astro 4.0.5 → 4.0.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/components/Picture.astro +1 -1
- package/dist/assets/build/generate.js +2 -1
- package/dist/assets/endpoint/config.d.ts +2 -0
- package/dist/assets/endpoint/config.js +12 -0
- package/dist/assets/endpoint/generic.js +2 -1
- package/dist/assets/endpoint/node.js +2 -1
- package/dist/assets/internal.d.ts +2 -6
- package/dist/assets/internal.js +2 -31
- package/dist/assets/services/service.js +2 -1
- package/dist/assets/utils/imageKind.d.ts +3 -0
- package/dist/assets/utils/imageKind.js +10 -0
- package/dist/assets/utils/index.d.ts +2 -0
- package/dist/assets/utils/index.js +17 -0
- package/dist/assets/utils/remotePattern.d.ts +2 -0
- package/dist/assets/utils/remotePattern.js +11 -0
- package/dist/assets/utils/transformToPath.js +1 -1
- package/dist/assets/vite-plugin-assets.js +1 -1
- package/dist/core/app/index.js +19 -7
- package/dist/core/build/index.js +1 -1
- package/dist/core/config/schema.d.ts +360 -360
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/container.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/errors/errors-data.js +2 -2
- package/dist/core/messages.js +2 -2
- package/dist/core/routing/manifest/create.js +1 -1
- package/dist/transitions/router.js +7 -5
- package/dist/vite-plugin-astro-server/request.js +0 -4
- package/package.json +2 -2
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.6";
|
|
25
25
|
if (currentVersion.includes("-")) {
|
|
26
26
|
logger.warn("SKIP_FORMAT", msg.prerelease({ currentVersion }));
|
|
27
27
|
}
|
|
@@ -230,8 +230,8 @@ const ResponseSentError = {
|
|
|
230
230
|
};
|
|
231
231
|
const MiddlewareNoDataOrNextCalled = {
|
|
232
232
|
name: "MiddlewareNoDataOrNextCalled",
|
|
233
|
-
title: "The middleware didn't return a
|
|
234
|
-
message: "
|
|
233
|
+
title: "The middleware didn't return a `Response`.",
|
|
234
|
+
message: "Make sure your middleware returns a `Response` object, either directly or by returning the `Response` from calling the `next` function."
|
|
235
235
|
};
|
|
236
236
|
const MiddlewareNotAResponse = {
|
|
237
237
|
name: "MiddlewareNotAResponse",
|
package/dist/core/messages.js
CHANGED
|
@@ -36,7 +36,7 @@ function serverStart({
|
|
|
36
36
|
host,
|
|
37
37
|
base
|
|
38
38
|
}) {
|
|
39
|
-
const version = "4.0.
|
|
39
|
+
const version = "4.0.6";
|
|
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.6"}`
|
|
262
262
|
)} ${headline}`
|
|
263
263
|
);
|
|
264
264
|
}
|
|
@@ -318,7 +318,7 @@ This route collides with: "${collision.component}".`
|
|
|
318
318
|
if (/^https?:\/\//.test(destination)) {
|
|
319
319
|
logger.warn(
|
|
320
320
|
"redirects",
|
|
321
|
-
`Redirecting to an external URL is not officially supported: ${from} -> ${
|
|
321
|
+
`Redirecting to an external URL is not officially supported: ${from} -> ${destination}`
|
|
322
322
|
);
|
|
323
323
|
}
|
|
324
324
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { TRANSITION_AFTER_SWAP, doPreparation, doSwap } from "./events.js";
|
|
2
|
+
const inBrowser = import.meta.env.SSR === false;
|
|
3
|
+
const pushState = inBrowser && history.pushState.bind(history);
|
|
4
|
+
const replaceState = inBrowser && history.replaceState.bind(history);
|
|
2
5
|
const updateScrollPosition = (positions) => {
|
|
3
6
|
if (history.state) {
|
|
4
7
|
history.scrollRestoration = "manual";
|
|
5
|
-
|
|
8
|
+
replaceState({ ...history.state, ...positions }, "");
|
|
6
9
|
}
|
|
7
10
|
};
|
|
8
|
-
const inBrowser = import.meta.env.SSR === false;
|
|
9
11
|
const supportsViewTransitions = inBrowser && !!document.startViewTransition;
|
|
10
12
|
const transitionEnabledOnThisPage = () => inBrowser && !!document.querySelector('[name="astro-view-transitions-enabled"]');
|
|
11
13
|
const samePage = (thisLocation, otherLocation) => thisLocation.pathname === otherLocation.pathname && thisLocation.search === otherLocation.search;
|
|
@@ -43,7 +45,7 @@ if (inBrowser) {
|
|
|
43
45
|
currentHistoryIndex = history.state.index;
|
|
44
46
|
scrollTo({ left: history.state.scrollX, top: history.state.scrollY });
|
|
45
47
|
} else if (transitionEnabledOnThisPage()) {
|
|
46
|
-
|
|
48
|
+
replaceState({ index: currentHistoryIndex, scrollX, scrollY }, "");
|
|
47
49
|
history.scrollRestoration = "manual";
|
|
48
50
|
}
|
|
49
51
|
}
|
|
@@ -117,7 +119,7 @@ const moveToLocation = (to, from, options, historyState) => {
|
|
|
117
119
|
if (to.href !== location.href && !historyState) {
|
|
118
120
|
if (options.history === "replace") {
|
|
119
121
|
const current = history.state;
|
|
120
|
-
|
|
122
|
+
replaceState(
|
|
121
123
|
{
|
|
122
124
|
...options.state,
|
|
123
125
|
index: current.index,
|
|
@@ -128,7 +130,7 @@ const moveToLocation = (to, from, options, historyState) => {
|
|
|
128
130
|
to.href
|
|
129
131
|
);
|
|
130
132
|
} else {
|
|
131
|
-
|
|
133
|
+
pushState(
|
|
132
134
|
{ ...options.state, index: ++currentHistoryIndex, scrollX: 0, scrollY: 0 },
|
|
133
135
|
"",
|
|
134
136
|
to.href
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import { collectErrorMetadata } from "../core/errors/dev/index.js";
|
|
2
|
-
import { createSafeError } from "../core/errors/index.js";
|
|
3
|
-
import { formatErrorMessage } from "../core/messages.js";
|
|
4
1
|
import { collapseDuplicateSlashes, removeTrailingForwardSlash } from "../core/path.js";
|
|
5
|
-
import { eventError, telemetry } from "../events/index.js";
|
|
6
2
|
import { isServerLikeOutput } from "../prerender/utils.js";
|
|
7
3
|
import { runWithErrorHandling } from "./controller.js";
|
|
8
4
|
import { handle500Response } from "./response.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.6",
|
|
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",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"vendor"
|
|
100
100
|
],
|
|
101
101
|
"dependencies": {
|
|
102
|
-
"@astrojs/compiler": "^2.3.
|
|
102
|
+
"@astrojs/compiler": "^2.3.4",
|
|
103
103
|
"@babel/core": "^7.23.3",
|
|
104
104
|
"@babel/generator": "^7.23.3",
|
|
105
105
|
"@babel/parser": "^7.23.3",
|