create-fs-app 1.1.10 → 2.0.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.
- package/README.md +340 -57
- package/dist/core/health-check.d.ts +15 -0
- package/dist/core/health-check.js +138 -0
- package/dist/core/health-check.js.map +1 -0
- package/dist/core/presets.d.ts +48 -0
- package/dist/core/presets.js +220 -0
- package/dist/core/presets.js.map +1 -0
- package/dist/core/registry-fetch.d.ts +20 -0
- package/dist/core/registry-fetch.js +121 -0
- package/dist/core/registry-fetch.js.map +1 -0
- package/dist/core/scaffold.d.ts +40 -0
- package/dist/core/scaffold.js +104 -0
- package/dist/core/scaffold.js.map +1 -0
- package/dist/core/template-cache.d.ts +38 -0
- package/dist/core/template-cache.js +233 -0
- package/dist/core/template-cache.js.map +1 -0
- package/dist/core/template-clone.d.ts +27 -0
- package/dist/core/template-clone.js +808 -0
- package/dist/core/template-clone.js.map +1 -0
- package/dist/core/template-list.d.ts +45 -0
- package/dist/core/template-list.js +191 -0
- package/dist/core/template-list.js.map +1 -0
- package/dist/core/template-registry.d.ts +78 -0
- package/dist/core/template-registry.js +238 -0
- package/dist/core/template-registry.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +964 -0
- package/dist/index.js.bak +872 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +102 -0
- package/dist/types/index.js +85 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/errors.d.ts +15 -0
- package/dist/utils/errors.js +50 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/logger.d.ts +37 -0
- package/dist/utils/logger.js +62 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/validation.d.ts +48 -0
- package/dist/utils/validation.js +100 -0
- package/dist/utils/validation.js.map +1 -0
- package/package.json +81 -35
- package/.github/workflows/npm-publish-github-packages.yml +0 -36
- package/SECURITY.md +0 -21
- package/assets/logo.png +0 -0
- package/assets/s1.png +0 -0
- package/create-fs-app.js +0 -181
package/README.md
CHANGED
|
@@ -1,57 +1,340 @@
|
|
|
1
|
-
|
|
2
|
-
<img src="./assets/logo.png"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
#
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
npx create-fs-app my-app
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="./assets/logo-no-bg.png" alt="create-fs-app" width="500"/>
|
|
3
|
+
|
|
4
|
+
**Stop configuring. Start building.**
|
|
5
|
+
|
|
6
|
+
Production-ready full-stack monorepo in 60 seconds.
|
|
7
|
+
|
|
8
|
+
[](https://www.npmjs.com/package/create-fs-app)
|
|
9
|
+
[](https://www.npmjs.com/package/create-fs-app)
|
|
10
|
+
[](https://opensource.org/licenses/ISC)
|
|
11
|
+
[](https://nodejs.org)
|
|
12
|
+
</div>
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Table of Contents
|
|
17
|
+
|
|
18
|
+
- [Quick Start](#quick-start)
|
|
19
|
+
- [Interactive Wizard](#interactive-wizard)
|
|
20
|
+
- [Stack Flags](#stack-flags)
|
|
21
|
+
- [Official Templates](#official-templates)
|
|
22
|
+
- [Contributed Templates](#contributed-templates)
|
|
23
|
+
- [All CLI Options](#all-cli-options)
|
|
24
|
+
- [Presets](#presets)
|
|
25
|
+
- [Commands Reference](#commands-reference)
|
|
26
|
+
- [Local Development](#local-development)
|
|
27
|
+
- [Requirements](#requirements)
|
|
28
|
+
- [Contributing](#contributing)
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Quick Start
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Interactive wizard — guides you through every choice
|
|
36
|
+
npx create-fs-app my-app
|
|
37
|
+
|
|
38
|
+
# Pick your stack and skip all prompts
|
|
39
|
+
npx create-fs-app my-app \
|
|
40
|
+
--frontend next.js \
|
|
41
|
+
--backend nest.js \
|
|
42
|
+
--database postgresql \
|
|
43
|
+
--orm prisma \
|
|
44
|
+
--yes
|
|
45
|
+
|
|
46
|
+
# Use a saved preset
|
|
47
|
+
npx create-fs-app my-app --preset saas-starter
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Interactive Wizard
|
|
53
|
+
|
|
54
|
+
Running `npx create-fs-app <name>` without stack flags launches a guided wizard:
|
|
55
|
+
|
|
56
|
+
| Step | Options |
|
|
57
|
+
|------|---------|
|
|
58
|
+
| Monorepo tool | Turborepo, Nx |
|
|
59
|
+
| Frontend | Next.js, React (Vite), Vue, Nuxt, Angular |
|
|
60
|
+
| Backend | NestJS, Express, Fastify (TS), Koa |
|
|
61
|
+
| Database | PostgreSQL, MongoDB, MySQL, SQLite |
|
|
62
|
+
| ORM / ODM | Prisma, TypeORM, Mongoose, Drizzle |
|
|
63
|
+
| Package manager | npm, yarn, pnpm |
|
|
64
|
+
| Styling | Tailwind CSS, CSS, SCSS, styled-components |
|
|
65
|
+
| API style | REST, GraphQL, both |
|
|
66
|
+
| Auth scaffolding | None, JWT |
|
|
67
|
+
| Extras | ESLint, Prettier, Docker, Turbopack, GitHub Actions CI |
|
|
68
|
+
|
|
69
|
+
After selection the CLI:
|
|
70
|
+
1. Fetches the best-matching official template from GitHub
|
|
71
|
+
2. Renames every placeholder to your project name
|
|
72
|
+
3. Initialises a git repository
|
|
73
|
+
4. Installs dependencies with your chosen package manager
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Stack Flags
|
|
78
|
+
|
|
79
|
+
Bypass the wizard by passing flags directly. Any flag you omit is prompted for (or uses the `--yes` default).
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
npx create-fs-app my-app \
|
|
83
|
+
--monorepo turborepo \
|
|
84
|
+
--frontend next.js \
|
|
85
|
+
--backend nest.js \
|
|
86
|
+
--database postgresql \
|
|
87
|
+
--orm prisma \
|
|
88
|
+
--styling tailwind \
|
|
89
|
+
--api-style rest \
|
|
90
|
+
--auth jwt \
|
|
91
|
+
--turbopack \
|
|
92
|
+
--ci \
|
|
93
|
+
--package-manager pnpm \
|
|
94
|
+
--yes
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Available values
|
|
98
|
+
|
|
99
|
+
| Flag | Values |
|
|
100
|
+
|------|--------|
|
|
101
|
+
| `--monorepo` | `turborepo`, `nx` |
|
|
102
|
+
| `--frontend` | `next.js`, `react`, `vue`, `nuxt`, `angular` |
|
|
103
|
+
| `--backend` | `nest.js`, `express`, `fastify-ts`, `koa` |
|
|
104
|
+
| `--database` | `postgresql`, `mongodb`, `mysql`, `sqlite` |
|
|
105
|
+
| `--orm` | `prisma`, `typeorm`, `mongoose`, `drizzle` |
|
|
106
|
+
| `--package-manager` | `npm`, `yarn`, `pnpm` |
|
|
107
|
+
| `--styling` | `tailwind`, `css`, `scss`, `styled-components` |
|
|
108
|
+
| `--api-style` | `rest`, `graphql`, `both` |
|
|
109
|
+
| `--auth` | `none`, `jwt` |
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## Official Templates
|
|
114
|
+
|
|
115
|
+
Official templates are built and maintained by the create-fs-app team. The wizard and stack flags select from this set automatically.
|
|
116
|
+
|
|
117
|
+
| Template | Stack |
|
|
118
|
+
|----------|-------|
|
|
119
|
+
| `turborepo-nextjs-nestjs-postgresql-prisma` | Next.js 16 + NestJS 11 + PostgreSQL 16 + Prisma 5 |
|
|
120
|
+
| `turborepo-nextjs-express-postgresql-prisma` | Next.js 15 + Express 4 + PostgreSQL 16 + Prisma 5 |
|
|
121
|
+
| `turborepo-nextjs-nestjs-mongodb-mongoose` | Next.js 16 + NestJS 11 + MongoDB 7 + Mongoose 8 |
|
|
122
|
+
| `turborepo-nextjs-express-mongodb-mongoose` | Next.js 15 + Express 4 + MongoDB 7 + Mongoose 8 |
|
|
123
|
+
| `turborepo-react-nestjs-postgresql-prisma` | React 19 (Vite) + NestJS 11 + PostgreSQL 16 + Prisma 5 |
|
|
124
|
+
| `turborepo-react-express-postgresql-prisma` | React 19 (Vite) + Express 4 + PostgreSQL 16 + Prisma 5 |
|
|
125
|
+
| `turborepo-react-nestjs-mongodb-mongoose` | React 19 (Vite) + NestJS 11 + MongoDB 7 + Mongoose 8 |
|
|
126
|
+
| `turborepo-react-express-mongodb-mongoose` | React 19 (Vite) + Express 4 + MongoDB 7 + Mongoose 8 |
|
|
127
|
+
|
|
128
|
+
Browse them:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
npx create-fs-app list
|
|
132
|
+
npx create-fs-app list graphql # keyword search
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
---
|
|
136
|
+
|
|
137
|
+
## Contributed Templates
|
|
138
|
+
|
|
139
|
+
Community-built variants extend the official stacks with additional tooling (GraphQL, tRPC, Redis, Sentry, etc.).
|
|
140
|
+
Each contributed template is identified by a permanent **UUID v4**.
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# Browse contributed templates — shows UUID and contributor
|
|
144
|
+
npx create-fs-app list --contributed
|
|
145
|
+
|
|
146
|
+
# Scaffold from a contributed template using its UUID
|
|
147
|
+
npx create-fs-app my-app --template bc75b4fb-3d42-4f6e-a8c1-0123456789ab
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
> **Why UUID?**
|
|
151
|
+
> Keys can be renamed or refactored; UUIDs are permanent. A UUID you copy today will always resolve to the same template.
|
|
152
|
+
|
|
153
|
+
To add your own template to the contributed registry, see the [templates repo contributing guide](https://github.com/Om-jannu/create-fs-app-templates/blob/master/CONTRIBUTING.md).
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## All CLI Options
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
npx create-fs-app <project-name> [options]
|
|
161
|
+
|
|
162
|
+
Stack selection
|
|
163
|
+
--monorepo <framework> turborepo | nx
|
|
164
|
+
--frontend <framework> next.js | react | vue | nuxt | angular
|
|
165
|
+
--backend <framework> nest.js | express | fastify-ts | koa
|
|
166
|
+
--database <db> postgresql | mongodb | mysql | sqlite
|
|
167
|
+
--orm <orm> prisma | typeorm | mongoose | drizzle
|
|
168
|
+
|
|
169
|
+
Customisation
|
|
170
|
+
--styling <style> tailwind | css | scss | styled-components
|
|
171
|
+
--api-style <style> rest | graphql | both (default: rest)
|
|
172
|
+
--auth <strategy> none | jwt (default: none)
|
|
173
|
+
--turbopack Enable Turbopack dev server (Next.js only)
|
|
174
|
+
--ci Add GitHub Actions CI workflow
|
|
175
|
+
--no-eslint Disable ESLint
|
|
176
|
+
--no-prettier Disable Prettier
|
|
177
|
+
--no-docker Skip Docker Compose
|
|
178
|
+
|
|
179
|
+
Template sources
|
|
180
|
+
--template <uuid> Use a contributed template by UUID v4
|
|
181
|
+
--template-url <url> Use any GitHub repo as a template source
|
|
182
|
+
--preset <name> Use a saved configuration preset
|
|
183
|
+
|
|
184
|
+
Behaviour
|
|
185
|
+
--package-manager <pm> npm | yarn | pnpm
|
|
186
|
+
--no-git Skip git initialization
|
|
187
|
+
--no-install Skip dependency installation
|
|
188
|
+
--no-cache Force fresh download, skip cache
|
|
189
|
+
-y, --yes Accept all defaults, skip prompts
|
|
190
|
+
|
|
191
|
+
Development
|
|
192
|
+
--local-templates <path> Use a local templates repo instead of GitHub
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Presets
|
|
198
|
+
|
|
199
|
+
Save a flag combination as a named preset and re-use it with a single word.
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
# Save a preset
|
|
203
|
+
npx create-fs-app preset save my-stack \
|
|
204
|
+
--description "NestJS + Next.js + PostgreSQL"
|
|
205
|
+
|
|
206
|
+
# List all presets (built-ins + yours)
|
|
207
|
+
npx create-fs-app preset list
|
|
208
|
+
|
|
209
|
+
# Use a preset
|
|
210
|
+
npx create-fs-app new-project --preset my-stack
|
|
211
|
+
|
|
212
|
+
# Overwrite a preset
|
|
213
|
+
npx create-fs-app preset save my-stack --force
|
|
214
|
+
|
|
215
|
+
# Delete a preset
|
|
216
|
+
npx create-fs-app preset delete my-stack
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
### Built-in presets (read-only)
|
|
220
|
+
|
|
221
|
+
| Name | Stack |
|
|
222
|
+
|------|-------|
|
|
223
|
+
| `saas-starter` | Next.js + NestJS + PostgreSQL + Prisma + JWT + Docker |
|
|
224
|
+
| `mern-stack` | React (Vite) + Express + MongoDB + Mongoose |
|
|
225
|
+
| `t3-inspired` | Next.js + NestJS + PostgreSQL + Prisma + GraphQL |
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## Commands Reference
|
|
230
|
+
|
|
231
|
+
### `list [search]`
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
npx create-fs-app list # official templates
|
|
235
|
+
npx create-fs-app list --contributed # community templates
|
|
236
|
+
npx create-fs-app list --all # both sections
|
|
237
|
+
npx create-fs-app list graphql # keyword search
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
### `info <template>`
|
|
241
|
+
|
|
242
|
+
Show full details for any template.
|
|
243
|
+
|
|
244
|
+
```bash
|
|
245
|
+
npx create-fs-app info turborepo-nextjs-nestjs-postgresql-prisma
|
|
246
|
+
npx create-fs-app info graphql
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### `preset <subcommand>`
|
|
250
|
+
|
|
251
|
+
```bash
|
|
252
|
+
npx create-fs-app preset list
|
|
253
|
+
npx create-fs-app preset save <name> [--description "..."] [--force]
|
|
254
|
+
npx create-fs-app preset delete <name>
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
### `health`
|
|
258
|
+
|
|
259
|
+
Verify your environment is ready.
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
npx create-fs-app health
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
Checks: **Node.js ≥ 18**, **Git**, **Docker** (binary + daemon), **npm**, **pnpm**, **yarn**.
|
|
266
|
+
|
|
267
|
+
### `cache <subcommand>`
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
npx create-fs-app cache stats # show cache size and template count
|
|
271
|
+
npx create-fs-app cache clear # wipe cached templates
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
Cache location: `~/.create-fs-app/`
|
|
275
|
+
|
|
276
|
+
---
|
|
277
|
+
|
|
278
|
+
## Local Development
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
# 1. Clone
|
|
282
|
+
git clone https://github.com/Om-jannu/create-fs-app.git
|
|
283
|
+
cd create-fs-app
|
|
284
|
+
|
|
285
|
+
# 2. Install
|
|
286
|
+
npm install
|
|
287
|
+
|
|
288
|
+
# 3. Build (TypeScript → dist/)
|
|
289
|
+
npm run build
|
|
290
|
+
|
|
291
|
+
# 4. Link globally
|
|
292
|
+
npm link
|
|
293
|
+
|
|
294
|
+
# 5. Test
|
|
295
|
+
create-fs-app my-test-app
|
|
296
|
+
|
|
297
|
+
# 6. Unlink when done
|
|
298
|
+
npm unlink -g create-fs-app
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Point at a local templates repo
|
|
302
|
+
|
|
303
|
+
```bash
|
|
304
|
+
git clone https://github.com/Om-jannu/create-fs-app-templates.git ../create-fs-app-templates
|
|
305
|
+
|
|
306
|
+
create-fs-app my-app \
|
|
307
|
+
--frontend next.js --backend nest.js --database postgresql --orm prisma \
|
|
308
|
+
--local-templates ../create-fs-app-templates \
|
|
309
|
+
--yes
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
This skips GitHub entirely and copies the template straight from your local clone.
|
|
313
|
+
|
|
314
|
+
---
|
|
315
|
+
|
|
316
|
+
## Requirements
|
|
317
|
+
|
|
318
|
+
| Tool | Minimum version |
|
|
319
|
+
|------|----------------|
|
|
320
|
+
| Node.js | **18.0.0** |
|
|
321
|
+
| npm | bundled with Node.js |
|
|
322
|
+
| Git | any recent |
|
|
323
|
+
| Docker | optional — used inside generated projects only |
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## Contributing
|
|
328
|
+
|
|
329
|
+
See **[CONTRIBUTING.md](./CONTRIBUTING.md)** for:
|
|
330
|
+
|
|
331
|
+
- Reporting bugs and requesting features
|
|
332
|
+
- Development environment setup
|
|
333
|
+
- Pull request process and code standards
|
|
334
|
+
- How to contribute a template to the community registry
|
|
335
|
+
|
|
336
|
+
---
|
|
337
|
+
|
|
338
|
+
## License
|
|
339
|
+
|
|
340
|
+
ISC © [Om-jannu](https://github.com/Om-jannu)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment Health Check
|
|
3
|
+
* Verifies that the required tools are installed and at the right version.
|
|
4
|
+
*/
|
|
5
|
+
export interface HealthCheckResult {
|
|
6
|
+
passed: boolean;
|
|
7
|
+
checks: Array<{
|
|
8
|
+
name: string;
|
|
9
|
+
passed: boolean;
|
|
10
|
+
message: string;
|
|
11
|
+
suggestion?: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
export declare function runHealthCheck(): Promise<HealthCheckResult>;
|
|
15
|
+
export declare function displayHealthCheckResults(result: HealthCheckResult): void;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Environment Health Check
|
|
3
|
+
* Verifies that the required tools are installed and at the right version.
|
|
4
|
+
*/
|
|
5
|
+
import { execa } from 'execa';
|
|
6
|
+
import chalk from 'chalk';
|
|
7
|
+
export async function runHealthCheck() {
|
|
8
|
+
const checks = [];
|
|
9
|
+
console.log(chalk.cyan.bold('\n🏥 Environment Health Check\n'));
|
|
10
|
+
checks.push(await checkNode());
|
|
11
|
+
checks.push(await checkGit());
|
|
12
|
+
checks.push(await checkDocker());
|
|
13
|
+
checks.push(await checkNpm());
|
|
14
|
+
checks.push(await checkPnpm());
|
|
15
|
+
checks.push(await checkYarn());
|
|
16
|
+
const passed = checks.every(c => c.passed);
|
|
17
|
+
return { passed, checks };
|
|
18
|
+
}
|
|
19
|
+
export function displayHealthCheckResults(result) {
|
|
20
|
+
console.log();
|
|
21
|
+
result.checks.forEach(check => {
|
|
22
|
+
const icon = check.passed ? chalk.green('✓') : chalk.red('✗');
|
|
23
|
+
console.log(`${icon} ${chalk.bold(check.name)}`);
|
|
24
|
+
console.log(chalk.gray(` ${check.message}`));
|
|
25
|
+
if (!check.passed && check.suggestion) {
|
|
26
|
+
console.log(chalk.yellow(` 💡 ${check.suggestion}`));
|
|
27
|
+
}
|
|
28
|
+
console.log();
|
|
29
|
+
});
|
|
30
|
+
const passedCount = result.checks.filter(c => c.passed).length;
|
|
31
|
+
const totalCount = result.checks.length;
|
|
32
|
+
console.log(chalk.bold(`Results: ${passedCount}/${totalCount} checks passed\n`));
|
|
33
|
+
if (result.passed) {
|
|
34
|
+
console.log(chalk.green.bold('✨ Environment is ready!\n'));
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
console.log(chalk.yellow.bold('⚠️ Some tools are missing. See suggestions above.\n'));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
// ── Individual checks ─────────────────────────────────────────────────────────
|
|
41
|
+
async function checkNode() {
|
|
42
|
+
try {
|
|
43
|
+
const result = await execa('node', ['--version']);
|
|
44
|
+
const raw = result.stdout.trim(); // e.g. "v20.11.0"
|
|
45
|
+
const [major] = raw.replace('v', '').split('.').map(Number);
|
|
46
|
+
const ok = major >= 18;
|
|
47
|
+
return {
|
|
48
|
+
name: 'Node.js',
|
|
49
|
+
passed: ok,
|
|
50
|
+
message: `${raw} detected${ok ? '' : ' (v18+ required)'}`,
|
|
51
|
+
suggestion: ok ? undefined : 'Download from https://nodejs.org (LTS recommended)',
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
return {
|
|
56
|
+
name: 'Node.js',
|
|
57
|
+
passed: false,
|
|
58
|
+
message: 'Not found in PATH',
|
|
59
|
+
suggestion: 'Download from https://nodejs.org',
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
async function checkGit() {
|
|
64
|
+
try {
|
|
65
|
+
const result = await execa('git', ['--version']);
|
|
66
|
+
return {
|
|
67
|
+
name: 'Git',
|
|
68
|
+
passed: true,
|
|
69
|
+
message: result.stdout.trim(),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return {
|
|
74
|
+
name: 'Git',
|
|
75
|
+
passed: false,
|
|
76
|
+
message: 'Not found in PATH',
|
|
77
|
+
suggestion: 'Install from https://git-scm.com/downloads',
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
async function checkDocker() {
|
|
82
|
+
try {
|
|
83
|
+
const result = await execa('docker', ['--version']);
|
|
84
|
+
// Check if daemon is running
|
|
85
|
+
try {
|
|
86
|
+
await execa('docker', ['info'], { timeout: 4000 });
|
|
87
|
+
return {
|
|
88
|
+
name: 'Docker',
|
|
89
|
+
passed: true,
|
|
90
|
+
message: result.stdout.trim() + ' — daemon running',
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return {
|
|
95
|
+
name: 'Docker',
|
|
96
|
+
passed: false,
|
|
97
|
+
message: result.stdout.trim() + ' — daemon not running',
|
|
98
|
+
suggestion: 'Start Docker Desktop or run: sudo systemctl start docker',
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return {
|
|
104
|
+
name: 'Docker',
|
|
105
|
+
passed: false,
|
|
106
|
+
message: 'Not found in PATH',
|
|
107
|
+
suggestion: 'Install from https://docs.docker.com/get-docker/',
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
async function checkNpm() {
|
|
112
|
+
try {
|
|
113
|
+
const result = await execa('npm', ['--version']);
|
|
114
|
+
return { name: 'npm', passed: true, message: `v${result.stdout.trim()}` };
|
|
115
|
+
}
|
|
116
|
+
catch {
|
|
117
|
+
return { name: 'npm', passed: false, message: 'Not found in PATH', suggestion: 'Comes bundled with Node.js' };
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function checkPnpm() {
|
|
121
|
+
try {
|
|
122
|
+
const result = await execa('pnpm', ['--version']);
|
|
123
|
+
return { name: 'pnpm', passed: true, message: `v${result.stdout.trim()}` };
|
|
124
|
+
}
|
|
125
|
+
catch {
|
|
126
|
+
return { name: 'pnpm', passed: false, message: 'Not installed', suggestion: 'npm install -g pnpm' };
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
async function checkYarn() {
|
|
130
|
+
try {
|
|
131
|
+
const result = await execa('yarn', ['--version']);
|
|
132
|
+
return { name: 'Yarn', passed: true, message: `v${result.stdout.trim()}` };
|
|
133
|
+
}
|
|
134
|
+
catch {
|
|
135
|
+
return { name: 'Yarn', passed: false, message: 'Not installed', suggestion: 'npm install -g yarn' };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
//# sourceMappingURL=health-check.js.map
|
|
@@ -0,0 +1 @@
|
|
|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M,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACtG,CAAC;AACH,CAAC;AAED,KAAK,UAAU,SAAS;IACtB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;QAClD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,EAAE,CAAC;IAC7E,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACtG,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Presets System
|
|
3
|
+
* Save and load favorite stack configurations
|
|
4
|
+
*/
|
|
5
|
+
import { ProjectConfig } from '../types/index.js';
|
|
6
|
+
export interface Preset {
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
config: Omit<ProjectConfig, 'name'>;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
lastUsed?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Save a preset
|
|
15
|
+
*/
|
|
16
|
+
/** Returns true if the name collides with a built-in preset (case-insensitive). */
|
|
17
|
+
export declare function isBuiltinPresetName(name: string): boolean;
|
|
18
|
+
/** Returns true if a user-saved preset with this name already exists. */
|
|
19
|
+
export declare function userPresetExists(name: string): Promise<boolean>;
|
|
20
|
+
export declare function savePreset(name: string, config: ProjectConfig, description?: string): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Load a preset
|
|
23
|
+
*/
|
|
24
|
+
export declare function loadPreset(name: string): Promise<Preset | null>;
|
|
25
|
+
/**
|
|
26
|
+
* List all presets
|
|
27
|
+
*/
|
|
28
|
+
export declare function listPresets(): Promise<Preset[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Delete a preset
|
|
31
|
+
*/
|
|
32
|
+
export declare function deletePreset(name: string): Promise<boolean>;
|
|
33
|
+
/**
|
|
34
|
+
* Check if preset exists
|
|
35
|
+
*/
|
|
36
|
+
export declare function hasPreset(name: string): Promise<boolean>;
|
|
37
|
+
/**
|
|
38
|
+
* Get preset configuration merged with project name
|
|
39
|
+
*/
|
|
40
|
+
export declare function getPresetConfig(presetName: string, projectName: string): Promise<ProjectConfig | null>;
|
|
41
|
+
/**
|
|
42
|
+
* Built-in presets
|
|
43
|
+
*/
|
|
44
|
+
export declare const BUILTIN_PRESETS: Record<string, Omit<Preset, 'createdAt'>>;
|
|
45
|
+
/**
|
|
46
|
+
* Get built-in preset
|
|
47
|
+
*/
|
|
48
|
+
export declare function getBuiltinPreset(name: string): Preset | null;
|