@nestjs/schematics 9.0.3 → 9.0.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/dist/lib/application/files/js/jsconfig.json +4 -4
- package/dist/lib/application/files/js/package.json +10 -10
- package/dist/lib/application/files/ts/.eslintrc.js +1 -1
- package/dist/lib/application/files/ts/nest-cli.json +4 -1
- package/dist/lib/application/files/ts/package.json +5 -7
- package/dist/lib/library/files/js/jsconfig.json +4 -4
- package/dist/lib/sub-app/sub-app.factory.js +20 -13
- package/package.json +16 -16
|
@@ -22,17 +22,17 @@
|
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@nestjs/testing": "^9.0.0",
|
|
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.
|
|
25
|
+
"@babel/core": "7.20.7",
|
|
26
|
+
"@babel/node": "7.20.7",
|
|
27
|
+
"@babel/plugin-proposal-decorators": "7.20.7",
|
|
28
|
+
"@babel/plugin-transform-runtime": "7.19.6",
|
|
29
|
+
"@babel/preset-env": "7.20.2",
|
|
30
30
|
"@babel/register": "7.18.9",
|
|
31
|
-
"@babel/runtime": "7.
|
|
32
|
-
"jest": "
|
|
33
|
-
"nodemon": "2.0.
|
|
34
|
-
"prettier": "2.
|
|
35
|
-
"supertest": "6.
|
|
31
|
+
"@babel/runtime": "7.20.7",
|
|
32
|
+
"jest": "29.3.1",
|
|
33
|
+
"nodemon": "2.0.20",
|
|
34
|
+
"prettier": "2.8.1",
|
|
35
|
+
"supertest": "6.3.3"
|
|
36
36
|
},
|
|
37
37
|
"jest": {
|
|
38
38
|
"moduleFileExtensions": [
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
"private": true,
|
|
7
7
|
"license": "UNLICENSED",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"prebuild": "rimraf dist",
|
|
10
9
|
"build": "nest build",
|
|
11
10
|
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
|
|
12
11
|
"start": "nest start",
|
|
@@ -25,7 +24,6 @@
|
|
|
25
24
|
"@nestjs/core": "^9.0.0",
|
|
26
25
|
"@nestjs/platform-express": "^9.0.0",
|
|
27
26
|
"reflect-metadata": "^0.1.13",
|
|
28
|
-
"rimraf": "^3.0.2",
|
|
29
27
|
"rxjs": "^7.2.0"
|
|
30
28
|
},
|
|
31
29
|
"devDependencies": {
|
|
@@ -33,22 +31,22 @@
|
|
|
33
31
|
"@nestjs/schematics": "^9.0.0",
|
|
34
32
|
"@nestjs/testing": "^9.0.0",
|
|
35
33
|
"@types/express": "^4.17.13",
|
|
36
|
-
"@types/jest": "
|
|
37
|
-
"@types/node": "
|
|
34
|
+
"@types/jest": "29.2.4",
|
|
35
|
+
"@types/node": "18.11.18",
|
|
38
36
|
"@types/supertest": "^2.0.11",
|
|
39
37
|
"@typescript-eslint/eslint-plugin": "^5.0.0",
|
|
40
38
|
"@typescript-eslint/parser": "^5.0.0",
|
|
41
39
|
"eslint": "^8.0.1",
|
|
42
40
|
"eslint-config-prettier": "^8.3.0",
|
|
43
41
|
"eslint-plugin-prettier": "^4.0.0",
|
|
44
|
-
"jest": "
|
|
42
|
+
"jest": "29.3.1",
|
|
45
43
|
"prettier": "^2.3.2",
|
|
46
44
|
"source-map-support": "^0.5.20",
|
|
47
45
|
"supertest": "^6.1.3",
|
|
48
|
-
"ts-jest": "
|
|
46
|
+
"ts-jest": "29.0.3",
|
|
49
47
|
"ts-loader": "^9.2.3",
|
|
50
48
|
"ts-node": "^10.0.0",
|
|
51
|
-
"tsconfig-paths": "4.1.
|
|
49
|
+
"tsconfig-paths": "4.1.1",
|
|
52
50
|
"typescript": "^4.7.4"
|
|
53
51
|
},
|
|
54
52
|
"jest": {
|
|
@@ -114,8 +114,11 @@ function updateNpmScripts(scripts, options, defaultAppName) {
|
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
116
|
const defaultFormatScriptName = 'format';
|
|
117
|
+
const defaultStartScriptName = 'start:prod';
|
|
117
118
|
const defaultTestScriptName = 'test:e2e';
|
|
118
|
-
if (!scripts[defaultTestScriptName] &&
|
|
119
|
+
if (!scripts[defaultTestScriptName] &&
|
|
120
|
+
!scripts[defaultFormatScriptName] &&
|
|
121
|
+
!scripts[defaultStartScriptName]) {
|
|
119
122
|
return;
|
|
120
123
|
}
|
|
121
124
|
if (scripts[defaultTestScriptName] &&
|
|
@@ -129,6 +132,11 @@ function updateNpmScripts(scripts, options, defaultAppName) {
|
|
|
129
132
|
const defaultSourceRoot = options.rootDir !== undefined ? options.rootDir : defaults_1.DEFAULT_APPS_PATH;
|
|
130
133
|
scripts[defaultFormatScriptName] = `prettier --write "${defaultSourceRoot}/**/*.ts" "${defaults_1.DEFAULT_LIB_PATH}/**/*.ts"`;
|
|
131
134
|
}
|
|
135
|
+
if (scripts[defaultStartScriptName] &&
|
|
136
|
+
scripts[defaultStartScriptName].indexOf('dist/main') >= 0) {
|
|
137
|
+
const defaultSourceRoot = options.rootDir !== undefined ? options.rootDir : defaults_1.DEFAULT_APPS_PATH;
|
|
138
|
+
scripts[defaultStartScriptName] = `node dist/${defaultSourceRoot}/${defaultAppName}/main`;
|
|
139
|
+
}
|
|
132
140
|
}
|
|
133
141
|
function updateJestOptions(jestOptions, options) {
|
|
134
142
|
if (!jestOptions) {
|
|
@@ -157,21 +165,20 @@ function moveDefaultAppToApps(projectRoot, appName, sourceRoot = defaults_1.DEFA
|
|
|
157
165
|
if (process.env.NODE_ENV === defaults_1.TEST_ENV) {
|
|
158
166
|
return host;
|
|
159
167
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}
|
|
164
|
-
const testDir = 'test';
|
|
165
|
-
if (fse.existsSync(testDir)) {
|
|
166
|
-
fse.moveSync(testDir, (0, core_1.join)(projectRoot, appName, testDir));
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
catch (err) {
|
|
170
|
-
throw new schematics_1.SchematicsException(`The "${projectRoot}" directory exists already.`);
|
|
171
|
-
}
|
|
168
|
+
const appDestination = (0, core_1.join)(projectRoot, appName);
|
|
169
|
+
moveDirectoryTo(sourceRoot, appDestination, host);
|
|
170
|
+
moveDirectoryTo('test', appDestination, host);
|
|
172
171
|
return host;
|
|
173
172
|
};
|
|
174
173
|
}
|
|
174
|
+
function moveDirectoryTo(srcDir, destination, tree) {
|
|
175
|
+
tree.getDir(srcDir).visit((filePath, file) => {
|
|
176
|
+
const newFilePath = (0, core_1.join)(destination, filePath);
|
|
177
|
+
tree.create(newFilePath, file.content);
|
|
178
|
+
tree.delete(filePath);
|
|
179
|
+
});
|
|
180
|
+
tree.delete(srcDir);
|
|
181
|
+
}
|
|
175
182
|
function addAppsToCliOptions(projectRoot, projectName, appName) {
|
|
176
183
|
const rootPath = (0, core_1.join)(projectRoot, projectName);
|
|
177
184
|
const project = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/schematics",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.4",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@schematics)",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"files": [
|
|
@@ -41,33 +41,33 @@
|
|
|
41
41
|
},
|
|
42
42
|
"homepage": "https://github.com/nestjs/schematics#readme",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@angular-devkit/core": "
|
|
45
|
-
"@angular-devkit/schematics": "
|
|
46
|
-
"fs-extra": "
|
|
44
|
+
"@angular-devkit/core": "15.0.4",
|
|
45
|
+
"@angular-devkit/schematics": "15.0.4",
|
|
46
|
+
"fs-extra": "11.1.0",
|
|
47
47
|
"jsonc-parser": "3.2.0",
|
|
48
48
|
"pluralize": "8.0.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@commitlint/cli": "17.
|
|
52
|
-
"@commitlint/config-angular": "17.
|
|
51
|
+
"@commitlint/cli": "17.3.0",
|
|
52
|
+
"@commitlint/config-angular": "17.3.0",
|
|
53
53
|
"@types/fs-extra": "9.0.13",
|
|
54
|
-
"@types/jest": "
|
|
55
|
-
"@types/node": "
|
|
56
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
57
|
-
"@typescript-eslint/parser": "5.
|
|
54
|
+
"@types/jest": "29.2.4",
|
|
55
|
+
"@types/node": "18.11.18",
|
|
56
|
+
"@typescript-eslint/eslint-plugin": "5.47.1",
|
|
57
|
+
"@typescript-eslint/parser": "5.47.1",
|
|
58
58
|
"cpx": "1.5.0",
|
|
59
|
-
"eslint": "8.
|
|
59
|
+
"eslint": "8.30.0",
|
|
60
60
|
"eslint-config-prettier": "8.5.0",
|
|
61
61
|
"eslint-plugin-import": "2.26.0",
|
|
62
62
|
"gulp": "4.0.2",
|
|
63
63
|
"gulp-clean": "0.4.0",
|
|
64
|
-
"husky": "8.0.
|
|
65
|
-
"jest": "
|
|
64
|
+
"husky": "8.0.2",
|
|
65
|
+
"jest": "29.3.1",
|
|
66
66
|
"nyc": "15.1.0",
|
|
67
|
-
"release-it": "15.
|
|
68
|
-
"ts-jest": "
|
|
67
|
+
"release-it": "15.5.1",
|
|
68
|
+
"ts-jest": "29.0.3",
|
|
69
69
|
"ts-node": "10.9.1",
|
|
70
|
-
"typescript": "
|
|
70
|
+
"typescript": "4.9.4"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"typescript": "^4.3.5"
|