create-krispya 0.5.1 → 0.5.3

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
@@ -28,6 +28,8 @@ yarn create krispya
28
28
  | Library | Publishable npm package with ESM/CJS output |
29
29
  | Monorepo | pnpm workspace with shared configs and multiple packages |
30
30
 
31
+ > **Note:** Monorepos require pnpm. Applications and libraries support pnpm, npm, and yarn.
32
+
31
33
  ## Templates
32
34
 
33
35
  | Template | Description |
@@ -63,7 +65,7 @@ my-workspace/
63
65
 
64
66
  ### Adding Packages
65
67
 
66
- Run the CLI from within a monorepo to add new packages:
68
+ **Interactive:**
67
69
 
68
70
  ```bash
69
71
  cd my-workspace
@@ -71,12 +73,59 @@ pnpm create krispya
71
73
  # Select "Add new package to this workspace"
72
74
  ```
73
75
 
76
+ **Non-interactive (for scripts/AI):**
77
+
78
+ ```bash
79
+ # Add a library to packages/
80
+ pnpm create krispya my-lib --workspace --type library --template react
81
+
82
+ # Add an app to apps/
83
+ pnpm create krispya my-app --workspace --template r3f --drei --leva
84
+ ```
85
+
86
+ 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).
87
+
74
88
  Sub-packages automatically:
75
89
 
76
90
  - Extend shared configs via `@config/*` workspace dependencies
77
91
  - Skip redundant files (`.gitignore`, `.vscode/`, etc.)
78
92
  - Use root-level dev tools (oxlint, oxfmt)
79
93
 
94
+ ### Validating a Workspace
95
+
96
+ Check if a monorepo is properly configured:
97
+
98
+ ```bash
99
+ pnpm create krispya --check
100
+ ```
101
+
102
+ Returns exit code `0` if valid, `1` if invalid. Validates:
103
+
104
+ - `.config/typescript` package exists
105
+ - Linter config exists (`.config/oxlint`, `eslint.config.js`, or `biome.json`)
106
+ - Formatter config exists (`.config/oxfmt`, `.prettierrc.json`, or `biome.json`)
107
+
108
+ Useful in scripts:
109
+
110
+ ```bash
111
+ if pnpm create krispya --check; then
112
+ pnpm create krispya # add package
113
+ fi
114
+ ```
115
+
116
+ ### AI Instruction Files
117
+
118
+ When creating a monorepo, you can generate AI instruction files to help AI assistants understand the workspace:
119
+
120
+ | File | Tool |
121
+ | --------------------------------- | ----------------------- |
122
+ | `.cursor/rules` | Cursor |
123
+ | `AGENTS.md` | GitHub Copilot, general |
124
+ | `CLAUDE.md` | Claude |
125
+ | `.github/copilot-instructions.md` | GitHub Copilot |
126
+
127
+ Select which files to generate during monorepo creation. Your selection can be saved as a default.
128
+
80
129
  ## Tooling Options
81
130
 
82
131
  | Category | Options | Default |
@@ -93,17 +142,27 @@ Sub-packages automatically:
93
142
  ```
94
143
  create-krispya [name] [options]
95
144
 
96
- Options:
145
+ Project Options:
97
146
  --type <type> app | library (default: app)
98
147
  --template <type> vanilla | react | r3f (+ -js variants)
99
- --monorepo Create a pnpm monorepo workspace
100
148
  --linter <type> eslint | oxlint | biome
101
149
  --formatter <type> prettier | oxfmt | biome
102
150
  --bundler <bundler> unbuild | tsdown (libraries only)
103
- --package-manager <pm> npm | yarn | pnpm
151
+ --package-manager <pm> npm | yarn | pnpm (monorepos: pnpm only)
104
152
  --node-version <version> Node.js version (default: latest)
105
153
  --pnpm-manage-versions Enable pnpm version management (default: true)
106
- -y, --yes Skip prompts, use defaults
154
+
155
+ Workspace Options:
156
+ --workspace Add package to current monorepo (non-interactive)
157
+ --dir <directory> Target directory (default: apps/ or packages/)
158
+
159
+ Utility Options:
160
+ --path <directory> Run in specified directory instead of cwd
161
+ --check Validate current monorepo workspace (exit 0/1)
162
+ --fix Fix monorepo by generating missing config packages
163
+ (use with --linter and --formatter for non-interactive)
164
+ --clear-config Clear saved preferences (editor, window reuse)
165
+ --config-path Print path to config file
107
166
  ```
108
167
 
109
168
  ### R3F Integrations
@@ -132,10 +191,14 @@ For `r3f`/`r3f-js` templates:
132
191
  pnpm create krispya
133
192
 
134
193
  # React app with defaults
135
- pnpm create krispya my-app --template react -y
194
+ pnpm create krispya my-app --template react
136
195
 
137
- # Monorepo workspace
138
- pnpm create krispya my-workspace --monorepo
196
+ # Monorepo workspace (select "Monorepo" in prompts)
197
+ pnpm create krispya my-workspace
198
+
199
+ # Add package to monorepo (non-interactive)
200
+ pnpm create krispya my-lib --workspace --type library --template react
201
+ pnpm create krispya my-example --workspace --dir examples --template r3f
139
202
 
140
203
  # R3F with integrations
141
204
  pnpm create krispya my-3d-app --template r3f --drei --rapier --leva
@@ -145,6 +208,41 @@ pnpm create krispya my-lib --type library --template react --bundler tsdown
145
208
 
146
209
  # Custom tooling
147
210
  pnpm create krispya my-app --linter eslint --formatter prettier
211
+
212
+ # Validate monorepo workspace
213
+ pnpm create krispya --check
214
+
215
+ # Validate a different directory
216
+ pnpm create krispya --check --path ~/Dev/my-monorepo
217
+
218
+ # Fix monorepo (interactive)
219
+ pnpm create krispya --fix
220
+
221
+ # Fix monorepo (non-interactive)
222
+ pnpm create krispya --fix --linter oxlint --formatter oxfmt
223
+
224
+ # Clear saved preferences
225
+ pnpm create krispya --clear-config
226
+ ```
227
+
228
+ ## Preferences
229
+
230
+ The CLI saves preferences for:
231
+
232
+ - **Editor** — Cursor, VS Code, WebStorm, or skip
233
+ - **Window reuse** — Open in current window or new window
234
+ - **AI files** — Which AI instruction files to generate for monorepos
235
+
236
+ Clear saved preferences:
237
+
238
+ ```bash
239
+ pnpm create krispya --clear-config
240
+ ```
241
+
242
+ View config file location:
243
+
244
+ ```bash
245
+ pnpm create krispya --config-path
148
246
  ```
149
247
 
150
248
  ## Post-Creation