create-krispya 0.5.3 → 0.7.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 +7 -242
- package/dist/index.cjs +2969 -17
- package/dist/index.d.cts +23 -7
- package/dist/index.d.mts +23 -7
- package/dist/index.d.ts +23 -7
- package/dist/index.mjs +2953 -2
- package/package.json +29 -15
- package/LICENSE +0 -15
- package/dist/chunks/index.cjs +0 -2766
- package/dist/chunks/index.mjs +0 -2741
- package/dist/cli.cjs +0 -2037
- package/dist/cli.d.cts +0 -1
- package/dist/cli.d.mts +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.mjs +0 -2016
package/README.md
CHANGED
|
@@ -1,254 +1,19 @@
|
|
|
1
1
|
# create-krispya
|
|
2
2
|
|
|
3
|
-
|
|
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
|
+
npm create krispya@latest
|
|
13
|
+
# or
|
|
14
|
+
bun create krispya
|
|
11
15
|
# or
|
|
12
16
|
yarn create krispya
|
|
13
17
|
```
|
|
14
18
|
|
|
15
|
-
|
|
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
|
-
|
|
23
|
-
## Project Types
|
|
24
|
-
|
|
25
|
-
| Type | Description |
|
|
26
|
-
| ----------- | -------------------------------------------------------- |
|
|
27
|
-
| Application | Web app with Vite dev server and bundling |
|
|
28
|
-
| Library | Publishable npm package with ESM/CJS output |
|
|
29
|
-
| Monorepo | pnpm workspace with shared configs and multiple packages |
|
|
30
|
-
|
|
31
|
-
> **Note:** Monorepos require pnpm. Applications and libraries support pnpm, npm, and yarn.
|
|
32
|
-
|
|
33
|
-
## Templates
|
|
34
|
-
|
|
35
|
-
| Template | Description |
|
|
36
|
-
| ------------ | --------------------------------- |
|
|
37
|
-
| `vanilla` | Vanilla TypeScript (default) |
|
|
38
|
-
| `vanilla-js` | Vanilla JavaScript |
|
|
39
|
-
| `react` | React with TypeScript |
|
|
40
|
-
| `react-js` | React with JavaScript |
|
|
41
|
-
| `r3f` | React Three Fiber with TypeScript |
|
|
42
|
-
| `r3f-js` | React Three Fiber with JavaScript |
|
|
43
|
-
|
|
44
|
-
## Monorepo
|
|
45
|
-
|
|
46
|
-
Generate a monorepo with shared configuration packages:
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
pnpm create krispya my-workspace --monorepo
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
This creates:
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
my-workspace/
|
|
56
|
-
├── .config/
|
|
57
|
-
│ ├── typescript/ # @config/typescript - shared tsconfigs
|
|
58
|
-
│ ├── oxlint/ # @config/oxlint - shared lint rules
|
|
59
|
-
│ └── oxfmt/ # @config/oxfmt - shared format rules
|
|
60
|
-
├── apps/ # Application packages
|
|
61
|
-
├── packages/ # Library packages
|
|
62
|
-
├── package.json
|
|
63
|
-
└── pnpm-workspace.yaml
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
### Adding Packages
|
|
67
|
-
|
|
68
|
-
**Interactive:**
|
|
69
|
-
|
|
70
|
-
```bash
|
|
71
|
-
cd my-workspace
|
|
72
|
-
pnpm create krispya
|
|
73
|
-
# Select "Add new package to this workspace"
|
|
74
|
-
```
|
|
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
|
-
|
|
88
|
-
Sub-packages automatically:
|
|
89
|
-
|
|
90
|
-
- Extend shared configs via `@config/*` workspace dependencies
|
|
91
|
-
- Skip redundant files (`.gitignore`, `.vscode/`, etc.)
|
|
92
|
-
- Use root-level dev tools (oxlint, oxfmt)
|
|
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
|
-
|
|
129
|
-
## Tooling Options
|
|
130
|
-
|
|
131
|
-
| Category | Options | Default |
|
|
132
|
-
| --------- | ---------------------------- | --------- |
|
|
133
|
-
| Linter | `oxlint`, `eslint`, `biome` | `oxlint` |
|
|
134
|
-
| Formatter | `oxfmt`, `prettier`, `biome` | `oxfmt` |
|
|
135
|
-
| Bundler | `unbuild`, `tsdown` | `unbuild` |
|
|
136
|
-
| Testing | `vitest`, `none` | varies\* |
|
|
137
|
-
|
|
138
|
-
\*Testing defaults to `vitest` for libraries, `none` for applications (configurable via prompts).
|
|
139
|
-
|
|
140
|
-
## CLI Options
|
|
141
|
-
|
|
142
|
-
```
|
|
143
|
-
create-krispya [name] [options]
|
|
144
|
-
|
|
145
|
-
Project Options:
|
|
146
|
-
--type <type> app | library (default: app)
|
|
147
|
-
--template <type> vanilla | react | r3f (+ -js variants)
|
|
148
|
-
--linter <type> eslint | oxlint | biome
|
|
149
|
-
--formatter <type> prettier | oxfmt | biome
|
|
150
|
-
--bundler <bundler> unbuild | tsdown (libraries only)
|
|
151
|
-
--package-manager <pm> npm | yarn | pnpm (monorepos: pnpm only)
|
|
152
|
-
--node-version <version> Node.js version (default: latest)
|
|
153
|
-
--pnpm-manage-versions Enable pnpm version management (default: true)
|
|
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
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### R3F Integrations
|
|
169
|
-
|
|
170
|
-
For `r3f`/`r3f-js` templates:
|
|
171
|
-
|
|
172
|
-
```
|
|
173
|
-
--drei @react-three/drei helpers
|
|
174
|
-
--handle @react-three/handle events
|
|
175
|
-
--leva leva controls
|
|
176
|
-
--postprocessing @react-three/postprocessing effects
|
|
177
|
-
--rapier @react-three/rapier physics
|
|
178
|
-
--xr @react-three/xr VR/AR
|
|
179
|
-
--uikit @react-three/uikit UI
|
|
180
|
-
--offscreen @react-three/offscreen rendering
|
|
181
|
-
--zustand zustand state
|
|
182
|
-
--koota koota ECS
|
|
183
|
-
--triplex Triplex dev environment
|
|
184
|
-
--viverse Viverse deployment
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
## Examples
|
|
188
|
-
|
|
189
|
-
```bash
|
|
190
|
-
# Interactive mode
|
|
191
|
-
pnpm create krispya
|
|
192
|
-
|
|
193
|
-
# React app with defaults
|
|
194
|
-
pnpm create krispya my-app --template react
|
|
195
|
-
|
|
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
|
|
202
|
-
|
|
203
|
-
# R3F with integrations
|
|
204
|
-
pnpm create krispya my-3d-app --template r3f --drei --rapier --leva
|
|
205
|
-
|
|
206
|
-
# Library with tsdown
|
|
207
|
-
pnpm create krispya my-lib --type library --template react --bundler tsdown
|
|
208
|
-
|
|
209
|
-
# Custom tooling
|
|
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
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
## Post-Creation
|
|
249
|
-
|
|
250
|
-
After scaffolding:
|
|
251
|
-
|
|
252
|
-
1. Install dependencies: `pnpm install`
|
|
253
|
-
2. Start development: `pnpm dev`
|
|
254
|
-
3. Optionally open in your editor (Cursor, VS Code, or WebStorm)
|
|
19
|
+
I really hate looking at my repo and there are 20 config files sitting in root. It is noisy and, worst of all, plain ugly. We deserve beautiful code. In pursuit of minimalism, as many files as possible are moved to hidden directories such as `.config`, `.vscode` and `.ai`.
|