create-stackit-app 0.0.0-stage → 0.1.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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +135 -2
  3. package/dist/stackit.js +19763 -0
  4. package/package.json +40 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Rahul Sain
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,136 @@
1
- # Temporary Holding Version
1
+ # stackit ⚡
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm version](https://img.shields.io/npm/v/create-stackit-app.svg)](https://www.npmjs.com/package/create-stackit-app)
4
+ [![license](https://img.shields.io/npm/l/create-stackit-app.svg)](https://www.npmjs.com/package/create-stackit-app)
5
+
6
+ Opinionated full-stack project scaffolder. Like `create-next-app`, but you pick the
7
+ whole stack — **MERN, PERN, React + Hono + Postgres, Go + Fiber** — and get a
8
+ best-practice monorepo (Vite + React frontend, layered API backend, Docker for the DB).
9
+
10
+ ## 🌐 Live demo & docs
11
+
12
+ **[stackitcli.vercel.app](https://stackitcli.vercel.app/)** — landing page, stack previews
13
+ and full documentation.
14
+
15
+ Published as [`create-stackit-app`](https://www.npmjs.com/package/create-stackit-app) —
16
+ no install needed:
17
+
18
+ ```bash
19
+ bunx create-stackit-app@latest create my-app
20
+ # or non-interactive:
21
+ bunx create-stackit-app@latest create my-app --stack mern --language typescript --runtime bun --pm bun -y
22
+ ```
23
+
24
+ Global install (`stackit` command everywhere):
25
+
26
+ ```bash
27
+ npm install -g create-stackit-app
28
+ stackit create my-app
29
+ ```
30
+
31
+ From source (this repo, run inside `cli/`):
32
+
33
+ ```bash
34
+ bun install
35
+ bun run src/index.ts create my-app
36
+ ```
37
+
38
+ ## Requirements
39
+
40
+ - [Bun](https://bun.sh) >= 1.2 (to run the CLI itself)
41
+ - Per stack, the CLI checks your machine and fails fast with a helpful hint:
42
+ - `mern` / `pern` / `hono-pg` → Node >= 20 and/or Bun >= 1.2
43
+ - `go-fiber` → Go >= 1.24 (+ Node >= 20 for the Vite frontend)
44
+
45
+ ## Running the CLI (run / develop)
46
+
47
+ ```bash
48
+ bun install # install CLI deps (first time only)
49
+ bun run src/index.ts --help # CLI help
50
+
51
+ # interactive scaffold
52
+ bun run src/index.ts create my-app
53
+
54
+ # example: MERN + Bun + TypeScript, no prompts
55
+ bun run src/index.ts create my-app --stack mern --language typescript --runtime bun --pm bun -y
56
+
57
+ # example: PERN + Node + JavaScript, skip install + git
58
+ bun run src/index.ts create shop-api --stack pern --language javascript --runtime node --pm npm -y --no-install --no-git
59
+ ```
60
+
61
+ ### `create` options
62
+
63
+ | Flag | Values | Default |
64
+ | ---- | ------ | ------- |
65
+ | `[project-name]` | `my-app` (lowercase, `-_`) | prompt |
66
+ | `--stack` | `mern` \| `pern` \| `hono-pg` \| `go-fiber` | prompt (`mern` with `-y`) |
67
+ | `--language` | `typescript` \| `javascript` (`go-fiber` → `go` auto) | prompt (`typescript` with `-y`) |
68
+ | `--runtime` | `node` \| `bun` (`go-fiber` → `go` auto) | prompt (stack default with `-y`) |
69
+ | `--pm` | `npm` \| `pnpm` \| `yarn` \| `bun` | prompt (`bun` if runtime is bun, else `npm`) |
70
+ | `-y, --yes` | skip all prompts | off |
71
+ | `--no-install` | skip dependency install | install |
72
+ | `--no-git` | skip `git init` | init |
73
+
74
+ ## Generated project
75
+
76
+ ```bash
77
+ cd my-app
78
+ cp .env.example server/.env # fill in DB URL etc.
79
+ docker compose up -d # starts MongoDB / PostgreSQL
80
+ bun run dev # runs client + server (or npm/pnpm/yarn run dev)
81
+ ```
82
+
83
+ | Service | URL |
84
+ | ------- | --- |
85
+ | Frontend | http://localhost:5173 |
86
+ | API | http://localhost:5000 |
87
+ | Health | http://localhost:5000/api/health |
88
+
89
+ ### Layout (JS stacks)
90
+
91
+ ```
92
+ my-app/
93
+ ├── client/ # Vite + React (proxies /api → :5000)
94
+ │ └── src/{App,main,lib/api}
95
+ ├── server/ # Express / Hono API
96
+ │ └── src/
97
+ │ ├── index.* # entrypoint (env → connect → listen)
98
+ │ ├── app.* # app factory (middleware + routes)
99
+ │ ├── config/ # env, db connection
100
+ │ ├── routes/ # health, users
101
+ │ ├── controllers/ # handlers (express) / routes carry logic (hono)
102
+ │ ├── models/ # mongoose schema / SQL DDL
103
+ │ ├── middlewares/ # errorHandler, notFound, zod validation
104
+ │ └── utils/ # asyncHandler, ApiError
105
+ ├── docker-compose.yml
106
+ └── .env.example
107
+ ```
108
+
109
+ ### Layout (go-fiber)
110
+
111
+ ```
112
+ my-app/
113
+ ├── client/ # same Vite + React frontend
114
+ └── server/ # Go + Fiber
115
+ ├── cmd/api/main.go
116
+ └── internal/{config,db,handlers,middleware,models,routes}
117
+ ```
118
+
119
+ `DATABASE_URL` unset → API runs with an in-memory store (demo mode);
120
+ set it (docker compose gives you Postgres) → real persistence via `pgx`.
121
+
122
+ ## Scripts (this repo)
123
+
124
+ ```bash
125
+ bun install # deps
126
+ bun run src/index.ts --help
127
+ bun test # 13 tests: semver, registry, scaffold file-maps
128
+ bunx tsc --noEmit # typecheck
129
+ bun run build # bun build → dist/stackit
130
+ ```
131
+
132
+ ## Tech
133
+
134
+ commander (CLI) · @clack/prompts (interactive UI) · zod (validation) ·
135
+ fs-extra (file writes) · yocto-spinner + picocolors (output). Templates are
136
+ plain TypeScript functions — no template engine, no network at scaffold time.