@b0tts/template-dev-installer 1.0.2 → 1.0.3

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/cli.mjs +29 -29
  2. package/package.json +1 -1
package/bin/cli.mjs CHANGED
@@ -11,7 +11,7 @@
11
11
  // 4. All — everything above
12
12
  // ────────────────────────────────────────────────────────────────────
13
13
 
14
- import { select, confirm } from "@inquirer/prompts";
14
+ import { checkbox, confirm } from "@inquirer/prompts";
15
15
  import { cpSync, existsSync } from "node:fs";
16
16
  import { resolve, dirname } from "node:path";
17
17
  import { fileURLToPath } from "node:url";
@@ -86,38 +86,38 @@ async function main() {
86
86
  console.log(" Development Template Installer");
87
87
  console.log("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n");
88
88
 
89
- const choice = await select({
90
- message: "Which template category do you want to install?",
89
+ const chosen = await checkbox({
90
+ message: "Select categories to install (Space to toggle, Enter to confirm):",
91
91
  choices: [
92
- { name: "Skills", value: "skills" },
93
- { name: "OpenCode", value: "opencode" },
94
- { name: "Pi", value: "pi" },
95
- { name: "All", value: "all" },
92
+ { name: "All", value: "all" },
93
+ { name: "Skills", value: "skills" },
94
+ { name: "OpenCode", value: "opencode" },
95
+ { name: "Pi", value: "pi" },
96
96
  ],
97
97
  });
98
98
 
99
- if (choice === "all") {
100
- const ok = await confirm({
101
- message: `Install everything into ${CWD}? Existing files will be overwritten.`,
102
- default: true,
103
- });
104
- if (!ok) {
105
- console.log("Aborted.");
106
- process.exit(0);
107
- }
108
- for (const name of Object.keys(CATEGORIES)) {
109
- installCategory(name);
110
- }
111
- } else {
112
- const ok = await confirm({
113
- message: `Install "${CATEGORIES[choice].label}" into ${CWD}?`,
114
- default: true,
115
- });
116
- if (!ok) {
117
- console.log("Aborted.");
118
- process.exit(0);
119
- }
120
- installCategory(choice);
99
+ if (chosen.length === 0) {
100
+ console.log("Nothing selected. Aborted.");
101
+ process.exit(0);
102
+ }
103
+
104
+ // Determine what to install
105
+ const toInstall = chosen.includes("all")
106
+ ? Object.keys(CATEGORIES)
107
+ : chosen;
108
+
109
+ const labels = toInstall.map((n) => CATEGORIES[n].label.split(" (")[0]).join(", ");
110
+ const ok = await confirm({
111
+ message: `Install ${labels} into ${CWD}?`,
112
+ default: true,
113
+ });
114
+ if (!ok) {
115
+ console.log("Aborted.");
116
+ process.exit(0);
117
+ }
118
+
119
+ for (const name of toInstall) {
120
+ installCategory(name);
121
121
  }
122
122
 
123
123
  console.log("\n✔ Done.\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@b0tts/template-dev-installer",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "description": "Interactive installer for the DevelopmentTemplate — pick Skills, OpenCode, Pi, or install everything at once.",
6
6
  "bin": {