astro 3.0.13 → 3.1.1
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/README.md +2 -2
- package/astro-jsx.d.ts +28 -1
- package/client.d.ts +9 -7
- package/components/ViewTransitions.astro +15 -15
- package/content-types.template.d.ts +7 -1
- package/dist/@types/astro.d.ts +38 -17
- package/dist/assets/build/generate.d.ts +1 -1
- package/dist/assets/build/remote.d.ts +1 -1
- package/dist/assets/consts.d.ts +2 -2
- package/dist/assets/consts.js +4 -10
- package/dist/assets/internal.d.ts +2 -2
- package/dist/assets/internal.js +3 -2
- package/dist/assets/services/service.d.ts +1 -1
- package/dist/assets/services/service.js +7 -3
- package/dist/assets/services/vendor/squoosh/avif/avif_node_dec.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/avif/avif_node_enc.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/codecs.d.ts +4 -4
- package/dist/assets/services/vendor/squoosh/image-pool.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/image.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/image_data.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/impl.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_dec.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/mozjpeg/mozjpeg_node_enc.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/png/squoosh_oxipng_bg.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/png/squoosh_png_bg.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/resize/squoosh_resize_bg.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/rotate/rotate.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/utils/workerPool.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/webp/webp_node_dec.wasm.d.ts +1 -1
- package/dist/assets/services/vendor/squoosh/webp/webp_node_enc.wasm.d.ts +1 -1
- package/dist/assets/types.d.ts +4 -1
- package/dist/assets/utils/metadata.d.ts +1 -1
- package/dist/assets/utils/metadata.js +6 -2
- package/dist/assets/vite-plugin-assets.d.ts +1 -1
- package/dist/assets/vite-plugin-assets.js +1 -1
- package/dist/cli/add/babel.d.ts +12 -11
- package/dist/config/index.d.ts +1 -1
- package/dist/config/vite-plugin-content-listen.d.ts +2 -2
- package/dist/content/server-listeners.d.ts +1 -1
- package/dist/content/types-generator.d.ts +2 -2
- package/dist/content/utils.d.ts +1 -1
- package/dist/content/vite-plugin-content-assets.d.ts +1 -1
- package/dist/content/vite-plugin-content-imports.d.ts +1 -1
- package/dist/content/vite-plugin-content-virtual-mod.d.ts +1 -1
- package/dist/core/app/common.d.ts +1 -1
- package/dist/core/app/index.d.ts +1 -1
- package/dist/core/app/node.d.ts +3 -3
- package/dist/core/app/ssrPipeline.d.ts +1 -1
- package/dist/core/app/types.d.ts +2 -2
- package/dist/core/build/buildPipeline.d.ts +4 -4
- package/dist/core/build/common.d.ts +1 -1
- package/dist/core/build/css-asset-name.d.ts +1 -1
- package/dist/core/build/generate.d.ts +2 -2
- package/dist/core/build/generate.js +1 -1
- package/dist/core/build/index.d.ts +1 -1
- package/dist/core/build/internal.d.ts +3 -3
- package/dist/core/build/page-data.d.ts +3 -3
- package/dist/core/build/plugin.d.ts +2 -2
- package/dist/core/build/plugins/index.d.ts +1 -1
- package/dist/core/build/plugins/plugin-css.d.ts +3 -3
- package/dist/core/build/plugins/plugin-hoisted-scripts.d.ts +3 -3
- package/dist/core/build/plugins/plugin-internals.d.ts +1 -1
- package/dist/core/build/plugins/plugin-manifest.d.ts +3 -3
- package/dist/core/build/plugins/plugin-manifest.js +2 -2
- package/dist/core/build/plugins/plugin-middleware.d.ts +3 -3
- package/dist/core/build/plugins/plugin-pages.d.ts +3 -3
- package/dist/core/build/plugins/plugin-prerender.d.ts +1 -1
- package/dist/core/build/plugins/plugin-renderers.d.ts +2 -2
- package/dist/core/build/plugins/plugin-ssr.d.ts +2 -2
- package/dist/core/build/plugins/plugin-ssr.js +2 -2
- package/dist/core/build/static-build.d.ts +2 -2
- package/dist/core/build/types.d.ts +5 -4
- package/dist/core/compile/cache.d.ts +1 -1
- package/dist/core/compile/compile.d.ts +1 -1
- package/dist/core/compile/index.d.ts +2 -2
- package/dist/core/config/config.d.ts +2 -2
- package/dist/core/config/index.d.ts +1 -1
- package/dist/core/config/schema.d.ts +29 -15
- package/dist/core/config/schema.js +1 -0
- package/dist/core/config/settings.d.ts +1 -1
- package/dist/core/config/vite-load.d.ts +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/cookies/response.d.ts +1 -1
- package/dist/core/create-vite.d.ts +3 -3
- package/dist/core/create-vite.js +1 -1
- package/dist/core/dev/container.d.ts +4 -4
- package/dist/core/dev/dev.d.ts +3 -3
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/dev/restart.d.ts +3 -3
- package/dist/core/endpoint/index.d.ts +3 -3
- package/dist/core/errors/dev/utils.js +4 -4
- package/dist/core/errors/errors-data.d.ts +12 -3
- package/dist/core/errors/errors-data.js +7 -4
- package/dist/core/errors/index.d.ts +1 -1
- package/dist/core/errors/overlay.js +2 -2
- package/dist/core/logger/node.d.ts +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/middleware/callMiddleware.d.ts +2 -2
- package/dist/core/middleware/index.d.ts +2 -2
- package/dist/core/middleware/loadMiddleware.d.ts +2 -2
- package/dist/core/middleware/sequence.d.ts +1 -1
- package/dist/core/module-loader/loader.d.ts +2 -2
- package/dist/core/module-loader/vite.d.ts +1 -1
- package/dist/core/pipeline.d.ts +1 -1
- package/dist/core/preview/index.d.ts +1 -1
- package/dist/core/preview/static-preview-server.d.ts +3 -3
- package/dist/core/redirects/component.d.ts +2 -2
- package/dist/core/redirects/helpers.d.ts +1 -1
- package/dist/core/render/context.d.ts +2 -2
- package/dist/core/render/core.d.ts +1 -1
- package/dist/core/render/environment.d.ts +1 -1
- package/dist/core/render/index.d.ts +2 -2
- package/dist/core/render/paginate.d.ts +1 -1
- package/dist/core/render/params-and-props.d.ts +1 -1
- package/dist/core/render/renderer.d.ts +1 -1
- package/dist/core/render/result.d.ts +1 -1
- package/dist/core/render/route-cache.d.ts +1 -1
- package/dist/core/render/ssr-element.d.ts +2 -2
- package/dist/core/request.d.ts +2 -2
- package/dist/core/routing/manifest/create.d.ts +3 -3
- package/dist/core/routing/manifest/generator.d.ts +1 -1
- package/dist/core/routing/manifest/serialization.d.ts +1 -1
- package/dist/core/routing/match.d.ts +1 -1
- package/dist/core/routing/params.d.ts +1 -1
- package/dist/core/routing/validation.d.ts +2 -2
- package/dist/core/sync/index.d.ts +2 -2
- package/dist/core/util.d.ts +2 -2
- package/dist/events/session.d.ts +1 -1
- package/dist/integrations/astroFeaturesValidation.d.ts +1 -1
- package/dist/integrations/index.d.ts +3 -3
- package/dist/prerender/metadata.d.ts +1 -1
- package/dist/prerender/routing.d.ts +2 -2
- package/dist/prerender/utils.d.ts +1 -1
- package/dist/runtime/client/idle.d.ts +1 -1
- package/dist/runtime/client/load.d.ts +1 -1
- package/dist/runtime/client/media.d.ts +1 -1
- package/dist/runtime/client/only.d.ts +1 -1
- package/dist/runtime/client/visible.d.ts +1 -1
- package/dist/runtime/client/visible.prebuilt.d.ts +1 -1
- package/dist/runtime/client/visible.prebuilt.js +1 -1
- package/dist/runtime/server/astro-component.d.ts +1 -1
- package/dist/runtime/server/astro-global.d.ts +1 -1
- package/dist/runtime/server/astro-island.d.ts +1 -4
- package/dist/runtime/server/endpoint.d.ts +2 -2
- package/dist/runtime/server/hydration.d.ts +1 -1
- package/dist/runtime/server/render/astro/factory.d.ts +3 -3
- package/dist/runtime/server/render/astro/head-and-content.d.ts +1 -1
- package/dist/runtime/server/render/astro/index.d.ts +2 -2
- package/dist/runtime/server/render/astro/instance.d.ts +1 -1
- package/dist/runtime/server/render/astro/render.d.ts +1 -1
- package/dist/runtime/server/render/common.d.ts +1 -1
- package/dist/runtime/server/render/component.d.ts +1 -1
- package/dist/runtime/server/render/dom.d.ts +1 -1
- package/dist/runtime/server/render/head.d.ts +1 -1
- package/dist/runtime/server/render/index.d.ts +2 -2
- package/dist/runtime/server/render/page.d.ts +2 -2
- package/dist/runtime/server/render/tags.d.ts +2 -2
- package/dist/runtime/server/render/util.d.ts +1 -1
- package/dist/runtime/server/scripts.d.ts +1 -1
- package/dist/runtime/server/scripts.js +3 -3
- package/dist/runtime/server/serialize.d.ts +1 -1
- package/dist/runtime/server/transition.d.ts +1 -1
- package/dist/transitions/index.d.ts +1 -1
- package/dist/type-utils.d.ts +4 -0
- package/dist/vite-plugin-astro/hmr.d.ts +1 -1
- package/dist/vite-plugin-astro/index.d.ts +2 -2
- package/dist/vite-plugin-astro/metadata.d.ts +2 -2
- package/dist/vite-plugin-astro/types.d.ts +1 -1
- package/dist/vite-plugin-astro-server/base.d.ts +1 -1
- package/dist/vite-plugin-astro-server/controller.d.ts +2 -2
- package/dist/vite-plugin-astro-server/css.d.ts +1 -1
- package/dist/vite-plugin-astro-server/devPipeline.d.ts +4 -4
- package/dist/vite-plugin-astro-server/index.d.ts +1 -1
- package/dist/vite-plugin-astro-server/metadata.d.ts +2 -2
- package/dist/vite-plugin-astro-server/plugin.d.ts +2 -2
- package/dist/vite-plugin-astro-server/request.d.ts +4 -4
- package/dist/vite-plugin-astro-server/resolve.d.ts +1 -1
- package/dist/vite-plugin-astro-server/response.d.ts +2 -2
- package/dist/vite-plugin-astro-server/route.d.ts +2 -2
- package/dist/vite-plugin-astro-server/scripts.d.ts +2 -2
- package/dist/vite-plugin-astro-server/vite.d.ts +1 -1
- package/dist/vite-plugin-config-alias/index.d.ts +1 -1
- package/dist/vite-plugin-env/index.d.ts +1 -1
- package/dist/vite-plugin-inject-env-ts/index.d.ts +1 -1
- package/dist/vite-plugin-load-fallback/index.d.ts +1 -1
- package/dist/vite-plugin-markdown/index.d.ts +1 -1
- package/dist/vite-plugin-markdown/index.js +20 -20
- package/dist/vite-plugin-mdx/index.d.ts +1 -1
- package/dist/vite-plugin-utils/index.d.ts +1 -1
- package/package.json +4 -2
- package/types.d.ts +6 -1
- package/dist/assets/vendor/image-size/detector.d.ts +0 -3
- package/dist/assets/vendor/image-size/detector.js +0 -28
- package/dist/assets/vendor/image-size/index.d.ts +0 -11
- package/dist/assets/vendor/image-size/index.js +0 -93
- package/dist/assets/vendor/image-size/readUInt.d.ts +0 -4
- package/dist/assets/vendor/image-size/readUInt.js +0 -9
- package/dist/assets/vendor/image-size/types/bmp.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/bmp.js +0 -14
- package/dist/assets/vendor/image-size/types/cur.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/cur.js +0 -16
- package/dist/assets/vendor/image-size/types/dds.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/dds.js +0 -14
- package/dist/assets/vendor/image-size/types/gif.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/gif.js +0 -16
- package/dist/assets/vendor/image-size/types/icns.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/icns.js +0 -87
- package/dist/assets/vendor/image-size/types/ico.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/ico.js +0 -42
- package/dist/assets/vendor/image-size/types/interface.d.ts +0 -14
- package/dist/assets/vendor/image-size/types/interface.js +0 -0
- package/dist/assets/vendor/image-size/types/j2c.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/j2c.js +0 -14
- package/dist/assets/vendor/image-size/types/jp2.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/jp2.js +0 -56
- package/dist/assets/vendor/image-size/types/jpg.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/jpg.js +0 -95
- package/dist/assets/vendor/image-size/types/ktx.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/ktx.js +0 -15
- package/dist/assets/vendor/image-size/types/png.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/png.js +0 -33
- package/dist/assets/vendor/image-size/types/pnm.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/pnm.js +0 -72
- package/dist/assets/vendor/image-size/types/psd.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/psd.js +0 -14
- package/dist/assets/vendor/image-size/types/svg.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/svg.js +0 -91
- package/dist/assets/vendor/image-size/types/tiff.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/tiff.js +0 -81
- package/dist/assets/vendor/image-size/types/webp.d.ts +0 -2
- package/dist/assets/vendor/image-size/types/webp.js +0 -51
- package/dist/assets/vendor/image-size/types.d.ts +0 -19
- package/dist/assets/vendor/image-size/types.js +0 -37
- package/dist/assets/vendor/queue/queue.d.ts +0 -39
- package/dist/assets/vendor/queue/queue.js +0 -187
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AstroCookies, ComponentInstance, MiddlewareHandler } from '../../@types/astro';
|
|
1
|
+
import type { AstroCookies, ComponentInstance, MiddlewareHandler } from '../../@types/astro.js';
|
|
2
2
|
import type { RenderContext } from './context.js';
|
|
3
3
|
import type { Environment } from './environment.js';
|
|
4
4
|
export type RenderPage = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AstroMiddlewareInstance, ComponentInstance, RouteData } from '../../@types/astro';
|
|
2
|
-
import type { Environment } from './environment';
|
|
1
|
+
import type { AstroMiddlewareInstance, ComponentInstance, RouteData } from '../../@types/astro.js';
|
|
2
|
+
import type { Environment } from './environment.js';
|
|
3
3
|
export { createRenderContext } from './context.js';
|
|
4
4
|
export type { RenderContext } from './context.js';
|
|
5
5
|
export { tryRenderRoute } from './core.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { PaginateFunction, RouteData } from '../../@types/astro';
|
|
1
|
+
import type { PaginateFunction, RouteData } from '../../@types/astro.js';
|
|
2
2
|
export declare function generatePaginateFunction(routeMatch: RouteData): (...args: Parameters<PaginateFunction>) => ReturnType<PaginateFunction>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentInstance, Params, Props, RouteData } from '../../@types/astro';
|
|
1
|
+
import type { ComponentInstance, Params, Props, RouteData } from '../../@types/astro.js';
|
|
2
2
|
import type { Logger } from '../logger/core.js';
|
|
3
3
|
import { RouteCache } from './route-cache.js';
|
|
4
4
|
interface GetParamsAndPropsOptions {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { AstroRenderer, SSRLoadedRenderer } from '../../@types/astro';
|
|
1
|
+
import type { AstroRenderer, SSRLoadedRenderer } from '../../@types/astro.js';
|
|
2
2
|
import type { ModuleLoader } from '../module-loader/index.js';
|
|
3
3
|
export declare function loadRenderer(renderer: AstroRenderer, moduleLoader: ModuleLoader): Promise<SSRLoadedRenderer | undefined>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Params, SSRElement, SSRLoadedRenderer, SSRResult } from '../../@types/astro';
|
|
1
|
+
import type { Params, SSRElement, SSRLoadedRenderer, SSRResult } from '../../@types/astro.js';
|
|
2
2
|
import { AstroCookies } from '../cookies/index.js';
|
|
3
3
|
import type { Logger } from '../logger/core.js';
|
|
4
4
|
export interface CreateResultArgs {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentInstance, GetStaticPathsItem, GetStaticPathsResultKeyed, Params, RouteData, RuntimeMode } from '../../@types/astro';
|
|
1
|
+
import type { ComponentInstance, GetStaticPathsItem, GetStaticPathsResultKeyed, Params, RouteData, RuntimeMode } from '../../@types/astro.js';
|
|
2
2
|
import type { Logger } from '../logger/core.js';
|
|
3
3
|
interface CallGetStaticPathsOptions {
|
|
4
4
|
mod: ComponentInstance;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { SSRElement } from '../../@types/astro';
|
|
2
|
-
import type { StylesheetAsset } from '../app/types';
|
|
1
|
+
import type { SSRElement } from '../../@types/astro.js';
|
|
2
|
+
import type { StylesheetAsset } from '../app/types.js';
|
|
3
3
|
export declare function createAssetLink(href: string, base?: string, assetsPrefix?: string): string;
|
|
4
4
|
export declare function createStylesheetElement(stylesheet: StylesheetAsset, base?: string, assetsPrefix?: string): SSRElement;
|
|
5
5
|
export declare function createStylesheetElementSet(stylesheets: StylesheetAsset[], base?: string, assetsPrefix?: string): Set<SSRElement>;
|
package/dist/core/request.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import type { IncomingHttpHeaders } from 'node:http';
|
|
3
|
-
import type { Logger } from './logger/core';
|
|
3
|
+
import type { Logger } from './logger/core.js';
|
|
4
4
|
type HeaderType = Headers | Record<string, any> | IncomingHttpHeaders;
|
|
5
5
|
type RequestBody = ArrayBuffer | Blob | ReadableStream | URLSearchParams | FormData;
|
|
6
6
|
export interface CreateRequestOptions {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import type { AstroSettings, ManifestData } from '../../../@types/astro';
|
|
3
|
-
import type { Logger } from '../../logger/core';
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
import type { AstroSettings, ManifestData } from '../../../@types/astro.js';
|
|
3
|
+
import type { Logger } from '../../logger/core.js';
|
|
4
4
|
import nodeFs from 'node:fs';
|
|
5
5
|
export interface CreateRouteManifestParams {
|
|
6
6
|
/** Astro Settings object */
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AstroConfig, RoutePart } from '../../../@types/astro';
|
|
1
|
+
import type { AstroConfig, RoutePart } from '../../../@types/astro.js';
|
|
2
2
|
export declare function getRouteGenerator(segments: RoutePart[][], addTrailingSlash: AstroConfig['trailingSlash']): import("path-to-regexp").PathFunction<object>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { AstroConfig, RouteData, SerializedRouteData } from '../../../@types/astro';
|
|
1
|
+
import type { AstroConfig, RouteData, SerializedRouteData } from '../../../@types/astro.js';
|
|
2
2
|
export declare function serializeRouteData(routeData: RouteData, trailingSlash: AstroConfig['trailingSlash']): SerializedRouteData;
|
|
3
3
|
export declare function deserializeRouteData(rawRouteData: SerializedRouteData): RouteData;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ManifestData, RouteData } from '../../@types/astro';
|
|
1
|
+
import type { ManifestData, RouteData } from '../../@types/astro.js';
|
|
2
2
|
/** Find matching route from pathname */
|
|
3
3
|
export declare function matchRoute(pathname: string, manifest: ManifestData): RouteData | undefined;
|
|
4
4
|
/** Finds all matching routes from pathname */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { GetStaticPathsItem, Params, RouteData } from '../../@types/astro';
|
|
1
|
+
import type { GetStaticPathsItem, Params, RouteData } from '../../@types/astro.js';
|
|
2
2
|
/**
|
|
3
3
|
* given an array of params like `['x', 'y', 'z']` for
|
|
4
4
|
* src/routes/[x]/[y]/[z]/svelte, create a function
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentInstance, GetStaticPathsResult, RouteData } from '../../@types/astro';
|
|
2
|
-
import type { Logger } from '../logger/core';
|
|
1
|
+
import type { ComponentInstance, GetStaticPathsResult, RouteData } from '../../@types/astro.js';
|
|
2
|
+
import type { Logger } from '../logger/core.js';
|
|
3
3
|
/** Throws error for invalid parameter in getStaticPaths() response */
|
|
4
4
|
export declare function validateGetStaticPathsParameter([key, value]: [string, any], route: string): void;
|
|
5
5
|
/** Error for deprecated or malformed route components */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import fsMod from 'node:fs';
|
|
3
|
-
import type { AstroInlineConfig, AstroSettings } from '../../@types/astro';
|
|
3
|
+
import type { AstroInlineConfig, AstroSettings } from '../../@types/astro.js';
|
|
4
4
|
import type { Logger } from '../logger/core.js';
|
|
5
5
|
export type ProcessExit = 0 | 1;
|
|
6
6
|
export type SyncOptions = {
|
package/dist/core/util.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AstroConfig, AstroSettings, RouteType } from '../@types/astro';
|
|
2
|
-
import type { ModuleLoader } from './module-loader';
|
|
1
|
+
import type { AstroConfig, AstroSettings, RouteType } from '../@types/astro.js';
|
|
2
|
+
import type { ModuleLoader } from './module-loader/index.js';
|
|
3
3
|
/** Returns true if argument is an object of any prototype/class (but not null). */
|
|
4
4
|
export declare function isObject(value: unknown): value is Record<string, any>;
|
|
5
5
|
/** Cross-realm compatible URL */
|
package/dist/events/session.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AstroConfig, AstroFeatureMap } from '../@types/astro';
|
|
1
|
+
import type { AstroConfig, AstroFeatureMap } from '../@types/astro.js';
|
|
2
2
|
import type { Logger } from '../core/logger/core.js';
|
|
3
3
|
type ValidationResult = {
|
|
4
4
|
[Property in keyof AstroFeatureMap]: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import type { AddressInfo } from 'node:net';
|
|
3
3
|
import type { InlineConfig, ViteDevServer } from 'vite';
|
|
4
4
|
import type { AstroAdapter, AstroConfig, AstroSettings, RouteData } from '../@types/astro.js';
|
|
5
|
-
import type { SerializedSSRManifest } from '../core/app/types';
|
|
6
|
-
import type { PageBuildData } from '../core/build/types';
|
|
5
|
+
import type { SerializedSSRManifest } from '../core/app/types.js';
|
|
6
|
+
import type { PageBuildData } from '../core/build/types.js';
|
|
7
7
|
import { type Logger } from '../core/logger/core.js';
|
|
8
8
|
export declare function runHookConfigSetup({ settings, command, logger, isRestart, }: {
|
|
9
9
|
settings: AstroSettings;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AstroSettings, ComponentInstance, RouteData } from '../@types/astro';
|
|
2
|
-
import type DevPipeline from '../vite-plugin-astro-server/devPipeline';
|
|
1
|
+
import type { AstroSettings, ComponentInstance, RouteData } from '../@types/astro.js';
|
|
2
|
+
import type DevPipeline from '../vite-plugin-astro-server/devPipeline.js';
|
|
3
3
|
type GetSortedPreloadedMatchesParams = {
|
|
4
4
|
pipeline: DevPipeline;
|
|
5
5
|
matches: RouteData[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ClientDirective } from '../../@types/astro';
|
|
1
|
+
import type { ClientDirective } from '../../@types/astro.js';
|
|
2
2
|
/**
|
|
3
3
|
* Hydrate this component when one of it's children becomes visible
|
|
4
4
|
* We target the children because `astro-island` is set to `display: contents`
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
* Do not edit this directly, but instead edit that file and rerun the prebuild
|
|
4
4
|
* to generate this file.
|
|
5
5
|
*/
|
|
6
|
-
declare const _default: "(()=>{var r=(i,c,
|
|
6
|
+
declare const _default: "(()=>{var r=(i,c,s)=>{let n=async()=>{await(await i())()},t=new IntersectionObserver(e=>{for(let o of e)if(o.isIntersecting){t.disconnect(),n();break}});for(let e of s.children)t.observe(e)};(self.Astro||(self.Astro={})).visible=r;window.dispatchEvent(new Event(\"astro:visible\"));})();";
|
|
7
7
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var visible_prebuilt_default = `(()=>{var r=(i,c,
|
|
1
|
+
var visible_prebuilt_default = `(()=>{var r=(i,c,s)=>{let n=async()=>{await(await i())()},t=new IntersectionObserver(e=>{for(let o of e)if(o.isIntersecting){t.disconnect(),n();break}});for(let e of s.children)t.observe(e)};(self.Astro||(self.Astro={})).visible=r;window.dispatchEvent(new Event("astro:visible"));})();`;
|
|
2
2
|
export {
|
|
3
3
|
visible_prebuilt_default as default
|
|
4
4
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AstroGlobalPartial } from '../../@types/astro';
|
|
1
|
+
import type { AstroGlobalPartial } from '../../@types/astro.js';
|
|
2
2
|
export declare function createAstro(site: string | undefined): AstroGlobalPartial;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { APIContext, EndpointHandler } from '../../@types/astro';
|
|
1
|
+
import type { APIContext, EndpointHandler } from '../../@types/astro.js';
|
|
2
2
|
import type { Logger } from '../../core/logger/core.js';
|
|
3
3
|
/** Renders an endpoint request to completion, returning the body. */
|
|
4
|
-
export declare function renderEndpoint(mod: EndpointHandler, context: APIContext, ssr: boolean, logger: Logger): Promise<Response | import("../../@types/astro").EndpointOutput>;
|
|
4
|
+
export declare function renderEndpoint(mod: EndpointHandler, context: APIContext, ssr: boolean, logger: Logger): Promise<Response | import("../../@types/astro.js").EndpointOutput>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AstroComponentMetadata, SSRElement, SSRLoadedRenderer, SSRResult } from '../../@types/astro';
|
|
1
|
+
import type { AstroComponentMetadata, SSRElement, SSRLoadedRenderer, SSRResult } from '../../@types/astro.js';
|
|
2
2
|
export interface HydrationMetadata {
|
|
3
3
|
directive: string;
|
|
4
4
|
value: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PropagationHint, SSRResult } from '../../../../@types/astro';
|
|
2
|
-
import type { HeadAndContent } from './head-and-content';
|
|
3
|
-
import type { RenderTemplateResult } from './render-template';
|
|
1
|
+
import type { PropagationHint, SSRResult } from '../../../../@types/astro.js';
|
|
2
|
+
import type { HeadAndContent } from './head-and-content.js';
|
|
3
|
+
import type { RenderTemplateResult } from './render-template.js';
|
|
4
4
|
export type AstroFactoryReturnValue = RenderTemplateResult | Response | HeadAndContent;
|
|
5
5
|
export interface AstroComponentFactory {
|
|
6
6
|
(result: any, props: any, slots: any): AstroFactoryReturnValue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export type { AstroComponentFactory } from './factory';
|
|
2
1
|
export { isAstroComponentFactory } from './factory.js';
|
|
2
|
+
export type { AstroComponentFactory } from './factory.js';
|
|
3
3
|
export { createHeadAndContent, isHeadAndContent } from './head-and-content.js';
|
|
4
|
-
export type { AstroComponentInstance } from './instance';
|
|
5
4
|
export { createAstroComponentInstance, isAstroComponentInstance } from './instance.js';
|
|
5
|
+
export type { AstroComponentInstance } from './instance.js';
|
|
6
6
|
export { isRenderTemplateResult, renderTemplate } from './render-template.js';
|
|
7
7
|
export { renderToReadableStream, renderToString } from './render.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SSRResult } from '../../../../@types/astro';
|
|
1
|
+
import type { SSRResult } from '../../../../@types/astro.js';
|
|
2
2
|
import type { ComponentSlots } from '../slot.js';
|
|
3
3
|
import type { AstroComponentFactory, AstroFactoryReturnValue } from './factory.js';
|
|
4
4
|
import type { RenderDestination } from '../common.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RouteData, SSRResult } from '../../../../@types/astro';
|
|
1
|
+
import type { RouteData, SSRResult } from '../../../../@types/astro.js';
|
|
2
2
|
import type { AstroComponentFactory } from './factory.js';
|
|
3
3
|
export declare function renderToString(result: SSRResult, componentFactory: AstroComponentFactory, props: any, children: any, isPage?: boolean, route?: RouteData): Promise<string | Response>;
|
|
4
4
|
export declare function renderToReadableStream(result: SSRResult, componentFactory: AstroComponentFactory, props: any, children: any, isPage?: boolean, route?: RouteData): Promise<ReadableStream | Response>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SSRResult } from '../../../@types/astro';
|
|
1
|
+
import type { SSRResult } from '../../../@types/astro.js';
|
|
2
2
|
import type { RenderInstruction } from './instruction.js';
|
|
3
3
|
import { HTMLBytes, HTMLString } from '../escape.js';
|
|
4
4
|
import { type SlotString } from './slot.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RouteData, SSRResult } from '../../../@types/astro';
|
|
1
|
+
import type { RouteData, SSRResult } from '../../../@types/astro.js';
|
|
2
2
|
import { type RenderInstruction } from './instruction.js';
|
|
3
3
|
import { HTMLBytes } from '../escape.js';
|
|
4
4
|
import { type RenderInstance } from './common.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { SSRResult } from '../../../@types/astro';
|
|
1
|
+
import type { SSRResult } from '../../../@types/astro.js';
|
|
2
2
|
export declare function componentIsHTMLElement(Component: unknown): boolean;
|
|
3
3
|
export declare function renderHTMLElement(result: SSRResult, constructor: typeof HTMLElement, props: any, slots: any): Promise<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SSRResult } from '../../../@types/astro';
|
|
1
|
+
import type { SSRResult } from '../../../@types/astro.js';
|
|
2
2
|
import type { MaybeRenderHeadInstruction, RenderHeadInstruction } from './instruction.js';
|
|
3
3
|
export declare function renderAllHeadContent(result: SSRResult): any;
|
|
4
4
|
export declare function renderHead(): Generator<RenderHeadInstruction>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export type { AstroComponentFactory, AstroComponentInstance } from './astro/index';
|
|
2
1
|
export { createHeadAndContent, renderTemplate, renderToString } from './astro/index.js';
|
|
2
|
+
export type { AstroComponentFactory, AstroComponentInstance } from './astro/index.js';
|
|
3
3
|
export { Fragment, Renderer, chunkToByteArray, chunkToString } from './common.js';
|
|
4
4
|
export { renderComponent, renderComponentToString } from './component.js';
|
|
5
5
|
export { renderHTMLElement } from './dom.js';
|
|
6
6
|
export { maybeRenderHead, renderHead } from './head.js';
|
|
7
|
-
export type { RenderInstruction } from './instruction';
|
|
7
|
+
export type { RenderInstruction } from './instruction.js';
|
|
8
8
|
export { renderPage } from './page.js';
|
|
9
9
|
export { renderSlot, renderSlotToString, type ComponentSlots } from './slot.js';
|
|
10
10
|
export { renderScriptElement, renderUniqueStylesheet } from './tags.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RouteData, SSRResult } from '../../../@types/astro';
|
|
1
|
+
import type { RouteData, SSRResult } from '../../../@types/astro.js';
|
|
2
2
|
import { type NonAstroPageComponent } from './component.js';
|
|
3
|
-
import type { AstroComponentFactory } from './index';
|
|
3
|
+
import type { AstroComponentFactory } from './index.js';
|
|
4
4
|
export declare function renderPage(result: SSRResult, componentFactory: AstroComponentFactory | NonAstroPageComponent, props: any, children: any, streaming: boolean, route?: RouteData): Promise<Response>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SSRElement, SSRResult } from '../../../@types/astro';
|
|
2
|
-
import type { StylesheetAsset } from '../../../core/app/types';
|
|
1
|
+
import type { SSRElement, SSRResult } from '../../../@types/astro.js';
|
|
2
|
+
import type { StylesheetAsset } from '../../../core/app/types.js';
|
|
3
3
|
export declare function renderScriptElement({ props, children }: SSRElement): string;
|
|
4
4
|
export declare function renderUniqueStylesheet(result: SSRResult, sheet: StylesheetAsset): string | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SSRElement } from '../../../@types/astro';
|
|
1
|
+
import type { SSRElement } from '../../../@types/astro.js';
|
|
2
2
|
import type { RenderFunction } from './common.js';
|
|
3
3
|
export declare const voidElementNames: RegExp;
|
|
4
4
|
export declare const toAttributeString: (value: any, shouldEscape?: boolean) => any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SSRResult } from '../../@types/astro';
|
|
1
|
+
import type { SSRResult } from '../../@types/astro.js';
|
|
2
2
|
export declare function determineIfNeedsHydrationScript(result: SSRResult): boolean;
|
|
3
3
|
export declare function determinesIfNeedsDirectiveScript(result: SSRResult, directive: string): boolean;
|
|
4
4
|
export type PrescriptType = null | 'both' | 'directive';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import islandScript from "./astro-island.prebuilt.js";
|
|
2
|
-
const ISLAND_STYLES = `<style>astro-island,astro-slot,astro-static-slot{display:contents}</style>`;
|
|
2
|
+
const ISLAND_STYLES = `<style style="display:none">astro-island,astro-slot,astro-static-slot{display:contents}</style>`;
|
|
3
3
|
function determineIfNeedsHydrationScript(result) {
|
|
4
4
|
if (result._metadata.hasHydrationScript) {
|
|
5
5
|
return false;
|
|
@@ -24,12 +24,12 @@ function getDirectiveScriptText(result, directive) {
|
|
|
24
24
|
function getPrescripts(result, type, directive) {
|
|
25
25
|
switch (type) {
|
|
26
26
|
case "both":
|
|
27
|
-
return `${ISLAND_STYLES}<script>${getDirectiveScriptText(
|
|
27
|
+
return `${ISLAND_STYLES}<script style="display:none">${getDirectiveScriptText(
|
|
28
28
|
result,
|
|
29
29
|
directive
|
|
30
30
|
)};${islandScript}</script>`;
|
|
31
31
|
case "directive":
|
|
32
|
-
return `<script>${getDirectiveScriptText(result, directive)}</script>`;
|
|
32
|
+
return `<script style="display:none">${getDirectiveScriptText(result, directive)}</script>`;
|
|
33
33
|
}
|
|
34
34
|
return "";
|
|
35
35
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { AstroComponentMetadata } from '../../@types/astro';
|
|
1
|
+
import type { AstroComponentMetadata } from '../../@types/astro.js';
|
|
2
2
|
export declare function serializeProps(props: any, metadata: AstroComponentMetadata): string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { SSRResult, TransitionAnimationValue } from '../../@types/astro';
|
|
1
|
+
import type { SSRResult, TransitionAnimationValue } from '../../@types/astro.js';
|
|
2
2
|
export declare function createTransitionScope(result: SSRResult, hash: string): string;
|
|
3
3
|
export declare function renderTransition(result: SSRResult, hash: string, animationName: TransitionAnimationValue | undefined, transitionName: string): string;
|
package/dist/type-utils.d.ts
CHANGED
|
@@ -7,4 +7,8 @@ export type WithRequired<T, K extends keyof T> = T & {
|
|
|
7
7
|
export type OmitIndexSignature<ObjectType> = {
|
|
8
8
|
[KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType];
|
|
9
9
|
};
|
|
10
|
+
export type Kebab<T extends string, A extends string = ''> = T extends `${infer F}${infer R}` ? Kebab<R, `${A}${F extends Lowercase<F> ? '' : '-'}${Lowercase<F>}`> : A;
|
|
11
|
+
export type KebabKeys<T> = {
|
|
12
|
+
[K in keyof T as K extends string ? Kebab<K> : K]: T[K];
|
|
13
|
+
};
|
|
10
14
|
export type ValueOf<T> = T[keyof T];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HmrContext, ModuleNode } from 'vite';
|
|
2
|
-
import type { AstroConfig } from '../@types/astro';
|
|
2
|
+
import type { AstroConfig } from '../@types/astro.js';
|
|
3
3
|
import { cachedCompilation } from '../core/compile/index.js';
|
|
4
4
|
import type { Logger } from '../core/logger/core.js';
|
|
5
5
|
export interface HandleHotUpdateOptions {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type * as vite from 'vite';
|
|
2
|
-
import type { AstroSettings } from '../@types/astro';
|
|
2
|
+
import type { AstroSettings } from '../@types/astro.js';
|
|
3
3
|
import type { Logger } from '../core/logger/core.js';
|
|
4
|
-
import type { PluginMetadata as AstroPluginMetadata } from './types';
|
|
4
|
+
import type { PluginMetadata as AstroPluginMetadata } from './types.js';
|
|
5
5
|
export { getAstroMetadata } from './metadata.js';
|
|
6
6
|
export type { AstroPluginMetadata };
|
|
7
7
|
interface AstroPluginOptions {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { ModuleInfo } from '../core/module-loader';
|
|
2
|
-
import type { PluginMetadata } from './types';
|
|
1
|
+
import type { ModuleInfo } from '../core/module-loader/index.js';
|
|
2
|
+
import type { PluginMetadata } from './types.js';
|
|
3
3
|
export declare function getAstroMetadata(modInfo: ModuleInfo): PluginMetadata['astro'] | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type * as vite from 'vite';
|
|
2
|
-
import type { AstroSettings } from '../@types/astro';
|
|
2
|
+
import type { AstroSettings } from '../@types/astro.js';
|
|
3
3
|
import type { Logger } from '../core/logger/core.js';
|
|
4
4
|
export declare function baseMiddleware(settings: AstroSettings, logger: Logger): vite.Connect.NextHandleFunction;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { LoaderEvents, ModuleLoader } from '../core/module-loader/index';
|
|
2
|
-
import type { ServerState } from './server-state';
|
|
1
|
+
import type { LoaderEvents, ModuleLoader } from '../core/module-loader/index.js';
|
|
2
|
+
import type { ServerState } from './server-state.js';
|
|
3
3
|
type ReloadFn = () => void;
|
|
4
4
|
export interface DevServerController {
|
|
5
5
|
state: ServerState;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RuntimeMode } from '../@types/astro.js';
|
|
2
|
-
import type { ModuleLoader } from '../core/module-loader';
|
|
2
|
+
import type { ModuleLoader } from '../core/module-loader/index.js';
|
|
3
3
|
/** Given a filePath URL, crawl Vite’s module graph to find all style imports. */
|
|
4
4
|
export declare function getStylesForURL(filePath: URL, loader: ModuleLoader, mode: RuntimeMode): Promise<{
|
|
5
5
|
urls: Set<string>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { AstroConfig, AstroSettings, SSRManifest } from '../@types/astro';
|
|
2
|
-
import type { Logger } from '../core/logger/core';
|
|
3
|
-
import type { ModuleLoader } from '../core/module-loader';
|
|
1
|
+
import type { AstroConfig, AstroSettings, SSRManifest } from '../@types/astro.js';
|
|
2
|
+
import type { Logger } from '../core/logger/core.js';
|
|
3
|
+
import type { ModuleLoader } from '../core/module-loader/index.js';
|
|
4
4
|
import { Pipeline } from '../core/pipeline.js';
|
|
5
|
-
import type { Environment } from '../core/render';
|
|
5
|
+
import type { Environment } from '../core/render/index.js';
|
|
6
6
|
export default class DevPipeline extends Pipeline {
|
|
7
7
|
#private;
|
|
8
8
|
constructor({ manifest, logger, settings, loader, }: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { SSRResult } from '../@types/astro';
|
|
2
|
-
import type { ModuleLoader } from '../core/module-loader';
|
|
1
|
+
import type { SSRResult } from '../@types/astro.js';
|
|
2
|
+
import type { ModuleLoader } from '../core/module-loader/index.js';
|
|
3
3
|
export declare function getComponentMetadata(filePath: URL, loader: ModuleLoader): Promise<SSRResult['componentMetadata']>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import type fs from 'node:fs';
|
|
3
3
|
import type * as vite from 'vite';
|
|
4
|
-
import type { AstroSettings, SSRManifest } from '../@types/astro';
|
|
4
|
+
import type { AstroSettings, SSRManifest } from '../@types/astro.js';
|
|
5
5
|
import type { Logger } from '../core/logger/core.js';
|
|
6
6
|
export interface AstroPluginOptions {
|
|
7
7
|
settings: AstroSettings;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import type http from 'node:http';
|
|
3
|
-
import type { ManifestData, SSRManifest } from '../@types/astro';
|
|
4
|
-
import type { DevServerController } from './controller';
|
|
5
|
-
import type DevPipeline from './devPipeline';
|
|
3
|
+
import type { ManifestData, SSRManifest } from '../@types/astro.js';
|
|
4
|
+
import type { DevServerController } from './controller.js';
|
|
5
|
+
import type DevPipeline from './devPipeline.js';
|
|
6
6
|
type HandleRequest = {
|
|
7
7
|
pipeline: DevPipeline;
|
|
8
8
|
manifestData: ManifestData;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ModuleLoader } from '../core/module-loader';
|
|
1
|
+
import type { ModuleLoader } from '../core/module-loader/index.js';
|
|
2
2
|
export declare function createResolve(loader: ModuleLoader, root: URL): (s: string) => Promise<string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
2
|
import type http from 'node:http';
|
|
3
3
|
import type { ErrorWithMetadata } from '../core/errors/index.js';
|
|
4
|
-
import type { ModuleLoader } from '../core/module-loader/index';
|
|
4
|
+
import type { ModuleLoader } from '../core/module-loader/index.js';
|
|
5
5
|
export declare function handle404Response(origin: string, req: http.IncomingMessage, res: http.ServerResponse): Promise<void>;
|
|
6
6
|
export declare function handle500Response(loader: ModuleLoader, res: http.ServerResponse, err: ErrorWithMetadata): Promise<void>;
|
|
7
7
|
export declare function writeHtmlResponse(res: http.ServerResponse, statusCode: number, html: string): void;
|