@matteoaliano/forest-ui 1.0.0 → 1.1.1

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 CHANGED
@@ -3,94 +3,59 @@
3
3
  /**
4
4
  * forest-ui sync
5
5
  *
6
- * Copies skill folders into the consuming project's .claude/skills/
7
- * directory so Claude Code automatically discovers Forest UI preset rules.
6
+ * DEPRECATED for consumers documentation + enforcement now ship as a Claude
7
+ * Code plugin. Copying loose skill files is no longer supported because stale
8
+ * copies drift from the plugin's hook.
9
+ *
10
+ * `--internal` (used by the monorepo's `npm run sync`) still propagates the
11
+ * skill source to the dogfood `.claude/skills/` copy and the plugin bundle.
8
12
  */
9
13
 
10
- import { readFileSync, mkdirSync, existsSync, readdirSync, cpSync, rmSync } from "node:fs";
14
+ import { mkdirSync, readdirSync, cpSync } from "node:fs";
11
15
  import { resolve, dirname } from "node:path";
12
16
  import { fileURLToPath } from "node:url";
13
17
 
14
18
  const __dirname = dirname(fileURLToPath(import.meta.url));
15
19
  const skillsDir = resolve(__dirname, "..", "skills");
16
20
 
17
- // Find the consuming project root (walk up until we find package.json)
18
- function findProjectRoot(startDir) {
19
- let dir = startDir;
20
- while (dir !== dirname(dir)) {
21
- if (existsSync(resolve(dir, "package.json"))) {
22
- try {
23
- const pkg = JSON.parse(readFileSync(resolve(dir, "package.json"), "utf-8"));
24
- if (pkg.name !== "@matteoaliano/forest-ui") return dir;
25
- } catch {
26
- return dir;
27
- }
28
- }
29
- dir = dirname(dir);
30
- }
31
- return process.cwd();
32
- }
33
-
34
- const projectRoot = findProjectRoot(process.cwd());
21
+ if (!process.argv.includes("--internal")) {
22
+ console.log(`
23
+ 🌲 Forest UI — \`sync\` is deprecated
35
24
 
36
- console.log(`\n🌲 Forest UI Syncing skills\n`);
37
- console.log(` Project root: ${projectRoot}\n`);
25
+ Skills are now delivered through the Forest Design System Claude Code
26
+ plugin, which also ships design-system enforcement hooks. Install it:
38
27
 
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
- ];
28
+ /plugin marketplace add Witailer/wtl-design-system-forest
29
+ /plugin install forest-ui@forest-design-system
46
30
 
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
- }
31
+ No files were copied. If you previously synced, you can delete
32
+ .claude/skills/forest-alkemy-plus/ the plugin replaces it.
33
+ `);
34
+ process.exit(0);
60
35
  }
61
- if (cleaned > 0) console.log();
62
36
 
63
- let synced = 0;
64
- let total = 0;
37
+ // ── Internal monorepo sync: skills/ → dogfood + plugin bundle ──
38
+ const repoRoot = resolve(__dirname, "..", "..", "..");
39
+ const targets = [
40
+ resolve(repoRoot, ".claude", "skills"),
41
+ resolve(repoRoot, "plugins", "forest-ui", "skills"),
42
+ ];
65
43
 
66
- if (!existsSync(skillsDir)) {
67
- console.log(` ⚠️ No skills directory found, nothing to sync.\n`);
68
- process.exit(0);
69
- }
44
+ console.log(`\n🌲 Forest UI — Syncing skills (internal)\n`);
70
45
 
71
46
  const skillFolders = readdirSync(skillsDir, { withFileTypes: true })
72
- .filter((d) => d.isDirectory())
73
- .map((d) => d.name);
74
-
75
- if (skillFolders.length === 0) {
76
- console.log(` ⚠️ No skill folders found, nothing to sync.\n`);
77
- process.exit(0);
78
- }
47
+ .filter((d) => d.isDirectory())
48
+ .map((d) => d.name);
79
49
 
80
- const claudeSkillsDir = resolve(projectRoot, ".claude", "skills");
81
-
82
- for (const folder of skillFolders) {
83
- const src = resolve(skillsDir, folder);
84
- const dest = resolve(claudeSkillsDir, folder);
85
- total++;
86
- try {
87
- mkdirSync(dest, { recursive: true });
88
- cpSync(src, dest, { recursive: true });
89
- console.log(` ✅ .claude/skills/${folder}/`);
90
- synced++;
91
- } catch (err) {
92
- console.log(` ⚠️ .claude/skills/${folder}/ skipped (${err.message})`);
93
- }
50
+ let synced = 0;
51
+ for (const target of targets) {
52
+ for (const folder of skillFolders) {
53
+ const dest = resolve(target, folder);
54
+ mkdirSync(dest, { recursive: true });
55
+ cpSync(resolve(skillsDir, folder), dest, { recursive: true });
56
+ console.log(` ✅ ${dest.replace(repoRoot + "/", "")}/`);
57
+ synced++;
58
+ }
94
59
  }
95
60
 
96
- console.log(`\n Synced ${synced}/${total} skills.\n`);
61
+ console.log(`\n Synced ${skillFolders.length} skill(s) to ${targets.length} target(s) (${synced} copies).\n`);
@@ -2051,8 +2051,11 @@ function buildComponents(tokens2) {
2051
2051
  }
2052
2052
  },
2053
2053
  staticTooltipLabel: {
2054
+ // Match MuiTooltip: inverted face (charcoal in light, near-white in
2055
+ // dark) with on-solid fg that inverts WITH it. text.white is
2056
+ // mode-invariant and vanished on the dark-mode light face.
2054
2057
  backgroundColor: bg4.primarySolid,
2055
- color: text4.white,
2058
+ color: buttonColors4.primary.fg,
2056
2059
  fontSize: 12,
2057
2060
  fontWeight: 600,
2058
2061
  borderRadius: radius4.md,
@@ -3973,4 +3976,4 @@ export {
3973
3976
  forestTheme,
3974
3977
  forestThemeOptions
3975
3978
  };
3976
- //# sourceMappingURL=chunk-XJYBU6LC.mjs.map
3979
+ //# sourceMappingURL=chunk-BCOHH5MJ.mjs.map