@nrwl/react-native 15.5.3 → 15.6.0-beta.0
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 +9 -9
- package/src/generators/storybook-configuration/files/app/storybook.ts.template +4 -4
- package/src/generators/storybook-configuration/lib/create-storybook-files.js +5 -6
- package/src/generators/storybook-configuration/lib/create-storybook-files.js.map +1 -1
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
|
-
|
|
6
|
+
# [15.6.0-beta.0](https://github.com/nrwl/nx/compare/15.5.1...15.6.0-beta.0) (2023-01-23)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/react-native
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/react-native",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.6.0-beta.0",
|
|
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.
|
|
29
|
-
"@nrwl/devkit": "15.
|
|
30
|
-
"@nrwl/jest": "15.
|
|
31
|
-
"@nrwl/js": "15.
|
|
32
|
-
"@nrwl/linter": "15.
|
|
33
|
-
"@nrwl/react": "15.
|
|
34
|
-
"@nrwl/workspace": "15.
|
|
28
|
+
"@nrwl/detox": "15.6.0-beta.0",
|
|
29
|
+
"@nrwl/devkit": "15.6.0-beta.0",
|
|
30
|
+
"@nrwl/jest": "15.6.0-beta.0",
|
|
31
|
+
"@nrwl/js": "15.6.0-beta.0",
|
|
32
|
+
"@nrwl/linter": "15.6.0-beta.0",
|
|
33
|
+
"@nrwl/react": "15.6.0-beta.0",
|
|
34
|
+
"@nrwl/workspace": "15.6.0-beta.0",
|
|
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": "
|
|
56
|
+
"gitHead": "077b55915b2da6b54f3f6a9f52b0681a1a350580"
|
|
57
57
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { configure, getStorybookUI } from '@storybook/react-native';
|
|
2
2
|
|
|
3
|
-
import { loadStories } from '
|
|
3
|
+
import { loadStories } from '<%= offsetFromRoot %>../.storybook/story-loader';
|
|
4
4
|
|
|
5
|
-
configure(loadStories(), module
|
|
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
|
|
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,
|
|
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,IACE,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,QAAQ,MAAK,0BAA0B;YACvD,CAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,0CAAE,QAAQ,MAAK,kBAAkB,EAC/C;YACA,eAAM,CAAC,KAAK,CACV,8BAA8B,MAAM,CAAC,IAAI,+CAA+C,CACzF,CAAC;YACF,OAAO;SACR;QAED,MAAM,mBAAmB,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC;QACxE,MAAM,mBAAmB,GAAG,IAAA,WAAI,EA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