@veryfront/ext-content-mdx 0.1.1185 → 0.1.1186
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/esm/deno.d.ts +16 -0
- package/esm/deno.js +21 -1
- package/esm/src/errors/error-registry.d.ts +2 -2
- package/esm/src/platform/adapters/base.d.ts +18 -0
- package/esm/src/platform/adapters/base.d.ts.map +1 -1
- package/esm/src/platform/adapters/bounded-file-read.d.ts +34 -0
- package/esm/src/platform/adapters/bounded-file-read.d.ts.map +1 -0
- package/esm/src/platform/adapters/bounded-file-read.js +179 -0
- package/esm/src/platform/adapters/file-snapshot-error.d.ts +6 -0
- package/esm/src/platform/adapters/file-snapshot-error.d.ts.map +1 -0
- package/esm/src/platform/adapters/file-snapshot-error.js +11 -0
- package/esm/src/platform/adapters/runtime/shared/native-file-capabilities.d.ts +33 -0
- package/esm/src/platform/adapters/runtime/shared/native-file-capabilities.d.ts.map +1 -0
- package/esm/src/platform/adapters/runtime/shared/native-file-capabilities.js +205 -0
- package/esm/src/platform/compat/fs.d.ts +6 -2
- package/esm/src/platform/compat/fs.d.ts.map +1 -1
- package/esm/src/platform/compat/fs.js +55 -19
- package/esm/src/platform/compat/not-found-error.d.ts +7 -0
- package/esm/src/platform/compat/not-found-error.d.ts.map +1 -0
- package/esm/src/platform/compat/not-found-error.js +41 -0
- package/esm/src/platform/compat/process.d.ts +1 -1
- package/esm/src/utils/constants/build.d.ts +9 -0
- package/esm/src/utils/constants/build.d.ts.map +1 -1
- package/esm/src/utils/constants/build.js +9 -0
- package/esm/src/utils/constants/index.d.ts +1 -1
- package/esm/src/utils/constants/index.d.ts.map +1 -1
- package/esm/src/utils/constants/index.js +1 -1
- package/esm/src/utils/css-artifact-identity.d.ts +23 -0
- package/esm/src/utils/css-artifact-identity.d.ts.map +1 -0
- package/esm/src/utils/css-artifact-identity.js +77 -0
- package/esm/src/utils/index.d.ts +1 -0
- package/esm/src/utils/index.d.ts.map +1 -1
- package/esm/src/utils/index.js +1 -0
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { isAbsolute, relative, resolve, sep } from "../../../compat/path/index.js";
|
|
2
|
+
import { runtimeUsesWindowsPaths } from "../../../compat/path/portable.js";
|
|
3
|
+
import { FileSnapshotChangedError } from "../../file-snapshot-error.js";
|
|
4
|
+
/** Whether the runtime can enforce a no-follow native snapshot open. */
|
|
5
|
+
export function supportsNativeFileSnapshots(platform = runtimeUsesWindowsPaths() ? "windows" : "posix") {
|
|
6
|
+
return platform === "posix";
|
|
7
|
+
}
|
|
8
|
+
function toSnapshotStat(stats) {
|
|
9
|
+
return {
|
|
10
|
+
dev: stats.dev,
|
|
11
|
+
ino: stats.ino,
|
|
12
|
+
size: stats.size,
|
|
13
|
+
mtimeNs: stats.mtimeNs,
|
|
14
|
+
ctimeNs: stats.ctimeNs,
|
|
15
|
+
isFile: () => stats.isFile(),
|
|
16
|
+
isSymbolicLink: () => stats.isSymbolicLink(),
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async function defaultOperations() {
|
|
20
|
+
const fs = await import("node:fs/promises");
|
|
21
|
+
return {
|
|
22
|
+
realpath: (path) => fs.realpath(path),
|
|
23
|
+
async lstat(path) {
|
|
24
|
+
return toSnapshotStat(await fs.lstat(path, { bigint: true }));
|
|
25
|
+
},
|
|
26
|
+
async open(path, flags) {
|
|
27
|
+
const handle = await fs.open(path, flags);
|
|
28
|
+
return {
|
|
29
|
+
async stat() {
|
|
30
|
+
return toSnapshotStat(await handle.stat({ bigint: true }));
|
|
31
|
+
},
|
|
32
|
+
read: (buffer, offset, length, position) => handle.read(buffer, offset, length, position),
|
|
33
|
+
writeFile: (content) => handle.writeFile(content),
|
|
34
|
+
close: () => handle.close(),
|
|
35
|
+
};
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function requireByteLimit(value) {
|
|
40
|
+
if (!Number.isSafeInteger(value) || value <= 0) {
|
|
41
|
+
throw new RangeError("Snapshot byte limit must be a positive safe integer");
|
|
42
|
+
}
|
|
43
|
+
return value;
|
|
44
|
+
}
|
|
45
|
+
function isContainedPath(path, root) {
|
|
46
|
+
const relation = relative(root, path);
|
|
47
|
+
return relation === "" ||
|
|
48
|
+
(relation !== ".." && !relation.startsWith(`..${sep}`) && !isAbsolute(relation));
|
|
49
|
+
}
|
|
50
|
+
function sameIdentity(left, right) {
|
|
51
|
+
return left.dev === right.dev && left.ino === right.ino;
|
|
52
|
+
}
|
|
53
|
+
function sameGeneration(left, right) {
|
|
54
|
+
return sameIdentity(left, right) && left.size === right.size &&
|
|
55
|
+
left.mtimeNs === right.mtimeNs && left.ctimeNs === right.ctimeNs;
|
|
56
|
+
}
|
|
57
|
+
function changed(message, cause) {
|
|
58
|
+
const error = new FileSnapshotChangedError(message);
|
|
59
|
+
if (cause !== undefined)
|
|
60
|
+
Object.defineProperty(error, "cause", { value: cause });
|
|
61
|
+
return error;
|
|
62
|
+
}
|
|
63
|
+
async function closeSnapshotHandle(handle, primaryFailure, failed) {
|
|
64
|
+
try {
|
|
65
|
+
await handle.close();
|
|
66
|
+
}
|
|
67
|
+
catch (cleanupFailure) {
|
|
68
|
+
if (failed) {
|
|
69
|
+
throw new AggregateError([primaryFailure, cleanupFailure], "Filesystem snapshot read and handle cleanup both failed");
|
|
70
|
+
}
|
|
71
|
+
throw cleanupFailure;
|
|
72
|
+
}
|
|
73
|
+
if (failed)
|
|
74
|
+
throw primaryFailure;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Read one verified regular-file generation without following a terminal link.
|
|
78
|
+
* Identity and generation are checked before and after the bounded positional read.
|
|
79
|
+
*/
|
|
80
|
+
export async function readNodeFileSnapshotWithinLimit(path, containmentRoot, byteLimit, operations) {
|
|
81
|
+
const admittedLimit = requireByteLimit(byteLimit);
|
|
82
|
+
const lexicalRoot = resolve(containmentRoot);
|
|
83
|
+
const candidate = resolve(path);
|
|
84
|
+
const fsOperations = operations ?? await defaultOperations();
|
|
85
|
+
const { constants } = await import("node:fs");
|
|
86
|
+
if (!Number.isSafeInteger(constants.O_NOFOLLOW) || constants.O_NOFOLLOW === 0) {
|
|
87
|
+
throw new TypeError("This runtime cannot guarantee no-follow snapshot opens");
|
|
88
|
+
}
|
|
89
|
+
const canonicalRoot = await fsOperations.realpath(lexicalRoot);
|
|
90
|
+
if (!isContainedPath(candidate, lexicalRoot) &&
|
|
91
|
+
!isContainedPath(candidate, canonicalRoot)) {
|
|
92
|
+
throw new TypeError("Snapshot path must be contained by the requested root");
|
|
93
|
+
}
|
|
94
|
+
const pathnameBefore = await fsOperations.lstat(candidate);
|
|
95
|
+
if (pathnameBefore.isSymbolicLink()) {
|
|
96
|
+
throw new TypeError("Snapshot path must not be a symbolic link");
|
|
97
|
+
}
|
|
98
|
+
if (!pathnameBefore.isFile()) {
|
|
99
|
+
throw new TypeError("Snapshot path must identify a regular file");
|
|
100
|
+
}
|
|
101
|
+
let handle;
|
|
102
|
+
try {
|
|
103
|
+
handle = await fsOperations.open(candidate, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
104
|
+
}
|
|
105
|
+
catch (cause) {
|
|
106
|
+
throw changed("File identity became uncertain while opening the snapshot", cause);
|
|
107
|
+
}
|
|
108
|
+
let failed = false;
|
|
109
|
+
let primaryFailure;
|
|
110
|
+
let result;
|
|
111
|
+
try {
|
|
112
|
+
let handleBefore;
|
|
113
|
+
try {
|
|
114
|
+
handleBefore = await handle.stat();
|
|
115
|
+
}
|
|
116
|
+
catch (cause) {
|
|
117
|
+
throw changed("Opened file identity could not be verified", cause);
|
|
118
|
+
}
|
|
119
|
+
if (!handleBefore.isFile() || !sameGeneration(pathnameBefore, handleBefore)) {
|
|
120
|
+
throw changed("File identity changed while opening the snapshot");
|
|
121
|
+
}
|
|
122
|
+
let canonicalTarget;
|
|
123
|
+
let pathnameOpened;
|
|
124
|
+
try {
|
|
125
|
+
[canonicalTarget, pathnameOpened] = await Promise.all([
|
|
126
|
+
fsOperations.realpath(candidate),
|
|
127
|
+
fsOperations.lstat(candidate),
|
|
128
|
+
]);
|
|
129
|
+
}
|
|
130
|
+
catch (cause) {
|
|
131
|
+
throw changed("File target became uncertain while opening the snapshot", cause);
|
|
132
|
+
}
|
|
133
|
+
if (pathnameOpened.isSymbolicLink() || !pathnameOpened.isFile() ||
|
|
134
|
+
!sameGeneration(handleBefore, pathnameOpened)) {
|
|
135
|
+
throw changed("File identity changed while opening the snapshot");
|
|
136
|
+
}
|
|
137
|
+
if (!isContainedPath(canonicalTarget, canonicalRoot)) {
|
|
138
|
+
throw new TypeError("Snapshot target must be contained by the canonical root");
|
|
139
|
+
}
|
|
140
|
+
if (handleBefore.size < 0n) {
|
|
141
|
+
throw changed("File size became uncertain while opening the snapshot");
|
|
142
|
+
}
|
|
143
|
+
if (handleBefore.size > BigInt(admittedLimit)) {
|
|
144
|
+
throw new RangeError(`File exceeds byte limit of ${admittedLimit} bytes`);
|
|
145
|
+
}
|
|
146
|
+
const size = Number(handleBefore.size);
|
|
147
|
+
let bytes;
|
|
148
|
+
try {
|
|
149
|
+
bytes = new Uint8Array(size);
|
|
150
|
+
}
|
|
151
|
+
catch (cause) {
|
|
152
|
+
throw new Error("Unable to allocate the admitted snapshot buffer", { cause });
|
|
153
|
+
}
|
|
154
|
+
let offset = 0;
|
|
155
|
+
while (offset < size) {
|
|
156
|
+
const { bytesRead } = await handle.read(bytes, offset, size - offset, offset);
|
|
157
|
+
if (!Number.isSafeInteger(bytesRead) || bytesRead <= 0 || bytesRead > size - offset) {
|
|
158
|
+
throw changed("File size changed while reading the snapshot");
|
|
159
|
+
}
|
|
160
|
+
offset += bytesRead;
|
|
161
|
+
}
|
|
162
|
+
let handleAfter;
|
|
163
|
+
let pathnameAfter;
|
|
164
|
+
let canonicalTargetAfter;
|
|
165
|
+
try {
|
|
166
|
+
[handleAfter, pathnameAfter, canonicalTargetAfter] = await Promise.all([
|
|
167
|
+
handle.stat(),
|
|
168
|
+
fsOperations.lstat(candidate),
|
|
169
|
+
fsOperations.realpath(candidate),
|
|
170
|
+
]);
|
|
171
|
+
}
|
|
172
|
+
catch (cause) {
|
|
173
|
+
throw changed("File identity became uncertain after reading the snapshot", cause);
|
|
174
|
+
}
|
|
175
|
+
if (pathnameAfter.isSymbolicLink() || !pathnameAfter.isFile() ||
|
|
176
|
+
!sameGeneration(handleBefore, handleAfter) ||
|
|
177
|
+
!sameGeneration(handleBefore, pathnameAfter) ||
|
|
178
|
+
canonicalTargetAfter !== canonicalTarget ||
|
|
179
|
+
!isContainedPath(canonicalTargetAfter, canonicalRoot)) {
|
|
180
|
+
throw changed("File snapshot changed during the read");
|
|
181
|
+
}
|
|
182
|
+
result = bytes;
|
|
183
|
+
}
|
|
184
|
+
catch (error) {
|
|
185
|
+
failed = true;
|
|
186
|
+
primaryFailure = error;
|
|
187
|
+
}
|
|
188
|
+
await closeSnapshotHandle(handle, primaryFailure, failed);
|
|
189
|
+
return result;
|
|
190
|
+
}
|
|
191
|
+
/** Create a new file without replacement and join handle cleanup. */
|
|
192
|
+
export async function createNodeFileBytesExclusive(path, content, operations) {
|
|
193
|
+
const fsOperations = operations ?? await defaultOperations();
|
|
194
|
+
const handle = await fsOperations.open(path, "wx");
|
|
195
|
+
let failed = false;
|
|
196
|
+
let primaryFailure;
|
|
197
|
+
try {
|
|
198
|
+
await handle.writeFile(content);
|
|
199
|
+
}
|
|
200
|
+
catch (error) {
|
|
201
|
+
failed = true;
|
|
202
|
+
primaryFailure = error;
|
|
203
|
+
}
|
|
204
|
+
await closeSnapshotHandle(handle, primaryFailure, failed);
|
|
205
|
+
}
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { FileInfo } from "../adapters/base.js";
|
|
2
|
+
export { isNotFoundError } from "./not-found-error.js";
|
|
2
3
|
/** Public API contract for file system. */
|
|
3
4
|
export interface FileSystem {
|
|
4
5
|
readTextFile(path: string): Promise<string>;
|
|
5
6
|
readFile(path: string): Promise<Uint8Array>;
|
|
7
|
+
readFileBytesWithinLimit?(path: string, byteLimit: number): Promise<Uint8Array>;
|
|
8
|
+
readFileSnapshotWithinLimit?(path: string, containmentRoot: string, byteLimit: number): Promise<Uint8Array>;
|
|
6
9
|
writeTextFile(path: string, data: string): Promise<void>;
|
|
7
10
|
writeFile(path: string, data: Uint8Array): Promise<void>;
|
|
11
|
+
/** Atomically replace a path when same-filesystem rename is supported. */
|
|
12
|
+
createFileBytesExclusive?(path: string, data: Uint8Array): Promise<void>;
|
|
13
|
+
rename?(from: string, to: string): Promise<void>;
|
|
8
14
|
exists(path: string): Promise<boolean>;
|
|
9
15
|
stat(path: string): Promise<FileInfo>;
|
|
10
16
|
lstat?(path: string): Promise<FileInfo>;
|
|
@@ -69,8 +75,6 @@ export declare function symlink(target: string, path: string): Promise<void>;
|
|
|
69
75
|
* symlink could otherwise escape an intended directory.
|
|
70
76
|
*/
|
|
71
77
|
export declare function realPath(path: string): Promise<string>;
|
|
72
|
-
/** Error shape for is not found. */
|
|
73
|
-
export declare function isNotFoundError(error: unknown, seen?: Set<unknown>): boolean;
|
|
74
78
|
/** Error shape for is already exists. */
|
|
75
79
|
export declare function isAlreadyExistsError(error: unknown): boolean;
|
|
76
80
|
//# sourceMappingURL=fs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/fs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/fs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AASpD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAcvD,2CAA2C;AAC3C,MAAM,WAAW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
3
3
|
import { isBun, isDeno, isNode } from "./runtime.js";
|
|
4
|
+
import { readFileWithinLimit } from "../adapters/bounded-file-read.js";
|
|
5
|
+
import { readNodeFileSnapshotWithinLimit, supportsNativeFileSnapshots, } from "../adapters/runtime/shared/native-file-capabilities.js";
|
|
6
|
+
export { isNotFoundError } from "./not-found-error.js";
|
|
4
7
|
/**
|
|
5
8
|
* Typed accessor for the Deno global.
|
|
6
9
|
*
|
|
@@ -13,6 +16,9 @@ function denoGlobal() {
|
|
|
13
16
|
return dntShim.dntGlobalThis.Deno;
|
|
14
17
|
}
|
|
15
18
|
class NodeFileSystem {
|
|
19
|
+
readFileSnapshotWithinLimit = supportsNativeFileSnapshots()
|
|
20
|
+
? (path, containmentRoot, byteLimit) => readNodeFileSnapshotWithinLimit(path, containmentRoot, byteLimit)
|
|
21
|
+
: undefined;
|
|
16
22
|
fs;
|
|
17
23
|
os;
|
|
18
24
|
path;
|
|
@@ -60,6 +66,19 @@ class NodeFileSystem {
|
|
|
60
66
|
await this.ensureInitialized();
|
|
61
67
|
return this.getFs().readFile(path);
|
|
62
68
|
}
|
|
69
|
+
async readFileBytesWithinLimit(path, byteLimit) {
|
|
70
|
+
await this.ensureInitialized();
|
|
71
|
+
return await readFileWithinLimit(async () => {
|
|
72
|
+
const handle = await this.getFs().open(path, "r");
|
|
73
|
+
return {
|
|
74
|
+
close: () => handle.close(),
|
|
75
|
+
read: async (buffer) => {
|
|
76
|
+
const { bytesRead } = await handle.read(buffer, 0, buffer.byteLength, null);
|
|
77
|
+
return bytesRead === 0 ? null : bytesRead;
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}, byteLimit);
|
|
81
|
+
}
|
|
63
82
|
async writeTextFile(path, data) {
|
|
64
83
|
await this.ensureInitialized();
|
|
65
84
|
await this.getFs().writeFile(path, data, { encoding: "utf8" });
|
|
@@ -68,6 +87,14 @@ class NodeFileSystem {
|
|
|
68
87
|
await this.ensureInitialized();
|
|
69
88
|
await this.getFs().writeFile(path, data);
|
|
70
89
|
}
|
|
90
|
+
async createFileBytesExclusive(path, data) {
|
|
91
|
+
await this.ensureInitialized();
|
|
92
|
+
await this.getFs().writeFile(path, data, { flag: "wx" });
|
|
93
|
+
}
|
|
94
|
+
async rename(from, to) {
|
|
95
|
+
await this.ensureInitialized();
|
|
96
|
+
await this.getFs().rename(from, to);
|
|
97
|
+
}
|
|
71
98
|
async exists(path) {
|
|
72
99
|
await this.ensureInitialized();
|
|
73
100
|
try {
|
|
@@ -142,18 +169,46 @@ class NodeFileSystem {
|
|
|
142
169
|
}
|
|
143
170
|
}
|
|
144
171
|
class DenoFileSystem {
|
|
172
|
+
readFileSnapshotWithinLimit = supportsNativeFileSnapshots()
|
|
173
|
+
? (path, containmentRoot, byteLimit) => readNodeFileSnapshotWithinLimit(path, containmentRoot, byteLimit)
|
|
174
|
+
: undefined;
|
|
145
175
|
readTextFile(path) {
|
|
146
176
|
return denoGlobal().readTextFile(path);
|
|
147
177
|
}
|
|
148
178
|
readFile(path) {
|
|
149
179
|
return denoGlobal().readFile(path);
|
|
150
180
|
}
|
|
181
|
+
async readFileBytesWithinLimit(path, byteLimit) {
|
|
182
|
+
return await readFileWithinLimit(async () => {
|
|
183
|
+
const file = await denoGlobal().open(path, { read: true });
|
|
184
|
+
return { close: () => file.close(), read: (buffer) => file.read(buffer) };
|
|
185
|
+
}, byteLimit);
|
|
186
|
+
}
|
|
151
187
|
async writeTextFile(path, data) {
|
|
152
188
|
await denoGlobal().writeTextFile(path, data);
|
|
153
189
|
}
|
|
154
190
|
async writeFile(path, data) {
|
|
155
191
|
await denoGlobal().writeFile(path, data);
|
|
156
192
|
}
|
|
193
|
+
async createFileBytesExclusive(path, data) {
|
|
194
|
+
const file = await denoGlobal().open(path, { write: true, createNew: true });
|
|
195
|
+
let offset = 0;
|
|
196
|
+
try {
|
|
197
|
+
while (offset < data.byteLength) {
|
|
198
|
+
const written = await file.write(data.subarray(offset));
|
|
199
|
+
if (!Number.isSafeInteger(written) || written <= 0 || written > data.byteLength - offset) {
|
|
200
|
+
throw new Error("Deno exclusive create write made no forward progress");
|
|
201
|
+
}
|
|
202
|
+
offset += written;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
finally {
|
|
206
|
+
file.close();
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
async rename(from, to) {
|
|
210
|
+
await denoGlobal().rename(from, to);
|
|
211
|
+
}
|
|
157
212
|
async exists(path) {
|
|
158
213
|
try {
|
|
159
214
|
await denoGlobal().stat(path);
|
|
@@ -308,25 +363,6 @@ export async function realPath(path) {
|
|
|
308
363
|
const fs = await import("node:fs/promises");
|
|
309
364
|
return await fs.realpath(path);
|
|
310
365
|
}
|
|
311
|
-
/** Error shape for is not found. */
|
|
312
|
-
export function isNotFoundError(error, seen = new Set()) {
|
|
313
|
-
if (seen.has(error))
|
|
314
|
-
return false;
|
|
315
|
-
seen.add(error);
|
|
316
|
-
const NotFound = dntShim.dntGlobalThis.Deno?.errors?.NotFound;
|
|
317
|
-
if (isDeno && NotFound && error instanceof NotFound)
|
|
318
|
-
return true;
|
|
319
|
-
if (error?.code === "ENOENT")
|
|
320
|
-
return true;
|
|
321
|
-
if (error instanceof Error && error.name === "VeryfrontError" &&
|
|
322
|
-
error.slug === "file-not-found") {
|
|
323
|
-
return true;
|
|
324
|
-
}
|
|
325
|
-
if (error instanceof Error && "cause" in error) {
|
|
326
|
-
return isNotFoundError(error.cause, seen);
|
|
327
|
-
}
|
|
328
|
-
return false;
|
|
329
|
-
}
|
|
330
366
|
/** Error shape for is already exists. */
|
|
331
367
|
export function isAlreadyExistsError(error) {
|
|
332
368
|
const AlreadyExists = dntShim.dntGlobalThis.Deno?.errors?.AlreadyExists;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return whether an error or its cause chain represents a path that cannot be
|
|
3
|
+
* resolved. ENOTDIR is included because a missing candidate beneath a file is
|
|
4
|
+
* just as absent as an ENOENT candidate during filesystem lookup.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isNotFoundError(error: unknown, seen?: Set<unknown>): boolean;
|
|
7
|
+
//# sourceMappingURL=not-found-error.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"not-found-error.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/not-found-error.ts"],"names":[],"mappings":"AAWA;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,GAAE,GAAG,CAAC,OAAO,CAAa,GAAG,OAAO,CAuCvF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
|
+
import { isDeno } from "./runtime.js";
|
|
3
|
+
/**
|
|
4
|
+
* Return whether an error or its cause chain represents a path that cannot be
|
|
5
|
+
* resolved. ENOTDIR is included because a missing candidate beneath a file is
|
|
6
|
+
* just as absent as an ENOENT candidate during filesystem lookup.
|
|
7
|
+
*/
|
|
8
|
+
export function isNotFoundError(error, seen = new Set()) {
|
|
9
|
+
if (seen.has(error))
|
|
10
|
+
return false;
|
|
11
|
+
seen.add(error);
|
|
12
|
+
try {
|
|
13
|
+
const NotFound = dntShim.dntGlobalThis.Deno?.errors?.NotFound;
|
|
14
|
+
if (isDeno && NotFound && error instanceof NotFound)
|
|
15
|
+
return true;
|
|
16
|
+
const code = error?.code;
|
|
17
|
+
if (code === "ENOENT" || code === "ENOTDIR")
|
|
18
|
+
return true;
|
|
19
|
+
if (error instanceof Error) {
|
|
20
|
+
if (error.name === "VeryfrontError" &&
|
|
21
|
+
error.slug === "file-not-found") {
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
const legacyContext = error.context;
|
|
25
|
+
if (error.name === "VeryfrontError[file]" &&
|
|
26
|
+
typeof legacyContext === "object" &&
|
|
27
|
+
legacyContext !== null &&
|
|
28
|
+
legacyContext.type === "file" &&
|
|
29
|
+
typeof legacyContext.message === "string" &&
|
|
30
|
+
/^(?:File|Path) not found:/.test(legacyContext.message)) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
if ("cause" in error)
|
|
34
|
+
return isNotFoundError(error.cause, seen);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
// Error classifiers must not replace the original filesystem failure.
|
|
39
|
+
}
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { deleteEnv, env, type EnvBooleanOptions, getEnv, getEnvBoolean, getEnvNumber, getEnvOverlayStorage, getEnvString, getHostEnv, setEnv, } from "
|
|
1
|
+
export { deleteEnv, env, type EnvBooleanOptions, getEnv, getEnvBoolean, getEnvNumber, getEnvOverlayStorage, getEnvString, getHostEnv, setEnv, } from "veryfront/platform/env";
|
|
2
2
|
export { chdir, cwd, execPath, exit, getArgs, getOsType, getRuntimeVersion, getStdout, getTerminalSize, isInteractive, isStdoutTTY, memoryUsage, onGlobalError, onSignal, pid, promptSync, readStdinByteSync, unrefTimer, uptime, writeStdout, writeStdoutAsync, } from "./process/lifecycle.js";
|
|
3
3
|
export { testHasRuntimeProcess } from "./process/runtime-process.js";
|
|
4
4
|
export { type CommandOptions, type CommandResult, runCommand } from "./process/command.js";
|
|
@@ -4,5 +4,14 @@ export declare const DEFAULT_BUILD_CONCURRENCY = 4;
|
|
|
4
4
|
export declare const IMAGE_OPTIMIZATION: {
|
|
5
5
|
readonly DEFAULT_SIZES: readonly [640, 750, 828, 1080, 1200, 1920, 2048, 3840];
|
|
6
6
|
readonly DEFAULT_QUALITY: 80;
|
|
7
|
+
readonly MAX_DIMENSION: 32768;
|
|
8
|
+
readonly MAX_OUTPUT_SIZES: 64;
|
|
9
|
+
readonly MAX_ENGINE_IDENTITY_CHARACTERS: 256;
|
|
10
|
+
};
|
|
11
|
+
/** Shared CSS optimization resource bounds. */
|
|
12
|
+
export declare const CSS_OPTIMIZATION: {
|
|
13
|
+
readonly MAX_FILES: 10000;
|
|
14
|
+
readonly MAX_PURGE_PATTERNS: 128;
|
|
15
|
+
readonly MAX_PURGE_SAFELIST_ENTRIES: 1024;
|
|
7
16
|
};
|
|
8
17
|
//# sourceMappingURL=build.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/constants/build.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,uCAAuC;AACvC,eAAO,MAAM,kBAAkB
|
|
1
|
+
{"version":3,"file":"build.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/constants/build.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAE3C,uCAAuC;AACvC,eAAO,MAAM,kBAAkB;;;;;;CAMrB,CAAC;AAEX,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB;;;;CAInB,CAAC"}
|
|
@@ -4,4 +4,13 @@ export const DEFAULT_BUILD_CONCURRENCY = 4;
|
|
|
4
4
|
export const IMAGE_OPTIMIZATION = {
|
|
5
5
|
DEFAULT_SIZES: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
|
|
6
6
|
DEFAULT_QUALITY: 80,
|
|
7
|
+
MAX_DIMENSION: 32_768,
|
|
8
|
+
MAX_OUTPUT_SIZES: 64,
|
|
9
|
+
MAX_ENGINE_IDENTITY_CHARACTERS: 256,
|
|
10
|
+
};
|
|
11
|
+
/** Shared CSS optimization resource bounds. */
|
|
12
|
+
export const CSS_OPTIMIZATION = {
|
|
13
|
+
MAX_FILES: 10_000,
|
|
14
|
+
MAX_PURGE_PATTERNS: 128,
|
|
15
|
+
MAX_PURGE_SAFELIST_ENTRIES: 1_024,
|
|
7
16
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module utils/constants
|
|
5
5
|
*/
|
|
6
|
-
export { DEFAULT_BUILD_CONCURRENCY, IMAGE_OPTIMIZATION } from "./build.js";
|
|
6
|
+
export { CSS_OPTIMIZATION, DEFAULT_BUILD_CONCURRENCY, IMAGE_OPTIMIZATION } from "./build.js";
|
|
7
7
|
export { BUFFER_SIZE_16_KB, BUFFER_SIZE_1_KB, BUFFER_SIZE_256_BYTES, BUFFER_SIZE_2_KB, BUFFER_SIZE_32_KB, BUFFER_SIZE_4_KB, BUFFER_SIZE_512_BYTES, BUFFER_SIZE_64_KB, BUFFER_SIZE_8_KB, DEFAULT_MAX_BODY_SIZE_BYTES, DEFAULT_MAX_FILE_SIZE_BYTES, DEFAULT_MAX_HEADER_SIZE_BYTES, DEFAULT_MAX_URL_LENGTH_BYTES, MAX_BUNDLE_CHUNK_SIZE_BYTES, PREFETCH_QUEUE_MAX_SIZE_BYTES, RSC_FILE_READ_BUFFER_SIZE_BYTES, } from "./buffers.js";
|
|
8
8
|
export { BUNDLE_CACHE_TTL_DEVELOPMENT_MS, BUNDLE_CACHE_TTL_PRODUCTION_MS, BUNDLE_MANIFEST_DEV_TTL_MS, BUNDLE_MANIFEST_DISTRIBUTED_TTL_SEC, BUNDLE_MANIFEST_LRU_MAX_ENTRIES, BUNDLE_MANIFEST_PROD_TTL_MS, CACHE_CLEANUP_INTERVAL_MS, CLEANUP_INTERVAL_MULTIPLIER, COMPONENT_LOADER_MAX_ENTRIES, COMPONENT_LOADER_TTL_MS, DATA_FETCHING_MAX_ENTRIES, DATA_FETCHING_TTL_MS, DEFAULT_LRU_MAX_ENTRIES, DENO_KV_SAFE_SIZE_LIMIT_BYTES, DISTRIBUTED_CSS_TTL_PREVIEW_SEC, DISTRIBUTED_CSS_TTL_PRODUCTION_SEC, DISTRIBUTED_FILE_TTL_PREVIEW_SEC, DISTRIBUTED_FILE_TTL_PRODUCTION_SEC, DISTRIBUTED_SSR_MODULE_TTL_PREVIEW_SEC, DISTRIBUTED_SSR_MODULE_TTL_PRODUCTION_SEC, DISTRIBUTED_TRANSFORM_TTL_PREVIEW_SEC, DISTRIBUTED_TRANSFORM_TTL_PRODUCTION_SEC, ESM_CACHE_MAX_ENTRIES, ESM_CACHE_TTL_MS, FILE_CACHE_MAX_ENTRIES, FILE_CACHE_MAX_SIZE_MB, getDistributedCacheTTL, HOURS_PER_DAY, HTTP_CACHE_LONG_MAX_AGE_SEC, HTTP_CACHE_MEDIUM_MAX_AGE_SEC, HTTP_CACHE_SHORT_MAX_AGE_SEC, HTTP_MODULE_CACHE_MAX_ENTRIES, HTTP_MODULE_DISTRIBUTED_TTL_SEC, LRU_DEFAULT_MAX_ENTRIES_V2, LRU_DEFAULT_MAX_SIZE_BYTES, MAX_CONCURRENT_HTTP_FETCHES, MAX_CONCURRENT_REVALIDATIONS, MDX_CACHE_TTL_DEVELOPMENT_MS, MDX_CACHE_TTL_PRODUCTION_MS, MDX_RENDERER_MAX_ENTRIES, MDX_RENDERER_TTL_MS, MEMORY_CACHE_MAX_ENTRIES, MEMORY_CACHE_MAX_SIZE_BYTES, MINUTES_PER_HOUR, MODULE_CACHE_MAX_ENTRIES, MODULE_CACHE_TTL_MS, MS_PER_HOUR, MS_PER_MINUTE, MS_PER_SECOND, ONE_DAY_MS, RENDERER_CORE_MAX_ENTRIES, RENDERER_CORE_TTL_MS, REVALIDATION_PER_PROJECT_LIMIT, REVALIDATION_TIMEOUT_MS, RSC_MANIFEST_CACHE_TTL_MS, SECONDS_PER_MINUTE, SERVER_ACTION_DEFAULT_TTL_SEC, TRANSFORM_DISTRIBUTED_TTL_SEC, TSX_LAYOUT_MAX_ENTRIES, TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES, TSX_LAYOUT_TTL_MS, } from "./cache.js";
|
|
9
9
|
export { DEFAULT_ALLOWED_CDN_HOSTS, DENO_STD_BASE, DENO_STD_VERSION, ESM_CDN_BASE, esmShReact, getDenoStdNodeBase, getReactCDNUrl, getReactDOMCDNUrl, getReactDOMClientCDNUrl, getReactDOMServerCDNUrl, getReactImportMap, getReactJSXDevRuntimeCDNUrl, getReactJSXRuntimeCDNUrl, getReactUrls, getTailwindCSSUrl, JSDELIVR_CDN_BASE, REACT_DEFAULT_VERSION, REACT_VERSION_17, REACT_VERSION_18_2, REACT_VERSION_18_3, REACT_VERSION_19, REACT_VERSION_19_RC, TAILWIND_VERSION, VERYFRONT_VERSION, } from "./cdn.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/utils/constants/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,2BAA2B,EAC3B,2BAA2B,EAC3B,6BAA6B,EAC7B,4BAA4B,EAC5B,2BAA2B,EAC3B,6BAA6B,EAC7B,+BAA+B,GAChC,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,EAC9B,0BAA0B,EAC1B,mCAAmC,EACnC,+BAA+B,EAC/B,2BAA2B,EAC3B,yBAAyB,EACzB,2BAA2B,EAC3B,4BAA4B,EAC5B,uBAAuB,EACvB,yBAAyB,EACzB,oBAAoB,EACpB,uBAAuB,EACvB,6BAA6B,EAC7B,+BAA+B,EAC/B,kCAAkC,EAClC,gCAAgC,EAChC,mCAAmC,EACnC,sCAAsC,EACtC,yCAAyC,EACzC,qCAAqC,EACrC,wCAAwC,EACxC,qBAAqB,EACrB,gBAAgB,EAChB,sBAAsB,EACt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kBAAkB,EAClB,YAAY,GACb,MAAM,aAAa,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @module utils/constants
|
|
5
5
|
*/
|
|
6
|
-
export { DEFAULT_BUILD_CONCURRENCY, IMAGE_OPTIMIZATION } from "./build.js";
|
|
6
|
+
export { CSS_OPTIMIZATION, DEFAULT_BUILD_CONCURRENCY, IMAGE_OPTIMIZATION } from "./build.js";
|
|
7
7
|
export { BUFFER_SIZE_16_KB, BUFFER_SIZE_1_KB, BUFFER_SIZE_256_BYTES, BUFFER_SIZE_2_KB, BUFFER_SIZE_32_KB, BUFFER_SIZE_4_KB, BUFFER_SIZE_512_BYTES, BUFFER_SIZE_64_KB, BUFFER_SIZE_8_KB, DEFAULT_MAX_BODY_SIZE_BYTES, DEFAULT_MAX_FILE_SIZE_BYTES, DEFAULT_MAX_HEADER_SIZE_BYTES, DEFAULT_MAX_URL_LENGTH_BYTES, MAX_BUNDLE_CHUNK_SIZE_BYTES, PREFETCH_QUEUE_MAX_SIZE_BYTES, RSC_FILE_READ_BUFFER_SIZE_BYTES, } from "./buffers.js";
|
|
8
8
|
export { BUNDLE_CACHE_TTL_DEVELOPMENT_MS, BUNDLE_CACHE_TTL_PRODUCTION_MS, BUNDLE_MANIFEST_DEV_TTL_MS, BUNDLE_MANIFEST_DISTRIBUTED_TTL_SEC, BUNDLE_MANIFEST_LRU_MAX_ENTRIES, BUNDLE_MANIFEST_PROD_TTL_MS, CACHE_CLEANUP_INTERVAL_MS, CLEANUP_INTERVAL_MULTIPLIER, COMPONENT_LOADER_MAX_ENTRIES, COMPONENT_LOADER_TTL_MS, DATA_FETCHING_MAX_ENTRIES, DATA_FETCHING_TTL_MS, DEFAULT_LRU_MAX_ENTRIES, DENO_KV_SAFE_SIZE_LIMIT_BYTES, DISTRIBUTED_CSS_TTL_PREVIEW_SEC, DISTRIBUTED_CSS_TTL_PRODUCTION_SEC, DISTRIBUTED_FILE_TTL_PREVIEW_SEC, DISTRIBUTED_FILE_TTL_PRODUCTION_SEC, DISTRIBUTED_SSR_MODULE_TTL_PREVIEW_SEC, DISTRIBUTED_SSR_MODULE_TTL_PRODUCTION_SEC, DISTRIBUTED_TRANSFORM_TTL_PREVIEW_SEC, DISTRIBUTED_TRANSFORM_TTL_PRODUCTION_SEC, ESM_CACHE_MAX_ENTRIES, ESM_CACHE_TTL_MS, FILE_CACHE_MAX_ENTRIES, FILE_CACHE_MAX_SIZE_MB, getDistributedCacheTTL, HOURS_PER_DAY, HTTP_CACHE_LONG_MAX_AGE_SEC, HTTP_CACHE_MEDIUM_MAX_AGE_SEC, HTTP_CACHE_SHORT_MAX_AGE_SEC, HTTP_MODULE_CACHE_MAX_ENTRIES, HTTP_MODULE_DISTRIBUTED_TTL_SEC, LRU_DEFAULT_MAX_ENTRIES_V2, LRU_DEFAULT_MAX_SIZE_BYTES, MAX_CONCURRENT_HTTP_FETCHES, MAX_CONCURRENT_REVALIDATIONS, MDX_CACHE_TTL_DEVELOPMENT_MS, MDX_CACHE_TTL_PRODUCTION_MS, MDX_RENDERER_MAX_ENTRIES, MDX_RENDERER_TTL_MS, MEMORY_CACHE_MAX_ENTRIES, MEMORY_CACHE_MAX_SIZE_BYTES, MINUTES_PER_HOUR, MODULE_CACHE_MAX_ENTRIES, MODULE_CACHE_TTL_MS, MS_PER_HOUR, MS_PER_MINUTE, MS_PER_SECOND, ONE_DAY_MS, RENDERER_CORE_MAX_ENTRIES, RENDERER_CORE_TTL_MS, REVALIDATION_PER_PROJECT_LIMIT, REVALIDATION_TIMEOUT_MS, RSC_MANIFEST_CACHE_TTL_MS, SECONDS_PER_MINUTE, SERVER_ACTION_DEFAULT_TTL_SEC, TRANSFORM_DISTRIBUTED_TTL_SEC, TSX_LAYOUT_MAX_ENTRIES, TSX_LAYOUT_PER_PROJECT_MAX_ENTRIES, TSX_LAYOUT_TTL_MS, } from "./cache.js";
|
|
9
9
|
export { DEFAULT_ALLOWED_CDN_HOSTS, DENO_STD_BASE, DENO_STD_VERSION, ESM_CDN_BASE, esmShReact, getDenoStdNodeBase, getReactCDNUrl, getReactDOMCDNUrl, getReactDOMClientCDNUrl, getReactDOMServerCDNUrl, getReactImportMap, getReactJSXDevRuntimeCDNUrl, getReactJSXRuntimeCDNUrl, getReactUrls, getTailwindCSSUrl, JSDELIVR_CDN_BASE, REACT_DEFAULT_VERSION, REACT_VERSION_17, REACT_VERSION_18_2, REACT_VERSION_18_3, REACT_VERSION_19, REACT_VERSION_19_RC, TAILWIND_VERSION, VERYFRONT_VERSION, } from "./cdn.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical identities shared by CSS generation, cache, and control-plane boundaries.
|
|
3
|
+
*
|
|
4
|
+
* This module deliberately has no vendor dependencies. Cache identities may cross
|
|
5
|
+
* process and service boundaries, so accepting two strings with the same encoded
|
|
6
|
+
* representation—or an unbounded string—is unsafe even when TypeScript calls the
|
|
7
|
+
* value a `string`.
|
|
8
|
+
*
|
|
9
|
+
* @module utils/css-artifact-identity
|
|
10
|
+
*/
|
|
11
|
+
/** Maximum UTF-16 code units accepted for one complete CSS pipeline identity. */
|
|
12
|
+
export declare const MAX_CSS_PIPELINE_IDENTITY_CODE_UNITS = 2048;
|
|
13
|
+
/** Maximum encoded UTF-8 bytes accepted for one complete CSS pipeline identity. */
|
|
14
|
+
export declare const MAX_CSS_PIPELINE_IDENTITY_UTF8_BYTES = 2048;
|
|
15
|
+
/** Whether a value is safe to compare, encode, and persist as a CSS pipeline identity. */
|
|
16
|
+
export declare function isCSSPipelineIdentity(value: unknown): value is string;
|
|
17
|
+
/** Validate and return an immutable string snapshot for cache or wire use. */
|
|
18
|
+
export declare function assertCSSPipelineIdentity(value: unknown, label?: string): string;
|
|
19
|
+
/** Whether a value is the canonical style-scope profile SHA-256 identity. */
|
|
20
|
+
export declare function isStyleProfileHash(value: unknown): value is string;
|
|
21
|
+
/** Validate and return the canonical style-scope profile SHA-256 identity. */
|
|
22
|
+
export declare function assertStyleProfileHash(value: unknown, label?: string): string;
|
|
23
|
+
//# sourceMappingURL=css-artifact-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css-artifact-identity.d.ts","sourceRoot":"","sources":["../../../src/src/utils/css-artifact-identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,iFAAiF;AACjF,eAAO,MAAM,oCAAoC,OAAQ,CAAC;AAE1D,mFAAmF;AACnF,eAAO,MAAM,oCAAoC,OAAQ,CAAC;AAiC1D,0FAA0F;AAC1F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAkBrE;AAED,8EAA8E;AAC9E,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,KAAK,SAA0B,GAC9B,MAAM,CAOR;AAED,6EAA6E;AAC7E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAGlE;AAED,8EAA8E;AAC9E,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,EACd,KAAK,SAAuB,GAC3B,MAAM,CAKR"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical identities shared by CSS generation, cache, and control-plane boundaries.
|
|
3
|
+
*
|
|
4
|
+
* This module deliberately has no vendor dependencies. Cache identities may cross
|
|
5
|
+
* process and service boundaries, so accepting two strings with the same encoded
|
|
6
|
+
* representation—or an unbounded string—is unsafe even when TypeScript calls the
|
|
7
|
+
* value a `string`.
|
|
8
|
+
*
|
|
9
|
+
* @module utils/css-artifact-identity
|
|
10
|
+
*/
|
|
11
|
+
/** Maximum UTF-16 code units accepted for one complete CSS pipeline identity. */
|
|
12
|
+
export const MAX_CSS_PIPELINE_IDENTITY_CODE_UNITS = 2_048;
|
|
13
|
+
/** Maximum encoded UTF-8 bytes accepted for one complete CSS pipeline identity. */
|
|
14
|
+
export const MAX_CSS_PIPELINE_IDENTITY_UTF8_BYTES = 2_048;
|
|
15
|
+
const CSS_STYLE_PROFILE_HASH_PATTERN = /^[a-f0-9]{64}$/;
|
|
16
|
+
const ReflectApply = Reflect.apply;
|
|
17
|
+
const RegExpPrototypeTest = RegExp.prototype.test;
|
|
18
|
+
const StringPrototypeCharCodeAt = String.prototype.charCodeAt;
|
|
19
|
+
const StringPrototypeNormalize = String.prototype.normalize;
|
|
20
|
+
const StringPrototypeTrim = String.prototype.trim;
|
|
21
|
+
const TextEncoderPrototypeEncode = TextEncoder.prototype.encode;
|
|
22
|
+
const cssIdentityTextEncoder = new TextEncoder();
|
|
23
|
+
function charCodeAt(value, index) {
|
|
24
|
+
return ReflectApply(StringPrototypeCharCodeAt, value, [index]);
|
|
25
|
+
}
|
|
26
|
+
function hasOnlyWellFormedNonControlCharacters(value) {
|
|
27
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
28
|
+
const codeUnit = charCodeAt(value, index);
|
|
29
|
+
if (codeUnit <= 0x1f || (codeUnit >= 0x7f && codeUnit <= 0x9f)) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (codeUnit >= 0xd800 && codeUnit <= 0xdbff) {
|
|
33
|
+
if (index + 1 >= value.length)
|
|
34
|
+
return false;
|
|
35
|
+
const trailing = charCodeAt(value, index + 1);
|
|
36
|
+
if (trailing < 0xdc00 || trailing > 0xdfff)
|
|
37
|
+
return false;
|
|
38
|
+
index += 1;
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (codeUnit >= 0xdc00 && codeUnit <= 0xdfff)
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
/** Whether a value is safe to compare, encode, and persist as a CSS pipeline identity. */
|
|
47
|
+
export function isCSSPipelineIdentity(value) {
|
|
48
|
+
if (typeof value !== "string" ||
|
|
49
|
+
value.length === 0 ||
|
|
50
|
+
value.length > MAX_CSS_PIPELINE_IDENTITY_CODE_UNITS ||
|
|
51
|
+
ReflectApply(StringPrototypeTrim, value, []) !== value ||
|
|
52
|
+
ReflectApply(StringPrototypeNormalize, value, ["NFC"]) !== value ||
|
|
53
|
+
!hasOnlyWellFormedNonControlCharacters(value)) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
const bytes = ReflectApply(TextEncoderPrototypeEncode, cssIdentityTextEncoder, [value]);
|
|
57
|
+
return bytes.byteLength <= MAX_CSS_PIPELINE_IDENTITY_UTF8_BYTES;
|
|
58
|
+
}
|
|
59
|
+
/** Validate and return an immutable string snapshot for cache or wire use. */
|
|
60
|
+
export function assertCSSPipelineIdentity(value, label = "CSS pipeline identity") {
|
|
61
|
+
if (!isCSSPipelineIdentity(value)) {
|
|
62
|
+
throw new TypeError(`${label} must be a trimmed, NFC-normalized, well-formed string without control characters and no larger than ${MAX_CSS_PIPELINE_IDENTITY_CODE_UNITS} code units or ${MAX_CSS_PIPELINE_IDENTITY_UTF8_BYTES} UTF-8 bytes`);
|
|
63
|
+
}
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
/** Whether a value is the canonical style-scope profile SHA-256 identity. */
|
|
67
|
+
export function isStyleProfileHash(value) {
|
|
68
|
+
return typeof value === "string" &&
|
|
69
|
+
ReflectApply(RegExpPrototypeTest, CSS_STYLE_PROFILE_HASH_PATTERN, [value]) === true;
|
|
70
|
+
}
|
|
71
|
+
/** Validate and return the canonical style-scope profile SHA-256 identity. */
|
|
72
|
+
export function assertStyleProfileHash(value, label = "Style profile hash") {
|
|
73
|
+
if (!isStyleProfileHash(value)) {
|
|
74
|
+
throw new TypeError(`${label} must be a full lowercase SHA-256 digest`);
|
|
75
|
+
}
|
|
76
|
+
return value;
|
|
77
|
+
}
|
package/esm/src/utils/index.d.ts
CHANGED
|
@@ -29,4 +29,5 @@ export { computeIntegrity, createLockfileManager, type LockfileManager, } from "
|
|
|
29
29
|
export { endRequest, isEnabled, startRequest, startTimer, timeAsync } from "./perf-timer.js";
|
|
30
30
|
export { parallelMap } from "./parallel.js";
|
|
31
31
|
export { safeJsonParse, type SafeJsonParseResult } from "./json.js";
|
|
32
|
+
export { assertCSSPipelineIdentity, assertStyleProfileHash, isCSSPipelineIdentity, isStyleProfileHash, MAX_CSS_PIPELINE_IDENTITY_CODE_UNITS, MAX_CSS_PIPELINE_IDENTITY_UTF8_BYTES, } from "./css-artifact-identity.js";
|
|
32
33
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,aAAa,EACb,cAAc,EACd,cAAc,GACf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,0BAA0B,EAC1B,4BAA4B,EAC5B,4BAA4B,IAAI,0BAA0B,EAC1D,WAAW,EACX,aAAa,EACb,SAAS,EACT,mBAAmB,EACnB,aAAa,EACb,MAAM,EACN,mBAAmB,EACnB,cAAc,EACd,0BAA0B,EAC1B,YAAY,GACb,MAAM,mBAAmB,CAAC;AAC3B,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAG1E,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAEjG,OAAO,EACL,aAAa,EACb,aAAa,EACb,aAAa,EACb,aAAa,EACb,YAAY,EACZ,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,eAAe,EACf,0BAA0B,EAC1B,2BAA2B,EAC3B,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,2BAA2B,EAC3B,wBA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