astro 4.0.2 → 4.0.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/astro-jsx.d.ts +2 -1
- package/dist/@types/astro.d.ts +3 -0
- package/dist/cli/add/index.js +35 -3
- package/dist/core/build/buildPipeline.js +9 -2
- package/dist/core/build/generate.js +10 -5
- package/dist/core/build/index.js +2 -2
- package/dist/core/build/plugin.d.ts +2 -2
- package/dist/core/build/plugin.js +1 -13
- package/dist/core/build/static-build.d.ts +2 -1
- package/dist/core/build/static-build.js +22 -18
- package/dist/core/build/util.d.ts +3 -0
- package/dist/core/build/util.js +11 -1
- package/dist/core/compile/compile.d.ts +3 -1
- package/dist/core/compile/compile.js +2 -1
- package/dist/core/config/schema.d.ts +26 -26
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/logger/core.d.ts +1 -1
- package/dist/core/messages.js +3 -3
- package/dist/core/routing/manifest/create.js +14 -0
- package/dist/runtime/client/dev-overlay/plugins/settings.js +1 -1
- package/dist/vite-plugin-astro/index.js +2 -0
- package/dist/vite-plugin-astro-server/route.js +9 -15
- package/package.json +5 -4
package/astro-jsx.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ declare namespace astroHTML.JSX {
|
|
|
36
36
|
AstroDefineVarsAttribute;
|
|
37
37
|
type AstroStyleAttributes = import('./dist/@types/astro.js').AstroStyleAttributes &
|
|
38
38
|
AstroDefineVarsAttribute;
|
|
39
|
+
type AstroSlotAttributes = import('./dist/@types/astro.js').AstroSlotAttributes;
|
|
39
40
|
|
|
40
41
|
// This is an unfortunate use of `any`, but unfortunately we can't make a type that works for every framework
|
|
41
42
|
// without importing every single framework's types (which comes with its own set of problems).
|
|
@@ -1415,7 +1416,7 @@ declare namespace astroHTML.JSX {
|
|
|
1415
1416
|
ruby: HTMLAttributes;
|
|
1416
1417
|
s: HTMLAttributes;
|
|
1417
1418
|
samp: HTMLAttributes;
|
|
1418
|
-
slot: SlotHTMLAttributes;
|
|
1419
|
+
slot: SlotHTMLAttributes & AstroSlotAttributes;
|
|
1419
1420
|
script: ScriptHTMLAttributes & AstroScriptAttributes;
|
|
1420
1421
|
section: HTMLAttributes;
|
|
1421
1422
|
select: SelectHTMLAttributes;
|
package/dist/@types/astro.d.ts
CHANGED
|
@@ -73,6 +73,9 @@ export interface AstroStyleAttributes {
|
|
|
73
73
|
export interface AstroScriptAttributes {
|
|
74
74
|
'is:inline'?: boolean;
|
|
75
75
|
}
|
|
76
|
+
export interface AstroSlotAttributes {
|
|
77
|
+
'is:inline'?: boolean;
|
|
78
|
+
}
|
|
76
79
|
export interface AstroComponentMetadata {
|
|
77
80
|
displayName: string;
|
|
78
81
|
hydrate?: 'load' | 'idle' | 'visible' | 'media' | 'only';
|
package/dist/cli/add/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { bold, cyan, dim, green, magenta, red, yellow } from "kleur/colors";
|
|
|
5
5
|
import fsMod, { existsSync, promises as fs } from "node:fs";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
8
|
+
import maxSatisfying from "semver/ranges/max-satisfying.js";
|
|
8
9
|
import ora from "ora";
|
|
9
10
|
import preferredPM from "preferred-pm";
|
|
10
11
|
import prompts from "prompts";
|
|
@@ -507,9 +508,7 @@ async function getInstallIntegrationsCommand({
|
|
|
507
508
|
logger.debug("add", `package manager: ${JSON.stringify(pm)}`);
|
|
508
509
|
if (!pm)
|
|
509
510
|
return null;
|
|
510
|
-
|
|
511
|
-
([name, version]) => version === null ? name : `${name}@${version.split(/\s*\|\|\s*/).pop()}`
|
|
512
|
-
).sort();
|
|
511
|
+
const dependencies = await convertIntegrationsToInstallSpecifiers(integrations);
|
|
513
512
|
switch (pm.name) {
|
|
514
513
|
case "npm":
|
|
515
514
|
return { pm: "npm", command: "install", flags: [], dependencies };
|
|
@@ -523,6 +522,26 @@ async function getInstallIntegrationsCommand({
|
|
|
523
522
|
return null;
|
|
524
523
|
}
|
|
525
524
|
}
|
|
525
|
+
async function convertIntegrationsToInstallSpecifiers(integrations) {
|
|
526
|
+
const ranges = {};
|
|
527
|
+
for (let { packageName, dependencies } of integrations) {
|
|
528
|
+
ranges[packageName] = "*";
|
|
529
|
+
for (const [name, range] of dependencies) {
|
|
530
|
+
ranges[name] = range;
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
return Promise.all(
|
|
534
|
+
Object.entries(ranges).map(([name, range]) => resolveRangeToInstallSpecifier(name, range))
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
async function resolveRangeToInstallSpecifier(name, range) {
|
|
538
|
+
const versions = await fetchPackageVersions(name);
|
|
539
|
+
if (versions instanceof Error)
|
|
540
|
+
return name;
|
|
541
|
+
const stableVersions = versions.filter((v) => !v.includes("-"));
|
|
542
|
+
const maxStable = maxSatisfying(stableVersions, range);
|
|
543
|
+
return `${name}@^${maxStable}`;
|
|
544
|
+
}
|
|
526
545
|
const INHERITED_FLAGS = /* @__PURE__ */ new Set([
|
|
527
546
|
"P",
|
|
528
547
|
"save-prod",
|
|
@@ -614,6 +633,19 @@ async function fetchPackageJson(scope, name, tag) {
|
|
|
614
633
|
return new Error(`Failed to fetch ${registry}/${packageName}/${tag} - GET ${res.status}`);
|
|
615
634
|
}
|
|
616
635
|
}
|
|
636
|
+
async function fetchPackageVersions(packageName) {
|
|
637
|
+
const registry = await getRegistry();
|
|
638
|
+
const res = await fetch(`${registry}/${packageName}`, {
|
|
639
|
+
headers: { accept: "application/vnd.npm.install-v1+json" }
|
|
640
|
+
});
|
|
641
|
+
if (res.status >= 200 && res.status < 300) {
|
|
642
|
+
return await res.json().then((data) => Object.keys(data.versions));
|
|
643
|
+
} else if (res.status === 404) {
|
|
644
|
+
return new Error();
|
|
645
|
+
} else {
|
|
646
|
+
return new Error(`Failed to fetch ${registry}/${packageName} - GET ${res.status}`);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
617
649
|
async function validateIntegrations(integrations) {
|
|
618
650
|
const spinner = ora("Resolving packages...").start();
|
|
619
651
|
try {
|
|
@@ -4,7 +4,10 @@ import { Pipeline } from "../pipeline.js";
|
|
|
4
4
|
import { routeIsFallback, routeIsRedirect } from "../redirects/helpers.js";
|
|
5
5
|
import { createEnvironment } from "../render/index.js";
|
|
6
6
|
import { createAssetLink } from "../render/ssr-element.js";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
ASTRO_PAGE_RESOLVED_MODULE_ID,
|
|
9
|
+
getVirtualModulePageNameFromPath
|
|
10
|
+
} from "./plugins/plugin-pages.js";
|
|
8
11
|
import { RESOLVED_SPLIT_MODULE_ID } from "./plugins/plugin-ssr.js";
|
|
9
12
|
import { ASTRO_PAGE_EXTENSION_POST_PATTERN } from "./plugins/util.js";
|
|
10
13
|
import { i18nHasFallback } from "./util.js";
|
|
@@ -131,7 +134,11 @@ class BuildPipeline extends Pipeline {
|
|
|
131
134
|
if (routeIsRedirect(pageData.route)) {
|
|
132
135
|
pages.set(pageData, path);
|
|
133
136
|
} else if (routeIsFallback(pageData.route) && (i18nHasFallback(this.getConfig()) || routeIsFallback(pageData.route) && pageData.route.route === "/")) {
|
|
134
|
-
|
|
137
|
+
const moduleSpecifier = getVirtualModulePageNameFromPath(path);
|
|
138
|
+
const filePath = this.#internals.entrySpecifierToBundleMap.get(moduleSpecifier);
|
|
139
|
+
if (filePath) {
|
|
140
|
+
pages.set(pageData, filePath);
|
|
141
|
+
}
|
|
135
142
|
}
|
|
136
143
|
}
|
|
137
144
|
return pages;
|
|
@@ -223,11 +223,7 @@ async function generatePage(pageData, ssrEntry, builtPaths, pipeline) {
|
|
|
223
223
|
};
|
|
224
224
|
for (const route of eachRouteInRouteData(pageData)) {
|
|
225
225
|
const icon = route.type === "page" || route.type === "redirect" || route.type === "fallback" ? green("\u25B6") : magenta("\u03BB");
|
|
226
|
-
|
|
227
|
-
logger.info(null, `${icon} ${route.route}`);
|
|
228
|
-
} else {
|
|
229
|
-
logger.info(null, `${icon} ${route.component}`);
|
|
230
|
-
}
|
|
226
|
+
logger.info(null, `${icon} ${getPrettyRouteName(route)}`);
|
|
231
227
|
const paths = await getPathsForRoute(route, pageModule, pipeline, builtPaths);
|
|
232
228
|
let timeStart = performance.now();
|
|
233
229
|
let prevTimeEnd = timeStart;
|
|
@@ -453,6 +449,15 @@ async function generatePath(pathname, pipeline, gopts, route) {
|
|
|
453
449
|
await fs.promises.mkdir(outFolder, { recursive: true });
|
|
454
450
|
await fs.promises.writeFile(outFile, body);
|
|
455
451
|
}
|
|
452
|
+
function getPrettyRouteName(route) {
|
|
453
|
+
if (isRelativePath(route.component)) {
|
|
454
|
+
return route.route;
|
|
455
|
+
} else if (route.component.includes("node_modules/")) {
|
|
456
|
+
return route.component.match(/.*node_modules\/(.+)/)?.[1] ?? route.component;
|
|
457
|
+
} else {
|
|
458
|
+
return route.component;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
456
461
|
function createBuildManifest(settings, internals, renderers) {
|
|
457
462
|
let i18nManifest = void 0;
|
|
458
463
|
if (settings.config.i18n) {
|
package/dist/core/build/index.js
CHANGED
|
@@ -132,8 +132,8 @@ class AstroBuilder {
|
|
|
132
132
|
teardownCompiler: this.teardownCompiler,
|
|
133
133
|
viteConfig
|
|
134
134
|
};
|
|
135
|
-
const { internals } = await viteBuild(opts);
|
|
136
|
-
await staticBuild(opts, internals);
|
|
135
|
+
const { internals, ssrOutputChunkNames } = await viteBuild(opts);
|
|
136
|
+
await staticBuild(opts, internals, ssrOutputChunkNames);
|
|
137
137
|
this.timer.assetsStart = performance.now();
|
|
138
138
|
Object.keys(assets).map((k) => {
|
|
139
139
|
if (!assets[k])
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Plugin as VitePlugin } from 'vite';
|
|
1
|
+
import type { Plugin as VitePlugin, Rollup } from 'vite';
|
|
2
2
|
import type { BuildInternals } from './internal.js';
|
|
3
3
|
import type { StaticBuildOptions, ViteBuildReturn } from './types.js';
|
|
4
4
|
type RollupOutputArray = Extract<ViteBuildReturn, Array<any>>;
|
|
@@ -34,7 +34,7 @@ export declare function createPluginContainer(options: StaticBuildOptions, inter
|
|
|
34
34
|
vitePlugins: (VitePlugin<any> | VitePlugin<any>[])[];
|
|
35
35
|
lastVitePlugins: (VitePlugin<any> | VitePlugin<any>[])[];
|
|
36
36
|
}>;
|
|
37
|
-
runPostHook(
|
|
37
|
+
runPostHook(ssrOutputs: Rollup.RollupOutput[], clientOutputs: Rollup.RollupOutput[]): Promise<Map<string, {
|
|
38
38
|
targets: BuildTarget[];
|
|
39
39
|
code: string;
|
|
40
40
|
}>>;
|
|
@@ -33,20 +33,8 @@ function createPluginContainer(options, internals) {
|
|
|
33
33
|
lastVitePlugins
|
|
34
34
|
};
|
|
35
35
|
},
|
|
36
|
-
async runPostHook(
|
|
36
|
+
async runPostHook(ssrOutputs, clientOutputs) {
|
|
37
37
|
const mutations = /* @__PURE__ */ new Map();
|
|
38
|
-
const ssrOutputs = [];
|
|
39
|
-
const clientOutputs = [];
|
|
40
|
-
if (Array.isArray(ssrReturn)) {
|
|
41
|
-
ssrOutputs.push(...ssrReturn);
|
|
42
|
-
} else if ("output" in ssrReturn) {
|
|
43
|
-
ssrOutputs.push(ssrReturn);
|
|
44
|
-
}
|
|
45
|
-
if (Array.isArray(clientReturn)) {
|
|
46
|
-
clientOutputs.push(...clientReturn);
|
|
47
|
-
} else if (clientReturn && "output" in clientReturn) {
|
|
48
|
-
clientOutputs.push(clientReturn);
|
|
49
|
-
}
|
|
50
38
|
const mutate = (chunk, targets, newCode) => {
|
|
51
39
|
chunk.code = newCode;
|
|
52
40
|
mutations.set(chunk.fileName, {
|
|
@@ -3,8 +3,9 @@ import { type BuildInternals } from '../../core/build/internal.js';
|
|
|
3
3
|
import type { StaticBuildOptions } from './types.js';
|
|
4
4
|
export declare function viteBuild(opts: StaticBuildOptions): Promise<{
|
|
5
5
|
internals: BuildInternals;
|
|
6
|
+
ssrOutputChunkNames: string[];
|
|
6
7
|
}>;
|
|
7
|
-
export declare function staticBuild(opts: StaticBuildOptions, internals: BuildInternals): Promise<void>;
|
|
8
|
+
export declare function staticBuild(opts: StaticBuildOptions, internals: BuildInternals, ssrOutputChunkNames: string[]): Promise<void>;
|
|
8
9
|
export declare function copyFiles(fromFolder: URL, toFolder: URL, includeDotfiles?: boolean): Promise<void>;
|
|
9
10
|
/**
|
|
10
11
|
* This function takes the virtual module name of any page entrypoint and
|
|
@@ -30,7 +30,7 @@ import { ASTRO_PAGE_RESOLVED_MODULE_ID } from "./plugins/plugin-pages.js";
|
|
|
30
30
|
import { RESOLVED_RENDERERS_MODULE_ID } from "./plugins/plugin-renderers.js";
|
|
31
31
|
import { RESOLVED_SPLIT_MODULE_ID, RESOLVED_SSR_VIRTUAL_MODULE_ID } from "./plugins/plugin-ssr.js";
|
|
32
32
|
import { ASTRO_PAGE_EXTENSION_POST_PATTERN } from "./plugins/util.js";
|
|
33
|
-
import { encodeName, getTimeStat } from "./util.js";
|
|
33
|
+
import { encodeName, getTimeStat, viteBuildReturnToRollupOutputs } from "./util.js";
|
|
34
34
|
async function viteBuild(opts) {
|
|
35
35
|
const { allPages, settings } = opts;
|
|
36
36
|
if (isModeServerWithNoAdapter(opts.settings)) {
|
|
@@ -70,28 +70,38 @@ async function viteBuild(opts) {
|
|
|
70
70
|
clientInput.add(PAGE_SCRIPT_ID);
|
|
71
71
|
}
|
|
72
72
|
const clientOutput = await clientBuild(opts, internals, clientInput, container);
|
|
73
|
-
|
|
73
|
+
const ssrOutputs = viteBuildReturnToRollupOutputs(ssrOutput);
|
|
74
|
+
const clientOutputs = viteBuildReturnToRollupOutputs(clientOutput ?? []);
|
|
75
|
+
await runPostBuildHooks(container, ssrOutputs, clientOutputs);
|
|
74
76
|
settings.timer.end("Client build");
|
|
75
77
|
internals.ssrEntryChunk = void 0;
|
|
76
78
|
if (opts.teardownCompiler) {
|
|
77
79
|
teardown();
|
|
78
80
|
}
|
|
79
|
-
|
|
81
|
+
const ssrOutputChunkNames = [];
|
|
82
|
+
for (const output of ssrOutputs) {
|
|
83
|
+
for (const chunk of output.output) {
|
|
84
|
+
if (chunk.type === "chunk") {
|
|
85
|
+
ssrOutputChunkNames.push(chunk.fileName);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return { internals, ssrOutputChunkNames };
|
|
80
90
|
}
|
|
81
|
-
async function staticBuild(opts, internals) {
|
|
91
|
+
async function staticBuild(opts, internals, ssrOutputChunkNames) {
|
|
82
92
|
const { settings } = opts;
|
|
83
93
|
switch (true) {
|
|
84
94
|
case settings.config.output === "static": {
|
|
85
95
|
settings.timer.start("Static generate");
|
|
86
96
|
await generatePages(opts, internals);
|
|
87
|
-
await cleanServerOutput(opts);
|
|
97
|
+
await cleanServerOutput(opts, ssrOutputChunkNames);
|
|
88
98
|
settings.timer.end("Static generate");
|
|
89
99
|
return;
|
|
90
100
|
}
|
|
91
101
|
case isServerLikeOutput(settings.config): {
|
|
92
102
|
settings.timer.start("Server generate");
|
|
93
103
|
await generatePages(opts, internals);
|
|
94
|
-
await cleanStaticOutput(opts, internals);
|
|
104
|
+
await cleanStaticOutput(opts, internals, ssrOutputChunkNames);
|
|
95
105
|
opts.logger.info(null, `
|
|
96
106
|
${bgMagenta(black(" finalizing server assets "))}
|
|
97
107
|
`);
|
|
@@ -254,8 +264,8 @@ ${bgGreen(black(" building client (vite) "))}`);
|
|
|
254
264
|
const buildResult = await vite.build(viteBuildConfig);
|
|
255
265
|
return buildResult;
|
|
256
266
|
}
|
|
257
|
-
async function runPostBuildHooks(container,
|
|
258
|
-
const mutations = await container.runPostHook(
|
|
267
|
+
async function runPostBuildHooks(container, ssrOutputs, clientOutputs) {
|
|
268
|
+
const mutations = await container.runPostHook(ssrOutputs, clientOutputs);
|
|
259
269
|
const config = container.options.settings.config;
|
|
260
270
|
const build = container.options.settings.config.build;
|
|
261
271
|
for (const [fileName, mutation] of mutations) {
|
|
@@ -266,7 +276,7 @@ async function runPostBuildHooks(container, ssrReturn, clientReturn) {
|
|
|
266
276
|
await fs.promises.writeFile(fileURL, mutation.code, "utf-8");
|
|
267
277
|
}
|
|
268
278
|
}
|
|
269
|
-
async function cleanStaticOutput(opts, internals) {
|
|
279
|
+
async function cleanStaticOutput(opts, internals, ssrOutputChunkNames) {
|
|
270
280
|
const allStaticFiles = /* @__PURE__ */ new Set();
|
|
271
281
|
for (const pageData of eachPageData(internals)) {
|
|
272
282
|
if (pageData.route.prerender) {
|
|
@@ -278,9 +288,7 @@ async function cleanStaticOutput(opts, internals) {
|
|
|
278
288
|
}
|
|
279
289
|
const ssr = isServerLikeOutput(opts.settings.config);
|
|
280
290
|
const out = ssr ? opts.settings.config.build.server : getOutDirWithinCwd(opts.settings.config.outDir);
|
|
281
|
-
const files =
|
|
282
|
-
cwd: fileURLToPath(out)
|
|
283
|
-
});
|
|
291
|
+
const files = ssrOutputChunkNames.filter((f) => f.endsWith(".mjs"));
|
|
284
292
|
if (files.length) {
|
|
285
293
|
await eslexer.init;
|
|
286
294
|
await Promise.all(
|
|
@@ -306,13 +314,9 @@ export const ${e.n} = noop;`;
|
|
|
306
314
|
removeEmptyDirs(out);
|
|
307
315
|
}
|
|
308
316
|
}
|
|
309
|
-
async function cleanServerOutput(opts) {
|
|
317
|
+
async function cleanServerOutput(opts, ssrOutputChunkNames) {
|
|
310
318
|
const out = getOutDirWithinCwd(opts.settings.config.outDir);
|
|
311
|
-
const files =
|
|
312
|
-
cwd: fileURLToPath(out),
|
|
313
|
-
// Important! Also cleanup dotfiles like `node_modules/.pnpm/**`
|
|
314
|
-
dot: true
|
|
315
|
-
});
|
|
319
|
+
const files = ssrOutputChunkNames.filter((f) => f.endsWith(".mjs"));
|
|
316
320
|
if (files.length) {
|
|
317
321
|
await Promise.all(
|
|
318
322
|
files.map(async (filename) => {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { Rollup } from 'vite';
|
|
1
2
|
import type { AstroConfig } from '../../@types/astro.js';
|
|
3
|
+
import type { ViteBuildReturn } from './types.js';
|
|
2
4
|
export declare function getTimeStat(timeStart: number, timeEnd: number): string;
|
|
3
5
|
/**
|
|
4
6
|
* Given the Astro configuration, it tells if a slash should be appended or not
|
|
@@ -6,3 +8,4 @@ export declare function getTimeStat(timeStart: number, timeEnd: number): string;
|
|
|
6
8
|
export declare function shouldAppendForwardSlash(trailingSlash: AstroConfig['trailingSlash'], buildFormat: AstroConfig['build']['format']): boolean;
|
|
7
9
|
export declare function i18nHasFallback(config: AstroConfig): boolean;
|
|
8
10
|
export declare function encodeName(name: string): string;
|
|
11
|
+
export declare function viteBuildReturnToRollupOutputs(viteBuildReturn: ViteBuildReturn): Rollup.RollupOutput[];
|
package/dist/core/build/util.js
CHANGED
|
@@ -35,9 +35,19 @@ function encodeName(name) {
|
|
|
35
35
|
}
|
|
36
36
|
return name;
|
|
37
37
|
}
|
|
38
|
+
function viteBuildReturnToRollupOutputs(viteBuildReturn) {
|
|
39
|
+
const result = [];
|
|
40
|
+
if (Array.isArray(viteBuildReturn)) {
|
|
41
|
+
result.push(...viteBuildReturn);
|
|
42
|
+
} else if ("output" in viteBuildReturn) {
|
|
43
|
+
result.push(viteBuildReturn);
|
|
44
|
+
}
|
|
45
|
+
return result;
|
|
46
|
+
}
|
|
38
47
|
export {
|
|
39
48
|
encodeName,
|
|
40
49
|
getTimeStat,
|
|
41
50
|
i18nHasFallback,
|
|
42
|
-
shouldAppendForwardSlash
|
|
51
|
+
shouldAppendForwardSlash,
|
|
52
|
+
viteBuildReturnToRollupOutputs
|
|
43
53
|
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { TransformResult } from '@astrojs/compiler';
|
|
2
2
|
import type { ResolvedConfig } from 'vite';
|
|
3
3
|
import type { AstroConfig } from '../../@types/astro.js';
|
|
4
|
+
import type { AstroPreferences } from '../../preferences/index.js';
|
|
4
5
|
export interface CompileProps {
|
|
5
6
|
astroConfig: AstroConfig;
|
|
6
7
|
viteConfig: ResolvedConfig;
|
|
8
|
+
preferences: AstroPreferences;
|
|
7
9
|
filename: string;
|
|
8
10
|
source: string;
|
|
9
11
|
}
|
|
@@ -11,4 +13,4 @@ export interface CompileResult extends TransformResult {
|
|
|
11
13
|
cssDeps: Set<string>;
|
|
12
14
|
source: string;
|
|
13
15
|
}
|
|
14
|
-
export declare function compile({ astroConfig, viteConfig, filename, source, }: CompileProps): Promise<CompileResult>;
|
|
16
|
+
export declare function compile({ astroConfig, viteConfig, preferences, filename, source, }: CompileProps): Promise<CompileResult>;
|
|
@@ -8,6 +8,7 @@ import { createStylePreprocessor } from "./style.js";
|
|
|
8
8
|
async function compile({
|
|
9
9
|
astroConfig,
|
|
10
10
|
viteConfig,
|
|
11
|
+
preferences,
|
|
11
12
|
filename,
|
|
12
13
|
source
|
|
13
14
|
}) {
|
|
@@ -25,7 +26,7 @@ async function compile({
|
|
|
25
26
|
scopedStyleStrategy: astroConfig.scopedStyleStrategy,
|
|
26
27
|
resultScopedSlot: true,
|
|
27
28
|
transitionsAnimationURL: "astro/components/viewtransitions.css",
|
|
28
|
-
annotateSourceFile: viteConfig.command === "serve" && astroConfig.devToolbar && astroConfig.devToolbar.enabled,
|
|
29
|
+
annotateSourceFile: viteConfig.command === "serve" && astroConfig.devToolbar && astroConfig.devToolbar.enabled && await preferences.get("devToolbar.enabled"),
|
|
29
30
|
preprocessStyle: createStylePreprocessor({
|
|
30
31
|
filename,
|
|
31
32
|
viteConfig,
|
|
@@ -57,12 +57,12 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
57
57
|
redirects: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
58
58
|
inlineStylesheets: z.ZodDefault<z.ZodOptional<z.ZodEnum<["always", "auto", "never"]>>>;
|
|
59
59
|
}, "strip", z.ZodTypeAny, {
|
|
60
|
+
redirects: boolean;
|
|
60
61
|
format: "file" | "directory";
|
|
61
62
|
client: URL;
|
|
62
63
|
server: URL;
|
|
63
64
|
assets: string;
|
|
64
65
|
serverEntry: string;
|
|
65
|
-
redirects: boolean;
|
|
66
66
|
inlineStylesheets: "always" | "never" | "auto";
|
|
67
67
|
assetsPrefix?: string | undefined;
|
|
68
68
|
}, {
|
|
@@ -308,12 +308,12 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
308
308
|
legacy: z.ZodDefault<z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>>;
|
|
309
309
|
}, "strip", z.ZodTypeAny, {
|
|
310
310
|
build: {
|
|
311
|
+
redirects: boolean;
|
|
311
312
|
format: "file" | "directory";
|
|
312
313
|
client: URL;
|
|
313
314
|
server: URL;
|
|
314
315
|
assets: string;
|
|
315
316
|
serverEntry: string;
|
|
316
|
-
redirects: boolean;
|
|
317
317
|
inlineStylesheets: "always" | "never" | "auto";
|
|
318
318
|
assetsPrefix?: string | undefined;
|
|
319
319
|
};
|
|
@@ -332,6 +332,10 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
332
332
|
smartypants: boolean;
|
|
333
333
|
};
|
|
334
334
|
vite: ViteUserConfig;
|
|
335
|
+
redirects: Record<string, string | {
|
|
336
|
+
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
337
|
+
destination: string;
|
|
338
|
+
}>;
|
|
335
339
|
output: "server" | "static" | "hybrid";
|
|
336
340
|
server: {
|
|
337
341
|
host: string | boolean;
|
|
@@ -339,10 +343,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
339
343
|
open: boolean;
|
|
340
344
|
headers?: OutgoingHttpHeaders | undefined;
|
|
341
345
|
};
|
|
342
|
-
redirects: Record<string, string | {
|
|
343
|
-
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
344
|
-
destination: string;
|
|
345
|
-
}>;
|
|
346
346
|
root: URL;
|
|
347
347
|
srcDir: URL;
|
|
348
348
|
publicDir: URL;
|
|
@@ -539,7 +539,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
539
539
|
smartypants?: boolean | undefined;
|
|
540
540
|
}>>;
|
|
541
541
|
vite: z.ZodDefault<z.ZodType<ViteUserConfig, z.ZodTypeDef, ViteUserConfig>>;
|
|
542
|
-
output: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"static">, z.ZodLiteral<"server">, z.ZodLiteral<"hybrid">]>>>;
|
|
543
542
|
redirects: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
544
543
|
status: z.ZodUnion<[z.ZodLiteral<300>, z.ZodLiteral<301>, z.ZodLiteral<302>, z.ZodLiteral<303>, z.ZodLiteral<304>, z.ZodLiteral<307>, z.ZodLiteral<308>]>;
|
|
545
544
|
destination: z.ZodString;
|
|
@@ -550,6 +549,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
550
549
|
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
551
550
|
destination: string;
|
|
552
551
|
}>]>>>;
|
|
552
|
+
output: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"static">, z.ZodLiteral<"server">, z.ZodLiteral<"hybrid">]>>>;
|
|
553
553
|
site: z.ZodOptional<z.ZodString>;
|
|
554
554
|
base: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
555
555
|
trailingSlash: z.ZodDefault<z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"always">, z.ZodLiteral<"never">, z.ZodLiteral<"ignore">]>>>;
|
|
@@ -748,12 +748,12 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
748
748
|
redirects: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
749
749
|
inlineStylesheets: z.ZodDefault<z.ZodOptional<z.ZodEnum<["always", "auto", "never"]>>>;
|
|
750
750
|
}, "strip", z.ZodTypeAny, {
|
|
751
|
+
redirects: boolean;
|
|
751
752
|
format: "file" | "directory";
|
|
752
753
|
client: import("url").URL;
|
|
753
754
|
server: import("url").URL;
|
|
754
755
|
assets: string;
|
|
755
756
|
serverEntry: string;
|
|
756
|
-
redirects: boolean;
|
|
757
757
|
inlineStylesheets: "always" | "never" | "auto";
|
|
758
758
|
assetsPrefix?: string | undefined;
|
|
759
759
|
}, {
|
|
@@ -793,12 +793,12 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
793
793
|
}, unknown>;
|
|
794
794
|
}, "strip", z.ZodTypeAny, {
|
|
795
795
|
build: {
|
|
796
|
+
redirects: boolean;
|
|
796
797
|
format: "file" | "directory";
|
|
797
798
|
client: import("url").URL;
|
|
798
799
|
server: import("url").URL;
|
|
799
800
|
assets: string;
|
|
800
801
|
serverEntry: string;
|
|
801
|
-
redirects: boolean;
|
|
802
802
|
inlineStylesheets: "always" | "never" | "auto";
|
|
803
803
|
assetsPrefix?: string | undefined;
|
|
804
804
|
};
|
|
@@ -817,6 +817,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
817
817
|
smartypants: boolean;
|
|
818
818
|
};
|
|
819
819
|
vite: ViteUserConfig;
|
|
820
|
+
redirects: Record<string, string | {
|
|
821
|
+
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
822
|
+
destination: string;
|
|
823
|
+
}>;
|
|
820
824
|
output: "server" | "static" | "hybrid";
|
|
821
825
|
server: {
|
|
822
826
|
host: string | boolean;
|
|
@@ -825,10 +829,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
825
829
|
streaming: boolean;
|
|
826
830
|
headers?: OutgoingHttpHeaders | undefined;
|
|
827
831
|
};
|
|
828
|
-
redirects: Record<string, string | {
|
|
829
|
-
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
830
|
-
destination: string;
|
|
831
|
-
}>;
|
|
832
832
|
root: import("url").URL;
|
|
833
833
|
srcDir: import("url").URL;
|
|
834
834
|
publicDir: import("url").URL;
|
|
@@ -902,11 +902,11 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
902
902
|
smartypants?: boolean | undefined;
|
|
903
903
|
} | undefined;
|
|
904
904
|
vite?: ViteUserConfig | undefined;
|
|
905
|
-
output?: "server" | "static" | "hybrid" | undefined;
|
|
906
905
|
redirects?: Record<string, string | {
|
|
907
906
|
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
908
907
|
destination: string;
|
|
909
908
|
}> | undefined;
|
|
909
|
+
output?: "server" | "static" | "hybrid" | undefined;
|
|
910
910
|
site?: string | undefined;
|
|
911
911
|
base?: string | undefined;
|
|
912
912
|
trailingSlash?: "ignore" | "always" | "never" | undefined;
|
|
@@ -973,12 +973,12 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
973
973
|
server?: unknown;
|
|
974
974
|
}>, {
|
|
975
975
|
build: {
|
|
976
|
+
redirects: boolean;
|
|
976
977
|
format: "file" | "directory";
|
|
977
978
|
client: import("url").URL;
|
|
978
979
|
server: import("url").URL;
|
|
979
980
|
assets: string;
|
|
980
981
|
serverEntry: string;
|
|
981
|
-
redirects: boolean;
|
|
982
982
|
inlineStylesheets: "always" | "never" | "auto";
|
|
983
983
|
assetsPrefix?: string | undefined;
|
|
984
984
|
};
|
|
@@ -997,6 +997,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
997
997
|
smartypants: boolean;
|
|
998
998
|
};
|
|
999
999
|
vite: ViteUserConfig;
|
|
1000
|
+
redirects: Record<string, string | {
|
|
1001
|
+
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
1002
|
+
destination: string;
|
|
1003
|
+
}>;
|
|
1000
1004
|
output: "server" | "static" | "hybrid";
|
|
1001
1005
|
server: {
|
|
1002
1006
|
host: string | boolean;
|
|
@@ -1005,10 +1009,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1005
1009
|
streaming: boolean;
|
|
1006
1010
|
headers?: OutgoingHttpHeaders | undefined;
|
|
1007
1011
|
};
|
|
1008
|
-
redirects: Record<string, string | {
|
|
1009
|
-
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
1010
|
-
destination: string;
|
|
1011
|
-
}>;
|
|
1012
1012
|
root: import("url").URL;
|
|
1013
1013
|
srcDir: import("url").URL;
|
|
1014
1014
|
publicDir: import("url").URL;
|
|
@@ -1082,11 +1082,11 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1082
1082
|
smartypants?: boolean | undefined;
|
|
1083
1083
|
} | undefined;
|
|
1084
1084
|
vite?: ViteUserConfig | undefined;
|
|
1085
|
-
output?: "server" | "static" | "hybrid" | undefined;
|
|
1086
1085
|
redirects?: Record<string, string | {
|
|
1087
1086
|
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
1088
1087
|
destination: string;
|
|
1089
1088
|
}> | undefined;
|
|
1089
|
+
output?: "server" | "static" | "hybrid" | undefined;
|
|
1090
1090
|
site?: string | undefined;
|
|
1091
1091
|
base?: string | undefined;
|
|
1092
1092
|
trailingSlash?: "ignore" | "always" | "never" | undefined;
|
|
@@ -1153,12 +1153,12 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1153
1153
|
server?: unknown;
|
|
1154
1154
|
}>, {
|
|
1155
1155
|
build: {
|
|
1156
|
+
redirects: boolean;
|
|
1156
1157
|
format: "file" | "directory";
|
|
1157
1158
|
client: import("url").URL;
|
|
1158
1159
|
server: import("url").URL;
|
|
1159
1160
|
assets: string;
|
|
1160
1161
|
serverEntry: string;
|
|
1161
|
-
redirects: boolean;
|
|
1162
1162
|
inlineStylesheets: "always" | "never" | "auto";
|
|
1163
1163
|
assetsPrefix?: string | undefined;
|
|
1164
1164
|
};
|
|
@@ -1177,6 +1177,10 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1177
1177
|
smartypants: boolean;
|
|
1178
1178
|
};
|
|
1179
1179
|
vite: ViteUserConfig;
|
|
1180
|
+
redirects: Record<string, string | {
|
|
1181
|
+
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
1182
|
+
destination: string;
|
|
1183
|
+
}>;
|
|
1180
1184
|
output: "server" | "static" | "hybrid";
|
|
1181
1185
|
server: {
|
|
1182
1186
|
host: string | boolean;
|
|
@@ -1185,10 +1189,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1185
1189
|
streaming: boolean;
|
|
1186
1190
|
headers?: OutgoingHttpHeaders | undefined;
|
|
1187
1191
|
};
|
|
1188
|
-
redirects: Record<string, string | {
|
|
1189
|
-
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
1190
|
-
destination: string;
|
|
1191
|
-
}>;
|
|
1192
1192
|
root: import("url").URL;
|
|
1193
1193
|
srcDir: import("url").URL;
|
|
1194
1194
|
publicDir: import("url").URL;
|
|
@@ -1262,11 +1262,11 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1262
1262
|
smartypants?: boolean | undefined;
|
|
1263
1263
|
} | undefined;
|
|
1264
1264
|
vite?: ViteUserConfig | undefined;
|
|
1265
|
-
output?: "server" | "static" | "hybrid" | undefined;
|
|
1266
1265
|
redirects?: Record<string, string | {
|
|
1267
1266
|
status: 300 | 301 | 302 | 303 | 304 | 307 | 308;
|
|
1268
1267
|
destination: string;
|
|
1269
1268
|
}> | undefined;
|
|
1269
|
+
output?: "server" | "static" | "hybrid" | undefined;
|
|
1270
1270
|
site?: string | undefined;
|
|
1271
1271
|
base?: string | undefined;
|
|
1272
1272
|
trailingSlash?: "ignore" | "always" | "never" | undefined;
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -21,7 +21,7 @@ async function dev(inlineConfig) {
|
|
|
21
21
|
base: restart.container.settings.config.base
|
|
22
22
|
})
|
|
23
23
|
);
|
|
24
|
-
const currentVersion = "4.0.
|
|
24
|
+
const currentVersion = "4.0.4";
|
|
25
25
|
if (currentVersion.includes("-")) {
|
|
26
26
|
logger.warn("SKIP_FORMAT", msg.prerelease({ currentVersion }));
|
|
27
27
|
}
|
|
@@ -7,7 +7,7 @@ export type LoggerLevel = 'debug' | 'info' | 'warn' | 'error' | 'silent';
|
|
|
7
7
|
* rather than specific to a single command, function, use, etc. The label will be
|
|
8
8
|
* shown in the log message to the user, so it should be relevant.
|
|
9
9
|
*/
|
|
10
|
-
export type LoggerLabel = 'add' | 'build' | 'check' | 'config' | 'content' | 'deprecated' | 'markdown' | 'router' | 'types' | 'vite' | 'watch' | 'middleware' | 'preferences' | 'SKIP_FORMAT';
|
|
10
|
+
export type LoggerLabel = 'add' | 'build' | 'check' | 'config' | 'content' | 'deprecated' | 'markdown' | 'router' | 'types' | 'vite' | 'watch' | 'middleware' | 'preferences' | 'redirects' | 'SKIP_FORMAT';
|
|
11
11
|
export interface LogOptions {
|
|
12
12
|
dest: LogWritable<LogMessage>;
|
|
13
13
|
level: LoggerLevel;
|
package/dist/core/messages.js
CHANGED
|
@@ -27,7 +27,7 @@ function req({
|
|
|
27
27
|
statusCode,
|
|
28
28
|
reqTime
|
|
29
29
|
}) {
|
|
30
|
-
const color = statusCode >=
|
|
30
|
+
const color = statusCode >= 500 ? red : statusCode >= 300 ? yellow : blue;
|
|
31
31
|
return color(`[${statusCode}]`) + ` ` + (method && method !== "GET" ? color(method) + " " : "") + url + ` ` + (reqTime ? dim(Math.round(reqTime) + "ms") : "");
|
|
32
32
|
}
|
|
33
33
|
function serverStart({
|
|
@@ -36,7 +36,7 @@ function serverStart({
|
|
|
36
36
|
host,
|
|
37
37
|
base
|
|
38
38
|
}) {
|
|
39
|
-
const version = "4.0.
|
|
39
|
+
const version = "4.0.4";
|
|
40
40
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
41
41
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
42
42
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -258,7 +258,7 @@ function printHelp({
|
|
|
258
258
|
message.push(
|
|
259
259
|
linebreak(),
|
|
260
260
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
261
|
-
`v${"4.0.
|
|
261
|
+
`v${"4.0.4"}`
|
|
262
262
|
)} ${headline}`
|
|
263
263
|
);
|
|
264
264
|
}
|
|
@@ -308,6 +308,20 @@ This route collides with: "${collision.component}".`
|
|
|
308
308
|
const pathname = segments.every((segment) => segment.length === 1 && !segment[0].dynamic) ? `/${segments.map((segment) => segment[0].content).join("/")}` : null;
|
|
309
309
|
const params = segments.flat().filter((p) => p.dynamic).map((p) => p.content);
|
|
310
310
|
const route = `/${segments.map(([{ dynamic, content }]) => dynamic ? `[${content}]` : content).join("/")}`.toLowerCase();
|
|
311
|
+
{
|
|
312
|
+
let destination;
|
|
313
|
+
if (typeof to === "string") {
|
|
314
|
+
destination = to;
|
|
315
|
+
} else {
|
|
316
|
+
destination = to.destination;
|
|
317
|
+
}
|
|
318
|
+
if (/^https?:\/\//.test(destination)) {
|
|
319
|
+
logger.warn(
|
|
320
|
+
"redirects",
|
|
321
|
+
`Redirecting to an external URL is not officially supported: ${from} -> ${to}`
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
311
325
|
const routeData = {
|
|
312
326
|
type: "redirect",
|
|
313
327
|
route,
|
|
@@ -13,7 +13,7 @@ const settingsRows = [
|
|
|
13
13
|
devOverlay.setNotificationVisible(!evt.currentTarget.checked);
|
|
14
14
|
}
|
|
15
15
|
settings.updateSetting("disablePluginNotification", evt.currentTarget.checked);
|
|
16
|
-
const action = evt.currentTarget.checked ? "
|
|
16
|
+
const action = evt.currentTarget.checked ? "disabled" : "enabled";
|
|
17
17
|
settings.log(`Plugin notification badges ${action}`);
|
|
18
18
|
}
|
|
19
19
|
}
|
|
@@ -113,6 +113,7 @@ File: ${id}`
|
|
|
113
113
|
const compileProps = {
|
|
114
114
|
astroConfig: config,
|
|
115
115
|
viteConfig: resolvedConfig,
|
|
116
|
+
preferences: settings.preferences,
|
|
116
117
|
filename: normalizePath(parsedId.filename),
|
|
117
118
|
source
|
|
118
119
|
};
|
|
@@ -149,6 +150,7 @@ File: ${id}`
|
|
|
149
150
|
const compile = () => cachedCompilation({
|
|
150
151
|
astroConfig: config,
|
|
151
152
|
viteConfig: resolvedConfig,
|
|
153
|
+
preferences: settings.preferences,
|
|
152
154
|
filename,
|
|
153
155
|
source
|
|
154
156
|
});
|
|
@@ -253,7 +253,7 @@ async function handleRoute({
|
|
|
253
253
|
req({
|
|
254
254
|
url: pathname,
|
|
255
255
|
method: incomingRequest.method,
|
|
256
|
-
statusCode: response.status,
|
|
256
|
+
statusCode: status ?? response.status,
|
|
257
257
|
reqTime: timeEnd - timeStart
|
|
258
258
|
})
|
|
259
259
|
);
|
|
@@ -277,22 +277,16 @@ async function handleRoute({
|
|
|
277
277
|
}
|
|
278
278
|
if (route.type === "endpoint") {
|
|
279
279
|
await writeWebResponse(incomingResponse, response);
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
// By default, the status code passed via parameters is computed by the matched route.
|
|
284
|
-
//
|
|
285
|
-
// By default, we should give priority to the status code passed, although it's possible that
|
|
286
|
-
// the `Response` emitted by the user is a redirect. If so, then return the returned response.
|
|
287
|
-
response.status < 400 && response.status >= 300
|
|
288
|
-
) {
|
|
289
|
-
await writeSSRResult(request, response, incomingResponse);
|
|
290
|
-
return;
|
|
291
|
-
} else if (status && response.status !== status && (status === 404 || status === 500)) {
|
|
292
|
-
response = new Response(response.body, { ...response, status });
|
|
293
|
-
}
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
if (response.status < 400 && response.status >= 300) {
|
|
294
283
|
await writeSSRResult(request, response, incomingResponse);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (status && response.status !== status && (status === 404 || status === 500)) {
|
|
287
|
+
response = new Response(response.body, { ...response, status });
|
|
295
288
|
}
|
|
289
|
+
await writeSSRResult(request, response, incomingResponse);
|
|
296
290
|
}
|
|
297
291
|
async function getScriptsAndStyles({ pipeline, filePath }) {
|
|
298
292
|
const moduleLoader = pipeline.getModuleLoader();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.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",
|
|
@@ -157,9 +157,9 @@
|
|
|
157
157
|
"which-pm": "^2.1.1",
|
|
158
158
|
"yargs-parser": "^21.1.1",
|
|
159
159
|
"zod": "^3.22.4",
|
|
160
|
-
"@astrojs/
|
|
161
|
-
"@astrojs/
|
|
162
|
-
"@astrojs/
|
|
160
|
+
"@astrojs/internal-helpers": "0.2.1",
|
|
161
|
+
"@astrojs/markdown-remark": "4.0.1",
|
|
162
|
+
"@astrojs/telemetry": "3.0.4"
|
|
163
163
|
},
|
|
164
164
|
"optionalDependencies": {
|
|
165
165
|
"sharp": "^0.32.5"
|
|
@@ -187,6 +187,7 @@
|
|
|
187
187
|
"@types/probe-image-size": "^7.2.3",
|
|
188
188
|
"@types/prompts": "^2.4.8",
|
|
189
189
|
"@types/resolve": "^1.20.5",
|
|
190
|
+
"@types/semver": "^7.5.2",
|
|
190
191
|
"@types/send": "^0.17.4",
|
|
191
192
|
"@types/server-destroy": "^1.0.3",
|
|
192
193
|
"@types/unist": "^3.0.2",
|