@waggylabs/yumekit 0.5.1 → 0.5.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/llm.txt CHANGED
@@ -3,7 +3,7 @@
3
3
  A modern, framework-agnostic Web Components UI kit providing 51 production-ready custom HTML elements. Built entirely on native web standards with zero external runtime dependencies.
4
4
 
5
5
  ## Version
6
- 0.5.1
6
+ 0.5.2
7
7
 
8
8
  ## License
9
9
  MIT
@@ -1657,6 +1657,7 @@ Attributes:
1657
1657
  - `position` — `"top"` (default) | `"bottom"` | `"left"` | `"right"`
1658
1658
  - `size` — `"small"` | `"medium"` | `"large"`
1659
1659
  - `variant` — `"default"` (default, bordered boxes) | `"accent"` (minimal tabs; the active tab shows a primary-colored indicator border on its content-facing edge — bottom for `top` tabs, top for `bottom`, etc. — like Material/Carbon)
1660
+ - `overflow` — `"scroll"` (default; tabs stay on one line and prev/next arrow buttons appear when the strip overflows its container) | `"wrap"` (tabs flow onto multiple rows, or columns for `left`/`right` positions)
1660
1661
 
1661
1662
  Methods: `activateTab(id)`
1662
1663
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@waggylabs/yumekit",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Modern Web Component UI Kit",
5
5
  "type": "module",
6
6
  "main": "dist/yumekit.min.js",
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ // `npx @waggylabs/yumekit init-ai` — copies YumeKit's bundled AI docs into the
3
+ // current project so coding assistants (Claude Code and generic LLM tooling)
4
+ // can use them. Opt-in and idempotent: existing files are skipped unless
5
+ // --force is passed.
6
+
2
7
  import {
3
8
  appendFileSync,
4
9
  cpSync,
@@ -11,18 +16,8 @@ import {
11
16
  import { dirname, join } from "path";
12
17
  import { fileURLToPath } from "url";
13
18
 
14
- // `npx @waggylabs/yumekit init-ai` — copies YumeKit's bundled AI docs into the
15
- // current project so coding assistants (Claude Code and generic LLM tooling)
16
- // can use them. Opt-in and idempotent: existing files are skipped unless
17
- // --force is passed.
18
-
19
19
  const __dirname = dirname(fileURLToPath(import.meta.url));
20
- const aiDir = join(__dirname, "..", "dist", "ai");
21
-
22
- const args = process.argv.slice(2);
23
- const force = args.includes("--force");
24
- const wantsHelp = args.includes("--help") || args.includes("-h");
25
- const cmd = args.find((a) => !a.startsWith("-"));
20
+ const AI_DIR = join(__dirname, "..", "dist", "ai");
26
21
 
27
22
  const HELP = `
28
23
  YumeKit AI docs installer
@@ -40,49 +35,11 @@ Options:
40
35
  --help Show this help
41
36
  `;
42
37
 
43
- if (wantsHelp || cmd !== "init-ai") {
44
- console.log(HELP);
45
- process.exit(wantsHelp || !cmd ? 0 : 1);
46
- }
47
-
48
- if (!existsSync(aiDir)) {
49
- console.error(
50
- `✗ Bundled AI docs not found at ${aiDir}.\n This package may not have been built with AI docs — please report it.`,
51
- );
52
- process.exit(1);
53
- }
54
-
55
- const cwd = process.cwd();
56
- const results = [];
57
-
58
- // 1. Claude skill ---------------------------------------------------------
59
- const skillDest = join(cwd, ".claude", "skills", "yumekit");
60
- if (existsSync(skillDest) && !force) {
61
- results.push("• skip .claude/skills/yumekit/ (exists — use --force)");
62
- } else {
63
- // Clear the destination first so --force is a true replacement — a
64
- // recursive copy alone would leave behind files removed/renamed upstream.
65
- if (existsSync(skillDest)) rmSync(skillDest, { recursive: true, force: true });
66
- mkdirSync(dirname(skillDest), { recursive: true });
67
- cpSync(join(aiDir, "skill"), skillDest, { recursive: true });
68
- results.push("✔ wrote .claude/skills/yumekit/");
69
- }
70
-
71
- // 2. llm.txt --------------------------------------------------------------
72
- const llmDest = join(cwd, "llm.txt");
73
- if (existsSync(llmDest) && !force) {
74
- results.push("• skip llm.txt (exists — use --force)");
75
- } else {
76
- cpSync(join(aiDir, "llm.txt"), llmDest);
77
- results.push("✔ wrote llm.txt");
78
- }
79
-
80
- // 3. AGENTS.md pointer ----------------------------------------------------
81
- // Delimited so --force can refresh the block in place without disturbing the
82
- // rest of the user's AGENTS.md.
38
+ // Delimited so --force can refresh the AGENTS.md block in place without
39
+ // disturbing the rest of the user's file.
83
40
  const POINTER_START = "<!-- yumekit-ai-docs -->";
84
41
  const POINTER_END = "<!-- /yumekit-ai-docs -->";
85
- const pointer = `${POINTER_START}
42
+ const POINTER = `${POINTER_START}
86
43
  ## YumeKit UI components
87
44
 
88
45
  This project uses [@waggylabs/yumekit](https://www.yumekit.com) web components.
@@ -90,28 +47,92 @@ When building UI with \`y-*\` elements, consult:
90
47
  - \`.claude/skills/yumekit/\` — full component skill (Claude Code)
91
48
  - \`llm.txt\` — component API reference for any LLM/agent
92
49
  ${POINTER_END}`;
93
- const agentsDest = join(cwd, "AGENTS.md");
94
- if (!existsSync(agentsDest)) {
95
- writeFileSync(agentsDest, `# AGENTS\n\n${pointer}\n`);
96
- results.push("✔ wrote AGENTS.md");
97
- } else {
98
- const existing = readFileSync(agentsDest, "utf8");
50
+
51
+ // ---------- install steps ----------
52
+
53
+ // Copies the Claude skill tree into <cwd>/.claude/skills/yumekit/. With --force
54
+ // the destination is cleared first so the copy is a true replacement (a plain
55
+ // recursive copy would leave behind files removed/renamed upstream).
56
+ function installSkill(cwd, force) {
57
+ const dest = join(cwd, ".claude", "skills", "yumekit");
58
+ if (existsSync(dest) && !force) {
59
+ return "• skip .claude/skills/yumekit/ (exists — use --force)";
60
+ }
61
+
62
+ if (existsSync(dest)) rmSync(dest, { recursive: true, force: true });
63
+ mkdirSync(dirname(dest), { recursive: true });
64
+ cpSync(join(AI_DIR, "skill"), dest, { recursive: true });
65
+ return "✔ wrote .claude/skills/yumekit/";
66
+ }
67
+
68
+ // Copies llm.txt into the project root.
69
+ function installLlm(cwd, force) {
70
+ const dest = join(cwd, "llm.txt");
71
+ if (existsSync(dest) && !force) {
72
+ return "• skip llm.txt (exists — use --force)";
73
+ }
74
+
75
+ cpSync(join(AI_DIR, "llm.txt"), dest);
76
+ return "✔ wrote llm.txt";
77
+ }
78
+
79
+ // Writes the pointer block into AGENTS.md: creates the file if absent, appends
80
+ // the block if the file exists without it, or (with --force) replaces an
81
+ // existing block in place. A legacy block with no end marker is replaced
82
+ // through end of file.
83
+ function installAgentsPointer(cwd, force) {
84
+ const dest = join(cwd, "AGENTS.md");
85
+ if (!existsSync(dest)) {
86
+ writeFileSync(dest, `# AGENTS\n\n${POINTER}\n`);
87
+ return "✔ wrote AGENTS.md";
88
+ }
89
+
90
+ const existing = readFileSync(dest, "utf8");
99
91
  const start = existing.indexOf(POINTER_START);
100
92
  if (start === -1) {
101
- appendFileSync(agentsDest, `\n${pointer}\n`);
102
- results.push("✔ append AGENTS.md (pointer)");
103
- } else if (!force) {
104
- results.push("• skip AGENTS.md (pointer present — use --force)");
105
- } else {
106
- // Replace the existing block (handles a legacy block with no end marker
107
- // by replacing through end of file).
108
- const endMark = existing.indexOf(POINTER_END, start);
109
- const end = endMark === -1 ? existing.length : endMark + POINTER_END.length;
110
- writeFileSync(agentsDest, existing.slice(0, start) + pointer + existing.slice(end));
111
- results.push("✔ update AGENTS.md (pointer)");
93
+ appendFileSync(dest, `\n${POINTER}\n`);
94
+ return "✔ append AGENTS.md (pointer)";
95
+ }
96
+ if (!force) {
97
+ return "• skip AGENTS.md (pointer present — use --force)";
112
98
  }
99
+
100
+ const endMark = existing.indexOf(POINTER_END, start);
101
+ const end = endMark === -1 ? existing.length : endMark + POINTER_END.length;
102
+ writeFileSync(dest, existing.slice(0, start) + POINTER + existing.slice(end));
103
+ return "✔ update AGENTS.md (pointer)";
104
+ }
105
+
106
+ // ---------- run ----------
107
+
108
+ function main() {
109
+ const args = process.argv.slice(2);
110
+ const force = args.includes("--force");
111
+ const wantsHelp = args.includes("--help") || args.includes("-h");
112
+ const cmd = args.find((a) => !a.startsWith("-"));
113
+
114
+ if (wantsHelp || cmd !== "init-ai") {
115
+ console.log(HELP);
116
+ process.exit(wantsHelp || !cmd ? 0 : 1);
117
+ }
118
+
119
+ if (!existsSync(AI_DIR)) {
120
+ console.error(
121
+ `✗ Bundled AI docs not found at ${AI_DIR}.\n This package may not have been built with AI docs — please report it.`,
122
+ );
123
+ process.exit(1);
124
+ }
125
+
126
+ const cwd = process.cwd();
127
+ const results = [
128
+ installSkill(cwd, force),
129
+ installLlm(cwd, force),
130
+ installAgentsPointer(cwd, force),
131
+ ];
132
+
133
+ console.log(`\nYumeKit AI docs → ${cwd}\n`);
134
+ console.log(results.map((r) => ` ${r}`).join("\n"));
135
+ console.log("");
113
136
  }
114
137
 
115
- console.log(`\nYumeKit AI docs → ${cwd}\n`);
116
- console.log(results.map((r) => ` ${r}`).join("\n"));
117
- console.log("");
138
+ main();