@nrwl/react-native 13.10.0-beta.9 → 13.10.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 +8 -8
- package/src/executors/storybook/storybook.impl.js +4 -1
- package/src/executors/storybook/storybook.impl.js.map +1 -1
- package/src/executors/storybook/storybook.impl.ts +11 -8
- package/src/generators/application/application.d.ts +1 -1
- package/src/generators/application/files/app/src/app/App.tsx.template +9 -11
- package/src/generators/component/component.d.ts +1 -1
- package/src/generators/component-story/component-story.d.ts +1 -1
- package/src/generators/component-story/component-story.spec.ts +1 -8
- package/src/generators/component-story/files/__componentFileName__.stories.__fileExt__ +0 -1
- package/src/generators/init/init.d.ts +1 -1
- package/src/generators/library/library.d.ts +1 -1
- package/src/generators/stories/stories-lib.spec.ts +1 -1
- package/src/generators/stories/stories.d.ts +1 -1
- package/src/generators/storybook-configuration/configuration.d.ts +1 -1
- package/src/generators/storybook-configuration/files/app/storybook.ts.template +1 -1
- package/src/generators/storybook-configuration/files/app/toggle-storybook.tsx.template +1 -1
- package/src/generators/storybook-configuration/lib/create-storybook-files.js +1 -1
- package/src/generators/storybook-configuration/lib/create-storybook-files.js.map +1 -1
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js +1 -1
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js.map +1 -1
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts +2 -2
- package/src/utils/versions.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/react-native",
|
|
3
|
-
"version": "13.10.0-
|
|
3
|
+
"version": "13.10.0-rc.2",
|
|
4
4
|
"description": "React Native brings React's declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform.\n\nThe Nx Plugin for React Native contains generators for managing React Native applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Detox, and Storybook.\n\n- Scaffolding for creating buildable libraries that can be published to npm.\n\n- Utilities for automatic workspace refactoring.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Monorepo",
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
"main": "index.js",
|
|
25
25
|
"types": "index.d.ts",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@nrwl/detox": "13.10.0-
|
|
28
|
-
"@nrwl/devkit": "13.10.0-
|
|
29
|
-
"@nrwl/jest": "13.10.0-
|
|
30
|
-
"@nrwl/linter": "13.10.0-
|
|
31
|
-
"@nrwl/storybook": "13.10.0-
|
|
32
|
-
"@nrwl/react": "13.10.0-
|
|
33
|
-
"@nrwl/workspace": "13.10.0-
|
|
27
|
+
"@nrwl/detox": "13.10.0-rc.2",
|
|
28
|
+
"@nrwl/devkit": "13.10.0-rc.2",
|
|
29
|
+
"@nrwl/jest": "13.10.0-rc.2",
|
|
30
|
+
"@nrwl/linter": "13.10.0-rc.2",
|
|
31
|
+
"@nrwl/storybook": "13.10.0-rc.2",
|
|
32
|
+
"@nrwl/react": "13.10.0-rc.2",
|
|
33
|
+
"@nrwl/workspace": "13.10.0-rc.2",
|
|
34
34
|
"chalk": "^4.1.0",
|
|
35
35
|
"enhanced-resolve": "^5.8.3",
|
|
36
36
|
"fs-extra": "^9.1.0",
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
+
const fileutils_1 = require("@nrwl/workspace/src/utilities/fileutils");
|
|
6
7
|
const chalk = require("chalk");
|
|
7
8
|
const child_process_1 = require("child_process");
|
|
8
9
|
const sync_deps_impl_1 = require("../sync-deps/sync-deps.impl");
|
|
@@ -12,7 +13,9 @@ function reactNatievStorybookExecutor(options, context) {
|
|
|
12
13
|
const projectRoot = context.workspace.projects[context.projectName].root;
|
|
13
14
|
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).`);
|
|
14
15
|
// add storybook addons to app's package.json
|
|
15
|
-
|
|
16
|
+
const packageJsonPath = (0, path_1.join)(context.root, projectRoot, 'package.json');
|
|
17
|
+
if ((0, fileutils_1.fileExists)(packageJsonPath))
|
|
18
|
+
(0, sync_deps_impl_1.displayNewlyAddedDepsMessage)(context.projectName, yield tslib_1.__await((0, sync_deps_impl_1.syncDeps)(context.projectName, projectRoot, context.root, '@storybook/addon-ondevice-actions,@storybook/addon-ondevice-backgrounds,@storybook/addon-ondevice-controls,@storybook/addon-ondevice-notes')));
|
|
16
19
|
try {
|
|
17
20
|
yield tslib_1.__await(runCliStorybook(context.root, projectRoot, options));
|
|
18
21
|
yield yield tslib_1.__await({ success: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storybook.impl.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/storybook/storybook.impl.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAC5B,yCAAuD;AACvD,+BAA+B;AAG/B,iDAAmD;AACnD,gEAGqC;AAErC,IAAI,YAA0B,CAAC;AAE/B,SAA+B,4BAA4B,CACzD,OAAoC,EACpC,OAAwB;;QAExB,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;QACzE,eAAM,CAAC,IAAI,CACT,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAChB,MAAM,CACP,8IAA8I,CAChJ,CAAC;QAEF,6CAA6C;QAC7C,IAAA,6CAA4B,EAC1B,OAAO,CAAC,WAAW,EACnB,sBAAM,IAAA,yBAAQ,EACZ,OAAO,CAAC,WAAW,EACnB,WAAW,EACX,OAAO,CAAC,IAAI,EACZ,4IAA4I,CAC7I,CAAA,CACF,CAAC;
|
|
1
|
+
{"version":3,"file":"storybook.impl.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/storybook/storybook.impl.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAC5B,yCAAuD;AACvD,uEAAqE;AACrE,+BAA+B;AAG/B,iDAAmD;AACnD,gEAGqC;AAErC,IAAI,YAA0B,CAAC;AAE/B,SAA+B,4BAA4B,CACzD,OAAoC,EACpC,OAAwB;;QAExB,MAAM,WAAW,GAAG,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;QACzE,eAAM,CAAC,IAAI,CACT,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAChB,MAAM,CACP,8IAA8I,CAChJ,CAAC;QAEF,6CAA6C;QAC7C,MAAM,eAAe,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,cAAc,CAAC,CAAC;QACxE,IAAI,IAAA,sBAAU,EAAC,eAAe,CAAC;YAC7B,IAAA,6CAA4B,EAC1B,OAAO,CAAC,WAAW,EACnB,sBAAM,IAAA,yBAAQ,EACZ,OAAO,CAAC,WAAW,EACnB,WAAW,EACX,OAAO,CAAC,IAAI,EACZ,4IAA4I,CAC7I,CAAA,CACF,CAAC;QAEJ,IAAI;YACF,sBAAM,eAAe,CAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,CAAA,CAAC;YAC1D,4BAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA,CAAC;SACzB;gBAAS;YACR,IAAI,YAAY,EAAE;gBAChB,YAAY,CAAC,IAAI,EAAE,CAAC;aACrB;SACF;IACH,CAAC;CAAA;AAhCD,+CAgCC;AAED,SAAS,eAAe,CACtB,aAAqB,EACrB,WAAmB,EACnB,OAAoC;IAEpC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,YAAY,GAAG,IAAA,oBAAI,EACjB,IAAA,WAAI,EACF,aAAa,EAC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join } from 'path';
|
|
2
2
|
import { ExecutorContext, logger } from '@nrwl/devkit';
|
|
3
|
+
import { fileExists } from '@nrwl/workspace/src/utilities/fileutils';
|
|
3
4
|
import * as chalk from 'chalk';
|
|
4
5
|
|
|
5
6
|
import { ReactNativeStorybookOptions } from './schema';
|
|
@@ -23,15 +24,17 @@ export default async function* reactNatievStorybookExecutor(
|
|
|
23
24
|
);
|
|
24
25
|
|
|
25
26
|
// add storybook addons to app's package.json
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
const packageJsonPath = join(context.root, projectRoot, 'package.json');
|
|
28
|
+
if (fileExists(packageJsonPath))
|
|
29
|
+
displayNewlyAddedDepsMessage(
|
|
29
30
|
context.projectName,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
await syncDeps(
|
|
32
|
+
context.projectName,
|
|
33
|
+
projectRoot,
|
|
34
|
+
context.root,
|
|
35
|
+
'@storybook/addon-ondevice-actions,@storybook/addon-ondevice-backgrounds,@storybook/addon-ondevice-controls,@storybook/addon-ondevice-notes'
|
|
36
|
+
)
|
|
37
|
+
);
|
|
35
38
|
|
|
36
39
|
try {
|
|
37
40
|
await runCliStorybook(context.root, projectRoot, options);
|
|
@@ -2,4 +2,4 @@ import { Schema } from './schema';
|
|
|
2
2
|
import { Tree, GeneratorCallback } from '@nrwl/devkit';
|
|
3
3
|
export declare function reactNativeApplicationGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export default reactNativeApplicationGenerator;
|
|
5
|
-
export declare const reactNativeApplicationSchematic: (
|
|
5
|
+
export declare const reactNativeApplicationSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -8,11 +8,9 @@ import {
|
|
|
8
8
|
Text,
|
|
9
9
|
StatusBar,
|
|
10
10
|
TouchableOpacity,
|
|
11
|
+
Linking,
|
|
11
12
|
} from 'react-native';
|
|
12
13
|
|
|
13
|
-
// @ts-ignore
|
|
14
|
-
import openURLInBrowser from 'react-native/Libraries/Core/Devtools/openURLInBrowser';
|
|
15
|
-
|
|
16
14
|
import Checkmark from './icons/checkmark.svg';
|
|
17
15
|
import Book from './icons/book.svg';
|
|
18
16
|
import ChevronRight from './icons/chevron-right.svg';
|
|
@@ -82,7 +80,7 @@ export const App = () => {
|
|
|
82
80
|
<TouchableOpacity
|
|
83
81
|
style={[styles.listItem, styles.learning]}
|
|
84
82
|
onPress={() =>
|
|
85
|
-
|
|
83
|
+
Linking.openURL(
|
|
86
84
|
'https://nx.dev/getting-started/intro?utm_source=nx-project'
|
|
87
85
|
)
|
|
88
86
|
}
|
|
@@ -99,7 +97,7 @@ export const App = () => {
|
|
|
99
97
|
<TouchableOpacity
|
|
100
98
|
style={[styles.listItem, styles.learning]}
|
|
101
99
|
onPress={() =>
|
|
102
|
-
|
|
100
|
+
Linking.openURL(
|
|
103
101
|
'https://blog.nrwl.io/?utm_source=nx-project'
|
|
104
102
|
)
|
|
105
103
|
}
|
|
@@ -116,7 +114,7 @@ export const App = () => {
|
|
|
116
114
|
<TouchableOpacity
|
|
117
115
|
style={[styles.listItem, styles.learning]}
|
|
118
116
|
onPress={() =>
|
|
119
|
-
|
|
117
|
+
Linking.openURL(
|
|
120
118
|
'https://www.youtube.com/c/Nrwl_io/videos?utm_source=nx-project'
|
|
121
119
|
)
|
|
122
120
|
}
|
|
@@ -133,7 +131,7 @@ export const App = () => {
|
|
|
133
131
|
<TouchableOpacity
|
|
134
132
|
style={[styles.listItem, styles.learning]}
|
|
135
133
|
onPress={() =>
|
|
136
|
-
|
|
134
|
+
Linking.openURL(
|
|
137
135
|
'https://nx.dev/tutorial/01-create-application?utm_source=nx-project'
|
|
138
136
|
)
|
|
139
137
|
}
|
|
@@ -150,7 +148,7 @@ export const App = () => {
|
|
|
150
148
|
<TouchableOpacity
|
|
151
149
|
style={[styles.listItem, styles.learning]}
|
|
152
150
|
onPress={() =>
|
|
153
|
-
|
|
151
|
+
Linking.openURL(
|
|
154
152
|
'https://nxplaybook.com/?utm_source=nx-project'
|
|
155
153
|
)
|
|
156
154
|
}
|
|
@@ -169,7 +167,7 @@ export const App = () => {
|
|
|
169
167
|
<View style={styles.section}>
|
|
170
168
|
<TouchableOpacity
|
|
171
169
|
onPress={() =>
|
|
172
|
-
|
|
170
|
+
Linking.openURL(
|
|
173
171
|
'https://marketplace.visualstudio.com/items?itemName=nrwl.angular-console&utm_source=nx-project'
|
|
174
172
|
)
|
|
175
173
|
}
|
|
@@ -196,7 +194,7 @@ export const App = () => {
|
|
|
196
194
|
<View style={styles.section}>
|
|
197
195
|
<TouchableOpacity
|
|
198
196
|
onPress={() =>
|
|
199
|
-
|
|
197
|
+
Linking.openURL('https://nx.app/?utm_source=nx-project')
|
|
200
198
|
}
|
|
201
199
|
>
|
|
202
200
|
<View style={styles.shadowBox}>
|
|
@@ -226,7 +224,7 @@ export const App = () => {
|
|
|
226
224
|
<View style={styles.section}>
|
|
227
225
|
<TouchableOpacity
|
|
228
226
|
onPress={() =>
|
|
229
|
-
|
|
227
|
+
Linking.openURL('https://nx.app/?utm_source=nx-project')
|
|
230
228
|
}
|
|
231
229
|
>
|
|
232
230
|
<View style={[styles.listItem, styles.shadowBox]}>
|
|
@@ -2,4 +2,4 @@ import { Schema } from './schema';
|
|
|
2
2
|
import { Tree } from '@nrwl/devkit';
|
|
3
3
|
export declare function reactNativeComponentGenerator(host: Tree, schema: Schema): Promise<void>;
|
|
4
4
|
export default reactNativeComponentGenerator;
|
|
5
|
-
export declare const reactNativeComponentSchematic: (
|
|
5
|
+
export declare const reactNativeComponentSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -5,4 +5,4 @@ export declare function getArgsDefaultValue(property: ts.SyntaxKind): string;
|
|
|
5
5
|
export declare function createComponentStoriesFile(host: Tree, { project, componentPath }: CreateComponentStoriesFileSchema): void;
|
|
6
6
|
export declare function componentStoryGenerator(host: Tree, schema: CreateComponentStoriesFileSchema): Promise<void>;
|
|
7
7
|
export default componentStoryGenerator;
|
|
8
|
-
export declare const componentStorySchematic: (
|
|
8
|
+
export declare const componentStorySchematic: (generatorOptions: CreateComponentStoriesFileSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -60,8 +60,7 @@ describe('react-native:component-story', () => {
|
|
|
60
60
|
import React from 'react';
|
|
61
61
|
import { TestUiLib, TestUiLibProps } from './test-ui-lib';
|
|
62
62
|
const props: TestUiLibProps = {};
|
|
63
|
-
storiesOf('TestUiLib', module)
|
|
64
|
-
.addDecorator((getStory) => <>{getStory()}</>)
|
|
63
|
+
storiesOf('TestUiLib', module)
|
|
65
64
|
.add('Primary', () => <TestUiLib {...props} />);
|
|
66
65
|
`);
|
|
67
66
|
});
|
|
@@ -110,7 +109,6 @@ describe('react-native:component-story', () => {
|
|
|
110
109
|
const props = {};
|
|
111
110
|
|
|
112
111
|
storiesOf('Test', module)
|
|
113
|
-
.addDecorator((getStory) => <>{getStory()}</>)
|
|
114
112
|
.add('Primary', () => <Test {...props} />);
|
|
115
113
|
`);
|
|
116
114
|
});
|
|
@@ -149,7 +147,6 @@ describe('react-native:component-story', () => {
|
|
|
149
147
|
import { Test } from './test-ui-lib';
|
|
150
148
|
const props = {};
|
|
151
149
|
storiesOf('Test', module)
|
|
152
|
-
.addDecorator((getStory) => <>{getStory()}</>)
|
|
153
150
|
.add('Primary', () => <Test {...props} />);
|
|
154
151
|
`);
|
|
155
152
|
});
|
|
@@ -172,7 +169,6 @@ describe('react-native:component-story', () => {
|
|
|
172
169
|
import { TestUiLib, TestUiLibProps } from './test-ui-lib';
|
|
173
170
|
const props: TestUiLibProps = {};
|
|
174
171
|
storiesOf('TestUiLib', module)
|
|
175
|
-
.addDecorator((getStory) => <>{getStory()}</>)
|
|
176
172
|
.add('Primary', () => <TestUiLib {...props} />);
|
|
177
173
|
`);
|
|
178
174
|
});
|
|
@@ -223,7 +219,6 @@ describe('react-native:component-story', () => {
|
|
|
223
219
|
const actions = { someAction: action('someAction executed!') };
|
|
224
220
|
const props: TestProps = { name: '', displayAge: false };
|
|
225
221
|
storiesOf('Test', module)
|
|
226
|
-
.addDecorator((getStory) => <>{getStory()}</>)
|
|
227
222
|
.add('Primary', () => <Test {...props} {...actions} />);
|
|
228
223
|
`);
|
|
229
224
|
});
|
|
@@ -372,7 +367,6 @@ describe('react-native:component-story', () => {
|
|
|
372
367
|
displayAge: false,
|
|
373
368
|
};
|
|
374
369
|
storiesOf('Test', module)
|
|
375
|
-
.addDecorator((getStory) => <>{getStory()}</>)
|
|
376
370
|
.add('Primary', () => <Test {...props} />);
|
|
377
371
|
`);
|
|
378
372
|
});
|
|
@@ -404,7 +398,6 @@ describe('react-native:component-story', () => {
|
|
|
404
398
|
const props: TestUiLibProps = {};
|
|
405
399
|
|
|
406
400
|
storiesOf('TestUiLib', module)
|
|
407
|
-
.addDecorator((getStory) => <>{getStory()}</>)
|
|
408
401
|
.add('Primary', () => <TestUiLib {...props} />);
|
|
409
402
|
`);
|
|
410
403
|
});
|
|
@@ -19,7 +19,6 @@ const props <% if ( propsTypeName ) { %>:<%= propsTypeName %><% } %> = {<% for (
|
|
|
19
19
|
<% } %>};
|
|
20
20
|
|
|
21
21
|
storiesOf('<%= componentName %>', module)
|
|
22
|
-
.addDecorator((getStory) => <>{getStory()}</>)
|
|
23
22
|
.add('Primary', () => (
|
|
24
23
|
<<%= componentName %> {...props} <% if (hasActions) { %> {...actions} <% } %>/>
|
|
25
24
|
));
|
|
@@ -3,4 +3,4 @@ import { Schema } from './schema';
|
|
|
3
3
|
export declare function reactNativeInitGenerator(host: Tree, schema: Schema): Promise<import("@nrwl/devkit").GeneratorCallback>;
|
|
4
4
|
export declare function updateDependencies(host: Tree): import("@nrwl/devkit").GeneratorCallback;
|
|
5
5
|
export default reactNativeInitGenerator;
|
|
6
|
-
export declare const reactNativeInitSchematic: (
|
|
6
|
+
export declare const reactNativeInitSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -2,4 +2,4 @@ import { GeneratorCallback, Tree } from '@nrwl/devkit';
|
|
|
2
2
|
import { Schema } from './schema';
|
|
3
3
|
export declare function reactNativeLibraryGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export default reactNativeLibraryGenerator;
|
|
5
|
-
export declare const reactNativeLibrarySchematic: (
|
|
5
|
+
export declare const reactNativeLibrarySchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -45,7 +45,7 @@ describe('react-native:stories for libraries', () => {
|
|
|
45
45
|
});
|
|
46
46
|
// create another component
|
|
47
47
|
appTree.write(
|
|
48
|
-
'libs/test-ui-lib/src/lib/some-utils.ts',
|
|
48
|
+
'libs/test-ui-lib/src/lib/some-command-line-utils.ts',
|
|
49
49
|
`export const add = (a: number, b: number) => a + b;`
|
|
50
50
|
);
|
|
51
51
|
|
|
@@ -4,4 +4,4 @@ export declare function projectRootPath(tree: Tree, sourceRoot: string, projectT
|
|
|
4
4
|
export declare function createAllStories(tree: Tree, projectName: string): Promise<void>;
|
|
5
5
|
export declare function storiesGenerator(host: Tree, schema: StorybookStoriesSchema): Promise<void>;
|
|
6
6
|
export default storiesGenerator;
|
|
7
|
-
export declare const storiesSchematic: (
|
|
7
|
+
export declare const storiesSchematic: (generatorOptions: StorybookStoriesSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -2,4 +2,4 @@ import { GeneratorCallback, Tree } from '@nrwl/devkit';
|
|
|
2
2
|
import { StorybookConfigureSchema } from './schema';
|
|
3
3
|
export declare function storybookConfigurationGenerator(host: Tree, schema: StorybookConfigureSchema): Promise<GeneratorCallback>;
|
|
4
4
|
export default storybookConfigurationGenerator;
|
|
5
|
-
export declare const storybookConfigurationSchematic: (
|
|
5
|
+
export declare const storybookConfigurationSchematic: (generatorOptions: StorybookConfigureSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -5,7 +5,7 @@ import React, { useState, useEffect, useRef } from 'react';
|
|
|
5
5
|
import { DevSettings } from 'react-native';
|
|
6
6
|
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
7
7
|
|
|
8
|
-
import AppRoot from '../
|
|
8
|
+
import AppRoot from '../app/App';
|
|
9
9
|
|
|
10
10
|
export const DEFAULT_REACTOTRON_WS_URI = 'ws://localhost:9090';
|
|
11
11
|
|
|
@@ -28,7 +28,7 @@ function createStorybookFiles(host, schema) {
|
|
|
28
28
|
const projectDirectory = projectType === 'application' ? 'app' : 'lib';
|
|
29
29
|
devkit_1.logger.debug(`Adding storybook file to React Native app ${projectDirectory}`);
|
|
30
30
|
// copy files to app's .storybook folder
|
|
31
|
-
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/app'), (0, path_1.join)(root, '
|
|
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
34
|
projectType: projectDirectory,
|
|
@@ -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,
|
|
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;YA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AA,aAAI,EAAC,IAAI,CAAC,CAAC;SACZ;;CACF;AA5DD,oDA4DC"}
|
package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js
CHANGED
|
@@ -11,7 +11,7 @@ function replaceAppImportWithStorybookToggle(host, schema) {
|
|
|
11
11
|
const { root, sourceRoot } = (0, devkit_1.readProjectConfiguration)(host, schema.name);
|
|
12
12
|
const mainFilePath = (0, path_1.join)(sourceRoot, schema.js ? 'main.js' : 'main.tsx');
|
|
13
13
|
const appImportImport = `import App from './app/App';`;
|
|
14
|
-
const storybookeToggleImport = `import App from '
|
|
14
|
+
const storybookeToggleImport = `import App from './storybook/toggle-storybook';`;
|
|
15
15
|
try {
|
|
16
16
|
devkit_1.logger.debug(`Updating import for ${mainFilePath}`);
|
|
17
17
|
const contents = host.read(mainFilePath, 'utf-8');
|
package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"replace-app-import-with-storybook-toggle.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.ts"],"names":[],"mappings":";;;AAAA,yCAKsB;AACtB,+BAA4B;AAI5B;;;GAGG;AACH,SAAgB,mCAAmC,CACjD,IAAU,EACV,MAAgC;IAEhC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAEzE,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAC1E,MAAM,eAAe,GAAG,8BAA8B,CAAC;IACvD,MAAM,sBAAsB,GAAG,
|
|
1
|
+
{"version":3,"file":"replace-app-import-with-storybook-toggle.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.ts"],"names":[],"mappings":";;;AAAA,yCAKsB;AACtB,+BAA4B;AAI5B;;;GAGG;AACH,SAAgB,mCAAmC,CACjD,IAAU,EACV,MAAgC;IAEhC,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;IAEzE,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,UAAU,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;IAC1E,MAAM,eAAe,GAAG,8BAA8B,CAAC;IACvD,MAAM,sBAAsB,GAAG,iDAAiD,CAAC;IAEjF,IAAI;QACF,eAAM,CAAC,KAAK,CAAC,uBAAuB,YAAY,EAAE,CAAC,CAAC;QACpD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QAClD,IACE,CAAC,QAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC;YACnC,QAAQ,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EACzC;YACA,eAAM,CAAC,IAAI,CAAC,IAAA,qBAAY,EAAA,GAAG,YAAY,sBAAsB,CAAC,CAAC;YAC/D,OAAO;SACR;QACD,IAAI,CAAC,KAAK,CACR,YAAY,EACZ,QAAQ,CAAC,OAAO,CAAC,eAAe,EAAE,sBAAsB,CAAC,CAC1D,CAAC;KACH;IAAC,WAAM;QACN,eAAM,CAAC,IAAI,CACT,IAAA,qBAAY,EAAA,8BAA8B,YAAY,gBAAgB,IAAI,GAAG,CAC9E,CAAC;KACH;AACH,CAAC;AA7BD,kFA6BC"}
|
package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts
CHANGED
|
@@ -34,7 +34,7 @@ describe('replaceAppImportWithStorybookToggle', () => {
|
|
|
34
34
|
const mainFile = tree.read('apps/products/src/main.tsx', 'utf-8');
|
|
35
35
|
expect(formatFile`${mainFile}`).toEqual(
|
|
36
36
|
formatFile`import { AppRegistry } from 'react-native';
|
|
37
|
-
import App from '
|
|
37
|
+
import App from './storybook/toggle-storybook';
|
|
38
38
|
|
|
39
39
|
AppRegistry.registerComponent('main', () => App);`
|
|
40
40
|
);
|
|
@@ -57,7 +57,7 @@ describe('replaceAppImportWithStorybookToggle', () => {
|
|
|
57
57
|
const mainFile = tree.read('apps/products/src/main.tsx', 'utf-8');
|
|
58
58
|
expect(formatFile`${mainFile}`).toEqual(
|
|
59
59
|
formatFile`import { AppRegistry } from 'react-native';
|
|
60
|
-
import App from '
|
|
60
|
+
import App from './storybook/toggle-storybook';
|
|
61
61
|
|
|
62
62
|
AppRegistry.registerComponent('main', () => App);`
|
|
63
63
|
);
|
package/src/utils/versions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.reactTestRendererVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.metroReactNativeBabelPresetVersion = exports.reactNativeAsyncStorageAsyncStorageVersion = exports.reactNativeConfigVersion = exports.reactNativeCommunityCliAndroid = exports.reactNativeCommunityCliIos = exports.reactNativeCommunityCli = exports.reactVersion = exports.metroVersion = exports.typesReactNativeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
|
|
4
|
-
exports.nxVersion = '13.10.0-
|
|
4
|
+
exports.nxVersion = '13.10.0-rc.2';
|
|
5
5
|
exports.reactNativeVersion = '0.67.4';
|
|
6
6
|
exports.typesReactNativeVersion = '0.67.3';
|
|
7
7
|
exports.metroVersion = '0.70.0';
|