@windyroad/tdd 0.1.1 → 0.2.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 CHANGED
@@ -4,7 +4,7 @@ import { resolve, dirname } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
5
 
6
6
  const __dirname = dirname(fileURLToPath(import.meta.url));
7
- const utils = await import(resolve(__dirname, "../lib/install-utils.mjs"));
7
+ const utils = await import(resolve(__dirname, "../../shared/install-utils.mjs"));
8
8
 
9
9
  const PLUGIN = "wr-tdd";
10
10
  const DEPS = [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@windyroad/tdd",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "TDD state machine enforcement (Red-Green-Refactor cycle)",
5
5
  "bin": {
6
6
  "windyroad-tdd": "./bin/install.mjs"
@@ -23,7 +23,6 @@
23
23
  "agents/",
24
24
  "hooks/",
25
25
  "skills/",
26
- ".claude-plugin/",
27
- "lib/"
26
+ ".claude-plugin/"
28
27
  ]
29
28
  }
@@ -1,163 +0,0 @@
1
- /**
2
- * Shared install utilities for @windyroad/* packages.
3
- * Used by both per-plugin installers and the meta-installer.
4
- */
5
-
6
- import { execSync } from "node:child_process";
7
-
8
- const MARKETPLACE_REPO = "windyroad/agent-plugins";
9
- const MARKETPLACE_NAME = "windyroad";
10
-
11
- let _dryRun = false;
12
-
13
- export { MARKETPLACE_REPO, MARKETPLACE_NAME };
14
-
15
- export function setDryRun(value) {
16
- _dryRun = value;
17
- }
18
-
19
- export function isDryRun() {
20
- return _dryRun;
21
- }
22
-
23
- export function run(cmd, label) {
24
- console.log(` ${label}...`);
25
- if (_dryRun) {
26
- console.log(` [dry-run] ${cmd}`);
27
- return true;
28
- }
29
- try {
30
- execSync(cmd, { stdio: "inherit" });
31
- return true;
32
- } catch {
33
- console.error(` FAILED: ${label}`);
34
- return false;
35
- }
36
- }
37
-
38
- export function checkPrerequisites() {
39
- if (_dryRun) return;
40
-
41
- try {
42
- execSync("claude --version", { stdio: "pipe" });
43
- } catch {
44
- console.error(
45
- "Error: 'claude' CLI not found. Install Claude Code first:\n https://docs.anthropic.com/en/docs/claude-code\n"
46
- );
47
- process.exit(1);
48
- }
49
-
50
- try {
51
- execSync("npx --version", { stdio: "pipe" });
52
- } catch {
53
- console.error(
54
- "Error: 'npx' not found. Install Node.js first:\n https://nodejs.org\n"
55
- );
56
- process.exit(1);
57
- }
58
- }
59
-
60
- export function addMarketplace() {
61
- return run(
62
- `claude plugin marketplace add ${MARKETPLACE_REPO}`,
63
- `Marketplace: ${MARKETPLACE_NAME}`
64
- );
65
- }
66
-
67
- export function installPlugin(pluginName) {
68
- return run(
69
- `claude plugin install ${pluginName}@${MARKETPLACE_NAME}`,
70
- pluginName
71
- );
72
- }
73
-
74
- export function updatePlugin(pluginName) {
75
- return run(`claude plugin update ${pluginName}`, pluginName);
76
- }
77
-
78
- export function uninstallPlugin(pluginName) {
79
- return run(`claude plugin uninstall ${pluginName}`, `Removing ${pluginName}`);
80
- }
81
-
82
- export function installSkills() {
83
- return run(
84
- `npx -y skills add --yes --all ${MARKETPLACE_REPO}`,
85
- "Skills (via skills package)"
86
- );
87
- }
88
-
89
- export function updateSkills() {
90
- return run("npx -y skills update", "Skills update");
91
- }
92
-
93
- export function removeSkills() {
94
- return run(
95
- `npx -y skills remove --yes --all ${MARKETPLACE_REPO}`,
96
- "Removing skills"
97
- );
98
- }
99
-
100
- /**
101
- * Install a single package: marketplace add + plugin install + skills.
102
- */
103
- export function installPackage(pluginName, { deps = [] } = {}) {
104
- console.log(`\nInstalling @windyroad/${pluginName.replace("wr-", "")}...\n`);
105
-
106
- addMarketplace();
107
- installPlugin(pluginName);
108
- installSkills();
109
-
110
- if (deps.length > 0) {
111
- console.log(`\nNote: This plugin works best with:`);
112
- for (const dep of deps) {
113
- console.log(` - @windyroad/${dep.replace("wr-", "")} (npx @windyroad/${dep.replace("wr-", "")})`);
114
- }
115
- }
116
-
117
- console.log(
118
- `\nDone! Restart Claude Code to activate.\n`
119
- );
120
- }
121
-
122
- /**
123
- * Update a single package.
124
- */
125
- export function updatePackage(pluginName) {
126
- console.log(`\nUpdating @windyroad/${pluginName.replace("wr-", "")}...\n`);
127
-
128
- run(
129
- `claude plugin marketplace update ${MARKETPLACE_NAME}`,
130
- "Updating marketplace"
131
- );
132
- updatePlugin(pluginName);
133
- updateSkills();
134
-
135
- console.log("\nDone! Restart Claude Code to apply updates.\n");
136
- }
137
-
138
- /**
139
- * Uninstall a single package.
140
- */
141
- export function uninstallPackage(pluginName) {
142
- console.log(`\nUninstalling @windyroad/${pluginName.replace("wr-", "")}...\n`);
143
-
144
- uninstallPlugin(pluginName);
145
-
146
- console.log("\nDone. Restart Claude Code to apply changes.\n");
147
- console.log("Note: Skills are shared across packages. Run");
148
- console.log(" npx @windyroad/agent-plugins --uninstall");
149
- console.log("to remove all skills.\n");
150
- }
151
-
152
- /**
153
- * Parse standard flags used by all per-plugin installers.
154
- */
155
- export function parseStandardArgs(argv) {
156
- const args = argv.slice(2);
157
- return {
158
- help: args.includes("--help") || args.includes("-h"),
159
- uninstall: args.includes("--uninstall"),
160
- update: args.includes("--update"),
161
- dryRun: args.includes("--dry-run"),
162
- };
163
- }