express-generator-typescript 2.1.6 → 2.1.7
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.
|
@@ -15,8 +15,6 @@ import childProcess from 'child_process';
|
|
|
15
15
|
// Copy front-end files
|
|
16
16
|
await copy('./src/public', './dist/public');
|
|
17
17
|
await copy('./src/views', './dist/views');
|
|
18
|
-
// Copy production env file
|
|
19
|
-
await copy('./src/pre-start/env/production.env', './dist/pre-start/env/production.env');
|
|
20
18
|
// Copy back-end files
|
|
21
19
|
await exec('tsc --build tsconfig.prod.json', './');
|
|
22
20
|
} catch (err) {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unsafe-return */
|
|
2
2
|
|
|
3
3
|
import jsonfile from 'jsonfile';
|
|
4
|
+
|
|
4
5
|
import { IUser } from '@models/user-model';
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
// **** Variables **** //
|
|
8
9
|
|
|
9
|
-
const
|
|
10
|
+
const dbFileName = 'database.json';
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
// **** Types **** //
|
|
@@ -22,14 +23,14 @@ interface IDb {
|
|
|
22
23
|
* Fetch the json from the file.
|
|
23
24
|
*/
|
|
24
25
|
function openDb(): Promise<IDb> {
|
|
25
|
-
return jsonfile.readFile(
|
|
26
|
+
return jsonfile.readFile(__dirname + '/' + dbFileName);
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* Update the file.
|
|
30
31
|
*/
|
|
31
32
|
function saveDb(db: IDb): Promise<void> {
|
|
32
|
-
return jsonfile.writeFile(
|
|
33
|
+
return jsonfile.writeFile((__dirname + '/' + dbFileName), db);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
|
|
@@ -2,7 +2,7 @@ import StatusCodes from 'http-status-codes';
|
|
|
2
2
|
import { Request, Response, NextFunction, RequestHandler } from 'express';
|
|
3
3
|
import { JwtPayload } from 'jsonwebtoken';
|
|
4
4
|
|
|
5
|
-
import envVars from '
|
|
5
|
+
import envVars from '@shared/env-vars';
|
|
6
6
|
import jwtUtil from '@util/jwt-util';
|
|
7
7
|
import { IUser, UserRoles } from '@models/user-model';
|
|
8
8
|
import { ParamInvalidError, ValidatorFnError } from '@shared/errors';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-generator-typescript",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.7",
|
|
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",
|