kira-kit 0.2.1 → 0.4.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.
- package/README.md +132 -43
- package/dist/index.mjs +2544 -0
- package/package.json +38 -17
- package/templates/monorepo/components.json +23 -0
- package/templates/monorepo/package.json +13 -0
- package/templates/monorepo/packages/app/index.html +13 -0
- package/templates/monorepo/packages/app/package.json +27 -0
- package/templates/monorepo/packages/app/src/App.tsx +21 -0
- package/templates/monorepo/packages/app/src/index.css +3 -0
- package/templates/monorepo/packages/app/src/main.tsx +10 -0
- package/templates/monorepo/packages/app/tsconfig.json +8 -0
- package/templates/monorepo/packages/app/vite.config.ts +10 -0
- package/templates/monorepo/packages/ui/package.json +32 -0
- package/templates/monorepo/packages/ui/src/components/ui/welcome.tsx +52 -0
- package/templates/monorepo/packages/ui/src/index.css +123 -0
- package/templates/monorepo/packages/ui/src/index.ts +3 -0
- package/templates/monorepo/packages/ui/src/lib/utils.ts +1 -0
- package/templates/monorepo/packages/ui/tsconfig.json +7 -0
- package/templates/monorepo/tsconfig.json +23 -0
- package/templates/next/app/globals.css +124 -0
- package/templates/next/app/layout.tsx +18 -0
- package/templates/next/app/page.tsx +9 -0
- package/templates/next/components/ui/welcome.tsx +62 -0
- package/templates/next/components.json +23 -0
- package/templates/next/lib/utils.ts +1 -0
- package/templates/next/next-env.d.ts +2 -0
- package/templates/next/next.config.ts +5 -0
- package/templates/next/package.json +28 -0
- package/templates/next/postcss.config.mjs +7 -0
- package/templates/next/tsconfig.json +24 -0
- package/templates/tanstack-start/README.md +16 -0
- package/templates/tanstack-start/components.json +23 -0
- package/templates/tanstack-start/package.json +30 -0
- package/templates/tanstack-start/src/components/ui/welcome.tsx +52 -0
- package/templates/tanstack-start/src/index.css +123 -0
- package/templates/tanstack-start/src/lib/utils.ts +1 -0
- package/templates/tanstack-start/src/router.tsx +15 -0
- package/templates/tanstack-start/src/routes/__root.tsx +41 -0
- package/templates/tanstack-start/src/routes/index.tsx +26 -0
- package/{tsconfig.json → templates/tanstack-start/tsconfig.json} +6 -7
- package/templates/tanstack-start/vite.config.ts +11 -0
- package/templates/vite/components.json +23 -0
- package/templates/vite/index.html +16 -0
- package/templates/vite/package.json +28 -0
- package/templates/vite/src/App.tsx +9 -0
- package/templates/vite/src/components/ui/welcome.tsx +60 -0
- package/templates/vite/src/index.css +124 -0
- package/templates/vite/src/lib/utils.ts +1 -0
- package/templates/vite/src/main.tsx +10 -0
- package/templates/vite/tsconfig.json +29 -0
- package/templates/vite/tsconfig.node.json +22 -0
- package/templates/vite/vite.config.ts +13 -0
- package/bin/kira-kit.js +0 -27329
- package/bun.lock +0 -247
- package/src/commands/add.ts +0 -146
- package/src/commands/build.ts +0 -212
- package/src/commands/init.ts +0 -164
- package/src/commands/list.ts +0 -31
- package/src/index.ts +0 -118
- package/src/lib/build-config.ts +0 -81
- package/src/lib/config.ts +0 -109
- package/src/lib/deps.ts +0 -135
- package/src/lib/file.ts +0 -64
- package/src/lib/logger.ts +0 -102
- package/src/lib/registry.ts +0 -81
- package/src/lib/templates.ts +0 -123
- package/src/lib/theme-generator.ts +0 -246
- package/src/prompts/base-color.ts +0 -20
- package/src/prompts/primary-color.ts +0 -23
- package/src/prompts/project-type.ts +0 -71
- package/src/types.ts +0 -61
package/README.md
CHANGED
|
@@ -1,86 +1,175 @@
|
|
|
1
|
-
#
|
|
1
|
+
# kira-kit
|
|
2
2
|
|
|
3
|
-
CLI
|
|
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
|
-
|
|
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
|
-
|
|
8
|
-
# Global install
|
|
9
|
-
npm install -g kira-kit
|
|
16
|
+
## Requirements
|
|
10
17
|
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
###
|
|
23
|
+
### `kira-kit init`
|
|
18
24
|
|
|
19
|
-
|
|
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
|
-
###
|
|
38
|
+
### `kira-kit add [items...]`
|
|
32
39
|
|
|
33
|
-
Add
|
|
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
|
-
|
|
40
|
-
|
|
49
|
+
Options: `-o/--overwrite`, `-y/--yes`, `-a/--all`, `-p/--path`, `--dry-run`,
|
|
50
|
+
`--diff`, `--view`, `-c/--cwd`.
|
|
41
51
|
|
|
42
|
-
|
|
43
|
-
|
|
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
|
-
|
|
47
|
-
- `--cwd <directory>` - Working directory
|
|
48
|
-
- `-o, --overwrite` - Overwrite existing files
|
|
49
|
-
- `-y, --yes` - Skip prompts
|
|
63
|
+
### `kira-kit theme`
|
|
50
64
|
|
|
51
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
120
|
+
Templates: `vite`, `next`, `tanstack-start`, `monorepo` (app + ui packages).
|
|
60
121
|
|
|
61
|
-
|
|
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
|
|
130
|
+
kira-kit migrate
|
|
131
|
+
kira-kit migrate --dry-run
|
|
65
132
|
```
|
|
66
133
|
|
|
67
|
-
|
|
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
|
-
|
|
71
|
-
kira-kit
|
|
146
|
+
kira-kit build
|
|
147
|
+
kira-kit build --skip-checks
|
|
148
|
+
```
|
|
72
149
|
|
|
73
|
-
|
|
74
|
-
kira-kit add button checkbox input --overwrite
|
|
150
|
+
## Exit codes
|
|
75
151
|
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|