@nx/react 17.0.1 → 17.0.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": "17.0.1",
3
+ "version": "17.0.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": {
@@ -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.0.3",
41
+ "@nx/js": "17.0.3",
42
+ "@nx/eslint": "17.0.3",
43
+ "@nx/web": "17.0.3",
44
+ "@nrwl/react": "17.0.3"
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,
@@ -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,
@@ -12,22 +12,22 @@
12
12
  ],
13
13
  "type": "object",
14
14
  "properties": {
15
- "name": {
16
- "description": "The name of the module.",
15
+ "path": {
17
16
  "type": "string",
18
17
  "$default": {
19
18
  "$source": "argv",
20
19
  "index": 0
21
20
  },
21
+ "description": "The path to locate the federated module. This path should be relative to the workspace root and the file should exist.",
22
+ "x-prompt": "What is the path to the module to be federated?"
23
+ },
24
+ "name": {
25
+ "description": "The name of the module.",
26
+ "type": "string",
22
27
  "x-prompt": "What name would you like to use for the module?",
23
28
  "pattern": "^[a-zA-Z][^:]*$",
24
29
  "x-priority": "important"
25
30
  },
26
- "path": {
27
- "type": "string",
28
- "description": "The path to locate the federated module. This path should be relative to the workspace root and the file should exist.",
29
- "x-prompt": "What is the path to the module to be federated?"
30
- },
31
31
  "remote": {
32
32
  "type": "string",
33
33
  "description": "The name of the remote.",
@@ -11,6 +11,9 @@ const knownLocations = [
11
11
  'pages/styles.css',
12
12
  'pages/styles.scss',
13
13
  'pages/styles.less',
14
+ 'app/global.css',
15
+ 'app/global.scss',
16
+ 'app/global.less',
14
17
  ];
15
18
  function addTailwindStyleImports(tree, project, _options) {
16
19
  const candidates = knownLocations.map((x) => (0, devkit_1.joinPathFragments)(project.root, x));
@@ -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';