Repository navigation
fix(preview): make words.mjs answer --help and stop early on bad input (#269) - #286
Merged
juancguerrerodev merged 1 commit intoDec 6, 2026
Conversation
juancguerrerodev
force-pushed
the
fix/preview-words-help-269
branch
from
December 6, 2026 09:18
e79d233 to
821b5cf
Compare
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.
What and why
Closes #269.
apps/mobile/preview/words.mjsnow answers--helpand-hwith its usage line on stdout and exit 0; with no arguments, or only one, it prints the usage line to stderr and exits 1; and a dist folder with noindex.htmlstops before the server starts and before Chromium launches, naming the folder and saying to runpnpm build. No stack traces in any of these cases. The checks run before the existing server and reading flow, which is unchanged: only the command line changed.words.test.mjscovers all three cases by spawning the script (no Chromium needed, since every case stops before it), and the previewtestscript now includes it.Vision fit
Principle 7, small, typed and tested, and the contributor-tools side of it: a rough command line that stack-traces on
--helpnow refuses bad input with a short message, like its siblings inscripts/devices, and the behavior is pinned by tests.Non-negotiables
Checklist
acceptedproposal.words.test.mjswas written and run first (0 pass, 3 fail against the oldthrow), then the checks were added towords.mjs(3 pass).pnpm check:privacy,pnpm typecheck,pnpm lint,pnpm testandnode scripts/guard/check.mjs --patterns scripts/guard/patterns.txt. Run locally:node --test words.test.mjs(3/3), the full preview suitepnpm testinapps/mobile/preview(29/29, afterpnpm install --ignore-workspace), the PR guard (ok), and manualnode words.mjs --help(exit 0) andnode words.mjs(exit 1) checks. The happy path afterpnpm buildwas not run here (it needs a preview build and Chromium); only the early checks changed, ahead of the untouched server and reading flow. CI runs the full root gates.packages/copy, in es-419 and en, with matching keys and placeholders, and no em or en dashes. n/a: dev-only CLI messages in plain English, no UI string changed, no em or en dashes.Model path
packages/model,agent,skillsoreval, the prompt, the router, tool descriptions, normalizers, examples or the model file.Screenshots
New dependencies and network calls
None. No dependency added (the preview lockfile is unchanged); the only network code is the existing localhost preview server, untouched.
AI agents
words.mjs, and ran the preview suites and manual exit-code checks above, in a session directed by the author.