diff --git a/src/cmd/componentize.js b/src/cmd/componentize.js index 3890a09bc..3c1fbf91f 100644 --- a/src/cmd/componentize.js +++ b/src/cmd/componentize.js @@ -1,15 +1,19 @@ -import { readFile, writeFile } from 'node:fs/promises'; -import { resolve, basename } from 'node:path'; -import c from 'chalk-template'; +import { readFile, writeFile } from "node:fs/promises"; +import { resolve, basename } from "node:path"; -export async function componentize (jsSource, opts) { - const { componentize: componentizeFn } = await eval('import("@bytecodealliance/componentize-js")'); - if (opts.disable?.includes('all')) { - opts.disable = ['stdio', 'random', 'clocks', 'http']; +import c from "chalk-template"; + +export async function componentize(jsSource, opts) { + const { componentize: componentizeFn } = await eval( + 'import("@bytecodealliance/componentize-js")', + ); + if (opts.disable?.includes("all")) { + opts.disable = ["stdio", "random", "clocks", "http"]; } - const source = await readFile(jsSource, 'utf8'); + const source = await readFile(jsSource, "utf8"); const { component } = await componentizeFn(source, { enableAot: opts.aot, + aotMinStackSizeBytes: opts.aotMinStackSizeBytes, wevalBin: opts.wevalBin, sourceName: basename(jsSource), witPath: resolve(opts.wit), diff --git a/src/jco.js b/src/jco.js index d9c7ab41c..3bf212a06 100755 --- a/src/jco.js +++ b/src/jco.js @@ -1,11 +1,13 @@ #!/usr/bin/env node + +import c from 'chalk-template'; import { program, Option } from 'commander'; + import { opt } from './cmd/opt.js'; import { transpile, types, guestTypes } from './cmd/transpile.js'; import { run as runCmd, serve as serveCmd } from './cmd/run.js'; import { parse, print, componentNew, componentEmbed, metadataAdd, metadataShow, componentWit } from './cmd/wasm-tools.js'; import { componentize } from './cmd/componentize.js'; -import c from 'chalk-template'; program .name('jco') @@ -34,6 +36,7 @@ program.command('componentize') .requiredOption('-w, --wit ', 'WIT path to build with') .option('-n, --world-name ', 'WIT world to build') .option('--aot', 'Enable Weval AOT compilation of JS') + .option('--aot-min-stack-size-bytes ', 'Set the min stack size to be used during AOT') .option('--weval-bin ', 'Specify a custom weval binary to use') .addOption(new Option('-d, --disable ', 'disable WASI features').choices(['clocks', 'http', 'random', 'stdio', 'all'])) // .addOption(new Option('-e, --enable ', 'enable WASI features').choices(['http']))