@nestjs/schematics 10.0.1 → 10.0.3
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 +9 -0
- package/dist/lib/application/files/js/package.json +10 -10
- package/dist/lib/application/files/ts/package.json +5 -5
- package/dist/lib/application/schema.json +10 -0
- package/dist/lib/configuration/configuration.factory.js +2 -1
- package/dist/lib/resource/files/ts/__name__.module.ts +1 -1
- package/dist/lib/sub-app/sub-app.factory.js +5 -2
- package/package.json +16 -16
- /package/dist/lib/application/files/js/src/{app.controller.spec.js → app.controller.__specFileSuffix__.js} +0 -0
- /package/dist/lib/application/files/js/test/{app.e2e-spec.js → app.e2e-__specFileSuffix__.js} +0 -0
- /package/dist/lib/application/files/ts/src/{app.controller.spec.ts → app.controller.__specFileSuffix__.ts} +0 -0
- /package/dist/lib/application/files/ts/test/{app.e2e-spec.ts → app.e2e-__specFileSuffix__.ts} +0 -0
|
@@ -24,6 +24,7 @@ function transform(options) {
|
|
|
24
24
|
target.language = !!target.language ? target.language : defaults_1.DEFAULT_LANGUAGE;
|
|
25
25
|
target.name = resolvePackageName(target.name.toString());
|
|
26
26
|
target.version = !!target.version ? target.version : defaults_1.DEFAULT_VERSION;
|
|
27
|
+
target.specFileSuffix = (0, formatting_1.normalizeToKebabOrSnakeCase)(options.specFileSuffix || 'spec');
|
|
27
28
|
target.packageManager =
|
|
28
29
|
!target.packageManager || target.packageManager === 'undefined'
|
|
29
30
|
? 'npm'
|
|
@@ -46,6 +47,14 @@ function resolvePackageName(path) {
|
|
|
46
47
|
}
|
|
47
48
|
function generate(options, path) {
|
|
48
49
|
return (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
50
|
+
options.spec ? (0, schematics_1.noop)() : (0, schematics_1.filter)((path) => !path.endsWith('__specFileSuffix__.ts')),
|
|
51
|
+
options.spec
|
|
52
|
+
? (0, schematics_1.noop)()
|
|
53
|
+
: (0, schematics_1.filter)((path) => {
|
|
54
|
+
const languageExtension = options.language || 'ts';
|
|
55
|
+
const suffix = `__specFileSuffix__.${languageExtension}`;
|
|
56
|
+
return !path.endsWith(suffix);
|
|
57
|
+
}),
|
|
49
58
|
(0, schematics_1.template)({
|
|
50
59
|
...core_1.strings,
|
|
51
60
|
...options,
|
|
@@ -22,16 +22,16 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@nestjs/testing": "^10.0.0",
|
|
25
|
-
"@babel/core": "7.
|
|
26
|
-
"@babel/node": "7.22.
|
|
27
|
-
"@babel/plugin-proposal-decorators": "7.
|
|
28
|
-
"@babel/plugin-transform-runtime": "7.
|
|
29
|
-
"@babel/preset-env": "7.
|
|
30
|
-
"@babel/register": "7.22.
|
|
31
|
-
"@babel/runtime": "7.
|
|
32
|
-
"jest": "29.
|
|
33
|
-
"nodemon": "
|
|
34
|
-
"prettier": "
|
|
25
|
+
"@babel/core": "7.23.2",
|
|
26
|
+
"@babel/node": "7.22.19",
|
|
27
|
+
"@babel/plugin-proposal-decorators": "7.23.2",
|
|
28
|
+
"@babel/plugin-transform-runtime": "7.23.2",
|
|
29
|
+
"@babel/preset-env": "7.23.2",
|
|
30
|
+
"@babel/register": "7.22.15",
|
|
31
|
+
"@babel/runtime": "7.23.2",
|
|
32
|
+
"jest": "29.7.0",
|
|
33
|
+
"nodemon": "3.0.1",
|
|
34
|
+
"prettier": "3.0.3",
|
|
35
35
|
"supertest": "6.3.3"
|
|
36
36
|
},
|
|
37
37
|
"jest": {
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"@types/jest": "^29.5.2",
|
|
35
35
|
"@types/node": "^20.3.1",
|
|
36
36
|
"@types/supertest": "^2.0.12",
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
38
|
-
"@typescript-eslint/parser": "^
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
38
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
39
39
|
"eslint": "^8.42.0",
|
|
40
|
-
"eslint-config-prettier": "^
|
|
41
|
-
"eslint-plugin-prettier": "^
|
|
40
|
+
"eslint-config-prettier": "^9.0.0",
|
|
41
|
+
"eslint-plugin-prettier": "^5.0.0",
|
|
42
42
|
"jest": "^29.5.0",
|
|
43
|
-
"prettier": "^
|
|
43
|
+
"prettier": "^3.0.0",
|
|
44
44
|
"source-map-support": "^0.5.21",
|
|
45
45
|
"supertest": "^6.3.3",
|
|
46
46
|
"ts-jest": "^29.1.0",
|
|
@@ -55,6 +55,16 @@
|
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"type": "string",
|
|
57
57
|
"description": "Nest application development dependencies."
|
|
58
|
+
},
|
|
59
|
+
"spec": {
|
|
60
|
+
"type": "boolean",
|
|
61
|
+
"default": true,
|
|
62
|
+
"description": "Specifies if a spec file is generated."
|
|
63
|
+
},
|
|
64
|
+
"specFileSuffix": {
|
|
65
|
+
"type": "string",
|
|
66
|
+
"default": "spec",
|
|
67
|
+
"description": "Specifies the file suffix of spec files."
|
|
58
68
|
}
|
|
59
69
|
},
|
|
60
70
|
"required": ["name"]
|
|
@@ -17,11 +17,12 @@ function transform(options) {
|
|
|
17
17
|
return target;
|
|
18
18
|
}
|
|
19
19
|
function generate(options) {
|
|
20
|
+
const projectOrPath = options.project ?? '.';
|
|
20
21
|
return (0, schematics_1.apply)((0, schematics_1.url)((0, core_1.join)('./files', options.language)), [
|
|
21
22
|
(0, schematics_1.template)({
|
|
22
23
|
...core_1.strings,
|
|
23
24
|
...options,
|
|
24
25
|
}),
|
|
25
|
-
(0, schematics_1.move)(
|
|
26
|
+
(0, schematics_1.move)(projectOrPath),
|
|
26
27
|
]);
|
|
27
28
|
}
|
|
@@ -4,6 +4,6 @@ import { <%= classify(name) %>Service } from './<%= name %>.service';
|
|
|
4
4
|
|
|
5
5
|
@Module({
|
|
6
6
|
<% if (type === 'rest' || type === 'microservice') { %>controllers: [<%= classify(name) %>Controller],
|
|
7
|
-
providers: [<%= classify(name) %>Service]
|
|
7
|
+
providers: [<%= classify(name) %>Service],<% } else if (type === 'graphql-code-first' || type === 'graphql-schema-first') { %>providers: [<%= classify(name) %>Resolver, <%= classify(name) %>Service],<% } else { %>providers: [<%= classify(name) %>Gateway, <%= classify(name) %>Service],<% } %>
|
|
8
8
|
})
|
|
9
9
|
export class <%= classify(name) %>Module {}
|
|
@@ -178,12 +178,15 @@ function moveDefaultAppToApps(projectRoot, appName, sourceRoot = defaults_1.DEFA
|
|
|
178
178
|
};
|
|
179
179
|
}
|
|
180
180
|
function moveDirectoryTo(srcDir, destination, tree) {
|
|
181
|
+
let srcDirExists = false;
|
|
181
182
|
tree.getDir(srcDir).visit((filePath, file) => {
|
|
183
|
+
srcDirExists = true;
|
|
182
184
|
const newFilePath = (0, core_1.join)(destination, filePath);
|
|
183
185
|
tree.create(newFilePath, file.content);
|
|
184
|
-
tree.delete(filePath);
|
|
185
186
|
});
|
|
186
|
-
|
|
187
|
+
if (srcDirExists) {
|
|
188
|
+
tree.delete(srcDir);
|
|
189
|
+
}
|
|
187
190
|
}
|
|
188
191
|
function addAppsToCliOptions(projectRoot, projectName, appName) {
|
|
189
192
|
const rootPath = (0, core_1.join)(projectRoot, projectName);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/schematics",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.3",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@schematics)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -41,32 +41,32 @@
|
|
|
41
41
|
},
|
|
42
42
|
"homepage": "https://github.com/nestjs/schematics#readme",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@angular-devkit/core": "16.
|
|
45
|
-
"@angular-devkit/schematics": "16.
|
|
44
|
+
"@angular-devkit/core": "16.2.8",
|
|
45
|
+
"@angular-devkit/schematics": "16.2.8",
|
|
46
46
|
"comment-json": "4.2.3",
|
|
47
47
|
"jsonc-parser": "3.2.0",
|
|
48
48
|
"pluralize": "8.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@commitlint/cli": "
|
|
52
|
-
"@commitlint/config-angular": "
|
|
53
|
-
"@types/jest": "29.5.
|
|
54
|
-
"@types/node": "
|
|
55
|
-
"@typescript-eslint/eslint-plugin": "
|
|
56
|
-
"@typescript-eslint/parser": "
|
|
51
|
+
"@commitlint/cli": "18.2.0",
|
|
52
|
+
"@commitlint/config-angular": "18.1.0",
|
|
53
|
+
"@types/jest": "29.5.6",
|
|
54
|
+
"@types/node": "20.8.9",
|
|
55
|
+
"@typescript-eslint/eslint-plugin": "6.9.0",
|
|
56
|
+
"@typescript-eslint/parser": "6.9.0",
|
|
57
57
|
"cpx": "1.5.0",
|
|
58
|
-
"eslint": "8.
|
|
59
|
-
"eslint-config-prettier": "
|
|
60
|
-
"eslint-plugin-import": "2.
|
|
58
|
+
"eslint": "8.52.0",
|
|
59
|
+
"eslint-config-prettier": "9.0.0",
|
|
60
|
+
"eslint-plugin-import": "2.29.0",
|
|
61
61
|
"gulp": "4.0.2",
|
|
62
62
|
"gulp-clean": "0.4.0",
|
|
63
63
|
"husky": "8.0.3",
|
|
64
|
-
"jest": "29.
|
|
64
|
+
"jest": "29.7.0",
|
|
65
65
|
"nyc": "15.1.0",
|
|
66
|
-
"release-it": "
|
|
67
|
-
"ts-jest": "29.1.
|
|
66
|
+
"release-it": "16.2.1",
|
|
67
|
+
"ts-jest": "29.1.1",
|
|
68
68
|
"ts-node": "10.9.1",
|
|
69
|
-
"typescript": "5.
|
|
69
|
+
"typescript": "5.2.2"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"typescript": ">=4.8.2"
|
|
File without changes
|
/package/dist/lib/application/files/js/test/{app.e2e-spec.js → app.e2e-__specFileSuffix__.js}
RENAMED
|
File without changes
|
|
File without changes
|
/package/dist/lib/application/files/ts/test/{app.e2e-spec.ts → app.e2e-__specFileSuffix__.ts}
RENAMED
|
File without changes
|