astro 4.4.5 → 4.4.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/components/Code.astro +3 -3
- package/components/ViewTransitions.astro +5 -0
- package/dist/@types/astro.d.ts +10 -4
- package/dist/assets/build/generate.js +1 -1
- package/dist/assets/endpoint/generic.js +1 -1
- package/dist/assets/endpoint/node.js +39 -9
- package/dist/assets/utils/metadata.js +1 -1
- package/dist/assets/utils/transformToPath.js +1 -1
- package/dist/assets/vite-plugin-assets.js +2 -1
- package/dist/cli/add/index.js +4 -4
- package/dist/cli/check/index.js +1 -1
- package/dist/cli/db/index.js +2 -2
- package/dist/cli/info/index.js +2 -2
- package/dist/cli/install-package.js +2 -2
- package/dist/cli/preferences/index.js +5 -5
- package/dist/content/server-listeners.js +1 -1
- package/dist/content/types-generator.js +2 -2
- package/dist/content/utils.d.ts +1 -1
- package/dist/content/utils.js +2 -2
- package/dist/content/vite-plugin-content-imports.js +1 -1
- package/dist/content/vite-plugin-content-virtual-mod.js +1 -1
- package/dist/core/app/common.d.ts +1 -1
- package/dist/core/app/index.js +10 -10
- package/dist/core/app/node.d.ts +1 -1
- package/dist/core/app/node.js +1 -1
- package/dist/core/app/types.d.ts +2 -2
- package/dist/core/base-pipeline.js +1 -1
- package/dist/core/build/generate.js +14 -13
- package/dist/core/build/index.js +2 -2
- package/dist/core/build/pipeline.js +1 -1
- package/dist/core/build/plugins/plugin-manifest.js +3 -3
- package/dist/core/build/plugins/plugin-ssr.js +1 -1
- package/dist/core/build/plugins/util.d.ts +1 -1
- package/dist/core/build/static-build.js +3 -3
- package/dist/core/client-directive/build.js +1 -1
- package/dist/core/compile/compile.js +1 -1
- package/dist/core/config/config.js +1 -1
- package/dist/core/config/settings.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.d.ts +1 -1
- package/dist/core/dev/dev.js +3 -3
- package/dist/core/endpoint/index.d.ts +1 -1
- package/dist/core/endpoint/index.js +2 -2
- package/dist/core/errors/dev/utils.js +2 -2
- package/dist/core/errors/errors-data.js +1 -1
- package/dist/core/logger/vite.d.ts +1 -1
- package/dist/core/logger/vite.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/middleware/index.js +4 -4
- package/dist/core/middleware/loadMiddleware.js +1 -1
- package/dist/core/preview/index.js +2 -2
- package/dist/core/render/result.d.ts +1 -1
- package/dist/core/render/result.js +5 -5
- package/dist/core/render/route-cache.d.ts +1 -0
- package/dist/core/render/route-cache.js +8 -4
- package/dist/core/render-context.js +11 -11
- package/dist/core/request.d.ts +10 -3
- package/dist/core/request.js +9 -6
- package/dist/core/routing/manifest/create.js +2 -2
- package/dist/core/sync/index.js +3 -3
- package/dist/i18n/middleware.js +1 -1
- package/dist/integrations/index.js +1 -1
- package/dist/jsx-runtime/index.js +1 -1
- package/dist/preferences/store.js +2 -2
- package/dist/runtime/server/index.js +1 -1
- package/dist/runtime/server/render/astro/render.js +1 -1
- package/dist/runtime/server/render/page.js +1 -1
- package/dist/runtime/server/scripts.js +1 -1
- package/dist/runtime/server/transition.js +2 -1
- package/dist/vite-plugin-astro-server/base.js +1 -1
- package/dist/vite-plugin-astro-server/error.d.ts +1 -1
- package/dist/vite-plugin-astro-server/error.js +1 -1
- package/dist/vite-plugin-astro-server/pipeline.d.ts +1 -1
- package/dist/vite-plugin-astro-server/pipeline.js +6 -6
- package/dist/vite-plugin-astro-server/plugin.js +6 -6
- package/dist/vite-plugin-astro-server/request.js +1 -1
- package/dist/vite-plugin-astro-server/route.js +10 -11
- package/dist/vite-plugin-env/index.js +1 -1
- package/dist/vite-plugin-inject-env-ts/index.js +1 -1
- package/dist/vite-plugin-markdown/index.js +5 -5
- package/dist/vite-plugin-scanner/index.js +1 -1
- package/dist/vite-plugin-utils/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,15 +1,14 @@
|
|
|
1
|
+
import { REROUTE_DIRECTIVE_HEADER, clientLocalsSymbol } from "../core/constants.js";
|
|
1
2
|
import { AstroErrorData, isAstroError } from "../core/errors/index.js";
|
|
2
3
|
import { req } from "../core/messages.js";
|
|
3
4
|
import { loadMiddleware } from "../core/middleware/loadMiddleware.js";
|
|
5
|
+
import { RenderContext } from "../core/render-context.js";
|
|
4
6
|
import { getProps } from "../core/render/index.js";
|
|
5
7
|
import { createRequest } from "../core/request.js";
|
|
6
8
|
import { matchAllRoutes } from "../core/routing/index.js";
|
|
7
9
|
import { normalizeTheLocale } from "../i18n/index.js";
|
|
8
10
|
import { getSortedPreloadedMatches } from "../prerender/routing.js";
|
|
9
|
-
import { isServerLikeOutput } from "../prerender/utils.js";
|
|
10
11
|
import { handle404Response, writeSSRResult, writeWebResponse } from "./response.js";
|
|
11
|
-
import { REROUTE_DIRECTIVE_HEADER, clientLocalsSymbol } from "../core/constants.js";
|
|
12
|
-
import { RenderContext } from "../core/render-context.js";
|
|
13
12
|
function isLoggedRequest(url) {
|
|
14
13
|
return url !== "/favicon.ico";
|
|
15
14
|
}
|
|
@@ -94,7 +93,6 @@ async function handleRoute({
|
|
|
94
93
|
}
|
|
95
94
|
return handle404Response(origin, incomingRequest, incomingResponse);
|
|
96
95
|
}
|
|
97
|
-
const buildingToSSR = isServerLikeOutput(config);
|
|
98
96
|
let request;
|
|
99
97
|
let renderContext;
|
|
100
98
|
let mod = void 0;
|
|
@@ -125,10 +123,12 @@ async function handleRoute({
|
|
|
125
123
|
return handle404Response(origin, incomingRequest, incomingResponse);
|
|
126
124
|
}
|
|
127
125
|
request = createRequest({
|
|
126
|
+
base: config.base,
|
|
128
127
|
url,
|
|
129
|
-
headers:
|
|
128
|
+
headers: incomingRequest.headers,
|
|
130
129
|
logger,
|
|
131
|
-
|
|
130
|
+
// no route found, so we assume the default for rendering the 404 page
|
|
131
|
+
staticLike: config.output === "static" || config.output === "hybrid"
|
|
132
132
|
});
|
|
133
133
|
route = {
|
|
134
134
|
component: "",
|
|
@@ -162,15 +162,14 @@ async function handleRoute({
|
|
|
162
162
|
route = matchedRoute.route;
|
|
163
163
|
const locals = Reflect.get(incomingRequest, clientLocalsSymbol);
|
|
164
164
|
request = createRequest({
|
|
165
|
+
base: config.base,
|
|
165
166
|
url,
|
|
166
|
-
|
|
167
|
-
headers: buildingToSSR ? incomingRequest.headers : new Headers(),
|
|
167
|
+
headers: incomingRequest.headers,
|
|
168
168
|
method: incomingRequest.method,
|
|
169
169
|
body,
|
|
170
170
|
logger,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
removeParams: buildingToSSR === false || route.prerender
|
|
171
|
+
clientAddress: incomingRequest.socket.remoteAddress,
|
|
172
|
+
staticLike: config.output === "static" || route.prerender
|
|
174
173
|
});
|
|
175
174
|
for (const [name, value] of Object.entries(config.server.headers ?? {})) {
|
|
176
175
|
if (value)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
|
-
import { loadEnv } from "vite";
|
|
3
2
|
import { transform } from "esbuild";
|
|
4
3
|
import MagicString from "magic-string";
|
|
4
|
+
import { loadEnv } from "vite";
|
|
5
5
|
const importMetaEnvOnlyRe = /\bimport\.meta\.env\b(?!\.)/;
|
|
6
6
|
const isValidIdentifierRe = /^[_$a-zA-Z][\w$]*$/;
|
|
7
7
|
const exportConstPrerenderRe = /\bexport\s+const\s+prerender\s*=\s*import\.meta\.env\.(.+?)\b/;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { bold } from "kleur/colors";
|
|
2
1
|
import path from "node:path";
|
|
3
2
|
import { fileURLToPath } from "node:url";
|
|
3
|
+
import { bold } from "kleur/colors";
|
|
4
4
|
import { normalizePath } from "vite";
|
|
5
5
|
import { getContentPaths, getDotAstroTypeReference } from "../content/index.js";
|
|
6
6
|
import {} from "../core/logger/core.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createMarkdownProcessor,
|
|
3
|
-
InvalidAstroDataError
|
|
4
|
-
} from "@astrojs/markdown-remark";
|
|
5
1
|
import fs from "node:fs";
|
|
6
2
|
import path from "node:path";
|
|
7
3
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
|
+
import {
|
|
5
|
+
InvalidAstroDataError,
|
|
6
|
+
createMarkdownProcessor
|
|
7
|
+
} from "@astrojs/markdown-remark";
|
|
8
8
|
import { normalizePath } from "vite";
|
|
9
|
-
import { AstroError, AstroErrorData } from "../core/errors/index.js";
|
|
10
9
|
import { safeParseFrontmatter } from "../content/utils.js";
|
|
10
|
+
import { AstroError, AstroErrorData } from "../core/errors/index.js";
|
|
11
11
|
import { isMarkdownFile } from "../core/util.js";
|
|
12
12
|
import { shorthash } from "../runtime/server/shorthash.js";
|
|
13
13
|
import { getFileInfo } from "../vite-plugin-utils/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bold } from "kleur/colors";
|
|
2
1
|
import { extname } from "node:path";
|
|
2
|
+
import { bold } from "kleur/colors";
|
|
3
3
|
import { normalizePath } from "vite";
|
|
4
4
|
import {} from "../core/logger/core.js";
|
|
5
5
|
import { isEndpoint, isPage, rootRelativePath } from "../core/util.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.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",
|
|
@@ -158,7 +158,7 @@
|
|
|
158
158
|
"tsconfck": "^3.0.0",
|
|
159
159
|
"unist-util-visit": "^5.0.0",
|
|
160
160
|
"vfile": "^6.0.1",
|
|
161
|
-
"vite": "^5.1.
|
|
161
|
+
"vite": "^5.1.4",
|
|
162
162
|
"vitefu": "^0.2.5",
|
|
163
163
|
"which-pm": "^2.1.1",
|
|
164
164
|
"yargs-parser": "^21.1.1",
|