astro 5.16.5 → 5.16.7
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/components/Code.astro +2 -2
- package/components/Image.astro +2 -2
- package/components/Picture.astro +1 -1
- package/dist/assets/build/remote.js +1 -1
- package/dist/assets/endpoint/dev.js +40 -11
- package/dist/assets/fonts/config.d.ts +3 -0
- package/dist/assets/fonts/config.js +3 -2
- package/dist/assets/fonts/constants.js +2 -1
- package/dist/assets/fonts/core/resolve-families.js +1 -0
- package/dist/assets/fonts/definitions.d.ts +10 -2
- package/dist/assets/fonts/infra/remote-font-provider-resolver.d.ts +2 -2
- package/dist/assets/fonts/infra/unifont-font-resolver.d.ts +24 -0
- package/dist/assets/fonts/infra/unifont-font-resolver.js +59 -0
- package/dist/assets/fonts/orchestrate.d.ts +6 -4
- package/dist/assets/fonts/orchestrate.js +16 -32
- package/dist/assets/fonts/providers/entrypoints/bunny.d.ts +1 -1
- package/dist/assets/fonts/providers/entrypoints/fontshare.d.ts +1 -1
- package/dist/assets/fonts/providers/entrypoints/fontsource.d.ts +1 -1
- package/dist/assets/fonts/providers/index.d.ts +6 -8
- package/dist/assets/fonts/providers/index.js +10 -14
- package/dist/assets/fonts/types.d.ts +17 -4
- package/dist/assets/fonts/vite-plugin-fonts.js +6 -1
- package/dist/assets/services/noop.js +10 -5
- package/dist/assets/services/service.d.ts +1 -1
- package/dist/assets/services/service.js +55 -51
- package/dist/assets/types.d.ts +2 -2
- package/dist/assets/utils/index.d.ts +1 -1
- package/dist/assets/utils/index.js +8 -8
- package/dist/assets/utils/vendor/image-size/detector.d.ts +1 -1
- package/dist/assets/utils/vendor/image-size/detector.js +2 -1
- package/dist/assets/utils/vendor/image-size/types/bmp.js +1 -1
- package/dist/assets/utils/vendor/image-size/types/gif.js +1 -1
- package/dist/assets/utils/vendor/image-size/types/heif.js +51 -29
- package/dist/assets/utils/vendor/image-size/types/icns.js +13 -14
- package/dist/assets/utils/vendor/image-size/types/ico.js +5 -5
- package/dist/assets/utils/vendor/image-size/types/index.d.ts +3 -3
- package/dist/assets/utils/vendor/image-size/types/index.js +4 -0
- package/dist/assets/utils/vendor/image-size/types/interface.d.ts +6 -6
- package/dist/assets/utils/vendor/image-size/types/j2c.js +2 -2
- package/dist/assets/utils/vendor/image-size/types/jp2.js +5 -3
- package/dist/assets/utils/vendor/image-size/types/jpg.js +4 -4
- package/dist/assets/utils/vendor/image-size/types/jxl-stream.d.ts +2 -0
- package/dist/assets/utils/vendor/image-size/types/jxl-stream.js +36 -0
- package/dist/assets/utils/vendor/image-size/types/jxl.d.ts +2 -0
- package/dist/assets/utils/vendor/image-size/types/jxl.js +57 -0
- package/dist/assets/utils/vendor/image-size/types/ktx.js +1 -1
- package/dist/assets/utils/vendor/image-size/types/png.js +1 -1
- package/dist/assets/utils/vendor/image-size/types/pnm.js +5 -7
- package/dist/assets/utils/vendor/image-size/types/psd.js +1 -1
- package/dist/assets/utils/vendor/image-size/types/tiff.js +93 -40
- package/dist/assets/utils/vendor/image-size/types/utils.d.ts +3 -2
- package/dist/assets/utils/vendor/image-size/types/utils.js +24 -22
- package/dist/assets/utils/vendor/image-size/types/webp.js +5 -6
- package/dist/assets/utils/vendor/image-size/utils/bit-reader.d.ts +10 -0
- package/dist/assets/utils/vendor/image-size/utils/bit-reader.js +41 -0
- package/dist/assets/vite-plugin-assets.js +7 -0
- package/dist/cli/infra/build-time-astro-version-provider.js +1 -1
- package/dist/config/entrypoint.d.ts +1 -2
- package/dist/config/entrypoint.js +1 -2
- package/dist/content/content-layer.js +3 -3
- package/dist/content/utils.js +9 -2
- package/dist/core/app/index.d.ts +1 -1
- package/dist/core/app/index.js +1 -1
- package/dist/core/config/schemas/base.d.ts +7 -0
- package/dist/core/config/schemas/relative.d.ts +9 -0
- package/dist/core/constants.js +1 -1
- package/dist/core/dev/dev.js +1 -1
- package/dist/core/messages.js +2 -2
- package/dist/runtime/server/render/astro/render.js +26 -3
- package/dist/runtime/server/render/common.d.ts +1 -0
- package/dist/runtime/server/render/common.js +8 -0
- package/dist/transitions/router.js +2 -0
- package/dist/types/public/config.d.ts +2 -2
- package/dist/types/public/context.d.ts +303 -284
- package/dist/types/public/extendables.d.ts +2 -0
- package/package.json +18 -18
- package/dist/assets/fonts/core/dedupe-font-faces.d.ts +0 -2
- package/dist/assets/fonts/core/dedupe-font-faces.js +0 -30
- package/dist/assets/fonts/core/extract-unifont-providers.d.ts +0 -10
- package/dist/assets/fonts/core/extract-unifont-providers.js +0 -28
- package/dist/assets/utils/remotePattern.d.ts +0 -1
- package/dist/assets/utils/remotePattern.js +0 -16
|
@@ -1,64 +1,117 @@
|
|
|
1
|
-
import { readUInt, toHexString, toUTF8String } from "./utils.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { readUInt, readUInt64, toHexString, toUTF8String } from "./utils.js";
|
|
2
|
+
const CONSTANTS = {
|
|
3
|
+
TAG: {
|
|
4
|
+
WIDTH: 256,
|
|
5
|
+
HEIGHT: 257,
|
|
6
|
+
COMPRESSION: 259
|
|
7
|
+
},
|
|
8
|
+
TYPE: {
|
|
9
|
+
SHORT: 3,
|
|
10
|
+
LONG: 4,
|
|
11
|
+
LONG8: 16
|
|
12
|
+
},
|
|
13
|
+
ENTRY_SIZE: {
|
|
14
|
+
STANDARD: 12,
|
|
15
|
+
BIG: 20
|
|
16
|
+
},
|
|
17
|
+
COUNT_SIZE: {
|
|
18
|
+
STANDARD: 2,
|
|
19
|
+
BIG: 8
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
function readIFD(input, { isBigEndian, isBigTiff }) {
|
|
23
|
+
const ifdOffset = isBigTiff ? Number(readUInt64(input, 8, isBigEndian)) : readUInt(input, 32, 4, isBigEndian);
|
|
24
|
+
const entryCountSize = isBigTiff ? CONSTANTS.COUNT_SIZE.BIG : CONSTANTS.COUNT_SIZE.STANDARD;
|
|
25
|
+
return input.slice(ifdOffset + entryCountSize);
|
|
5
26
|
}
|
|
6
|
-
function
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
27
|
+
function readTagValue(input, type, offset, isBigEndian) {
|
|
28
|
+
switch (type) {
|
|
29
|
+
case CONSTANTS.TYPE.SHORT:
|
|
30
|
+
return readUInt(input, 16, offset, isBigEndian);
|
|
31
|
+
case CONSTANTS.TYPE.LONG:
|
|
32
|
+
return readUInt(input, 32, offset, isBigEndian);
|
|
33
|
+
case CONSTANTS.TYPE.LONG8: {
|
|
34
|
+
const value = Number(readUInt64(input, offset, isBigEndian));
|
|
35
|
+
if (value > Number.MAX_SAFE_INTEGER) {
|
|
36
|
+
throw new TypeError("Value too large");
|
|
37
|
+
}
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
default:
|
|
41
|
+
return 0;
|
|
42
|
+
}
|
|
10
43
|
}
|
|
11
|
-
function nextTag(input) {
|
|
12
|
-
|
|
13
|
-
|
|
44
|
+
function nextTag(input, isBigTiff) {
|
|
45
|
+
const entrySize = isBigTiff ? CONSTANTS.ENTRY_SIZE.BIG : CONSTANTS.ENTRY_SIZE.STANDARD;
|
|
46
|
+
if (input.length > entrySize) {
|
|
47
|
+
return input.slice(entrySize);
|
|
14
48
|
}
|
|
15
49
|
}
|
|
16
|
-
function extractTags(input, isBigEndian) {
|
|
50
|
+
function extractTags(input, { isBigEndian, isBigTiff }) {
|
|
17
51
|
const tags = {};
|
|
18
52
|
let temp = input;
|
|
19
|
-
while (temp
|
|
53
|
+
while (temp?.length) {
|
|
20
54
|
const code = readUInt(temp, 16, 0, isBigEndian);
|
|
21
55
|
const type = readUInt(temp, 16, 2, isBigEndian);
|
|
22
|
-
const length = readUInt(temp, 32, 4, isBigEndian);
|
|
23
|
-
if (code === 0)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
tags[code] = readValue(temp, isBigEndian);
|
|
28
|
-
}
|
|
29
|
-
temp = nextTag(temp);
|
|
56
|
+
const length = isBigTiff ? Number(readUInt64(temp, 4, isBigEndian)) : readUInt(temp, 32, 4, isBigEndian);
|
|
57
|
+
if (code === 0) break;
|
|
58
|
+
if (length === 1 && (type === CONSTANTS.TYPE.SHORT || type === CONSTANTS.TYPE.LONG || isBigTiff && type === CONSTANTS.TYPE.LONG8)) {
|
|
59
|
+
const valueOffset = isBigTiff ? 12 : 8;
|
|
60
|
+
tags[code] = readTagValue(temp, type, valueOffset, isBigEndian);
|
|
30
61
|
}
|
|
62
|
+
temp = nextTag(temp, isBigTiff);
|
|
31
63
|
}
|
|
32
64
|
return tags;
|
|
33
65
|
}
|
|
34
|
-
function
|
|
66
|
+
function determineFormat(input) {
|
|
35
67
|
const signature = toUTF8String(input, 0, 2);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
68
|
+
const version = readUInt(input, 16, 2, signature === "MM");
|
|
69
|
+
return {
|
|
70
|
+
isBigEndian: signature === "MM",
|
|
71
|
+
isBigTiff: version === 43
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function validateBigTIFFHeader(input, isBigEndian) {
|
|
75
|
+
const byteSize = readUInt(input, 16, 4, isBigEndian);
|
|
76
|
+
const reserved = readUInt(input, 16, 6, isBigEndian);
|
|
77
|
+
if (byteSize !== 8 || reserved !== 0) {
|
|
78
|
+
throw new TypeError("Invalid BigTIFF header");
|
|
40
79
|
}
|
|
41
80
|
}
|
|
42
|
-
const signatures = [
|
|
43
|
-
// '492049', // currently not supported
|
|
81
|
+
const signatures = /* @__PURE__ */ new Set([
|
|
44
82
|
"49492a00",
|
|
45
|
-
// Little
|
|
46
|
-
"4d4d002a"
|
|
83
|
+
// Little Endian
|
|
84
|
+
"4d4d002a",
|
|
47
85
|
// Big Endian
|
|
48
|
-
|
|
49
|
-
|
|
86
|
+
"49492b00",
|
|
87
|
+
// BigTIFF Little Endian
|
|
88
|
+
"4d4d002b"
|
|
89
|
+
// BigTIFF Big Endian
|
|
90
|
+
]);
|
|
50
91
|
const TIFF = {
|
|
51
|
-
validate: (input) =>
|
|
92
|
+
validate: (input) => {
|
|
93
|
+
const signature = toHexString(input, 0, 4);
|
|
94
|
+
return signatures.has(signature);
|
|
95
|
+
},
|
|
52
96
|
calculate(input) {
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
97
|
+
const format = determineFormat(input);
|
|
98
|
+
if (format.isBigTiff) {
|
|
99
|
+
validateBigTIFFHeader(input, format.isBigEndian);
|
|
100
|
+
}
|
|
101
|
+
const ifdBuffer = readIFD(input, format);
|
|
102
|
+
const tags = extractTags(ifdBuffer, format);
|
|
103
|
+
const info = {
|
|
104
|
+
height: tags[CONSTANTS.TAG.HEIGHT],
|
|
105
|
+
width: tags[CONSTANTS.TAG.WIDTH],
|
|
106
|
+
type: format.isBigTiff ? "bigtiff" : "tiff"
|
|
107
|
+
};
|
|
108
|
+
if (tags[CONSTANTS.TAG.COMPRESSION]) {
|
|
109
|
+
info.compression = tags[CONSTANTS.TAG.COMPRESSION];
|
|
110
|
+
}
|
|
111
|
+
if (!info.width || !info.height) {
|
|
59
112
|
throw new TypeError("Invalid Tiff. Missing tags");
|
|
60
113
|
}
|
|
61
|
-
return
|
|
114
|
+
return info;
|
|
62
115
|
}
|
|
63
116
|
};
|
|
64
117
|
export {
|
|
@@ -7,8 +7,9 @@ export declare const readUInt24LE: (input: Uint8Array, offset?: number) => numbe
|
|
|
7
7
|
export declare const readInt32LE: (input: Uint8Array, offset?: number) => number;
|
|
8
8
|
export declare const readUInt32BE: (input: Uint8Array, offset?: number) => number;
|
|
9
9
|
export declare const readUInt32LE: (input: Uint8Array, offset?: number) => number;
|
|
10
|
-
export declare
|
|
11
|
-
export declare function
|
|
10
|
+
export declare const readUInt64: (input: Uint8Array, offset: number, isBigEndian: boolean) => bigint;
|
|
11
|
+
export declare function readUInt(input: Uint8Array, bits: 16 | 32, offset?: number, isBigEndian?: boolean): number;
|
|
12
|
+
export declare function findBox(input: Uint8Array, boxName: string, currentOffset: number): {
|
|
12
13
|
name: string;
|
|
13
14
|
offset: number;
|
|
14
15
|
size: number;
|
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
const decoder = new TextDecoder();
|
|
2
2
|
const toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
|
|
3
|
-
const toHexString = (input, start = 0, end = input.length) => input.slice(start, end).reduce((memo, i) => memo +
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const toHexString = (input, start = 0, end = input.length) => input.slice(start, end).reduce((memo, i) => memo + `0${i.toString(16)}`.slice(-2), "");
|
|
4
|
+
const getView = (input, offset) => new DataView(input.buffer, input.byteOffset + offset);
|
|
5
|
+
const readInt16LE = (input, offset = 0) => getView(input, offset).getInt16(0, true);
|
|
6
|
+
const readUInt16BE = (input, offset = 0) => getView(input, offset).getUint16(0, false);
|
|
7
|
+
const readUInt16LE = (input, offset = 0) => getView(input, offset).getUint16(0, true);
|
|
8
|
+
const readUInt24LE = (input, offset = 0) => {
|
|
9
|
+
const view = getView(input, offset);
|
|
10
|
+
return view.getUint16(0, true) + (view.getUint8(2) << 16);
|
|
7
11
|
};
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const readUInt32BE = (input, offset = 0) => input[offset] * 2 ** 24 + input[offset + 1] * 2 ** 16 + input[offset + 2] * 2 ** 8 + input[offset + 3];
|
|
13
|
-
const readUInt32LE = (input, offset = 0) => input[offset] + input[offset + 1] * 2 ** 8 + input[offset + 2] * 2 ** 16 + input[offset + 3] * 2 ** 24;
|
|
12
|
+
const readInt32LE = (input, offset = 0) => getView(input, offset).getInt32(0, true);
|
|
13
|
+
const readUInt32BE = (input, offset = 0) => getView(input, offset).getUint32(0, false);
|
|
14
|
+
const readUInt32LE = (input, offset = 0) => getView(input, offset).getUint32(0, true);
|
|
15
|
+
const readUInt64 = (input, offset, isBigEndian) => getView(input, offset).getBigUint64(0, !isBigEndian);
|
|
14
16
|
const methods = {
|
|
15
17
|
readUInt16BE,
|
|
16
18
|
readUInt16LE,
|
|
17
19
|
readUInt32BE,
|
|
18
20
|
readUInt32LE
|
|
19
21
|
};
|
|
20
|
-
function readUInt(input, bits, offset, isBigEndian) {
|
|
21
|
-
offset = offset || 0;
|
|
22
|
+
function readUInt(input, bits, offset = 0, isBigEndian = false) {
|
|
22
23
|
const endian = isBigEndian ? "BE" : "LE";
|
|
23
|
-
const methodName =
|
|
24
|
+
const methodName = `readUInt${bits}${endian}`;
|
|
24
25
|
return methods[methodName](input, offset);
|
|
25
26
|
}
|
|
26
|
-
function readBox(
|
|
27
|
-
if (
|
|
28
|
-
const boxSize = readUInt32BE(
|
|
29
|
-
if (
|
|
27
|
+
function readBox(input, offset) {
|
|
28
|
+
if (input.length - offset < 4) return;
|
|
29
|
+
const boxSize = readUInt32BE(input, offset);
|
|
30
|
+
if (input.length - offset < boxSize) return;
|
|
30
31
|
return {
|
|
31
|
-
name: toUTF8String(
|
|
32
|
+
name: toUTF8String(input, 4 + offset, 8 + offset),
|
|
32
33
|
offset,
|
|
33
34
|
size: boxSize
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
|
-
function findBox(
|
|
37
|
-
while (
|
|
38
|
-
const box = readBox(
|
|
37
|
+
function findBox(input, boxName, currentOffset) {
|
|
38
|
+
while (currentOffset < input.length) {
|
|
39
|
+
const box = readBox(input, currentOffset);
|
|
39
40
|
if (!box) break;
|
|
40
41
|
if (box.name === boxName) return box;
|
|
41
|
-
|
|
42
|
+
currentOffset += box.size > 0 ? box.size : 8;
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
export {
|
|
@@ -51,6 +52,7 @@ export {
|
|
|
51
52
|
readUInt24LE,
|
|
52
53
|
readUInt32BE,
|
|
53
54
|
readUInt32LE,
|
|
55
|
+
readUInt64,
|
|
54
56
|
toHexString,
|
|
55
57
|
toUTF8String
|
|
56
58
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readInt16LE, readUInt24LE, toHexString, toUTF8String } from "./utils.js";
|
|
2
2
|
function calculateExtended(input) {
|
|
3
3
|
return {
|
|
4
4
|
height: 1 + readUInt24LE(input, 7),
|
|
@@ -24,18 +24,17 @@ const WEBP = {
|
|
|
24
24
|
const vp8Header = "VP8" === toUTF8String(input, 12, 15);
|
|
25
25
|
return riffHeader && webpHeader && vp8Header;
|
|
26
26
|
},
|
|
27
|
-
calculate(
|
|
28
|
-
const chunkHeader = toUTF8String(
|
|
29
|
-
input =
|
|
27
|
+
calculate(_input) {
|
|
28
|
+
const chunkHeader = toUTF8String(_input, 12, 16);
|
|
29
|
+
const input = _input.slice(20, 30);
|
|
30
30
|
if (chunkHeader === "VP8X") {
|
|
31
31
|
const extendedHeader = input[0];
|
|
32
32
|
const validStart = (extendedHeader & 192) === 0;
|
|
33
33
|
const validEnd = (extendedHeader & 1) === 0;
|
|
34
34
|
if (validStart && validEnd) {
|
|
35
35
|
return calculateExtended(input);
|
|
36
|
-
} else {
|
|
37
|
-
throw new TypeError("Invalid WebP");
|
|
38
36
|
}
|
|
37
|
+
throw new TypeError("Invalid WebP");
|
|
39
38
|
}
|
|
40
39
|
if (chunkHeader === "VP8 " && input[0] !== 47) {
|
|
41
40
|
return calculateLossy(input);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** This class helps read Uint8Array bit-by-bit */
|
|
2
|
+
export declare class BitReader {
|
|
3
|
+
private readonly input;
|
|
4
|
+
private readonly endianness;
|
|
5
|
+
private byteOffset;
|
|
6
|
+
private bitOffset;
|
|
7
|
+
constructor(input: Uint8Array, endianness: 'big-endian' | 'little-endian');
|
|
8
|
+
/** Reads a specified number of bits, and move the offset */
|
|
9
|
+
getBits(length?: number): number;
|
|
10
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
class BitReader {
|
|
2
|
+
constructor(input, endianness) {
|
|
3
|
+
this.input = input;
|
|
4
|
+
this.endianness = endianness;
|
|
5
|
+
}
|
|
6
|
+
// Skip the first 16 bits (2 bytes) of signature
|
|
7
|
+
byteOffset = 2;
|
|
8
|
+
bitOffset = 0;
|
|
9
|
+
/** Reads a specified number of bits, and move the offset */
|
|
10
|
+
getBits(length = 1) {
|
|
11
|
+
let result = 0;
|
|
12
|
+
let bitsRead = 0;
|
|
13
|
+
while (bitsRead < length) {
|
|
14
|
+
if (this.byteOffset >= this.input.length) {
|
|
15
|
+
throw new Error("Reached end of input");
|
|
16
|
+
}
|
|
17
|
+
const currentByte = this.input[this.byteOffset];
|
|
18
|
+
const bitsLeft = 8 - this.bitOffset;
|
|
19
|
+
const bitsToRead = Math.min(length - bitsRead, bitsLeft);
|
|
20
|
+
if (this.endianness === "little-endian") {
|
|
21
|
+
const mask = (1 << bitsToRead) - 1;
|
|
22
|
+
const bits = currentByte >> this.bitOffset & mask;
|
|
23
|
+
result |= bits << bitsRead;
|
|
24
|
+
} else {
|
|
25
|
+
const mask = (1 << bitsToRead) - 1 << 8 - this.bitOffset - bitsToRead;
|
|
26
|
+
const bits = (currentByte & mask) >> 8 - this.bitOffset - bitsToRead;
|
|
27
|
+
result = result << bitsToRead | bits;
|
|
28
|
+
}
|
|
29
|
+
bitsRead += bitsToRead;
|
|
30
|
+
this.bitOffset += bitsToRead;
|
|
31
|
+
if (this.bitOffset === 8) {
|
|
32
|
+
this.byteOffset++;
|
|
33
|
+
this.bitOffset = 0;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
export {
|
|
40
|
+
BitReader
|
|
41
|
+
};
|
|
@@ -109,6 +109,13 @@ function assets({ fs, settings, sync, logger }) {
|
|
|
109
109
|
export { default as Font } from "astro/components/Font.astro";
|
|
110
110
|
import * as fontsMod from 'virtual:astro:assets/fonts/internal';
|
|
111
111
|
import { createGetFontData } from "astro/assets/fonts/runtime";
|
|
112
|
+
|
|
113
|
+
export const viteFSConfig = ${JSON.stringify(resolvedConfig.server.fs)} ?? {};
|
|
114
|
+
|
|
115
|
+
export const safeModulePaths = new Set(${JSON.stringify(
|
|
116
|
+
// @ts-expect-error safeModulePaths is internal to Vite
|
|
117
|
+
Array.from(resolvedConfig.safeModulePaths)
|
|
118
|
+
)} ?? []);
|
|
112
119
|
|
|
113
120
|
const assetQueryParams = ${settings.adapter?.client?.assetQueryParams ? `new URLSearchParams(${JSON.stringify(
|
|
114
121
|
Array.from(settings.adapter.client.assetQueryParams.entries())
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { SharpImageServiceConfig } from '../assets/services/sharp.js';
|
|
2
2
|
import type { ImageServiceConfig } from '../types/public/index.js';
|
|
3
|
-
export {
|
|
4
|
-
export type { AstroFontProvider } from '../assets/fonts/types.js';
|
|
3
|
+
export { fontProviders } from '../assets/fonts/providers/index.js';
|
|
5
4
|
export { mergeConfig } from '../core/config/merge.js';
|
|
6
5
|
export { validateConfig } from '../core/config/validate.js';
|
|
7
6
|
export { envField } from '../env/config.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { fontProviders } from "../assets/fonts/providers/index.js";
|
|
2
2
|
import { mergeConfig } from "../core/config/merge.js";
|
|
3
3
|
import { validateConfig } from "../core/config/validate.js";
|
|
4
4
|
import { envField } from "../env/config.js";
|
|
@@ -16,7 +16,6 @@ function passthroughImageService() {
|
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
export {
|
|
19
|
-
defineAstroFontProvider,
|
|
20
19
|
defineConfig,
|
|
21
20
|
envField,
|
|
22
21
|
fontProviders,
|
|
@@ -164,7 +164,7 @@ ${contentConfig.error.message}`);
|
|
|
164
164
|
logger.info("Content config changed");
|
|
165
165
|
shouldClear = true;
|
|
166
166
|
}
|
|
167
|
-
if (previousAstroVersion && previousAstroVersion !== "5.16.
|
|
167
|
+
if (previousAstroVersion && previousAstroVersion !== "5.16.7") {
|
|
168
168
|
logger.info("Astro version changed");
|
|
169
169
|
shouldClear = true;
|
|
170
170
|
}
|
|
@@ -172,8 +172,8 @@ ${contentConfig.error.message}`);
|
|
|
172
172
|
logger.info("Clearing content store");
|
|
173
173
|
this.#store.clearAll();
|
|
174
174
|
}
|
|
175
|
-
if ("5.16.
|
|
176
|
-
await this.#store.metaStore().set("astro-version", "5.16.
|
|
175
|
+
if ("5.16.7") {
|
|
176
|
+
await this.#store.metaStore().set("astro-version", "5.16.7");
|
|
177
177
|
}
|
|
178
178
|
if (currentConfigDigest) {
|
|
179
179
|
await this.#store.metaStore().set("content-config-digest", currentConfigDigest);
|
package/dist/content/utils.js
CHANGED
|
@@ -128,8 +128,15 @@ async function getEntryDataAndImages(entry, collectionConfig, shouldEmitFile, ex
|
|
|
128
128
|
schema = schema({
|
|
129
129
|
image: () => z.string().transform((val) => {
|
|
130
130
|
let normalizedPath = val;
|
|
131
|
-
|
|
132
|
-
|
|
131
|
+
const isUrl = val.includes("://");
|
|
132
|
+
const isAbsolute = val.startsWith("/");
|
|
133
|
+
const isRelative = val.startsWith(".");
|
|
134
|
+
if (val && !isUrl && !isAbsolute && !isRelative) {
|
|
135
|
+
const entryDir = path.dirname(entry._internal.filePath);
|
|
136
|
+
const resolvedPath = path.resolve(entryDir, val);
|
|
137
|
+
if (fsMod.existsSync(resolvedPath)) {
|
|
138
|
+
normalizedPath = `./${val}`;
|
|
139
|
+
}
|
|
133
140
|
}
|
|
134
141
|
imageImports.add(normalizedPath);
|
|
135
142
|
return `${IMAGE_IMPORT_PREFIX}${normalizedPath}`;
|
package/dist/core/app/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RemotePattern } from '
|
|
1
|
+
import { type RemotePattern } from '@astrojs/internal-helpers/remote';
|
|
2
2
|
import type { RoutesList } from '../../types/astro.js';
|
|
3
3
|
import type { RouteData, SSRManifest } from '../../types/public/internal.js';
|
|
4
4
|
import { getSetCookiesFromResponse } from '../cookies/index.js';
|
package/dist/core/app/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
hasFileExtension,
|
|
4
4
|
isInternalPath
|
|
5
5
|
} from "@astrojs/internal-helpers/path";
|
|
6
|
-
import { matchPattern } from "
|
|
6
|
+
import { matchPattern } from "@astrojs/internal-helpers/remote";
|
|
7
7
|
import { normalizeTheLocale } from "../../i18n/index.js";
|
|
8
8
|
import {
|
|
9
9
|
clientAddressSymbol,
|
|
@@ -900,6 +900,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
900
900
|
weights: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "atleastone">>;
|
|
901
901
|
styles: z.ZodOptional<z.ZodArray<z.ZodEnum<["normal", "italic", "oblique"]>, "atleastone">>;
|
|
902
902
|
subsets: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
|
|
903
|
+
formats: z.ZodOptional<z.ZodArray<z.ZodEnum<["woff2", "woff", "otf", "ttf", "eot"]>, "atleastone">>;
|
|
903
904
|
display: z.ZodOptional<z.ZodEnum<["auto", "block", "swap", "fallback", "optional"]>>;
|
|
904
905
|
stretch: z.ZodOptional<z.ZodString>;
|
|
905
906
|
featureSettings: z.ZodOptional<z.ZodString>;
|
|
@@ -921,6 +922,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
921
922
|
subsets?: [string, ...string[]] | undefined;
|
|
922
923
|
fallbacks?: string[] | undefined;
|
|
923
924
|
optimizedFallbacks?: boolean | undefined;
|
|
925
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
924
926
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
925
927
|
stretch?: string | undefined;
|
|
926
928
|
featureSettings?: string | undefined;
|
|
@@ -938,6 +940,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
938
940
|
subsets?: [string, ...string[]] | undefined;
|
|
939
941
|
fallbacks?: string[] | undefined;
|
|
940
942
|
optimizedFallbacks?: boolean | undefined;
|
|
943
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
941
944
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
942
945
|
stretch?: string | undefined;
|
|
943
946
|
featureSettings?: string | undefined;
|
|
@@ -1072,6 +1075,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1072
1075
|
subsets?: [string, ...string[]] | undefined;
|
|
1073
1076
|
fallbacks?: string[] | undefined;
|
|
1074
1077
|
optimizedFallbacks?: boolean | undefined;
|
|
1078
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
1075
1079
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
1076
1080
|
stretch?: string | undefined;
|
|
1077
1081
|
featureSettings?: string | undefined;
|
|
@@ -1128,6 +1132,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1128
1132
|
subsets?: [string, ...string[]] | undefined;
|
|
1129
1133
|
fallbacks?: string[] | undefined;
|
|
1130
1134
|
optimizedFallbacks?: boolean | undefined;
|
|
1135
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
1131
1136
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
1132
1137
|
stretch?: string | undefined;
|
|
1133
1138
|
featureSettings?: string | undefined;
|
|
@@ -1373,6 +1378,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1373
1378
|
subsets?: [string, ...string[]] | undefined;
|
|
1374
1379
|
fallbacks?: string[] | undefined;
|
|
1375
1380
|
optimizedFallbacks?: boolean | undefined;
|
|
1381
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
1376
1382
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
1377
1383
|
stretch?: string | undefined;
|
|
1378
1384
|
featureSettings?: string | undefined;
|
|
@@ -1633,6 +1639,7 @@ export declare const AstroConfigSchema: z.ZodObject<{
|
|
|
1633
1639
|
subsets?: [string, ...string[]] | undefined;
|
|
1634
1640
|
fallbacks?: string[] | undefined;
|
|
1635
1641
|
optimizedFallbacks?: boolean | undefined;
|
|
1642
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
1636
1643
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
1637
1644
|
stretch?: string | undefined;
|
|
1638
1645
|
featureSettings?: string | undefined;
|
|
@@ -745,6 +745,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
745
745
|
weights: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "atleastone">>;
|
|
746
746
|
styles: z.ZodOptional<z.ZodArray<z.ZodEnum<["normal", "italic", "oblique"]>, "atleastone">>;
|
|
747
747
|
subsets: z.ZodOptional<z.ZodArray<z.ZodString, "atleastone">>;
|
|
748
|
+
formats: z.ZodOptional<z.ZodArray<z.ZodEnum<["woff2", "woff", "otf", "ttf", "eot"]>, "atleastone">>;
|
|
748
749
|
display: z.ZodOptional<z.ZodEnum<["auto", "block", "swap", "fallback", "optional"]>>;
|
|
749
750
|
stretch: z.ZodOptional<z.ZodString>;
|
|
750
751
|
featureSettings: z.ZodOptional<z.ZodString>;
|
|
@@ -766,6 +767,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
766
767
|
subsets?: [string, ...string[]] | undefined;
|
|
767
768
|
fallbacks?: string[] | undefined;
|
|
768
769
|
optimizedFallbacks?: boolean | undefined;
|
|
770
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
769
771
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
770
772
|
stretch?: string | undefined;
|
|
771
773
|
featureSettings?: string | undefined;
|
|
@@ -783,6 +785,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
783
785
|
subsets?: [string, ...string[]] | undefined;
|
|
784
786
|
fallbacks?: string[] | undefined;
|
|
785
787
|
optimizedFallbacks?: boolean | undefined;
|
|
788
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
786
789
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
787
790
|
stretch?: string | undefined;
|
|
788
791
|
featureSettings?: string | undefined;
|
|
@@ -917,6 +920,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
917
920
|
subsets?: [string, ...string[]] | undefined;
|
|
918
921
|
fallbacks?: string[] | undefined;
|
|
919
922
|
optimizedFallbacks?: boolean | undefined;
|
|
923
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
920
924
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
921
925
|
stretch?: string | undefined;
|
|
922
926
|
featureSettings?: string | undefined;
|
|
@@ -973,6 +977,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
973
977
|
subsets?: [string, ...string[]] | undefined;
|
|
974
978
|
fallbacks?: string[] | undefined;
|
|
975
979
|
optimizedFallbacks?: boolean | undefined;
|
|
980
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
976
981
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
977
982
|
stretch?: string | undefined;
|
|
978
983
|
featureSettings?: string | undefined;
|
|
@@ -1296,6 +1301,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1296
1301
|
subsets?: [string, ...string[]] | undefined;
|
|
1297
1302
|
fallbacks?: string[] | undefined;
|
|
1298
1303
|
optimizedFallbacks?: boolean | undefined;
|
|
1304
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
1299
1305
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
1300
1306
|
stretch?: string | undefined;
|
|
1301
1307
|
featureSettings?: string | undefined;
|
|
@@ -1556,6 +1562,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1556
1562
|
subsets?: [string, ...string[]] | undefined;
|
|
1557
1563
|
fallbacks?: string[] | undefined;
|
|
1558
1564
|
optimizedFallbacks?: boolean | undefined;
|
|
1565
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
1559
1566
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
1560
1567
|
stretch?: string | undefined;
|
|
1561
1568
|
featureSettings?: string | undefined;
|
|
@@ -1798,6 +1805,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
1798
1805
|
subsets?: [string, ...string[]] | undefined;
|
|
1799
1806
|
fallbacks?: string[] | undefined;
|
|
1800
1807
|
optimizedFallbacks?: boolean | undefined;
|
|
1808
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
1801
1809
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
1802
1810
|
stretch?: string | undefined;
|
|
1803
1811
|
featureSettings?: string | undefined;
|
|
@@ -2058,6 +2066,7 @@ export declare function createRelativeSchema(cmd: string, fileProtocolRoot: stri
|
|
|
2058
2066
|
subsets?: [string, ...string[]] | undefined;
|
|
2059
2067
|
fallbacks?: string[] | undefined;
|
|
2060
2068
|
optimizedFallbacks?: boolean | undefined;
|
|
2069
|
+
formats?: ["woff2" | "woff" | "otf" | "ttf" | "eot", ...("woff2" | "woff" | "otf" | "ttf" | "eot")[]] | undefined;
|
|
2061
2070
|
display?: "auto" | "block" | "swap" | "fallback" | "optional" | undefined;
|
|
2062
2071
|
stretch?: string | undefined;
|
|
2063
2072
|
featureSettings?: string | undefined;
|
package/dist/core/constants.js
CHANGED
package/dist/core/dev/dev.js
CHANGED
|
@@ -22,7 +22,7 @@ async function dev(inlineConfig) {
|
|
|
22
22
|
await telemetry.record([]);
|
|
23
23
|
const restart = await createContainerWithAutomaticRestart({ inlineConfig, fs });
|
|
24
24
|
const logger = restart.container.logger;
|
|
25
|
-
const currentVersion = "5.16.
|
|
25
|
+
const currentVersion = "5.16.7";
|
|
26
26
|
const isPrerelease = currentVersion.includes("-");
|
|
27
27
|
if (!isPrerelease) {
|
|
28
28
|
try {
|
package/dist/core/messages.js
CHANGED
|
@@ -38,7 +38,7 @@ function serverStart({
|
|
|
38
38
|
host,
|
|
39
39
|
base
|
|
40
40
|
}) {
|
|
41
|
-
const version = "5.16.
|
|
41
|
+
const version = "5.16.7";
|
|
42
42
|
const localPrefix = `${dim("\u2503")} Local `;
|
|
43
43
|
const networkPrefix = `${dim("\u2503")} Network `;
|
|
44
44
|
const emptyPrefix = " ".repeat(11);
|
|
@@ -275,7 +275,7 @@ function printHelp({
|
|
|
275
275
|
message.push(
|
|
276
276
|
linebreak(),
|
|
277
277
|
` ${bgGreen(black(` ${commandName} `))} ${green(
|
|
278
|
-
`v${"5.16.
|
|
278
|
+
`v${"5.16.7"}`
|
|
279
279
|
)} ${headline}`
|
|
280
280
|
);
|
|
281
281
|
}
|