express-generator-typescript 2.7.11 → 2.7.12
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/lib/express-generator-typescript.js +44 -11
- package/lib/project-files/.prettierignore +12 -0
- package/lib/project-files/.prettierrc.json +15 -0
- package/lib/project-files/README.md +58 -65
- package/lib/project-files/config.ts +20 -22
- package/lib/project-files/eslint.config.ts +46 -100
- package/lib/project-files/package.json +59 -56
- package/lib/project-files/scripts/build.ts +23 -28
- package/lib/project-files/scripts/common/utils.ts +11 -11
- package/lib/project-files/src/common/constants/HttpStatusCodes.ts +393 -394
- package/lib/project-files/src/common/constants/Paths.ts +15 -15
- package/lib/project-files/src/common/constants/{EnvVars.ts → env.ts} +28 -19
- package/lib/project-files/src/common/utils/{misc.ts → number-utils.ts} +10 -11
- package/lib/project-files/src/common/utils/route-errors.ts +35 -36
- package/lib/project-files/src/common/utils/validators.ts +14 -14
- package/lib/project-files/src/{index.ts → main.ts} +24 -27
- package/lib/project-files/src/models/User.ts +69 -72
- package/lib/project-files/src/models/common/{types.ts → IModel.ts} +4 -5
- package/lib/project-files/src/public/stylesheets/users.css +50 -48
- package/lib/project-files/src/repos/MockOrm.ts +57 -63
- package/lib/project-files/src/repos/UserRepo.ts +133 -133
- package/lib/project-files/src/repos/common/database.test.json +22 -0
- package/lib/project-files/src/routes/UserRoutes.ts +77 -69
- package/lib/project-files/src/routes/{index.ts → apiRouter.ts} +28 -28
- package/lib/project-files/src/routes/common/{types.ts → express-types.ts} +9 -10
- package/lib/project-files/src/routes/common/{utils.ts → parseReq.ts} +19 -16
- package/lib/project-files/src/server.ts +79 -84
- package/lib/project-files/src/services/{UserService/index.ts → UserService.ts} +64 -58
- package/lib/project-files/src/views/users.html +118 -132
- package/lib/project-files/tests/common/{utils.ts → comparators.ts} +38 -55
- package/lib/project-files/tests/common/error-utils.ts +25 -0
- package/lib/project-files/tests/common/{types.ts → supertest-types.ts} +15 -16
- package/lib/project-files/tests/{aux/setup.ts → support/agent.ts} +23 -26
- package/lib/project-files/tests/users.test.ts +131 -123
- package/lib/project-files/tsconfig.json +30 -35
- package/lib/project-files/tsconfig.prod.json +27 -30
- package/lib/project-files/vitest.config.mts +18 -18
- package/package.json +1 -1
- package/lib/project-files/src/common/constants/index.ts +0 -11
- package/lib/project-files/src/repos/database.test.json +0 -1
- package/lib/project-files/src/services/UserService/constants.ts +0 -5
- /package/lib/project-files/src/repos/{database.json → common/database.json} +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { isString } from 'jet-validators';
|
|
2
|
+
import { ParseError, parseJson } from 'jet-validators/utils';
|
|
3
|
+
|
|
4
|
+
/******************************************************************************
|
|
5
|
+
Types
|
|
6
|
+
******************************************************************************/
|
|
7
|
+
|
|
8
|
+
interface IValidationError {
|
|
9
|
+
message: string;
|
|
10
|
+
errors: ParseError[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/******************************************************************************
|
|
14
|
+
Functions
|
|
15
|
+
******************************************************************************/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* JSON parse a validation error.
|
|
19
|
+
*/
|
|
20
|
+
export function parseValidationError(arg: unknown): IValidationError {
|
|
21
|
+
if (!isString(arg)) {
|
|
22
|
+
throw new Error('Not a string');
|
|
23
|
+
}
|
|
24
|
+
return parseJson<IValidationError>(arg);
|
|
25
|
+
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { Response } from 'supertest';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
1
|
+
import { Response } from 'supertest';
|
|
2
|
+
|
|
3
|
+
/******************************************************************************
|
|
4
|
+
Types
|
|
5
|
+
******************************************************************************/
|
|
6
|
+
|
|
7
|
+
// Use generics to add properties to 'body'
|
|
8
|
+
export interface IRes<T = object> extends Omit<Response, 'body'> {
|
|
9
|
+
body: T & { error?: string | IErrorObject };
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface IErrorObject {
|
|
13
|
+
message: string;
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
@@ -1,26 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import app from '@src/server';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
******************************************************************************/
|
|
25
|
-
|
|
26
|
-
export { agent };
|
|
1
|
+
import supertest, { Test } from 'supertest';
|
|
2
|
+
import TestAgent from 'supertest/lib/agent';
|
|
3
|
+
import { beforeAll } from 'vitest';
|
|
4
|
+
|
|
5
|
+
import MockOrm from '@src/repos/MockOrm';
|
|
6
|
+
import app from '@src/server';
|
|
7
|
+
|
|
8
|
+
/******************************************************************************
|
|
9
|
+
Run
|
|
10
|
+
******************************************************************************/
|
|
11
|
+
|
|
12
|
+
let agent: TestAgent<Test>;
|
|
13
|
+
|
|
14
|
+
beforeAll(async () => {
|
|
15
|
+
agent = supertest.agent(app);
|
|
16
|
+
await MockOrm.cleanDb();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/******************************************************************************
|
|
20
|
+
Export
|
|
21
|
+
******************************************************************************/
|
|
22
|
+
|
|
23
|
+
export { agent };
|
|
@@ -1,123 +1,131 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
/******************************************************************************
|
|
14
|
-
Constants
|
|
15
|
-
******************************************************************************/
|
|
16
|
-
|
|
17
|
-
const DUMMY_USERS = [
|
|
18
|
-
User.new({ name: 'Sean Maxwell', email: 'sean.maxwell@gmail.com' }),
|
|
19
|
-
User.new({ name: 'John Smith', email: 'john.smith@gmail.com' }),
|
|
20
|
-
User.new({ name: 'Gordan Freeman', email: 'gordan.freeman@gmail.com' }),
|
|
21
|
-
] as const;
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
1
|
+
import HttpStatusCodes from '@src/common/constants/HttpStatusCodes';
|
|
2
|
+
import { JetPaths as Paths } from '@src/common/constants/Paths';
|
|
3
|
+
import { ValidationError } from '@src/common/utils/route-errors';
|
|
4
|
+
import User, { IUser } from '@src/models/User';
|
|
5
|
+
import UserRepo from '@src/repos/UserRepo';
|
|
6
|
+
|
|
7
|
+
import { agent } from './support/agent';
|
|
8
|
+
import { IRes } from './common/supertest-types';
|
|
9
|
+
import { parseValidationError } from './common/error-utils';
|
|
10
|
+
import UserService from '@src/services/UserService';
|
|
11
|
+
import { compareUserArrays } from './common/comparators';
|
|
12
|
+
|
|
13
|
+
/******************************************************************************
|
|
14
|
+
Constants
|
|
15
|
+
******************************************************************************/
|
|
16
|
+
|
|
17
|
+
const DUMMY_USERS = [
|
|
18
|
+
User.new({ name: 'Sean Maxwell', email: 'sean.maxwell@gmail.com' }),
|
|
19
|
+
User.new({ name: 'John Smith', email: 'john.smith@gmail.com' }),
|
|
20
|
+
User.new({ name: 'Gordan Freeman', email: 'gordan.freeman@gmail.com' }),
|
|
21
|
+
] as const;
|
|
22
|
+
|
|
23
|
+
const { BAD_REQUEST, CREATED, OK, NOT_FOUND } = HttpStatusCodes;
|
|
24
|
+
|
|
25
|
+
/******************************************************************************
|
|
26
|
+
Tests
|
|
27
|
+
IMPORTANT: Following TypeScript best practices, we test all scenarios that
|
|
28
|
+
can be triggered by a user under normal circumstances. Not all theoretically
|
|
29
|
+
scenarios (i.e. a failed database connection).
|
|
30
|
+
******************************************************************************/
|
|
31
|
+
|
|
32
|
+
describe('UserRouter', () => {
|
|
33
|
+
let dbUsers: IUser[] = [];
|
|
34
|
+
|
|
35
|
+
beforeEach(async () => {
|
|
36
|
+
await UserRepo.deleteAllUsers();
|
|
37
|
+
dbUsers = await UserRepo.insertMultiple(DUMMY_USERS);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
describe(`"GET:${Paths.Users.Get}"`, () => {
|
|
41
|
+
it(
|
|
42
|
+
'should return a JSON object with all the users and a status code of ' +
|
|
43
|
+
`"${OK}" if the request was successful.`,
|
|
44
|
+
async () => {
|
|
45
|
+
const res: IRes<{ users: IUser[] }> = await agent.get(Paths.Users.Get);
|
|
46
|
+
expect(res.status).toBe(OK);
|
|
47
|
+
expect(compareUserArrays(res.body.users, DUMMY_USERS)).toBeTruthy();
|
|
48
|
+
},
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
describe(`"POST:${Paths.Users.Add}"`, () => {
|
|
53
|
+
it(
|
|
54
|
+
`should return a status code of "${CREATED}" if the request was ` +
|
|
55
|
+
'successful.',
|
|
56
|
+
async () => {
|
|
57
|
+
const user = User.new({ name: 'a', email: 'a@a.com' }),
|
|
58
|
+
res = await agent.post(Paths.Users.Add).send({ user });
|
|
59
|
+
expect(res.status).toBe(CREATED);
|
|
60
|
+
},
|
|
61
|
+
);
|
|
62
|
+
|
|
63
|
+
it(
|
|
64
|
+
'should return a JSON object with an error message of and a status ' +
|
|
65
|
+
`code of "${BAD_REQUEST}" if the user param was missing.`,
|
|
66
|
+
async () => {
|
|
67
|
+
const res: IRes = await agent
|
|
68
|
+
.post(Paths.Users.Add)
|
|
69
|
+
.send({ user: null });
|
|
70
|
+
expect(res.status).toBe(BAD_REQUEST);
|
|
71
|
+
const errorObject = parseValidationError(res.body.error);
|
|
72
|
+
expect(errorObject.message).toBe(ValidationError.MESSAGE);
|
|
73
|
+
expect(errorObject.errors[0].key).toStrictEqual('user');
|
|
74
|
+
},
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
describe(`"PUT:${Paths.Users.Update}"`, () => {
|
|
79
|
+
it(`should return a status code of "${OK}" if the request was successfull`, async () => {
|
|
80
|
+
const user = DUMMY_USERS[0];
|
|
81
|
+
user.name = 'Bill';
|
|
82
|
+
const res = await agent.put(Paths.Users.Update).send({ user });
|
|
83
|
+
expect(res.status).toBe(OK);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it(
|
|
87
|
+
'should return a JSON object with an error message and a status code ' +
|
|
88
|
+
`of "${BAD_REQUEST}" if id is the wrong data type`,
|
|
89
|
+
async () => {
|
|
90
|
+
const user = User.new();
|
|
91
|
+
user.id = '5' as unknown as number;
|
|
92
|
+
const res: IRes = await agent.put(Paths.Users.Update).send({ user });
|
|
93
|
+
expect(res.status).toBe(BAD_REQUEST);
|
|
94
|
+
const errorObj = parseValidationError(res.body.error);
|
|
95
|
+
expect(errorObj.message).toBe(ValidationError.MESSAGE);
|
|
96
|
+
expect(errorObj.errors[0].keyPath).toStrictEqual(['user', 'id']);
|
|
97
|
+
},
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
it(
|
|
101
|
+
'should return a JSON object with the error message of ' +
|
|
102
|
+
`"${UserService.Errors.USER_NOT_FOUND}" and a status code of ` +
|
|
103
|
+
`"${NOT_FOUND}" if the id was not found.`,
|
|
104
|
+
async () => {
|
|
105
|
+
const user = User.new({ id: 4, name: 'a', email: 'a@a.com' }),
|
|
106
|
+
res: IRes = await agent.put(Paths.Users.Update).send({ user });
|
|
107
|
+
expect(res.status).toBe(NOT_FOUND);
|
|
108
|
+
expect(res.body.error).toBe(UserService.Errors.USER_NOT_FOUND);
|
|
109
|
+
},
|
|
110
|
+
);
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
describe(`"DELETE:${Paths.Users.Delete()}"`, () => {
|
|
114
|
+
it(`should return a status code of "${OK}" if the request was successful.`, async () => {
|
|
115
|
+
const id = dbUsers[0].id,
|
|
116
|
+
res = await agent.delete(Paths.Users.Delete(id));
|
|
117
|
+
expect(res.status).toBe(OK);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it(
|
|
121
|
+
'should return a JSON object with the error message of ' +
|
|
122
|
+
`"${UserService.Errors.USER_NOT_FOUND}" and a status code of ` +
|
|
123
|
+
'"${NOT_FOUND}" if the id was not found.',
|
|
124
|
+
async () => {
|
|
125
|
+
const res: IRes = await agent.delete(Paths.Users.Delete(-1));
|
|
126
|
+
expect(res.status).toBe(NOT_FOUND);
|
|
127
|
+
expect(res.body.error).toBe(UserService.Errors.USER_NOT_FOUND);
|
|
128
|
+
},
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
});
|
|
@@ -1,35 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "
|
|
5
|
-
"lib": ["ES2020"],
|
|
6
|
-
"strict": true,
|
|
7
|
-
"baseUrl": "./",
|
|
8
|
-
"esModuleInterop": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"paths": {
|
|
12
|
-
"@src/*": ["src/*"]
|
|
13
|
-
},
|
|
14
|
-
"useUnknownInCatchVariables": false,
|
|
15
|
-
"types": ["vitest/globals"]
|
|
16
|
-
},
|
|
17
|
-
"ts-node": {
|
|
18
|
-
"swc": true,
|
|
19
|
-
"require": [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"config.
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
],
|
|
32
|
-
"exclude": [
|
|
33
|
-
"src/public/*"
|
|
34
|
-
]
|
|
35
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "commonjs",
|
|
5
|
+
"lib": ["ES2020"],
|
|
6
|
+
"strict": true,
|
|
7
|
+
"baseUrl": "./",
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"paths": {
|
|
12
|
+
"@src/*": ["src/*"]
|
|
13
|
+
},
|
|
14
|
+
"useUnknownInCatchVariables": false,
|
|
15
|
+
"types": ["vitest/globals"]
|
|
16
|
+
},
|
|
17
|
+
"ts-node": {
|
|
18
|
+
"swc": true,
|
|
19
|
+
"require": ["tsconfig-paths/register", "./config.ts"]
|
|
20
|
+
},
|
|
21
|
+
"include": [
|
|
22
|
+
"src/**/*.ts",
|
|
23
|
+
"tests/**/*.ts",
|
|
24
|
+
"config.ts",
|
|
25
|
+
"scripts",
|
|
26
|
+
"eslint.config.ts",
|
|
27
|
+
"vitest.config.mts"
|
|
28
|
+
],
|
|
29
|
+
"exclude": ["src/public/*"]
|
|
30
|
+
}
|
|
@@ -1,30 +1,27 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ES2020",
|
|
4
|
-
"module": "CommonJS",
|
|
5
|
-
"lib": ["ES2020"],
|
|
6
|
-
"strict": true,
|
|
7
|
-
"baseUrl": "./",
|
|
8
|
-
"outDir": "temp",
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"forceConsistentCasingInFileNames": true,
|
|
12
|
-
"paths": {
|
|
13
|
-
"@src/*": ["src/*"]
|
|
14
|
-
},
|
|
15
|
-
"useUnknownInCatchVariables": false,
|
|
16
|
-
"sourceMap": false,
|
|
17
|
-
"removeComments": true
|
|
18
|
-
},
|
|
19
|
-
"include": [
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"vitest.config.js"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"lib": ["ES2020"],
|
|
6
|
+
"strict": true,
|
|
7
|
+
"baseUrl": "./",
|
|
8
|
+
"outDir": "temp",
|
|
9
|
+
"esModuleInterop": true,
|
|
10
|
+
"skipLibCheck": true,
|
|
11
|
+
"forceConsistentCasingInFileNames": true,
|
|
12
|
+
"paths": {
|
|
13
|
+
"@src/*": ["src/*"]
|
|
14
|
+
},
|
|
15
|
+
"useUnknownInCatchVariables": false,
|
|
16
|
+
"sourceMap": false,
|
|
17
|
+
"removeComments": true
|
|
18
|
+
},
|
|
19
|
+
"include": ["src/**/*.ts", "config.ts"],
|
|
20
|
+
"exclude": [
|
|
21
|
+
"tests",
|
|
22
|
+
"src/public/",
|
|
23
|
+
"scripts",
|
|
24
|
+
"eslint.config.ts",
|
|
25
|
+
"vitest.config.js"
|
|
26
|
+
]
|
|
27
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
const config = defineConfig({
|
|
5
|
-
test: {
|
|
6
|
-
globals: true,
|
|
7
|
-
environment: 'node',
|
|
8
|
-
setupFiles: ['config.ts', './tests/
|
|
9
|
-
isolate: true,
|
|
10
|
-
},
|
|
11
|
-
resolve: {
|
|
12
|
-
alias: {
|
|
13
|
-
'@src': path.resolve(__dirname, './src'),
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export default config;
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { defineConfig } from 'vitest/config';
|
|
3
|
+
|
|
4
|
+
const config = defineConfig({
|
|
5
|
+
test: {
|
|
6
|
+
globals: true,
|
|
7
|
+
environment: 'node',
|
|
8
|
+
setupFiles: ['config.ts', './tests/support/agent.ts'],
|
|
9
|
+
isolate: true,
|
|
10
|
+
},
|
|
11
|
+
resolve: {
|
|
12
|
+
alias: {
|
|
13
|
+
'@src': path.resolve(__dirname, './src'),
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export default config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-generator-typescript",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.12",
|
|
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",
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/******************************************************************************
|
|
3
|
-
Constants
|
|
4
|
-
******************************************************************************/
|
|
5
|
-
|
|
6
|
-
// NOTE: These need to match the names of your ".env" files
|
|
7
|
-
export const NodeEnvs = {
|
|
8
|
-
DEV: 'development',
|
|
9
|
-
TEST: 'test',
|
|
10
|
-
PRODUCTION: 'production',
|
|
11
|
-
} as const;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"users":[{"id":547317739445,"name":"Bill","email":"sean.maxwell@gmail.com","created":"2026-01-10T04:06:20.291Z"},{"id":332906029656,"name":"John Smith","email":"john.smith@gmail.com","created":"2026-01-10T04:06:20.291Z"},{"id":421195709596,"name":"Gordan Freeman","email":"gordan.freeman@gmail.com","created":"2026-01-10T04:06:20.291Z"}]}
|
|
File without changes
|