Skip to content

Commit

Permalink
[ci] release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Aug 19, 2024
1 parent aae5d97 commit 3064bdc
Show file tree
Hide file tree
Showing 16 changed files with 89 additions and 69 deletions.
5 changes: 0 additions & 5 deletions .changeset/healthy-papayas-own.md

This file was deleted.

6 changes: 0 additions & 6 deletions .changeset/witty-sloths-greet.md

This file was deleted.

8 changes: 8 additions & 0 deletions examples/request-nanostores/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# @example/request-nanostores

## 0.0.2

### Patch Changes

- Updated dependencies [f84ff80]
- @inox-tools/request-nanostores@0.1.1
20 changes: 10 additions & 10 deletions examples/request-nanostores/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import node from '@astrojs/node';

// https://astro.build/config
export default defineConfig({
// Enable many frameworks to support all different kinds of components.
integrations: [preact(), requestNanostores()],
compressHTML: false,
output: 'server',
adapter: node({
mode: 'standalone',
}),
experimental: {
actions: true,
},
// Enable many frameworks to support all different kinds of components.
integrations: [preact(), requestNanostores()],
compressHTML: false,
output: 'server',
adapter: node({
mode: 'standalone',
}),
experimental: {
actions: true,
},
});
2 changes: 1 addition & 1 deletion examples/request-nanostores/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@example/request-nanostores",
"private": true,
"type": "module",
"version": "0.0.1",
"version": "0.0.2",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand Down
34 changes: 17 additions & 17 deletions examples/request-nanostores/src/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@ import { defineAction, z } from 'astro:actions';
import { CART_COOKIE_NAME, cookieOptions, extractCartCookie } from '../cookies';

export const server = {
setCartItem: defineAction({
input: z.object({
id: z.string(),
quantity: z.number(),
}),
handler: async (input, ctx) => {
const currentCookie = extractCartCookie(ctx.cookies);
setCartItem: defineAction({
input: z.object({
id: z.string(),
quantity: z.number(),
}),
handler: async (input, ctx) => {
const currentCookie = extractCartCookie(ctx.cookies);

const newCookie = {
...currentCookie,
[input.id]: {
id: input.id,
quantity: input.quantity,
},
};
const newCookie = {
...currentCookie,
[input.id]: {
id: input.id,
quantity: input.quantity,
},
};

ctx.cookies.set(CART_COOKIE_NAME, newCookie, cookieOptions(ctx.url));
},
}),
ctx.cookies.set(CART_COOKIE_NAME, newCookie, cookieOptions(ctx.url));
},
}),
};
16 changes: 8 additions & 8 deletions examples/request-nanostores/src/cartStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ export function addCartItem({ id, name, imageSrc }: CartItemDisplayInfo) {
const existingEntry = cartItems.get()[id];
const newEntry = existingEntry
? {
...existingEntry,
quantity: existingEntry.quantity + 1,
}
...existingEntry,
quantity: existingEntry.quantity + 1,
}
: {
id,
name,
imageSrc,
quantity: 1,
};
id,
name,
imageSrc,
quantity: 1,
};

cartItems.setKey(id, newEntry);

Expand Down
30 changes: 15 additions & 15 deletions examples/request-nanostores/src/cookies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ type CartCookie = Record<string, Pick<CartItem, 'id' | 'quantity'>>;
export const CART_COOKIE_NAME = 'cart';

export function cookieOptions(url: URL): AstroCookieSetOptions {
return {
path: '/',
domain: url.hostname,
httpOnly: true,
secure: url.protocol === 'https:',
sameSite: 'lax',
maxAge: 3600,
};
return {
path: '/',
domain: url.hostname,
httpOnly: true,
secure: url.protocol === 'https:',
sameSite: 'lax',
maxAge: 3600,
};
}

export function extractCartCookie(cookies: AstroCookies): CartCookie {
const cookie = cookies.get(CART_COOKIE_NAME);
if (!cookie) return {};
const cookie = cookies.get(CART_COOKIE_NAME);
if (!cookie) return {};

try {
return cookie.json();
} catch {
return {};
}
try {
return cookie.json();
} catch {
return {};
}
}
2 changes: 1 addition & 1 deletion examples/request-nanostores/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
"jsx": "react-jsx",
"jsxImportSource": "preact"
}
}
}
9 changes: 9 additions & 0 deletions examples/request-state/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @examples/astro-when

## 0.0.11

### Patch Changes

- Updated dependencies [aae5d97]
- Updated dependencies [f84ff80]
- @inox-tools/request-state@0.1.1
- @inox-tools/request-nanostores@0.1.1

## 0.0.10

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/request-state/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@example/request-state",
"private": true,
"type": "module",
"version": "0.0.10",
"version": "0.0.11",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand Down
9 changes: 9 additions & 0 deletions packages/request-nanostores/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @inox-tools/request-nanostores

## 0.1.1

### Patch Changes

- f84ff80: Fixes resolution of runtime modules when integration is a transitive dependency with a strict package manager.
- Updated dependencies [aae5d97]
- Updated dependencies [f84ff80]
- @inox-tools/request-state@0.1.1

## 0.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/request-nanostores/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@inox-tools/request-nanostores",
"version": "0.1.0",
"version": "0.1.1",
"description": "Make your Nanostores concurrent safe and shared from server to client",
"keywords": [
"astro-integration",
Expand Down
7 changes: 7 additions & 0 deletions packages/request-state/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @inox-tools/request-state

## 0.1.1

### Patch Changes

- aae5d97: Refactor client state injection to be fully compliant with Web APIs
- f84ff80: Fixes resolution of runtime modules when integration is a transitive dependency with a strict package manager.

## 0.1.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/request-state/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@inox-tools/request-state",
"version": "0.1.0",
"version": "0.1.1",
"description": "Shared request state between server and client",
"keywords": [
"astro-integration",
Expand Down
4 changes: 1 addition & 3 deletions packages/request-state/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
"$schema": "https://json.schemastore.org/tsconfig",
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"lib": [
"dom"
]
"lib": ["dom"]
}
}

0 comments on commit 3064bdc

Please sign in to comment.