@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.
Files changed (43) hide show
  1. package/README.md +23 -21
  2. package/lib/wasi_snapshot_preview1.command.wasm +0 -0
  3. package/lib/wasi_snapshot_preview1.reactor.wasm +0 -0
  4. package/obj/interfaces/wasi-filesystem-types.d.ts +4 -9
  5. package/obj/interfaces/wasi-io-error.d.ts +6 -0
  6. package/obj/interfaces/wasi-io-streams.d.ts +2 -4
  7. package/obj/js-component-bindgen-component.component.wasm +0 -0
  8. package/obj/js-component-bindgen-component.core.wasm +0 -0
  9. package/obj/js-component-bindgen-component.core2.wasm +0 -0
  10. package/obj/js-component-bindgen-component.d.ts +27 -18
  11. package/obj/js-component-bindgen-component.js +849 -784
  12. package/obj/wasm-tools.component.wasm +0 -0
  13. package/obj/wasm-tools.core.wasm +0 -0
  14. package/obj/wasm-tools.core2.wasm +0 -0
  15. package/obj/wasm-tools.d.ts +18 -17
  16. package/obj/wasm-tools.js +779 -751
  17. package/package.json +3 -3
  18. package/src/api.d.ts +42 -0
  19. package/src/api.d.ts.map +1 -0
  20. package/src/browser.d.ts +4 -0
  21. package/src/browser.d.ts.map +1 -0
  22. package/src/cmd/componentize.d.ts +2 -0
  23. package/src/cmd/componentize.d.ts.map +1 -0
  24. package/src/cmd/componentize.js +1 -0
  25. package/src/cmd/opt.d.ts +15 -0
  26. package/src/cmd/opt.d.ts.map +1 -0
  27. package/src/cmd/run.d.ts +2 -0
  28. package/src/cmd/run.d.ts.map +1 -0
  29. package/src/cmd/run.js +23 -6
  30. package/src/cmd/transpile.d.ts +44 -0
  31. package/src/cmd/transpile.d.ts.map +1 -0
  32. package/src/cmd/transpile.js +206 -45
  33. package/src/cmd/wasm-tools.d.ts +8 -0
  34. package/src/cmd/wasm-tools.d.ts.map +1 -0
  35. package/src/cmd/wasm-tools.js +3 -2
  36. package/src/common.d.ts +16 -0
  37. package/src/common.d.ts.map +1 -0
  38. package/src/common.js +3 -0
  39. package/src/jco.d.ts +3 -0
  40. package/src/jco.d.ts.map +1 -0
  41. package/src/jco.js +9 -4
  42. package/src/ora-shim.d.ts +7 -0
  43. 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
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=jco.d.ts.map
@@ -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.13.2');
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
- .option('-I, --instantiation', 'output for custom module instantiation')
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
- program.command('run')
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,7 @@
1
+ export default function ora(): Ora;
2
+ declare class Ora {
3
+ start(): void;
4
+ stop(): void;
5
+ }
6
+ export {};
7
+ //# sourceMappingURL=ora-shim.d.ts.map
@@ -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"}