@nx/react 17.0.0-rc.1 → 17.0.0-rc.2
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.0-rc.
|
|
3
|
+
"version": "17.0.0-rc.2",
|
|
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.0-rc.
|
|
41
|
-
"@nx/js": "17.0.0-rc.
|
|
42
|
-
"@nx/eslint": "17.0.0-rc.
|
|
43
|
-
"@nx/web": "17.0.0-rc.
|
|
44
|
-
"@nrwl/react": "17.0.0-rc.
|
|
40
|
+
"@nx/devkit": "17.0.0-rc.2",
|
|
41
|
+
"@nx/js": "17.0.0-rc.2",
|
|
42
|
+
"@nx/eslint": "17.0.0-rc.2",
|
|
43
|
+
"@nx/web": "17.0.0-rc.2",
|
|
44
|
+
"@nrwl/react": "17.0.0-rc.2"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
@@ -16,16 +16,12 @@ async function federateModuleGenerator(tree, schema) {
|
|
|
16
16
|
const tasks = [];
|
|
17
17
|
// Check remote exists
|
|
18
18
|
const remote = (0, utils_1.checkRemoteExists)(tree, schema.remote);
|
|
19
|
-
|
|
20
|
-
name: schema.remote,
|
|
21
|
-
projectType: 'application',
|
|
22
|
-
projectNameAndRootFormat: schema.projectNameAndRootFormat,
|
|
23
|
-
callingGenerator: '@nx/react:federate-module',
|
|
24
|
-
});
|
|
19
|
+
let projectRoot, remoteName;
|
|
25
20
|
if (!remote) {
|
|
26
21
|
// create remote
|
|
27
22
|
const remoteGenerator = await (0, remote_1.remoteGeneratorInternal)(tree, {
|
|
28
23
|
name: schema.remote,
|
|
24
|
+
directory: schema.remoteDirectory,
|
|
29
25
|
e2eTestRunner: schema.e2eTestRunner,
|
|
30
26
|
skipFormat: schema.skipFormat,
|
|
31
27
|
linter: schema.linter,
|
|
@@ -35,9 +31,20 @@ async function federateModuleGenerator(tree, schema) {
|
|
|
35
31
|
projectNameAndRootFormat: schema.projectNameAndRootFormat ?? 'derived',
|
|
36
32
|
});
|
|
37
33
|
tasks.push(remoteGenerator);
|
|
34
|
+
const { projectName, projectRoot: remoteRoot } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
|
|
35
|
+
name: schema.remote,
|
|
36
|
+
directory: schema.remoteDirectory,
|
|
37
|
+
projectType: 'application',
|
|
38
|
+
projectNameAndRootFormat: schema.projectNameAndRootFormat ?? 'derived',
|
|
39
|
+
callingGenerator: '@nx/react:federate-module',
|
|
40
|
+
});
|
|
41
|
+
projectRoot = remoteRoot;
|
|
42
|
+
remoteName = projectName;
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
projectRoot = remote.root;
|
|
46
|
+
remoteName = remote.name;
|
|
38
47
|
}
|
|
39
|
-
const projectRoot = remote ? remote.root : remoteRoot;
|
|
40
|
-
const remoteName = remote ? remote.name : projectName;
|
|
41
48
|
// add path to exposes property
|
|
42
49
|
(0, utils_1.addPathToExposes)(tree, projectRoot, schema.name, schema.path);
|
|
43
50
|
// Add new path to tsconfig
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description": "Create a federated module, which can be loaded by a remote host.",
|
|
7
7
|
"examples": [
|
|
8
8
|
{
|
|
9
|
-
"command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=my-remote-app",
|
|
9
|
+
"command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=my-remote-app --remoteDirectory=apps/my-remote-app",
|
|
10
10
|
"description": "Create a federated module from my-remote-app, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
|
|
11
11
|
}
|
|
12
12
|
],
|
|
@@ -33,6 +33,10 @@
|
|
|
33
33
|
"description": "The name of the remote.",
|
|
34
34
|
"x-prompt": "What is/should the remote be named?"
|
|
35
35
|
},
|
|
36
|
+
"remoteDirectory": {
|
|
37
|
+
"description": "The directory of the new remote application if one needs to be created.",
|
|
38
|
+
"type": "string"
|
|
39
|
+
},
|
|
36
40
|
"projectNameAndRootFormat": {
|
|
37
41
|
"description": "Whether to generate the project name and root directory as provided (`as-provided`) or generate them composing their values and taking the configured layout into account (`derived`).",
|
|
38
42
|
"type": "string",
|
|
@@ -41,46 +45,8 @@
|
|
|
41
45
|
"style": {
|
|
42
46
|
"description": "The file extension to be used for style files.",
|
|
43
47
|
"type": "string",
|
|
44
|
-
"default": "
|
|
45
|
-
"alias": "s"
|
|
46
|
-
"x-prompt": {
|
|
47
|
-
"message": "Which stylesheet format would you like to use?",
|
|
48
|
-
"type": "list",
|
|
49
|
-
"items": [
|
|
50
|
-
{
|
|
51
|
-
"value": "css",
|
|
52
|
-
"label": "CSS"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"value": "scss",
|
|
56
|
-
"label": "SASS(.scss) [ http://sass-lang.com ]"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"value": "less",
|
|
60
|
-
"label": "LESS [ http://lesscss.org ]"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"value": "styled-components",
|
|
64
|
-
"label": "styled-components [ https://styled-components.com ]"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"value": "@emotion/styled",
|
|
68
|
-
"label": "emotion [ https://emotion.sh ]"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"value": "styled-jsx",
|
|
72
|
-
"label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"value": "styl",
|
|
76
|
-
"label": "DEPRECATD: Stylus(.styl) [ http://stylus-lang.com ]"
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
"value": "none",
|
|
80
|
-
"label": "None"
|
|
81
|
-
}
|
|
82
|
-
]
|
|
83
|
-
}
|
|
48
|
+
"default": "none",
|
|
49
|
+
"alias": "s"
|
|
84
50
|
},
|
|
85
51
|
"linter": {
|
|
86
52
|
"description": "The tool to use for running lint checks.",
|