Add CLI subcommands and command-specific help - #332
Merged
Merged
Conversation
Coverage Report for CI Build 35155258354Coverage increased (+0.7%) to 96.576%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsNo coverage regressions found. Coverage Stats💛 - Coveralls |
bcomnes
marked this pull request as ready for review
September 16, 2026 21:55
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Partition the CLI by operation while keeping a bare
domstackinvocation as a one-shot build. Add command-specific help and strict option validation without introducing dependencies or changing the underlying build, watch, serve, and eject behavior.domstack buildas an explicit alias for the default build.domstack watchfor builds with watching and live reload, with--no-servefor watch-only operation.domstack serveto build once and serve production output without watching or live reload; keep--portexclusive to this command.domstack ejectwith its own--src,--language, and--yesoptions.<command> --helpandhelp <command; root help lists commands and default-build options.node:util.parseArgsresponsible for parsing and validation, andargscloptsresponsible for help formatting, using shared command schemas underlib/cli.Compatibility and validation behavior
Existing root-level
--watch/-w,--watch-only,--serve, and--eject/-eremain supported as shortcuts. Normalize them into commands and validate against the selected command schema, rather than accepting unrelated options silently.Explicit commands must precede their options. Irrelevant options and conflicting legacy modes now fail with concise usage errors and a help hint. In particular,
--watchcombined with--watch-onlyis rejected, and legacy mode flags are not accepted after an explicit command.Tests
Add parser coverage for command selection, short-option groups, repeated options, command names used as option values, compatibility shortcuts, conflicts, and help routing. Add integration coverage for side-effect-free help/version, real builds, eject behavior, watch rebuilds, HTTP serving without live-reload injection, and SIGTERM cleanup.
Validation rerun after rebasing onto master:
node --test --test-reporter=spec: 469 passed, 0 failed, 2 TODO.npx tsc --noEmit: passed.npm run test:neostandard: passed.git diff --check: passed.