From 8820e58f5225a189f6c416f621f3804181f86fe2 Mon Sep 17 00:00:00 2001 From: Emanuele Stoppa Date: Fri, 24 Jan 2025 13:37:51 +0000 Subject: [PATCH] chore: rename to `astro:config` --- packages/astro/src/core/config/schema.ts | 6 +++--- packages/astro/src/manifest/virtual-module.ts | 8 ++++---- packages/astro/src/types/public/config.ts | 6 +++--- .../test/fixtures/astro-manifest-invalid/astro.config.mjs | 2 +- .../astro-manifest-invalid/src/pages/client.astro | 2 +- .../astro/test/fixtures/astro-manifest/astro.config.mjs | 2 +- .../test/fixtures/astro-manifest/src/pages/index.astro | 4 ++-- .../test/fixtures/astro-manifest/src/pages/server.astro | 2 +- packages/astro/test/serializeManifest.test.js | 4 ++-- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/packages/astro/src/core/config/schema.ts b/packages/astro/src/core/config/schema.ts index 78a1fbb2e046..777e8df2665e 100644 --- a/packages/astro/src/core/config/schema.ts +++ b/packages/astro/src/core/config/schema.ts @@ -97,7 +97,7 @@ export const ASTRO_CONFIG_DEFAULTS = { contentIntellisense: false, responsiveImages: false, svg: false, - serializeManifest: false, + serializeConfig: false, }, } satisfies AstroUserConfig & { server: { open: boolean } }; @@ -590,10 +590,10 @@ export const AstroConfigSchema = z.object({ } return svgConfig; }), - serializeManifest: z + serializeConfig: z .boolean() .optional() - .default(ASTRO_CONFIG_DEFAULTS.experimental.serializeManifest), + .default(ASTRO_CONFIG_DEFAULTS.experimental.serializeConfig), }) .strict( `Invalid or outdated experimental feature.\nCheck for incorrect spelling or outdated Astro version.\nSee https://docs.astro.build/en/reference/experimental-flags/ for a list of all current experiments.`, diff --git a/packages/astro/src/manifest/virtual-module.ts b/packages/astro/src/manifest/virtual-module.ts index ee58847f5b17..d812ce25a496 100644 --- a/packages/astro/src/manifest/virtual-module.ts +++ b/packages/astro/src/manifest/virtual-module.ts @@ -11,9 +11,9 @@ import type { ServerDeserializedManifest, } from '../types/public/index.js'; -const VIRTUAL_SERVER_ID = 'astro:manifest/server'; +const VIRTUAL_SERVER_ID = 'astro:config/server'; const RESOLVED_VIRTUAL_SERVER_ID = '\0' + VIRTUAL_SERVER_ID; -const VIRTUAL_CLIENT_ID = 'astro:manifest/client'; +const VIRTUAL_CLIENT_ID = 'astro:config/client'; const RESOLVED_VIRTUAL_CLIENT_ID = '\0' + VIRTUAL_CLIENT_ID; export default function virtualModulePlugin({ @@ -35,7 +35,7 @@ export default function virtualModulePlugin({ load(id, opts) { // client if (id === RESOLVED_VIRTUAL_CLIENT_ID) { - if (!settings.config.experimental.serializeManifest) { + if (!settings.config.experimental.serializeConfig) { throw new AstroError({ ...CantUseManifestModule, message: CantUseManifestModule.message(VIRTUAL_CLIENT_ID), @@ -46,7 +46,7 @@ export default function virtualModulePlugin({ } // server else if (id == RESOLVED_VIRTUAL_SERVER_ID) { - if (!settings.config.experimental.serializeManifest) { + if (!settings.config.experimental.serializeConfig) { throw new AstroError({ ...CantUseManifestModule, message: CantUseManifestModule.message(VIRTUAL_SERVER_ID), diff --git a/packages/astro/src/types/public/config.ts b/packages/astro/src/types/public/config.ts index 2973618bf345..b7d8c6b906fa 100644 --- a/packages/astro/src/types/public/config.ts +++ b/packages/astro/src/types/public/config.ts @@ -2061,17 +2061,17 @@ export interface ViteUserConfig extends OriginalViteUserConfig { }; /** - * @name experimental.serializeManifest + * @name experimental.serializeConfig * @type {boolean} * @default `false` * @version 5.x * @description * - * Allows to use the virtual modules `astro:manifest/server` and `astro:manifest/client`. + * Allows to use the virtual modules `astro:config/server` and `astro:config/client`. * * These two virtual modules contain a serializable subset of the Astro configuration. */ - serializeManifest?: boolean; + serializeConfig?: boolean; }; } diff --git a/packages/astro/test/fixtures/astro-manifest-invalid/astro.config.mjs b/packages/astro/test/fixtures/astro-manifest-invalid/astro.config.mjs index ac1b28a80048..354e3476d02f 100644 --- a/packages/astro/test/fixtures/astro-manifest-invalid/astro.config.mjs +++ b/packages/astro/test/fixtures/astro-manifest-invalid/astro.config.mjs @@ -4,7 +4,7 @@ import { defineConfig } from "astro/config"; export default defineConfig({ site: "https://astro.build/", experimental: { - serializeManifest: true, + serializeConfig: true, }, i18n: { locales: ["en", "fr"], diff --git a/packages/astro/test/fixtures/astro-manifest-invalid/src/pages/client.astro b/packages/astro/test/fixtures/astro-manifest-invalid/src/pages/client.astro index a045b8f2e916..51f1a6c5272d 100644 --- a/packages/astro/test/fixtures/astro-manifest-invalid/src/pages/client.astro +++ b/packages/astro/test/fixtures/astro-manifest-invalid/src/pages/client.astro @@ -12,7 +12,7 @@

Hello, World!

Welcome to this Astro page.

diff --git a/packages/astro/test/fixtures/astro-manifest/astro.config.mjs b/packages/astro/test/fixtures/astro-manifest/astro.config.mjs index ac1b28a80048..354e3476d02f 100644 --- a/packages/astro/test/fixtures/astro-manifest/astro.config.mjs +++ b/packages/astro/test/fixtures/astro-manifest/astro.config.mjs @@ -4,7 +4,7 @@ import { defineConfig } from "astro/config"; export default defineConfig({ site: "https://astro.build/", experimental: { - serializeManifest: true, + serializeConfig: true, }, i18n: { locales: ["en", "fr"], diff --git a/packages/astro/test/fixtures/astro-manifest/src/pages/index.astro b/packages/astro/test/fixtures/astro-manifest/src/pages/index.astro index a3d19033b6f8..3c95169c2420 100644 --- a/packages/astro/test/fixtures/astro-manifest/src/pages/index.astro +++ b/packages/astro/test/fixtures/astro-manifest/src/pages/index.astro @@ -1,8 +1,8 @@ --- -import { base, i18n, trailingSlash, compressHTML, site, legacy, build } from "astro:manifest/client"; +import { base, i18n, trailingSlash, compressHTML, site, build } from "astro:config/client"; -const config = JSON.stringify({ base, i18n, build, trailingSlash, compressHTML, site, legacy }); +const config = JSON.stringify({ base, i18n, build, trailingSlash, compressHTML, site }); --- diff --git a/packages/astro/test/fixtures/astro-manifest/src/pages/server.astro b/packages/astro/test/fixtures/astro-manifest/src/pages/server.astro index e8e0b1362864..ea0d90d730c7 100644 --- a/packages/astro/test/fixtures/astro-manifest/src/pages/server.astro +++ b/packages/astro/test/fixtures/astro-manifest/src/pages/server.astro @@ -1,5 +1,5 @@ --- -import { root, outDir, srcDir, build, cacheDir } from "astro:manifest/server"; +import { root, outDir, srcDir, build, cacheDir } from "astro:config/server"; --- diff --git a/packages/astro/test/serializeManifest.test.js b/packages/astro/test/serializeManifest.test.js index 57dc5f3d118b..9e838dc2a7f7 100644 --- a/packages/astro/test/serializeManifest.test.js +++ b/packages/astro/test/serializeManifest.test.js @@ -15,7 +15,7 @@ describe('astro:manifest/client', () => { fixture = await loadFixture({ root: './fixtures/astro-manifest/', experimental: { - serializeManifest: false, + serializeConfig: false, }, }); devServer = await fixture.startDevServer(); @@ -99,7 +99,7 @@ describe('astro:manifest/server', () => { fixture = await loadFixture({ root: './fixtures/astro-manifest/', experimental: { - serializeManifest: false, + serializeConfig: false, }, }); devServer = await fixture.startDevServer();