@nrwl/react-native 13.8.1 → 13.8.4-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.
Files changed (66) hide show
  1. package/executors.json +10 -0
  2. package/generators.json +36 -0
  3. package/migrations.json +41 -0
  4. package/package.json +10 -9
  5. package/src/executors/build-android/build-android.impl.js +8 -6
  6. package/src/executors/build-android/build-android.impl.js.map +1 -1
  7. package/src/executors/build-android/build-android.impl.ts +8 -10
  8. package/src/executors/storybook/compat.d.ts +2 -0
  9. package/src/executors/storybook/compat.js +6 -0
  10. package/src/executors/storybook/compat.js.map +1 -0
  11. package/src/executors/storybook/schema.d.ts +7 -0
  12. package/src/executors/storybook/schema.json +28 -0
  13. package/src/executors/storybook/storybook.impl.d.ts +5 -0
  14. package/src/executors/storybook/storybook.impl.js +63 -0
  15. package/src/executors/storybook/storybook.impl.js.map +1 -0
  16. package/src/executors/storybook/storybook.impl.ts +92 -0
  17. package/src/generators/application/files/app/android/app/build.gradle.template +1 -1
  18. package/src/generators/application/files/app/android/app/src/main/res/drawable/rn_edit_text_material.xml +29 -0
  19. package/src/generators/application/files/app/android/app/src/main/res/values/styles.xml +1 -0
  20. package/src/generators/application/files/app/android/build.gradle.template +7 -3
  21. package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  22. package/src/generators/application/files/app/android/gradle.properties +1 -1
  23. package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +29 -72
  24. package/src/generators/application/files/app/metro.config.js.template +1 -0
  25. package/src/generators/application/files/app/package.json.template +2 -1
  26. package/src/generators/application/files/app/src/app/App.tsx.template +1 -1
  27. package/src/generators/component-story/component-story.d.ts +8 -0
  28. package/src/generators/component-story/component-story.js +95 -0
  29. package/src/generators/component-story/component-story.js.map +1 -0
  30. package/src/generators/component-story/component-story.spec.ts +445 -0
  31. package/src/generators/component-story/files/__componentFileName__.stories.__fileExt__ +25 -0
  32. package/src/generators/component-story/schema.d.ts +4 -0
  33. package/src/generators/component-story/schema.json +25 -0
  34. package/src/generators/init/init.js +1 -1
  35. package/src/generators/init/init.js.map +1 -1
  36. package/src/generators/stories/schema.d.ts +3 -0
  37. package/src/generators/stories/schema.json +18 -0
  38. package/src/generators/stories/stories-app.spec.ts +66 -0
  39. package/src/generators/stories/stories-lib.spec.ts +86 -0
  40. package/src/generators/stories/stories.d.ts +7 -0
  41. package/src/generators/stories/stories.js +66 -0
  42. package/src/generators/stories/stories.js.map +1 -0
  43. package/src/generators/storybook-configuration/configuration.d.ts +5 -0
  44. package/src/generators/storybook-configuration/configuration.js +52 -0
  45. package/src/generators/storybook-configuration/configuration.js.map +1 -0
  46. package/src/generators/storybook-configuration/configuration.spec.ts +142 -0
  47. package/src/generators/storybook-configuration/files/app/storybook.ts.template +9 -0
  48. package/src/generators/storybook-configuration/files/app/toggle-storybook.tsx.template +114 -0
  49. package/src/generators/storybook-configuration/files/root/story-loader.js.template +13 -0
  50. package/src/generators/storybook-configuration/lib/create-storybook-files.d.ts +6 -0
  51. package/src/generators/storybook-configuration/lib/create-storybook-files.js +46 -0
  52. package/src/generators/storybook-configuration/lib/create-storybook-files.js.map +1 -0
  53. package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.d.ts +7 -0
  54. package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js +30 -0
  55. package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js.map +1 -0
  56. package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts +65 -0
  57. package/src/generators/storybook-configuration/schema.d.ts +9 -0
  58. package/src/generators/storybook-configuration/schema.json +38 -0
  59. package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js +3 -8
  60. package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js.map +1 -1
  61. package/src/utils/format-file.d.ts +1 -0
  62. package/src/utils/format-file.js +17 -0
  63. package/src/utils/format-file.js.map +1 -0
  64. package/src/utils/versions.d.ts +9 -8
  65. package/src/utils/versions.js +11 -10
  66. package/src/utils/versions.js.map +1 -1
@@ -7,13 +7,11 @@
7
7
  objects = {
8
8
 
9
9
  /* Begin PBXBuildFile section */
10
- 00E356F31AD99517003FC87E /* <%= className %>Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* <%= className %>Tests.m */; };
11
10
  13B07FBC1A68108700A75B9A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.m */; };
12
11
  13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13
12
  13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
14
13
  81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
15
- 9C141382382E3C900FF41CFE /* libPods-<%= className %>-<%= className %>Tests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1743840A4091A253DF94ADF3 /* libPods-<%= className %>-<%= className %>Tests.a */; };
16
- CB28F6E71BFFBBFFE4D6CA71 /* libPods-<%= className %>.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 65E4FAB80E3D35EA640E54A7 /* libPods-<%= className %>.a */; };
14
+ EDFF86BB34F0D74BE0446172 /* libPods-<%= className %>.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BD2D4F986838457D63908AA /* libPods-<%= className %>.a */; };
17
15
  /* End PBXBuildFile section */
18
16
 
19
17
  /* Begin PBXContainerItemProxy section */
@@ -34,11 +32,11 @@
34
32
  13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = <%= className %>/Images.xcassets; sourceTree = "<group>"; };
35
33
  13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = <%= className %>/Info.plist; sourceTree = "<group>"; };
36
34
  13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = <%= className %>/main.m; sourceTree = "<group>"; };
37
- 56DF1300CF795902963DA15C /* Pods-<%= className %>.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-<%= className %>.release.xcconfig"; path = "Target Support Files/Pods-<%= className %>/Pods-<%= className %>.release.xcconfig"; sourceTree = "<group>"; };
38
- 65E4FAB80E3D35EA640E54A7 /* libPods-<%= className %>.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-<%= className %>.a"; sourceTree = BUILT_PRODUCTS_DIR; };
35
+ 29A87B01F483BC8B4574840A /* Pods-<%= className %>.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-<%= className %>.debug.xcconfig"; path = "Target Support Files/Pods-<%= className %>/Pods-<%= className %>.debug.xcconfig"; sourceTree = "<group>"; };
36
+ 2BD2D4F986838457D63908AA /* libPods-<%= className %>.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-<%= className %>.a"; sourceTree = BUILT_PRODUCTS_DIR; };
39
37
  81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = <%= className %>/LaunchScreen.storyboard; sourceTree = "<group>"; };
40
- D06EE1839428A1A3F684470B /* Pods-<%= className %>.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-<%= className %>.debug.xcconfig"; path = "Target Support Files/Pods-<%= className %>/Pods-<%= className %>.debug.xcconfig"; sourceTree = "<group>"; };
41
38
  ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
39
+ EF215046929D3E61DF7A9DAC /* Pods-<%= className %>.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-<%= className %>.release.xcconfig"; path = "Target Support Files/Pods-<%= className %>/Pods-<%= className %>.release.xcconfig"; sourceTree = "<group>"; };
42
40
  /* End PBXFileReference section */
43
41
 
44
42
  /* Begin PBXFrameworksBuildPhase section */
@@ -46,7 +44,7 @@
46
44
  isa = PBXFrameworksBuildPhase;
47
45
  buildActionMask = 2147483647;
48
46
  files = (
49
- CB28F6E71BFFBBFFE4D6CA71 /* libPods-<%= className %>.a in Frameworks */,
47
+ EDFF86BB34F0D74BE0446172 /* libPods-<%= className %>.a in Frameworks */,
50
48
  );
51
49
  runOnlyForDeploymentPostprocessing = 0;
52
50
  };
@@ -78,7 +76,7 @@
78
76
  isa = PBXGroup;
79
77
  children = (
80
78
  ED297162215061F000B7C4FE /* JavaScriptCore.framework */,
81
- 65E4FAB80E3D35EA640E54A7 /* libPods-<%= className %>.a */,
79
+ 2BD2D4F986838457D63908AA /* libPods-<%= className %>.a */,
82
80
  );
83
81
  name = Frameworks;
84
82
  sourceTree = "<group>";
@@ -97,7 +95,7 @@
97
95
  832341AE1AAA6A7D00B99B32 /* Libraries */,
98
96
  83CBBA001A601CBA00E9B192 /* Products */,
99
97
  2D16E6871FA4F8E400B85C8A /* Frameworks */,
100
- CC467A8CA32BFDD637A07875 /* Pods */,
98
+ AD59FE128C11EAE8EBF9813F /* Pods */,
101
99
  );
102
100
  indentWidth = 2;
103
101
  sourceTree = "<group>";
@@ -112,11 +110,11 @@
112
110
  name = Products;
113
111
  sourceTree = "<group>";
114
112
  };
115
- CC467A8CA32BFDD637A07875 /* Pods */ = {
113
+ AD59FE128C11EAE8EBF9813F /* Pods */ = {
116
114
  isa = PBXGroup;
117
115
  children = (
118
- D06EE1839428A1A3F684470B /* Pods-<%= className %>.debug.xcconfig */,
119
- 56DF1300CF795902963DA15C /* Pods-<%= className %>.release.xcconfig */,
116
+ 29A87B01F483BC8B4574840A /* Pods-<%= className %>.debug.xcconfig */,
117
+ EF215046929D3E61DF7A9DAC /* Pods-<%= className %>.release.xcconfig */,
120
118
  );
121
119
  name = Pods;
122
120
  path = Pods;
@@ -129,14 +127,14 @@
129
127
  isa = PBXNativeTarget;
130
128
  buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "<%= className %>" */;
131
129
  buildPhases = (
132
- 58252BD862A890A972880CBA /* [CP] Check Pods Manifest.lock */,
130
+ D74C9A91184D45852CB535C0 /* [CP] Check Pods Manifest.lock */,
133
131
  FD10A7F022414F080027D42C /* Start Packager */,
134
132
  13B07F871A680F5B00A75B9A /* Sources */,
135
133
  13B07F8C1A680F5B00A75B9A /* Frameworks */,
136
134
  13B07F8E1A680F5B00A75B9A /* Resources */,
137
135
  00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
138
- 02884E84544B8E84B8B8F340 /* [CP] Embed Pods Frameworks */,
139
- F0F4F71C107914435FC29DBB /* [CP] Copy Pods Resources */,
136
+ E4661260B2F8995764FA3223 /* [CP] Embed Pods Frameworks */,
137
+ 589CD817700AC23390FB1CF7 /* [CP] Copy Pods Resources */,
140
138
  );
141
139
  buildRules = (
142
140
  );
@@ -214,65 +212,26 @@
214
212
  );
215
213
  runOnlyForDeploymentPostprocessing = 0;
216
214
  shellPath = /bin/sh;
217
- shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh <%= entryFileAbsolutePath %>\n";
215
+ shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
218
216
  };
219
- 02884E84544B8E84B8B8F340 /* [CP] Embed Pods Frameworks */ = {
217
+ 589CD817700AC23390FB1CF7 /* [CP] Copy Pods Resources */ = {
220
218
  isa = PBXShellScriptBuildPhase;
221
219
  buildActionMask = 2147483647;
222
220
  files = (
223
221
  );
224
222
  inputFileListPaths = (
225
- "${PODS_ROOT}/Target Support Files/Pods-<%= className %>/Pods-<%= className %>-frameworks-${CONFIGURATION}-input-files.xcfilelist",
226
- );
227
- name = "[CP] Embed Pods Frameworks";
228
- outputFileListPaths = (
229
- "${PODS_ROOT}/Target Support Files/Pods-<%= className %>/Pods-<%= className %>-frameworks-${CONFIGURATION}-output-files.xcfilelist",
230
- );
231
- runOnlyForDeploymentPostprocessing = 0;
232
- shellPath = /bin/sh;
233
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-<%= className %>/Pods-<%= className %>-frameworks.sh\"\n";
234
- showEnvVarsInLog = 0;
235
- };
236
- 0712EA5C2D09350540097B86 /* [CP] Copy Pods Resources */ = {
237
- isa = PBXShellScriptBuildPhase;
238
- buildActionMask = 2147483647;
239
- files = (
240
- );
241
- inputFileListPaths = (
242
- "${PODS_ROOT}/Target Support Files/Pods-<%= className %>-<%= className %>Tests/Pods-<%= className %>-<%= className %>Tests-resources-${CONFIGURATION}-input-files.xcfilelist",
223
+ "${PODS_ROOT}/Target Support Files/Pods-<%= className %>/Pods-<%= className %>-resources-${CONFIGURATION}-input-files.xcfilelist",
243
224
  );
244
225
  name = "[CP] Copy Pods Resources";
245
226
  outputFileListPaths = (
246
- "${PODS_ROOT}/Target Support Files/Pods-<%= className %>-<%= className %>Tests/Pods-<%= className %>-<%= className %>Tests-resources-${CONFIGURATION}-output-files.xcfilelist",
247
- );
248
- runOnlyForDeploymentPostprocessing = 0;
249
- shellPath = /bin/sh;
250
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-<%= className %>-<%= className %>Tests/Pods-<%= className %>-<%= className %>Tests-resources.sh\"\n";
251
- showEnvVarsInLog = 0;
252
- };
253
- 44872F21BC689CC8A347F488 /* [CP] Check Pods Manifest.lock */ = {
254
- isa = PBXShellScriptBuildPhase;
255
- buildActionMask = 2147483647;
256
- files = (
257
- );
258
- inputFileListPaths = (
259
- );
260
- inputPaths = (
261
- "${PODS_PODFILE_DIR_PATH}/Podfile.lock",
262
- "${PODS_ROOT}/Manifest.lock",
263
- );
264
- name = "[CP] Check Pods Manifest.lock";
265
- outputFileListPaths = (
266
- );
267
- outputPaths = (
268
- "$(DERIVED_FILE_DIR)/Pods-<%= className %>-<%= className %>Tests-checkManifestLockResult.txt",
227
+ "${PODS_ROOT}/Target Support Files/Pods-<%= className %>/Pods-<%= className %>-resources-${CONFIGURATION}-output-files.xcfilelist",
269
228
  );
270
229
  runOnlyForDeploymentPostprocessing = 0;
271
230
  shellPath = /bin/sh;
272
- shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
231
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-<%= className %>/Pods-<%= className %>-resources.sh\"\n";
273
232
  showEnvVarsInLog = 0;
274
233
  };
275
- 58252BD862A890A972880CBA /* [CP] Check Pods Manifest.lock */ = {
234
+ D74C9A91184D45852CB535C0 /* [CP] Check Pods Manifest.lock */ = {
276
235
  isa = PBXShellScriptBuildPhase;
277
236
  buildActionMask = 2147483647;
278
237
  files = (
@@ -294,21 +253,21 @@
294
253
  shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
295
254
  showEnvVarsInLog = 0;
296
255
  };
297
- F0F4F71C107914435FC29DBB /* [CP] Copy Pods Resources */ = {
256
+ E4661260B2F8995764FA3223 /* [CP] Embed Pods Frameworks */ = {
298
257
  isa = PBXShellScriptBuildPhase;
299
258
  buildActionMask = 2147483647;
300
259
  files = (
301
260
  );
302
261
  inputFileListPaths = (
303
- "${PODS_ROOT}/Target Support Files/Pods-<%= className %>/Pods-<%= className %>-resources-${CONFIGURATION}-input-files.xcfilelist",
262
+ "${PODS_ROOT}/Target Support Files/Pods-<%= className %>/Pods-<%= className %>-frameworks-${CONFIGURATION}-input-files.xcfilelist",
304
263
  );
305
- name = "[CP] Copy Pods Resources";
264
+ name = "[CP] Embed Pods Frameworks";
306
265
  outputFileListPaths = (
307
- "${PODS_ROOT}/Target Support Files/Pods-<%= className %>/Pods-<%= className %>-resources-${CONFIGURATION}-output-files.xcfilelist",
266
+ "${PODS_ROOT}/Target Support Files/Pods-<%= className %>/Pods-<%= className %>-frameworks-${CONFIGURATION}-output-files.xcfilelist",
308
267
  );
309
268
  runOnlyForDeploymentPostprocessing = 0;
310
269
  shellPath = /bin/sh;
311
- shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-<%= className %>/Pods-<%= className %>-resources.sh\"\n";
270
+ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-<%= className %>/Pods-<%= className %>-frameworks.sh\"\n";
312
271
  showEnvVarsInLog = 0;
313
272
  };
314
273
  FD10A7F022414F080027D42C /* Start Packager */ = {
@@ -355,7 +314,7 @@
355
314
  /* Begin XCBuildConfiguration section */
356
315
  13B07F941A680F5B00A75B9A /* Debug */ = {
357
316
  isa = XCBuildConfiguration;
358
- baseConfigurationReference = D06EE1839428A1A3F684470B /* Pods-<%= className %>.debug.xcconfig */;
317
+ baseConfigurationReference = 29A87B01F483BC8B4574840A /* Pods-<%= className %>.debug.xcconfig */;
359
318
  buildSettings = {
360
319
  ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
361
320
  CLANG_ENABLE_MODULES = YES;
@@ -381,7 +340,7 @@
381
340
  };
382
341
  13B07F951A680F5B00A75B9A /* Release */ = {
383
342
  isa = XCBuildConfiguration;
384
- baseConfigurationReference = 56DF1300CF795902963DA15C /* Pods-<%= className %>.release.xcconfig */;
343
+ baseConfigurationReference = EF215046929D3E61DF7A9DAC /* Pods-<%= className %>.release.xcconfig */;
385
344
  buildSettings = {
386
345
  ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
387
346
  CLANG_ENABLE_MODULES = YES;
@@ -396,7 +355,7 @@
396
355
  "-ObjC",
397
356
  "-lc++",
398
357
  );
399
- PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
358
+ PRODUCT_BUNDLE_IDENTIFIER = "org.$(PRODUCT_NAME:rfc1034identifier)";
400
359
  PRODUCT_NAME = <%= className %>;
401
360
  SWIFT_VERSION = 5.0;
402
361
  VERSIONING_SYSTEM = "apple-generic";
@@ -436,7 +395,7 @@
436
395
  COPY_PHASE_STRIP = NO;
437
396
  ENABLE_STRICT_OBJC_MSGSEND = YES;
438
397
  ENABLE_TESTABILITY = YES;
439
- "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
398
+ "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
440
399
  GCC_C_LANGUAGE_STANDARD = gnu99;
441
400
  GCC_DYNAMIC_NO_PIC = NO;
442
401
  GCC_NO_COMMON_BLOCKS = YES;
@@ -460,7 +419,6 @@
460
419
  LIBRARY_SEARCH_PATHS = (
461
420
  "\"$(SDKROOT)/usr/lib/swift\"",
462
421
  "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
463
- "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
464
422
  "\"$(inherited)\"",
465
423
  );
466
424
  MTL_ENABLE_DEBUG_INFO = YES;
@@ -502,7 +460,7 @@
502
460
  COPY_PHASE_STRIP = YES;
503
461
  ENABLE_NS_ASSERTIONS = NO;
504
462
  ENABLE_STRICT_OBJC_MSGSEND = YES;
505
- "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 ";
463
+ "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
506
464
  GCC_C_LANGUAGE_STANDARD = gnu99;
507
465
  GCC_NO_COMMON_BLOCKS = YES;
508
466
  GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -519,7 +477,6 @@
519
477
  LIBRARY_SEARCH_PATHS = (
520
478
  "\"$(SDKROOT)/usr/lib/swift\"",
521
479
  "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"",
522
- "\"$(TOOLCHAIN_DIR)/usr/lib/swift-5.0/$(PLATFORM_NAME)\"",
523
480
  "\"$(inherited)\"",
524
481
  );
525
482
  MTL_ENABLE_DEBUG_INFO = NO;
@@ -19,6 +19,7 @@ module.exports = (async () => {
19
19
  resolver: {
20
20
  assetExts: assetExts.filter((ext) => ext !== 'svg'),
21
21
  sourceExts: [...sourceExts, 'svg'],
22
+ resolverMainFields: ['sbmodern', 'browser', 'main'],
22
23
  },
23
24
  },
24
25
  {
@@ -8,6 +8,7 @@
8
8
  "react": "*",
9
9
  "react-native": "*",
10
10
  "react-native-config": "*",
11
- "react-native-svg": "*"
11
+ "react-native-svg": "*",
12
+ "@react-native-async-storage/async-storage": "*"
12
13
  }
13
14
  }
@@ -26,7 +26,7 @@ import GitHub from './icons/github.svg';
26
26
  import Terminal from './icons/terminal.svg';
27
27
  import Heart from './icons/heart.svg';
28
28
 
29
- const App = () => {
29
+ export const App = () => {
30
30
  const [whatsNextYCoord, setWhatsNextYCoord] = useState<number>(0);
31
31
  const scrollViewRef = useRef<null | ScrollView>(null);
32
32
 
@@ -0,0 +1,8 @@
1
+ import { Tree } from '@nrwl/devkit';
2
+ import * as ts from 'typescript';
3
+ import { CreateComponentStoriesFileSchema } from './schema';
4
+ export declare function getArgsDefaultValue(property: ts.SyntaxKind): string;
5
+ export declare function createComponentStoriesFile(host: Tree, { project, componentPath }: CreateComponentStoriesFileSchema): void;
6
+ export declare function componentStoryGenerator(host: Tree, schema: CreateComponentStoriesFileSchema): Promise<void>;
7
+ export default componentStoryGenerator;
8
+ export declare const componentStorySchematic: (options: CreateComponentStoriesFileSchema) => (tree: any, context: any) => Promise<any>;
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.componentStorySchematic = exports.componentStoryGenerator = exports.createComponentStoriesFile = exports.getArgsDefaultValue = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nrwl/devkit");
6
+ const ts = require("typescript");
7
+ const ast_utils_1 = require("@nrwl/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;
23
+ function createComponentStoriesFile(host, { project, componentPath }) {
24
+ const proj = (0, devkit_1.getProjects)(host).get(project);
25
+ const sourceRoot = proj.sourceRoot;
26
+ const componentFilePath = (0, devkit_1.joinPathFragments)(sourceRoot, componentPath);
27
+ const componentDirectory = componentFilePath.replace(componentFilePath.slice(componentFilePath.lastIndexOf('/')), '');
28
+ const isPlainJs = componentFilePath.endsWith('.jsx') || componentFilePath.endsWith('.js');
29
+ let fileExt = 'tsx';
30
+ if (componentFilePath.endsWith('.jsx')) {
31
+ fileExt = 'jsx';
32
+ }
33
+ else if (componentFilePath.endsWith('.js')) {
34
+ fileExt = 'js';
35
+ }
36
+ const componentFileName = componentFilePath
37
+ .slice(componentFilePath.lastIndexOf('/') + 1)
38
+ .replace('.tsx', '')
39
+ .replace('.jsx', '')
40
+ .replace('.js', '');
41
+ const name = componentFileName;
42
+ const contents = host.read(componentFilePath, 'utf-8');
43
+ if (contents === null) {
44
+ throw new Error(`Failed to read ${componentFilePath}`);
45
+ }
46
+ const sourceFile = ts.createSourceFile(componentFilePath, contents, ts.ScriptTarget.Latest, true);
47
+ const cmpDeclaration = (0, ast_utils_1.getComponentName)(sourceFile);
48
+ if (!cmpDeclaration) {
49
+ throw new Error(`Could not find any React Native component in file ${componentFilePath}`);
50
+ }
51
+ const propsInterface = (0, ast_utils_1.getComponentPropsInterface)(sourceFile);
52
+ let propsTypeName = null;
53
+ let props = [];
54
+ let argTypes = [];
55
+ if (propsInterface) {
56
+ propsTypeName = propsInterface.name.text;
57
+ props = propsInterface.members.map((member) => {
58
+ if (member.type.kind === ts.SyntaxKind.FunctionType) {
59
+ argTypes.push({
60
+ name: member.name.text,
61
+ type: 'action',
62
+ actionText: `${member.name.text} executed!`,
63
+ });
64
+ }
65
+ else {
66
+ return {
67
+ name: member.name.text,
68
+ defaultValue: getArgsDefaultValue(member.type.kind),
69
+ };
70
+ }
71
+ });
72
+ props = props.filter((p) => p && p.defaultValue !== undefined);
73
+ }
74
+ (0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, './files'), (0, devkit_1.normalizePath)(componentDirectory), {
75
+ componentFileName: name,
76
+ propsTypeName,
77
+ props,
78
+ argTypes,
79
+ componentName: cmpDeclaration.name.text,
80
+ isPlainJs,
81
+ fileExt,
82
+ hasActions: argTypes && argTypes.length,
83
+ });
84
+ }
85
+ exports.createComponentStoriesFile = createComponentStoriesFile;
86
+ function componentStoryGenerator(host, schema) {
87
+ return (0, tslib_1.__awaiter)(this, void 0, void 0, function* () {
88
+ createComponentStoriesFile(host, schema);
89
+ yield (0, devkit_1.formatFiles)(host);
90
+ });
91
+ }
92
+ exports.componentStoryGenerator = componentStoryGenerator;
93
+ exports.default = componentStoryGenerator;
94
+ exports.componentStorySchematic = (0, devkit_1.convertNxGenerator)(componentStoryGenerator);
95
+ //# sourceMappingURL=component-story.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-story.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/component-story/component-story.ts"],"names":[],"mappings":";;;;AAAA,yCAQsB;AACtB,iCAAiC;AACjC,+DAGyC;AAGzC,SAAgB,mBAAmB,CAAC,QAAuB;IACzD,MAAM,iBAAiB,GAAwB;QAC7C,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,IAAI;QACnC,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QAChC,CAAC,EAAE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,KAAK;KACtC,CAAC;IAEF,MAAM,aAAa,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,OAAO,aAAa,KAAK,SAAS,EAAE;QACtC,OAAO,IAAI,CAAC;KACb;SAAM;QACL,OAAO,aAAa,CAAC;KACtB;AACH,CAAC;AAbD,kDAaC;AAED,SAAgB,0BAA0B,CACxC,IAAU,EACV,EAAE,OAAO,EAAE,aAAa,EAAoC;IAE5D,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,IAAA,0BAAiB,EAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IACvE,MAAM,kBAAkB,GAAG,iBAAiB,CAAC,OAAO,CAClD,iBAAiB,CAAC,KAAK,CAAC,iBAAiB,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAC3D,EAAE,CACH,CAAC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