create-express-new 1.0.0 → 1.1.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/CHANGELOG.md CHANGED
@@ -6,6 +6,18 @@ All notable changes to this project are documented here. The format is based on
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.1.0] - 2026-10-10
10
+
11
+ ### Added
12
+
13
+ - `--install` installs the dependencies after creating the app, with the app's package manager, as
14
+ the wizard already offered; the wizard's equivalent command includes it
15
+
16
+ ### Changed
17
+
18
+ - Generated apps use newer versions of `eslint`, `globals` and `@types/node`, and generated
19
+ Dockerfiles install newer versions of pnpm and npm
20
+
9
21
  ## [1.0.0] - 2026-10-10
10
22
 
11
23
  The first release of `create-express-new`, a fork of
@@ -109,5 +121,6 @@ the full list and a table for migrating commands.
109
121
  - The `-e/--ejs`, `--hbs`, `--pug` and `-H/--hogan` aliases; use `--view=<engine>`
110
122
  - The `debug` package and `DEBUG=...` start instructions
111
123
 
112
- [Unreleased]: https://github.com/w0244079/create-express-new/compare/v1.0.0...HEAD
124
+ [Unreleased]: https://github.com/w0244079/create-express-new/compare/v1.1.0...HEAD
125
+ [1.1.0]: https://github.com/w0244079/create-express-new/compare/v1.0.0...v1.1.0
113
126
  [1.0.0]: https://github.com/w0244079/create-express-new/releases/tag/v1.0.0
package/README.md CHANGED
@@ -57,7 +57,7 @@ $ pnpm install
57
57
 
58
58
  With `npm create`, put the options after `--`: `npm create express-new@latest my-app -- --ts --helmet`.
59
59
  `npx create-express-new my-app --ts --helmet` needs no `--`. Either way the app requires pnpm unless
60
- you add `--pm=npm`.
60
+ you add `--pm=npm`. Add `--install` to install the dependencies too, with the app's package manager.
61
61
 
62
62
  Start it at `http://localhost:3000/`, and run its tests, written with the built-in
63
63
  [`node:test`](https://nodejs.org/api/test.html) runner:
@@ -235,6 +235,7 @@ support TypeScript 7 yet, these apps use TypeScript 6.
235
235
  --docker add a Dockerfile for a production image
236
236
  --lint add ESLint and a lint script
237
237
  --pm <name> package manager the app requires (pnpm|npm) (defaults to pnpm)
238
+ --install install the dependencies after creating the app
238
239
  --no-git skip the .gitignore
239
240
  -f, --force force on non-empty directory
240
241
  --keep-config keep existing config files (.env.example, Dockerfile,
@@ -25,6 +25,7 @@ const OPTIONS = {
25
25
  git: { type: 'boolean' },
26
26
  helmet: { type: 'boolean' },
27
27
  help: { type: 'boolean', short: 'h' },
28
+ install: { type: 'boolean' },
28
29
  'keep-config': { type: 'boolean' },
29
30
  lint: { type: 'boolean' },
30
31
  logger: { type: 'string' },
@@ -44,7 +45,7 @@ const args = process.argv.slice(2)
44
45
 
45
46
  if (args.length === 0 && process.stdin.isTTY && process.stdout.isTTY) {
46
47
  wizard({ input: process.stdin, output: process.stdout }).then((options) => {
47
- main(options, (code) => installDependencies(options, code))
48
+ main(options, exit)
48
49
  }, (err) => {
49
50
  if (!(err instanceof CancelError)) throw err
50
51
  console.error('aborting')
@@ -130,28 +131,24 @@ function createApplication (dir, entries, leftovers, options, done) {
130
131
  'remove them if they are from an earlier app with other options')
131
132
  }
132
133
 
133
- // dependencies installed by the wizard print next steps afterwards
134
- if (!options.install) {
134
+ if (options.install) {
135
+ installDependencies(dir, options.pm, done)
136
+ } else {
135
137
  printNextSteps(dir, options.pm, true)
138
+ done(0)
136
139
  }
137
-
138
- done(0)
139
140
  }
140
141
 
141
142
  /**
142
- * Install the generated app's dependencies with its package manager, when
143
- * the wizard asked to.
143
+ * Install the generated app's dependencies with its package manager, then
144
+ * display the next steps.
144
145
  *
145
- * @param {object} options
146
- * @param {number} code
146
+ * @param {string} dir
147
+ * @param {string} pm the app's package manager
148
+ * @param {function} done
147
149
  */
148
150
 
149
- function installDependencies (options, code) {
150
- if (code !== 0 || !options.install) return exit(code)
151
-
152
- const dir = options._[0]
153
- const pm = options.pm
154
-
151
+ function installDependencies (dir, pm, done) {
155
152
  console.log(' installing dependencies...')
156
153
  console.log()
157
154
 
@@ -170,14 +167,14 @@ function installDependencies (options, code) {
170
167
  ? pm + ' is not installed, see ' + PACKAGE_MANAGERS[pm].docs
171
168
  : pm + ' install failed: ' + err.message)
172
169
  printNextSteps(dir, pm, true)
173
- exit(1)
170
+ done(1)
174
171
  })
175
172
 
176
173
  child.on('close', (status) => {
177
174
  if (failed) return
178
175
  if (status !== 0) error(pm + ' install failed')
179
176
  printNextSteps(dir, pm, status !== 0)
180
- exit(status === 0 ? 0 : 1)
177
+ done(status === 0 ? 0 : 1)
181
178
  })
182
179
  }
183
180
 
@@ -487,6 +484,7 @@ function usage () {
487
484
  console.log(' --docker add a Dockerfile for a production image')
488
485
  console.log(' --lint add ESLint and a lint script')
489
486
  console.log(' --pm <name> package manager the app requires (pnpm|npm) (defaults to pnpm)')
487
+ console.log(' --install install the dependencies after creating the app')
490
488
  console.log(' --no-git skip the .gitignore')
491
489
  console.log(' -f, --force force on non-empty directory')
492
490
  console.log(' --keep-config keep existing config files (.env.example, Dockerfile,')
package/lib/wizard.js CHANGED
@@ -366,6 +366,7 @@ export function toCommand (options) {
366
366
  if (!options.git) flags.push('--no-git')
367
367
  if (options.force) flags.push('--force')
368
368
  if (options.keepConfig) flags.push('--keep-config')
369
+ if (options.install) flags.push('--install')
369
370
 
370
371
  // npm create keeps the options before `--` for itself
371
372
  if (flags.length && pm === 'npm') args.push('--')
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-express-new",
3
3
  "description": "Express 5 application generator: ESM, TypeScript and CommonJS app templates. A modern successor to express-generator.",
4
- "version": "1.0.0",
4
+ "version": "1.1.0",
5
5
  "author": "Michael Caines (https://github.com/w0244079)",
6
6
  "contributors": [
7
7
  "TJ Holowaychuk <tj@vision-media.ca>",
@@ -9,26 +9,26 @@
9
9
  "@types/http-errors": "^2.0.5",
10
10
  "@types/morgan": "^1.9.10",
11
11
  "@types/multer": "^2.3.0",
12
- "@types/node": "^22.20.4",
12
+ "@types/node": "^22.20.5",
13
13
  "compression": "^1.8.2",
14
14
  "cookie-parser": "^1.4.7",
15
15
  "cors": "^2.8.6",
16
16
  "csrf-sync": "^4.2.1",
17
17
  "ejs": "^6.0.1",
18
- "eslint": "^10.11.0",
18
+ "eslint": "^10.12.0",
19
19
  "express": "^5.2.1",
20
20
  "express-rate-limit": "^8.7.0",
21
21
  "express-session": "^1.19.0",
22
- "globals": "^17.12.0",
22
+ "globals": "^17.13.0",
23
23
  "hbs": "^4.3.1",
24
24
  "helmet": "^8.3.0",
25
25
  "http-errors": "^2.0.1",
26
26
  "morgan": "^1.12.1",
27
27
  "multer": "^2.4.0",
28
- "npm": "^12.1.0",
28
+ "npm": "^12.2.0",
29
29
  "pino-http": "^11.0.0",
30
30
  "pino-pretty": "^13.1.3",
31
- "pnpm": "^12.7.0",
31
+ "pnpm": "^12.9.1",
32
32
  "pug": "^3.0.4",
33
33
  "twig": "^3.0.0",
34
34
  "typescript": "^7.0.2",