express-generator-typescript 1.9.8 → 1.10.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.
package/bin/cli.js CHANGED
@@ -11,38 +11,38 @@ const expressGenTs = require('../lib/express-generator-typescript');
11
11
 
12
12
 
13
13
  (() => {
14
- console.log('Setting up new Express/TypeScript project...');
15
- // const opts = processOptions(process.argv.slice(2));
16
- // Process options
17
- let destination = 'express-gen-ts';
18
- let withAuth = false;
19
- let useYarn = false;
20
- let useSocketIo = false;
21
- const args = process.argv.slice(2);
22
- let idx = -1;
23
- idx = args.indexOf('--with-auth');
24
- if (idx > -1) {
25
- withAuth = true;
26
- args.splice(idx, 1);
27
- }
28
- idx = args.indexOf('--use-yarn');
29
- if (idx > -1) {
30
- useYarn = true;
31
- args.splice(idx, 1);
32
- }
33
- idx = args.indexOf('--socket-io');
34
- if (idx > -1) {
35
- useSocketIo = true;
36
- withAuth = true;
37
- args.splice(idx, 1);
38
- }
39
- if (args.length > 0) {
40
- destination = args[0];
41
- }
42
- destination = path.join(process.cwd(), destination);
43
- // Creating new project finished
44
- expressGenTs(destination, withAuth, useYarn, useSocketIo).then(() => {
45
- console.log('Project setup complete!');
46
- });
14
+ console.log('Setting up new Express/TypeScript project...');
15
+ // const opts = processOptions(process.argv.slice(2));
16
+ // Process options
17
+ let destination = 'express-gen-ts';
18
+ let withAuth = false;
19
+ let useYarn = false;
20
+ let useSocketIo = false;
21
+ const args = process.argv.slice(2);
22
+ let idx = -1;
23
+ idx = args.indexOf('--with-auth');
24
+ if (idx > -1) {
25
+ withAuth = true;
26
+ args.splice(idx, 1);
27
+ }
28
+ idx = args.indexOf('--use-yarn');
29
+ if (idx > -1) {
30
+ useYarn = true;
31
+ args.splice(idx, 1);
32
+ }
33
+ idx = args.indexOf('--socket-io');
34
+ if (idx > -1) {
35
+ useSocketIo = true;
36
+ withAuth = true;
37
+ args.splice(idx, 1);
38
+ }
39
+ if (args.length > 0) {
40
+ destination = args[0];
41
+ }
42
+ destination = path.join(process.cwd(), destination);
43
+ // Creating new project finished
44
+ expressGenTs(destination, withAuth, useYarn, useSocketIo).then(() => {
45
+ console.log('Project setup complete!');
46
+ });
47
47
  })();
48
48
 
@@ -14,7 +14,7 @@ const fs = require('fs');
14
14
  // **** Variables **** //
15
15
 
16
16
  const ncpOpts = {
17
- filter: new RegExp('^((?!node_modules).)*$'),
17
+ filter: new RegExp('^(?!.*(node_modules|package-lock.json)).*$'),
18
18
  };
19
19
 
20
20
 
@@ -27,7 +27,7 @@ async function expressGenTs(destination, withAuth, useYarn, useSocketIo) {
27
27
  try {
28
28
  await copyProjectFiles(destination, withAuth, useSocketIo);
29
29
  updatePackageJson(destination);
30
- await renameGitingoreFile(destination);
30
+ await renameGitigoreFile(destination);
31
31
  const depStrings = getDepStrings(withAuth, useSocketIo);
32
32
  downloadNodeModules(destination, depStrings, useYarn);
33
33
  } catch (err) {
@@ -48,8 +48,8 @@ function copyProjectFiles(destination, withAuth, useSocketIo) {
48
48
  const source = path.join(__dirname, prjFolder);
49
49
  // Return
50
50
  return new Promise((res, rej) => {
51
- ncp.limit = 16;
52
- ncp(source, destination, ncpOpts, (err) => {
51
+ ncp.limit = 32;
52
+ return ncp(source, destination, ncpOpts, (err) => {
53
53
  return (!!err ? rej(err) : res());
54
54
  });
55
55
  });
@@ -70,7 +70,7 @@ function updatePackageJson(destination) {
70
70
  /**
71
71
  * Because npm does not allow .gitignore to be published.
72
72
  */
73
- function renameGitingoreFile(destination) {
73
+ function renameGitigoreFile(destination) {
74
74
  return new Promise((res, rej) => {
75
75
  fs.rename(destination + '/gitignore', destination + '/.gitignore', (err) => {
76
76
  return (!!err ? rej(err) : res());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-generator-typescript",
3
- "version": "1.9.8",
3
+ "version": "1.10.1",
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",