@paulduvall/claude-dev-toolkit 0.0.1-alpha.4 → 0.0.1-alpha.6
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/package.json +1 -1
- package/scripts/postinstall.js +28 -10
package/package.json
CHANGED
package/scripts/postinstall.js
CHANGED
|
@@ -89,7 +89,7 @@ async function runSetup() {
|
|
|
89
89
|
|
|
90
90
|
const sourceCommandsDir = path.join(packageDir, 'commands');
|
|
91
91
|
if (fs.existsSync(sourceCommandsDir)) {
|
|
92
|
-
|
|
92
|
+
copyCommandsFlat(sourceCommandsDir, commandsDir);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
@@ -116,14 +116,13 @@ function copyAllCommands(sourceDir, targetDir) {
|
|
|
116
116
|
const items = fs.readdirSync(sourceDir);
|
|
117
117
|
for (const item of items) {
|
|
118
118
|
const sourcePath = path.join(sourceDir, item);
|
|
119
|
-
const targetPath = path.join(targetDir, item);
|
|
120
119
|
|
|
121
120
|
if (fs.statSync(sourcePath).isDirectory()) {
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
125
|
-
copyAllCommands(sourcePath, targetPath);
|
|
121
|
+
// For subdirectories, copy their contents directly to targetDir (flat structure)
|
|
122
|
+
copyAllCommands(sourcePath, targetDir);
|
|
126
123
|
} else if (item.endsWith('.md')) {
|
|
124
|
+
// Copy .md files directly to target directory
|
|
125
|
+
const targetPath = path.join(targetDir, item);
|
|
127
126
|
fs.copyFileSync(sourcePath, targetPath);
|
|
128
127
|
}
|
|
129
128
|
}
|
|
@@ -134,8 +133,8 @@ function copySelectedCommands(sourceDir, targetDir, config) {
|
|
|
134
133
|
const installationType = config.installationType || 'standard';
|
|
135
134
|
|
|
136
135
|
if (installationType === 'full' || !config.commandSets) {
|
|
137
|
-
// Copy all commands
|
|
138
|
-
|
|
136
|
+
// Copy all commands in flat structure
|
|
137
|
+
copyCommandsFlat(sourceDir, targetDir);
|
|
139
138
|
} else {
|
|
140
139
|
// Copy selected command sets
|
|
141
140
|
const commandSets = config.commandSets || [];
|
|
@@ -144,7 +143,7 @@ function copySelectedCommands(sourceDir, targetDir, config) {
|
|
|
144
143
|
if (installationType === 'standard' || commandSets.includes('development')) {
|
|
145
144
|
const activeSource = path.join(sourceDir, 'active');
|
|
146
145
|
if (fs.existsSync(activeSource)) {
|
|
147
|
-
|
|
146
|
+
copyCommandsFlat(activeSource, targetDir);
|
|
148
147
|
}
|
|
149
148
|
}
|
|
150
149
|
|
|
@@ -152,12 +151,31 @@ function copySelectedCommands(sourceDir, targetDir, config) {
|
|
|
152
151
|
if (commandSets.includes('experimental') || installationType === 'full') {
|
|
153
152
|
const expSource = path.join(sourceDir, 'experiments');
|
|
154
153
|
if (fs.existsSync(expSource)) {
|
|
155
|
-
|
|
154
|
+
copyCommandsFlat(expSource, targetDir);
|
|
156
155
|
}
|
|
157
156
|
}
|
|
158
157
|
}
|
|
159
158
|
}
|
|
160
159
|
|
|
160
|
+
function copyCommandsFlat(sourceDir, targetDir) {
|
|
161
|
+
// Copy all .md files from sourceDir and subdirectories directly to targetDir (flat structure)
|
|
162
|
+
if (!fs.existsSync(sourceDir)) return;
|
|
163
|
+
|
|
164
|
+
const items = fs.readdirSync(sourceDir);
|
|
165
|
+
for (const item of items) {
|
|
166
|
+
const sourcePath = path.join(sourceDir, item);
|
|
167
|
+
|
|
168
|
+
if (fs.statSync(sourcePath).isDirectory()) {
|
|
169
|
+
// Recursively copy from subdirectories but maintain flat structure
|
|
170
|
+
copyCommandsFlat(sourcePath, targetDir);
|
|
171
|
+
} else if (item.endsWith('.md')) {
|
|
172
|
+
const targetPath = path.join(targetDir, item);
|
|
173
|
+
fs.copyFileSync(sourcePath, targetPath);
|
|
174
|
+
console.log(`✅ Installed command: ${item}`);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
161
179
|
function copySelectedHooks(sourceDir, targetDir, selectedHooks) {
|
|
162
180
|
const items = fs.readdirSync(sourceDir);
|
|
163
181
|
for (const item of items) {
|