express-generator-typescript 1.9.5 → 1.9.8

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.
@@ -29,7 +29,45 @@
29
29
  "@util": "dist/util"
30
30
  },
31
31
  "dependencies": {
32
+ "bcrypt": "^5.0.1",
33
+ "command-line-args": "^5.2.1",
34
+ "cookie-parser": "^1.4.6",
35
+ "dotenv": "^16.0.2",
36
+ "express": "^4.18.1",
37
+ "express-async-errors": "^3.1.1",
38
+ "helmet": "^6.0.0",
39
+ "http-status-codes": "^2.2.0",
40
+ "jet-logger": "^1.2.3",
41
+ "jsonfile": "^6.1.0",
42
+ "jsonwebtoken": "^8.5.1",
43
+ "module-alias": "^2.2.2",
44
+ "morgan": "^1.10.0",
45
+ "randomstring": "^1.2.2"
32
46
  },
33
47
  "devDependencies": {
48
+ "@types/bcrypt": "^5.0.0",
49
+ "@types/command-line-args": "^5.2.0",
50
+ "@types/cookie-parser": "^1.4.3",
51
+ "@types/express": "^4.17.13",
52
+ "@types/find": "^0.2.1",
53
+ "@types/fs-extra": "^9.0.13",
54
+ "@types/jasmine": "^4.3.0",
55
+ "@types/jsonfile": "^6.1.0",
56
+ "@types/jsonwebtoken": "^8.5.9",
57
+ "@types/morgan": "^1.9.3",
58
+ "@types/node": "^18.7.14",
59
+ "@types/randomstring": "^1.1.8",
60
+ "@types/supertest": "^2.0.12",
61
+ "@typescript-eslint/eslint-plugin": "^5.36.1",
62
+ "@typescript-eslint/parser": "^5.36.1",
63
+ "eslint": "^8.23.0",
64
+ "find": "^0.3.0",
65
+ "fs-extra": "^10.1.0",
66
+ "jasmine": "^4.3.0",
67
+ "nodemon": "^2.0.19",
68
+ "supertest": "^6.2.4",
69
+ "ts-node": "^10.9.1",
70
+ "tsconfig-paths": "^4.1.0",
71
+ "typescript": "^4.8.2"
34
72
  }
35
73
  }
@@ -8,8 +8,18 @@ const path = require('path');
8
8
  const editJsonFile = require('edit-json-file');
9
9
  const childProcess = require('child_process');
10
10
  const ncp = require('ncp').ncp;
11
+ const fs = require('fs');
11
12
 
12
13
 
14
+ // **** Variables **** //
15
+
16
+ const ncpOpts = {
17
+ filter: new RegExp('^((?!node_modules).)*$'),
18
+ };
19
+
20
+
21
+ // **** Functions **** //
22
+
13
23
  /**
14
24
  * Entry point
15
25
  */
@@ -17,6 +27,7 @@ async function expressGenTs(destination, withAuth, useYarn, useSocketIo) {
17
27
  try {
18
28
  await copyProjectFiles(destination, withAuth, useSocketIo);
19
29
  updatePackageJson(destination);
30
+ await renameGitingoreFile(destination);
20
31
  const depStrings = getDepStrings(withAuth, useSocketIo);
21
32
  downloadNodeModules(destination, depStrings, useYarn);
22
33
  } catch (err) {
@@ -36,25 +47,35 @@ function copyProjectFiles(destination, withAuth, useSocketIo) {
36
47
  }
37
48
  const source = path.join(__dirname, prjFolder);
38
49
  // Return
39
- return new Promise((resolve, reject) => {
50
+ return new Promise((res, rej) => {
40
51
  ncp.limit = 16;
41
- ncp(source, destination, (err) => {
42
- if (err) {
43
- reject(err);
44
- }
45
- resolve();
52
+ ncp(source, destination, ncpOpts, (err) => {
53
+ return (!!err ? rej(err) : res());
46
54
  });
47
55
  });
48
56
  }
49
57
 
50
58
  /**
51
- * Set project name in package.json.
59
+ * Set update the package.json file.
52
60
  */
53
61
  function updatePackageJson(destination) {
54
62
  let file = editJsonFile(destination + '/package.json', {
55
63
  autosave: true
56
64
  });
57
65
  file.set('name', path.basename(destination));
66
+ file.set('dependencies', {});
67
+ file.set('devDependencies', {});
68
+ }
69
+
70
+ /**
71
+ * Because npm does not allow .gitignore to be published.
72
+ */
73
+ function renameGitingoreFile(destination) {
74
+ return new Promise((res, rej) => {
75
+ fs.rename(destination + '/gitignore', destination + '/.gitignore', (err) => {
76
+ return (!!err ? rej(err) : res());
77
+ });
78
+ });
58
79
  }
59
80
 
60
81
  /**
@@ -76,10 +97,7 @@ function getDepStrings(withAuth, useSocketIo) {
76
97
  dependencies += ' socket.io socket.io-client';
77
98
  }
78
99
  // Return
79
- return {
80
- dependencies,
81
- devDependencies,
82
- };
100
+ return { dependencies, devDependencies };
83
101
  }
84
102
 
85
103
  /**
@@ -21,6 +21,7 @@
21
21
  "no-console": 1,
22
22
  "no-extra-boolean-cast": 0,
23
23
  "semi": 1,
24
- "@typescript-eslint/no-misused-promises": 0
24
+ "@typescript-eslint/no-misused-promises": 0,
25
+ "@typescript-eslint/no-floating-promises": 0
25
26
  }
26
27
  }
@@ -0,0 +1,3 @@
1
+ **/node_modules
2
+ dist/
3
+ **/**/*.log