feat: add JoyCode install target

This commit is contained in:
Affaan Mustafa
2026-05-11 10:58:24 -04:00
committed by Affaan Mustafa
parent fb9a8f2973
commit c7c1e36625
12 changed files with 275 additions and 21 deletions

View File

@@ -43,6 +43,7 @@ function runTests() {
assert.ok(targets.includes('gemini'), 'Should include gemini target');
assert.ok(targets.includes('opencode'), 'Should include opencode target');
assert.ok(targets.includes('codebuddy'), 'Should include codebuddy target');
assert.ok(targets.includes('joycode'), 'Should include joycode target');
})) passed++; else failed++;
if (test('resolves cursor adapter root and install-state path from project root', () => {
@@ -501,6 +502,29 @@ function runTests() {
assert.ok(byTarget.supports('codebuddy-project'));
})) passed++; else failed++;
if (test('resolves joycode adapter root and install-state path from project root', () => {
const adapter = getInstallTargetAdapter('joycode');
const projectRoot = '/workspace/app';
const root = adapter.resolveRoot({ projectRoot });
const statePath = adapter.getInstallStatePath({ projectRoot });
assert.strictEqual(adapter.id, 'joycode-project');
assert.strictEqual(adapter.target, 'joycode');
assert.strictEqual(adapter.kind, 'project');
assert.strictEqual(root, path.join(projectRoot, '.joycode'));
assert.strictEqual(statePath, path.join(projectRoot, '.joycode', 'ecc-install-state.json'));
})) passed++; else failed++;
if (test('joycode adapter supports lookup by target and adapter id', () => {
const byTarget = getInstallTargetAdapter('joycode');
const byId = getInstallTargetAdapter('joycode-project');
assert.strictEqual(byTarget.id, 'joycode-project');
assert.strictEqual(byId.id, 'joycode-project');
assert.ok(byTarget.supports('joycode'));
assert.ok(byTarget.supports('joycode-project'));
})) passed++; else failed++;
if (test('plans codebuddy rules with flat namespaced filenames', () => {
const repoRoot = path.join(__dirname, '..', '..');
const projectRoot = '/workspace/app';
@@ -536,6 +560,68 @@ function runTests() {
);
})) passed++; else failed++;
if (test('plans joycode commands, agents, skills, and flattened rules', () => {
const repoRoot = path.join(__dirname, '..', '..');
const projectRoot = '/workspace/app';
const plan = planInstallTargetScaffold({
target: 'joycode',
repoRoot,
projectRoot,
modules: [
{
id: 'rules-core',
paths: ['rules'],
},
{
id: 'agents-core',
paths: ['agents'],
},
{
id: 'commands-core',
paths: ['commands'],
},
{
id: 'workflow-quality',
paths: ['skills/tdd-workflow'],
},
],
});
assert.strictEqual(plan.adapter.id, 'joycode-project');
assert.strictEqual(plan.targetRoot, path.join(projectRoot, '.joycode'));
assert.strictEqual(plan.installStatePath, path.join(projectRoot, '.joycode', 'ecc-install-state.json'));
assert.ok(
plan.operations.some(operation => (
normalizedRelativePath(operation.sourceRelativePath) === 'rules/common/coding-style.md'
&& operation.destinationPath === path.join(projectRoot, '.joycode', 'rules', 'common-coding-style.md')
)),
'Should flatten common rules into namespaced files for joycode'
);
assert.ok(
plan.operations.some(operation => (
normalizedRelativePath(operation.sourceRelativePath) === 'agents'
&& operation.destinationPath === path.join(projectRoot, '.joycode', 'agents')
)),
'Should install agents under .joycode/agents'
);
assert.ok(
plan.operations.some(operation => (
normalizedRelativePath(operation.sourceRelativePath) === 'commands'
&& operation.destinationPath === path.join(projectRoot, '.joycode', 'commands')
)),
'Should install commands under .joycode/commands'
);
assert.ok(
plan.operations.some(operation => (
normalizedRelativePath(operation.sourceRelativePath) === 'skills/tdd-workflow'
&& operation.destinationPath === path.join(projectRoot, '.joycode', 'skills', 'tdd-workflow')
)),
'Should install skills under .joycode/skills'
);
})) passed++; else failed++;
if (test('exposes validate and planOperations on codebuddy adapter', () => {
const codebuddyAdapter = getInstallTargetAdapter('codebuddy');