@nx/react 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.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addE2e = addE2e;
4
+ const internal_1 = require("@nx/eslint/internal");
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const web_1 = require("@nx/web");
6
7
  const versions_1 = require("../../../utils/versions");
@@ -92,6 +93,7 @@ async function addE2e(tree, options) {
92
93
  baseUrl: e2eWebServerInfo.e2eWebServerAddress,
93
94
  jsx: true,
94
95
  rootProject: options.rootProject,
96
+ enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
95
97
  webServerCommands: {
96
98
  default: e2eWebServerInfo.e2eWebServerCommand,
97
99
  production: e2eWebServerInfo.e2eCiWebServerCommand,
@@ -133,7 +135,7 @@ async function addE2e(tree, options) {
133
135
  directory: 'src',
134
136
  js: false,
135
137
  linter: options.linter,
136
- setParserOptionsProject: options.setParserOptionsProject,
138
+ enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
137
139
  webServerCommand: e2eWebServerInfo.e2eCiWebServerCommand,
138
140
  webServerAddress: e2eWebServerInfo.e2eCiBaseUrl,
139
141
  rootProject: options.rootProject,
@@ -22,6 +22,7 @@ async function addLinting(host, options) {
22
22
  skipFormat: true,
23
23
  rootProject: options.rootProject,
24
24
  skipPackageJson: options.skipPackageJson,
25
+ enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
25
26
  addPlugin: options.addPlugin,
26
27
  });
27
28
  tasks.push(lintTask);
@@ -19,6 +19,7 @@ export declare function getDefaultTemplateVariables(host: Tree, options: Normali
19
19
  skipNxJson?: boolean;
20
20
  globalCss?: boolean;
21
21
  strict?: boolean;
22
+ enableTypedLinting?: boolean;
22
23
  setParserOptionsProject?: boolean;
23
24
  compiler?: 'babel' | 'swc';
24
25
  remotes?: string[];
@@ -19,6 +19,10 @@ export interface Schema {
19
19
  js?: boolean;
20
20
  globalCss?: boolean;
21
21
  strict?: boolean;
22
+ enableTypedLinting?: boolean;
23
+ /**
24
+ * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
25
+ */
22
26
  setParserOptionsProject?: boolean;
23
27
  compiler?: 'babel' | 'swc';
24
28
  remotes?: string[];
@@ -150,11 +150,17 @@
150
150
  "description": "Creates an application with strict mode and strict type checking.",
151
151
  "default": true
152
152
  },
153
- "setParserOptionsProject": {
153
+ "enableTypedLinting": {
154
154
  "type": "boolean",
155
- "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
155
+ "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.",
156
156
  "default": false
157
157
  },
158
+ "setParserOptionsProject": {
159
+ "type": "boolean",
160
+ "description": "Deprecated alias for `enableTypedLinting`.",
161
+ "default": false,
162
+ "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
163
+ },
158
164
  "compiler": {
159
165
  "type": "string",
160
166
  "description": "The compiler to use.",
@@ -4,6 +4,7 @@ exports.hostGenerator = hostGenerator;
4
4
  const tslib_1 = require("tslib");
5
5
  const internal_1 = require("@nx/devkit/internal");
6
6
  const assert_supported_react_version_1 = require("../../utils/assert-supported-react-version");
7
+ const internal_2 = require("@nx/eslint/internal");
7
8
  const devkit_1 = require("@nx/devkit");
8
9
  const update_module_federation_project_1 = require("../../rules/update-module-federation-project");
9
10
  const application_1 = tslib_1.__importDefault(require("../application/application"));
@@ -16,7 +17,7 @@ const setup_ssr_for_host_1 = require("./lib/setup-ssr-for-host");
16
17
  const update_module_federation_e2e_project_1 = require("./lib/update-module-federation-e2e-project");
17
18
  const add_mf_env_to_inputs_1 = require("../../utils/add-mf-env-to-inputs");
18
19
  const js_1 = require("@nx/js");
19
- const internal_2 = require("@nx/js/internal");
20
+ const internal_3 = require("@nx/js/internal");
20
21
  const versions_1 = require("../../utils/versions");
21
22
  const update_module_federation_tsconfig_1 = require("./lib/update-module-federation-tsconfig");
22
23
  const normalize_host_name_1 = require("./lib/normalize-host-name");
@@ -61,7 +62,7 @@ async function hostGenerator(host, schema) {
61
62
  });
62
63
  tasks.push(initTask);
63
64
  // In TS solution setup, update package.json to use simple name instead of scoped name
64
- if ((0, internal_2.isUsingTsSolutionSetup)(host)) {
65
+ if ((0, internal_3.isUsingTsSolutionSetup)(host)) {
65
66
  const hostPackageJsonPath = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json');
66
67
  if (host.exists(hostPackageJsonPath)) {
67
68
  (0, devkit_1.updateJson)(host, hostPackageJsonPath, (json) => {
@@ -102,7 +103,7 @@ async function hostGenerator(host, schema) {
102
103
  (0, update_module_federation_e2e_project_1.updateModuleFederationE2eProject)(host, options);
103
104
  (0, update_module_federation_tsconfig_1.updateModuleFederationTsconfig)(host, options);
104
105
  // Add remotes as devDependencies in TS solution setup
105
- if ((0, internal_2.isUsingTsSolutionSetup)(host) && remotesWithPorts.length > 0) {
106
+ if ((0, internal_3.isUsingTsSolutionSetup)(host) && remotesWithPorts.length > 0) {
106
107
  addRemotesAsHostDependencies(host, options.projectName, remotesWithPorts);
107
108
  }
108
109
  if (options.ssr) {
@@ -122,7 +123,7 @@ async function hostGenerator(host, schema) {
122
123
  }
123
124
  (0, devkit_1.updateProjectConfiguration)(host, options.projectName, projectConfig);
124
125
  }
125
- if (!options.setParserOptionsProject) {
126
+ if (!(0, internal_2.isTypedLintingEnabled)(options)) {
126
127
  host.delete((0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.lint.json'));
127
128
  }
128
129
  (0, add_mf_env_to_inputs_1.addMfEnvToTargetDefaultInputs)(host, options.bundler);
@@ -12,6 +12,10 @@ export interface Schema {
12
12
  linter: Linter | LinterType;
13
13
  name?: string;
14
14
  remotes?: string[];
15
+ enableTypedLinting?: boolean;
16
+ /**
17
+ * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
18
+ */
15
19
  setParserOptionsProject?: boolean;
16
20
  skipFormat?: boolean;
17
21
  skipNxJson?: boolean;
@@ -109,11 +109,17 @@
109
109
  "description": "Creates an application with strict mode and strict type checking",
110
110
  "default": true
111
111
  },
112
- "setParserOptionsProject": {
112
+ "enableTypedLinting": {
113
113
  "type": "boolean",
114
- "description": "Whether or not to configure the ESLint \"parserOptions.project\" option. We do not do this by default for lint performance reasons.",
114
+ "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.",
115
115
  "default": false
116
116
  },
117
+ "setParserOptionsProject": {
118
+ "type": "boolean",
119
+ "description": "Deprecated alias for `enableTypedLinting`.",
120
+ "default": false,
121
+ "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
122
+ },
117
123
  "compiler": {
118
124
  "type": "string",
119
125
  "description": "The compiler to use",
@@ -18,7 +18,7 @@ async function addLinting(host, options) {
18
18
  unitTestRunner: options.unitTestRunner,
19
19
  skipFormat: true,
20
20
  skipPackageJson: options.skipPackageJson,
21
- setParserOptionsProject: options.setParserOptionsProject,
21
+ enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
22
22
  addPlugin: options.addPlugin,
23
23
  });
24
24
  tasks.push(lintTask);
@@ -16,6 +16,10 @@ export interface Schema {
16
16
  name?: string;
17
17
  publishable?: boolean;
18
18
  routing?: boolean;
19
+ enableTypedLinting?: boolean;
20
+ /**
21
+ * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
22
+ */
19
23
  setParserOptionsProject?: boolean;
20
24
  skipFormat?: boolean;
21
25
  skipPackageJson?: boolean;
@@ -145,11 +145,17 @@
145
145
  "description": "Whether to enable tsconfig strict mode or not.",
146
146
  "default": true
147
147
  },
148
- "setParserOptionsProject": {
148
+ "enableTypedLinting": {
149
149
  "type": "boolean",
150
- "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
150
+ "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.",
151
151
  "default": false
152
152
  },
153
+ "setParserOptionsProject": {
154
+ "type": "boolean",
155
+ "description": "Deprecated alias for `enableTypedLinting`.",
156
+ "default": false,
157
+ "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
158
+ },
153
159
  "compiler": {
154
160
  "type": "string",
155
161
  "enum": ["babel", "swc"],
@@ -5,10 +5,11 @@ exports.remoteGenerator = remoteGenerator;
5
5
  const tslib_1 = require("tslib");
6
6
  const internal_1 = require("@nx/devkit/internal");
7
7
  const assert_supported_react_version_1 = require("../../utils/assert-supported-react-version");
8
+ const internal_2 = require("@nx/eslint/internal");
8
9
  const devkit_1 = require("@nx/devkit");
9
10
  const path_1 = require("path");
10
11
  const js_1 = require("@nx/js");
11
- const internal_2 = require("@nx/js/internal");
12
+ const internal_3 = require("@nx/js/internal");
12
13
  const update_module_federation_project_1 = require("../../rules/update-module-federation-project");
13
14
  const add_mf_env_to_inputs_1 = require("../../utils/add-mf-env-to-inputs");
14
15
  const normalize_remote_1 = require("../../utils/normalize-remote");
@@ -59,7 +60,7 @@ function addModuleFederationFiles(host, options) {
59
60
  host.delete(pathToWebpackProdConfig);
60
61
  }
61
62
  // Delete TypeScript prod config in TS solution setup - not needed in Crystal
62
- if ((0, internal_2.isUsingTsSolutionSetup)(host)) {
63
+ if ((0, internal_3.isUsingTsSolutionSetup)(host)) {
63
64
  const pathToTsProdConfig = (0, devkit_1.joinPathFragments)(options.appProjectRoot, options.bundler === 'rspack'
64
65
  ? 'rspack.config.prod.ts'
65
66
  : 'webpack.config.prod.ts');
@@ -109,7 +110,7 @@ async function remoteGenerator(host, schema) {
109
110
  });
110
111
  tasks.push(initAppTask);
111
112
  // In TS solution setup, update package.json to use simple name instead of scoped name
112
- if ((0, internal_2.isUsingTsSolutionSetup)(host)) {
113
+ if ((0, internal_3.isUsingTsSolutionSetup)(host)) {
113
114
  const remotePackageJsonPath = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json');
114
115
  if (host.exists(remotePackageJsonPath)) {
115
116
  (0, devkit_1.updateJson)(host, remotePackageJsonPath, (json) => {
@@ -128,7 +129,7 @@ async function remoteGenerator(host, schema) {
128
129
  addModuleFederationFiles(host, options);
129
130
  (0, update_module_federation_project_1.updateModuleFederationProject)(host, options);
130
131
  // Conditionally setup TS path or package.json exports based on TS solution setup
131
- if ((0, internal_2.isUsingTsSolutionSetup)(host)) {
132
+ if ((0, internal_3.isUsingTsSolutionSetup)(host)) {
132
133
  (0, setup_package_json_exports_for_remote_1.setupPackageJsonExportsForRemote)(host, options);
133
134
  }
134
135
  else {
@@ -152,7 +153,7 @@ async function remoteGenerator(host, schema) {
152
153
  (0, devkit_1.updateProjectConfiguration)(host, options.projectName, projectConfig);
153
154
  }
154
155
  }
155
- if (!options.setParserOptionsProject) {
156
+ if (!(0, internal_2.isTypedLintingEnabled)(options)) {
156
157
  host.delete((0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.lint.json'));
157
158
  }
158
159
  if (options.host && options.bundler === 'rspack') {
@@ -164,7 +165,7 @@ async function remoteGenerator(host, schema) {
164
165
  }
165
166
  if (options.host && options.dynamic) {
166
167
  const hostConfig = (0, devkit_1.readProjectConfiguration)(host, schema.host);
167
- const pathToMFManifest = (0, devkit_1.joinPathFragments)((0, internal_2.getProjectSourceRoot)(hostConfig, host), 'assets/module-federation.manifest.json');
168
+ const pathToMFManifest = (0, devkit_1.joinPathFragments)((0, internal_3.getProjectSourceRoot)(hostConfig, host), 'assets/module-federation.manifest.json');
168
169
  (0, add_remote_to_dynamic_host_1.addRemoteToDynamicHost)(host, options.projectName, options.devServerPort, pathToMFManifest);
169
170
  }
170
171
  (0, add_mf_env_to_inputs_1.addMfEnvToTargetDefaultInputs)(host, options.bundler);
@@ -14,6 +14,10 @@ export interface Schema {
14
14
  linter: Linter | LinterType;
15
15
  name?: string;
16
16
  routing?: boolean;
17
+ enableTypedLinting?: boolean;
18
+ /**
19
+ * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
20
+ */
17
21
  setParserOptionsProject?: boolean;
18
22
  skipFormat: boolean;
19
23
  skipNxJson?: boolean;
@@ -115,11 +115,17 @@
115
115
  "description": "Creates an application with strict mode and strict type checking.",
116
116
  "default": true
117
117
  },
118
- "setParserOptionsProject": {
118
+ "enableTypedLinting": {
119
119
  "type": "boolean",
120
- "description": "Whether or not to configure the ESLint \"parserOptions.project\" option. We do not do this by default for lint performance reasons.",
120
+ "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.",
121
121
  "default": false
122
122
  },
123
+ "setParserOptionsProject": {
124
+ "type": "boolean",
125
+ "description": "Deprecated alias for `enableTypedLinting`.",
126
+ "default": false,
127
+ "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
128
+ },
123
129
  "compiler": {
124
130
  "type": "string",
125
131
  "description": "The compiler to use.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react",
3
- "version": "23.1.0",
3
+ "version": "23.1.1",
4
4
  "private": false,
5
5
  "description": "The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Vitest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -108,25 +108,25 @@
108
108
  "express": "^4.21.2",
109
109
  "http-proxy-middleware": "^3.0.5",
110
110
  "semver": "^7.6.3",
111
- "@nx/devkit": "23.1.0",
112
- "@nx/js": "23.1.0",
113
- "@nx/eslint": "23.1.0",
114
- "@nx/web": "23.1.0",
115
- "@nx/module-federation": "23.1.0",
116
- "@nx/rollup": "23.1.0"
111
+ "@nx/devkit": "23.1.1",
112
+ "@nx/js": "23.1.1",
113
+ "@nx/eslint": "23.1.1",
114
+ "@nx/web": "23.1.1",
115
+ "@nx/module-federation": "23.1.1",
116
+ "@nx/rollup": "23.1.1"
117
117
  },
118
118
  "devDependencies": {
119
- "@nx/cypress": "23.1.0",
120
- "@nx/playwright": "23.1.0",
121
- "@nx/rsbuild": "23.1.0",
122
- "@nx/vite": "23.1.0",
123
- "@nx/vitest": "23.1.0",
124
- "@nx/webpack": "23.1.0",
125
- "@nx/storybook": "23.1.0",
126
- "nx": "23.1.0"
119
+ "@nx/cypress": "23.1.1",
120
+ "@nx/playwright": "23.1.1",
121
+ "@nx/rsbuild": "23.1.1",
122
+ "@nx/vite": "23.1.1",
123
+ "@nx/vitest": "23.1.1",
124
+ "@nx/webpack": "23.1.1",
125
+ "@nx/storybook": "23.1.1",
126
+ "nx": "23.1.1"
127
127
  },
128
128
  "optionalDependencies": {
129
- "@nx/vite": "23.1.0"
129
+ "@nx/vite": "23.1.1"
130
130
  },
131
131
  "publishConfig": {
132
132
  "access": "public"