create-krispya 0.4.4 → 0.4.7

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 ADDED
@@ -0,0 +1,97 @@
1
+ # create-krispya
2
+
3
+ A CLI for scaffolding modern web projects with sensible defaults.
4
+
5
+ ## Usage
6
+
7
+ ```bash
8
+ npm create krispya
9
+ # or
10
+ pnpm create krispya
11
+ # or
12
+ yarn create krispya
13
+ ```
14
+
15
+ ## Templates
16
+
17
+ | Template | Description |
18
+ | ------------ | --------------------------------- |
19
+ | `vanilla` | Vanilla TypeScript (default) |
20
+ | `vanilla-js` | Vanilla JavaScript |
21
+ | `react` | React with TypeScript |
22
+ | `react-js` | React with JavaScript |
23
+ | `r3f` | React Three Fiber with TypeScript |
24
+ | `r3f-js` | React Three Fiber with JavaScript |
25
+
26
+ ## Project Types
27
+
28
+ - **Application** (default): Web app with Vite for dev/bundling
29
+ - **Library**: Publishable npm package with ESM/CJS output, proper exports, and peer dependencies
30
+
31
+ ## Tooling Options
32
+
33
+ | Category | Options | Default |
34
+ | --------- | ------------------------------------ | --------- |
35
+ | Linter | `oxlint`, `eslint`, `biome` | `oxlint` |
36
+ | Formatter | `oxfmt`, `prettier`, `biome` | `oxfmt` |
37
+ | Bundler | `unbuild`, `tsdown` (libraries only) | `unbuild` |
38
+ | Testing | `vitest` | always |
39
+
40
+ ## CLI Options
41
+
42
+ ```
43
+ create-krispya [name] [options]
44
+
45
+ Options:
46
+ --type <type> app | library (default: app)
47
+ --template <type> vanilla | react | r3f (+ -js variants)
48
+ --linter <type> eslint | oxlint | biome
49
+ --formatter <type> prettier | oxfmt | biome
50
+ --bundler <bundler> unbuild | tsdown (libraries only)
51
+ --package-manager <pm> npm | yarn | pnpm
52
+ --node-version <version> Node.js version (default: latest)
53
+ --pnpm-manage-versions Enable pnpm version management (default: true)
54
+ -y, --yes Skip prompts, use defaults
55
+ ```
56
+
57
+ ### R3F Integrations
58
+
59
+ For `r3f`/`r3f-js` templates:
60
+
61
+ ```
62
+ --drei @react-three/drei helpers
63
+ --handle @react-three/handle events
64
+ --leva leva controls
65
+ --postprocessing @react-three/postprocessing effects
66
+ --rapier @react-three/rapier physics
67
+ --xr @react-three/xr VR/AR
68
+ --uikit @react-three/uikit UI
69
+ --offscreen @react-three/offscreen rendering
70
+ --zustand zustand state
71
+ --koota koota ECS
72
+ --triplex Triplex dev environment
73
+ --viverse Viverse deployment
74
+ ```
75
+
76
+ ## Examples
77
+
78
+ ```bash
79
+ # Interactive mode
80
+ npm create krispya
81
+
82
+ # React app with defaults
83
+ npm create krispya my-app --template react -y
84
+
85
+ # R3F with integrations
86
+ npm create krispya my-3d-app --template r3f --drei --rapier --leva
87
+
88
+ # Library with tsdown
89
+ npm create krispya my-lib --type library --template react --bundler tsdown
90
+
91
+ # Custom tooling
92
+ npm create krispya my-app --linter eslint --formatter prettier
93
+ ```
94
+
95
+ ## Post-Creation
96
+
97
+ After scaffolding, you'll be prompted to open the project in your editor (Cursor, VS Code, or WebStorm).
package/dist/cli.cjs CHANGED
@@ -384,11 +384,13 @@ async function promptForOptions(name) {
384
384
  function openInEditor(editor, path) {
385
385
  return new Promise((resolve, reject) => {
386
386
  const isWindows = process.platform === "win32";
387
- const child = isWindows ? child_process.spawn(`${editor} "${path}"`, {
387
+ const reuseWindow = (editor === "cursor" || editor === "code") && process.env.TERM_PROGRAM === "vscode";
388
+ const args = reuseWindow ? ["-r", path] : [path];
389
+ const child = isWindows ? child_process.spawn(`${editor} ${reuseWindow ? "-r " : ""}"${path}"`, {
388
390
  detached: true,
389
391
  stdio: "ignore",
390
392
  shell: true
391
- }) : child_process.spawn(editor, [path], {
393
+ }) : child_process.spawn(editor, args, {
392
394
  detached: true,
393
395
  stdio: "ignore"
394
396
  });
package/dist/cli.mjs CHANGED
@@ -364,11 +364,13 @@ async function promptForOptions(name) {
364
364
  function openInEditor(editor, path) {
365
365
  return new Promise((resolve, reject) => {
366
366
  const isWindows = process.platform === "win32";
367
- const child = isWindows ? spawn(`${editor} "${path}"`, {
367
+ const reuseWindow = (editor === "cursor" || editor === "code") && process.env.TERM_PROGRAM === "vscode";
368
+ const args = reuseWindow ? ["-r", path] : [path];
369
+ const child = isWindows ? spawn(`${editor} ${reuseWindow ? "-r " : ""}"${path}"`, {
368
370
  detached: true,
369
371
  stdio: "ignore",
370
372
  shell: true
371
- }) : spawn(editor, [path], {
373
+ }) : spawn(editor, args, {
372
374
  detached: true,
373
375
  stdio: "ignore"
374
376
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-krispya",
3
- "version": "0.4.4",
3
+ "version": "0.4.7",
4
4
  "description": "🌹 CLI for creating web projects with (my) sensible defaults",
5
5
  "keywords": [
6
6
  "cli",
@@ -14,7 +14,8 @@
14
14
  "author": "Kris Baumgartner",
15
15
  "bin": "dist/cli.mjs",
16
16
  "files": [
17
- "dist"
17
+ "dist",
18
+ "README.md"
18
19
  ],
19
20
  "type": "module",
20
21
  "main": "dist/index.mjs",