move profiles to /src

This commit is contained in:
Joe Danziger
2025-06-05 10:17:30 -04:00
parent 8f93a695e9
commit 948203ed7f
27 changed files with 26 additions and 26 deletions

View File

@@ -21,8 +21,8 @@
* *
* To add a new rule profile: * To add a new rule profile:
* 1. Add the profile name to this array * 1. Add the profile name to this array
* 2. Create a profile file in scripts/profiles/{profile}.js * 2. Create a profile file in src/profiles/{profile}.js
* 3. Export it as {profile}Profile in scripts/profiles/index.js * 3. Export it as {profile}Profile in src/profiles/index.js
*/ */
export const RULE_PROFILES = [ export const RULE_PROFILES = [
'claude', 'claude',

View File

@@ -1,7 +1,7 @@
// Claude Code profile for rule-transformer // Claude Code profile for rule-transformer
import path from 'path'; import path from 'path';
import fs from 'fs'; import fs from 'fs';
import { isSilentMode, log } from '../modules/utils.js'; import { isSilentMode, log } from '../../scripts/modules/utils.js';
// Lifecycle functions for Claude Code profile // Lifecycle functions for Claude Code profile
function onAddRulesProfile(targetDir, assetsDir) { function onAddRulesProfile(targetDir, assetsDir) {

View File

@@ -1,7 +1,7 @@
// Codex profile for rule-transformer // Codex profile for rule-transformer
import path from 'path'; import path from 'path';
import fs from 'fs'; import fs from 'fs';
import { isSilentMode, log } from '../modules/utils.js'; import { isSilentMode, log } from '../../scripts/modules/utils.js';
// Lifecycle functions for Codex profile // Lifecycle functions for Codex profile
function onAddRulesProfile(targetDir, assetsDir) { function onAddRulesProfile(targetDir, assetsDir) {

View File

@@ -1,9 +1,9 @@
// Roo Code conversion profile for rule-transformer // Roo Code conversion profile for rule-transformer
import path from 'path'; import path from 'path';
import fs from 'fs'; import fs from 'fs';
import { isSilentMode, log } from '../modules/utils.js'; import { isSilentMode, log } from '../../scripts/modules/utils.js';
import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js'; import { createProfile, COMMON_TOOL_MAPPINGS } from './base-profile.js';
import { ROO_MODES } from '../../src/constants/profiles.js'; import { ROO_MODES } from '../constants/profiles.js';
// Lifecycle functions for Roo profile // Lifecycle functions for Roo profile
function onAddRulesProfile(targetDir, assetsDir) { function onAddRulesProfile(targetDir, assetsDir) {

View File

@@ -20,7 +20,7 @@ import {
import { RULE_PROFILES } from '../constants/profiles.js'; import { RULE_PROFILES } from '../constants/profiles.js';
// --- Profile Imports --- // --- Profile Imports ---
import * as profilesModule from '../../scripts/profiles/index.js'; import * as profilesModule from '../profiles/index.js';
export function isValidProfile(profile) { export function isValidProfile(profile) {
return RULE_PROFILES.includes(profile); return RULE_PROFILES.includes(profile);

View File

@@ -7,7 +7,7 @@ describe('Claude Profile Initialization Functionality', () => {
beforeAll(() => { beforeAll(() => {
const claudeJsPath = path.join( const claudeJsPath = path.join(
process.cwd(), process.cwd(),
'scripts', 'src',
'profiles', 'profiles',
'claude.js' 'claude.js'
); );

View File

@@ -7,7 +7,7 @@ describe('Cline Profile Initialization Functionality', () => {
beforeAll(() => { beforeAll(() => {
const clineJsPath = path.join( const clineJsPath = path.join(
process.cwd(), process.cwd(),
'scripts', 'src',
'profiles', 'profiles',
'cline.js' 'cline.js'
); );

View File

@@ -7,7 +7,7 @@ describe('Codex Profile Initialization Functionality', () => {
beforeAll(() => { beforeAll(() => {
const codexJsPath = path.join( const codexJsPath = path.join(
process.cwd(), process.cwd(),
'scripts', 'src',
'profiles', 'profiles',
'codex.js' 'codex.js'
); );

View File

@@ -7,7 +7,7 @@ describe('Cursor Profile Initialization Functionality', () => {
beforeAll(() => { beforeAll(() => {
const cursorJsPath = path.join( const cursorJsPath = path.join(
process.cwd(), process.cwd(),
'scripts', 'src',
'profiles', 'profiles',
'cursor.js' 'cursor.js'
); );

View File

@@ -18,7 +18,7 @@ describe('Roo Files Inclusion in Package', () => {
test('roo.js profile contains logic for Roo directory creation and file copying', () => { test('roo.js profile contains logic for Roo directory creation and file copying', () => {
// Read the roo.js profile file // Read the roo.js profile file
const rooJsPath = path.join(process.cwd(), 'scripts', 'profiles', 'roo.js'); const rooJsPath = path.join(process.cwd(), 'src', 'profiles', 'roo.js');
const rooJsContent = fs.readFileSync(rooJsPath, 'utf8'); const rooJsContent = fs.readFileSync(rooJsPath, 'utf8');
// Check for the main handler function // Check for the main handler function
@@ -55,10 +55,10 @@ describe('Roo Files Inclusion in Package', () => {
) )
).toBe(true); ).toBe(true);
// Check for import of ROO_MODES from profiles.js // Check for import of ROO_MODES from profiles.js instead of local definition
expect( expect(
rooJsContent.includes( rooJsContent.includes(
"import { ROO_MODES } from '../../src/constants/profiles.js'" "import { ROO_MODES } from '../constants/profiles.js'"
) )
).toBe(true); ).toBe(true);

View File

@@ -7,7 +7,7 @@ describe('Roo Profile Initialization Functionality', () => {
beforeAll(() => { beforeAll(() => {
// Read the roo.js profile file content once for all tests // Read the roo.js profile file content once for all tests
const rooJsPath = path.join(process.cwd(), 'scripts', 'profiles', 'roo.js'); const rooJsPath = path.join(process.cwd(), 'src', 'profiles', 'roo.js');
rooProfileContent = fs.readFileSync(rooJsPath, 'utf8'); rooProfileContent = fs.readFileSync(rooJsPath, 'utf8');
}); });
@@ -32,7 +32,7 @@ describe('Roo Profile Initialization Functionality', () => {
// Check for import of ROO_MODES from profiles.js instead of local definition // Check for import of ROO_MODES from profiles.js instead of local definition
expect(rooProfileContent).toContain( expect(rooProfileContent).toContain(
"import { ROO_MODES } from '../../src/constants/profiles.js';" "import { ROO_MODES } from '../constants/profiles.js';"
); );
}); });

View File

@@ -37,7 +37,7 @@ describe('Rules Files Inclusion in Package', () => {
test('roo.js profile contains logic for Roo directory creation and file copying', () => { test('roo.js profile contains logic for Roo directory creation and file copying', () => {
// Read the roo.js profile file // Read the roo.js profile file
const rooJsPath = path.join(process.cwd(), 'scripts', 'profiles', 'roo.js'); const rooJsPath = path.join(process.cwd(), 'src', 'profiles', 'roo.js');
const rooJsContent = fs.readFileSync(rooJsPath, 'utf8'); const rooJsContent = fs.readFileSync(rooJsPath, 'utf8');
// Check for the main handler function // Check for the main handler function
@@ -77,7 +77,7 @@ describe('Rules Files Inclusion in Package', () => {
// Check for import of ROO_MODES from profiles.js // Check for import of ROO_MODES from profiles.js
expect( expect(
rooJsContent.includes( rooJsContent.includes(
"import { ROO_MODES } from '../../src/constants/profiles.js'" "import { ROO_MODES } from '../constants/profiles.js'"
) )
).toBe(true); ).toBe(true);

View File

@@ -7,7 +7,7 @@ describe('Trae Profile Initialization Functionality', () => {
beforeAll(() => { beforeAll(() => {
const traeJsPath = path.join( const traeJsPath = path.join(
process.cwd(), process.cwd(),
'scripts', 'src',
'profiles', 'profiles',
'trae.js' 'trae.js'
); );

View File

@@ -7,7 +7,7 @@ describe('Windsurf Profile Initialization Functionality', () => {
beforeAll(() => { beforeAll(() => {
const windsurfJsPath = path.join( const windsurfJsPath = path.join(
process.cwd(), process.cwd(),
'scripts', 'src',
'profiles', 'profiles',
'windsurf.js' 'windsurf.js'
); );

View File

@@ -11,7 +11,7 @@ jest.mock('fs', () => ({
// Import modules after mocking // Import modules after mocking
import fs from 'fs'; import fs from 'fs';
import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js'; import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js';
import { clineProfile } from '../../../scripts/profiles/cline.js'; import { clineProfile } from '../../../src/profiles/cline.js';
describe('Cline Rule Transformer', () => { describe('Cline Rule Transformer', () => {
// Set up spies on the mocked modules // Set up spies on the mocked modules

View File

@@ -11,7 +11,7 @@ jest.mock('fs', () => ({
// Import modules after mocking // Import modules after mocking
import fs from 'fs'; import fs from 'fs';
import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js'; import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js';
import { cursorProfile } from '../../../scripts/profiles/cursor.js'; import { cursorProfile } from '../../../src/profiles/cursor.js';
describe('Cursor Rule Transformer', () => { describe('Cursor Rule Transformer', () => {
// Set up spies on the mocked modules // Set up spies on the mocked modules

View File

@@ -11,7 +11,7 @@ jest.mock('fs', () => ({
// Import modules after mocking // Import modules after mocking
import fs from 'fs'; import fs from 'fs';
import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js'; import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js';
import { rooProfile } from '../../../scripts/profiles/roo.js'; import { rooProfile } from '../../../src/profiles/roo.js';
describe('Roo Rule Transformer', () => { describe('Roo Rule Transformer', () => {
// Set up spies on the mocked modules // Set up spies on the mocked modules

View File

@@ -11,7 +11,7 @@ jest.mock('fs', () => ({
// Import modules after mocking // Import modules after mocking
import fs from 'fs'; import fs from 'fs';
import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js'; import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js';
import { traeProfile } from '../../../scripts/profiles/trae.js'; import { traeProfile } from '../../../src/profiles/trae.js';
describe('Trae Rule Transformer', () => { describe('Trae Rule Transformer', () => {
// Set up spies on the mocked modules // Set up spies on the mocked modules

View File

@@ -11,7 +11,7 @@ jest.mock('fs', () => ({
// Import modules after mocking // Import modules after mocking
import fs from 'fs'; import fs from 'fs';
import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js'; import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js';
import { vscodeProfile } from '../../../scripts/profiles/vscode.js'; import { vscodeProfile } from '../../../src/profiles/vscode.js';
describe('VS Code Rule Transformer', () => { describe('VS Code Rule Transformer', () => {
// Set up spies on the mocked modules // Set up spies on the mocked modules

View File

@@ -11,7 +11,7 @@ jest.mock('fs', () => ({
// Import modules after mocking // Import modules after mocking
import fs from 'fs'; import fs from 'fs';
import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js'; import { convertRuleToProfileRule } from '../../../src/utils/rule-transformer.js';
import { windsurfProfile } from '../../../scripts/profiles/windsurf.js'; import { windsurfProfile } from '../../../src/profiles/windsurf.js';
describe('Windsurf Rule Transformer', () => { describe('Windsurf Rule Transformer', () => {
// Set up spies on the mocked modules // Set up spies on the mocked modules