@nrwl/react 13.9.3 → 13.10.0-beta.1

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": "@nrwl/react",
3
- "version": "13.9.3",
3
+ "version": "13.10.0-beta.1",
4
4
  "description": "React Plugin for Nx",
5
5
  "repository": {
6
6
  "type": "git",
@@ -31,14 +31,14 @@
31
31
  "dependencies": {
32
32
  "@babel/core": "^7.15.0",
33
33
  "@babel/preset-react": "^7.14.5",
34
- "@nrwl/cypress": "13.9.3",
35
- "@nrwl/devkit": "13.9.3",
36
- "@nrwl/jest": "13.9.3",
37
- "@nrwl/js": "13.9.3",
38
- "@nrwl/linter": "13.9.3",
39
- "@nrwl/storybook": "13.9.3",
40
- "@nrwl/web": "13.9.3",
41
- "@nrwl/workspace": "13.9.3",
34
+ "@nrwl/cypress": "13.10.0-beta.1",
35
+ "@nrwl/devkit": "13.10.0-beta.1",
36
+ "@nrwl/jest": "13.10.0-beta.1",
37
+ "@nrwl/js": "13.10.0-beta.1",
38
+ "@nrwl/linter": "13.10.0-beta.1",
39
+ "@nrwl/storybook": "13.10.0-beta.1",
40
+ "@nrwl/web": "13.10.0-beta.1",
41
+ "@nrwl/workspace": "13.10.0-beta.1",
42
42
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.1",
43
43
  "@svgr/webpack": "^6.1.2",
44
44
  "chalk": "4.1.0",
@@ -32,7 +32,7 @@ const babelDefault = () => {
32
32
  exports.babelDefault = babelDefault;
33
33
  const core = (prev, options) => (Object.assign(Object.assign({}, prev), { disableWebpackDefaults: true }));
34
34
  exports.core = core;
35
- const webpack = (storybookWebpackConfig = {}, options) => (0, tslib_1.__awaiter)(void 0, void 0, void 0, function* () {
35
+ const webpack = (storybookWebpackConfig = {}, options) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
36
36
  var _a, _b, _c, _d, _e;
37
37
  node_logger_1.logger.info('=> Loading Nrwl React Storybook preset from "@nrwl/react/plugins/storybook"');
38
38
  const tsconfigPath = (0, path_1.join)(options.configDir, 'tsconfig.json');
@@ -19,7 +19,7 @@ const linter_1 = require("@nrwl/linter");
19
19
  const versions_1 = require("@nrwl/js/src/utils/versions");
20
20
  const versions_2 = require("@nrwl/web/src/utils/versions");
21
21
  function addLinting(host, options) {
22
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
22
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
23
23
  const tasks = [];
24
24
  const lintTask = yield (0, linter_1.lintProjectGenerator)(host, {
25
25
  linter: options.linter,
@@ -41,7 +41,7 @@ function addLinting(host, options) {
41
41
  });
42
42
  }
43
43
  function applicationGenerator(host, schema) {
44
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
44
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
45
45
  const options = (0, normalize_options_1.normalizeOptions)(host, schema);
46
46
  const initTask = yield (0, init_1.default)(host, Object.assign(Object.assign({}, options), { skipFormat: true }));
47
47
  (0, create_application_files_1.createApplicationFiles)(host, options);
@@ -4,7 +4,7 @@ exports.addCypress = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const cypress_1 = require("@nrwl/cypress");
6
6
  function addCypress(host, options) {
7
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
8
  if (options.e2eTestRunner !== 'cypress') {
9
9
  return () => { };
10
10
  }
@@ -4,7 +4,7 @@ exports.addJest = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const jest_1 = require("@nrwl/jest");
6
6
  function addJest(host, options) {
7
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
8
  if (options.unitTestRunner !== 'jest') {
9
9
  return () => { };
10
10
  }
@@ -10,7 +10,7 @@ const devkit_1 = require("@nrwl/devkit");
10
10
  const run_tasks_in_serial_1 = require("@nrwl/workspace/src/utilities/run-tasks-in-serial");
11
11
  const ast_utils_1 = require("../../utils/ast-utils");
12
12
  function componentGenerator(host, schema) {
13
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
13
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
14
  const options = yield normalizeOptions(host, schema);
15
15
  createComponentFiles(host, options);
16
16
  const tasks = [];
@@ -68,7 +68,7 @@ function addExportsToBarrel(host, options) {
68
68
  }
69
69
  function normalizeOptions(host, options) {
70
70
  var _a, _b, _c, _d;
71
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
71
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
72
72
  assertValidOptions(options);
73
73
  const { className, fileName } = (0, devkit_1.names)(options.name);
74
74
  const componentFileName = (_a = options.fileName) !== null && _a !== void 0 ? _a : (options.pascalCaseFiles ? className : fileName);
@@ -93,7 +93,7 @@ function normalizeOptions(host, options) {
93
93
  });
94
94
  }
95
95
  function getDirectory(host, options) {
96
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
96
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
97
97
  const genNames = (0, devkit_1.names)(options.name);
98
98
  const fileName = options.pascalCaseDirectory === true
99
99
  ? genNames.className
@@ -84,7 +84,7 @@ function createComponentStoriesFile(host, { project, componentPath }) {
84
84
  }
85
85
  exports.createComponentStoriesFile = createComponentStoriesFile;
86
86
  function componentStoryGenerator(host, schema) {
87
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
87
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
88
88
  createComponentStoriesFile(host, schema);
89
89
  yield (0, devkit_1.formatFiles)(host);
90
90
  });
@@ -6,7 +6,7 @@ const ts = require("typescript");
6
6
  const devkit_1 = require("@nrwl/devkit");
7
7
  const ast_utils_1 = require("../../utils/ast-utils");
8
8
  function hookGenerator(host, schema) {
9
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
9
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
10
  const options = yield normalizeOptions(host, schema);
11
11
  createFiles(host, options);
12
12
  addExportsToBarrel(host, options);
@@ -44,7 +44,7 @@ function addExportsToBarrel(host, options) {
44
44
  }
45
45
  }
46
46
  function normalizeOptions(host, options) {
47
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
47
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
48
48
  assertValidOptions(options);
49
49
  let base = options.name;
50
50
  if (base.startsWith('use-')) {
@@ -75,7 +75,7 @@ function normalizeOptions(host, options) {
75
75
  });
76
76
  }
77
77
  function getDirectory(host, options, baseHookName) {
78
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
78
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
79
79
  const { className, fileName } = (0, devkit_1.names)(baseHookName);
80
80
  const hookFileName = options.pascalCaseDirectory === true
81
81
  ? 'use'.concat(className)
@@ -40,7 +40,7 @@ function updateDependencies(host) {
40
40
  });
41
41
  }
42
42
  function reactInitGenerator(host, schema) {
43
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
43
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
44
44
  const tasks = [];
45
45
  setDefault(host);
46
46
  if (!schema.unitTestRunner || schema.unitTestRunner === 'jest') {
@@ -16,7 +16,7 @@ const versions_2 = require("../../utils/versions");
16
16
  const component_1 = require("../component/component");
17
17
  const init_1 = require("../init/init");
18
18
  function libraryGenerator(host, schema) {
19
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
19
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
20
  const tasks = [];
21
21
  const options = normalizeOptions(host, schema);
22
22
  if (options.publishable === true && !schema.importPath) {
@@ -76,7 +76,7 @@ function libraryGenerator(host, schema) {
76
76
  }
77
77
  exports.libraryGenerator = libraryGenerator;
78
78
  function addLinting(host, options) {
79
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
79
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
80
80
  const lintTask = yield (0, linter_1.lintProjectGenerator)(host, {
81
81
  linter: options.linter,
82
82
  project: options.name,
@@ -9,7 +9,7 @@ const versions_1 = require("../../utils/versions");
9
9
  const devkit_1 = require("@nrwl/devkit");
10
10
  const typescript_1 = require("@nrwl/workspace/src/utilities/typescript");
11
11
  function reduxGenerator(host, schema) {
12
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
12
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
13
13
  const options = normalizeOptions(host, schema);
14
14
  generateReduxFiles(host, options);
15
15
  addExportsToBarrel(host, options);
@@ -30,7 +30,7 @@ function containsComponentDeclaration(tree, componentPath) {
30
30
  return !!(0, ast_utils_1.getComponentName)(sourceFile);
31
31
  }
32
32
  function createAllStories(tree, projectName, generateCypressSpecs, js, cypressProject) {
33
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
33
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
34
34
  const projects = (0, devkit_1.getProjects)(tree);
35
35
  const project = projects.get(projectName);
36
36
  const { sourceRoot, projectType } = project;
@@ -53,7 +53,7 @@ function createAllStories(tree, projectName, generateCypressSpecs, js, cypressPr
53
53
  if (generateCypressSpecs && !e2eProject) {
54
54
  devkit_1.logger.info(`There was no e2e project "${e2eProjectName}" found, so cypress specs will not be generated. Pass "--cypressProject" to specify a different e2e project name`);
55
55
  }
56
- yield Promise.all(componentPaths.map((componentPath) => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
56
+ yield Promise.all(componentPaths.map((componentPath) => tslib_1.__awaiter(this, void 0, void 0, function* () {
57
57
  const relativeCmpDir = componentPath.replace((0, path_1.join)(sourceRoot, '/'), '');
58
58
  if (!containsComponentDeclaration(tree, componentPath)) {
59
59
  return;
@@ -75,7 +75,7 @@ function createAllStories(tree, projectName, generateCypressSpecs, js, cypressPr
75
75
  }
76
76
  exports.createAllStories = createAllStories;
77
77
  function storiesGenerator(host, schema) {
78
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
78
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
79
79
  yield createAllStories(host, schema.project, schema.generateCypressSpecs, schema.js, schema.cypressProject);
80
80
  });
81
81
  }
@@ -7,7 +7,7 @@ const devkit_1 = require("@nrwl/devkit");
7
7
  const storybook_1 = require("@nrwl/storybook");
8
8
  const project_name_1 = require("@nrwl/cypress/src/utils/project-name");
9
9
  function generateStories(host, schema) {
10
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
10
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
11
  const libConfig = (0, devkit_1.readProjectConfiguration)(host, schema.name);
12
12
  const libRoot = libConfig.root;
13
13
  const cypressProject = (0, project_name_1.getE2eProjectName)(schema.name, libRoot, schema.cypressDirectory);
@@ -20,7 +20,7 @@ function generateStories(host, schema) {
20
20
  });
21
21
  }
22
22
  function storybookConfigurationGenerator(host, schema) {
23
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
23
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
24
  const installTask = yield (0, storybook_1.configurationGenerator)(host, {
25
25
  name: schema.name,
26
26
  uiFramework: '@storybook/react',
@@ -4,7 +4,7 @@ exports.removeReactReduxTypesFromPackageJson = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nrwl/devkit");
6
6
  function removeReactReduxTypesFromPackageJson(host) {
7
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
8
  return (0, devkit_1.removeDependenciesFromPackageJson)(host, ['@types/react-redux'], ['@types/react-redux']);
9
9
  });
10
10
  }
@@ -4,7 +4,7 @@ exports.updateEmotionSetup = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nrwl/devkit");
6
6
  function updateEmotionSetup(host) {
7
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
8
  const projects = (0, devkit_1.getProjects)(host);
9
9
  projects.forEach((p) => {
10
10
  const babelrcPath = `${p.root}/.babelrc`;
@@ -4,7 +4,7 @@ exports.useReactJsxInTsconfig = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nrwl/devkit");
6
6
  function useReactJsxInTsconfig(host) {
7
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
8
  const projects = (0, devkit_1.getProjects)(host);
9
9
  projects.forEach((p) => {
10
10
  const tsConfigPath = `${p.root}/tsconfig.json`;
@@ -4,7 +4,7 @@ exports.removeReactReduxTypesFromPackageJson = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nrwl/devkit");
6
6
  function removeReactReduxTypesFromPackageJson(host) {
7
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
8
  return (0, devkit_1.addDependenciesToPackageJson)(host, {}, {
9
9
  '@testing-library/react-hooks': '^7.0.1',
10
10
  });
@@ -6,7 +6,7 @@ const devkit_1 = require("@nrwl/devkit");
6
6
  const webpack5_changes_utils_1 = require("./webpack5-changes-utils");
7
7
  let needsInstall = false;
8
8
  function migrateStorybookToWebPack5(tree) {
9
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
9
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
10
  const packageJson = (0, devkit_1.readJson)(tree, 'package.json');
11
11
  if ((0, webpack5_changes_utils_1.workspaceHasStorybookForReact)(packageJson)) {
12
12
  (0, devkit_1.updateJson)(tree, 'package.json', (json) => {
@@ -4,7 +4,7 @@ exports.updateEmotionSetup = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nrwl/devkit");
6
6
  function updateEmotionSetup(host) {
7
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
7
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
8
8
  const projects = (0, devkit_1.getProjects)(host);
9
9
  projects.forEach((p) => {
10
10
  let hasEmotion = false;
@@ -7,7 +7,7 @@ const devkit_2 = require("@nrwl/devkit");
7
7
  const ts = require("typescript");
8
8
  const find_nodes_1 = require("@nrwl/workspace/src/utilities/typescript/find-nodes");
9
9
  function migrateToWebPack5(tree) {
10
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
10
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
11
  allReactProjectsWithStorybookConfiguration(tree).forEach((project) => {
12
12
  let storybookConfigFile = `${project.storybookConfigPath}/main.js`;
13
13
  if (!tree.exists(storybookConfigFile)) {
@@ -15,7 +15,7 @@ let addedEmotionPreset = false;
15
15
  * - For any projects that are not migrated, display a message so users are not surprised.
16
16
  */
17
17
  function update() {
18
- return (host, context) => (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
18
+ return (host, context) => tslib_1.__awaiter(this, void 0, void 0, function* () {
19
19
  const updates = [];
20
20
  const conflicts = [];
21
21
  const projectGraph = yield (0, project_graph_1.createProjectGraphAsync)();
@@ -6,7 +6,7 @@ const devkit_1 = require("@nrwl/devkit");
6
6
  const application_1 = require("../generators/application/application");
7
7
  const linter_1 = require("@nrwl/linter");
8
8
  function createApp(tree, appName, standaloneConfig) {
9
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
9
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
10
  yield (0, application_1.default)(tree, {
11
11
  e2eTestRunner: 'none',
12
12
  linter: linter_1.Linter.EsLint,
@@ -20,7 +20,7 @@ function createApp(tree, appName, standaloneConfig) {
20
20
  }
21
21
  exports.createApp = createApp;
22
22
  function createLib(tree, libName, standaloneConfig) {
23
- return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
23
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
24
  const { fileName } = (0, devkit_1.names)(libName);
25
25
  tree.write(`/libs/${fileName}/src/index.ts`, `import React from 'react';\n`);
26
26
  (0, devkit_1.addProjectConfiguration)(tree, fileName, {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.babelPluginStyledComponentsVersion = exports.eslintPluginReactHooksVersion = exports.eslintPluginReactVersion = exports.eslintPluginJsxA11yVersion = exports.eslintPluginImportVersion = exports.reactTestRendererVersion = exports.reactReduxVersion = exports.reduxjsToolkitVersion = exports.testingLibraryReactHooksVersion = exports.testingLibraryReactVersion = exports.typesReactRouterDomVersion = exports.reactRouterDomVersion = exports.styledJsxVersion = exports.emotionBabelPlugin = exports.emotionReactVersion = exports.emotionStyledVersion = exports.typesStyledComponentsVersion = exports.styledComponentsVersion = exports.typesReactIsVersion = exports.typesReactDomVersion = exports.typesReactVersion = exports.reactIsVersion = exports.reactDomVersion = exports.reactVersion = exports.nxVersion = void 0;
4
- exports.nxVersion = '13.9.3';
4
+ exports.nxVersion = '13.10.0-beta.1';
5
5
  exports.reactVersion = '17.0.2';
6
6
  exports.reactDomVersion = '17.0.2';
7
7
  exports.reactIsVersion = '17.0.2';