Skip to content

Commit

Permalink
chore: rename to astro:config
Browse files Browse the repository at this point in the history
  • Loading branch information
ematipico committed Jan 24, 2025
1 parent ab9854e commit 8820e58
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions packages/astro/src/core/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export const ASTRO_CONFIG_DEFAULTS = {
contentIntellisense: false,
responsiveImages: false,
svg: false,
serializeManifest: false,
serializeConfig: false,
},
} satisfies AstroUserConfig & { server: { open: boolean } };

Expand Down Expand Up @@ -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.`,
Expand Down
8 changes: 4 additions & 4 deletions packages/astro/src/manifest/virtual-module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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),
Expand All @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions packages/astro/src/types/public/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<h1>Hello, World!</h1>
<p>Welcome to this Astro page.</p>
<script>
import { outDir } from "astro:manifest/server"
import { outDir } from "astro:config/server"

console.log(outDir)
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
Original file line number Diff line number Diff line change
@@ -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 });
---
<!DOCTYPE html>
<html lang="en">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import { root, outDir, srcDir, build, cacheDir } from "astro:manifest/server";
import { root, outDir, srcDir, build, cacheDir } from "astro:config/server";
---
<!DOCTYPE html>
<html lang="en">
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/test/serializeManifest.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('astro:manifest/client', () => {
fixture = await loadFixture({
root: './fixtures/astro-manifest/',
experimental: {
serializeManifest: false,
serializeConfig: false,
},
});
devServer = await fixture.startDevServer();
Expand Down Expand Up @@ -99,7 +99,7 @@ describe('astro:manifest/server', () => {
fixture = await loadFixture({
root: './fixtures/astro-manifest/',
experimental: {
serializeManifest: false,
serializeConfig: false,
},
});
devServer = await fixture.startDevServer();
Expand Down

0 comments on commit 8820e58

Please sign in to comment.