@whook/create 20.1.2 → 21.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.
@@ -9,7 +9,7 @@ import { type PathLike } from 'fs-extra';
9
9
  const _packageJSON = JSON.parse(
10
10
  readFileSync('../whook-example/package.json').toString(),
11
11
  );
12
- const FILE_CONTENTS = {
12
+ const FILE_CONTENTS: Record<string, string> = {
13
13
  'README.md': `
14
14
  # test
15
15
  > yolo
@@ -97,23 +97,28 @@ describe('initCreateWhook', () => {
97
97
 
98
98
  test('should work', async () => {
99
99
  readdir.mockResolvedValueOnce(['local', 'production']);
100
- copy.mockImplementationOnce((_, _2, { filter }) =>
101
- Promise.all(
102
- [
103
- 'package.json',
104
- 'package-lock.json',
105
- 'LICENSE',
106
- 'dist/index.js',
107
- 'src/index.js',
108
- 'coverage/index.html',
109
- 'node_modules/whook/index.js',
110
- ].map((fileName) =>
111
- filter(
112
- `${SOURCE_DIR}/${fileName}`,
113
- `${project.directory}/${fileName}`,
100
+ copy.mockImplementationOnce(
101
+ (
102
+ _: unknown,
103
+ _2: unknown,
104
+ { filter }: { filter: <T>(...args: T[]) => T },
105
+ ) =>
106
+ Promise.all(
107
+ [
108
+ 'package.json',
109
+ 'package-lock.json',
110
+ 'LICENSE',
111
+ 'dist/index.js',
112
+ 'src/index.js',
113
+ 'coverage/index.html',
114
+ 'node_modules/whook/index.js',
115
+ ].map((fileName) =>
116
+ filter(
117
+ `${SOURCE_DIR}/${fileName}`,
118
+ `${project.directory}/${fileName}`,
119
+ ),
114
120
  ),
115
121
  ),
116
- ),
117
122
  );
118
123
  axios.mockResolvedValueOnce({
119
124
  data: 'node_modules',
@@ -121,11 +126,19 @@ describe('initCreateWhook', () => {
121
126
  outputFile.mockResolvedValueOnce(undefined);
122
127
  outputFile.mockResolvedValueOnce(undefined);
123
128
  outputFile.mockResolvedValueOnce(undefined);
124
- exec.mockImplementationOnce((_, _2, cb) =>
125
- cb(null, 'Initialized an empty git repository!'),
129
+ exec.mockImplementationOnce(
130
+ (
131
+ _: unknown,
132
+ _2: unknown,
133
+ cb: (err?: Error | null, data?: string) => undefined,
134
+ ) => cb(null, 'Initialized an empty git repository!'),
126
135
  );
127
- exec.mockImplementationOnce((_, _2, cb) =>
128
- cb(null, 'Installed dependencies!'),
136
+ exec.mockImplementationOnce(
137
+ (
138
+ _: unknown,
139
+ _2: unknown,
140
+ cb: (err?: Error | null, data?: string) => undefined,
141
+ ) => cb(null, 'Installed dependencies!'),
129
142
  );
130
143
 
131
144
  const createWhook = await initCreateWhook({
@@ -152,130 +165,139 @@ describe('initCreateWhook', () => {
152
165
  ?.toString() || '',
153
166
  ),
154
167
  ).toMatchInlineSnapshot(`
155
- {
156
- "author": {
157
- "email": "wayne@warner.com",
158
- "name": "Wayne Campbell",
159
- },
160
- "dependencies": {
161
- "@whook/authorization": "<current_version>",
162
- "@whook/cors": "<current_version>",
163
- "@whook/http-router": "<current_version>",
164
- "@whook/http-server": "<current_version>",
165
- "@whook/http-transaction": "<current_version>",
166
- "@whook/swagger-ui": "<current_version>",
167
- "@whook/whook": "<current_version>",
168
- "application-services": "^7.0.4",
169
- "common-services": "^17.1.2",
170
- "http-auth-utils": "^6.0.1",
171
- "jwt-service": "^11.0.3",
172
- "knifecycle": "^19.1.3",
173
- "strict-qs": "^8.0.3",
174
- "type-fest": "^5.1.0",
175
- "ya-json-schema-types": "^1.0.1",
176
- "ya-open-api-types": "1.2.2",
177
- "yerror": "^8.0.0",
178
- "yhttperror": "^8.1.0",
179
- },
180
- "description": "A new Whook project",
181
- "devDependencies": {
182
- "@eslint/js": "^9.30.1",
183
- "@swc/cli": "^0.7.8",
184
- "@swc/core": "^1.12.11",
185
- "@swc/helpers": "^0.5.17",
186
- "@swc/jest": "^0.2.39",
187
- "axios": "^1.12.2",
188
- "esbuild-node-externals": "^1.15.0",
189
- "eslint": "^9.30.1",
190
- "eslint-config-prettier": "^10.1.5",
191
- "eslint-plugin-jest": "^29.0.1",
192
- "eslint-plugin-prettier": "^5.5.1",
193
- "jest": "^30.0.4",
194
- "jsarch": "^6.2.1",
195
- "prettier": "^3.6.2",
196
- "rimraf": "^6.0.1",
197
- "schema2dts": "^8.1.1",
198
- "streamtest": "^3.0.1",
199
- "tsx": "^4.7.1",
200
- "typescript": "^5.8.3",
201
- "typescript-eslint": "^8.36.0",
202
- },
203
- "engines": {
204
- "node": ">=22.16.0",
205
- },
206
- "files": [
207
- "bin",
208
- "dist",
209
- "src",
210
- "LICENSE",
211
- "README.md",
212
- "CHANGELOG.md",
213
- ],
214
- "jest": {
215
- "coverageReporters": [
216
- "lcov",
217
- "html",
218
- ],
219
- "extensionsToTreatAsEsm": [
220
- ".ts",
221
- ],
222
- "moduleNameMapper": {
223
- "#(.*)": "<rootDir>/../../node_modules/$1",
224
- "(.+)\\.js": "$1",
225
- },
226
- "prettierPath": null,
227
- "roots": [
228
- "<rootDir>/src",
229
- ],
230
- "testEnvironment": "node",
231
- "testPathIgnorePatterns": [
232
- "/node_modules/",
233
- ],
234
- "transform": {
235
- "^.+\\.tsx?$": [
236
- "@swc/jest",
237
- {},
238
- ],
239
- },
240
- },
241
- "keywords": [
242
- "whook",
243
- ],
244
- "license": "SEE LICENSE",
245
- "main": "dist/index.js",
246
- "name": "super-project",
247
- "prettier": {
248
- "printWidth": 80,
249
- "proseWrap": "always",
250
- "semi": true,
251
- "singleQuote": true,
252
- "trailingComma": "all",
253
- },
254
- "private": true,
255
- "scripts": {
256
- "apitypes": "npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts",
257
- "architecture": "jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md",
258
- "build": "rimraf 'dist' && tsc --outDir dist",
259
- "cover": "node --run jest -- --coverage",
260
- "debug": "NODE_OPTIONS=\${NODE_OPTIONS:-'--inspect'} NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} tsx bin/whook.js",
261
- "dev": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 tsx src/run.js",
262
- "format": "node --run prettier",
263
- "jest": "NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest",
264
- "lint": "eslint 'src/**/*.ts'",
265
- "postbuild": "NODE_ENV=\${NODE_ENV:-development} tsx src/runBuild.js",
266
- "prettier": "prettier --write 'src/**/*.ts'",
267
- "rebuild": "swc ./src -s -d dist -C jsc.target=es2022",
268
- "repl": "NODE_ENV=\${NODE_ENV:-development} tsx src/run.js -- __inject repl",
269
- "start": "NODE_ENV=\${NODE_ENV:-development} node dist/run.js",
270
- "test": "NODE_ENV=test npm run build && node --run jest && node --run jest",
271
- "watch": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 tsx src/runWatch.js",
272
- "whook": "NODE_ENV=\${NODE_ENV:-development} whook",
273
- },
274
- "type": "module",
275
- "types": "dist/index.d.ts",
276
- "version": "0.0.0",
277
- }
278
- `);
168
+ {
169
+ "author": {
170
+ "email": "wayne@warner.com",
171
+ "name": "Wayne Campbell",
172
+ },
173
+ "dependencies": {
174
+ "@whook/authorization": "<current_version>",
175
+ "@whook/cors": "<current_version>",
176
+ "@whook/http-router": "<current_version>",
177
+ "@whook/http-server": "<current_version>",
178
+ "@whook/http-transaction": "<current_version>",
179
+ "@whook/swagger-ui": "<current_version>",
180
+ "@whook/whook": "<current_version>",
181
+ "application-services": "^8.0.1",
182
+ "common-services": "^18.0.1",
183
+ "http-auth-utils": "^7.0.0",
184
+ "jwt-service": "^12.0.0",
185
+ "knifecycle": "^20.0.0",
186
+ "strict-qs": "^9.0.0",
187
+ "type-fest": "^5.5.0",
188
+ "ya-json-schema-types": "^2.0.1",
189
+ "ya-open-api-types": "^2.1.1",
190
+ "yerror": "^9.1.1",
191
+ "yhttperror": "^9.0.1",
192
+ },
193
+ "description": "A new Whook project",
194
+ "devDependencies": {
195
+ "@eslint/js": "^10.0.1",
196
+ "@swc/cli": "^0.8.0",
197
+ "@swc/core": "^1.15.21",
198
+ "@swc/jest": "^0.2.39",
199
+ "axios": "^1.13.6",
200
+ "esbuild-node-externals": "^1.20.1",
201
+ "eslint": "^10.1.0",
202
+ "eslint-config-prettier": "^10.1.8",
203
+ "eslint-plugin-jest": "^29.15.1",
204
+ "eslint-plugin-prettier": "^5.5.5",
205
+ "jest": "^30.3.0",
206
+ "jsarch": "^7.0.0",
207
+ "prettier": "^3.8.1",
208
+ "rimraf": "^6.1.3",
209
+ "schema2dts": "^9.0.0",
210
+ "streamtest": "^4.0.0",
211
+ "tsx": "^4.21.0",
212
+ "typescript": "^6.0.2",
213
+ "typescript-eslint": "^8.57.2",
214
+ },
215
+ "engines": {
216
+ "node": ">=24.14.0",
217
+ },
218
+ "files": [
219
+ "bin",
220
+ "dist",
221
+ "src",
222
+ "LICENSE",
223
+ "README.md",
224
+ "CHANGELOG.md",
225
+ ],
226
+ "jest": {
227
+ "coverageReporters": [
228
+ "lcov",
229
+ "html",
230
+ ],
231
+ "extensionsToTreatAsEsm": [
232
+ ".ts",
233
+ ],
234
+ "moduleNameMapper": {
235
+ "#(.*)": "<rootDir>/../../node_modules/$1",
236
+ "(.+)\\.js": "$1",
237
+ },
238
+ "roots": [
239
+ "<rootDir>/src",
240
+ ],
241
+ "testEnvironment": "node",
242
+ "testPathIgnorePatterns": [
243
+ "/node_modules/",
244
+ ],
245
+ "transform": {
246
+ "^.+\\.tsx?$": [
247
+ "@swc/jest",
248
+ {},
249
+ ],
250
+ },
251
+ },
252
+ "keywords": [
253
+ "whook",
254
+ ],
255
+ "license": "SEE LICENSE",
256
+ "main": "dist/index.js",
257
+ "name": "super-project",
258
+ "overrides": {
259
+ "@typescript-eslint/eslint-plugin": {
260
+ "typescript": "^6",
261
+ },
262
+ "@typescript-eslint/parser": {
263
+ "typescript": "^6",
264
+ },
265
+ "typescript-eslint": {
266
+ "typescript": "^6",
267
+ },
268
+ },
269
+ "prettier": {
270
+ "printWidth": 80,
271
+ "proseWrap": "always",
272
+ "semi": true,
273
+ "singleQuote": true,
274
+ "trailingComma": "all",
275
+ },
276
+ "private": true,
277
+ "scripts": {
278
+ "apitypes": "npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts",
279
+ "architecture": "jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md",
280
+ "build": "rimraf 'dist' && tsc --outDir dist",
281
+ "cover": "node --run jest -- --coverage",
282
+ "debug": "NODE_OPTIONS=\${NODE_OPTIONS:-'--inspect'} NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} tsx bin/whook.js",
283
+ "dev": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 tsx src/run.js",
284
+ "format": "node --run prettier",
285
+ "jest": "NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest",
286
+ "lint": "eslint 'src/**/*.ts'",
287
+ "postbuild": "NODE_ENV=\${NODE_ENV:-development} tsx src/runBuild.js",
288
+ "prettier": "prettier --write 'src/**/*.ts'",
289
+ "rebuild": "swc ./src -s -d dist -C jsc.target=es2022",
290
+ "repl": "NODE_ENV=\${NODE_ENV:-development} tsx src/run.js -- __inject repl",
291
+ "start": "NODE_ENV=\${NODE_ENV:-development} node dist/run.js",
292
+ "test": "NODE_ENV=test npm run build && node --run jest && node --run jest",
293
+ "watch": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 tsx src/runWatch.js",
294
+ "whook": "NODE_ENV=\${NODE_ENV:-development} whook",
295
+ },
296
+ "type": "module",
297
+ "types": "dist/index.d.ts",
298
+ "version": "0.0.0",
299
+ }
300
+ `);
279
301
  expect({
280
302
  copyCalls: copy.mock.calls,
281
303
  outputFileCalls: outputFile.mock.calls,
@@ -291,31 +313,46 @@ describe('initCreateWhook', () => {
291
313
 
292
314
  test('should handle network issues', async () => {
293
315
  readdir.mockResolvedValueOnce(['local', 'production']);
294
- copy.mockImplementationOnce((_, _2, { filter }) =>
295
- Promise.all(
296
- [
297
- 'package.json',
298
- 'package-lock.json',
299
- 'LICENSE',
300
- 'dist/index.js',
301
- 'src/index.js',
302
- 'coverage/index.html',
303
- 'node_modules/whook/index.js',
304
- ].map((fileName) =>
305
- filter(
306
- `${SOURCE_DIR}/${fileName}`,
307
- `${project.directory}/${fileName}`,
316
+ copy.mockImplementationOnce(
317
+ (
318
+ _: unknown,
319
+ _2: unknown,
320
+ { filter }: { filter: <T>(...args: T[]) => T },
321
+ ) =>
322
+ Promise.all(
323
+ [
324
+ 'package.json',
325
+ 'package-lock.json',
326
+ 'LICENSE',
327
+ 'dist/index.js',
328
+ 'src/index.js',
329
+ 'coverage/index.html',
330
+ 'node_modules/whook/index.js',
331
+ ].map((fileName) =>
332
+ filter(
333
+ `${SOURCE_DIR}/${fileName}`,
334
+ `${project.directory}/${fileName}`,
335
+ ),
308
336
  ),
309
337
  ),
310
- ),
311
338
  );
312
339
  axios.mockRejectedValueOnce(new YError('E_NETWORK'));
313
340
  outputFile.mockResolvedValueOnce(undefined);
314
341
  outputFile.mockResolvedValueOnce(undefined);
315
342
  outputFile.mockResolvedValueOnce(undefined);
316
- exec.mockImplementationOnce((_, _2, cb) => cb(new YError('E_ACCESS')));
317
- exec.mockImplementationOnce((_, _2, cb) =>
318
- cb(null, 'Installed dependencies!'),
343
+ exec.mockImplementationOnce(
344
+ (
345
+ _: unknown,
346
+ _2: unknown,
347
+ cb: (err?: Error | null, data?: string) => undefined,
348
+ ) => cb(new YError('E_ACCESS')),
349
+ );
350
+ exec.mockImplementationOnce(
351
+ (
352
+ _: unknown,
353
+ _2: unknown,
354
+ cb: (err?: Error | null, data?: string) => undefined,
355
+ ) => cb(null, 'Installed dependencies!'),
319
356
  );
320
357
 
321
358
  const createWhook = await initCreateWhook({
@@ -342,130 +379,139 @@ describe('initCreateWhook', () => {
342
379
  ?.toString() || '',
343
380
  ),
344
381
  ).toMatchInlineSnapshot(`
345
- {
346
- "author": {
347
- "email": "wayne@warner.com",
348
- "name": "Wayne Campbell",
349
- },
350
- "dependencies": {
351
- "@whook/authorization": "<current_version>",
352
- "@whook/cors": "<current_version>",
353
- "@whook/http-router": "<current_version>",
354
- "@whook/http-server": "<current_version>",
355
- "@whook/http-transaction": "<current_version>",
356
- "@whook/swagger-ui": "<current_version>",
357
- "@whook/whook": "<current_version>",
358
- "application-services": "^7.0.4",
359
- "common-services": "^17.1.2",
360
- "http-auth-utils": "^6.0.1",
361
- "jwt-service": "^11.0.3",
362
- "knifecycle": "^19.1.3",
363
- "strict-qs": "^8.0.3",
364
- "type-fest": "^5.1.0",
365
- "ya-json-schema-types": "^1.0.1",
366
- "ya-open-api-types": "1.2.2",
367
- "yerror": "^8.0.0",
368
- "yhttperror": "^8.1.0",
369
- },
370
- "description": "A new Whook project",
371
- "devDependencies": {
372
- "@eslint/js": "^9.30.1",
373
- "@swc/cli": "^0.7.8",
374
- "@swc/core": "^1.12.11",
375
- "@swc/helpers": "^0.5.17",
376
- "@swc/jest": "^0.2.39",
377
- "axios": "^1.12.2",
378
- "esbuild-node-externals": "^1.15.0",
379
- "eslint": "^9.30.1",
380
- "eslint-config-prettier": "^10.1.5",
381
- "eslint-plugin-jest": "^29.0.1",
382
- "eslint-plugin-prettier": "^5.5.1",
383
- "jest": "^30.0.4",
384
- "jsarch": "^6.2.1",
385
- "prettier": "^3.6.2",
386
- "rimraf": "^6.0.1",
387
- "schema2dts": "^8.1.1",
388
- "streamtest": "^3.0.1",
389
- "tsx": "^4.7.1",
390
- "typescript": "^5.8.3",
391
- "typescript-eslint": "^8.36.0",
392
- },
393
- "engines": {
394
- "node": ">=22.16.0",
395
- },
396
- "files": [
397
- "bin",
398
- "dist",
399
- "src",
400
- "LICENSE",
401
- "README.md",
402
- "CHANGELOG.md",
403
- ],
404
- "jest": {
405
- "coverageReporters": [
406
- "lcov",
407
- "html",
408
- ],
409
- "extensionsToTreatAsEsm": [
410
- ".ts",
411
- ],
412
- "moduleNameMapper": {
413
- "#(.*)": "<rootDir>/../../node_modules/$1",
414
- "(.+)\\.js": "$1",
415
- },
416
- "prettierPath": null,
417
- "roots": [
418
- "<rootDir>/src",
419
- ],
420
- "testEnvironment": "node",
421
- "testPathIgnorePatterns": [
422
- "/node_modules/",
423
- ],
424
- "transform": {
425
- "^.+\\.tsx?$": [
426
- "@swc/jest",
427
- {},
428
- ],
429
- },
430
- },
431
- "keywords": [
432
- "whook",
433
- ],
434
- "license": "SEE LICENSE",
435
- "main": "dist/index.js",
436
- "name": "super-project",
437
- "prettier": {
438
- "printWidth": 80,
439
- "proseWrap": "always",
440
- "semi": true,
441
- "singleQuote": true,
442
- "trailingComma": "all",
443
- },
444
- "private": true,
445
- "scripts": {
446
- "apitypes": "npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts",
447
- "architecture": "jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md",
448
- "build": "rimraf 'dist' && tsc --outDir dist",
449
- "cover": "node --run jest -- --coverage",
450
- "debug": "NODE_OPTIONS=\${NODE_OPTIONS:-'--inspect'} NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} tsx bin/whook.js",
451
- "dev": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 tsx src/run.js",
452
- "format": "node --run prettier",
453
- "jest": "NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest",
454
- "lint": "eslint 'src/**/*.ts'",
455
- "postbuild": "NODE_ENV=\${NODE_ENV:-development} tsx src/runBuild.js",
456
- "prettier": "prettier --write 'src/**/*.ts'",
457
- "rebuild": "swc ./src -s -d dist -C jsc.target=es2022",
458
- "repl": "NODE_ENV=\${NODE_ENV:-development} tsx src/run.js -- __inject repl",
459
- "start": "NODE_ENV=\${NODE_ENV:-development} node dist/run.js",
460
- "test": "NODE_ENV=test npm run build && node --run jest && node --run jest",
461
- "watch": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 tsx src/runWatch.js",
462
- "whook": "NODE_ENV=\${NODE_ENV:-development} whook",
463
- },
464
- "type": "module",
465
- "types": "dist/index.d.ts",
466
- "version": "0.0.0",
467
- }
468
- `);
382
+ {
383
+ "author": {
384
+ "email": "wayne@warner.com",
385
+ "name": "Wayne Campbell",
386
+ },
387
+ "dependencies": {
388
+ "@whook/authorization": "<current_version>",
389
+ "@whook/cors": "<current_version>",
390
+ "@whook/http-router": "<current_version>",
391
+ "@whook/http-server": "<current_version>",
392
+ "@whook/http-transaction": "<current_version>",
393
+ "@whook/swagger-ui": "<current_version>",
394
+ "@whook/whook": "<current_version>",
395
+ "application-services": "^8.0.1",
396
+ "common-services": "^18.0.1",
397
+ "http-auth-utils": "^7.0.0",
398
+ "jwt-service": "^12.0.0",
399
+ "knifecycle": "^20.0.0",
400
+ "strict-qs": "^9.0.0",
401
+ "type-fest": "^5.5.0",
402
+ "ya-json-schema-types": "^2.0.1",
403
+ "ya-open-api-types": "^2.1.1",
404
+ "yerror": "^9.1.1",
405
+ "yhttperror": "^9.0.1",
406
+ },
407
+ "description": "A new Whook project",
408
+ "devDependencies": {
409
+ "@eslint/js": "^10.0.1",
410
+ "@swc/cli": "^0.8.0",
411
+ "@swc/core": "^1.15.21",
412
+ "@swc/jest": "^0.2.39",
413
+ "axios": "^1.13.6",
414
+ "esbuild-node-externals": "^1.20.1",
415
+ "eslint": "^10.1.0",
416
+ "eslint-config-prettier": "^10.1.8",
417
+ "eslint-plugin-jest": "^29.15.1",
418
+ "eslint-plugin-prettier": "^5.5.5",
419
+ "jest": "^30.3.0",
420
+ "jsarch": "^7.0.0",
421
+ "prettier": "^3.8.1",
422
+ "rimraf": "^6.1.3",
423
+ "schema2dts": "^9.0.0",
424
+ "streamtest": "^4.0.0",
425
+ "tsx": "^4.21.0",
426
+ "typescript": "^6.0.2",
427
+ "typescript-eslint": "^8.57.2",
428
+ },
429
+ "engines": {
430
+ "node": ">=24.14.0",
431
+ },
432
+ "files": [
433
+ "bin",
434
+ "dist",
435
+ "src",
436
+ "LICENSE",
437
+ "README.md",
438
+ "CHANGELOG.md",
439
+ ],
440
+ "jest": {
441
+ "coverageReporters": [
442
+ "lcov",
443
+ "html",
444
+ ],
445
+ "extensionsToTreatAsEsm": [
446
+ ".ts",
447
+ ],
448
+ "moduleNameMapper": {
449
+ "#(.*)": "<rootDir>/../../node_modules/$1",
450
+ "(.+)\\.js": "$1",
451
+ },
452
+ "roots": [
453
+ "<rootDir>/src",
454
+ ],
455
+ "testEnvironment": "node",
456
+ "testPathIgnorePatterns": [
457
+ "/node_modules/",
458
+ ],
459
+ "transform": {
460
+ "^.+\\.tsx?$": [
461
+ "@swc/jest",
462
+ {},
463
+ ],
464
+ },
465
+ },
466
+ "keywords": [
467
+ "whook",
468
+ ],
469
+ "license": "SEE LICENSE",
470
+ "main": "dist/index.js",
471
+ "name": "super-project",
472
+ "overrides": {
473
+ "@typescript-eslint/eslint-plugin": {
474
+ "typescript": "^6",
475
+ },
476
+ "@typescript-eslint/parser": {
477
+ "typescript": "^6",
478
+ },
479
+ "typescript-eslint": {
480
+ "typescript": "^6",
481
+ },
482
+ },
483
+ "prettier": {
484
+ "printWidth": 80,
485
+ "proseWrap": "always",
486
+ "semi": true,
487
+ "singleQuote": true,
488
+ "trailingComma": "all",
489
+ },
490
+ "private": true,
491
+ "scripts": {
492
+ "apitypes": "npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts",
493
+ "architecture": "jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md",
494
+ "build": "rimraf 'dist' && tsc --outDir dist",
495
+ "cover": "node --run jest -- --coverage",
496
+ "debug": "NODE_OPTIONS=\${NODE_OPTIONS:-'--inspect'} NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} tsx bin/whook.js",
497
+ "dev": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 tsx src/run.js",
498
+ "format": "node --run prettier",
499
+ "jest": "NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest",
500
+ "lint": "eslint 'src/**/*.ts'",
501
+ "postbuild": "NODE_ENV=\${NODE_ENV:-development} tsx src/runBuild.js",
502
+ "prettier": "prettier --write 'src/**/*.ts'",
503
+ "rebuild": "swc ./src -s -d dist -C jsc.target=es2022",
504
+ "repl": "NODE_ENV=\${NODE_ENV:-development} tsx src/run.js -- __inject repl",
505
+ "start": "NODE_ENV=\${NODE_ENV:-development} node dist/run.js",
506
+ "test": "NODE_ENV=test npm run build && node --run jest && node --run jest",
507
+ "watch": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 tsx src/runWatch.js",
508
+ "whook": "NODE_ENV=\${NODE_ENV:-development} whook",
509
+ },
510
+ "type": "module",
511
+ "types": "dist/index.d.ts",
512
+ "version": "0.0.0",
513
+ }
514
+ `);
469
515
  expect({
470
516
  copyCalls: copy.mock.calls,
471
517
  outputFileCalls: outputFile.mock.calls,
@@ -488,9 +534,19 @@ describe('initCreateWhook', () => {
488
534
  outputFile.mockResolvedValueOnce(undefined);
489
535
  outputFile.mockResolvedValueOnce(undefined);
490
536
  outputFile.mockResolvedValueOnce(undefined);
491
- exec.mockImplementationOnce((_, _2, cb) => cb(new YError('E_ACCESS')));
492
- exec.mockImplementationOnce((_, _2, cb) =>
493
- cb(null, 'Installed dependencies!'),
537
+ exec.mockImplementationOnce(
538
+ (
539
+ _: unknown,
540
+ _2: unknown,
541
+ cb: (err?: Error | null, data?: string) => undefined,
542
+ ) => cb(new YError('E_ACCESS')),
543
+ );
544
+ exec.mockImplementationOnce(
545
+ (
546
+ _: unknown,
547
+ _2: unknown,
548
+ cb: (err?: Error | null, data?: string) => undefined,
549
+ ) => cb(null, 'Installed dependencies!'),
494
550
  );
495
551
 
496
552
  const createWhook = await initCreateWhook({
@@ -517,130 +573,139 @@ describe('initCreateWhook', () => {
517
573
  ?.toString() || '',
518
574
  ),
519
575
  ).toMatchInlineSnapshot(`
520
- {
521
- "author": {
522
- "email": "wayne@warner.com",
523
- "name": "Wayne Campbell",
524
- },
525
- "dependencies": {
526
- "@whook/authorization": "<current_version>",
527
- "@whook/cors": "<current_version>",
528
- "@whook/http-router": "<current_version>",
529
- "@whook/http-server": "<current_version>",
530
- "@whook/http-transaction": "<current_version>",
531
- "@whook/swagger-ui": "<current_version>",
532
- "@whook/whook": "<current_version>",
533
- "application-services": "^7.0.4",
534
- "common-services": "^17.1.2",
535
- "http-auth-utils": "^6.0.1",
536
- "jwt-service": "^11.0.3",
537
- "knifecycle": "^19.1.3",
538
- "strict-qs": "^8.0.3",
539
- "type-fest": "^5.1.0",
540
- "ya-json-schema-types": "^1.0.1",
541
- "ya-open-api-types": "1.2.2",
542
- "yerror": "^8.0.0",
543
- "yhttperror": "^8.1.0",
544
- },
545
- "description": "A new Whook project",
546
- "devDependencies": {
547
- "@eslint/js": "^9.30.1",
548
- "@swc/cli": "^0.7.8",
549
- "@swc/core": "^1.12.11",
550
- "@swc/helpers": "^0.5.17",
551
- "@swc/jest": "^0.2.39",
552
- "axios": "^1.12.2",
553
- "esbuild-node-externals": "^1.15.0",
554
- "eslint": "^9.30.1",
555
- "eslint-config-prettier": "^10.1.5",
556
- "eslint-plugin-jest": "^29.0.1",
557
- "eslint-plugin-prettier": "^5.5.1",
558
- "jest": "^30.0.4",
559
- "jsarch": "^6.2.1",
560
- "prettier": "^3.6.2",
561
- "rimraf": "^6.0.1",
562
- "schema2dts": "^8.1.1",
563
- "streamtest": "^3.0.1",
564
- "tsx": "^4.7.1",
565
- "typescript": "^5.8.3",
566
- "typescript-eslint": "^8.36.0",
567
- },
568
- "engines": {
569
- "node": ">=22.16.0",
570
- },
571
- "files": [
572
- "bin",
573
- "dist",
574
- "src",
575
- "LICENSE",
576
- "README.md",
577
- "CHANGELOG.md",
578
- ],
579
- "jest": {
580
- "coverageReporters": [
581
- "lcov",
582
- "html",
583
- ],
584
- "extensionsToTreatAsEsm": [
585
- ".ts",
586
- ],
587
- "moduleNameMapper": {
588
- "#(.*)": "<rootDir>/../../node_modules/$1",
589
- "(.+)\\.js": "$1",
590
- },
591
- "prettierPath": null,
592
- "roots": [
593
- "<rootDir>/src",
594
- ],
595
- "testEnvironment": "node",
596
- "testPathIgnorePatterns": [
597
- "/node_modules/",
598
- ],
599
- "transform": {
600
- "^.+\\.tsx?$": [
601
- "@swc/jest",
602
- {},
603
- ],
604
- },
605
- },
606
- "keywords": [
607
- "whook",
608
- ],
609
- "license": "SEE LICENSE",
610
- "main": "dist/index.js",
611
- "name": "super-project",
612
- "prettier": {
613
- "printWidth": 80,
614
- "proseWrap": "always",
615
- "semi": true,
616
- "singleQuote": true,
617
- "trailingComma": "all",
618
- },
619
- "private": true,
620
- "scripts": {
621
- "apitypes": "npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts",
622
- "architecture": "jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md",
623
- "build": "rimraf 'dist' && tsc --outDir dist",
624
- "cover": "node --run jest -- --coverage",
625
- "debug": "NODE_OPTIONS=\${NODE_OPTIONS:-'--inspect'} NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} tsx bin/whook.js",
626
- "dev": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 tsx src/run.js",
627
- "format": "node --run prettier",
628
- "jest": "NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest",
629
- "lint": "eslint 'src/**/*.ts'",
630
- "postbuild": "NODE_ENV=\${NODE_ENV:-development} tsx src/runBuild.js",
631
- "prettier": "prettier --write 'src/**/*.ts'",
632
- "rebuild": "swc ./src -s -d dist -C jsc.target=es2022",
633
- "repl": "NODE_ENV=\${NODE_ENV:-development} tsx src/run.js -- __inject repl",
634
- "start": "NODE_ENV=\${NODE_ENV:-development} node dist/run.js",
635
- "test": "NODE_ENV=test npm run build && node --run jest && node --run jest",
636
- "watch": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 tsx src/runWatch.js",
637
- "whook": "NODE_ENV=\${NODE_ENV:-development} whook",
638
- },
639
- "type": "module",
640
- "types": "dist/index.d.ts",
641
- "version": "0.0.0",
642
- }
643
- `);
576
+ {
577
+ "author": {
578
+ "email": "wayne@warner.com",
579
+ "name": "Wayne Campbell",
580
+ },
581
+ "dependencies": {
582
+ "@whook/authorization": "<current_version>",
583
+ "@whook/cors": "<current_version>",
584
+ "@whook/http-router": "<current_version>",
585
+ "@whook/http-server": "<current_version>",
586
+ "@whook/http-transaction": "<current_version>",
587
+ "@whook/swagger-ui": "<current_version>",
588
+ "@whook/whook": "<current_version>",
589
+ "application-services": "^8.0.1",
590
+ "common-services": "^18.0.1",
591
+ "http-auth-utils": "^7.0.0",
592
+ "jwt-service": "^12.0.0",
593
+ "knifecycle": "^20.0.0",
594
+ "strict-qs": "^9.0.0",
595
+ "type-fest": "^5.5.0",
596
+ "ya-json-schema-types": "^2.0.1",
597
+ "ya-open-api-types": "^2.1.1",
598
+ "yerror": "^9.1.1",
599
+ "yhttperror": "^9.0.1",
600
+ },
601
+ "description": "A new Whook project",
602
+ "devDependencies": {
603
+ "@eslint/js": "^10.0.1",
604
+ "@swc/cli": "^0.8.0",
605
+ "@swc/core": "^1.15.21",
606
+ "@swc/jest": "^0.2.39",
607
+ "axios": "^1.13.6",
608
+ "esbuild-node-externals": "^1.20.1",
609
+ "eslint": "^10.1.0",
610
+ "eslint-config-prettier": "^10.1.8",
611
+ "eslint-plugin-jest": "^29.15.1",
612
+ "eslint-plugin-prettier": "^5.5.5",
613
+ "jest": "^30.3.0",
614
+ "jsarch": "^7.0.0",
615
+ "prettier": "^3.8.1",
616
+ "rimraf": "^6.1.3",
617
+ "schema2dts": "^9.0.0",
618
+ "streamtest": "^4.0.0",
619
+ "tsx": "^4.21.0",
620
+ "typescript": "^6.0.2",
621
+ "typescript-eslint": "^8.57.2",
622
+ },
623
+ "engines": {
624
+ "node": ">=24.14.0",
625
+ },
626
+ "files": [
627
+ "bin",
628
+ "dist",
629
+ "src",
630
+ "LICENSE",
631
+ "README.md",
632
+ "CHANGELOG.md",
633
+ ],
634
+ "jest": {
635
+ "coverageReporters": [
636
+ "lcov",
637
+ "html",
638
+ ],
639
+ "extensionsToTreatAsEsm": [
640
+ ".ts",
641
+ ],
642
+ "moduleNameMapper": {
643
+ "#(.*)": "<rootDir>/../../node_modules/$1",
644
+ "(.+)\\.js": "$1",
645
+ },
646
+ "roots": [
647
+ "<rootDir>/src",
648
+ ],
649
+ "testEnvironment": "node",
650
+ "testPathIgnorePatterns": [
651
+ "/node_modules/",
652
+ ],
653
+ "transform": {
654
+ "^.+\\.tsx?$": [
655
+ "@swc/jest",
656
+ {},
657
+ ],
658
+ },
659
+ },
660
+ "keywords": [
661
+ "whook",
662
+ ],
663
+ "license": "SEE LICENSE",
664
+ "main": "dist/index.js",
665
+ "name": "super-project",
666
+ "overrides": {
667
+ "@typescript-eslint/eslint-plugin": {
668
+ "typescript": "^6",
669
+ },
670
+ "@typescript-eslint/parser": {
671
+ "typescript": "^6",
672
+ },
673
+ "typescript-eslint": {
674
+ "typescript": "^6",
675
+ },
676
+ },
677
+ "prettier": {
678
+ "printWidth": 80,
679
+ "proseWrap": "always",
680
+ "semi": true,
681
+ "singleQuote": true,
682
+ "trailingComma": "all",
683
+ },
684
+ "private": true,
685
+ "scripts": {
686
+ "apitypes": "npm run --silent whook -- generateOpenAPISchema --authenticated=true | npm run --silent whook -- generateOpenAPITypes > src/openAPISchema.d.ts",
687
+ "architecture": "jsarch 'src/**/*.ts' > ARCHITECTURE.md && git add ARCHITECTURE.md",
688
+ "build": "rimraf 'dist' && tsc --outDir dist",
689
+ "cover": "node --run jest -- --coverage",
690
+ "debug": "NODE_OPTIONS=\${NODE_OPTIONS:-'--inspect'} NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 DEBUG=\${DEBUG:-whook} tsx bin/whook.js",
691
+ "dev": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 tsx src/run.js",
692
+ "format": "node --run prettier",
693
+ "jest": "NODE_OPTIONS=--experimental-vm-modules NODE_ENV=test jest",
694
+ "lint": "eslint 'src/**/*.ts'",
695
+ "postbuild": "NODE_ENV=\${NODE_ENV:-development} tsx src/runBuild.js",
696
+ "prettier": "prettier --write 'src/**/*.ts'",
697
+ "rebuild": "swc ./src -s -d dist -C jsc.target=es2022",
698
+ "repl": "NODE_ENV=\${NODE_ENV:-development} tsx src/run.js -- __inject repl",
699
+ "start": "NODE_ENV=\${NODE_ENV:-development} node dist/run.js",
700
+ "test": "NODE_ENV=test npm run build && node --run jest && node --run jest",
701
+ "watch": "NODE_ENV=\${NODE_ENV:-development} DEV_MODE=1 DESTROY_SOCKETS=1 tsx src/runWatch.js",
702
+ "whook": "NODE_ENV=\${NODE_ENV:-development} whook",
703
+ },
704
+ "type": "module",
705
+ "types": "dist/index.d.ts",
706
+ "version": "0.0.0",
707
+ }
708
+ `);
644
709
  expect({
645
710
  copyCalls: copy.mock.calls,
646
711
  outputFileCalls: outputFile.mock.calls,
@@ -663,9 +728,19 @@ describe('initCreateWhook', () => {
663
728
  outputFile.mockResolvedValueOnce(undefined);
664
729
  outputFile.mockResolvedValueOnce(undefined);
665
730
  outputFile.mockResolvedValueOnce(undefined);
666
- exec.mockImplementationOnce((_, _2, cb) => cb(null, ''));
667
- exec.mockImplementationOnce((_, _2, cb) =>
668
- cb(null, 'Installed dependencies!'),
731
+ exec.mockImplementationOnce(
732
+ (
733
+ _: unknown,
734
+ _2: unknown,
735
+ cb: (err?: Error | null, data?: string) => undefined,
736
+ ) => cb(null, ''),
737
+ );
738
+ exec.mockImplementationOnce(
739
+ (
740
+ _: unknown,
741
+ _2: unknown,
742
+ cb: (err?: Error | null, data?: string) => undefined,
743
+ ) => cb(null, 'Installed dependencies!'),
669
744
  );
670
745
 
671
746
  try {
@@ -690,12 +765,12 @@ describe('initCreateWhook', () => {
690
765
  } catch (err) {
691
766
  expect({
692
767
  errorCode: (err as YError).code,
693
- errorParams: (err as YError).params,
768
+ errorDebugValues: (err as YError).debugValues,
694
769
  }).toMatchInlineSnapshot(`
695
- {
696
- "errorCode": "E_ACCESS",
697
- "errorParams": [],
698
- }
770
+ {
771
+ "errorCode": "E_ACCESS",
772
+ "errorDebugValues": [],
773
+ }
699
774
  `);
700
775
  expect({
701
776
  copyCalls: copy.mock.calls,