@nestjs/cli 8.2.8 → 9.0.0
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/actions/generate.action.js +1 -4
- package/actions/index.d.ts +0 -1
- package/actions/index.js +0 -1
- package/actions/new.action.js +15 -0
- package/commands/command.loader.js +0 -2
- package/commands/generate.command.js +0 -3
- package/lib/schematics/nest.collection.js +2 -2
- package/lib/schematics/schematic.option.d.ts +2 -2
- package/lib/schematics/schematic.option.js +9 -9
- package/package.json +17 -23
|
@@ -85,10 +85,7 @@ const mapSchematicOptions = (inputs) => {
|
|
|
85
85
|
const options = [];
|
|
86
86
|
inputs.forEach((input) => {
|
|
87
87
|
if (!excludedInputNames.includes(input.name) && input.value !== undefined) {
|
|
88
|
-
|
|
89
|
-
? 'keepInputNameFormat' in input.options
|
|
90
|
-
: false;
|
|
91
|
-
options.push(new schematics_1.SchematicOption(input.name, input.value, keepInputName));
|
|
88
|
+
options.push(new schematics_1.SchematicOption(input.name, input.value));
|
|
92
89
|
}
|
|
93
90
|
});
|
|
94
91
|
return options;
|
package/actions/index.d.ts
CHANGED
package/actions/index.js
CHANGED
|
@@ -19,6 +19,5 @@ __exportStar(require("./build.action"), exports);
|
|
|
19
19
|
__exportStar(require("./generate.action"), exports);
|
|
20
20
|
__exportStar(require("./info.action"), exports);
|
|
21
21
|
__exportStar(require("./new.action"), exports);
|
|
22
|
-
__exportStar(require("./update.action"), exports);
|
|
23
22
|
__exportStar(require("./start.action"), exports);
|
|
24
23
|
__exportStar(require("./add.action"), exports);
|
package/actions/new.action.js
CHANGED
|
@@ -146,6 +146,9 @@ const initializeGitRepository = (dir) => __awaiter(void 0, void 0, void 0, funct
|
|
|
146
146
|
const createGitIgnoreFile = (dir, content) => {
|
|
147
147
|
const fileContent = content || defaults_1.defaultGitIgnore;
|
|
148
148
|
const filePath = (0, path_1.join)(process.cwd(), dir, '.gitignore');
|
|
149
|
+
if (fileExists(filePath)) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
149
152
|
return (0, util_1.promisify)(fs.writeFile)(filePath, fileContent);
|
|
150
153
|
};
|
|
151
154
|
const printCollective = () => {
|
|
@@ -184,5 +187,17 @@ const retrieveCols = () => {
|
|
|
184
187
|
}
|
|
185
188
|
};
|
|
186
189
|
exports.retrieveCols = retrieveCols;
|
|
190
|
+
const fileExists = (path) => {
|
|
191
|
+
try {
|
|
192
|
+
fs.accessSync(path);
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
catch (err) {
|
|
196
|
+
if (err.code === 'ENOENT') {
|
|
197
|
+
return false;
|
|
198
|
+
}
|
|
199
|
+
throw err;
|
|
200
|
+
}
|
|
201
|
+
};
|
|
187
202
|
const exit = () => process.exit(1);
|
|
188
203
|
exports.exit = exit;
|
|
@@ -10,14 +10,12 @@ const generate_command_1 = require("./generate.command");
|
|
|
10
10
|
const info_command_1 = require("./info.command");
|
|
11
11
|
const new_command_1 = require("./new.command");
|
|
12
12
|
const start_command_1 = require("./start.command");
|
|
13
|
-
const update_command_1 = require("./update.command");
|
|
14
13
|
class CommandLoader {
|
|
15
14
|
static load(program) {
|
|
16
15
|
new new_command_1.NewCommand(new actions_1.NewAction()).load(program);
|
|
17
16
|
new build_command_1.BuildCommand(new actions_1.BuildAction()).load(program);
|
|
18
17
|
new start_command_1.StartCommand(new actions_1.StartAction()).load(program);
|
|
19
18
|
new info_command_1.InfoCommand(new actions_1.InfoAction()).load(program);
|
|
20
|
-
new update_command_1.UpdateCommand(new actions_1.UpdateAction()).load(program);
|
|
21
19
|
new add_command_1.AddCommand(new actions_1.AddAction()).load(program);
|
|
22
20
|
new generate_command_1.GenerateCommand(new actions_1.GenerateAction()).load(program);
|
|
23
21
|
this.handleInvalidCommand(program);
|
|
@@ -60,9 +60,6 @@ class GenerateCommand extends abstract_command_1.AbstractCommand {
|
|
|
60
60
|
options.push({
|
|
61
61
|
name: 'skipImport',
|
|
62
62
|
value: command.skipImport,
|
|
63
|
-
options: {
|
|
64
|
-
keepInputNameFormat: true,
|
|
65
|
-
},
|
|
66
63
|
});
|
|
67
64
|
const inputs = [];
|
|
68
65
|
inputs.push({ name: 'schematic', value: schematic });
|
|
@@ -84,12 +84,12 @@ NestCollection.schematics = [
|
|
|
84
84
|
},
|
|
85
85
|
{
|
|
86
86
|
name: 'interceptor',
|
|
87
|
-
alias: '
|
|
87
|
+
alias: 'itc',
|
|
88
88
|
description: 'Generate an interceptor declaration',
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
name: 'interface',
|
|
92
|
-
alias: '
|
|
92
|
+
alias: 'itf',
|
|
93
93
|
description: 'Generate an interface',
|
|
94
94
|
},
|
|
95
95
|
{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export declare class SchematicOption {
|
|
2
2
|
private name;
|
|
3
3
|
private value;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
constructor(name: string, value: boolean | string);
|
|
5
|
+
get normalizedName(): string;
|
|
6
6
|
toCommandString(): string;
|
|
7
7
|
private format;
|
|
8
8
|
}
|
|
@@ -3,31 +3,31 @@ 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) {
|
|
7
7
|
this.name = name;
|
|
8
8
|
this.value = value;
|
|
9
|
-
|
|
9
|
+
}
|
|
10
|
+
get normalizedName() {
|
|
11
|
+
return (0, formatting_1.normalizeToKebabOrSnakeCase)(this.name);
|
|
10
12
|
}
|
|
11
13
|
toCommandString() {
|
|
12
14
|
if (typeof this.value === 'string') {
|
|
13
15
|
if (this.name === 'name') {
|
|
14
|
-
return `--${this.
|
|
16
|
+
return `--${this.normalizedName}=${this.format()}`;
|
|
15
17
|
}
|
|
16
18
|
else if (this.name === 'version' || this.name === 'path') {
|
|
17
|
-
return `--${this.
|
|
19
|
+
return `--${this.normalizedName}=${this.value}`;
|
|
18
20
|
}
|
|
19
21
|
else {
|
|
20
|
-
return `--${this.
|
|
22
|
+
return `--${this.normalizedName}="${this.value}"`;
|
|
21
23
|
}
|
|
22
24
|
}
|
|
23
25
|
else if (typeof this.value === 'boolean') {
|
|
24
|
-
const str = this.
|
|
25
|
-
? this.name
|
|
26
|
-
: (0, formatting_1.normalizeToKebabOrSnakeCase)(this.name);
|
|
26
|
+
const str = this.normalizedName;
|
|
27
27
|
return this.value ? `--${str}` : `--no-${str}`;
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
|
-
return `--${
|
|
30
|
+
return `--${this.normalizedName}=${this.value}`;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
format() {
|
package/package.json
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@cli)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
8
8
|
"engines": {
|
|
9
|
-
"node": ">=
|
|
10
|
-
"npm": ">= 6.11.0"
|
|
9
|
+
"node": ">= 12.9.0"
|
|
11
10
|
},
|
|
12
11
|
"bin": {
|
|
13
12
|
"nest": "bin/nest.js"
|
|
@@ -33,21 +32,16 @@
|
|
|
33
32
|
"type": "git",
|
|
34
33
|
"url": "git+https://github.com/nestjs/nest-cli.git"
|
|
35
34
|
},
|
|
36
|
-
"contributors": [
|
|
37
|
-
"Kamil Mysliwiec <mail@kamilmysliwiec.com>",
|
|
38
|
-
"Mark Pieszak <mark@trilon.io>",
|
|
39
|
-
"ThomRick"
|
|
40
|
-
],
|
|
41
35
|
"license": "MIT",
|
|
42
36
|
"bugs": {
|
|
43
37
|
"url": "https://github.com/nestjs/nest-cli/issues"
|
|
44
38
|
},
|
|
45
39
|
"homepage": "https://github.com/nestjs/nest-cli#readme",
|
|
46
40
|
"dependencies": {
|
|
47
|
-
"@angular-devkit/core": "
|
|
48
|
-
"@angular-devkit/schematics": "
|
|
49
|
-
"@angular-devkit/schematics-cli": "
|
|
50
|
-
"@nestjs/schematics": "^
|
|
41
|
+
"@angular-devkit/core": "14.0.5",
|
|
42
|
+
"@angular-devkit/schematics": "14.0.5",
|
|
43
|
+
"@angular-devkit/schematics-cli": "14.0.5",
|
|
44
|
+
"@nestjs/schematics": "^9.0.0",
|
|
51
45
|
"chalk": "3.0.0",
|
|
52
46
|
"chokidar": "3.5.3",
|
|
53
47
|
"cli-table3": "0.6.2",
|
|
@@ -68,34 +62,34 @@
|
|
|
68
62
|
"webpack-node-externals": "3.0.0"
|
|
69
63
|
},
|
|
70
64
|
"devDependencies": {
|
|
71
|
-
"@commitlint/cli": "17.0.
|
|
72
|
-
"@commitlint/config-angular": "17.0.
|
|
65
|
+
"@commitlint/cli": "17.0.3",
|
|
66
|
+
"@commitlint/config-angular": "17.0.3",
|
|
73
67
|
"@types/copyfiles": "2.4.1",
|
|
74
68
|
"@types/inquirer": "8.2.1",
|
|
75
|
-
"@types/jest": "28.1.
|
|
76
|
-
"@types/node": "16.11.
|
|
69
|
+
"@types/jest": "28.1.4",
|
|
70
|
+
"@types/node": "16.11.43",
|
|
77
71
|
"@types/node-emoji": "1.8.1",
|
|
78
72
|
"@types/ora": "3.2.0",
|
|
79
73
|
"@types/os-name": "3.1.0",
|
|
80
74
|
"@types/rimraf": "3.0.2",
|
|
81
75
|
"@types/shelljs": "0.8.11",
|
|
82
76
|
"@types/webpack-node-externals": "2.5.3",
|
|
83
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
84
|
-
"@typescript-eslint/parser": "5.
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "5.30.5",
|
|
78
|
+
"@typescript-eslint/parser": "5.30.5",
|
|
85
79
|
"delete-empty": "3.0.0",
|
|
86
|
-
"eslint": "8.
|
|
80
|
+
"eslint": "8.19.0",
|
|
87
81
|
"eslint-config-prettier": "8.5.0",
|
|
88
82
|
"eslint-plugin-import": "2.26.0",
|
|
89
83
|
"gulp": "4.0.2",
|
|
90
84
|
"gulp-clean": "0.4.0",
|
|
91
85
|
"husky": "8.0.1",
|
|
92
|
-
"jest": "28.1.
|
|
93
|
-
"lint-staged": "13.0.
|
|
86
|
+
"jest": "28.1.2",
|
|
87
|
+
"lint-staged": "13.0.3",
|
|
94
88
|
"prettier": "2.7.1",
|
|
95
|
-
"release-it": "15.1.
|
|
89
|
+
"release-it": "15.1.1",
|
|
96
90
|
"ts-jest": "28.0.5",
|
|
97
91
|
"ts-loader": "9.3.1",
|
|
98
|
-
"ts-node": "10.8.
|
|
92
|
+
"ts-node": "10.8.2"
|
|
99
93
|
},
|
|
100
94
|
"lint-staged": {
|
|
101
95
|
"**/*.{ts,json}": []
|