cskit-cli 1.0.5 → 1.0.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/src/commands/init.js +20 -37
package/package.json
CHANGED
package/src/commands/init.js
CHANGED
|
@@ -124,42 +124,25 @@ async function setupPythonEnv(projectDir, spinner) {
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
127
|
+
* Remap source paths to .claude/ destinations
|
|
128
|
+
* Downloads directly to Claude Code directories
|
|
128
129
|
*/
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
{ src: 'domains', dest: '.claude/skills/csk/domains' },
|
|
141
|
-
{ src: 'industries', dest: '.claude/skills/csk/industries' },
|
|
142
|
-
{ src: 'lib', dest: '.claude/skills/csk/lib' }
|
|
143
|
-
];
|
|
144
|
-
|
|
145
|
-
let copied = 0;
|
|
146
|
-
for (const { src, dest } of mappings) {
|
|
147
|
-
const srcPath = path.join(projectDir, src);
|
|
148
|
-
const destPath = path.join(projectDir, dest);
|
|
149
|
-
|
|
150
|
-
if (fs.existsSync(srcPath)) {
|
|
151
|
-
ensureDir(destPath);
|
|
152
|
-
copyDirRecursive(srcPath, destPath);
|
|
153
|
-
copied++;
|
|
154
|
-
}
|
|
130
|
+
function remapPath(filePath) {
|
|
131
|
+
const mappings = [
|
|
132
|
+
{ from: 'src/commands/', to: '.claude/commands/' },
|
|
133
|
+
{ from: 'core/', to: '.claude/skills/csk/core/' },
|
|
134
|
+
{ from: 'domains/', to: '.claude/skills/csk/domains/' },
|
|
135
|
+
{ from: 'industries/', to: '.claude/skills/csk/industries/' }
|
|
136
|
+
];
|
|
137
|
+
|
|
138
|
+
for (const { from, to } of mappings) {
|
|
139
|
+
if (filePath.startsWith(from)) {
|
|
140
|
+
return filePath.replace(from, to);
|
|
155
141
|
}
|
|
156
|
-
|
|
157
|
-
spinner.succeed(`CSK installed to .claude/ (${copied} modules)`);
|
|
158
|
-
return { success: true };
|
|
159
|
-
} catch (error) {
|
|
160
|
-
spinner.warn(`CSK setup failed: ${error.message}`);
|
|
161
|
-
return { success: false, error: error.message };
|
|
162
142
|
}
|
|
143
|
+
|
|
144
|
+
// Keep other files as-is (lib/, cli/, config/, etc.)
|
|
145
|
+
return filePath;
|
|
163
146
|
}
|
|
164
147
|
|
|
165
148
|
/**
|
|
@@ -277,8 +260,8 @@ async function initCommand(options) {
|
|
|
277
260
|
|
|
278
261
|
for (let i = 0; i < files.length; i++) {
|
|
279
262
|
const file = files[i];
|
|
280
|
-
const
|
|
281
|
-
const
|
|
263
|
+
const relativePath = remapPath(file.path);
|
|
264
|
+
const targetPath = path.join(projectDir, relativePath);
|
|
282
265
|
|
|
283
266
|
// Update progress bar
|
|
284
267
|
process.stdout.write(`\r ${progressBar(i + 1, files.length)} ${chalk.dim(`(${i + 1}/${files.length})`)}`);
|
|
@@ -339,8 +322,8 @@ async function initCommand(options) {
|
|
|
339
322
|
console.log('');
|
|
340
323
|
const pythonResult = await setupPythonEnv(projectDir, spinner);
|
|
341
324
|
|
|
342
|
-
//
|
|
343
|
-
|
|
325
|
+
// CSK files already downloaded to .claude/ (no copy needed)
|
|
326
|
+
spinner.succeed('CSK installed to .claude/');
|
|
344
327
|
|
|
345
328
|
// Success message
|
|
346
329
|
const ver = selectedVersion.replace(/^v/, '');
|