@robosoft/skillhub-cli 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/bin/skillhub.mjs +25 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.2
|
|
4
|
+
|
|
5
|
+
- Fixed `skillhub init --target cursor` when `skillhub.json` already exists.
|
|
6
|
+
- Existing projects now update `target`, `skillsDir`, and adapters instead of continuing to create `.ai/skills`.
|
|
7
|
+
- Added clearer init output showing the active target.
|
|
8
|
+
|
|
3
9
|
## 0.1.1
|
|
4
10
|
|
|
5
11
|
- Added configurable install targets: `ai`, `cursor`, and `claude`.
|
package/bin/skillhub.mjs
CHANGED
|
@@ -506,13 +506,34 @@ async function updateCopilotInstructions(projectRoot, skillsDir, installed) {
|
|
|
506
506
|
async function commandInit(projectRoot, flags) {
|
|
507
507
|
const configPath = path.join(projectRoot, CONFIG_FILE);
|
|
508
508
|
const lockPath = path.join(projectRoot, LOCK_FILE);
|
|
509
|
-
const
|
|
509
|
+
const requestedTarget = normalizeTarget(flags.target || flags.to);
|
|
510
|
+
let config;
|
|
510
511
|
|
|
511
512
|
if (await exists(configPath)) {
|
|
513
|
+
config = await readProjectConfig(projectRoot);
|
|
512
514
|
warn(`${CONFIG_FILE} already exists.`);
|
|
513
|
-
|
|
515
|
+
|
|
516
|
+
if (requestedTarget) {
|
|
517
|
+
const previousTarget = getConfigTarget(config);
|
|
518
|
+
applyTargetToConfig(config, requestedTarget);
|
|
519
|
+
if (flags.registry) config.registry = flags.registry;
|
|
520
|
+
await writeJson(configPath, config);
|
|
521
|
+
if (previousTarget === requestedTarget) {
|
|
522
|
+
ok(`${CONFIG_FILE} already uses target ${requestedTarget}`);
|
|
523
|
+
} else {
|
|
524
|
+
ok(`Updated ${CONFIG_FILE} target: ${previousTarget} → ${requestedTarget}`);
|
|
525
|
+
}
|
|
526
|
+
} else if (flags.registry) {
|
|
527
|
+
config.registry = flags.registry;
|
|
528
|
+
await writeJson(configPath, config);
|
|
529
|
+
ok(`Updated ${CONFIG_FILE} registry`);
|
|
530
|
+
} else {
|
|
531
|
+
info(`Current target: ${getConfigTarget(config)}`);
|
|
532
|
+
info(`To change target: skillhub init --target cursor`);
|
|
533
|
+
}
|
|
514
534
|
} else {
|
|
515
|
-
const
|
|
535
|
+
const target = requestedTarget || (flags.yes ? DEFAULT_TARGET : await askTarget(DEFAULT_TARGET));
|
|
536
|
+
config = defaultConfig(projectRoot, target);
|
|
516
537
|
if (flags.registry) config.registry = flags.registry;
|
|
517
538
|
await writeJson(configPath, config);
|
|
518
539
|
ok(`Created ${CONFIG_FILE}`);
|
|
@@ -525,10 +546,10 @@ async function commandInit(projectRoot, flags) {
|
|
|
525
546
|
ok(`Created ${LOCK_FILE}`);
|
|
526
547
|
}
|
|
527
548
|
|
|
528
|
-
const config = await readProjectConfig(projectRoot);
|
|
529
549
|
await ensureDir(path.join(projectRoot, config.skillsDir));
|
|
530
550
|
ok(`Created ${config.skillsDir}`);
|
|
531
551
|
|
|
552
|
+
info(`Target: ${config.target}`);
|
|
532
553
|
info("Next: skillhub install nextjs-clean-architecture");
|
|
533
554
|
}
|
|
534
555
|
|