astro 5.9.3 → 5.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -164,7 +164,7 @@ ${contentConfig.error.message}`);
164
164
  logger.info("Content config changed");
165
165
  shouldClear = true;
166
166
  }
167
- if (previousAstroVersion && previousAstroVersion !== "5.9.3") {
167
+ if (previousAstroVersion && previousAstroVersion !== "5.9.4") {
168
168
  logger.info("Astro version changed");
169
169
  shouldClear = true;
170
170
  }
@@ -172,8 +172,8 @@ ${contentConfig.error.message}`);
172
172
  logger.info("Clearing content store");
173
173
  this.#store.clearAll();
174
174
  }
175
- if ("5.9.3") {
176
- await this.#store.metaStore().set("astro-version", "5.9.3");
175
+ if ("5.9.4") {
176
+ await this.#store.metaStore().set("astro-version", "5.9.4");
177
177
  }
178
178
  if (currentConfigDigest) {
179
179
  await this.#store.metaStore().set("content-config-digest", currentConfigDigest);
@@ -659,7 +659,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
659
659
  })> | undefined;
660
660
  }>>>;
661
661
  session: z.ZodOptional<z.ZodObject<{
662
- driver: z.ZodString;
662
+ driver: z.ZodOptional<z.ZodString>;
663
663
  options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
664
664
  cookie: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodObject<{
665
665
  name: z.ZodOptional<z.ZodString>;
@@ -699,8 +699,8 @@ export declare const AstroConfigSchema: z.ZodObject<{
699
699
  }>>;
700
700
  ttl: z.ZodOptional<z.ZodNumber>;
701
701
  }, "strip", z.ZodTypeAny, {
702
- driver: string;
703
702
  options?: Record<string, any> | undefined;
703
+ driver?: string | undefined;
704
704
  cookie?: {
705
705
  name?: string | undefined;
706
706
  path?: string | undefined;
@@ -711,8 +711,8 @@ export declare const AstroConfigSchema: z.ZodObject<{
711
711
  } | undefined;
712
712
  ttl?: number | undefined;
713
713
  }, {
714
- driver: string;
715
714
  options?: Record<string, any> | undefined;
715
+ driver?: string | undefined;
716
716
  cookie?: string | {
717
717
  name?: string | undefined;
718
718
  path?: string | undefined;
@@ -1342,8 +1342,8 @@ export declare const AstroConfigSchema: z.ZodObject<{
1342
1342
  collections: boolean;
1343
1343
  };
1344
1344
  session?: {
1345
- driver: string;
1346
1345
  options?: Record<string, any> | undefined;
1346
+ driver?: string | undefined;
1347
1347
  cookie?: {
1348
1348
  name?: string | undefined;
1349
1349
  path?: string | undefined;
@@ -1421,8 +1421,8 @@ export declare const AstroConfigSchema: z.ZodObject<{
1421
1421
  destination: string;
1422
1422
  }> | undefined;
1423
1423
  session?: {
1424
- driver: string;
1425
1424
  options?: Record<string, any> | undefined;
1425
+ driver?: string | undefined;
1426
1426
  cookie?: string | {
1427
1427
  name?: string | undefined;
1428
1428
  path?: string | undefined;
@@ -244,7 +244,7 @@ const AstroConfigSchema = z.object({
244
244
  validateSecrets: z.boolean().optional().default(ASTRO_CONFIG_DEFAULTS.env.validateSecrets)
245
245
  }).strict().optional().default(ASTRO_CONFIG_DEFAULTS.env),
246
246
  session: z.object({
247
- driver: z.string(),
247
+ driver: z.string().optional(),
248
248
  options: z.record(z.any()).optional(),
249
249
  cookie: z.object({
250
250
  name: z.string().optional(),
@@ -582,7 +582,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
582
582
  })> | undefined;
583
583
  }>>>;
584
584
  session: z.ZodOptional<z.ZodObject<{
585
- driver: z.ZodString;
585
+ driver: z.ZodOptional<z.ZodString>;
586
586
  options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
587
587
  cookie: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodObject<{
588
588
  name: z.ZodOptional<z.ZodString>;
@@ -622,8 +622,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
622
622
  }>>;
623
623
  ttl: z.ZodOptional<z.ZodNumber>;
624
624
  }, "strip", z.ZodTypeAny, {
625
- driver: string;
626
625
  options?: Record<string, any> | undefined;
626
+ driver?: string | undefined;
627
627
  cookie?: {
628
628
  name?: string | undefined;
629
629
  path?: string | undefined;
@@ -634,8 +634,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
634
634
  } | undefined;
635
635
  ttl?: number | undefined;
636
636
  }, {
637
- driver: string;
638
637
  options?: Record<string, any> | undefined;
638
+ driver?: string | undefined;
639
639
  cookie?: string | {
640
640
  name?: string | undefined;
641
641
  path?: string | undefined;
@@ -1343,8 +1343,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1343
1343
  collections: boolean;
1344
1344
  };
1345
1345
  session?: {
1346
- driver: string;
1347
1346
  options?: Record<string, any> | undefined;
1347
+ driver?: string | undefined;
1348
1348
  cookie?: {
1349
1349
  name?: string | undefined;
1350
1350
  path?: string | undefined;
@@ -1422,8 +1422,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1422
1422
  destination: string;
1423
1423
  }> | undefined;
1424
1424
  session?: {
1425
- driver: string;
1426
1425
  options?: Record<string, any> | undefined;
1426
+ driver?: string | undefined;
1427
1427
  cookie?: string | {
1428
1428
  name?: string | undefined;
1429
1429
  path?: string | undefined;
@@ -1827,8 +1827,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1827
1827
  collections: boolean;
1828
1828
  };
1829
1829
  session?: {
1830
- driver: string;
1831
1830
  options?: Record<string, any> | undefined;
1831
+ driver?: string | undefined;
1832
1832
  cookie?: {
1833
1833
  name?: string | undefined;
1834
1834
  path?: string | undefined;
@@ -1906,8 +1906,8 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
1906
1906
  destination: string;
1907
1907
  }> | undefined;
1908
1908
  session?: {
1909
- driver: string;
1910
1909
  options?: Record<string, any> | undefined;
1910
+ driver?: string | undefined;
1911
1911
  cookie?: string | {
1912
1912
  name?: string | undefined;
1913
1913
  path?: string | undefined;
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "5.9.3";
1
+ const ASTRO_VERSION = "5.9.4";
2
2
  const REROUTE_DIRECTIVE_HEADER = "X-Astro-Reroute";
3
3
  const REWRITE_DIRECTIVE_HEADER_KEY = "X-Astro-Rewrite";
4
4
  const REWRITE_DIRECTIVE_HEADER_VALUE = "yes";
@@ -22,7 +22,7 @@ async function dev(inlineConfig) {
22
22
  await telemetry.record([]);
23
23
  const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
24
24
  const logger = restart.container.logger;
25
- const currentVersion = "5.9.3";
25
+ const currentVersion = "5.9.4";
26
26
  const isPrerelease = currentVersion.includes("-");
27
27
  if (!isPrerelease) {
28
28
  try {
@@ -37,7 +37,7 @@ function serverStart({
37
37
  host,
38
38
  base
39
39
  }) {
40
- const version = "5.9.3";
40
+ const version = "5.9.4";
41
41
  const localPrefix = `${dim("\u2503")} Local `;
42
42
  const networkPrefix = `${dim("\u2503")} Network `;
43
43
  const emptyPrefix = " ".repeat(11);
@@ -274,7 +274,7 @@ function printHelp({
274
274
  message.push(
275
275
  linebreak(),
276
276
  ` ${bgGreen(black(` ${commandName} `))} ${green(
277
- `v${"5.9.3"}`
277
+ `v${"5.9.4"}`
278
278
  )} ${headline}`
279
279
  );
280
280
  }
@@ -3,7 +3,7 @@ import type { AstroCookies } from './cookies/cookies.js';
3
3
  export declare const PERSIST_SYMBOL: unique symbol;
4
4
  export declare class AstroSession<TDriver extends SessionDriverName = any> {
5
5
  #private;
6
- constructor(cookies: AstroCookies, { cookie: cookieConfig, ...config }: Exclude<ResolvedSessionConfig<TDriver>, undefined>, runtimeMode?: RuntimeMode);
6
+ constructor(cookies: AstroCookies, { cookie: cookieConfig, ...config }: NonNullable<ResolvedSessionConfig<TDriver>>, runtimeMode?: RuntimeMode);
7
7
  /**
8
8
  * Gets a session value. Returns `undefined` if the session or value does not exist.
9
9
  */
@@ -52,6 +52,15 @@ class AstroSession {
52
52
  cookie: cookieConfig = DEFAULT_COOKIE_NAME,
53
53
  ...config
54
54
  }, runtimeMode) {
55
+ const { driver } = config;
56
+ if (!driver) {
57
+ throw new AstroError({
58
+ ...SessionStorageInitError,
59
+ message: SessionStorageInitError.message(
60
+ "No driver was defined in the session configuration and the adapter did not provide a default driver."
61
+ )
62
+ });
63
+ }
55
64
  this.#cookies = cookies;
56
65
  let cookieConfigObject;
57
66
  if (typeof cookieConfig === "object") {
@@ -68,7 +77,7 @@ class AstroSession {
68
77
  ...cookieConfigObject,
69
78
  httpOnly: true
70
79
  };
71
- this.#config = config;
80
+ this.#config = { ...config, driver };
72
81
  }
73
82
  /**
74
83
  * Gets a session value. Returns `undefined` if the session or value does not exist.
@@ -335,14 +344,6 @@ class AstroSession {
335
344
  this.#config.driver = "fs-lite";
336
345
  this.#config.options.base ??= ".astro/session";
337
346
  }
338
- if (!this.#config?.driver) {
339
- throw new AstroError({
340
- ...SessionStorageInitError,
341
- message: SessionStorageInitError.message(
342
- "No driver was defined in the session configuration and the adapter did not provide a default driver."
343
- )
344
- });
345
- }
346
347
  let driver = null;
347
348
  try {
348
349
  if (this.#config.driverModule) {
@@ -25,7 +25,7 @@ function renderCspContent(result) {
25
25
  if (result.styleResources.length > 0) {
26
26
  styleResources = result.styleResources.map((r) => `${r}`).join(" ");
27
27
  }
28
- const strictDynamic = result.isStrictDynamic ? ` strict-dynamic` : "";
28
+ const strictDynamic = result.isStrictDynamic ? ` 'strict-dynamic'` : "";
29
29
  const scriptSrc = `script-src ${scriptResources} ${Array.from(finalScriptHashes).join(" ")}${strictDynamic};`;
30
30
  const styleSrc = `style-src ${styleResources} ${Array.from(finalStyleHashes).join(" ")};`;
31
31
  return `${directives} ${scriptSrc} ${styleSrc}`;
@@ -123,7 +123,7 @@ interface BuiltinSessionConfig<TDriver extends keyof BuiltinDriverOptions> exten
123
123
  }
124
124
  interface CustomSessionConfig extends CommonSessionConfig {
125
125
  /** Entrypoint for a custom session driver */
126
- driver: string;
126
+ driver?: string;
127
127
  options?: Record<string, unknown>;
128
128
  }
129
129
  interface TestSessionConfig extends CommonSessionConfig {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "5.9.3",
3
+ "version": "5.9.4",
4
4
  "description": "Astro is a modern site builder with web best practices, performance, and DX front-of-mind.",
5
5
  "type": "module",
6
6
  "author": "withastro",
@@ -157,8 +157,8 @@
157
157
  "zod-to-json-schema": "^3.24.5",
158
158
  "zod-to-ts": "^1.2.0",
159
159
  "@astrojs/internal-helpers": "0.6.1",
160
- "@astrojs/telemetry": "3.3.0",
161
- "@astrojs/markdown-remark": "6.3.2"
160
+ "@astrojs/markdown-remark": "6.3.2",
161
+ "@astrojs/telemetry": "3.3.0"
162
162
  },
163
163
  "optionalDependencies": {
164
164
  "sharp": "^0.33.3"