mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-06-15 04:31:27 +08:00
Fix claude-project target for legacy language installs (#2147)
This commit is contained in:
committed by
GitHub
parent
0cb8907e14
commit
53d4b7d664
@@ -262,18 +262,16 @@ function isDirectoryNonEmpty(dirPath) {
|
|||||||
return fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory() && fs.readdirSync(dirPath).length > 0;
|
return fs.existsSync(dirPath) && fs.statSync(dirPath).isDirectory() && fs.readdirSync(dirPath).length > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
function planClaudeLegacyInstall(context) {
|
function planClaudeStyleLegacyInstall(context, { adapterId, adapterRootInput, rulesDir: rulesDirOverride }) {
|
||||||
const adapter = getInstallTargetAdapter('claude');
|
const adapter = getInstallTargetAdapter(adapterId);
|
||||||
const targetRoot = adapter.resolveRoot({ homeDir: context.homeDir });
|
const targetRoot = adapter.resolveRoot(adapterRootInput);
|
||||||
const rulesDir = context.claudeRulesDir || path.join(targetRoot, 'rules', CLAUDE_ECC_NAMESPACE);
|
const rulesDir = rulesDirOverride || path.join(targetRoot, 'rules', CLAUDE_ECC_NAMESPACE);
|
||||||
const installStatePath = adapter.getInstallStatePath({ homeDir: context.homeDir });
|
const installStatePath = adapter.getInstallStatePath(adapterRootInput);
|
||||||
const operations = [];
|
const operations = [];
|
||||||
const warnings = [];
|
const warnings = [];
|
||||||
|
|
||||||
if (isDirectoryNonEmpty(rulesDir)) {
|
if (isDirectoryNonEmpty(rulesDir)) {
|
||||||
warnings.push(
|
warnings.push(`Destination ${rulesDir}/ already exists and files may be overwritten`);
|
||||||
`Destination ${rulesDir}/ already exists and files may be overwritten`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addRecursiveCopyOperations(operations, {
|
addRecursiveCopyOperations(operations, {
|
||||||
@@ -285,9 +283,7 @@ function planClaudeLegacyInstall(context) {
|
|||||||
|
|
||||||
for (const language of context.languages) {
|
for (const language of context.languages) {
|
||||||
if (!LANGUAGE_NAME_PATTERN.test(language)) {
|
if (!LANGUAGE_NAME_PATTERN.test(language)) {
|
||||||
warnings.push(
|
warnings.push(`Invalid language name '${language}'. Only alphanumeric, dash, and underscore are allowed`);
|
||||||
`Invalid language name '${language}'. Only alphanumeric, dash, and underscore are allowed`
|
|
||||||
);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -308,7 +304,7 @@ function planClaudeLegacyInstall(context) {
|
|||||||
return {
|
return {
|
||||||
mode: 'legacy',
|
mode: 'legacy',
|
||||||
adapter,
|
adapter,
|
||||||
target: 'claude',
|
target: adapterId,
|
||||||
targetRoot,
|
targetRoot,
|
||||||
installRoot: rulesDir,
|
installRoot: rulesDir,
|
||||||
installStatePath,
|
installStatePath,
|
||||||
@@ -318,6 +314,22 @@ function planClaudeLegacyInstall(context) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function planClaudeLegacyInstall(context) {
|
||||||
|
return planClaudeStyleLegacyInstall(context, {
|
||||||
|
adapterId: 'claude',
|
||||||
|
adapterRootInput: { homeDir: context.homeDir },
|
||||||
|
rulesDir: context.claudeRulesDir || null,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function planClaudeProjectLegacyInstall(context) {
|
||||||
|
return planClaudeStyleLegacyInstall(context, {
|
||||||
|
adapterId: 'claude-project',
|
||||||
|
adapterRootInput: { repoRoot: context.projectRoot },
|
||||||
|
rulesDir: null,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function planCursorLegacyInstall(context) {
|
function planCursorLegacyInstall(context) {
|
||||||
const adapter = getInstallTargetAdapter('cursor');
|
const adapter = getInstallTargetAdapter('cursor');
|
||||||
const targetRoot = adapter.resolveRoot({ repoRoot: context.projectRoot });
|
const targetRoot = adapter.resolveRoot({ repoRoot: context.projectRoot });
|
||||||
@@ -503,6 +515,8 @@ function createLegacyInstallPlan(options = {}) {
|
|||||||
let plan;
|
let plan;
|
||||||
if (target === 'claude') {
|
if (target === 'claude') {
|
||||||
plan = planClaudeLegacyInstall(context);
|
plan = planClaudeLegacyInstall(context);
|
||||||
|
} else if (target === 'claude-project') {
|
||||||
|
plan = planClaudeProjectLegacyInstall(context);
|
||||||
} else if (target === 'cursor') {
|
} else if (target === 'cursor') {
|
||||||
plan = planCursorLegacyInstall(context);
|
plan = planCursorLegacyInstall(context);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
const { validateInstallModuleIds, LOCALE_ALIAS_TO_COMPONENT_ID, listSupportedLocales } = require('../install-manifests');
|
const { validateInstallModuleIds, LOCALE_ALIAS_TO_COMPONENT_ID, listSupportedLocales } = require('../install-manifests');
|
||||||
|
|
||||||
const LEGACY_INSTALL_TARGETS = ['claude', 'cursor', 'antigravity'];
|
const LEGACY_INSTALL_TARGETS = ['claude', 'claude-project', 'cursor', 'antigravity'];
|
||||||
|
|
||||||
function dedupeStrings(values) {
|
function dedupeStrings(values) {
|
||||||
return [...new Set((Array.isArray(values) ? values : []).map(value => String(value).trim()).filter(Boolean))];
|
return [...new Set((Array.isArray(values) ? values : []).map(value => String(value).trim()).filter(Boolean))];
|
||||||
|
|||||||
Reference in New Issue
Block a user