wasm-idle 1.2.0 → 1.4.0
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 +250 -146
- package/dist/container/clang-runtime.js +32 -8
- package/dist/container/runtime-adapter.d.ts +2 -0
- package/dist/container/runtime-adapter.js +37 -8
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/playground/assetBridge.js +10 -8
- package/dist/playground/assets.d.ts +4 -0
- package/dist/playground/assets.js +9 -4
- package/dist/playground/c3.js +1 -1
- package/dist/playground/compiledLldb.d.ts +2 -0
- package/dist/playground/compiledLldb.js +37 -2
- package/dist/playground/d.d.ts +1 -0
- package/dist/playground/d.js +18 -8
- package/dist/playground/index.d.ts +1 -1
- package/dist/playground/index.js +7 -0
- package/dist/playground/{java-debug-FMHDKUN6.js → java-debug-64JGCLTC.js} +1 -1
- package/dist/playground/java-debug-notices.txt +26 -1
- package/dist/playground/java.js +3 -2
- package/dist/playground/javaDebugBridge.js +42 -7
- package/dist/playground/javaDebugSource.js +4 -4
- package/dist/playground/javaMain.d.ts +3 -0
- package/dist/playground/javaMain.js +2 -0
- package/dist/playground/javaRuntimeErrors.d.ts +2 -1
- package/dist/playground/javaRuntimeErrors.js +9 -2
- package/dist/playground/javaSource.d.ts +1 -1
- package/dist/playground/javaSource.js +7 -2
- package/dist/playground/lldbSession.d.ts +2 -0
- package/dist/playground/lldbSession.js +60 -4
- package/dist/playground/objectivec.d.ts +1 -1
- package/dist/playground/objectivec.js +2 -1
- package/dist/playground/options.d.ts +1 -1
- package/dist/playground/python.d.ts +3 -0
- package/dist/playground/python.js +122 -2
- package/dist/playground/pythonCompileOptions.d.ts +52 -0
- package/dist/playground/pythonCompileOptions.js +40 -0
- package/dist/playground/scala.d.ts +34 -0
- package/dist/playground/scala.js +397 -0
- package/dist/playground/scalaAssets.d.ts +16 -0
- package/dist/playground/scalaAssets.js +51 -0
- package/dist/playground/scalaDiagnostics.d.ts +3 -0
- package/dist/playground/scalaDiagnostics.js +29 -0
- package/dist/playground/staticRuntimeModuleVersion.d.ts +1 -1
- package/dist/playground/staticRuntimeModuleVersion.js +1 -1
- package/dist/playground/staticWorkerRuntime.d.ts +2 -0
- package/dist/playground/staticWorkerRuntime.js +85 -11
- package/dist/playground/tinygo.js +21 -8
- package/dist/playground/tinygoExecutableGraph.js +1 -1
- package/dist/playground/v.d.ts +1 -0
- package/dist/playground/v.js +17 -7
- package/dist/playground/wasmC3Version.d.ts +8 -8
- package/dist/playground/wasmC3Version.js +8 -8
- package/dist/playground/wasmDebugVersion.d.ts +1 -1
- package/dist/playground/wasmDebugVersion.js +1 -1
- package/dist/playground/wasmDotnetVersion.d.ts +1 -1
- package/dist/playground/wasmDotnetVersion.js +1 -1
- package/dist/playground/wasmGoVersion.d.ts +1 -1
- package/dist/playground/wasmGoVersion.js +1 -1
- package/dist/playground/wasmLispVersion.d.ts +5 -0
- package/dist/playground/wasmLispVersion.js +5 -0
- package/dist/playground/wasmOcamlVersion.d.ts +4 -4
- package/dist/playground/wasmOcamlVersion.js +3 -3
- package/dist/playground/wasmPrologVersion.d.ts +17 -17
- package/dist/playground/wasmPrologVersion.js +16 -16
- package/dist/playground/wasmTinyGoVersion.d.ts +57 -57
- package/dist/playground/wasmTinyGoVersion.js +57 -57
- package/dist/playground/wasmTypeScriptVersion.d.ts +3 -3
- package/dist/playground/wasmTypeScriptVersion.js +3 -3
- package/dist/playground/wasmZigVersion.d.ts +7 -7
- package/dist/playground/wasmZigVersion.js +7 -7
- package/dist/playground/worker/java.js +18 -4
- package/dist/playground/worker/javaDebugEvaluator.js +2 -2
- package/dist/playground/worker/javaDebugRuntime.js +8 -1
- package/dist/playground/worker/javaStreaming.js +4 -2
- package/dist/playground/worker/ocaml.js +11 -10
- package/dist/playground/worker/python.js +45 -165
- package/dist/playground/worker/pythonCompile.d.ts +4 -0
- package/dist/playground/worker/pythonCompile.js +127 -0
- package/dist/playground/worker/pythonDebug.d.ts +20 -0
- package/dist/playground/worker/pythonDebug.js +205 -0
- package/dist/playground/worker/scala/UPSTREAM-LICENSE.txt +201 -0
- package/dist/playground/worker/scala/UPSTREAM-NOTICE.txt +108 -0
- package/dist/playground/worker/scala/asset-bootstrap.d.ts +6 -0
- package/dist/playground/worker/scala/asset-bootstrap.js +58 -0
- package/dist/playground/worker/scala/asset-receipts.d.ts +7 -0
- package/dist/playground/worker/scala/asset-receipts.js +58 -0
- package/dist/playground/worker/scala/compiler.worker.d.ts +1 -0
- package/dist/playground/worker/scala/compiler.worker.js +204 -0
- package/dist/playground/worker/scala/execution.worker.d.ts +1 -0
- package/dist/playground/worker/scala/execution.worker.js +89 -0
- package/dist/playground/worker/scala/memory-fs.d.ts +29 -0
- package/dist/playground/worker/scala/memory-fs.js +333 -0
- package/dist/playground/worker/scala/runner.d.ts +1 -0
- package/dist/playground/worker/scala/runner.js +36 -0
- package/dist/playground/worker/zig.d.ts +2 -1
- package/dist/playground/worker/zig.js +212 -86
- package/dist/playground/worker/zigDebug.d.ts +39 -0
- package/dist/playground/worker/zigDebug.js +156 -0
- package/dist/playground/zig.d.ts +27 -4
- package/dist/playground/zig.js +266 -23
- package/dist/playground/zigDebugValues.d.ts +20 -0
- package/dist/playground/zigDebugValues.js +248 -0
- package/dist/pythonCompiler.d.ts +8 -0
- package/dist/pythonCompiler.js +52 -0
- package/package.json +37 -26
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
const MAX_REFERENCES = 256;
|
|
2
|
+
const MAX_REQUESTS = 64;
|
|
3
|
+
const MAX_DEPTH = 4;
|
|
4
|
+
const PREVIEW_BYTES = 32;
|
|
5
|
+
const PAGE_SIZE = 64;
|
|
6
|
+
const WASM32_END = 0x1_0000_0000;
|
|
7
|
+
const addressOf = (value) => {
|
|
8
|
+
// LLDB's memoryReference on a pointer names its storage, not its pointee.
|
|
9
|
+
const match = /^(0x[\da-f]{1,8})(?:\s|$)/i.exec(value);
|
|
10
|
+
return match ? Number.parseInt(match[1], 16) : undefined;
|
|
11
|
+
};
|
|
12
|
+
const addressText = (address) => `0x${address.toString(16)}`;
|
|
13
|
+
const shortValue = (value) => (value.length > 160 ? `${value.slice(0, 160)}…` : value);
|
|
14
|
+
const isUnavailable = (variable) => variable.value === '?' || variable.value.startsWith('<');
|
|
15
|
+
function bytePreview(bytes, truncated) {
|
|
16
|
+
let text;
|
|
17
|
+
try {
|
|
18
|
+
// Streaming avoids replacing an incomplete UTF-8 character at the preview boundary.
|
|
19
|
+
text = JSON.stringify(new TextDecoder('utf-8', { fatal: true }).decode(bytes, { stream: truncated }));
|
|
20
|
+
}
|
|
21
|
+
catch {
|
|
22
|
+
text = '"';
|
|
23
|
+
for (const byte of bytes) {
|
|
24
|
+
text +=
|
|
25
|
+
byte >= 32 && byte < 127
|
|
26
|
+
? byte === 34 || byte === 92
|
|
27
|
+
? `\\${String.fromCharCode(byte)}`
|
|
28
|
+
: String.fromCharCode(byte)
|
|
29
|
+
: `\\x${byte.toString(16).padStart(2, '0')}`;
|
|
30
|
+
}
|
|
31
|
+
text += '"';
|
|
32
|
+
}
|
|
33
|
+
return text + (truncated ? '…' : '');
|
|
34
|
+
}
|
|
35
|
+
/** Pinned Zig DWARF layouts only. No expressions or user code are evaluated. */
|
|
36
|
+
export class ZigDebugValues {
|
|
37
|
+
backend;
|
|
38
|
+
epoch = 0;
|
|
39
|
+
children = new Map();
|
|
40
|
+
layouts = new Map();
|
|
41
|
+
constructor(backend) {
|
|
42
|
+
this.backend = backend;
|
|
43
|
+
}
|
|
44
|
+
invalidate() {
|
|
45
|
+
this.layouts.clear();
|
|
46
|
+
this.invalidateValues();
|
|
47
|
+
}
|
|
48
|
+
/** A memory write preserves DAP handles in this stop, but not their values. */
|
|
49
|
+
invalidateValues() {
|
|
50
|
+
this.epoch += 1;
|
|
51
|
+
this.children.clear();
|
|
52
|
+
}
|
|
53
|
+
async variables(reference, start, count) {
|
|
54
|
+
if (!Number.isSafeInteger(reference) || reference <= 0)
|
|
55
|
+
throw new RangeError('variablesReference must be a positive safe integer.');
|
|
56
|
+
for (const [name, value] of [
|
|
57
|
+
['start', start],
|
|
58
|
+
['count', count]
|
|
59
|
+
]) {
|
|
60
|
+
if (value !== undefined && (!Number.isSafeInteger(value) || value < 0))
|
|
61
|
+
throw new RangeError(`${name} must be a non-negative safe integer.`);
|
|
62
|
+
}
|
|
63
|
+
const budget = { requests: MAX_REQUESTS, epoch: this.epoch };
|
|
64
|
+
const children = this.children.get(reference);
|
|
65
|
+
if (children)
|
|
66
|
+
return this.expand(children, start ?? 0, count ?? PAGE_SIZE, budget);
|
|
67
|
+
const layout = this.layouts.get(reference);
|
|
68
|
+
if (layout) {
|
|
69
|
+
// Re-read the original native fields/tag/range before applying UI child paging.
|
|
70
|
+
// Paging the native ptr/len fields as byte indices would silently lose pages.
|
|
71
|
+
await this.format(layout, budget, 0);
|
|
72
|
+
const refreshed = this.children.get(reference);
|
|
73
|
+
return refreshed && budget.epoch === this.epoch
|
|
74
|
+
? this.expand(refreshed, start ?? 0, count ?? PAGE_SIZE, budget)
|
|
75
|
+
: [];
|
|
76
|
+
}
|
|
77
|
+
const values = await this.backend.variables(reference, start, count);
|
|
78
|
+
const result = [];
|
|
79
|
+
for (const value of values) {
|
|
80
|
+
if (budget.epoch !== this.epoch)
|
|
81
|
+
return [];
|
|
82
|
+
result.push(await this.format(value, budget, 0));
|
|
83
|
+
}
|
|
84
|
+
return budget.epoch === this.epoch ? result : [];
|
|
85
|
+
}
|
|
86
|
+
describe(variable, value, children) {
|
|
87
|
+
const reference = variable.variablesReference;
|
|
88
|
+
if (this.layouts.size >= MAX_REFERENCES && !this.layouts.has(reference))
|
|
89
|
+
return variable;
|
|
90
|
+
this.layouts.set(reference, variable);
|
|
91
|
+
this.children.set(reference, children);
|
|
92
|
+
const indexedVariables = children.bytes?.length ?? 0;
|
|
93
|
+
return {
|
|
94
|
+
...variable,
|
|
95
|
+
value,
|
|
96
|
+
variablesReference: children.fields.length || indexedVariables ? reference : 0,
|
|
97
|
+
namedVariables: children.fields.length,
|
|
98
|
+
indexedVariables
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
async format(variable, budget, depth) {
|
|
102
|
+
const type = variable.type ?? '';
|
|
103
|
+
const reference = variable.variablesReference;
|
|
104
|
+
if (isUnavailable(variable) ||
|
|
105
|
+
type.length > 1024 ||
|
|
106
|
+
depth >= MAX_DEPTH ||
|
|
107
|
+
budget.requests <= 0 ||
|
|
108
|
+
budget.epoch !== this.epoch ||
|
|
109
|
+
(this.layouts.size >= MAX_REFERENCES && !this.layouts.has(reference ?? 0)))
|
|
110
|
+
return variable;
|
|
111
|
+
if (type.startsWith('?*')) {
|
|
112
|
+
const address = addressOf(variable.value);
|
|
113
|
+
if (address === undefined)
|
|
114
|
+
return variable;
|
|
115
|
+
if (address !== 0)
|
|
116
|
+
return { ...variable, value: `some(${shortValue(variable.value)})` };
|
|
117
|
+
return {
|
|
118
|
+
...variable,
|
|
119
|
+
value: 'null',
|
|
120
|
+
variablesReference: 0,
|
|
121
|
+
namedVariables: 0,
|
|
122
|
+
indexedVariables: 0
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
if (!reference)
|
|
126
|
+
return variable;
|
|
127
|
+
const slice = /^(\?)?\[\](?:const )?(.+)$/.exec(type);
|
|
128
|
+
const optional = type.startsWith('?');
|
|
129
|
+
const errorUnion = /^(?:error\{[^{}\r\n]*\}|anyerror)!(.+)$/.exec(type);
|
|
130
|
+
if (!slice && !optional && !errorUnion)
|
|
131
|
+
return variable;
|
|
132
|
+
budget.requests -= 1;
|
|
133
|
+
let fields;
|
|
134
|
+
try {
|
|
135
|
+
// Two members in each supported layout; a third member rejects lookalike layouts.
|
|
136
|
+
fields = await this.backend.variables(reference, 0, 3);
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return variable;
|
|
140
|
+
}
|
|
141
|
+
if (budget.epoch !== this.epoch)
|
|
142
|
+
return variable;
|
|
143
|
+
const field = (name) => fields.find((entry) => entry.name === name);
|
|
144
|
+
const payload = field('payload');
|
|
145
|
+
if (slice) {
|
|
146
|
+
const pointer = field('ptr');
|
|
147
|
+
const length = field('len');
|
|
148
|
+
if (fields.length !== 2 || !pointer || !length)
|
|
149
|
+
return variable;
|
|
150
|
+
const address = addressOf(pointer.value);
|
|
151
|
+
if (slice[1] && address === 0)
|
|
152
|
+
return this.describe(variable, 'null', { fields: [] });
|
|
153
|
+
const size = /^\d{1,10}$/.test(length.value) ? Number(length.value) : NaN;
|
|
154
|
+
if (address === undefined || !Number.isInteger(size) || size > 0xffff_ffff)
|
|
155
|
+
return variable;
|
|
156
|
+
const metadata = { fields: [pointer, length] };
|
|
157
|
+
if (slice[2] === 'u8' && ((address === 0 && size > 0) || address + size > WASM32_END))
|
|
158
|
+
return this.describe(variable, '<unavailable: invalid slice range>', metadata);
|
|
159
|
+
let value = `len=${size}, ptr=${addressText(address)}`;
|
|
160
|
+
let bytes;
|
|
161
|
+
if (slice[2] === 'u8') {
|
|
162
|
+
const preview = size === 0
|
|
163
|
+
? new Uint8Array()
|
|
164
|
+
: await this.readBytes(address, Math.min(size, PREVIEW_BYTES), budget);
|
|
165
|
+
if (budget.epoch !== this.epoch)
|
|
166
|
+
return variable;
|
|
167
|
+
if (preview) {
|
|
168
|
+
value = `len=${size} ${bytePreview(preview, size > preview.length)}`;
|
|
169
|
+
bytes = { address, length: size };
|
|
170
|
+
}
|
|
171
|
+
else
|
|
172
|
+
value += ' <preview unavailable>';
|
|
173
|
+
}
|
|
174
|
+
return this.describe(variable, slice[1] ? `some(${value})` : value, {
|
|
175
|
+
...metadata,
|
|
176
|
+
bytes
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
if (optional) {
|
|
180
|
+
const some = field('some');
|
|
181
|
+
if (fields.length !== 2 || !payload || !some)
|
|
182
|
+
return variable;
|
|
183
|
+
if (['0', "'\\0'", "'\\x00'"].includes(some.value))
|
|
184
|
+
return this.describe(variable, 'null', { fields: [] });
|
|
185
|
+
if (!['1', "'\\x01'"].includes(some.value))
|
|
186
|
+
return this.describe(variable, '<unavailable: invalid optional tag>', {
|
|
187
|
+
fields: []
|
|
188
|
+
});
|
|
189
|
+
const value = await this.format(payload, budget, depth + 1);
|
|
190
|
+
if (budget.epoch !== this.epoch)
|
|
191
|
+
return variable;
|
|
192
|
+
return this.describe(variable, `some(${shortValue(value.value)})`, { fields: [value] });
|
|
193
|
+
}
|
|
194
|
+
const error = field('error');
|
|
195
|
+
const voidPayload = errorUnion[1] === 'void';
|
|
196
|
+
if (!error || fields.length !== (voidPayload ? 1 : 2) || (!voidPayload && !payload))
|
|
197
|
+
return variable;
|
|
198
|
+
if (error.value === 'null') {
|
|
199
|
+
if (voidPayload)
|
|
200
|
+
return this.describe(variable, '{}', { fields: [] });
|
|
201
|
+
const value = await this.format(payload, budget, depth + 1);
|
|
202
|
+
if (budget.epoch !== this.epoch)
|
|
203
|
+
return variable;
|
|
204
|
+
return this.describe(variable, shortValue(value.value), { fields: [value] });
|
|
205
|
+
}
|
|
206
|
+
return this.describe(variable, error.value.startsWith('error.')
|
|
207
|
+
? shortValue(error.value)
|
|
208
|
+
: '<unavailable: invalid error tag>', { fields: [error] });
|
|
209
|
+
}
|
|
210
|
+
async readBytes(address, count, budget) {
|
|
211
|
+
if (budget.requests <= 0 || budget.epoch !== this.epoch)
|
|
212
|
+
return null;
|
|
213
|
+
budget.requests -= 1;
|
|
214
|
+
try {
|
|
215
|
+
const memory = await this.backend.readMemory(addressText(address), 0, count);
|
|
216
|
+
return budget.epoch === this.epoch &&
|
|
217
|
+
memory?.data.length === count &&
|
|
218
|
+
!memory.unreadableBytes
|
|
219
|
+
? memory.data
|
|
220
|
+
: null;
|
|
221
|
+
}
|
|
222
|
+
catch {
|
|
223
|
+
return null;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
async expand(children, start, count, budget) {
|
|
227
|
+
// Named metadata precedes byte indices, matching the debugger tree's paging contract.
|
|
228
|
+
const end = start + Math.min(count, PAGE_SIZE);
|
|
229
|
+
const values = children.fields.slice(start, end);
|
|
230
|
+
const bytes = children.bytes;
|
|
231
|
+
if (bytes) {
|
|
232
|
+
const first = Math.max(0, start - children.fields.length);
|
|
233
|
+
const last = Math.min(bytes.length, end - children.fields.length);
|
|
234
|
+
if (last > first) {
|
|
235
|
+
const memory = await this.readBytes(bytes.address + first, last - first, budget);
|
|
236
|
+
for (let index = first; index < last; index += 1)
|
|
237
|
+
values.push({
|
|
238
|
+
name: `[${index}]`,
|
|
239
|
+
value: memory ? String(memory[index - first]) : '<unavailable>',
|
|
240
|
+
type: 'u8',
|
|
241
|
+
variablesReference: 0,
|
|
242
|
+
memoryReference: addressText(bytes.address + index)
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return budget.epoch === this.epoch ? values : [];
|
|
247
|
+
}
|
|
248
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PythonCompileOptions, PythonCompileResult } from './playground/pythonCompileOptions';
|
|
2
|
+
export type { PythonCompileOptions, PythonCompileResult } from './playground/pythonCompileOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Compile one source file without executing it or loading its imports.
|
|
5
|
+
* A dedicated worker keeps compilation independent of active playground sessions.
|
|
6
|
+
* Its runtime, temporary files, and proxies are disposed on every exit path.
|
|
7
|
+
*/
|
|
8
|
+
export declare function compilePython(code: string, options?: PythonCompileOptions): Promise<PythonCompileResult>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { TimeoutError } from '@wasm-idle/core';
|
|
2
|
+
import { resolvePythonCompileRequest } from './playground/pythonCompileOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Compile one source file without executing it or loading its imports.
|
|
5
|
+
* A dedicated worker keeps compilation independent of active playground sessions.
|
|
6
|
+
* Its runtime, temporary files, and proxies are disposed on every exit path.
|
|
7
|
+
*/
|
|
8
|
+
export async function compilePython(code, options = {}) {
|
|
9
|
+
const request = { ...options, ...resolvePythonCompileRequest(code, options) };
|
|
10
|
+
request.signal?.throwIfAborted();
|
|
11
|
+
const importStartedAt = performance.now();
|
|
12
|
+
const { startupTimeoutMs } = request.limits;
|
|
13
|
+
const startupTimeout = new TimeoutError(`Python runtime startup timed out after ${startupTimeoutMs} ms`, { runtimeId: 'PYTHON3', phase: 'startup', timeoutMs: startupTimeoutMs });
|
|
14
|
+
let timeout;
|
|
15
|
+
let onAbort;
|
|
16
|
+
// Native imports cannot be cancelled, but callers must not wait for a stalled chunk.
|
|
17
|
+
// The race also handles late import failures without creating a compiler afterward.
|
|
18
|
+
const { default: Python } = await Promise.race([
|
|
19
|
+
import('./playground/python'),
|
|
20
|
+
new Promise((_resolve, reject) => {
|
|
21
|
+
timeout = setTimeout(() => reject(startupTimeout), startupTimeoutMs);
|
|
22
|
+
onAbort = () => reject(request.signal?.reason);
|
|
23
|
+
request.signal?.addEventListener('abort', onAbort, { once: true });
|
|
24
|
+
if (request.signal?.aborted)
|
|
25
|
+
onAbort();
|
|
26
|
+
})
|
|
27
|
+
]).finally(() => {
|
|
28
|
+
if (timeout !== undefined)
|
|
29
|
+
clearTimeout(timeout);
|
|
30
|
+
if (onAbort)
|
|
31
|
+
request.signal?.removeEventListener('abort', onAbort);
|
|
32
|
+
});
|
|
33
|
+
request.signal?.throwIfAborted();
|
|
34
|
+
const remainingStartupMs = Math.ceil(startupTimeoutMs - (performance.now() - importStartedAt));
|
|
35
|
+
if (remainingStartupMs <= 0)
|
|
36
|
+
throw startupTimeout;
|
|
37
|
+
const compiler = new Python();
|
|
38
|
+
try {
|
|
39
|
+
await compiler.load(request.runtimeAssets, '', false, [], { ...request, limits: { ...request.limits, startupTimeoutMs: remainingStartupMs } }, request.progress);
|
|
40
|
+
return await compiler.compile(code, request);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (request.signal?.aborted && error === request.signal.reason)
|
|
44
|
+
throw error;
|
|
45
|
+
if (typeof error === 'string')
|
|
46
|
+
throw new Error(error);
|
|
47
|
+
throw error;
|
|
48
|
+
}
|
|
49
|
+
finally {
|
|
50
|
+
await compiler.dispose();
|
|
51
|
+
}
|
|
52
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wasm-idle",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "A simple web app to run code in the browser",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -17,64 +17,66 @@
|
|
|
17
17
|
"@eslint/js": "^10.0.1",
|
|
18
18
|
"@sveltejs/adapter-auto": "^8.0.0",
|
|
19
19
|
"@sveltejs/adapter-static": "^4.0.0",
|
|
20
|
-
"@sveltejs/kit": "^3.0
|
|
21
|
-
"@sveltejs/package": "^3.0.
|
|
20
|
+
"@sveltejs/kit": "^3.1.0",
|
|
21
|
+
"@sveltejs/package": "^3.0.1",
|
|
22
22
|
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
23
23
|
"@testing-library/svelte": "^5.4.2",
|
|
24
|
-
"@testing-library/user-event": "^14.6.
|
|
24
|
+
"@testing-library/user-event": "^14.6.8",
|
|
25
25
|
"@assemblyscript/loader": "0.28.20",
|
|
26
26
|
"@duckdb/duckdb-wasm": "1.33.1-dev57.0",
|
|
27
|
-
"@electric-sql/pglite": "0.5.
|
|
27
|
+
"@electric-sql/pglite": "0.5.11",
|
|
28
|
+
"@katana-project/asm": "0.25.4",
|
|
28
29
|
"@live-codes/gleam-precompiled": "0.5.0",
|
|
29
30
|
"@ruby/3.4-wasm-wasi": "2.10.1",
|
|
30
31
|
"@ruby/wasm-wasi": "2.10.1",
|
|
31
32
|
"@seorii/monaco": "0.2.0",
|
|
32
33
|
"@swmansion/popcorn": "0.3.3",
|
|
33
|
-
"@types/node": "^24.19.
|
|
34
|
+
"@types/node": "^24.19.2",
|
|
34
35
|
"@types/sql.js": "^1.4.11",
|
|
35
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
36
|
-
"@typescript-eslint/parser": "^8.
|
|
37
|
-
"@wasm-idle/container": "0.2.
|
|
38
|
-
"@wasm-idle/debug": "1.
|
|
39
|
-
"@wasm-idle/
|
|
40
|
-
"@wasm-idle/
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^8.72.0",
|
|
37
|
+
"@typescript-eslint/parser": "^8.72.0",
|
|
38
|
+
"@wasm-idle/container": "0.2.2",
|
|
39
|
+
"@wasm-idle/debug": "1.4.0",
|
|
40
|
+
"@wasm-idle/gcc": "1.4.0",
|
|
41
|
+
"@wasm-idle/lsp": "1.4.0",
|
|
42
|
+
"@wasm-idle/terminal": "1.4.0",
|
|
41
43
|
"@wasmer/sdk": "0.10.0",
|
|
42
44
|
"assemblyscript": "0.28.20",
|
|
43
45
|
"esbuild": "0.28.2",
|
|
44
|
-
"eslint": "^10.
|
|
46
|
+
"eslint": "^10.13.0",
|
|
45
47
|
"eslint-config-prettier": "^10.1.8",
|
|
46
|
-
"eslint-plugin-svelte": "^3.23.
|
|
48
|
+
"eslint-plugin-svelte": "^3.23.1",
|
|
47
49
|
"eslint-plugin-svelte3": "^4.0.0",
|
|
48
50
|
"gh-pages": "^6.3.0",
|
|
49
51
|
"globals": "^17.13.0",
|
|
50
|
-
"jsdom": "^30.1.
|
|
52
|
+
"jsdom": "^30.1.3",
|
|
51
53
|
"java-parser": "3.0.1",
|
|
52
54
|
"monaco-editor": "^0.55.1",
|
|
53
|
-
"playwright-core": "^1.
|
|
54
|
-
"prettier": "^3.9.
|
|
55
|
+
"playwright-core": "^1.64.1",
|
|
56
|
+
"prettier": "^3.9.10",
|
|
55
57
|
"prettier-plugin-svelte": "^4.1.1",
|
|
56
58
|
"publint": "^0.3.25",
|
|
57
59
|
"pyodide": "314.0.7",
|
|
58
|
-
"sql.js": "^1.
|
|
60
|
+
"sql.js": "^1.15.1",
|
|
59
61
|
"svelte": "^5.57.2",
|
|
60
|
-
"svelte-check": "^4.7.
|
|
61
|
-
"swipl-wasm": "8.2.
|
|
62
|
+
"svelte-check": "^4.7.7",
|
|
63
|
+
"swipl-wasm": "8.2.5",
|
|
62
64
|
"tslib": "^2.8.1",
|
|
63
65
|
"typescript": "^6.0.3",
|
|
64
|
-
"typescript-eslint": "^8.
|
|
66
|
+
"typescript-eslint": "^8.72.0",
|
|
65
67
|
"vite": "^8.3.3",
|
|
66
|
-
"vitest": "^5.0.
|
|
68
|
+
"vitest": "^5.0.5",
|
|
67
69
|
"waforth": "0.20.1",
|
|
68
70
|
"webr": "0.6.0"
|
|
69
71
|
},
|
|
70
72
|
"dependencies": {
|
|
71
73
|
"@bjorn3/browser_wasi_shim": "^0.4.2",
|
|
72
|
-
"@wasm-idle/core": "1.
|
|
73
|
-
"@wasm-idle/llvm-core": "1.
|
|
74
|
+
"@wasm-idle/core": "1.4.0",
|
|
75
|
+
"@wasm-idle/llvm-core": "1.4.0",
|
|
74
76
|
"fflate": "0.8.3"
|
|
75
77
|
},
|
|
76
78
|
"peerDependencies": {
|
|
77
|
-
"@wasm-idle/container": "0.2.
|
|
79
|
+
"@wasm-idle/container": "0.2.2"
|
|
78
80
|
},
|
|
79
81
|
"peerDependenciesMeta": {
|
|
80
82
|
"@wasm-idle/container": {
|
|
@@ -136,6 +138,9 @@
|
|
|
136
138
|
"sync:pyodide": "node scripts/sync-pyodide.mjs",
|
|
137
139
|
"test:browser:clang-stdin": "WASM_IDLE_RUN_REAL_BROWSER_CLANG_STDIN=1 pnpm exec vitest run src/lib/playground/stdin.playwright.test.ts",
|
|
138
140
|
"test:browser:compiler-options": "WASM_IDLE_REQUIRE_BROWSER_TESTS=1 WASM_IDLE_RUN_REAL_BROWSER_COMPILER_OPTIONS=1 pnpm exec vitest run src/routes/compiler-options.playwright.test.ts",
|
|
141
|
+
"test:browser:gcc-worker-contract": "WASM_IDLE_RUN_GCC_WORKER_BROWSER=1 node --test scripts/gcc-worker-contract.browser.test.mjs",
|
|
142
|
+
"fuzz:gcc-contract": "node scripts/gcc-contract-fuzz.mjs",
|
|
143
|
+
"fuzz:gcc-browser": "node scripts/fuzz-x86-cross-gcc.mjs",
|
|
139
144
|
"test:browser:fortran": "WASM_IDLE_RUN_REAL_BROWSER_FORTRAN=1 pnpm exec vitest run src/lib/playground/stdin.playwright.test.ts",
|
|
140
145
|
"test:browser:cobol": "WASM_IDLE_RUN_REAL_BROWSER_COBOL=1 pnpm exec vitest run src/lib/playground/stdin.playwright.test.ts",
|
|
141
146
|
"test:browser:v": "WASM_IDLE_RUN_REAL_BROWSER_V=1 pnpm exec vitest run src/lib/playground/stdin.playwright.test.ts -t \"V \"",
|
|
@@ -173,6 +178,7 @@
|
|
|
173
178
|
"test:browser:tinygo": "WASM_IDLE_RUN_REAL_BROWSER_TINYGO=1 pnpm exec vitest run src/lib/playground/tinygo.playwright.test.ts",
|
|
174
179
|
"test:browser:languages:full": "node scripts/run-all-language-browser-tests.mjs",
|
|
175
180
|
"test:browser:audit:full": "node scripts/run-all-language-browser-tests.mjs --include-compressed-assets --include-lsp-full",
|
|
181
|
+
"test:browser:page-smoke": "node scripts/page-browser-smoke.mjs",
|
|
176
182
|
"prepare:test-assets": "node scripts/prepare-browser-test-assets.mjs",
|
|
177
183
|
"sync:runtime": "node scripts/sync-runtime.mjs",
|
|
178
184
|
"sync:runtimes": "node scripts/sync-runtime.mjs all",
|
|
@@ -268,6 +274,7 @@
|
|
|
268
274
|
"test:browser:c3": "WASM_IDLE_RUN_REAL_BROWSER_C3=1 pnpm exec vitest run src/lib/playground/c3.playwright.test.ts",
|
|
269
275
|
"test:unit:c3": "node --test scripts/c3-memory.test.mjs scripts/c3-stdin.test.mjs scripts/sync-wasm-c3.test.mjs",
|
|
270
276
|
"verify:page-c3": "node scripts/verify-page-c3-compiler.mjs",
|
|
277
|
+
"verify:page-assets": "node scripts/verify-page-assets.mjs",
|
|
271
278
|
"test:page-compiler-assets": "node --test scripts/verify-pinned-runtime-assets.test.mjs scripts/verify-page-*-compiler.test.mjs",
|
|
272
279
|
"probe:crystal-wasi-consumer": "node scripts/probe-crystal-wasi-consumer.mjs",
|
|
273
280
|
"test:unit:crystal-consumer": "node --test scripts/probe-crystal-wasi-consumer.test.mjs",
|
|
@@ -319,6 +326,10 @@
|
|
|
319
326
|
"test:lsp:browser:v": "WASM_IDLE_RUN_REAL_BROWSER_V_LSP=1 node --test scripts/v-lsp.browser.test.mjs",
|
|
320
327
|
"sync:nim-lsp": "node scripts/sync-nim-lsp.mjs",
|
|
321
328
|
"test:lsp:assets:nim": "pnpm run sync:nim-lsp && WASM_IDLE_RUN_NIM_LSP_ASSET_BUILD=1 node --test scripts/sync-nim-lsp.test.mjs",
|
|
322
|
-
"test:lsp:browser:nim": "pnpm run sync:nim-lsp && python3 producers/nim-lsp/build.py --native && WASM_IDLE_RUN_NIM_LSP_BROWSER=1 pnpm --dir packages/lsp exec vitest run test/nim.playwright.test.ts --pool threads --maxWorkers 1 --no-file-parallelism"
|
|
329
|
+
"test:lsp:browser:nim": "pnpm run sync:nim-lsp && python3 producers/nim-lsp/build.py --native && WASM_IDLE_RUN_NIM_LSP_BROWSER=1 pnpm --dir packages/lsp exec vitest run test/nim.playwright.test.ts --pool threads --maxWorkers 1 --no-file-parallelism",
|
|
330
|
+
"test:zig:browser": "node scripts/zig017-browser-smoke.mjs",
|
|
331
|
+
"sync:wasm-scala": "node scripts/sync-wasm-scala.mjs",
|
|
332
|
+
"test:scala": "vitest run --config vitest.scala.config.ts",
|
|
333
|
+
"test:browser:scala": "WASM_IDLE_RUN_REAL_BROWSER_SCALA=1 vitest run --config vitest.scala.config.ts src/lib/playground/scala.playwright.test.ts"
|
|
323
334
|
}
|
|
324
335
|
}
|