@nx/nest 23.1.0 → 23.1.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/src/generators/application/lib/normalize-options.js +4 -3
- package/dist/src/generators/application/schema.d.ts +4 -0
- package/dist/src/generators/application/schema.json +8 -2
- package/dist/src/generators/library/lib/normalize-options.js +6 -5
- package/dist/src/generators/library/schema.d.ts +4 -0
- package/dist/src/generators/library/schema.json +8 -2
- package/dist/src/utils/ensure-dependencies.js +7 -0
- package/package.json +5 -5
|
@@ -4,7 +4,8 @@ exports.normalizeOptions = normalizeOptions;
|
|
|
4
4
|
exports.toNodeApplicationGeneratorOptions = toNodeApplicationGeneratorOptions;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
-
const internal_2 = require("@nx/
|
|
7
|
+
const internal_2 = require("@nx/eslint/internal");
|
|
8
|
+
const internal_3 = require("@nx/js/internal");
|
|
8
9
|
async function normalizeOptions(tree, options) {
|
|
9
10
|
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
10
11
|
const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
|
|
@@ -26,7 +27,7 @@ async function normalizeOptions(tree, options) {
|
|
|
26
27
|
linter: options.linter ?? 'eslint',
|
|
27
28
|
unitTestRunner: options.unitTestRunner ?? 'jest',
|
|
28
29
|
e2eTestRunner: options.e2eTestRunner ?? 'jest',
|
|
29
|
-
useProjectJson: options.useProjectJson ?? !(0,
|
|
30
|
+
useProjectJson: options.useProjectJson ?? !(0, internal_3.isUsingTsSolutionSetup)(tree),
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
function toNodeApplicationGeneratorOptions(options) {
|
|
@@ -40,7 +41,7 @@ function toNodeApplicationGeneratorOptions(options) {
|
|
|
40
41
|
tags: options.tags,
|
|
41
42
|
unitTestRunner: options.unitTestRunner,
|
|
42
43
|
e2eTestRunner: options.e2eTestRunner,
|
|
43
|
-
|
|
44
|
+
enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
|
|
44
45
|
rootProject: options.rootProject,
|
|
45
46
|
bundler: 'webpack', // Some features require webpack plugins such as TS transformers
|
|
46
47
|
isNest: true,
|
|
@@ -10,6 +10,10 @@ export interface ApplicationGeneratorOptions {
|
|
|
10
10
|
tags?: string;
|
|
11
11
|
unitTestRunner?: 'jest' | 'none';
|
|
12
12
|
e2eTestRunner?: 'jest' | 'none';
|
|
13
|
+
enableTypedLinting?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
16
|
+
*/
|
|
13
17
|
setParserOptionsProject?: boolean;
|
|
14
18
|
rootProject?: boolean;
|
|
15
19
|
strict?: boolean;
|
|
@@ -63,11 +63,17 @@
|
|
|
63
63
|
"type": "string",
|
|
64
64
|
"x-priority": "important"
|
|
65
65
|
},
|
|
66
|
-
"
|
|
66
|
+
"enableTypedLinting": {
|
|
67
67
|
"type": "boolean",
|
|
68
|
-
"description": "Whether
|
|
68
|
+
"description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
|
|
69
69
|
"default": false
|
|
70
70
|
},
|
|
71
|
+
"setParserOptionsProject": {
|
|
72
|
+
"type": "boolean",
|
|
73
|
+
"description": "Deprecated alias for `enableTypedLinting`.",
|
|
74
|
+
"default": false,
|
|
75
|
+
"x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
|
|
76
|
+
},
|
|
71
77
|
"strict": {
|
|
72
78
|
"type": "boolean",
|
|
73
79
|
"description": "Adds strictNullChecks, noImplicitAny, strictBindCallApply, forceConsistentCasingInFileNames and noFallthroughCasesInSwitch to tsconfig.",
|
|
@@ -4,7 +4,8 @@ exports.normalizeOptions = normalizeOptions;
|
|
|
4
4
|
exports.toJsLibraryGeneratorOptions = toJsLibraryGeneratorOptions;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
|
-
const internal_2 = require("@nx/
|
|
7
|
+
const internal_2 = require("@nx/eslint/internal");
|
|
8
|
+
const internal_3 = require("@nx/js/internal");
|
|
8
9
|
async function normalizeOptions(tree, options) {
|
|
9
10
|
await (0, internal_1.ensureRootProjectName)(options, 'library');
|
|
10
11
|
const { projectName, names: projectNames, projectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
|
|
@@ -24,8 +25,8 @@ async function normalizeOptions(tree, options) {
|
|
|
24
25
|
// this helper is called before the jsLibraryGenerator is called, so, if the
|
|
25
26
|
// TS solution setup is not configured, we additionally check if the TS
|
|
26
27
|
// solution setup will be configured by the jsLibraryGenerator
|
|
27
|
-
const isUsingTsSolutionsConfig = (0,
|
|
28
|
-
(0,
|
|
28
|
+
const isUsingTsSolutionsConfig = (0, internal_3.isUsingTsSolutionSetup)(tree) ||
|
|
29
|
+
(0, internal_3.shouldConfigureTsSolutionSetup)(tree, addPlugin);
|
|
29
30
|
const normalized = {
|
|
30
31
|
...options,
|
|
31
32
|
strict: options.strict ?? true,
|
|
@@ -34,7 +35,7 @@ async function normalizeOptions(tree, options) {
|
|
|
34
35
|
global: options.global ?? false,
|
|
35
36
|
linter: options.linter ?? 'eslint',
|
|
36
37
|
parsedTags,
|
|
37
|
-
prefix: (0,
|
|
38
|
+
prefix: (0, internal_3.getNpmScope)(tree), // we could also allow customizing this
|
|
38
39
|
projectName: isUsingTsSolutionsConfig && !options.name ? importPath : projectName,
|
|
39
40
|
projectRoot,
|
|
40
41
|
importPath,
|
|
@@ -62,7 +63,7 @@ function toJsLibraryGeneratorOptions(options) {
|
|
|
62
63
|
tags: options.tags,
|
|
63
64
|
testEnvironment: options.testEnvironment,
|
|
64
65
|
unitTestRunner: options.unitTestRunner,
|
|
65
|
-
|
|
66
|
+
enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
|
|
66
67
|
addPlugin: options.addPlugin,
|
|
67
68
|
useProjectJson: options.useProjectJson,
|
|
68
69
|
};
|
|
@@ -28,6 +28,10 @@ export interface LibraryGeneratorOptions {
|
|
|
28
28
|
| 'es2021';
|
|
29
29
|
testEnvironment?: 'jsdom' | 'node';
|
|
30
30
|
unitTestRunner?: UnitTestRunner;
|
|
31
|
+
enableTypedLinting?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
|
|
34
|
+
*/
|
|
31
35
|
setParserOptionsProject?: boolean;
|
|
32
36
|
skipPackageJson?: boolean;
|
|
33
37
|
addPlugin?: boolean;
|
|
@@ -118,11 +118,17 @@
|
|
|
118
118
|
"type": "boolean",
|
|
119
119
|
"default": true
|
|
120
120
|
},
|
|
121
|
-
"
|
|
121
|
+
"enableTypedLinting": {
|
|
122
122
|
"type": "boolean",
|
|
123
|
-
"description": "Whether
|
|
123
|
+
"description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
|
|
124
124
|
"default": false
|
|
125
125
|
},
|
|
126
|
+
"setParserOptionsProject": {
|
|
127
|
+
"type": "boolean",
|
|
128
|
+
"description": "Deprecated alias for `enableTypedLinting`.",
|
|
129
|
+
"default": false,
|
|
130
|
+
"x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
|
|
131
|
+
},
|
|
126
132
|
"skipPackageJson": {
|
|
127
133
|
"description": "Do not add dependencies to `package.json`.",
|
|
128
134
|
"type": "boolean",
|
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ensureDependencies = ensureDependencies;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const versions_1 = require("./versions");
|
|
6
7
|
function ensureDependencies(tree, projectRoot) {
|
|
7
8
|
const packageJsonPath = projectRoot
|
|
8
9
|
? (0, devkit_1.joinPathFragments)(projectRoot, 'package.json')
|
|
9
10
|
: 'package.json';
|
|
10
11
|
const pkgVersions = (0, versions_1.versions)(tree);
|
|
12
|
+
// @nestjs/core releases up to 11.1.24 had an opencollective funding-message
|
|
13
|
+
// postinstall (removed in 11.1.25); deny it so locked installs of those
|
|
14
|
+
// versions don't trip pnpm 11's build gate.
|
|
15
|
+
(0, internal_1.acknowledgeBuildScripts)(tree, (0, devkit_1.detectPackageManager)(tree.root), {
|
|
16
|
+
'@nestjs/core': false,
|
|
17
|
+
});
|
|
11
18
|
return (0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
12
19
|
'@nestjs/common': pkgVersions.nestJsVersion,
|
|
13
20
|
'@nestjs/core': pkgVersions.nestJsVersion,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/nest",
|
|
3
|
-
"version": "23.1.
|
|
3
|
+
"version": "23.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
"@nestjs/schematics": "^11.0.0",
|
|
63
63
|
"semver": "^7.6.3",
|
|
64
64
|
"tslib": "^2.3.0",
|
|
65
|
-
"@nx/
|
|
66
|
-
"@nx/
|
|
67
|
-
"@nx/
|
|
68
|
-
"@nx/node": "23.1.
|
|
65
|
+
"@nx/devkit": "23.1.1",
|
|
66
|
+
"@nx/js": "23.1.1",
|
|
67
|
+
"@nx/eslint": "23.1.1",
|
|
68
|
+
"@nx/node": "23.1.1"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@nestjs/core": ">=10.0.0 <12.0.0",
|