From 0027ef299224c2c312bd2cb0d4d379a417e07698 Mon Sep 17 00:00:00 2001 From: Armando Navarro Date: Wed, 15 Jul 2026 13:57:08 -0700 Subject: [PATCH 1/2] fix(schematics): warn when ng add setup runs with no features selected 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. --- src/schematics/setup/index.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/schematics/setup/index.ts b/src/schematics/setup/index.ts index 3d40ed132..976548f87 100644 --- a/src/schematics/setup/index.ts +++ b/src/schematics/setup/index.ts @@ -62,7 +62,14 @@ export const ngAddSetupProject = ( const features = await featuresPrompt(); - if (features.length > 0) { + if (features.length === 0) { + context.logger.warn( + 'No features were selected, so there is nothing to set up. ' + + 'At the "What features would you like to setup?" prompt, use the arrow keys to move, ' + + 'press Space to select each feature you want, then Enter to confirm. ' + + 'Re-run ng add @angular/fire to try again.' + ); + } else { const firebaseTools = await getFirebaseTools(); From 3f32bb9dcb2d2ea86eb878a6820bb9077fcebcbf Mon Sep 17 00:00:00 2001 From: Armando Navarro Date: Mon, 3 Aug 2026 14:21:30 -0700 Subject: [PATCH 2/2] refactor(schematics): derive the empty-features warning from the prompt 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. --- src/schematics/setup/index.ts | 4 ++-- src/schematics/setup/prompts.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/schematics/setup/index.ts b/src/schematics/setup/index.ts index 976548f87..a7cec6610 100644 --- a/src/schematics/setup/index.ts +++ b/src/schematics/setup/index.ts @@ -16,7 +16,7 @@ import { parseDataConnectConfig, setupTanstackDependencies, } from '../utils'; -import { appPrompt, featuresPrompt, projectPrompt, userPrompt } from './prompts'; +import { appPrompt, featuresPrompt, featuresPromptMessage, projectPrompt, userPrompt } from './prompts'; // FirebaseOptions keys — apps.sdkconfig responses include management-API extras that initializeApp() rejects. const firebaseOptionsKeys = [ @@ -65,7 +65,7 @@ export const ngAddSetupProject = ( if (features.length === 0) { context.logger.warn( 'No features were selected, so there is nothing to set up. ' + - 'At the "What features would you like to setup?" prompt, use the arrow keys to move, ' + + `At the "${featuresPromptMessage}" prompt, use the arrow keys to move, ` + 'press Space to select each feature you want, then Enter to confirm. ' + 'Re-run ng add @angular/fire to try again.' ); diff --git a/src/schematics/setup/prompts.ts b/src/schematics/setup/prompts.ts index f36c22ed2..701713b96 100644 --- a/src/schematics/setup/prompts.ts +++ b/src/schematics/setup/prompts.ts @@ -79,12 +79,14 @@ type Prompt = (questions: { name: K, source: (...a const autocomplete: Prompt = (questions) => inquirer.prompt(questions); +export const featuresPromptMessage = 'What features would you like to setup?'; + export const featuresPrompt = async (): Promise => { const { features } = await inquirer.prompt({ type: 'checkbox', name: 'features', choices: featureOptions, - message: 'What features would you like to setup?', + message: featuresPromptMessage, default: [], }) as { features: FEATURES[] }; return features;