Skip to content

Commit 64b9e31

Browse files
committed
feat: expose more programatic API via CLI
1 parent 7edb725 commit 64b9e31

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,8 @@ Before being able to use `componentize-js` with AOT support (ex. via `npm link`,
351351
npm run build:weval
352352
```
353353

354+
(`npm run build` will also execute the weval build)
355+
354356
This will produce `lib/starlingmonkey_embedding_weval.wasm` and `lib/starlingmonkey_ics.wevalcache`.
355357

356358
To clean up a local installation (i.e. remove the installation of StarlingMonkey):

crates/spidermonkey-embedding-splicer/src/splice.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,7 +759,7 @@ fn synthesize_import_functions(
759759
.unwrap();
760760

761761
// Save the idx parameter to local at the start of the function,
762-
// so that orignal code does not oeverwrit it.
762+
// so that original code does not overwrite it.
763763
let idx_local = builder.add_local(DataType::I32);
764764
builder.inject_at(
765765
0,

src/cli.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,16 @@ export async function componentizeCmd(jsSource, opts) {
1212
worldName: opts.worldName,
1313
runtimeArgs: opts.runtimeArgs,
1414
enableAot: opts.aot,
15+
engine: opts.engine,
1516
disableFeatures: opts.disable,
1617
preview2Adapter: opts.preview2Adapter,
1718
debugBindings: opts.debugBindings,
1819
debugBuild: opts.useDebugBuild,
1920
enableWizerLogging: opts.enableWizerLogging,
2021
wizerBin: opts.wizerBin,
22+
wevalBin: opts.wevalBin,
23+
aotCache: opts.aotCacheDir,
24+
aotMinStackSizeBytes: opts.aotMinStackSize,
2125
});
2226
await writeFile(opts.out, component);
2327
}
@@ -31,6 +35,10 @@ program
3135
.option('-n, --world-name <name>', 'WIT world to build')
3236
.option('--runtime-args <string>', 'arguments to pass to the runtime')
3337
.option('--aot', 'enable AOT compilation')
38+
.option(
39+
'--engine <path>',
40+
'provide a custom ComponentizeJS engine build path',
41+
)
3442
.addOption(
3543
new Option('-d, --disable <feature...>', 'disable WASI features').choices(
3644
DEFAULT_FEATURES,
@@ -50,6 +58,18 @@ program
5058
'--wizer-bin <path>',
5159
'specify a path to a local wizer binary',
5260
)
61+
.option(
62+
'--weval-bin <path>',
63+
'specify a path to a local weval binary',
64+
)
65+
.option(
66+
'--aot-cache-dir <path>',
67+
'specify a custom AOT weval cache path',
68+
)
69+
.option(
70+
'--aot-min-stack-size <bytes>',
71+
'set the minimum stack size (RUST_MIN_STACK) for weval AOT compilation',
72+
)
5373
.requiredOption('-o, --out <out>', 'output component file')
5474
.action(asyncAction(componentizeCmd));
5575

0 commit comments

Comments
 (0)