@nx/react 17.0.1 → 17.1.0-beta.0

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": "17.0.1",
3
+ "version": "17.1.0-beta.0",
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": {
@@ -37,11 +37,11 @@
37
37
  "file-loader": "^6.2.0",
38
38
  "minimatch": "3.0.5",
39
39
  "tslib": "^2.3.0",
40
- "@nx/devkit": "17.0.1",
41
- "@nx/js": "17.0.1",
42
- "@nx/eslint": "17.0.1",
43
- "@nx/web": "17.0.1",
44
- "@nrwl/react": "17.0.1"
40
+ "@nx/devkit": "17.1.0-beta.0",
41
+ "@nx/js": "17.1.0-beta.0",
42
+ "@nx/eslint": "17.1.0-beta.0",
43
+ "@nx/web": "17.1.0-beta.0",
44
+ "@nrwl/react": "17.1.0-beta.0"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
@@ -15,7 +15,8 @@ function getBuildOptions(buildTarget, context) {
15
15
  };
16
16
  }
17
17
  async function* moduleFederationDevServer(options, context) {
18
- const nxBin = require.resolve('nx');
18
+ // Force Node to resolve to look for the nx binary that is inside node_modules
19
+ const nxBin = require.resolve('nx/bin/nx');
19
20
  const currIter = options.static
20
21
  ? (0, file_server_impl_1.default)({
21
22
  ...options,
@@ -274,12 +274,21 @@ export function NxWelcome({ title }: { title: string }) {
274
274
  .button-pill:hover {
275
275
  color: rgba(255, 255, 255, 1) !important;
276
276
  }
277
- .nx-console:hover {
277
+ #nx-console:hover {
278
278
  background-color: rgba(0, 122, 204, 1);
279
279
  }
280
- .nx-console svg {
280
+ #nx-console svg {
281
281
  color: rgba(0, 122, 204, 1);
282
282
  }
283
+ #nx-console-jetbrains {
284
+ margin-top: 2rem;
285
+ }
286
+ #nx-console-jetbrains:hover {
287
+ background-color: rgba(255, 49, 140, 1);
288
+ }
289
+ #nx-console-jetbrains svg {
290
+ color: rgba(255, 49, 140, 1);
291
+ }
283
292
  #nx-repo:hover {
284
293
  background-color: rgba(24, 23, 23, 1);
285
294
  }
@@ -644,7 +653,8 @@ export function NxWelcome({ title }: { title: string }) {
644
653
  </div>
645
654
  <div id="other-links">
646
655
  <a
647
- className="button-pill nx-console rounded shadow"
656
+ id="nx-console"
657
+ className="button-pill rounded shadow"
648
658
  href="https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console&utm_source=nx-project"
649
659
  target="_blank"
650
660
  rel="noreferrer"
@@ -660,23 +670,35 @@ export function NxWelcome({ title }: { title: string }) {
660
670
  </svg>
661
671
  <span>
662
672
  Install Nx Console for VSCode
663
- <span>The official VSCode plugin for Nx.</span>
673
+ <span>The official VSCode extension for Nx.</span>
664
674
  </span>
665
675
  </a>
666
676
  <a
667
- className="button-pill nx-console rounded shadow"
677
+ id="nx-console-jetbrains"
678
+ className="button-pill rounded shadow"
668
679
  href="https://plugins.jetbrains.com/plugin/21060-nx-console"
669
680
  target="_blank"
670
681
  rel="noreferrer"
671
682
  >
672
683
  <svg
673
- fill="currentColor"
674
- role="img"
675
- viewBox="0 0 24 24"
684
+ height="48"
685
+ width="48"
686
+ viewBox="20 20 60 60"
676
687
  xmlns="http://www.w3.org/2000/svg"
677
688
  >
678
- <title>IntelliJ</title>
679
- <path d="M0 0v24h24V0zm3.723 3.111h5v1.834h-1.39v6.277h1.39v1.834h-5v-1.834h1.444V4.945H3.723zm11.055 0H17v6.5c0 .612-.055 1.111-.222 1.556-.167.444-.39.777-.723 1.11-.277.279-.666.557-1.11.668a3.933 3.933 0 0 1-1.445.278c-.778 0-1.444-.167-1.944-.445a4.81 4.81 0 0 1-1.279-1.056l1.39-1.555c.277.334.555.555.833.722.277.167.611.278.945.278.389 0 .721-.111 1-.389.221-.278.333-.667.333-1.278zM2.222 19.5h9V21h-9z"></path>
689
+ <path d="m22.5 22.5h60v60h-60z" />
690
+ <g fill="#fff">
691
+ <path d="m29.03 71.25h22.5v3.75h-22.5z" />
692
+ <path d="m28.09 38 1.67-1.58a1.88 1.88 0 0 0 1.47.87c.64 0 1.06-.44 1.06-1.31v-5.98h2.58v6a3.48 3.48 0 0 1 -.87 2.6 3.56 3.56 0 0 1 -2.57.95 3.84 3.84 0 0 1 -3.34-1.55z" />
693
+ <path d="m36 30h7.53v2.19h-5v1.44h4.49v2h-4.42v1.49h5v2.21h-7.6z" />
694
+ <path d="m47.23 32.29h-2.8v-2.29h8.21v2.27h-2.81v7.1h-2.6z" />
695
+ <path d="m29.13 43.08h4.42a3.53 3.53 0 0 1 2.55.83 2.09 2.09 0 0 1 .6 1.53 2.16 2.16 0 0 1 -1.44 2.09 2.27 2.27 0 0 1 1.86 2.29c0 1.61-1.31 2.59-3.55 2.59h-4.44zm5 2.89c0-.52-.42-.8-1.18-.8h-1.29v1.64h1.24c.79 0 1.25-.26 1.25-.81zm-.9 2.66h-1.57v1.73h1.62c.8 0 1.24-.31 1.24-.86 0-.5-.4-.87-1.27-.87z" />
696
+ <path d="m38 43.08h4.1a4.19 4.19 0 0 1 3 1 2.93 2.93 0 0 1 .9 2.19 3 3 0 0 1 -1.93 2.89l2.24 3.27h-3l-1.88-2.84h-.87v2.84h-2.56zm4 4.5c.87 0 1.39-.43 1.39-1.11 0-.75-.54-1.12-1.4-1.12h-1.44v2.26z" />
697
+ <path d="m49.59 43h2.5l4 9.44h-2.79l-.67-1.69h-3.63l-.67 1.69h-2.71zm2.27 5.73-1-2.65-1.06 2.65z" />
698
+ <path d="m56.46 43.05h2.6v9.37h-2.6z" />
699
+ <path d="m60.06 43.05h2.42l3.37 5v-5h2.57v9.37h-2.26l-3.53-5.14v5.14h-2.57z" />
700
+ <path d="m68.86 51 1.45-1.73a4.84 4.84 0 0 0 3 1.13c.71 0 1.08-.24 1.08-.65 0-.4-.31-.6-1.59-.91-2-.46-3.53-1-3.53-2.93 0-1.74 1.37-3 3.62-3a5.89 5.89 0 0 1 3.86 1.25l-1.26 1.84a4.63 4.63 0 0 0 -2.62-.92c-.63 0-.94.25-.94.6 0 .42.32.61 1.63.91 2.14.46 3.44 1.16 3.44 2.91 0 1.91-1.51 3-3.79 3a6.58 6.58 0 0 1 -4.35-1.5z" />
701
+ </g>
680
702
  </svg>
681
703
  <span>
682
704
  Install Nx Console for JetBrains
@@ -6,25 +6,36 @@ const web_1 = require("@nx/web");
6
6
  const versions_1 = require("../../../utils/versions");
7
7
  async function addE2e(tree, options) {
8
8
  switch (options.e2eTestRunner) {
9
- case 'cypress':
9
+ case 'cypress': {
10
10
  (0, web_1.webStaticServeGenerator)(tree, {
11
11
  buildTarget: `${options.projectName}:build`,
12
12
  targetName: 'serve-static',
13
13
  });
14
- const { cypressProjectGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
15
- return await cypressProjectGenerator(tree, {
14
+ const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
15
+ (0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
16
+ projectType: 'application',
17
+ root: options.e2eProjectRoot,
18
+ sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
19
+ targets: {},
20
+ implicitDependencies: [options.projectName],
21
+ tags: [],
22
+ });
23
+ return await configurationGenerator(tree, {
16
24
  ...options,
17
- name: options.e2eProjectName,
18
- directory: options.e2eProjectRoot,
25
+ project: options.e2eProjectName,
26
+ directory: 'src',
19
27
  // the name and root are already normalized, instruct the generator to use them as is
20
- projectNameAndRootFormat: 'as-provided',
21
- project: options.projectName,
22
28
  bundler: options.bundler === 'rspack' ? 'webpack' : options.bundler,
23
29
  skipFormat: true,
30
+ devServerTarget: `${options.projectName}:serve`,
31
+ jsx: true,
32
+ rootProject: options.rootProject,
24
33
  });
25
- case 'playwright':
34
+ }
35
+ case 'playwright': {
26
36
  const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
27
37
  (0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
38
+ projectType: 'application',
28
39
  root: options.e2eProjectRoot,
29
40
  sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
30
41
  targets: {},
@@ -40,7 +51,9 @@ async function addE2e(tree, options) {
40
51
  setParserOptionsProject: options.setParserOptionsProject,
41
52
  webServerCommand: `${(0, devkit_1.getPackageManagerCommand)().exec} nx serve ${options.name}`,
42
53
  webServerAddress: 'http://localhost:4200',
54
+ rootProject: options.rootProject,
43
55
  });
56
+ }
44
57
  case 'none':
45
58
  default:
46
59
  return () => { };
@@ -16,6 +16,7 @@ async function cypressComponentConfigGenerator(tree, options) {
16
16
  const installTask = await baseCyCtConfig(tree, {
17
17
  project: options.project,
18
18
  skipFormat: true,
19
+ jsx: true,
19
20
  });
20
21
  const found = await (0, ct_utils_1.addCTTargetWithBuildTarget)(tree, {
21
22
  project: options.project,
@@ -8,7 +8,13 @@ function getFunctionDeterminateRemoteUrl(isServer = false) {
8
8
  const target = isServer ? 'serve-server' : 'serve';
9
9
  const remoteEntry = isServer ? 'server/remoteEntry.js' : 'remoteEntry.js';
10
10
  return function (remote) {
11
- const remoteConfiguration = (0, project_graph_1.readCachedProjectConfiguration)(remote);
11
+ let remoteConfiguration = null;
12
+ try {
13
+ remoteConfiguration = (0, project_graph_1.readCachedProjectConfiguration)(remote);
14
+ }
15
+ catch (e) {
16
+ throw new Error(`Cannot find remote: "${remote}". Check that the remote name is correct in your module federation config file.\n`);
17
+ }
12
18
  const serveTarget = remoteConfiguration?.targets?.[target];
13
19
  if (!serveTarget) {
14
20
  throw new Error(`Cannot automatically determine URL of remote (${remote}). Looked for property "host" in the project's "${serveTarget}" target.\n
@@ -5,8 +5,8 @@ export declare const reactDomVersion = "18.2.0";
5
5
  export declare const reactIsVersion = "18.2.0";
6
6
  export declare const swcLoaderVersion = "0.1.15";
7
7
  export declare const babelLoaderVersion = "^9.1.2";
8
- export declare const typesReactVersion = "18.2.24";
9
- export declare const typesReactDomVersion = "18.2.9";
8
+ export declare const typesReactVersion = "18.2.33";
9
+ export declare const typesReactDomVersion = "18.2.14";
10
10
  export declare const typesReactIsVersion = "18.2.2";
11
11
  export declare const typesNodeVersion = "18.14.2";
12
12
  export declare const babelPresetReactVersion = "^7.14.5";
@@ -9,8 +9,8 @@ exports.reactDomVersion = '18.2.0';
9
9
  exports.reactIsVersion = '18.2.0';
10
10
  exports.swcLoaderVersion = '0.1.15';
11
11
  exports.babelLoaderVersion = '^9.1.2';
12
- exports.typesReactVersion = '18.2.24';
13
- exports.typesReactDomVersion = '18.2.9';
12
+ exports.typesReactVersion = '18.2.33';
13
+ exports.typesReactDomVersion = '18.2.14';
14
14
  exports.typesReactIsVersion = '18.2.2';
15
15
  exports.typesNodeVersion = '18.14.2';
16
16
  exports.babelPresetReactVersion = '^7.14.5';