@bytecodealliance/jco 1.12.0 → 1.13.0-rc.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytecodealliance/jco",
3
- "version": "1.12.0",
3
+ "version": "1.13.0-rc.0",
4
4
  "description": "JavaScript tooling for working with WebAssembly Components",
5
5
  "homepage": "https://github.com/bytecodealliance/jco#readme",
6
6
  "author": "Guy Bedford",
@@ -66,31 +66,31 @@
66
66
  "prepack": "cargo xtask build release"
67
67
  },
68
68
  "dependencies": {
69
- "@bytecodealliance/componentize-js": "^0.18.3",
69
+ "@bytecodealliance/componentize-js": "^0.18.4",
70
70
  "@bytecodealliance/preview2-shim": "^0.17.2",
71
71
  "binaryen": "^123.0.0",
72
72
  "chalk-template": "^1",
73
- "commander": "^12",
73
+ "commander": "^14",
74
74
  "mkdirp": "^3",
75
75
  "ora": "^8",
76
76
  "terser": "^5"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@commitlint/config-conventional": "^19.8.1",
80
- "@types/node": "^22.15.17",
81
- "@typescript-eslint/eslint-plugin": "^8.2.0",
82
- "@typescript-eslint/parser": "^8.2.0",
80
+ "@types/node": "^24.0.15",
81
+ "@typescript-eslint/eslint-plugin": "^8.37.0",
82
+ "@typescript-eslint/parser": "^8.37.0",
83
83
  "commitlint": "^19.8.1",
84
- "conventional-changelog-conventionalcommits": "^8.0.0",
85
- "eslint": "^9.9.0",
86
- "eslint-config-prettier": "^10.1.1",
87
- "eslint-plugin-prettier": "^5.2.3",
88
- "mime": "^4.0.4",
89
- "prettier": "^3.5.3",
90
- "puppeteer": "^24.0.1",
84
+ "conventional-changelog-conventionalcommits": "^9.1.0",
85
+ "eslint": "^9.31.0",
86
+ "eslint-config-prettier": "^10.1.8",
87
+ "eslint-plugin-prettier": "^5.5.3",
88
+ "mime": "^4.0.7",
89
+ "prettier": "^3.6.2",
90
+ "puppeteer": "^24.14.0",
91
91
  "semver": "^7.7.1",
92
- "smol-toml": "^1.3.1",
92
+ "smol-toml": "^1.4.1",
93
93
  "typescript": "^5.8.3",
94
- "vitest": "^3.0.7"
94
+ "vitest": "^3.2.4"
95
95
  }
96
96
  }
@@ -8,7 +8,7 @@ export async function componentize(jsSource, opts) {
8
8
  'import("@bytecodealliance/componentize-js")'
9
9
  );
10
10
  if (opts.disable?.includes('all')) {
11
- opts.disable = ['stdio', 'random', 'clocks', 'http'];
11
+ opts.disable = ['stdio', 'random', 'clocks', 'http', 'fetch-event'];
12
12
  }
13
13
  const source = await readFile(jsSource, 'utf8');
14
14
 
package/src/jco.js CHANGED
@@ -24,7 +24,8 @@ program
24
24
  c`{bold jco - WebAssembly JS Component Tools}\n JS Component Transpilation Bindgen & Wasm Tools for JS`
25
25
  )
26
26
  .usage('<command> [options]')
27
- .version('1.12.0');
27
+ .enablePositionalOptions()
28
+ .version('1.13.0-rc.0');
28
29
 
29
30
  function myParseInt(value) {
30
31
  return parseInt(value, 10);
@@ -57,7 +58,7 @@ program
57
58
  new Option(
58
59
  '-d, --disable <feature...>',
59
60
  'disable WASI features'
60
- ).choices(['clocks', 'http', 'random', 'stdio', 'all'])
61
+ ).choices(['clocks', 'http', 'random', 'stdio', 'fetch-event', 'all'])
61
62
  )
62
63
  // .addOption(new Option('-e, --enable <feature...>', 'enable WASI features').choices(['http']))
63
64
  .option(
@@ -101,7 +102,10 @@ program
101
102
  '-m, --minify',
102
103
  'minify the JS output (--optimize / opt cmd still required)'
103
104
  )
104
- .option('-O, --optimize', 'optimize the component first')
105
+ .option(
106
+ '-O, --optimize',
107
+ `optimize the component first (use -- and arguments to wasm-opt)`
108
+ )
105
109
  .option('--no-typescript', 'do not output TypeScript .d.ts types')
106
110
  .option(
107
111
  '--valid-lifting-optimization',
@@ -174,10 +178,7 @@ program
174
178
  'disable namespaced exports for typescript compatibility'
175
179
  )
176
180
  .option('--multi-memory', 'optimized output for Wasm multi-memory')
177
- .option(
178
- '--',
179
- 'for --optimize, custom wasm-opt arguments (defaults to best size optimization)'
180
- )
181
+ .allowExcessArguments(true)
181
182
  .action(asyncAction(transpile));
182
183
 
183
184
  program
@@ -335,7 +336,7 @@ program
335
336
  .description(
336
337
  'optimizes a Wasm component, including running wasm-opt Binaryen optimizations'
337
338
  )
338
- .usage('<component-file> -o <output-file>')
339
+ .usage('<component-file> -o <output-file> -- [wasm-opt arguments]')
339
340
  .argument('<component-file>', 'Wasm component binary filepath')
340
341
  .requiredOption(
341
342
  '-o, --output <output-file>',
@@ -343,10 +344,7 @@ program
343
344
  )
344
345
  .option('--asyncify', 'runs Asyncify pass in wasm-opt')
345
346
  .option('-q, --quiet')
346
- .option(
347
- '--',
348
- 'custom wasm-opt arguments (defaults to best size optimization)'
349
- )
347
+ .allowExcessArguments(true)
350
348
  .action(asyncAction(opt));
351
349
 
352
350
  program