astro 1.4.2 → 1.4.3
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/@types/astro.d.ts +2 -3
- package/dist/core/build/types.d.ts +2 -2
- package/dist/core/config/schema.d.ts +12 -12
- package/dist/core/create-vite.d.ts +1 -4
- package/dist/core/dev/index.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/core/util.js +1 -1
- package/dist/integrations/index.d.ts +2 -3
- package/dist/runtime/server/astro-global.js +1 -1
- package/dist/runtime/server/render/common.d.ts +1 -2
- package/dist/runtime/server/render/common.js +5 -30
- package/package.json +1 -1
package/dist/@types/astro.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ import type { SerializedSSRManifest } from '../core/app/types';
|
|
|
10
10
|
import type { PageBuildData } from '../core/build/types';
|
|
11
11
|
import type { AstroConfigSchema } from '../core/config';
|
|
12
12
|
import type { AstroCookies } from '../core/cookies';
|
|
13
|
-
import type { ViteConfigWithSSR } from '../core/create-vite';
|
|
14
13
|
import type { AstroComponentFactory, Metadata } from '../runtime/server';
|
|
15
14
|
export type { MarkdownHeading, MarkdownMetadata, MarkdownRenderingResult, RehypePlugins, RemarkPlugins, ShikiConfig, } from '@astrojs/markdown-remark';
|
|
16
15
|
export type { SSRManifest } from '../core/app/types';
|
|
@@ -1044,10 +1043,10 @@ export interface AstroIntegration {
|
|
|
1044
1043
|
buildConfig: BuildConfig;
|
|
1045
1044
|
}) => void | Promise<void>;
|
|
1046
1045
|
'astro:build:setup'?: (options: {
|
|
1047
|
-
vite:
|
|
1046
|
+
vite: vite.InlineConfig;
|
|
1048
1047
|
pages: Map<string, PageBuildData>;
|
|
1049
1048
|
target: 'client' | 'server';
|
|
1050
|
-
updateConfig: (newConfig:
|
|
1049
|
+
updateConfig: (newConfig: vite.InlineConfig) => void;
|
|
1051
1050
|
}) => void | Promise<void>;
|
|
1052
1051
|
'astro:build:generated'?: (options: {
|
|
1053
1052
|
dir: URL;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { InlineConfig } from 'vite';
|
|
1
2
|
import type { AstroSettings, BuildConfig, ComponentInstance, ManifestData, RouteData, RuntimeMode, SSRLoadedRenderer } from '../../@types/astro';
|
|
2
|
-
import type { ViteConfigWithSSR } from '../create-vite';
|
|
3
3
|
import type { LogOptions } from '../logger/core';
|
|
4
4
|
import type { RouteCache } from '../render/route-cache';
|
|
5
5
|
export declare type ComponentPath = string;
|
|
@@ -29,7 +29,7 @@ export interface StaticBuildOptions {
|
|
|
29
29
|
origin: string;
|
|
30
30
|
pageNames: string[];
|
|
31
31
|
routeCache: RouteCache;
|
|
32
|
-
viteConfig:
|
|
32
|
+
viteConfig: InlineConfig;
|
|
33
33
|
}
|
|
34
34
|
export interface SingleFileBuiltModule {
|
|
35
35
|
pageMap: Map<ComponentPath, ComponentInstance>;
|
|
@@ -149,9 +149,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
149
149
|
remarkRehype: RemarkRehype;
|
|
150
150
|
extendDefaultPlugins: boolean;
|
|
151
151
|
};
|
|
152
|
-
build: {
|
|
153
|
-
format: "file" | "directory";
|
|
154
|
-
};
|
|
155
152
|
root: URL;
|
|
156
153
|
srcDir: URL;
|
|
157
154
|
publicDir: URL;
|
|
@@ -166,6 +163,9 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
166
163
|
name: string;
|
|
167
164
|
hooks: {};
|
|
168
165
|
}[];
|
|
166
|
+
build: {
|
|
167
|
+
format: "file" | "directory";
|
|
168
|
+
};
|
|
169
169
|
style: {
|
|
170
170
|
postcss: {
|
|
171
171
|
options?: any;
|
|
@@ -192,9 +192,6 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
192
192
|
remarkRehype?: RemarkRehype | undefined;
|
|
193
193
|
extendDefaultPlugins?: boolean | undefined;
|
|
194
194
|
} | undefined;
|
|
195
|
-
build?: {
|
|
196
|
-
format?: "file" | "directory" | undefined;
|
|
197
|
-
} | undefined;
|
|
198
195
|
root?: string | undefined;
|
|
199
196
|
srcDir?: string | undefined;
|
|
200
197
|
publicDir?: string | undefined;
|
|
@@ -207,6 +204,9 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
207
204
|
name: string;
|
|
208
205
|
} | undefined;
|
|
209
206
|
integrations?: unknown;
|
|
207
|
+
build?: {
|
|
208
|
+
format?: "file" | "directory" | undefined;
|
|
209
|
+
} | undefined;
|
|
210
210
|
style?: {
|
|
211
211
|
postcss?: {
|
|
212
212
|
options?: any;
|
|
@@ -409,9 +409,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
409
409
|
remarkRehype: RemarkRehype;
|
|
410
410
|
extendDefaultPlugins: boolean;
|
|
411
411
|
};
|
|
412
|
-
build: {
|
|
413
|
-
format: "file" | "directory";
|
|
414
|
-
};
|
|
415
412
|
root: URL;
|
|
416
413
|
srcDir: URL;
|
|
417
414
|
publicDir: URL;
|
|
@@ -427,6 +424,9 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
427
424
|
name: string;
|
|
428
425
|
hooks: {};
|
|
429
426
|
}[];
|
|
427
|
+
build: {
|
|
428
|
+
format: "file" | "directory";
|
|
429
|
+
};
|
|
430
430
|
style: {
|
|
431
431
|
postcss: {
|
|
432
432
|
options?: any;
|
|
@@ -453,9 +453,6 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
453
453
|
remarkRehype?: RemarkRehype | undefined;
|
|
454
454
|
extendDefaultPlugins?: boolean | undefined;
|
|
455
455
|
} | undefined;
|
|
456
|
-
build?: {
|
|
457
|
-
format?: "file" | "directory" | undefined;
|
|
458
|
-
} | undefined;
|
|
459
456
|
root?: string | undefined;
|
|
460
457
|
srcDir?: string | undefined;
|
|
461
458
|
publicDir?: string | undefined;
|
|
@@ -468,6 +465,9 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: URL)
|
|
|
468
465
|
name: string;
|
|
469
466
|
} | undefined;
|
|
470
467
|
integrations?: unknown;
|
|
468
|
+
build?: {
|
|
469
|
+
format?: "file" | "directory" | undefined;
|
|
470
|
+
} | undefined;
|
|
471
471
|
style?: {
|
|
472
472
|
postcss?: unknown;
|
|
473
473
|
} | undefined;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import type { AstroSettings } from '../@types/astro';
|
|
2
2
|
import type { LogOptions } from './logger/core';
|
|
3
3
|
import * as vite from 'vite';
|
|
4
|
-
export declare type ViteConfigWithSSR = vite.InlineConfig & {
|
|
5
|
-
ssr?: vite.SSROptions;
|
|
6
|
-
};
|
|
7
4
|
interface CreateViteOptions {
|
|
8
5
|
settings: AstroSettings;
|
|
9
6
|
logging: LogOptions;
|
|
10
7
|
mode: 'dev' | 'build' | string;
|
|
11
8
|
}
|
|
12
9
|
/** Return a common starting point for all Vite actions */
|
|
13
|
-
export declare function createVite(commandConfig:
|
|
10
|
+
export declare function createVite(commandConfig: vite.InlineConfig, { settings, logging, mode }: CreateViteOptions): Promise<vite.InlineConfig>;
|
|
14
11
|
export {};
|
package/dist/core/dev/index.js
CHANGED
package/dist/core/messages.js
CHANGED
|
@@ -47,7 +47,7 @@ function serverStart({
|
|
|
47
47
|
site,
|
|
48
48
|
isRestart = false
|
|
49
49
|
}) {
|
|
50
|
-
const version = "1.4.
|
|
50
|
+
const version = "1.4.3";
|
|
51
51
|
const rootPath = site ? site.pathname : "/";
|
|
52
52
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
53
53
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
@@ -250,7 +250,7 @@ function printHelp({
|
|
|
250
250
|
message.push(
|
|
251
251
|
linebreak(),
|
|
252
252
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
253
|
-
`v${"1.4.
|
|
253
|
+
`v${"1.4.3"}`
|
|
254
254
|
)} ${headline}`
|
|
255
255
|
);
|
|
256
256
|
}
|
package/dist/core/util.js
CHANGED
|
@@ -5,7 +5,7 @@ import resolve from "resolve";
|
|
|
5
5
|
import slash from "slash";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "url";
|
|
7
7
|
import { prependForwardSlash, removeTrailingForwardSlash } from "./path.js";
|
|
8
|
-
const ASTRO_VERSION = "1.4.
|
|
8
|
+
const ASTRO_VERSION = "1.4.3";
|
|
9
9
|
function isObject(value) {
|
|
10
10
|
return typeof value === "object" && value != null;
|
|
11
11
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import type { AddressInfo } from 'net';
|
|
3
|
-
import type { ViteDevServer } from 'vite';
|
|
3
|
+
import type { InlineConfig, ViteDevServer } from 'vite';
|
|
4
4
|
import { AstroConfig, AstroSettings, BuildConfig, RouteData } from '../@types/astro.js';
|
|
5
5
|
import type { SerializedSSRManifest } from '../core/app/types';
|
|
6
6
|
import type { PageBuildData } from '../core/build/types';
|
|
7
|
-
import type { ViteConfigWithSSR } from '../core/create-vite.js';
|
|
8
7
|
import { LogOptions } from '../core/logger/core.js';
|
|
9
8
|
export declare function runHookConfigSetup({ settings, command, logging, }: {
|
|
10
9
|
settings: AstroSettings;
|
|
@@ -36,7 +35,7 @@ export declare function runHookBuildStart({ config, buildConfig, logging, }: {
|
|
|
36
35
|
}): Promise<void>;
|
|
37
36
|
export declare function runHookBuildSetup({ config, vite, pages, target, logging, }: {
|
|
38
37
|
config: AstroConfig;
|
|
39
|
-
vite:
|
|
38
|
+
vite: InlineConfig;
|
|
40
39
|
pages: Map<string, PageBuildData>;
|
|
41
40
|
target: 'server' | 'client';
|
|
42
41
|
logging: LogOptions;
|
|
@@ -7,11 +7,10 @@ export declare const encoder: TextEncoder;
|
|
|
7
7
|
export declare const decoder: TextDecoder;
|
|
8
8
|
export declare function stringifyChunk(result: SSRResult, chunk: string | RenderInstruction): any;
|
|
9
9
|
export declare class HTMLParts {
|
|
10
|
-
parts:
|
|
10
|
+
parts: string;
|
|
11
11
|
constructor();
|
|
12
12
|
append(part: string | HTMLBytes | RenderInstruction, result: SSRResult): void;
|
|
13
13
|
toString(): string;
|
|
14
14
|
toArrayBuffer(): Uint8Array;
|
|
15
15
|
}
|
|
16
16
|
export declare function chunkToByteArray(result: SSRResult, chunk: string | HTMLBytes | RenderInstruction): Uint8Array;
|
|
17
|
-
export declare function concatUint8Arrays(arrays: Array<Uint8Array>): Uint8Array;
|
|
@@ -29,33 +29,20 @@ function stringifyChunk(result, chunk) {
|
|
|
29
29
|
}
|
|
30
30
|
class HTMLParts {
|
|
31
31
|
constructor() {
|
|
32
|
-
this.parts =
|
|
32
|
+
this.parts = "";
|
|
33
33
|
}
|
|
34
34
|
append(part, result) {
|
|
35
35
|
if (ArrayBuffer.isView(part)) {
|
|
36
|
-
this.parts.
|
|
36
|
+
this.parts += decoder.decode(part);
|
|
37
37
|
} else {
|
|
38
|
-
this.parts
|
|
38
|
+
this.parts += stringifyChunk(result, part);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
41
|
toString() {
|
|
42
|
-
|
|
43
|
-
for (const part of this.parts) {
|
|
44
|
-
if (ArrayBuffer.isView(part)) {
|
|
45
|
-
html += decoder.decode(part);
|
|
46
|
-
} else {
|
|
47
|
-
html += part;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
return html;
|
|
42
|
+
return this.parts;
|
|
51
43
|
}
|
|
52
44
|
toArrayBuffer() {
|
|
53
|
-
this.parts
|
|
54
|
-
if (!ArrayBuffer.isView(part)) {
|
|
55
|
-
this.parts[i] = encoder.encode(String(part));
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
return concatUint8Arrays(this.parts);
|
|
45
|
+
return encoder.encode(this.parts);
|
|
59
46
|
}
|
|
60
47
|
}
|
|
61
48
|
function chunkToByteArray(result, chunk) {
|
|
@@ -64,23 +51,11 @@ function chunkToByteArray(result, chunk) {
|
|
|
64
51
|
}
|
|
65
52
|
return encoder.encode(stringifyChunk(result, chunk));
|
|
66
53
|
}
|
|
67
|
-
function concatUint8Arrays(arrays) {
|
|
68
|
-
let len = 0;
|
|
69
|
-
arrays.forEach((arr) => len += arr.length);
|
|
70
|
-
let merged = new Uint8Array(len);
|
|
71
|
-
let offset = 0;
|
|
72
|
-
arrays.forEach((arr) => {
|
|
73
|
-
merged.set(arr, offset);
|
|
74
|
-
offset += arr.length;
|
|
75
|
-
});
|
|
76
|
-
return merged;
|
|
77
|
-
}
|
|
78
54
|
export {
|
|
79
55
|
Fragment,
|
|
80
56
|
HTMLParts,
|
|
81
57
|
Renderer,
|
|
82
58
|
chunkToByteArray,
|
|
83
|
-
concatUint8Arrays,
|
|
84
59
|
decoder,
|
|
85
60
|
encoder,
|
|
86
61
|
stringifyChunk
|