kigumi 0.2.0 β†’ 0.2.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.
Files changed (2) hide show
  1. package/README.md +35 -356
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,407 +1,86 @@
1
- # Kigumi CLI
1
+ # Kigumi
2
2
 
3
- > Add Web Awesome components to your React, Vue, or Svelte project
3
+ Add [Web Awesome](https://webawesome.com) components to your React project.
4
4
 
5
- Inspired by [shadcn/ui](https://ui.shadcn.com), Kigumi provides a seamless way to integrate Web Awesome components with framework-specific wrappers.
5
+ Inspired by [shadcn/ui](https://ui.shadcn.com).
6
6
 
7
- ## ✨ Features
8
-
9
- - 🎯 **Framework Support**: React (Vue/Svelte coming soon)
10
- - πŸ“¦ **Component Registry**: 40+ Web Awesome components
11
- - 🎨 **Theme System**: 11 themes + 9 color palettes
12
- - 🌈 **Brand Colors**: Customize with your brand
13
- - ⚑ **Hot Reload**: Theme changes apply instantly
14
- - πŸ“ **TypeScript First**: Auto-generated types
15
- - πŸ”§ **Free & Pro Tiers**: Flexible licensing
16
-
17
- ## πŸš€ Quick Start
18
-
19
- ### React + Vite (Recommended)
20
-
21
- #### 1. Create Project
22
-
23
- ```bash
24
- npm create vite@latest my-app -- --template react
25
- cd my-app
26
- npm install
27
- ```
28
-
29
- #### 2. Initialize Kigumi
30
-
31
- **Free Tier**:
7
+ ## Quick Start
32
8
 
33
9
  ```bash
10
+ # Initialize in your project
34
11
  npx kigumi init
35
- # Interactive: Follow prompts for Framework β†’ Theme β†’ Palette β†’ Brand
36
12
 
37
- # Or non-interactive:
38
- npx kigumi init --framework=react --theme=awesome --palette=default --brand=purple
13
+ # Add components
14
+ npx kigumi add button card input
39
15
  ```
40
16
 
41
- **Pro Tier**:
42
-
43
- ```bash
44
- npx kigumi init --framework=react --theme=brutalist --token=YOUR_PRO_TOKEN
45
- ```
46
-
47
- > **Get Pro Token**: [webawesome.com](https://webawesome.com) β†’ Settings β†’ API Tokens
48
-
49
- **What `init` does**:
50
-
51
- - βœ… Creates `kigumi.config.json`
52
- - βœ… Generates `src/lib/webawesome.ts` (theme setup)
53
- - βœ… Generates `src/styles/theme.css` (customization)
54
- - βœ… **Configures path aliases automatically** (`vite.config.ts` + `tsconfig.app.json`)
55
- - βœ… Creates `.env` (Pro only, with token)
56
- - βœ… Creates `.npmrc` (registry configuration)
57
- - βœ… Installs Web Awesome package + `@types/react` (TypeScript)
58
- - βœ… Generates TypeScript definitions (if TypeScript)
59
-
60
- #### 3. Import Web Awesome
61
-
62
- **`src/main.tsx`** (or `main.jsx`):
17
+ Then import Web Awesome in your entry file:
63
18
 
64
19
  ```tsx
65
- import { createRoot } from 'react-dom/client';
66
- import { App } from './App';
67
- import '@/lib/webawesome'; // Add this line
68
-
69
- createRoot(document.getElementById('root')!).render(<App />);
20
+ // src/main.tsx
21
+ import '@/lib/webawesome';
70
22
  ```
71
23
 
72
- #### 4. Add Components
73
-
74
- ```bash
75
- # Add single component
76
- npx kigumi add button
77
-
78
- # Add multiple components
79
- npx kigumi add button input card dialog
80
-
81
- # Interactive selection
82
- npx kigumi add
83
-
84
- # Add all components
85
- npx kigumi add --all
86
- ```
87
-
88
- #### 6. Use Components
89
-
90
- **`src/App.tsx`**:
24
+ Use the components:
91
25
 
92
26
  ```tsx
93
- import { Button, Input, Card } from '@/components/ui';
27
+ import { Button, Card } from '@/components/ui';
94
28
 
95
29
  function App() {
96
30
  return (
97
31
  <Card>
98
- <Input placeholder="Enter your name" />
99
- <Button variant="brand">Submit</Button>
32
+ <Button variant="brand">Click me</Button>
100
33
  </Card>
101
34
  );
102
35
  }
103
-
104
- export default App;
105
- ```
106
-
107
- #### 7. Start Dev Server
108
-
109
- ```bash
110
- npm run dev
111
- ```
112
-
113
- Open [http://localhost:5173](http://localhost:5173) πŸŽ‰
114
-
115
- ---
116
-
117
- ## πŸ“¦ CLI Commands
118
-
119
- ### `init` - Initialize Kigumi
120
-
121
- ```bash
122
- npx kigumi init
123
-
124
- # Non-interactive
125
- npx kigumi init --framework=react --theme=awesome --token=YOUR_TOKEN
126
- ```
127
-
128
- Initializes Kigumi in your project and installs dependencies automatically.
129
-
130
- ### `add [components...]` - Add Components
131
-
132
- ```bash
133
- npx kigumi add button
134
- npx kigumi add button input card
135
- npx kigumi add --all
136
- npx kigumi add button --overwrite
137
36
  ```
138
37
 
139
- **Options**:
140
-
141
- - `--all` - Add all available components
142
- - `--overwrite` - Overwrite existing components
143
-
144
- ### `list` - List Components
38
+ ## Commands
145
39
 
146
40
  ```bash
147
- npx kigumi list
41
+ npx kigumi init # Initialize project
42
+ npx kigumi add <component> # Add component(s)
43
+ npx kigumi add --all # Add all components
44
+ npx kigumi list # List available components
45
+ npx kigumi status # Show current configuration
46
+ npx kigumi theme set <name> # Change theme
47
+ npx kigumi palette <name> # Change color palette
48
+ npx kigumi brand <color> # Change brand color
148
49
  ```
149
50
 
150
- Shows all available components with tier requirements.
51
+ ## Pro Tier
151
52
 
152
- ### `theme` - Theme Management
53
+ Unlock premium themes and components with a [Web Awesome Pro](https://webawesome.com) token:
153
54
 
154
55
  ```bash
155
- # Show current theme
156
- npx kigumi theme show
157
-
158
- # List available themes
159
- npx kigumi theme list
160
-
161
- # Switch theme
162
- npx kigumi theme set awesome
163
- npx kigumi theme set brutalist
164
-
165
- # Change palette
166
- npx kigumi palette default
167
- npx kigumi palette rudimentary
168
-
169
- # Change brand color
170
- npx kigumi brand purple
171
- npx kigumi brand green
172
- ```
173
-
174
- **Available Themes**:
175
-
176
- | Theme | Tier | Style |
177
- | --------- | ---- | ------------------- |
178
- | awesome | Free | Web Awesome default |
179
- | default | Free | Default theme |
180
- | shoelace | Free | Shoelace theme |
181
- | brutalist | Pro | Bold & raw |
182
- | material | Pro | Material Design |
183
- | ios | Pro | iOS style |
184
- | fluent | Pro | Microsoft Fluent |
185
- | nord | Pro | Nord color scheme |
186
- | neon | Pro | Neon glow |
187
- | coffee | Pro | Warm coffee tones |
188
- | ocean | Pro | Ocean blues |
189
-
190
- > **Note**: Pro tier themes are listed in `src/utils/tier-restrictions.ts` but may not all be available in the actual package yet.
191
-
192
- **Available Palettes**: default, bright, subdued, high-contrast, low-contrast, warm, cool, rudimentary, vivid (all available for both tiers)
193
-
194
- **Brand Colors**: blue, purple, green, red, orange, yellow, cyan, indigo, pink, gray
195
-
196
- ---
197
-
198
- ## 🎨 Customization
199
-
200
- Override Web Awesome design tokens in `src/styles/theme.css`:
201
-
202
- ```css
203
- :root {
204
- /* Spacing */
205
- --wa-space-xs: 0.25rem;
206
- --wa-space-s: 0.5rem;
207
- --wa-space-m: 1rem;
208
-
209
- /* Typography */
210
- --wa-font-size-s: 0.875rem;
211
- --wa-font-weight-bold: 700;
212
-
213
- /* Brand color */
214
- --wa-color-brand-fill-loud: #your-custom-color;
215
- }
56
+ npx kigumi init --token=YOUR_PRO_TOKEN
216
57
  ```
217
58
 
218
- See [Web Awesome tokens](https://webawesome.com/docs/tokens) for all available tokens.
219
-
220
- ---
221
-
222
- ## πŸ†“ Free vs Pro
223
-
224
- | Feature | Free | Pro |
225
- | ------------------ | ---- | --- |
226
- | **Themes** | 3 | 11 |
227
- | **Palettes** | 9 | 9 |
228
- | **Components** | 30+ | 40+ |
229
- | **Pro Components** | ❌ | βœ… |
230
-
231
- **Pro-only components**: page, charts, combobox, data-grid, date-picker, file-input, toast, video
59
+ ## Configuration
232
60
 
233
- ### Upgrading Free β†’ Pro
234
-
235
- 1. Get Pro token from [webawesome.com](https://webawesome.com)
236
- 2. Run `npx kigumi init --token=YOUR_PRO_TOKEN`
237
- 3. Done! Existing components are automatically migrated
238
-
239
- ---
240
-
241
- ## πŸ”§ Configuration
242
-
243
- `kigumi.config.json`:
61
+ Settings are stored in `kigumi.config.json`:
244
62
 
245
63
  ```json
246
64
  {
247
65
  "framework": "react",
248
66
  "typescript": true,
249
67
  "componentsDir": "src/components/ui",
250
- "utilsDir": "src/lib",
251
68
  "theme": {
252
- "selected": "awesome",
69
+ "selected": "default",
253
70
  "palette": "default",
254
- "brandColor": "purple"
255
- },
256
- "aliases": {
257
- "@/components": "./src/components",
258
- "@/lib": "./src/lib"
259
- },
260
- "webAwesome": {
261
- "version": "^3.1.0"
71
+ "brandColor": "blue"
262
72
  }
263
73
  }
264
74
  ```
265
75
 
266
- **Tier Detection**: Automatically detected from `.env` file. If `WEBAWESOME_NPM_TOKEN` exists, Pro tier is used.
267
-
268
- ---
269
-
270
- ## πŸ”§ Development
271
-
272
- ### Code Quality Tools
273
-
274
- This project uses automated code quality tools to ensure consistent, high-quality code:
275
-
276
- - **ESLint**: Lints TypeScript/JavaScript code for errors and code quality issues
277
- - **Prettier**: Formats code consistently across the entire codebase
278
- - **Husky**: Manages Git hooks to enforce quality standards before commits
279
- - **lint-staged**: Runs linting/formatting only on staged files for efficient pre-commit checks
280
-
281
- ### Available Scripts
282
-
283
- ```bash
284
- # Linting
285
- pnpm lint # Check for linting issues
286
- pnpm lint:fix # Auto-fix linting issues
287
-
288
- # Formatting
289
- pnpm format # Format all code with Prettier
290
- pnpm format:check # Check if code is formatted correctly
291
-
292
- # Type Checking
293
- pnpm type-check # Run TypeScript type checker
294
-
295
- # Testing
296
- pnpm test # Run all tests
297
- pnpm test:watch # Run tests in watch mode
298
-
299
- # Building
300
- pnpm build # Build the CLI for distribution
301
- pnpm dev # Run the CLI in development mode with watch
302
- ```
303
-
304
- ### Pre-Commit Hooks
305
-
306
- All commits are automatically checked before being created:
307
-
308
- 1. **ESLint** runs on staged TypeScript files (errors block commits)
309
- 2. **Prettier** formats all staged files automatically
310
-
311
- This ensures all committed code meets quality standards.
312
-
313
- ---
314
-
315
- ## πŸ› Troubleshooting
316
-
317
- ### "Failed to resolve import @/lib/webawesome"
318
-
319
- With CLI v0.2.0+, path aliases are configured automatically for Vite projects.
320
-
321
- If you still see this error:
322
-
323
- 1. Verify `vite.config.ts` has `resolve.alias['@']`
324
- 2. Verify `tsconfig.app.json` has `paths["@/*"]`
325
- 3. Re-run `npx kigumi init` (safe, won't break existing setup)
326
-
327
- ### "401 Unauthorized" when installing Pro
328
-
329
- Invalid token in `.env`. Get new token from [webawesome.com](https://webawesome.com).
330
-
331
- ### Components render unstyled
332
-
333
- 1. Check `src/lib/webawesome.ts` has component imports
334
- 2. Verify `import '@/lib/webawesome'` in `src/main.tsx`
335
-
336
- ### Components don't render at all
337
-
338
- Add `import '@/lib/webawesome'` to your main entry file (see Quick Start step 4).
339
-
340
- ### TypeScript errors with React hooks
341
-
342
- Web component wrappers use `import React from 'react'` (not named imports) for compatibility.
343
-
344
- ### Registry mismatch errors (pnpm)
345
-
346
- Run `rm -rf node_modules pnpm-lock.yaml && pnpm install` to recreate lockfile with new registry configuration.
347
-
348
- ---
349
-
350
- ## πŸ—οΈ Architecture
351
-
352
- ```
353
- src/
354
- β”œβ”€β”€ commands/ # CLI command handlers
355
- β”‚ β”œβ”€β”€ init/ # Project initialization
356
- β”‚ β”œβ”€β”€ add/ # Component installation
357
- β”‚ └── theme/ # Theme management
358
- β”œβ”€β”€ utils/ # Internal utilities
359
- β”‚ β”œβ”€β”€ tier.ts # Free/Pro tier detection
360
- β”‚ β”œβ”€β”€ config.ts # Configuration management
361
- β”‚ β”œβ”€β”€ registry.ts # Component definitions
362
- β”‚ └── template.ts # Handlebars template rendering
363
- β”œβ”€β”€ schemas/ # Zod validation schemas
364
- β”œβ”€β”€ errors/ # Typed error classes
365
- β”œβ”€β”€ output/ # Console output formatting
366
- └── constants.ts # Centralized magic strings
367
- templates/
368
- └── react/ # .hbs template files
369
- ```
370
-
371
- **Key Design Patterns**:
372
-
373
- - Templates-first development (never edit generated code)
374
- - Tier detection from `.env` (not stored in config)
375
- - Centralized constants (`src/constants.ts`)
376
- - Structured error handling with semantic exit codes
377
- - Template compilation caching for performance
378
-
379
- ---
76
+ ## Troubleshooting
380
77
 
381
- ## πŸ“š Documentation
78
+ **Components not rendering?**
79
+ Make sure you have `import '@/lib/webawesome'` in your main entry file.
382
80
 
383
- - **AGENTS.md** - AI assistant development guide (architecture diagrams, data flow)
384
- - **CLAUDE.md** - Human developer documentation
81
+ **Path alias errors?**
82
+ Re-run `npx kigumi init` to reconfigure aliases.
385
83
 
386
- ---
387
-
388
- ## πŸ—ΊοΈ Roadmap
389
-
390
- - [ ] Vue framework support
391
- - [ ] Svelte framework support
392
- - [ ] Angular framework support
393
- - [ ] Remote component registry
394
- - [ ] Component preview/documentation generation
395
- - [ ] Storybook integration
396
-
397
- ---
398
-
399
- ## πŸ“„ License
84
+ ## License
400
85
 
401
86
  MIT
402
-
403
- ---
404
-
405
- ## πŸ’™ Credits
406
-
407
- Inspired by [shadcn/ui](https://ui.shadcn.com) - Built for [Web Awesome](https://awesome.me)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kigumi",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "CLI tool to add Web Awesome components to your project",
5
5
  "type": "module",
6
6
  "bin": {