astro 7.0.8 → 7.1.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/dist/assets/fonts/infra/fs-font-file-content-resolver.js +1 -1
- package/dist/cli/dev/index.d.ts +17 -0
- package/dist/cli/dev/index.js +56 -2
- package/dist/cli/infra/build-time-astro-version-provider.js +1 -1
- package/dist/content/consts.d.ts +2 -0
- package/dist/content/consts.js +4 -0
- package/dist/content/content-layer.d.ts +0 -6
- package/dist/content/content-layer.js +4 -9
- package/dist/content/data-store-source.d.ts +36 -0
- package/dist/content/data-store-source.js +30 -0
- package/dist/content/data-store-writer.d.ts +67 -0
- package/dist/content/data-store-writer.js +94 -0
- package/dist/content/data-store.d.ts +15 -0
- package/dist/content/data-store.js +33 -3
- package/dist/content/loaders/glob.d.ts +7 -0
- package/dist/content/loaders/glob.js +2 -2
- package/dist/content/mutable-data-store.d.ts +8 -0
- package/dist/content/mutable-data-store.js +52 -15
- package/dist/content/paths.d.ts +14 -0
- package/dist/content/paths.js +11 -0
- package/dist/content/runtime.js +4 -4
- package/dist/content/vite-plugin-content-virtual-mod.js +37 -8
- package/dist/core/app/dev/pipeline.js +2 -1
- package/dist/core/app/types.d.ts +39 -5
- package/dist/core/base-pipeline.d.ts +1 -1
- package/dist/core/base-pipeline.js +6 -2
- package/dist/core/build/index.js +2 -1
- package/dist/core/build/plugins/plugin-manifest.js +23 -8
- package/dist/core/config/schemas/base.d.ts +38 -5
- package/dist/core/config/schemas/base.js +15 -8
- package/dist/core/config/schemas/relative.d.ts +73 -15
- package/dist/core/constants.js +1 -1
- package/dist/core/csp/common.d.ts +7 -7
- package/dist/core/csp/common.js +8 -9
- package/dist/core/csp/config.d.ts +45 -0
- package/dist/core/csp/config.js +44 -2
- package/dist/core/csp/runtime.d.ts +21 -1
- package/dist/core/csp/runtime.js +31 -0
- package/dist/core/dev/dev.js +9 -4
- package/dist/core/dev/restart.js +7 -1
- package/dist/core/errors/zod-error-map.js +7 -1
- package/dist/core/fetch/fetch-state.js +52 -10
- package/dist/core/logger/config.d.ts +1 -1
- package/dist/core/logger/core.d.ts +4 -4
- package/dist/core/logger/impls/console.d.ts +2 -2
- package/dist/core/logger/impls/json.d.ts +2 -2
- package/dist/core/logger/impls/json.js +3 -14
- package/dist/core/logger/impls/node.d.ts +2 -2
- package/dist/core/logger/load.d.ts +2 -2
- package/dist/core/logger/load.js +19 -27
- package/dist/core/messages/runtime.d.ts +8 -0
- package/dist/core/messages/runtime.js +34 -1
- package/dist/core/render/paginate.js +21 -16
- package/dist/core/sync/index.js +23 -8
- package/dist/integrations/hooks.js +8 -0
- package/dist/manifest/serialized.js +21 -6
- package/dist/runtime/server/astro-island.js +1 -3
- package/dist/runtime/server/astro-island.prebuilt-dev.d.ts +1 -1
- package/dist/runtime/server/astro-island.prebuilt-dev.js +1 -1
- package/dist/runtime/server/astro-island.prebuilt.d.ts +1 -1
- package/dist/runtime/server/astro-island.prebuilt.js +1 -1
- package/dist/runtime/server/escape.d.ts +2 -0
- package/dist/runtime/server/escape.js +4 -0
- package/dist/runtime/server/render/csp.js +80 -19
- package/dist/runtime/server/render/server-islands.js +6 -4
- package/dist/runtime/server/transition.js +2 -2
- package/dist/types/astro.d.ts +2 -3
- package/dist/types/public/common.d.ts +13 -0
- package/dist/types/public/config.d.ts +196 -15
- package/dist/types/public/context.d.ts +27 -11
- package/dist/types/public/internal.d.ts +12 -11
- package/dist/vite-plugin-app/pipeline.js +2 -1
- package/dist/vite-plugin-astro-server/route-guard.js +3 -2
- package/package.json +3 -3
|
@@ -210,26 +210,27 @@ export interface SSRResult {
|
|
|
210
210
|
key: Promise<CryptoKey>;
|
|
211
211
|
_metadata: SSRMetadata;
|
|
212
212
|
/**
|
|
213
|
-
* `
|
|
214
|
-
* -
|
|
215
|
-
* -
|
|
216
|
-
*
|
|
217
|
-
* `meta`:
|
|
218
|
-
* - <meta> for all pages
|
|
219
|
-
*
|
|
220
|
-
* `adapter`:
|
|
221
|
-
* - nothing for static pages (the adapter does this)
|
|
222
|
-
* - Response header for dynamic pages
|
|
213
|
+
* `cspDestination`:
|
|
214
|
+
* - `header`: `<meta>` for static pages, response header for dynamic pages
|
|
215
|
+
* - `meta`: `<meta>` for all pages
|
|
216
|
+
* - `adapter`: nothing for static pages (the adapter does this), response header for dynamic pages
|
|
223
217
|
*/
|
|
224
218
|
cspDestination: NonNullable<SSRManifestCSP['cspDestination']>;
|
|
225
219
|
shouldInjectCspMetaTags: boolean;
|
|
226
220
|
cspAlgorithm: SSRManifestCSP['algorithm'];
|
|
221
|
+
directives: SSRManifestCSP['directives'];
|
|
222
|
+
/** @deprecated Use {@linkcode scriptDirective} instead. Holds the `default`-kind `script-src` hashes. */
|
|
227
223
|
scriptHashes: SSRManifestCSP['scriptHashes'];
|
|
224
|
+
/** @deprecated Use {@linkcode scriptDirective} instead. Holds the `default`-kind `script-src` resources. */
|
|
228
225
|
scriptResources: SSRManifestCSP['scriptResources'];
|
|
226
|
+
/** @deprecated Use {@linkcode styleDirective} instead. Holds the `default`-kind `style-src` hashes. */
|
|
229
227
|
styleHashes: SSRManifestCSP['styleHashes'];
|
|
228
|
+
/** @deprecated Use {@linkcode styleDirective} instead. Holds the `default`-kind `style-src` resources. */
|
|
230
229
|
styleResources: SSRManifestCSP['styleResources'];
|
|
231
|
-
|
|
230
|
+
/** @deprecated Use {@linkcode scriptDirective}'s `strictDynamic` instead. */
|
|
232
231
|
isStrictDynamic: SSRManifestCSP['isStrictDynamic'];
|
|
232
|
+
scriptDirective: SSRManifestCSP['scriptDirective'];
|
|
233
|
+
styleDirective: SSRManifestCSP['styleDirective'];
|
|
233
234
|
internalFetchHeaders?: Record<string, string>;
|
|
234
235
|
}
|
|
235
236
|
/**
|
|
@@ -8,6 +8,7 @@ import { loadRenderer } from "../core/render/index.js";
|
|
|
8
8
|
import { routeIsRedirect } from "../core/routing/helpers.js";
|
|
9
9
|
import { findRouteToRewrite } from "../core/routing/rewrite.js";
|
|
10
10
|
import { isPage } from "../core/util.js";
|
|
11
|
+
import { stringifyForScript } from "../runtime/server/escape.js";
|
|
11
12
|
import { getComponentMetadata } from "../vite-plugin-astro-server/metadata.js";
|
|
12
13
|
import { createResolve } from "../vite-plugin-astro-server/resolve.js";
|
|
13
14
|
import { PAGE_SCRIPT_ID } from "../vite-plugin-scripts/index.js";
|
|
@@ -90,7 +91,7 @@ class RunnablePipeline extends Pipeline {
|
|
|
90
91
|
debugInfo: await this.getDebugInfo(),
|
|
91
92
|
placement: settings.config.devToolbar.placement
|
|
92
93
|
};
|
|
93
|
-
const children = `window.__astro_dev_toolbar__ = ${
|
|
94
|
+
const children = `window.__astro_dev_toolbar__ = ${stringifyForScript(additionalMetadata)}`;
|
|
94
95
|
scripts.add({ props: {}, children });
|
|
95
96
|
}
|
|
96
97
|
}
|
|
@@ -48,9 +48,10 @@ function routeGuardMiddleware(settings) {
|
|
|
48
48
|
} catch {
|
|
49
49
|
return next();
|
|
50
50
|
}
|
|
51
|
+
const resolved = new URL("." + pathname, config.root);
|
|
51
52
|
const fsInfo = {
|
|
52
|
-
existsInPublic:
|
|
53
|
-
existsInSrc:
|
|
53
|
+
existsInPublic: resolved.pathname.startsWith(config.publicDir.pathname) && fs.existsSync(resolved),
|
|
54
|
+
existsInSrc: resolved.pathname.startsWith(config.srcDir.pathname) && fs.existsSync(resolved),
|
|
54
55
|
existsAtRootAsFile: false
|
|
55
56
|
};
|
|
56
57
|
if (accept.includes("text/html") && !url.includes("?") && !VITE_INTERNAL_PREFIXES.some((prefix) => pathname.startsWith(prefix))) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.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",
|
|
@@ -147,8 +147,8 @@
|
|
|
147
147
|
"yargs-parser": "^22.0.0",
|
|
148
148
|
"zod": "^4.3.6",
|
|
149
149
|
"@astrojs/internal-helpers": "0.10.1",
|
|
150
|
-
"@astrojs/
|
|
151
|
-
"@astrojs/
|
|
150
|
+
"@astrojs/telemetry": "3.3.3",
|
|
151
|
+
"@astrojs/markdown-satteri": "0.3.4"
|
|
152
152
|
},
|
|
153
153
|
"optionalDependencies": {
|
|
154
154
|
"sharp": "^0.34.0 || ^0.35.0"
|