add brandDir to remove ambiguity and support Cline

This commit is contained in:
Joe Danziger
2025-05-21 12:28:56 -04:00
parent 97859d8d7e
commit 9eacd6e061
6 changed files with 14 additions and 6 deletions

View File

@@ -110,8 +110,8 @@ export async function rulesDirect(args, log, context = {}) {
// Determine paths // Determine paths
const rulesDir = profile.rulesDir; const rulesDir = profile.rulesDir;
const brandRulesDir = path.join(projectRoot, rulesDir); const brandRulesDir = path.join(projectRoot, rulesDir);
const brandDir = path.dirname(brandRulesDir); const brandDir = profile.brandDir;
const mcpPath = path.join(brandDir, 'mcp.json'); const mcpPath = path.join(projectRoot, brandDir, 'mcp.json');
// Check what was created // Check what was created
const mcpConfigCreated = fs.existsSync(mcpPath); const mcpConfigCreated = fs.existsSync(mcpPath);

View File

@@ -208,8 +208,8 @@ function convertAllRulesToBrandRules(projectDir, profile) {
fs.mkdirSync(brandRulesDir, { recursive: true }); fs.mkdirSync(brandRulesDir, { recursive: true });
log('debug', `Created ${brandName} rules directory: ${brandRulesDir}`); log('debug', `Created ${brandName} rules directory: ${brandRulesDir}`);
// Also create MCP configuration in the brand directory // Also create MCP configuration in the brand directory
const brandDir = path.dirname(brandRulesDir); const brandDir = profile.brandDir;
setupMCPConfiguration(brandDir); setupMCPConfiguration(path.join(projectDir, brandDir));
} }
// Count successful and failed conversions // Count successful and failed conversions
@@ -259,9 +259,9 @@ function convertAllRulesToBrandRules(projectDir, profile) {
*/ */
function removeBrandRules(projectDir, profile) { function removeBrandRules(projectDir, profile) {
const { brandName, rulesDir } = profile; const { brandName, rulesDir } = profile;
const brandDir = profile.brandDir;
const brandRulesDir = path.join(projectDir, rulesDir); const brandRulesDir = path.join(projectDir, rulesDir);
const brandDir = path.dirname(brandRulesDir); const mcpPath = path.join(projectDir, brandDir, 'mcp.json');
const mcpPath = path.join(brandDir, 'mcp.json');
const result = { const result = {
brandName, brandName,

View File

@@ -2,6 +2,7 @@
import path from 'path'; import path from 'path';
const brandName = 'Cline'; const brandName = 'Cline';
const brandDir = '.clinerules';
const rulesDir = '.clinerules'; const rulesDir = '.clinerules';
// File name mapping (specific files with naming changes) // File name mapping (specific files with naming changes)
@@ -134,6 +135,7 @@ export {
fileMap, fileMap,
globalReplacements, globalReplacements,
brandName, brandName,
brandDir,
rulesDir, rulesDir,
getTargetRuleFilename getTargetRuleFilename
}; };

View File

@@ -2,6 +2,7 @@
import path from 'path'; import path from 'path';
const brandName = 'Cursor'; const brandName = 'Cursor';
const brandDir = '.cursor';
const rulesDir = '.cursor/rules'; const rulesDir = '.cursor/rules';
// File name mapping (specific files with naming changes) // File name mapping (specific files with naming changes)
@@ -80,6 +81,7 @@ export {
fileMap, fileMap,
globalReplacements, globalReplacements,
brandName, brandName,
brandDir,
rulesDir, rulesDir,
getTargetRuleFilename getTargetRuleFilename
}; };

View File

@@ -8,6 +8,7 @@ const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename); const __dirname = path.dirname(__filename);
const brandName = 'Roo'; const brandName = 'Roo';
const brandDir = '.roo';
const rulesDir = '.roo/rules'; const rulesDir = '.roo/rules';
// File name mapping (specific files with naming changes) // File name mapping (specific files with naming changes)
@@ -236,6 +237,7 @@ export {
fileMap, fileMap,
globalReplacements, globalReplacements,
brandName, brandName,
brandDir,
rulesDir, rulesDir,
getTargetRuleFilename, getTargetRuleFilename,
onPostConvertBrandRules onPostConvertBrandRules

View File

@@ -2,6 +2,7 @@
import path from 'path'; import path from 'path';
const brandName = 'Windsurf'; const brandName = 'Windsurf';
const brandDir = '.windsurf';
const rulesDir = '.windsurf/rules'; const rulesDir = '.windsurf/rules';
// File name mapping (specific files with naming changes) // File name mapping (specific files with naming changes)
@@ -130,6 +131,7 @@ export {
fileMap, fileMap,
globalReplacements, globalReplacements,
brandName, brandName,
brandDir,
rulesDir, rulesDir,
getTargetRuleFilename getTargetRuleFilename
}; };