@nx/node 23.2.0-beta.1 → 23.2.0-beta.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.
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addLintingToApplication = addLintingToApplication;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const eslint_1 = require("@nx/eslint");
6
+ const internal_1 = require("@nx/eslint/internal");
6
7
  async function addLintingToApplication(tree, options) {
7
8
  const lintTask = await (0, eslint_1.lintProjectGenerator)(tree, {
8
9
  linter: options.linter,
@@ -12,7 +13,7 @@ async function addLintingToApplication(tree, options) {
12
13
  ],
13
14
  unitTestRunner: options.unitTestRunner,
14
15
  skipFormat: true,
15
- setParserOptionsProject: options.setParserOptionsProject,
16
+ enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
16
17
  rootProject: options.rootProject,
17
18
  addPlugin: options.addPlugin,
18
19
  });
@@ -15,6 +15,10 @@ export interface Schema {
15
15
  /** @deprecated use `swcJest` instead */
16
16
  babelJest?: boolean;
17
17
  js?: boolean;
18
+ enableTypedLinting?: boolean;
19
+ /**
20
+ * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
21
+ */
18
22
  setParserOptionsProject?: boolean;
19
23
  bundler?: 'esbuild' | 'webpack';
20
24
  framework?: NodeJsFrameWorks;
@@ -82,11 +82,17 @@
82
82
  "description": "Generate JavaScript files rather than TypeScript files.",
83
83
  "default": false
84
84
  },
85
- "setParserOptionsProject": {
85
+ "enableTypedLinting": {
86
86
  "type": "boolean",
87
- "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
87
+ "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.",
88
88
  "default": false
89
89
  },
90
+ "setParserOptionsProject": {
91
+ "type": "boolean",
92
+ "description": "Deprecated alias for `enableTypedLinting`.",
93
+ "default": false,
94
+ "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
95
+ },
90
96
  "bundler": {
91
97
  "description": "Bundler which is used to package the application",
92
98
  "type": "string",
@@ -172,7 +172,7 @@ async function e2eProjectGeneratorInternal(host, _options) {
172
172
  tsConfigPaths: [
173
173
  (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'tsconfig.json'),
174
174
  ],
175
- setParserOptionsProject: false,
175
+ enableTypedLinting: false,
176
176
  skipPackageJson: false,
177
177
  rootProject: options.rootProject,
178
178
  addPlugin: options.addPlugin,
@@ -4,8 +4,9 @@ exports.libraryGenerator = libraryGenerator;
4
4
  exports.libraryGeneratorInternal = libraryGeneratorInternal;
5
5
  const internal_1 = require("@nx/devkit/internal");
6
6
  const devkit_1 = require("@nx/devkit");
7
+ const internal_2 = require("@nx/eslint/internal");
7
8
  const js_1 = require("@nx/js");
8
- const internal_2 = require("@nx/js/internal");
9
+ const internal_3 = require("@nx/js/internal");
9
10
  const path_1 = require("path");
10
11
  const versions_1 = require("../../utils/versions");
11
12
  const init_1 = require("../init/init");
@@ -21,7 +22,7 @@ async function libraryGeneratorInternal(tree, schema) {
21
22
  // If we are using the new TS solution
22
23
  // We need to update the workspace file (package.json or pnpm-workspaces.yaml) to include the new project
23
24
  if (options.isUsingTsSolutionConfig) {
24
- await (0, internal_2.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
25
+ await (0, internal_3.addProjectToTsSolutionWorkspace)(tree, options.projectRoot);
25
26
  }
26
27
  const tasks = [];
27
28
  if (options.publishable === true && !schema.importPath) {
@@ -45,7 +46,7 @@ async function libraryGeneratorInternal(tree, schema) {
45
46
  importPath: schema.importPath,
46
47
  testEnvironment: 'node',
47
48
  skipFormat: true,
48
- setParserOptionsProject: schema.setParserOptionsProject,
49
+ enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(schema),
49
50
  useProjectJson: options.useProjectJson,
50
51
  }));
51
52
  updatePackageJson(tree, options);
@@ -63,7 +64,7 @@ async function libraryGeneratorInternal(tree, schema) {
63
64
  if (options.isUsingTsSolutionConfig) {
64
65
  tasks.push(() => (0, devkit_1.installPackagesTask)(tree, true));
65
66
  }
66
- (0, internal_2.sortPackageJsonFields)(tree, options.projectRoot);
67
+ (0, internal_3.sortPackageJsonFields)(tree, options.projectRoot);
67
68
  if (!schema.skipFormat) {
68
69
  await (0, devkit_1.formatFiles)(tree);
69
70
  }
@@ -91,8 +92,8 @@ async function normalizeOptions(tree, options) {
91
92
  // this helper is called before the jsLibraryGenerator is called, so, if the
92
93
  // TS solution setup is not configured, we additionally check if the TS
93
94
  // solution setup will be configured by the jsLibraryGenerator
94
- const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(tree) ||
95
- (0, internal_2.shouldConfigureTsSolutionSetup)(tree, options.addPlugin);
95
+ const isUsingTsSolutionConfig = (0, internal_3.isUsingTsSolutionSetup)(tree) ||
96
+ (0, internal_3.shouldConfigureTsSolutionSetup)(tree, options.addPlugin);
96
97
  return {
97
98
  ...options,
98
99
  fileName,
@@ -149,8 +150,8 @@ function updateProject(tree, options) {
149
150
  };
150
151
  }
151
152
  if (options.compiler === 'swc') {
152
- (0, internal_2.addSwcDependencies)(tree);
153
- (0, internal_2.addSwcConfig)(tree, options.projectRoot);
153
+ (0, internal_3.addSwcDependencies)(tree);
154
+ (0, internal_3.addSwcConfig)(tree, options.projectRoot);
154
155
  }
155
156
  if (options.rootDir) {
156
157
  project.targets.build.options.srcRootForCompilationRoot = options.rootDir;
@@ -17,6 +17,10 @@ export interface Schema {
17
17
  babelJest?: boolean;
18
18
  js?: boolean;
19
19
  strict?: boolean;
20
+ enableTypedLinting?: boolean;
21
+ /**
22
+ * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
23
+ */
20
24
  setParserOptionsProject?: boolean;
21
25
  compiler: 'tsc' | 'swc';
22
26
  addPlugin?: boolean;
@@ -113,11 +113,17 @@
113
113
  "description": "Whether to enable tsconfig strict mode or not.",
114
114
  "default": false
115
115
  },
116
- "setParserOptionsProject": {
116
+ "enableTypedLinting": {
117
117
  "type": "boolean",
118
- "description": "Whether or not to configure the ESLint `parserOptions.project`. We do not do this by default for lint performance reasons.",
118
+ "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.",
119
119
  "default": false
120
120
  },
121
+ "setParserOptionsProject": {
122
+ "type": "boolean",
123
+ "description": "Deprecated alias for `enableTypedLinting`.",
124
+ "default": false,
125
+ "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
126
+ },
121
127
  "useProjectJson": {
122
128
  "type": "boolean",
123
129
  "description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/node",
3
- "version": "23.2.0-beta.1",
3
+ "version": "23.2.0-beta.3",
4
4
  "private": false,
5
5
  "type": "commonjs",
6
6
  "files": [
@@ -73,15 +73,15 @@
73
73
  "semver": "^7.6.3",
74
74
  "tcp-port-used": "^1.0.2",
75
75
  "kill-port": "^1.6.1",
76
- "@nx/devkit": "23.2.0-beta.1",
77
- "@nx/jest": "23.2.0-beta.1",
78
- "@nx/js": "23.2.0-beta.1",
79
- "@nx/eslint": "23.2.0-beta.1",
80
- "@nx/docker": "23.2.0-beta.1"
76
+ "@nx/devkit": "23.2.0-beta.3",
77
+ "@nx/jest": "23.2.0-beta.3",
78
+ "@nx/js": "23.2.0-beta.3",
79
+ "@nx/eslint": "23.2.0-beta.3",
80
+ "@nx/docker": "23.2.0-beta.3"
81
81
  },
82
82
  "devDependencies": {
83
- "nx": "23.2.0-beta.1",
84
- "@nx/webpack": "23.2.0-beta.1"
83
+ "nx": "23.2.0-beta.3",
84
+ "@nx/webpack": "23.2.0-beta.3"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "express": ">=4.0.0 <6.0.0",