@nrwl/react-native 16.0.0-beta.0 → 16.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/executors.json +40 -40
- package/generators.json +2 -107
- package/index.d.ts +1 -5
- package/index.js +2 -11
- package/index.js.map +1 -1
- package/package.json +7 -25
- package/plugins/jest/svg-mock.js.map +1 -1
- package/plugins/with-nx-metro.d.ts +1 -8
- package/plugins/with-nx-metro.js +2 -29
- package/plugins/with-nx-metro.js.map +1 -1
- package/.eslintrc.json +0 -19
- package/README.md +0 -63
- package/migrations.json +0 -1285
- package/plugins/metro-resolver.d.ts +0 -1
- package/plugins/metro-resolver.js +0 -135
- package/plugins/metro-resolver.js.map +0 -1
- package/project.json +0 -61
- package/src/executors/build-android/build-android.impl.d.ts +0 -6
- package/src/executors/build-android/build-android.impl.js +0 -76
- package/src/executors/build-android/build-android.impl.js.map +0 -1
- package/src/executors/build-android/build-android.impl.ts +0 -108
- package/src/executors/build-android/compat.d.ts +0 -2
- package/src/executors/build-android/compat.js +0 -6
- package/src/executors/build-android/compat.js.map +0 -1
- package/src/executors/build-android/schema.d.ts +0 -31
- package/src/executors/build-android/schema.json +0 -102
- package/src/executors/build-ios/build-ios.impl.d.ts +0 -6
- package/src/executors/build-ios/build-ios.impl.js +0 -77
- package/src/executors/build-ios/build-ios.impl.js.map +0 -1
- package/src/executors/build-ios/build-ios.impl.ts +0 -118
- package/src/executors/build-ios/compat.d.ts +0 -2
- package/src/executors/build-ios/compat.js +0 -6
- package/src/executors/build-ios/compat.js.map +0 -1
- package/src/executors/build-ios/schema.d.ts +0 -22
- package/src/executors/build-ios/schema.json +0 -106
- package/src/executors/bundle/bundle.impl.d.ts +0 -6
- package/src/executors/bundle/bundle.impl.js +0 -58
- package/src/executors/bundle/bundle.impl.js.map +0 -1
- package/src/executors/bundle/bundle.impl.ts +0 -76
- package/src/executors/bundle/compat.d.ts +0 -2
- package/src/executors/bundle/compat.js +0 -6
- package/src/executors/bundle/compat.js.map +0 -1
- package/src/executors/bundle/schema.d.ts +0 -16
- package/src/executors/bundle/schema.json +0 -92
- package/src/executors/ensure-symlink/compat.d.ts +0 -2
- package/src/executors/ensure-symlink/compat.js +0 -6
- package/src/executors/ensure-symlink/compat.js.map +0 -1
- package/src/executors/ensure-symlink/ensure-symlink.impl.d.ts +0 -5
- package/src/executors/ensure-symlink/ensure-symlink.impl.js +0 -13
- package/src/executors/ensure-symlink/ensure-symlink.impl.js.map +0 -1
- package/src/executors/ensure-symlink/ensure-symlink.impl.ts +0 -18
- package/src/executors/ensure-symlink/schema.json +0 -11
- package/src/executors/pod-install/compat.d.ts +0 -2
- package/src/executors/pod-install/compat.js +0 -6
- package/src/executors/pod-install/compat.js.map +0 -1
- package/src/executors/pod-install/pod-install.impl.d.ts +0 -6
- package/src/executors/pod-install/pod-install.impl.js +0 -15
- package/src/executors/pod-install/pod-install.impl.js.map +0 -1
- package/src/executors/pod-install/pod-install.impl.ts +0 -21
- package/src/executors/pod-install/schema.d.ts +0 -3
- package/src/executors/pod-install/schema.json +0 -18
- package/src/executors/run-android/compat.d.ts +0 -2
- package/src/executors/run-android/compat.js +0 -6
- package/src/executors/run-android/compat.js.map +0 -1
- package/src/executors/run-android/run-android.impl.d.ts +0 -6
- package/src/executors/run-android/run-android.impl.js +0 -72
- package/src/executors/run-android/run-android.impl.js.map +0 -1
- package/src/executors/run-android/run-android.impl.ts +0 -110
- package/src/executors/run-android/schema.d.ts +0 -24
- package/src/executors/run-android/schema.json +0 -121
- package/src/executors/run-ios/compat.d.ts +0 -2
- package/src/executors/run-ios/compat.js +0 -6
- package/src/executors/run-ios/compat.js.map +0 -1
- package/src/executors/run-ios/run-ios.impl.d.ts +0 -6
- package/src/executors/run-ios/run-ios.impl.js +0 -78
- package/src/executors/run-ios/run-ios.impl.js.map +0 -1
- package/src/executors/run-ios/run-ios.impl.ts +0 -120
- package/src/executors/run-ios/schema.d.ts +0 -12
- package/src/executors/run-ios/schema.json +0 -119
- package/src/executors/start/compat.d.ts +0 -2
- package/src/executors/start/compat.js +0 -6
- package/src/executors/start/compat.js.map +0 -1
- package/src/executors/start/lib/is-packager-running.d.ts +0 -1
- package/src/executors/start/lib/is-packager-running.js +0 -19
- package/src/executors/start/lib/is-packager-running.js.map +0 -1
- package/src/executors/start/schema.d.ts +0 -7
- package/src/executors/start/schema.json +0 -28
- package/src/executors/start/start.impl.d.ts +0 -8
- package/src/executors/start/start.impl.js +0 -99
- package/src/executors/start/start.impl.js.map +0 -1
- package/src/executors/start/start.impl.ts +0 -120
- package/src/executors/storybook/compat.d.ts +0 -2
- package/src/executors/storybook/compat.js +0 -6
- package/src/executors/storybook/compat.js.map +0 -1
- package/src/executors/storybook/schema.d.ts +0 -7
- package/src/executors/storybook/schema.json +0 -34
- package/src/executors/storybook/storybook.impl.d.ts +0 -5
- package/src/executors/storybook/storybook.impl.js +0 -76
- package/src/executors/storybook/storybook.impl.js.map +0 -1
- package/src/executors/storybook/storybook.impl.ts +0 -105
- package/src/executors/sync-deps/compat.d.ts +0 -2
- package/src/executors/sync-deps/compat.js +0 -6
- package/src/executors/sync-deps/compat.js.map +0 -1
- package/src/executors/sync-deps/schema.d.ts +0 -4
- package/src/executors/sync-deps/schema.json +0 -28
- package/src/executors/sync-deps/sync-deps.impl.d.ts +0 -8
- package/src/executors/sync-deps/sync-deps.impl.js +0 -62
- package/src/executors/sync-deps/sync-deps.impl.js.map +0 -1
- package/src/executors/sync-deps/sync-deps.impl.ts +0 -101
- package/src/generators/application/application.d.ts +0 -5
- package/src/generators/application/application.js +0 -40
- package/src/generators/application/application.js.map +0 -1
- package/src/generators/application/application.spec.ts +0 -214
- package/src/generators/application/files/app/.ruby-version +0 -1
- package/src/generators/application/files/app/Gemfile.template +0 -6
- package/src/generators/application/files/app/android/app/build.gradle.template +0 -184
- package/src/generators/application/files/app/android/app/debug.keystore +0 -0
- package/src/generators/application/files/app/android/app/proguard-rules.pro +0 -10
- package/src/generators/application/files/app/android/app/src/androidTest/java/com/__lowerCaseName__/DetoxTest.java.template +0 -30
- package/src/generators/application/files/app/android/app/src/debug/AndroidManifest.xml.template +0 -14
- package/src/generators/application/files/app/android/app/src/debug/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +0 -75
- package/src/generators/application/files/app/android/app/src/main/AndroidManifest.xml.template +0 -26
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainActivity.java.template +0 -35
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainApplication.java.template +0 -63
- package/src/generators/application/files/app/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -36
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/values/strings.xml.template +0 -3
- package/src/generators/application/files/app/android/app/src/main/res/values/styles.xml +0 -9
- package/src/generators/application/files/app/android/app/src/main/res/xml/network_security_config.xml +0 -7
- package/src/generators/application/files/app/android/app/src/release/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +0 -20
- package/src/generators/application/files/app/android/build.gradle.template +0 -34
- package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/src/generators/application/files/app/android/gradle.properties +0 -44
- package/src/generators/application/files/app/android/gradlew.bat +0 -89
- package/src/generators/application/files/app/android/gradlew.template +0 -234
- package/src/generators/application/files/app/android/settings.gradle.template +0 -7
- package/src/generators/application/files/app/app.json.template +0 -4
- package/src/generators/application/files/app/babel.config.json.template +0 -3
- package/src/generators/application/files/app/ios/.xcode.env.template +0 -12
- package/src/generators/application/files/app/ios/Podfile.template +0 -60
- package/src/generators/application/files/app/ios/__className__/AppDelegate.h +0 -6
- package/src/generators/application/files/app/ios/__className__/AppDelegate.mm.template +0 -36
- package/src/generators/application/files/app/ios/__className__/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
- package/src/generators/application/files/app/ios/__className__/Images.xcassets/Contents.json +0 -6
- package/src/generators/application/files/app/ios/__className__/Info.plist.template +0 -55
- package/src/generators/application/files/app/ios/__className__/LaunchScreen.storyboard.template +0 -47
- package/src/generators/application/files/app/ios/__className__/main.m +0 -10
- package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +0 -702
- package/src/generators/application/files/app/ios/__className__.xcodeproj/xcshareddata/xcschemes/__className__.xcscheme.template +0 -88
- package/src/generators/application/files/app/ios/__className__.xcworkspace/contents.xcworkspacedata +0 -10
- package/src/generators/application/files/app/ios/__className__Tests/Info.plist +0 -24
- package/src/generators/application/files/app/ios/__className__Tests/__className__Tests.m +0 -66
- package/src/generators/application/files/app/metro.config.js.template +0 -38
- package/src/generators/application/files/app/package.json.template +0 -15
- package/src/generators/application/files/app/src/app/App.spec.tsx.template +0 -9
- package/src/generators/application/files/app/src/app/App.tsx.template +0 -694
- package/src/generators/application/files/app/src/main.tsx.template +0 -4
- package/src/generators/application/files/app/test-setup.ts.template +0 -1
- package/src/generators/application/files/app/tsconfig.app.json.template +0 -9
- package/src/generators/application/files/app/tsconfig.json.template +0 -25
- package/src/generators/application/lib/add-detox.d.ts +0 -3
- package/src/generators/application/lib/add-detox.js +0 -16
- package/src/generators/application/lib/add-detox.js.map +0 -1
- package/src/generators/application/lib/add-project.d.ts +0 -3
- package/src/generators/application/lib/add-project.js +0 -83
- package/src/generators/application/lib/add-project.js.map +0 -1
- package/src/generators/application/lib/create-application-files.d.ts +0 -3
- package/src/generators/application/lib/create-application-files.js +0 -20
- package/src/generators/application/lib/create-application-files.js.map +0 -1
- package/src/generators/application/lib/nomalize-options.spec.ts +0 -138
- package/src/generators/application/lib/normalize-options.d.ts +0 -13
- package/src/generators/application/lib/normalize-options.js +0 -36
- package/src/generators/application/lib/normalize-options.js.map +0 -1
- package/src/generators/application/schema.d.ts +0 -19
- package/src/generators/application/schema.json +0 -89
- package/src/generators/component/component.d.ts +0 -5
- package/src/generators/component/component.js +0 -53
- package/src/generators/component/component.js.map +0 -1
- package/src/generators/component/component.spec.ts +0 -135
- package/src/generators/component/files/__fileName__.spec.tsx__tmpl__ +0 -11
- package/src/generators/component/files/__fileName__.tsx__tmpl__ +0 -32
- package/src/generators/component/lib/add-import.d.ts +0 -3
- package/src/generators/component/lib/add-import.js +0 -34
- package/src/generators/component/lib/add-import.js.map +0 -1
- package/src/generators/component/lib/normalize-options.d.ts +0 -8
- package/src/generators/component/lib/normalize-options.js +0 -58
- package/src/generators/component/lib/normalize-options.js.map +0 -1
- package/src/generators/component/schema.d.ts +0 -14
- package/src/generators/component/schema.json +0 -78
- package/src/generators/component-story/component-story.d.ts +0 -8
- package/src/generators/component-story/component-story.js +0 -113
- package/src/generators/component-story/component-story.js.map +0 -1
- package/src/generators/component-story/component-story.spec.ts +0 -433
- package/src/generators/component-story/files/__componentFileName__.stories.__fileExt__ +0 -24
- package/src/generators/component-story/schema.d.ts +0 -5
- package/src/generators/component-story/schema.json +0 -34
- package/src/generators/init/init.d.ts +0 -6
- package/src/generators/init/init.js +0 -58
- package/src/generators/init/init.js.map +0 -1
- package/src/generators/init/init.spec.ts +0 -81
- package/src/generators/init/lib/add-git-ignore-entry.d.ts +0 -2
- package/src/generators/init/lib/add-git-ignore-entry.js +0 -25
- package/src/generators/init/lib/add-git-ignore-entry.js.map +0 -1
- package/src/generators/init/lib/gitignore-entries.d.ts +0 -1
- package/src/generators/init/lib/gitignore-entries.js +0 -75
- package/src/generators/init/lib/gitignore-entries.js.map +0 -1
- package/src/generators/init/schema.d.ts +0 -7
- package/src/generators/init/schema.json +0 -40
- package/src/generators/library/files/lib/README.md +0 -7
- package/src/generators/library/files/lib/babel.config.json.template +0 -17
- package/src/generators/library/files/lib/package.json__tmpl__ +0 -4
- package/src/generators/library/files/lib/src/index.ts__tmpl__ +0 -0
- package/src/generators/library/files/lib/test-setup.ts.template +0 -1
- package/src/generators/library/files/lib/tsconfig.json__tmpl__ +0 -16
- package/src/generators/library/files/lib/tsconfig.lib.json__tmpl__ +0 -9
- package/src/generators/library/lib/normalize-options.d.ts +0 -13
- package/src/generators/library/lib/normalize-options.js +0 -26
- package/src/generators/library/lib/normalize-options.js.map +0 -1
- package/src/generators/library/library.d.ts +0 -5
- package/src/generators/library/library.js +0 -101
- package/src/generators/library/library.js.map +0 -1
- package/src/generators/library/library.spec.ts +0 -397
- package/src/generators/library/schema.d.ts +0 -22
- package/src/generators/library/schema.json +0 -102
- package/src/generators/stories/schema.d.ts +0 -5
- package/src/generators/stories/schema.json +0 -42
- package/src/generators/stories/stories-app.spec.ts +0 -145
- package/src/generators/stories/stories-lib.spec.ts +0 -113
- package/src/generators/stories/stories.d.ts +0 -6
- package/src/generators/stories/stories.js +0 -63
- package/src/generators/stories/stories.js.map +0 -1
- package/src/generators/storybook-configuration/configuration.d.ts +0 -5
- package/src/generators/storybook-configuration/configuration.js +0 -60
- package/src/generators/storybook-configuration/configuration.js.map +0 -1
- package/src/generators/storybook-configuration/configuration.spec.ts +0 -146
- package/src/generators/storybook-configuration/files/app/storybook.ts.template +0 -9
- package/src/generators/storybook-configuration/files/app/toggle-storybook.tsx.template +0 -114
- package/src/generators/storybook-configuration/files/root/story-loader.js.template +0 -13
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.d.ts +0 -6
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.js +0 -26
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.js.map +0 -1
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.spec.ts +0 -161
- package/src/generators/storybook-configuration/lib/create-storybook-files.d.ts +0 -6
- package/src/generators/storybook-configuration/lib/create-storybook-files.js +0 -45
- package/src/generators/storybook-configuration/lib/create-storybook-files.js.map +0 -1
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.d.ts +0 -7
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js +0 -30
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js.map +0 -1
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts +0 -65
- package/src/generators/storybook-configuration/schema.d.ts +0 -11
- package/src/generators/storybook-configuration/schema.json +0 -66
- package/src/generators/upgrade-native/lib/create-native-files.d.ts +0 -3
- package/src/generators/upgrade-native/lib/create-native-files.js +0 -15
- package/src/generators/upgrade-native/lib/create-native-files.js.map +0 -1
- package/src/generators/upgrade-native/lib/normalize-options.d.ts +0 -12
- package/src/generators/upgrade-native/lib/normalize-options.js +0 -28
- package/src/generators/upgrade-native/lib/normalize-options.js.map +0 -1
- package/src/generators/upgrade-native/schema.d.ts +0 -9
- package/src/generators/upgrade-native/schema.json +0 -41
- package/src/generators/upgrade-native/upgrade-native.d.ts +0 -9
- package/src/generators/upgrade-native/upgrade-native.js +0 -33
- package/src/generators/upgrade-native/upgrade-native.js.map +0 -1
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.d.ts +0 -8
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.js +0 -63
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.js.map +0 -1
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.spec.ts +0 -79
- package/src/migrations/update-12-5-0/update-jest-for-react-native.d.ts +0 -2
- package/src/migrations/update-12-5-0/update-jest-for-react-native.js +0 -62
- package/src/migrations/update-12-5-0/update-jest-for-react-native.js.map +0 -1
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.d.ts +0 -2
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js +0 -22
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js.map +0 -1
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.spec.ts +0 -48
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.d.ts +0 -6
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.js +0 -41
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.js.map +0 -1
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.spec.ts +0 -61
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.d.ts +0 -6
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js +0 -33
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js.map +0 -1
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts +0 -192
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.d.ts +0 -5
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.js +0 -39
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.js.map +0 -1
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.spec.ts +0 -84
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.d.ts +0 -5
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.js +0 -42
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.js.map +0 -1
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.spec.ts +0 -48
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.d.ts +0 -6
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.js +0 -33
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.js.map +0 -1
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.spec.ts +0 -190
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.d.ts +0 -5
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.js +0 -26
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.js.map +0 -1
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.spec.ts +0 -39
- package/src/migrations/update-14-5-8/change-searchDir-storybook.d.ts +0 -5
- package/src/migrations/update-14-5-8/change-searchDir-storybook.js +0 -26
- package/src/migrations/update-14-5-8/change-searchDir-storybook.js.map +0 -1
- package/src/migrations/update-14-5-8/change-searchDir-storybook.spec.ts +0 -39
- package/src/migrations/update-14-6-0/remove-jest-transform.d.ts +0 -5
- package/src/migrations/update-14-6-0/remove-jest-transform.js +0 -58
- package/src/migrations/update-14-6-0/remove-jest-transform.js.map +0 -1
- package/src/migrations/update-14-6-0/remove-jest-transform.spec.ts +0 -109
- package/src/migrations/update-15-0-0/add-babel-inputs.d.ts +0 -2
- package/src/migrations/update-15-0-0/add-babel-inputs.js +0 -13
- package/src/migrations/update-15-0-0/add-babel-inputs.js.map +0 -1
- package/src/migrations/update-15-0-0/add-babel-inputs.spec.ts +0 -73
- package/src/migrations/update-15-9-1/add-build-ios-target.d.ts +0 -5
- package/src/migrations/update-15-9-1/add-build-ios-target.js +0 -34
- package/src/migrations/update-15-9-1/add-build-ios-target.js.map +0 -1
- package/src/migrations/update-15-9-1/add-build-ios-target.spec.ts +0 -36
- package/src/utils/add-jest.d.ts +0 -2
- package/src/utils/add-jest.js +0 -38
- package/src/utils/add-jest.js.map +0 -1
- package/src/utils/add-linting.d.ts +0 -12
- package/src/utils/add-linting.js +0 -41
- package/src/utils/add-linting.js.map +0 -1
- package/src/utils/add-linting.spec.ts +0 -42
- package/src/utils/chmod-android-gradle-files.d.ts +0 -3
- package/src/utils/chmod-android-gradle-files.js +0 -24
- package/src/utils/chmod-android-gradle-files.js.map +0 -1
- package/src/utils/ensure-node-modules-symlink.d.ts +0 -9
- package/src/utils/ensure-node-modules-symlink.js +0 -29
- package/src/utils/ensure-node-modules-symlink.js.map +0 -1
- package/src/utils/ensure-node-modules-symlink.spec.ts +0 -108
- package/src/utils/find-all-npm-dependencies.d.ts +0 -2
- package/src/utils/find-all-npm-dependencies.js +0 -26
- package/src/utils/find-all-npm-dependencies.js.map +0 -1
- package/src/utils/find-all-npm-dependencies.spec.ts +0 -95
- package/src/utils/format-file.d.ts +0 -1
- package/src/utils/format-file.js +0 -17
- package/src/utils/format-file.js.map +0 -1
- package/src/utils/get-cli-options.d.ts +0 -8
- package/src/utils/get-cli-options.js +0 -31
- package/src/utils/get-cli-options.js.map +0 -1
- package/src/utils/pod-install-task.d.ts +0 -8
- package/src/utils/pod-install-task.js +0 -62
- package/src/utils/pod-install-task.js.map +0 -1
- package/src/utils/symlink-task.d.ts +0 -2
- package/src/utils/symlink-task.js +0 -19
- package/src/utils/symlink-task.js.map +0 -1
- package/src/utils/testing-generators.d.ts +0 -3
- package/src/utils/testing-generators.js +0 -36
- package/src/utils/testing-generators.js.map +0 -1
- package/src/utils/versions.d.ts +0 -20
- package/src/utils/versions.js +0 -24
- package/src/utils/versions.js.map +0 -1
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"outputCapture": "direct-nodejs",
|
|
4
|
-
"cli": "nx",
|
|
5
|
-
"$id": "NxReactNativeRunIos",
|
|
6
|
-
"$schema": "http://json-schema.org/schema",
|
|
7
|
-
"title": "Run iOS application",
|
|
8
|
-
"description": "Run iOS target options.",
|
|
9
|
-
"type": "object",
|
|
10
|
-
"presets": [
|
|
11
|
-
{
|
|
12
|
-
"name": "Run iOS on a simulator",
|
|
13
|
-
"keys": ["simulator"]
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
"name": "Run iOS on a device",
|
|
17
|
-
"keys": ["device"]
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"name": "Run iOS on a device with udid",
|
|
21
|
-
"keys": ["udid"]
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"name": "Run `pod install` before building iOS app",
|
|
25
|
-
"keys": ["install"]
|
|
26
|
-
}
|
|
27
|
-
],
|
|
28
|
-
"properties": {
|
|
29
|
-
"xcodeConfiguration": {
|
|
30
|
-
"type": "string",
|
|
31
|
-
"description": "Explicitly set the Xcode configuration to use.",
|
|
32
|
-
"default": "Debug",
|
|
33
|
-
"examples": ["Debug", "Release"],
|
|
34
|
-
"x-deprecated": "Use `mode` instead. Deprecated from @react-native-community/cli. Will be removed in Nx 17."
|
|
35
|
-
},
|
|
36
|
-
"simulator": {
|
|
37
|
-
"type": "string",
|
|
38
|
-
"description": "Explicitly set simulator to use. Optionally include iOS version between parenthesis at the end to match an exact version: \"iPhone 6 (10.0)\"",
|
|
39
|
-
"examples": [
|
|
40
|
-
"iPhone 14",
|
|
41
|
-
"iPhone 13",
|
|
42
|
-
"iPhone 12",
|
|
43
|
-
"iPhone 11",
|
|
44
|
-
"iPhone X"
|
|
45
|
-
],
|
|
46
|
-
"x-priority": "important"
|
|
47
|
-
},
|
|
48
|
-
"mode": {
|
|
49
|
-
"type": "string",
|
|
50
|
-
"description": "Explicitly set the scheme configuration to use",
|
|
51
|
-
"default": "Debug",
|
|
52
|
-
"examples": ["Debug", "Release"],
|
|
53
|
-
"x-priority": "important"
|
|
54
|
-
},
|
|
55
|
-
"schema": {
|
|
56
|
-
"type": "string",
|
|
57
|
-
"description": "Explicitly set Xcode scheme to use"
|
|
58
|
-
},
|
|
59
|
-
"device": {
|
|
60
|
-
"type": "string",
|
|
61
|
-
"description": "Explicitly set device to use by name. The value is not required if you have a single device connected."
|
|
62
|
-
},
|
|
63
|
-
"udid": {
|
|
64
|
-
"type": "string",
|
|
65
|
-
"description": "Explicitly set device to use by udid"
|
|
66
|
-
},
|
|
67
|
-
"verbose": {
|
|
68
|
-
"type": "boolean",
|
|
69
|
-
"description": "Do not use xcbeautify or xcpretty even if installed"
|
|
70
|
-
},
|
|
71
|
-
"port": {
|
|
72
|
-
"type": "number",
|
|
73
|
-
"description": "The port where the packager server is listening on.",
|
|
74
|
-
"default": 8081
|
|
75
|
-
},
|
|
76
|
-
"xcconfig": {
|
|
77
|
-
"type": "string",
|
|
78
|
-
"description": "Explicitly set xcconfig to use"
|
|
79
|
-
},
|
|
80
|
-
"buildFolder": {
|
|
81
|
-
"type": "string",
|
|
82
|
-
"description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\". Relative to ios directory.",
|
|
83
|
-
"buildFolder": "./build"
|
|
84
|
-
},
|
|
85
|
-
"interactive": {
|
|
86
|
-
"type": "boolean",
|
|
87
|
-
"description": "Explicitly select which scheme and configuration to use before running a build"
|
|
88
|
-
},
|
|
89
|
-
"extraParams": {
|
|
90
|
-
"type": "string",
|
|
91
|
-
"description": "Custom params that will be passed to xcodebuild command."
|
|
92
|
-
},
|
|
93
|
-
"install": {
|
|
94
|
-
"type": "boolean",
|
|
95
|
-
"description": "Runs `pod install` for native modules before building iOS app.",
|
|
96
|
-
"default": false
|
|
97
|
-
},
|
|
98
|
-
"sync": {
|
|
99
|
-
"type": "boolean",
|
|
100
|
-
"description": "Syncs npm dependencies to `package.json` (for React Native autolink).",
|
|
101
|
-
"default": true
|
|
102
|
-
},
|
|
103
|
-
"resetCache": {
|
|
104
|
-
"type": "boolean",
|
|
105
|
-
"description": "Resets metro cache.",
|
|
106
|
-
"default": false
|
|
107
|
-
},
|
|
108
|
-
"packager": {
|
|
109
|
-
"type": "boolean",
|
|
110
|
-
"description": "Launch packager while building",
|
|
111
|
-
"default": true
|
|
112
|
-
},
|
|
113
|
-
"binaryPath": {
|
|
114
|
-
"type": "string",
|
|
115
|
-
"description": "Path relative to project root where pre-built .app binary lives."
|
|
116
|
-
}
|
|
117
|
-
},
|
|
118
|
-
"examplesFile": "../../../docs/run-ios-examples.md"
|
|
119
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
4
|
-
const start_impl_1 = require("./start.impl");
|
|
5
|
-
exports.default = (0, devkit_1.convertNxExecutor)(start_impl_1.default);
|
|
6
|
-
//# sourceMappingURL=compat.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/start/compat.ts"],"names":[],"mappings":";;AAAA,yCAAiD;AAEjD,6CAAyC;AAEzC,kBAAe,IAAA,0BAAiB,EAAC,oBAAa,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function isPackagerRunning(packagerPort: number): Promise<'running' | 'not_running' | 'unrecognized'>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isPackagerRunning = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const node_fetch_1 = require("node-fetch");
|
|
6
|
-
function isPackagerRunning(packagerPort) {
|
|
7
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
|
-
try {
|
|
9
|
-
const resp = yield (0, node_fetch_1.default)(`http://localhost:${packagerPort}/status`);
|
|
10
|
-
const data = yield resp.text();
|
|
11
|
-
return data === 'packager-status:running' ? 'running' : 'unrecognized';
|
|
12
|
-
}
|
|
13
|
-
catch (_a) {
|
|
14
|
-
return 'not_running';
|
|
15
|
-
}
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
exports.isPackagerRunning = isPackagerRunning;
|
|
19
|
-
//# sourceMappingURL=is-packager-running.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"is-packager-running.js","sourceRoot":"","sources":["../../../../../../../packages/react-native/src/executors/start/lib/is-packager-running.ts"],"names":[],"mappings":";;;;AAAA,2CAA+B;AAE/B,SAAsB,iBAAiB,CACrC,YAAoB;;QAEpB,IAAI;YACF,MAAM,IAAI,GAAG,MAAM,IAAA,oBAAK,EAAC,oBAAoB,YAAY,SAAS,CAAC,CAAC;YACpE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;YAC/B,OAAO,IAAI,KAAK,yBAAyB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC;SACxE;QAAC,WAAM;YACN,OAAO,aAAa,CAAC;SACtB;IACH,CAAC;CAAA;AAVD,8CAUC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// options from https://github.com/react-native-community/cli/blob/main/packages/cli-plugin-metro/src/commands/start/index.ts
|
|
2
|
-
|
|
3
|
-
export interface ReactNativeStartOptions {
|
|
4
|
-
port: number;
|
|
5
|
-
resetCache: boolean; // default is false
|
|
6
|
-
interactive: boolean; // default is true
|
|
7
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"outputCapture": "direct-nodejs",
|
|
4
|
-
"cli": "nx",
|
|
5
|
-
"$id": "NxReactNativeStart",
|
|
6
|
-
"$schema": "http://json-schema.org/schema",
|
|
7
|
-
"title": "Packager Server for React Native",
|
|
8
|
-
"description": "Packager Server target options.",
|
|
9
|
-
"type": "object",
|
|
10
|
-
"properties": {
|
|
11
|
-
"port": {
|
|
12
|
-
"type": "number",
|
|
13
|
-
"description": "The port to listen on.",
|
|
14
|
-
"default": 8081
|
|
15
|
-
},
|
|
16
|
-
"resetCache": {
|
|
17
|
-
"type": "boolean",
|
|
18
|
-
"description": "Resets metro cache.",
|
|
19
|
-
"default": false
|
|
20
|
-
},
|
|
21
|
-
"interactive": {
|
|
22
|
-
"type": "boolean",
|
|
23
|
-
"description": "Run packager server in interactive mode.",
|
|
24
|
-
"default": true
|
|
25
|
-
}
|
|
26
|
-
},
|
|
27
|
-
"examplesFile": "../../../docs/start-examples.md"
|
|
28
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
-
import { ReactNativeStartOptions } from './schema';
|
|
3
|
-
export interface ReactNativeStartOutput {
|
|
4
|
-
baseUrl?: string;
|
|
5
|
-
success: boolean;
|
|
6
|
-
}
|
|
7
|
-
export default function startExecutor(options: ReactNativeStartOptions, context: ExecutorContext): AsyncGenerator<ReactNativeStartOutput>;
|
|
8
|
-
export declare function runCliStart(workspaceRoot: string, projectRoot: string, options: ReactNativeStartOptions): Promise<void>;
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.runCliStart = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const chalk = require("chalk");
|
|
6
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
-
const child_process_1 = require("child_process");
|
|
8
|
-
const path_1 = require("path");
|
|
9
|
-
const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
|
|
10
|
-
const is_packager_running_1 = require("./lib/is-packager-running");
|
|
11
|
-
let childProcess;
|
|
12
|
-
function startExecutor(options, context) {
|
|
13
|
-
return tslib_1.__asyncGenerator(this, arguments, function* startExecutor_1() {
|
|
14
|
-
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
15
|
-
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
|
|
16
|
-
try {
|
|
17
|
-
const baseUrl = `http://localhost:${options.port}`;
|
|
18
|
-
const appName = context.projectName;
|
|
19
|
-
devkit_1.logger.info(chalk.cyan(`Packager is ready at ${baseUrl}`));
|
|
20
|
-
devkit_1.logger.info(`Use ${chalk.bold(`nx run-android ${appName}`)} or ${chalk.bold(`nx run-ios ${appName}`)} to run the native app.`);
|
|
21
|
-
yield tslib_1.__await(runCliStart(context.root, projectRoot, options));
|
|
22
|
-
yield yield tslib_1.__await({
|
|
23
|
-
baseUrl,
|
|
24
|
-
success: true,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
finally {
|
|
28
|
-
if (childProcess) {
|
|
29
|
-
childProcess.kill();
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
exports.default = startExecutor;
|
|
35
|
-
/*
|
|
36
|
-
* Starts the JS bundler and checks for "running" status before notifying
|
|
37
|
-
* that packager has started.
|
|
38
|
-
*/
|
|
39
|
-
function runCliStart(workspaceRoot, projectRoot, options) {
|
|
40
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
41
|
-
const result = yield (0, is_packager_running_1.isPackagerRunning)(options.port);
|
|
42
|
-
if (result === 'running') {
|
|
43
|
-
devkit_1.logger.info('JS server already running.');
|
|
44
|
-
}
|
|
45
|
-
else if (result === 'unrecognized') {
|
|
46
|
-
devkit_1.logger.warn('JS server not recognized.');
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
// result === 'not_running'
|
|
50
|
-
devkit_1.logger.info('Starting JS server...');
|
|
51
|
-
try {
|
|
52
|
-
yield startAsync(workspaceRoot, projectRoot, options);
|
|
53
|
-
}
|
|
54
|
-
catch (error) {
|
|
55
|
-
devkit_1.logger.error(`Failed to start the packager server. Error details: ${error.message}`);
|
|
56
|
-
throw error;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
exports.runCliStart = runCliStart;
|
|
62
|
-
function startAsync(workspaceRoot, projectRoot, options) {
|
|
63
|
-
return new Promise((resolve, reject) => {
|
|
64
|
-
childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/react-native/cli.js'), ['start', ...createStartOptions(options)], { cwd: (0, path_1.join)(workspaceRoot, projectRoot), env: process.env });
|
|
65
|
-
// Ensure the child process is killed when the parent exits
|
|
66
|
-
process.on('exit', () => childProcess.kill());
|
|
67
|
-
process.on('SIGTERM', () => childProcess.kill());
|
|
68
|
-
childProcess.on('error', (err) => {
|
|
69
|
-
reject(err);
|
|
70
|
-
});
|
|
71
|
-
childProcess.on('exit', (code) => {
|
|
72
|
-
if (code === 0) {
|
|
73
|
-
resolve(code);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
reject(code);
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
function createStartOptions(options) {
|
|
82
|
-
return Object.keys(options).reduce((acc, k) => {
|
|
83
|
-
if (k === 'resetCache') {
|
|
84
|
-
if (options[k] === true) {
|
|
85
|
-
acc.push(`--reset-cache`);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
else if (k === 'interactive') {
|
|
89
|
-
if (options[k] === false) {
|
|
90
|
-
acc.push(`--no-interactive`);
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
acc.push(`--${k}`, options[k]);
|
|
95
|
-
}
|
|
96
|
-
return acc;
|
|
97
|
-
}, []);
|
|
98
|
-
}
|
|
99
|
-
//# sourceMappingURL=start.impl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"start.impl.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/start/start.impl.ts"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAC/B,yCAAuD;AACvD,iDAAmD;AACnD,+BAA4B;AAC5B,yFAAmF;AACnF,mEAA8D;AAQ9D,IAAI,YAA0B,CAAC;AAE/B,SAA+B,aAAa,CAC1C,OAAgC,EAChC,OAAwB;;QAExB,MAAM,WAAW,GACf,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,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AAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE;QAC5C,IAAI,CAAC,KAAK,YAAY,EAAE;YACtB,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE;gBACvB,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;aAC3B;SACF;aAAM,IAAI,CAAC,KAAK,aAAa,EAAE;YAC9B,IAAI,OAAO,CAAC,CAAC,CAAC,KAAK,KAAK,EAAE;gBACxB,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;aAC9B;SACF;aAAM;YACL,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;SAChC;QACD,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import * as chalk from 'chalk';
|
|
2
|
-
import { ExecutorContext, logger } from '@nrwl/devkit';
|
|
3
|
-
import { ChildProcess, fork } from 'child_process';
|
|
4
|
-
import { join } from 'path';
|
|
5
|
-
import { ensureNodeModulesSymlink } from '../../utils/ensure-node-modules-symlink';
|
|
6
|
-
import { isPackagerRunning } from './lib/is-packager-running';
|
|
7
|
-
import { ReactNativeStartOptions } from './schema';
|
|
8
|
-
|
|
9
|
-
export interface ReactNativeStartOutput {
|
|
10
|
-
baseUrl?: string;
|
|
11
|
-
success: boolean;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
let childProcess: ChildProcess;
|
|
15
|
-
|
|
16
|
-
export default async function* startExecutor(
|
|
17
|
-
options: ReactNativeStartOptions,
|
|
18
|
-
context: ExecutorContext
|
|
19
|
-
): AsyncGenerator<ReactNativeStartOutput> {
|
|
20
|
-
const projectRoot =
|
|
21
|
-
context.projectsConfigurations.projects[context.projectName].root;
|
|
22
|
-
ensureNodeModulesSymlink(context.root, projectRoot);
|
|
23
|
-
|
|
24
|
-
try {
|
|
25
|
-
const baseUrl = `http://localhost:${options.port}`;
|
|
26
|
-
const appName = context.projectName;
|
|
27
|
-
logger.info(chalk.cyan(`Packager is ready at ${baseUrl}`));
|
|
28
|
-
logger.info(
|
|
29
|
-
`Use ${chalk.bold(`nx run-android ${appName}`)} or ${chalk.bold(
|
|
30
|
-
`nx run-ios ${appName}`
|
|
31
|
-
)} to run the native app.`
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
await runCliStart(context.root, projectRoot, options);
|
|
35
|
-
|
|
36
|
-
yield {
|
|
37
|
-
baseUrl,
|
|
38
|
-
success: true,
|
|
39
|
-
};
|
|
40
|
-
} finally {
|
|
41
|
-
if (childProcess) {
|
|
42
|
-
childProcess.kill();
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/*
|
|
48
|
-
* Starts the JS bundler and checks for "running" status before notifying
|
|
49
|
-
* that packager has started.
|
|
50
|
-
*/
|
|
51
|
-
export async function runCliStart(
|
|
52
|
-
workspaceRoot: string,
|
|
53
|
-
projectRoot: string,
|
|
54
|
-
options: ReactNativeStartOptions
|
|
55
|
-
): Promise<void> {
|
|
56
|
-
const result = await isPackagerRunning(options.port);
|
|
57
|
-
if (result === 'running') {
|
|
58
|
-
logger.info('JS server already running.');
|
|
59
|
-
} else if (result === 'unrecognized') {
|
|
60
|
-
logger.warn('JS server not recognized.');
|
|
61
|
-
} else {
|
|
62
|
-
// result === 'not_running'
|
|
63
|
-
logger.info('Starting JS server...');
|
|
64
|
-
|
|
65
|
-
try {
|
|
66
|
-
await startAsync(workspaceRoot, projectRoot, options);
|
|
67
|
-
} catch (error) {
|
|
68
|
-
logger.error(
|
|
69
|
-
`Failed to start the packager server. Error details: ${error.message}`
|
|
70
|
-
);
|
|
71
|
-
throw error;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function startAsync(
|
|
77
|
-
workspaceRoot: string,
|
|
78
|
-
projectRoot: string,
|
|
79
|
-
options: ReactNativeStartOptions
|
|
80
|
-
): Promise<number> {
|
|
81
|
-
return new Promise((resolve, reject) => {
|
|
82
|
-
childProcess = fork(
|
|
83
|
-
join(workspaceRoot, './node_modules/react-native/cli.js'),
|
|
84
|
-
['start', ...createStartOptions(options)],
|
|
85
|
-
{ cwd: join(workspaceRoot, projectRoot), env: process.env }
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
// Ensure the child process is killed when the parent exits
|
|
89
|
-
process.on('exit', () => childProcess.kill());
|
|
90
|
-
process.on('SIGTERM', () => childProcess.kill());
|
|
91
|
-
|
|
92
|
-
childProcess.on('error', (err) => {
|
|
93
|
-
reject(err);
|
|
94
|
-
});
|
|
95
|
-
childProcess.on('exit', (code) => {
|
|
96
|
-
if (code === 0) {
|
|
97
|
-
resolve(code);
|
|
98
|
-
} else {
|
|
99
|
-
reject(code);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
function createStartOptions(options) {
|
|
106
|
-
return Object.keys(options).reduce((acc, k) => {
|
|
107
|
-
if (k === 'resetCache') {
|
|
108
|
-
if (options[k] === true) {
|
|
109
|
-
acc.push(`--reset-cache`);
|
|
110
|
-
}
|
|
111
|
-
} else if (k === 'interactive') {
|
|
112
|
-
if (options[k] === false) {
|
|
113
|
-
acc.push(`--no-interactive`);
|
|
114
|
-
}
|
|
115
|
-
} else {
|
|
116
|
-
acc.push(`--${k}`, options[k]);
|
|
117
|
-
}
|
|
118
|
-
return acc;
|
|
119
|
-
}, []);
|
|
120
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
4
|
-
const storybook_impl_1 = require("./storybook.impl");
|
|
5
|
-
exports.default = (0, devkit_1.convertNxExecutor)(storybook_impl_1.default);
|
|
6
|
-
//# sourceMappingURL=compat.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/storybook/compat.ts"],"names":[],"mappings":";;AAAA,yCAAiD;AAEjD,qDAAiD;AAEjD,kBAAe,IAAA,0BAAiB,EAAC,wBAAiB,CAAC,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"outputCapture": "direct-nodejs",
|
|
4
|
-
"title": "React Native Storybook Load Stories",
|
|
5
|
-
"cli": "nx",
|
|
6
|
-
"description": "Load stories for react native.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"searchDir": {
|
|
10
|
-
"type": "array",
|
|
11
|
-
"items": {
|
|
12
|
-
"type": "string"
|
|
13
|
-
},
|
|
14
|
-
"default": [],
|
|
15
|
-
"description": "The directory or directories, relative to the project root, to search for files in."
|
|
16
|
-
},
|
|
17
|
-
"outputFile": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"description": "The output file that will be written. It is relative to the project directory.",
|
|
20
|
-
"default": "./.storybook/story-loader.js"
|
|
21
|
-
},
|
|
22
|
-
"pattern": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"description": "The pattern of files to look at. It can be a specific file, or any valid glob. Note: if using the CLI, globs with `**/*...` must be escaped with quotes",
|
|
25
|
-
"default": "**/*.stories.@(js|jsx|ts|tsx|md)"
|
|
26
|
-
},
|
|
27
|
-
"silent": {
|
|
28
|
-
"type": "boolean",
|
|
29
|
-
"description": "Silences output.",
|
|
30
|
-
"default": false
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
"required": ["searchDir", "outputFile", "pattern"]
|
|
34
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const fileutils_1 = require("@nrwl/workspace/src/utilities/fileutils");
|
|
7
|
-
const chalk = require("chalk");
|
|
8
|
-
const child_process_1 = require("child_process");
|
|
9
|
-
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() {
|
|
13
|
-
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
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).`);
|
|
15
|
-
// add storybook addons to app's package.json
|
|
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, context.projectGraph, [
|
|
19
|
-
'@storybook/addon-ondevice-actions',
|
|
20
|
-
'@storybook/addon-ondevice-backgrounds',
|
|
21
|
-
'@storybook/addon-ondevice-controls',
|
|
22
|
-
'@storybook/addon-ondevice-notes',
|
|
23
|
-
])));
|
|
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
|
-
}
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
exports.default = reactNatievStorybookExecutor;
|
|
36
|
-
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
|
-
}, []);
|
|
75
|
-
}
|
|
76
|
-
//# sourceMappingURL=storybook.impl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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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