@nx/react 0.0.0-pr-32490-e4fdfa9 → 0.0.0-pr-32868-a65a4a2

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/README.md CHANGED
@@ -22,7 +22,7 @@
22
22
 
23
23
  # Nx: Smart Repos · Fast Builds
24
24
 
25
- An AI-first build platform that connects everything from your editor to CI. Helping you deliver fast, without breaking things.
25
+ Get to green PRs in half the time. Nx optimizes your builds, scales your CI, and fixes failed PRs. Built for developers and AI agents.
26
26
 
27
27
  This package is a [React plugin for Nx](https://nx.dev/nx-api/react).
28
28
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react",
3
- "version": "0.0.0-pr-32490-e4fdfa9",
3
+ "version": "0.0.0-pr-32868-a65a4a2",
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,19 +38,19 @@
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-32490-e4fdfa9",
42
- "@nx/js": "0.0.0-pr-32490-e4fdfa9",
43
- "@nx/eslint": "0.0.0-pr-32490-e4fdfa9",
44
- "@nx/web": "0.0.0-pr-32490-e4fdfa9",
45
- "@nx/vite": "0.0.0-pr-32490-e4fdfa9",
46
- "@nx/module-federation": "0.0.0-pr-32490-e4fdfa9",
47
- "@nx/rollup": "0.0.0-pr-32490-e4fdfa9",
41
+ "@nx/devkit": "0.0.0-pr-32868-a65a4a2",
42
+ "@nx/js": "0.0.0-pr-32868-a65a4a2",
43
+ "@nx/eslint": "0.0.0-pr-32868-a65a4a2",
44
+ "@nx/web": "0.0.0-pr-32868-a65a4a2",
45
+ "@nx/vite": "0.0.0-pr-32868-a65a4a2",
46
+ "@nx/module-federation": "0.0.0-pr-32868-a65a4a2",
47
+ "@nx/rollup": "0.0.0-pr-32868-a65a4a2",
48
48
  "express": "^4.21.2",
49
49
  "http-proxy-middleware": "^3.0.5",
50
50
  "semver": "^7.6.3"
51
51
  },
52
52
  "devDependencies": {
53
- "nx": "0.0.0-pr-32490-e4fdfa9"
53
+ "nx": "0.0.0-pr-32868-a65a4a2"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"
@@ -1 +1 @@
1
- {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAIjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAoCpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAmM5B;AAED,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"application.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/application/application.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,iBAAiB,EAIjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAoCpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAIlC,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAM5B;AAED,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAoM5B;AAED,eAAe,oBAAoB,CAAC"}
@@ -71,6 +71,7 @@ async function applicationGeneratorInternal(tree, schema) {
71
71
  const initTask = await (0, init_1.default)(tree, {
72
72
  ...options,
73
73
  skipFormat: true,
74
+ useReactRouterPlugin: options.useReactRouter,
74
75
  });
75
76
  tasks.push(initTask);
76
77
  if (!options.addPlugin) {
@@ -1,12 +1,12 @@
1
1
  <%_ if (dynamic) { _%>
2
- import { init } from '@module-federation/enhanced/runtime';
2
+ import { registerRemotes } from '@module-federation/enhanced/runtime';
3
3
 
4
4
  fetch('/assets/module-federation.manifest.json')
5
5
  .then((res) => res.json())
6
6
  .then((remotes: Record<string, string>) =>
7
7
  Object.entries(remotes).map(([name, entry]) => ({ name, entry }))
8
8
  )
9
- .then((remotes) => init({ name: '<%= projectName %>', remotes }))
9
+ .then((remotes) => registerRemotes(remotes))
10
10
  .then(() => import('./bootstrap').catch(err => console.error(err)));
11
11
  <%_ } else { _%>
12
12
  import('./bootstrap').catch(err => console.error(err));
@@ -1,12 +1,12 @@
1
1
  <%_ if (dynamic) { _%>
2
- import { init } from '@module-federation/enhanced/runtime';
2
+ import { registerRemotes } from '@module-federation/enhanced/runtime';
3
3
 
4
4
  fetch('/assets/module-federation.manifest.json')
5
5
  .then((res) => res.json())
6
6
  .then((remotes: Record<string, string>) =>
7
7
  Object.entries(remotes).map(([name, entry]) => ({ name, entry }))
8
8
  )
9
- .then((remotes) => init({ name: '<%= projectName %>', remotes }))
9
+ .then((remotes) => registerRemotes(remotes))
10
10
  .then(() => import('./bootstrap').catch(err => console.error(err)));
11
11
  <%_ } else { _%>
12
12
  import('./bootstrap').catch(err => console.error(err));
@@ -22,7 +22,7 @@ async function reactInitGenerator(tree, schema) {
22
22
  schema.addPlugin ??=
23
23
  process.env.NX_ADD_PLUGINS !== 'false' &&
24
24
  nxJson.useInferencePlugins !== false;
25
- if (schema.addPlugin) {
25
+ if (schema.useReactRouterPlugin && schema.addPlugin) {
26
26
  await (0, add_plugin_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/react/router-plugin', router_plugin_1.createNodesV2, {
27
27
  buildTargetName: ['build', 'react-router:build', 'react-router-build'],
28
28
  devTargetName: ['dev', 'react-router:dev', 'react-router-dev'],
@@ -4,4 +4,5 @@ export interface InitSchema {
4
4
  keepExistingVersions?: boolean;
5
5
  updatePackageScripts?: boolean;
6
6
  addPlugin?: boolean;
7
+ useReactRouterPlugin?: boolean;
7
8
  }
@@ -21,6 +21,12 @@
21
21
  "x-priority": "internal",
22
22
  "description": "Keep existing dependencies versions",
23
23
  "default": false
24
+ },
25
+ "useReactRouterPlugin": {
26
+ "type": "boolean",
27
+ "x-priority": "internal",
28
+ "description": "Add the @nx/react/router-plugin to the nx.json plugins array. Only use this if using React Router for SSR/RSC.",
29
+ "default": false
24
30
  }
25
31
  },
26
32
  "required": []
@@ -1 +1 @@
1
- {"version":3,"file":"add-linting.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/library/lib/add-linting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAG9C,OAAO,EAEL,iBAAiB,EAElB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAU7C,wBAAsB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,8BAwDrE"}
1
+ {"version":3,"file":"add-linting.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/library/lib/add-linting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAG9C,OAAO,EAEL,iBAAiB,EAElB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAW7C,wBAAsB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gBAAgB,8BA6DrE"}
@@ -39,6 +39,10 @@ async function addLinting(host, options) {
39
39
  });
40
40
  tasks.push(addExtendsTask);
41
41
  }
42
+ // Add out-tsc ignore pattern when using TS solution setup
43
+ if (options.isUsingTsSolutionConfig) {
44
+ (0, eslint_file_1.addIgnoresToLintConfig)(host, options.projectRoot, ['**/out-tsc']);
45
+ }
42
46
  }
43
47
  let installTask = () => { };
44
48
  if (!options.skipPackageJson) {
@@ -1 +1 @@
1
- {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAOjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAiCpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAMhE;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BA4RxE;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAOjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAiCpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAMhE;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BA6RxE;AAED,eAAe,gBAAgB,CAAC"}
@@ -57,6 +57,7 @@ async function libraryGeneratorInternal(host, schema) {
57
57
  const initTask = await (0, init_1.default)(host, {
58
58
  ...options,
59
59
  skipFormat: true,
60
+ useReactRouterPlugin: false,
60
61
  });
61
62
  tasks.push(initTask);
62
63
  const packageJson = {