@nx/react-native 16.1.0-beta.0 → 16.1.0-rc.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.
Files changed (29) hide show
  1. package/migrations.json +19 -0
  2. package/package.json +11 -10
  3. package/src/executors/build-ios/schema.json +2 -1
  4. package/src/executors/run-ios/schema.json +1 -1
  5. package/src/executors/storybook/schema.d.ts +3 -1
  6. package/src/executors/storybook/schema.json +3 -2
  7. package/src/executors/storybook/storybook.impl.d.ts +2 -1
  8. package/src/executors/storybook/storybook.impl.js +24 -52
  9. package/src/executors/storybook/storybook.impl.js.map +1 -1
  10. package/src/executors/storybook/storybook.impl.ts +23 -56
  11. package/src/generators/component-story/component-story.d.ts +7 -3
  12. package/src/generators/component-story/component-story.js +10 -42
  13. package/src/generators/component-story/component-story.js.map +1 -1
  14. package/src/generators/component-story/component-story.spec.ts +45 -50
  15. package/src/generators/component-story/files/__componentFileName__.stories.__fileExt__ +28 -20
  16. package/src/generators/storybook-configuration/configuration.js +7 -4
  17. package/src/generators/storybook-configuration/configuration.js.map +1 -1
  18. package/src/generators/storybook-configuration/configuration.spec.ts +0 -9
  19. package/src/generators/storybook-configuration/files/app/storybook.ts.template +1 -1
  20. package/src/generators/storybook-configuration/files/root/story-loader.ts.template +5 -0
  21. package/src/migrations/update-16-1-0/upgrade-storybook-6-5.d.ts +7 -0
  22. package/src/migrations/update-16-1-0/upgrade-storybook-6-5.js +20 -0
  23. package/src/migrations/update-16-1-0/upgrade-storybook-6-5.js.map +1 -0
  24. package/src/utils/pod-install-task.js +0 -7
  25. package/src/utils/pod-install-task.js.map +1 -1
  26. package/src/utils/versions.d.ts +2 -0
  27. package/src/utils/versions.js +3 -1
  28. package/src/utils/versions.js.map +1 -1
  29. package/src/generators/storybook-configuration/files/root/story-loader.js.template +0 -13
package/migrations.json CHANGED
@@ -83,6 +83,12 @@
83
83
  "version": "16.0.0-beta.1",
84
84
  "description": "Replace @nrwl/react-native with @nx/react-native",
85
85
  "implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
86
+ },
87
+ "update-16-1-0-upgrade-storybook-6-5": {
88
+ "cli": "nx",
89
+ "version": "16.1.0-beta.0",
90
+ "description": "Upgrade @storybook/react-native to 6.5",
91
+ "implementation": "./src/migrations/update-16-1-0/upgrade-storybook-6-5"
86
92
  }
87
93
  },
88
94
  "packageJsonUpdates": {
@@ -1291,6 +1297,19 @@
1291
1297
  "alwaysAddToPackageJson": false
1292
1298
  }
1293
1299
  }
1300
+ },
1301
+ "16.0.2": {
1302
+ "version": "16.0.2-beta.0",
1303
+ "packages": {
1304
+ "@react-native-async-storage/async-storage": {
1305
+ "version": "1.18.1",
1306
+ "alwaysAddToPackageJson": false
1307
+ },
1308
+ "react-native-safe-area-context": {
1309
+ "version": "4.5.1",
1310
+ "alwaysAddToPackageJson": false
1311
+ }
1312
+ }
1294
1313
  }
1295
1314
  }
1296
1315
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/react-native",
3
- "version": "16.1.0-beta.0",
3
+ "version": "16.1.0-rc.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,17 +25,18 @@
25
25
  "main": "./index",
26
26
  "types": "index.d.ts",
27
27
  "dependencies": {
28
- "@nrwl/react-native": "16.1.0-beta.0",
29
- "@nx/detox": "16.1.0-beta.0",
30
- "@nx/devkit": "16.1.0-beta.0",
31
- "@nx/jest": "16.1.0-beta.0",
32
- "@nx/js": "16.1.0-beta.0",
33
- "@nx/linter": "16.1.0-beta.0",
34
- "@nx/react": "16.1.0-beta.0",
35
- "@nx/workspace": "16.1.0-beta.0",
28
+ "@nrwl/react-native": "16.1.0-rc.0",
29
+ "@nx/detox": "16.1.0-rc.0",
30
+ "@nx/devkit": "16.1.0-rc.0",
31
+ "@nx/jest": "16.1.0-rc.0",
32
+ "@nx/js": "16.1.0-rc.0",
33
+ "@nx/linter": "16.1.0-rc.0",
34
+ "@nx/react": "16.1.0-rc.0",
35
+ "@nx/workspace": "16.1.0-rc.0",
36
36
  "chalk": "^4.1.0",
37
37
  "enhanced-resolve": "^5.8.3",
38
38
  "fs-extra": "^11.1.0",
39
+ "glob": "7.1.4",
39
40
  "ignore": "^5.0.4",
40
41
  "metro-resolver": "^0.74.1",
41
42
  "minimatch": "3.0.5",
@@ -54,5 +55,5 @@
54
55
  "publishConfig": {
55
56
  "access": "public"
56
57
  },
57
- "gitHead": "6c221eae40054e6b104f1d53a7baea632a28d28e"
58
+ "gitHead": "8cc64baf9537e775fcc5f2e606687ea3d01308ab"
58
59
  }
@@ -83,7 +83,8 @@
83
83
  },
84
84
  "install": {
85
85
  "type": "boolean",
86
- "description": "Runs `pod install` for native modules before building iOS app."
86
+ "description": "Runs `pod install` for native modules before building iOS app.",
87
+ "default": true
87
88
  },
88
89
  "sync": {
89
90
  "type": "boolean",
@@ -93,7 +93,7 @@
93
93
  "install": {
94
94
  "type": "boolean",
95
95
  "description": "Runs `pod install` for native modules before building iOS app.",
96
- "default": false
96
+ "default": true
97
97
  },
98
98
  "sync": {
99
99
  "type": "boolean",
@@ -1,7 +1,9 @@
1
- // options from https://github.com/elderfo/react-native-storybook-loader#options
2
1
  export interface ReactNativeStorybookOptions {
3
2
  searchDir: string[];
4
3
  outputFile: string;
5
4
  pattern: string;
5
+ /**
6
+ * @deprecated going to be removed in 17
7
+ */
6
8
  silent: boolean;
7
9
  }
@@ -17,7 +17,7 @@
17
17
  "outputFile": {
18
18
  "type": "string",
19
19
  "description": "The output file that will be written. It is relative to the project directory.",
20
- "default": "./.storybook/story-loader.js"
20
+ "default": "./.storybook/story-loader.ts"
21
21
  },
22
22
  "pattern": {
23
23
  "type": "string",
@@ -27,7 +27,8 @@
27
27
  "silent": {
28
28
  "type": "boolean",
29
29
  "description": "Silences output.",
30
- "default": false
30
+ "default": false,
31
+ "x-deprecated": "No longer used. It will be silent as default."
31
32
  }
32
33
  },
33
34
  "required": ["searchDir", "outputFile", "pattern"]
@@ -1,5 +1,6 @@
1
1
  import { ExecutorContext } from '@nx/devkit';
2
2
  import { ReactNativeStorybookOptions } from './schema';
3
- export default function reactNatievStorybookExecutor(options: ReactNativeStorybookOptions, context: ExecutorContext): AsyncGenerator<{
3
+ export default function reactNativeStorybookExecutor(options: ReactNativeStorybookOptions, context: ExecutorContext): AsyncGenerator<{
4
4
  success: boolean;
5
5
  }>;
6
+ export declare function runCliStorybook(workspaceRoot: string, options: ReactNativeStorybookOptions): void;
@@ -1,76 +1,48 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.runCliStorybook = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  const path_1 = require("path");
5
6
  const devkit_1 = require("@nx/devkit");
6
7
  const fileutils_1 = require("@nx/workspace/src/utilities/fileutils");
7
8
  const chalk = require("chalk");
8
- const child_process_1 = require("child_process");
9
+ const glob_1 = require("glob");
9
10
  const sync_deps_impl_1 = require("../sync-deps/sync-deps.impl");
10
- let childProcess;
11
- function reactNatievStorybookExecutor(options, context) {
12
- return tslib_1.__asyncGenerator(this, arguments, function* reactNatievStorybookExecutor_1() {
11
+ const fs_extra_1 = require("fs-extra");
12
+ function reactNativeStorybookExecutor(options, context) {
13
+ return tslib_1.__asyncGenerator(this, arguments, function* reactNativeStorybookExecutor_1() {
13
14
  const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
14
15
  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).`);
15
16
  // add storybook addons to app's package.json
16
17
  const packageJsonPath = (0, path_1.join)(context.root, projectRoot, 'package.json');
17
18
  if ((0, fileutils_1.fileExists)(packageJsonPath))
18
19
  (0, sync_deps_impl_1.displayNewlyAddedDepsMessage)(context.projectName, yield tslib_1.__await((0, sync_deps_impl_1.syncDeps)(context.projectName, projectRoot, context.root, context.projectGraph, [
20
+ `@storybook/react-native`,
19
21
  '@storybook/addon-ondevice-actions',
20
22
  '@storybook/addon-ondevice-backgrounds',
21
23
  '@storybook/addon-ondevice-controls',
22
24
  '@storybook/addon-ondevice-notes',
25
+ '@react-native-async-storage/async-storage',
26
+ 'react-native-safe-area-context',
23
27
  ])));
24
- try {
25
- yield tslib_1.__await(runCliStorybook(context.root, options));
26
- yield yield tslib_1.__await({ success: true });
27
- }
28
- finally {
29
- if (childProcess) {
30
- childProcess.kill();
31
- }
32
- }
28
+ runCliStorybook(context.root, options);
29
+ yield yield tslib_1.__await({ success: true });
33
30
  });
34
31
  }
35
- exports.default = reactNatievStorybookExecutor;
32
+ exports.default = reactNativeStorybookExecutor;
36
33
  function runCliStorybook(workspaceRoot, options) {
37
- return new Promise((resolve, reject) => {
38
- childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/react-native-storybook-loader/out/rnstl-cli.js'), createStorybookOptions(options), {
39
- cwd: workspaceRoot,
40
- });
41
- // Ensure the child process is killed when the parent exits
42
- process.on('exit', () => childProcess.kill());
43
- process.on('SIGTERM', () => childProcess.kill());
44
- childProcess.on('error', (err) => {
45
- reject(err);
46
- });
47
- childProcess.on('exit', (code) => {
48
- if (code === 0) {
49
- resolve(code);
50
- }
51
- else {
52
- reject(code);
53
- }
54
- });
55
- });
56
- }
57
- function createStorybookOptions(options) {
58
- return Object.keys(options).reduce((acc, k) => {
59
- const v = options[k];
60
- if (typeof v === 'boolean') {
61
- if (v === true) {
62
- acc.push(`--${k}`);
63
- }
64
- }
65
- else if (Array.isArray(v)) {
66
- v.forEach((value) => {
67
- acc.push(`--${k}`, value);
68
- });
69
- }
70
- else {
71
- acc.push(`--${k}`, v);
72
- }
73
- return acc;
74
- }, []);
34
+ const storiesFiles = options.searchDir.flatMap((dir) => (0, glob_1.sync)((0, path_1.join)(dir, options.pattern)));
35
+ if (storiesFiles.length === 0) {
36
+ devkit_1.logger.warn(`${chalk.bold.yellow('warn')} No stories found.`);
37
+ }
38
+ const newContents = `// Auto-generated file created by nx
39
+ // DO NOT EDIT.
40
+ export function loadStories() {
41
+ return [
42
+ ${storiesFiles.map((story) => `require('${story}')`).join(',\n')}
43
+ ];
44
+ }`;
45
+ (0, fs_extra_1.writeFileSync)((0, path_1.join)(workspaceRoot, options.outputFile), newContents);
75
46
  }
47
+ exports.runCliStorybook = runCliStorybook;
76
48
  //# sourceMappingURL=storybook.impl.js.map
@@ -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,uCAAqD;AACrD,qEAAmE;AACnE,+BAA+B;AAG/B,iDAAmD;AACnD,gEAGqC;AAErC,IAAI,YAA0B,CAAC;AAE/B,SAA+B,4BAA4B,CACzD,OAAoC,EACpC,OAAwB;;QAExB,MAAM,WAAW,GACf,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;QACpE,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,OAAO,CAAC,YAAY,EACpB;gBACE,mCAAmC;gBACnC,uCAAuC;gBACvC,oCAAoC;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C,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QAC5C,MAAM,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QACrB,IAAI,OAAO,CAAC,KAAK,SAAS,EAAE;YAC1B,IAAI,CAAC,KAAK,IAAI,EAAE;gBACd,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;aACpB;SACF;aAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE;YAC3B,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBAClB,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;YAC5B,CAAC,CAAC,CAAC;SACJ;aAAM;YACL,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;SACvB;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
1
+ {"version":3,"file":"storybook.impl.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/storybook/storybook.impl.ts"],"names":[],"mappings":";;;;AAAA,+BAA4B;AAC5B,uCAAqD;AACrD,qEAAmE;AACnE,+BAA+B;AAC/B,+BAAwC;AAGxC,gEAGqC;AACrC,uCAAyC;AAEzC,SAA+B,4BAA4B,CACzD,OAAoC,EACpC,OAAwB;;QAExB,MAAM,WAAW,GACf,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;QACpE,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,E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workspace/src/utilities/fileutils';
4
4
  import * as chalk from 'chalk';
5
+ import { sync as globSync } from 'glob';
5
6
 
6
7
  import { ReactNativeStorybookOptions } from './schema';
7
- import { ChildProcess, fork } from 'child_process';
8
8
  import {
9
9
  displayNewlyAddedDepsMessage,
10
10
  syncDeps,
11
11
  } from '../sync-deps/sync-deps.impl';
12
+ import { writeFileSync } from 'fs-extra';
12
13
 
13
- let childProcess: ChildProcess;
14
-
15
- export default async function* reactNatievStorybookExecutor(
14
+ export default async function* reactNativeStorybookExecutor(
16
15
  options: ReactNativeStorybookOptions,
17
16
  context: ExecutorContext
18
17
  ): AsyncGenerator<{ success: boolean }> {
@@ -35,71 +34,39 @@ export default async function* reactNatievStorybookExecutor(
35
34
  context.root,
36
35
  context.projectGraph,
37
36
  [
37
+ `@storybook/react-native`,
38
38
  '@storybook/addon-ondevice-actions',
39
39
  '@storybook/addon-ondevice-backgrounds',
40
40
  '@storybook/addon-ondevice-controls',
41
41
  '@storybook/addon-ondevice-notes',
42
+ '@react-native-async-storage/async-storage',
43
+ 'react-native-safe-area-context',
42
44
  ]
43
45
  )
44
46
  );
45
47
 
46
- try {
47
- await runCliStorybook(context.root, options);
48
- yield { success: true };
49
- } finally {
50
- if (childProcess) {
51
- childProcess.kill();
52
- }
53
- }
48
+ runCliStorybook(context.root, options);
49
+ yield { success: true };
54
50
  }
55
51
 
56
- function runCliStorybook(
52
+ export function runCliStorybook(
57
53
  workspaceRoot: string,
58
54
  options: ReactNativeStorybookOptions
59
55
  ) {
60
- return new Promise((resolve, reject) => {
61
- childProcess = fork(
62
- join(
63
- workspaceRoot,
64
- './node_modules/react-native-storybook-loader/out/rnstl-cli.js'
65
- ),
66
- createStorybookOptions(options),
67
- {
68
- cwd: workspaceRoot,
69
- }
70
- );
71
-
72
- // Ensure the child process is killed when the parent exits
73
- process.on('exit', () => childProcess.kill());
74
- process.on('SIGTERM', () => childProcess.kill());
56
+ const storiesFiles: string[] = options.searchDir.flatMap((dir) =>
57
+ globSync(join(dir, options.pattern))
58
+ );
59
+ if (storiesFiles.length === 0) {
60
+ logger.warn(`${chalk.bold.yellow('warn')} No stories found.`);
61
+ }
75
62
 
76
- childProcess.on('error', (err) => {
77
- reject(err);
78
- });
79
- childProcess.on('exit', (code) => {
80
- if (code === 0) {
81
- resolve(code);
82
- } else {
83
- reject(code);
84
- }
85
- });
86
- });
87
- }
63
+ const newContents = `// Auto-generated file created by nx
64
+ // DO NOT EDIT.
65
+ export function loadStories() {
66
+ return [
67
+ ${storiesFiles.map((story) => `require('${story}')`).join(',\n')}
68
+ ];
69
+ }`;
88
70
 
89
- function createStorybookOptions(options) {
90
- return Object.keys(options).reduce((acc, k) => {
91
- const v = options[k];
92
- if (typeof v === 'boolean') {
93
- if (v === true) {
94
- acc.push(`--${k}`);
95
- }
96
- } else if (Array.isArray(v)) {
97
- v.forEach((value) => {
98
- acc.push(`--${k}`, value);
99
- });
100
- } else {
101
- acc.push(`--${k}`, v);
102
- }
103
- return acc;
104
- }, []);
71
+ writeFileSync(join(workspaceRoot, options.outputFile), newContents);
105
72
  }
@@ -1,8 +1,12 @@
1
1
  import { Tree } from '@nx/devkit';
2
- import * as ts from 'typescript';
3
- import { CreateComponentStoriesFileSchema } from './schema';
4
- export declare function getArgsDefaultValue(property: ts.SyntaxKind): string;
2
+ import type * as ts from 'typescript';
3
+ export interface CreateComponentStoriesFileSchema {
4
+ project: string;
5
+ componentPath: string;
6
+ skipFormat?: boolean;
7
+ }
5
8
  export declare function createComponentStoriesFile(host: Tree, { project, componentPath }: CreateComponentStoriesFileSchema): void;
9
+ export declare function findPropsAndGenerateFile(host: Tree, sourceFile: ts.SourceFile, cmpDeclaration: ts.Node, componentDirectory: string, name: string, isPlainJs: boolean, fileExt: string, fromNodeArray?: boolean): void;
6
10
  export declare function componentStoryGenerator(host: Tree, schema: CreateComponentStoriesFileSchema): Promise<void>;
7
11
  export default componentStoryGenerator;
8
12
  export declare const componentStorySchematic: (generatorOptions: CreateComponentStoriesFileSchema) => (tree: any, context: any) => Promise<any>;
@@ -1,26 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.componentStorySchematic = exports.componentStoryGenerator = exports.createComponentStoriesFile = exports.getArgsDefaultValue = void 0;
3
+ exports.componentStorySchematic = exports.componentStoryGenerator = exports.findPropsAndGenerateFile = exports.createComponentStoriesFile = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const devkit_1 = require("@nx/devkit");
6
- const ts = require("typescript");
7
6
  const ast_utils_1 = require("@nx/react/src/utils/ast-utils");
8
- function getArgsDefaultValue(property) {
9
- const typeNameToDefault = {
10
- [ts.SyntaxKind.StringKeyword]: "''",
11
- [ts.SyntaxKind.NumberKeyword]: 0,
12
- [ts.SyntaxKind.BooleanKeyword]: false,
13
- };
14
- const resolvedValue = typeNameToDefault[property];
15
- if (typeof resolvedValue === undefined) {
16
- return "''";
17
- }
18
- else {
19
- return resolvedValue;
20
- }
21
- }
22
- exports.getArgsDefaultValue = getArgsDefaultValue;
7
+ const component_props_1 = require("@nx/react/src/utils/component-props");
8
+ const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
9
+ let tsModule;
23
10
  function createComponentStoriesFile(host, { project, componentPath }) {
11
+ if (!tsModule) {
12
+ tsModule = (0, ensure_typescript_1.ensureTypescript)();
13
+ }
24
14
  const proj = (0, devkit_1.getProjects)(host).get(project);
25
15
  const sourceRoot = proj.sourceRoot;
26
16
  const componentFilePath = (0, devkit_1.joinPathFragments)(sourceRoot, componentPath);
@@ -43,7 +33,7 @@ function createComponentStoriesFile(host, { project, componentPath }) {
43
33
  if (contents === null) {
44
34
  throw new Error(`Failed to read ${componentFilePath}`);
45
35
  }
46
- const sourceFile = ts.createSourceFile(componentFilePath, contents, ts.ScriptTarget.Latest, true);
36
+ const sourceFile = tsModule.createSourceFile(componentFilePath, contents, tsModule.ScriptTarget.Latest, true);
47
37
  const cmpDeclaration = (0, ast_utils_1.getComponentNode)(sourceFile);
48
38
  if (!cmpDeclaration) {
49
39
  const componentNodes = (0, ast_utils_1.findExportDeclarationsForJsx)(sourceFile);
@@ -62,29 +52,7 @@ function createComponentStoriesFile(host, { project, componentPath }) {
62
52
  }
63
53
  exports.createComponentStoriesFile = createComponentStoriesFile;
64
54
  function findPropsAndGenerateFile(host, sourceFile, cmpDeclaration, componentDirectory, name, isPlainJs, fileExt, fromNodeArray) {
65
- const propsInterface = (0, ast_utils_1.getComponentPropsInterface)(sourceFile, cmpDeclaration);
66
- let propsTypeName = null;
67
- let props = [];
68
- let argTypes = [];
69
- if (propsInterface) {
70
- propsTypeName = propsInterface.name.text;
71
- props = propsInterface.members.map((member) => {
72
- if (member.type.kind === ts.SyntaxKind.FunctionType) {
73
- argTypes.push({
74
- name: member.name.text,
75
- type: 'action',
76
- actionText: `${member.name.text} executed!`,
77
- });
78
- }
79
- else {
80
- return {
81
- name: member.name.text,
82
- defaultValue: getArgsDefaultValue(member.type.kind),
83
- };
84
- }
85
- });
86
- props = props.filter((p) => p && p.defaultValue !== undefined);
87
- }
55
+ const { propsTypeName, props, argTypes } = (0, component_props_1.getDefaultsForComponent)(sourceFile, cmpDeclaration);
88
56
  (0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, './files'), (0, devkit_1.normalizePath)(componentDirectory), {
89
57
  componentFileName: fromNodeArray
90
58
  ? `${name}--${cmpDeclaration.name.text}`
@@ -96,9 +64,9 @@ function findPropsAndGenerateFile(host, sourceFile, cmpDeclaration, componentDir
96
64
  componentName: cmpDeclaration.name.text,
97
65
  isPlainJs,
98
66
  fileExt,
99
- hasActions: argTypes && argTypes.length,
100
67
  });
101
68
  }
69
+ exports.findPropsAndGenerateFile = findPropsAndGenerateFile;
102
70
  function componentStoryGenerator(host, schema) {
103
71
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
104
72
  createComponentStoriesFile(host, schema);
@@ -1 +1 @@
1
- {"version":3,"file":"component-story.js","sourceRoot":"","sources":["../../../../../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C,SAAS,EAAE,SAAS,CAAC,EACvC,IAAA,sBAAa,EAAC,kBAAkB,CAAC,EACjC;QACE,iBAAiB,EAAE,aAAa;YAC9B,CAAC,CAAC,GAAG,IAAI,KAAM,cAAsB,CAAC,IAAI,CAAC,IAAI,EAAE;YACjD,CAAC,CAAC,IAAI;QACR,uBAAuB,EAAE,IAAI;QAC7B,aAAa;QACb,KAAK;QACL,QAAQ;QACR,aAAa,EAAG,cAAsB,CAAC,IAAI,CAAC,IAAI;QAChD,SAAS;QACT,OAAO;QACP,UAAU,EAAE,QAAQ,IAAI,QAAQ,CAAC,MAAM;KACxC,CACF,CAAC;AACJ,CAAC;AAED,SAAsB,uBAAuB,CAC3C,IAAU,EACV,MAAwC;;QAExC,0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAEzC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACtB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;IACH,CAAC;CAAA;AATD,0DASC;AAED,kBAAe,uBAAuB,CAAC;AAC1B,QAAA,uBAAuB,GAAG,IAAA,2BAAkB,EACvD,uBAAuB,CACxB,CAAC"}
1
+ {"version":3,"file":"component-story.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/component-story/component-story.ts"],"names":[],"mappings":";;;;AAAA,uCAQoB;AAEpB,6DAGuC;AACvC,yEAA8E;AAC9E,qFAAiF;AAEjF,IAAI,QAAqC,CAAC;AAQ1C,SAAgB,0BAA0B,CACxC,IAAU,EACV,EAAE,OAAO,EAAE,aAAa,EAAoC;IAE5D,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAA,oCAAgB,GAAE,CAAC;KAC/B;IACD,MAAM,IAAI,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IAEnC,MAAM,iBAAiB,GAAG,I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hCD,4DAgCC;AAED,SAAsB,uBAAuB,CAC3C,IAAU,EACV,MAAwC;;QAExC,0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAEzC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACtB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;IACH,CAAC;CAAA;AATD,0DASC;AAED,kBAAe,uBAAuB,CAAC;AAC1B,QAAA,uBAAuB,GAAG,IAAA,2BAAkB,EACvD,uBAAuB,CACxB,CAAC"}
@@ -56,12 +56,14 @@ describe('react-native:component-story', () => {
56
56
  expect(
57
57
  formatFile`${appTree.read(storyFilePath, 'utf-8').replace('·', '')}`
58
58
  ).toContain(formatFile`
59
- import { storiesOf } from '@storybook/react-native';
60
- import React from 'react';
61
- import { TestUiLib, TestUiLibProps } from './test-ui-lib';
62
- const props: TestUiLibProps = {};
63
- storiesOf('TestUiLib', module)
64
- .add('Primary', () => <TestUiLib {...props} />);
59
+ import type { Meta } from '@storybook/react-native';
60
+ import { TestUiLib } from './test-ui-lib';
61
+ const Story: Meta<typeof TestUiLib> = {
62
+ component: TestUiLib,
63
+ title: 'TestUiLib',
64
+ };
65
+ export default Story;
66
+ export const Primary = { args: {} };
65
67
  `);
66
68
  });
67
69
  });
@@ -102,14 +104,9 @@ describe('react-native:component-story', () => {
102
104
  it('should properly set up the story', () => {
103
105
  expect(formatFile`${appTree.read(storyFilePathPlain, 'utf-8')}`)
104
106
  .toContain(formatFile`
105
- import { storiesOf } from '@storybook/react-native';
106
- import React from 'react';
107
- import { Test } from './test-ui-libplain';
108
-
109
- const props = {};
110
-
111
- storiesOf('Test', module)
112
- .add('Primary', () => <Test {...props} />);
107
+ import Test from './test-ui-libplain';
108
+ export default { component: Test, title: 'Test' };
109
+ export const Primary = { args: {} };
113
110
  `);
114
111
  });
115
112
  });
@@ -142,12 +139,11 @@ describe('react-native:component-story', () => {
142
139
  it('should create a story without controls', () => {
143
140
  expect(formatFile`${appTree.read(storyFilePath, 'utf-8')}`)
144
141
  .toContain(formatFile`
145
- import { storiesOf } from '@storybook/react-native';
146
- import React from 'react';
142
+ import type { Meta } from '@storybook/react-native';
147
143
  import { Test } from './test-ui-lib';
148
- const props = {};
149
- storiesOf('Test', module)
150
- .add('Primary', () => <Test {...props} />);
144
+ const Story: Meta<typeof Test> = { component: Test, title: 'Test' };
145
+ export default Story;
146
+ export const Primary = { args: {} };
151
147
  `);
152
148
  });
153
149
  });
@@ -164,12 +160,14 @@ describe('react-native:component-story', () => {
164
160
  expect(
165
161
  formatFile`${appTree.read(storyFilePath, 'utf-8').replace('·', '')}`
166
162
  ).toContain(formatFile`
167
- import { storiesOf } from '@storybook/react-native';
168
- import React from 'react';
169
- import { TestUiLib, TestUiLibProps } from './test-ui-lib';
170
- const props: TestUiLibProps = {};
171
- storiesOf('TestUiLib', module)
172
- .add('Primary', () => <TestUiLib {...props} />);
163
+ import type { Meta } from '@storybook/react-native';
164
+ import { TestUiLib } from './test-ui-lib';
165
+ const Story: Meta<typeof TestUiLib> = {
166
+ component: TestUiLib,
167
+ title: 'TestUiLib',
168
+ };
169
+ export default Story;
170
+ export const Primary = { args: {} };
173
171
  `);
174
172
  });
175
173
  });
@@ -212,14 +210,15 @@ describe('react-native:component-story', () => {
212
210
  expect(
213
211
  formatFile`${appTree.read(storyFilePath, 'utf-8').replace('·', '')}`
214
212
  ).toContain(formatFile`
215
- import { action } from '@storybook/addon-actions';
216
- import { storiesOf } from '@storybook/react-native';
217
- import React from 'react';
218
- import { Test, TestProps } from './test-ui-lib';
219
- const actions = { someAction: action('someAction executed!') };
220
- const props: TestProps = { name: '', displayAge: false };
221
- storiesOf('Test', module)
222
- .add('Primary', () => <Test {...props} {...actions} />);
213
+ import type { Meta } from '@storybook/react-native';
214
+ import { Test } from './test-ui-lib';
215
+ const Story: Meta<typeof Test> = {
216
+ component: Test,
217
+ title: 'Test',
218
+ argTypes: { someAction: { action: 'someAction executed!' } },
219
+ };
220
+ export default Story;
221
+ export const Primary = { args: { name: '', displayAge: false } };
223
222
  `);
224
223
  });
225
224
  });
@@ -359,15 +358,11 @@ describe('react-native:component-story', () => {
359
358
  expect(
360
359
  formatFile`${appTree.read(storyFilePath, 'utf-8').replace('·', '')}`
361
360
  ).toContain(formatFile`
362
- import { storiesOf } from '@storybook/react-native';
363
- import React from 'react';
364
- import { Test, TestProps } from './test-ui-lib';
365
- const props: TestProps = {
366
- name: '',
367
- displayAge: false,
368
- };
369
- storiesOf('Test', module)
370
- .add('Primary', () => <Test {...props} />);
361
+ import type { Meta } from '@storybook/react-native';
362
+ import { Test } from './test-ui-lib';
363
+ const Story: Meta<typeof Test> = { component: Test, title: 'Test' };
364
+ export default Story;
365
+ export const Primary = { args: { name: '', displayAge: false } };
371
366
  `);
372
367
  });
373
368
  });
@@ -391,14 +386,14 @@ describe('react-native:component-story', () => {
391
386
  it('should properly set up the story', () => {
392
387
  expect(formatFile`${appTree.read(storyFilePath, 'utf-8')}`)
393
388
  .toContain(formatFile`
394
- import { storiesOf } from '@storybook/react-native';
395
- import React from 'react';
396
- import { TestUiLib, TestUiLibProps } from './test-ui-lib';
397
-
398
- const props: TestUiLibProps = {};
399
-
400
- storiesOf('TestUiLib', module)
401
- .add('Primary', () => <TestUiLib {...props} />);
389
+ import type { Meta } from '@storybook/react-native';
390
+ import { TestUiLib } from './test-ui-lib';
391
+ const Story: Meta<typeof TestUiLib> = {
392
+ component: TestUiLib,
393
+ title: 'TestUiLib',
394
+ };
395
+ export default Story;
396
+ export const Primary = { args: {} };
402
397
  `);
403
398
  });
404
399
  });
@@ -1,24 +1,32 @@
1
- <% if (hasActions) { %>
2
- import { action } from '@storybook/addon-actions';
3
- <% } %>
4
- import { storiesOf } from '@storybook/react-native';
5
- import React from 'react';
6
- import {
7
- <%= componentName %>
8
- <% if ( propsTypeName ) { %>, <%= propsTypeName %> <% } %>
9
- } from './<%= componentImportFileName %>';
1
+ <% if ( !isPlainJs ) { %>import type { Meta } from '@storybook/react-native';<% } %>
2
+ import<% if ( !isPlainJs ) { %> { <% } %> <%= componentName %> <% if ( !isPlainJs ) { %> } <% } %> from './<%= componentImportFileName %>';
10
3
 
11
- <% if (hasActions) { %>
12
- const actions = {<% for (let argType of argTypes) { %>
13
- <%= argType.name %>: action('<%- argType.actionText %>'),
14
- <% } %>};
4
+ <% if ( isPlainJs ) { %>
5
+ export default {
6
+ component: <%= componentName %>,
7
+ title: '<%= componentName %>',<% if ( argTypes && argTypes.length > 0 ) { %>
8
+ argTypes: {<% for (let argType of argTypes) { %>
9
+ <%= argType.name %>: { <%- argType.type %> : "<%- argType.actionText %>" },<% } %>
10
+ }
11
+ <% } %>
12
+ };
15
13
  <% } %>
16
14
 
17
- const props <% if ( propsTypeName ) { %>:<%= propsTypeName %><% } %> = {<% for (let prop of props) { %>
18
- <%= prop.name %>: <%- prop.defaultValue %>,
19
- <% } %>};
20
15
 
21
- storiesOf('<%= componentName %>', module)
22
- .add('Primary', () => (
23
- <<%= componentName %> {...props} <% if (hasActions) { %> {...actions} <% } %>/>
24
- ));
16
+ <% if ( !isPlainJs ) { %>
17
+ const Story: Meta<typeof <%= componentName %>> = {
18
+ component: <%= componentName %>,
19
+ title: '<%= componentName %>',<% if ( argTypes && argTypes.length > 0 ) { %>
20
+ argTypes: {<% for (let argType of argTypes) { %>
21
+ <%= argType.name %>: { <%- argType.type %> : "<%- argType.actionText %>" },<% } %>
22
+ }
23
+ <% } %>
24
+ };
25
+ export default Story;
26
+ <% } %>
27
+
28
+ export const Primary = {
29
+ args: {<% for (let prop of props) { %>
30
+ <%= prop.name %>: <%- prop.defaultValue %>,<% } %>
31
+ },
32
+ };
@@ -30,6 +30,10 @@ function storybookConfigurationGenerator(host, schema) {
30
30
  tsConfiguration: schema.tsConfiguration,
31
31
  skipFormat: true,
32
32
  });
33
+ const installRequiredPackagesTask = yield (0, devkit_1.addDependenciesToPackageJson)(host, {}, {
34
+ '@react-native-async-storage/async-storage': versions_1.reactNativeAsyncStorageVersion,
35
+ 'react-native-safe-area-context': versions_1.reactNativeSafeAreaContextVersion,
36
+ });
33
37
  addStorybookTask(host, schema.name);
34
38
  (0, create_storybook_files_1.createStorybookFiles)(host, schema);
35
39
  (0, replace_app_import_with_storybook_toggle_1.replaceAppImportWithStorybookToggle)(host, schema);
@@ -38,7 +42,7 @@ function storybookConfigurationGenerator(host, schema) {
38
42
  yield generateStories(host, schema);
39
43
  }
40
44
  yield (0, devkit_1.formatFiles)(host);
41
- return installTask;
45
+ return (0, devkit_1.runTasksInSerial)(installTask, installRequiredPackagesTask);
42
46
  });
43
47
  }
44
48
  exports.storybookConfigurationGenerator = storybookConfigurationGenerator;
@@ -47,10 +51,9 @@ function addStorybookTask(host, projectName) {
47
51
  projectConfig.targets['storybook'] = {
48
52
  executor: '@nx/react-native:storybook',
49
53
  options: {
50
- searchDir: [projectConfig.root],
51
- outputFile: './.storybook/story-loader.js',
54
+ searchDir: [projectConfig.sourceRoot],
55
+ outputFile: './.storybook/story-loader.ts',
52
56
  pattern: '**/*.stories.@(js|jsx|ts|tsx|md)',
53
- silent: false,
54
57
  },
55
58
  };
56
59
  (0, devkit_1.updateProjectConfiguration)(host, projectName, projectConfig);
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/storybook-configuration/configuration.ts"],"names":[],"mappings":";;;;AAAA,uCAQoB;AACpB,mDAAiD;AAEjD,gDAAkD;AAClD,6GAAoG;AACpG,yEAAoE;AACpE,6GAAqG;AAIrG,SAAe,eAAe,CAAC,IAAU,EAAE,MAAgC;;QACzE,MAAM,IAAA,iBAAgB,EAAC,IAAI,EAAE;YAC3B,OAAO,EAAE,MAAM,CAAC,IAAI;YACpB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;IACL,CAAC;CAAA;AAED,SAAsB,+BAA+B,CACnD,IAAU,EACV,MAAgC;;QAEhC,MAAM,EAAE,sBAAsB,EAAE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,CAAC,CAAC;AAC/D,CAAC;AAED,kBAAe,+BAA+B,CAAC;AAClC,QAAA,+BAA+B,GAAG,IAAA,2BAAkB,EAC/D,+BAA+B,CAChC,CAAC"}
1
+ {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/storybook-configuration/configuration.ts"],"names":[],"mappings":";;;;AAAA,uCAUoB;AACpB,mDAI8B;AAE9B,gDAAkD;AAClD,6GAAoG;AACpG,yEAAoE;AACpE,6GAAqG;AAIrG,SAAe,eAAe,CAAC,IAAU,EAAE,MAAgC;;QACzE,MAAM,IAAA,iBAAgB,EAAC,IAAI,EAAE;YAC3B,OAAO,EAAE,MAAM,CAAC,IAAI;YACpB,WAAW,EAAE,MAAM,CAAC,WAAW;YAC/B,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;IACL,CAAC;CAAA;AAED,SAAsB,+BAA+B,CACnD,IAAU,EACV,MAAgC;;QAEhC,MAAM,EAAE,sBAAsB,EAAE,GAAG,IAAA,sBAAa,EAE9C,eAAe,EAAE,oBAAS,CAAC,CAAC;QAE9B,MAAM,WAAW,GAAG,MAAM,sBAAsB,CAAC,IAAI,EAAE;YACrD,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,WAAW,EAAE,yBAAyB;YACtC,gBAAgB,EAAE,KAAK;YACvB,EAAE,EAAE,KAAK;YACT,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,MAAM,2BAA2B,GAAG,MAAM,IAAA,qCAA4B,EACpE,IAAI,EACJ,EAAE,EACF;YACE,2CAA2C,EACzC,yCAA8B;YAChC,gCAAgC,EAAE,4CAAiC;SACpE,CACF,CAAC;QAEF,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC;QACpC,IAAA,6CAAoB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACnC,IAAA,8EAAmC,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAClD,IAAA,6EAAkC,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAEjD,IAAI,MAAM,CAAC,eAAe,EAAE;YAC1B,MAAM,eAAe,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;SACrC;QAED,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;QACxB,OAAO,IAAA,yBAAgB,EAAC,WAAW,EAAE,2BAA2B,CAAC,CAAC;IACpE,CAAC;CAAA;AAxCD,0EAwCC;AAED,SAAS,gBAAgB,CAAC,IAAU,EAAE,WAAmB;IACvD,MAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,WAAW,CAAC,CAAC;IAClE,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG;QACnC,QAAQ,EAAE,4BAA4B;QACtC,OAAO,EAAE;YACP,SAAS,EAAE,CAAC,aAAa,CAAC,UAAU,CAAC;YACrC,UAAU,EAAE,8BAA8B;YAC1C,OAAO,EAAE,kCAAkC;SAC5C;KACF,CAAC;IAEF,IAAA,mCAA0B,EAAC,IAAI,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;AAC/D,CAAC;AAED,kBAAe,+BAA+B,CAAC;AAClC,QAAA,+BAA+B,GAAG,IAAA,2BAAkB,EAC/D,+BAA+B,CAChC,CAAC"}
@@ -20,15 +20,6 @@ describe('react-native:storybook-configuration', () => {
20
20
  let appTree;
21
21
 
22
22
  beforeEach(async () => {
23
- // jest.spyOn(fileUtils, 'readPackageJson').mockReturnValue({
24
- // devDependencies: {
25
- // '@storybook/addon-essentials': '*',
26
- // '@storybook/react-native': '*',
27
- // '@storybook/addon-ondevice-actions': '*',
28
- // '@storybook/addon-ondevice-knobs': '*',
29
- // },
30
- // });
31
-
32
23
  jest.spyOn(logger, 'warn').mockImplementation(() => {});
33
24
  jest.spyOn(logger, 'debug').mockImplementation(() => {});
34
25
  });
@@ -4,6 +4,6 @@ import { loadStories } from '<%= offsetFromRoot %>../.storybook/story-loader';
4
4
 
5
5
  configure(() => loadStories(), module);
6
6
 
7
- const StorybookUIRoot = getStorybookUI();
7
+ const StorybookUIRoot = getStorybookUI({});
8
8
 
9
9
  export default StorybookUIRoot;
@@ -0,0 +1,5 @@
1
+ // Auto-generated file created by nx
2
+ // DO NOT EDIT.
3
+ export function loadStories() {
4
+ return [];
5
+ }
@@ -0,0 +1,7 @@
1
+ import { Tree } from '@nx/devkit';
2
+ /**
3
+ * This migration is to upgrade storybook to 6.5.
4
+ * - remove react-native-storybook-loader
5
+ * - change .storybook/story-loader.js to .storybook/story-loader.ts
6
+ */
7
+ export declare function update(tree: Tree): void;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.update = void 0;
4
+ const devkit_1 = require("@nx/devkit");
5
+ /**
6
+ * This migration is to upgrade storybook to 6.5.
7
+ * - remove react-native-storybook-loader
8
+ * - change .storybook/story-loader.js to .storybook/story-loader.ts
9
+ */
10
+ function update(tree) {
11
+ (0, devkit_1.updateJson)(tree, 'package.json', (packageJson) => {
12
+ delete packageJson.devDependencies['react-native-storybook-loader'];
13
+ return packageJson;
14
+ });
15
+ if (tree.exists('.storybook/story-loader.js')) {
16
+ tree.rename('.storybook/story-loader.js', '.storybook/story-loader.ts');
17
+ }
18
+ }
19
+ exports.update = update;
20
+ //# sourceMappingURL=upgrade-storybook-6-5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade-storybook-6-5.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/migrations/update-16-1-0/upgrade-storybook-6-5.ts"],"names":[],"mappings":";;;AAAA,uCAA8C;AAE9C;;;;GAIG;AACH,SAAgB,MAAM,CAAC,IAAU;IAC/B,IAAA,mBAAU,EAAC,IAAI,EAAE,cAAc,EAAE,CAAC,WAAW,EAAE,EAAE;QAC/C,OAAO,WAAW,CAAC,eAAe,CAAC,+BAA+B,CAAC,CAAC;QACpE,OAAO,WAAW,CAAC;IACrB,CAAC,CAAC,CAAC;IACH,IAAI,IAAI,CAAC,MAAM,CAAC,4BAA4B,CAAC,EAAE;QAC7C,IAAI,CAAC,MAAM,CAAC,4BAA4B,EAAE,4BAA4B,CAAC,CAAC;KACzE;AACH,CAAC;AARD,wBAQC"}
@@ -52,13 +52,6 @@ function podInstall(iosDirectory, buildFolder) {
52
52
  }
53
53
  devkit_1.logger.info(stdout);
54
54
  if (stdout.includes('Pod installation complete')) {
55
- // Remove build folder after pod install
56
- if (buildFolder) {
57
- buildFolder = (0, path_1.join)(iosDirectory, buildFolder);
58
- if ((0, fs_extra_1.existsSync)(buildFolder)) {
59
- (0, fs_extra_1.rmdirSync)(buildFolder, { recursive: true });
60
- }
61
- }
62
55
  resolve();
63
56
  }
64
57
  else {
@@ -1 +1 @@
1
- {"version":3,"file":"pod-install-task.js","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/pod-install-task.ts"],"names":[],"mappings":";;;AAAA,iDAAqC;AACrC,2BAA8B;AAC9B,+BAA+B;AAC/B,uCAAuD;AACvD,uCAAiD;AACjD,+BAA4B;AAE5B,MAAM,sBAAsB,GAAG;UACrB,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC;;;;EAIjC,KAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC;;;EAG5C,KAAK,CAAC,IAAI,CAAC,oDAAoD,CAAC;CACjE,CAAC;AAEF;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,YAAoB,EACpB,UAAmB,IAAI,EACvB,WAAoB;IAEpB,OAAO,GAAG,EAAE;QACV,IAAI,IAAA,aAAQ,GAAE,KAAK,QAAQ,EAAE;YAC3B,eAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;YAC7D,OAAO;SACR;QAED,IAAI,CAAC,OAAO,IAAI,CAAC,IAAA,qBAAU,EAAC,IAAA,WAAI,EAAC,YAAY,EA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CAAC,CAAC;aAC3C;QACH,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAnCD,gCAmCC"}
1
+ {"version":3,"file":"pod-install-task.js","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/pod-install-task.ts"],"names":[],"mappings":";;;AAAA,iDAAqC;AACrC,2BAA8B;AAC9B,+BAA+B;AAC/B,uCAAuD;AACvD,uCAAiD;AACjD,+BAA4B;AAE5B,MAAM,sBAAsB,GAAG;UACrB,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC;;;;EAIjC,KAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC;;;EAG5C,KAAK,CAAC,IAAI,CAAC,oDAAoD,CAAC;CACjE,CAAC;AAEF;;;;GAIG;AACH,SAAgB,aAAa,CAC3B,YAAoB,EACpB,UAAmB,IAAI,EACvB,WAAoB;IAEpB,OAAO,GAAG,EAAE;QACV,IAAI,IAAA,aAAQ,GAAE,KAAK,QAAQ,EAAE;YAC3B,eAAM,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAC;YAC7D,OAAO;SACR;QAED,IAAI,CAAC,OAAO,IAAI,CAAC,IAAA,qBAAU,EAAC,IAAA,WAAI,EAAC,YAAY,EAAE,SAAS,CAAC,CAAC,EAAE;YAC1D,eAAM,CAAC,IAAI,CAAC,wBAAwB,CAAC,CAAC;YACtC,OAAO;SACR;QAED,eAAM,CAAC,IAAI,CAAC,iCAAiC,YAAY,GAAG,CAAC,CAAC;QAE9D,OAAO,UAAU,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAC/C,CAAC,CAAC;AACJ,CAAC;AApBD,sCAoBC;AAED,SAAgB,UAAU,CACxB,YAAoB,EACpB,WAAoB;IAEpB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAA,oBAAI,EACF,aAAa,EACb;YACE,GAAG,EAAE,YAAY;SAClB,EACD,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;YACxB,IAAI,KAAK,EAAE;gBACT,eAAM,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAC5B,MAAM,CAAC,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;aAC3C;YACD,IAAI,MAAM,EAAE;gBACV,eAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;gBACrB,MAAM,CAAC,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;aAC3C;YACD,eAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YACpB,IAAI,MAAM,CAAC,QAAQ,CAAC,2BAA2B,CAAC,EAAE;gBAChD,OAAO,EAAE,CAAC;aACX;iBAAM;gBACL,MAAM,CAAC,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC;aAC3C;QACH,CAAC,CACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AA5BD,gCA4BC"}
@@ -16,3 +16,5 @@ export declare const jestReactNativeVersion = "18.0.0";
16
16
  export declare const reactNativeSvgTransformerVersion = "1.0.0";
17
17
  export declare const reactNativeSvgVersion = "13.9.0";
18
18
  export declare const babelRuntimeVersion = "7.21.0";
19
+ export declare const reactNativeAsyncStorageVersion = "1.18.1";
20
+ export declare const reactNativeSafeAreaContextVersion = "4.5.1";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.typesReactVersion = exports.reactTestRendererVersion = exports.reactDomVersion = exports.reactVersion = exports.reactNativeCommunityCliAndroid = exports.reactNativeCommunityCliIos = exports.reactNativeCommunityCli = exports.metroVersion = exports.typesNodeVersion = exports.typesReactNativeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
3
+ exports.reactNativeSafeAreaContextVersion = exports.reactNativeAsyncStorageVersion = exports.babelRuntimeVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.jestReactNativeVersion = exports.testingLibraryJestNativeVersion = exports.testingLibraryReactNativeVersion = exports.typesReactVersion = exports.reactTestRendererVersion = exports.reactDomVersion = exports.reactVersion = exports.reactNativeCommunityCliAndroid = exports.reactNativeCommunityCliIos = exports.reactNativeCommunityCli = exports.metroVersion = exports.typesNodeVersion = exports.typesReactNativeVersion = exports.reactNativeVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
5
  exports.reactNativeVersion = '0.71.7';
6
6
  exports.typesReactNativeVersion = '0.71.6';
@@ -19,4 +19,6 @@ exports.jestReactNativeVersion = '18.0.0';
19
19
  exports.reactNativeSvgTransformerVersion = '1.0.0';
20
20
  exports.reactNativeSvgVersion = '13.9.0';
21
21
  exports.babelRuntimeVersion = '7.21.0';
22
+ exports.reactNativeAsyncStorageVersion = '1.18.1';
23
+ exports.reactNativeSafeAreaContextVersion = '4.5.1';
22
24
  //# sourceMappingURL=versions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"versions.js","sourceRoot":"","sources":["../../../../../packages/react-native/src/utils/versions.ts"],"names":[],"mappings":";;;AAAa,QAAA,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,OAAO,CAAC;AAElD,QAAA,kBAAkB,GAAG,QAAQ,CAAC;AAC9B,QAAA,uBAAuB,GAAG,QAAQ,CAAC;AAEnC,QAAA,gBAAgB,GAAG,SAAS,CAAC;AAE7B,QAAA,YAAY,GAAG,QAAQ,CAAC;AAExB,QAAA,uBAAuB,GAAG,QAAQ,CAAC;AACnC,QAAA,0BAA0B,GAAG,QAAQ,CAAC;AACtC,QAAA,8BAA8B,GAAG,QAAQ,CAAC;AAE1C,QAAA,YAAY,GAAG,QAAQ,CAAC;AACxB,QAAA,eAAe,GAAG,QAAQ,CAAC;AAC3B,QAAA,wBAAwB,GAAG,Q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-generated file created by react-native-storybook-loader
2
- // Do not edit.
3
- //
4
- // https://github.com/elderfo/react-native-storybook-loader.git
5
-
6
- function loadStories() {}
7
-
8
- const stories = [];
9
-
10
- module.exports = {
11
- loadStories,
12
- stories,
13
- };