kira-kit 0.2.1 → 0.3.0

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.
Files changed (71) hide show
  1. package/README.md +132 -43
  2. package/dist/index.mjs +2472 -0
  3. package/package.json +38 -17
  4. package/templates/monorepo/components.json +23 -0
  5. package/templates/monorepo/package.json +13 -0
  6. package/templates/monorepo/packages/app/index.html +13 -0
  7. package/templates/monorepo/packages/app/package.json +27 -0
  8. package/templates/monorepo/packages/app/src/App.tsx +21 -0
  9. package/templates/monorepo/packages/app/src/index.css +3 -0
  10. package/templates/monorepo/packages/app/src/main.tsx +10 -0
  11. package/templates/monorepo/packages/app/tsconfig.json +8 -0
  12. package/templates/monorepo/packages/app/vite.config.ts +10 -0
  13. package/templates/monorepo/packages/ui/package.json +32 -0
  14. package/templates/monorepo/packages/ui/src/components/ui/welcome.tsx +52 -0
  15. package/templates/monorepo/packages/ui/src/index.css +123 -0
  16. package/templates/monorepo/packages/ui/src/index.ts +3 -0
  17. package/templates/monorepo/packages/ui/src/lib/utils.ts +1 -0
  18. package/templates/monorepo/packages/ui/tsconfig.json +7 -0
  19. package/templates/monorepo/tsconfig.json +23 -0
  20. package/templates/next/app/globals.css +124 -0
  21. package/templates/next/app/layout.tsx +18 -0
  22. package/templates/next/app/page.tsx +9 -0
  23. package/templates/next/components/ui/welcome.tsx +62 -0
  24. package/templates/next/components.json +23 -0
  25. package/templates/next/lib/utils.ts +1 -0
  26. package/templates/next/next-env.d.ts +2 -0
  27. package/templates/next/next.config.ts +5 -0
  28. package/templates/next/package.json +28 -0
  29. package/templates/next/postcss.config.mjs +7 -0
  30. package/templates/next/tsconfig.json +24 -0
  31. package/templates/tanstack-start/README.md +16 -0
  32. package/templates/tanstack-start/components.json +23 -0
  33. package/templates/tanstack-start/package.json +30 -0
  34. package/templates/tanstack-start/src/components/ui/welcome.tsx +52 -0
  35. package/templates/tanstack-start/src/index.css +123 -0
  36. package/templates/tanstack-start/src/lib/utils.ts +1 -0
  37. package/templates/tanstack-start/src/router.tsx +15 -0
  38. package/templates/tanstack-start/src/routes/__root.tsx +41 -0
  39. package/templates/tanstack-start/src/routes/index.tsx +26 -0
  40. package/{tsconfig.json → templates/tanstack-start/tsconfig.json} +6 -7
  41. package/templates/tanstack-start/vite.config.ts +11 -0
  42. package/templates/vite/components.json +23 -0
  43. package/templates/vite/index.html +16 -0
  44. package/templates/vite/package.json +28 -0
  45. package/templates/vite/src/App.tsx +9 -0
  46. package/templates/vite/src/components/ui/welcome.tsx +60 -0
  47. package/templates/vite/src/index.css +124 -0
  48. package/templates/vite/src/lib/utils.ts +1 -0
  49. package/templates/vite/src/main.tsx +10 -0
  50. package/templates/vite/tsconfig.json +29 -0
  51. package/templates/vite/tsconfig.node.json +22 -0
  52. package/templates/vite/vite.config.ts +13 -0
  53. package/bin/kira-kit.js +0 -27329
  54. package/bun.lock +0 -247
  55. package/src/commands/add.ts +0 -146
  56. package/src/commands/build.ts +0 -212
  57. package/src/commands/init.ts +0 -164
  58. package/src/commands/list.ts +0 -31
  59. package/src/index.ts +0 -118
  60. package/src/lib/build-config.ts +0 -81
  61. package/src/lib/config.ts +0 -109
  62. package/src/lib/deps.ts +0 -135
  63. package/src/lib/file.ts +0 -64
  64. package/src/lib/logger.ts +0 -102
  65. package/src/lib/registry.ts +0 -81
  66. package/src/lib/templates.ts +0 -123
  67. package/src/lib/theme-generator.ts +0 -246
  68. package/src/prompts/base-color.ts +0 -20
  69. package/src/prompts/primary-color.ts +0 -23
  70. package/src/prompts/project-type.ts +0 -71
  71. package/src/types.ts +0 -61
package/README.md CHANGED
@@ -1,86 +1,175 @@
1
- # Kira Kit CLI
1
+ # kira-kit
2
2
 
3
- CLI tool for adding Kira Kit components to your React project.
3
+ The CLI for [Kira Kit](../../#readme) — a shadcn-compatible registry of Base UI
4
+ components. Kira Kit is registry-first: installation is delegated entirely to
5
+ the pinned `shadcn` CLI (4.22.1), so what you add is exactly what shadcn would
6
+ add. The `kira-kit` CLI covers the parts shadcn doesn't:
4
7
 
5
- ## Installation
8
+ - **OKLCH theme generation** from any primary color, with WCAG 2.2 AA verified
9
+ contrast
10
+ - **Quality checks** over component sources (12 parser-based checks)
11
+ - **Project scaffolding** with four embedded templates
12
+ - **`migrate`** from the pre-1.0 `registryUrl` setup
13
+ - **`build`** for maintainers: the full registry → validate → JSON → docs
14
+ pipeline
6
15
 
7
- ```bash
8
- # Global install
9
- npm install -g kira-kit
16
+ ## Requirements
10
17
 
11
- # Or use with npx
12
- npx kira-kit add button
13
- ```
18
+ - Node.js 22+ (or Bun 1.x)
19
+ - The `shadcn` CLI is bundled as a pinned dependency — no separate install
14
20
 
15
21
  ## Usage
16
22
 
17
- ### Initialize
23
+ ### `kira-kit init`
18
24
 
19
- Initialize Kira Kit in your project with interactive color selection:
25
+ Set up a project for Kira Kit: delegates base setup to shadcn, registers the
26
+ `@kira-kit` namespace in `components.json` (never overwriting an existing
27
+ entry), and optionally applies a theme.
20
28
 
21
29
  ```bash
22
30
  kira-kit init
31
+ kira-kit init --preset ember-press # one of the 9 curated presets
32
+ kira-kit init --primary "#0B7F79" # generate a custom theme
33
+ kira-kit init --base-color stone --yes
23
34
  ```
24
35
 
25
- Options:
26
- - `--base-color <color>` - Base color (slate, gray, zinc, neutral, stone)
27
- - `--primary-color <color>` - Primary color (blue, green, orange, pink, purple, red, violet, yellow)
28
- - `--cwd <directory>` - Working directory
29
- - `-y, --yes` - Skip prompts and use defaults
36
+ Options: `--base`, `--preset`, `--primary`, `--base-color`, `--force`, `-y/--yes`, `-c/--cwd`.
30
37
 
31
- ### Add Components
38
+ ### `kira-kit add [items...]`
32
39
 
33
- Add one or more components to your project:
40
+ Add component(s) via the pinned shadcn CLI. Transitive registry dependencies
41
+ are resolved by shadcn automatically.
34
42
 
35
43
  ```bash
36
- # Add single component
37
44
  kira-kit add button
45
+ kira-kit add button card dialog --overwrite
46
+ kira-kit add --all
47
+ ```
38
48
 
39
- # Add multiple components
40
- kira-kit add button card dialog
49
+ Options: `-o/--overwrite`, `-y/--yes`, `-a/--all`, `-p/--path`, `--dry-run`,
50
+ `--diff`, `--view`, `-c/--cwd`.
41
51
 
42
- # Add all components
43
- kira-kit add --all
52
+ ### `kira-kit list` / `view` / `search`
53
+
54
+ Registry inspection commands, all delegating to shadcn:
55
+
56
+ ```bash
57
+ kira-kit list # every available item
58
+ kira-kit list --json
59
+ kira-kit view button # show item contents
60
+ kira-kit search table --json
44
61
  ```
45
62
 
46
- Options:
47
- - `--cwd <directory>` - Working directory
48
- - `-o, --overwrite` - Overwrite existing files
49
- - `-y, --yes` - Skip prompts
63
+ ### `kira-kit theme`
50
64
 
51
- ### Build Registry
65
+ Generate an OKLCH theme palette from a primary color. Produces a
66
+ `registry:theme` item with light/dark schemes, chart hues, and APCA-verified
67
+ contrast; every token lands in the 4.5:1 (text) / 3:1 (UI) range.
52
68
 
53
- Build registry JSON files (used for distribution):
69
+ ```bash
70
+ kira-kit theme --primary "#0B7F79" # print the palette
71
+ kira-kit theme --primary "#0B7F79" --apply # install into the project
72
+ kira-kit theme --primary "#0B7F79" --out my-theme.json
73
+ ```
74
+
75
+ Options: `--primary`, `--base-color` (neutral, stone, zinc, slate, gray, plus
76
+ mauve, olive, mist, taupe), `--out`, `--apply`, `-c/--cwd`.
77
+
78
+ ### `kira-kit check [paths...]`
79
+
80
+ Run the quality checks over component sources (defaults to
81
+ `src/components/ui` + `src/hooks`). Errors fail the run; warnings are advisory
82
+ unless `--ci` is passed.
54
83
 
55
84
  ```bash
56
- kira-kit build
85
+ kira-kit check
86
+ kira-kit check --format github # GitHub Actions annotations
87
+ kira-kit check --ci # strict: every finding fails
88
+ kira-kit check src/components/ui/button.tsx
89
+ ```
90
+
91
+ Checks include: imports-vs-declared-deps, dead animation utilities,
92
+ `data-slot`/cva exports, reduced-motion gating, 24×24 target sizes, raw colors,
93
+ layout-property transitions, arbitrary Tailwind values, registry metadata,
94
+ Base-UI-only primitives, `cn` import source, and suppression hygiene.
95
+
96
+ Suppress a false positive with a reason (unused suppressions are themselves
97
+ flagged):
98
+
99
+ ```tsx
100
+ // kira-kit-ignore target-size: decorative icon, no pointer target needed
101
+ ```
102
+
103
+ Or for a whole file:
104
+
105
+ ```tsx
106
+ /* kira-kit-ignore-file */
107
+ ```
108
+
109
+ ### `kira-kit create [dir]`
110
+
111
+ Scaffold a new project pre-wired for Kira Kit — `components.json` with the
112
+ `@kira-kit` registry, OKLCH theme tokens, the `cn` package, and a welcome
113
+ component.
114
+
115
+ ```bash
116
+ kira-kit create my-app
117
+ kira-kit create my-app --template next --install --git
57
118
  ```
58
119
 
59
- ### List Components
120
+ Templates: `vite`, `next`, `tanstack-start`, `monorepo` (app + ui packages).
60
121
 
61
- List all available components:
122
+ ### `kira-kit migrate`
123
+
124
+ Migrate a pre-1.0 project: converts the legacy `registryUrl` field to the
125
+ `registries` map, runs `shadcn migrate cn` to switch `clsx`/`tailwind-merge`
126
+ imports to the `cn` package, and reports components that have diverged from
127
+ the published registry (read-only — it never overwrites your work).
62
128
 
63
129
  ```bash
64
- kira-kit list
130
+ kira-kit migrate
131
+ kira-kit migrate --dry-run
65
132
  ```
66
133
 
67
- ## Examples
134
+ ### `kira-kit build` (maintainers)
135
+
136
+ The full registry pipeline, run from the repository root:
137
+
138
+ 1. Quality checks (errors block, warnings advise)
139
+ 2. Regenerate the 9 theme presets into `src/themes/registry.json`
140
+ 3. `shadcn registry validate` over every source registry
141
+ 4. `shadcn build` → `public/r/*.json`
142
+ 5. Prune stale `public/r` outputs
143
+ 6. Generate `public/llms.txt` + per-item markdown docs
68
144
 
69
145
  ```bash
70
- # Initialize with specific colors
71
- kira-kit init --base-color neutral --primary-color blue
146
+ kira-kit build
147
+ kira-kit build --skip-checks
148
+ ```
72
149
 
73
- # Add components
74
- kira-kit add button checkbox input --overwrite
150
+ ## Exit codes
75
151
 
76
- # List available components
77
- kira-kit list
152
+ | Code | Meaning |
153
+ | ---- | -------------------------------------------------- |
154
+ | 0 | Success |
155
+ | 1 | User error (bad input, validation failure) |
156
+ | 2 | Registry problem (invalid/malformed registry data) |
157
+ | 3 | Quality checks failed |
158
+
159
+ ## Development
160
+
161
+ ```bash
162
+ bun install
163
+ bun run test # vitest
164
+ bun run typecheck
165
+ bun run build # tsdown → dist/index.mjs
78
166
  ```
79
167
 
80
- ## Requirements
168
+ When source registries change, refresh dependency/file facts with
169
+ `bun run scripts/scaffold-sources.ts` (curated titles/descriptions/categories
170
+ in `scripts/registry-metadata.json` are preserved).
81
171
 
82
- - Node.js 18+
83
- - Bun (recommended) or npm/pnpm/yarn
172
+ Releases use [Changesets](https://changesets.js.org) scoped to this package.
84
173
 
85
174
  ## License
86
175