@nestjs/cli 11.0.7 → 11.0.9
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
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.17.1
|
|
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.17.1
|
|
44
44
|
steps:
|
|
45
45
|
- checkout
|
|
46
46
|
- *restore-cache
|
package/actions/info.action.js
CHANGED
|
@@ -50,7 +50,7 @@ class InfoAction extends abstract_action_1.AbstractAction {
|
|
|
50
50
|
}
|
|
51
51
|
async displayNestInformation() {
|
|
52
52
|
this.displayCliVersion();
|
|
53
|
-
console.info((0, ansis_1.green) `[Nest Platform Information`);
|
|
53
|
+
console.info((0, ansis_1.green) `[Nest Platform Information]`);
|
|
54
54
|
await this.displayNestInformationFromPackage();
|
|
55
55
|
}
|
|
56
56
|
async displayNestInformationFromPackage() {
|
|
@@ -26,7 +26,7 @@ class StartCommand extends abstract_command_1.AbstractCommand {
|
|
|
26
26
|
.option('--entryFile [entryFile]', "Path to the entry file where this command will work with. Defaults to the one defined at your Nest's CLI config file.")
|
|
27
27
|
.option('-e, --exec [binary]', 'Binary to run (default: "node").')
|
|
28
28
|
.option('--preserveWatchOutput', 'Use "preserveWatchOutput" option when using tsc watch mode.')
|
|
29
|
-
.option('--shell', "Spawn child processes within a shell (see node's child_process.spawn() method docs). Default:
|
|
29
|
+
.option('--shell', "Spawn child processes within a shell (see node's child_process.spawn() method docs). Default: false.", false)
|
|
30
30
|
.option('--no-shell', 'Do not spawn child processes within a shell.')
|
|
31
31
|
.option('--env-file [path]', 'Path to an env file (.env) to be loaded into the environment.', collect, [])
|
|
32
32
|
.description('Run Nest application.')
|
|
@@ -5,6 +5,7 @@ const ansis_1 = require("ansis");
|
|
|
5
5
|
const child_process_1 = require("child_process");
|
|
6
6
|
const chokidar = require("chokidar");
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
|
+
const promises_1 = require("fs/promises");
|
|
8
9
|
const path = require("path");
|
|
9
10
|
const path_1 = require("path");
|
|
10
11
|
const ui_1 = require("../../ui");
|
|
@@ -107,14 +108,29 @@ class SwcCompiler extends base_compiler_1.BaseCompiler {
|
|
|
107
108
|
const rootDir = process.cwd();
|
|
108
109
|
swcOptions.jsc.baseUrl = path.join(rootDir, swcOptions.jsc.baseUrl);
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
+
const swcCliOpts = {
|
|
111
112
|
...options,
|
|
112
113
|
swcOptions,
|
|
113
114
|
cliOptions: {
|
|
114
115
|
...options.cliOptions,
|
|
115
116
|
watch: extras.watch,
|
|
116
117
|
},
|
|
117
|
-
}
|
|
118
|
+
};
|
|
119
|
+
if (extras.watch) {
|
|
120
|
+
// This is required since SWC no longer supports auto-compiling of newly added files in watch mode.
|
|
121
|
+
// We need to watch the source directory and trigger SWC compilation manually.
|
|
122
|
+
await this.watchFilesInSrcDir(options, async (file) => {
|
|
123
|
+
// Transpile newly added file
|
|
124
|
+
await swcCli.default({
|
|
125
|
+
...swcCliOpts,
|
|
126
|
+
cliOptions: {
|
|
127
|
+
...swcCliOpts.cliOptions,
|
|
128
|
+
filenames: [file],
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
await swcCli.default(swcCliOpts);
|
|
118
134
|
}
|
|
119
135
|
loadSwcCliBinary() {
|
|
120
136
|
try {
|
|
@@ -172,6 +188,28 @@ class SwcCompiler extends base_compiler_1.BaseCompiler {
|
|
|
172
188
|
timeout = setTimeout(callback, wait);
|
|
173
189
|
};
|
|
174
190
|
}
|
|
191
|
+
async watchFilesInSrcDir(options, onFileAdded) {
|
|
192
|
+
const srcDir = options.cliOptions?.filenames?.[0];
|
|
193
|
+
const isDirectory = await (0, promises_1.stat)(srcDir)
|
|
194
|
+
.then((stats) => stats.isDirectory())
|
|
195
|
+
.catch(() => false);
|
|
196
|
+
if (!srcDir || !isDirectory) {
|
|
197
|
+
// Skip watching if source directory is not a default "src" folder
|
|
198
|
+
// or any other specified directory
|
|
199
|
+
return;
|
|
200
|
+
}
|
|
201
|
+
const extensions = options.cliOptions?.extensions ?? ['ts'];
|
|
202
|
+
const watcher = chokidar.watch(srcDir, {
|
|
203
|
+
ignored: (file, stats) => (stats?.isFile() &&
|
|
204
|
+
extensions.includes(path.extname(file).slice(1))),
|
|
205
|
+
ignoreInitial: true,
|
|
206
|
+
awaitWriteFinish: {
|
|
207
|
+
stabilityThreshold: 50,
|
|
208
|
+
pollInterval: 10,
|
|
209
|
+
},
|
|
210
|
+
});
|
|
211
|
+
watcher.on('add', async (file) => onFileAdded(file));
|
|
212
|
+
}
|
|
175
213
|
watchFilesInOutDir(options, onChange) {
|
|
176
214
|
const dir = (0, path_1.isAbsolute)(options.cliOptions.outDir)
|
|
177
215
|
? options.cliOptions.outDir
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/cli",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.9",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@cli)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -38,49 +38,49 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://github.com/nestjs/nest-cli#readme",
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@angular-devkit/core": "
|
|
42
|
-
"@angular-devkit/schematics": "
|
|
43
|
-
"@angular-devkit/schematics-cli": "
|
|
44
|
-
"@inquirer/prompts": "7.
|
|
41
|
+
"@angular-devkit/core": "20.1.3",
|
|
42
|
+
"@angular-devkit/schematics": "20.1.3",
|
|
43
|
+
"@angular-devkit/schematics-cli": "20.1.3",
|
|
44
|
+
"@inquirer/prompts": "7.8.0",
|
|
45
45
|
"@nestjs/schematics": "^11.0.1",
|
|
46
|
-
"ansis": "
|
|
46
|
+
"ansis": "4.1.0",
|
|
47
47
|
"chokidar": "4.0.3",
|
|
48
48
|
"cli-table3": "0.6.5",
|
|
49
49
|
"commander": "4.1.1",
|
|
50
50
|
"fork-ts-checker-webpack-plugin": "9.1.0",
|
|
51
|
-
"glob": "11.0.
|
|
51
|
+
"glob": "11.0.3",
|
|
52
52
|
"node-emoji": "1.11.0",
|
|
53
53
|
"ora": "5.4.1",
|
|
54
54
|
"tree-kill": "1.2.2",
|
|
55
55
|
"tsconfig-paths": "4.2.0",
|
|
56
56
|
"tsconfig-paths-webpack-plugin": "4.2.0",
|
|
57
57
|
"typescript": "5.8.3",
|
|
58
|
-
"webpack": "5.
|
|
58
|
+
"webpack": "5.100.2",
|
|
59
59
|
"webpack-node-externals": "3.0.0"
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
|
-
"@commitlint/cli": "19.8.
|
|
63
|
-
"@commitlint/config-angular": "19.8.
|
|
64
|
-
"@swc/cli": "0.7.
|
|
65
|
-
"@swc/core": "1.
|
|
66
|
-
"@types/inquirer": "9.0.
|
|
62
|
+
"@commitlint/cli": "19.8.1",
|
|
63
|
+
"@commitlint/config-angular": "19.8.1",
|
|
64
|
+
"@swc/cli": "0.7.8",
|
|
65
|
+
"@swc/core": "1.13.3",
|
|
66
|
+
"@types/inquirer": "9.0.8",
|
|
67
67
|
"@types/jest": "29.5.14",
|
|
68
|
-
"@types/node": "22.
|
|
68
|
+
"@types/node": "22.17.0",
|
|
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.38.0",
|
|
72
|
+
"@typescript-eslint/parser": "8.38.0",
|
|
73
73
|
"delete-empty": "3.0.0",
|
|
74
|
-
"eslint": "9.
|
|
75
|
-
"eslint-config-prettier": "10.1.
|
|
76
|
-
"gulp": "5.0.
|
|
74
|
+
"eslint": "9.32.0",
|
|
75
|
+
"eslint-config-prettier": "10.1.8",
|
|
76
|
+
"gulp": "5.0.1",
|
|
77
77
|
"gulp-clean": "0.4.0",
|
|
78
78
|
"husky": "9.1.7",
|
|
79
79
|
"jest": "29.7.0",
|
|
80
|
-
"lint-staged": "
|
|
81
|
-
"prettier": "3.
|
|
82
|
-
"release-it": "19.0.
|
|
83
|
-
"ts-jest": "29.
|
|
80
|
+
"lint-staged": "16.1.2",
|
|
81
|
+
"prettier": "3.6.2",
|
|
82
|
+
"release-it": "19.0.4",
|
|
83
|
+
"ts-jest": "29.4.0",
|
|
84
84
|
"ts-loader": "9.5.2",
|
|
85
85
|
"ts-node": "10.9.2"
|
|
86
86
|
},
|