add brandDir to remove ambiguity and support Cline
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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
|
||||||
};
|
};
|
||||||
@@ -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
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user