@nx/react 18.0.0-beta.2 → 18.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react",
3
- "version": "18.0.0-beta.2",
3
+ "version": "18.0.0-beta.3",
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, 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": {
@@ -36,11 +36,11 @@
36
36
  "chalk": "^4.1.0",
37
37
  "minimatch": "9.0.3",
38
38
  "tslib": "^2.3.0",
39
- "@nx/devkit": "18.0.0-beta.2",
40
- "@nx/js": "18.0.0-beta.2",
41
- "@nx/eslint": "18.0.0-beta.2",
42
- "@nx/web": "18.0.0-beta.2",
43
- "@nrwl/react": "18.0.0-beta.2"
39
+ "@nx/devkit": "18.0.0-beta.3",
40
+ "@nx/js": "18.0.0-beta.3",
41
+ "@nx/eslint": "18.0.0-beta.3",
42
+ "@nx/web": "18.0.0-beta.3",
43
+ "@nrwl/react": "18.0.0-beta.3"
44
44
  },
45
45
  "publishConfig": {
46
46
  "access": "public"
@@ -17,15 +17,22 @@ function readEntryFile(host, path) {
17
17
  source: tsModule.createSourceFile(path, content, tsModule.ScriptTarget.Latest, true),
18
18
  };
19
19
  }
20
- async function setupSsrGenerator(tree, options) {
21
- let projectGraph;
22
- try {
23
- projectGraph = (0, devkit_1.readCachedProjectGraph)();
24
- }
25
- catch {
26
- projectGraph = await (0, devkit_1.createProjectGraphAsync)();
20
+ async function getProjectConfig(tree, projectName) {
21
+ let maybeProjectConfig = (0, devkit_1.readProjectConfiguration)(tree, projectName);
22
+ if (!maybeProjectConfig.targets?.build) {
23
+ let projectGraph;
24
+ try {
25
+ projectGraph = (0, devkit_1.readCachedProjectGraph)();
26
+ }
27
+ catch {
28
+ projectGraph = await (0, devkit_1.createProjectGraphAsync)();
29
+ }
30
+ maybeProjectConfig = projectGraph.nodes[projectName].data;
27
31
  }
28
- const projectConfig = projectGraph.nodes[options.project].data;
32
+ return maybeProjectConfig;
33
+ }
34
+ async function setupSsrGenerator(tree, options) {
35
+ const projectConfig = await getProjectConfig(tree, options.project);
29
36
  const projectRoot = projectConfig.root;
30
37
  const appImportCandidates = [
31
38
  options.appComponentImportPath ?? 'app/app',
@@ -13,7 +13,7 @@ exports.default = default_1;
13
13
  function hasModuleFederationProject(tree) {
14
14
  const projects = (0, devkit_1.getProjects)(tree);
15
15
  for (const project of projects.values()) {
16
- const targets = project.targets;
16
+ const targets = project.targets || {};
17
17
  for (const [_, target] of Object.entries(targets)) {
18
18
  if (target.executor === '@nx/webpack:webpack' &&
19
19
  (tree.exists((0, devkit_1.joinPathFragments)(project.root, 'module-federation.config.ts')) ||