@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 +7 -7
- package/src/generators/component/files/__fileName__.tsx__tmpl__ +1 -1
- package/src/generators/federate-module/schema.d.ts +1 -1
- package/src/generators/federate-module/schema.json +1 -1
- package/src/generators/hook/files/__fileName__.ts__tmpl__ +15 -15
- package/src/generators/host/schema.d.ts +1 -1
- package/src/generators/host/schema.json +1 -1
- package/src/generators/init/init.js +1 -1
- package/src/generators/init/schema.d.ts +1 -0
- package/src/generators/init/schema.json +6 -0
- package/src/generators/remote/schema.d.ts +1 -1
- package/src/generators/remote/schema.json +1 -1
- package/src/generators/stories/stories.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react",
|
|
3
|
-
"version": "17.3.0-beta.
|
|
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": "
|
|
38
|
+
"minimatch": "9.0.3",
|
|
39
39
|
"tslib": "^2.3.0",
|
|
40
|
-
"@nx/devkit": "17.3.0-beta.
|
|
41
|
-
"@nx/js": "17.3.0-beta.
|
|
42
|
-
"@nx/eslint": "17.3.0-beta.
|
|
43
|
-
"@nx/web": "17.3.0-beta.
|
|
44
|
-
"@nrwl/react": "17.3.0-beta.
|
|
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"
|
|
@@ -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;
|
|
@@ -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;
|
|
@@ -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);
|
|
@@ -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;
|
|
@@ -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
|
|
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')) ||
|