mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-05-15 00:48:39 +08:00
fix: restore short Claude plugin slug and skill installs (#1712)
This commit is contained in:
@@ -24,6 +24,7 @@ function getHelpText() {
|
||||
Usage: install.sh [--target <${LEGACY_INSTALL_TARGETS.join('|')}>] [--dry-run] [--json] <language> [<language> ...]
|
||||
install.sh [--target <${SUPPORTED_INSTALL_TARGETS.join('|')}>] [--dry-run] [--json] --profile <name> [--with <component>]... [--without <component>]...
|
||||
install.sh [--target <${SUPPORTED_INSTALL_TARGETS.join('|')}>] [--dry-run] [--json] --modules <id,id,...> [--with <component>]... [--without <component>]...
|
||||
install.sh [--target <${SUPPORTED_INSTALL_TARGETS.join('|')}>] [--dry-run] [--json] --skills <skill-id[,skill-id...]>
|
||||
install.sh [--dry-run] [--json] --config <path>
|
||||
|
||||
Targets:
|
||||
@@ -35,6 +36,7 @@ Options:
|
||||
--profile <name> Resolve and install a manifest profile
|
||||
--modules <ids> Resolve and install explicit module IDs
|
||||
--with <component> Include a user-facing install component
|
||||
--skills <ids> Install one or more skill directories by ID, e.g. continuous-learning-v2
|
||||
--without <component>
|
||||
Exclude a user-facing install component
|
||||
--config <path> Load install intent from ecc-install.json
|
||||
|
||||
@@ -25,6 +25,7 @@ Usage:
|
||||
node scripts/install-plan.js --list-components [--family <family>] [--target <target>] [--json]
|
||||
node scripts/install-plan.js --profile <name> [--with <component>]... [--without <component>]... [--target <target>] [--json]
|
||||
node scripts/install-plan.js --modules <id,id,...> [--with <component>]... [--without <component>]... [--target <target>] [--json]
|
||||
node scripts/install-plan.js --skills <skill-id[,skill-id...]> [--target <target>] [--json]
|
||||
node scripts/install-plan.js --config <path> [--json]
|
||||
|
||||
Options:
|
||||
@@ -35,6 +36,7 @@ Options:
|
||||
--profile <name> Resolve an install profile
|
||||
--modules <ids> Resolve explicit module IDs (comma-separated)
|
||||
--with <component> Include a user-facing install component
|
||||
--skills <ids> Include one or more skill components by directory ID
|
||||
--without <component>
|
||||
Exclude a user-facing install component
|
||||
--config <path> Load install intent from ecc-install.json
|
||||
@@ -61,6 +63,11 @@ function parseArgs(argv) {
|
||||
listComponents: false,
|
||||
};
|
||||
|
||||
function normalizeSkillComponentIds(rawValue) {
|
||||
return [...new Set(String(rawValue || '').split(',').map(value => value.trim()).filter(Boolean))]
|
||||
.map(value => (value.startsWith('skill:') ? value : `skill:${value}`));
|
||||
}
|
||||
|
||||
for (let index = 0; index < args.length; index += 1) {
|
||||
const arg = args[index];
|
||||
if (arg === '--help' || arg === '-h') {
|
||||
@@ -89,6 +96,9 @@ function parseArgs(argv) {
|
||||
parsed.includeComponentIds.push(componentId.trim());
|
||||
}
|
||||
index += 1;
|
||||
} else if (arg === '--skill' || arg === '--skills') {
|
||||
parsed.includeComponentIds.push(...normalizeSkillComponentIds(args[index + 1] || ''));
|
||||
index += 1;
|
||||
} else if (arg === '--without') {
|
||||
const componentId = args[index + 1] || '';
|
||||
if (componentId.trim()) {
|
||||
|
||||
@@ -78,6 +78,56 @@ function dedupeStrings(values) {
|
||||
return [...new Set((Array.isArray(values) ? values : []).map(value => String(value).trim()).filter(Boolean))];
|
||||
}
|
||||
|
||||
function listSkillDirectoryIds(repoRoot) {
|
||||
const skillsRoot = path.join(repoRoot, 'skills');
|
||||
if (!fs.existsSync(skillsRoot) || !fs.statSync(skillsRoot).isDirectory()) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return fs.readdirSync(skillsRoot, { withFileTypes: true })
|
||||
.filter(entry => entry.isDirectory())
|
||||
.map(entry => entry.name)
|
||||
.sort();
|
||||
}
|
||||
|
||||
function addSyntheticSkillComponents({ repoRoot, modules, components }) {
|
||||
const moduleIds = new Set(modules.map(module => module.id));
|
||||
const componentIds = new Set(components.map(component => component.id));
|
||||
|
||||
for (const skillId of listSkillDirectoryIds(repoRoot)) {
|
||||
const componentId = `skill:${skillId}`;
|
||||
if (componentIds.has(componentId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const moduleId = `skill-${skillId}`;
|
||||
if (!moduleIds.has(moduleId)) {
|
||||
modules.push({
|
||||
id: moduleId,
|
||||
kind: 'skills',
|
||||
description: `Single-skill install surface for ${skillId}.`,
|
||||
paths: [`skills/${skillId}`],
|
||||
targets: SUPPORTED_INSTALL_TARGETS.slice(),
|
||||
dependencies: [],
|
||||
defaultInstall: false,
|
||||
cost: 'light',
|
||||
stability: 'stable',
|
||||
synthetic: true,
|
||||
});
|
||||
moduleIds.add(moduleId);
|
||||
}
|
||||
|
||||
components.push({
|
||||
id: componentId,
|
||||
family: 'skill',
|
||||
description: `Install only the ${skillId} skill directory.`,
|
||||
modules: [moduleId],
|
||||
synthetic: true,
|
||||
});
|
||||
componentIds.add(componentId);
|
||||
}
|
||||
}
|
||||
|
||||
function readOptionalStringOption(options, key) {
|
||||
if (
|
||||
!Object.prototype.hasOwnProperty.call(options, key)
|
||||
@@ -164,11 +214,13 @@ function loadInstallManifests(options = {}) {
|
||||
const componentsData = fs.existsSync(componentsPath)
|
||||
? readJson(componentsPath, 'install-components.json')
|
||||
: { version: null, components: [] };
|
||||
const modules = Array.isArray(modulesData.modules) ? modulesData.modules : [];
|
||||
const modules = Array.isArray(modulesData.modules) ? modulesData.modules.slice() : [];
|
||||
const profiles = profilesData && typeof profilesData.profiles === 'object'
|
||||
? profilesData.profiles
|
||||
: {};
|
||||
const components = Array.isArray(componentsData.components) ? componentsData.components : [];
|
||||
const components = Array.isArray(componentsData.components) ? componentsData.components.slice() : [];
|
||||
|
||||
addSyntheticSkillComponents({ repoRoot, modules, components });
|
||||
|
||||
for (const module of modules) {
|
||||
readModuleTargetsOrThrow(module);
|
||||
|
||||
@@ -8,6 +8,12 @@ function dedupeStrings(values) {
|
||||
return [...new Set((Array.isArray(values) ? values : []).map(value => String(value).trim()).filter(Boolean))];
|
||||
}
|
||||
|
||||
function normalizeSkillComponentIds(rawValue) {
|
||||
return dedupeStrings(String(rawValue || '').split(',')).map(value => (
|
||||
value.startsWith('skill:') ? value : `skill:${value}`
|
||||
));
|
||||
}
|
||||
|
||||
function parseInstallArgs(argv) {
|
||||
const args = argv.slice(2);
|
||||
const parsed = {
|
||||
@@ -45,6 +51,9 @@ function parseInstallArgs(argv) {
|
||||
parsed.includeComponentIds.push(componentId.trim());
|
||||
}
|
||||
index += 1;
|
||||
} else if (arg === '--skill' || arg === '--skills') {
|
||||
parsed.includeComponentIds.push(...normalizeSkillComponentIds(args[index + 1] || ''));
|
||||
index += 1;
|
||||
} else if (arg === '--without') {
|
||||
const componentId = args[index + 1] || '';
|
||||
if (componentId.trim()) {
|
||||
|
||||
Reference in New Issue
Block a user