astro 0.25.1 → 0.25.2
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/cli/index.js +1 -1
- package/dist/core/add/consts.js +1 -1
- package/dist/core/config.js +17 -4
- package/dist/core/dev/index.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/types/@types/astro.d.ts +6 -0
- package/dist/types/core/add/consts.d.ts +1 -1
- package/dist/types/core/config.d.ts +4 -7
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
package/dist/core/add/consts.js
CHANGED
|
@@ -20,7 +20,7 @@ const CONFIG_STUB = `import { defineConfig } from 'astro/config';
|
|
|
20
20
|
|
|
21
21
|
export default defineConfig({});`;
|
|
22
22
|
const TAILWIND_CONFIG_STUB = `module.exports = {
|
|
23
|
-
content: [],
|
|
23
|
+
content: ['./src/**/*.{astro,html,js,jsx,svelte,ts,tsx,vue}'],
|
|
24
24
|
theme: {
|
|
25
25
|
extend: {},
|
|
26
26
|
},
|
package/dist/core/config.js
CHANGED
|
@@ -55,9 +55,7 @@ const AstroConfigSchema = z.object({
|
|
|
55
55
|
pages: z.string().optional().default("./src/pages").transform((val) => new URL(val)),
|
|
56
56
|
public: z.string().optional().default("./public").transform((val) => new URL(val)),
|
|
57
57
|
dist: z.string().optional().default("./dist").transform((val) => new URL(val)),
|
|
58
|
-
integrations: z.preprocess((val) => Array.isArray(val) ? val.flat(Infinity).filter(Boolean) : val, z.array(z.object({ name: z.string(), hooks: z.object({}).passthrough().default({}) })).default([])
|
|
59
|
-
message: `Astro integrations are still experimental, and only official integrations are currently supported`
|
|
60
|
-
})),
|
|
58
|
+
integrations: z.preprocess((val) => Array.isArray(val) ? val.flat(Infinity).filter(Boolean) : val, z.array(z.object({ name: z.string(), hooks: z.object({}).passthrough().default({}) })).default([])),
|
|
61
59
|
adapter: z.object({ name: z.string(), hooks: z.object({}).passthrough().default({}) }).optional(),
|
|
62
60
|
styleOptions: z.object({
|
|
63
61
|
postcss: z.object({
|
|
@@ -84,6 +82,7 @@ const AstroConfigSchema = z.object({
|
|
|
84
82
|
port: z.number().optional().default(3e3),
|
|
85
83
|
trailingSlash: z.union([z.literal("always"), z.literal("never"), z.literal("ignore")]).optional().default("ignore")
|
|
86
84
|
}).optional().default({}),
|
|
85
|
+
experimentalIntegrations: z.boolean().optional().default(false),
|
|
87
86
|
vite: z.any().optional().default({})
|
|
88
87
|
});
|
|
89
88
|
async function validateConfig(userConfig, root) {
|
|
@@ -127,9 +126,20 @@ async function validateConfig(userConfig, root) {
|
|
|
127
126
|
}).optional().default({ options: {}, plugins: [] }))
|
|
128
127
|
}).optional().default({})
|
|
129
128
|
});
|
|
130
|
-
|
|
129
|
+
const result = __spreadProps(__spreadValues({}, await AstroConfigRelativeSchema.parseAsync(userConfig)), {
|
|
131
130
|
_ctx: { scripts: [], renderers: [], adapter: void 0 }
|
|
132
131
|
});
|
|
132
|
+
if (!result.experimentalIntegrations && !result.integrations.every((int) => int.name.startsWith("@astrojs/"))) {
|
|
133
|
+
throw new Error([
|
|
134
|
+
`Astro integrations are still experimental.`,
|
|
135
|
+
``,
|
|
136
|
+
`Only official "@astrojs/*" integrations are currently supported.`,
|
|
137
|
+
`To enable 3rd-party integrations, use the "--experimental-integrations" flag.`,
|
|
138
|
+
`Breaking changes may occur in this API before Astro v1.0 is released.`,
|
|
139
|
+
``
|
|
140
|
+
].join("\n"));
|
|
141
|
+
}
|
|
142
|
+
return result;
|
|
133
143
|
}
|
|
134
144
|
function addTrailingSlash(str) {
|
|
135
145
|
return str.replace(/\/*$/, "/");
|
|
@@ -148,6 +158,7 @@ function resolveFlags(flags) {
|
|
|
148
158
|
host: typeof flags.host === "string" || typeof flags.host === "boolean" ? flags.host : void 0,
|
|
149
159
|
legacyBuild: typeof flags.legacyBuild === "boolean" ? flags.legacyBuild : false,
|
|
150
160
|
experimentalSsr: typeof flags.experimentalSsr === "boolean" ? flags.experimentalSsr : false,
|
|
161
|
+
experimentalIntegrations: typeof flags.experimentalIntegrations === "boolean" ? flags.experimentalIntegrations : false,
|
|
151
162
|
drafts: typeof flags.drafts === "boolean" ? flags.drafts : false
|
|
152
163
|
};
|
|
153
164
|
}
|
|
@@ -172,6 +183,8 @@ function mergeCLIFlags(astroConfig, flags) {
|
|
|
172
183
|
astroConfig.buildOptions.legacyBuild = false;
|
|
173
184
|
}
|
|
174
185
|
}
|
|
186
|
+
if (typeof flags.experimentalIntegrations === "boolean")
|
|
187
|
+
astroConfig.experimentalIntegrations = flags.experimentalIntegrations;
|
|
175
188
|
if (typeof flags.drafts === "boolean")
|
|
176
189
|
astroConfig.buildOptions.drafts = flags.drafts;
|
|
177
190
|
return astroConfig;
|
package/dist/core/dev/index.js
CHANGED
|
@@ -23,7 +23,7 @@ async function dev(config, options = { logging: defaultLogOptions }) {
|
|
|
23
23
|
const devServerAddressInfo = viteServer.httpServer.address();
|
|
24
24
|
const site = config.buildOptions.site ? new URL(config.buildOptions.site) : void 0;
|
|
25
25
|
info(options.logging, null, msg.devStart({ startupTime: performance.now() - devStart, config, devServerAddressInfo, site, https: !!((_a = viteConfig.server) == null ? void 0 : _a.https) }));
|
|
26
|
-
const currentVersion = "0.25.
|
|
26
|
+
const currentVersion = "0.25.2";
|
|
27
27
|
if (currentVersion.includes("-")) {
|
|
28
28
|
warn(options.logging, null, msg.prerelease({ currentVersion }));
|
|
29
29
|
}
|
package/dist/core/messages.js
CHANGED
|
@@ -28,7 +28,7 @@ function devStart({
|
|
|
28
28
|
https,
|
|
29
29
|
site
|
|
30
30
|
}) {
|
|
31
|
-
const version = "0.25.
|
|
31
|
+
const version = "0.25.2";
|
|
32
32
|
const rootPath = site ? site.pathname : "/";
|
|
33
33
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
34
34
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
@@ -121,7 +121,7 @@ function printHelp({
|
|
|
121
121
|
};
|
|
122
122
|
let message = [];
|
|
123
123
|
if (headline) {
|
|
124
|
-
message.push(linebreak(), ` ${bgGreen(black(` ${commandName} `))} ${green(`v${"0.25.
|
|
124
|
+
message.push(linebreak(), ` ${bgGreen(black(` ${commandName} `))} ${green(`v${"0.25.2"}`)} ${headline}`);
|
|
125
125
|
}
|
|
126
126
|
if (usage) {
|
|
127
127
|
message.push(linebreak(), ` ${green(commandName)} ${bold(usage)}`);
|
|
@@ -35,6 +35,7 @@ export interface CLIFlags {
|
|
|
35
35
|
/** @deprecated */
|
|
36
36
|
experimentalStaticBuild?: boolean;
|
|
37
37
|
experimentalSsr?: boolean;
|
|
38
|
+
experimentalIntegrations?: boolean;
|
|
38
39
|
legacyBuild?: boolean;
|
|
39
40
|
drafts?: boolean;
|
|
40
41
|
}
|
|
@@ -400,6 +401,11 @@ export interface AstroUserConfig {
|
|
|
400
401
|
*/
|
|
401
402
|
trailingSlash?: 'always' | 'never' | 'ignore';
|
|
402
403
|
};
|
|
404
|
+
/**
|
|
405
|
+
* Enable experimental support for 3rd-party integrations.
|
|
406
|
+
* Default: false
|
|
407
|
+
*/
|
|
408
|
+
experimentalIntegrations?: boolean;
|
|
403
409
|
/**
|
|
404
410
|
* @docs
|
|
405
411
|
* @name vite
|
|
@@ -8,4 +8,4 @@ export declare const FIRST_PARTY_ADDONS: {
|
|
|
8
8
|
}[];
|
|
9
9
|
export declare const ALIASES: Map<string, string>;
|
|
10
10
|
export declare const CONFIG_STUB = "import { defineConfig } from 'astro/config';\n\nexport default defineConfig({});";
|
|
11
|
-
export declare const TAILWIND_CONFIG_STUB = "module.exports = {\n\tcontent: [],\n\ttheme: {\n\t\textend: {},\n\t},\n\tplugins: [],\n}\n";
|
|
11
|
+
export declare const TAILWIND_CONFIG_STUB = "module.exports = {\n\tcontent: ['./src/**/*.{astro,html,js,jsx,svelte,ts,tsx,vue}'],\n\ttheme: {\n\t\textend: {},\n\t},\n\tplugins: [],\n}\n";
|
|
@@ -7,7 +7,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
7
7
|
pages: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, URL, string | undefined>;
|
|
8
8
|
public: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, URL, string | undefined>;
|
|
9
9
|
dist: z.ZodEffects<z.ZodDefault<z.ZodOptional<z.ZodString>>, URL, string | undefined>;
|
|
10
|
-
integrations: z.ZodEffects<z.
|
|
10
|
+
integrations: z.ZodEffects<z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
11
11
|
name: z.ZodString;
|
|
12
12
|
hooks: z.ZodDefault<z.ZodObject<{}, "passthrough", z.ZodTypeAny, {}, {}>>;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -22,12 +22,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
22
22
|
}[], {
|
|
23
23
|
hooks?: {} | undefined;
|
|
24
24
|
name: string;
|
|
25
|
-
}[] | undefined>, {
|
|
26
|
-
name: string;
|
|
27
|
-
hooks: {};
|
|
28
|
-
}[], {
|
|
29
|
-
hooks?: {} | undefined;
|
|
30
|
-
name: string;
|
|
31
25
|
}[] | undefined>;
|
|
32
26
|
adapter: z.ZodOptional<z.ZodObject<{
|
|
33
27
|
name: z.ZodString;
|
|
@@ -112,6 +106,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
112
106
|
port?: number | undefined;
|
|
113
107
|
trailingSlash?: "always" | "never" | "ignore" | undefined;
|
|
114
108
|
}>>>;
|
|
109
|
+
experimentalIntegrations: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
115
110
|
vite: z.ZodDefault<z.ZodOptional<z.ZodAny>>;
|
|
116
111
|
}, "strip", z.ZodTypeAny, {
|
|
117
112
|
adapter?: {
|
|
@@ -153,6 +148,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
153
148
|
port: number;
|
|
154
149
|
trailingSlash: "always" | "never" | "ignore";
|
|
155
150
|
};
|
|
151
|
+
experimentalIntegrations: boolean;
|
|
156
152
|
}, {
|
|
157
153
|
projectRoot?: string | undefined;
|
|
158
154
|
src?: string | undefined;
|
|
@@ -192,6 +188,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
192
188
|
port?: number | undefined;
|
|
193
189
|
trailingSlash?: "always" | "never" | "ignore" | undefined;
|
|
194
190
|
} | undefined;
|
|
191
|
+
experimentalIntegrations?: boolean | undefined;
|
|
195
192
|
vite?: any;
|
|
196
193
|
}>;
|
|
197
194
|
/** Turn raw config values into normalized values */
|