@ttsc/wasm 0.13.0 → 0.14.0-dev.20260528
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 +61 -1
- package/dist/ttsc.wasm +0 -0
- package/host/api.go +5 -4
- package/host/doc.go +7 -5
- package/host/fountain.go +505 -0
- package/host/host.go +64 -10
- package/host/plugin.go +6 -5
- package/lib/src/MemFSError.d.ts +15 -0
- package/lib/src/MemFSError.js +47 -0
- package/lib/src/MemFSError.js.map +1 -0
- package/lib/src/bootTtsc.d.ts +21 -0
- package/lib/src/bootTtsc.js +180 -0
- package/lib/src/bootTtsc.js.map +1 -0
- package/lib/src/createMemFS.d.ts +11 -0
- package/lib/src/{MemFS.js → createMemFS.js} +26 -61
- package/lib/src/createMemFS.js.map +1 -0
- package/lib/src/index.d.ts +5 -6
- package/lib/src/index.js +19 -8
- package/lib/src/index.js.map +1 -1
- package/lib/src/parseResult.d.ts +9 -0
- package/lib/src/parseResult.js +21 -0
- package/lib/src/parseResult.js.map +1 -0
- package/lib/src/structures/IBootResult.d.ts +9 -0
- package/lib/src/structures/IBootResult.js +3 -0
- package/lib/src/structures/IBootResult.js.map +1 -0
- package/lib/src/structures/IBootTtscOptions.d.ts +21 -0
- package/lib/src/structures/IBootTtscOptions.js +3 -0
- package/lib/src/structures/IBootTtscOptions.js.map +1 -0
- package/lib/src/structures/IFileStats.d.ts +23 -0
- package/lib/src/structures/IFileStats.js +3 -0
- package/lib/src/structures/IFileStats.js.map +1 -0
- package/lib/src/structures/IMemFSHost.d.ts +21 -0
- package/lib/src/structures/IMemFSHost.js +3 -0
- package/lib/src/structures/IMemFSHost.js.map +1 -0
- package/lib/src/structures/ITtscApi.d.ts +86 -0
- package/lib/src/structures/ITtscApi.js +3 -0
- package/lib/src/structures/ITtscApi.js.map +1 -0
- package/lib/src/structures/ITtscBuildOpts.d.ts +7 -0
- package/lib/src/structures/ITtscBuildOpts.js +3 -0
- package/lib/src/structures/ITtscBuildOpts.js.map +1 -0
- package/lib/src/structures/ITtscCompileResult.d.ts +11 -0
- package/lib/src/structures/ITtscCompileResult.js +3 -0
- package/lib/src/structures/ITtscCompileResult.js.map +1 -0
- package/lib/src/structures/ITtscDiagnostic.d.ts +14 -0
- package/lib/src/structures/ITtscDiagnostic.js +3 -0
- package/lib/src/structures/ITtscDiagnostic.js.map +1 -0
- package/lib/src/structures/ITtscFileQuery.d.ts +6 -0
- package/lib/src/structures/ITtscFileQuery.js +3 -0
- package/lib/src/structures/ITtscFileQuery.js.map +1 -0
- package/lib/src/structures/ITtscFountainDiagnosticsResult.d.ts +5 -0
- package/lib/src/structures/ITtscFountainDiagnosticsResult.js +3 -0
- package/lib/src/structures/ITtscFountainDiagnosticsResult.js.map +1 -0
- package/lib/src/structures/ITtscNodeAtPositionResult.d.ts +6 -0
- package/lib/src/structures/ITtscNodeAtPositionResult.js +3 -0
- package/lib/src/structures/ITtscNodeAtPositionResult.js.map +1 -0
- package/lib/src/structures/ITtscNodeInfo.d.ts +13 -0
- package/lib/src/structures/ITtscNodeInfo.js +3 -0
- package/lib/src/structures/ITtscNodeInfo.js.map +1 -0
- package/lib/src/structures/ITtscPluginOpts.d.ts +13 -0
- package/lib/src/structures/ITtscPluginOpts.js +3 -0
- package/lib/src/structures/ITtscPluginOpts.js.map +1 -0
- package/lib/src/structures/ITtscPositionQuery.d.ts +9 -0
- package/lib/src/structures/ITtscPositionQuery.js +3 -0
- package/lib/src/structures/ITtscPositionQuery.js.map +1 -0
- package/lib/src/structures/ITtscReleaseSnapshotResult.d.ts +5 -0
- package/lib/src/structures/ITtscReleaseSnapshotResult.js +3 -0
- package/lib/src/structures/ITtscReleaseSnapshotResult.js.map +1 -0
- package/lib/src/structures/ITtscResult.d.ts +15 -0
- package/lib/src/structures/ITtscResult.js +3 -0
- package/lib/src/structures/ITtscResult.js.map +1 -0
- package/lib/src/structures/ITtscSnapshotHandle.d.ts +5 -0
- package/lib/src/structures/ITtscSnapshotHandle.js +3 -0
- package/lib/src/structures/ITtscSnapshotHandle.js.map +1 -0
- package/lib/src/structures/ITtscSnapshotResult.d.ts +5 -0
- package/lib/src/structures/ITtscSnapshotResult.js +3 -0
- package/lib/src/structures/ITtscSnapshotResult.js.map +1 -0
- package/lib/src/structures/ITtscSnapshotsResult.d.ts +4 -0
- package/lib/src/structures/ITtscSnapshotsResult.js +3 -0
- package/lib/src/structures/ITtscSnapshotsResult.js.map +1 -0
- package/lib/src/structures/ITtscSourceFileTextResult.d.ts +5 -0
- package/lib/src/structures/ITtscSourceFileTextResult.js +3 -0
- package/lib/src/structures/ITtscSourceFileTextResult.js.map +1 -0
- package/lib/src/structures/ITtscSourceFilesResult.d.ts +5 -0
- package/lib/src/structures/ITtscSourceFilesResult.js +3 -0
- package/lib/src/structures/ITtscSourceFilesResult.js.map +1 -0
- package/lib/src/structures/ITtscSymbolAtPositionResult.d.ts +6 -0
- package/lib/src/structures/ITtscSymbolAtPositionResult.js +3 -0
- package/lib/src/structures/ITtscSymbolAtPositionResult.js.map +1 -0
- package/lib/src/structures/ITtscSymbolDeclaration.d.ts +7 -0
- package/lib/src/structures/ITtscSymbolDeclaration.js +3 -0
- package/lib/src/structures/ITtscSymbolDeclaration.js.map +1 -0
- package/lib/src/structures/ITtscSymbolInfo.d.ts +14 -0
- package/lib/src/structures/ITtscSymbolInfo.js +3 -0
- package/lib/src/structures/ITtscSymbolInfo.js.map +1 -0
- package/lib/src/structures/ITtscTransformResult.d.ts +12 -0
- package/lib/src/structures/ITtscTransformResult.js +3 -0
- package/lib/src/structures/ITtscTransformResult.js.map +1 -0
- package/lib/src/structures/ITtscTypeAtPositionResult.d.ts +6 -0
- package/lib/src/structures/ITtscTypeAtPositionResult.js +3 -0
- package/lib/src/structures/ITtscTypeAtPositionResult.js.map +1 -0
- package/lib/src/structures/ITtscTypeInfo.d.ts +7 -0
- package/lib/src/structures/ITtscTypeInfo.js +3 -0
- package/lib/src/structures/ITtscTypeInfo.js.map +1 -0
- package/lib/src/structures/ITtscVersion.d.ts +9 -0
- package/lib/src/structures/ITtscVersion.js +3 -0
- package/lib/src/structures/ITtscVersion.js.map +1 -0
- package/lib/src/{MemFS.d.ts → structures/IWasmExecFS.d.ts} +7 -66
- package/lib/src/structures/IWasmExecFS.js +3 -0
- package/lib/src/structures/IWasmExecFS.js.map +1 -0
- package/lib/src/structures/index.d.ts +29 -0
- package/lib/src/structures/index.js +46 -0
- package/lib/src/structures/index.js.map +1 -0
- package/package.json +2 -2
- package/shim-vendor/shim/ast/lint.go +7 -1
- package/shim-vendor/shim/checker/shim.go +3 -0
- package/shim-vendor/shim/core/shim.go +11 -0
- package/src/MemFSError.ts +43 -0
- package/src/bootTtsc.ts +214 -0
- package/src/{MemFS.ts → createMemFS.ts} +13 -231
- package/src/index.ts +5 -17
- package/src/parseResult.ts +17 -0
- package/src/structures/IBootResult.ts +10 -0
- package/src/structures/IBootTtscOptions.ts +22 -0
- package/src/structures/IFileStats.ts +23 -0
- package/src/structures/IMemFSHost.ts +18 -0
- package/src/structures/ITtscApi.ts +101 -0
- package/src/structures/ITtscBuildOpts.ts +7 -0
- package/src/structures/ITtscCompileResult.ts +12 -0
- package/src/structures/ITtscDiagnostic.ts +14 -0
- package/src/structures/ITtscFileQuery.ts +7 -0
- package/src/structures/ITtscFountainDiagnosticsResult.ts +6 -0
- package/src/structures/ITtscNodeAtPositionResult.ts +7 -0
- package/src/structures/ITtscNodeInfo.ts +13 -0
- package/src/structures/ITtscPluginOpts.ts +13 -0
- package/src/structures/ITtscPositionQuery.ts +10 -0
- package/src/structures/ITtscReleaseSnapshotResult.ts +5 -0
- package/src/structures/ITtscResult.ts +15 -0
- package/src/structures/ITtscSnapshotHandle.ts +5 -0
- package/src/structures/ITtscSnapshotResult.ts +5 -0
- package/src/structures/ITtscSnapshotsResult.ts +4 -0
- package/src/structures/ITtscSourceFileTextResult.ts +5 -0
- package/src/structures/ITtscSourceFilesResult.ts +5 -0
- package/src/structures/ITtscSymbolAtPositionResult.ts +7 -0
- package/src/structures/ITtscSymbolDeclaration.ts +7 -0
- package/src/structures/ITtscSymbolInfo.ts +15 -0
- package/src/structures/ITtscTransformResult.ts +13 -0
- package/src/structures/ITtscTypeAtPositionResult.ts +7 -0
- package/src/structures/ITtscTypeInfo.ts +7 -0
- package/src/structures/ITtscVersion.ts +9 -0
- package/src/structures/IWasmExecFS.ts +150 -0
- package/src/structures/index.ts +29 -0
- package/lib/src/MemFS.js.map +0 -1
- package/lib/src/api.d.ts +0 -120
- package/lib/src/api.js +0 -23
- package/lib/src/api.js.map +0 -1
- package/lib/src/instantiate.d.ts +0 -30
- package/lib/src/instantiate.js +0 -88
- package/lib/src/instantiate.js.map +0 -1
- package/src/api.ts +0 -145
- package/src/instantiate.ts +0 -137
|
@@ -12,53 +12,17 @@
|
|
|
12
12
|
// Errors carry a `code` (e.g. ENOENT, EBADF) so Go's os package sees them as
|
|
13
13
|
// proper os.PathError values.
|
|
14
14
|
//
|
|
15
|
-
// Files are stored as Uint8Array.
|
|
16
|
-
//
|
|
15
|
+
// Files are stored as Uint8Array. String input passed to writeFile is encoded,
|
|
16
|
+
// byte input is copied, and readFile returns a copy so callers cannot mutate
|
|
17
|
+
// stored filesystem state by keeping a reference.
|
|
17
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.MemFSError = void 0;
|
|
19
19
|
exports.createMemFS = createMemFS;
|
|
20
|
+
const MemFSError_1 = require("./MemFSError");
|
|
20
21
|
/** Mode bits exposed by stat. We only differentiate file vs directory. */
|
|
21
22
|
const S_IFDIR = 0o040000;
|
|
22
23
|
const S_IFREG = 0o100000;
|
|
23
24
|
const DEFAULT_FILE_MODE = S_IFREG | 0o644;
|
|
24
25
|
const DEFAULT_DIR_MODE = S_IFDIR | 0o755;
|
|
25
|
-
/**
|
|
26
|
-
* Filesystem error with a POSIX error code and numeric `errno`.
|
|
27
|
-
*
|
|
28
|
-
* Matches the shape of `NodeJS.ErrnoException` so Go's os package interprets it
|
|
29
|
-
* as a proper `os.PathError` with a numeric error code.
|
|
30
|
-
*/
|
|
31
|
-
class MemFSError extends Error {
|
|
32
|
-
code;
|
|
33
|
-
errno;
|
|
34
|
-
path;
|
|
35
|
-
syscall;
|
|
36
|
-
constructor(code, syscall, path) {
|
|
37
|
-
super(`${code}: ${syscall} ${path ?? ""}`.trim());
|
|
38
|
-
this.code = code;
|
|
39
|
-
this.errno = errnoForCode(code);
|
|
40
|
-
this.path = path;
|
|
41
|
-
this.syscall = syscall;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.MemFSError = MemFSError;
|
|
45
|
-
/** Map a POSIX error name to its Linux numeric errno (negative by convention). */
|
|
46
|
-
function errnoForCode(code) {
|
|
47
|
-
switch (code) {
|
|
48
|
-
case "ENOENT":
|
|
49
|
-
return -2;
|
|
50
|
-
case "EBADF":
|
|
51
|
-
return -9;
|
|
52
|
-
case "EEXIST":
|
|
53
|
-
return -17;
|
|
54
|
-
case "ENOTDIR":
|
|
55
|
-
return -20;
|
|
56
|
-
case "EISDIR":
|
|
57
|
-
return -21;
|
|
58
|
-
default:
|
|
59
|
-
return -1;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
26
|
const encoder = new TextEncoder();
|
|
63
27
|
const decoder = new TextDecoder();
|
|
64
28
|
/**
|
|
@@ -165,21 +129,21 @@ function createMemFS() {
|
|
|
165
129
|
});
|
|
166
130
|
}
|
|
167
131
|
else if (existing.kind !== "dir") {
|
|
168
|
-
throw new MemFSError("ENOTDIR", "mkdir", cursor);
|
|
132
|
+
throw new MemFSError_1.MemFSError("ENOTDIR", "mkdir", cursor);
|
|
169
133
|
}
|
|
170
134
|
}
|
|
171
135
|
}
|
|
172
136
|
function writeFile(p, data) {
|
|
173
137
|
const norm = normalize(p);
|
|
174
138
|
ensureParentDirs(norm);
|
|
175
|
-
const bytes = typeof data === "string" ? encoder.encode(data) : data;
|
|
139
|
+
const bytes = typeof data === "string" ? encoder.encode(data) : new Uint8Array(data);
|
|
176
140
|
nodes.set(norm, { kind: "file", data: bytes, mtimeMs: Date.now() });
|
|
177
141
|
}
|
|
178
142
|
function readFile(p) {
|
|
179
143
|
const node = nodes.get(normalize(p));
|
|
180
144
|
if (!node || node.kind !== "file")
|
|
181
145
|
return null;
|
|
182
|
-
return node.data;
|
|
146
|
+
return new Uint8Array(node.data);
|
|
183
147
|
}
|
|
184
148
|
function readFileText(p) {
|
|
185
149
|
const bytes = readFile(p);
|
|
@@ -193,7 +157,7 @@ function createMemFS() {
|
|
|
193
157
|
const norm = normalize(p);
|
|
194
158
|
const node = nodes.get(norm);
|
|
195
159
|
if (!node)
|
|
196
|
-
throw new MemFSError("ENOENT", "stat", norm);
|
|
160
|
+
throw new MemFSError_1.MemFSError("ENOENT", "stat", norm);
|
|
197
161
|
return makeStats(node);
|
|
198
162
|
}
|
|
199
163
|
/** Build an `IFileStats` object from a filesystem node. */
|
|
@@ -227,9 +191,9 @@ function createMemFS() {
|
|
|
227
191
|
const norm = normalize(p);
|
|
228
192
|
const node = nodes.get(norm);
|
|
229
193
|
if (!node)
|
|
230
|
-
throw new MemFSError("ENOENT", "readdir", norm);
|
|
194
|
+
throw new MemFSError_1.MemFSError("ENOENT", "readdir", norm);
|
|
231
195
|
if (node.kind !== "dir")
|
|
232
|
-
throw new MemFSError("ENOTDIR", "readdir", norm);
|
|
196
|
+
throw new MemFSError_1.MemFSError("ENOTDIR", "readdir", norm);
|
|
233
197
|
const prefix = norm === "/" ? "/" : norm + "/";
|
|
234
198
|
const direct = new Set();
|
|
235
199
|
for (const key of nodes.keys()) {
|
|
@@ -276,7 +240,8 @@ function createMemFS() {
|
|
|
276
240
|
if (entry) {
|
|
277
241
|
const node = nodes.get(entry.path);
|
|
278
242
|
if (node && node.kind === "file") {
|
|
279
|
-
// subarray(0) is a zero-copy view over the full incoming buffer
|
|
243
|
+
// subarray(0) is a zero-copy view over the full incoming buffer; the
|
|
244
|
+
// bytes are copied into `next` before writeSync returns.
|
|
280
245
|
const incoming = buf.subarray(0);
|
|
281
246
|
const existing = node.data;
|
|
282
247
|
const next = new Uint8Array(existing.byteLength + incoming.byteLength);
|
|
@@ -308,7 +273,7 @@ function createMemFS() {
|
|
|
308
273
|
const pipeState = pipes.get(fd);
|
|
309
274
|
if (pipeState) {
|
|
310
275
|
if (fd !== pipeState.writeFd) {
|
|
311
|
-
callback(new MemFSError("EBADF", "write"), 0);
|
|
276
|
+
callback(new MemFSError_1.MemFSError("EBADF", "write"), 0);
|
|
312
277
|
return;
|
|
313
278
|
}
|
|
314
279
|
if (length > 0) {
|
|
@@ -321,7 +286,7 @@ function createMemFS() {
|
|
|
321
286
|
return;
|
|
322
287
|
}
|
|
323
288
|
if (position !== null && position !== 0) {
|
|
324
|
-
callback(new MemFSError("ESPIPE", "write"), 0);
|
|
289
|
+
callback(new MemFSError_1.MemFSError("ESPIPE", "write"), 0);
|
|
325
290
|
return;
|
|
326
291
|
}
|
|
327
292
|
const view = buf.subarray(offset, offset + length);
|
|
@@ -338,7 +303,7 @@ function createMemFS() {
|
|
|
338
303
|
const creating = (flags & (this.constants.O_CREAT ?? 0)) !== 0;
|
|
339
304
|
if (!node) {
|
|
340
305
|
if (!creating) {
|
|
341
|
-
callback(new MemFSError("ENOENT", "open", norm), -1);
|
|
306
|
+
callback(new MemFSError_1.MemFSError("ENOENT", "open", norm), -1);
|
|
342
307
|
return;
|
|
343
308
|
}
|
|
344
309
|
ensureParentDirs(norm);
|
|
@@ -371,7 +336,7 @@ function createMemFS() {
|
|
|
371
336
|
return;
|
|
372
337
|
}
|
|
373
338
|
if (!fdTable.has(fd)) {
|
|
374
|
-
callback(new MemFSError("EBADF", "close"));
|
|
339
|
+
callback(new MemFSError_1.MemFSError("EBADF", "close"));
|
|
375
340
|
return;
|
|
376
341
|
}
|
|
377
342
|
if (fd > 2)
|
|
@@ -384,7 +349,7 @@ function createMemFS() {
|
|
|
384
349
|
const pipeState = pipes.get(fd);
|
|
385
350
|
if (pipeState) {
|
|
386
351
|
if (fd !== pipeState.readFd) {
|
|
387
|
-
callback(new MemFSError("EBADF", "read"), 0);
|
|
352
|
+
callback(new MemFSError_1.MemFSError("EBADF", "read"), 0);
|
|
388
353
|
return;
|
|
389
354
|
}
|
|
390
355
|
if (pipeState.buffers.length > 0) {
|
|
@@ -401,12 +366,12 @@ function createMemFS() {
|
|
|
401
366
|
}
|
|
402
367
|
const entry = fdTable.get(fd);
|
|
403
368
|
if (!entry) {
|
|
404
|
-
callback(new MemFSError("EBADF", "read"), 0);
|
|
369
|
+
callback(new MemFSError_1.MemFSError("EBADF", "read"), 0);
|
|
405
370
|
return;
|
|
406
371
|
}
|
|
407
372
|
const node = nodes.get(entry.path);
|
|
408
373
|
if (!node || node.kind !== "file") {
|
|
409
|
-
callback(new MemFSError("ENOENT", "read", entry.path), 0);
|
|
374
|
+
callback(new MemFSError_1.MemFSError("ENOENT", "read", entry.path), 0);
|
|
410
375
|
return;
|
|
411
376
|
}
|
|
412
377
|
const start = position ?? entry.position;
|
|
@@ -459,7 +424,7 @@ function createMemFS() {
|
|
|
459
424
|
}
|
|
460
425
|
const entry = fdTable.get(fd);
|
|
461
426
|
if (!entry) {
|
|
462
|
-
callback(new MemFSError("EBADF", "fstat"), undefined);
|
|
427
|
+
callback(new MemFSError_1.MemFSError("EBADF", "fstat"), undefined);
|
|
463
428
|
return;
|
|
464
429
|
}
|
|
465
430
|
try {
|
|
@@ -475,7 +440,7 @@ function createMemFS() {
|
|
|
475
440
|
unlink(p, callback) {
|
|
476
441
|
const norm = normalize(p);
|
|
477
442
|
if (!nodes.has(norm)) {
|
|
478
|
-
callback(new MemFSError("ENOENT", "unlink", norm));
|
|
443
|
+
callback(new MemFSError_1.MemFSError("ENOENT", "unlink", norm));
|
|
479
444
|
return;
|
|
480
445
|
}
|
|
481
446
|
nodes.delete(norm);
|
|
@@ -485,7 +450,7 @@ function createMemFS() {
|
|
|
485
450
|
const src = normalize(from);
|
|
486
451
|
const node = nodes.get(src);
|
|
487
452
|
if (!node) {
|
|
488
|
-
callback(new MemFSError("ENOENT", "rename", src));
|
|
453
|
+
callback(new MemFSError_1.MemFSError("ENOENT", "rename", src));
|
|
489
454
|
return;
|
|
490
455
|
}
|
|
491
456
|
const dest = normalize(to);
|
|
@@ -515,13 +480,13 @@ function createMemFS() {
|
|
|
515
480
|
callback(null);
|
|
516
481
|
},
|
|
517
482
|
link(_p, _link, callback) {
|
|
518
|
-
callback(new MemFSError("EPERM", "link"));
|
|
483
|
+
callback(new MemFSError_1.MemFSError("EPERM", "link"));
|
|
519
484
|
},
|
|
520
485
|
symlink(_p, _link, callback) {
|
|
521
|
-
callback(new MemFSError("EPERM", "symlink"));
|
|
486
|
+
callback(new MemFSError_1.MemFSError("EPERM", "symlink"));
|
|
522
487
|
},
|
|
523
488
|
readlink(_p, callback) {
|
|
524
|
-
callback(new MemFSError("EINVAL", "readlink"), "");
|
|
489
|
+
callback(new MemFSError_1.MemFSError("EINVAL", "readlink"), "");
|
|
525
490
|
},
|
|
526
491
|
truncate(_p, _length, callback) {
|
|
527
492
|
callback(null);
|
|
@@ -559,4 +524,4 @@ function createMemFS() {
|
|
|
559
524
|
},
|
|
560
525
|
};
|
|
561
526
|
}
|
|
562
|
-
//# sourceMappingURL=
|
|
527
|
+
//# sourceMappingURL=createMemFS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createMemFS.js","sourceRoot":"","sources":["../../src/createMemFS.ts"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,+BAA+B;AAC/B,EAAE;AACF,2EAA2E;AAC3E,+EAA+E;AAC/E,8EAA8E;AAC9E,6EAA6E;AAC7E,uCAAuC;AACvC,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,8BAA8B;AAC9B,EAAE;AACF,+EAA+E;AAC/E,6EAA6E;AAC7E,kDAAkD;;;AAElD,6CAA0C;AAK1C,0EAA0E;AAC1E,MAAM,OAAO,GAAG,QAAQ,CAAC;AACzB,MAAM,OAAO,GAAG,QAA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B,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC;YACxB,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC;YACzB,MAAM,KAAK,GAAe;gBACxB,OAAO,EAAE,EAAE;gBACX,cAAc,EAAE,EAAE;gBAClB,MAAM;gBACN,OAAO;gBACP,WAAW,EAAE,KAAK;aACnB,CAAC;YACF,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;YACzB,KAAK,CAAC,GAAG,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;YAC1B,QAAQ,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACpC,CAAC;KACF,CAAC;IAEF,OAAO;QACL,EAAE;QACF,SAAS;QACT,QAAQ;QACR,YAAY;QACZ,MAAM;QACN,MAAM;QACN,MAAM;QACN,MAAM;QACN,UAAU;YACR,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC;YACnB,MAAM,CAAC,MAAM,GAAG,EAAE,CAAC;QACrB,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/lib/src/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export { parseResult } from "./api";
|
|
1
|
+
export * from "./bootTtsc";
|
|
2
|
+
export * from "./createMemFS";
|
|
3
|
+
export * from "./MemFSError";
|
|
4
|
+
export * from "./parseResult";
|
|
5
|
+
export * from "./structures/index";
|
package/lib/src/index.js
CHANGED
|
@@ -5,13 +5,24 @@
|
|
|
5
5
|
// authors and playground builders consume these. The Go-side scaffolding
|
|
6
6
|
// (`host/`) is shipped alongside on disk but loaded via `go build`, not
|
|
7
7
|
// imported from JS.
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
8
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
Object.defineProperty(exports, "MemFSError", { enumerable: true, get: function () { return MemFS_1.MemFSError; } });
|
|
15
|
-
var api_1 = require("./api");
|
|
16
|
-
Object.defineProperty(exports, "parseResult", { enumerable: true, get: function () { return api_1.parseResult; } });
|
|
23
|
+
__exportStar(require("./bootTtsc"), exports);
|
|
24
|
+
__exportStar(require("./createMemFS"), exports);
|
|
25
|
+
__exportStar(require("./MemFSError"), exports);
|
|
26
|
+
__exportStar(require("./parseResult"), exports);
|
|
27
|
+
__exportStar(require("./structures/index"), exports);
|
|
17
28
|
//# sourceMappingURL=index.js.map
|
package/lib/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,wEAAwE;AACxE,oBAAoB
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,wEAAwE;AACxE,oBAAoB;;;;;;;;;;;;;;;;AAEpB,6CAA2B;AAC3B,gDAA8B;AAC9B,+CAA6B;AAC7B,gDAA8B;AAC9B,qDAAmC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ITtscResult } from "./structures/ITtscResult";
|
|
2
|
+
/**
|
|
3
|
+
* Parse the `result` field of an ITtscResult into the structured payload.
|
|
4
|
+
*
|
|
5
|
+
* The wasm returns JSON as a string because `js.ValueOf` does not handle
|
|
6
|
+
* large nested maps efficiently. Callers JSON.parse exactly once at the
|
|
7
|
+
* boundary.
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseResult<T>(result: ITtscResult): T | null;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseResult = parseResult;
|
|
4
|
+
/**
|
|
5
|
+
* Parse the `result` field of an ITtscResult into the structured payload.
|
|
6
|
+
*
|
|
7
|
+
* The wasm returns JSON as a string because `js.ValueOf` does not handle
|
|
8
|
+
* large nested maps efficiently. Callers JSON.parse exactly once at the
|
|
9
|
+
* boundary.
|
|
10
|
+
*/
|
|
11
|
+
function parseResult(result) {
|
|
12
|
+
if (!result.result)
|
|
13
|
+
return null;
|
|
14
|
+
try {
|
|
15
|
+
return JSON.parse(result.result);
|
|
16
|
+
}
|
|
17
|
+
catch {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=parseResult.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parseResult.js","sourceRoot":"","sources":["../../src/parseResult.ts"],"names":[],"mappings":";;;AAEA;;;;;;GAMG;AACH,qBAA+B,MAAmB;IAChD,IAAI,CAAC,MAAM,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAChC,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAM,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IMemFSHost } from "./IMemFSHost";
|
|
2
|
+
import type { ITtscApi } from "./ITtscApi";
|
|
3
|
+
/** Handle returned by `bootTtsc` once the wasm is ready. */
|
|
4
|
+
export interface IBootResult {
|
|
5
|
+
/** The typed API proxy bound by the wasm to `globalThis[apiName]`. */
|
|
6
|
+
api: ITtscApi;
|
|
7
|
+
/** The MemFS instance shared with the wasm's virtual filesystem. */
|
|
8
|
+
host: IMemFSHost;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IBootResult.js","sourceRoot":"","sources":["../../../src/structures/IBootResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IMemFSHost } from "./IMemFSHost";
|
|
2
|
+
/** Options for `bootTtsc`. All fields except `wasmUrl` have sensible defaults. */
|
|
3
|
+
export interface IBootTtscOptions {
|
|
4
|
+
/** URL of the .wasm to fetch. */
|
|
5
|
+
wasmUrl: string;
|
|
6
|
+
/** URL of wasm_exec.js. Defaults to the same directory as wasmUrl. */
|
|
7
|
+
wasmExecUrl?: string;
|
|
8
|
+
/**
|
|
9
|
+
* GlobalThis property name the wasm binds. Must match the value the wasm
|
|
10
|
+
* was built with (the `apiName` passed to `host.Expose`). Defaults to
|
|
11
|
+
* `"ttsc"`.
|
|
12
|
+
*/
|
|
13
|
+
apiName?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional pre-existing MemFS host. When omitted, a fresh one is created
|
|
16
|
+
* and stored on the returned BootResult. Pass an existing host when you
|
|
17
|
+
* want to boot multiple wasms over the same filesystem (e.g. base ttsc + a
|
|
18
|
+
* typia wasm) so they share project sources.
|
|
19
|
+
*/
|
|
20
|
+
host?: IMemFSHost;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IBootTtscOptions.js","sourceRoot":"","sources":["../../../src/structures/IBootTtscOptions.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stat-like object returned by `stat`, `lstat`, and `fstat`.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the subset of `fs.Stats` that `wasm_exec.js` reads. Fields not
|
|
5
|
+
* relevant to Go's `os.FileInfo` (e.g. ownership) are zeroed.
|
|
6
|
+
*/
|
|
7
|
+
export interface IFileStats {
|
|
8
|
+
isDirectory(): boolean;
|
|
9
|
+
isFile(): boolean;
|
|
10
|
+
size: number;
|
|
11
|
+
mode: number;
|
|
12
|
+
mtimeMs: number;
|
|
13
|
+
atimeMs: number;
|
|
14
|
+
ctimeMs: number;
|
|
15
|
+
dev: number;
|
|
16
|
+
ino: number;
|
|
17
|
+
nlink: number;
|
|
18
|
+
uid: number;
|
|
19
|
+
gid: number;
|
|
20
|
+
rdev: number;
|
|
21
|
+
blksize: number;
|
|
22
|
+
blocks: number;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IFileStats.js","sourceRoot":"","sources":["../../../src/structures/IFileStats.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { IWasmExecFS } from "./IWasmExecFS";
|
|
2
|
+
/**
|
|
3
|
+
* Handle returned by `createMemFS`. Provides the `fs` shim to install on
|
|
4
|
+
* `globalThis` plus convenience methods for seeding the virtual filesystem
|
|
5
|
+
* before booting the wasm.
|
|
6
|
+
*/
|
|
7
|
+
export interface IMemFSHost {
|
|
8
|
+
fs: IWasmExecFS;
|
|
9
|
+
writeFile(path: string, data: string | Uint8Array): void;
|
|
10
|
+
readFile(path: string): Uint8Array | null;
|
|
11
|
+
readFileText(path: string): string | null;
|
|
12
|
+
exists(path: string): boolean;
|
|
13
|
+
mkdirp(path: string): void;
|
|
14
|
+
stdout: {
|
|
15
|
+
buffer: string;
|
|
16
|
+
};
|
|
17
|
+
stderr: {
|
|
18
|
+
buffer: string;
|
|
19
|
+
};
|
|
20
|
+
resetStdio(): void;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IMemFSHost.js","sourceRoot":"","sources":["../../../src/structures/IMemFSHost.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import type { ITtscBuildOpts } from "./ITtscBuildOpts";
|
|
2
|
+
import type { ITtscPluginOpts } from "./ITtscPluginOpts";
|
|
3
|
+
import type { ITtscPositionQuery } from "./ITtscPositionQuery";
|
|
4
|
+
import type { ITtscFileQuery } from "./ITtscFileQuery";
|
|
5
|
+
import type { ITtscResult } from "./ITtscResult";
|
|
6
|
+
import type { ITtscSnapshotHandle } from "./ITtscSnapshotHandle";
|
|
7
|
+
import type { ITtscVersion } from "./ITtscVersion";
|
|
8
|
+
/**
|
|
9
|
+
* API object that every host-built wasm binds to `globalThis[apiName]`.
|
|
10
|
+
*
|
|
11
|
+
* Obtain an instance via `bootTtsc`, which waits for the wasm to signal
|
|
12
|
+
* readiness and returns the typed handle together with its `IMemFSHost`.
|
|
13
|
+
*/
|
|
14
|
+
export interface ITtscApi {
|
|
15
|
+
/** Build metadata reported by the wasm. Useful for diagnostics. */
|
|
16
|
+
version(): ITtscVersion;
|
|
17
|
+
/**
|
|
18
|
+
* Compile a project: typecheck + emit. `result` is JSON;
|
|
19
|
+
* `parseResult<ITtscCompileResult>` deserializes it.
|
|
20
|
+
*/
|
|
21
|
+
build(opts: ITtscBuildOpts): Promise<ITtscResult>;
|
|
22
|
+
/**
|
|
23
|
+
* Typecheck without emit. `result` is JSON; `parseResult<ITtscCompileResult>`
|
|
24
|
+
* deserializes it.
|
|
25
|
+
*/
|
|
26
|
+
check(opts: ITtscBuildOpts): Promise<ITtscResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Return every source file the program saw, keyed by project-relative path.
|
|
29
|
+
* Used by playgrounds that want to render the TypeScript view after a source
|
|
30
|
+
* rewriter (e.g. paths) has run. `result` is JSON; use
|
|
31
|
+
* `parseResult<ITtscTransformResult>` to deserialize.
|
|
32
|
+
*/
|
|
33
|
+
transform(opts: ITtscBuildOpts): Promise<ITtscResult>;
|
|
34
|
+
/**
|
|
35
|
+
* Dispatch a registered plugin's subcommand. Returns the captured stdout /
|
|
36
|
+
* stderr (the same streams the native sidecar binary would write to)
|
|
37
|
+
* together with the exit code.
|
|
38
|
+
*/
|
|
39
|
+
plugin(opts: ITtscPluginOpts): Promise<ITtscResult>;
|
|
40
|
+
/** Names of the plugins this wasm was built with. */
|
|
41
|
+
plugins(): string[];
|
|
42
|
+
/**
|
|
43
|
+
* Load a project once and retain the TypeScript-Go Program in memory for
|
|
44
|
+
* follow-up queries via the other fountain verbs.
|
|
45
|
+
*
|
|
46
|
+
* Callers MUST call `releaseSnapshot` for every handle they receive to free
|
|
47
|
+
* the program's checker pool lease and let Go GC reclaim the AST. Use
|
|
48
|
+
* `parseResult<ITtscSnapshotResult>` to read the handle.
|
|
49
|
+
*/
|
|
50
|
+
snapshot(opts: ITtscBuildOpts): Promise<ITtscResult>;
|
|
51
|
+
/**
|
|
52
|
+
* Drop a snapshot held by the wasm. Safe to call with an already-released
|
|
53
|
+
* handle — the response's `released` flag will be `false`.
|
|
54
|
+
*/
|
|
55
|
+
releaseSnapshot(opts: ITtscSnapshotHandle): Promise<ITtscResult>;
|
|
56
|
+
/** List the currently retained snapshot handles. Debug aid. */
|
|
57
|
+
snapshots(): Promise<ITtscResult>;
|
|
58
|
+
/** List source file paths held by the snapshot's program. */
|
|
59
|
+
getSourceFiles(opts: ITtscSnapshotHandle): Promise<ITtscResult>;
|
|
60
|
+
/**
|
|
61
|
+
* Read the current text the snapshot's program is holding for a file. After
|
|
62
|
+
* transform-stage plugins ran inside this snapshot, the text reflects their
|
|
63
|
+
* rewrites.
|
|
64
|
+
*/
|
|
65
|
+
getSourceFileText(opts: ITtscFileQuery): Promise<ITtscResult>;
|
|
66
|
+
/**
|
|
67
|
+
* Diagnostics from the snapshot's program. Pass `file` to filter to a
|
|
68
|
+
* single project-relative path.
|
|
69
|
+
*/
|
|
70
|
+
getDiagnostics(opts: ITtscSnapshotHandle & {
|
|
71
|
+
file?: string;
|
|
72
|
+
}): Promise<ITtscResult>;
|
|
73
|
+
/** Return the deepest AST node whose range covers `position` (byte offset). */
|
|
74
|
+
getNodeAtPosition(opts: ITtscPositionQuery): Promise<ITtscResult>;
|
|
75
|
+
/**
|
|
76
|
+
* Run the TypeScript-Go type checker against the node at `position` and
|
|
77
|
+
* return its printed type string + flags. Returns `{type: null}` when there
|
|
78
|
+
* is no node at that position.
|
|
79
|
+
*/
|
|
80
|
+
getTypeAtPosition(opts: ITtscPositionQuery): Promise<ITtscResult>;
|
|
81
|
+
/**
|
|
82
|
+
* Resolve the symbol the node at `position` refers to, including up to 16
|
|
83
|
+
* declaration sites. Returns `{symbol: null}` when no symbol is bound.
|
|
84
|
+
*/
|
|
85
|
+
getSymbolAtPosition(opts: ITtscPositionQuery): Promise<ITtscResult>;
|
|
86
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscApi.js","sourceRoot":"","sources":["../../../src/structures/ITtscApi.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Options shared by `build`, `check`, and `transform`. */
|
|
2
|
+
export interface ITtscBuildOpts {
|
|
3
|
+
/** Absolute virtual path the project lives at inside the MemFS. */
|
|
4
|
+
cwd: string;
|
|
5
|
+
/** Tsconfig path, relative to `cwd`. Defaults to `tsconfig.json`. */
|
|
6
|
+
tsconfig?: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscBuildOpts.js","sourceRoot":"","sources":["../../../src/structures/ITtscBuildOpts.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ITtscDiagnostic } from "./ITtscDiagnostic";
|
|
2
|
+
/**
|
|
3
|
+
* Structured payload inside `ITtscResult.result` for `build` and `check`.
|
|
4
|
+
*
|
|
5
|
+
* `output` maps emit-destination paths (relative to `cwd`) to file contents.
|
|
6
|
+
* It is empty when `check` is called without emit.
|
|
7
|
+
*/
|
|
8
|
+
export interface ITtscCompileResult {
|
|
9
|
+
diagnostics?: ITtscDiagnostic[];
|
|
10
|
+
output: Record<string, string>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscCompileResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscCompileResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single TypeScript compiler diagnostic emitted during `build`, `check`, or
|
|
3
|
+
* `transform`. `line` and `character` are 0-based.
|
|
4
|
+
*/
|
|
5
|
+
export interface ITtscDiagnostic {
|
|
6
|
+
file: string | null;
|
|
7
|
+
category: "error" | "warning";
|
|
8
|
+
code: number;
|
|
9
|
+
start?: number;
|
|
10
|
+
length?: number;
|
|
11
|
+
line?: number;
|
|
12
|
+
character?: number;
|
|
13
|
+
messageText: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscDiagnostic.js","sourceRoot":"","sources":["../../../src/structures/ITtscDiagnostic.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ITtscSnapshotHandle } from "./ITtscSnapshotHandle";
|
|
2
|
+
/** Request shape for `getSourceFileText`. */
|
|
3
|
+
export interface ITtscFileQuery extends ITtscSnapshotHandle {
|
|
4
|
+
/** Project-relative or absolute path inside the snapshot's program. */
|
|
5
|
+
path: string;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscFileQuery.js","sourceRoot":"","sources":["../../../src/structures/ITtscFileQuery.ts"],"names":[],"mappings":""}
|