astro 4.4.14 → 4.5.0
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 +15 -12
- package/dist/@types/astro.d.ts +95 -18
- package/dist/assets/utils/getAssetsPrefix.d.ts +2 -0
- package/dist/assets/utils/getAssetsPrefix.js +14 -0
- package/dist/assets/vite-plugin-assets.js +10 -3
- package/dist/cli/add/index.js +76 -28
- package/dist/cli/install-package.js +2 -2
- package/dist/content/types-generator.js +56 -7
- package/dist/content/vite-plugin-content-assets.js +11 -3
- package/dist/core/app/common.js +2 -0
- package/dist/core/app/index.js +10 -2
- package/dist/core/app/types.d.ts +7 -2
- package/dist/core/base-pipeline.d.ts +2 -1
- package/dist/core/base-pipeline.js +2 -1
- package/dist/core/build/generate.js +1 -0
- package/dist/core/build/internal.d.ts +6 -0
- package/dist/core/build/internal.js +1 -0
- package/dist/core/build/plugins/index.js +6 -1
- package/dist/core/build/plugins/plugin-analyzer.js +10 -98
- package/dist/core/build/plugins/plugin-css.js +27 -1
- package/dist/core/build/plugins/plugin-manifest.js +5 -2
- package/dist/core/build/plugins/plugin-scripts.d.ts +8 -0
- package/dist/core/build/plugins/plugin-scripts.js +34 -0
- package/dist/core/compile/compile.d.ts +1 -7
- package/dist/core/compile/compile.js +5 -4
- package/dist/core/compile/style.d.ts +4 -3
- package/dist/core/compile/style.js +5 -4
- package/dist/core/compile/types.d.ts +11 -0
- package/dist/core/config/schema.d.ts +177 -113
- package/dist/core/config/schema.js +42 -9
- package/dist/core/config/vite-load.js +1 -0
- package/dist/core/constants.d.ts +1 -0
- package/dist/core/constants.js +3 -1
- package/dist/core/create-vite.js +5 -3
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/errors/dev/vite.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/render/params-and-props.js +2 -1
- package/dist/core/render/ssr-element.d.ts +8 -8
- package/dist/core/render/ssr-element.js +4 -2
- package/dist/core/render-context.js +3 -1
- package/dist/core/routing/astro-designed-error-pages.d.ts +2 -0
- package/dist/core/routing/astro-designed-error-pages.js +21 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/index.d.ts +8 -15
- package/dist/runtime/client/dev-toolbar/apps/audit/index.js +130 -249
- package/dist/runtime/client/dev-toolbar/apps/audit/{a11y.js → rules/a11y.js} +4 -2
- package/dist/runtime/client/dev-toolbar/apps/audit/rules/index.d.ts +35 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/rules/index.js +40 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/{perf.js → rules/perf.js} +2 -2
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-list-item.d.ts +7 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-list-item.js +137 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-list-window.d.ts +23 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-list-window.js +384 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-ui.d.ts +6 -0
- package/dist/runtime/client/dev-toolbar/apps/audit/ui/audit-ui.js +126 -0
- package/dist/runtime/client/dev-toolbar/apps/utils/window.d.ts +1 -1
- package/dist/runtime/client/dev-toolbar/apps/utils/window.js +3 -1
- package/dist/runtime/client/dev-toolbar/entrypoint.js +43 -15
- package/dist/runtime/client/dev-toolbar/settings.d.ts +3 -1
- package/dist/runtime/client/dev-toolbar/settings.js +8 -2
- package/dist/runtime/client/dev-toolbar/toolbar.d.ts +1 -0
- package/dist/runtime/client/dev-toolbar/toolbar.js +10 -8
- package/dist/runtime/client/dev-toolbar/ui-library/badge.d.ts +14 -4
- package/dist/runtime/client/dev-toolbar/ui-library/badge.js +72 -33
- package/dist/runtime/client/dev-toolbar/ui-library/button.d.ts +14 -4
- package/dist/runtime/client/dev-toolbar/ui-library/button.js +100 -47
- package/dist/runtime/client/dev-toolbar/ui-library/card.d.ts +9 -0
- package/dist/runtime/client/dev-toolbar/ui-library/card.js +57 -2
- package/dist/runtime/client/dev-toolbar/ui-library/highlight.d.ts +9 -0
- package/dist/runtime/client/dev-toolbar/ui-library/highlight.js +54 -2
- package/dist/runtime/client/dev-toolbar/ui-library/icons.d.ts +4 -0
- package/dist/runtime/client/dev-toolbar/ui-library/icons.js +5 -1
- package/dist/runtime/client/dev-toolbar/ui-library/toggle.d.ts +9 -0
- package/dist/runtime/client/dev-toolbar/ui-library/toggle.js +64 -5
- package/dist/runtime/compiler/index.d.ts +1 -1
- package/dist/runtime/compiler/index.js +2 -0
- package/dist/runtime/server/hydration.js +3 -2
- package/dist/runtime/server/index.d.ts +1 -1
- package/dist/runtime/server/index.js +2 -0
- package/dist/runtime/server/render/astro/factory.d.ts +1 -1
- package/dist/runtime/server/render/component.js +4 -5
- package/dist/runtime/server/render/index.d.ts +1 -0
- package/dist/runtime/server/render/index.js +2 -0
- package/dist/runtime/server/render/script.d.ts +6 -0
- package/dist/runtime/server/render/script.js +15 -0
- package/dist/transitions/router.js +12 -3
- package/dist/vite-plugin-astro/index.d.ts +2 -2
- package/dist/vite-plugin-astro/index.js +12 -1
- package/dist/vite-plugin-astro/types.d.ts +21 -1
- package/dist/vite-plugin-astro-server/pipeline.js +6 -2
- package/dist/vite-plugin-astro-server/plugin.js +6 -2
- package/dist/vite-plugin-astro-server/response.d.ts +6 -0
- package/dist/vite-plugin-astro-server/response.js +13 -0
- package/dist/vite-plugin-astro-server/route.js +18 -2
- package/package.json +8 -9
- package/tsconfigs/base.json +3 -1
- /package/dist/runtime/client/dev-toolbar/apps/audit/{a11y.d.ts → rules/a11y.d.ts} +0 -0
- /package/dist/runtime/client/dev-toolbar/apps/audit/{perf.d.ts → rules/perf.d.ts} +0 -0
|
@@ -12,6 +12,18 @@ async function handle404Response(origin, req, res) {
|
|
|
12
12
|
});
|
|
13
13
|
writeHtmlResponse(res, 404, html);
|
|
14
14
|
}
|
|
15
|
+
async function default404Page({ pathname }) {
|
|
16
|
+
return new Response(
|
|
17
|
+
notFoundTemplate({
|
|
18
|
+
statusCode: 404,
|
|
19
|
+
title: "Not found",
|
|
20
|
+
tabTitle: "404: Not Found",
|
|
21
|
+
pathname
|
|
22
|
+
}),
|
|
23
|
+
{ status: 404, headers: { "Content-Type": "text/html; charset=utf-8" } }
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
default404Page.isAstroComponentFactory = true;
|
|
15
27
|
async function handle500Response(loader, res, err) {
|
|
16
28
|
res.on(
|
|
17
29
|
"close",
|
|
@@ -81,6 +93,7 @@ async function writeSSRResult(webRequest, webResponse, res) {
|
|
|
81
93
|
return writeWebResponse(res, webResponse);
|
|
82
94
|
}
|
|
83
95
|
export {
|
|
96
|
+
default404Page,
|
|
84
97
|
handle404Response,
|
|
85
98
|
handle500Response,
|
|
86
99
|
writeHtmlResponse,
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_404_COMPONENT,
|
|
3
|
+
REROUTE_DIRECTIVE_HEADER,
|
|
4
|
+
clientLocalsSymbol
|
|
5
|
+
} from "../core/constants.js";
|
|
2
6
|
import { AstroErrorData, isAstroError } from "../core/errors/index.js";
|
|
3
7
|
import { req } from "../core/messages.js";
|
|
4
8
|
import { loadMiddleware } from "../core/middleware/loadMiddleware.js";
|
|
@@ -8,7 +12,7 @@ import { createRequest } from "../core/request.js";
|
|
|
8
12
|
import { matchAllRoutes } from "../core/routing/index.js";
|
|
9
13
|
import { normalizeTheLocale } from "../i18n/index.js";
|
|
10
14
|
import { getSortedPreloadedMatches } from "../prerender/routing.js";
|
|
11
|
-
import { handle404Response, writeSSRResult, writeWebResponse } from "./response.js";
|
|
15
|
+
import { default404Page, handle404Response, writeSSRResult, writeWebResponse } from "./response.js";
|
|
12
16
|
function isLoggedRequest(url) {
|
|
13
17
|
return url !== "/favicon.ico";
|
|
14
18
|
}
|
|
@@ -60,6 +64,18 @@ ${AstroErrorData.NoMatchingStaticPathFound.hint(possibleRoutes)}`
|
|
|
60
64
|
);
|
|
61
65
|
}
|
|
62
66
|
const custom404 = getCustom404Route(manifestData);
|
|
67
|
+
if (custom404 && custom404.component === DEFAULT_404_COMPONENT) {
|
|
68
|
+
const component = {
|
|
69
|
+
default: default404Page
|
|
70
|
+
};
|
|
71
|
+
return {
|
|
72
|
+
route: custom404,
|
|
73
|
+
filePath: new URL(`file://${custom404.component}`),
|
|
74
|
+
resolvedPathname: pathname,
|
|
75
|
+
preloadedComponent: component,
|
|
76
|
+
mod: component
|
|
77
|
+
};
|
|
78
|
+
}
|
|
63
79
|
if (custom404) {
|
|
64
80
|
const filePath = new URL(`./${custom404.component}`, config.root);
|
|
65
81
|
const preloadedComponent = await pipeline.preload(filePath);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
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",
|
|
@@ -102,14 +102,14 @@
|
|
|
102
102
|
"vendor"
|
|
103
103
|
],
|
|
104
104
|
"dependencies": {
|
|
105
|
-
"@astrojs/compiler": "^2.
|
|
105
|
+
"@astrojs/compiler": "^2.7.0",
|
|
106
106
|
"@babel/core": "^7.23.3",
|
|
107
107
|
"@babel/generator": "^7.23.3",
|
|
108
108
|
"@babel/parser": "^7.23.3",
|
|
109
109
|
"@babel/plugin-transform-react-jsx": "^7.22.5",
|
|
110
110
|
"@babel/traverse": "^7.23.3",
|
|
111
111
|
"@babel/types": "^7.23.3",
|
|
112
|
-
"@
|
|
112
|
+
"@shikijs/core": "^1.1.2",
|
|
113
113
|
"@types/babel__core": "^7.20.4",
|
|
114
114
|
"acorn": "^8.11.2",
|
|
115
115
|
"aria-query": "^5.3.0",
|
|
@@ -151,8 +151,7 @@
|
|
|
151
151
|
"rehype": "^13.0.1",
|
|
152
152
|
"resolve": "^1.22.4",
|
|
153
153
|
"semver": "^7.5.4",
|
|
154
|
-
"
|
|
155
|
-
"shikiji-core": "^0.9.19",
|
|
154
|
+
"shiki": "^1.1.2",
|
|
156
155
|
"string-width": "^7.0.0",
|
|
157
156
|
"strip-ansi": "^7.1.0",
|
|
158
157
|
"tsconfck": "^3.0.0",
|
|
@@ -163,9 +162,10 @@
|
|
|
163
162
|
"which-pm": "^2.1.1",
|
|
164
163
|
"yargs-parser": "^21.1.1",
|
|
165
164
|
"zod": "^3.22.4",
|
|
166
|
-
"
|
|
167
|
-
"@astrojs/internal-helpers": "0.
|
|
168
|
-
"@astrojs/markdown-remark": "4.
|
|
165
|
+
"zod-to-json-schema": "^3.22.4",
|
|
166
|
+
"@astrojs/internal-helpers": "0.3.0",
|
|
167
|
+
"@astrojs/markdown-remark": "4.3.0",
|
|
168
|
+
"@astrojs/telemetry": "3.0.4"
|
|
169
169
|
},
|
|
170
170
|
"optionalDependencies": {
|
|
171
171
|
"sharp": "^0.32.6"
|
|
@@ -185,7 +185,6 @@
|
|
|
185
185
|
"@types/diff": "^5.0.8",
|
|
186
186
|
"@types/dlv": "^1.1.4",
|
|
187
187
|
"@types/dom-view-transitions": "^1.0.4",
|
|
188
|
-
"@types/estree": "^1.0.5",
|
|
189
188
|
"@types/hast": "^3.0.3",
|
|
190
189
|
"@types/html-escaper": "^3.0.2",
|
|
191
190
|
"@types/http-cache-semantics": "^4.0.4",
|
package/tsconfigs/base.json
CHANGED
|
@@ -24,6 +24,8 @@
|
|
|
24
24
|
// Skip typechecking libraries and .d.ts files
|
|
25
25
|
"skipLibCheck": true,
|
|
26
26
|
// Allow JavaScript files to be imported
|
|
27
|
-
"allowJs": true
|
|
27
|
+
"allowJs": true,
|
|
28
|
+
// Allow JSX files (or files that are internally considered JSX, like Astro files) to be imported inside `.js` and `.ts` files.
|
|
29
|
+
"jsx": "preserve"
|
|
28
30
|
}
|
|
29
31
|
}
|
|
File without changes
|
|
File without changes
|