@nrwl/react 14.4.2 → 14.4.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/CHANGELOG.md +1 -1
- package/package.json +10 -10
- package/src/generators/application/lib/set-defaults.js +1 -1
- package/src/generators/application/lib/set-defaults.js.map +1 -1
- package/src/generators/application/schema.d.ts +1 -0
- package/src/generators/application/schema.json +5 -0
- package/src/generators/component-story/schema.json +2 -1
- package/src/generators/remote/remote.js +1 -1
- package/src/generators/remote/remote.js.map +1 -1
- package/src/generators/stories/schema.json +5 -4
- package/src/generators/storybook-configuration/schema.json +5 -2
- package/src/migrations/update-14-0-0/replace-testing-library-react-hook.js +2 -2
- package/src/migrations/update-14-0-0/replace-testing-library-react-hook.js.map +1 -1
- package/.eslintrc.json +0 -36
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [14.4.
|
|
6
|
+
## [14.4.3](https://github.com/nrwl/nx/compare/14.4.2...14.4.3) (2022-07-16)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/react
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/react",
|
|
3
|
-
"version": "14.4.
|
|
3
|
+
"version": "14.4.3",
|
|
4
4
|
"description": "The React plugin 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.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/core": "^7.15.0",
|
|
34
34
|
"@babel/preset-react": "^7.14.5",
|
|
35
|
-
"@nrwl/cypress": "14.4.
|
|
36
|
-
"@nrwl/devkit": "14.4.
|
|
37
|
-
"@nrwl/jest": "14.4.
|
|
38
|
-
"@nrwl/js": "14.4.
|
|
39
|
-
"@nrwl/linter": "14.4.
|
|
40
|
-
"@nrwl/storybook": "14.4.
|
|
41
|
-
"@nrwl/web": "14.4.
|
|
42
|
-
"@nrwl/workspace": "14.4.
|
|
35
|
+
"@nrwl/cypress": "14.4.3",
|
|
36
|
+
"@nrwl/devkit": "14.4.3",
|
|
37
|
+
"@nrwl/jest": "14.4.3",
|
|
38
|
+
"@nrwl/js": "14.4.3",
|
|
39
|
+
"@nrwl/linter": "14.4.3",
|
|
40
|
+
"@nrwl/storybook": "14.4.3",
|
|
41
|
+
"@nrwl/web": "14.4.3",
|
|
42
|
+
"@nrwl/workspace": "14.4.3",
|
|
43
43
|
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
|
|
44
44
|
"@storybook/node-logger": "6.1.20",
|
|
45
45
|
"@svgr/webpack": "^6.1.2",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"webpack": "^5.58.1",
|
|
55
55
|
"webpack-merge": "^5.8.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "9f7df39875d04baa2e8b8f8f12796dea6b38752a"
|
|
58
58
|
}
|
|
@@ -7,7 +7,7 @@ function setDefaults(host, options) {
|
|
|
7
7
|
return;
|
|
8
8
|
}
|
|
9
9
|
const workspace = (0, devkit_1.readWorkspaceConfiguration)(host);
|
|
10
|
-
if (!workspace.defaultProject) {
|
|
10
|
+
if (!options.skipDefaultProject && !workspace.defaultProject) {
|
|
11
11
|
workspace.defaultProject = options.projectName;
|
|
12
12
|
}
|
|
13
13
|
workspace.generators = workspace.generators || {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-defaults.js","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/set-defaults.ts"],"names":[],"mappings":";;;AAAA,yCAIsB;AAGtB,SAAgB,WAAW,CAAC,IAAU,EAAE,OAAyB;IAC/D,IAAI,OAAO,CAAC,iBAAiB,EAAE;QAC7B,OAAO;KACR;IAED,MAAM,SAAS,GAAG,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC;IAEnD,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;
|
|
1
|
+
{"version":3,"file":"set-defaults.js","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/application/lib/set-defaults.ts"],"names":[],"mappings":";;;AAAA,yCAIsB;AAGtB,SAAgB,WAAW,CAAC,IAAU,EAAE,OAAyB;IAC/D,IAAI,OAAO,CAAC,iBAAiB,EAAE;QAC7B,OAAO;KACR;IAED,MAAM,SAAS,GAAG,IAAA,mCAA0B,EAAC,IAAI,CAAC,CAAC;IAEnD,IAAI,CAAC,OAAO,CAAC,kBAAkB,IAAI,CAAC,SAAS,CAAC,cAAc,EAAE;QAC5D,SAAS,CAAC,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC;KAChD;IAED,SAAS,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,IAAI,EAAE,CAAC;IAClD,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC;QACjC,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;IAE5C,MAAM,IAAI,qBAAQ,SAAS,CAAC,UAAU,CAAC,aAAa,CAAC,CAAE,CAAC;IAExD,SAAS,CAAC,UAAU,mCACf,SAAS,CAAC,UAAU,KACvB,aAAa,kCACR,IAAI,KACP,WAAW,kBACT,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,MAAM,EAAE,OAAO,CAAC,MAAM,IACnB,IAAI,CAAC,WAAW,GAErB,SAAS,kBACP,KAAK,EAAE,OAAO,CAAC,KAAK,IACjB,IAAI,CAAC,SAAS,GAEnB,OAAO,kBACL,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,MAAM,EAAE,OAAO,CAAC,MAAM,IACnB,IAAI,CAAC,OAAO,OAGpB,CAAC;IAEF,IAAA,qCAA4B,EAAC,IAAI,EAAE,SAAS,CAAC,CAAC;AAChD,CAAC;AAvCD,kCAuCC"}
|
|
@@ -159,6 +159,11 @@
|
|
|
159
159
|
"description": "The compiler to use.",
|
|
160
160
|
"enum": ["babel", "swc"],
|
|
161
161
|
"default": "babel"
|
|
162
|
+
},
|
|
163
|
+
"skipDefaultProject": {
|
|
164
|
+
"description": "Skip setting the project as the default project. When `false` (the default), the project is set as the default project only if there is no default project already set.",
|
|
165
|
+
"type": "boolean",
|
|
166
|
+
"default": false
|
|
162
167
|
}
|
|
163
168
|
},
|
|
164
169
|
"required": []
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
"properties": {
|
|
9
9
|
"project": {
|
|
10
10
|
"type": "string",
|
|
11
|
-
"
|
|
11
|
+
"aliases": ["name", "projectName"],
|
|
12
|
+
"description": "The project where to add the components.",
|
|
12
13
|
"examples": ["shared-ui-component"],
|
|
13
14
|
"$default": {
|
|
14
15
|
"$source": "projectName",
|
|
@@ -17,7 +17,7 @@ exports.addModuleFederationFiles = addModuleFederationFiles;
|
|
|
17
17
|
function remoteGenerator(host, schema) {
|
|
18
18
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
19
|
const options = (0, normalize_options_1.normalizeOptions)(host, schema);
|
|
20
|
-
const initApp = yield (0, application_1.default)(host, options);
|
|
20
|
+
const initApp = yield (0, application_1.default)(host, Object.assign(Object.assign({}, options), { skipDefaultProject: true }));
|
|
21
21
|
if (schema.host) {
|
|
22
22
|
(0, update_host_with_remote_1.updateHostWithRemote)(host, schema.host, options.name);
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/remote/remote.ts"],"names":[],"mappings":";;;;AAAA,+BAA4B;AAC5B,yCAAuE;AACvE,2FAAqF;AAErF,4EAAwE;AACxE,4DAA8D;AAE9D,2EAAqE;AACrE,mGAA6F;AAG7F,SAAgB,wBAAwB,CACtC,IAAU,EACV,OAAyB;IAEzB,MAAM,iBAAiB,iDAClB,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,GACnB,OAAO,KACV,IAAI,EAAE,EAAE,GACT,CAAC;IAEF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,WAAI,EAAC,SAAS,EAAE,2BAA2B,CAAC,EAC5C,OAAO,CAAC,cAAc,EACtB,iBAAiB,CAClB,CAAC;AACJ,CAAC;AAhBD,4DAgBC;AAED,SAAsB,eAAe,CAAC,IAAU,EAAE,MAAc;;QAC9D,MAAM,OAAO,GAAG,IAAA,oCAAgB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG,MAAM,IAAA,qBAAoB,EAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"remote.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/remote/remote.ts"],"names":[],"mappings":";;;;AAAA,+BAA4B;AAC5B,yCAAuE;AACvE,2FAAqF;AAErF,4EAAwE;AACxE,4DAA8D;AAE9D,2EAAqE;AACrE,mGAA6F;AAG7F,SAAgB,wBAAwB,CACtC,IAAU,EACV,OAAyB;IAEzB,MAAM,iBAAiB,iDAClB,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,GACnB,OAAO,KACV,IAAI,EAAE,EAAE,GACT,CAAC;IAEF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,WAAI,EAAC,SAAS,EAAE,2BAA2B,CAAC,EAC5C,OAAO,CAAC,cAAc,EACtB,iBAAiB,CAClB,CAAC;AACJ,CAAC;AAhBD,4DAgBC;AAED,SAAsB,eAAe,CAAC,IAAU,EAAE,MAAc;;QAC9D,MAAM,OAAO,GAAG,IAAA,oCAAgB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/C,MAAM,OAAO,GAAG,MAAM,IAAA,qBAAoB,EAAC,IAAI,kCAC1C,OAAO,KACV,kBAAkB,EAAE,IAAI,IACxB,CAAC;QAEH,IAAI,MAAM,CAAC,IAAI,EAAE;YACf,IAAA,8CAAoB,EAAC,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;SACvD;QAED,wEAAwE;QACxE,sEAAsE;QACtE,kBAAkB;QAClB,IAAI,CAAC,MAAM,CACT,IAAA,WAAI,EAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAC5C,IAAA,WAAI,EAAC,OAAO,CAAC,cAAc,EAAE,mBAAmB,CAAC,CAClD,CAAC;QAEF,wBAAwB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACxC,IAAA,gEAA6B,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE7C,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAA,sCAAgB,EAAC,OAAO,CAAC,CAAC;IACnC,CAAC;CAAA;AA3BD,0CA2BC;AAED,kBAAe,eAAe,CAAC"}
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/schema",
|
|
3
3
|
"cli": "nx",
|
|
4
4
|
"$id": "NxReactStorybookStories",
|
|
5
|
-
"title": "
|
|
6
|
-
"description": "
|
|
5
|
+
"title": "Generate React Storybook stories",
|
|
6
|
+
"description": "Generate stories/specs for all components declared in a project.",
|
|
7
7
|
"type": "object",
|
|
8
8
|
"properties": {
|
|
9
9
|
"project": {
|
|
10
10
|
"type": "string",
|
|
11
|
-
"
|
|
11
|
+
"aliases": ["name", "projectName"],
|
|
12
|
+
"description": "Project for which to generate stories.",
|
|
12
13
|
"$default": {
|
|
13
14
|
"$source": "projectName",
|
|
14
15
|
"index": 0
|
|
15
16
|
},
|
|
16
|
-
"x-prompt": "
|
|
17
|
+
"x-prompt": "For which project do you want to generate stories?"
|
|
17
18
|
},
|
|
18
19
|
"generateCypressSpecs": {
|
|
19
20
|
"type": "boolean",
|
|
@@ -8,11 +8,14 @@
|
|
|
8
8
|
"properties": {
|
|
9
9
|
"name": {
|
|
10
10
|
"type": "string",
|
|
11
|
-
"
|
|
11
|
+
"aliases": ["project", "projectName"],
|
|
12
|
+
"description": "Project for which to generate Storybook configuration.",
|
|
12
13
|
"$default": {
|
|
13
14
|
"$source": "argv",
|
|
14
15
|
"index": 0
|
|
15
|
-
}
|
|
16
|
+
},
|
|
17
|
+
"x-prompt": "For which project do you want to generate Storybook configuration?",
|
|
18
|
+
"x-dropdown": "projects"
|
|
16
19
|
},
|
|
17
20
|
"configureCypress": {
|
|
18
21
|
"type": "boolean",
|
|
@@ -14,8 +14,8 @@ function update(tree) {
|
|
|
14
14
|
if (!file.endsWith('.spec.ts'))
|
|
15
15
|
return;
|
|
16
16
|
const content = tree.read(file).toString();
|
|
17
|
-
if (content.includes('@testing-library/react-
|
|
18
|
-
tree.write(file, content.replace(/@testing-library\/react-
|
|
17
|
+
if (content.includes('@testing-library/react-hooks')) {
|
|
18
|
+
tree.write(file, content.replace(/@testing-library\/react-hooks/g, '@testing-library/react'));
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replace-testing-library-react-hook.js","sourceRoot":"","sources":["../../../../../../packages/react/src/migrations/update-14-0-0/replace-testing-library-react-hook.ts"],"names":[],"mappings":";;;;AAAA,yCAKsB;AAEtB,SAAsB,MAAM,CAAC,IAAU;;QACrC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;;YAC1B,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,IAAI,0CAAE,QAAQ,MAAK,iBAAiB;gBAAE,OAAO;YAEjE,IAAA,6BAAoB,EAAC,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE;gBACrD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;oBAAE,OAAO;gBAEvC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAC3C,IAAI,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"replace-testing-library-react-hook.js","sourceRoot":"","sources":["../../../../../../packages/react/src/migrations/update-14-0-0/replace-testing-library-react-hook.ts"],"names":[],"mappings":";;;;AAAA,yCAKsB;AAEtB,SAAsB,MAAM,CAAC,IAAU;;QACrC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACnC,QAAQ,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;;YAC1B,IAAI,CAAA,MAAA,MAAA,MAAM,CAAC,OAAO,0CAAE,IAAI,0CAAE,QAAQ,MAAK,iBAAiB;gBAAE,OAAO;YAEjE,IAAA,6BAAoB,EAAC,IAAI,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE;gBACrD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC;oBAAE,OAAO;gBAEvC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;gBAC3C,IAAI,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAAC,EAAE;oBACpD,IAAI,CAAC,KAAK,CACR,IAAI,EACJ,OAAO,CAAC,OAAO,CACb,gCAAgC,EAChC,wBAAwB,CACzB,CACF,CAAC;iBACH;YACH,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,IAAA,0CAAiC,EAC/B,IAAI,EACJ,CAAC,8BAA8B,CAAC,EAChC,CAAC,8BAA8B,CAAC,CACjC,CAAC;IACJ,CAAC;CAAA;AA1BD,wBA0BC;AAED,kBAAe,MAAM,CAAC"}
|
package/.eslintrc.json
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../.eslintrc",
|
|
3
|
-
"rules": {},
|
|
4
|
-
"overrides": [
|
|
5
|
-
{
|
|
6
|
-
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
|
|
7
|
-
"rules": {}
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
"files": ["**/*.ts"],
|
|
11
|
-
"excludedFiles": ["./src/migrations/**"],
|
|
12
|
-
"rules": {
|
|
13
|
-
"no-restricted-imports": [
|
|
14
|
-
"error",
|
|
15
|
-
"@nrwl/workspace",
|
|
16
|
-
"@angular-devkit/core",
|
|
17
|
-
"@angular-devkit/schematics",
|
|
18
|
-
"@angular-devkit/architect"
|
|
19
|
-
]
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"files": [
|
|
24
|
-
"./package.json",
|
|
25
|
-
"./generators.json",
|
|
26
|
-
"./executors.json",
|
|
27
|
-
"./migrations.json"
|
|
28
|
-
],
|
|
29
|
-
"parser": "jsonc-eslint-parser",
|
|
30
|
-
"rules": {
|
|
31
|
-
"@nrwl/nx/nx-plugin-checks": "error"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
],
|
|
35
|
-
"ignorePatterns": ["!**/*"]
|
|
36
|
-
}
|