Use execa to orchestrate running npm scripts, and add a lage-debug command #744
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use
execa
's promise API to handle running npm scripts inNpmScriptRunner
, and pass the abort signal directly as an option. I'm wondering if one or both of these changes might address the mysterious intermittent crashes I've seen from lage (the ones that aren't related to hashing).Due to the external dependency on
execa
inNpmScriptRunner
, it was also necessary to update the bundling logic (previously the runners weren't bundled, so external deps weren't available at runtime). Based on experience with esbuild from cloudpack, I refactored the bundling logic to specify all the entry points in a more "proper" way and create all the bundles in a single operation, rather than a file copy followed by multiple bundle commands.I also added a new
lage-debug
command which uses non-minified bundles. If the first change above didn't fix the intermittent crash, the new command should help with figuring it out.