@nestjs/schematics 11.0.0-next.2 → 11.0.1
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/dist/lib/application/files/js/package.json +10 -10
- package/dist/lib/application/files/ts/eslint.config.mjs +2 -2
- package/dist/lib/application/files/ts/package.json +25 -23
- package/dist/lib/application/files/ts/tsconfig.json +1 -1
- package/dist/lib/library/files/js/jsconfig.json +1 -1
- package/dist/lib/library/library.factory.js +6 -2
- package/dist/lib/readers/file-system.reader.js +1 -0
- package/dist/lib/sub-app/files/js/jsconfig.json +1 -1
- package/dist/lib/sub-app/sub-app.factory.js +4 -2
- package/dist/lib/sub-app/workspace/js/jsconfig.json +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -0
- package/dist/utils/json-file.util.js +4 -0
- package/dist/utils/metadata.manager.js +1 -0
- package/dist/utils/module-import.declarator.js +1 -0
- package/dist/utils/module.declarator.js +2 -0
- package/dist/utils/module.finder.js +1 -0
- package/dist/utils/object-sorting.d.ts +1 -0
- package/dist/utils/object-sorting.js +13 -0
- package/package.json +15 -16
|
@@ -14,24 +14,24 @@
|
|
|
14
14
|
"test:e2e": "jest --config ./test/jest-e2e.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@nestjs/common": "^
|
|
18
|
-
"@nestjs/core": "^
|
|
19
|
-
"@nestjs/platform-express": "^
|
|
17
|
+
"@nestjs/common": "^11.0.1",
|
|
18
|
+
"@nestjs/core": "^11.0.1",
|
|
19
|
+
"@nestjs/platform-express": "^11.0.1",
|
|
20
20
|
"reflect-metadata": "^0.2.0",
|
|
21
21
|
"rxjs": "^7.2.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@nestjs/testing": "^
|
|
25
|
-
"@babel/core": "7.26.
|
|
24
|
+
"@nestjs/testing": "^11.0.1",
|
|
25
|
+
"@babel/core": "7.26.9",
|
|
26
26
|
"@babel/node": "7.26.0",
|
|
27
27
|
"@babel/plugin-proposal-decorators": "7.25.9",
|
|
28
|
-
"@babel/plugin-transform-runtime": "7.
|
|
29
|
-
"@babel/preset-env": "7.26.
|
|
28
|
+
"@babel/plugin-transform-runtime": "7.26.9",
|
|
29
|
+
"@babel/preset-env": "7.26.9",
|
|
30
30
|
"@babel/register": "7.25.9",
|
|
31
|
-
"@babel/runtime": "7.26.
|
|
31
|
+
"@babel/runtime": "7.26.9",
|
|
32
32
|
"jest": "29.7.0",
|
|
33
|
-
"nodemon": "3.1.
|
|
34
|
-
"prettier": "3.
|
|
33
|
+
"nodemon": "3.1.9",
|
|
34
|
+
"prettier": "3.5.1",
|
|
35
35
|
"supertest": "7.0.0"
|
|
36
36
|
},
|
|
37
37
|
"jest": {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
import eslint from '@eslint/js';
|
|
3
|
-
import tseslint from 'typescript-eslint';
|
|
4
3
|
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
|
5
4
|
import globals from 'globals';
|
|
5
|
+
import tseslint from 'typescript-eslint';
|
|
6
6
|
|
|
7
7
|
export default tseslint.config(
|
|
8
8
|
{
|
|
@@ -28,7 +28,7 @@ export default tseslint.config(
|
|
|
28
28
|
{
|
|
29
29
|
rules: {
|
|
30
30
|
'@typescript-eslint/no-explicit-any': 'off',
|
|
31
|
-
'@typescript-eslint/no-floating-promises': '
|
|
31
|
+
'@typescript-eslint/no-floating-promises': 'warn',
|
|
32
32
|
'@typescript-eslint/no-unsafe-argument': 'warn'
|
|
33
33
|
},
|
|
34
34
|
},
|
|
@@ -20,36 +20,38 @@
|
|
|
20
20
|
"test:e2e": "jest --config ./test/jest-e2e.json"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@nestjs/common": "^
|
|
24
|
-
"@nestjs/core": "^
|
|
25
|
-
"@nestjs/platform-express": "^
|
|
26
|
-
"reflect-metadata": "^0.2.
|
|
23
|
+
"@nestjs/common": "^11.0.1",
|
|
24
|
+
"@nestjs/core": "^11.0.1",
|
|
25
|
+
"@nestjs/platform-express": "^11.0.1",
|
|
26
|
+
"reflect-metadata": "^0.2.2",
|
|
27
27
|
"rxjs": "^7.8.1"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@eslint/eslintrc": "^3.
|
|
31
|
-
"@eslint/js": "^9.
|
|
32
|
-
"@nestjs/cli": "^
|
|
33
|
-
"@nestjs/schematics": "^
|
|
34
|
-
"@nestjs/testing": "^
|
|
35
|
-
"@
|
|
30
|
+
"@eslint/eslintrc": "^3.2.0",
|
|
31
|
+
"@eslint/js": "^9.18.0",
|
|
32
|
+
"@nestjs/cli": "^11.0.0",
|
|
33
|
+
"@nestjs/schematics": "^11.0.0",
|
|
34
|
+
"@nestjs/testing": "^11.0.1",
|
|
35
|
+
"@swc/cli": "^0.6.0",
|
|
36
|
+
"@swc/core": "^1.10.7",
|
|
36
37
|
"@types/express": "^5.0.0",
|
|
37
|
-
"@types/jest": "^29.5.
|
|
38
|
-
"@types/node": "^22.
|
|
39
|
-
"@types/supertest": "^6.0.
|
|
40
|
-
"eslint": "^9.
|
|
41
|
-
"eslint-
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
38
|
+
"@types/jest": "^29.5.14",
|
|
39
|
+
"@types/node": "^22.10.7",
|
|
40
|
+
"@types/supertest": "^6.0.2",
|
|
41
|
+
"eslint": "^9.18.0",
|
|
42
|
+
"eslint-config-prettier": "^10.0.1",
|
|
43
|
+
"eslint-plugin-prettier": "^5.2.2",
|
|
44
|
+
"globals": "^15.14.0",
|
|
45
|
+
"jest": "^29.7.0",
|
|
46
|
+
"prettier": "^3.4.2",
|
|
45
47
|
"source-map-support": "^0.5.21",
|
|
46
48
|
"supertest": "^7.0.0",
|
|
47
|
-
"ts-jest": "^29.
|
|
48
|
-
"ts-loader": "^9.
|
|
49
|
-
"ts-node": "^10.9.
|
|
49
|
+
"ts-jest": "^29.2.5",
|
|
50
|
+
"ts-loader": "^9.5.2",
|
|
51
|
+
"ts-node": "^10.9.2",
|
|
50
52
|
"tsconfig-paths": "^4.2.0",
|
|
51
|
-
"typescript": "^5.
|
|
52
|
-
"typescript-eslint": "^8.
|
|
53
|
+
"typescript": "^5.7.3",
|
|
54
|
+
"typescript-eslint": "^8.20.0"
|
|
53
55
|
},
|
|
54
56
|
"jest": {
|
|
55
57
|
"moduleFileExtensions": [
|
|
@@ -4,7 +4,7 @@ exports.main = main;
|
|
|
4
4
|
const core_1 = require("@angular-devkit/core");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
6
|
const jsonc_parser_1 = require("jsonc-parser");
|
|
7
|
-
const
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
8
|
const defaults_1 = require("../defaults");
|
|
9
9
|
const readers_1 = require("../readers");
|
|
10
10
|
function main(options) {
|
|
@@ -43,7 +43,7 @@ function transform(options) {
|
|
|
43
43
|
throw new schematics_1.SchematicsException('Option (name) is required.');
|
|
44
44
|
}
|
|
45
45
|
target.language = target.language ? target.language : defaults_1.DEFAULT_LANGUAGE;
|
|
46
|
-
target.name = (0,
|
|
46
|
+
target.name = (0, utils_1.normalizeToKebabOrSnakeCase)(target.name);
|
|
47
47
|
target.path =
|
|
48
48
|
target.path !== undefined
|
|
49
49
|
? (0, core_1.join)((0, core_1.normalize)(defaultSourceRoot), target.path)
|
|
@@ -88,6 +88,7 @@ function updateJestConfig(jestOptions, options, packageKey, distRoot) {
|
|
|
88
88
|
const packageKeyRegex = '^' + packageKey + '(|/.*)$';
|
|
89
89
|
const packageRoot = (0, core_1.join)('<rootDir>', distRoot);
|
|
90
90
|
jestOptions.moduleNameMapper[packageKeyRegex] = (0, core_1.join)(packageRoot, '$1');
|
|
91
|
+
(0, utils_1.inPlaceSortByKeys)(jestOptions.moduleNameMapper);
|
|
91
92
|
}
|
|
92
93
|
function updateNpmScripts(scripts, options) {
|
|
93
94
|
if (!scripts) {
|
|
@@ -122,6 +123,7 @@ function updateJestEndToEnd(options) {
|
|
|
122
123
|
const packageRoot = '<rootDir>/../' + distRoot;
|
|
123
124
|
jestOptions.moduleNameMapper[deepPackagePath] = packageRoot + '/$1';
|
|
124
125
|
jestOptions.moduleNameMapper[packageKey] = packageRoot;
|
|
126
|
+
(0, utils_1.inPlaceSortByKeys)(jestOptions.moduleNameMapper);
|
|
125
127
|
});
|
|
126
128
|
};
|
|
127
129
|
}
|
|
@@ -163,6 +165,7 @@ function updateTsConfig(packageName, packagePrefix, root) {
|
|
|
163
165
|
tsconfig.compilerOptions.paths[deepPackagePath] = [];
|
|
164
166
|
}
|
|
165
167
|
tsconfig.compilerOptions.paths[deepPackagePath].push(distRoot + '/*');
|
|
168
|
+
(0, utils_1.inPlaceSortByKeys)(tsconfig.compilerOptions.paths);
|
|
166
169
|
});
|
|
167
170
|
};
|
|
168
171
|
}
|
|
@@ -198,6 +201,7 @@ function addLibraryToCliOptions(projectRoot, projectName) {
|
|
|
198
201
|
throw new schematics_1.SchematicsException(`Project "${projectName}" exists in this workspace already.`);
|
|
199
202
|
}
|
|
200
203
|
optionsFile.projects[projectName] = project;
|
|
204
|
+
(0, utils_1.inPlaceSortByKeys)(optionsFile.projects);
|
|
201
205
|
});
|
|
202
206
|
};
|
|
203
207
|
}
|
|
@@ -5,7 +5,7 @@ const core_1 = require("@angular-devkit/core");
|
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
7
|
const comment_json_1 = require("comment-json");
|
|
8
|
-
const
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
9
9
|
const defaults_1 = require("../defaults");
|
|
10
10
|
function main(options) {
|
|
11
11
|
const appName = getAppNameFromPackageJson();
|
|
@@ -53,7 +53,7 @@ function transform(options) {
|
|
|
53
53
|
target.name = defaults_1.DEFAULT_APP_NAME;
|
|
54
54
|
}
|
|
55
55
|
target.language = target.language ? target.language : defaults_1.DEFAULT_LANGUAGE;
|
|
56
|
-
target.name = (0,
|
|
56
|
+
target.name = (0, utils_1.normalizeToKebabOrSnakeCase)(target.name);
|
|
57
57
|
target.path =
|
|
58
58
|
target.path !== undefined
|
|
59
59
|
? (0, core_1.join)((0, core_1.normalize)(defaultSourceRoot), target.path)
|
|
@@ -100,6 +100,7 @@ function updateTsConfig() {
|
|
|
100
100
|
if (!tsconfig.compilerOptions.paths) {
|
|
101
101
|
tsconfig.compilerOptions.paths = {};
|
|
102
102
|
}
|
|
103
|
+
(0, utils_1.inPlaceSortByKeys)(tsconfig.compilerOptions.paths);
|
|
103
104
|
});
|
|
104
105
|
};
|
|
105
106
|
}
|
|
@@ -216,6 +217,7 @@ function addAppsToCliOptions(projectRoot, projectName, appName) {
|
|
|
216
217
|
throw new schematics_1.SchematicsException(`Project "${projectName}" exists in this workspace already.`);
|
|
217
218
|
}
|
|
218
219
|
optionsFile.projects[projectName] = project;
|
|
220
|
+
(0, utils_1.inPlaceSortByKeys)(optionsFile.projects);
|
|
219
221
|
});
|
|
220
222
|
};
|
|
221
223
|
}
|
package/dist/utils/index.d.ts
CHANGED
package/dist/utils/index.js
CHANGED
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.JSONFile = void 0;
|
|
4
4
|
const jsonc_parser_1 = require("jsonc-parser");
|
|
5
5
|
class JSONFile {
|
|
6
|
+
host;
|
|
7
|
+
path;
|
|
8
|
+
content;
|
|
6
9
|
constructor(host, path) {
|
|
7
10
|
this.host = host;
|
|
8
11
|
this.path = path;
|
|
@@ -14,6 +17,7 @@ class JSONFile {
|
|
|
14
17
|
throw new Error(`Could not read '${path}'.`);
|
|
15
18
|
}
|
|
16
19
|
}
|
|
20
|
+
_jsonAst;
|
|
17
21
|
get JsonAst() {
|
|
18
22
|
if (this._jsonAst) {
|
|
19
23
|
return this._jsonAst;
|
|
@@ -5,6 +5,8 @@ const strings_1 = require("@angular-devkit/core/src/utils/strings");
|
|
|
5
5
|
const module_import_declarator_1 = require("./module-import.declarator");
|
|
6
6
|
const module_metadata_declarator_1 = require("./module-metadata.declarator");
|
|
7
7
|
class ModuleDeclarator {
|
|
8
|
+
imports;
|
|
9
|
+
metadata;
|
|
8
10
|
constructor(imports = new module_import_declarator_1.ModuleImportDeclarator(), metadata = new module_metadata_declarator_1.ModuleMetadataDeclarator()) {
|
|
9
11
|
this.imports = imports;
|
|
10
12
|
this.metadata = metadata;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function inPlaceSortByKeys(object: Record<string, any>): Record<string, any>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.inPlaceSortByKeys = inPlaceSortByKeys;
|
|
4
|
+
function inPlaceSortByKeys(object) {
|
|
5
|
+
const sorted = {};
|
|
6
|
+
const keys = Object.keys(object);
|
|
7
|
+
keys.sort();
|
|
8
|
+
for (const key of keys) {
|
|
9
|
+
sorted[key] = object[key];
|
|
10
|
+
delete object[key];
|
|
11
|
+
}
|
|
12
|
+
return Object.assign(object, sorted);
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/schematics",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.1",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@schematics)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -41,38 +41,37 @@
|
|
|
41
41
|
},
|
|
42
42
|
"homepage": "https://github.com/nestjs/schematics#readme",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@angular-devkit/core": "19.
|
|
45
|
-
"@angular-devkit/schematics": "19.
|
|
44
|
+
"@angular-devkit/core": "19.1.7",
|
|
45
|
+
"@angular-devkit/schematics": "19.1.7",
|
|
46
46
|
"comment-json": "4.2.5",
|
|
47
47
|
"jsonc-parser": "3.3.1",
|
|
48
48
|
"pluralize": "8.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@commitlint/cli": "19.
|
|
52
|
-
"@commitlint/config-angular": "19.
|
|
51
|
+
"@commitlint/cli": "19.7.1",
|
|
52
|
+
"@commitlint/config-angular": "19.7.1",
|
|
53
53
|
"@eslint/eslintrc": "3.2.0",
|
|
54
|
-
"@eslint/js": "9.
|
|
55
|
-
"@types/eslint__js": "8.42.3",
|
|
54
|
+
"@eslint/js": "9.20.0",
|
|
56
55
|
"@types/jest": "29.5.14",
|
|
57
|
-
"@types/node": "22.
|
|
58
|
-
"@typescript-eslint/eslint-plugin": "8.
|
|
59
|
-
"@typescript-eslint/parser": "8.
|
|
56
|
+
"@types/node": "22.13.4",
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "8.24.0",
|
|
58
|
+
"@typescript-eslint/parser": "8.24.0",
|
|
60
59
|
"cpx2": "8.0.0",
|
|
61
|
-
"eslint": "9.
|
|
62
|
-
"eslint-config-prettier": "
|
|
60
|
+
"eslint": "9.20.1",
|
|
61
|
+
"eslint-config-prettier": "10.0.1",
|
|
63
62
|
"eslint-plugin-import": "2.31.0",
|
|
64
63
|
"eslint-plugin-prettier": "^5.2.1",
|
|
65
|
-
"globals": "15.
|
|
64
|
+
"globals": "15.15.0",
|
|
66
65
|
"gulp": "5.0.0",
|
|
67
66
|
"gulp-clean": "0.4.0",
|
|
68
67
|
"husky": "9.1.7",
|
|
69
68
|
"jest": "29.7.0",
|
|
70
69
|
"nyc": "17.1.0",
|
|
71
|
-
"prettier": "3.
|
|
72
|
-
"release-it": "
|
|
70
|
+
"prettier": "3.5.1",
|
|
71
|
+
"release-it": "18.1.2",
|
|
73
72
|
"ts-jest": "29.2.5",
|
|
74
73
|
"ts-node": "10.9.2",
|
|
75
|
-
"typescript": "5.7.
|
|
74
|
+
"typescript": "5.7.3",
|
|
76
75
|
"typescript-eslint": "^8.15.0"
|
|
77
76
|
},
|
|
78
77
|
"peerDependencies": {
|