@nestjs/cli 8.2.4 → 8.2.5
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.
|
@@ -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
|
-
|
|
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 });
|
package/commands/new.command.js
CHANGED
|
@@ -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:
|
|
34
|
-
options.push({ name: 'skip-git', value:
|
|
35
|
-
options.push({ name: 'skip-install', value:
|
|
36
|
-
options.push({ name: 'strict', value:
|
|
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:
|
|
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 });
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export declare class SchematicOption {
|
|
2
2
|
private name;
|
|
3
3
|
private value;
|
|
4
|
-
|
|
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 =
|
|
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
|
+
"version": "8.2.5",
|
|
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.3.
|
|
47
|
-
"@angular-devkit/schematics": "13.3.
|
|
48
|
-
"@angular-devkit/schematics-cli": "13.3.
|
|
46
|
+
"@angular-devkit/core": "13.3.2",
|
|
47
|
+
"@angular-devkit/schematics": "13.3.2",
|
|
48
|
+
"@angular-devkit/schematics-cli": "13.3.2",
|
|
49
49
|
"@nestjs/schematics": "^8.0.3",
|
|
50
50
|
"chalk": "3.0.0",
|
|
51
51
|
"chokidar": "3.5.3",
|
|
52
52
|
"cli-table3": "0.6.1",
|
|
53
53
|
"commander": "4.1.1",
|
|
54
|
-
"fork-ts-checker-webpack-plugin": "7.2.
|
|
54
|
+
"fork-ts-checker-webpack-plugin": "7.2.3",
|
|
55
55
|
"inquirer": "7.3.3",
|
|
56
56
|
"node-emoji": "1.11.0",
|
|
57
57
|
"ora": "5.4.1",
|
|
@@ -60,10 +60,10 @@
|
|
|
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.
|
|
63
|
+
"tsconfig-paths": "3.14.1",
|
|
64
64
|
"tsconfig-paths-webpack-plugin": "3.5.2",
|
|
65
65
|
"typescript": "4.6.2",
|
|
66
|
-
"webpack": "5.
|
|
66
|
+
"webpack": "5.71.0",
|
|
67
67
|
"webpack-node-externals": "3.0.0"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
@@ -79,19 +79,19 @@
|
|
|
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.
|
|
83
|
-
"@typescript-eslint/parser": "5.
|
|
82
|
+
"@typescript-eslint/eslint-plugin": "5.17.0",
|
|
83
|
+
"@typescript-eslint/parser": "5.17.0",
|
|
84
84
|
"delete-empty": "3.0.0",
|
|
85
|
-
"eslint": "8.
|
|
85
|
+
"eslint": "8.12.0",
|
|
86
86
|
"eslint-config-prettier": "8.5.0",
|
|
87
|
-
"eslint-plugin-import": "2.
|
|
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
91
|
"jest": "27.5.1",
|
|
92
|
-
"prettier": "2.6.
|
|
93
|
-
"release-it": "14.
|
|
94
|
-
"ts-jest": "27.1.
|
|
92
|
+
"prettier": "2.6.2",
|
|
93
|
+
"release-it": "14.14.0",
|
|
94
|
+
"ts-jest": "27.1.4",
|
|
95
95
|
"ts-loader": "9.2.8",
|
|
96
96
|
"ts-node": "10.7.0"
|
|
97
97
|
},
|