@depup/nestjs__cli 11.0.18-depup.1 → 11.0.24-depup.4
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 +13 -12
- package/actions/build.action.js +1 -1
- package/actions/generate.action.js +1 -1
- package/actions/info.action.js +1 -1
- package/actions/start.action.js +21 -1
- package/changes.json +19 -15
- package/commands/generate.command.js +12 -0
- package/commands/new.command.js +1 -1
- package/lib/compiler/assets-manager.d.ts +5 -4
- package/lib/compiler/assets-manager.js +19 -8
- package/lib/compiler/compiler.js +4 -2
- package/lib/compiler/hooks/tsconfig-paths.hook.js +15 -3
- package/lib/compiler/plugins/plugins-loader.js +1 -1
- package/lib/compiler/swc/forked-type-checker.js +1 -1
- package/lib/compiler/swc/swc-compiler.js +3 -3
- package/lib/compiler/typescript-loader.d.ts +1 -0
- package/lib/compiler/typescript-loader.js +11 -3
- package/lib/compiler/watch-compiler.js +1 -0
- package/lib/configuration/configuration.d.ts +2 -2
- package/lib/runners/abstract.runner.js +3 -3
- package/lib/ui/errors.d.ts +1 -0
- package/lib/ui/errors.js +1 -0
- package/package.json +40 -36
package/README.md
CHANGED
|
@@ -13,26 +13,27 @@ npm install @depup/nestjs__cli
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [@nestjs/cli](https://www.npmjs.com/package/@nestjs/cli) @ 11.0.
|
|
17
|
-
| Processed | 2026-
|
|
16
|
+
| Original | [@nestjs/cli](https://www.npmjs.com/package/@nestjs/cli) @ 11.0.24 |
|
|
17
|
+
| Processed | 2026-07-21 |
|
|
18
18
|
| Smoke test | failed |
|
|
19
|
-
| Deps updated |
|
|
19
|
+
| Deps updated | 12 |
|
|
20
20
|
|
|
21
21
|
## Dependency Changes
|
|
22
22
|
|
|
23
23
|
| Dependency | From | To |
|
|
24
24
|
|------------|------|-----|
|
|
25
|
-
| @angular-devkit/core | 19.2.
|
|
26
|
-
| @angular-devkit/schematics | 19.2.
|
|
27
|
-
| @angular-devkit/schematics-cli | 19.2.
|
|
28
|
-
| @inquirer/prompts | 7.10.1 | ^8.
|
|
29
|
-
| @nestjs/schematics | ^11.0.1 | ^11.0
|
|
25
|
+
| @angular-devkit/core | 19.2.27 | ^22.0.7 |
|
|
26
|
+
| @angular-devkit/schematics | 19.2.27 | ^22.0.7 |
|
|
27
|
+
| @angular-devkit/schematics-cli | 19.2.27 | ^22.0.7 |
|
|
28
|
+
| @inquirer/prompts | 7.10.1 | ^8.5.2 |
|
|
29
|
+
| @nestjs/schematics | ^11.0.1 | ^11.1.0 |
|
|
30
|
+
| ansis | 4.2.0 | ^4.3.1 |
|
|
30
31
|
| chokidar | 4.0.3 | ^5.0.0 |
|
|
31
|
-
| commander | 4.1.1 | ^
|
|
32
|
+
| commander | 4.1.1 | ^15.0.0 |
|
|
32
33
|
| node-emoji | 1.11.0 | ^2.2.0 |
|
|
33
|
-
| ora | 5.4.1 | ^9.
|
|
34
|
-
| typescript | 5.9.3 | ^
|
|
35
|
-
| webpack | 5.
|
|
34
|
+
| ora | 5.4.1 | ^9.4.1 |
|
|
35
|
+
| typescript | 5.9.3 | ^7.0.2 |
|
|
36
|
+
| webpack | 5.106.2 | ^5.108.4 |
|
|
36
37
|
|
|
37
38
|
---
|
|
38
39
|
|
package/actions/build.action.js
CHANGED
|
@@ -130,7 +130,7 @@ class BuildAction extends abstract_action_1.AbstractAction {
|
|
|
130
130
|
const { Compiler } = await Promise.resolve().then(() => require('../lib/compiler/compiler'));
|
|
131
131
|
const compiler = new Compiler(this.pluginsLoader, this.tsConfigProvider, this.tsLoader);
|
|
132
132
|
compiler.run(configuration, pathToTsconfig, appName, undefined, onSuccess);
|
|
133
|
-
this.assetsManager.closeWatchers();
|
|
133
|
+
await this.assetsManager.closeWatchers();
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
getWebpackConfigFactoryByPath(webpackPath, defaultPath) {
|
|
@@ -61,7 +61,7 @@ const generateFiles = async (inputs) => {
|
|
|
61
61
|
// Only overwrite if the appName is not the default- as it has already been loaded above
|
|
62
62
|
generateSpec = (0, project_utils_1.shouldGenerateSpec)(configuration, schematic, selectedProjectName, specValue, specOptions.passedAsInput);
|
|
63
63
|
generateFlat = (0, project_utils_1.shouldGenerateFlat)(configuration, selectedProjectName, flatValue);
|
|
64
|
-
generateSpecFileSuffix = (0, project_utils_1.getSpecFileSuffix)(configuration,
|
|
64
|
+
generateSpecFileSuffix = (0, project_utils_1.getSpecFileSuffix)(configuration, selectedProjectName, specFileSuffixValue);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
if (configuration.generateOptions?.baseDir) {
|
package/actions/info.action.js
CHANGED
|
@@ -35,7 +35,7 @@ class InfoAction extends abstract_action_1.AbstractAction {
|
|
|
35
35
|
}
|
|
36
36
|
async displaySystemInformation() {
|
|
37
37
|
console.info((0, ansis_1.green) `[System Information]`);
|
|
38
|
-
console.info('OS Version :', (0, ansis_1.blue)((0, os_info_utils_1.default)((0, os_1.platform)(), (0, os_1.release)()) + (0, os_1.release)()));
|
|
38
|
+
console.info('OS Version :', (0, ansis_1.blue)((0, os_info_utils_1.default)((0, os_1.platform)(), (0, os_1.release)()) + ' ' + (0, os_1.release)()));
|
|
39
39
|
console.info('NodeJS Version :', (0, ansis_1.blue)(process.version));
|
|
40
40
|
await this.displayPackageManagerVersion();
|
|
41
41
|
}
|
package/actions/start.action.js
CHANGED
|
@@ -53,9 +53,15 @@ class StartAction extends build_action_1.BuildAction {
|
|
|
53
53
|
}
|
|
54
54
|
createOnSuccessHook(entryFile, sourceRoot, debugFlag, outDirName, binaryToRun, options) {
|
|
55
55
|
let childProcessRef;
|
|
56
|
+
let shuttingDown = false;
|
|
56
57
|
process.on('exit', () => childProcessRef && (0, tree_kill_1.treeKillSync)(childProcessRef.pid));
|
|
57
58
|
const signalHandler = (signal) => {
|
|
59
|
+
shuttingDown = true;
|
|
58
60
|
if (childProcessRef) {
|
|
61
|
+
// Forward the signal to the child so async shutdown hooks
|
|
62
|
+
// (onModuleDestroy, beforeApplicationShutdown, onApplicationShutdown)
|
|
63
|
+
// can run to completion. The CLI parent will exit when the child
|
|
64
|
+
// exits, see the child's exit handler below.
|
|
59
65
|
childProcessRef.kill(signal);
|
|
60
66
|
}
|
|
61
67
|
else {
|
|
@@ -72,7 +78,15 @@ class StartAction extends build_action_1.BuildAction {
|
|
|
72
78
|
shell: options.shell,
|
|
73
79
|
envFile: options.envFile,
|
|
74
80
|
});
|
|
75
|
-
childProcessRef.on('exit', () =>
|
|
81
|
+
childProcessRef.on('exit', (code) => {
|
|
82
|
+
childProcessRef = undefined;
|
|
83
|
+
// Exit explicitly when shutting down; in watch/cluster mode the
|
|
84
|
+
// file watcher keeps the event loop alive and would otherwise
|
|
85
|
+
// require a second Ctrl+C to exit.
|
|
86
|
+
if (shuttingDown) {
|
|
87
|
+
process.exit(code ?? 0);
|
|
88
|
+
}
|
|
89
|
+
});
|
|
76
90
|
});
|
|
77
91
|
childProcessRef.stdin && childProcessRef.stdin.pause();
|
|
78
92
|
(0, tree_kill_1.treeKillSync)(childProcessRef.pid);
|
|
@@ -85,6 +99,12 @@ class StartAction extends build_action_1.BuildAction {
|
|
|
85
99
|
childProcessRef.on('exit', (code) => {
|
|
86
100
|
process.exitCode = code;
|
|
87
101
|
childProcessRef = undefined;
|
|
102
|
+
// Exit explicitly when shutting down; in watch/cluster mode the
|
|
103
|
+
// file watcher keeps the event loop alive and would otherwise
|
|
104
|
+
// require a second Ctrl+C to exit.
|
|
105
|
+
if (shuttingDown) {
|
|
106
|
+
process.exit(code ?? 0);
|
|
107
|
+
}
|
|
88
108
|
});
|
|
89
109
|
}
|
|
90
110
|
};
|
package/changes.json
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bumped": {
|
|
3
3
|
"@angular-devkit/core": {
|
|
4
|
-
"from": "19.2.
|
|
5
|
-
"to": "^
|
|
4
|
+
"from": "19.2.27",
|
|
5
|
+
"to": "^22.0.7"
|
|
6
6
|
},
|
|
7
7
|
"@angular-devkit/schematics": {
|
|
8
|
-
"from": "19.2.
|
|
9
|
-
"to": "^
|
|
8
|
+
"from": "19.2.27",
|
|
9
|
+
"to": "^22.0.7"
|
|
10
10
|
},
|
|
11
11
|
"@angular-devkit/schematics-cli": {
|
|
12
|
-
"from": "19.2.
|
|
13
|
-
"to": "^
|
|
12
|
+
"from": "19.2.27",
|
|
13
|
+
"to": "^22.0.7"
|
|
14
14
|
},
|
|
15
15
|
"@inquirer/prompts": {
|
|
16
16
|
"from": "7.10.1",
|
|
17
|
-
"to": "^8.
|
|
17
|
+
"to": "^8.5.2"
|
|
18
18
|
},
|
|
19
19
|
"@nestjs/schematics": {
|
|
20
20
|
"from": "^11.0.1",
|
|
21
|
-
"to": "^11.0
|
|
21
|
+
"to": "^11.1.0"
|
|
22
|
+
},
|
|
23
|
+
"ansis": {
|
|
24
|
+
"from": "4.2.0",
|
|
25
|
+
"to": "^4.3.1"
|
|
22
26
|
},
|
|
23
27
|
"chokidar": {
|
|
24
28
|
"from": "4.0.3",
|
|
@@ -26,7 +30,7 @@
|
|
|
26
30
|
},
|
|
27
31
|
"commander": {
|
|
28
32
|
"from": "4.1.1",
|
|
29
|
-
"to": "^
|
|
33
|
+
"to": "^15.0.0"
|
|
30
34
|
},
|
|
31
35
|
"node-emoji": {
|
|
32
36
|
"from": "1.11.0",
|
|
@@ -34,17 +38,17 @@
|
|
|
34
38
|
},
|
|
35
39
|
"ora": {
|
|
36
40
|
"from": "5.4.1",
|
|
37
|
-
"to": "^9.
|
|
41
|
+
"to": "^9.4.1"
|
|
38
42
|
},
|
|
39
43
|
"typescript": {
|
|
40
44
|
"from": "5.9.3",
|
|
41
|
-
"to": "^
|
|
45
|
+
"to": "^7.0.2"
|
|
42
46
|
},
|
|
43
47
|
"webpack": {
|
|
44
|
-
"from": "5.
|
|
45
|
-
"to": "^5.
|
|
48
|
+
"from": "5.106.2",
|
|
49
|
+
"to": "^5.108.4"
|
|
46
50
|
}
|
|
47
51
|
},
|
|
48
|
-
"timestamp": "2026-
|
|
49
|
-
"totalUpdated":
|
|
52
|
+
"timestamp": "2026-07-21T16:06:26.858Z",
|
|
53
|
+
"totalUpdated": 12
|
|
50
54
|
}
|
|
@@ -26,6 +26,8 @@ class GenerateCommand extends abstract_command_1.AbstractCommand {
|
|
|
26
26
|
return { value: false, passedAsInput: true };
|
|
27
27
|
})
|
|
28
28
|
.option('-c, --collection [collectionName]', 'Schematics collection to use.')
|
|
29
|
+
.option('--type <type>', 'Transport layer type (rest, graphql, microservice)')
|
|
30
|
+
.option('--crud [value]', 'Generate CRUD entry points')
|
|
29
31
|
.action(async (schematic, name, path, command) => {
|
|
30
32
|
(0, extra_args_warning_1.exitIfExtraArgs)(command, 3);
|
|
31
33
|
const options = [];
|
|
@@ -60,6 +62,16 @@ class GenerateCommand extends abstract_command_1.AbstractCommand {
|
|
|
60
62
|
name: 'skipImport',
|
|
61
63
|
value: command.skipImport,
|
|
62
64
|
});
|
|
65
|
+
options.push({
|
|
66
|
+
name: 'type',
|
|
67
|
+
value: command.type,
|
|
68
|
+
});
|
|
69
|
+
if (command.crud !== undefined) {
|
|
70
|
+
options.push({
|
|
71
|
+
name: 'crud',
|
|
72
|
+
value: command.crud === true || command.crud === 'true',
|
|
73
|
+
});
|
|
74
|
+
}
|
|
63
75
|
const inputs = [];
|
|
64
76
|
inputs.push({ name: 'schematic', value: schematic });
|
|
65
77
|
inputs.push({ name: 'name', value: name });
|
package/commands/new.command.js
CHANGED
|
@@ -21,7 +21,6 @@ class NewCommand extends abstract_command_1.AbstractCommand {
|
|
|
21
21
|
.action(async (name, command) => {
|
|
22
22
|
(0, extra_args_warning_1.exitIfExtraArgs)(command, 1);
|
|
23
23
|
const options = [];
|
|
24
|
-
const availableLanguages = ['js', 'ts', 'javascript', 'typescript'];
|
|
25
24
|
options.push({ name: 'directory', value: command.directory });
|
|
26
25
|
options.push({ name: 'dry-run', value: command.dryRun });
|
|
27
26
|
options.push({ name: 'skip-git', value: command.skipGit });
|
|
@@ -32,6 +31,7 @@ class NewCommand extends abstract_command_1.AbstractCommand {
|
|
|
32
31
|
value: command.packageManager,
|
|
33
32
|
});
|
|
34
33
|
options.push({ name: 'collection', value: command.collection });
|
|
34
|
+
const availableLanguages = ['js', 'ts', 'javascript', 'typescript'];
|
|
35
35
|
if (!!command.language) {
|
|
36
36
|
const lowercasedLanguage = command.language.toLowerCase();
|
|
37
37
|
const langMatch = availableLanguages.includes(lowercasedLanguage);
|
|
@@ -2,11 +2,12 @@ import { Configuration } from '../configuration';
|
|
|
2
2
|
export declare class AssetsManager {
|
|
3
3
|
private watchAssetsKeyValue;
|
|
4
4
|
private watchers;
|
|
5
|
-
private
|
|
5
|
+
private actionInProgress;
|
|
6
6
|
/**
|
|
7
|
-
* Using on `nest build` to close file watch or the build process will not end
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* Using on `nest build` to close file watch or the build process will not end
|
|
8
|
+
* Interval like process
|
|
9
|
+
* If no action has been taken recently close watchers
|
|
10
|
+
* If action has been taken recently flag and try again
|
|
10
11
|
*/
|
|
11
12
|
closeWatchers(): void;
|
|
12
13
|
copyAssets(configuration: Required<Configuration>, appName: string | undefined, outDir: string, watchAssetsMode: boolean): void;
|
|
@@ -11,17 +11,27 @@ class AssetsManager {
|
|
|
11
11
|
constructor() {
|
|
12
12
|
this.watchAssetsKeyValue = {};
|
|
13
13
|
this.watchers = [];
|
|
14
|
-
this.
|
|
14
|
+
this.actionInProgress = false;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
|
-
* Using on `nest build` to close file watch or the build process will not end
|
|
18
|
-
*
|
|
19
|
-
*
|
|
17
|
+
* Using on `nest build` to close file watch or the build process will not end
|
|
18
|
+
* Interval like process
|
|
19
|
+
* If no action has been taken recently close watchers
|
|
20
|
+
* If action has been taken recently flag and try again
|
|
20
21
|
*/
|
|
21
22
|
closeWatchers() {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
// Consider adjusting this for larger files
|
|
24
|
+
const timeoutMs = 500;
|
|
25
|
+
const closeFn = () => {
|
|
26
|
+
if (this.actionInProgress) {
|
|
27
|
+
this.actionInProgress = false;
|
|
28
|
+
setTimeout(closeFn, timeoutMs);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
this.watchers.forEach((watcher) => watcher.close());
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
setTimeout(closeFn, timeoutMs);
|
|
25
35
|
}
|
|
26
36
|
copyAssets(configuration, appName, outDir, watchAssetsMode) {
|
|
27
37
|
const assets = (0, get_value_or_default_1.getValueOrDefault)(configuration, 'compilerOptions.assets', appName) || [];
|
|
@@ -66,7 +76,6 @@ class AssetsManager {
|
|
|
66
76
|
.on('change', (path) => this.actionOnFile({ ...option, path, action: 'change' }))
|
|
67
77
|
.on('unlink', (path) => this.actionOnFile({ ...option, path, action: 'unlink' }));
|
|
68
78
|
this.watchers.push(watcher);
|
|
69
|
-
this.watcherReadyPromises.push(new Promise((resolve) => watcher.on('ready', resolve)));
|
|
70
79
|
}
|
|
71
80
|
else {
|
|
72
81
|
const matchedPaths = (0, glob_1.sync)(item.glob, {
|
|
@@ -103,6 +112,8 @@ class AssetsManager {
|
|
|
103
112
|
}
|
|
104
113
|
// Set path value to true for watching the first time
|
|
105
114
|
this.watchAssetsKeyValue[assetCheckKey] = true;
|
|
115
|
+
// Set action to true to avoid watches getting cutoff
|
|
116
|
+
this.actionInProgress = true;
|
|
106
117
|
const dest = (0, copy_path_resolve_1.copyPathResolve)(path, item.outDir, sourceRoot.split(path_1.sep).length);
|
|
107
118
|
// Copy to output dir if file is changed or added
|
|
108
119
|
if (action === 'change') {
|
package/lib/compiler/compiler.js
CHANGED
|
@@ -34,10 +34,12 @@ class Compiler extends base_compiler_1.BaseCompiler {
|
|
|
34
34
|
const afterDeclarations = plugins.afterDeclarationsHooks.map((hook) => hook(programRef));
|
|
35
35
|
const emitResult = program.emit(undefined, undefined, undefined, undefined, {
|
|
36
36
|
before: tsconfigPathsPlugin
|
|
37
|
-
? before
|
|
37
|
+
? [tsconfigPathsPlugin, ...before]
|
|
38
38
|
: before,
|
|
39
39
|
after,
|
|
40
|
-
afterDeclarations
|
|
40
|
+
afterDeclarations: tsconfigPathsPlugin
|
|
41
|
+
? [tsconfigPathsPlugin, ...afterDeclarations]
|
|
42
|
+
: afterDeclarations,
|
|
41
43
|
});
|
|
42
44
|
const errorsCount = this.reportAfterCompilationDiagnostic(program, emitResult, tsBinary, formatHost);
|
|
43
45
|
if (errorsCount) {
|
|
@@ -15,11 +15,10 @@ function tsconfigPathsBeforeHookFactory(compilerOptions) {
|
|
|
15
15
|
if (tsBinary.isImportDeclaration(node) ||
|
|
16
16
|
(tsBinary.isExportDeclaration(node) && node.moduleSpecifier)) {
|
|
17
17
|
try {
|
|
18
|
-
const
|
|
19
|
-
if (!
|
|
18
|
+
const text = getModuleSpecifierText(node.moduleSpecifier, sf);
|
|
19
|
+
if (!text) {
|
|
20
20
|
return node;
|
|
21
21
|
}
|
|
22
|
-
const text = importPathWithQuotes.substring(1, importPathWithQuotes.length - 1);
|
|
23
22
|
const result = getNotAliasedPath(sf, matcher, text);
|
|
24
23
|
if (!result) {
|
|
25
24
|
return node;
|
|
@@ -47,6 +46,19 @@ function tsconfigPathsBeforeHookFactory(compilerOptions) {
|
|
|
47
46
|
};
|
|
48
47
|
};
|
|
49
48
|
}
|
|
49
|
+
function getModuleSpecifierText(moduleSpecifier, sourceFile) {
|
|
50
|
+
if (!moduleSpecifier) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (typeof moduleSpecifier.text === 'string') {
|
|
54
|
+
return moduleSpecifier.text;
|
|
55
|
+
}
|
|
56
|
+
const importPathWithQuotes = moduleSpecifier.getText(sourceFile);
|
|
57
|
+
if (!importPathWithQuotes) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
return importPathWithQuotes.substring(1, importPathWithQuotes.length - 1);
|
|
61
|
+
}
|
|
50
62
|
function getNotAliasedPath(sf, matcher, text) {
|
|
51
63
|
let result = matcher(text, undefined, undefined, [
|
|
52
64
|
'.ts',
|
|
@@ -52,7 +52,7 @@ class PluginsLoader {
|
|
|
52
52
|
return pluginNames.map((item) => {
|
|
53
53
|
try {
|
|
54
54
|
try {
|
|
55
|
-
const binaryPath = require.resolve(
|
|
55
|
+
const binaryPath = require.resolve(`${item}/${PLUGIN_ENTRY_FILENAME}`, {
|
|
56
56
|
paths: nodeModulePaths,
|
|
57
57
|
});
|
|
58
58
|
return require(binaryPath);
|
|
@@ -45,7 +45,7 @@ class SwcCompiler extends base_compiler_1.BaseCompiler {
|
|
|
45
45
|
if (onSuccess) {
|
|
46
46
|
onSuccess();
|
|
47
47
|
}
|
|
48
|
-
extras.assetsManager?.closeWatchers();
|
|
48
|
+
await extras.assetsManager?.closeWatchers();
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
runTypeChecker(configuration, tsConfigPath, appName, extras) {
|
|
@@ -198,10 +198,10 @@ class SwcCompiler extends base_compiler_1.BaseCompiler {
|
|
|
198
198
|
// or any other specified directory
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
|
-
const extensions = options.cliOptions?.extensions ?? ['ts'];
|
|
201
|
+
const extensions = options.cliOptions?.extensions ?? ['.ts'];
|
|
202
202
|
const watcher = chokidar.watch(srcDir, {
|
|
203
203
|
ignored: (file, stats) => (stats?.isFile() &&
|
|
204
|
-
extensions.
|
|
204
|
+
!extensions.some((ext) => file.endsWith(ext))),
|
|
205
205
|
ignoreInitial: true,
|
|
206
206
|
awaitWriteFinish: {
|
|
207
207
|
stabilityThreshold: 50,
|
|
@@ -1,23 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TypeScriptBinaryLoader = void 0;
|
|
4
|
+
const ui_1 = require("../ui");
|
|
4
5
|
class TypeScriptBinaryLoader {
|
|
5
6
|
load() {
|
|
6
7
|
if (this.tsBinary) {
|
|
7
8
|
return this.tsBinary;
|
|
8
9
|
}
|
|
10
|
+
let tsBinary;
|
|
9
11
|
try {
|
|
10
12
|
const tsBinaryPath = require.resolve('typescript', {
|
|
11
13
|
paths: [process.cwd(), ...this.getModulePaths()],
|
|
12
14
|
});
|
|
13
15
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
14
|
-
|
|
15
|
-
this.tsBinary = tsBinary;
|
|
16
|
-
return tsBinary;
|
|
16
|
+
tsBinary = require(tsBinaryPath);
|
|
17
17
|
}
|
|
18
18
|
catch {
|
|
19
19
|
throw new Error('TypeScript could not be found! Please, install "typescript" package.');
|
|
20
20
|
}
|
|
21
|
+
this.assertProgrammaticApiIsSupported(tsBinary);
|
|
22
|
+
this.tsBinary = tsBinary;
|
|
23
|
+
return tsBinary;
|
|
24
|
+
}
|
|
25
|
+
assertProgrammaticApiIsSupported(tsBinary) {
|
|
26
|
+
if (typeof tsBinary.getParsedCommandLineOfConfigFile !== 'function') {
|
|
27
|
+
throw new Error(ui_1.CLI_ERRORS.UNSUPPORTED_TYPESCRIPT_VERSION(tsBinary.version));
|
|
28
|
+
}
|
|
21
29
|
}
|
|
22
30
|
getModulePaths() {
|
|
23
31
|
const modulePaths = module.paths.slice(2, module.paths.length);
|
|
@@ -56,6 +56,7 @@ class WatchCompiler extends base_compiler_1.BaseCompiler {
|
|
|
56
56
|
const afterDeclarations = plugins.afterDeclarationsHooks.map((hook) => hook(program.getProgram()));
|
|
57
57
|
if (tsconfigPathsPlugin) {
|
|
58
58
|
before.unshift(tsconfigPathsPlugin);
|
|
59
|
+
afterDeclarations.unshift(tsconfigPathsPlugin);
|
|
59
60
|
}
|
|
60
61
|
transforms.before = before.concat(transforms.before || []);
|
|
61
62
|
transforms.after = after.concat(transforms.after || []);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type Asset =
|
|
1
|
+
export type Asset = string | AssetEntry;
|
|
2
2
|
export interface AssetEntry {
|
|
3
3
|
glob: string;
|
|
4
4
|
include?: string;
|
|
@@ -52,7 +52,7 @@ export interface CompilerOptions {
|
|
|
52
52
|
*/
|
|
53
53
|
webpackConfigPath?: string;
|
|
54
54
|
plugins?: string[] | PluginOptions[];
|
|
55
|
-
assets?:
|
|
55
|
+
assets?: Asset[];
|
|
56
56
|
deleteOutDir?: boolean;
|
|
57
57
|
manualRestart?: boolean;
|
|
58
58
|
builder?: Builder;
|
|
@@ -19,8 +19,8 @@ class AbstractRunner {
|
|
|
19
19
|
shell: true,
|
|
20
20
|
};
|
|
21
21
|
return new Promise((resolve, reject) => {
|
|
22
|
-
const
|
|
23
|
-
const child = (0, child_process_1.spawn)(
|
|
22
|
+
const fullCommand = [this.binary, ...this.args, ...args].join(' ');
|
|
23
|
+
const child = (0, child_process_1.spawn)(fullCommand, options);
|
|
24
24
|
if (collect) {
|
|
25
25
|
child.stdout.on('data', (data) => resolve(data.toString().replace(/\r\n|\n/, '')));
|
|
26
26
|
}
|
|
@@ -29,7 +29,7 @@ class AbstractRunner {
|
|
|
29
29
|
resolve(null);
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
console.error((0, ansis_1.red)(ui_1.MESSAGES.RUNNER_EXECUTION_ERROR(
|
|
32
|
+
console.error((0, ansis_1.red)(ui_1.MESSAGES.RUNNER_EXECUTION_ERROR(fullCommand)));
|
|
33
33
|
reject();
|
|
34
34
|
}
|
|
35
35
|
});
|
package/lib/ui/errors.d.ts
CHANGED
package/lib/ui/errors.js
CHANGED
|
@@ -4,4 +4,5 @@ exports.CLI_ERRORS = void 0;
|
|
|
4
4
|
exports.CLI_ERRORS = {
|
|
5
5
|
MISSING_TYPESCRIPT: (path) => `Could not find TypeScript configuration file "${path}". Please, ensure that you are running this command in the appropriate directory (inside Nest workspace).`,
|
|
6
6
|
WRONG_PLUGIN: (name) => `The "${name}" plugin is not compatible with Nest CLI. Neither "after()" nor "before()" nor "afterDeclarations()" function have been provided.`,
|
|
7
|
+
UNSUPPORTED_TYPESCRIPT_VERSION: (version) => `The installed TypeScript version (${version}) does not expose the programmatic compiler API that the Nest CLI requires. TypeScript 7.0 ships the "tsc" executable only; the compiler API is expected to return in 7.1. Please install TypeScript 6 (e.g. "npm i -D typescript@^6") until then.`,
|
|
7
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/nestjs__cli",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.24-depup.4",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@cli) (with updated dependencies)",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">= 20.11"
|
|
@@ -33,47 +33,47 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://github.com/nestjs/nest-cli#readme",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@angular-devkit/core": "^
|
|
37
|
-
"@angular-devkit/schematics": "^
|
|
38
|
-
"@angular-devkit/schematics-cli": "^
|
|
39
|
-
"@inquirer/prompts": "^8.
|
|
40
|
-
"@nestjs/schematics": "^11.0
|
|
41
|
-
"ansis": "4.
|
|
36
|
+
"@angular-devkit/core": "^22.0.7",
|
|
37
|
+
"@angular-devkit/schematics": "^22.0.7",
|
|
38
|
+
"@angular-devkit/schematics-cli": "^22.0.7",
|
|
39
|
+
"@inquirer/prompts": "^8.5.2",
|
|
40
|
+
"@nestjs/schematics": "^11.1.0",
|
|
41
|
+
"ansis": "^4.3.1",
|
|
42
42
|
"chokidar": "^5.0.0",
|
|
43
43
|
"cli-table3": "0.6.5",
|
|
44
|
-
"commander": "^
|
|
44
|
+
"commander": "^15.0.0",
|
|
45
45
|
"fork-ts-checker-webpack-plugin": "9.1.0",
|
|
46
46
|
"glob": "13.0.6",
|
|
47
47
|
"node-emoji": "^2.2.0",
|
|
48
|
-
"ora": "^9.
|
|
48
|
+
"ora": "^9.4.1",
|
|
49
49
|
"tsconfig-paths": "4.2.0",
|
|
50
50
|
"tsconfig-paths-webpack-plugin": "4.2.0",
|
|
51
|
-
"typescript": "^
|
|
52
|
-
"webpack": "^5.
|
|
51
|
+
"typescript": "^7.0.2",
|
|
52
|
+
"webpack": "^5.108.4",
|
|
53
53
|
"webpack-node-externals": "3.0.0"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@commitlint/cli": "20.5.
|
|
57
|
-
"@commitlint/config-angular": "20.5.
|
|
58
|
-
"@swc/cli": "0.
|
|
59
|
-
"@swc/core": "1.15.
|
|
56
|
+
"@commitlint/cli": "20.5.3",
|
|
57
|
+
"@commitlint/config-angular": "20.5.3",
|
|
58
|
+
"@swc/cli": "0.8.1",
|
|
59
|
+
"@swc/core": "1.15.40",
|
|
60
60
|
"@types/inquirer": "9.0.9",
|
|
61
61
|
"@types/jest": "29.5.14",
|
|
62
62
|
"@types/node": "24.12.2",
|
|
63
63
|
"@types/node-emoji": "1.8.2",
|
|
64
64
|
"@types/webpack-node-externals": "3.0.4",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
66
|
-
"@typescript-eslint/parser": "8.
|
|
65
|
+
"@typescript-eslint/eslint-plugin": "8.60.1",
|
|
66
|
+
"@typescript-eslint/parser": "8.60.1",
|
|
67
67
|
"delete-empty": "3.0.0",
|
|
68
|
-
"eslint": "10.2.
|
|
68
|
+
"eslint": "10.2.1",
|
|
69
69
|
"eslint-config-prettier": "10.1.8",
|
|
70
70
|
"gulp": "5.0.1",
|
|
71
71
|
"gulp-clean": "0.4.0",
|
|
72
72
|
"husky": "9.1.7",
|
|
73
73
|
"jest": "29.7.0",
|
|
74
74
|
"lint-staged": "16.4.0",
|
|
75
|
-
"prettier": "3.8.
|
|
76
|
-
"release-it": "
|
|
75
|
+
"prettier": "3.8.3",
|
|
76
|
+
"release-it": "20.0.1",
|
|
77
77
|
"ts-jest": "29.4.9",
|
|
78
78
|
"ts-loader": "9.5.7",
|
|
79
79
|
"ts-node": "10.9.2"
|
|
@@ -104,24 +104,28 @@
|
|
|
104
104
|
"depup": {
|
|
105
105
|
"changes": {
|
|
106
106
|
"@angular-devkit/core": {
|
|
107
|
-
"from": "19.2.
|
|
108
|
-
"to": "^
|
|
107
|
+
"from": "19.2.27",
|
|
108
|
+
"to": "^22.0.7"
|
|
109
109
|
},
|
|
110
110
|
"@angular-devkit/schematics": {
|
|
111
|
-
"from": "19.2.
|
|
112
|
-
"to": "^
|
|
111
|
+
"from": "19.2.27",
|
|
112
|
+
"to": "^22.0.7"
|
|
113
113
|
},
|
|
114
114
|
"@angular-devkit/schematics-cli": {
|
|
115
|
-
"from": "19.2.
|
|
116
|
-
"to": "^
|
|
115
|
+
"from": "19.2.27",
|
|
116
|
+
"to": "^22.0.7"
|
|
117
117
|
},
|
|
118
118
|
"@inquirer/prompts": {
|
|
119
119
|
"from": "7.10.1",
|
|
120
|
-
"to": "^8.
|
|
120
|
+
"to": "^8.5.2"
|
|
121
121
|
},
|
|
122
122
|
"@nestjs/schematics": {
|
|
123
123
|
"from": "^11.0.1",
|
|
124
|
-
"to": "^11.0
|
|
124
|
+
"to": "^11.1.0"
|
|
125
|
+
},
|
|
126
|
+
"ansis": {
|
|
127
|
+
"from": "4.2.0",
|
|
128
|
+
"to": "^4.3.1"
|
|
125
129
|
},
|
|
126
130
|
"chokidar": {
|
|
127
131
|
"from": "4.0.3",
|
|
@@ -129,7 +133,7 @@
|
|
|
129
133
|
},
|
|
130
134
|
"commander": {
|
|
131
135
|
"from": "4.1.1",
|
|
132
|
-
"to": "^
|
|
136
|
+
"to": "^15.0.0"
|
|
133
137
|
},
|
|
134
138
|
"node-emoji": {
|
|
135
139
|
"from": "1.11.0",
|
|
@@ -137,21 +141,21 @@
|
|
|
137
141
|
},
|
|
138
142
|
"ora": {
|
|
139
143
|
"from": "5.4.1",
|
|
140
|
-
"to": "^9.
|
|
144
|
+
"to": "^9.4.1"
|
|
141
145
|
},
|
|
142
146
|
"typescript": {
|
|
143
147
|
"from": "5.9.3",
|
|
144
|
-
"to": "^
|
|
148
|
+
"to": "^7.0.2"
|
|
145
149
|
},
|
|
146
150
|
"webpack": {
|
|
147
|
-
"from": "5.
|
|
148
|
-
"to": "^5.
|
|
151
|
+
"from": "5.106.2",
|
|
152
|
+
"to": "^5.108.4"
|
|
149
153
|
}
|
|
150
154
|
},
|
|
151
|
-
"depsUpdated":
|
|
155
|
+
"depsUpdated": 12,
|
|
152
156
|
"originalPackage": "@nestjs/cli",
|
|
153
|
-
"originalVersion": "11.0.
|
|
154
|
-
"processedAt": "2026-
|
|
157
|
+
"originalVersion": "11.0.24",
|
|
158
|
+
"processedAt": "2026-07-21T16:06:43.855Z",
|
|
155
159
|
"smokeTest": "failed"
|
|
156
160
|
}
|
|
157
161
|
}
|