@nx/react 17.3.0-beta.5 → 17.3.0-beta.8

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.3.0-beta.5",
3
+ "version": "17.3.0-beta.8",
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": {
@@ -35,13 +35,13 @@
35
35
  "@svgr/webpack": "^8.0.1",
36
36
  "chalk": "^4.1.0",
37
37
  "file-loader": "^6.2.0",
38
- "minimatch": "3.0.5",
38
+ "minimatch": "9.0.3",
39
39
  "tslib": "^2.3.0",
40
- "@nx/devkit": "17.3.0-beta.5",
41
- "@nx/js": "17.3.0-beta.5",
42
- "@nx/eslint": "17.3.0-beta.5",
43
- "@nx/web": "17.3.0-beta.5",
44
- "@nrwl/react": "17.3.0-beta.5"
40
+ "@nx/devkit": "17.3.0-beta.8",
41
+ "@nx/js": "17.3.0-beta.8",
42
+ "@nx/eslint": "17.3.0-beta.8",
43
+ "@nx/web": "17.3.0-beta.8",
44
+ "@nrwl/react": "17.3.0-beta.8"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public"
@@ -64,7 +64,7 @@ const Styled<%= className %> = styled.div`
64
64
  <% } %>
65
65
  </<%= wrapper %>>
66
66
  );
67
- };
67
+ }
68
68
  <% } %>
69
69
 
70
70
  export default <%= className %>;
@@ -4,7 +4,7 @@ export interface Schema {
4
4
  remote: string;
5
5
  remoteDirectory?: string;
6
6
  projectNameAndRootFormat?: ProjectNameAndRootFormat;
7
- e2eTestRunner?: 'cypress' | 'none';
7
+ e2eTestRunner?: 'cypress' | 'playwright' | 'none';
8
8
  host?: string;
9
9
  linter?: Linter;
10
10
  skipFormat?: boolean;
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "e2eTestRunner": {
70
70
  "type": "string",
71
- "enum": ["cypress", "none"],
71
+ "enum": ["cypress", "playwright", "none"],
72
72
  "description": "Test runner to use for end to end (e2e) tests.",
73
73
  "default": "cypress"
74
74
  },
@@ -1,15 +1,15 @@
1
- import { useState, useCallback } from 'react'
2
-
3
- // eslint-disable-next-line @typescript-eslint/no-empty-interface
4
- export interface <%= hookTypeName %> {
5
- count: number;
6
- increment: () => void;
7
- }
8
-
9
- export function <%= hookName %>(): <%= hookTypeName %> {
10
- const [count, setCount] = useState(0)
11
- const increment = useCallback(() => setCount((x) => x + 1), [])
12
- return { count, increment }
13
- };
14
-
15
- export default <%= hookName %>;
1
+ import { useState, useCallback } from 'react'
2
+
3
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
4
+ export interface <%= hookTypeName %> {
5
+ count: number;
6
+ increment: () => void;
7
+ }
8
+
9
+ export function <%= hookName %>(): <%= hookTypeName %> {
10
+ const [count, setCount] = useState(0)
11
+ const increment = useCallback(() => setCount((x) => x + 1), [])
12
+ return { count, increment }
13
+ }
14
+
15
+ export default <%= hookName %>;
@@ -8,7 +8,7 @@ export interface Schema {
8
8
  devServerPort?: number;
9
9
  directory?: string;
10
10
  projectNameAndRootFormat?: ProjectNameAndRootFormat;
11
- e2eTestRunner: 'cypress' | 'none';
11
+ e2eTestRunner: 'cypress' | 'playwright' | 'none';
12
12
  globalCss?: boolean;
13
13
  js?: boolean;
14
14
  linter: Linter;
@@ -99,7 +99,7 @@
99
99
  },
100
100
  "e2eTestRunner": {
101
101
  "type": "string",
102
- "enum": ["cypress", "none"],
102
+ "enum": ["cypress", "playwright", "none"],
103
103
  "description": "Test runner to use for end to end (e2e) tests.",
104
104
  "default": "cypress"
105
105
  },
@@ -12,7 +12,7 @@ async function reactInitGenerator(host, schema) {
12
12
  'react-dom': versions_1.reactDomVersion,
13
13
  }, {
14
14
  '@nx/react': versions_1.nxVersion,
15
- }));
15
+ }, undefined, schema.keepExistingVersions));
16
16
  }
17
17
  if (!schema.skipFormat) {
18
18
  await (0, devkit_1.formatFiles)(host);
@@ -1,4 +1,5 @@
1
1
  export interface InitSchema {
2
2
  skipFormat?: boolean;
3
3
  skipPackageJson?: boolean;
4
+ keepExistingVersions?: boolean;
4
5
  }
@@ -15,6 +15,12 @@
15
15
  "description": "Do not add dependencies to `package.json`.",
16
16
  "type": "boolean",
17
17
  "default": false
18
+ },
19
+ "keepExistingVersions": {
20
+ "type": "boolean",
21
+ "x-priority": "internal",
22
+ "description": "Keep existing dependencies versions",
23
+ "default": false
18
24
  }
19
25
  },
20
26
  "required": []
@@ -9,7 +9,7 @@ export interface Schema {
9
9
  devServerPort?: number;
10
10
  directory?: string;
11
11
  projectNameAndRootFormat?: ProjectNameAndRootFormat;
12
- e2eTestRunner: 'cypress' | 'none';
12
+ e2eTestRunner: 'cypress' | 'playwright' | 'none';
13
13
  globalCss?: boolean;
14
14
  host?: string;
15
15
  js?: boolean;
@@ -105,7 +105,7 @@
105
105
  },
106
106
  "e2eTestRunner": {
107
107
  "type": "string",
108
- "enum": ["cypress", "none"],
108
+ "enum": ["cypress", "playwright", "none"],
109
109
  "description": "Test runner to use for end to end (e2e) tests.",
110
110
  "default": "cypress"
111
111
  },
@@ -6,7 +6,7 @@ const component_cypress_spec_1 = require("../component-cypress-spec/component-cy
6
6
  const ast_utils_1 = require("../../utils/ast-utils");
7
7
  const devkit_1 = require("@nx/devkit");
8
8
  const path_1 = require("path");
9
- const minimatch = require("minimatch");
9
+ const minimatch_1 = require("minimatch");
10
10
  const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
11
11
  const versions_1 = require("../../utils/versions");
12
12
  let tsModule;
@@ -53,7 +53,7 @@ async function createAllStories(tree, projectName, interactionTests, js, project
53
53
  // Ignore private files starting with "_".
54
54
  if ((0, path_1.basename)(path).startsWith('_'))
55
55
  return;
56
- if (ignorePaths?.some((pattern) => minimatch(path, pattern)))
56
+ if (ignorePaths?.some((pattern) => (0, minimatch_1.minimatch)(path, pattern)))
57
57
  return;
58
58
  if ((path.endsWith('.tsx') && !path.endsWith('.spec.tsx')) ||
59
59
  (path.endsWith('.js') && !path.endsWith('.spec.js')) ||