astro 2.5.3 → 2.5.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.
package/client-base.d.ts CHANGED
@@ -1,5 +1,32 @@
1
1
  /// <reference path="./import-meta.d.ts" />
2
2
 
3
+ // eslint-disable-next-line @typescript-eslint/no-namespace
4
+ declare namespace App {
5
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
6
+ export interface Locals {}
7
+ }
8
+
9
+ interface ImportMetaEnv {
10
+ /**
11
+ * The prefix for Astro-generated asset links if the build.assetsPrefix config option is set. This can be used to create asset links not handled by Astro.
12
+ */
13
+ readonly ASSETS_PREFIX: string;
14
+ /**
15
+ * This is set to the site option specified in your project’s Astro config file.
16
+ */
17
+ readonly SITE: string;
18
+ }
19
+
20
+ interface ImportMeta {
21
+ /**
22
+ * Astro and Vite expose environment variables through `import.meta.env`. For a complete list of the environment variables available, see the two references below.
23
+ *
24
+ * - [Astro reference](https://docs.astro.build/en/guides/environment-variables/#default-environment-variables)
25
+ * - [Vite reference](https://vitejs.dev/guide/env-and-mode.html#env-variables)
26
+ */
27
+ readonly env: ImportMetaEnv;
28
+ }
29
+
3
30
  declare module 'astro:assets' {
4
31
  // Exporting things one by one is a bit cumbersome, not sure if there's a better way - erika, 2023-02-03
5
32
  type AstroAssets = {
@@ -387,9 +414,3 @@ declare module '*?inline' {
387
414
  const src: string;
388
415
  export default src;
389
416
  }
390
-
391
- // eslint-disable-next-line @typescript-eslint/no-namespace
392
- declare namespace App {
393
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
394
- export interface Locals {}
395
- }
package/client-image.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  // TODO: Merge this file with `client-base.d.ts` in 3.0, when the `astro:assets` feature isn't under a flag anymore.
4
4
 
5
- type InputFormat = import('./dist/assets/types.js').InputFormat;
5
+ type InputFormat = import('./dist/assets/types.js').ImageInputFormat;
6
6
 
7
7
  interface ImageMetadata {
8
8
  src: string;
package/client.d.ts CHANGED
@@ -21,10 +21,6 @@ declare module '*.svg' {
21
21
  const src: string;
22
22
  export default src;
23
23
  }
24
- declare module '*.ico' {
25
- const src: string;
26
- export default src;
27
- }
28
24
  declare module '*.webp' {
29
25
  const src: string;
30
26
  export default src;
@@ -2,6 +2,7 @@ import glob from "fast-glob";
2
2
  import fsMod from "node:fs";
3
3
  import { extname } from "node:path";
4
4
  import { fileURLToPath, pathToFileURL } from "node:url";
5
+ import pLimit from "p-limit";
5
6
  import { AstroError, AstroErrorData } from "../core/errors/index.js";
6
7
  import { rootRelativePath } from "../core/util.js";
7
8
  import { VIRTUAL_MODULE_ID } from "./consts.js";
@@ -83,57 +84,62 @@ async function getStringifiedLookupMap({
83
84
  }
84
85
  }
85
86
  );
86
- await Promise.all(
87
- contentGlob.map(async (filePath) => {
88
- var _a, _b, _c;
89
- const entryType = getEntryType(filePath, contentPaths, contentEntryExts, dataEntryExts);
90
- if (entryType !== "content" && entryType !== "data")
91
- return;
92
- const collection = getEntryCollectionName({ contentDir, entry: pathToFileURL(filePath) });
93
- if (!collection)
94
- throw UnexpectedLookupMapError;
95
- if (((_a = lookupMap[collection]) == null ? void 0 : _a.type) && lookupMap[collection].type !== entryType) {
96
- throw new AstroError({
97
- ...AstroErrorData.MixedContentDataCollectionError,
98
- message: AstroErrorData.MixedContentDataCollectionError.message(collection)
99
- });
100
- }
101
- if (entryType === "content") {
102
- const contentEntryType = contentEntryConfigByExt.get(extname(filePath));
103
- if (!contentEntryType)
87
+ const limit = pLimit(10);
88
+ const promises = [];
89
+ for (const filePath of contentGlob) {
90
+ promises.push(
91
+ limit(async () => {
92
+ var _a, _b, _c;
93
+ const entryType = getEntryType(filePath, contentPaths, contentEntryExts, dataEntryExts);
94
+ if (entryType !== "content" && entryType !== "data")
95
+ return;
96
+ const collection = getEntryCollectionName({ contentDir, entry: pathToFileURL(filePath) });
97
+ if (!collection)
104
98
  throw UnexpectedLookupMapError;
105
- const { id, slug: generatedSlug } = await getContentEntryIdAndSlug({
106
- entry: pathToFileURL(filePath),
107
- contentDir,
108
- collection
109
- });
110
- const slug = await getEntrySlug({
111
- id,
112
- collection,
113
- generatedSlug,
114
- fs,
115
- fileUrl: pathToFileURL(filePath),
116
- contentEntryType
117
- });
118
- lookupMap[collection] = {
119
- type: "content",
120
- entries: {
121
- ...(_b = lookupMap[collection]) == null ? void 0 : _b.entries,
122
- [slug]: rootRelativePath(root, filePath)
123
- }
124
- };
125
- } else {
126
- const id = getDataEntryId({ entry: pathToFileURL(filePath), contentDir, collection });
127
- lookupMap[collection] = {
128
- type: "data",
129
- entries: {
130
- ...(_c = lookupMap[collection]) == null ? void 0 : _c.entries,
131
- [id]: rootRelativePath(root, filePath)
132
- }
133
- };
134
- }
135
- })
136
- );
99
+ if (((_a = lookupMap[collection]) == null ? void 0 : _a.type) && lookupMap[collection].type !== entryType) {
100
+ throw new AstroError({
101
+ ...AstroErrorData.MixedContentDataCollectionError,
102
+ message: AstroErrorData.MixedContentDataCollectionError.message(collection)
103
+ });
104
+ }
105
+ if (entryType === "content") {
106
+ const contentEntryType = contentEntryConfigByExt.get(extname(filePath));
107
+ if (!contentEntryType)
108
+ throw UnexpectedLookupMapError;
109
+ const { id, slug: generatedSlug } = await getContentEntryIdAndSlug({
110
+ entry: pathToFileURL(filePath),
111
+ contentDir,
112
+ collection
113
+ });
114
+ const slug = await getEntrySlug({
115
+ id,
116
+ collection,
117
+ generatedSlug,
118
+ fs,
119
+ fileUrl: pathToFileURL(filePath),
120
+ contentEntryType
121
+ });
122
+ lookupMap[collection] = {
123
+ type: "content",
124
+ entries: {
125
+ ...(_b = lookupMap[collection]) == null ? void 0 : _b.entries,
126
+ [slug]: rootRelativePath(root, filePath)
127
+ }
128
+ };
129
+ } else {
130
+ const id = getDataEntryId({ entry: pathToFileURL(filePath), contentDir, collection });
131
+ lookupMap[collection] = {
132
+ type: "data",
133
+ entries: {
134
+ ...(_c = lookupMap[collection]) == null ? void 0 : _c.entries,
135
+ [id]: rootRelativePath(root, filePath)
136
+ }
137
+ };
138
+ }
139
+ })
140
+ );
141
+ }
142
+ await Promise.all(promises);
137
143
  return JSON.stringify(lookupMap);
138
144
  }
139
145
  const UnexpectedLookupMapError = new AstroError({
@@ -9,12 +9,14 @@ import { pluginInternals } from "./plugin-internals.js";
9
9
  import { pluginMiddleware } from "./plugin-middleware.js";
10
10
  import { pluginPages } from "./plugin-pages.js";
11
11
  import { pluginPrerender } from "./plugin-prerender.js";
12
+ import { pluginRenderers } from "./plugin-renderers.js";
12
13
  import { pluginSSR } from "./plugin-ssr.js";
13
14
  function registerAllPlugins({ internals, options, register }) {
14
15
  register(pluginComponentEntry(internals));
15
16
  register(pluginAliasResolve(internals));
16
17
  register(pluginAnalyzer(internals));
17
18
  register(pluginInternals(internals));
19
+ register(pluginRenderers(options, internals));
18
20
  register(pluginMiddleware(options, internals));
19
21
  register(pluginPages(options, internals));
20
22
  register(pluginCSS(options, internals));
@@ -2,6 +2,7 @@ import { pagesVirtualModuleId, resolvedPagesVirtualModuleId } from "../../app/in
2
2
  import { addRollupInput } from "../add-rollup-input.js";
3
3
  import { eachPageData } from "../internal.js";
4
4
  import { MIDDLEWARE_MODULE_ID } from "./plugin-middleware.js";
5
+ import { RENDERERS_MODULE_ID } from "./plugin-renderers.js";
5
6
  function vitePluginPages(opts, internals) {
6
7
  return {
7
8
  name: "@astro/plugin-build-pages",
@@ -18,8 +19,12 @@ function vitePluginPages(opts, internals) {
18
19
  async load(id) {
19
20
  if (id === resolvedPagesVirtualModuleId) {
20
21
  let importMap = "";
21
- let imports = [];
22
+ const imports = [];
23
+ const exports = [];
24
+ const content = [];
22
25
  let i = 0;
26
+ imports.push(`import { renderers } from "${RENDERERS_MODULE_ID}";`);
27
+ exports.push(`export { renderers };`);
23
28
  for (const pageData of eachPageData(internals)) {
24
29
  const variable = `_page${i}`;
25
30
  imports.push(
@@ -28,23 +33,12 @@ function vitePluginPages(opts, internals) {
28
33
  importMap += `[${JSON.stringify(pageData.component)}, ${variable}],`;
29
34
  i++;
30
35
  }
31
- i = 0;
32
- let rendererItems = "";
33
- for (const renderer of opts.settings.renderers) {
34
- const variable = `_renderer${i}`;
35
- imports.unshift(`import ${variable} from '${renderer.serverEntrypoint}';`);
36
- rendererItems += `Object.assign(${JSON.stringify(renderer)}, { ssr: ${variable} }),`;
37
- i++;
36
+ if (opts.settings.config.experimental.middleware) {
37
+ imports.push(`import * as _middleware from "${MIDDLEWARE_MODULE_ID}";`);
38
+ exports.push(`export const middleware = _middleware;`);
38
39
  }
39
- const def = `${imports.join("\n")}
40
-
41
- ${opts.settings.config.experimental.middleware ? `import * as _middleware from "${MIDDLEWARE_MODULE_ID}";` : ""}
42
-
43
- export const pageMap = new Map([${importMap}]);
44
- export const renderers = [${rendererItems}];
45
- ${opts.settings.config.experimental.middleware ? `export const middleware = _middleware;` : ""}
46
- `;
47
- return def;
40
+ content.push(`export const pageMap = new Map([${importMap}]);`);
41
+ return `${imports.join("\n")}${content.join("\n")}${exports.join("\n")}`;
48
42
  }
49
43
  }
50
44
  };
@@ -0,0 +1,8 @@
1
+ import type { Plugin as VitePlugin } from 'vite';
2
+ import type { BuildInternals } from '../internal.js';
3
+ import type { AstroBuildPlugin } from '../plugin';
4
+ import type { StaticBuildOptions } from '../types';
5
+ export declare const RENDERERS_MODULE_ID = "@astro-renderers";
6
+ export declare const RESOLVED_RENDERERS_MODULE_ID: string;
7
+ export declare function vitePluginRenderers(opts: StaticBuildOptions, _internals: BuildInternals): VitePlugin;
8
+ export declare function pluginRenderers(opts: StaticBuildOptions, internals: BuildInternals): AstroBuildPlugin;
@@ -0,0 +1,54 @@
1
+ import { addRollupInput } from "../add-rollup-input.js";
2
+ const RENDERERS_MODULE_ID = "@astro-renderers";
3
+ const RESOLVED_RENDERERS_MODULE_ID = `\0${RENDERERS_MODULE_ID}`;
4
+ let inputs = /* @__PURE__ */ new Set();
5
+ function vitePluginRenderers(opts, _internals) {
6
+ return {
7
+ name: "@astro/plugin-renderers",
8
+ options(options) {
9
+ return addRollupInput(options, [RENDERERS_MODULE_ID]);
10
+ },
11
+ resolveId(id) {
12
+ if (id === RENDERERS_MODULE_ID) {
13
+ return RESOLVED_RENDERERS_MODULE_ID;
14
+ }
15
+ },
16
+ async load(id) {
17
+ if (id === RESOLVED_RENDERERS_MODULE_ID) {
18
+ if (opts.settings.renderers.length > 0) {
19
+ const imports = [];
20
+ const exports = [];
21
+ let i = 0;
22
+ let rendererItems = "";
23
+ for (const renderer of opts.settings.renderers) {
24
+ const variable = `_renderer${i}`;
25
+ imports.push(`import ${variable} from '${renderer.serverEntrypoint}';`);
26
+ rendererItems += `Object.assign(${JSON.stringify(renderer)}, { ssr: ${variable} }),`;
27
+ i++;
28
+ }
29
+ exports.push(`export const renderers = [${rendererItems}];`);
30
+ return `${imports.join("\n")}
31
+ ${exports.join("\n")}`;
32
+ }
33
+ }
34
+ }
35
+ };
36
+ }
37
+ function pluginRenderers(opts, internals) {
38
+ return {
39
+ build: "ssr",
40
+ hooks: {
41
+ "build:before": () => {
42
+ return {
43
+ vitePlugin: vitePluginRenderers(opts, internals)
44
+ };
45
+ }
46
+ }
47
+ };
48
+ }
49
+ export {
50
+ RENDERERS_MODULE_ID,
51
+ RESOLVED_RENDERERS_MODULE_ID,
52
+ pluginRenderers,
53
+ vitePluginRenderers
54
+ };
@@ -9,6 +9,7 @@ import { serializeRouteData } from "../../routing/index.js";
9
9
  import { addRollupInput } from "../add-rollup-input.js";
10
10
  import { getOutFile, getOutFolder } from "../common.js";
11
11
  import { cssOrder, mergeInlineCss } from "../internal.js";
12
+ import { RENDERERS_MODULE_ID } from "./plugin-renderers.js";
12
13
  const virtualModuleId = "@astrojs-ssr-virtual-entry";
13
14
  const resolvedVirtualModuleId = "\0" + virtualModuleId;
14
15
  const manifestReplace = "@@ASTRO_MANIFEST_REPLACE@@";
@@ -33,6 +34,7 @@ function vitePluginSSR(internals, adapter, config) {
33
34
  middleware = "middleware: _main.middleware";
34
35
  }
35
36
  return `import * as adapter from '${adapter.serverEntrypoint}';
37
+ import { renderers } from '${RENDERERS_MODULE_ID}';
36
38
  import * as _main from '${pagesVirtualModuleId}';
37
39
  import { deserializeManifest as _deserializeManifest } from 'astro/app';
38
40
  import { _privateSetManifestDontUseThis } from 'astro:ssr-manifest';
@@ -25,6 +25,7 @@ import { trackPageData } from "./internal.js";
25
25
  import { createPluginContainer } from "./plugin.js";
26
26
  import { registerAllPlugins } from "./plugins/index.js";
27
27
  import { RESOLVED_MIDDLEWARE_MODULE_ID } from "./plugins/plugin-middleware.js";
28
+ import { RESOLVED_RENDERERS_MODULE_ID } from "./plugins/plugin-renderers.js";
28
29
  import { getTimeStat } from "./util.js";
29
30
  async function viteBuild(opts) {
30
31
  var _a, _b, _c;
@@ -132,6 +133,8 @@ async function ssrBuild(opts, internals, input, container) {
132
133
  return opts.buildConfig.serverEntry;
133
134
  } else if (chunkInfo.facadeModuleId === RESOLVED_MIDDLEWARE_MODULE_ID) {
134
135
  return "middleware.mjs";
136
+ } else if (chunkInfo.facadeModuleId === RESOLVED_RENDERERS_MODULE_ID) {
137
+ return "renderers.mjs";
135
138
  } else {
136
139
  return "[name].mjs";
137
140
  }
@@ -3,7 +3,7 @@ import * as vite from "vite";
3
3
  import loadFallbackPlugin from "../../vite-plugin-load-fallback/index.js";
4
4
  async function createViteLoader(root, fs) {
5
5
  const viteServer = await vite.createServer({
6
- server: { middlewareMode: true, hmr: false },
6
+ server: { middlewareMode: true, hmr: false, watch: { ignored: ["**"] } },
7
7
  optimizeDeps: { disabled: true },
8
8
  clearScreen: false,
9
9
  appType: "custom",
@@ -1,4 +1,4 @@
1
- const ASTRO_VERSION = "2.5.3";
1
+ const ASTRO_VERSION = "2.5.4";
2
2
  const SUPPORTED_MARKDOWN_FILE_EXTENSIONS = [
3
3
  ".markdown",
4
4
  ".mdown",
@@ -53,7 +53,7 @@ async function dev(settings, options) {
53
53
  isRestart: options.isRestart
54
54
  })
55
55
  );
56
- const currentVersion = "2.5.3";
56
+ const currentVersion = "2.5.4";
57
57
  if (currentVersion.includes("-")) {
58
58
  warn(options.logging, null, msg.prerelease({ currentVersion }));
59
59
  }
@@ -5,7 +5,6 @@ import { AstroCookies, attachToResponse } from "../cookies/index.js";
5
5
  import { AstroError, AstroErrorData } from "../errors/index.js";
6
6
  import { warn } from "../logger/core.js";
7
7
  import { callMiddleware } from "../middleware/callMiddleware.js";
8
- import { isValueSerializable } from "../render/core.js";
9
8
  const clientAddressSymbol = Symbol.for("astro.clientAddress");
10
9
  const clientLocalsSymbol = Symbol.for("astro.locals");
11
10
  function createAPIContext({
@@ -76,12 +75,6 @@ async function callEndpoint(mod, env, ctx, logging, middleware) {
76
75
  onRequest,
77
76
  context,
78
77
  async () => {
79
- if (env.mode === "development" && !isValueSerializable(context.locals)) {
80
- throw new AstroError({
81
- ...AstroErrorData.LocalsNotSerializable,
82
- message: AstroErrorData.LocalsNotSerializable.message(ctx.pathname)
83
- });
84
- }
85
78
  return await renderEndpoint(mod, context, env.ssr);
86
79
  }
87
80
  );
@@ -613,29 +613,6 @@ export declare const AstroErrorData: {
613
613
  readonly message: "`locals` can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.";
614
614
  readonly hint: "If you tried to remove some information from the `locals` object, try to use `delete` or set the property to `undefined`.";
615
615
  };
616
- /**
617
- * @docs
618
- * @description
619
- * Thrown in development mode when a user attempts to store something that is not serializable in `locals`.
620
- *
621
- * For example:
622
- * ```ts
623
- * import {defineMiddleware} from "astro/middleware";
624
- * export const onRequest = defineMiddleware((context, next) => {
625
- * context.locals = {
626
- * foo() {
627
- * alert("Hello world!")
628
- * }
629
- * };
630
- * return next();
631
- * });
632
- * ```
633
- */
634
- readonly LocalsNotSerializable: {
635
- readonly title: "`Astro.locals` is not serializable";
636
- readonly code: 3034;
637
- readonly message: (href: string) => string;
638
- };
639
616
  /**
640
617
  * @docs
641
618
  * @see
@@ -627,32 +627,6 @@ Expected \`${defaultExpectedValue}\` value but got \`${suffix}\`.`;
627
627
  message: "`locals` can only be assigned to an object. Other values like numbers, strings, etc. are not accepted.",
628
628
  hint: "If you tried to remove some information from the `locals` object, try to use `delete` or set the property to `undefined`."
629
629
  },
630
- /**
631
- * @docs
632
- * @description
633
- * Thrown in development mode when a user attempts to store something that is not serializable in `locals`.
634
- *
635
- * For example:
636
- * ```ts
637
- * import {defineMiddleware} from "astro/middleware";
638
- * export const onRequest = defineMiddleware((context, next) => {
639
- * context.locals = {
640
- * foo() {
641
- * alert("Hello world!")
642
- * }
643
- * };
644
- * return next();
645
- * });
646
- * ```
647
- */
648
- LocalsNotSerializable: {
649
- title: "`Astro.locals` is not serializable",
650
- code: 3034,
651
- message: (href) => {
652
- return `The information stored in \`Astro.locals\` for the path "${href}" is not serializable.
653
- Make sure you store only serializable data.`;
654
- }
655
- },
656
630
  // No headings here, that way Vite errors are merged with Astro ones in the docs, which makes more sense to users.
657
631
  // Vite Errors - 4xxx
658
632
  /**
@@ -47,7 +47,7 @@ function serverStart({
47
47
  base,
48
48
  isRestart = false
49
49
  }) {
50
- const version = "2.5.3";
50
+ const version = "2.5.4";
51
51
  const localPrefix = `${dim("\u2503")} Local `;
52
52
  const networkPrefix = `${dim("\u2503")} Network `;
53
53
  const emptyPrefix = " ".repeat(11);
@@ -233,7 +233,7 @@ function printHelp({
233
233
  message.push(
234
234
  linebreak(),
235
235
  ` ${bgGreen(black(` ${commandName} `))} ${green(
236
- `v${"2.5.3"}`
236
+ `v${"2.5.4"}`
237
237
  )} ${headline}`
238
238
  );
239
239
  }
@@ -27,13 +27,4 @@ export type RenderPage = {
27
27
  apiContext?: APIContext;
28
28
  };
29
29
  export declare function renderPage({ mod, renderContext, env, apiContext }: RenderPage): Promise<Response>;
30
- /**
31
- * Checks whether any value can is serializable.
32
- *
33
- * A serializable value contains plain values. For example, `Proxy`, `Set`, `Map`, functions, etc.
34
- * are not serializable objects.
35
- *
36
- * @param object
37
- */
38
- export declare function isValueSerializable(value: unknown): boolean;
39
30
  export {};
@@ -65,16 +65,7 @@ async function renderPage({ mod, renderContext, env, apiContext }) {
65
65
  const Component = mod.default;
66
66
  if (!Component)
67
67
  throw new Error(`Expected an exported Astro component but received typeof ${typeof Component}`);
68
- let locals = {};
69
- if (apiContext) {
70
- if (env.mode === "development" && !isValueSerializable(apiContext.locals)) {
71
- throw new AstroError({
72
- ...AstroErrorData.LocalsNotSerializable,
73
- message: AstroErrorData.LocalsNotSerializable.message(renderContext.pathname)
74
- });
75
- }
76
- locals = apiContext.locals;
77
- }
68
+ let locals = (apiContext == null ? void 0 : apiContext.locals) ?? {};
78
69
  const result = createResult({
79
70
  adapterName: env.adapterName,
80
71
  links: renderContext.links,
@@ -113,38 +104,9 @@ async function renderPage({ mod, renderContext, env, apiContext }) {
113
104
  }
114
105
  return response;
115
106
  }
116
- function isValueSerializable(value) {
117
- let type = typeof value;
118
- let plainObject = true;
119
- if (type === "object" && isPlainObject(value)) {
120
- for (const [, nestedValue] of Object.entries(value)) {
121
- if (!isValueSerializable(nestedValue)) {
122
- plainObject = false;
123
- break;
124
- }
125
- }
126
- } else {
127
- plainObject = false;
128
- }
129
- let result = value === null || type === "string" || type === "number" || type === "boolean" || Array.isArray(value) || plainObject;
130
- return result;
131
- }
132
- function isPlainObject(value) {
133
- if (typeof value !== "object" || value === null)
134
- return false;
135
- let proto = Object.getPrototypeOf(value);
136
- if (proto === null)
137
- return true;
138
- let baseProto = proto;
139
- while (Object.getPrototypeOf(baseProto) !== null) {
140
- baseProto = Object.getPrototypeOf(baseProto);
141
- }
142
- return proto === baseProto;
143
- }
144
107
  export {
145
108
  GetParamsAndPropsError,
146
109
  getParamsAndProps,
147
110
  getParamsAndPropsOrThrow,
148
- isValueSerializable,
149
111
  renderPage
150
112
  };
@@ -34,7 +34,7 @@ async function sync(settings, { logging, fs }) {
34
34
  const tempViteServer = await createServer(
35
35
  await createVite(
36
36
  {
37
- server: { middlewareMode: true, hmr: false },
37
+ server: { middlewareMode: true, hmr: false, watch: { ignored: ["**"] } },
38
38
  optimizeDeps: { disabled: true },
39
39
  ssr: { external: [] },
40
40
  logLevel: "silent"
@@ -20,9 +20,10 @@ const toStyleString = (obj) => Object.entries(obj).map(([k, v]) => {
20
20
  return `${k}:${v}`;
21
21
  }).join(";");
22
22
  function defineScriptVars(vars) {
23
+ var _a;
23
24
  let output = "";
24
25
  for (const [key, value] of Object.entries(vars)) {
25
- output += `const ${toIdent(key)} = ${JSON.stringify(value).replace(
26
+ output += `const ${toIdent(key)} = ${(_a = JSON.stringify(value)) == null ? void 0 : _a.replace(
26
27
  /<\/script>/g,
27
28
  "\\x3C/script>"
28
29
  )};
package/import-meta.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // File vendored from Vite itself, as a workaround to https://github.com/vitejs/vite/pull/9827 until Vite 4 comes out
1
+ // File vendored from Vite itself, as a workaround to https://github.com/vitejs/vite/issues/13309 until Vite 5 comes out
2
2
 
3
3
  // This file is an augmentation to the built-in ImportMeta interface
4
4
  // Thus cannot contain any top-level imports
@@ -6,13 +6,6 @@
6
6
 
7
7
  /* eslint-disable @typescript-eslint/consistent-type-imports */
8
8
 
9
- // Duplicate of import('../src/node/importGlob').GlobOptions in order to
10
- // avoid breaking the production client type. Because this file is referenced
11
- // in vite/client.d.ts and in production src/node/importGlob.ts doesn't exist.
12
- interface GlobOptions {
13
- as?: string;
14
- }
15
-
16
9
  interface ImportMeta {
17
10
  url: string;
18
11
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "astro",
3
- "version": "2.5.3",
3
+ "version": "2.5.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",
@@ -135,6 +135,7 @@
135
135
  "magic-string": "^0.27.0",
136
136
  "mime": "^3.0.0",
137
137
  "ora": "^6.1.0",
138
+ "p-limit": "^4.0.0",
138
139
  "path-to-regexp": "^6.2.1",
139
140
  "preferred-pm": "^3.0.3",
140
141
  "prompts": "^2.4.2",