Skip to content

Commit 1ec5b44

Browse files
authored
chore(deps): update unstorage and use new syntax (#12783)
1 parent 45c3f33 commit 1ec5b44

File tree

5 files changed

+51
-24
lines changed

5 files changed

+51
-24
lines changed

.changeset/poor-mangos-fold.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ If you are using the Node.js adapter, you can use the `fs` driver to store sessi
2525
adapter: node({ mode: 'standalone' }),
2626
experimental: {
2727
session: {
28-
// Required: the name of the Unstorage driver
28+
// Required: the name of the unstorage driver
2929
driver: "fs",
3030
},
3131
},
3232
}
3333
```
34-
If you are deploying to a serverless environment, you can use drivers such as `redis` or `netlifyBlobs` or `cloudflareKV` and optionally pass additional configuration options.
34+
If you are deploying to a serverless environment, you can use drivers such as `redis`, `netlify-blobs`, `vercel-kv`, or `cloudflare-kv-binding` and optionally pass additional configuration options.
3535

3636
For more information, including using the session API with other adapters and a full list of supported drivers, see [the docs for experimental session support](https://docs.astro.build/en/reference/experimental-flags/sessions/). For even more details, and to leave feedback and participate in the development of this feature, [the Sessions RFC](https://github.com/withastro/roadmap/pull/1055).

packages/astro/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
"tsconfck": "^3.1.4",
167167
"ultrahtml": "^1.5.3",
168168
"unist-util-visit": "^5.0.0",
169-
"unstorage": "^1.12.0",
169+
"unstorage": "^1.14.0",
170170
"vfile": "^6.0.3",
171171
"vite": "^6.0.1",
172172
"vitefu": "^1.0.4",

packages/astro/src/core/session.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,13 @@ export class AstroSession<TDriver extends SessionDriverName = any> {
372372

373373
if (this.#config.driver === 'test') {
374374
this.#storage = (this.#config as SessionConfig<'test'>).options.mockStorage;
375-
return this.#storage;
375+
return this.#storage!;
376376
}
377-
// Use fsLite rather than fs, because fs can't be bundled. Add a default base path if not provided.
378-
if (this.#config.driver === 'fs' || this.#config.driver === 'fsLite') {
377+
// Use fs-lite rather than fs, because fs can't be bundled. Add a default base path if not provided.
378+
if (this.#config.driver === 'fs' || this.#config.driver === 'fsLite' || this.#config.driver === 'fs-lite') {
379379
this.#config.options ??= {};
380-
this.#config.driver = 'fsLite';
381-
(this.#config.options as BuiltinDriverOptions['fsLite']).base ??= '.astro/session';
380+
this.#config.driver = 'fs-lite';
381+
(this.#config.options as BuiltinDriverOptions['fs-lite']).base ??= '.astro/session';
382382
}
383383

384384
if (!this.#config?.driver) {

packages/astro/test/fixtures/sessions/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"dependencies": {
6+
"@netlify/blobs": "^8.1.0",
67
"astro": "workspace:*"
78
}
89
}

pnpm-lock.yaml

Lines changed: 42 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)