remove unneeded exports to optimize loc

This commit is contained in:
Joe Danziger
2025-05-27 14:52:09 -04:00
parent 5149aaa56f
commit 9681c9171c
10 changed files with 86 additions and 101 deletions

View File

@@ -1,8 +1,8 @@
// Cline conversion profile for rule-transformer // Cline conversion profile for rule-transformer
import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js'; import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js';
// Create cline profile using the base factory // Create and export cline profile using the base factory
const clineProfile = createProfile({ export const clineProfile = createProfile({
name: 'cline', name: 'cline',
displayName: 'Cline', displayName: 'Cline',
url: 'cline.bot', url: 'cline.bot',
@@ -18,18 +18,3 @@ const clineProfile = createProfile({
'cursor_rules.mdc': 'cline_rules.md' '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;

View File

@@ -1,8 +1,8 @@
// Cursor conversion profile for rule-transformer // Cursor conversion profile for rule-transformer
import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js'; import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js';
// Create cursor profile using the base factory // Create and export cursor profile using the base factory
const cursorProfile = createProfile({ export const cursorProfile = createProfile({
name: 'cursor', name: 'cursor',
displayName: 'Cursor', displayName: 'Cursor',
url: 'cursor.so', url: 'cursor.so',
@@ -18,18 +18,3 @@ const cursorProfile = createProfile({
'cursor_rules.mdc': 'cursor_rules.mdc' // Keep the same name for cursor '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;

View File

@@ -102,8 +102,8 @@ function onPostConvertRulesProfile(targetDir) {
onAddRulesProfile(targetDir); onAddRulesProfile(targetDir);
} }
// Create roo profile using the base factory // Create and export roo profile using the base factory
const rooProfile = createProfile({ export const rooProfile = createProfile({
name: 'roo', name: 'roo',
displayName: 'Roo Code', displayName: 'Roo Code',
url: 'roocode.com', url: 'roocode.com',
@@ -123,20 +123,5 @@ const rooProfile = createProfile({
onPostConvert: onPostConvertRulesProfile 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 lifecycle functions separately to avoid naming conflicts
export { onAddRulesProfile, onRemoveRulesProfile, onPostConvertRulesProfile }; export { onAddRulesProfile, onRemoveRulesProfile, onPostConvertRulesProfile };

View File

@@ -1,8 +1,8 @@
// Trae conversion profile for rule-transformer // Trae conversion profile for rule-transformer
import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js'; import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js';
// Create trae profile using the base factory // Create and export trae profile using the base factory
const traeProfile = createProfile({ export const traeProfile = createProfile({
name: 'trae', name: 'trae',
displayName: 'Trae', displayName: 'Trae',
url: 'trae.ai', url: 'trae.ai',
@@ -15,18 +15,3 @@ const traeProfile = createProfile({
targetExtension: '.md', targetExtension: '.md',
toolMappings: COMMON_TOOL_MAPPINGS.STANDARD // Trae uses standard tool names 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;

View File

@@ -1,8 +1,8 @@
// Windsurf conversion profile for rule-transformer // Windsurf conversion profile for rule-transformer
import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js'; import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js';
// Create windsurf profile using the base factory // Create and export windsurf profile using the base factory
const windsurfProfile = createProfile({ export const windsurfProfile = createProfile({
name: 'windsurf', name: 'windsurf',
displayName: 'Windsurf', displayName: 'Windsurf',
url: 'windsurf.com', url: 'windsurf.com',
@@ -15,18 +15,3 @@ const windsurfProfile = createProfile({
targetExtension: '.md', targetExtension: '.md',
toolMappings: COMMON_TOOL_MAPPINGS.STANDARD // Windsurf uses standard tool names 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;

View File

@@ -41,7 +41,11 @@ Also has references to .mdc files.`;
// Convert it // Convert it
const testClineRule = path.join(testDir, 'basic-terms.md'); const testClineRule = path.join(testDir, 'basic-terms.md');
convertRuleToProfileRule(testCursorRule, testClineRule, clineProfile); convertRuleToProfileRule(
testCursorRule,
testClineRule,
clineProfile.clineProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testClineRule, 'utf8'); const convertedContent = fs.readFileSync(testClineRule, 'utf8');
@@ -72,7 +76,11 @@ alwaysApply: true
// Convert it // Convert it
const testClineRule = path.join(testDir, 'tool-refs.md'); const testClineRule = path.join(testDir, 'tool-refs.md');
convertRuleToProfileRule(testCursorRule, testClineRule, clineProfile); convertRuleToProfileRule(
testCursorRule,
testClineRule,
clineProfile.clineProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testClineRule, 'utf8'); const convertedContent = fs.readFileSync(testClineRule, 'utf8');
@@ -100,7 +108,11 @@ This references [dev_workflow.mdc](mdc:.cursor/rules/dev_workflow.mdc) and
// Convert it // Convert it
const testClineRule = path.join(testDir, 'file-refs.md'); const testClineRule = path.join(testDir, 'file-refs.md');
convertRuleToProfileRule(testCursorRule, testClineRule, clineProfile); convertRuleToProfileRule(
testCursorRule,
testClineRule,
clineProfile.clineProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testClineRule, 'utf8'); const convertedContent = fs.readFileSync(testClineRule, 'utf8');

View File

@@ -45,7 +45,11 @@ Also has references to .mdc files.`;
// Convert it // Convert it
const testCursorOut = path.join(testDir, 'basic-terms.mdc'); const testCursorOut = path.join(testDir, 'basic-terms.mdc');
convertRuleToProfileRule(testCursorRule, testCursorOut, cursorProfile); convertRuleToProfileRule(
testCursorRule,
testCursorOut,
cursorProfile.cursorProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testCursorOut, 'utf8'); const convertedContent = fs.readFileSync(testCursorOut, 'utf8');
@@ -76,7 +80,11 @@ alwaysApply: true
// Convert it // Convert it
const testCursorOut = path.join(testDir, 'tool-refs.mdc'); const testCursorOut = path.join(testDir, 'tool-refs.mdc');
convertRuleToProfileRule(testCursorRule, testCursorOut, cursorProfile); convertRuleToProfileRule(
testCursorRule,
testCursorOut,
cursorProfile.cursorProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testCursorOut, 'utf8'); const convertedContent = fs.readFileSync(testCursorOut, 'utf8');
@@ -106,7 +114,11 @@ This references [dev_workflow.mdc](mdc:.cursor/rules/dev_workflow.mdc) and
// Convert it // Convert it
const testCursorOut = path.join(testDir, 'file-refs.mdc'); const testCursorOut = path.join(testDir, 'file-refs.mdc');
convertRuleToProfileRule(testCursorRule, testCursorOut, cursorProfile); convertRuleToProfileRule(
testCursorRule,
testCursorOut,
cursorProfile.cursorProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testCursorOut, 'utf8'); const convertedContent = fs.readFileSync(testCursorOut, 'utf8');

View File

@@ -45,7 +45,11 @@ Also has references to .mdc files.`;
// Convert it // Convert it
const testRooRule = path.join(testDir, 'basic-terms.md'); const testRooRule = path.join(testDir, 'basic-terms.md');
convertRuleToProfileRule(testCursorRule, testRooRule, rooProfile); convertRuleToProfileRule(
testCursorRule,
testRooRule,
rooProfile.rooProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testRooRule, 'utf8'); const convertedContent = fs.readFileSync(testRooRule, 'utf8');
@@ -76,7 +80,11 @@ alwaysApply: true
// Convert it // Convert it
const testRooRule = path.join(testDir, 'tool-refs.md'); const testRooRule = path.join(testDir, 'tool-refs.md');
convertRuleToProfileRule(testCursorRule, testRooRule, rooProfile); convertRuleToProfileRule(
testCursorRule,
testRooRule,
rooProfile.rooProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testRooRule, 'utf8'); const convertedContent = fs.readFileSync(testRooRule, 'utf8');
@@ -104,7 +112,11 @@ This references [dev_workflow.mdc](mdc:.cursor/rules/dev_workflow.mdc) and
// Convert it // Convert it
const testRooRule = path.join(testDir, 'file-refs.md'); const testRooRule = path.join(testDir, 'file-refs.md');
convertRuleToProfileRule(testCursorRule, testRooRule, rooProfile); convertRuleToProfileRule(
testCursorRule,
testRooRule,
rooProfile.rooProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testRooRule, 'utf8'); 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'); const assetRule = path.join(assetsRulesDir, 'dev_workflow.mdc');
fs.writeFileSync(assetRule, 'dummy'); fs.writeFileSync(assetRule, 'dummy');
// Should create .roo/rules and call post-processing // 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 // Check for post-processing artifacts, e.g., rules-* folders or extra files
const rooDir = path.join(testDir, '.roo'); const rooDir = path.join(testDir, '.roo');
const found = fs.readdirSync(rooDir).some((f) => f.startsWith('rules-')); const found = fs.readdirSync(rooDir).some((f) => f.startsWith('rules-'));

View File

@@ -41,7 +41,11 @@ Also has references to .mdc files.`;
// Convert it // Convert it
const testTraeRule = path.join(testDir, 'basic-terms.md'); const testTraeRule = path.join(testDir, 'basic-terms.md');
convertRuleToProfileRule(testCursorRule, testTraeRule, traeProfile); convertRuleToProfileRule(
testCursorRule,
testTraeRule,
traeProfile.traeProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testTraeRule, 'utf8'); const convertedContent = fs.readFileSync(testTraeRule, 'utf8');
@@ -72,7 +76,11 @@ alwaysApply: true
// Convert it // Convert it
const testTraeRule = path.join(testDir, 'tool-refs.md'); const testTraeRule = path.join(testDir, 'tool-refs.md');
convertRuleToProfileRule(testCursorRule, testTraeRule, traeProfile); convertRuleToProfileRule(
testCursorRule,
testTraeRule,
traeProfile.traeProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testTraeRule, 'utf8'); const convertedContent = fs.readFileSync(testTraeRule, 'utf8');
@@ -100,7 +108,11 @@ This references [dev_workflow.mdc](mdc:.cursor/rules/dev_workflow.mdc) and
// Convert it // Convert it
const testTraeRule = path.join(testDir, 'file-refs.md'); const testTraeRule = path.join(testDir, 'file-refs.md');
convertRuleToProfileRule(testCursorRule, testTraeRule, traeProfile); convertRuleToProfileRule(
testCursorRule,
testTraeRule,
traeProfile.traeProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testTraeRule, 'utf8'); const convertedContent = fs.readFileSync(testTraeRule, 'utf8');

View File

@@ -41,7 +41,11 @@ Also has references to .mdc files.`;
// Convert it // Convert it
const testWindsurfRule = path.join(testDir, 'basic-terms.md'); const testWindsurfRule = path.join(testDir, 'basic-terms.md');
convertRuleToProfileRule(testCursorRule, testWindsurfRule, windsurfProfile); convertRuleToProfileRule(
testCursorRule,
testWindsurfRule,
windsurfProfile.windsurfProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testWindsurfRule, 'utf8'); const convertedContent = fs.readFileSync(testWindsurfRule, 'utf8');
@@ -72,7 +76,11 @@ alwaysApply: true
// Convert it // Convert it
const testWindsurfRule = path.join(testDir, 'tool-refs.md'); const testWindsurfRule = path.join(testDir, 'tool-refs.md');
convertRuleToProfileRule(testCursorRule, testWindsurfRule, windsurfProfile); convertRuleToProfileRule(
testCursorRule,
testWindsurfRule,
windsurfProfile.windsurfProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testWindsurfRule, 'utf8'); const convertedContent = fs.readFileSync(testWindsurfRule, 'utf8');
@@ -100,7 +108,11 @@ This references [dev_workflow.mdc](mdc:.cursor/rules/dev_workflow.mdc) and
// Convert it // Convert it
const testWindsurfRule = path.join(testDir, 'file-refs.md'); const testWindsurfRule = path.join(testDir, 'file-refs.md');
convertRuleToProfileRule(testCursorRule, testWindsurfRule, windsurfProfile); convertRuleToProfileRule(
testCursorRule,
testWindsurfRule,
windsurfProfile.windsurfProfile
);
// Read the converted file // Read the converted file
const convertedContent = fs.readFileSync(testWindsurfRule, 'utf8'); const convertedContent = fs.readFileSync(testWindsurfRule, 'utf8');