From c0f5d33c615a8edb2a62ba97b531b952140c806c Mon Sep 17 00:00:00 2001 From: Brian Madison Date: Tue, 23 Dec 2025 20:52:06 +0800 Subject: [PATCH] core module always asks its questions (no accept defaults --- .../installers/lib/core/config-collector.js | 36 +++++++------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/tools/cli/installers/lib/core/config-collector.js b/tools/cli/installers/lib/core/config-collector.js index 2d916c2f..fad0f108 100644 --- a/tools/cli/installers/lib/core/config-collector.js +++ b/tools/cli/installers/lib/core/config-collector.js @@ -582,26 +582,23 @@ class ConfigCollector { // If there are questions to ask, prompt for accepting defaults vs customizing if (questions.length > 0) { - // Get friendly module name from config or use uppercase module name const moduleDisplayName = moduleConfig.header || `${moduleName.toUpperCase()} Module`; - - // Add blank line for better readability console.log(); - - // Display the module name in color first console.log(chalk.cyan('?') + ' ' + chalk.magenta(moduleDisplayName)); + let customize = true; + if (moduleName !== 'core') { + const customizeAnswer = await inquirer.prompt([ + { + type: 'confirm', + name: 'customize', + message: 'Accept Defaults (no to customize)?', + default: true, + }, + ]); + customize = customizeAnswer.customize; + } - // Ask user if they want to accept defaults or customize on the next line - const { customize } = await inquirer.prompt([ - { - type: 'confirm', - name: 'customize', - message: 'Accept Defaults (no to customize)?', - default: true, - }, - ]); - - if (customize) { + if (customize && moduleName !== 'core') { // Accept defaults - only ask questions that have NO default value const questionsWithoutDefaults = questions.filter((q) => q.default === undefined || q.default === null || q.default === ''); @@ -621,8 +618,6 @@ class ConfigCollector { allAnswers[question.name] = question.default; } } else { - // Customize - ask all questions - console.log(chalk.dim(`\n Configuring ${moduleName.toUpperCase()}...`)); const promptedAnswers = await inquirer.prompt(questions); Object.assign(allAnswers, promptedAnswers); } @@ -647,8 +642,6 @@ class ConfigCollector { // For arrays (multi-select), handle differently if (Array.isArray(value)) { - // If there's a result template and it's a string, don't use it for arrays - // Just use the array value directly result = value; } else if (item.result) { result = item.result; @@ -663,11 +656,9 @@ class ConfigCollector { if (result === '{value}') { result = value; } else { - // Otherwise replace in the string result = result.replace('{value}', value); } } else { - // For non-string values, use directly result = value; } @@ -719,7 +710,6 @@ class ConfigCollector { } } } else { - // No result template, use value directly result = value; }