claude-devkit-cli 1.2.0 → 1.2.2
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/upgrade.js +20 -3
package/package.json
CHANGED
package/src/commands/upgrade.js
CHANGED
|
@@ -83,10 +83,25 @@ export async function upgradeCommand(path, opts) {
|
|
|
83
83
|
updated++;
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
//
|
|
86
|
+
// Remove files in manifest that no longer exist in kit
|
|
87
|
+
let removed = 0;
|
|
87
88
|
for (const file of Object.keys(manifest.files)) {
|
|
88
89
|
if (!allFiles.includes(file)) {
|
|
89
|
-
|
|
90
|
+
const filePath = resolve(targetDir, file);
|
|
91
|
+
if (!opts.dryRun) {
|
|
92
|
+
try {
|
|
93
|
+
const { unlink } = await import('node:fs/promises');
|
|
94
|
+
await unlink(filePath);
|
|
95
|
+
delete manifest.files[file];
|
|
96
|
+
removed++;
|
|
97
|
+
log.del(file);
|
|
98
|
+
} catch {
|
|
99
|
+
log.warn(`${file} — no longer in kit (could not delete)`);
|
|
100
|
+
}
|
|
101
|
+
} else {
|
|
102
|
+
log.del(`${file} (would remove)`);
|
|
103
|
+
removed++;
|
|
104
|
+
}
|
|
90
105
|
}
|
|
91
106
|
}
|
|
92
107
|
|
|
@@ -100,7 +115,9 @@ export async function upgradeCommand(path, opts) {
|
|
|
100
115
|
|
|
101
116
|
// Summary
|
|
102
117
|
log.blank();
|
|
103
|
-
|
|
118
|
+
const parts = [`Updated ${updated}`, `added ${added}`, `removed ${removed}`, `unchanged ${unchanged}`];
|
|
119
|
+
if (skippedCustomized > 0) parts.push(`skipped ${skippedCustomized} customized`);
|
|
120
|
+
log.pass(parts.join(', ') + '.');
|
|
104
121
|
|
|
105
122
|
if (skippedCustomized > 0) {
|
|
106
123
|
log.warn(`${skippedCustomized} customized file(s) skipped. Run with --force to overwrite.`);
|