@devrev-computer/skills 2.0.1 → 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.
Files changed (2) hide show
  1. package/bin/install.mjs +34 -22
  2. package/package.json +1 -1
package/bin/install.mjs CHANGED
@@ -4,7 +4,7 @@ import { readdir, cp, mkdir, stat, readFile, rm } from "node:fs/promises";
4
4
  import { join, dirname } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { homedir } from "node:os";
7
- import { existsSync } from "node:fs";
7
+ import { existsSync, readFileSync } from "node:fs";
8
8
  import { parseArgs } from "node:util";
9
9
  import * as p from "@clack/prompts";
10
10
  import pc from "picocolors";
@@ -65,11 +65,11 @@ function showLogo() {
65
65
  function getVersion() {
66
66
  try {
67
67
  const pkg = JSON.parse(
68
- require("node:fs").readFileSync(join(__dirname, "..", "package.json"), "utf-8")
68
+ readFileSync(join(__dirname, "..", "package.json"), "utf-8")
69
69
  );
70
70
  return pkg.version;
71
71
  } catch {
72
- return "1.0.0";
72
+ return "2.0.0";
73
73
  }
74
74
  }
75
75
 
@@ -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: SKILLS.map((s) => ({
259
- value: s.name,
260
- label: s.name,
261
- hint: alreadyInstalled.includes(s.name)
262
- ? `${s.desc} ${pc.yellow("(installed, will update)")}`
263
- : s.desc,
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: [...allInstalled.entries()].map(([name, loc]) => {
385
- const where = [loc.project && "project", loc.global && "global"]
386
- .filter(Boolean)
387
- .join(" + ");
388
- return {
389
- value: name,
390
- label: name,
391
- hint: where,
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 () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devrev-computer/skills",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "Skills for Computer",
5
5
  "type": "module",
6
6
  "bin": {