0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-03-10 23:01:26 -05:00

chore: move session to top-level config option (#13241)

* chore: add heading for session

* move session to top-level config option

---------

Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
This commit is contained in:
Emanuele Stoppa 2025-02-13 14:04:38 +00:00 committed by GitHub
parent d79ee8cc27
commit 723c843971
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -554,6 +554,37 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
checkOrigin?: boolean;
};
/**
* @docs
* @kind heading
* @name session
* @type {SessionConfig}
* @version 5.3.0
* @description
*
* Configures experimental session support by specifying a storage `driver` as well as any associated `options`.
* You must enable the `experimental.session` flag to use this feature.
* Some adapters may provide a default session driver, but you can override it with your own configuration.
*
* You can specify [any driver from Unstorage](https://unstorage.unjs.io/drivers) or provide a custom config which will override your adapter's default.
*
* See [the experimental session guide](https://docs.astro.build/en/reference/experimental-flags/sessions/) for more information.
*
* ```js title="astro.config.mjs"
* {
* session: {
* // Required: the name of the Unstorage driver
* driver: 'redis',
* // The required options depend on the driver
* options: {
* url: process.env.REDIS_URL,
* },
* }
* }
* ```
*/
session?: SessionConfig<TSession>;
/**
* @docs
* @name vite
@ -1724,36 +1755,6 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
validateSecrets?: boolean;
};
/**
* @docs
* @name session
* @type {SessionConfig}
* @version 5.3.0
* @description
*
* Configures experimental session support by specifying a storage `driver` as well as any associated `options`.
* You must enable the `experimental.session` flag to use this feature.
* Some adapters may provide a default session driver, but you can override it with your own configuration.
*
* You can specify [any driver from Unstorage](https://unstorage.unjs.io/drivers) or provide a custom config which will override your adapter's default.
*
* See [the experimental session guide](https://docs.astro.build/en/reference/experimental-flags/sessions/) for more information.
*
* ```js title="astro.config.mjs"
* {
* session: {
* // Required: the name of the Unstorage driver
* driver: 'redis',
* // The required options depend on the driver
* options: {
* url: process.env.REDIS_URL,
* },
* }
* }
* ```
*/
session?: SessionConfig<TSession>;
/**
*
* @kind heading