From e2e56fbabdd5c86e08ad684738ac402f4d3da60e Mon Sep 17 00:00:00 2001 From: Victor Adossi Date: Thu, 17 Jul 2025 00:59:56 +0900 Subject: [PATCH] refactor: pass more debug options to componentize This commit makes use of new functionality in componentize that enables passing in more debug options, and outputs information from debugging during the jco build. Signed-off-by: Victor Adossi --- packages/jco/src/cmd/componentize.js | 13 +++++++++++++ packages/jco/src/jco.js | 17 +++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/packages/jco/src/cmd/componentize.js b/packages/jco/src/cmd/componentize.js index cb4cf2b12..01db7603e 100644 --- a/packages/jco/src/cmd/componentize.js +++ b/packages/jco/src/cmd/componentize.js @@ -28,7 +28,20 @@ export async function componentize(jsSource, opts) { enableFeatures: opts.enable, preview2Adapter: opts.preview2Adapter, debugBuild: opts.debugStarlingmonkeyBuild, + debug: { + bindings: opts.debugBindings, + bindingsDir: opts.debugBindingsDir, + binary: opts.debugBinary, + binaryPath: opts.debugBinaryPath, + enableWizerLogging: opts.debugEnableWizerLogging, + }, }); + if (result.debug) { + console.error( + c`{cyan DEBUG} Debug output\n${JSON.stringify(debug, null, 2)}\n` + ); + } + component = result.component; } catch (err) { // Detect package resolution issues that usually mean a misconfigured "witPath" diff --git a/packages/jco/src/jco.js b/packages/jco/src/jco.js index 5361e41b9..c0a665be2 100755 --- a/packages/jco/src/jco.js +++ b/packages/jco/src/jco.js @@ -68,6 +68,23 @@ program 'use a debug build of StarlingMonkey' ) .requiredOption('-o, --out ', 'output component file') + .option( + '--debug-bindings', + 'Output debug bindings and metadata during componentization (by default to stderr)' + ) + .option( + '--debug-bindings-dir ', + 'Directory to which to output generated bindings and metadata' + ) + .option( + '--debug-binary', + 'Output binary (without component metadata) created during componentization (by default to tmp dir)' + ) + .option( + '--debug-binary-path ', + 'Path to which to write the generated debug binary' + ) + .option('--debug-enable-wizer-logging', 'Enable wizer call debugging') .action(asyncAction(componentize)); program