@nx/react 0.0.0-pr-30516-94d09ba → 0.0.0-pr-30762-23d89a3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react",
3
- "version": "0.0.0-pr-30516-94d09ba",
3
+ "version": "0.0.0-pr-30762-23d89a3",
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": {
@@ -38,11 +38,11 @@
38
38
  "minimatch": "9.0.3",
39
39
  "picocolors": "^1.1.0",
40
40
  "tslib": "^2.3.0",
41
- "@nx/devkit": "0.0.0-pr-30516-94d09ba",
42
- "@nx/js": "0.0.0-pr-30516-94d09ba",
43
- "@nx/eslint": "0.0.0-pr-30516-94d09ba",
44
- "@nx/web": "0.0.0-pr-30516-94d09ba",
45
- "@nx/module-federation": "0.0.0-pr-30516-94d09ba",
41
+ "@nx/devkit": "0.0.0-pr-30762-23d89a3",
42
+ "@nx/js": "0.0.0-pr-30762-23d89a3",
43
+ "@nx/eslint": "0.0.0-pr-30762-23d89a3",
44
+ "@nx/web": "0.0.0-pr-30762-23d89a3",
45
+ "@nx/module-federation": "0.0.0-pr-30762-23d89a3",
46
46
  "express": "^4.21.2",
47
47
  "http-proxy-middleware": "^3.0.3",
48
48
  "semver": "^7.6.3"
@@ -8,8 +8,6 @@ const has_webpack_plugin_1 = require("../../../utils/has-webpack-plugin");
8
8
  const has_vite_plugin_1 = require("../../../utils/has-vite-plugin");
9
9
  const has_rspack_plugin_1 = require("../../../utils/has-rspack-plugin");
10
10
  const has_rsbuild_plugin_1 = require("../../../utils/has-rsbuild-plugin");
11
- const find_plugin_for_config_file_1 = require("@nx/devkit/src/utils/find-plugin-for-config-file");
12
- const target_defaults_utils_1 = require("@nx/devkit/src/generators/target-defaults-utils");
13
11
  async function addE2e(tree, options) {
14
12
  const hasNxBuildPlugin = (options.bundler === 'webpack' && (0, has_webpack_plugin_1.hasWebpackPlugin)(tree)) ||
15
13
  (options.bundler === 'rspack' && (0, has_rspack_plugin_1.hasRspackPlugin)(tree)) ||
@@ -90,35 +88,13 @@ async function addE2e(tree, options) {
90
88
  baseUrl: e2eWebServerInfo.e2eWebServerAddress,
91
89
  jsx: true,
92
90
  rootProject: options.rootProject,
93
- webServerCommands: hasNxBuildPlugin
94
- ? {
95
- default: e2eWebServerInfo.e2eWebServerCommand,
96
- production: e2eWebServerInfo.e2eCiWebServerCommand,
97
- }
98
- : undefined,
99
- ciWebServerCommand: hasNxBuildPlugin
100
- ? e2eWebServerInfo.e2eCiWebServerCommand
101
- : undefined,
91
+ webServerCommands: {
92
+ default: e2eWebServerInfo.e2eWebServerCommand,
93
+ production: e2eWebServerInfo.e2eCiWebServerCommand,
94
+ },
95
+ ciWebServerCommand: e2eWebServerInfo.e2eCiWebServerCommand,
102
96
  ciBaseUrl: e2eWebServerInfo.e2eCiBaseUrl,
103
97
  });
104
- if (options.addPlugin ||
105
- (0, devkit_1.readNxJson)(tree).plugins?.find((p) => typeof p === 'string'
106
- ? p === '@nx/cypress/plugin'
107
- : p.plugin === '@nx/cypress/plugin')) {
108
- let buildTarget = '^build';
109
- if (hasNxBuildPlugin) {
110
- const configFile = options.bundler === 'webpack'
111
- ? 'webpack.config.js'
112
- : options.bundler === 'vite'
113
- ? `vite.config.${options.js ? 'js' : 'ts'}`
114
- : 'webpack.config.js';
115
- const matchingPlugin = await (0, find_plugin_for_config_file_1.findPluginForConfigFile)(tree, `@nx/${options.bundler}/plugin`, (0, devkit_1.joinPathFragments)(options.appProjectRoot, configFile));
116
- if (matchingPlugin && typeof matchingPlugin !== 'string') {
117
- buildTarget = `^${matchingPlugin.options?.buildTargetName ?? 'build'}`;
118
- }
119
- }
120
- await (0, target_defaults_utils_1.addE2eCiTargetDefaults)(tree, '@nx/cypress/plugin', buildTarget, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, `cypress.config.${options.js ? 'js' : 'ts'}`));
121
- }
122
98
  return e2eTask;
123
99
  }
124
100
  case 'playwright': {
@@ -159,24 +135,6 @@ async function addE2e(tree, options) {
159
135
  rootProject: options.rootProject,
160
136
  addPlugin: options.addPlugin,
161
137
  });
162
- if (options.addPlugin ||
163
- (0, devkit_1.readNxJson)(tree).plugins?.find((p) => typeof p === 'string'
164
- ? p === '@nx/playwright/plugin'
165
- : p.plugin === '@nx/playwright/plugin')) {
166
- let buildTarget = '^build';
167
- if (hasNxBuildPlugin) {
168
- const configFile = options.bundler === 'webpack'
169
- ? 'webpack.config.js'
170
- : options.bundler === 'vite'
171
- ? `vite.config.${options.js ? 'js' : 'ts'}`
172
- : 'webpack.config.js';
173
- const matchingPlugin = await (0, find_plugin_for_config_file_1.findPluginForConfigFile)(tree, `@nx/${options.bundler}/plugin`, (0, devkit_1.joinPathFragments)(options.appProjectRoot, configFile));
174
- if (matchingPlugin && typeof matchingPlugin !== 'string') {
175
- buildTarget = `^${matchingPlugin.options?.buildTargetName ?? 'build'}`;
176
- }
177
- }
178
- await (0, target_defaults_utils_1.addE2eCiTargetDefaults)(tree, '@nx/playwright/plugin', buildTarget, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, `playwright.config.ts`));
179
- }
180
138
  return e2eTask;
181
139
  }
182
140
  case 'none':
@@ -7,12 +7,12 @@
7
7
  "type": "object",
8
8
  "examples": [
9
9
  {
10
- "command": "nx g lib mylib --directory=myapp",
11
- "description": "Generate `libs/myapp/mylib`"
10
+ "command": "nx g @nx/react:lib libs/mylib",
11
+ "description": "Generate a library under `libs/mylib`"
12
12
  },
13
13
  {
14
- "command": "nx g lib mylib --appProject=myapp",
15
- "description": "Generate a library with routes and add them to `myapp`"
14
+ "command": "nx g @nx/react:lib mylib --appProject=myapp",
15
+ "description": "Generate a library under mylib with routes and add them to `myapp`"
16
16
  }
17
17
  ],
18
18
  "properties": {