astro 5.0.6 → 5.0.7
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/content/content-layer.js +3 -3
- package/dist/core/build/index.js +2 -2
- package/dist/core/build/static-build.d.ts +1 -2
- package/dist/core/build/static-build.js +14 -12
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/messages.js +2 -2
- package/package.json +3 -3
|
@@ -114,7 +114,7 @@ class ContentLayer {
|
|
|
114
114
|
logger.info("Content config changed");
|
|
115
115
|
shouldClear = true;
|
|
116
116
|
}
|
|
117
|
-
if (previousAstroVersion !== "5.0.
|
|
117
|
+
if (previousAstroVersion !== "5.0.7") {
|
|
118
118
|
logger.info("Astro version changed");
|
|
119
119
|
shouldClear = true;
|
|
120
120
|
}
|
|
@@ -122,8 +122,8 @@ class ContentLayer {
|
|
|
122
122
|
logger.info("Clearing content store");
|
|
123
123
|
this.#store.clearAll();
|
|
124
124
|
}
|
|
125
|
-
if ("5.0.
|
|
126
|
-
await this.#store.metaStore().set("astro-version", "5.0.
|
|
125
|
+
if ("5.0.7") {
|
|
126
|
+
await this.#store.metaStore().set("astro-version", "5.0.7");
|
|
127
127
|
}
|
|
128
128
|
if (currentConfigDigest) {
|
|
129
129
|
await this.#store.metaStore().set("config-digest", currentConfigDigest);
|
package/dist/core/build/index.js
CHANGED
|
@@ -139,12 +139,12 @@ class AstroBuilder {
|
|
|
139
139
|
viteConfig,
|
|
140
140
|
key: keyPromise
|
|
141
141
|
};
|
|
142
|
-
const { internals, ssrOutputChunkNames,
|
|
142
|
+
const { internals, ssrOutputChunkNames, contentFileNames } = await viteBuild(opts);
|
|
143
143
|
const hasServerIslands = this.settings.serverIslandNameMap.size > 0;
|
|
144
144
|
if (hasServerIslands && this.settings.buildOutput !== "server") {
|
|
145
145
|
throw new AstroError(AstroErrorData.NoAdapterInstalledServerIslands);
|
|
146
146
|
}
|
|
147
|
-
await staticBuild(opts, internals, ssrOutputChunkNames,
|
|
147
|
+
await staticBuild(opts, internals, ssrOutputChunkNames, contentFileNames);
|
|
148
148
|
this.timer.assetsStart = performance.now();
|
|
149
149
|
Object.keys(assets).map((k) => {
|
|
150
150
|
if (!assets[k]) return;
|
|
@@ -4,10 +4,9 @@ import type { StaticBuildOptions } from './types.js';
|
|
|
4
4
|
export declare function viteBuild(opts: StaticBuildOptions): Promise<{
|
|
5
5
|
internals: BuildInternals;
|
|
6
6
|
ssrOutputChunkNames: string[];
|
|
7
|
-
ssrOutputAssetNames: string[];
|
|
8
7
|
contentFileNames: undefined;
|
|
9
8
|
}>;
|
|
10
|
-
export declare function staticBuild(opts: StaticBuildOptions, internals: BuildInternals, ssrOutputChunkNames: string[],
|
|
9
|
+
export declare function staticBuild(opts: StaticBuildOptions, internals: BuildInternals, ssrOutputChunkNames: string[], contentFileNames?: string[]): Promise<void>;
|
|
11
10
|
export declare function copyFiles(fromFolder: URL, toFolder: URL, includeDotfiles?: boolean): Promise<void[] | undefined>;
|
|
12
11
|
/**
|
|
13
12
|
* This function takes the virtual module name of any page entrypoint and
|
|
@@ -69,20 +69,16 @@ async function viteBuild(opts) {
|
|
|
69
69
|
teardown();
|
|
70
70
|
}
|
|
71
71
|
const ssrOutputChunkNames = [];
|
|
72
|
-
const ssrOutputAssetNames = [];
|
|
73
72
|
for (const output of ssrOutputs) {
|
|
74
73
|
for (const chunk of output.output) {
|
|
75
74
|
if (chunk.type === "chunk") {
|
|
76
75
|
ssrOutputChunkNames.push(chunk.fileName);
|
|
77
76
|
}
|
|
78
|
-
if (chunk.type === "asset") {
|
|
79
|
-
ssrOutputAssetNames.push(chunk.fileName);
|
|
80
|
-
}
|
|
81
77
|
}
|
|
82
78
|
}
|
|
83
|
-
return { internals, ssrOutputChunkNames,
|
|
79
|
+
return { internals, ssrOutputChunkNames, contentFileNames };
|
|
84
80
|
}
|
|
85
|
-
async function staticBuild(opts, internals, ssrOutputChunkNames,
|
|
81
|
+
async function staticBuild(opts, internals, ssrOutputChunkNames, contentFileNames) {
|
|
86
82
|
const { settings } = opts;
|
|
87
83
|
if (settings.buildOutput === "static") {
|
|
88
84
|
settings.timer.start("Static generate");
|
|
@@ -93,7 +89,7 @@ async function staticBuild(opts, internals, ssrOutputChunkNames, ssrOutputAssetN
|
|
|
93
89
|
settings.timer.start("Server generate");
|
|
94
90
|
await generatePages(opts, internals);
|
|
95
91
|
await cleanStaticOutput(opts, internals);
|
|
96
|
-
await ssrMoveAssets(opts
|
|
92
|
+
await ssrMoveAssets(opts);
|
|
97
93
|
settings.timer.end("Server generate");
|
|
98
94
|
}
|
|
99
95
|
}
|
|
@@ -309,15 +305,21 @@ async function copyFiles(fromFolder, toFolder, includeDotfiles = false) {
|
|
|
309
305
|
})
|
|
310
306
|
);
|
|
311
307
|
}
|
|
312
|
-
async function ssrMoveAssets(opts
|
|
308
|
+
async function ssrMoveAssets(opts) {
|
|
313
309
|
opts.logger.info("build", "Rearranging server assets...");
|
|
314
310
|
const serverRoot = opts.settings.buildOutput === "static" ? opts.settings.config.build.client : opts.settings.config.build.server;
|
|
315
311
|
const clientRoot = opts.settings.config.build.client;
|
|
316
|
-
|
|
312
|
+
const assets = opts.settings.config.build.assets;
|
|
313
|
+
const serverAssets = new URL(`./${assets}/`, appendForwardSlash(serverRoot.toString()));
|
|
314
|
+
const clientAssets = new URL(`./${assets}/`, appendForwardSlash(clientRoot.toString()));
|
|
315
|
+
const files = await glob(`**/*`, {
|
|
316
|
+
cwd: fileURLToPath(serverAssets)
|
|
317
|
+
});
|
|
318
|
+
if (files.length > 0) {
|
|
317
319
|
await Promise.all(
|
|
318
|
-
|
|
319
|
-
const currentUrl = new URL(filename, appendForwardSlash(
|
|
320
|
-
const clientUrl = new URL(filename, appendForwardSlash(
|
|
320
|
+
files.map(async function moveAsset(filename) {
|
|
321
|
+
const currentUrl = new URL(filename, appendForwardSlash(serverAssets.toString()));
|
|
322
|
+
const clientUrl = new URL(filename, appendForwardSlash(clientAssets.toString()));
|
|
321
323
|
const dir = new URL(path.parse(clientUrl.href).dir);
|
|
322
324
|
if (!fs.existsSync(dir)) await fs.promises.mkdir(dir, { recursive: true });
|
|
323
325
|
return fs.promises.rename(currentUrl, clientUrl);
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -22,7 +22,7 @@ async function dev(inlineConfig) {
|
|
|
22
22
|
await telemetry.record([]);
|
|
23
23
|
const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
|
|
24
24
|
const logger = restart.container.logger;
|
|
25
|
-
const currentVersion = "5.0.
|
|
25
|
+
const currentVersion = "5.0.7";
|
|
26
26
|
const isPrerelease = currentVersion.includes("-");
|
|
27
27
|
if (!isPrerelease) {
|
|
28
28
|
try {
|
package/dist/core/messages.js
CHANGED
|
@@ -38,7 +38,7 @@ function serverStart({
|
|
|
38
38
|
host,
|
|
39
39
|
base
|
|
40
40
|
}) {
|
|
41
|
-
const version = "5.0.
|
|
41
|
+
const version = "5.0.7";
|
|
42
42
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
43
43
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
44
44
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -276,7 +276,7 @@ function printHelp({
|
|
|
276
276
|
message.push(
|
|
277
277
|
linebreak(),
|
|
278
278
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
279
|
-
`v${"5.0.
|
|
279
|
+
`v${"5.0.7"}`
|
|
280
280
|
)} ${headline}`
|
|
281
281
|
);
|
|
282
282
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.7",
|
|
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",
|
|
@@ -159,8 +159,8 @@
|
|
|
159
159
|
"zod-to-json-schema": "^3.23.5",
|
|
160
160
|
"zod-to-ts": "^1.2.0",
|
|
161
161
|
"@astrojs/internal-helpers": "0.4.2",
|
|
162
|
-
"@astrojs/
|
|
163
|
-
"@astrojs/
|
|
162
|
+
"@astrojs/markdown-remark": "6.0.1",
|
|
163
|
+
"@astrojs/telemetry": "3.2.0"
|
|
164
164
|
},
|
|
165
165
|
"optionalDependencies": {
|
|
166
166
|
"sharp": "^0.33.3"
|