@nestjs/cli 7.5.0 → 7.5.2

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 (80) hide show
  1. package/actions/abstract.action.js +1 -0
  2. package/actions/add.action.js +4 -3
  3. package/actions/build.action.js +7 -5
  4. package/actions/generate.action.js +7 -7
  5. package/actions/index.js +18 -11
  6. package/actions/info.action.js +4 -3
  7. package/actions/new.action.js +9 -8
  8. package/actions/start.action.js +7 -6
  9. package/actions/update.action.js +3 -2
  10. package/commands/abstract.command.js +1 -0
  11. package/commands/add.command.js +1 -0
  12. package/commands/build.command.js +1 -0
  13. package/commands/command.loader.js +1 -0
  14. package/commands/generate.command.js +8 -2
  15. package/commands/index.js +12 -4
  16. package/commands/info.command.js +1 -0
  17. package/commands/new.command.js +1 -0
  18. package/commands/start.command.js +1 -0
  19. package/commands/update.command.js +1 -0
  20. package/lib/compiler/assets-manager.js +3 -2
  21. package/lib/compiler/compiler.js +4 -3
  22. package/lib/compiler/defaults/webpack-defaults.js +1 -0
  23. package/lib/compiler/helpers/append-extension.js +1 -0
  24. package/lib/compiler/helpers/copy-path-resolve.js +2 -4
  25. package/lib/compiler/helpers/get-value-or-default.js +2 -1
  26. package/lib/compiler/helpers/tsconfig-provider.js +1 -0
  27. package/lib/compiler/hooks/tsconfig-paths.hook.js +12 -0
  28. package/lib/compiler/plugins-loader.js +11 -2
  29. package/lib/compiler/typescript-loader.d.ts +0 -1
  30. package/lib/compiler/typescript-loader.js +10 -26
  31. package/lib/compiler/watch-compiler.js +3 -2
  32. package/lib/compiler/webpack-compiler.d.ts +1 -1
  33. package/lib/compiler/webpack-compiler.js +8 -1
  34. package/lib/compiler/workspace-utils.js +2 -1
  35. package/lib/configuration/defaults.js +1 -0
  36. package/lib/configuration/index.js +13 -4
  37. package/lib/configuration/nest-configuration.loader.js +1 -0
  38. package/lib/dependency-managers/index.js +11 -4
  39. package/lib/dependency-managers/nest.dependency-manager.js +3 -2
  40. package/lib/package-managers/abstract.package-manager.d.ts +2 -2
  41. package/lib/package-managers/abstract.package-manager.js +5 -4
  42. package/lib/package-managers/index.js +17 -8
  43. package/lib/package-managers/npm.package-manager.d.ts +2 -2
  44. package/lib/package-managers/npm.package-manager.js +1 -0
  45. package/lib/package-managers/package-manager.factory.js +3 -2
  46. package/lib/package-managers/package-manager.js +1 -0
  47. package/lib/package-managers/yarn.package-manager.d.ts +2 -2
  48. package/lib/package-managers/yarn.package-manager.js +1 -0
  49. package/lib/questions/questions.js +1 -0
  50. package/lib/readers/file-system.reader.js +1 -0
  51. package/lib/readers/index.js +12 -4
  52. package/lib/runners/abstract.runner.d.ts +2 -1
  53. package/lib/runners/abstract.runner.js +6 -4
  54. package/lib/runners/git.runner.js +1 -0
  55. package/lib/runners/index.js +13 -6
  56. package/lib/runners/npm.runner.js +1 -0
  57. package/lib/runners/runner.factory.js +1 -0
  58. package/lib/runners/runner.js +1 -0
  59. package/lib/runners/schematic.runner.js +7 -10
  60. package/lib/runners/yarn.runner.js +1 -0
  61. package/lib/schematics/abstract.collection.js +1 -0
  62. package/lib/schematics/collection.factory.js +1 -0
  63. package/lib/schematics/collection.js +1 -0
  64. package/lib/schematics/custom.collection.js +1 -0
  65. package/lib/schematics/index.js +14 -7
  66. package/lib/schematics/nest.collection.d.ts +1 -0
  67. package/lib/schematics/nest.collection.js +101 -20
  68. package/lib/schematics/schematic.option.js +1 -0
  69. package/lib/ui/banner.js +1 -0
  70. package/lib/ui/emojis.js +1 -0
  71. package/lib/ui/errors.js +1 -0
  72. package/lib/ui/index.js +15 -8
  73. package/lib/ui/messages.js +1 -0
  74. package/lib/ui/prefixes.js +1 -0
  75. package/lib/utils/is-error.js +1 -0
  76. package/lib/utils/load-configuration.js +1 -0
  77. package/lib/utils/local-binaries.js +1 -0
  78. package/lib/utils/project-utils.js +2 -1
  79. package/lib/utils/remaining-flags.js +1 -0
  80. package/package.json +26 -25
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.NestCollection = void 0;
12
13
  const abstract_collection_1 = require("./abstract.collection");
13
14
  class NestCollection extends abstract_collection_1.AbstractCollection {
14
15
  constructor(runner) {
@@ -36,24 +37,104 @@ class NestCollection extends abstract_collection_1.AbstractCollection {
36
37
  }
37
38
  exports.NestCollection = NestCollection;
38
39
  NestCollection.schematics = [
39
- { name: 'application', alias: 'application' },
40
- { name: 'angular-app', alias: 'ng-app' },
41
- { name: 'class', alias: 'cl' },
42
- { name: 'configuration', alias: 'config' },
43
- { name: 'controller', alias: 'co' },
44
- { name: 'decorator', alias: 'd' },
45
- { name: 'filter', alias: 'f' },
46
- { name: 'gateway', alias: 'ga' },
47
- { name: 'guard', alias: 'gu' },
48
- { name: 'interceptor', alias: 'in' },
49
- { name: 'interface', alias: 'interface' },
50
- { name: 'middleware', alias: 'mi' },
51
- { name: 'module', alias: 'mo' },
52
- { name: 'pipe', alias: 'pi' },
53
- { name: 'provider', alias: 'pr' },
54
- { name: 'resolver', alias: 'r' },
55
- { name: 'service', alias: 's' },
56
- { name: 'library', alias: 'lib' },
57
- { name: 'sub-app', alias: 'app' },
58
- { name: 'resource', alias: 'res' },
40
+ {
41
+ name: 'application',
42
+ alias: 'application',
43
+ description: 'Generate a new application workspace',
44
+ },
45
+ {
46
+ name: 'angular-app',
47
+ alias: 'ng-app',
48
+ description: '',
49
+ },
50
+ {
51
+ name: 'class',
52
+ alias: 'cl',
53
+ description: 'Generate a new class',
54
+ },
55
+ {
56
+ name: 'configuration',
57
+ alias: 'config',
58
+ description: 'Generate a CLI configuration file',
59
+ },
60
+ {
61
+ name: 'controller',
62
+ alias: 'co',
63
+ description: 'Generate a controller declaration',
64
+ },
65
+ {
66
+ name: 'decorator',
67
+ alias: 'd',
68
+ description: 'Generate a custom decorator',
69
+ },
70
+ {
71
+ name: 'filter',
72
+ alias: 'f',
73
+ description: 'Generate a filter declaration',
74
+ },
75
+ {
76
+ name: 'gateway',
77
+ alias: 'ga',
78
+ description: 'Generate a gateway declaration',
79
+ },
80
+ {
81
+ name: 'guard',
82
+ alias: 'gu',
83
+ description: 'Generate a guard declaration',
84
+ },
85
+ {
86
+ name: 'interceptor',
87
+ alias: 'in',
88
+ description: 'Generate an interceptor declaration',
89
+ },
90
+ {
91
+ name: 'interface',
92
+ alias: 'interface',
93
+ description: 'Generate an interface',
94
+ },
95
+ {
96
+ name: 'middleware',
97
+ alias: 'mi',
98
+ description: 'Generate a middleware declaration',
99
+ },
100
+ {
101
+ name: 'module',
102
+ alias: 'mo',
103
+ description: 'Generate a module declaration',
104
+ },
105
+ {
106
+ name: 'pipe',
107
+ alias: 'pi',
108
+ description: 'Generate a pipe declaration',
109
+ },
110
+ {
111
+ name: 'provider',
112
+ alias: 'pr',
113
+ description: 'Generate a provider declaration',
114
+ },
115
+ {
116
+ name: 'resolver',
117
+ alias: 'r',
118
+ description: 'Generate a GraphQL resolver declaration',
119
+ },
120
+ {
121
+ name: 'service',
122
+ alias: 's',
123
+ description: 'Generate a service declaration',
124
+ },
125
+ {
126
+ name: 'library',
127
+ alias: 'lib',
128
+ description: 'Generate a new library within a monorepo',
129
+ },
130
+ {
131
+ name: 'sub-app',
132
+ alias: 'app',
133
+ description: 'Generate a new application within a monorepo',
134
+ },
135
+ {
136
+ name: 'resource',
137
+ alias: 'res',
138
+ description: 'Generate a new CRUD resource',
139
+ },
59
140
  ];
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SchematicOption = void 0;
3
4
  const core_1 = require("@angular-devkit/core");
4
5
  class SchematicOption {
5
6
  constructor(name, value) {
package/lib/ui/banner.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BANNER = void 0;
3
4
  exports.BANNER = `
4
5
  _ _ _ ___ _____ _____ _ _____
5
6
  | \\ | | | | |_ |/ ___|/ __ \\| | |_ _|
package/lib/ui/emojis.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EMOJIS = void 0;
3
4
  const node_emoji_1 = require("node-emoji");
4
5
  exports.EMOJIS = {
5
6
  HEART: node_emoji_1.get('heart'),
package/lib/ui/errors.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  // tslint:disable:max-line-length
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CLI_ERRORS = void 0;
4
5
  exports.CLI_ERRORS = {
5
6
  MISSING_TYPESCRIPT: (path) => `Could not find TypeScript configuration file "${path}". Please, ensure that you are running this command in the appropriate directory (inside Nest workspace).`,
6
7
  WRONG_PLUGIN: (name) => `The "${name}" plugin is not compatible with Nest CLI. Neither "after()" nor "before()" function have been provided.`,
package/lib/ui/index.js CHANGED
@@ -1,10 +1,17 @@
1
1
  "use strict";
2
- function __export(m) {
3
- for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
4
- }
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
5
+ }) : (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ o[k2] = m[k];
8
+ }));
9
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
10
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
11
+ };
5
12
  Object.defineProperty(exports, "__esModule", { value: true });
6
- __export(require("./banner"));
7
- __export(require("./emojis"));
8
- __export(require("./errors"));
9
- __export(require("./messages"));
10
- __export(require("./prefixes"));
13
+ __exportStar(require("./banner"), exports);
14
+ __exportStar(require("./emojis"), exports);
15
+ __exportStar(require("./errors"), exports);
16
+ __exportStar(require("./messages"), exports);
17
+ __exportStar(require("./prefixes"), exports);
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MESSAGES = void 0;
3
4
  const chalk = require("chalk");
4
5
  const emojis_1 = require("./emojis");
5
6
  exports.MESSAGES = {
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.INFO_PREFIX = exports.ERROR_PREFIX = void 0;
3
4
  const chalk = require("chalk");
4
5
  exports.ERROR_PREFIX = chalk.bgRgb(210, 0, 75).bold.rgb(0, 0, 0)(' Error ');
5
6
  exports.INFO_PREFIX = chalk.bgRgb(60, 190, 100).bold.rgb(0, 0, 0)(' Info ');
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isError = void 0;
3
4
  function isError(e) {
4
5
  return (e &&
5
6
  e.stack &&
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.loadConfiguration = void 0;
12
13
  const nest_configuration_loader_1 = require("../configuration/nest-configuration.loader");
13
14
  const readers_1 = require("../readers");
14
15
  function loadConfiguration() {
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.loadLocalBinCommandLoader = exports.localBinExists = void 0;
3
4
  const fs_1 = require("fs");
4
5
  const path_1 = require("path");
5
6
  const localBinPathSegments = [process.cwd(), 'node_modules', '@nestjs', 'cli'];
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.moveDefaultProjectToStart = exports.askForProjectName = exports.shouldGenerateSpec = exports.shouldAskForProject = void 0;
12
13
  const inquirer = require("inquirer");
13
14
  const get_value_or_default_1 = require("../compiler/helpers/get-value-or-default");
14
15
  const questions_1 = require("../questions/questions");
@@ -60,7 +61,7 @@ exports.askForProjectName = askForProjectName;
60
61
  function moveDefaultProjectToStart(configuration, defaultProjectName, defaultLabel) {
61
62
  let projects = Object.keys(configuration.projects);
62
63
  if (configuration.sourceRoot !== 'src') {
63
- projects = projects.filter(p => p !== defaultProjectName.replace(defaultLabel, ''));
64
+ projects = projects.filter((p) => p !== defaultProjectName.replace(defaultLabel, ''));
64
65
  }
65
66
  projects.unshift(defaultProjectName);
66
67
  return projects;
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getRemainingFlags = void 0;
3
4
  function getRemainingFlags(cli) {
4
5
  const rawArgs = [...cli.rawArgs];
5
6
  return rawArgs
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/cli",
3
- "version": "7.5.0",
3
+ "version": "7.5.2",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@cli)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -18,6 +18,7 @@
18
18
  "format": "prettier --write \"**/*.ts\"",
19
19
  "lint": "eslint '{lib,commands,actions}/**/*.ts' --fix",
20
20
  "start": "node bin/nest.js",
21
+ "prepack": "npm run build",
21
22
  "prepublish:next": "npm run build",
22
23
  "publish:next": "npm publish --access public --tag next",
23
24
  "prepublish:npm": "npm run build",
@@ -42,35 +43,35 @@
42
43
  },
43
44
  "homepage": "https://github.com/nestjs/nest-cli#readme",
44
45
  "dependencies": {
45
- "@angular-devkit/core": "10.0.7",
46
- "@angular-devkit/schematics": "10.0.7",
47
- "@angular-devkit/schematics-cli": "0.1000.7",
46
+ "@angular-devkit/core": "10.2.0",
47
+ "@angular-devkit/schematics": "10.2.0",
48
+ "@angular-devkit/schematics-cli": "0.1002.0",
48
49
  "@nestjs/schematics": "^7.1.0",
49
- "@types/webpack": "4.41.21",
50
+ "@types/webpack": "4.41.24",
50
51
  "chalk": "3.0.0",
51
- "chokidar": "3.4.2",
52
+ "chokidar": "3.4.3",
52
53
  "cli-table3": "0.5.1",
53
54
  "commander": "4.1.1",
54
- "fork-ts-checker-webpack-plugin": "5.1.0",
55
+ "fork-ts-checker-webpack-plugin": "5.2.1",
55
56
  "inquirer": "7.3.3",
56
57
  "node-emoji": "1.10.0",
57
- "ora": "5.0.0",
58
- "os-name": "3.1.0",
58
+ "ora": "5.1.0",
59
+ "os-name": "4.0.0",
59
60
  "rimraf": "3.0.2",
60
61
  "shelljs": "0.8.4",
61
62
  "tree-kill": "1.2.2",
62
63
  "tsconfig-paths": "3.9.0",
63
64
  "tsconfig-paths-webpack-plugin": "3.3.0",
64
- "typescript": "^3.6.4",
65
- "webpack": "4.44.1",
66
- "webpack-node-externals": "2.5.1"
65
+ "typescript": "4.0.5",
66
+ "webpack": "5.4.0",
67
+ "webpack-node-externals": "2.5.2"
67
68
  },
68
69
  "devDependencies": {
69
- "@commitlint/cli": "9.1.2",
70
- "@commitlint/config-angular": "9.1.2",
71
- "@types/copyfiles": "2.2.0",
70
+ "@commitlint/cli": "11.0.0",
71
+ "@commitlint/config-angular": "11.0.0",
72
+ "@types/copyfiles": "2.4.0",
72
73
  "@types/inquirer": "7.3.1",
73
- "@types/jest": "26.0.10",
74
+ "@types/jest": "26.0.15",
74
75
  "@types/node": "12.12.31",
75
76
  "@types/node-emoji": "1.8.1",
76
77
  "@types/ora": "3.1.0",
@@ -81,17 +82,17 @@
81
82
  "@typescript-eslint/eslint-plugin": "^2.19.0",
82
83
  "@typescript-eslint/parser": "^2.19.0",
83
84
  "delete-empty": "3.0.0",
84
- "eslint": "7.7.0",
85
- "eslint-config-prettier": "6.11.0",
86
- "eslint-plugin-import": "2.22.0",
85
+ "eslint": "7.12.0",
86
+ "eslint-config-prettier": "6.15.0",
87
+ "eslint-plugin-import": "2.22.1",
87
88
  "gulp": "4.0.2",
88
89
  "gulp-clean": "0.4.0",
89
- "husky": "4.2.5",
90
- "jest": "26.4.2",
91
- "prettier": "2.0.5",
92
- "release-it": "13.6.9",
93
- "ts-jest": "26.2.0",
94
- "ts-loader": "8.0.2",
90
+ "husky": "4.3.0",
91
+ "jest": "26.6.3",
92
+ "prettier": "2.1.2",
93
+ "release-it": "14.2.1",
94
+ "ts-jest": "26.4.3",
95
+ "ts-loader": "8.0.8",
95
96
  "ts-node": "9.0.0"
96
97
  },
97
98
  "husky": {