mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-05-18 06:43:05 +08:00
feat: add zed install target
This commit is contained in:
@@ -11,6 +11,7 @@ const PLATFORM_SOURCE_PATH_OWNERS = Object.freeze({
|
||||
'.opencode': 'opencode',
|
||||
'.codebuddy': 'codebuddy',
|
||||
'.qwen': 'qwen',
|
||||
'.zed': 'zed',
|
||||
});
|
||||
|
||||
function normalizeRelativePath(relativePath) {
|
||||
|
||||
@@ -7,6 +7,7 @@ const geminiProject = require('./gemini-project');
|
||||
const joycodeProject = require('./joycode-project');
|
||||
const opencodeHome = require('./opencode-home');
|
||||
const qwenHome = require('./qwen-home');
|
||||
const zedProject = require('./zed-project');
|
||||
|
||||
const ADAPTERS = Object.freeze([
|
||||
claudeHome,
|
||||
@@ -18,6 +19,7 @@ const ADAPTERS = Object.freeze([
|
||||
codebuddyProject,
|
||||
joycodeProject,
|
||||
qwenHome,
|
||||
zedProject,
|
||||
]);
|
||||
|
||||
function listInstallTargetAdapters() {
|
||||
|
||||
50
scripts/lib/install-targets/zed-project.js
Normal file
50
scripts/lib/install-targets/zed-project.js
Normal file
@@ -0,0 +1,50 @@
|
||||
const path = require('path');
|
||||
|
||||
const {
|
||||
createFlatRuleOperations,
|
||||
createInstallTargetAdapter,
|
||||
isForeignPlatformPath,
|
||||
} = require('./helpers');
|
||||
|
||||
module.exports = createInstallTargetAdapter({
|
||||
id: 'zed-project',
|
||||
target: 'zed',
|
||||
kind: 'project',
|
||||
rootSegments: ['.zed'],
|
||||
installStatePathSegments: ['ecc-install-state.json'],
|
||||
nativeRootRelativePath: '.zed',
|
||||
planOperations(input, adapter) {
|
||||
const modules = Array.isArray(input.modules)
|
||||
? input.modules
|
||||
: (input.module ? [input.module] : []);
|
||||
const {
|
||||
repoRoot,
|
||||
projectRoot,
|
||||
homeDir,
|
||||
} = input;
|
||||
const planningInput = {
|
||||
repoRoot,
|
||||
projectRoot,
|
||||
homeDir,
|
||||
};
|
||||
const targetRoot = adapter.resolveRoot(planningInput);
|
||||
|
||||
return modules.flatMap(module => {
|
||||
const paths = Array.isArray(module.paths) ? module.paths : [];
|
||||
return paths
|
||||
.filter(p => !isForeignPlatformPath(p, adapter.target))
|
||||
.flatMap(sourceRelativePath => {
|
||||
if (sourceRelativePath === 'rules') {
|
||||
return createFlatRuleOperations({
|
||||
moduleId: module.id,
|
||||
repoRoot,
|
||||
sourceRelativePath,
|
||||
destinationDir: path.join(targetRoot, 'rules'),
|
||||
});
|
||||
}
|
||||
|
||||
return [adapter.createScaffoldOperation(module.id, sourceRelativePath, planningInput)];
|
||||
});
|
||||
});
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user