astro 2.6.4 → 2.6.5
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/core/build/generate.js +6 -1
- package/dist/core/build/static-build.js +9 -4
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/errors/errors-data.d.ts +2 -2
- package/dist/core/errors/errors-data.js +2 -2
- package/dist/core/messages.js +2 -2
- package/dist/events/index.js +2 -11
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
hasPrerenderedPages
|
|
13
13
|
} from "../../core/build/internal.js";
|
|
14
14
|
import {
|
|
15
|
+
isRelativePath,
|
|
15
16
|
prependForwardSlash,
|
|
16
17
|
removeLeadingForwardSlash,
|
|
17
18
|
removeTrailingForwardSlash
|
|
@@ -181,7 +182,11 @@ async function generatePage(opts, internals, pageData, ssrEntry, builtPaths) {
|
|
|
181
182
|
renderers
|
|
182
183
|
};
|
|
183
184
|
const icon = pageData.route.type === "page" ? green("\u25B6") : magenta("\u03BB");
|
|
184
|
-
|
|
185
|
+
if (isRelativePath(pageData.route.component)) {
|
|
186
|
+
info(opts.logging, null, `${icon} ${pageData.route.route}`);
|
|
187
|
+
} else {
|
|
188
|
+
info(opts.logging, null, `${icon} ${pageData.route.component}`);
|
|
189
|
+
}
|
|
185
190
|
const paths = await getPathsForRoute(pageData, pageModule, opts, builtPaths);
|
|
186
191
|
for (let i = 0; i < paths.length; i++) {
|
|
187
192
|
const path = paths[i];
|
|
@@ -102,7 +102,7 @@ ${bgMagenta(black(" finalizing server assets "))}
|
|
|
102
102
|
}
|
|
103
103
|
async function ssrBuild(opts, internals, input, container) {
|
|
104
104
|
var _a, _b, _c, _d, _e;
|
|
105
|
-
const { settings, viteConfig } = opts;
|
|
105
|
+
const { allPages, settings, viteConfig } = opts;
|
|
106
106
|
const ssr = isServerLikeOutput(settings.config);
|
|
107
107
|
const out = ssr ? opts.buildConfig.server : getOutDirWithinCwd(settings.config.outDir);
|
|
108
108
|
const { lastVitePlugins, vitePlugins } = container.runBeforeHook("ssr", input);
|
|
@@ -133,7 +133,7 @@ async function ssrBuild(opts, internals, input, container) {
|
|
|
133
133
|
entryFileNames(chunkInfo) {
|
|
134
134
|
var _a2;
|
|
135
135
|
if ((_a2 = chunkInfo.facadeModuleId) == null ? void 0 : _a2.startsWith(ASTRO_PAGE_RESOLVED_MODULE_ID)) {
|
|
136
|
-
return makeAstroPageEntryPointFileName(chunkInfo.facadeModuleId);
|
|
136
|
+
return makeAstroPageEntryPointFileName(chunkInfo.facadeModuleId, allPages);
|
|
137
137
|
} else if (
|
|
138
138
|
// checks if the path of the module we have middleware, e.g. middleware.js / middleware/index.js
|
|
139
139
|
chunkInfo.moduleIds.find((m) => m.includes("middleware")) !== void 0 && // checks if the file actually export the `onRequest` function
|
|
@@ -324,8 +324,13 @@ async function ssrMoveAssets(opts) {
|
|
|
324
324
|
removeEmptyDirs(serverAssets);
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
function makeAstroPageEntryPointFileName(facadeModuleId) {
|
|
328
|
-
|
|
327
|
+
function makeAstroPageEntryPointFileName(facadeModuleId, pages) {
|
|
328
|
+
var _a, _b;
|
|
329
|
+
const pageModuleId = facadeModuleId.replace(ASTRO_PAGE_RESOLVED_MODULE_ID, "").replace(ASTRO_PAGE_EXTENSION_POST_PATTERN, ".");
|
|
330
|
+
let name = ((_b = (_a = pages[pageModuleId]) == null ? void 0 : _a.route) == null ? void 0 : _b.route) ?? pageModuleId;
|
|
331
|
+
if (name.endsWith("/"))
|
|
332
|
+
name += "index";
|
|
333
|
+
return `pages${name.replaceAll("[", "_").replaceAll("]", "_").replaceAll("...", "---")}.mjs`;
|
|
329
334
|
}
|
|
330
335
|
export {
|
|
331
336
|
staticBuild,
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -53,7 +53,7 @@ async function dev(settings, options) {
|
|
|
53
53
|
isRestart: options.isRestart
|
|
54
54
|
})
|
|
55
55
|
);
|
|
56
|
-
const currentVersion = "2.6.
|
|
56
|
+
const currentVersion = "2.6.5";
|
|
57
57
|
if (currentVersion.includes("-")) {
|
|
58
58
|
warn(options.logging, null, msg.prerelease({ currentVersion }));
|
|
59
59
|
}
|
|
@@ -913,9 +913,9 @@ export declare const AstroErrorData: {
|
|
|
913
913
|
/**
|
|
914
914
|
* @docs
|
|
915
915
|
* @see
|
|
916
|
-
* - [The reserved entry `slug` field](https://docs.astro.build/en/guides/content-collections
|
|
916
|
+
* - [The reserved entry `slug` field](https://docs.astro.build/en/guides/content-collections/#defining-custom-slugs)
|
|
917
917
|
* @description
|
|
918
|
-
* A content collection schema should not contain the `slug` field. This is reserved by Astro for generating entry slugs. Remove
|
|
918
|
+
* A content collection schema should not contain the `slug` field. This is reserved by Astro for generating entry slugs. Remove `slug` from your schema. You can still use custom slugs in your frontmatter.
|
|
919
919
|
*/
|
|
920
920
|
readonly ContentSchemaContainsSlugError: {
|
|
921
921
|
readonly title: "Content Schema should not contain `slug`.";
|
|
@@ -965,9 +965,9 @@ Expected \`${defaultExpectedValue}\` value but got \`${suffix}\`.`;
|
|
|
965
965
|
/**
|
|
966
966
|
* @docs
|
|
967
967
|
* @see
|
|
968
|
-
* - [The reserved entry `slug` field](https://docs.astro.build/en/guides/content-collections
|
|
968
|
+
* - [The reserved entry `slug` field](https://docs.astro.build/en/guides/content-collections/#defining-custom-slugs)
|
|
969
969
|
* @description
|
|
970
|
-
* A content collection schema should not contain the `slug` field. This is reserved by Astro for generating entry slugs. Remove
|
|
970
|
+
* A content collection schema should not contain the `slug` field. This is reserved by Astro for generating entry slugs. Remove `slug` from your schema. You can still use custom slugs in your frontmatter.
|
|
971
971
|
*/
|
|
972
972
|
ContentSchemaContainsSlugError: {
|
|
973
973
|
title: "Content Schema should not contain `slug`.",
|
package/dist/core/messages.js
CHANGED
|
@@ -47,7 +47,7 @@ function serverStart({
|
|
|
47
47
|
base,
|
|
48
48
|
isRestart = false
|
|
49
49
|
}) {
|
|
50
|
-
const version = "2.6.
|
|
50
|
+
const version = "2.6.5";
|
|
51
51
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
52
52
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
53
53
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -233,7 +233,7 @@ function printHelp({
|
|
|
233
233
|
message.push(
|
|
234
234
|
linebreak(),
|
|
235
235
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
236
|
-
`v${"2.6.
|
|
236
|
+
`v${"2.6.5"}`
|
|
237
237
|
)} ${headline}`
|
|
238
238
|
);
|
|
239
239
|
}
|
package/dist/events/index.js
CHANGED
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import { AstroTelemetry } from "@astrojs/telemetry";
|
|
2
|
-
import {
|
|
2
|
+
import { version as viteVersion } from "vite";
|
|
3
3
|
import { ASTRO_VERSION } from "../core/constants.js";
|
|
4
|
-
const require2 = createRequire(import.meta.url);
|
|
5
|
-
function getViteVersion() {
|
|
6
|
-
try {
|
|
7
|
-
const { version } = require2("vite/package.json");
|
|
8
|
-
return version;
|
|
9
|
-
} catch (e) {
|
|
10
|
-
}
|
|
11
|
-
return void 0;
|
|
12
|
-
}
|
|
13
4
|
const telemetry = new AstroTelemetry({
|
|
14
5
|
astroVersion: ASTRO_VERSION,
|
|
15
|
-
viteVersion
|
|
6
|
+
viteVersion
|
|
16
7
|
});
|
|
17
8
|
export * from "./error.js";
|
|
18
9
|
export * from "./session.js";
|