create-fs-app 3.0.0 → 3.2.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 +40 -30
- package/dist/cli/output.js +3 -2
- package/dist/cli/program.js +3 -1
- package/dist/cli/resolve-config.js +2 -1
- package/dist/cli/ui/layer-log.js +6 -2
- package/dist/cli/wizard.js +9 -3
- package/dist/core/auth/jwt.js +2 -2
- package/dist/core/health-check.js +7 -3
- package/dist/core/registry.fallback.json +314 -72
- package/dist/core/scaffold.js +4 -3
- package/dist/core/template-clone.js +16 -5
- package/dist/core/template-registry.js +23 -0
- package/dist/core/welcome.js +260 -0
- package/dist/index.js +2 -2
- package/dist/types/index.js +1 -0
- package/package.json +24 -12
- package/welcome/dist/OFL-BarlowCondensed.txt +93 -0
- package/welcome/dist/cfa-welcome-display.woff2 +0 -0
- package/welcome/dist/cfa-welcome.js +114 -0
package/README.md
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<img src="
|
|
2
|
+
<img src="https://raw.githubusercontent.com/Om-jannu/create-fs-app/master/assets/banner.png" alt="create-fs-app: the triangle logo, the wordmark and the tagline "Stop configuring. Start building.", beside a hatched column of the five project layers" width="1200"/>
|
|
3
3
|
|
|
4
4
|
**Stop configuring. Start building.**
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
A frontend, a backend and a database, wired together from one command.
|
|
7
7
|
|
|
8
8
|
[](https://www.npmjs.com/package/create-fs-app)
|
|
9
9
|
[](https://www.npmjs.com/package/create-fs-app)
|
|
10
10
|
[](https://opensource.org/licenses/ISC)
|
|
11
|
-
[](https://nodejs.org)
|
|
12
|
+
|
|
13
|
+
<img src="https://raw.githubusercontent.com/Om-jannu/create-fs-app/master/assets/command-run.png" alt="create-fs-app in a terminal: the success screen with the project ready, the layer log of apps and packages with versions and ports, and the next steps" width="800"/>
|
|
14
|
+
|
|
15
|
+
<!-- Maintainer: to play the video inline on GitHub, edit README.md on github.com, drag assets/create-fs-app.mp4 into the editor and replace the link below with the user-attachments URL that GitHub inserts. -->
|
|
16
|
+
▶ [Watch the launch video (36 s)](https://github.com/Om-jannu/create-fs-app/blob/master/assets/create-fs-app.mp4)
|
|
12
17
|
</div>
|
|
13
18
|
|
|
14
19
|
---
|
|
@@ -55,6 +60,8 @@ npx create-fs-app@latest my-app --preset saas-starter
|
|
|
55
60
|
|
|
56
61
|
Use `npx create-fs-app@latest` to always get the newest CLI; it does not check for updates itself.
|
|
57
62
|
|
|
63
|
+
> **Windows:** the commands in this README are written for a POSIX shell (bash, zsh, Git Bash, WSL). In PowerShell, put each command on one line (or end a line with a backtick instead of `\`) and use `curl.exe` instead of `curl`.
|
|
64
|
+
|
|
58
65
|
---
|
|
59
66
|
|
|
60
67
|
## Interactive Wizard
|
|
@@ -80,11 +87,11 @@ Each choice has a short hint next to it. Stack hints come from the template regi
|
|
|
80
87
|
|
|
81
88
|
The wizard ends with a **Review** step: the layer log of the project (each app and package, its framework version and port) plus your extras, auth and install choice. Then pick **Create project**, **Change an answer** (choose the answer to change; later stack answers that no longer fit are asked again) or **Cancel**. Ctrl+C prints `Cancelled` and exits without writing anything.
|
|
82
89
|
|
|
83
|
-
```
|
|
84
|
-
demo Turborepo · npm · node
|
|
90
|
+
```text
|
|
91
|
+
demo Turborepo · npm · node ^20.19.0 || ^22.12.0 || >=24.0.0
|
|
85
92
|
├─ apps/frontend Next.js 16 :3000 App Router · Tailwind CSS 4
|
|
86
93
|
├─ packages/* eslint-config · typescript-config
|
|
87
|
-
├─ apps/backend NestJS
|
|
94
|
+
├─ apps/backend NestJS 12 :3001 Swagger · rate limit
|
|
88
95
|
├─ apps/backend/prisma Prisma 7 schema · migrations
|
|
89
96
|
└─ database PostgreSQL 16 :5432 docker compose
|
|
90
97
|
```
|
|
@@ -138,7 +145,7 @@ You do not need to pass a field that has only one possible value: `--frontend vu
|
|
|
138
145
|
- **With `--yes`:** missing values get defaults (Next.js, NestJS, PostgreSQL, Prisma when available, otherwise the first value that fits).
|
|
139
146
|
- **Without a terminal (CI, scripts, piped input) and without `--yes`:** the CLI exits with code 1, lists the missing flags and their values, and suggests the `--yes` defaults:
|
|
140
147
|
|
|
141
|
-
```
|
|
148
|
+
```text
|
|
142
149
|
✗ Missing required options: --backend, --database, --orm
|
|
143
150
|
No terminal to ask in.
|
|
144
151
|
--backend nest.js, express, hono, fastify
|
|
@@ -149,7 +156,7 @@ You do not need to pass a field that has only one possible value: `--frontend vu
|
|
|
149
156
|
|
|
150
157
|
- **A value without a template** exits with code 1 and names the values that fit:
|
|
151
158
|
|
|
152
|
-
```
|
|
159
|
+
```text
|
|
153
160
|
✗ No template for Vue + NestJS
|
|
154
161
|
Vue works with: express
|
|
155
162
|
Try: --backend express
|
|
@@ -161,25 +168,27 @@ The CLI never prompts when stdin or stdout is not a terminal, or when the `CI` e
|
|
|
161
168
|
|
|
162
169
|
## Official Templates
|
|
163
170
|
|
|
164
|
-
Official templates live in [`templates/`](
|
|
171
|
+
Official templates live in [`templates/`](https://github.com/Om-jannu/create-fs-app/tree/master/templates) of this repository and are built and tested in CI on Node 20, 22 and 24. Every template is a Turborepo with `apps/frontend`, `apps/backend` and shared `packages/{eslint-config,typescript-config}`, written in strict TypeScript with Tailwind CSS v4.
|
|
165
172
|
|
|
166
173
|
| Template | Stack |
|
|
167
174
|
|----------|-------|
|
|
168
|
-
| `turborepo-nextjs-nestjs-postgresql-prisma` | Next.js 16 + NestJS
|
|
169
|
-
| `turborepo-nextjs-nestjs-mongodb-mongoose` | Next.js 16 + NestJS
|
|
170
|
-
| `turborepo-nextjs-express-postgresql-prisma` | Next.js 16 + Express
|
|
171
|
-
| `turborepo-nextjs-express-mongodb-mongoose` | Next.js 16 + Express
|
|
172
|
-
| `turborepo-nextjs-express-sqlite-drizzle` | Next.js 16 + Express
|
|
175
|
+
| `turborepo-nextjs-nestjs-postgresql-prisma` | Next.js 16 + NestJS 12 + PostgreSQL 16 + Prisma 7 |
|
|
176
|
+
| `turborepo-nextjs-nestjs-mongodb-mongoose` | Next.js 16 + NestJS 12 + MongoDB 7 + Mongoose 9 |
|
|
177
|
+
| `turborepo-nextjs-express-postgresql-prisma` | Next.js 16 + Express 5 + PostgreSQL 16 + Prisma 7 |
|
|
178
|
+
| `turborepo-nextjs-express-mongodb-mongoose` | Next.js 16 + Express 5 + MongoDB 7 + Mongoose 9 |
|
|
179
|
+
| `turborepo-nextjs-express-sqlite-drizzle` | Next.js 16 + Express 5 + SQLite (libSQL) + Drizzle (no Docker or database setup) |
|
|
173
180
|
| `turborepo-nextjs-hono-postgresql-drizzle` | Next.js 16 + Hono 4 + PostgreSQL 16 + Drizzle |
|
|
174
181
|
| `turborepo-nextjs-fastify-postgresql-prisma` | Next.js 16 + Fastify 5 + PostgreSQL 16 + Prisma 7 |
|
|
175
|
-
| `turborepo-react-nestjs-postgresql-prisma` | React 19 (Vite) + NestJS
|
|
176
|
-
| `turborepo-react-nestjs-mongodb-mongoose` | React 19 (Vite) + NestJS
|
|
177
|
-
| `turborepo-react-express-postgresql-prisma` | React 19 (Vite) + Express
|
|
178
|
-
| `turborepo-react-express-mongodb-mongoose` | React 19 (Vite) + Express
|
|
179
|
-
| `turborepo-vue-express-postgresql-prisma` | Vue 3 (Vite) + Express
|
|
182
|
+
| `turborepo-react-nestjs-postgresql-prisma` | React 19 (Vite) + NestJS 12 + PostgreSQL 16 + Prisma 7 |
|
|
183
|
+
| `turborepo-react-nestjs-mongodb-mongoose` | React 19 (Vite) + NestJS 12 + MongoDB 7 + Mongoose 9 |
|
|
184
|
+
| `turborepo-react-express-postgresql-prisma` | React 19 (Vite) + Express 5 + PostgreSQL 16 + Prisma 7 |
|
|
185
|
+
| `turborepo-react-express-mongodb-mongoose` | React 19 (Vite) + Express 5 + MongoDB 7 + Mongoose 9 |
|
|
186
|
+
| `turborepo-vue-express-postgresql-prisma` | Vue 3 (Vite) + Express 5 + PostgreSQL 16 + Prisma 7 |
|
|
180
187
|
|
|
181
188
|
PostgreSQL and MongoDB templates include a `docker-compose.yml` for the database and a Dockerfile for each app (`apps/frontend`, `apps/backend`) that builds from the project root after you install dependencies (the image installs from your npm, pnpm or yarn lockfile). The SQLite template stores data in `apps/backend/dev.db` and applies its migrations on startup, so `npm run dev` works right away.
|
|
182
189
|
|
|
190
|
+
Every generated project includes Vitest tests for the frontend and the backend that need no running database; run them with `npm run test` (Turborepo runs `test` in each app).
|
|
191
|
+
|
|
183
192
|
```bash
|
|
184
193
|
npx create-fs-app@latest list # all official templates
|
|
185
194
|
npx create-fs-app@latest list prisma # keyword search
|
|
@@ -221,7 +230,7 @@ npx create-fs-app@latest list --contributed # shows UUID and contr
|
|
|
221
230
|
npx create-fs-app@latest my-app --template <uuid> # scaffold one
|
|
222
231
|
```
|
|
223
232
|
|
|
224
|
-
To add a template, see [templates/CONTRIBUTING.md](
|
|
233
|
+
To add a template, see [templates/CONTRIBUTING.md](https://github.com/Om-jannu/create-fs-app/blob/master/templates/CONTRIBUTING.md).
|
|
225
234
|
|
|
226
235
|
### Any GitHub repository
|
|
227
236
|
|
|
@@ -232,13 +241,13 @@ npx create-fs-app@latest my-app --template-url https://github.com/owner/repo/tre
|
|
|
232
241
|
|
|
233
242
|
The CLI downloads the repository as a tarball (no git needed). A URL without `/tree/<branch>` uses the repository's default branch. For custom templates the CLI only sets the root package name and `packageManager`, replaces `{{PROJECT_NAME}}`, applies the pnpm workspace settings for `--package-manager pnpm`, and adds CI with `--ci`. `--auth jwt`, `--no-eslint`, `--no-prettier` and `--no-docker` are not applied to custom templates (the CLI warns).
|
|
234
243
|
|
|
235
|
-
> create-fs-app 2.x reads its templates from the old `create-fs-app-templates` repository. 3.x reads them from [`templates/`](
|
|
244
|
+
> create-fs-app 2.x reads its templates from the old `create-fs-app-templates` repository. 3.x reads them from [`templates/`](https://github.com/Om-jannu/create-fs-app/tree/master/templates) of this repository.
|
|
236
245
|
|
|
237
246
|
---
|
|
238
247
|
|
|
239
248
|
## All CLI Options
|
|
240
249
|
|
|
241
|
-
```
|
|
250
|
+
```text
|
|
242
251
|
npx create-fs-app@latest [name] [options]
|
|
243
252
|
|
|
244
253
|
Template source
|
|
@@ -259,6 +268,7 @@ Project options
|
|
|
259
268
|
--eslint / --no-eslint Keep (default) or remove ESLint configs and lint scripts
|
|
260
269
|
--prettier / --no-prettier Keep (default) or remove Prettier and the format script
|
|
261
270
|
--docker / --no-docker Keep (default) or remove Docker files
|
|
271
|
+
--welcome / --no-welcome Welcome start page with live checks (default) or the template's plain page
|
|
262
272
|
--ci / --no-ci Add a GitHub Actions CI workflow (default: no)
|
|
263
273
|
--auth <strategy> none | jwt (jwt: nest.js, express)
|
|
264
274
|
|
|
@@ -278,7 +288,7 @@ Behavior
|
|
|
278
288
|
|
|
279
289
|
When one of its checks fails (an unavailable option, an invalid name, a missing template, a failed download), the CLI prints what failed, why, and what to try, and exits with code 1 (set `DEBUG=1` for the stack trace):
|
|
280
290
|
|
|
281
|
-
```
|
|
291
|
+
```text
|
|
282
292
|
✗ --auth jwt is not available for hono
|
|
283
293
|
JWT auth works with: nest.js, express
|
|
284
294
|
Try: --auth none
|
|
@@ -363,7 +373,7 @@ npx create-fs-app@latest preset delete <name>
|
|
|
363
373
|
npx create-fs-app@latest health
|
|
364
374
|
```
|
|
365
375
|
|
|
366
|
-
Required: **Node.js
|
|
376
|
+
Required: **Node.js 20.19+, 22.12+ or 24+** and **npm**. Optional: **git** (only needed for `git init`), **Docker** (binary and daemon), **pnpm**, **yarn**. Exits with code 1 only when a required tool is missing.
|
|
367
377
|
|
|
368
378
|
### `cache <subcommand>`
|
|
369
379
|
|
|
@@ -415,7 +425,7 @@ create-fs-app my-app \
|
|
|
415
425
|
|
|
416
426
|
| Tool | Version |
|
|
417
427
|
|------|---------|
|
|
418
|
-
| Node.js | **20.19.
|
|
428
|
+
| Node.js | **20.19+**, **22.12+** or **24+** (Node.js 21 and 23 are not supported) |
|
|
419
429
|
| npm, pnpm or yarn | npm comes with Node.js |
|
|
420
430
|
| git | optional, only for `git init` in the new project |
|
|
421
431
|
| Docker | optional, runs the database of the generated project and builds its app images |
|
|
@@ -424,21 +434,21 @@ create-fs-app my-app \
|
|
|
424
434
|
|
|
425
435
|
## Contributing
|
|
426
436
|
|
|
427
|
-
See **[CONTRIBUTING.md](
|
|
437
|
+
See **[CONTRIBUTING.md](https://github.com/Om-jannu/create-fs-app/blob/master/CONTRIBUTING.md)** for:
|
|
428
438
|
|
|
429
439
|
- Reporting bugs and requesting features
|
|
430
440
|
- Development environment setup, tests and the template e2e script
|
|
431
441
|
- Pull request process and code standards
|
|
432
442
|
- How to add a template
|
|
433
443
|
|
|
434
|
-
Please also read our **[Code of Conduct](
|
|
444
|
+
Please also read our **[Code of Conduct](https://github.com/Om-jannu/create-fs-app/blob/master/CODE_OF_CONDUCT.md)**.
|
|
435
445
|
|
|
436
|
-
Found a security issue? See **[SECURITY.md](
|
|
446
|
+
Found a security issue? See **[SECURITY.md](https://github.com/Om-jannu/create-fs-app/blob/master/SECURITY.md)** and please don't open a public issue for vulnerabilities.
|
|
437
447
|
|
|
438
|
-
See **[CHANGELOG.md](
|
|
448
|
+
See **[CHANGELOG.md](https://github.com/Om-jannu/create-fs-app/blob/master/CHANGELOG.md)** for release history.
|
|
439
449
|
|
|
440
450
|
---
|
|
441
451
|
|
|
442
452
|
## License
|
|
443
453
|
|
|
444
|
-
ISC © [Om-jannu](https://github.com/Om-jannu) — see **[LICENSE](
|
|
454
|
+
ISC © [Om-jannu](https://github.com/Om-jannu) — see **[LICENSE](https://github.com/Om-jannu/create-fs-app/blob/master/LICENSE)**.
|
package/dist/cli/output.js
CHANGED
|
@@ -43,6 +43,7 @@ export function describeExtras(config) {
|
|
|
43
43
|
config.eslint && 'ESLint',
|
|
44
44
|
config.prettier && 'Prettier',
|
|
45
45
|
config.docker && 'Docker',
|
|
46
|
+
config.welcome && 'welcome page',
|
|
46
47
|
config.ci && 'GitHub Actions CI',
|
|
47
48
|
config.git && 'git init',
|
|
48
49
|
].filter((v) => Boolean(v));
|
|
@@ -133,7 +134,7 @@ function sourceDir(plan) {
|
|
|
133
134
|
/** The --dry-run screen. Reads the source directory (local or cache) but writes nothing. */
|
|
134
135
|
export function renderDryRun(plan, theme, width = 80) {
|
|
135
136
|
const { config, template } = plan;
|
|
136
|
-
const { added, removed } = plannedFileChanges(config, plan.kind);
|
|
137
|
+
const { added, removed } = plannedFileChanges(config, plan.kind, template);
|
|
137
138
|
const out = [
|
|
138
139
|
`${theme.bold('Dry run')} ${plan.templateLabel} ${theme.dim(`(${plan.kind})`)}`,
|
|
139
140
|
'',
|
|
@@ -170,7 +171,7 @@ export function renderDryRun(plan, theme, width = 80) {
|
|
|
170
171
|
}
|
|
171
172
|
}
|
|
172
173
|
out.push('', theme.bold('Customizations'));
|
|
173
|
-
for (const action of describeCustomizations(config, plan.kind)) {
|
|
174
|
+
for (const action of describeCustomizations(config, plan.kind, template)) {
|
|
174
175
|
out.push(...wrapText(action, width - 4).map((l, i) => `${i ? ' ' : ' - '}${l}`));
|
|
175
176
|
}
|
|
176
177
|
const install = config.install
|
package/dist/cli/program.js
CHANGED
|
@@ -47,6 +47,8 @@ function addStackOptions(cmd) {
|
|
|
47
47
|
.addOption(opt('--no-prettier', 'Remove Prettier and the format script', 'Output'))
|
|
48
48
|
.addOption(opt('--docker', 'Keep Docker files (default)', 'Output'))
|
|
49
49
|
.addOption(opt('--no-docker', 'Remove Docker files', 'Output'))
|
|
50
|
+
.addOption(opt('--welcome', 'Welcome start page with live checks (default)', 'Output'))
|
|
51
|
+
.addOption(opt('--no-welcome', "Keep the template's plain start page", 'Output'))
|
|
50
52
|
.addOption(opt('--ci', 'Add a GitHub Actions CI workflow', 'Output'))
|
|
51
53
|
.addOption(opt('--no-ci', 'Skip GitHub Actions CI (default)', 'Output'));
|
|
52
54
|
}
|
|
@@ -299,7 +301,7 @@ export function buildProgram(options = {}) {
|
|
|
299
301
|
stack: stack,
|
|
300
302
|
packageManager: parsePackageManager(cmdOptions.packageManager),
|
|
301
303
|
eslint: cmdOptions.eslint, prettier: cmdOptions.prettier, docker: cmdOptions.docker,
|
|
302
|
-
ci: cmdOptions.ci, auth,
|
|
304
|
+
ci: cmdOptions.ci, welcome: cmdOptions.welcome, auth,
|
|
303
305
|
});
|
|
304
306
|
await savePreset(presetName, config, cmdOptions.description);
|
|
305
307
|
console.log(theme.dim(` ${describeStack(stack)} ${theme.glyphs.dot} ${config.packageManager}`));
|
|
@@ -176,6 +176,7 @@ export async function resolveCreate(name, flags, ctx) {
|
|
|
176
176
|
prettier: flags.prettier ?? base.prettier,
|
|
177
177
|
docker: flags.docker ?? base.docker,
|
|
178
178
|
ci: flags.ci ?? base.ci,
|
|
179
|
+
welcome: flags.welcome ?? base.welcome,
|
|
179
180
|
auth: explicitAuth ?? base.auth,
|
|
180
181
|
git: ctx.gitGiven ? flags.git : base.git,
|
|
181
182
|
install: ctx.installGiven ? flags.install : base.install,
|
|
@@ -221,7 +222,7 @@ export async function resolveCreate(name, flags, ctx) {
|
|
|
221
222
|
}
|
|
222
223
|
const template = createCustomTemplate(parsed.parsed.repoUrl, parsed.parsed.branch, parsed.parsed.subfolder);
|
|
223
224
|
const config = ProjectConfigSchema.parse({
|
|
224
|
-
...given, name: requireName(), stack: undefined, auth: 'none', eslint: true, prettier: true, docker: true,
|
|
225
|
+
...given, name: requireName(), stack: undefined, auth: 'none', eslint: true, prettier: true, docker: true, welcome: false,
|
|
225
226
|
});
|
|
226
227
|
return { kind: 'custom', template, config };
|
|
227
228
|
}
|
package/dist/cli/ui/layer-log.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The layer log: where each layer of a template lives and what it runs.
|
|
3
3
|
*
|
|
4
|
-
* <title> <monorepo> · <pm> · node ≥<node>
|
|
4
|
+
* <title> <monorepo> · <pm> · node ≥<node> (facts on a second line if too wide)
|
|
5
5
|
* ├─ <frontend path> <name> <version> :<port> <notes · …>
|
|
6
6
|
* ├─ packages/* <notes · …>
|
|
7
7
|
* ├─ <backend path> <name> <version> :<port> <notes · …>
|
|
@@ -76,9 +76,13 @@ export function renderLayerLog(input, theme, width = 80) {
|
|
|
76
76
|
template.node ? `node ${nodeRange(template.node, glyphs.ge)}` : undefined,
|
|
77
77
|
].filter((v) => Boolean(v));
|
|
78
78
|
const headerPlain = ` ${input.title}${facts.length ? ` ${facts.join(sep)}` : ''}`;
|
|
79
|
+
// Too wide for one line (long title or Node range): the facts go on their own line
|
|
79
80
|
const header = visibleWidth(headerPlain) <= width
|
|
80
81
|
? ` ${theme.bold(input.title)}${facts.length ? ` ${theme.dim(facts.join(sep))}` : ''}`
|
|
81
|
-
:
|
|
82
|
+
: [
|
|
83
|
+
` ${theme.bold(truncate(input.title, Math.max(1, width - 2), glyphs.ellipsis))}`,
|
|
84
|
+
...(facts.length ? [` ${theme.dim(truncate(facts.join(sep), Math.max(1, width - 2), glyphs.ellipsis))}`] : []),
|
|
85
|
+
].join('\n');
|
|
82
86
|
const rows = layerRows(template, { docker: input.docker, auth: input.auth });
|
|
83
87
|
const columns = rows.filter(r => !r.span);
|
|
84
88
|
const pathWidth = Math.max(...rows.map(r => visibleWidth(r.path)));
|
package/dist/cli/wizard.js
CHANGED
|
@@ -15,6 +15,7 @@ import * as p from '@clack/prompts';
|
|
|
15
15
|
import { PACKAGE_MANAGERS, ProjectConfigSchema, } from '../types/index.js';
|
|
16
16
|
import { FIELD_LABELS, STACK_FIELDS, availableOptions, autoPick, findTemplate, labelFor, } from '../core/stack.js';
|
|
17
17
|
import { AUTH_SUPPORT, supportsAuth } from '../core/auth/jwt.js';
|
|
18
|
+
import { supportsWelcome } from '../core/welcome.js';
|
|
18
19
|
import { validateProjectName } from '../utils/validation.js';
|
|
19
20
|
import { defaultFor } from './resolve-config.js';
|
|
20
21
|
import { describeExtras, rows, yesNo } from './output.js';
|
|
@@ -38,6 +39,7 @@ const EXTRA_LABELS = {
|
|
|
38
39
|
eslint: 'ESLint',
|
|
39
40
|
prettier: 'Prettier',
|
|
40
41
|
docker: 'Docker',
|
|
42
|
+
welcome: 'Welcome page',
|
|
41
43
|
ci: 'GitHub Actions CI',
|
|
42
44
|
git: 'Initialize git',
|
|
43
45
|
};
|
|
@@ -45,6 +47,7 @@ const EXTRA_HINTS = {
|
|
|
45
47
|
eslint: 'lint scripts + configs',
|
|
46
48
|
prettier: 'format script',
|
|
47
49
|
docker: 'database compose file + app Dockerfiles',
|
|
50
|
+
welcome: 'start page that checks frontend, backend and database',
|
|
48
51
|
ci: '.github/workflows/ci.yml',
|
|
49
52
|
git: 'git init + first commit',
|
|
50
53
|
};
|
|
@@ -117,8 +120,9 @@ function templateFor(templates, stack) {
|
|
|
117
120
|
return template;
|
|
118
121
|
}
|
|
119
122
|
function extrasFor(template) {
|
|
120
|
-
return ['eslint', 'prettier', 'docker', 'ci', 'git']
|
|
121
|
-
.filter(e => e !== 'docker' || template.supports.docker)
|
|
123
|
+
return ['eslint', 'prettier', 'docker', 'welcome', 'ci', 'git']
|
|
124
|
+
.filter(e => e !== 'docker' || template.supports.docker)
|
|
125
|
+
.filter(e => e !== 'welcome' || supportsWelcome(template));
|
|
122
126
|
}
|
|
123
127
|
async function askPackageManager(current) {
|
|
124
128
|
return answer(await p.select({
|
|
@@ -173,7 +177,7 @@ function reviewText(state, template) {
|
|
|
173
177
|
}, t, 74);
|
|
174
178
|
const details = rows([
|
|
175
179
|
['template', template.key],
|
|
176
|
-
['extras', describeExtras({ ...state.extras, docker })],
|
|
180
|
+
['extras', describeExtras({ ...state.extras, docker, welcome: state.extras.welcome && supportsWelcome(template) })],
|
|
177
181
|
['auth', supportsAuth(template.stack.backend) ? state.auth : t.dim(`not available for ${labelFor(template.stack.backend)}`)],
|
|
178
182
|
['install', yesNo(state.install)],
|
|
179
183
|
]).map(line => ` ${line}`);
|
|
@@ -196,6 +200,7 @@ export async function runWizard(seed, templates) {
|
|
|
196
200
|
eslint: given.eslint ?? true,
|
|
197
201
|
prettier: given.prettier ?? true,
|
|
198
202
|
docker: given.docker ?? true,
|
|
203
|
+
welcome: given.welcome ?? true,
|
|
199
204
|
ci: given.ci ?? false,
|
|
200
205
|
git: given.git ?? true,
|
|
201
206
|
},
|
|
@@ -230,6 +235,7 @@ export async function runWizard(seed, templates) {
|
|
|
230
235
|
packageManager: state.packageManager,
|
|
231
236
|
...state.extras,
|
|
232
237
|
docker: state.extras.docker && template.supports.docker,
|
|
238
|
+
welcome: state.extras.welcome && supportsWelcome(template),
|
|
233
239
|
auth: supportsAuth(template.stack.backend) ? state.auth : 'none',
|
|
234
240
|
install: state.install,
|
|
235
241
|
});
|
package/dist/core/auth/jwt.js
CHANGED
|
@@ -271,7 +271,7 @@ const loginLimiter = rateLimit({
|
|
|
271
271
|
message: { message: 'Too many login attempts, please try again later.' },
|
|
272
272
|
});
|
|
273
273
|
|
|
274
|
-
//
|
|
274
|
+
// Pass errors to the error handler (app.use(errorHandler) in src/app.ts)
|
|
275
275
|
authRouter.post('/login', loginLimiter, async (req, res, next) => {
|
|
276
276
|
try {
|
|
277
277
|
const { email, password } = LoginSchema.parse(req.body);
|
|
@@ -306,7 +306,7 @@ function planFor(backend) {
|
|
|
306
306
|
...SHARED_FILES,
|
|
307
307
|
},
|
|
308
308
|
// The official templates already have @nestjs/throttler; the login route's @Throttle needs it
|
|
309
|
-
dependencies: { '@nestjs/jwt': '^
|
|
309
|
+
dependencies: { '@nestjs/jwt': '^12.0.5', '@nestjs/throttler': '^6.8.0' },
|
|
310
310
|
devDependencies: {},
|
|
311
311
|
};
|
|
312
312
|
}
|
|
@@ -42,15 +42,19 @@ export function displayHealthCheckResults(result) {
|
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
// ── Individual checks ─────────────────────────────────────────────────────────
|
|
45
|
+
/** Same rule as the guard in src/index.ts and engines.node: ^20.19.0 || ^22.12.0 || >=24.0.0. */
|
|
46
|
+
export function isSupportedNode(version) {
|
|
47
|
+
const [major = 0, minor = 0] = version.replace(/^v/, '').split('.').map(Number);
|
|
48
|
+
return (major === 20 && minor >= 19) || (major === 22 && minor >= 12) || major >= 24;
|
|
49
|
+
}
|
|
45
50
|
/** The Node.js running the CLI is the one that matters. */
|
|
46
51
|
async function checkNode() {
|
|
47
52
|
const raw = process.version; // e.g. "v20.19.0"
|
|
48
|
-
const
|
|
49
|
-
const ok = major > 20 || (major === 20 && minor >= 19);
|
|
53
|
+
const ok = isSupportedNode(raw);
|
|
50
54
|
return {
|
|
51
55
|
name: 'Node.js',
|
|
52
56
|
passed: ok,
|
|
53
|
-
message: `${raw} detected${ok ? '' : ' (v20.19+ required)'}`,
|
|
57
|
+
message: `${raw} detected${ok ? '' : ' (v20.19+, v22.12+ or v24+ required)'}`,
|
|
54
58
|
suggestion: ok ? undefined : 'Download from https://nodejs.org (LTS recommended)',
|
|
55
59
|
};
|
|
56
60
|
}
|