fix(schematics): warn when ng add setup runs with no features selected - #3717
Conversation
Pressing Enter without toggling any checkbox at the features prompt silently exited with the CLI's stock "Nothing to be done." message, giving no indication that Space selects a feature. Print a warning explaining the checkbox controls and inviting a retry.
tyler-reitz
left a comment
There was a problem hiding this comment.
Approving. Nice, tightly scoped fix for #3716, and the setup path is untouched.
I pulled the branch and ran the checks locally:
ng lintis clean (the one warning is the pre-existing@ts-ignoreindeploy/actions.ts, unrelated to this PR)tsc --noEmitreports no errors inschematics/setup- The quoted prompt text matches
featuresPromptinprompts.tsexactly - Branch is current with
main, no rebase needed
Agreed on skipping specs. There is no spec file anywhere under src/schematics/ today, so this would mean standing up a whole mocking harness for a one-branch message. Not worth it here.
One non-blocking suggestion: the warning hardcodes "What features would you like to setup?", which duplicates the message in prompts.ts. If the prompt ever gets reworded the warning will drift out of sync silently. We recently did this same cleanup for the firebase-tools version message in 59c8a2f, pulling it into a shared constant in common.ts. Might be worth exporting the prompt message from prompts.ts and referencing it in both places. Happy to see this land as-is if you would rather do it as a follow-up.
…pt message The empty-features warning duplicated the checkbox prompt's message as a second string literal, so a reworded prompt would leave the warning pointing at text the user never sees. Export the message as a shared constant and reference it in both places, matching the shared-constant pattern used for the firebase-tools version message in 59c8a2f.
Resolve the src/schematics/setup/index.ts import conflict: keep main's new firebaseConfigs import and add featuresPromptMessage to the prompts import. No logic change from either side.
Fixes #3716
Pressing Enter without toggling any checkbox at the
ng addfeatures prompt silently exited with the CLI's stock "Nothing to be done." message, with no indication that Space selects a feature. Adds a warning in that case explaining the checkbox controls and inviting a retry, leaving the existing setup path unchanged when at least one feature is selected.No unit specs — this file has none today, and building a mocking harness for a one-branch message would be new test infrastructure disproportionate to the change. Verified with a real
ng addrun against a tarball build: Enter-only at the features prompt now shows the warning and exits cleanly, with no stray files written.