feat: add zed install target

This commit is contained in:
Affaan Mustafa
2026-05-17 07:06:49 -04:00
parent fb6d4a7104
commit 2371a3cf05
17 changed files with 361 additions and 37 deletions

View File

@@ -480,6 +480,7 @@ function runTests() {
assert.ok(result.includes('--with'), 'Help should mention --with');
assert.ok(result.includes('--without'), 'Help should mention --without');
assert.ok(result.includes('component'), 'Help should describe components');
assert.ok(result.includes('zed - Install project settings'), 'Help should describe Zed target');
})) passed++; else failed++;
// ─── End-to-End Dry-Run ───
@@ -515,6 +516,45 @@ function runTests() {
}
})) passed++; else failed++;
if (test('end-to-end: --profile minimal --target zed --dry-run --json plans project adapter', () => {
const { execFileSync } = require('child_process');
const scriptPath = path.join(__dirname, '..', '..', 'scripts', 'install-apply.js');
const homeDir = fs.mkdtempSync(path.join(os.tmpdir(), 'selective-e2e-'));
const projectDir = fs.mkdtempSync(path.join(os.tmpdir(), 'selective-e2e-zed-project-'));
try {
const result = execFileSync('node', [
scriptPath,
'--profile', 'minimal',
'--target', 'zed',
'--dry-run',
'--json',
], {
cwd: projectDir,
env: { ...process.env, HOME: homeDir },
encoding: 'utf8',
stdio: ['pipe', 'pipe', 'pipe'],
});
const parsed = JSON.parse(result);
assert.strictEqual(parsed.dryRun, true);
assert.strictEqual(parsed.plan.target, 'zed');
assert.strictEqual(parsed.plan.adapter.id, 'zed-project');
assert.strictEqual(parsed.plan.installRoot, path.join(fs.realpathSync(projectDir), '.zed'));
assert.ok(
parsed.plan.operations.some(operation => operation.sourceRelativePath === '.zed/settings.json'),
'Should include Zed native settings operation'
);
assert.ok(
!parsed.plan.operations.some(operation => operation.moduleId === 'hooks-runtime'),
'Zed minimal dry-run should not install hook runtime files'
);
} finally {
fs.rmSync(homeDir, { recursive: true, force: true });
fs.rmSync(projectDir, { recursive: true, force: true });
}
})) passed++; else failed++;
if (test('end-to-end: --with lang:python --with agent:security-reviewer --dry-run', () => {
const { execFileSync } = require('child_process');
const scriptPath = path.join(__dirname, '..', '..', 'scripts', 'install-apply.js');