@nestjs/cli 8.2.3 → 8.2.6

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/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <p align="center">
2
- <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo_text.svg" width="320" alt="Nest Logo" /></a>
2
+ <a href="http://nestjs.com/" target="blank"><img src="https://nestjs.com/img/logo-small.svg" width="120" alt="Nest Logo" /></a>
3
3
  </p>
4
4
 
5
5
  <p align="center">A progressive <a href="http://nodejs.org" target="blank">Node.js</a> framework for building efficient and scalable server-side applications.</p>
@@ -85,7 +85,10 @@ const mapSchematicOptions = (inputs) => {
85
85
  const options = [];
86
86
  inputs.forEach((input) => {
87
87
  if (!excludedInputNames.includes(input.name) && input.value !== undefined) {
88
- options.push(new schematics_1.SchematicOption(input.name, input.value));
88
+ const keepInputName = input.options
89
+ ? 'keepInputNameFormat' in input.options
90
+ : false;
91
+ options.push(new schematics_1.SchematicOption(input.name, input.value, keepInputName));
89
92
  }
90
93
  });
91
94
  return options;
@@ -27,6 +27,7 @@ class GenerateCommand extends abstract_command_1.AbstractCommand {
27
27
  .option('--spec', 'Enforce spec files generation.', () => {
28
28
  return { value: true, passedAsInput: true };
29
29
  }, true)
30
+ .option('--skip-import', 'Skip importing', () => true, false)
30
31
  .option('--no-spec', 'Disable spec files generation.', () => {
31
32
  return { value: false, passedAsInput: true };
32
33
  })
@@ -56,6 +57,13 @@ class GenerateCommand extends abstract_command_1.AbstractCommand {
56
57
  name: 'project',
57
58
  value: command.project,
58
59
  });
60
+ options.push({
61
+ name: 'skipImport',
62
+ value: command.skipImport,
63
+ options: {
64
+ keepInputNameFormat: true,
65
+ },
66
+ });
59
67
  const inputs = [];
60
68
  inputs.push({ name: 'schematic', value: schematic });
61
69
  inputs.push({ name: 'name', value: name });
@@ -19,25 +19,26 @@ class NewCommand extends abstract_command_1.AbstractCommand {
19
19
  .alias('n')
20
20
  .description('Generate Nest application.')
21
21
  .option('--directory [directory]', 'Specify the destination directory')
22
- .option('-d, --dry-run', 'Report actions that would be performed without writing out results.')
23
- .option('-g, --skip-git', 'Skip git repository initialization.')
24
- .option('-s, --skip-install', 'Skip package installation.')
22
+ .option('-d, --dry-run', 'Report actions that would be performed without writing out results.', false)
23
+ .option('-g, --skip-git', 'Skip git repository initialization.', false)
24
+ .option('-s, --skip-install', 'Skip package installation.', false)
25
25
  .option('-p, --package-manager [package-manager]', 'Specify package manager.')
26
- .option('-l, --language [language]', 'Programming language to be used (TypeScript or JavaScript).')
27
- .option('-c, --collection [collectionName]', 'Schematics collection to use.')
28
- .option('--strict', 'Enables strict mode in TypeScript.')
26
+ .option('-l, --language [language]', 'Programming language to be used (TypeScript or JavaScript)', 'TypeScript')
27
+ .option('-c, --collection [collectionName]', 'Schematics collection to use', schematics_1.Collection.NESTJS)
28
+ .option('--strict', 'Enables strict mode in TypeScript.', false)
29
29
  .action((name, command) => __awaiter(this, void 0, void 0, function* () {
30
30
  const options = [];
31
31
  const availableLanguages = ['js', 'ts', 'javascript', 'typescript'];
32
32
  options.push({ name: 'directory', value: command.directory });
33
- options.push({ name: 'dry-run', value: !!command.dryRun });
34
- options.push({ name: 'skip-git', value: !!command.skipGit });
35
- options.push({ name: 'skip-install', value: !!command.skipInstall });
36
- options.push({ name: 'strict', value: !!command.strict });
33
+ options.push({ name: 'dry-run', value: command.dryRun });
34
+ options.push({ name: 'skip-git', value: command.skipGit });
35
+ options.push({ name: 'skip-install', value: command.skipInstall });
36
+ options.push({ name: 'strict', value: command.strict });
37
37
  options.push({
38
38
  name: 'package-manager',
39
39
  value: command.packageManager,
40
40
  });
41
+ options.push({ name: 'collection', value: command.collection });
41
42
  if (!!command.language) {
42
43
  const lowercasedLanguage = command.language.toLowerCase();
43
44
  const langMatch = availableLanguages.includes(lowercasedLanguage);
@@ -58,11 +59,7 @@ class NewCommand extends abstract_command_1.AbstractCommand {
58
59
  }
59
60
  options.push({
60
61
  name: 'language',
61
- value: !!command.language ? command.language : 'ts',
62
- });
63
- options.push({
64
- name: 'collection',
65
- value: command.collection || schematics_1.Collection.NESTJS,
62
+ value: command.language,
66
63
  });
67
64
  const inputs = [];
68
65
  inputs.push({ name: 'name', value: name });
@@ -27,7 +27,7 @@ class WatchCompiler {
27
27
  host.createProgram = (rootNames, options,
28
28
  // tslint:disable-next-line:no-shadowed-variable
29
29
  host, oldProgram) => {
30
- const tsconfigPathsPlugin = (0, tsconfig_paths_hook_1.tsconfigPathsBeforeHookFactory)(options);
30
+ const tsconfigPathsPlugin = options ? (0, tsconfig_paths_hook_1.tsconfigPathsBeforeHookFactory)(options) : null;
31
31
  const program = origCreateProgram(rootNames, options, host, oldProgram, undefined, projectReferences);
32
32
  const origProgramEmit = program.emit;
33
33
  program.emit = (targetSourceFile, writeFile, cancellationToken, emitOnlyDtsFiles, customTransformers) => {
@@ -36,7 +36,9 @@ class WatchCompiler {
36
36
  const before = plugins.beforeHooks.map((hook) => hook(program.getProgram()));
37
37
  const after = plugins.afterHooks.map((hook) => hook(program.getProgram()));
38
38
  const afterDeclarations = plugins.afterDeclarationsHooks.map((hook) => hook(program.getProgram()));
39
- before.unshift(tsconfigPathsPlugin);
39
+ if (tsconfigPathsPlugin) {
40
+ before.unshift(tsconfigPathsPlugin);
41
+ }
40
42
  transforms.before = before.concat(transforms.before || []);
41
43
  transforms.after = after.concat(transforms.after || []);
42
44
  transforms.afterDeclarations = afterDeclarations.concat(transforms.afterDeclarations || []);
@@ -1,7 +1,8 @@
1
1
  export declare class SchematicOption {
2
2
  private name;
3
3
  private value;
4
- constructor(name: string, value: boolean | string);
4
+ private keepInputNameFormat;
5
+ constructor(name: string, value: boolean | string, keepInputNameFormat?: boolean);
5
6
  toCommandString(): string;
6
7
  private format;
7
8
  }
@@ -3,9 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SchematicOption = void 0;
4
4
  const formatting_1 = require("../utils/formatting");
5
5
  class SchematicOption {
6
- constructor(name, value) {
6
+ constructor(name, value, keepInputNameFormat = false) {
7
7
  this.name = name;
8
8
  this.value = value;
9
+ this.keepInputNameFormat = keepInputNameFormat;
9
10
  }
10
11
  toCommandString() {
11
12
  if (typeof this.value === 'string') {
@@ -20,7 +21,9 @@ class SchematicOption {
20
21
  }
21
22
  }
22
23
  else if (typeof this.value === 'boolean') {
23
- const str = (0, formatting_1.normalizeToKebabOrSnakeCase)(this.name);
24
+ const str = this.keepInputNameFormat
25
+ ? this.name
26
+ : (0, formatting_1.normalizeToKebabOrSnakeCase)(this.name);
24
27
  return this.value ? `--${str}` : `--no-${str}`;
25
28
  }
26
29
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nestjs/cli",
3
- "version": "8.2.3",
3
+ "version": "8.2.6",
4
4
  "description": "Nest - modern, fast, powerful node.js web framework (@cli)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -43,15 +43,15 @@
43
43
  },
44
44
  "homepage": "https://github.com/nestjs/nest-cli#readme",
45
45
  "dependencies": {
46
- "@angular-devkit/core": "13.2.6",
47
- "@angular-devkit/schematics": "13.2.6",
48
- "@angular-devkit/schematics-cli": "13.2.6",
46
+ "@angular-devkit/core": "13.3.5",
47
+ "@angular-devkit/schematics": "13.3.5",
48
+ "@angular-devkit/schematics-cli": "13.3.5",
49
49
  "@nestjs/schematics": "^8.0.3",
50
50
  "chalk": "3.0.0",
51
51
  "chokidar": "3.5.3",
52
- "cli-table3": "0.6.1",
52
+ "cli-table3": "0.6.2",
53
53
  "commander": "4.1.1",
54
- "fork-ts-checker-webpack-plugin": "7.2.1",
54
+ "fork-ts-checker-webpack-plugin": "7.2.11",
55
55
  "inquirer": "7.3.3",
56
56
  "node-emoji": "1.11.0",
57
57
  "ora": "5.4.1",
@@ -60,39 +60,39 @@
60
60
  "shelljs": "0.8.5",
61
61
  "source-map-support": "0.5.21",
62
62
  "tree-kill": "1.2.2",
63
- "tsconfig-paths": "3.14.0",
63
+ "tsconfig-paths": "3.14.1",
64
64
  "tsconfig-paths-webpack-plugin": "3.5.2",
65
- "typescript": "4.6.2",
66
- "webpack": "5.70.0",
65
+ "typescript": "4.6.4",
66
+ "webpack": "5.72.1",
67
67
  "webpack-node-externals": "3.0.0"
68
68
  },
69
69
  "devDependencies": {
70
- "@commitlint/cli": "16.2.1",
71
- "@commitlint/config-angular": "16.2.1",
70
+ "@commitlint/cli": "16.2.4",
71
+ "@commitlint/config-angular": "16.2.4",
72
72
  "@types/copyfiles": "2.4.1",
73
73
  "@types/inquirer": "7.3.3",
74
- "@types/jest": "27.4.1",
75
- "@types/node": "16.11.26",
74
+ "@types/jest": "27.5.0",
75
+ "@types/node": "16.11.36",
76
76
  "@types/node-emoji": "1.8.1",
77
77
  "@types/ora": "3.2.0",
78
78
  "@types/os-name": "3.1.0",
79
79
  "@types/rimraf": "3.0.2",
80
80
  "@types/shelljs": "0.8.11",
81
81
  "@types/webpack-node-externals": "2.5.3",
82
- "@typescript-eslint/eslint-plugin": "5.15.0",
83
- "@typescript-eslint/parser": "5.15.0",
82
+ "@typescript-eslint/eslint-plugin": "5.22.0",
83
+ "@typescript-eslint/parser": "5.22.0",
84
84
  "delete-empty": "3.0.0",
85
- "eslint": "8.11.0",
85
+ "eslint": "8.14.0",
86
86
  "eslint-config-prettier": "8.5.0",
87
- "eslint-plugin-import": "2.25.4",
87
+ "eslint-plugin-import": "2.26.0",
88
88
  "gulp": "4.0.2",
89
89
  "gulp-clean": "0.4.0",
90
90
  "husky": "7.0.4",
91
- "jest": "27.5.1",
92
- "prettier": "2.5.1",
93
- "release-it": "14.12.5",
94
- "ts-jest": "27.1.3",
95
- "ts-loader": "9.2.8",
91
+ "jest": "28.0.3",
92
+ "prettier": "2.6.2",
93
+ "release-it": "15.0.0",
94
+ "ts-jest": "28.0.2",
95
+ "ts-loader": "9.3.0",
96
96
  "ts-node": "10.7.0"
97
97
  },
98
98
  "husky": {