Skip to content

fix(schematics): warn when ng add setup runs with no features selected - #3717

Merged
armando-navarro merged 3 commits into
angular:mainfrom
armando-navarro:fix/ng-add-empty-features-warning
Aug 3, 2026
Merged

fix(schematics): warn when ng add setup runs with no features selected#3717
armando-navarro merged 3 commits into
angular:mainfrom
armando-navarro:fix/ng-add-empty-features-warning

Conversation

@armando-navarro

Copy link
Copy Markdown
Collaborator

Fixes #3716

Pressing Enter without toggling any checkbox at the ng add features 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 add run against a tarball build: Enter-only at the features prompt now shows the warning and exits cleanly, with no stray files written.

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.
@armando-navarro armando-navarro added bump: patch comp: schematics ng add / deploy schematics (src/schematics). type: bug Defect: expected behavior doesn't happen. labels Jul 25, 2026

@tyler-reitz tyler-reitz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving. Nice, tightly scoped fix for #3716, and the setup path is untouched.

I pulled the branch and ran the checks locally:

  • ng lint is clean (the one warning is the pre-existing @ts-ignore in deploy/actions.ts, unrelated to this PR)
  • tsc --noEmit reports no errors in schematics/setup
  • The quoted prompt text matches featuresPrompt in prompts.ts exactly
  • 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.
@armando-navarro
armando-navarro merged commit 88c7b80 into angular:main Aug 3, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bump: patch comp: schematics ng add / deploy schematics (src/schematics). type: bug Defect: expected behavior doesn't happen.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ng add silently exits with "Nothing to be done." if no features are selected

2 participants