@depup/nestjs__cli 12.0.5-depup.1 → 12.0.6-depup.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/README.md +2 -5
- package/changes.json +2 -14
- package/lib/compiler/assets-manager.js +9 -6
- package/lib/compiler/defaults/swc-defaults.d.ts +1 -1
- package/lib/compiler/defaults/swc-defaults.js +22 -6
- package/lib/compiler/hooks/tsconfig-paths.hook.js +19 -2
- package/lib/compiler/swc/swc-compiler.js +5 -2
- package/lib/configuration/configuration.d.ts +1 -0
- package/package.json +8 -20
package/README.md
CHANGED
|
@@ -13,18 +13,15 @@ npm install @depup/nestjs__cli
|
|
|
13
13
|
|
|
14
14
|
| Field | Value |
|
|
15
15
|
|-------|-------|
|
|
16
|
-
| Original | [@nestjs/cli](https://www.npmjs.com/package/@nestjs/cli) @ 12.0.
|
|
16
|
+
| Original | [@nestjs/cli](https://www.npmjs.com/package/@nestjs/cli) @ 12.0.6 |
|
|
17
17
|
| Processed | 2026-09-24 |
|
|
18
18
|
| Smoke test | failed |
|
|
19
|
-
| Deps updated |
|
|
19
|
+
| Deps updated | 2 |
|
|
20
20
|
|
|
21
21
|
## Dependency Changes
|
|
22
22
|
|
|
23
23
|
| Dependency | From | To |
|
|
24
24
|
|------------|------|-----|
|
|
25
|
-
| @angular-devkit/core | 22.1.8 | ^22.2.0 |
|
|
26
|
-
| @angular-devkit/schematics | 22.1.8 | ^22.2.0 |
|
|
27
|
-
| @angular-devkit/schematics-cli | 22.1.8 | ^22.2.0 |
|
|
28
25
|
| @nestjs/schematics | ^12.0.0 | ^12.0.5 |
|
|
29
26
|
| typescript | ~6.0.2 | ^7.0.2 |
|
|
30
27
|
|
package/changes.json
CHANGED
|
@@ -1,17 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bumped": {
|
|
3
|
-
"@angular-devkit/core": {
|
|
4
|
-
"from": "22.1.8",
|
|
5
|
-
"to": "^22.2.0"
|
|
6
|
-
},
|
|
7
|
-
"@angular-devkit/schematics": {
|
|
8
|
-
"from": "22.1.8",
|
|
9
|
-
"to": "^22.2.0"
|
|
10
|
-
},
|
|
11
|
-
"@angular-devkit/schematics-cli": {
|
|
12
|
-
"from": "22.1.8",
|
|
13
|
-
"to": "^22.2.0"
|
|
14
|
-
},
|
|
15
3
|
"@nestjs/schematics": {
|
|
16
4
|
"from": "^12.0.0",
|
|
17
5
|
"to": "^12.0.5"
|
|
@@ -21,6 +9,6 @@
|
|
|
21
9
|
"to": "^7.0.2"
|
|
22
10
|
}
|
|
23
11
|
},
|
|
24
|
-
"timestamp": "2026-09-
|
|
25
|
-
"totalUpdated":
|
|
12
|
+
"timestamp": "2026-09-24T08:13:03.346Z",
|
|
13
|
+
"totalUpdated": 2
|
|
26
14
|
}
|
|
@@ -56,6 +56,7 @@ export class AssetsManager {
|
|
|
56
56
|
exclude: excludePath,
|
|
57
57
|
flat: typeof item !== 'string' ? item.flat : undefined, // deprecated field
|
|
58
58
|
watchAssets: typeof item !== 'string' ? item.watchAssets : undefined,
|
|
59
|
+
restartOnChange: typeof item !== 'string' ? item.restartOnChange : undefined,
|
|
59
60
|
};
|
|
60
61
|
});
|
|
61
62
|
const allFilesToCopy = [...filesToCopy, ...libraryAssets];
|
|
@@ -119,25 +120,26 @@ export class AssetsManager {
|
|
|
119
120
|
continue;
|
|
120
121
|
}
|
|
121
122
|
let ready = false;
|
|
123
|
+
const restartApp = item.restartOnChange === false ? undefined : debouncedOnSuccess;
|
|
122
124
|
// prettier-ignore
|
|
123
125
|
const watcher = chokidar
|
|
124
126
|
.watch(matchedPaths)
|
|
125
127
|
.on('add', (path) => {
|
|
126
128
|
this.safeActionOnFile({ ...option, path, action: 'change' });
|
|
127
|
-
if (ready &&
|
|
128
|
-
|
|
129
|
+
if (ready && restartApp) {
|
|
130
|
+
restartApp();
|
|
129
131
|
}
|
|
130
132
|
})
|
|
131
133
|
.on('change', (path) => {
|
|
132
134
|
this.safeActionOnFile({ ...option, path, action: 'change' });
|
|
133
|
-
if (ready &&
|
|
134
|
-
|
|
135
|
+
if (ready && restartApp) {
|
|
136
|
+
restartApp();
|
|
135
137
|
}
|
|
136
138
|
})
|
|
137
139
|
.on('unlink', (path) => {
|
|
138
140
|
this.safeActionOnFile({ ...option, path, action: 'unlink' });
|
|
139
|
-
if (ready &&
|
|
140
|
-
|
|
141
|
+
if (ready && restartApp) {
|
|
142
|
+
restartApp();
|
|
141
143
|
}
|
|
142
144
|
});
|
|
143
145
|
let markSettled;
|
|
@@ -214,6 +216,7 @@ export class AssetsManager {
|
|
|
214
216
|
exclude: excludePath,
|
|
215
217
|
flat: typeof item !== 'string' ? item.flat : undefined,
|
|
216
218
|
watchAssets: typeof item !== 'string' ? item.watchAssets : undefined,
|
|
219
|
+
restartOnChange: typeof item !== 'string' ? item.restartOnChange : undefined,
|
|
217
220
|
_sourceRoot: libSourceRoot,
|
|
218
221
|
};
|
|
219
222
|
result.push(entry);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as ts from 'typescript';
|
|
2
2
|
import { Configuration } from '../../configuration/index.js';
|
|
3
|
-
export declare const swcDefaultsFactory: (tsOptions?: ts.CompilerOptions, configuration?: Configuration, tsConfigExclude?: string[]) => {
|
|
3
|
+
export declare const swcDefaultsFactory: (tsOptions?: ts.CompilerOptions, configuration?: Configuration, tsConfigExclude?: string[], appName?: string) => {
|
|
4
4
|
swcOptions: {
|
|
5
5
|
sourceMaps: string | boolean | undefined;
|
|
6
6
|
module: {
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
import * as ts from 'typescript';
|
|
2
2
|
import { isEsmProject } from '../../utils/is-esm-project.js';
|
|
3
|
-
|
|
3
|
+
import { getValueOrDefault } from '../helpers/get-value-or-default.js';
|
|
4
|
+
export const swcDefaultsFactory = (tsOptions, configuration, tsConfigExclude = [], appName) => {
|
|
4
5
|
const builderOptions = typeof configuration?.compilerOptions?.builder !== 'string'
|
|
5
6
|
? configuration?.compilerOptions?.builder?.options
|
|
6
7
|
: {};
|
|
7
8
|
const esm = resolveSwcModuleType(tsOptions) === 'es6';
|
|
9
|
+
// In a monorepo the root "sourceRoot" is the default project's, so reading
|
|
10
|
+
// it directly makes every other project compile the default project's
|
|
11
|
+
// sources into its own outDir. Resolve it per application, the way the rest
|
|
12
|
+
// of the compiler does.
|
|
13
|
+
const sourceRoot = configuration
|
|
14
|
+
? (getValueOrDefault(configuration, 'sourceRoot', appName, 'sourceRoot') ?? 'src')
|
|
15
|
+
: 'src';
|
|
8
16
|
return {
|
|
9
17
|
swcOptions: {
|
|
10
18
|
sourceMaps: tsOptions?.sourceMap || (tsOptions?.inlineSourceMap && 'inline'),
|
|
@@ -43,7 +51,7 @@ export const swcDefaultsFactory = (tsOptions, configuration, tsConfigExclude = [
|
|
|
43
51
|
},
|
|
44
52
|
cliOptions: {
|
|
45
53
|
outDir: tsOptions?.outDir ? convertPath(tsOptions.outDir) : 'dist',
|
|
46
|
-
filenames: [
|
|
54
|
+
filenames: [sourceRoot],
|
|
47
55
|
sync: false,
|
|
48
56
|
extensions: ['.js', '.ts'],
|
|
49
57
|
copyFiles: false,
|
|
@@ -51,7 +59,7 @@ export const swcDefaultsFactory = (tsOptions, configuration, tsConfigExclude = [
|
|
|
51
59
|
ignore: tsConfigExclude.length ? tsConfigExclude : undefined,
|
|
52
60
|
quiet: false,
|
|
53
61
|
watch: false,
|
|
54
|
-
stripLeadingPaths: shouldStripLeadingPaths(tsOptions?.rootDir,
|
|
62
|
+
stripLeadingPaths: shouldStripLeadingPaths(tsOptions?.rootDir, sourceRoot),
|
|
55
63
|
...builderOptions,
|
|
56
64
|
},
|
|
57
65
|
};
|
|
@@ -92,15 +100,23 @@ function resolveBaseUrl(tsOptions) {
|
|
|
92
100
|
* common source directory), or a rootDir that points at the source root
|
|
93
101
|
* (relative or resolved absolute). A rootDir above the source root (e.g. '.')
|
|
94
102
|
* keeps the source directory in the output, so nothing is stripped.
|
|
103
|
+
*
|
|
104
|
+
* "@swc/cli" strips only the first path segment, so a nested source root
|
|
105
|
+
* (e.g. "apps/api/src" in a monorepo) cannot be flattened: it would come out
|
|
106
|
+
* as "api/src/main.js". Keep the full source root instead, which is the
|
|
107
|
+
* "<outDir>/<sourceRoot>/<entryFile>" layout "nest start" looks for first.
|
|
95
108
|
*/
|
|
96
109
|
function shouldStripLeadingPaths(rootDir, sourceRoot) {
|
|
110
|
+
const normalizedSourceRoot = convertPath(sourceRoot)
|
|
111
|
+
.replace(/^\.\//, '')
|
|
112
|
+
.replace(/\/+$/, '');
|
|
113
|
+
if (normalizedSourceRoot.includes('/')) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
97
116
|
if (!rootDir) {
|
|
98
117
|
return true;
|
|
99
118
|
}
|
|
100
119
|
const normalizedRootDir = convertPath(rootDir).replace(/\/+$/, '');
|
|
101
|
-
const normalizedSourceRoot = convertPath(sourceRoot)
|
|
102
|
-
.replace(/^\.\//, '')
|
|
103
|
-
.replace(/\/+$/, '');
|
|
104
120
|
return (normalizedRootDir === normalizedSourceRoot ||
|
|
105
121
|
normalizedRootDir.endsWith(`/${normalizedSourceRoot}`));
|
|
106
122
|
}
|
|
@@ -7,8 +7,8 @@ import { TypeScriptBinaryLoader } from '../typescript-loader.js';
|
|
|
7
7
|
const require = createRequire(import.meta.url);
|
|
8
8
|
export function tsconfigPathsBeforeHookFactory(compilerOptions) {
|
|
9
9
|
const tsBinary = new TypeScriptBinaryLoader().load();
|
|
10
|
-
const { paths = {}
|
|
11
|
-
const matcher = tsPaths.createMatchPath(
|
|
10
|
+
const { paths = {} } = compilerOptions;
|
|
11
|
+
const matcher = tsPaths.createMatchPath(resolveBaseUrl(compilerOptions), paths, ['main']);
|
|
12
12
|
const esm = requiresExplicitImportExtensions(compilerOptions, tsBinary);
|
|
13
13
|
const extensions = sourceToOutputExtension(compilerOptions, tsBinary);
|
|
14
14
|
// Resolution is immutable within a build, and the hook runs per import.
|
|
@@ -50,6 +50,23 @@ export function tsconfigPathsBeforeHookFactory(compilerOptions) {
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* TypeScript resolves "paths" against `baseUrl ?? pathsBasePath ?? cwd`
|
|
55
|
+
* (`getPathsBasePath`), where "pathsBasePath" is the directory of the tsconfig
|
|
56
|
+
* that declared them — the shape every project takes now that TypeScript 6
|
|
57
|
+
* deprecates "baseUrl". The historical "./" fallback points at the process
|
|
58
|
+
* working directory instead, so an alias declared in a tsconfig outside it
|
|
59
|
+
* matches nothing and the import is emitted verbatim. The parser records
|
|
60
|
+
* "pathsBasePath" only for a config that sets "paths", so a project without
|
|
61
|
+
* aliases keeps the old fallback.
|
|
62
|
+
*/
|
|
63
|
+
function resolveBaseUrl(compilerOptions) {
|
|
64
|
+
if (compilerOptions.baseUrl) {
|
|
65
|
+
return compilerOptions.baseUrl;
|
|
66
|
+
}
|
|
67
|
+
const pathsBasePath = compilerOptions.pathsBasePath;
|
|
68
|
+
return typeof pathsBasePath === 'string' ? pathsBasePath : './';
|
|
69
|
+
}
|
|
53
70
|
function getModuleSpecifierText(moduleSpecifier, sourceFile) {
|
|
54
71
|
if (!moduleSpecifier) {
|
|
55
72
|
return;
|
|
@@ -27,7 +27,7 @@ export class SwcCompiler extends BaseCompiler {
|
|
|
27
27
|
super(pluginsLoader);
|
|
28
28
|
}
|
|
29
29
|
async run(configuration, tsConfigPath, appName, extras, onSuccess) {
|
|
30
|
-
const swcOptions = swcDefaultsFactory(extras.tsOptions, configuration, extras.tsConfigExclude);
|
|
30
|
+
const swcOptions = swcDefaultsFactory(extras.tsOptions, configuration, extras.tsConfigExclude, appName);
|
|
31
31
|
const swcrcFilePath = getValueOrDefault(configuration, 'compilerOptions.builder.options.swcrcPath', appName);
|
|
32
32
|
if (extras.watch) {
|
|
33
33
|
if (extras.typeCheck) {
|
|
@@ -76,7 +76,10 @@ export class SwcCompiler extends BaseCompiler {
|
|
|
76
76
|
const args = [
|
|
77
77
|
tsConfigPath,
|
|
78
78
|
appName ?? 'undefined',
|
|
79
|
-
|
|
79
|
+
// The forked checker resolves its plugin metadata output directory
|
|
80
|
+
// from this value, so it has to be the built application's source
|
|
81
|
+
// root, not the monorepo's default project one.
|
|
82
|
+
getValueOrDefault(configuration, 'sourceRoot', appName, 'sourceRoot') ?? 'src',
|
|
80
83
|
JSON.stringify(configuration.compilerOptions.plugins ?? []),
|
|
81
84
|
];
|
|
82
85
|
const childProcessRef = fork(join(__dirname, 'forked-type-checker.js'), args, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/nestjs__cli",
|
|
3
|
-
"version": "12.0.
|
|
3
|
+
"version": "12.0.6-depup.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Nest - modern, fast, powerful node.js web framework (@cli) (with updated dependencies)",
|
|
6
6
|
"engines": {
|
|
@@ -35,9 +35,9 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://github.com/nestjs/nest-cli#readme",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@angular-devkit/core": "
|
|
39
|
-
"@angular-devkit/schematics": "
|
|
40
|
-
"@angular-devkit/schematics-cli": "
|
|
38
|
+
"@angular-devkit/core": "22.2.0",
|
|
39
|
+
"@angular-devkit/schematics": "22.2.0",
|
|
40
|
+
"@angular-devkit/schematics-cli": "22.2.0",
|
|
41
41
|
"@inquirer/prompts": "8.7.2",
|
|
42
42
|
"@nestjs/schematics": "^12.0.5",
|
|
43
43
|
"ansis": "4.4.0",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"husky": "9.1.7",
|
|
67
67
|
"lint-staged": "17.5.1",
|
|
68
68
|
"oxlint": "1.85.0",
|
|
69
|
-
"prettier": "3.9.
|
|
69
|
+
"prettier": "3.9.9",
|
|
70
70
|
"release-it": "21.1.0",
|
|
71
71
|
"ts-loader": "9.6.2",
|
|
72
72
|
"tsconfig-paths-webpack-plugin": "4.2.0",
|
|
@@ -124,18 +124,6 @@
|
|
|
124
124
|
],
|
|
125
125
|
"depup": {
|
|
126
126
|
"changes": {
|
|
127
|
-
"@angular-devkit/core": {
|
|
128
|
-
"from": "22.1.8",
|
|
129
|
-
"to": "^22.2.0"
|
|
130
|
-
},
|
|
131
|
-
"@angular-devkit/schematics": {
|
|
132
|
-
"from": "22.1.8",
|
|
133
|
-
"to": "^22.2.0"
|
|
134
|
-
},
|
|
135
|
-
"@angular-devkit/schematics-cli": {
|
|
136
|
-
"from": "22.1.8",
|
|
137
|
-
"to": "^22.2.0"
|
|
138
|
-
},
|
|
139
127
|
"@nestjs/schematics": {
|
|
140
128
|
"from": "^12.0.0",
|
|
141
129
|
"to": "^12.0.5"
|
|
@@ -145,10 +133,10 @@
|
|
|
145
133
|
"to": "^7.0.2"
|
|
146
134
|
}
|
|
147
135
|
},
|
|
148
|
-
"depsUpdated":
|
|
136
|
+
"depsUpdated": 2,
|
|
149
137
|
"originalPackage": "@nestjs/cli",
|
|
150
|
-
"originalVersion": "12.0.
|
|
151
|
-
"processedAt": "2026-09-
|
|
138
|
+
"originalVersion": "12.0.6",
|
|
139
|
+
"processedAt": "2026-09-24T08:13:25.308Z",
|
|
152
140
|
"smokeTest": "failed"
|
|
153
141
|
}
|
|
154
142
|
}
|