astro 6.1.5 → 6.1.6
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/actions/integration.js +1 -1
- package/dist/assets/build/generate.d.ts +2 -2
- package/dist/assets/fonts/core/compute-font-families-assets.d.ts +2 -2
- package/dist/assets/fonts/core/get-or-create-font-family-assets.d.ts +2 -2
- package/dist/assets/fonts/vite-plugin-fonts.d.ts +2 -2
- package/dist/assets/vite-plugin-assets.d.ts +2 -2
- package/dist/cli/create-key/core/create-key.d.ts +2 -2
- package/dist/cli/docs/core/open-docs.d.ts +2 -2
- package/dist/cli/flags.d.ts +2 -2
- package/dist/cli/flags.js +1 -1
- package/dist/cli/info/core/info.d.ts +2 -2
- package/dist/cli/info/infra/tinyclip-clipboard.d.ts +2 -2
- package/dist/cli/infra/build-time-astro-version-provider.js +1 -1
- package/dist/cli/infra/logger-help-display.d.ts +2 -2
- package/dist/cli/install-package.d.ts +2 -2
- package/dist/container/index.js +3 -3
- package/dist/content/content-layer.d.ts +2 -2
- package/dist/content/content-layer.js +3 -3
- package/dist/content/instance.d.ts +2 -2
- package/dist/content/server-listeners.d.ts +2 -2
- package/dist/content/types-generator.d.ts +2 -2
- package/dist/content/utils.d.ts +2 -2
- package/dist/content/vite-plugin-content-imports.d.ts +2 -2
- package/dist/core/app/base.d.ts +2 -2
- package/dist/core/app/base.js +3 -3
- package/dist/core/app/dev/app.d.ts +4 -4
- package/dist/core/app/logging.d.ts +2 -2
- package/dist/core/app/logging.js +3 -3
- package/dist/core/app/types.d.ts +2 -2
- package/dist/core/base-pipeline.d.ts +3 -3
- package/dist/core/build/generate.d.ts +2 -2
- package/dist/core/build/index.d.ts +2 -2
- package/dist/core/build/page-data.d.ts +2 -2
- package/dist/core/build/types.d.ts +2 -2
- package/dist/core/cache/runtime/noop.d.ts +2 -2
- package/dist/core/constants.js +1 -1
- package/dist/core/create-vite.d.ts +2 -2
- package/dist/core/dev/adapter-validation.d.ts +3 -3
- package/dist/core/dev/container.d.ts +3 -3
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/logger/console.d.ts +2 -2
- package/dist/core/logger/console.js +4 -1
- package/dist/core/logger/core.d.ts +48 -21
- package/dist/core/logger/core.js +8 -4
- package/dist/core/logger/node.d.ts +4 -4
- package/dist/core/logger/node.js +21 -9
- package/dist/core/logger/vite.d.ts +1 -1
- package/dist/core/messages/runtime.d.ts +2 -2
- package/dist/core/messages/runtime.js +1 -1
- package/dist/core/preview/static-preview-server.d.ts +2 -2
- package/dist/core/render/params-and-props.d.ts +2 -2
- package/dist/core/render/route-cache.d.ts +3 -3
- package/dist/core/render/slots.d.ts +2 -2
- package/dist/core/request.d.ts +2 -2
- package/dist/core/routing/create-manifest.d.ts +3 -3
- package/dist/core/routing/prerender.d.ts +2 -2
- package/dist/core/routing/rewrite.d.ts +2 -2
- package/dist/core/sync/index.d.ts +3 -3
- package/dist/integrations/features-validation.d.ts +2 -2
- package/dist/integrations/hooks.d.ts +13 -13
- package/dist/runtime/server/endpoint.d.ts +2 -2
- package/dist/runtime/server/escape.d.ts +8 -0
- package/dist/runtime/server/escape.js +4 -0
- package/dist/runtime/server/render/server-islands.js +5 -12
- package/dist/runtime/server/render/util.js +2 -5
- package/dist/types/astro.d.ts +3 -3
- package/dist/types/public/config.d.ts +2 -2
- package/dist/vite-plugin-app/app.d.ts +5 -5
- package/dist/vite-plugin-app/createAstroServerApp.d.ts +2 -2
- package/dist/vite-plugin-app/createAstroServerApp.js +3 -3
- package/dist/vite-plugin-astro/compile.d.ts +2 -2
- package/dist/vite-plugin-astro/hmr.d.ts +2 -2
- package/dist/vite-plugin-astro/index.d.ts +2 -2
- package/dist/vite-plugin-astro-server/base.d.ts +2 -2
- package/dist/vite-plugin-astro-server/error.d.ts +2 -2
- package/dist/vite-plugin-astro-server/plugin.d.ts +2 -2
- package/dist/vite-plugin-astro-server/sec-fetch.d.ts +2 -2
- package/dist/vite-plugin-hmr-reload/index.js +17 -0
- package/dist/vite-plugin-integrations-container/index.d.ts +2 -2
- package/dist/vite-plugin-markdown/index.d.ts +2 -2
- package/dist/vite-plugin-routes/index.d.ts +2 -2
- package/package.json +3 -3
|
@@ -10,7 +10,7 @@ import type { CacheProviderConfig, RouteRules } from '../../core/cache/types.js'
|
|
|
10
10
|
import type { AstroConfigType } from '../../core/config/schemas/index.js';
|
|
11
11
|
import type { REDIRECT_STATUS_CODES } from '../../core/constants.js';
|
|
12
12
|
import type { CspAlgorithm, CspDirective, CspHash } from '../../core/csp/config.js';
|
|
13
|
-
import type {
|
|
13
|
+
import type { AstroLoggerLevel } from '../../core/logger/core.js';
|
|
14
14
|
import type { SessionConfig, SessionDriverConfig, SessionDriverName } from '../../core/session/types.js';
|
|
15
15
|
import type { EnvSchema } from '../../env/schema.js';
|
|
16
16
|
import type { AstroIntegration } from './integrations.js';
|
|
@@ -2934,7 +2934,7 @@ export interface AstroInlineOnlyConfig {
|
|
|
2934
2934
|
*
|
|
2935
2935
|
* @default "info"
|
|
2936
2936
|
*/
|
|
2937
|
-
logLevel?:
|
|
2937
|
+
logLevel?: AstroLoggerLevel;
|
|
2938
2938
|
/**
|
|
2939
2939
|
* Clear the content layer cache, forcing a rebuild of all content entries.
|
|
2940
2940
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type http from 'node:http';
|
|
2
2
|
import { BaseApp, type RenderErrorOptions } from '../core/app/entrypoints/index.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
4
4
|
import type { ModuleLoader } from '../core/module-loader/index.js';
|
|
5
5
|
import type { CreateRenderContext, RenderContext } from '../core/render-context.js';
|
|
6
6
|
import type { AstroSettings, RoutesList } from '../types/astro.js';
|
|
@@ -10,11 +10,11 @@ import { RunnablePipeline } from './pipeline.js';
|
|
|
10
10
|
import type { DevMatch, LogRequestPayload } from '../core/app/base.js';
|
|
11
11
|
export declare class AstroServerApp extends BaseApp<RunnablePipeline> {
|
|
12
12
|
settings: AstroSettings;
|
|
13
|
-
logger:
|
|
13
|
+
logger: AstroLogger;
|
|
14
14
|
loader: ModuleLoader;
|
|
15
15
|
manifestData: RoutesList;
|
|
16
16
|
currentRenderContext: RenderContext | undefined;
|
|
17
|
-
constructor(manifest: SSRManifest, streaming: boolean | undefined, logger:
|
|
17
|
+
constructor(manifest: SSRManifest, streaming: boolean | undefined, logger: AstroLogger, manifestData: RoutesList, loader: ModuleLoader, settings: AstroSettings, getDebugInfo: () => Promise<string>);
|
|
18
18
|
isDev(): boolean;
|
|
19
19
|
/**
|
|
20
20
|
* Updates the routes list when files change during development.
|
|
@@ -32,8 +32,8 @@ export declare class AstroServerApp extends BaseApp<RunnablePipeline> {
|
|
|
32
32
|
*/
|
|
33
33
|
clearMiddleware(): void;
|
|
34
34
|
devMatch(pathname: string): Promise<DevMatch | undefined>;
|
|
35
|
-
static create(manifest: SSRManifest, routesList: RoutesList, logger:
|
|
36
|
-
createPipeline(_streaming: boolean, manifest: SSRManifest, settings: AstroSettings, logger:
|
|
35
|
+
static create(manifest: SSRManifest, routesList: RoutesList, logger: AstroLogger, loader: ModuleLoader, settings: AstroSettings, getDebugInfo: () => Promise<string>): Promise<AstroServerApp>;
|
|
36
|
+
createPipeline(_streaming: boolean, manifest: SSRManifest, settings: AstroSettings, logger: AstroLogger, loader: ModuleLoader, manifestData: RoutesList, getDebugInfo: () => Promise<string>): RunnablePipeline;
|
|
37
37
|
createRenderContext(payload: CreateRenderContext): Promise<RenderContext>;
|
|
38
38
|
handleRequest({ controller, incomingRequest, incomingResponse, isHttps, }: HandleRequest): Promise<void>;
|
|
39
39
|
match(request: Request, _allowPrerenderedRoutes: boolean): RouteData | undefined;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type http from 'node:http';
|
|
2
|
-
import {
|
|
2
|
+
import { AstroLogger } from '../core/logger/core.js';
|
|
3
3
|
import type { ModuleLoader } from '../core/module-loader/index.js';
|
|
4
4
|
import type { AstroSettings } from '../types/astro.js';
|
|
5
5
|
import type { DevServerController } from '../vite-plugin-astro-server/controller.js';
|
|
6
|
-
export default function createAstroServerApp(controller: DevServerController, settings: AstroSettings, loader: ModuleLoader, logger?:
|
|
6
|
+
export default function createAstroServerApp(controller: DevServerController, settings: AstroSettings, loader: ModuleLoader, logger?: AstroLogger): Promise<{
|
|
7
7
|
handler(incomingRequest: http.IncomingMessage, incomingResponse: http.ServerResponse): void;
|
|
8
8
|
}>;
|
|
@@ -9,12 +9,12 @@ import { BuildTimeAstroVersionProvider } from "../cli/infra/build-time-astro-ver
|
|
|
9
9
|
import { PassthroughTextStyler } from "../cli/infra/passthrough-text-styler.js";
|
|
10
10
|
import { ProcessOperatingSystemProvider } from "../cli/infra/process-operating-system-provider.js";
|
|
11
11
|
import { TinyexecCommandExecutor } from "../cli/infra/tinyexec-command-executor.js";
|
|
12
|
-
import {
|
|
12
|
+
import { AstroLogger } from "../core/logger/core.js";
|
|
13
13
|
import { nodeLogDestination } from "../core/logger/node.js";
|
|
14
14
|
import { AstroServerApp } from "./app.js";
|
|
15
15
|
async function createAstroServerApp(controller, settings, loader, logger) {
|
|
16
|
-
const actualLogger = logger ?? new
|
|
17
|
-
|
|
16
|
+
const actualLogger = logger ?? new AstroLogger({
|
|
17
|
+
destination: nodeLogDestination,
|
|
18
18
|
level: settings.logLevel
|
|
19
19
|
});
|
|
20
20
|
const routesList = { routes: routes.map((r) => r.routeData) };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type CompileProps, type CompileResult } from '../core/compile/index.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
3
3
|
import type { CompileMetadata } from './types.js';
|
|
4
4
|
import type { SourceMapInput } from 'rollup';
|
|
5
5
|
interface CompileAstroOption {
|
|
6
6
|
compileProps: CompileProps;
|
|
7
7
|
astroFileToCompileMetadata: Map<string, CompileMetadata>;
|
|
8
|
-
logger:
|
|
8
|
+
logger: AstroLogger;
|
|
9
9
|
}
|
|
10
10
|
export interface CompileAstroResult extends Omit<CompileResult, 'map'> {
|
|
11
11
|
map: SourceMapInput;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { HmrContext } from 'vite';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
3
3
|
import type { CompileAstroResult } from './compile.js';
|
|
4
4
|
import type { CompileMetadata } from './types.js';
|
|
5
5
|
interface HandleHotUpdateOptions {
|
|
6
|
-
logger:
|
|
6
|
+
logger: AstroLogger;
|
|
7
7
|
compile: (code: string, filename: string) => Promise<CompileAstroResult>;
|
|
8
8
|
astroFileToCompileMetadata: Map<string, CompileMetadata>;
|
|
9
9
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type * as vite from 'vite';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
3
3
|
import type { AstroSettings } from '../types/astro.js';
|
|
4
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 {
|
|
8
8
|
settings: AstroSettings;
|
|
9
|
-
logger:
|
|
9
|
+
logger: AstroLogger;
|
|
10
10
|
}
|
|
11
11
|
/** Transform .astro files for Vite */
|
|
12
12
|
export default function astro({ settings, logger }: AstroPluginOptions): vite.Plugin[];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as vite from 'vite';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
3
3
|
import type { AstroSettings } from '../types/astro.js';
|
|
4
4
|
/**
|
|
5
5
|
* Outcome of the base-URL evaluation for a dev-server request.
|
|
@@ -53,4 +53,4 @@ export declare function resolveDevRoot(base: string, site?: string): {
|
|
|
53
53
|
* by the caller.
|
|
54
54
|
*/
|
|
55
55
|
export declare function evaluateBaseRewrite(url: string, pathname: string, acceptHeader: string | undefined, devRoot: string, devRootReplacement: string): BaseRewriteDecision;
|
|
56
|
-
export declare function baseMiddleware(settings: AstroSettings, logger:
|
|
56
|
+
export declare function baseMiddleware(settings: AstroSettings, logger: AstroLogger): vite.Connect.NextHandleFunction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SSRManifest } from '../core/app/types.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
3
3
|
import type { ModuleLoader } from '../core/module-loader/index.js';
|
|
4
|
-
export declare function recordServerError(loader: ModuleLoader, manifest: SSRManifest, logger:
|
|
4
|
+
export declare function recordServerError(loader: ModuleLoader, manifest: SSRManifest, logger: AstroLogger, err: Error): {
|
|
5
5
|
errorWithMetadata: import("../core/errors/errors.js").ErrorWithMetadata;
|
|
6
6
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type * as vite from 'vite';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
3
3
|
import type { AstroSettings } from '../types/astro.js';
|
|
4
4
|
interface AstroPluginOptions {
|
|
5
5
|
settings: AstroSettings;
|
|
6
|
-
logger:
|
|
6
|
+
logger: AstroLogger;
|
|
7
7
|
}
|
|
8
8
|
export default function createVitePluginAstroServer({ settings, logger, }: AstroPluginOptions): vite.Plugin;
|
|
9
9
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RemotePattern } from '@astrojs/internal-helpers/remote';
|
|
2
2
|
import type * as vite from 'vite';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
4
4
|
/**
|
|
5
5
|
* Middleware that validates Sec-Fetch metadata headers on incoming requests
|
|
6
6
|
* to block cross-origin subresource requests (e.g. `<script>` tags from
|
|
@@ -18,4 +18,4 @@ import type { Logger } from '../core/logger/core.js';
|
|
|
18
18
|
* dev server setups (e.g. ngrok, Cloudflare Tunnel) where the browser sees a
|
|
19
19
|
* different origin than the dev server itself.
|
|
20
20
|
*/
|
|
21
|
-
export declare function secFetchMiddleware(logger:
|
|
21
|
+
export declare function secFetchMiddleware(logger: AstroLogger, allowedDomains?: Partial<RemotePattern>[]): vite.Connect.NextHandleFunction;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { VIRTUAL_PAGE_RESOLVED_MODULE_ID } from "../vite-plugin-pages/const.js";
|
|
2
2
|
import { getDevCssModuleNameFromPageVirtualModuleName } from "../vite-plugin-css/util.js";
|
|
3
3
|
import { isAstroServerEnvironment } from "../environments.js";
|
|
4
|
+
const STYLE_EXT_REGEX = /\.(?:css|scss|sass|less|styl|pcss)$/i;
|
|
5
|
+
function isStyleModule(mod) {
|
|
6
|
+
if (mod.file && STYLE_EXT_REGEX.test(mod.file)) return true;
|
|
7
|
+
if (mod.id) {
|
|
8
|
+
const idPath = mod.id.split("?")[0];
|
|
9
|
+
if (STYLE_EXT_REGEX.test(idPath)) return true;
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
4
13
|
function hmrReload() {
|
|
5
14
|
return {
|
|
6
15
|
name: "astro:hmr-reload",
|
|
@@ -10,9 +19,14 @@ function hmrReload() {
|
|
|
10
19
|
handler({ modules, server, timestamp }) {
|
|
11
20
|
if (!isAstroServerEnvironment(this.environment)) return;
|
|
12
21
|
let hasSsrOnlyModules = false;
|
|
22
|
+
let hasSkippedStyleModules = false;
|
|
13
23
|
const invalidatedModules = /* @__PURE__ */ new Set();
|
|
14
24
|
for (const mod of modules) {
|
|
15
25
|
if (mod.id == null) continue;
|
|
26
|
+
if (isStyleModule(mod)) {
|
|
27
|
+
hasSkippedStyleModules = true;
|
|
28
|
+
continue;
|
|
29
|
+
}
|
|
16
30
|
const clientModule = server.environments.client.moduleGraph.getModuleById(mod.id);
|
|
17
31
|
if (clientModule != null) continue;
|
|
18
32
|
this.environment.moduleGraph.invalidateModule(mod, invalidatedModules, timestamp, true);
|
|
@@ -31,6 +45,9 @@ function hmrReload() {
|
|
|
31
45
|
server.ws.send({ type: "full-reload" });
|
|
32
46
|
return [];
|
|
33
47
|
}
|
|
48
|
+
if (hasSkippedStyleModules) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
34
51
|
}
|
|
35
52
|
}
|
|
36
53
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Plugin as VitePlugin } from 'vite';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
3
3
|
import type { AstroSettings } from '../types/astro.js';
|
|
4
4
|
/** Connect Astro integrations into Vite, as needed. */
|
|
5
5
|
export default function astroIntegrationsContainerPlugin({ settings, logger, }: {
|
|
6
6
|
settings: AstroSettings;
|
|
7
|
-
logger:
|
|
7
|
+
logger: AstroLogger;
|
|
8
8
|
}): VitePlugin;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
3
3
|
import type { AstroSettings } from '../types/astro.js';
|
|
4
4
|
interface AstroPluginOptions {
|
|
5
5
|
settings: AstroSettings;
|
|
6
|
-
logger:
|
|
6
|
+
logger: AstroLogger;
|
|
7
7
|
}
|
|
8
8
|
export default function markdown({ settings, logger }: AstroPluginOptions): Plugin;
|
|
9
9
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type fsMod from 'node:fs';
|
|
2
2
|
import { type Plugin } from 'vite';
|
|
3
3
|
import type { SerializedRouteInfo } from '../core/app/types.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { AstroLogger } from '../core/logger/core.js';
|
|
5
5
|
import type { AstroSettings, RoutesList } from '../types/astro.js';
|
|
6
6
|
type Payload = {
|
|
7
7
|
settings: AstroSettings;
|
|
8
|
-
logger:
|
|
8
|
+
logger: AstroLogger;
|
|
9
9
|
fsMod?: typeof fsMod;
|
|
10
10
|
routesList: RoutesList;
|
|
11
11
|
command: 'dev' | 'build';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "astro",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.6",
|
|
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",
|
|
@@ -152,9 +152,9 @@
|
|
|
152
152
|
"xxhash-wasm": "^1.1.0",
|
|
153
153
|
"yargs-parser": "^22.0.0",
|
|
154
154
|
"zod": "^4.3.6",
|
|
155
|
-
"@astrojs/
|
|
155
|
+
"@astrojs/internal-helpers": "0.8.0",
|
|
156
156
|
"@astrojs/telemetry": "3.3.0",
|
|
157
|
-
"@astrojs/
|
|
157
|
+
"@astrojs/markdown-remark": "7.1.0"
|
|
158
158
|
},
|
|
159
159
|
"optionalDependencies": {
|
|
160
160
|
"sharp": "^0.34.0"
|