|
|
|
@@ -9,7 +9,7 @@ import { RULES_PROFILES } from '../constants/profiles.js';
|
|
|
|
const availableRulesProfiles = RULES_PROFILES.map((name) => {
|
|
|
|
const availableRulesProfiles = RULES_PROFILES.map((name) => {
|
|
|
|
const displayName = getProfileDisplayName(name);
|
|
|
|
const displayName = getProfileDisplayName(name);
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
name: name === 'cursor' ? `${displayName} (default)` : displayName,
|
|
|
|
name: displayName,
|
|
|
|
value: name
|
|
|
|
value: name
|
|
|
|
};
|
|
|
|
};
|
|
|
|
});
|
|
|
|
});
|
|
|
|
@@ -19,7 +19,7 @@ const availableRulesProfiles = RULES_PROFILES.map((name) => {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function getProfileDisplayName(name) {
|
|
|
|
function getProfileDisplayName(name) {
|
|
|
|
const profile = getRulesProfile(name);
|
|
|
|
const profile = getRulesProfile(name);
|
|
|
|
return profile?.profileName || name.charAt(0).toUpperCase() + name.slice(1);
|
|
|
|
return profile?.displayName || name.charAt(0).toUpperCase() + name.slice(1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
@@ -30,7 +30,7 @@ function getProfileDisplayName(name) {
|
|
|
|
* Launches an interactive prompt for selecting which profile rules to include in your project.
|
|
|
|
* Launches an interactive prompt for selecting which profile rules to include in your project.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* This function dynamically lists all available profiles (from RULES_PROFILES) and presents them as checkboxes.
|
|
|
|
* This function dynamically lists all available profiles (from RULES_PROFILES) and presents them as checkboxes.
|
|
|
|
* The user must select at least one profile (default: cursor). The result is an array of selected profile names.
|
|
|
|
* The user must select at least one profile (no defaults are pre-selected). The result is an array of selected profile names.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Used by both project initialization (init) and the CLI 'task-master rules setup' command to ensure DRY, consistent UX.
|
|
|
|
* Used by both project initialization (init) and the CLI 'task-master rules setup' command to ensure DRY, consistent UX.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
@@ -47,7 +47,6 @@ export async function runInteractiveRulesSetup() {
|
|
|
|
name: 'rulesProfiles',
|
|
|
|
name: 'rulesProfiles',
|
|
|
|
message: 'Which IDEs would you like rules included for?',
|
|
|
|
message: 'Which IDEs would you like rules included for?',
|
|
|
|
choices: availableRulesProfiles,
|
|
|
|
choices: availableRulesProfiles,
|
|
|
|
default: ['cursor'],
|
|
|
|
|
|
|
|
validate: (input) => input.length > 0 || 'You must select at least one.'
|
|
|
|
validate: (input) => input.length > 0 || 'You must select at least one.'
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const { rulesProfiles } = await inquirer.prompt([rulesProfilesQuestion]);
|
|
|
|
const { rulesProfiles } = await inquirer.prompt([rulesProfilesQuestion]);
|
|
|
|
|