@matteoaliano/forest-ui 0.4.1 โ 0.4.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/bin/sync.mjs +25 -1
- package/package.json +1 -1
package/bin/sync.mjs
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* directory so Claude Code automatically discovers Forest UI preset rules.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { readFileSync, mkdirSync, existsSync, readdirSync, cpSync } from "node:fs";
|
|
10
|
+
import { readFileSync, mkdirSync, existsSync, readdirSync, cpSync, rmSync } from "node:fs";
|
|
11
11
|
import { resolve, dirname } from "node:path";
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
13
|
|
|
@@ -36,6 +36,30 @@ const projectRoot = findProjectRoot(process.cwd());
|
|
|
36
36
|
console.log(`\n๐ฒ Forest UI โ Syncing skills\n`);
|
|
37
37
|
console.log(` Project root: ${projectRoot}\n`);
|
|
38
38
|
|
|
39
|
+
// Clean up legacy guideline files from pre-v0.4.1
|
|
40
|
+
const legacyPaths = [
|
|
41
|
+
resolve(projectRoot, ".claude", "forest-ui.md"),
|
|
42
|
+
resolve(projectRoot, ".cursor", "rules", "forest-ui.mdc"),
|
|
43
|
+
resolve(projectRoot, ".gemini", "forest-ui.md"),
|
|
44
|
+
resolve(projectRoot, ".antigravity", "rules.md"),
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
let cleaned = 0;
|
|
48
|
+
for (const legacyPath of legacyPaths) {
|
|
49
|
+
if (existsSync(legacyPath)) {
|
|
50
|
+
try {
|
|
51
|
+
rmSync(legacyPath);
|
|
52
|
+
const rel = legacyPath.replace(projectRoot + "/", "");
|
|
53
|
+
console.log(` ๐งน Removed legacy ${rel}`);
|
|
54
|
+
cleaned++;
|
|
55
|
+
} catch (err) {
|
|
56
|
+
const rel = legacyPath.replace(projectRoot + "/", "");
|
|
57
|
+
console.log(` โ ๏ธ Could not remove ${rel} (${err.message})`);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (cleaned > 0) console.log();
|
|
62
|
+
|
|
39
63
|
let synced = 0;
|
|
40
64
|
let total = 0;
|
|
41
65
|
|