@nestjs/cli 11.0.6 → 11.0.7
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/.circleci/config.yml +2 -2
- package/actions/generate.action.js +2 -0
- package/actions/new.action.js +2 -0
- package/actions/start.action.d.ts +1 -1
- package/actions/start.action.js +6 -3
- package/commands/command.input.d.ts +1 -1
- package/commands/start.command.js +4 -1
- package/lib/utils/type-assertions.d.ts +1 -0
- package/lib/utils/type-assertions.js +8 -0
- package/package.json +17 -17
package/.circleci/config.yml
CHANGED
|
@@ -21,7 +21,7 @@ jobs:
|
|
|
21
21
|
build:
|
|
22
22
|
working_directory: ~/nest
|
|
23
23
|
docker:
|
|
24
|
-
- image: cimg/node:22.
|
|
24
|
+
- image: cimg/node:22.14.0
|
|
25
25
|
steps:
|
|
26
26
|
- checkout
|
|
27
27
|
- restore_cache:
|
|
@@ -40,7 +40,7 @@ jobs:
|
|
|
40
40
|
unit_tests:
|
|
41
41
|
working_directory: ~/nest
|
|
42
42
|
docker:
|
|
43
|
-
- image: cimg/node:22.
|
|
43
|
+
- image: cimg/node:22.14.0
|
|
44
44
|
steps:
|
|
45
45
|
- checkout
|
|
46
46
|
- *restore-cache
|
|
@@ -9,6 +9,7 @@ const ui_1 = require("../lib/ui");
|
|
|
9
9
|
const load_configuration_1 = require("../lib/utils/load-configuration");
|
|
10
10
|
const project_utils_1 = require("../lib/utils/project-utils");
|
|
11
11
|
const abstract_action_1 = require("./abstract.action");
|
|
12
|
+
const type_assertions_1 = require("../lib/utils/type-assertions");
|
|
12
13
|
class GenerateAction extends abstract_action_1.AbstractAction {
|
|
13
14
|
async handle(inputs, options) {
|
|
14
15
|
await generateFiles(inputs.concat(options));
|
|
@@ -88,6 +89,7 @@ const mapSchematicOptions = (inputs) => {
|
|
|
88
89
|
const options = [];
|
|
89
90
|
inputs.forEach((input) => {
|
|
90
91
|
if (!excludedInputNames.includes(input.name) && input.value !== undefined) {
|
|
92
|
+
(0, type_assertions_1.assertNonArray)(input.value);
|
|
91
93
|
options.push(new schematics_1.SchematicOption(input.name, input.value));
|
|
92
94
|
}
|
|
93
95
|
});
|
package/actions/new.action.js
CHANGED
|
@@ -15,6 +15,7 @@ const ui_1 = require("../lib/ui");
|
|
|
15
15
|
const formatting_1 = require("../lib/utils/formatting");
|
|
16
16
|
const gracefully_exit_on_prompt_error_1 = require("../lib/utils/gracefully-exit-on-prompt-error");
|
|
17
17
|
const abstract_action_1 = require("./abstract.action");
|
|
18
|
+
const type_assertions_1 = require("../lib/utils/type-assertions");
|
|
18
19
|
class NewAction extends abstract_action_1.AbstractAction {
|
|
19
20
|
async handle(inputs, options) {
|
|
20
21
|
const directoryOption = options.find((option) => option.name === 'directory');
|
|
@@ -80,6 +81,7 @@ const generateApplicationFiles = async (args, options) => {
|
|
|
80
81
|
const mapSchematicOptions = (options) => {
|
|
81
82
|
return options.reduce((schematicOptions, option) => {
|
|
82
83
|
if (option.name !== 'skip-install') {
|
|
84
|
+
(0, type_assertions_1.assertNonArray)(option.value);
|
|
83
85
|
schematicOptions.push(new schematics_1.SchematicOption(option.name, option.value));
|
|
84
86
|
}
|
|
85
87
|
return schematicOptions;
|
|
@@ -4,7 +4,7 @@ export declare class StartAction extends BuildAction {
|
|
|
4
4
|
handle(commandInputs: Input[], commandOptions: Input[]): Promise<void>;
|
|
5
5
|
createOnSuccessHook(entryFile: string, sourceRoot: string, debugFlag: boolean | string | undefined, outDirName: string, binaryToRun: string, options: {
|
|
6
6
|
shell: boolean;
|
|
7
|
-
envFile?: string;
|
|
7
|
+
envFile?: string[];
|
|
8
8
|
}): () => void;
|
|
9
9
|
private spawnChildProcess;
|
|
10
10
|
}
|
package/actions/start.action.js
CHANGED
|
@@ -12,6 +12,7 @@ const defaults_1 = require("../lib/configuration/defaults");
|
|
|
12
12
|
const ui_1 = require("../lib/ui");
|
|
13
13
|
const tree_kill_1 = require("../lib/utils/tree-kill");
|
|
14
14
|
const build_action_1 = require("./build.action");
|
|
15
|
+
const type_assertions_1 = require("../lib/utils/type-assertions");
|
|
15
16
|
class StartAction extends build_action_1.BuildAction {
|
|
16
17
|
async handle(commandInputs, commandOptions) {
|
|
17
18
|
try {
|
|
@@ -26,6 +27,7 @@ class StartAction extends build_action_1.BuildAction {
|
|
|
26
27
|
const watchAssetsModeOption = commandOptions.find((option) => option.name === 'watchAssets');
|
|
27
28
|
const isWatchAssetsEnabled = !!(watchAssetsModeOption && watchAssetsModeOption.value);
|
|
28
29
|
const debugFlag = debugModeOption && debugModeOption.value;
|
|
30
|
+
(0, type_assertions_1.assertNonArray)(debugFlag);
|
|
29
31
|
const binaryToRun = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'exec', appName, 'exec', commandOptions, defaults_1.defaultConfiguration.exec);
|
|
30
32
|
const { options: tsOptions } = this.tsConfigProvider.getByConfigFilename(pathToTsconfig);
|
|
31
33
|
const outDir = tsOptions.outDir || defaults_1.defaultOutDir;
|
|
@@ -34,7 +36,7 @@ class StartAction extends build_action_1.BuildAction {
|
|
|
34
36
|
const shellOption = commandOptions.find((option) => option.name === 'shell');
|
|
35
37
|
const useShell = !!shellOption?.value;
|
|
36
38
|
const envFileOption = commandOptions.find((option) => option.name === 'envFile');
|
|
37
|
-
const envFile = envFileOption?.value;
|
|
39
|
+
const envFile = (envFileOption?.value ?? []);
|
|
38
40
|
const onSuccess = this.createOnSuccessHook(entryFile, sourceRoot, debugFlag, outDir, binaryToRun, {
|
|
39
41
|
shell: useShell,
|
|
40
42
|
envFile,
|
|
@@ -102,8 +104,9 @@ class StartAction extends build_action_1.BuildAction {
|
|
|
102
104
|
const inspectFlag = typeof debug === 'string' ? `--inspect=${debug}` : '--inspect';
|
|
103
105
|
processArgs.unshift(inspectFlag);
|
|
104
106
|
}
|
|
105
|
-
if (options.envFile) {
|
|
106
|
-
|
|
107
|
+
if (options.envFile && options.envFile.length > 0) {
|
|
108
|
+
const envFileNodeArgs = options.envFile.map((envFilePath) => `--env-file=${envFilePath}`);
|
|
109
|
+
processArgs.unshift(envFileNodeArgs.join(' '));
|
|
107
110
|
}
|
|
108
111
|
processArgs.unshift('--enable-source-maps');
|
|
109
112
|
return (0, child_process_1.spawn)(binaryToRun, processArgs, {
|
|
@@ -6,6 +6,9 @@ const remaining_flags_1 = require("../lib/utils/remaining-flags");
|
|
|
6
6
|
const abstract_command_1 = require("./abstract.command");
|
|
7
7
|
class StartCommand extends abstract_command_1.AbstractCommand {
|
|
8
8
|
load(program) {
|
|
9
|
+
const collect = (value, previous) => {
|
|
10
|
+
return previous.concat([value]);
|
|
11
|
+
};
|
|
9
12
|
program
|
|
10
13
|
.command('start [app]')
|
|
11
14
|
.allowUnknownOption()
|
|
@@ -25,7 +28,7 @@ class StartCommand extends abstract_command_1.AbstractCommand {
|
|
|
25
28
|
.option('--preserveWatchOutput', 'Use "preserveWatchOutput" option when using tsc watch mode.')
|
|
26
29
|
.option('--shell', "Spawn child processes within a shell (see node's child_process.spawn() method docs). Default: true.", true)
|
|
27
30
|
.option('--no-shell', 'Do not spawn child processes within a shell.')
|
|
28
|
-
.option('--env-file [path]', 'Path to an env file (.env) to be loaded into the environment.')
|
|
31
|
+
.option('--env-file [path]', 'Path to an env file (.env) to be loaded into the environment.', collect, [])
|
|
29
32
|
.description('Run Nest application.')
|
|
30
33
|
.action(async (app, command) => {
|
|
31
34
|
const options = [];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assertNonArray<T>(value: T): asserts value is Exclude<T, any[]>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/cli",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.7",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@cli)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/nestjs/nest-cli#readme",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@angular-devkit/core": "19.2.
|
|
42
|
-
"@angular-devkit/schematics": "19.2.
|
|
43
|
-
"@angular-devkit/schematics-cli": "19.2.
|
|
41
|
+
"@angular-devkit/core": "19.2.8",
|
|
42
|
+
"@angular-devkit/schematics": "19.2.8",
|
|
43
|
+
"@angular-devkit/schematics-cli": "19.2.8",
|
|
44
44
|
"@inquirer/prompts": "7.4.1",
|
|
45
45
|
"@nestjs/schematics": "^11.0.1",
|
|
46
46
|
"ansis": "3.17.0",
|
|
@@ -54,33 +54,33 @@
|
|
|
54
54
|
"tree-kill": "1.2.2",
|
|
55
55
|
"tsconfig-paths": "4.2.0",
|
|
56
56
|
"tsconfig-paths-webpack-plugin": "4.2.0",
|
|
57
|
-
"typescript": "5.
|
|
58
|
-
"webpack": "5.
|
|
57
|
+
"typescript": "5.8.3",
|
|
58
|
+
"webpack": "5.99.6",
|
|
59
59
|
"webpack-node-externals": "3.0.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@commitlint/cli": "19.8.0",
|
|
63
63
|
"@commitlint/config-angular": "19.8.0",
|
|
64
|
-
"@swc/cli": "0.
|
|
65
|
-
"@swc/core": "1.11.
|
|
64
|
+
"@swc/cli": "0.7.3",
|
|
65
|
+
"@swc/core": "1.11.21",
|
|
66
66
|
"@types/inquirer": "9.0.7",
|
|
67
67
|
"@types/jest": "29.5.14",
|
|
68
|
-
"@types/node": "22.14.
|
|
68
|
+
"@types/node": "22.14.1",
|
|
69
69
|
"@types/node-emoji": "1.8.2",
|
|
70
70
|
"@types/webpack-node-externals": "3.0.4",
|
|
71
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
72
|
-
"@typescript-eslint/parser": "8.
|
|
71
|
+
"@typescript-eslint/eslint-plugin": "8.31.0",
|
|
72
|
+
"@typescript-eslint/parser": "8.31.0",
|
|
73
73
|
"delete-empty": "3.0.0",
|
|
74
|
-
"eslint": "9.
|
|
75
|
-
"eslint-config-prettier": "10.1.
|
|
74
|
+
"eslint": "9.25.1",
|
|
75
|
+
"eslint-config-prettier": "10.1.2",
|
|
76
76
|
"gulp": "5.0.0",
|
|
77
77
|
"gulp-clean": "0.4.0",
|
|
78
78
|
"husky": "9.1.7",
|
|
79
79
|
"jest": "29.7.0",
|
|
80
|
-
"lint-staged": "15.5.
|
|
80
|
+
"lint-staged": "15.5.1",
|
|
81
81
|
"prettier": "3.5.3",
|
|
82
|
-
"release-it": "
|
|
83
|
-
"ts-jest": "29.3.
|
|
82
|
+
"release-it": "19.0.1",
|
|
83
|
+
"ts-jest": "29.3.2",
|
|
84
84
|
"ts-loader": "9.5.2",
|
|
85
85
|
"ts-node": "10.9.2"
|
|
86
86
|
},
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"**/*.{ts,json}": []
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
|
-
"@swc/cli": "^0.1.62 || ^0.3.0 || ^0.4.0 || ^0.5.0 || ^0.6.0",
|
|
91
|
+
"@swc/cli": "^0.1.62 || ^0.3.0 || ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0",
|
|
92
92
|
"@swc/core": "^1.3.62"
|
|
93
93
|
},
|
|
94
94
|
"peerDependenciesMeta": {
|