@noego/trust 0.5.0-dev.0 → 0.5.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -9
- package/dist/{baseline-B0AplCuF.d.ts → baseline-Bkav9mS0.d.ts} +22 -4
- package/dist/{chunk-V72KWVWP.js → chunk-7PY2Q6OX.js} +212 -16
- package/dist/chunk-7PY2Q6OX.js.map +1 -0
- package/dist/{chunk-NG4KYWVW.js → chunk-UG6D3V4M.js} +877 -41
- package/dist/chunk-UG6D3V4M.js.map +1 -0
- package/dist/{chunk-OSSITT3R.js → chunk-XXLWC5DB.js} +17 -61
- package/dist/chunk-XXLWC5DB.js.map +1 -0
- package/dist/cli/index.js +341 -92
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/wasm-worker.js +257 -0
- package/dist/cli/wasm-worker.js.map +1 -0
- package/dist/core/index.d.ts +5 -3
- package/dist/core/index.js +7 -7
- package/dist/eslint/index.d.ts +6 -2
- package/dist/eslint/index.js +2 -2
- package/dist/licenses/@jridgewell__resolve-uri/LICENSE +19 -0
- package/dist/licenses/@jridgewell__sourcemap-codec/LICENSE +19 -0
- package/dist/licenses/@jridgewell__trace-mapping/LICENSE +19 -0
- package/dist/licenses/JS-DEPENDENCIES.json +83 -0
- package/dist/licenses/balanced-match/LICENSE.md +23 -0
- package/dist/licenses/brace-expansion/LICENSE +23 -0
- package/dist/licenses/dedent-js/LICENSE +19 -0
- package/dist/licenses/minimatch/LICENSE.md +55 -0
- package/dist/licenses/scule/LICENSE +21 -0
- package/dist/licenses/svelte2tsx/LICENSE +21 -0
- package/dist/native/licenses/CARGO-DEPENDENCIES.json +479 -0
- package/dist/native/licenses/LICENSE-trust.txt +15 -0
- package/dist/native/licenses/cargo/adler2-2.0.1/LICENSE-0BSD +12 -0
- package/dist/native/licenses/cargo/adler2-2.0.1/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/adler2-2.0.1/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/aho-corasick-1.1.5/COPYING +3 -0
- package/dist/native/licenses/cargo/aho-corasick-1.1.5/LICENSE-MIT +21 -0
- package/dist/native/licenses/cargo/autocfg-1.5.1/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/autocfg-1.5.1/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/bitflags-1.3.2/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/bitflags-1.3.2/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/bstr-1.13.1/COPYING +8 -0
- package/dist/native/licenses/cargo/bstr-1.13.1/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/bstr-1.13.1/LICENSE-MIT +21 -0
- package/dist/native/licenses/cargo/bumpalo-3.20.3/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/bumpalo-3.20.3/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/cfg-if-1.0.5/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/cfg-if-1.0.5/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/crc32fast-1.5.2/LICENSE-APACHE +202 -0
- package/dist/native/licenses/cargo/crc32fast-1.5.2/LICENSE-MIT +21 -0
- package/dist/native/licenses/cargo/defmt-1.1.1/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/defmt-1.1.1/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/defmt-macros-1.1.1/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/defmt-macros-1.1.1/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/equivalent-1.0.2/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/equivalent-1.0.2/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/flate2-1.1.10/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/flate2-1.1.10/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/globset-0.4.20/COPYING +3 -0
- package/dist/native/licenses/cargo/globset-0.4.20/LICENSE-MIT +21 -0
- package/dist/native/licenses/cargo/hashbrown-0.17.1/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/hashbrown-0.17.1/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/indexmap-2.14.0/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/indexmap-2.14.0/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/itoa-1.0.18/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/itoa-1.0.18/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/jiff-0.2.37/COPYING +3 -0
- package/dist/native/licenses/cargo/jiff-0.2.37/LICENSE-MIT +21 -0
- package/dist/native/licenses/cargo/jiff-core-0.1.1/COPYING +3 -0
- package/dist/native/licenses/cargo/jiff-core-0.1.1/LICENSE-MIT +21 -0
- package/dist/native/licenses/cargo/jiff-tzdb-0.1.9/COPYING +3 -0
- package/dist/native/licenses/cargo/jiff-tzdb-0.1.9/LICENSE-MIT +21 -0
- package/dist/native/licenses/cargo/jiff-tzdb-platform-0.1.3/COPYING +3 -0
- package/dist/native/licenses/cargo/jiff-tzdb-platform-0.1.3/LICENSE-MIT +21 -0
- package/dist/native/licenses/cargo/log-0.4.34/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/log-0.4.34/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/lzma-rust2-0.21.0/LICENSE +201 -0
- package/dist/native/licenses/cargo/memchr-2.8.2/COPYING +3 -0
- package/dist/native/licenses/cargo/memchr-2.8.2/LICENSE-MIT +21 -0
- package/dist/native/licenses/cargo/miniz_oxide-0.9.1/LICENSE +25 -0
- package/dist/native/licenses/cargo/miniz_oxide-0.9.1/LICENSE-APACHE.md +177 -0
- package/dist/native/licenses/cargo/miniz_oxide-0.9.1/LICENSE-MIT.md +24 -0
- package/dist/native/licenses/cargo/miniz_oxide-0.9.1/LICENSE-ZLIB.md +14 -0
- package/dist/native/licenses/cargo/num-bigint-0.4.6/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/num-bigint-0.4.6/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/num-integer-0.1.47/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/num-integer-0.1.47/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/num-traits-0.2.19/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/num-traits-0.2.19/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/proc-macro2-1.0.107/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/proc-macro2-1.0.107/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/quote-1.0.47/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/quote-1.0.47/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/regex-automata-0.4.18/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/regex-automata-0.4.18/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/regex-syntax-0.8.11/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/regex-syntax-0.8.11/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/rustc-hash-2.1.2/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/rustc-hash-2.1.2/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/ryu-js-1.0.2/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/ryu-js-1.0.2/LICENSE-BOOST +23 -0
- package/dist/native/licenses/cargo/serde-1.0.229/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/serde-1.0.229/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/serde_core-1.0.229/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/serde_core-1.0.229/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/serde_derive-1.0.229/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/serde_derive-1.0.229/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/serde_json-1.0.152/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/serde_json-1.0.152/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/simd-adler32-0.3.10/LICENSE.md +21 -0
- package/dist/native/licenses/cargo/smallvec-1.15.1/LICENSE-APACHE +201 -0
- package/dist/native/licenses/cargo/smallvec-1.15.1/LICENSE-MIT +25 -0
- package/dist/native/licenses/cargo/syn-2.0.119/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/syn-2.0.119/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/syn-3.0.7/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/syn-3.0.7/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/thiserror-2.0.21/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/thiserror-2.0.21/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/thiserror-impl-2.0.21/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/thiserror-impl-2.0.21/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/unicode-ident-1.0.26/LICENSE-APACHE +176 -0
- package/dist/native/licenses/cargo/unicode-ident-1.0.26/LICENSE-MIT +23 -0
- package/dist/native/licenses/cargo/unicode-ident-1.0.26/LICENSE-UNICODE +39 -0
- package/dist/native/licenses/cargo/xxhash-rust-0.8.15/LICENSE +23 -0
- package/dist/native/licenses/cargo/zlib-rs-0.6.8/LICENSE +19 -0
- package/dist/native/licenses/cargo/zmij-1.0.23/LICENSE-MIT +23 -0
- package/dist/native/licenses/ts-rust/LICENSE +21 -0
- package/dist/native/licenses/ts-rust/NOTICE.md +53 -0
- package/dist/native/licenses/ts-rust/licenses/Go-LICENSE.txt +27 -0
- package/dist/native/licenses/ts-rust/licenses/TypeScript-LICENSE.txt +55 -0
- package/dist/native/licenses/ts-rust/licenses/TypeScript-NOTICE.txt +405 -0
- package/dist/native/licenses/ts-rust/licenses/Unicode-LICENSE.txt +39 -0
- package/dist/native/licenses/ts-rust/licenses/vscode-languageserver-node-LICENSE.txt +18 -0
- package/dist/native/licenses/typescript/LICENSE.txt +55 -0
- package/dist/native/licenses/typescript/ThirdPartyNoticeText.txt +193 -0
- package/dist/native/licenses/typescript/manifest.json +105 -0
- package/dist/native/trust_native_wasm.wasm +0 -0
- package/dist/svelte2tsx/index.cjs +7064 -0
- package/dist/svelte2tsx/svelte-jsx-v4.d.ts +230 -0
- package/dist/svelte2tsx/svelte-jsx.d.ts +1492 -0
- package/dist/svelte2tsx/svelte-shims-v4.d.ts +290 -0
- package/dist/svelte2tsx/svelte-shims.d.ts +305 -0
- package/package.json +25 -5
- package/dist/chunk-NG4KYWVW.js.map +0 -1
- package/dist/chunk-OSSITT3R.js.map +0 -1
- package/dist/chunk-V72KWVWP.js.map +0 -1
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
// src/cli/wasm-worker.js
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
import { parentPort, workerData } from "worker_threads";
|
|
4
|
+
var encoder = new TextEncoder();
|
|
5
|
+
var decoder = new TextDecoder();
|
|
6
|
+
var FLAG_CASE_INSENSITIVE = 1;
|
|
7
|
+
var SUCCESS = 0;
|
|
8
|
+
var EBADF = 8;
|
|
9
|
+
var ENOSYS = 52;
|
|
10
|
+
var OP_READ = 0;
|
|
11
|
+
var OP_STAT = 1;
|
|
12
|
+
var OP_READ_DIR = 2;
|
|
13
|
+
var OP_REALPATH = 3;
|
|
14
|
+
var OP_WRITE = 4;
|
|
15
|
+
var OP_APPEND = 5;
|
|
16
|
+
var OP_REMOVE = 6;
|
|
17
|
+
var OP_CHTIMES = 7;
|
|
18
|
+
var KIND_CHAR = { file: "f", directory: "d", symlink: "l", other: "o" };
|
|
19
|
+
var WasiExit = class extends Error {
|
|
20
|
+
constructor(code) {
|
|
21
|
+
super(`exit ${code}`);
|
|
22
|
+
this.code = code;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
var isEngineConfig = (path) => /\/\.trust-native-\d+-\d+\.tsconfig\.json$/.test(path);
|
|
26
|
+
function hostFileSystem() {
|
|
27
|
+
const virtual = new Map(Object.entries(JSON.parse(workerData.request).virtualFiles ?? {}).map(([path, code]) => [path, encoder.encode(code)]));
|
|
28
|
+
const kind = (entry) => entry.isDirectory() ? "directory" : entry.isFile() ? "file" : entry.isSymbolicLink() ? "symlink" : "other";
|
|
29
|
+
return {
|
|
30
|
+
readFile(path) {
|
|
31
|
+
const held = virtual.get(path);
|
|
32
|
+
if (held) return held;
|
|
33
|
+
try {
|
|
34
|
+
return fs.readFileSync(path);
|
|
35
|
+
} catch {
|
|
36
|
+
return void 0;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
stat(path) {
|
|
40
|
+
const held = virtual.get(path);
|
|
41
|
+
if (held) return { isDirectory: false, isFile: true, size: held.length, mtimeNs: 0n };
|
|
42
|
+
try {
|
|
43
|
+
const stat = fs.statSync(path, { bigint: true });
|
|
44
|
+
return { isDirectory: stat.isDirectory(), isFile: stat.isFile(), size: Number(stat.size), mtimeNs: stat.mtimeNs };
|
|
45
|
+
} catch {
|
|
46
|
+
return void 0;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
readDirectory(path) {
|
|
50
|
+
try {
|
|
51
|
+
const entries = fs.readdirSync(path, { withFileTypes: true }).map((entry) => ({ name: entry.name, kind: kind(entry) }));
|
|
52
|
+
const prefix = path.replace(/\/$/, "") + "/";
|
|
53
|
+
for (const file of virtual.keys()) {
|
|
54
|
+
if (!file.startsWith(prefix)) continue;
|
|
55
|
+
const rest = file.slice(prefix.length);
|
|
56
|
+
const name = rest.split("/")[0];
|
|
57
|
+
if (!entries.some((entry) => entry.name === name)) entries.push({ name, kind: rest.includes("/") ? "directory" : "file" });
|
|
58
|
+
}
|
|
59
|
+
return entries;
|
|
60
|
+
} catch {
|
|
61
|
+
return void 0;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
realpath(path) {
|
|
65
|
+
if (virtual.has(path)) return path;
|
|
66
|
+
try {
|
|
67
|
+
return fs.realpathSync.native(path).replaceAll("\\", "/");
|
|
68
|
+
} catch {
|
|
69
|
+
return void 0;
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
writeFile(path, data, append) {
|
|
73
|
+
if (!isEngineConfig(path)) return `open ${path}: read-only file system`;
|
|
74
|
+
const bytes = new Uint8Array(data);
|
|
75
|
+
const previous = append ? virtual.get(path) : void 0;
|
|
76
|
+
if (previous) {
|
|
77
|
+
const joined = new Uint8Array(previous.length + bytes.length);
|
|
78
|
+
joined.set(previous);
|
|
79
|
+
joined.set(bytes, previous.length);
|
|
80
|
+
virtual.set(path, joined);
|
|
81
|
+
} else {
|
|
82
|
+
virtual.set(path, bytes);
|
|
83
|
+
}
|
|
84
|
+
return void 0;
|
|
85
|
+
},
|
|
86
|
+
remove(path) {
|
|
87
|
+
if (!virtual.delete(path)) return `remove ${path}: read-only file system`;
|
|
88
|
+
return void 0;
|
|
89
|
+
},
|
|
90
|
+
chtimes() {
|
|
91
|
+
return void 0;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
function caseInsensitive() {
|
|
96
|
+
const swapped = process.execPath.replace(/\w/g, (c) => c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase());
|
|
97
|
+
return swapped !== process.execPath && fs.existsSync(swapped);
|
|
98
|
+
}
|
|
99
|
+
function writeResult(result) {
|
|
100
|
+
if (typeof result === "string") return { error: result };
|
|
101
|
+
return new Uint8Array();
|
|
102
|
+
}
|
|
103
|
+
function fsCall(host, op, request2) {
|
|
104
|
+
const text2 = decoder.decode(request2);
|
|
105
|
+
switch (op) {
|
|
106
|
+
case OP_READ: {
|
|
107
|
+
const data = host.readFile(text2);
|
|
108
|
+
if (data === void 0) return void 0;
|
|
109
|
+
return typeof data === "string" ? encoder.encode(data) : data;
|
|
110
|
+
}
|
|
111
|
+
case OP_STAT: {
|
|
112
|
+
const stat = host.stat(text2);
|
|
113
|
+
if (!stat) return void 0;
|
|
114
|
+
const kind = stat.isDirectory ? "d" : stat.isFile === false ? "o" : "f";
|
|
115
|
+
return encoder.encode(`${kind} ${stat.size ?? 0} ${stat.mtimeNs ?? 0n}`);
|
|
116
|
+
}
|
|
117
|
+
case OP_READ_DIR: {
|
|
118
|
+
const entries = host.readDirectory(text2);
|
|
119
|
+
if (!entries) return void 0;
|
|
120
|
+
return encoder.encode(entries.map((e) => `${KIND_CHAR[e.kind] ?? "o"}${e.name}\0`).join(""));
|
|
121
|
+
}
|
|
122
|
+
case OP_REALPATH: {
|
|
123
|
+
const real = host.realpath(text2);
|
|
124
|
+
return real === void 0 ? void 0 : encoder.encode(real);
|
|
125
|
+
}
|
|
126
|
+
case OP_WRITE:
|
|
127
|
+
case OP_APPEND: {
|
|
128
|
+
const nul = request2.indexOf(0);
|
|
129
|
+
const path = decoder.decode(request2.subarray(0, nul));
|
|
130
|
+
return writeResult(host.writeFile(path, request2.subarray(nul + 1), op === OP_APPEND));
|
|
131
|
+
}
|
|
132
|
+
case OP_REMOVE:
|
|
133
|
+
return writeResult(host.remove(text2));
|
|
134
|
+
case OP_CHTIMES:
|
|
135
|
+
return writeResult(host.chtimes());
|
|
136
|
+
default:
|
|
137
|
+
return void 0;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function prepareRun(module, { host, stdout, stderr }) {
|
|
141
|
+
let memory;
|
|
142
|
+
let staged;
|
|
143
|
+
const u8 = () => new Uint8Array(memory.buffer);
|
|
144
|
+
const dv = () => new DataView(memory.buffer);
|
|
145
|
+
const sizes = (list, countPtr, sizePtr) => {
|
|
146
|
+
dv().setUint32(countPtr, list.length, true);
|
|
147
|
+
dv().setUint32(sizePtr, 0, true);
|
|
148
|
+
return SUCCESS;
|
|
149
|
+
};
|
|
150
|
+
const wasi = {
|
|
151
|
+
args_sizes_get: (countPtr, sizePtr) => sizes([], countPtr, sizePtr),
|
|
152
|
+
args_get: () => SUCCESS,
|
|
153
|
+
environ_sizes_get: (countPtr, sizePtr) => sizes([], countPtr, sizePtr),
|
|
154
|
+
environ_get: () => SUCCESS,
|
|
155
|
+
clock_time_get: (id, _precision, out) => {
|
|
156
|
+
const ms = id === 0 ? performance.timeOrigin + performance.now() : performance.now();
|
|
157
|
+
dv().setBigUint64(out, BigInt(Math.round(ms * 1e6)), true);
|
|
158
|
+
return SUCCESS;
|
|
159
|
+
},
|
|
160
|
+
clock_res_get: (_id, out) => {
|
|
161
|
+
dv().setBigUint64(out, 1000n, true);
|
|
162
|
+
return SUCCESS;
|
|
163
|
+
},
|
|
164
|
+
random_get: (buf, len) => {
|
|
165
|
+
for (let at = 0; at < len; at += 65536) {
|
|
166
|
+
crypto.getRandomValues(u8().subarray(buf + at, buf + Math.min(len, at + 65536)));
|
|
167
|
+
}
|
|
168
|
+
return SUCCESS;
|
|
169
|
+
},
|
|
170
|
+
fd_write: (fd, iovs, iovsLen, nwritten) => {
|
|
171
|
+
if (fd !== 1 && fd !== 2) return EBADF;
|
|
172
|
+
const view = dv();
|
|
173
|
+
let total = 0;
|
|
174
|
+
for (let i = 0; i < iovsLen; i++) {
|
|
175
|
+
const ptr = view.getUint32(iovs + i * 8, true);
|
|
176
|
+
const len = view.getUint32(iovs + i * 8 + 4, true);
|
|
177
|
+
const chunk = u8().slice(ptr, ptr + len);
|
|
178
|
+
(fd === 1 ? stdout : stderr)(chunk);
|
|
179
|
+
total += len;
|
|
180
|
+
}
|
|
181
|
+
view.setUint32(nwritten, total, true);
|
|
182
|
+
return SUCCESS;
|
|
183
|
+
},
|
|
184
|
+
fd_fdstat_get: (fd, out) => {
|
|
185
|
+
if (fd > 2) return EBADF;
|
|
186
|
+
u8().fill(0, out, out + 24);
|
|
187
|
+
return SUCCESS;
|
|
188
|
+
},
|
|
189
|
+
fd_prestat_get: () => EBADF,
|
|
190
|
+
proc_exit: (code) => {
|
|
191
|
+
throw new WasiExit(code);
|
|
192
|
+
},
|
|
193
|
+
sched_yield: () => SUCCESS,
|
|
194
|
+
poll_oneoff: (_in, _out, _n, nevents) => {
|
|
195
|
+
dv().setUint32(nevents, 0, true);
|
|
196
|
+
return SUCCESS;
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
const imports = { wasi_snapshot_preview1: {}, ts_host: {} };
|
|
200
|
+
for (const { module: name, name: field } of WebAssembly.Module.imports(module)) {
|
|
201
|
+
if (name === "wasi_snapshot_preview1") imports[name][field] = wasi[field] ?? (() => ENOSYS);
|
|
202
|
+
}
|
|
203
|
+
imports.ts_host.fs = (op, ptr, len) => {
|
|
204
|
+
const result = fsCall(host, op, u8().slice(ptr, ptr + len));
|
|
205
|
+
if (result === void 0) return -1;
|
|
206
|
+
if (result.error !== void 0) {
|
|
207
|
+
staged = encoder.encode(result.error);
|
|
208
|
+
return -2 - staged.length;
|
|
209
|
+
}
|
|
210
|
+
staged = result;
|
|
211
|
+
return staged.length;
|
|
212
|
+
};
|
|
213
|
+
imports.ts_host.fs_take = (ptr) => {
|
|
214
|
+
u8().set(staged, ptr);
|
|
215
|
+
staged = void 0;
|
|
216
|
+
};
|
|
217
|
+
let exports;
|
|
218
|
+
return {
|
|
219
|
+
imports,
|
|
220
|
+
/** Writes the request into `instance` and runs it; returns the module's status. */
|
|
221
|
+
run(instance, flags, request2) {
|
|
222
|
+
exports = instance.exports;
|
|
223
|
+
memory = exports.memory;
|
|
224
|
+
const bytes = encoder.encode(`${flags}\0${request2}`);
|
|
225
|
+
const at = exports.trust_input(bytes.length);
|
|
226
|
+
u8().set(bytes, at);
|
|
227
|
+
return exports.trust_run();
|
|
228
|
+
},
|
|
229
|
+
/** The reply of the last run as text. */
|
|
230
|
+
output() {
|
|
231
|
+
const ptr = exports.trust_output();
|
|
232
|
+
const len = exports.trust_output_len();
|
|
233
|
+
return decoder.decode(u8().subarray(ptr, ptr + len));
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
}
|
|
237
|
+
var { wasmPath, request } = workerData;
|
|
238
|
+
var stdoutChunks = [];
|
|
239
|
+
var stderrChunks = [];
|
|
240
|
+
var text = (chunks) => Buffer.concat(chunks).toString();
|
|
241
|
+
try {
|
|
242
|
+
const module = await WebAssembly.compile(fs.readFileSync(wasmPath));
|
|
243
|
+
const run = prepareRun(module, { host: hostFileSystem(), stdout: (chunk) => stdoutChunks.push(chunk), stderr: (chunk) => stderrChunks.push(chunk) });
|
|
244
|
+
const instance = new WebAssembly.Instance(module, run.imports);
|
|
245
|
+
const flags = caseInsensitive() ? FLAG_CASE_INSENSITIVE : 0;
|
|
246
|
+
let status;
|
|
247
|
+
try {
|
|
248
|
+
status = run.run(instance, flags, request);
|
|
249
|
+
} catch (thrown) {
|
|
250
|
+
if (!(thrown instanceof WasiExit)) throw thrown;
|
|
251
|
+
status = thrown.code;
|
|
252
|
+
}
|
|
253
|
+
parentPort.postMessage({ status, output: status === 0 ? run.output() : text(stderrChunks) || run.output(), stdout: text(stdoutChunks), stderr: text(stderrChunks) });
|
|
254
|
+
} catch (error) {
|
|
255
|
+
parentPort.postMessage({ status: -1, output: `${error instanceof Error ? error.message : String(error)}`, stdout: text(stdoutChunks), stderr: text(stderrChunks) });
|
|
256
|
+
}
|
|
257
|
+
//# sourceMappingURL=wasm-worker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/cli/wasm-worker.js"],"sourcesContent":["// The Wasm fallback of `trust check` (native-check.ts). It instantiates native/wasm,\n// serves module file reads, and posts the engine response back. Programs are constructed in memory.\n// A worker is used because the checker recurses deeply and a worker can have a large stack\n// (`stackSizeMb`); the main thread's is about 1 MB. Plain JavaScript with only Node built-ins, so the same\n// file runs from src/ (vitest) and from dist/.\n//\n// The WASI preview1 shim and the host file-system bridge are adapted from ts-rust's npm/wasm/core.js and\n// node-run.js (https://github.com/pingdotgg/ts-rust, MIT AND Apache-2.0); native/wasm/src/host.rs is the\n// module side of the bridge.\nimport * as fs from 'node:fs';\nimport { parentPort, workerData } from 'node:worker_threads';\n\nconst encoder = new TextEncoder();\nconst decoder = new TextDecoder();\n\n// native/wasm/src/lib.rs FLAG_* bits.\nconst FLAG_CASE_INSENSITIVE = 1;\n\n// WASI errno values.\nconst SUCCESS = 0;\nconst EBADF = 8;\nconst ENOSYS = 52;\n\n// native/wasm/src/host.rs `Op`.\nconst OP_READ = 0;\nconst OP_STAT = 1;\nconst OP_READ_DIR = 2;\nconst OP_REALPATH = 3;\nconst OP_WRITE = 4;\nconst OP_APPEND = 5;\nconst OP_REMOVE = 6;\nconst OP_CHTIMES = 7;\n\nconst KIND_CHAR = { file: 'f', directory: 'd', symlink: 'l', other: 'o' };\n\n/** Thrown by the WASI `proc_exit` import to end a run. */\nclass WasiExit extends Error {\n constructor(code) {\n super(`exit ${code}`);\n this.code = code;\n }\n}\n\n/** The engine writes exactly one kind of file: its per-group tsconfig (src/lib.rs `write_root_config`). */\nconst isEngineConfig = (path) => /\\/\\.trust-native-\\d+-\\d+\\.tsconfig\\.json$/.test(path);\n\n/**\n * The real file system through node:fs, read-only, with the engine's temporary tsconfigs held in memory:\n * the module \"writes\" them, reads them back, and \"removes\" them without touching the disk.\n */\nfunction hostFileSystem() {\n const virtual = new Map(Object.entries(JSON.parse(workerData.request).virtualFiles ?? {}).map(([path, code]) => [path, encoder.encode(code)]));\n const kind = (entry) => (entry.isDirectory() ? 'directory' : entry.isFile() ? 'file' : entry.isSymbolicLink() ? 'symlink' : 'other');\n return {\n readFile(path) {\n const held = virtual.get(path);\n if (held) return held;\n try {\n return fs.readFileSync(path);\n } catch {\n return undefined;\n }\n },\n stat(path) {\n const held = virtual.get(path);\n if (held) return { isDirectory: false, isFile: true, size: held.length, mtimeNs: 0n };\n try {\n const stat = fs.statSync(path, { bigint: true });\n return { isDirectory: stat.isDirectory(), isFile: stat.isFile(), size: Number(stat.size), mtimeNs: stat.mtimeNs };\n } catch {\n return undefined;\n }\n },\n readDirectory(path) {\n try {\n const entries = fs.readdirSync(path, { withFileTypes: true }).map((entry) => ({ name: entry.name, kind: kind(entry) }));\n const prefix = path.replace(/\\/$/, '') + '/';\n for (const file of virtual.keys()) {\n if (!file.startsWith(prefix)) continue;\n const rest = file.slice(prefix.length);\n const name = rest.split('/')[0];\n if (!entries.some(entry => entry.name === name)) entries.push({ name, kind: rest.includes('/') ? 'directory' : 'file' });\n }\n return entries;\n } catch {\n return undefined;\n }\n },\n realpath(path) {\n if (virtual.has(path)) return path;\n try {\n return fs.realpathSync.native(path).replaceAll('\\\\', '/');\n } catch {\n return undefined;\n }\n },\n writeFile(path, data, append) {\n if (!isEngineConfig(path)) return `open ${path}: read-only file system`;\n // A copy: `data` is a view of the module's memory, which grows (and detaches the view) as it runs.\n const bytes = new Uint8Array(data);\n const previous = append ? virtual.get(path) : undefined;\n if (previous) {\n const joined = new Uint8Array(previous.length + bytes.length);\n joined.set(previous);\n joined.set(bytes, previous.length);\n virtual.set(path, joined);\n } else {\n virtual.set(path, bytes);\n }\n return undefined;\n },\n remove(path) {\n if (!virtual.delete(path)) return `remove ${path}: read-only file system`;\n return undefined;\n },\n chtimes() {\n return undefined;\n },\n };\n}\n\n/** Go's osvfs check: the file system ignores case when the executable is also found with its case swapped. */\nfunction caseInsensitive() {\n const swapped = process.execPath.replace(/\\w/g, (c) => (c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase()));\n return swapped !== process.execPath && fs.existsSync(swapped);\n}\n\n/** The result of a host write method: undefined when it worked, or a string with the error text. */\nfunction writeResult(result) {\n if (typeof result === 'string') return { error: result };\n return new Uint8Array();\n}\n\n/** Runs one host file operation of host.rs on `host`: the result bytes, undefined on failure, or `{ error }`. */\nfunction fsCall(host, op, request) {\n const text = decoder.decode(request);\n switch (op) {\n case OP_READ: {\n const data = host.readFile(text);\n if (data === undefined) return undefined;\n return typeof data === 'string' ? encoder.encode(data) : data;\n }\n case OP_STAT: {\n const stat = host.stat(text);\n if (!stat) return undefined;\n const kind = stat.isDirectory ? 'd' : stat.isFile === false ? 'o' : 'f';\n return encoder.encode(`${kind} ${stat.size ?? 0} ${stat.mtimeNs ?? 0n}`);\n }\n case OP_READ_DIR: {\n const entries = host.readDirectory(text);\n if (!entries) return undefined;\n return encoder.encode(entries.map((e) => `${KIND_CHAR[e.kind] ?? 'o'}${e.name}\\0`).join(''));\n }\n case OP_REALPATH: {\n const real = host.realpath(text);\n return real === undefined ? undefined : encoder.encode(real);\n }\n case OP_WRITE:\n case OP_APPEND: {\n const nul = request.indexOf(0);\n const path = decoder.decode(request.subarray(0, nul));\n return writeResult(host.writeFile(path, request.subarray(nul + 1), op === OP_APPEND));\n }\n case OP_REMOVE:\n return writeResult(host.remove(text));\n case OP_CHTIMES:\n return writeResult(host.chtimes());\n default:\n return undefined;\n }\n}\n\n/** The imports of one run and the calls into the instance. */\nfunction prepareRun(module, { host, stdout, stderr }) {\n let memory;\n let staged;\n const u8 = () => new Uint8Array(memory.buffer);\n const dv = () => new DataView(memory.buffer);\n const sizes = (list, countPtr, sizePtr) => {\n dv().setUint32(countPtr, list.length, true);\n dv().setUint32(sizePtr, 0, true);\n return SUCCESS;\n };\n const wasi = {\n args_sizes_get: (countPtr, sizePtr) => sizes([], countPtr, sizePtr),\n args_get: () => SUCCESS,\n environ_sizes_get: (countPtr, sizePtr) => sizes([], countPtr, sizePtr),\n environ_get: () => SUCCESS,\n clock_time_get: (id, _precision, out) => {\n const ms = id === 0 ? performance.timeOrigin + performance.now() : performance.now();\n dv().setBigUint64(out, BigInt(Math.round(ms * 1e6)), true);\n return SUCCESS;\n },\n clock_res_get: (_id, out) => {\n dv().setBigUint64(out, 1000n, true);\n return SUCCESS;\n },\n random_get: (buf, len) => {\n for (let at = 0; at < len; at += 65536) {\n crypto.getRandomValues(u8().subarray(buf + at, buf + Math.min(len, at + 65536)));\n }\n return SUCCESS;\n },\n fd_write: (fd, iovs, iovsLen, nwritten) => {\n if (fd !== 1 && fd !== 2) return EBADF;\n const view = dv();\n let total = 0;\n for (let i = 0; i < iovsLen; i++) {\n const ptr = view.getUint32(iovs + i * 8, true);\n const len = view.getUint32(iovs + i * 8 + 4, true);\n const chunk = u8().slice(ptr, ptr + len);\n (fd === 1 ? stdout : stderr)(chunk);\n total += len;\n }\n view.setUint32(nwritten, total, true);\n return SUCCESS;\n },\n fd_fdstat_get: (fd, out) => {\n if (fd > 2) return EBADF;\n u8().fill(0, out, out + 24);\n return SUCCESS;\n },\n fd_prestat_get: () => EBADF,\n proc_exit: (code) => {\n throw new WasiExit(code);\n },\n sched_yield: () => SUCCESS,\n poll_oneoff: (_in, _out, _n, nevents) => {\n dv().setUint32(nevents, 0, true);\n return SUCCESS;\n },\n };\n const imports = { wasi_snapshot_preview1: {}, ts_host: {} };\n for (const { module: name, name: field } of WebAssembly.Module.imports(module)) {\n if (name === 'wasi_snapshot_preview1') imports[name][field] = wasi[field] ?? (() => ENOSYS);\n }\n imports.ts_host.fs = (op, ptr, len) => {\n const result = fsCall(host, op, u8().slice(ptr, ptr + len));\n if (result === undefined) return -1;\n if (result.error !== undefined) {\n staged = encoder.encode(result.error);\n return -2 - staged.length;\n }\n staged = result;\n return staged.length;\n };\n imports.ts_host.fs_take = (ptr) => {\n u8().set(staged, ptr);\n staged = undefined;\n };\n let exports;\n return {\n imports,\n /** Writes the request into `instance` and runs it; returns the module's status. */\n run(instance, flags, request) {\n exports = instance.exports;\n memory = exports.memory;\n const bytes = encoder.encode(`${flags}\\0${request}`);\n // The view comes after the call: `trust_input` grows the memory for a large request, which\n // detaches every earlier view of it.\n const at = exports.trust_input(bytes.length);\n u8().set(bytes, at);\n return exports.trust_run();\n },\n /** The reply of the last run as text. */\n output() {\n const ptr = exports.trust_output();\n const len = exports.trust_output_len();\n return decoder.decode(u8().subarray(ptr, ptr + len));\n },\n };\n}\n\nconst { wasmPath, request } = workerData;\nconst stdoutChunks = [];\nconst stderrChunks = [];\nconst text = (chunks) => Buffer.concat(chunks).toString();\ntry {\n const module = await WebAssembly.compile(fs.readFileSync(wasmPath));\n const run = prepareRun(module, { host: hostFileSystem(), stdout: (chunk) => stdoutChunks.push(chunk), stderr: (chunk) => stderrChunks.push(chunk) });\n const instance = new WebAssembly.Instance(module, run.imports);\n const flags = caseInsensitive() ? FLAG_CASE_INSENSITIVE : 0;\n let status;\n try {\n status = run.run(instance, flags, request);\n } catch (thrown) {\n if (!(thrown instanceof WasiExit)) throw thrown;\n status = thrown.code;\n }\n parentPort.postMessage({ status, output: status === 0 ? run.output() : text(stderrChunks) || run.output(), stdout: text(stdoutChunks), stderr: text(stderrChunks) });\n} catch (error) {\n parentPort.postMessage({ status: -1, output: `${error instanceof Error ? error.message : String(error)}`, stdout: text(stdoutChunks), stderr: text(stderrChunks) });\n}\n"],"mappings":";AASA,YAAY,QAAQ;AACpB,SAAS,YAAY,kBAAkB;AAEvC,IAAM,UAAU,IAAI,YAAY;AAChC,IAAM,UAAU,IAAI,YAAY;AAGhC,IAAM,wBAAwB;AAG9B,IAAM,UAAU;AAChB,IAAM,QAAQ;AACd,IAAM,SAAS;AAGf,IAAM,UAAU;AAChB,IAAM,UAAU;AAChB,IAAM,cAAc;AACpB,IAAM,cAAc;AACpB,IAAM,WAAW;AACjB,IAAM,YAAY;AAClB,IAAM,YAAY;AAClB,IAAM,aAAa;AAEnB,IAAM,YAAY,EAAE,MAAM,KAAK,WAAW,KAAK,SAAS,KAAK,OAAO,IAAI;AAGxE,IAAM,WAAN,cAAuB,MAAM;AAAA,EAC3B,YAAY,MAAM;AAChB,UAAM,QAAQ,IAAI,EAAE;AACpB,SAAK,OAAO;AAAA,EACd;AACF;AAGA,IAAM,iBAAiB,CAAC,SAAS,4CAA4C,KAAK,IAAI;AAMtF,SAAS,iBAAiB;AACxB,QAAM,UAAU,IAAI,IAAI,OAAO,QAAQ,KAAK,MAAM,WAAW,OAAO,EAAE,gBAAgB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,QAAQ,OAAO,IAAI,CAAC,CAAC,CAAC;AAC7I,QAAM,OAAO,CAAC,UAAW,MAAM,YAAY,IAAI,cAAc,MAAM,OAA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;AACrK,SAAS,OAAO;AACd,aAAW,YAAY,EAAE,QAAQ,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,OAAO,KAAK,CAAC,IAAI,QAAQ,KAAK,YAAY,GAAG,QAAQ,KAAK,YAAY,EAAE,CAAC;AACpK;","names":["request","text"]}
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as TypeScript, a as TsconfigMapping, Z as ZoneGroup, F as Finding } from '../baseline-
|
|
2
|
-
export { B as BaselineCounts, b as BaselineDelta, c as BaselineFinding, d as BaselineScope, e as LineDirective, W as WHOLE_BASELINE, f as Zone, g as Zones, h as compareToBaseline, i as countFindings, j as describeBaselineDelta, k as directiveDirectlyAbove, l as directiveReason, m as groupMatches, n as isNamedDirective, o as lineDirectivesIn, p as loadTypeScript, q as matchesPatterns, r as nearestPackageName, s as nodeBelow, t as normalizePattern, u as parseBaseline, v as readBaseline, w as realpathOrSelf, x as relativeInside, y as serializeBaseline, z as toPosix, A as updateBaseline } from '../baseline-
|
|
1
|
+
import { T as TypeScript, a as TsconfigMapping, Z as ZoneGroup, F as Finding } from '../baseline-Bkav9mS0.js';
|
|
2
|
+
export { B as BaselineCounts, b as BaselineDelta, c as BaselineFinding, d as BaselineScope, e as LineDirective, W as WHOLE_BASELINE, f as Zone, g as Zones, h as compareToBaseline, i as countFindings, j as describeBaselineDelta, k as directiveDirectlyAbove, l as directiveReason, m as groupMatches, n as isNamedDirective, o as lineDirectivesIn, p as loadTypeScript, q as matchesPatterns, r as nearestPackageName, s as nodeBelow, t as normalizePattern, u as parseBaseline, v as readBaseline, w as realpathOrSelf, x as relativeInside, y as serializeBaseline, z as toPosix, A as updateBaseline } from '../baseline-Bkav9mS0.js';
|
|
3
3
|
import * as TS from 'typescript';
|
|
4
4
|
|
|
5
5
|
/** Absolute paths, sorted and deduplicated: named files as-is, directories walked for .ts/.tsx. */
|
|
@@ -118,7 +118,9 @@ declare function emptyToolConfig(rootDir: string): ToolConfig;
|
|
|
118
118
|
declare function loadToolConfig(configFile: string, options: LoadToolConfigOptions): ToolConfigLoad;
|
|
119
119
|
|
|
120
120
|
/** What a printed finding needs. */
|
|
121
|
-
type ReportFinding = Pick<Finding, 'file' | 'line' | 'column' | 'rule' | 'message'
|
|
121
|
+
type ReportFinding = Pick<Finding, 'file' | 'line' | 'column' | 'rule' | 'message'> & {
|
|
122
|
+
readonly severity?: 'error' | 'warning';
|
|
123
|
+
};
|
|
122
124
|
/** Sort order of printed findings: file, then line, then column. */
|
|
123
125
|
declare function compareFindings(a: ReportFinding, b: ReportFinding): number;
|
|
124
126
|
/** `file:line:col rule message`. */
|
package/dist/core/index.js
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compareFindings,
|
|
3
|
-
createPrograms,
|
|
4
3
|
forEachSourceFile,
|
|
5
4
|
formatFinding,
|
|
6
5
|
formatWalkFailure,
|
|
7
|
-
groupByTsconfig,
|
|
8
|
-
readTsconfig,
|
|
9
6
|
relativeTo,
|
|
10
|
-
resolveFiles
|
|
11
|
-
|
|
12
|
-
} from "../chunk-OSSITT3R.js";
|
|
7
|
+
resolveFiles
|
|
8
|
+
} from "../chunk-XXLWC5DB.js";
|
|
13
9
|
import {
|
|
14
10
|
WHOLE_BASELINE,
|
|
15
11
|
Zones,
|
|
16
12
|
compareToBaseline,
|
|
17
13
|
countFindings,
|
|
14
|
+
createPrograms,
|
|
18
15
|
describeBaselineDelta,
|
|
19
16
|
directiveDirectlyAbove,
|
|
20
17
|
directiveReason,
|
|
18
|
+
groupByTsconfig,
|
|
21
19
|
groupMatches,
|
|
22
20
|
isNamedDirective,
|
|
23
21
|
lineDirectivesIn,
|
|
@@ -28,13 +26,15 @@ import {
|
|
|
28
26
|
normalizePattern,
|
|
29
27
|
parseBaseline,
|
|
30
28
|
readBaseline,
|
|
29
|
+
readTsconfig,
|
|
31
30
|
readZoneSettings,
|
|
32
31
|
realpathOrSelf,
|
|
33
32
|
relativeInside,
|
|
34
33
|
serializeBaseline,
|
|
34
|
+
sourceFileOf,
|
|
35
35
|
toPosix,
|
|
36
36
|
updateBaseline
|
|
37
|
-
} from "../chunk-
|
|
37
|
+
} from "../chunk-UG6D3V4M.js";
|
|
38
38
|
|
|
39
39
|
// src/core/tool-config.ts
|
|
40
40
|
import { existsSync, readFileSync } from "fs";
|
package/dist/eslint/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as eslint from 'eslint';
|
|
2
2
|
import { Linter, ESLint } from 'eslint';
|
|
3
|
-
import { g as Zones, O as OriginResolver, C as TrustRuleSettings, T as TypeScript, D as TrustConfig, E as OriginInfo, G as CatchProblem } from '../baseline-
|
|
4
|
-
export { H as ACCEPT_DIRECTIVE, I as ACCEPT_DIRECTIVE_MESSAGES, B as BaselineCounts, b as BaselineDelta, d as BaselineScope, J as CATCH_ORIGIN, K as DEFAULT_RULE_SETTINGS, L as DIRECTIVE_ORIGIN, M as DROPPED_RESULT_MESSAGES, N as DROPPED_RESULT_RULE, P as DroppedResultOrigin, F as Finding, Q as LoadTrustConfigOptions, R as OptInRule, S as REDUNDANT_GUARD_MESSAGES, U as REDUNDANT_GUARD_ORIGIN, V as REDUNDANT_GUARD_RULE, X as RuleSwitch, Y as THROW_MESSAGES, _ as THROW_RULE, $ as TYPE_CLAIM_KINDS, a0 as TYPE_CLAIM_MESSAGES, a1 as TYPE_CLAIM_RULE, a2 as TrustConfigError, a3 as TrustEntry, a4 as TrustLevel, a as TsconfigMapping, a5 as TypeClaimOrigin, a6 as UNANALYZABLE_ORIGIN, a7 as UNTRUSTED_CALL_MESSAGES, a8 as UNTRUSTED_CALL_RULE, a9 as UNTRUSTED_VALUE_MESSAGES, aa as UNTRUSTED_VALUE_RULE, ab as UntrustedCallbacks, ac as UntrustedEntry, ad as VALIDATOR_DIRECTIVE, W as WHOLE_BASELINE, f as Zone, Z as ZoneGroup, h as compareToBaseline, i as countFindings, ae as effectiveTrustList, af as effectiveTypeTrustList, ag as isInsideValidator, ah as isMarkedValidator, ai as isRuleEnabled, aj as loadTrustConfig, ak as normalizeOrigin, u as parseBaseline, y as serializeBaseline, A as updateBaseline } from '../baseline-
|
|
3
|
+
import { g as Zones, O as OriginResolver, C as TrustRuleSettings, T as TypeScript, D as TrustConfig, E as OriginInfo, G as CatchProblem } from '../baseline-Bkav9mS0.js';
|
|
4
|
+
export { H as ACCEPT_DIRECTIVE, I as ACCEPT_DIRECTIVE_MESSAGES, B as BaselineCounts, b as BaselineDelta, d as BaselineScope, J as CATCH_ORIGIN, K as DEFAULT_RULE_SETTINGS, L as DIRECTIVE_ORIGIN, M as DROPPED_RESULT_MESSAGES, N as DROPPED_RESULT_RULE, P as DroppedResultOrigin, F as Finding, Q as LoadTrustConfigOptions, R as OptInRule, S as REDUNDANT_GUARD_MESSAGES, U as REDUNDANT_GUARD_ORIGIN, V as REDUNDANT_GUARD_RULE, X as RuleSwitch, Y as THROW_MESSAGES, _ as THROW_RULE, $ as TYPE_CLAIM_KINDS, a0 as TYPE_CLAIM_MESSAGES, a1 as TYPE_CLAIM_RULE, a2 as TrustConfigError, a3 as TrustEntry, a4 as TrustLevel, a as TsconfigMapping, a5 as TypeClaimOrigin, a6 as UNANALYZABLE_ORIGIN, a7 as UNTRUSTED_CALL_MESSAGES, a8 as UNTRUSTED_CALL_RULE, a9 as UNTRUSTED_VALUE_MESSAGES, aa as UNTRUSTED_VALUE_RULE, ab as UntrustedCallbacks, ac as UntrustedEntry, ad as VALIDATOR_DIRECTIVE, W as WHOLE_BASELINE, f as Zone, Z as ZoneGroup, h as compareToBaseline, i as countFindings, ae as effectiveTrustList, af as effectiveTypeTrustList, ag as isInsideValidator, ah as isMarkedValidator, ai as isRuleEnabled, aj as loadTrustConfig, ak as normalizeOrigin, u as parseBaseline, y as serializeBaseline, A as updateBaseline } from '../baseline-Bkav9mS0.js';
|
|
5
5
|
import * as TS from 'typescript';
|
|
6
6
|
|
|
7
7
|
interface PresetDefinition {
|
|
@@ -100,6 +100,10 @@ declare class TrustPolicy {
|
|
|
100
100
|
/** Whether the types `declaration` states are trusted (see TypeVerdict). */
|
|
101
101
|
typeVerdictOf(declaration: TS.Node): TypeVerdict;
|
|
102
102
|
classify(node: TS.CallExpression | TS.NewExpression): Verdict;
|
|
103
|
+
/** Pick by origin, never compiler-internal union order (JavaScript compares UTF-16 units). */
|
|
104
|
+
choose_origin_declaration(candidates: readonly TS.Declaration[]): TS.Declaration | undefined;
|
|
105
|
+
/** Equal-origin overloads keep the existing declaration; distinct origins select the minimum. */
|
|
106
|
+
symbol_declaration(symbol: TS.Symbol | undefined, fallback?: TS.Declaration | undefined): TS.Declaration | undefined;
|
|
103
107
|
calleeDeclaration(node: TS.CallExpression | TS.NewExpression): {
|
|
104
108
|
declaration: TS.Node;
|
|
105
109
|
signature?: TS.Signature;
|
package/dist/eslint/index.js
CHANGED
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
untrustedValueData,
|
|
27
27
|
untrustedValueMessageId,
|
|
28
28
|
untrustedValuesIn
|
|
29
|
-
} from "../chunk-
|
|
29
|
+
} from "../chunk-7PY2Q6OX.js";
|
|
30
30
|
import {
|
|
31
31
|
ACCEPT_DIRECTIVE,
|
|
32
32
|
ACCEPT_DIRECTIVE_MESSAGES,
|
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
parseBaseline,
|
|
69
69
|
serializeBaseline,
|
|
70
70
|
updateBaseline
|
|
71
|
-
} from "../chunk-
|
|
71
|
+
} from "../chunk-UG6D3V4M.js";
|
|
72
72
|
|
|
73
73
|
// src/eslint/rule-setup.ts
|
|
74
74
|
import { resolve } from "path";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2019 Justin Ridgewell <jridgewell@google.com>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2024 Justin Ridgewell <justin@ridgewell.name>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright 2024 Justin Ridgewell <justin@ridgewell.name>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"name": "@jridgewell/resolve-uri",
|
|
4
|
+
"version": "3.1.2",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": "https://github.com/jridgewell/resolve-uri",
|
|
7
|
+
"licenseTexts": [
|
|
8
|
+
"LICENSE"
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"name": "@jridgewell/sourcemap-codec",
|
|
13
|
+
"version": "1.6.0",
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"repository": "git+https://github.com/jridgewell/sourcemaps.git",
|
|
16
|
+
"licenseTexts": [
|
|
17
|
+
"LICENSE"
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"name": "@jridgewell/trace-mapping",
|
|
22
|
+
"version": "0.3.31",
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"repository": "git+https://github.com/jridgewell/sourcemaps.git",
|
|
25
|
+
"licenseTexts": [
|
|
26
|
+
"LICENSE"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"name": "balanced-match",
|
|
31
|
+
"version": "4.0.4",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": "git://github.com/juliangruber/balanced-match.git",
|
|
34
|
+
"licenseTexts": [
|
|
35
|
+
"LICENSE.md"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"name": "brace-expansion",
|
|
40
|
+
"version": "5.0.12",
|
|
41
|
+
"license": "MIT",
|
|
42
|
+
"repository": "git+https://github.com/juliangruber/brace-expansion.git",
|
|
43
|
+
"licenseTexts": [
|
|
44
|
+
"LICENSE"
|
|
45
|
+
]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "dedent-js",
|
|
49
|
+
"version": "1.0.1",
|
|
50
|
+
"license": "MIT",
|
|
51
|
+
"repository": "https://github.com/MartinKolarik/dedent-js.git",
|
|
52
|
+
"licenseTexts": [
|
|
53
|
+
"LICENSE"
|
|
54
|
+
]
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"name": "minimatch",
|
|
58
|
+
"version": "10.2.6",
|
|
59
|
+
"license": "BlueOak-1.0.0",
|
|
60
|
+
"repository": "git@github.com:isaacs/minimatch",
|
|
61
|
+
"licenseTexts": [
|
|
62
|
+
"LICENSE.md"
|
|
63
|
+
]
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"name": "scule",
|
|
67
|
+
"version": "1.3.0",
|
|
68
|
+
"license": "MIT",
|
|
69
|
+
"repository": "unjs/scule",
|
|
70
|
+
"licenseTexts": [
|
|
71
|
+
"LICENSE"
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"name": "svelte2tsx",
|
|
76
|
+
"version": "0.7.61",
|
|
77
|
+
"license": "MIT",
|
|
78
|
+
"repository": "https://github.com/sveltejs/language-tools/tree/master/packages/svelte2tsx",
|
|
79
|
+
"licenseTexts": [
|
|
80
|
+
"LICENSE"
|
|
81
|
+
]
|
|
82
|
+
}
|
|
83
|
+
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
(MIT)
|
|
2
|
+
|
|
3
|
+
Original code Copyright Julian Gruber <julian@juliangruber.com>
|
|
4
|
+
|
|
5
|
+
Port to TypeScript Copyright Isaac Z. Schlueter <i@izs.me>
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
8
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
9
|
+
the Software without restriction, including without limitation the rights to
|
|
10
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
11
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
12
|
+
so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright Julian Gruber <julian@juliangruber.com>
|
|
4
|
+
|
|
5
|
+
TypeScript port Copyright Isaac Z. Schlueter <i@izs.me>
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2015 Martin Kolárik
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
THE SOFTWARE.
|