create-krispya 0.6.0 → 0.8.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 CHANGED
@@ -1,358 +1,30 @@
1
1
  # create-krispya
2
2
 
3
- A CLI for scaffolding modern web projects and monorepos with sensible defaults.
3
+ > Full AI generated docs can be found [here](./docs/api.md).
4
+
5
+ A CLI for scaffolding modern, clutter-free web projects.
4
6
 
5
7
  ## Quick Start
6
8
 
7
9
  ```bash
8
10
  pnpm create krispya
9
11
  # or
10
- npm create krispya
12
+ bun create krispya
11
13
  # or
12
- yarn create krispya
13
- ```
14
-
15
- ## Features
16
-
17
- - **Monorepo support** — Generate pnpm workspaces with shared configs
18
- - **Modern tooling** — Oxlint, Oxfmt, Vite, Vitest out of the box
19
- - **TypeScript first** — Full type safety with JavaScript fallback
20
- - **Library ready** — ESM/CJS dual output with proper exports
21
- - **React & R3F** — First-class support with optional integrations
22
- - **Config strategy** — Choose between stealth (`.config/`) or root placement
23
-
24
- ## Project Types
25
-
26
- | Type | Description |
27
- | ----------- | -------------------------------------------------------- |
28
- | Application | Web app with Vite dev server and bundling |
29
- | Library | Publishable npm package with ESM/CJS output |
30
- | Monorepo | pnpm workspace with shared configs and multiple packages |
31
-
32
- > **Note:** Monorepos require pnpm. Applications and libraries support pnpm, npm, and yarn.
33
-
34
- ## Templates
35
-
36
- | Template | Description |
37
- | ------------ | --------------------------------- |
38
- | `vanilla` | Vanilla TypeScript (default) |
39
- | `vanilla-js` | Vanilla JavaScript |
40
- | `react` | React with TypeScript |
41
- | `react-js` | React with JavaScript |
42
- | `r3f` | React Three Fiber with TypeScript |
43
- | `r3f-js` | React Three Fiber with JavaScript |
44
-
45
- ## Monorepo
46
-
47
- Generate a monorepo with shared configuration packages:
48
-
49
- ```bash
50
- pnpm create krispya
51
- # Select "Monorepo" when prompted for project type
52
- ```
53
-
54
- This creates:
55
-
56
- ```
57
- my-workspace/
58
- ├── .config/
59
- │ ├── typescript/ # @config/typescript - shared tsconfigs
60
- │ ├── oxlint/ # @config/oxlint - shared lint rules
61
- │ └── oxfmt/ # @config/oxfmt - shared format rules
62
- ├── apps/ # Application packages
63
- ├── packages/ # Library packages
64
- ├── package.json
65
- └── pnpm-workspace.yaml
66
- ```
67
-
68
- ### Adding Packages
69
-
70
- **Interactive:**
71
-
72
- ```bash
73
- cd my-workspace
74
- pnpm create krispya
75
- # Select "Add new package to this workspace"
76
- ```
77
-
78
- **Non-interactive (for scripts/AI):**
79
-
80
- ```bash
81
- # Add a library to packages/
82
- pnpm create krispya my-lib --workspace --type library --template react
83
-
84
- # Add an app to apps/
85
- pnpm create krispya my-app --workspace --template r3f --drei --leva
86
- ```
87
-
88
- The CLI automatically detects workspace directories from `pnpm-workspace.yaml`. If you have custom directories beyond `apps/` and `packages/` (e.g., `examples/`, `modules/`), you'll be prompted to select where to place the new package (interactive mode only).
89
-
90
- Sub-packages automatically:
91
-
92
- - Extend shared configs via `@config/*` workspace dependencies
93
- - Skip redundant files (`.gitignore`, `.vscode/`, etc.)
94
- - Use root-level dev tools (oxlint, oxfmt)
95
-
96
- ### Validating a Workspace
97
-
98
- Check if a monorepo is properly configured:
99
-
100
- ```bash
101
- pnpm create krispya --check
102
- ```
103
-
104
- Returns exit code `0` if valid, `1` if invalid. Validates:
105
-
106
- - `.config/typescript` package exists
107
- - Linter config exists (`.config/oxlint`, `eslint.config.js`, or `biome.json`)
108
- - Formatter config exists (`.config/oxfmt`, `.prettierrc.json`, or `biome.json`)
109
-
110
- Useful in scripts:
111
-
112
- ```bash
113
- if pnpm create krispya --check; then
114
- pnpm create krispya # add package
115
- fi
14
+ npm create krispya@latest
15
+ # and follow the prompts
116
16
  ```
117
17
 
118
- ### Updating a Workspace
119
-
120
- Update an existing monorepo to the latest template:
121
-
122
- ```bash
123
- pnpm create krispya --update
124
- ```
125
-
126
- This compares your workspace against the latest template and offers to:
127
-
128
- - Add new files (AI instructions, VS Code settings, etc.)
129
- - Update config packages to latest versions
130
- - Merge workspace config changes
131
-
132
- Files are grouped by category. For each category with changes:
133
-
134
- - `+` indicates new files (safe to add)
135
- - `~` indicates changed files (will overwrite your customizations)
136
-
137
- Use `--yes` for non-interactive mode (adds new files only, skips modified).
138
-
139
- ### Migrating Linter/Formatter
140
-
141
- Switch between linters or formatters:
142
-
143
- ```bash
144
- # Migrate linter
145
- pnpm create krispya --update --linter eslint
146
-
147
- # Migrate formatter
148
- pnpm create krispya --update --formatter prettier
149
-
150
- # Migrate both
151
- pnpm create krispya --update --linter biome --formatter biome
152
- ```
153
-
154
- Migration automatically:
155
-
156
- - Removes old config packages (e.g., `.config/oxlint/`)
157
- - Generates new config packages (e.g., `.config/eslint/`)
158
- - Updates root `package.json` (devDependencies, scripts)
159
- - Updates all sub-package devDependencies
160
- - Regenerates VS Code settings and AI files
161
-
162
- Run `pnpm install` after migration to update dependencies.
18
+ **Who cares?**
163
19
 
164
- ### AI Rules
20
+ I really hate looking at my repo when there are 20 config files sitting in root. It is noisy and, worst of all, plain ugly. Not only do we derserve beautiful code, but in the post-AI world great taste is all I have. In pursuit of minimalism, as many files as possible are moved to hidden directories such as `.config` and`.vscode`.
165
21
 
166
- Optionally generate AI instruction files to help coding assistants understand the project:
22
+ We are also in a time of rampant changes to the JS toolchain ecossytem. In an effort to keep up, but also encourage trying new tools out, I wante to build a framework that let me swap between them with some guardrails.
167
23
 
168
- | File | Supported by |
169
- | ----------- | --------------------------------- |
170
- | `AGENTS.md` | OpenAI, Cursor, Windsurf, Copilot |
171
- | `CLAUDE.md` | Claude Code |
172
-
173
- These are pointer files that reference `.ai/workspace.md`, which contains:
174
-
175
- - Project type and tooling (linter, formatter, package manager)
176
- - Common commands (`pnpm test`, `pnpm build`, etc.)
177
- - Project structure documentation
178
-
179
- Select which files to generate during project creation. Your selection can be saved as a default.
180
-
181
- ## Tooling Options
182
-
183
- | Category | Options | Default |
184
- | --------- | ---------------------------- | --------- |
185
- | Linter | `oxlint`, `eslint`, `biome` | `oxlint` |
186
- | Formatter | `oxfmt`, `prettier`, `biome` | `oxfmt` |
187
- | Bundler | `unbuild`, `tsdown` | `unbuild` |
188
- | Testing | `vitest`, `none` | varies\* |
189
-
190
- \*Testing defaults to `vitest` for libraries, `none` for applications (configurable via prompts).
191
-
192
- ## Config Strategy
193
-
194
- Control where configuration files are placed in single-package projects:
195
-
196
- | Strategy | Description |
197
- | --------- | ---------------------------------------------- |
198
- | `stealth` | Configs in `.config/` directory (default) |
199
- | `root` | Configs at project root (traditional approach) |
200
-
201
- **Stealth mode** keeps your project root clean:
202
-
203
- ```
204
- my-project/
205
- ├── .config/
206
- │ ├── oxlint.json
207
- │ ├── prettier.json
208
- │ ├── tsconfig.app.json
209
- │ └── tsconfig.node.json
210
- ├── src/
211
- ├── package.json
212
- └── tsconfig.json
213
- ```
214
-
215
- **Root mode** uses traditional config placement:
216
-
217
- ```
218
- my-project/
219
- ├── src/
220
- ├── oxlint.json
221
- ├── .prettierrc
222
- ├── tsconfig.json
223
- ├── tsconfig.app.json
224
- ├── tsconfig.node.json
225
- └── package.json
226
- ```
227
-
228
- Set your default via the global config file (`~/.config/create-krispya/config.json`):
229
-
230
- ```json
231
- {
232
- "configStrategy": "root"
233
- }
234
- ```
235
-
236
- ## CLI Options
237
-
238
- ```
239
- create-krispya [name] [options]
240
-
241
- Project Options:
242
- --type <type> app | library (default: app)
243
- --template <type> vanilla | react | r3f (+ -js variants)
244
- --linter <type> eslint | oxlint | biome
245
- --formatter <type> prettier | oxfmt | biome
246
- --bundler <bundler> unbuild | tsdown (libraries only)
247
- --package-manager <pm> npm | yarn | pnpm (monorepos: pnpm only)
248
- --node-version <version> Node.js version (default: latest)
249
- --pnpm-manage-versions Enable pnpm version management (default: true)
250
-
251
- Workspace Options:
252
- --workspace Add package to current monorepo (non-interactive)
253
- --dir <directory> Target directory (default: apps/ or packages/)
254
-
255
- Utility Options:
256
- --path <directory> Run in specified directory instead of cwd
257
- --check Validate current monorepo workspace (exit 0/1)
258
- --fix Fix monorepo by generating missing config packages
259
- (use with --linter and --formatter for non-interactive)
260
- --update Update monorepo to latest template (add new files, update configs)
261
- --yes Accept defaults for prompts (non-interactive mode)
262
- --clear-config Clear saved preferences (editor, window reuse)
263
- --config-path Print path to config file
264
- ```
265
-
266
- ### R3F Integrations
267
-
268
- For `r3f`/`r3f-js` templates:
269
-
270
- ```
271
- --drei @react-three/drei helpers
272
- --handle @react-three/handle events
273
- --leva leva controls
274
- --postprocessing @react-three/postprocessing effects
275
- --rapier @react-three/rapier physics
276
- --xr @react-three/xr VR/AR
277
- --uikit @react-three/uikit UI
278
- --offscreen @react-three/offscreen rendering
279
- --zustand zustand state
280
- --koota koota ECS
281
- --triplex Triplex dev environment
282
- --viverse Viverse deployment
283
- ```
284
-
285
- ## Examples
286
-
287
- ```bash
288
- # Interactive mode
289
- pnpm create krispya
290
-
291
- # React app with defaults
292
- pnpm create krispya my-app --template react
293
-
294
- # Monorepo workspace (select "Monorepo" in prompts)
295
- pnpm create krispya my-workspace
296
-
297
- # Add package to monorepo (non-interactive)
298
- pnpm create krispya my-lib --workspace --type library --template react
299
- pnpm create krispya my-example --workspace --dir examples --template r3f
300
-
301
- # R3F with integrations
302
- pnpm create krispya my-3d-app --template r3f --drei --rapier --leva
303
-
304
- # Library with tsdown
305
- pnpm create krispya my-lib --type library --template react --bundler tsdown
306
-
307
- # Custom tooling
308
- pnpm create krispya my-app --linter eslint --formatter prettier
309
-
310
- # Validate monorepo workspace
311
- pnpm create krispya --check
312
-
313
- # Validate a different directory
314
- pnpm create krispya --check --path ~/Dev/my-monorepo
315
-
316
- # Fix monorepo (interactive)
317
- pnpm create krispya --fix
318
-
319
- # Fix monorepo (non-interactive)
320
- pnpm create krispya --fix --linter oxlint --formatter oxfmt
321
-
322
- # Update monorepo to latest template
323
- pnpm create krispya --update
324
-
325
- # Update monorepo (non-interactive - adds new files only)
326
- pnpm create krispya --update --yes
327
-
328
- # Clear saved preferences
329
- pnpm create krispya --clear-config
330
- ```
331
-
332
- ## Preferences
333
-
334
- The CLI saves preferences for:
335
-
336
- - **Editor** — Cursor, VS Code, WebStorm, or skip
337
- - **Window reuse** — Open in current window or new window
338
- - **AI platforms** — Which AI rule files to generate (AGENTS.md, CLAUDE.md)
339
-
340
- Clear saved preferences:
341
-
342
- ```bash
343
- pnpm create krispya --clear-config
344
- ```
345
-
346
- View config file location:
347
-
348
- ```bash
349
- pnpm create krispya --config-path
350
- ```
24
+ **Current Status**
351
25
 
352
- ## Post-Creation
26
+ Consider this experimental but safe. It was vibe coded and then I decided this project deserved better so I am going through it piece by piece and making it whole and loved.
353
27
 
354
- After scaffolding:
28
+ ## Single-project workspaces
355
29
 
356
- 1. Install dependencies: `pnpm install`
357
- 2. Start development: `pnpm dev`
358
- 3. Optionally open in your editor (Cursor, VS Code, or WebStorm)
30
+ The basic dish.