@nestjs/schematics 12.0.0-alpha.5 → 12.0.0-alpha.7
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/jest.config.js +9 -0
- package/dist/lib/application/files/js/package.json +0 -9
- package/dist/lib/application/files/ts/jest.config.ts +15 -0
- package/dist/lib/application/files/ts/package.json +0 -17
- package/dist/lib/application/files/ts-esm/test/app.e2e-__specFileSuffix__.ts +1 -2
- package/dist/lib/application/schema.json +6 -3
- package/dist/lib/library/library.factory.js +15 -12
- package/dist/lib/resource/resource.factory.js +2 -2
- package/dist/lib/sub-app/files/ts/src/main.ts +1 -1
- package/package.json +10 -10
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Config } from 'jest';
|
|
2
|
+
|
|
3
|
+
const config: Config = {
|
|
4
|
+
moduleFileExtensions: ['js', 'json', 'ts'],
|
|
5
|
+
rootDir: 'src',
|
|
6
|
+
testRegex: '.*\\.spec\\.ts$',
|
|
7
|
+
transform: {
|
|
8
|
+
'^.+\\.(t|j)s$': 'ts-jest',
|
|
9
|
+
},
|
|
10
|
+
collectCoverageFrom: ['**/*.(t|j)s'],
|
|
11
|
+
coverageDirectory: '../coverage',
|
|
12
|
+
testEnvironment: 'node',
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default config;
|
|
@@ -49,22 +49,5 @@
|
|
|
49
49
|
"tsconfig-paths": "^4.2.0",
|
|
50
50
|
"typescript": "^5.7.3",
|
|
51
51
|
"typescript-eslint": "^8.30.0"
|
|
52
|
-
},
|
|
53
|
-
"jest": {
|
|
54
|
-
"moduleFileExtensions": [
|
|
55
|
-
"js",
|
|
56
|
-
"json",
|
|
57
|
-
"ts"
|
|
58
|
-
],
|
|
59
|
-
"rootDir": "src",
|
|
60
|
-
"testRegex": ".*\\.spec\\.ts$",
|
|
61
|
-
"transform": {
|
|
62
|
-
"^.+\\.(t|j)s$": "ts-jest"
|
|
63
|
-
},
|
|
64
|
-
"collectCoverageFrom": [
|
|
65
|
-
"**/*.(t|j)s"
|
|
66
|
-
],
|
|
67
|
-
"coverageDirectory": "../coverage",
|
|
68
|
-
"testEnvironment": "node"
|
|
69
52
|
}
|
|
70
53
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { Test, TestingModule } from '@nestjs/testing';
|
|
2
2
|
import { INestApplication } from '@nestjs/common';
|
|
3
3
|
import request from 'supertest';
|
|
4
|
-
import { App } from 'supertest/types';
|
|
5
4
|
import { AppModule } from './../src/app.module.js';
|
|
6
5
|
|
|
7
6
|
describe('AppController (e2e)', () => {
|
|
8
|
-
let app: INestApplication
|
|
7
|
+
let app: INestApplication;
|
|
9
8
|
|
|
10
9
|
beforeEach(async () => {
|
|
11
10
|
const moduleFixture: TestingModule = await Test.createTestingModule({
|
|
@@ -41,13 +41,16 @@
|
|
|
41
41
|
"type": "string",
|
|
42
42
|
"description": "Nest application module type (CJS or ESM).",
|
|
43
43
|
"enum": ["cjs", "esm"],
|
|
44
|
-
"default": "
|
|
44
|
+
"default": "esm",
|
|
45
45
|
"x-prompt": {
|
|
46
46
|
"message": "Which module system would you like to use?",
|
|
47
47
|
"type": "list",
|
|
48
48
|
"items": [
|
|
49
|
-
{
|
|
50
|
-
|
|
49
|
+
{
|
|
50
|
+
"value": "esm",
|
|
51
|
+
"label": "ESM (ES Modules) [ with vitest ]"
|
|
52
|
+
},
|
|
53
|
+
{ "value": "cjs", "label": "CJS (CommonJS) [ with jest ]" }
|
|
51
54
|
]
|
|
52
55
|
}
|
|
53
56
|
},
|
|
@@ -139,30 +139,33 @@ function updateJsonFile(host, path, callback) {
|
|
|
139
139
|
}
|
|
140
140
|
return host;
|
|
141
141
|
}
|
|
142
|
-
function updateTsConfig(packageName,
|
|
142
|
+
function updateTsConfig(packageName, packagePrefix, root) {
|
|
143
143
|
return (host) => {
|
|
144
144
|
if (!host.exists('tsconfig.json')) {
|
|
145
145
|
return host;
|
|
146
146
|
}
|
|
147
|
-
const
|
|
147
|
+
const distRoot = join(root, packageName, 'src');
|
|
148
|
+
const packageKey = packagePrefix
|
|
149
|
+
? packagePrefix + '/' + packageName
|
|
150
|
+
: packageName;
|
|
148
151
|
return updateJsonFile(host, 'tsconfig.json', (tsconfig) => {
|
|
149
152
|
if (!tsconfig.compilerOptions) {
|
|
150
153
|
tsconfig.compilerOptions = {};
|
|
151
154
|
}
|
|
152
155
|
delete tsconfig.compilerOptions.baseUrl;
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
tsconfig.files = [];
|
|
156
|
+
if (!tsconfig.compilerOptions.paths) {
|
|
157
|
+
tsconfig.compilerOptions.paths = {};
|
|
156
158
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (!tsconfig.references) {
|
|
160
|
-
tsconfig.references = [];
|
|
159
|
+
if (!tsconfig.compilerOptions.paths[packageKey]) {
|
|
160
|
+
tsconfig.compilerOptions.paths[packageKey] = [];
|
|
161
161
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
tsconfig.compilerOptions.paths[packageKey].push('./' + distRoot);
|
|
163
|
+
const deepPackagePath = packageKey + '/*';
|
|
164
|
+
if (!tsconfig.compilerOptions.paths[deepPackagePath]) {
|
|
165
|
+
tsconfig.compilerOptions.paths[deepPackagePath] = [];
|
|
165
166
|
}
|
|
167
|
+
tsconfig.compilerOptions.paths[deepPackagePath].push('./' + distRoot + '/*');
|
|
168
|
+
inPlaceSortByKeys(tsconfig.compilerOptions.paths);
|
|
166
169
|
});
|
|
167
170
|
};
|
|
168
171
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { join, strings } from '@angular-devkit/core';
|
|
2
2
|
import { classify } from '@angular-devkit/core/src/utils/strings';
|
|
3
3
|
import { apply, branchAndMerge, chain, filter, mergeWith, move, noop, SchematicsException, template, url, } from '@angular-devkit/schematics';
|
|
4
|
-
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';
|
|
5
|
-
import
|
|
4
|
+
import { NodePackageInstallTask } from '@angular-devkit/schematics/tasks/index.js';
|
|
5
|
+
import pluralize from 'pluralize';
|
|
6
6
|
import { ModuleDeclarator, ModuleFinder, } from '../../index.js';
|
|
7
7
|
import { addPackageJsonDependency, getPackageJsonDependency, NodeDependencyType, } from '../../utils/dependencies.utils.js';
|
|
8
8
|
import { normalizeToKebabOrSnakeCase } from '../../utils/formatting.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/schematics",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.7",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@schematics)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
},
|
|
43
43
|
"homepage": "https://github.com/nestjs/schematics#readme",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@angular-devkit/core": "21.2.
|
|
46
|
-
"@angular-devkit/schematics": "21.2.
|
|
47
|
-
"comment-json": "4.
|
|
45
|
+
"@angular-devkit/core": "21.2.1",
|
|
46
|
+
"@angular-devkit/schematics": "21.2.1",
|
|
47
|
+
"comment-json": "4.6.2",
|
|
48
48
|
"jsonc-parser": "3.3.1",
|
|
49
49
|
"pluralize": "8.0.0"
|
|
50
50
|
},
|
|
@@ -52,23 +52,23 @@
|
|
|
52
52
|
"@commitlint/cli": "20.4.3",
|
|
53
53
|
"@commitlint/config-angular": "20.4.3",
|
|
54
54
|
"@eslint/js": "10.0.1",
|
|
55
|
-
"@types/node": "
|
|
55
|
+
"@types/node": "25.3.5",
|
|
56
56
|
"cpx2": "8.0.0",
|
|
57
|
-
"eslint": "10.0.
|
|
57
|
+
"eslint": "10.0.3",
|
|
58
58
|
"eslint-config-prettier": "10.1.8",
|
|
59
59
|
"eslint-plugin-prettier": "5.5.5",
|
|
60
60
|
"globals": "17.4.0",
|
|
61
61
|
"husky": "9.1.7",
|
|
62
|
-
"jiti": "2.
|
|
62
|
+
"jiti": "2.6.1",
|
|
63
63
|
"prettier": "3.8.1",
|
|
64
64
|
"release-it": "19.2.4",
|
|
65
65
|
"typescript": "5.9.3",
|
|
66
66
|
"typescript-eslint": "8.56.1",
|
|
67
|
-
"tsx": "
|
|
68
|
-
"vitest": "
|
|
67
|
+
"tsx": "4.21.0",
|
|
68
|
+
"vitest": "4.0.18"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
|
-
"typescript": ">=
|
|
71
|
+
"typescript": ">=5.9.3"
|
|
72
72
|
},
|
|
73
73
|
"schematics": "./dist/collection.json",
|
|
74
74
|
"lint-staged": {
|