@bytecodealliance/jco 0.13.2 → 0.14.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 +23 -21
- package/lib/wasi_snapshot_preview1.command.wasm +0 -0
- package/lib/wasi_snapshot_preview1.reactor.wasm +0 -0
- package/obj/interfaces/wasi-filesystem-types.d.ts +4 -9
- package/obj/interfaces/wasi-io-error.d.ts +6 -0
- package/obj/interfaces/wasi-io-streams.d.ts +2 -4
- package/obj/js-component-bindgen-component.component.wasm +0 -0
- package/obj/js-component-bindgen-component.core.wasm +0 -0
- package/obj/js-component-bindgen-component.core2.wasm +0 -0
- package/obj/js-component-bindgen-component.d.ts +27 -18
- package/obj/js-component-bindgen-component.js +849 -784
- package/obj/wasm-tools.component.wasm +0 -0
- package/obj/wasm-tools.core.wasm +0 -0
- package/obj/wasm-tools.core2.wasm +0 -0
- package/obj/wasm-tools.d.ts +18 -17
- package/obj/wasm-tools.js +779 -751
- package/package.json +3 -3
- package/src/api.d.ts +42 -0
- package/src/api.d.ts.map +1 -0
- package/src/browser.d.ts +4 -0
- package/src/browser.d.ts.map +1 -0
- package/src/cmd/componentize.d.ts +2 -0
- package/src/cmd/componentize.d.ts.map +1 -0
- package/src/cmd/componentize.js +1 -0
- package/src/cmd/opt.d.ts +15 -0
- package/src/cmd/opt.d.ts.map +1 -0
- package/src/cmd/run.d.ts +2 -0
- package/src/cmd/run.d.ts.map +1 -0
- package/src/cmd/run.js +23 -6
- package/src/cmd/transpile.d.ts +44 -0
- package/src/cmd/transpile.d.ts.map +1 -0
- package/src/cmd/transpile.js +206 -45
- package/src/cmd/wasm-tools.d.ts +8 -0
- package/src/cmd/wasm-tools.d.ts.map +1 -0
- package/src/cmd/wasm-tools.js +3 -2
- package/src/common.d.ts +16 -0
- package/src/common.d.ts.map +1 -0
- package/src/common.js +3 -0
- package/src/jco.d.ts +3 -0
- package/src/jco.d.ts.map +1 -0
- package/src/jco.js +9 -4
- package/src/ora-shim.d.ts +7 -0
- package/src/ora-shim.d.ts.map +1 -0
package/src/common.js
CHANGED
|
@@ -4,6 +4,9 @@ import { readFile, writeFile, rm, mkdtemp } from 'node:fs/promises';
|
|
|
4
4
|
import { spawn } from 'node:child_process';
|
|
5
5
|
import { argv0 } from 'node:process';
|
|
6
6
|
import c from 'chalk-template';
|
|
7
|
+
import { platform } from 'node:process';
|
|
8
|
+
|
|
9
|
+
export const isWindows = platform === 'win32';
|
|
7
10
|
|
|
8
11
|
let _showSpinner = false;
|
|
9
12
|
export function setShowSpinner (val) {
|
package/src/jco.d.ts
ADDED
package/src/jco.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jco.d.ts","sourceRoot":"","sources":["jco.js"],"names":[],"mappings":""}
|
package/src/jco.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { program } from 'commander';
|
|
2
|
+
import { program, Option } from 'commander';
|
|
3
3
|
import { opt } from './cmd/opt.js';
|
|
4
4
|
import { transpile } from './cmd/transpile.js';
|
|
5
5
|
import { run } from './cmd/run.js';
|
|
@@ -11,7 +11,7 @@ program
|
|
|
11
11
|
.name('jco')
|
|
12
12
|
.description(c`{bold jco - WebAssembly JS Component Tools}\n JS Component Transpilation Bindgen & Wasm Tools for JS`)
|
|
13
13
|
.usage('<command> [options]')
|
|
14
|
-
.version('0.
|
|
14
|
+
.version('0.14.0');
|
|
15
15
|
|
|
16
16
|
function myParseInt(value) {
|
|
17
17
|
return parseInt(value, 10);
|
|
@@ -45,15 +45,20 @@ program.command('transpile')
|
|
|
45
45
|
.option('-M, --map <mappings...>', 'specifier=./output custom mappings for the component imports')
|
|
46
46
|
.option('--no-wasi-shim', 'disable automatic rewriting of WASI imports to use @bytecodealliance/preview2-shim')
|
|
47
47
|
.option('--js', 'output JS instead of core WebAssembly')
|
|
48
|
-
.
|
|
48
|
+
.addOption(new Option('-I, --instantiation [mode]', 'output for custom module instantiation').choices(['async', 'sync']).preset('async'))
|
|
49
49
|
.option('-q, --quiet', 'disable logging')
|
|
50
|
+
.option('--no-namespaced-exports', 'disable namespaced exports for typescript compatibility')
|
|
50
51
|
.option('--', 'for --optimize, custom wasm-opt arguments (defaults to best size optimization)')
|
|
51
52
|
.action(asyncAction(transpile));
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
program.command('run')
|
|
54
55
|
.description('Run a WebAssembly Command component')
|
|
55
56
|
.usage('<command.wasm> <args...>')
|
|
57
|
+
.helpOption(false)
|
|
56
58
|
.argument('<command>', 'Wasm command binary to run')
|
|
59
|
+
.option('--jco-dir <dir>', 'Instead of using a temporary dir, set the output directory for the run command')
|
|
60
|
+
.option('--jco-trace', 'Enable call tracing')
|
|
61
|
+
.option('--jco-import <module>', 'Custom module to import before the run executes to support custom environment setup')
|
|
57
62
|
.argument('[args...]', 'Any CLI arguments to provide to the command')
|
|
58
63
|
.action(asyncAction(run));
|
|
59
64
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ora-shim.d.ts","sourceRoot":"","sources":["ora-shim.js"],"names":[],"mappings":"AACA,mCAEC;AAED;IACE,cAAW;IACX,aAAU;CACX"}
|