use more generic function names

This commit is contained in:
Joe Danziger
2025-05-09 10:46:51 -04:00
parent 8185f59470
commit d45589dde9
2 changed files with 9 additions and 9 deletions

View File

@@ -126,7 +126,7 @@ function transformCursorToBrandRules(
/**
* Convert a single Cursor rule file to brand rule format
*/
function convertCursorRuleToBrandRule(sourcePath, targetPath, profile) {
function convertRuleToBrandRule(sourcePath, targetPath, profile) {
const { conversionConfig, brandName, globalReplacements } = profile;
try {
log(
@@ -170,7 +170,7 @@ function convertCursorRuleToBrandRule(sourcePath, targetPath, profile) {
/**
* Process all Cursor rules and convert to brand rules
*/
function convertAllCursorRulesToBrandRules(projectDir, profile) {
function convertAllRulesToBrandRules(projectDir, profile) {
const { fileMap, brandName, rulesDir } = profile;
// Use assets/rules as the source of rules instead of .cursor/rules
const cursorRulesDir = path.join(projectDir, 'assets', 'rules');
@@ -204,7 +204,7 @@ function convertAllCursorRulesToBrandRules(projectDir, profile) {
const targetPath = path.join(brandRulesDir, targetFilename);
// Convert the file
if (convertCursorRuleToBrandRule(sourcePath, targetPath, profile)) {
if (convertRuleToBrandRule(sourcePath, targetPath, profile)) {
success++;
} else {
failed++;
@@ -272,7 +272,7 @@ function removeBrandRules(projectDir, profile) {
}
export {
convertAllCursorRulesToBrandRules,
convertCursorRuleToBrandRule,
convertAllRulesToBrandRules,
convertRuleToBrandRule,
removeBrandRules
};

View File

@@ -2,7 +2,7 @@ import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import { dirname } from 'path';
import { convertCursorRuleToBrandRule } from '../../scripts/modules/rule-transformer.js';
import { convertRuleToBrandRule } from '../../scripts/modules/rule-transformer.js';
import * as rooProfile from '../../scripts/profiles/roo.js';
const __filename = fileURLToPath(import.meta.url);
@@ -41,7 +41,7 @@ Also has references to .mdc files.`;
// Convert it
const testRooRule = path.join(testDir, 'basic-terms.md');
convertCursorRuleToBrandRule(testCursorRule, testRooRule, rooProfile);
convertRuleToBrandRule(testCursorRule, testRooRule, rooProfile);
// Read the converted file
const convertedContent = fs.readFileSync(testRooRule, 'utf8');
@@ -72,7 +72,7 @@ alwaysApply: true
// Convert it
const testRooRule = path.join(testDir, 'tool-refs.md');
convertCursorRuleToBrandRule(testCursorRule, testRooRule, rooProfile);
convertRuleToBrandRule(testCursorRule, testRooRule, rooProfile);
// Read the converted file
const convertedContent = fs.readFileSync(testRooRule, 'utf8');
@@ -100,7 +100,7 @@ This references [dev_workflow.mdc](mdc:.cursor/rules/dev_workflow.mdc) and
// Convert it
const testRooRule = path.join(testDir, 'file-refs.md');
convertCursorRuleToBrandRule(testCursorRule, testRooRule, rooProfile);
convertRuleToBrandRule(testCursorRule, testRooRule, rooProfile);
// Read the converted file
const convertedContent = fs.readFileSync(testRooRule, 'utf8');