express-generator-typescript 2.6.1 → 2.6.3

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 (24) hide show
  1. package/lib/express-generator-typescript.js +6 -6
  2. package/lib/project-files/package.json +29 -32
  3. package/lib/project-files/spec/support/Paths.ts +1 -1
  4. package/lib/project-files/spec/tests/users.spec.ts +2 -2
  5. package/lib/project-files/src/{util → common/util}/route-errors.ts +1 -1
  6. package/lib/project-files/src/index.ts +1 -1
  7. package/lib/project-files/src/models/User.ts +3 -4
  8. package/lib/project-files/src/models/common/types/index.ts +5 -0
  9. package/lib/project-files/src/repos/MockOrm.ts +2 -2
  10. package/lib/project-files/src/repos/UserRepo.ts +1 -1
  11. package/lib/project-files/src/repos/database.test.json +1 -1
  12. package/lib/project-files/src/routes/UserRoutes.ts +3 -3
  13. package/lib/project-files/src/routes/{util → common/util}/index.ts +1 -1
  14. package/lib/project-files/src/routes/index.ts +1 -1
  15. package/lib/project-files/src/server.ts +5 -7
  16. package/lib/project-files/src/services/UserService.ts +2 -2
  17. package/package.json +1 -1
  18. /package/lib/project-files/src/{constants → common/constants}/ENV.ts +0 -0
  19. /package/lib/project-files/src/{constants → common/constants}/HttpStatusCodes.ts +0 -0
  20. /package/lib/project-files/src/{constants → common/constants}/Paths.ts +0 -0
  21. /package/lib/project-files/src/{constants → common/constants}/index.ts +0 -0
  22. /package/lib/project-files/src/{util → common/util}/misc.ts +0 -0
  23. /package/lib/project-files/src/{util → common/util}/validators.ts +0 -0
  24. /package/lib/project-files/src/routes/{types → common/types}/index.ts +0 -0
@@ -14,13 +14,13 @@ const PROJECT_FOLDER_PATH = './project-files';
14
14
 
15
15
  // Project-folder dependencies
16
16
  const DEPENDENCIES = 'express dotenv morgan cookie-parser jet-logger ' +
17
- 'module-alias express-async-errors helmet jsonfile inserturlparams ' +
18
- 'jet-paths dayjs jet-env jet-validators',
17
+ 'module-alias helmet jsonfile inserturlparams jet-paths dayjs jet-env ' +
18
+ 'jet-validators',
19
19
  DEV_DEPENDENCIES = 'ts-node typescript nodemon find jasmine supertest ' +
20
- '@types/node @types/express @types/jasmine @types/find @types/morgan ' +
21
- '@types/cookie-parser @types/supertest fs-extra tsconfig-paths jiti @swc/core ' +
22
- '@types/jsonfile @types/fs-extra @types/module-alias @stylistic/eslint-plugin-js ' +
23
- 'eslint @eslint/js @types/eslint__js typescript-eslint eslint-plugin-n @stylistic/eslint-plugin-ts';
20
+ '@types/node @types/jasmine @types/find @types/morgan @types/cookie-parser ' +
21
+ '@types/supertest fs-extra tsconfig-paths jiti @swc/core @types/jsonfile ' +
22
+ '@types/fs-extra @types/module-alias @stylistic/eslint-plugin-js eslint ' +
23
+ '@eslint/js typescript-eslint eslint-plugin-n @stylistic/eslint-plugin-ts';
24
24
 
25
25
  // "ncp" options
26
26
  const ncpOpts = {
@@ -16,48 +16,45 @@
16
16
  "node": ">=16.0.0"
17
17
  },
18
18
  "dependencies": {
19
- "cookie-parser": "^1.4.6",
19
+ "cookie-parser": "^1.4.7",
20
20
  "dayjs": "^1.11.13",
21
- "dotenv": "^16.4.5",
22
- "express": "^4.18.1",
23
- "express-async-errors": "^3.1.1",
24
- "helmet": "^6.0.0",
21
+ "dotenv": "^16.5.0",
22
+ "express": "^5.1.0",
23
+ "helmet": "^8.1.0",
25
24
  "inserturlparams": "^2.0.5",
26
25
  "jet-env": "^1.1.4",
27
26
  "jet-logger": "^2.0.1",
28
27
  "jet-paths": "^1.1.0",
29
- "jet-validators": "^1.3.7",
28
+ "jet-validators": "^1.4.0",
30
29
  "jsonfile": "^6.1.0",
31
- "module-alias": "^2.2.2",
30
+ "module-alias": "^2.2.3",
32
31
  "morgan": "^1.10.0"
33
32
  },
34
33
  "devDependencies": {
35
- "@eslint/js": "^9.16.0",
36
- "@stylistic/eslint-plugin-js": "^2.11.0",
37
- "@stylistic/eslint-plugin-ts": "^2.8.0",
38
- "@swc/core": "^1.9.3",
39
- "@types/cookie-parser": "^1.4.3",
40
- "@types/eslint__js": "^8.42.3",
41
- "@types/express": "^4.17.13",
42
- "@types/find": "^0.2.1",
43
- "@types/fs-extra": "^9.0.13",
44
- "@types/jasmine": "^4.3.0",
45
- "@types/jsonfile": "^6.1.0",
34
+ "@eslint/js": "^9.25.1",
35
+ "@stylistic/eslint-plugin-js": "^4.2.0",
36
+ "@stylistic/eslint-plugin-ts": "^4.2.0",
37
+ "@swc/core": "^1.11.22",
38
+ "@types/cookie-parser": "^1.4.8",
39
+ "@types/find": "^0.2.4",
40
+ "@types/fs-extra": "^11.0.4",
41
+ "@types/jasmine": "^5.1.7",
42
+ "@types/jsonfile": "^6.1.4",
46
43
  "@types/module-alias": "^2.0.4",
47
- "@types/morgan": "^1.9.3",
48
- "@types/node": "^18.7.14",
49
- "@types/supertest": "^6.0.2",
50
- "eslint": "^9.11.1",
51
- "eslint-plugin-n": "^17.14.0",
44
+ "@types/morgan": "^1.9.9",
45
+ "@types/node": "^22.14.1",
46
+ "@types/supertest": "^6.0.3",
47
+ "eslint": "^9.25.1",
48
+ "eslint-plugin-n": "^17.17.0",
52
49
  "find": "^0.3.0",
53
- "fs-extra": "^10.1.0",
54
- "jasmine": "^4.3.0",
55
- "jiti": "^2.4.1",
56
- "nodemon": "^2.0.19",
57
- "supertest": "^6.3.4",
58
- "ts-node": "^10.9.1",
59
- "tsconfig-paths": "^4.1.0",
60
- "typescript": "^5.6.2",
61
- "typescript-eslint": "^8.8.0"
50
+ "fs-extra": "^11.3.0",
51
+ "jasmine": "^5.6.0",
52
+ "jiti": "^2.4.2",
53
+ "nodemon": "^3.1.10",
54
+ "supertest": "^7.1.0",
55
+ "ts-node": "^10.9.2",
56
+ "tsconfig-paths": "^4.2.0",
57
+ "typescript": "^5.8.3",
58
+ "typescript-eslint": "^8.31.0"
62
59
  }
63
60
  }
@@ -1,5 +1,5 @@
1
1
  import jetPaths from 'jet-paths';
2
- import Paths from '@src/constants/Paths';
2
+ import Paths from '@src/common/constants/Paths';
3
3
 
4
4
 
5
5
  export default jetPaths(Paths);
@@ -8,8 +8,8 @@ import UserRepo from '@src/repos/UserRepo';
8
8
  import User, { IUser } from '@src/models/User';
9
9
  import { USER_NOT_FOUND_ERR } from '@src/services/UserService';
10
10
 
11
- import HttpStatusCodes from '@src/constants/HttpStatusCodes';
12
- import { ValidationError } from '@src/util/route-errors';
11
+ import HttpStatusCodes from '@src/common/constants/HttpStatusCodes';
12
+ import { ValidationError } from '@src/common/util/route-errors';
13
13
 
14
14
  import Paths from 'spec/support/Paths';
15
15
  import { cleanDatabase, parseValidationErr, TRes } from 'spec/support';
@@ -1,6 +1,6 @@
1
1
  import { IParseObjectError } from 'jet-validators/utils';
2
2
 
3
- import HttpStatusCodes from '@src/constants/HttpStatusCodes';
3
+ import HttpStatusCodes from '@src/common/constants/HttpStatusCodes';
4
4
 
5
5
 
6
6
  /******************************************************************************
@@ -1,6 +1,6 @@
1
1
  import logger from 'jet-logger';
2
2
 
3
- import ENV from '@src/constants/ENV';
3
+ import ENV from '@src/common/constants/ENV';
4
4
  import server from './server';
5
5
 
6
6
 
@@ -1,7 +1,8 @@
1
1
  import { isString } from 'jet-validators';
2
2
  import { parseObject, TParseOnError } from 'jet-validators/utils';
3
3
 
4
- import { isRelationalKey, transIsDate } from '@src/util/validators';
4
+ import { isRelationalKey, transIsDate } from '@src/common/util/validators';
5
+ import { IModel } from './common/types';
5
6
 
6
7
 
7
8
  /******************************************************************************
@@ -20,11 +21,9 @@ const DEFAULT_USER_VALS = (): IUser => ({
20
21
  Types
21
22
  ******************************************************************************/
22
23
 
23
- export interface IUser {
24
- id: number;
24
+ export interface IUser extends IModel {
25
25
  name: string;
26
26
  email: string;
27
- created: Date;
28
27
  }
29
28
 
30
29
 
@@ -0,0 +1,5 @@
1
+
2
+ export interface IModel {
3
+ id: number;
4
+ created: Date;
5
+ }
@@ -1,7 +1,7 @@
1
1
  import jsonfile from 'jsonfile';
2
2
 
3
- import ENV from '@src/constants/ENV';
4
- import { NodeEnvs } from '@src/constants';
3
+ import ENV from '@src/common/constants/ENV';
4
+ import { NodeEnvs } from '@src/common/constants';
5
5
  import { IUser } from '@src/models/User';
6
6
 
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { IUser } from '@src/models/User';
2
- import { getRandomInt } from '@src/util/misc';
2
+ import { getRandomInt } from '@src/common/util/misc';
3
3
 
4
4
  import orm from './MockOrm';
5
5
 
@@ -1 +1 @@
1
- {"users":[{"id":866076075124,"name":"Bill","created":"2025-04-13T01:17:38.963Z","email":"sean.maxwell@gmail.com"},{"id":179941579839,"name":"John Smith","created":"2025-04-13T01:17:38.963Z","email":"john.smith@gmail.com"},{"id":361998639557,"name":"Gordan Freeman","created":"2025-04-13T01:17:38.963Z","email":"gordan.freeman@gmail.com"}]}
1
+ {"users":[{"id":53597750560,"name":"Bill","created":"2025-04-23T22:13:36.714Z","email":"sean.maxwell@gmail.com"},{"id":343509021766,"name":"John Smith","created":"2025-04-23T22:13:36.714Z","email":"john.smith@gmail.com"},{"id":223752183095,"name":"Gordan Freeman","created":"2025-04-23T22:13:36.714Z","email":"gordan.freeman@gmail.com"}]}
@@ -1,12 +1,12 @@
1
1
  import { isNumber } from 'jet-validators';
2
2
  import { transform } from 'jet-validators/utils';
3
3
 
4
- import HttpStatusCodes from '@src/constants/HttpStatusCodes';
4
+ import HttpStatusCodes from '@src/common/constants/HttpStatusCodes';
5
5
  import UserService from '@src/services/UserService';
6
6
  import User from '@src/models/User';
7
7
 
8
- import { IReq, IRes } from './types';
9
- import { parseReq } from './util';
8
+ import { IReq, IRes } from './common/types';
9
+ import { parseReq } from './common/util';
10
10
 
11
11
 
12
12
  /******************************************************************************
@@ -1,6 +1,6 @@
1
1
  import { parseObject, TSchema } from 'jet-validators/utils';
2
2
 
3
- import { ValidationError } from '@src/util/route-errors';
3
+ import { ValidationError } from '@src/common/util/route-errors';
4
4
 
5
5
 
6
6
  /******************************************************************************
@@ -1,6 +1,6 @@
1
1
  import { Router } from 'express';
2
2
 
3
- import Paths from '@src/constants/Paths';
3
+ import Paths from '@src/common/constants/Paths';
4
4
  import UserRoutes from './UserRoutes';
5
5
 
6
6
 
@@ -4,15 +4,13 @@ import helmet from 'helmet';
4
4
  import express, { Request, Response, NextFunction } from 'express';
5
5
  import logger from 'jet-logger';
6
6
 
7
- import 'express-async-errors';
8
-
9
7
  import BaseRouter from '@src/routes';
10
8
 
11
- import Paths from '@src/constants/Paths';
12
- import ENV from '@src/constants/ENV';
13
- import HttpStatusCodes from '@src/constants/HttpStatusCodes';
14
- import { RouteError } from '@src/util/route-errors';
15
- import { NodeEnvs } from '@src/constants';
9
+ import Paths from '@src/common/constants/Paths';
10
+ import ENV from '@src/common/constants/ENV';
11
+ import HttpStatusCodes from '@src/common/constants/HttpStatusCodes';
12
+ import { RouteError } from '@src/common/util/route-errors';
13
+ import { NodeEnvs } from '@src/common/constants';
16
14
 
17
15
 
18
16
  /******************************************************************************
@@ -1,5 +1,5 @@
1
- import { RouteError } from '@src/util/route-errors';
2
- import HttpStatusCodes from '@src/constants/HttpStatusCodes';
1
+ import { RouteError } from '@src/common/util/route-errors';
2
+ import HttpStatusCodes from '@src/common/constants/HttpStatusCodes';
3
3
 
4
4
  import UserRepo from '@src/repos/UserRepo';
5
5
  import { IUser } from '@src/models/User';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-generator-typescript",
3
- "version": "2.6.1",
3
+ "version": "2.6.3",
4
4
  "description": "Generate new Express applications similar to express-generate which but sets it up to use TypeScript instead",
5
5
  "scripts": {
6
6
  "express-generator-typescript": "node bin/cli.js",