diff --git a/scripts/profiles/cline.js b/scripts/profiles/cline.js index 0368876b..50711cb4 100644 --- a/scripts/profiles/cline.js +++ b/scripts/profiles/cline.js @@ -1,8 +1,8 @@ // Cline conversion profile for rule-transformer import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js'; -// Create cline profile using the base factory -const clineProfile = createProfile({ +// Create and export cline profile using the base factory +export const clineProfile = createProfile({ name: 'cline', displayName: 'Cline', url: 'cline.bot', @@ -18,18 +18,3 @@ const clineProfile = createProfile({ 'cursor_rules.mdc': 'cline_rules.md' } }); - -// Export all the standard profile properties -export const { - conversionConfig, - fileMap, - globalReplacements, - profileName, - displayName, - profileDir, - rulesDir, - mcpConfig, - mcpConfigName, - mcpConfigPath, - getTargetRuleFilename -} = clineProfile; diff --git a/scripts/profiles/cursor.js b/scripts/profiles/cursor.js index 8c548bfe..f4f0b165 100644 --- a/scripts/profiles/cursor.js +++ b/scripts/profiles/cursor.js @@ -1,8 +1,8 @@ // Cursor conversion profile for rule-transformer import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js'; -// Create cursor profile using the base factory -const cursorProfile = createProfile({ +// Create and export cursor profile using the base factory +export const cursorProfile = createProfile({ name: 'cursor', displayName: 'Cursor', url: 'cursor.so', @@ -18,18 +18,3 @@ const cursorProfile = createProfile({ 'cursor_rules.mdc': 'cursor_rules.mdc' // Keep the same name for cursor } }); - -// Export all the standard profile properties -export const { - conversionConfig, - fileMap, - globalReplacements, - profileName, - displayName, - profileDir, - rulesDir, - mcpConfig, - mcpConfigName, - mcpConfigPath, - getTargetRuleFilename -} = cursorProfile; diff --git a/scripts/profiles/roo.js b/scripts/profiles/roo.js index cfb06ff5..1d3cfe30 100644 --- a/scripts/profiles/roo.js +++ b/scripts/profiles/roo.js @@ -102,8 +102,8 @@ function onPostConvertRulesProfile(targetDir) { onAddRulesProfile(targetDir); } -// Create roo profile using the base factory -const rooProfile = createProfile({ +// Create and export roo profile using the base factory +export const rooProfile = createProfile({ name: 'roo', displayName: 'Roo Code', url: 'roocode.com', @@ -123,20 +123,5 @@ const rooProfile = createProfile({ onPostConvert: onPostConvertRulesProfile }); -// Export all the standard profile properties and lifecycle functions -export const { - conversionConfig, - fileMap, - globalReplacements, - profileName, - displayName, - profileDir, - rulesDir, - mcpConfig, - mcpConfigName, - mcpConfigPath, - getTargetRuleFilename -} = rooProfile; - // Export lifecycle functions separately to avoid naming conflicts export { onAddRulesProfile, onRemoveRulesProfile, onPostConvertRulesProfile }; diff --git a/scripts/profiles/trae.js b/scripts/profiles/trae.js index 1310f959..5485478c 100644 --- a/scripts/profiles/trae.js +++ b/scripts/profiles/trae.js @@ -1,8 +1,8 @@ // Trae conversion profile for rule-transformer import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js'; -// Create trae profile using the base factory -const traeProfile = createProfile({ +// Create and export trae profile using the base factory +export const traeProfile = createProfile({ name: 'trae', displayName: 'Trae', url: 'trae.ai', @@ -15,18 +15,3 @@ const traeProfile = createProfile({ targetExtension: '.md', toolMappings: COMMON_TOOL_MAPPINGS.STANDARD // Trae uses standard tool names }); - -// Export all the standard profile properties -export const { - conversionConfig, - fileMap, - globalReplacements, - profileName, - displayName, - profileDir, - rulesDir, - mcpConfig, - mcpConfigName, - mcpConfigPath, - getTargetRuleFilename -} = traeProfile; diff --git a/scripts/profiles/windsurf.js b/scripts/profiles/windsurf.js index db4b2e86..24f81925 100644 --- a/scripts/profiles/windsurf.js +++ b/scripts/profiles/windsurf.js @@ -1,8 +1,8 @@ // Windsurf conversion profile for rule-transformer import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js'; -// Create windsurf profile using the base factory -const windsurfProfile = createProfile({ +// Create and export windsurf profile using the base factory +export const windsurfProfile = createProfile({ name: 'windsurf', displayName: 'Windsurf', url: 'windsurf.com', @@ -15,18 +15,3 @@ const windsurfProfile = createProfile({ targetExtension: '.md', toolMappings: COMMON_TOOL_MAPPINGS.STANDARD // Windsurf uses standard tool names }); - -// Export all the standard profile properties -export const { - conversionConfig, - fileMap, - globalReplacements, - profileName, - displayName, - profileDir, - rulesDir, - mcpConfig, - mcpConfigName, - mcpConfigPath, - getTargetRuleFilename -} = windsurfProfile; diff --git a/tests/unit/rule-transformer-cline.test.js b/tests/unit/rule-transformer-cline.test.js index 554e9024..8f3b7523 100644 --- a/tests/unit/rule-transformer-cline.test.js +++ b/tests/unit/rule-transformer-cline.test.js @@ -41,7 +41,11 @@ Also has references to .mdc files.`; // Convert it const testClineRule = path.join(testDir, 'basic-terms.md'); - convertRuleToProfileRule(testCursorRule, testClineRule, clineProfile); + convertRuleToProfileRule( + testCursorRule, + testClineRule, + clineProfile.clineProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testClineRule, 'utf8'); @@ -72,7 +76,11 @@ alwaysApply: true // Convert it const testClineRule = path.join(testDir, 'tool-refs.md'); - convertRuleToProfileRule(testCursorRule, testClineRule, clineProfile); + convertRuleToProfileRule( + testCursorRule, + testClineRule, + clineProfile.clineProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testClineRule, 'utf8'); @@ -100,7 +108,11 @@ This references [dev_workflow.mdc](mdc:.cursor/rules/dev_workflow.mdc) and // Convert it const testClineRule = path.join(testDir, 'file-refs.md'); - convertRuleToProfileRule(testCursorRule, testClineRule, clineProfile); + convertRuleToProfileRule( + testCursorRule, + testClineRule, + clineProfile.clineProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testClineRule, 'utf8'); diff --git a/tests/unit/rule-transformer-cursor.test.js b/tests/unit/rule-transformer-cursor.test.js index 49f6162b..a6c6755b 100644 --- a/tests/unit/rule-transformer-cursor.test.js +++ b/tests/unit/rule-transformer-cursor.test.js @@ -45,7 +45,11 @@ Also has references to .mdc files.`; // Convert it const testCursorOut = path.join(testDir, 'basic-terms.mdc'); - convertRuleToProfileRule(testCursorRule, testCursorOut, cursorProfile); + convertRuleToProfileRule( + testCursorRule, + testCursorOut, + cursorProfile.cursorProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testCursorOut, 'utf8'); @@ -76,7 +80,11 @@ alwaysApply: true // Convert it const testCursorOut = path.join(testDir, 'tool-refs.mdc'); - convertRuleToProfileRule(testCursorRule, testCursorOut, cursorProfile); + convertRuleToProfileRule( + testCursorRule, + testCursorOut, + cursorProfile.cursorProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testCursorOut, 'utf8'); @@ -106,7 +114,11 @@ This references [dev_workflow.mdc](mdc:.cursor/rules/dev_workflow.mdc) and // Convert it const testCursorOut = path.join(testDir, 'file-refs.mdc'); - convertRuleToProfileRule(testCursorRule, testCursorOut, cursorProfile); + convertRuleToProfileRule( + testCursorRule, + testCursorOut, + cursorProfile.cursorProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testCursorOut, 'utf8'); diff --git a/tests/unit/rule-transformer-roo.test.js b/tests/unit/rule-transformer-roo.test.js index 72fd0d6c..456b4603 100644 --- a/tests/unit/rule-transformer-roo.test.js +++ b/tests/unit/rule-transformer-roo.test.js @@ -45,7 +45,11 @@ Also has references to .mdc files.`; // Convert it const testRooRule = path.join(testDir, 'basic-terms.md'); - convertRuleToProfileRule(testCursorRule, testRooRule, rooProfile); + convertRuleToProfileRule( + testCursorRule, + testRooRule, + rooProfile.rooProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testRooRule, 'utf8'); @@ -76,7 +80,11 @@ alwaysApply: true // Convert it const testRooRule = path.join(testDir, 'tool-refs.md'); - convertRuleToProfileRule(testCursorRule, testRooRule, rooProfile); + convertRuleToProfileRule( + testCursorRule, + testRooRule, + rooProfile.rooProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testRooRule, 'utf8'); @@ -104,7 +112,11 @@ This references [dev_workflow.mdc](mdc:.cursor/rules/dev_workflow.mdc) and // Convert it const testRooRule = path.join(testDir, 'file-refs.md'); - convertRuleToProfileRule(testCursorRule, testRooRule, rooProfile); + convertRuleToProfileRule( + testCursorRule, + testRooRule, + rooProfile.rooProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testRooRule, 'utf8'); @@ -122,7 +134,7 @@ This references [dev_workflow.mdc](mdc:.cursor/rules/dev_workflow.mdc) and const assetRule = path.join(assetsRulesDir, 'dev_workflow.mdc'); fs.writeFileSync(assetRule, 'dummy'); // Should create .roo/rules and call post-processing - convertAllRulesToProfileRules(testDir, rooProfile); + convertAllRulesToProfileRules(testDir, rooProfile.rooProfile); // Check for post-processing artifacts, e.g., rules-* folders or extra files const rooDir = path.join(testDir, '.roo'); const found = fs.readdirSync(rooDir).some((f) => f.startsWith('rules-')); diff --git a/tests/unit/rule-transformer-trae.test.js b/tests/unit/rule-transformer-trae.test.js index 7dd34a05..195ec309 100644 --- a/tests/unit/rule-transformer-trae.test.js +++ b/tests/unit/rule-transformer-trae.test.js @@ -41,7 +41,11 @@ Also has references to .mdc files.`; // Convert it const testTraeRule = path.join(testDir, 'basic-terms.md'); - convertRuleToProfileRule(testCursorRule, testTraeRule, traeProfile); + convertRuleToProfileRule( + testCursorRule, + testTraeRule, + traeProfile.traeProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testTraeRule, 'utf8'); @@ -72,7 +76,11 @@ alwaysApply: true // Convert it const testTraeRule = path.join(testDir, 'tool-refs.md'); - convertRuleToProfileRule(testCursorRule, testTraeRule, traeProfile); + convertRuleToProfileRule( + testCursorRule, + testTraeRule, + traeProfile.traeProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testTraeRule, 'utf8'); @@ -100,7 +108,11 @@ This references [dev_workflow.mdc](mdc:.cursor/rules/dev_workflow.mdc) and // Convert it const testTraeRule = path.join(testDir, 'file-refs.md'); - convertRuleToProfileRule(testCursorRule, testTraeRule, traeProfile); + convertRuleToProfileRule( + testCursorRule, + testTraeRule, + traeProfile.traeProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testTraeRule, 'utf8'); diff --git a/tests/unit/rule-transformer-windsurf.test.js b/tests/unit/rule-transformer-windsurf.test.js index e263d76d..d6c542dc 100644 --- a/tests/unit/rule-transformer-windsurf.test.js +++ b/tests/unit/rule-transformer-windsurf.test.js @@ -41,7 +41,11 @@ Also has references to .mdc files.`; // Convert it const testWindsurfRule = path.join(testDir, 'basic-terms.md'); - convertRuleToProfileRule(testCursorRule, testWindsurfRule, windsurfProfile); + convertRuleToProfileRule( + testCursorRule, + testWindsurfRule, + windsurfProfile.windsurfProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testWindsurfRule, 'utf8'); @@ -72,7 +76,11 @@ alwaysApply: true // Convert it const testWindsurfRule = path.join(testDir, 'tool-refs.md'); - convertRuleToProfileRule(testCursorRule, testWindsurfRule, windsurfProfile); + convertRuleToProfileRule( + testCursorRule, + testWindsurfRule, + windsurfProfile.windsurfProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testWindsurfRule, 'utf8'); @@ -100,7 +108,11 @@ This references [dev_workflow.mdc](mdc:.cursor/rules/dev_workflow.mdc) and // Convert it const testWindsurfRule = path.join(testDir, 'file-refs.md'); - convertRuleToProfileRule(testCursorRule, testWindsurfRule, windsurfProfile); + convertRuleToProfileRule( + testCursorRule, + testWindsurfRule, + windsurfProfile.windsurfProfile + ); // Read the converted file const convertedContent = fs.readFileSync(testWindsurfRule, 'utf8');