astro 1.2.4 → 1.2.6
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/dist/@types/astro.d.ts +15 -11
- package/dist/cli/check/index.d.ts +2 -2
- package/dist/cli/check/index.js +2 -2
- package/dist/cli/index.js +28 -9
- package/dist/core/add/index.js +1 -1
- package/dist/core/app/index.js +9 -1
- package/dist/core/build/generate.d.ts +3 -3
- package/dist/core/build/generate.js +28 -28
- package/dist/core/build/index.d.ts +2 -2
- package/dist/core/build/index.js +23 -19
- package/dist/core/build/page-data.d.ts +2 -2
- package/dist/core/build/page-data.js +2 -2
- package/dist/core/build/static-build.js +26 -28
- package/dist/core/build/types.d.ts +2 -2
- package/dist/core/build/vite-plugin-css.d.ts +0 -2
- package/dist/core/build/vite-plugin-css.js +3 -3
- package/dist/core/build/vite-plugin-hoisted-scripts.d.ts +2 -2
- package/dist/core/build/vite-plugin-hoisted-scripts.js +3 -3
- package/dist/core/build/vite-plugin-pages.js +2 -2
- package/dist/core/build/vite-plugin-ssr.js +16 -12
- package/dist/core/config/config.d.ts +41 -0
- package/dist/core/{config.js → config/config.js} +5 -153
- package/dist/core/config/index.d.ts +4 -0
- package/dist/core/config/index.js +18 -0
- package/dist/core/config/schema.d.ts +478 -0
- package/dist/core/config/schema.js +148 -0
- package/dist/core/config/settings.d.ts +8 -0
- package/dist/core/config/settings.js +16 -0
- package/dist/core/config/tsconfig.d.ts +2 -0
- package/dist/core/config/tsconfig.js +13 -0
- package/dist/core/create-vite.d.ts +3 -3
- package/dist/core/create-vite.js +21 -21
- package/dist/core/dev/index.d.ts +2 -2
- package/dist/core/dev/index.js +16 -12
- package/dist/core/endpoint/dev/index.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/preview/index.d.ts +2 -2
- package/dist/core/preview/index.js +9 -9
- package/dist/core/render/dev/index.d.ts +5 -5
- package/dist/core/render/dev/index.js +14 -14
- package/dist/core/render/dev/scripts.d.ts +2 -2
- package/dist/core/render/dev/scripts.js +4 -7
- package/dist/core/routing/manifest/create.d.ts +3 -3
- package/dist/core/routing/manifest/create.js +9 -12
- package/dist/core/util.d.ts +3 -3
- package/dist/core/util.js +9 -9
- package/dist/integrations/index.d.ts +6 -6
- package/dist/integrations/index.js +19 -17
- package/dist/runtime/server/astro-global.js +1 -1
- package/dist/runtime/server/astro-island.js +4 -1
- package/dist/runtime/server/astro-island.prebuilt.d.ts +1 -1
- package/dist/runtime/server/astro-island.prebuilt.js +1 -1
- package/dist/runtime/server/hydration.js +4 -1
- package/dist/vite-plugin-astro/index.d.ts +3 -3
- package/dist/vite-plugin-astro/index.js +2 -1
- package/dist/vite-plugin-astro-postprocess/index.d.ts +3 -3
- package/dist/vite-plugin-astro-postprocess/index.js +1 -1
- package/dist/vite-plugin-astro-server/index.d.ts +4 -4
- package/dist/vite-plugin-astro-server/index.js +27 -24
- package/dist/vite-plugin-config-alias/index.d.ts +3 -3
- package/dist/vite-plugin-config-alias/index.js +9 -13
- package/dist/vite-plugin-env/index.d.ts +3 -3
- package/dist/vite-plugin-env/index.js +2 -3
- package/dist/vite-plugin-integrations-container/index.d.ts +3 -3
- package/dist/vite-plugin-integrations-container/index.js +2 -2
- package/dist/vite-plugin-jsx/index.d.ts +3 -3
- package/dist/vite-plugin-jsx/index.js +7 -2
- package/dist/vite-plugin-markdown/index.d.ts +3 -3
- package/dist/vite-plugin-markdown/index.js +3 -3
- package/dist/vite-plugin-markdown-legacy/index.d.ts +3 -3
- package/dist/vite-plugin-markdown-legacy/index.js +2 -1
- package/dist/vite-plugin-scripts/index.d.ts +3 -3
- package/dist/vite-plugin-scripts/index.js +5 -5
- package/dist/vite-plugin-scripts/page-ssr.d.ts +3 -3
- package/dist/vite-plugin-scripts/page-ssr.js +7 -5
- package/package.json +1 -1
- package/dist/core/config.d.ts +0 -260
|
@@ -2,7 +2,7 @@ const SCRIPT_ID_PREFIX = `astro:scripts/`;
|
|
|
2
2
|
const BEFORE_HYDRATION_SCRIPT_ID = `${SCRIPT_ID_PREFIX}${"before-hydration"}.js`;
|
|
3
3
|
const PAGE_SCRIPT_ID = `${SCRIPT_ID_PREFIX}${"page"}.js`;
|
|
4
4
|
const PAGE_SSR_SCRIPT_ID = `${SCRIPT_ID_PREFIX}${"page-ssr"}.js`;
|
|
5
|
-
function astroScriptsPlugin({
|
|
5
|
+
function astroScriptsPlugin({ settings }) {
|
|
6
6
|
let env = void 0;
|
|
7
7
|
return {
|
|
8
8
|
name: "astro:scripts",
|
|
@@ -17,18 +17,18 @@ function astroScriptsPlugin({ config }) {
|
|
|
17
17
|
},
|
|
18
18
|
async load(id) {
|
|
19
19
|
if (id === BEFORE_HYDRATION_SCRIPT_ID) {
|
|
20
|
-
return
|
|
20
|
+
return settings.scripts.filter((s) => s.stage === "before-hydration").map((s) => s.content).join("\n");
|
|
21
21
|
}
|
|
22
22
|
if (id === PAGE_SCRIPT_ID) {
|
|
23
|
-
return
|
|
23
|
+
return settings.scripts.filter((s) => s.stage === "page").map((s) => s.content).join("\n");
|
|
24
24
|
}
|
|
25
25
|
if (id === PAGE_SSR_SCRIPT_ID) {
|
|
26
|
-
return
|
|
26
|
+
return settings.scripts.filter((s) => s.stage === "page-ssr").map((s) => s.content).join("\n");
|
|
27
27
|
}
|
|
28
28
|
return null;
|
|
29
29
|
},
|
|
30
30
|
buildStart(options) {
|
|
31
|
-
const hasHydrationScripts =
|
|
31
|
+
const hasHydrationScripts = settings.scripts.some((s) => s.stage === "before-hydration");
|
|
32
32
|
if (hasHydrationScripts && (env == null ? void 0 : env.command) === "build" && !(env == null ? void 0 : env.ssrBuild)) {
|
|
33
33
|
this.emitFile({
|
|
34
34
|
type: "chunk",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin as VitePlugin } from 'vite';
|
|
2
|
-
import {
|
|
3
|
-
export default function astroScriptsPostPlugin({
|
|
4
|
-
|
|
2
|
+
import { AstroSettings } from '../@types/astro.js';
|
|
3
|
+
export default function astroScriptsPostPlugin({ settings, }: {
|
|
4
|
+
settings: AstroSettings;
|
|
5
5
|
}): VitePlugin;
|
|
@@ -2,12 +2,14 @@ import { PAGE_SSR_SCRIPT_ID } from "./index.js";
|
|
|
2
2
|
import ancestor from "common-ancestor-path";
|
|
3
3
|
import MagicString from "magic-string";
|
|
4
4
|
import { isPage } from "../core/util.js";
|
|
5
|
-
function astroScriptsPostPlugin({
|
|
5
|
+
function astroScriptsPostPlugin({
|
|
6
|
+
settings
|
|
7
|
+
}) {
|
|
6
8
|
function normalizeFilename(filename) {
|
|
7
9
|
if (filename.startsWith("/@fs")) {
|
|
8
10
|
filename = filename.slice("/@fs".length);
|
|
9
|
-
} else if (filename.startsWith("/") && !ancestor(filename, config.root.pathname)) {
|
|
10
|
-
filename = new URL("." + filename, config.root).pathname;
|
|
11
|
+
} else if (filename.startsWith("/") && !ancestor(filename, settings.config.root.pathname)) {
|
|
12
|
+
filename = new URL("." + filename, settings.config.root).pathname;
|
|
11
13
|
}
|
|
12
14
|
return filename;
|
|
13
15
|
}
|
|
@@ -17,7 +19,7 @@ function astroScriptsPostPlugin({ config }) {
|
|
|
17
19
|
transform(code, id, options) {
|
|
18
20
|
if (!(options == null ? void 0 : options.ssr))
|
|
19
21
|
return;
|
|
20
|
-
const hasInjectedScript =
|
|
22
|
+
const hasInjectedScript = settings.scripts.some((s2) => s2.stage === "page-ssr");
|
|
21
23
|
if (!hasInjectedScript)
|
|
22
24
|
return;
|
|
23
25
|
const filename = normalizeFilename(id);
|
|
@@ -27,7 +29,7 @@ function astroScriptsPostPlugin({ config }) {
|
|
|
27
29
|
} catch (e) {
|
|
28
30
|
return;
|
|
29
31
|
}
|
|
30
|
-
const fileIsPage = isPage(fileURL,
|
|
32
|
+
const fileIsPage = isPage(fileURL, settings);
|
|
31
33
|
if (!fileIsPage)
|
|
32
34
|
return;
|
|
33
35
|
const s = new MagicString(code, { filename });
|
package/package.json
CHANGED
package/dist/core/config.d.ts
DELETED
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import type { RehypePlugin, RemarkPlugin, RemarkRehype } from '@astrojs/markdown-remark';
|
|
2
|
-
import type { ILanguageRegistration, IThemeRegistration, Theme } from 'shiki';
|
|
3
|
-
import type { Arguments as Flags } from 'yargs-parser';
|
|
4
|
-
import type { AstroConfig, AstroUserConfig, CLIFlags, ViteUserConfig } from '../@types/astro';
|
|
5
|
-
import { z } from 'zod';
|
|
6
|
-
import { LogOptions } from './logger/core.js';
|
|
7
|
-
export declare const LEGACY_ASTRO_CONFIG_KEYS: Set<string>;
|
|
8
|
-
export declare const AstroConfigSchema: z.ZodObject<{
|
|
9
|
-
root: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, URL, string | undefined>;
|
|
10
|
-
srcDir: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, URL, string | undefined>;
|
|
11
|
-
publicDir: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, URL, string | undefined>;
|
|
12
|
-
outDir: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, URL, string | undefined>;
|
|
13
|
-
site: z.ZodEffects<z.ZodOptional<z.ZodString>, string | undefined, string | undefined>;
|
|
14
|
-
base: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, string, string | undefined>;
|
|
15
|
-
trailingSlash: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"always">, z.ZodLiteral<"never">, z.ZodLiteral<"ignore">]>>>;
|
|
16
|
-
output: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"static">, z.ZodLiteral<"server">]>>>;
|
|
17
|
-
adapter: z.ZodOptional<z.ZodObject<{
|
|
18
|
-
name: z.ZodString;
|
|
19
|
-
hooks: z.ZodDefault<z.ZodObject<{}, "passthrough", z.ZodTypeAny, {}, {}>>;
|
|
20
|
-
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
name: string;
|
|
22
|
-
hooks: {};
|
|
23
|
-
}, {
|
|
24
|
-
hooks?: {} | undefined;
|
|
25
|
-
name: string;
|
|
26
|
-
}>>;
|
|
27
|
-
integrations: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
28
|
-
name: z.ZodString;
|
|
29
|
-
hooks: z.ZodDefault<z.ZodObject<{}, "passthrough", z.ZodTypeAny, {}, {}>>;
|
|
30
|
-
}, "strip", z.ZodTypeAny, {
|
|
31
|
-
name: string;
|
|
32
|
-
hooks: {};
|
|
33
|
-
}, {
|
|
34
|
-
hooks?: {} | undefined;
|
|
35
|
-
name: string;
|
|
36
|
-
}>, "many">>, {
|
|
37
|
-
name: string;
|
|
38
|
-
hooks: {};
|
|
39
|
-
}[], unknown>;
|
|
40
|
-
build: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
41
|
-
format: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"file">, z.ZodLiteral<"directory">]>>>;
|
|
42
|
-
}, "strip", z.ZodTypeAny, {
|
|
43
|
-
format: "file" | "directory";
|
|
44
|
-
}, {
|
|
45
|
-
format?: "file" | "directory" | undefined;
|
|
46
|
-
}>>>;
|
|
47
|
-
server: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
48
|
-
host: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>>;
|
|
49
|
-
port: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
50
|
-
}, "strip", z.ZodTypeAny, {
|
|
51
|
-
host: string | boolean;
|
|
52
|
-
port: number;
|
|
53
|
-
}, {
|
|
54
|
-
host?: string | boolean | undefined;
|
|
55
|
-
port?: number | undefined;
|
|
56
|
-
}>>>, {
|
|
57
|
-
host: string | boolean;
|
|
58
|
-
port: number;
|
|
59
|
-
}, unknown>;
|
|
60
|
-
style: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
61
|
-
postcss: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
62
|
-
options: z.ZodAny;
|
|
63
|
-
plugins: z.ZodArray<z.ZodAny, "many">;
|
|
64
|
-
}, "strip", z.ZodTypeAny, {
|
|
65
|
-
options?: any;
|
|
66
|
-
plugins: any[];
|
|
67
|
-
}, {
|
|
68
|
-
options?: any;
|
|
69
|
-
plugins: any[];
|
|
70
|
-
}>>>;
|
|
71
|
-
}, "strip", z.ZodTypeAny, {
|
|
72
|
-
postcss: {
|
|
73
|
-
options?: any;
|
|
74
|
-
plugins: any[];
|
|
75
|
-
};
|
|
76
|
-
}, {
|
|
77
|
-
postcss?: {
|
|
78
|
-
options?: any;
|
|
79
|
-
plugins: any[];
|
|
80
|
-
} | undefined;
|
|
81
|
-
}>>>;
|
|
82
|
-
markdown: z.ZodDefault<z.ZodObject<{
|
|
83
|
-
drafts: z.ZodDefault<z.ZodBoolean>;
|
|
84
|
-
syntaxHighlight: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<"shiki">, z.ZodLiteral<"prism">, z.ZodLiteral<false>]>>;
|
|
85
|
-
shikiConfig: z.ZodDefault<z.ZodObject<{
|
|
86
|
-
langs: z.ZodDefault<z.ZodArray<z.ZodType<ILanguageRegistration, z.ZodTypeDef, ILanguageRegistration>, "many">>;
|
|
87
|
-
theme: z.ZodDefault<z.ZodUnion<[z.ZodEnum<[Theme, ...Theme[]]>, z.ZodType<IThemeRegistration, z.ZodTypeDef, IThemeRegistration>]>>;
|
|
88
|
-
wrap: z.ZodDefault<z.ZodUnion<[z.ZodBoolean, z.ZodNull]>>;
|
|
89
|
-
}, "strip", z.ZodTypeAny, {
|
|
90
|
-
langs: ILanguageRegistration[];
|
|
91
|
-
theme: "css-variables" | "dark-plus" | "dracula-soft" | "dracula" | "github-dark-dimmed" | "github-dark" | "github-light" | "hc_light" | "light-plus" | "material-darker" | "material-default" | "material-lighter" | "material-ocean" | "material-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine-dawn" | "rose-pine-moon" | "rose-pine" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light" | import("shiki").IShikiTheme | (string & {});
|
|
92
|
-
wrap: boolean | null;
|
|
93
|
-
}, {
|
|
94
|
-
langs?: ILanguageRegistration[] | undefined;
|
|
95
|
-
theme?: "css-variables" | "dark-plus" | "dracula-soft" | "dracula" | "github-dark-dimmed" | "github-dark" | "github-light" | "hc_light" | "light-plus" | "material-darker" | "material-default" | "material-lighter" | "material-ocean" | "material-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine-dawn" | "rose-pine-moon" | "rose-pine" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light" | import("shiki").IShikiTheme | (string & {}) | undefined;
|
|
96
|
-
wrap?: boolean | null | undefined;
|
|
97
|
-
}>>;
|
|
98
|
-
remarkPlugins: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodAny], null>, z.ZodType<RemarkPlugin<any[]>, z.ZodTypeDef, RemarkPlugin<any[]>>, z.ZodTuple<[z.ZodType<RemarkPlugin<any[]>, z.ZodTypeDef, RemarkPlugin<any[]>>, z.ZodAny], null>]>, "many">>;
|
|
99
|
-
rehypePlugins: z.ZodDefault<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodAny], null>, z.ZodType<RehypePlugin<any[]>, z.ZodTypeDef, RehypePlugin<any[]>>, z.ZodTuple<[z.ZodType<RehypePlugin<any[]>, z.ZodTypeDef, RehypePlugin<any[]>>, z.ZodAny], null>]>, "many">>;
|
|
100
|
-
remarkRehype: z.ZodDefault<z.ZodOptional<z.ZodType<RemarkRehype, z.ZodTypeDef, RemarkRehype>>>;
|
|
101
|
-
extendDefaultPlugins: z.ZodDefault<z.ZodBoolean>;
|
|
102
|
-
}, "strip", z.ZodTypeAny, {
|
|
103
|
-
drafts: boolean;
|
|
104
|
-
syntaxHighlight: false | "shiki" | "prism";
|
|
105
|
-
shikiConfig: {
|
|
106
|
-
langs: ILanguageRegistration[];
|
|
107
|
-
theme: "css-variables" | "dark-plus" | "dracula-soft" | "dracula" | "github-dark-dimmed" | "github-dark" | "github-light" | "hc_light" | "light-plus" | "material-darker" | "material-default" | "material-lighter" | "material-ocean" | "material-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine-dawn" | "rose-pine-moon" | "rose-pine" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light" | import("shiki").IShikiTheme | (string & {});
|
|
108
|
-
wrap: boolean | null;
|
|
109
|
-
};
|
|
110
|
-
remarkPlugins: (string | [string, any] | RemarkPlugin<any[]> | [RemarkPlugin<any[]>, any])[];
|
|
111
|
-
rehypePlugins: (string | [string, any] | RehypePlugin<any[]> | [RehypePlugin<any[]>, any])[];
|
|
112
|
-
remarkRehype: RemarkRehype;
|
|
113
|
-
extendDefaultPlugins: boolean;
|
|
114
|
-
}, {
|
|
115
|
-
drafts?: boolean | undefined;
|
|
116
|
-
syntaxHighlight?: false | "shiki" | "prism" | undefined;
|
|
117
|
-
shikiConfig?: {
|
|
118
|
-
langs?: ILanguageRegistration[] | undefined;
|
|
119
|
-
theme?: "css-variables" | "dark-plus" | "dracula-soft" | "dracula" | "github-dark-dimmed" | "github-dark" | "github-light" | "hc_light" | "light-plus" | "material-darker" | "material-default" | "material-lighter" | "material-ocean" | "material-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine-dawn" | "rose-pine-moon" | "rose-pine" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light" | import("shiki").IShikiTheme | (string & {}) | undefined;
|
|
120
|
-
wrap?: boolean | null | undefined;
|
|
121
|
-
} | undefined;
|
|
122
|
-
remarkPlugins?: (string | [string, any] | RemarkPlugin<any[]> | [RemarkPlugin<any[]>, any])[] | undefined;
|
|
123
|
-
rehypePlugins?: (string | [string, any] | RehypePlugin<any[]> | [RehypePlugin<any[]>, any])[] | undefined;
|
|
124
|
-
remarkRehype?: RemarkRehype | undefined;
|
|
125
|
-
extendDefaultPlugins?: boolean | undefined;
|
|
126
|
-
}>>;
|
|
127
|
-
vite: z.ZodDefault<z.ZodType<ViteUserConfig, z.ZodTypeDef, ViteUserConfig>>;
|
|
128
|
-
legacy: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
129
|
-
astroFlavoredMarkdown: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
130
|
-
}, "strip", z.ZodTypeAny, {
|
|
131
|
-
astroFlavoredMarkdown: boolean;
|
|
132
|
-
}, {
|
|
133
|
-
astroFlavoredMarkdown?: boolean | undefined;
|
|
134
|
-
}>>>;
|
|
135
|
-
}, "strip", z.ZodTypeAny, {
|
|
136
|
-
site?: string | undefined;
|
|
137
|
-
adapter?: {
|
|
138
|
-
name: string;
|
|
139
|
-
hooks: {};
|
|
140
|
-
} | undefined;
|
|
141
|
-
base: string;
|
|
142
|
-
markdown: {
|
|
143
|
-
drafts: boolean;
|
|
144
|
-
syntaxHighlight: false | "shiki" | "prism";
|
|
145
|
-
shikiConfig: {
|
|
146
|
-
langs: ILanguageRegistration[];
|
|
147
|
-
theme: "css-variables" | "dark-plus" | "dracula-soft" | "dracula" | "github-dark-dimmed" | "github-dark" | "github-light" | "hc_light" | "light-plus" | "material-darker" | "material-default" | "material-lighter" | "material-ocean" | "material-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine-dawn" | "rose-pine-moon" | "rose-pine" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light" | import("shiki").IShikiTheme | (string & {});
|
|
148
|
-
wrap: boolean | null;
|
|
149
|
-
};
|
|
150
|
-
remarkPlugins: (string | [string, any] | RemarkPlugin<any[]> | [RemarkPlugin<any[]>, any])[];
|
|
151
|
-
rehypePlugins: (string | [string, any] | RehypePlugin<any[]> | [RehypePlugin<any[]>, any])[];
|
|
152
|
-
remarkRehype: RemarkRehype;
|
|
153
|
-
extendDefaultPlugins: boolean;
|
|
154
|
-
};
|
|
155
|
-
root: URL;
|
|
156
|
-
srcDir: URL;
|
|
157
|
-
publicDir: URL;
|
|
158
|
-
outDir: URL;
|
|
159
|
-
trailingSlash: "never" | "always" | "ignore";
|
|
160
|
-
server: {
|
|
161
|
-
host: string | boolean;
|
|
162
|
-
port: number;
|
|
163
|
-
};
|
|
164
|
-
output: "static" | "server";
|
|
165
|
-
integrations: {
|
|
166
|
-
name: string;
|
|
167
|
-
hooks: {};
|
|
168
|
-
}[];
|
|
169
|
-
build: {
|
|
170
|
-
format: "file" | "directory";
|
|
171
|
-
};
|
|
172
|
-
style: {
|
|
173
|
-
postcss: {
|
|
174
|
-
options?: any;
|
|
175
|
-
plugins: any[];
|
|
176
|
-
};
|
|
177
|
-
};
|
|
178
|
-
vite: ViteUserConfig;
|
|
179
|
-
legacy: {
|
|
180
|
-
astroFlavoredMarkdown: boolean;
|
|
181
|
-
};
|
|
182
|
-
}, {
|
|
183
|
-
site?: string | undefined;
|
|
184
|
-
base?: string | undefined;
|
|
185
|
-
markdown?: {
|
|
186
|
-
drafts?: boolean | undefined;
|
|
187
|
-
syntaxHighlight?: false | "shiki" | "prism" | undefined;
|
|
188
|
-
shikiConfig?: {
|
|
189
|
-
langs?: ILanguageRegistration[] | undefined;
|
|
190
|
-
theme?: "css-variables" | "dark-plus" | "dracula-soft" | "dracula" | "github-dark-dimmed" | "github-dark" | "github-light" | "hc_light" | "light-plus" | "material-darker" | "material-default" | "material-lighter" | "material-ocean" | "material-palenight" | "min-dark" | "min-light" | "monokai" | "nord" | "one-dark-pro" | "poimandres" | "rose-pine-dawn" | "rose-pine-moon" | "rose-pine" | "slack-dark" | "slack-ochin" | "solarized-dark" | "solarized-light" | "vitesse-dark" | "vitesse-light" | import("shiki").IShikiTheme | (string & {}) | undefined;
|
|
191
|
-
wrap?: boolean | null | undefined;
|
|
192
|
-
} | undefined;
|
|
193
|
-
remarkPlugins?: (string | [string, any] | RemarkPlugin<any[]> | [RemarkPlugin<any[]>, any])[] | undefined;
|
|
194
|
-
rehypePlugins?: (string | [string, any] | RehypePlugin<any[]> | [RehypePlugin<any[]>, any])[] | undefined;
|
|
195
|
-
remarkRehype?: RemarkRehype | undefined;
|
|
196
|
-
extendDefaultPlugins?: boolean | undefined;
|
|
197
|
-
} | undefined;
|
|
198
|
-
root?: string | undefined;
|
|
199
|
-
srcDir?: string | undefined;
|
|
200
|
-
publicDir?: string | undefined;
|
|
201
|
-
outDir?: string | undefined;
|
|
202
|
-
trailingSlash?: "never" | "always" | "ignore" | undefined;
|
|
203
|
-
server?: unknown;
|
|
204
|
-
output?: "static" | "server" | undefined;
|
|
205
|
-
adapter?: {
|
|
206
|
-
hooks?: {} | undefined;
|
|
207
|
-
name: string;
|
|
208
|
-
} | undefined;
|
|
209
|
-
integrations?: unknown;
|
|
210
|
-
build?: {
|
|
211
|
-
format?: "file" | "directory" | undefined;
|
|
212
|
-
} | undefined;
|
|
213
|
-
style?: {
|
|
214
|
-
postcss?: {
|
|
215
|
-
options?: any;
|
|
216
|
-
plugins: any[];
|
|
217
|
-
} | undefined;
|
|
218
|
-
} | undefined;
|
|
219
|
-
vite?: ViteUserConfig | undefined;
|
|
220
|
-
legacy?: {
|
|
221
|
-
astroFlavoredMarkdown?: boolean | undefined;
|
|
222
|
-
} | undefined;
|
|
223
|
-
}>;
|
|
224
|
-
/** Turn raw config values into normalized values */
|
|
225
|
-
export declare function validateConfig(userConfig: any, root: string, cmd: string, logging: LogOptions): Promise<AstroConfig>;
|
|
226
|
-
/** Convert the generic "yargs" flag object into our own, custom TypeScript object. */
|
|
227
|
-
export declare function resolveFlags(flags: Partial<Flags>): CLIFlags;
|
|
228
|
-
export declare function resolveRoot(cwd?: string): string;
|
|
229
|
-
interface LoadConfigOptions {
|
|
230
|
-
cwd?: string;
|
|
231
|
-
flags?: Flags;
|
|
232
|
-
cmd: string;
|
|
233
|
-
validate?: boolean;
|
|
234
|
-
logging: LogOptions;
|
|
235
|
-
/** Invalidate when reloading a previously loaded config */
|
|
236
|
-
isConfigReload?: boolean;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Resolve the file URL of the user's `astro.config.js|cjs|mjs|ts` file
|
|
240
|
-
* Note: currently the same as loadConfig but only returns the `filePath`
|
|
241
|
-
* instead of the resolved config
|
|
242
|
-
*/
|
|
243
|
-
export declare function resolveConfigPath(configOptions: Pick<LoadConfigOptions, 'cwd' | 'flags'>): Promise<string | undefined>;
|
|
244
|
-
interface OpenConfigResult {
|
|
245
|
-
userConfig: AstroUserConfig;
|
|
246
|
-
astroConfig: AstroConfig;
|
|
247
|
-
flags: CLIFlags;
|
|
248
|
-
root: string;
|
|
249
|
-
}
|
|
250
|
-
/** Load a configuration file, returning both the userConfig and astroConfig */
|
|
251
|
-
export declare function openConfig(configOptions: LoadConfigOptions): Promise<OpenConfigResult>;
|
|
252
|
-
/**
|
|
253
|
-
* Attempt to load an `astro.config.mjs` file
|
|
254
|
-
* @deprecated
|
|
255
|
-
*/
|
|
256
|
-
export declare function loadConfig(configOptions: LoadConfigOptions): Promise<AstroConfig>;
|
|
257
|
-
/** Attempt to resolve an Astro configuration object. Normalize, validate, and return. */
|
|
258
|
-
export declare function resolveConfig(userConfig: AstroUserConfig, root: string, flags: CLIFlags | undefined, cmd: string, logging: LogOptions): Promise<AstroConfig>;
|
|
259
|
-
export declare function mergeConfig(defaults: Record<string, any>, overrides: Record<string, any>, isRoot?: boolean): Record<string, any>;
|
|
260
|
-
export {};
|