@devrev-computer/skills 2.0.2 → 2.1.0
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/bin/install.mjs +31 -19
- package/package.json +1 -1
package/bin/install.mjs
CHANGED
|
@@ -253,15 +253,20 @@ async function runAdd(cwd, flags) {
|
|
|
253
253
|
: getProjectSkillsDir(targetDir)
|
|
254
254
|
);
|
|
255
255
|
|
|
256
|
+
p.log.info(pc.dim("space = toggle, a = select all, enter = confirm"));
|
|
257
|
+
|
|
256
258
|
const selected = await p.multiselect({
|
|
257
259
|
message: "Which skills do you want to install?",
|
|
258
|
-
options:
|
|
259
|
-
value:
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
: s.
|
|
264
|
-
|
|
260
|
+
options: [
|
|
261
|
+
{ value: "__all__", label: pc.bold("Select All"), hint: `all ${SKILLS.length} skills` },
|
|
262
|
+
...SKILLS.map((s) => ({
|
|
263
|
+
value: s.name,
|
|
264
|
+
label: s.name,
|
|
265
|
+
hint: alreadyInstalled.includes(s.name)
|
|
266
|
+
? `${s.desc} ${pc.yellow("(installed, will update)")}`
|
|
267
|
+
: s.desc,
|
|
268
|
+
})),
|
|
269
|
+
],
|
|
265
270
|
required: true,
|
|
266
271
|
});
|
|
267
272
|
|
|
@@ -270,7 +275,7 @@ async function runAdd(cwd, flags) {
|
|
|
270
275
|
process.exit(0);
|
|
271
276
|
}
|
|
272
277
|
|
|
273
|
-
selectedSkills = selected;
|
|
278
|
+
selectedSkills = selected.includes("__all__") ? SKILL_NAMES : selected;
|
|
274
279
|
}
|
|
275
280
|
|
|
276
281
|
// ── Step 3: Confirmation ──
|
|
@@ -379,18 +384,25 @@ async function runRemove(cwd, flags) {
|
|
|
379
384
|
} else if (flags.yes) {
|
|
380
385
|
toRemove = [...allInstalled.keys()];
|
|
381
386
|
} else {
|
|
387
|
+
const allNames = [...allInstalled.keys()];
|
|
388
|
+
|
|
389
|
+
p.log.info(pc.dim("space = toggle, a = select all, enter = confirm"));
|
|
390
|
+
|
|
382
391
|
const selected = await p.multiselect({
|
|
383
392
|
message: "Which skills do you want to remove?",
|
|
384
|
-
options: [
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
.
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
393
|
+
options: [
|
|
394
|
+
{ value: "__all__", label: pc.bold("Select All"), hint: `all ${allNames.length} installed` },
|
|
395
|
+
...[...allInstalled.entries()].map(([name, loc]) => {
|
|
396
|
+
const where = [loc.project && "project", loc.global && "global"]
|
|
397
|
+
.filter(Boolean)
|
|
398
|
+
.join(" + ");
|
|
399
|
+
return {
|
|
400
|
+
value: name,
|
|
401
|
+
label: name,
|
|
402
|
+
hint: where,
|
|
403
|
+
};
|
|
404
|
+
}),
|
|
405
|
+
],
|
|
394
406
|
required: true,
|
|
395
407
|
});
|
|
396
408
|
|
|
@@ -398,7 +410,7 @@ async function runRemove(cwd, flags) {
|
|
|
398
410
|
p.cancel("Removal cancelled.");
|
|
399
411
|
process.exit(0);
|
|
400
412
|
}
|
|
401
|
-
toRemove = selected;
|
|
413
|
+
toRemove = selected.includes("__all__") ? allNames : selected;
|
|
402
414
|
}
|
|
403
415
|
|
|
404
416
|
const confirmed = flags.yes || await (async () => {
|