import brand profiles from rule-transformer.js

This commit is contained in:
Joe Danziger
2025-05-12 11:33:03 -04:00
parent 79fe5496e5
commit 3194367318

View File

@@ -462,7 +462,7 @@ async function initializeProject(options = {}) {
} }
for (const rule of selectedBrandRules) { for (const rule of selectedBrandRules) {
const profile = ruleProfiles[rule]; const profile = BRAND_PROFILES[rule];
if (profile) { if (profile) {
convertAllRulesToBrandRules(targetDir, profile); convertAllRulesToBrandRules(targetDir, profile);
// Ensure MCP config is set up under the correct brand folder // Ensure MCP config is set up under the correct brand folder
@@ -474,7 +474,7 @@ async function initializeProject(options = {}) {
} }
// fallback for safety if selectedBrandRules is not an array // fallback for safety if selectedBrandRules is not an array
if (!Array.isArray(selectedBrandRules)) { if (!Array.isArray(selectedBrandRules)) {
convertAllRulesToBrandRules(targetDir, cursorProfile); convertAllRulesToBrandRules(targetDir, BRAND_PROFILES['cursor']);
} }
} catch (error) { } catch (error) {
rl.close(); rl.close();
@@ -583,7 +583,7 @@ function createProjectStructure(
log('info', 'Generating brand rules from assets/rules...'); log('info', 'Generating brand rules from assets/rules...');
if (Array.isArray(selectedBrandRules)) { if (Array.isArray(selectedBrandRules)) {
for (const rule of selectedBrandRules) { for (const rule of selectedBrandRules) {
const profile = ruleProfiles[rule]; const profile = BRAND_PROFILES[rule];
if (profile) { if (profile) {
convertAllRulesToBrandRules(targetDir, profile); convertAllRulesToBrandRules(targetDir, profile);
// Ensure MCP config is set up under the correct brand folder for any non-cursor rule // Ensure MCP config is set up under the correct brand folder for any non-cursor rule
@@ -596,7 +596,7 @@ function createProjectStructure(
} }
} else { } else {
// fallback for safety // fallback for safety
convertAllRulesToBrandRules(targetDir, cursorProfile); convertAllRulesToBrandRules(targetDir, BRAND_PROFILES['cursor']);
} }
// Run npm install automatically // Run npm install automatically
@@ -765,22 +765,19 @@ function createProjectStructure(
// Import DRY MCP configuration helper // Import DRY MCP configuration helper
import { setupMCPConfiguration } from './modules/mcp-utils.js'; import { setupMCPConfiguration } from './modules/mcp-utils.js';
// Statically import rule profiles // Import centralized brand profile logic
import * as rooProfile from './profiles/roo.js'; import { BRAND_PROFILES, BRAND_NAMES } from './modules/rule-transformer.js';
import * as windsurfProfile from './profiles/windsurf.js';
import * as cursorProfile from './profiles/cursor.js';
const availableBrandRules = [ // Dynamically generate availableBrandRules from BRAND_NAMES and brand profiles
{ name: 'Cursor (default)', value: 'cursor' }, const availableBrandRules = BRAND_NAMES.map((name) => {
{ name: 'Roo', value: 'roo' }, const displayName =
{ name: 'Windsurf', value: 'windsurf' } BRAND_PROFILES[name]?.brandName ||
]; name.charAt(0).toUpperCase() + name.slice(1);
return {
const ruleProfiles = { name: name === 'cursor' ? `${displayName} (default)` : displayName,
roo: rooProfile, value: name
windsurf: windsurfProfile, };
cursor: cursorProfile });
};
// Ensure necessary functions are exported // Ensure necessary functions are exported
export { initializeProject, log }; // Only export what's needed by commands.js export { initializeProject, log }; // Only export what's needed by commands.js