astro 5.15.4 → 6.0.0-alpha.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/{astro.js → bin/astro.mjs} +7 -8
- package/client.d.ts +2 -4
- package/components/ClientRouter.astro +0 -5
- package/dist/actions/runtime/utils.d.ts +2 -8
- package/dist/assets/build/remote.js +4 -14
- package/dist/assets/fonts/implementations/font-metrics-resolver.js +15 -9
- package/dist/assets/services/sharp.js +5 -6
- package/dist/assets/utils/index.d.ts +1 -5
- package/dist/assets/utils/index.js +1 -5
- package/dist/assets/utils/node/emitAsset.d.ts +0 -14
- package/dist/assets/utils/node/emitAsset.js +0 -50
- package/dist/assets/vite-plugin-assets.js +3 -8
- package/dist/cli/add/index.js +0 -2
- package/dist/cli/db/index.js +0 -2
- package/dist/cli/info/index.js +0 -2
- package/dist/cli/infra/build-time-astro-version-provider.js +1 -1
- package/dist/cli/preferences/index.js +0 -2
- package/dist/config/index.js +3 -12
- package/dist/container/index.d.ts +0 -1
- package/dist/container/index.js +0 -1
- package/dist/content/config.js +17 -13
- package/dist/content/content-layer.js +4 -6
- package/dist/content/data-store.d.ts +0 -2
- package/dist/content/loaders/glob.d.ts +0 -5
- package/dist/content/loaders/glob.js +3 -30
- package/dist/content/mutable-data-store.js +1 -14
- package/dist/content/runtime-assets.d.ts +1 -1
- package/dist/content/runtime-assets.js +3 -6
- package/dist/content/runtime.d.ts +19 -58
- package/dist/content/runtime.js +52 -218
- package/dist/content/server-listeners.js +25 -88
- package/dist/content/types-generator.d.ts +1 -6
- package/dist/content/types-generator.js +20 -116
- package/dist/content/utils.d.ts +31 -104
- package/dist/content/utils.js +48 -158
- package/dist/content/vite-plugin-content-imports.js +0 -4
- package/dist/content/vite-plugin-content-virtual-mod.js +3 -134
- package/dist/core/app/index.d.ts +1 -1
- package/dist/core/app/index.js +7 -10
- package/dist/core/app/node.d.ts +2 -8
- package/dist/core/app/node.js +4 -6
- package/dist/core/build/generate.js +0 -1
- package/dist/core/build/index.js +1 -4
- package/dist/core/build/internal.d.ts +1 -2
- package/dist/core/build/internal.js +0 -1
- package/dist/core/build/plugins/plugin-manifest.js +2 -4
- package/dist/core/compile/compile.js +0 -2
- package/dist/core/config/schemas/base.d.ts +4 -40
- package/dist/core/config/schemas/base.js +3 -16
- package/dist/core/config/schemas/refined.js +7 -0
- package/dist/core/config/schemas/relative.d.ts +5 -47
- package/dist/core/constants.d.ts +1 -0
- package/dist/core/constants.js +3 -1
- package/dist/core/create-vite.js +1 -4
- package/dist/core/dev/container.js +0 -2
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/errors/dev/vite.js +1 -18
- package/dist/core/errors/errors-data.d.ts +68 -50
- package/dist/core/errors/errors-data.js +30 -24
- package/dist/core/errors/overlay.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/middleware/index.d.ts +1 -1
- package/dist/core/middleware/index.js +5 -9
- package/dist/core/preview/index.js +0 -2
- package/dist/core/render/params-and-props.js +0 -1
- package/dist/core/render/route-cache.d.ts +1 -2
- package/dist/core/render/route-cache.js +1 -2
- package/dist/core/render-context.d.ts +3 -3
- package/dist/core/render-context.js +13 -27
- package/dist/core/routing/manifest/create.js +1 -1
- package/dist/core/routing/params.js +5 -6
- package/dist/core/routing/validation.d.ts +1 -2
- package/dist/core/routing/validation.js +2 -18
- package/dist/core/server-islands/endpoint.d.ts +1 -2
- package/dist/core/server-islands/endpoint.js +0 -1
- package/dist/core/sync/index.js +2 -10
- package/dist/env/env-loader.d.ts +0 -1
- package/dist/env/env-loader.js +4 -17
- package/dist/env/vite-plugin-env.js +41 -45
- package/dist/i18n/index.js +0 -3
- package/dist/integrations/hooks.d.ts +1 -2
- package/dist/integrations/hooks.js +0 -27
- package/dist/prefetch/index.d.ts +0 -10
- package/dist/prefetch/index.js +1 -1
- package/dist/runtime/server/astro-global.d.ts +2 -2
- package/dist/runtime/server/astro-global.js +86 -24
- package/dist/transitions/vite-plugin-transitions.js +1 -4
- package/dist/types/astro.d.ts +2 -2
- package/dist/types/public/common.d.ts +1 -3
- package/dist/types/public/config.d.ts +4 -127
- package/dist/types/public/context.d.ts +18 -39
- package/dist/types/public/integrations.d.ts +0 -17
- package/dist/types/public/internal.d.ts +2 -2
- package/dist/virtual-modules/live-config.d.ts +0 -2
- package/dist/virtual-modules/live-config.js +0 -4
- package/dist/vite-plugin-markdown/index.js +0 -1
- package/package.json +8 -11
- package/templates/content/module.mjs +8 -63
- package/templates/content/types.d.ts +10 -69
- package/dist/config/vite-plugin-content-listen.d.ts +0 -17
- package/dist/config/vite-plugin-content-listen.js +0 -26
- package/dist/container/polyfill.d.ts +0 -1
- package/dist/container/polyfill.js +0 -2
- package/dist/core/polyfill.d.ts +0 -5
- package/dist/core/polyfill.js +0 -17
- package/dist/vite-plugin-astro-postprocess/index.d.ts +0 -2
- package/dist/vite-plugin-astro-postprocess/index.js +0 -48
|
@@ -1704,14 +1704,14 @@ export interface AstroUserConfig<TLocales extends Locales = never, TSession exte
|
|
|
1704
1704
|
* @name i18n.routing.redirectToDefaultLocale
|
|
1705
1705
|
* @kind h4
|
|
1706
1706
|
* @type {boolean}
|
|
1707
|
-
* @default `
|
|
1707
|
+
* @default `false`
|
|
1708
1708
|
* @version 4.2.0
|
|
1709
1709
|
* @description
|
|
1710
1710
|
*
|
|
1711
1711
|
* Configures whether or not the home URL (`/`) generated by `src/pages/index.astro`
|
|
1712
1712
|
* will redirect to `/[defaultLocale]` when `prefixDefaultLocale: true` is set.
|
|
1713
1713
|
*
|
|
1714
|
-
* Set `redirectToDefaultLocale:
|
|
1714
|
+
* Set `redirectToDefaultLocale: true` to enable this automatic redirection at the root of your site:
|
|
1715
1715
|
* ```js
|
|
1716
1716
|
* // astro.config.mjs
|
|
1717
1717
|
* export default defineConfig({
|
|
@@ -1720,7 +1720,7 @@ export interface AstroUserConfig<TLocales extends Locales = never, TSession exte
|
|
|
1720
1720
|
* locales: ["en", "fr"],
|
|
1721
1721
|
* routing: {
|
|
1722
1722
|
* prefixDefaultLocale: true,
|
|
1723
|
-
* redirectToDefaultLocale:
|
|
1723
|
+
* redirectToDefaultLocale: true
|
|
1724
1724
|
* }
|
|
1725
1725
|
* }
|
|
1726
1726
|
* })
|
|
@@ -1921,48 +1921,7 @@ export interface AstroUserConfig<TLocales extends Locales = never, TSession exte
|
|
|
1921
1921
|
* These flags allow you to opt in to some deprecated or otherwise outdated behavior of Astro
|
|
1922
1922
|
* in the latest version, so that you can continue to upgrade and take advantage of new Astro releases.
|
|
1923
1923
|
*/
|
|
1924
|
-
legacy?:
|
|
1925
|
-
/**
|
|
1926
|
-
*
|
|
1927
|
-
* @name legacy.collections
|
|
1928
|
-
* @type {boolean}
|
|
1929
|
-
* @default `false`
|
|
1930
|
-
* @version 5.0.0
|
|
1931
|
-
* @description
|
|
1932
|
-
* Enable legacy behavior for content collections.
|
|
1933
|
-
*
|
|
1934
|
-
* ```js
|
|
1935
|
-
* // astro.config.mjs
|
|
1936
|
-
* import { defineConfig } from 'astro/config';
|
|
1937
|
-
* export default defineConfig({
|
|
1938
|
-
* legacy: {
|
|
1939
|
-
* collections: true
|
|
1940
|
-
* }
|
|
1941
|
-
* });
|
|
1942
|
-
* ```
|
|
1943
|
-
*
|
|
1944
|
-
* If enabled, `data` and `content` collections (only) are handled using the legacy content collections implementation. Collections with a `loader` (only) will continue to use the Content Layer API instead. Both kinds of collections may exist in the same project, each using their respective implementations.
|
|
1945
|
-
*
|
|
1946
|
-
* The following limitations continue to exist:
|
|
1947
|
-
*
|
|
1948
|
-
* - Any legacy (`type: 'content'` or `type: 'data'`) collections must continue to be located in the `src/content/` directory.
|
|
1949
|
-
* - These legacy collections will not be transformed to implicitly use the `glob()` loader, and will instead be handled by legacy code.
|
|
1950
|
-
* - Collections using the Content Layer API (with a `loader` defined) are forbidden in `src/content/`, but may exist anywhere else in your project.
|
|
1951
|
-
*
|
|
1952
|
-
* When you are ready to remove this flag and migrate to the new Content Layer API for your legacy collections, you must define a collection for any directories in `src/content/` that you want to continue to use as a collection. It is sufficient to declare an empty collection, and Astro will implicitly generate an appropriate definition for your legacy collections:
|
|
1953
|
-
*
|
|
1954
|
-
* ```js
|
|
1955
|
-
* // src/content.config.ts
|
|
1956
|
-
* import { defineCollection, z } from 'astro:content';
|
|
1957
|
-
*
|
|
1958
|
-
* const blog = defineCollection({ })
|
|
1959
|
-
*
|
|
1960
|
-
* export const collections = { blog };
|
|
1961
|
-
* ```
|
|
1962
|
-
*
|
|
1963
|
-
*/
|
|
1964
|
-
collections?: boolean;
|
|
1965
|
-
};
|
|
1924
|
+
legacy?: Record<string, never>;
|
|
1966
1925
|
/**
|
|
1967
1926
|
*
|
|
1968
1927
|
* @kind heading
|
|
@@ -2059,19 +2018,6 @@ export interface AstroUserConfig<TLocales extends Locales = never, TSession exte
|
|
|
2059
2018
|
* see the [Fonts RFC](https://github.com/withastro/roadmap/pull/1039).
|
|
2060
2019
|
*/
|
|
2061
2020
|
fonts?: FontFamily[];
|
|
2062
|
-
/**
|
|
2063
|
-
* @name experimental.headingIdCompat
|
|
2064
|
-
* @type {boolean}
|
|
2065
|
-
* @default `false`
|
|
2066
|
-
* @version 5.5.x
|
|
2067
|
-
* @description
|
|
2068
|
-
*
|
|
2069
|
-
* Enables full compatibility of Markdown headings IDs with common platforms such as GitHub and npm.
|
|
2070
|
-
*
|
|
2071
|
-
* When enabled, IDs for headings ending with non-alphanumeric characters, e.g. `<Picture />`, will
|
|
2072
|
-
* include a trailing `-`, matching standard behavior in other Markdown tooling.
|
|
2073
|
-
*/
|
|
2074
|
-
headingIdCompat?: boolean;
|
|
2075
2021
|
/**
|
|
2076
2022
|
* @name experimental.csp
|
|
2077
2023
|
* @type {boolean | object}
|
|
@@ -2310,75 +2256,6 @@ export interface AstroUserConfig<TLocales extends Locales = never, TSession exte
|
|
|
2310
2256
|
*/
|
|
2311
2257
|
directives?: CspDirective[];
|
|
2312
2258
|
};
|
|
2313
|
-
/**
|
|
2314
|
-
* @name experimental.preserveScriptOrder
|
|
2315
|
-
* @type {boolean}
|
|
2316
|
-
* @default `false`
|
|
2317
|
-
* @version 5.5
|
|
2318
|
-
* @description
|
|
2319
|
-
*
|
|
2320
|
-
* When enabled, `<script>` and `<style>` tags are rendered in the same order as they are defined.
|
|
2321
|
-
*
|
|
2322
|
-
* ## Example
|
|
2323
|
-
*
|
|
2324
|
-
* Consider the following component:
|
|
2325
|
-
*
|
|
2326
|
-
* ```html
|
|
2327
|
-
* <p>I am a component</p>
|
|
2328
|
-
* <style>
|
|
2329
|
-
* body {
|
|
2330
|
-
* background: red;
|
|
2331
|
-
* }
|
|
2332
|
-
* </style>
|
|
2333
|
-
* <style>
|
|
2334
|
-
* body {
|
|
2335
|
-
* background: yellow;
|
|
2336
|
-
* }
|
|
2337
|
-
* </style>
|
|
2338
|
-
* ```
|
|
2339
|
-
*
|
|
2340
|
-
* By default, it will generate a CSS style where `red` will be applied:
|
|
2341
|
-
*
|
|
2342
|
-
* ```css
|
|
2343
|
-
* body {background:#ff0} body {background:red}
|
|
2344
|
-
* ```
|
|
2345
|
-
*
|
|
2346
|
-
* When this new option is set to `true`, the generated CSS style will apply `yellow`:
|
|
2347
|
-
*
|
|
2348
|
-
* ```css
|
|
2349
|
-
* body {background:red} body {background:#ff0}
|
|
2350
|
-
* ```
|
|
2351
|
-
*
|
|
2352
|
-
*/
|
|
2353
|
-
preserveScriptOrder?: boolean;
|
|
2354
|
-
/**
|
|
2355
|
-
* @name experimental.liveContentCollections
|
|
2356
|
-
* @type {boolean}
|
|
2357
|
-
* @default `false`
|
|
2358
|
-
* @version 5.10
|
|
2359
|
-
* @description
|
|
2360
|
-
* Enables the use of live content collections.
|
|
2361
|
-
*
|
|
2362
|
-
*/
|
|
2363
|
-
liveContentCollections?: boolean;
|
|
2364
|
-
/**
|
|
2365
|
-
* @name experimental.staticImportMetaEnv
|
|
2366
|
-
* @type {boolean}
|
|
2367
|
-
* @default `false`
|
|
2368
|
-
* @version 5.13
|
|
2369
|
-
* @description
|
|
2370
|
-
*
|
|
2371
|
-
* Disables replacement of `import.meta.env` values with `process.env` calls and their coercion
|
|
2372
|
-
*
|
|
2373
|
-
* Currently, non-public `import.meta.env` environment variables are replaced by a reference to `process.env`. Additionally, Astro may also convert the value type of your environment variables used through `import.meta.env`, which can prevent access to some values such as the strings `"true"` (which is converted to a boolean value), and `"1"` (which is converted to a number).
|
|
2374
|
-
*
|
|
2375
|
-
* The `experimental.staticImportMetaEnv` flag simplifies Astro's default behavior, making it easier to understand and use. Astro will no longer replace any `import.meta.env` environment variables with a `process.env` call, nor will it coerce values.
|
|
2376
|
-
*
|
|
2377
|
-
* This flag aligns `import.meta.env`'s behavior in Astro with [Vite](https://vite.dev/guide/env-and-mode.html#env-variables).
|
|
2378
|
-
*
|
|
2379
|
-
* See the [experimental static `import.meta.env` docs](https://docs.astro.build/en/reference/experimental-flags/static-import-meta-env/) for more information.
|
|
2380
|
-
*/
|
|
2381
|
-
staticImportMetaEnv?: boolean;
|
|
2382
2259
|
/**
|
|
2383
2260
|
* @name experimental.chromeDevtoolsWorkspace
|
|
2384
2261
|
* @type {boolean}
|
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
import type { z } from 'zod';
|
|
2
2
|
import type { ActionAccept, ActionClient, ActionReturnType } from '../../actions/runtime/server.js';
|
|
3
|
-
import type { SUPPORTED_MARKDOWN_FILE_EXTENSIONS } from '../../core/constants.js';
|
|
4
3
|
import type { AstroCookies } from '../../core/cookies/cookies.js';
|
|
5
4
|
import type { CspDirective, CspHash } from '../../core/csp/config.js';
|
|
6
5
|
import type { AstroSession } from '../../core/session.js';
|
|
7
6
|
import type { AstroComponentFactory } from '../../runtime/server/index.js';
|
|
8
7
|
import type { Params, RewritePayload } from './common.js';
|
|
9
8
|
import type { ValidRedirectStatus } from './config.js';
|
|
10
|
-
import type { AstroInstance, MarkdownInstance, MDXInstance } from './content.js';
|
|
11
9
|
/**
|
|
12
10
|
* Astro global available in all contexts in .astro files
|
|
13
11
|
*
|
|
14
12
|
* [Astro reference](https://docs.astro.build/reference/api-reference/#astro-global)
|
|
15
13
|
*/
|
|
16
|
-
export interface AstroGlobal<Props extends Record<string, any> = Record<string, any>, Self = AstroComponentFactory, Params extends Record<string, string | undefined> = Record<string, string | undefined>> extends
|
|
14
|
+
export interface AstroGlobal<Props extends Record<string, any> = Record<string, any>, Self = AstroComponentFactory, Params extends Record<string, string | undefined> = Record<string, string | undefined>> extends AstroSharedContext<Props, Params> {
|
|
15
|
+
/**
|
|
16
|
+
* Returns a [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) object built from the [site](https://docs.astro.build/en/reference/configuration-reference/#site) config option
|
|
17
|
+
*
|
|
18
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#astrosite)
|
|
19
|
+
*/
|
|
20
|
+
site: URL | undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Returns a string with the current version of Astro.
|
|
23
|
+
*
|
|
24
|
+
* Useful for using `<meta name="generator" content={Astro.generator} />` or crediting Astro in a site footer.
|
|
25
|
+
*
|
|
26
|
+
* [HTML Specification for `generator`](https://html.spec.whatwg.org/multipage/semantics.html#meta-generator)
|
|
27
|
+
*
|
|
28
|
+
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#astrogenerator)
|
|
29
|
+
*/
|
|
30
|
+
generator: string;
|
|
17
31
|
/**
|
|
18
32
|
* A full URL object of the request URL.
|
|
19
33
|
* Equivalent to: `new URL(Astro.request.url)`
|
|
@@ -195,42 +209,7 @@ export interface AstroGlobal<Props extends Record<string, any> = Record<string,
|
|
|
195
209
|
render(slotName: string, args?: any[]): Promise<string>;
|
|
196
210
|
};
|
|
197
211
|
}
|
|
198
|
-
|
|
199
|
-
type MarkdownFileExtension = (typeof SUPPORTED_MARKDOWN_FILE_EXTENSIONS)[number];
|
|
200
|
-
export interface AstroGlobalPartial {
|
|
201
|
-
/**
|
|
202
|
-
* Fetch local files into your static site setup
|
|
203
|
-
*
|
|
204
|
-
* Example usage:
|
|
205
|
-
* ```typescript
|
|
206
|
-
* const posts = await Astro.glob('../pages/post/*.md');
|
|
207
|
-
* ```
|
|
208
|
-
*
|
|
209
|
-
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#astroglob)
|
|
210
|
-
* @deprecated Astro.glob is deprecated and will be removed in the next major version of Astro. Use `import.meta.glob` instead: https://vitejs.dev/guide/features.html#glob-import
|
|
211
|
-
*/
|
|
212
|
-
glob(globStr: `${any}.astro`): Promise<AstroInstance[]>;
|
|
213
|
-
glob<T extends Record<string, any>>(globStr: `${any}${MarkdownFileExtension}`): Promise<MarkdownInstance<T>[]>;
|
|
214
|
-
glob<T extends Record<string, any>>(globStr: `${any}.mdx`): Promise<MDXInstance<T>[]>;
|
|
215
|
-
glob<T extends Record<string, any>>(globStr: string): Promise<T[]>;
|
|
216
|
-
/**
|
|
217
|
-
* Returns a [URL](https://developer.mozilla.org/en-US/docs/Web/API/URL) object built from the [site](https://docs.astro.build/en/reference/configuration-reference/#site) config option
|
|
218
|
-
*
|
|
219
|
-
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#astrosite)
|
|
220
|
-
*/
|
|
221
|
-
site: URL | undefined;
|
|
222
|
-
/**
|
|
223
|
-
* Returns a string with the current version of Astro.
|
|
224
|
-
*
|
|
225
|
-
* Useful for using `<meta name="generator" content={Astro.generator} />` or crediting Astro in a site footer.
|
|
226
|
-
*
|
|
227
|
-
* [HTML Specification for `generator`](https://html.spec.whatwg.org/multipage/semantics.html#meta-generator)
|
|
228
|
-
*
|
|
229
|
-
* [Astro reference](https://docs.astro.build/en/reference/api-reference/#astrogenerator)
|
|
230
|
-
*/
|
|
231
|
-
generator: string;
|
|
232
|
-
}
|
|
233
|
-
export interface AstroSharedContext<Props extends Record<string, any> = Record<string, any>, RouteParams extends Record<string, string | undefined> = Record<string, string | undefined>> {
|
|
212
|
+
interface AstroSharedContext<Props extends Record<string, any> = Record<string, any>, RouteParams extends Record<string, string | undefined> = Record<string, string | undefined>> {
|
|
234
213
|
/**
|
|
235
214
|
* The address (usually IP address) of the user.
|
|
236
215
|
*
|
|
@@ -184,11 +184,6 @@ export interface BaseIntegrationHooks {
|
|
|
184
184
|
}) => void | Promise<void>;
|
|
185
185
|
'astro:build:ssr': (options: {
|
|
186
186
|
manifest: SerializedSSRManifest;
|
|
187
|
-
/**
|
|
188
|
-
* This maps a {@link RouteData} to an {@link URL}, this URL represents
|
|
189
|
-
* the physical file you should import.
|
|
190
|
-
*/
|
|
191
|
-
entryPoints: Map<IntegrationRouteData, URL>;
|
|
192
187
|
/**
|
|
193
188
|
* File path of the emitted middleware
|
|
194
189
|
*/
|
|
@@ -215,8 +210,6 @@ export interface BaseIntegrationHooks {
|
|
|
215
210
|
pathname: string;
|
|
216
211
|
}[];
|
|
217
212
|
dir: URL;
|
|
218
|
-
/** @deprecated Use the `assets` map and the new `astro:routes:resolved` hook */
|
|
219
|
-
routes: IntegrationRouteData[];
|
|
220
213
|
assets: Map<string, URL[]>;
|
|
221
214
|
logger: AstroIntegrationLogger;
|
|
222
215
|
}) => void | Promise<void>;
|
|
@@ -237,16 +230,6 @@ export interface AstroIntegration {
|
|
|
237
230
|
[K in keyof Astro.IntegrationHooks]?: Astro.IntegrationHooks[K];
|
|
238
231
|
} & Partial<Record<string, unknown>>;
|
|
239
232
|
}
|
|
240
|
-
/**
|
|
241
|
-
* A smaller version of the {@link RouteData} that is used in the integrations.
|
|
242
|
-
* @deprecated Use {@link IntegrationResolvedRoute}
|
|
243
|
-
*/
|
|
244
|
-
export type IntegrationRouteData = Omit<RouteData, 'isIndex' | 'fallbackRoutes' | 'redirectRoute' | 'origin'> & {
|
|
245
|
-
/**
|
|
246
|
-
* {@link RouteData.redirectRoute}
|
|
247
|
-
*/
|
|
248
|
-
redirectRoute?: IntegrationRouteData;
|
|
249
|
-
};
|
|
250
233
|
export type RouteToHeaders = Map<string, HeaderPayload>;
|
|
251
234
|
export type HeaderPayload = {
|
|
252
235
|
headers: Headers;
|
|
@@ -4,7 +4,7 @@ import type { AstroCookies } from '../../core/cookies/cookies.js';
|
|
|
4
4
|
import type { AstroComponentInstance, ServerIslandComponent } from '../../runtime/server/index.js';
|
|
5
5
|
import type { Params } from './common.js';
|
|
6
6
|
import type { AstroConfig, RedirectConfig } from './config.js';
|
|
7
|
-
import type { AstroGlobal
|
|
7
|
+
import type { AstroGlobal } from './context.js';
|
|
8
8
|
import type { AstroRenderer } from './integrations.js';
|
|
9
9
|
export type { SSRActions, SSRManifest, SSRManifestCSP } from '../../core/app/types.js';
|
|
10
10
|
export interface NamedSSRLoadedRendererValue extends SSRLoadedRendererValue {
|
|
@@ -202,7 +202,7 @@ export interface SSRResult {
|
|
|
202
202
|
links: Set<SSRElement>;
|
|
203
203
|
componentMetadata: Map<string, SSRComponentMetadata>;
|
|
204
204
|
inlinedScripts: Map<string, string>;
|
|
205
|
-
createAstro(
|
|
205
|
+
createAstro(props: Record<string, any>, slots: Record<string, any> | null): AstroGlobal;
|
|
206
206
|
params: Params;
|
|
207
207
|
resolve: (s: string) => Promise<string>;
|
|
208
208
|
response: AstroGlobal['response'];
|
|
@@ -3,8 +3,6 @@ export { defineLiveCollection } from '../content/config.js';
|
|
|
3
3
|
export declare const getCollection: () => never;
|
|
4
4
|
export declare const render: () => never;
|
|
5
5
|
export declare const getEntry: () => never;
|
|
6
|
-
export declare const getEntryBySlug: () => never;
|
|
7
|
-
export declare const getDataEntryById: () => never;
|
|
8
6
|
export declare const getEntries: () => never;
|
|
9
7
|
export declare const reference: () => never;
|
|
10
8
|
export declare const getLiveCollection: () => never;
|
|
@@ -14,8 +14,6 @@ function createErrorFunction(message) {
|
|
|
14
14
|
const getCollection = createErrorFunction("getCollection");
|
|
15
15
|
const render = createErrorFunction("render");
|
|
16
16
|
const getEntry = createErrorFunction("getEntry");
|
|
17
|
-
const getEntryBySlug = createErrorFunction("getEntryBySlug");
|
|
18
|
-
const getDataEntryById = createErrorFunction("getDataEntryById");
|
|
19
17
|
const getEntries = createErrorFunction("getEntries");
|
|
20
18
|
const reference = createErrorFunction("reference");
|
|
21
19
|
const getLiveCollection = createErrorFunction("getLiveCollection");
|
|
@@ -25,10 +23,8 @@ export {
|
|
|
25
23
|
defineCollection,
|
|
26
24
|
defineLiveCollection,
|
|
27
25
|
getCollection,
|
|
28
|
-
getDataEntryById,
|
|
29
26
|
getEntries,
|
|
30
27
|
getEntry,
|
|
31
|
-
getEntryBySlug,
|
|
32
28
|
getLiveCollection,
|
|
33
29
|
getLiveEntry,
|
|
34
30
|
reference,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-alpha.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",
|
|
@@ -77,14 +77,14 @@
|
|
|
77
77
|
"./virtual-modules/*": "./dist/virtual-modules/*"
|
|
78
78
|
},
|
|
79
79
|
"bin": {
|
|
80
|
-
"astro": "astro.
|
|
80
|
+
"astro": "./bin/astro.mjs"
|
|
81
81
|
},
|
|
82
82
|
"files": [
|
|
83
83
|
"components/*.{astro,css,ts}",
|
|
84
84
|
"tsconfigs",
|
|
85
85
|
"dist",
|
|
86
86
|
"types",
|
|
87
|
-
"
|
|
87
|
+
"bin",
|
|
88
88
|
"env.d.ts",
|
|
89
89
|
"client.d.ts",
|
|
90
90
|
"jsx-runtime.d.ts",
|
|
@@ -94,11 +94,10 @@
|
|
|
94
94
|
"README.md"
|
|
95
95
|
],
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@astrojs/compiler": "
|
|
97
|
+
"@astrojs/compiler": "0.0.0-render-script-20251003120459",
|
|
98
98
|
"@capsizecss/unpack": "^3.0.0",
|
|
99
99
|
"@oslojs/encoding": "^1.1.0",
|
|
100
100
|
"@rollup/pluginutils": "^5.2.0",
|
|
101
|
-
"acorn": "^8.15.0",
|
|
102
101
|
"aria-query": "^5.3.2",
|
|
103
102
|
"axobject-query": "^4.1.0",
|
|
104
103
|
"boxen": "8.0.1",
|
|
@@ -115,13 +114,11 @@
|
|
|
115
114
|
"dset": "^3.1.4",
|
|
116
115
|
"es-module-lexer": "^1.7.0",
|
|
117
116
|
"esbuild": "^0.25.0",
|
|
118
|
-
"estree-walker": "^3.0.3",
|
|
119
117
|
"flattie": "^1.1.1",
|
|
120
118
|
"fontace": "~0.3.0",
|
|
121
119
|
"github-slugger": "^2.0.0",
|
|
122
120
|
"html-escaper": "3.0.3",
|
|
123
121
|
"http-cache-semantics": "^4.2.0",
|
|
124
|
-
"import-meta-resolve": "^4.2.0",
|
|
125
122
|
"js-yaml": "^4.1.0",
|
|
126
123
|
"magic-string": "^0.30.18",
|
|
127
124
|
"magicast": "^0.3.5",
|
|
@@ -145,7 +142,7 @@
|
|
|
145
142
|
"unist-util-visit": "^5.0.0",
|
|
146
143
|
"unstorage": "^1.17.0",
|
|
147
144
|
"vfile": "^6.0.3",
|
|
148
|
-
"vite": "^
|
|
145
|
+
"vite": "^7.1.7",
|
|
149
146
|
"vitefu": "^1.1.1",
|
|
150
147
|
"xxhash-wasm": "^1.1.0",
|
|
151
148
|
"yargs-parser": "^21.1.1",
|
|
@@ -154,7 +151,7 @@
|
|
|
154
151
|
"zod-to-json-schema": "^3.24.6",
|
|
155
152
|
"zod-to-ts": "^1.2.0",
|
|
156
153
|
"@astrojs/internal-helpers": "0.7.4",
|
|
157
|
-
"@astrojs/markdown-remark": "
|
|
154
|
+
"@astrojs/markdown-remark": "7.0.0-alpha.0",
|
|
158
155
|
"@astrojs/telemetry": "3.3.0"
|
|
159
156
|
},
|
|
160
157
|
"optionalDependencies": {
|
|
@@ -194,11 +191,11 @@
|
|
|
194
191
|
"undici": "^6.21.3",
|
|
195
192
|
"unified": "^11.0.5",
|
|
196
193
|
"vitest": "^3.2.4",
|
|
197
|
-
"@astrojs/check": "0.9.
|
|
194
|
+
"@astrojs/check": "0.9.6-alpha.0",
|
|
198
195
|
"astro-scripts": "0.0.14"
|
|
199
196
|
},
|
|
200
197
|
"engines": {
|
|
201
|
-
"node": "
|
|
198
|
+
"node": "^20.19.5 || >=22.12.0",
|
|
202
199
|
"npm": ">=9.6.5",
|
|
203
200
|
"pnpm": ">=7.1.0"
|
|
204
201
|
},
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
// astro-head-inject
|
|
2
2
|
import {
|
|
3
|
-
|
|
3
|
+
createDeprecatedFunction,
|
|
4
4
|
createGetCollection,
|
|
5
|
-
createGetDataEntryById,
|
|
6
5
|
createGetEntries,
|
|
7
6
|
createGetEntry,
|
|
8
|
-
createGetEntryBySlug,
|
|
9
7
|
createGetLiveCollection,
|
|
10
8
|
createGetLiveEntry,
|
|
11
9
|
createReference,
|
|
@@ -20,76 +18,17 @@ export { z } from 'astro/zod';
|
|
|
20
18
|
|
|
21
19
|
/* @@LIVE_CONTENT_CONFIG@@ */
|
|
22
20
|
|
|
23
|
-
const contentDir = '@@CONTENT_DIR@@';
|
|
24
|
-
|
|
25
|
-
const contentEntryGlob = '@@CONTENT_ENTRY_GLOB_PATH@@';
|
|
26
|
-
const contentCollectionToEntryMap = createCollectionToGlobResultMap({
|
|
27
|
-
globResult: contentEntryGlob,
|
|
28
|
-
contentDir,
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
const dataEntryGlob = '@@DATA_ENTRY_GLOB_PATH@@';
|
|
32
|
-
const dataCollectionToEntryMap = createCollectionToGlobResultMap({
|
|
33
|
-
globResult: dataEntryGlob,
|
|
34
|
-
contentDir,
|
|
35
|
-
});
|
|
36
|
-
const collectionToEntryMap = createCollectionToGlobResultMap({
|
|
37
|
-
globResult: { ...contentEntryGlob, ...dataEntryGlob },
|
|
38
|
-
contentDir,
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
let lookupMap = {};
|
|
42
|
-
/* @@LOOKUP_MAP_ASSIGNMENT@@ */
|
|
43
|
-
|
|
44
|
-
const collectionNames = new Set(Object.keys(lookupMap));
|
|
45
|
-
|
|
46
|
-
function createGlobLookup(glob) {
|
|
47
|
-
return async (collection, lookupId) => {
|
|
48
|
-
const filePath = lookupMap[collection]?.entries[lookupId];
|
|
49
|
-
|
|
50
|
-
if (!filePath) return undefined;
|
|
51
|
-
return glob[collection][filePath];
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const renderEntryGlob = '@@RENDER_ENTRY_GLOB_PATH@@';
|
|
56
|
-
const collectionToRenderEntryMap = createCollectionToGlobResultMap({
|
|
57
|
-
globResult: renderEntryGlob,
|
|
58
|
-
contentDir,
|
|
59
|
-
});
|
|
60
|
-
|
|
61
|
-
const cacheEntriesByCollection = new Map();
|
|
62
21
|
export const getCollection = createGetCollection({
|
|
63
|
-
contentCollectionToEntryMap,
|
|
64
|
-
dataCollectionToEntryMap,
|
|
65
|
-
getRenderEntryImport: createGlobLookup(collectionToRenderEntryMap),
|
|
66
|
-
cacheEntriesByCollection,
|
|
67
22
|
liveCollections,
|
|
68
23
|
});
|
|
69
24
|
|
|
70
25
|
export const getEntry = createGetEntry({
|
|
71
|
-
getEntryImport: createGlobLookup(collectionToEntryMap),
|
|
72
|
-
getRenderEntryImport: createGlobLookup(collectionToRenderEntryMap),
|
|
73
|
-
collectionNames,
|
|
74
26
|
liveCollections,
|
|
75
27
|
});
|
|
76
28
|
|
|
77
|
-
export const getEntryBySlug = createGetEntryBySlug({
|
|
78
|
-
getEntryImport: createGlobLookup(contentCollectionToEntryMap),
|
|
79
|
-
getRenderEntryImport: createGlobLookup(collectionToRenderEntryMap),
|
|
80
|
-
collectionNames,
|
|
81
|
-
getEntry,
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
export const getDataEntryById = createGetDataEntryById({
|
|
85
|
-
getEntryImport: createGlobLookup(dataCollectionToEntryMap),
|
|
86
|
-
collectionNames,
|
|
87
|
-
getEntry,
|
|
88
|
-
});
|
|
89
|
-
|
|
90
29
|
export const getEntries = createGetEntries(getEntry);
|
|
91
30
|
|
|
92
|
-
export const reference = createReference(
|
|
31
|
+
export const reference = createReference();
|
|
93
32
|
|
|
94
33
|
export const getLiveCollection = createGetLiveCollection({
|
|
95
34
|
liveCollections,
|
|
@@ -98,3 +37,9 @@ export const getLiveCollection = createGetLiveCollection({
|
|
|
98
37
|
export const getLiveEntry = createGetLiveEntry({
|
|
99
38
|
liveCollections,
|
|
100
39
|
});
|
|
40
|
+
|
|
41
|
+
// TODO: remove in Astro 7
|
|
42
|
+
export const getEntryBySlug = createDeprecatedFunction('getEntryBySlug');
|
|
43
|
+
|
|
44
|
+
// TODO: remove in Astro 7
|
|
45
|
+
export const getDataEntryById = createDeprecatedFunction('getDataEntryById');
|