@nestjs/schematics 9.2.0 → 10.0.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/dist/lib/application/application.factory.js +4 -1
- package/dist/lib/application/files/js/package.json +11 -11
- package/dist/lib/application/files/ts/package.json +8 -8
- package/dist/lib/application/files/ts/tsconfig.json +1 -1
- package/dist/lib/class/class.factory.js +4 -1
- package/dist/lib/client-app/angular/angular.factory.js +8 -2
- package/dist/lib/configuration/configuration.factory.js +4 -1
- package/dist/lib/controller/controller.factory.js +4 -1
- package/dist/lib/decorator/decorator.factory.js +4 -1
- package/dist/lib/filter/filter.factory.js +4 -1
- package/dist/lib/gateway/gateway.factory.js +4 -1
- package/dist/lib/guard/guard.factory.js +4 -1
- package/dist/lib/interceptor/interceptor.factory.js +4 -1
- package/dist/lib/interface/interface.factory.js +4 -1
- package/dist/lib/library/files/js/jsconfig.json +1 -1
- package/dist/lib/library/library.factory.js +4 -1
- package/dist/lib/middleware/middleware.factory.js +4 -1
- package/dist/lib/module/module.factory.js +4 -1
- package/dist/lib/pipe/pipe.factory.js +4 -1
- package/dist/lib/provider/provider.factory.js +4 -1
- package/dist/lib/resolver/resolver.factory.js +4 -1
- package/dist/lib/resource/resource.factory.js +13 -5
- package/dist/lib/service/service.factory.js +4 -1
- package/dist/lib/sub-app/files/js/jsconfig.json +1 -1
- package/dist/lib/sub-app/sub-app.factory.js +14 -7
- package/dist/lib/sub-app/workspace/js/jsconfig.json +1 -1
- package/dist/utils/dependencies.utils.js +1 -1
- package/dist/utils/metadata.manager.d.ts +1 -1
- package/dist/utils/metadata.manager.js +3 -0
- package/dist/utils/module-metadata.declarator.js +1 -1
- package/package.json +14 -13
|
@@ -46,7 +46,10 @@ function resolvePackageName(path) {
|
|
|
46
46
|
}
|
|
47
47
|
function generate(options, path) {
|
|
48
48
|
return (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
49
|
-
(0, schematics_1.template)(
|
|
49
|
+
(0, schematics_1.template)({
|
|
50
|
+
...core_1.strings,
|
|
51
|
+
...options,
|
|
52
|
+
}),
|
|
50
53
|
(0, schematics_1.move)(path),
|
|
51
54
|
]);
|
|
52
55
|
}
|
|
@@ -14,21 +14,21 @@
|
|
|
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": "^10.0.0",
|
|
18
|
+
"@nestjs/core": "^10.0.0",
|
|
19
|
+
"@nestjs/platform-express": "^10.0.0",
|
|
20
20
|
"reflect-metadata": "^0.1.13",
|
|
21
21
|
"rxjs": "^7.2.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@nestjs/testing": "^
|
|
25
|
-
"@babel/core": "7.
|
|
26
|
-
"@babel/node": "7.
|
|
27
|
-
"@babel/plugin-proposal-decorators": "7.
|
|
28
|
-
"@babel/plugin-transform-runtime": "7.
|
|
29
|
-
"@babel/preset-env": "7.
|
|
30
|
-
"@babel/register": "7.
|
|
31
|
-
"@babel/runtime": "7.
|
|
24
|
+
"@nestjs/testing": "^10.0.0",
|
|
25
|
+
"@babel/core": "7.22.5",
|
|
26
|
+
"@babel/node": "7.22.5",
|
|
27
|
+
"@babel/plugin-proposal-decorators": "7.22.5",
|
|
28
|
+
"@babel/plugin-transform-runtime": "7.22.5",
|
|
29
|
+
"@babel/preset-env": "7.22.5",
|
|
30
|
+
"@babel/register": "7.22.5",
|
|
31
|
+
"@babel/runtime": "7.22.5",
|
|
32
32
|
"jest": "29.5.0",
|
|
33
33
|
"nodemon": "2.0.22",
|
|
34
34
|
"prettier": "2.8.8",
|
|
@@ -20,19 +20,19 @@
|
|
|
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": "^
|
|
23
|
+
"@nestjs/common": "^10.0.0",
|
|
24
|
+
"@nestjs/core": "^10.0.0",
|
|
25
|
+
"@nestjs/platform-express": "^10.0.0",
|
|
26
26
|
"reflect-metadata": "^0.1.13",
|
|
27
27
|
"rxjs": "^7.2.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@nestjs/cli": "^
|
|
31
|
-
"@nestjs/schematics": "^
|
|
32
|
-
"@nestjs/testing": "^
|
|
30
|
+
"@nestjs/cli": "^10.0.0",
|
|
31
|
+
"@nestjs/schematics": "^10.0.0",
|
|
32
|
+
"@nestjs/testing": "^10.0.0",
|
|
33
33
|
"@types/express": "^4.17.13",
|
|
34
|
-
"@types/jest": "29.5.
|
|
35
|
-
"@types/node": "18.16.
|
|
34
|
+
"@types/jest": "29.5.2",
|
|
35
|
+
"@types/node": "18.16.18",
|
|
36
36
|
"@types/supertest": "^2.0.11",
|
|
37
37
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
38
38
|
"@typescript-eslint/parser": "^5.0.0",
|
|
@@ -43,7 +43,10 @@ function generate(options) {
|
|
|
43
43
|
const suffix = `.__specFileSuffix__.${languageExtension}`;
|
|
44
44
|
return !path.endsWith(suffix);
|
|
45
45
|
}),
|
|
46
|
-
(0, schematics_1.template)(
|
|
46
|
+
(0, schematics_1.template)({
|
|
47
|
+
...core_1.strings,
|
|
48
|
+
...options,
|
|
49
|
+
}),
|
|
47
50
|
(0, schematics_1.move)(options.path),
|
|
48
51
|
])(context);
|
|
49
52
|
}
|
|
@@ -34,7 +34,10 @@ function transform(source) {
|
|
|
34
34
|
}
|
|
35
35
|
function generate(options) {
|
|
36
36
|
return (context) => (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
|
|
37
|
-
(0, schematics_1.template)(
|
|
37
|
+
(0, schematics_1.template)({
|
|
38
|
+
...core_1.strings,
|
|
39
|
+
...options,
|
|
40
|
+
}),
|
|
38
41
|
(0, schematics_1.move)(options.path),
|
|
39
42
|
])(context);
|
|
40
43
|
}
|
|
@@ -65,7 +68,10 @@ function addDeclarationToModule(options) {
|
|
|
65
68
|
rootPath,
|
|
66
69
|
},
|
|
67
70
|
};
|
|
68
|
-
const declarationOptions =
|
|
71
|
+
const declarationOptions = {
|
|
72
|
+
...options,
|
|
73
|
+
staticOptions,
|
|
74
|
+
};
|
|
69
75
|
tree.overwrite(options.module, declarator.declare(content, declarationOptions));
|
|
70
76
|
return tree;
|
|
71
77
|
};
|
|
@@ -18,7 +18,10 @@ function transform(options) {
|
|
|
18
18
|
}
|
|
19
19
|
function generate(options) {
|
|
20
20
|
return (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
21
|
-
(0, schematics_1.template)(
|
|
21
|
+
(0, schematics_1.template)({
|
|
22
|
+
...core_1.strings,
|
|
23
|
+
...options,
|
|
24
|
+
}),
|
|
22
25
|
(0, schematics_1.move)(options.project),
|
|
23
26
|
]);
|
|
24
27
|
}
|
|
@@ -46,7 +46,10 @@ function generate(options) {
|
|
|
46
46
|
const suffix = `.__specFileSuffix__.${languageExtension}`;
|
|
47
47
|
return !path.endsWith(suffix);
|
|
48
48
|
}),
|
|
49
|
-
(0, schematics_1.template)(
|
|
49
|
+
(0, schematics_1.template)({
|
|
50
|
+
...core_1.strings,
|
|
51
|
+
...options,
|
|
52
|
+
}),
|
|
50
53
|
(0, schematics_1.move)(options.path),
|
|
51
54
|
])(context);
|
|
52
55
|
}
|
|
@@ -27,7 +27,10 @@ function transform(options) {
|
|
|
27
27
|
}
|
|
28
28
|
function generate(options) {
|
|
29
29
|
return (context) => (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
30
|
-
(0, schematics_1.template)(
|
|
30
|
+
(0, schematics_1.template)({
|
|
31
|
+
...core_1.strings,
|
|
32
|
+
...options,
|
|
33
|
+
}),
|
|
31
34
|
(0, schematics_1.move)(options.path),
|
|
32
35
|
])(context);
|
|
33
36
|
}
|
|
@@ -35,7 +35,10 @@ function generate(options) {
|
|
|
35
35
|
const suffix = `.__specFileSuffix__.${languageExtension}`;
|
|
36
36
|
return !path.endsWith(suffix);
|
|
37
37
|
}),
|
|
38
|
-
(0, schematics_1.template)(
|
|
38
|
+
(0, schematics_1.template)({
|
|
39
|
+
...core_1.strings,
|
|
40
|
+
...options,
|
|
41
|
+
}),
|
|
39
42
|
(0, schematics_1.move)(options.path),
|
|
40
43
|
])(context);
|
|
41
44
|
}
|
|
@@ -46,7 +46,10 @@ function generate(options) {
|
|
|
46
46
|
const suffix = `.__specFileSuffix__.${languageExtension}`;
|
|
47
47
|
return !path.endsWith(suffix);
|
|
48
48
|
}),
|
|
49
|
-
(0, schematics_1.template)(
|
|
49
|
+
(0, schematics_1.template)({
|
|
50
|
+
...core_1.strings,
|
|
51
|
+
...options,
|
|
52
|
+
}),
|
|
50
53
|
(0, schematics_1.move)(options.path),
|
|
51
54
|
])(context);
|
|
52
55
|
}
|
|
@@ -35,7 +35,10 @@ function generate(options) {
|
|
|
35
35
|
const suffix = `.__specFileSuffix__.${languageExtension}`;
|
|
36
36
|
return !path.endsWith(suffix);
|
|
37
37
|
}),
|
|
38
|
-
(0, schematics_1.template)(
|
|
38
|
+
(0, schematics_1.template)({
|
|
39
|
+
...core_1.strings,
|
|
40
|
+
...options,
|
|
41
|
+
}),
|
|
39
42
|
(0, schematics_1.move)(options.path),
|
|
40
43
|
])(context);
|
|
41
44
|
}
|
|
@@ -36,7 +36,10 @@ function generate(options) {
|
|
|
36
36
|
const suffix = `.__specFileSuffix__.${languageExtension}`;
|
|
37
37
|
return !path.endsWith(suffix);
|
|
38
38
|
}),
|
|
39
|
-
(0, schematics_1.template)(
|
|
39
|
+
(0, schematics_1.template)({
|
|
40
|
+
...core_1.strings,
|
|
41
|
+
...options,
|
|
42
|
+
}),
|
|
40
43
|
(0, schematics_1.move)(options.path),
|
|
41
44
|
])(context);
|
|
42
45
|
}
|
|
@@ -26,7 +26,10 @@ function transform(options) {
|
|
|
26
26
|
}
|
|
27
27
|
function generate(options) {
|
|
28
28
|
return (context) => (0, schematics_1.apply)((0, schematics_1.url)('./files'), [
|
|
29
|
-
(0, schematics_1.template)(
|
|
29
|
+
(0, schematics_1.template)({
|
|
30
|
+
...core_1.strings,
|
|
31
|
+
...options,
|
|
32
|
+
}),
|
|
30
33
|
(0, schematics_1.move)(options.path),
|
|
31
34
|
])(context);
|
|
32
35
|
}
|
|
@@ -184,7 +184,10 @@ function addLibraryToCliOptions(projectRoot, projectName) {
|
|
|
184
184
|
function generate(options) {
|
|
185
185
|
const path = (0, core_1.join)(options.path, options.name);
|
|
186
186
|
return (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
187
|
-
(0, schematics_1.template)(
|
|
187
|
+
(0, schematics_1.template)({
|
|
188
|
+
...core_1.strings,
|
|
189
|
+
...options,
|
|
190
|
+
}),
|
|
188
191
|
(0, schematics_1.move)(path),
|
|
189
192
|
]);
|
|
190
193
|
}
|
|
@@ -35,7 +35,10 @@ function generate(options) {
|
|
|
35
35
|
const suffix = `.__specFileSuffix__.${languageExtension}`;
|
|
36
36
|
return !path.endsWith(suffix);
|
|
37
37
|
}),
|
|
38
|
-
(0, schematics_1.template)(
|
|
38
|
+
(0, schematics_1.template)({
|
|
39
|
+
...core_1.strings,
|
|
40
|
+
...options,
|
|
41
|
+
}),
|
|
39
42
|
(0, schematics_1.move)(options.path),
|
|
40
43
|
])(context);
|
|
41
44
|
}
|
|
@@ -34,7 +34,10 @@ function transform(source) {
|
|
|
34
34
|
}
|
|
35
35
|
function generate(options) {
|
|
36
36
|
return (context) => (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
37
|
-
(0, schematics_1.template)(
|
|
37
|
+
(0, schematics_1.template)({
|
|
38
|
+
...core_1.strings,
|
|
39
|
+
...options,
|
|
40
|
+
}),
|
|
38
41
|
(0, schematics_1.move)(options.path),
|
|
39
42
|
])(context);
|
|
40
43
|
}
|
|
@@ -36,7 +36,10 @@ function generate(options) {
|
|
|
36
36
|
const suffix = `.__specFileSuffix__.${languageExtension}`;
|
|
37
37
|
return !path.endsWith(suffix);
|
|
38
38
|
}),
|
|
39
|
-
(0, schematics_1.template)(
|
|
39
|
+
(0, schematics_1.template)({
|
|
40
|
+
...core_1.strings,
|
|
41
|
+
...options,
|
|
42
|
+
}),
|
|
40
43
|
(0, schematics_1.move)(options.path),
|
|
41
44
|
])(context);
|
|
42
45
|
}
|
|
@@ -50,7 +50,10 @@ function generate(options) {
|
|
|
50
50
|
const suffix = `.__specFileSuffix__.${languageExtension}`;
|
|
51
51
|
return !path.endsWith(suffix);
|
|
52
52
|
}),
|
|
53
|
-
(0, schematics_1.template)(
|
|
53
|
+
(0, schematics_1.template)({
|
|
54
|
+
...core_1.strings,
|
|
55
|
+
...options,
|
|
56
|
+
}),
|
|
54
57
|
(0, schematics_1.move)(options.path),
|
|
55
58
|
])(context);
|
|
56
59
|
}
|
|
@@ -45,7 +45,10 @@ function generate(options) {
|
|
|
45
45
|
const suffix = `.__specFileSuffix__.${languageExtension}`;
|
|
46
46
|
return !path.endsWith(suffix);
|
|
47
47
|
}),
|
|
48
|
-
(0, schematics_1.template)(
|
|
48
|
+
(0, schematics_1.template)({
|
|
49
|
+
...core_1.strings,
|
|
50
|
+
...options,
|
|
51
|
+
}),
|
|
49
52
|
(0, schematics_1.move)(options.path),
|
|
50
53
|
])(context);
|
|
51
54
|
}
|
|
@@ -24,7 +24,6 @@ function main(options) {
|
|
|
24
24
|
}
|
|
25
25
|
exports.main = main;
|
|
26
26
|
function transform(options) {
|
|
27
|
-
var _a;
|
|
28
27
|
const target = Object.assign({}, options);
|
|
29
28
|
if (!target.name) {
|
|
30
29
|
throw new schematics_1.SchematicsException('Option (name) is required.');
|
|
@@ -41,7 +40,7 @@ function transform(options) {
|
|
|
41
40
|
target.path = target.flat
|
|
42
41
|
? target.path
|
|
43
42
|
: (0, core_1.join)(target.path, target.name);
|
|
44
|
-
target.isSwaggerInstalled =
|
|
43
|
+
target.isSwaggerInstalled = options.isSwaggerInstalled ?? false;
|
|
45
44
|
return target;
|
|
46
45
|
}
|
|
47
46
|
function generate(options) {
|
|
@@ -83,10 +82,16 @@ function generate(options) {
|
|
|
83
82
|
const suffix = `.__specFileSuffix__.ts`;
|
|
84
83
|
return !path.endsWith(suffix);
|
|
85
84
|
}),
|
|
86
|
-
(0, schematics_1.template)(
|
|
85
|
+
(0, schematics_1.template)({
|
|
86
|
+
...core_1.strings,
|
|
87
|
+
...options,
|
|
88
|
+
lowercased: (name) => {
|
|
87
89
|
const classifiedName = (0, strings_1.classify)(name);
|
|
88
90
|
return (classifiedName.charAt(0).toLowerCase() + classifiedName.slice(1));
|
|
89
|
-
},
|
|
91
|
+
},
|
|
92
|
+
singular: (name) => pluralize.singular(name),
|
|
93
|
+
ent: (name) => name + '.entity',
|
|
94
|
+
}),
|
|
90
95
|
(0, schematics_1.move)(options.path),
|
|
91
96
|
])(context);
|
|
92
97
|
}
|
|
@@ -104,7 +109,10 @@ function addDeclarationToModule(options) {
|
|
|
104
109
|
}
|
|
105
110
|
const content = tree.read(options.module).toString();
|
|
106
111
|
const declarator = new __1.ModuleDeclarator();
|
|
107
|
-
tree.overwrite(options.module, declarator.declare(content,
|
|
112
|
+
tree.overwrite(options.module, declarator.declare(content, {
|
|
113
|
+
...options,
|
|
114
|
+
type: 'module',
|
|
115
|
+
}));
|
|
108
116
|
return tree;
|
|
109
117
|
};
|
|
110
118
|
}
|
|
@@ -46,7 +46,10 @@ function generate(options) {
|
|
|
46
46
|
const suffix = `.__specFileSuffix__.${languageExtension}`;
|
|
47
47
|
return !path.endsWith(suffix);
|
|
48
48
|
}),
|
|
49
|
-
(0, schematics_1.template)(
|
|
49
|
+
(0, schematics_1.template)({
|
|
50
|
+
...core_1.strings,
|
|
51
|
+
...options,
|
|
52
|
+
}),
|
|
50
53
|
(0, schematics_1.move)(options.path),
|
|
51
54
|
])(context);
|
|
52
55
|
}
|
|
@@ -4,7 +4,7 @@ exports.main = void 0;
|
|
|
4
4
|
const core_1 = require("@angular-devkit/core");
|
|
5
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
6
6
|
const fs_1 = require("fs");
|
|
7
|
-
const
|
|
7
|
+
const comment_json_1 = require("comment-json");
|
|
8
8
|
const formatting_1 = require("../../utils/formatting");
|
|
9
9
|
const defaults_1 = require("../defaults");
|
|
10
10
|
function main(options) {
|
|
@@ -37,7 +37,7 @@ function getAppNameFromPackageJson() {
|
|
|
37
37
|
name = name.replace(/[^\w.]+/g, '-').replace(/\-+/g, '-');
|
|
38
38
|
return name[0] === '-' ? name.substr(1) : name;
|
|
39
39
|
}
|
|
40
|
-
catch
|
|
40
|
+
catch {
|
|
41
41
|
return defaults_1.DEFAULT_DIR_ENTRY_APP;
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -73,16 +73,16 @@ function isMonorepo(host) {
|
|
|
73
73
|
return false;
|
|
74
74
|
}
|
|
75
75
|
const sourceText = source.toString('utf-8');
|
|
76
|
-
const optionsObj = (0,
|
|
76
|
+
const optionsObj = (0, comment_json_1.parse)(sourceText);
|
|
77
77
|
return !!optionsObj.monorepo;
|
|
78
78
|
}
|
|
79
79
|
function updateJsonFile(host, path, callback) {
|
|
80
80
|
const source = host.read(path);
|
|
81
81
|
if (source) {
|
|
82
82
|
const sourceText = source.toString('utf-8');
|
|
83
|
-
const json = (0,
|
|
83
|
+
const json = (0, comment_json_1.parse)(sourceText);
|
|
84
84
|
callback(json);
|
|
85
|
-
host.overwrite(path,
|
|
85
|
+
host.overwrite(path, (0, comment_json_1.stringify)(json, null, 2));
|
|
86
86
|
}
|
|
87
87
|
return host;
|
|
88
88
|
}
|
|
@@ -245,14 +245,21 @@ function updateMainAppOptions(optionsFile, projectRoot, appName) {
|
|
|
245
245
|
function generateWorkspace(options, appName) {
|
|
246
246
|
const path = (0, core_1.join)(options.path, appName);
|
|
247
247
|
return (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./workspace', options.language)), [
|
|
248
|
-
(0, schematics_1.template)(
|
|
248
|
+
(0, schematics_1.template)({
|
|
249
|
+
...core_1.strings,
|
|
250
|
+
...options,
|
|
251
|
+
name: appName,
|
|
252
|
+
}),
|
|
249
253
|
(0, schematics_1.move)(path),
|
|
250
254
|
]);
|
|
251
255
|
}
|
|
252
256
|
function generate(options) {
|
|
253
257
|
const path = (0, core_1.join)(options.path, options.name);
|
|
254
258
|
return (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
255
|
-
(0, schematics_1.template)(
|
|
259
|
+
(0, schematics_1.template)({
|
|
260
|
+
...core_1.strings,
|
|
261
|
+
...options,
|
|
262
|
+
}),
|
|
256
263
|
(0, schematics_1.move)(path),
|
|
257
264
|
]);
|
|
258
265
|
}
|
|
@@ -9,7 +9,7 @@ var NodeDependencyType;
|
|
|
9
9
|
NodeDependencyType["Dev"] = "devDependencies";
|
|
10
10
|
NodeDependencyType["Peer"] = "peerDependencies";
|
|
11
11
|
NodeDependencyType["Optional"] = "optionalDependencies";
|
|
12
|
-
})(NodeDependencyType
|
|
12
|
+
})(NodeDependencyType || (exports.NodeDependencyType = NodeDependencyType = {}));
|
|
13
13
|
const ALL_DEPENDENCY_TYPE = [
|
|
14
14
|
NodeDependencyType.Default,
|
|
15
15
|
NodeDependencyType.Dev,
|
|
@@ -2,7 +2,7 @@ import { DeclarationOptions } from './module.declarator';
|
|
|
2
2
|
export declare class MetadataManager {
|
|
3
3
|
private content;
|
|
4
4
|
constructor(content: string);
|
|
5
|
-
insert(metadata: string, symbol: string, staticOptions?: DeclarationOptions['staticOptions']): string;
|
|
5
|
+
insert(metadata: string, symbol: string, staticOptions?: DeclarationOptions['staticOptions']): string | undefined;
|
|
6
6
|
private getDecoratorMetadata;
|
|
7
7
|
private getSourceNodes;
|
|
8
8
|
private insertMetadataToEmptyModuleDecorator;
|
|
@@ -10,6 +10,9 @@ class MetadataManager {
|
|
|
10
10
|
const source = (0, typescript_1.createSourceFile)('filename.ts', this.content, typescript_1.ScriptTarget.ES2017);
|
|
11
11
|
const decoratorNodes = this.getDecoratorMetadata(source, '@Module');
|
|
12
12
|
const node = decoratorNodes[0];
|
|
13
|
+
if (!node) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
13
16
|
const matchingProperties = node.properties
|
|
14
17
|
.filter((prop) => prop.kind === typescript_1.SyntaxKind.PropertyAssignment)
|
|
15
18
|
.filter((prop) => {
|
|
@@ -6,7 +6,7 @@ class ModuleMetadataDeclarator {
|
|
|
6
6
|
declare(content, options) {
|
|
7
7
|
const manager = new metadata_manager_1.MetadataManager(content);
|
|
8
8
|
const inserted = manager.insert(options.metadata, options.symbol, options.staticOptions);
|
|
9
|
-
return inserted;
|
|
9
|
+
return inserted ?? content;
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
exports.ModuleMetadataDeclarator = ModuleMetadataDeclarator;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/schematics",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@schematics)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -41,20 +41,21 @@
|
|
|
41
41
|
},
|
|
42
42
|
"homepage": "https://github.com/nestjs/schematics#readme",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@angular-devkit/core": "16.0
|
|
45
|
-
"@angular-devkit/schematics": "16.0
|
|
44
|
+
"@angular-devkit/core": "16.1.0",
|
|
45
|
+
"@angular-devkit/schematics": "16.1.0",
|
|
46
|
+
"comment-json": "4.2.3",
|
|
46
47
|
"jsonc-parser": "3.2.0",
|
|
47
48
|
"pluralize": "8.0.0"
|
|
48
49
|
},
|
|
49
50
|
"devDependencies": {
|
|
50
|
-
"@commitlint/cli": "17.6.
|
|
51
|
-
"@commitlint/config-angular": "17.6.
|
|
52
|
-
"@types/jest": "29.5.
|
|
53
|
-
"@types/node": "18.16.
|
|
54
|
-
"@typescript-eslint/eslint-plugin": "5.59.
|
|
55
|
-
"@typescript-eslint/parser": "5.59.
|
|
51
|
+
"@commitlint/cli": "17.6.5",
|
|
52
|
+
"@commitlint/config-angular": "17.6.5",
|
|
53
|
+
"@types/jest": "29.5.2",
|
|
54
|
+
"@types/node": "18.16.18",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "5.59.11",
|
|
56
|
+
"@typescript-eslint/parser": "5.59.11",
|
|
56
57
|
"cpx": "1.5.0",
|
|
57
|
-
"eslint": "8.
|
|
58
|
+
"eslint": "8.42.0",
|
|
58
59
|
"eslint-config-prettier": "8.8.0",
|
|
59
60
|
"eslint-plugin-import": "2.27.5",
|
|
60
61
|
"gulp": "4.0.2",
|
|
@@ -62,13 +63,13 @@
|
|
|
62
63
|
"husky": "8.0.3",
|
|
63
64
|
"jest": "29.5.0",
|
|
64
65
|
"nyc": "15.1.0",
|
|
65
|
-
"release-it": "15.
|
|
66
|
+
"release-it": "15.11.0",
|
|
66
67
|
"ts-jest": "29.1.0",
|
|
67
68
|
"ts-node": "10.9.1",
|
|
68
|
-
"typescript": "5.
|
|
69
|
+
"typescript": "5.1.3"
|
|
69
70
|
},
|
|
70
71
|
"peerDependencies": {
|
|
71
|
-
"typescript": ">=4.
|
|
72
|
+
"typescript": ">=4.8.2"
|
|
72
73
|
},
|
|
73
74
|
"schematics": "./dist/collection.json",
|
|
74
75
|
"nyc": {
|