@nx/react 19.0.0-beta.8 → 19.0.0-beta.9

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/migrations.json CHANGED
@@ -1,23 +1,5 @@
1
1
  {
2
2
  "generators": {
3
- "update-rollup-executor": {
4
- "cli": "nx",
5
- "version": "15.3.0-beta.0",
6
- "description": "Update projects using @nrwl/web:rollup to @nrwl/rollup:rollup for build.",
7
- "factory": "./src/migrations/update-15-3-0/update-rollup-executor"
8
- },
9
- "install-webpack-rollup-dependencies": {
10
- "cli": "nx",
11
- "version": "15.3.0-beta.0",
12
- "description": "Install new dependencies for React projects using Webpack or Rollup.",
13
- "factory": "./src/migrations/update-15-3-0/install-webpack-rollup-dependencies"
14
- },
15
- "react-webpack-config-setup": {
16
- "cli": "nx",
17
- "version": "15.6.3-beta.0",
18
- "description": "Creates or updates webpack.config.js file with the new options for webpack.",
19
- "factory": "./src/migrations/update-15-6-3/webpack-config-setup"
20
- },
21
3
  "update-16-0-0-add-nx-packages": {
22
4
  "cli": "nx",
23
5
  "version": "16.0.0-beta.1",
@@ -62,148 +44,6 @@
62
44
  }
63
45
  },
64
46
  "packageJsonUpdates": {
65
- "15.2.2-beta.0": {
66
- "version": "15.2.2-beta.0",
67
- "packages": {
68
- "@types/react": {
69
- "version": "18.0.25",
70
- "alwaysAddToPackageJson": false
71
- },
72
- "@types/react-dom": {
73
- "version": "18.0.9",
74
- "alwaysAddToPackageJson": false
75
- },
76
- "@types/node": {
77
- "version": "18.11.9",
78
- "alwaysAddToPackageJson": false
79
- },
80
- "styled-components": {
81
- "version": "5.3.6",
82
- "alwaysAddToPackageJson": false
83
- },
84
- "@emotion/styled": {
85
- "version": "11.10.5",
86
- "alwaysAddToPackageJson": false
87
- },
88
- "@emotion/react": {
89
- "version": "11.10.5",
90
- "alwaysAddToPackageJson": false
91
- },
92
- "@emotion/babel-plugin": {
93
- "version": "11.10.5",
94
- "alwaysAddToPackageJson": false
95
- },
96
- "styled-jsx": {
97
- "version": "5.1.0",
98
- "alwaysAddToPackageJson": false
99
- },
100
- "react-router-dom": {
101
- "version": "6.4.3",
102
- "alwaysAddToPackageJson": false
103
- },
104
- "@reduxjs/toolkit": {
105
- "version": "1.9.0",
106
- "alwaysAddToPackageJson": false
107
- },
108
- "react-redux": {
109
- "version": "8.0.5",
110
- "alwaysAddToPackageJson": false
111
- },
112
- "eslint-plugin-react": {
113
- "version": "7.31.11",
114
- "alwaysAddToPackageJson": false
115
- },
116
- "postcss": {
117
- "version": "8.4.19",
118
- "alwaysAddToPackageJson": false
119
- },
120
- "tailwindcss": {
121
- "version": "3.2.4",
122
- "alwaysAddToPackageJson": false
123
- },
124
- "autoprefixer": {
125
- "version": "10.4.13",
126
- "alwaysAddToPackageJson": false
127
- },
128
- "@types/express": {
129
- "version": "4.17.14",
130
- "alwaysAddToPackageJson": false
131
- }
132
- }
133
- },
134
- "15.8.0": {
135
- "version": "15.8.0-beta.0",
136
- "packages": {
137
- "@types/react": {
138
- "version": "18.0.28",
139
- "alwaysAddToPackageJson": false
140
- },
141
- "@types/react-dom": {
142
- "version": "18.0.11",
143
- "alwaysAddToPackageJson": false
144
- },
145
- "@types/node": {
146
- "version": "18.14.2",
147
- "alwaysAddToPackageJson": false
148
- },
149
- "@emotion/styled": {
150
- "version": "11.10.6",
151
- "alwaysAddToPackageJson": false
152
- },
153
- "@emotion/react": {
154
- "version": "11.10.6",
155
- "alwaysAddToPackageJson": false
156
- },
157
- "@emotion/babel-plugin": {
158
- "version": "11.10.6",
159
- "alwaysAddToPackageJson": false
160
- },
161
- "styled-jsx": {
162
- "version": "5.1.2",
163
- "alwaysAddToPackageJson": false
164
- },
165
- "react-router-dom": {
166
- "version": "6.8.1",
167
- "alwaysAddToPackageJson": false
168
- },
169
- "@testing-library/react": {
170
- "version": "14.0.0",
171
- "alwaysAddToPackageJson": false
172
- },
173
- "@reduxjs/toolkit": {
174
- "version": "1.9.3",
175
- "alwaysAddToPackageJson": false
176
- },
177
- "eslint-plugin-import": {
178
- "version": "2.27.5",
179
- "alwaysAddToPackageJson": false
180
- },
181
- "eslint-plugin-jsx-a11y": {
182
- "version": "6.7.1",
183
- "alwaysAddToPackageJson": false
184
- },
185
- "eslint-plugin-react": {
186
- "version": "7.32.2",
187
- "alwaysAddToPackageJson": false
188
- },
189
- "postcss": {
190
- "version": "8.4.21",
191
- "alwaysAddToPackageJson": false
192
- },
193
- "tailwindcss": {
194
- "version": "3.2.7",
195
- "alwaysAddToPackageJson": false
196
- },
197
- "@types/express": {
198
- "version": "4.17.17",
199
- "alwaysAddToPackageJson": false
200
- },
201
- "less": {
202
- "version": "4.1.3",
203
- "alwaysAddToPackageJson": false
204
- }
205
- }
206
- },
207
47
  "16.3.0": {
208
48
  "version": "16.3.0-beta.2",
209
49
  "packages": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react",
3
- "version": "19.0.0-beta.8",
3
+ "version": "19.0.0-beta.9",
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": {
@@ -37,11 +37,11 @@
37
37
  "file-loader": "^6.2.0",
38
38
  "minimatch": "9.0.3",
39
39
  "tslib": "^2.3.0",
40
- "@nx/devkit": "19.0.0-beta.8",
41
- "@nx/js": "19.0.0-beta.8",
42
- "@nx/eslint": "19.0.0-beta.8",
43
- "@nx/web": "19.0.0-beta.8",
44
- "@nrwl/react": "19.0.0-beta.8"
40
+ "@nx/devkit": "19.0.0-beta.9",
41
+ "@nx/js": "19.0.0-beta.9",
42
+ "@nx/eslint": "19.0.0-beta.9",
43
+ "@nx/web": "19.0.0-beta.9",
44
+ "@nrwl/react": "19.0.0-beta.9"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
@@ -1,3 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export declare function installWebpackRollupDependencies(tree: Tree): import("@nx/devkit").GeneratorCallback;
3
- export default installWebpackRollupDependencies;
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.installWebpackRollupDependencies = void 0;
4
- const devkit_1 = require("@nx/devkit");
5
- const versions_1 = require("../../utils/versions");
6
- function installWebpackRollupDependencies(tree) {
7
- const projects = (0, devkit_1.getProjects)(tree);
8
- let shouldInstall = false;
9
- for (const [, project] of projects) {
10
- if (project.targets?.build?.executor === '@nrwl/webpack:webpack' ||
11
- project.targets?.build?.executor === '@nrwl/rollup:rollup' ||
12
- project.targets?.build?.executor === '@nrwl/web:rollup') {
13
- shouldInstall = true;
14
- break;
15
- }
16
- }
17
- if (shouldInstall) {
18
- // These were previously dependencies of `@nrwl/react` but we've removed them
19
- // to accommodate different bundlers and test runners.
20
- return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
21
- '@babel/preset-react': '^7.14.5',
22
- '@pmmmwh/react-refresh-webpack-plugin': '^0.5.7',
23
- '@svgr/webpack': '^6.1.2',
24
- 'css-loader': '^6.4.0',
25
- 'react-refresh': '^0.10.0',
26
- 'style-loader': '^3.3.0',
27
- stylus: '^0.55.0',
28
- 'stylus-loader': '^7.1.0',
29
- 'url-loader': '^4.1.1',
30
- webpack: '^5.75.0',
31
- 'webpack-merge': '^5.8.0',
32
- '@nrwl/webpack': versions_1.nxVersion,
33
- });
34
- }
35
- }
36
- exports.installWebpackRollupDependencies = installWebpackRollupDependencies;
37
- exports.default = installWebpackRollupDependencies;
@@ -1,3 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export declare function updateRollupExecutor(tree: Tree): void;
3
- export default updateRollupExecutor;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateRollupExecutor = void 0;
4
- const devkit_1 = require("@nx/devkit");
5
- function updateRollupExecutor(tree) {
6
- const projects = (0, devkit_1.getProjects)(tree);
7
- for (const [name, project] of projects) {
8
- if (project.targets?.build?.executor === '@nrwl/web:rollup') {
9
- project.targets.build.executor = '@nrwl/rollup:rollup';
10
- (0, devkit_1.updateProjectConfiguration)(tree, name, project);
11
- }
12
- }
13
- }
14
- exports.updateRollupExecutor = updateRollupExecutor;
15
- exports.default = updateRollupExecutor;
@@ -1,2 +0,0 @@
1
- import { Tree } from '@nx/devkit';
2
- export default function (tree: Tree): Promise<void>;
@@ -1,103 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const devkit_1 = require("@nx/devkit");
4
- const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
5
- const path_1 = require("path");
6
- async function default_1(tree) {
7
- // Since projects can have multiple configurations, we need to know if the default options
8
- // need to be migrated or not. If so then the subsequent configurations with `webpackConfig` also need to be.
9
- const defaultOptionsUpdated = new Set();
10
- (0, executor_options_utils_1.forEachExecutorOptions)(tree, '@nrwl/webpack:webpack', (options, projectName, targetName, configurationName) => {
11
- const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, projectName);
12
- const defaultOptions = projectConfiguration.targets[targetName].options;
13
- const defaultWasUpdated = defaultOptionsUpdated.has(projectName);
14
- // If default was not updated (for different configurations), we don't do anything
15
- // If isolatedConfig is set, we don't need to do anything
16
- // If it is NOT React, we don't need to do anything
17
- if (!defaultWasUpdated &&
18
- (defaultOptions?.['isolatedConfig'] ||
19
- !(defaultOptions?.['main']?.match(/main\.(t|j)sx$/) ||
20
- defaultOptions?.['webpackConfig'] === '@nrwl/react/plugins/webpack'))) {
21
- return;
22
- }
23
- defaultOptionsUpdated.add(projectName);
24
- // If this is not the default options (e.g. for development, production, or something custom),
25
- // then skip it unless it specifically configures a webpackConfig file
26
- if (configurationName && !options?.webpackConfig) {
27
- return;
28
- }
29
- // If webpackConfig is set, update it with the new options
30
- // If webpackConfig is not set, we need to create a new
31
- // webpack.config.js file and set the path to it in the
32
- // executor options
33
- if (options?.['webpackConfig'] &&
34
- options['webpackConfig'] !== '@nrwl/react/plugins/webpack') {
35
- let oldName = options['webpackConfig'];
36
- if (options['webpackConfig'].endsWith('.js')) {
37
- oldName = options['webpackConfig'].replace('.js', '.old.js');
38
- }
39
- if (options['webpackConfig'].endsWith('.ts')) {
40
- oldName = options['webpackConfig'].replace('.ts', '.old.ts');
41
- }
42
- renameFile(tree, options['webpackConfig'], oldName);
43
- const justTheFileName = (0, path_1.basename)(oldName);
44
- tree.write(options['webpackConfig'], `
45
- const { composePlugins, withNx } = require('@nrwl/webpack');
46
- const { withReact } = require('@nrwl/react');
47
-
48
- // Nx plugins for webpack.
49
- module.exports = composePlugins(withNx(), withReact(), (config, { options, context }) => {
50
- // Note: This was added by an Nx migration.
51
- // You should consider inlining the logic into this file.
52
- // For more information on webpack config and Nx see:
53
- // https://nx.dev/recipes/webpack/webpack-config-setup
54
- return require('./${justTheFileName}')(config, context);
55
- });
56
- `);
57
- options['isolatedConfig'] = true;
58
- projectConfiguration.targets[targetName][configurationName ?? 'options'] = options;
59
- (0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
60
- devkit_1.logger.info(`
61
- ${options['webpackConfig']} has been renamed to ${oldName} and a new ${options['webpackConfig']}
62
- has been created for your project ${projectName}.
63
- You should consider inlining the logic from ${oldName} into ${options['webpackConfig']}.
64
- You can read our guide on how to do this here:
65
-
66
- https://nx.dev/recipes/webpack/webpack-config-setup
67
- `);
68
- }
69
- else {
70
- const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, projectName);
71
- if (!options) {
72
- options = {};
73
- }
74
- options['webpackConfig'] = `${projectConfiguration.root}/webpack.config.js`;
75
- options['isolatedConfig'] = true;
76
- tree.write(options['webpackConfig'], `
77
- const { composePlugins, withNx } = require('@nrwl/webpack');
78
- const { withReact } = require('@nrwl/react');
79
-
80
- // Nx plugins for webpack.
81
- module.exports = composePlugins(withNx(), withReact(), (config, { options, context }) => {
82
- // Update the webpack config as needed here.
83
- // e.g. config.plugins.push(new MyPlugin())
84
- // For more information on webpack config and Nx see:
85
- // https://nx.dev/recipes/webpack/webpack-config-setup
86
- return config;
87
- });
88
- `);
89
- projectConfiguration.targets[targetName].options = options;
90
- (0, devkit_1.updateProjectConfiguration)(tree, projectName, projectConfiguration);
91
- }
92
- });
93
- await (0, devkit_1.formatFiles)(tree);
94
- }
95
- exports.default = default_1;
96
- function renameFile(tree, from, to) {
97
- const buffer = tree.read(from);
98
- if (!buffer) {
99
- return;
100
- }
101
- tree.write(to, buffer);
102
- tree.delete(from);
103
- }