Repository navigation
fix(cli): one-line errors, checked inputs and no prompts without a terminal - #322
Merged
Merged
Conversation
nf dev ran nf build --watch with its output collected, and collected output only prints when the child exits non-zero, which a watch build never does. Both sub-commands now inherit the terminal. Closes #306
…ates TypeScript 6 rejects esModuleInterop: false with TS5107 and stops before checking anything, so a fresh TypeScript project failed tsc --noEmit. Refs #308
nf build writes to dist/ by default, and only the workspace template ignored it, so a single-app project showed its build in git status. Closes #312
…gents.md AGENTS.md hard-coded ^2 while package.json gets the version resolved at generation time (^3.0.0 today). Closes #313
dotenv 17+ prints "injected env (0) from .env" on every load, even with no .env file. Closes #314
The url was wrapped in a hard-coded ansi escape, shown even with NO_COLOR, in pipes and in log files. Closes #315
- a missing config suggests -d, not a --config option no command reads; - an unreachable registry no longer suggests REGISTRY_URL, which the build inlines; - a missing manifest suggests a package folder, not a syntax fix. Closes #316
- an unexpected error prints its message, and the stack trace only with NF_DEBUG set; - a bad nf editor port is an InvalidCommandArgumentError, not a plain error; - nf new checks --language and --package-manager with commander choices, before the schematics run. Closes #309
nf start -p abc reached Bun.serve, which crashed with a raw RangeError. The port, from --port or the config, now goes through the same check as nf editor and fails with an InvalidCommandArgumentError and exit code 1. Closes #310
nf start served an empty loader with no hint when the build folder was missing. It now prints a warning naming the folder and 'nf build'. Under --watch (nf dev) the build creates the folder alongside, so it does not warn. Closes #319
… nothing Both options are accepted but read by nothing: the help now says so, as the nf new docs already do. Refs #317
"unpublish a package from", "add editor dependencies", and NanoForge in the login, logout, publish, unpublish, new and install texts. The issue template's casing (.github) is left for another change. Refs #320
nf create component --name '2d sprite' wrote class 2dSpriteComponent, which does not parse. The name must now be letters, digits, '-' and '_', starting with a letter, and is checked before anything is written. Closes #318
…inal With stdin not a terminal, nf new, nf create, nf login and nf install printed a question and exited 1 with no message. The questions now refuse to prompt, and the input that asked names the option to pass, e.g. "--name is required when not running in a terminal." Closes #311
The README of nf create plugin covered the dev loop and a manual install, not nf publish. Refs #321
- drop the DEV_PLUGINS notes: the shipped editor 1.0.0 reads it; - drop the link to the private API repo; - say what part does in the component and system schematics; - name the import to replace in the components guide. Closes #321
- add the rule to the commands overview; - name the option to pass in create, login and install.
…resolve the dev spec path
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 does this PR do?
Closes #306
Closes #309
Closes #310
Closes #311
Closes #312
Closes #313
Closes #314
Closes #315
Closes #316
Closes #318
Closes #319
Closes #321
Refs #308
Refs #317
Refs #320
Pre-testing polish of
nf, one commit per issue:nf devshows the build output (nf dev never shows the build output or build errors #306).NF_DEBUGset;--languageand--package-managerchoices are checked (Unexpected errors print a stack trace, and nf new does not validate --language or --package-manager #309).--portor the config are checked, 1 to 65535 (nf start -p with an invalid port shows a raw Bun RangeError #310).nf new,nf create,nf loginandnf installname the missing option instead of prompting (nf new and nf create exit 1 with no message when stdin is not a terminal #311).nf startstops with "No build found at " when the build folder is missing;--watch(used bynf dev) skips the check (nf start before nf build serves an empty loader with no warning #319).^[A-Za-z][A-Za-z0-9_-]*$(nf create component and system accept names that produce invalid code #318).dist/ignored (Single-app project template does not git-ignore dist #312), the resolved engine version in AGENTS.md (Generated AGENTS.md says the NanoForge packages are on ^2 #313),esModuleInteropno longer disabled in the TS templates (Fresh TypeScript projects fail tsc --noEmit #308, part 1).NO_COLORfor the editor URL (nf editor colors its URL by hand and ignores NO_COLOR #315), suggestions that point at real options (Error suggestions point at --config, REGISTRY_URL and manifest syntax where they do not apply #316), help typos and NanoForge casing (Typos and Nanoforge casing in the help texts #320, except the.githubissue template),--init-functions/--no-linthelp says they have no effect yet (nf new help lists --no-lint and --init-functions, which have no effect #317, help only), docs fixes (Docs: stale DEV_PLUGINS note, private API link, wrong part row, guide import step, plugin publish step #321).How do you test this PR?
nf devhid build errors;nf start -p abccrashed with a Bun RangeError and exited 0;nf new </dev/nullexited 1 with no message;nf new --language rustprinted a stack trace;nf startbeforenf buildserved an empty loader; the generated tsconfig gave TS5107;dist/was not ignored.After: each one fixed;
dev.action.specand the new non-terminal e2e tests fail on main and pass here.pnpm build,pnpm lint,pnpm test(unit 296 passed, e2e 101 passed, 1 skipped, 1 todo); schematics build, lint,test:unit(48) andtest:e2e(151). Manual:NO_COLOR=1 nf start -p 4655in an unbuilt project exits 1 and opens no port.start.action.spec.tscomes with fix(cli): copy nested asset folders and add unit tests for files, package manager, build and start #295.Merge danger
Door: two-way (revert is enough).
Blast radius:
@nanoforge-dev/cliand@nanoforge-dev/schematicsat the next release; nothing deploys on merge. Behavior changes for users:nf startwithout a build exits 1;The editor passes every
nf newoption, so it is not affected.Follow-up issues
Quality gate
NO_COLORrespected)--api-key