@nrwl/react-native 15.5.3 → 15.6.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/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
- ## [15.5.3](https://github.com/nrwl/nx/compare/15.5.2...15.5.3) (2023-01-20)
6
+ # [15.6.0-beta.1](https://github.com/nrwl/nx/compare/15.5.1...15.6.0-beta.1) (2023-01-23)
7
7
 
8
8
  **Note:** Version bump only for package @nrwl/react-native
package/README.md CHANGED
@@ -43,38 +43,18 @@ npm init nx-workspace
43
43
  yarn create nx-workspace
44
44
  ```
45
45
 
46
- The `create-nx-workspace` command will ask you to select a preset, which will configure some plugins and create your applications to help you get started.
47
-
48
- ```
49
- ? What to create in the new workspace (Use arrow keys)
50
- ❯ apps [an empty workspace with no plugins with a layout that works best for building apps]
51
- core [an empty workspace with no plugins set up to publish npm packages (similar to yarn workspaces)]
52
- ts [an empty workspace with the JS/TS plugin preinstalled]
53
- react [a workspace with a single React application]
54
- angular [a workspace with a single Angular application]
55
- next.js [a workspace with a single Next.js application]
56
- nest [a workspace with a single Nest application]
57
- express [a workspace with a single Express application]
58
- web components [a workspace with a single app built using web components]
59
- react-native [a workspace with a single React Native application]
60
- ```
61
-
62
- Select the preset that works best for you
63
-
64
- ### Adding Nx to an Existing Monorepo
46
+ ### Adding Nx to an Existing Repository
65
47
 
66
48
  Run:
67
49
 
68
50
  ```bash
69
- npx add-nx-to-monorepo@latest
51
+ npx nx@latest init
70
52
  ```
71
53
 
72
54
  ## Documentation & Resources
73
55
 
74
- A few links to help you get started:
75
-
76
- - [Nx.Dev: Documentation, Guides, Interactive Tutorials](https://nx.dev)
77
- - [Tutorial: Adding Nx to an Existing Monorepo](/recipes/adopting-nx/adding-to-monorepo)
56
+ - [Nx.Dev: Documentation, Guides, Tutorials](https://nx.dev)
57
+ - [Intro to Nx](https://nx.dev/getting-started/intro)
78
58
  - [Official Nx YouTube Channel](https://www.youtube.com/c/Nrwl_io)
79
59
  - [Blog Posts About Nx](https://blog.nrwl.io/nx/home)
80
60
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrwl/react-native",
3
- "version": "15.5.3",
3
+ "version": "15.6.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides: \n\n-Integration with libraries such as Jest, Detox, and Storybook.\n-Scaffolding for creating buildable libraries that can be published to npm.\n-Utilities for automatic workspace refactoring.",
6
6
  "keywords": [
@@ -25,13 +25,13 @@
25
25
  "main": "index.js",
26
26
  "types": "index.d.ts",
27
27
  "dependencies": {
28
- "@nrwl/detox": "15.5.3",
29
- "@nrwl/devkit": "15.5.3",
30
- "@nrwl/jest": "15.5.3",
31
- "@nrwl/js": "15.5.3",
32
- "@nrwl/linter": "15.5.3",
33
- "@nrwl/react": "15.5.3",
34
- "@nrwl/workspace": "15.5.3",
28
+ "@nrwl/detox": "15.6.0-beta.1",
29
+ "@nrwl/devkit": "15.6.0-beta.1",
30
+ "@nrwl/jest": "15.6.0-beta.1",
31
+ "@nrwl/js": "15.6.0-beta.1",
32
+ "@nrwl/linter": "15.6.0-beta.1",
33
+ "@nrwl/react": "15.6.0-beta.1",
34
+ "@nrwl/workspace": "15.6.0-beta.1",
35
35
  "chalk": "^4.1.0",
36
36
  "enhanced-resolve": "^5.8.3",
37
37
  "fs-extra": "^11.1.0",
@@ -53,5 +53,5 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
- "gitHead": "7285ee50fca7136f38ce159ef3ed2977b8e7816a"
56
+ "gitHead": "b424d0c4f2c93177b1aff808f8b269c1b55f2d06"
57
57
  }
@@ -1,9 +1,9 @@
1
1
  import { configure, getStorybookUI } from '@storybook/react-native';
2
2
 
3
- import { loadStories } from '../../../../.storybook/story-loader';
3
+ import { loadStories } from '<%= offsetFromRoot %>../.storybook/story-loader';
4
4
 
5
- configure(loadStories(), module, false);
5
+ configure(() => loadStories(), module);
6
6
 
7
- const StorybookUIRoot = getStorybookUI({});
7
+ const StorybookUIRoot = getStorybookUI();
8
8
 
9
- export default StorybookUIRoot;
9
+ export default StorybookUIRoot;
@@ -9,29 +9,28 @@ const chalk = require("chalk");
9
9
  * This function generate ./storybook under project root.
10
10
  */
11
11
  function createStorybookFiles(host, schema) {
12
- var _a;
12
+ var _a, _b;
13
13
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
14
  const { root, projectType, targets, sourceRoot } = (0, devkit_1.readProjectConfiguration)(host, schema.name);
15
15
  // do not proceed if not a react native project
16
- if (((_a = targets === null || targets === void 0 ? void 0 : targets.start) === null || _a === void 0 ? void 0 : _a.executor) !== '@nrwl/react-native:start') {
16
+ if (((_a = targets === null || targets === void 0 ? void 0 : targets.start) === null || _a === void 0 ? void 0 : _a.executor) !== '@nrwl/react-native:start' &&
17
+ ((_b = targets === null || targets === void 0 ? void 0 : targets.start) === null || _b === void 0 ? void 0 : _b.executor) !== '@nrwl/expo:start') {
18
+ devkit_1.logger.error(`Unable to add storybook to ${schema.name}. It is not a Nx React Native / Expo project.`);
17
19
  return;
18
20
  }
19
21
  const storybookUIFileName = schema.js ? 'storybook.js' : 'storybook.ts';
20
22
  const storybookUIFilePath = (0, path_1.join)(root, `./${storybookUIFileName}`);
21
23
  if (host.exists(storybookUIFilePath)) {
22
- devkit_1.logger.warn(`${storybookUIFileName} file already exists for React Native ${projectType} ${schema.name}! Skipping generating this file.`);
24
+ devkit_1.logger.warn(`${storybookUIFileName} file already exists for ${projectType} ${schema.name}! Skipping generating this file.`);
23
25
  return;
24
26
  }
25
27
  if (projectType !== 'application') {
26
28
  devkit_1.logger.info(`${chalk.bold.cyan('info')} To see your Storybook stories on the device, you should start your mobile app for the <platform> of your choice (typically ios or android).`);
27
29
  }
28
- const projectDirectory = projectType === 'application' ? 'app' : 'lib';
29
- devkit_1.logger.debug(`Adding storybook file to React Native app ${projectDirectory}`);
30
30
  // copy files to app's .storybook folder
31
31
  (0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/app'), (0, path_1.join)(root, 'src', 'storybook'), {
32
32
  tmpl: '',
33
33
  offsetFromRoot: (0, devkit_1.offsetFromRoot)(sourceRoot),
34
- projectType: projectDirectory,
35
34
  });
36
35
  // copy files to workspace root's .storybook folder
37
36
  (0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/root'), (0, path_1.join)(root, (0, devkit_1.offsetFromRoot)(root), '.storybook'), {
@@ -1 +1 @@
1
- {"version":3,"file":"create-storybook-files.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/storybook-configuration/lib/create-storybook-files.ts"],"names":[],"mappings":";;;;AAAA,yCAOsB;AACtB,+BAA4B;AAC5B,+BAA+B;AAI/B;;GAEG;AACH,SAAsB,oBAAoB,CACxC,IAAU,EACV,MAAgC;;;QAEhC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EACzE,IAAI,EACJ,MAAM,CAAC,IAAI,CACZ,CAAC;QAEF,+CAA+C;QAC/C,IAAI,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,QAAQ,MAAK,0BAA0B,EAAE;YAC3D,OAAO;SACR;QAED,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC;QACxE,MAAM,mBAAmB,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,KAAK,mBAAmB,EAAE,CAAC,CAAC;QAEnE,IAAI,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC,EAAE;YACpC,eAAM,CAAC,IAAI,CACT,GAAG,mBAAmB,yCAAyC,WAAW,IAAI,MAAM,CAAC,IAAI,kCAAkC,CAC5H,CAAC;YACF,OAAO;SACR;QACD,IAAI,WAAW,KAAK,aAAa,EAAE;YACjC,eAAM,CAAC,IAAI,CACT,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAChB,MAAM,CACP,8IAA8I,CAChJ,CAAC;SACH;QAED,MAAM,gBAAgB,GAAG,WAAW,KAAK,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;QAEvE,eAAM,CAAC,KAAK,CAAC,6CAA6C,gBAAgB,EAAE,CAAC,CAAC;QAE9E,wCAAwC;QACxC,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,WAAI,EAAC,SAAS,EAAE,cAAc,CAAC,EAC/B,IAAA,WAAI,EAAC,IAAI,EAAE,KAAK,EAAE,WAAW,CAAC,EAC9B;YACE,IAAI,EAAE,EAAE;YACR,cAAc,EAAE,IAAA,uBAAc,EAAC,UAAU,CAAC;YAC1C,WAAW,EAAE,gBAAgB;SAC9B,CACF,CAAC;QAEF,mDAAmD;QACnD,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,WAAI,EAAC,SAAS,EAAE,eAAe,CAAC,EAChC,IAAA,WAAI,EAAC,IAAI,EAAE,IAAA,uBAAc,EAAC,IAAI,CAAC,EAAE,YAAY,CAAC,EAC9C;YACE,IAAI,EAAE,EAAE;SACT,CACF,CAAC;QAEF,IAAI,MAAM,CAAC,EAAE,EAAE;YACb,IAAA,aAAI,EAAC,IAAI,CAAC,CAAC;SACZ;;CACF;AA5DD,oDA4DC"}
1
+ {"version":3,"file":"create-storybook-files.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/storybook-configuration/lib/create-storybook-files.ts"],"names":[],"mappings":";;;;AAAA,yCAOsB;AACtB,+BAA4B;AAC5B,+BAA+B;AAI/B;;GAEG;AACH,SAAsB,oBAAoB,CACxC,IAAU,EACV,MAAgC;;;QAEhC,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,UAAU,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