@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscFountainDiagnosticsResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscFountainDiagnosticsResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscNodeAtPositionResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscNodeAtPositionResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** AST node shape returned by `getNodeAtPosition`. */
|
|
2
|
+
export interface ITtscNodeInfo {
|
|
3
|
+
/** Numeric `ast.Kind` from TypeScript-Go. */
|
|
4
|
+
kind: number;
|
|
5
|
+
/** Human-readable name of `kind`. */
|
|
6
|
+
kindName: string;
|
|
7
|
+
/** Byte offset where the node begins (inclusive). */
|
|
8
|
+
pos: number;
|
|
9
|
+
/** Byte offset where the node ends (exclusive). */
|
|
10
|
+
end: number;
|
|
11
|
+
/** Source text covered by the node, when available. */
|
|
12
|
+
text?: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscNodeInfo.js","sourceRoot":"","sources":["../../../src/structures/ITtscNodeInfo.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Options for dispatching a named plugin subcommand via `api.plugin`. */
|
|
2
|
+
export interface ITtscPluginOpts {
|
|
3
|
+
/** Plugin id registered with `host.Expose` (e.g. `@ttsc/banner`). */
|
|
4
|
+
name: string;
|
|
5
|
+
/** Subcommand the plugin's Run will receive (e.g. `build`). */
|
|
6
|
+
command: string;
|
|
7
|
+
/** Forwarded as `--cwd=<value>`. */
|
|
8
|
+
cwd?: string;
|
|
9
|
+
/** Forwarded as `--tsconfig=<value>`. Defaults to `tsconfig.json`. */
|
|
10
|
+
tsconfig?: string;
|
|
11
|
+
/** Any extra key/value pairs map to `--key=value` argv entries. */
|
|
12
|
+
[key: string]: string | boolean | number | undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscPluginOpts.js","sourceRoot":"","sources":["../../../src/structures/ITtscPluginOpts.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ITtscFileQuery } from "./ITtscFileQuery";
|
|
2
|
+
/** Request shape for `getNodeAtPosition`, `getTypeAtPosition`, `getSymbolAtPosition`. */
|
|
3
|
+
export interface ITtscPositionQuery extends ITtscFileQuery {
|
|
4
|
+
/**
|
|
5
|
+
* Byte offset into the file's source text. JS callers with a UTF-16
|
|
6
|
+
* line/character pair must resolve it to a byte offset first.
|
|
7
|
+
*/
|
|
8
|
+
position: number;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscPositionQuery.js","sourceRoot":"","sources":["../../../src/structures/ITtscPositionQuery.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscReleaseSnapshotResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscReleaseSnapshotResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Envelope returned by every `ITtscApi` method. */
|
|
2
|
+
export interface ITtscResult {
|
|
3
|
+
/** Exit code. 0 = success, 2 = compiler/config/usage error, 3 = runtime error. */
|
|
4
|
+
code: number;
|
|
5
|
+
/** Anything the wasm wrote to its stdout stream. */
|
|
6
|
+
stdout: string;
|
|
7
|
+
/** Anything the wasm wrote to its stderr stream. */
|
|
8
|
+
stderr: string;
|
|
9
|
+
/**
|
|
10
|
+
* For the base endpoints, the JSON-encoded compile/transform result. For the
|
|
11
|
+
* plugin endpoint, this is empty — the plugin's own output sits in
|
|
12
|
+
* stdout/stderr. Use `parseResult<T>` to deserialize.
|
|
13
|
+
*/
|
|
14
|
+
result: string;
|
|
15
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscSnapshotHandle.js","sourceRoot":"","sources":["../../../src/structures/ITtscSnapshotHandle.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscSnapshotResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscSnapshotResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscSnapshotsResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscSnapshotsResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscSourceFileTextResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscSourceFileTextResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscSourceFilesResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscSourceFilesResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ITtscSymbolInfo } from "./ITtscSymbolInfo";
|
|
2
|
+
/** Payload inside `ITtscResult.result` for `getSymbolAtPosition`. */
|
|
3
|
+
export interface ITtscSymbolAtPositionResult {
|
|
4
|
+
/** `null` when the node has no associated symbol. */
|
|
5
|
+
symbol: ITtscSymbolInfo | null;
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscSymbolAtPositionResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscSymbolAtPositionResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscSymbolDeclaration.js","sourceRoot":"","sources":["../../../src/structures/ITtscSymbolDeclaration.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ITtscSymbolDeclaration } from "./ITtscSymbolDeclaration";
|
|
2
|
+
/** Symbol shape returned by `getSymbolAtPosition`. */
|
|
3
|
+
export interface ITtscSymbolInfo {
|
|
4
|
+
/** Raw symbol name, including TypeScript's internal prefix markers. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Printed symbol, equivalent to TypeScript's `SymbolToString(s)`. */
|
|
7
|
+
text?: string;
|
|
8
|
+
/** Numeric `SymbolFlags` bitmask from TypeScript-Go. */
|
|
9
|
+
flags: number;
|
|
10
|
+
/** Up to 16 declaration sites; see `declarationCount` for the unclamped total. */
|
|
11
|
+
declarations?: ITtscSymbolDeclaration[];
|
|
12
|
+
/** Total number of declarations, even when `declarations` was clamped. */
|
|
13
|
+
declarationCount?: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscSymbolInfo.js","sourceRoot":"","sources":["../../../src/structures/ITtscSymbolInfo.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ITtscDiagnostic } from "./ITtscDiagnostic";
|
|
2
|
+
/**
|
|
3
|
+
* Structured payload inside `ITtscResult.result` for `transform`.
|
|
4
|
+
*
|
|
5
|
+
* `typescript` maps source file paths (relative to `cwd`) to their
|
|
6
|
+
* post-transform TypeScript text — useful for playgrounds that want to show
|
|
7
|
+
* the rewritten source before it is emitted.
|
|
8
|
+
*/
|
|
9
|
+
export interface ITtscTransformResult {
|
|
10
|
+
diagnostics?: ITtscDiagnostic[];
|
|
11
|
+
typescript: Record<string, string>;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscTransformResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscTransformResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscTypeAtPositionResult.js","sourceRoot":"","sources":["../../../src/structures/ITtscTypeAtPositionResult.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscTypeInfo.js","sourceRoot":"","sources":["../../../src/structures/ITtscTypeInfo.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ITtscVersion.js","sourceRoot":"","sources":["../../../src/structures/ITtscVersion.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IFileStats } from "./IFileStats";
|
|
1
2
|
/**
|
|
2
3
|
* Subset of the Node.js `fs` module that `wasm_exec.js` calls into.
|
|
3
4
|
*
|
|
@@ -34,71 +35,11 @@ export interface IWasmExecFS {
|
|
|
34
35
|
readlink(path: string, callback: (err: NodeJS.ErrnoException | null, link: string) => void): void;
|
|
35
36
|
truncate(path: string, length: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
|
|
36
37
|
ftruncate(fd: number, length: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
|
|
38
|
+
/**
|
|
39
|
+
* `pipe2` is what Go's wasm `os.Pipe()` calls. Returns two fds: a read end
|
|
40
|
+
* and a write end. The host's stdout/stderr capture currently uses MemFS
|
|
41
|
+
* temp files, but this keeps direct pipe callers compatible with the wasm
|
|
42
|
+
* fs surface.
|
|
43
|
+
*/
|
|
37
44
|
pipe2(flags: number, callback: (err: NodeJS.ErrnoException | null, fds: [number, number]) => void): void;
|
|
38
45
|
}
|
|
39
|
-
/**
|
|
40
|
-
* Stat-like object returned by `stat`, `lstat`, and `fstat`.
|
|
41
|
-
*
|
|
42
|
-
* Mirrors the subset of `fs.Stats` that `wasm_exec.js` reads. Fields not
|
|
43
|
-
* relevant to Go's `os.FileInfo` (e.g. ownership) are zeroed.
|
|
44
|
-
*/
|
|
45
|
-
export interface IFileStats {
|
|
46
|
-
isDirectory(): boolean;
|
|
47
|
-
isFile(): boolean;
|
|
48
|
-
size: number;
|
|
49
|
-
mode: number;
|
|
50
|
-
mtimeMs: number;
|
|
51
|
-
atimeMs: number;
|
|
52
|
-
ctimeMs: number;
|
|
53
|
-
dev: number;
|
|
54
|
-
ino: number;
|
|
55
|
-
nlink: number;
|
|
56
|
-
uid: number;
|
|
57
|
-
gid: number;
|
|
58
|
-
rdev: number;
|
|
59
|
-
blksize: number;
|
|
60
|
-
blocks: number;
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Filesystem error with a POSIX error code and numeric `errno`.
|
|
64
|
-
*
|
|
65
|
-
* Matches the shape of `NodeJS.ErrnoException` so Go's os package interprets it
|
|
66
|
-
* as a proper `os.PathError` with a numeric error code.
|
|
67
|
-
*/
|
|
68
|
-
export declare class MemFSError extends Error {
|
|
69
|
-
code: string;
|
|
70
|
-
errno: number;
|
|
71
|
-
path?: string;
|
|
72
|
-
syscall?: string;
|
|
73
|
-
constructor(code: string, syscall: string, path?: string);
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Handle returned by `createMemFS`. Provides the `fs` shim to install on
|
|
77
|
-
* `globalThis` plus convenience methods for seeding the virtual filesystem
|
|
78
|
-
* before booting the wasm.
|
|
79
|
-
*/
|
|
80
|
-
export interface IMemFSHost {
|
|
81
|
-
fs: IWasmExecFS;
|
|
82
|
-
writeFile(path: string, data: string | Uint8Array): void;
|
|
83
|
-
readFile(path: string): Uint8Array | null;
|
|
84
|
-
readFileText(path: string): string | null;
|
|
85
|
-
exists(path: string): boolean;
|
|
86
|
-
mkdirp(path: string): void;
|
|
87
|
-
stdout: {
|
|
88
|
-
buffer: string;
|
|
89
|
-
};
|
|
90
|
-
stderr: {
|
|
91
|
-
buffer: string;
|
|
92
|
-
};
|
|
93
|
-
resetStdio(): void;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Create an in-memory filesystem suitable for use as `globalThis.fs` inside a
|
|
97
|
-
* Go/wasm runtime.
|
|
98
|
-
*
|
|
99
|
-
* The returned host exposes the low-level `fs` object (install it on
|
|
100
|
-
* `globalThis.fs` before loading `wasm_exec.js`) and convenience helpers
|
|
101
|
-
* (`writeFile`, `readFile`, `mkdirp`, …) for seeding source files and reading
|
|
102
|
-
* compiler output without touching the real filesystem.
|
|
103
|
-
*/
|
|
104
|
-
export declare function createMemFS(): IMemFSHost;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IWasmExecFS.js","sourceRoot":"","sources":["../../../src/structures/IWasmExecFS.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export * from "./IBootResult";
|
|
2
|
+
export * from "./IBootTtscOptions";
|
|
3
|
+
export * from "./IFileStats";
|
|
4
|
+
export * from "./IMemFSHost";
|
|
5
|
+
export * from "./ITtscApi";
|
|
6
|
+
export * from "./ITtscBuildOpts";
|
|
7
|
+
export * from "./ITtscCompileResult";
|
|
8
|
+
export * from "./ITtscDiagnostic";
|
|
9
|
+
export * from "./ITtscFileQuery";
|
|
10
|
+
export * from "./ITtscFountainDiagnosticsResult";
|
|
11
|
+
export * from "./ITtscNodeAtPositionResult";
|
|
12
|
+
export * from "./ITtscNodeInfo";
|
|
13
|
+
export * from "./ITtscPluginOpts";
|
|
14
|
+
export * from "./ITtscPositionQuery";
|
|
15
|
+
export * from "./ITtscReleaseSnapshotResult";
|
|
16
|
+
export * from "./ITtscResult";
|
|
17
|
+
export * from "./ITtscSnapshotHandle";
|
|
18
|
+
export * from "./ITtscSnapshotResult";
|
|
19
|
+
export * from "./ITtscSnapshotsResult";
|
|
20
|
+
export * from "./ITtscSourceFileTextResult";
|
|
21
|
+
export * from "./ITtscSourceFilesResult";
|
|
22
|
+
export * from "./ITtscSymbolAtPositionResult";
|
|
23
|
+
export * from "./ITtscSymbolDeclaration";
|
|
24
|
+
export * from "./ITtscSymbolInfo";
|
|
25
|
+
export * from "./ITtscTransformResult";
|
|
26
|
+
export * from "./ITtscTypeAtPositionResult";
|
|
27
|
+
export * from "./ITtscTypeInfo";
|
|
28
|
+
export * from "./ITtscVersion";
|
|
29
|
+
export * from "./IWasmExecFS";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./IBootResult"), exports);
|
|
18
|
+
__exportStar(require("./IBootTtscOptions"), exports);
|
|
19
|
+
__exportStar(require("./IFileStats"), exports);
|
|
20
|
+
__exportStar(require("./IMemFSHost"), exports);
|
|
21
|
+
__exportStar(require("./ITtscApi"), exports);
|
|
22
|
+
__exportStar(require("./ITtscBuildOpts"), exports);
|
|
23
|
+
__exportStar(require("./ITtscCompileResult"), exports);
|
|
24
|
+
__exportStar(require("./ITtscDiagnostic"), exports);
|
|
25
|
+
__exportStar(require("./ITtscFileQuery"), exports);
|
|
26
|
+
__exportStar(require("./ITtscFountainDiagnosticsResult"), exports);
|
|
27
|
+
__exportStar(require("./ITtscNodeAtPositionResult"), exports);
|
|
28
|
+
__exportStar(require("./ITtscNodeInfo"), exports);
|
|
29
|
+
__exportStar(require("./ITtscPluginOpts"), exports);
|
|
30
|
+
__exportStar(require("./ITtscPositionQuery"), exports);
|
|
31
|
+
__exportStar(require("./ITtscReleaseSnapshotResult"), exports);
|
|
32
|
+
__exportStar(require("./ITtscResult"), exports);
|
|
33
|
+
__exportStar(require("./ITtscSnapshotHandle"), exports);
|
|
34
|
+
__exportStar(require("./ITtscSnapshotResult"), exports);
|
|
35
|
+
__exportStar(require("./ITtscSnapshotsResult"), exports);
|
|
36
|
+
__exportStar(require("./ITtscSourceFileTextResult"), exports);
|
|
37
|
+
__exportStar(require("./ITtscSourceFilesResult"), exports);
|
|
38
|
+
__exportStar(require("./ITtscSymbolAtPositionResult"), exports);
|
|
39
|
+
__exportStar(require("./ITtscSymbolDeclaration"), exports);
|
|
40
|
+
__exportStar(require("./ITtscSymbolInfo"), exports);
|
|
41
|
+
__exportStar(require("./ITtscTransformResult"), exports);
|
|
42
|
+
__exportStar(require("./ITtscTypeAtPositionResult"), exports);
|
|
43
|
+
__exportStar(require("./ITtscTypeInfo"), exports);
|
|
44
|
+
__exportStar(require("./ITtscVersion"), exports);
|
|
45
|
+
__exportStar(require("./IWasmExecFS"), exports);
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/structures/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,qDAAmC;AACnC,+CAA6B;AAC7B,+CAA6B;AAC7B,6CAA2B;AAC3B,mDAAiC;AACjC,uDAAqC;AACrC,oDAAkC;AAClC,mDAAiC;AACjC,mEAAiD;AACjD,8DAA4C;AAC5C,kDAAgC;AAChC,oDAAkC;AAClC,uDAAqC;AACrC,+DAA6C;AAC7C,gDAA8B;AAC9B,wDAAsC;AACtC,wDAAsC;AACtC,yDAAuC;AACvC,8DAA4C;AAC5C,2DAAyC;AACzC,gEAA8C;AAC9C,2DAAyC;AACzC,oDAAkC;AAClC,yDAAuC;AACvC,8DAA4C;AAC5C,kDAAgC;AAChC,iDAA+B;AAC/B,gDAA8B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttsc/wasm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0-dev.20260528",
|
|
4
4
|
"description": "Build in-browser ttsc playgrounds. Compose ttsc + typescript-go with your own plugins via the Go host helper.",
|
|
5
5
|
"main": "lib/src/index.js",
|
|
6
6
|
"types": "lib/src/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"homepage": "https://ttsc.dev",
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^25.3.0",
|
|
41
|
-
"@typescript/native-preview": "7.0.0-dev.
|
|
41
|
+
"@typescript/native-preview": "7.0.0-dev.20260527.2",
|
|
42
42
|
"rimraf": "^6.1.2"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
@@ -111,7 +111,7 @@ type YieldExpression = innerast.YieldExpression
|
|
|
111
111
|
type RegularExpressionLiteral = innerast.RegularExpressionLiteral
|
|
112
112
|
type SatisfiesExpression = innerast.SatisfiesExpression
|
|
113
113
|
|
|
114
|
-
// ---- Comment directives (
|
|
114
|
+
// ---- Comment directives (banTsComment) ----
|
|
115
115
|
|
|
116
116
|
type CommentDirective = innerast.CommentDirective
|
|
117
117
|
type CommentDirectiveKind = innerast.CommentDirectiveKind
|
|
@@ -132,6 +132,12 @@ const (
|
|
|
132
132
|
NodeFlagsAwaitContext = innerast.NodeFlagsAwaitContext
|
|
133
133
|
)
|
|
134
134
|
|
|
135
|
+
// ---- Modifier-flag constants ----
|
|
136
|
+
|
|
137
|
+
const (
|
|
138
|
+
ModifierFlagsAmbient = innerast.ModifierFlagsAmbient
|
|
139
|
+
)
|
|
140
|
+
|
|
135
141
|
// ---- Statement / declaration / expression kinds ----
|
|
136
142
|
|
|
137
143
|
const (
|
|
@@ -46,6 +46,9 @@ const (
|
|
|
46
46
|
TypeFlagsNumberLike = innerchecker.TypeFlagsNumberLike
|
|
47
47
|
TypeFlagsBigIntLike = innerchecker.TypeFlagsBigIntLike
|
|
48
48
|
TypeFlagsBooleanLike = innerchecker.TypeFlagsBooleanLike
|
|
49
|
+
TypeFlagsEnum = innerchecker.TypeFlagsEnum
|
|
50
|
+
TypeFlagsEnumLiteral = innerchecker.TypeFlagsEnumLiteral
|
|
51
|
+
TypeFlagsEnumLike = innerchecker.TypeFlagsEnumLike
|
|
49
52
|
|
|
50
53
|
ObjectFlagsReference = innerchecker.ObjectFlagsReference
|
|
51
54
|
ObjectFlagsClass = innerchecker.ObjectFlagsClass
|
|
@@ -10,6 +10,9 @@ import innercore "github.com/microsoft/typescript-go/internal/core"
|
|
|
10
10
|
// TypeScript-Go program host.
|
|
11
11
|
type CompilerOptions = innercore.CompilerOptions
|
|
12
12
|
|
|
13
|
+
// JsxEmit is the parsed compilerOptions.jsx mode.
|
|
14
|
+
type JsxEmit = innercore.JsxEmit
|
|
15
|
+
|
|
13
16
|
// Tristate is a three-valued boolean: TSFalse, TSTrue, or TSUnknown. Used by
|
|
14
17
|
// CompilerOptions fields that can be explicitly unset.
|
|
15
18
|
type Tristate = innercore.Tristate
|
|
@@ -37,6 +40,14 @@ const (
|
|
|
37
40
|
ScriptKindExternal = innercore.ScriptKindExternal
|
|
38
41
|
ScriptKindJSON = innercore.ScriptKindJSON
|
|
39
42
|
ScriptKindDeferred = innercore.ScriptKindDeferred
|
|
43
|
+
|
|
44
|
+
// JsxEmit* constants enumerate compilerOptions.jsx modes.
|
|
45
|
+
JsxEmitNone = innercore.JsxEmitNone
|
|
46
|
+
JsxEmitPreserve = innercore.JsxEmitPreserve
|
|
47
|
+
JsxEmitReactNative = innercore.JsxEmitReactNative
|
|
48
|
+
JsxEmitReact = innercore.JsxEmitReact
|
|
49
|
+
JsxEmitReactJSX = innercore.JsxEmitReactJSX
|
|
50
|
+
JsxEmitReactJSXDev = innercore.JsxEmitReactJSXDev
|
|
40
51
|
)
|
|
41
52
|
|
|
42
53
|
// NewTextRange constructs a closed/open [pos, end) text range.
|