@nx/react-native 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/.eslintrc.json +19 -0
- package/CHANGELOG.md +8 -0
- package/LICENSE +22 -0
- package/README.md +63 -0
- package/executors.json +106 -0
- package/generators.json +109 -0
- package/index.d.ts +5 -0
- package/index.js +14 -0
- package/index.js.map +1 -0
- package/migrations.json +1291 -0
- package/package.json +58 -0
- package/plugins/jest/svg-mock.d.ts +0 -0
- package/plugins/jest/svg-mock.js +4 -0
- package/plugins/jest/svg-mock.js.map +1 -0
- package/plugins/metro-resolver.d.ts +1 -0
- package/plugins/metro-resolver.js +135 -0
- package/plugins/metro-resolver.js.map +1 -0
- package/plugins/with-nx-metro.d.ts +8 -0
- package/plugins/with-nx-metro.js +32 -0
- package/plugins/with-nx-metro.js.map +1 -0
- package/project.json +64 -0
- package/src/executors/build-android/build-android.impl.d.ts +6 -0
- package/src/executors/build-android/build-android.impl.js +76 -0
- package/src/executors/build-android/build-android.impl.js.map +1 -0
- package/src/executors/build-android/build-android.impl.ts +108 -0
- package/src/executors/build-android/compat.d.ts +2 -0
- package/src/executors/build-android/compat.js +6 -0
- package/src/executors/build-android/compat.js.map +1 -0
- package/src/executors/build-android/schema.d.ts +31 -0
- package/src/executors/build-android/schema.json +102 -0
- package/src/executors/build-ios/build-ios.impl.d.ts +6 -0
- package/src/executors/build-ios/build-ios.impl.js +77 -0
- package/src/executors/build-ios/build-ios.impl.js.map +1 -0
- package/src/executors/build-ios/build-ios.impl.ts +118 -0
- package/src/executors/build-ios/compat.d.ts +2 -0
- package/src/executors/build-ios/compat.js +6 -0
- package/src/executors/build-ios/compat.js.map +1 -0
- package/src/executors/build-ios/schema.d.ts +22 -0
- package/src/executors/build-ios/schema.json +106 -0
- package/src/executors/bundle/bundle.impl.d.ts +6 -0
- package/src/executors/bundle/bundle.impl.js +58 -0
- package/src/executors/bundle/bundle.impl.js.map +1 -0
- package/src/executors/bundle/bundle.impl.ts +76 -0
- package/src/executors/bundle/compat.d.ts +2 -0
- package/src/executors/bundle/compat.js +6 -0
- package/src/executors/bundle/compat.js.map +1 -0
- package/src/executors/bundle/schema.d.ts +16 -0
- package/src/executors/bundle/schema.json +92 -0
- package/src/executors/ensure-symlink/compat.d.ts +2 -0
- package/src/executors/ensure-symlink/compat.js +6 -0
- package/src/executors/ensure-symlink/compat.js.map +1 -0
- package/src/executors/ensure-symlink/ensure-symlink.impl.d.ts +5 -0
- package/src/executors/ensure-symlink/ensure-symlink.impl.js +13 -0
- package/src/executors/ensure-symlink/ensure-symlink.impl.js.map +1 -0
- package/src/executors/ensure-symlink/ensure-symlink.impl.ts +18 -0
- package/src/executors/ensure-symlink/schema.json +11 -0
- package/src/executors/pod-install/compat.d.ts +2 -0
- package/src/executors/pod-install/compat.js +6 -0
- package/src/executors/pod-install/compat.js.map +1 -0
- package/src/executors/pod-install/pod-install.impl.d.ts +6 -0
- package/src/executors/pod-install/pod-install.impl.js +15 -0
- package/src/executors/pod-install/pod-install.impl.js.map +1 -0
- package/src/executors/pod-install/pod-install.impl.ts +21 -0
- package/src/executors/pod-install/schema.d.ts +3 -0
- package/src/executors/pod-install/schema.json +18 -0
- package/src/executors/run-android/compat.d.ts +2 -0
- package/src/executors/run-android/compat.js +6 -0
- package/src/executors/run-android/compat.js.map +1 -0
- package/src/executors/run-android/run-android.impl.d.ts +6 -0
- package/src/executors/run-android/run-android.impl.js +72 -0
- package/src/executors/run-android/run-android.impl.js.map +1 -0
- package/src/executors/run-android/run-android.impl.ts +110 -0
- package/src/executors/run-android/schema.d.ts +24 -0
- package/src/executors/run-android/schema.json +121 -0
- package/src/executors/run-ios/compat.d.ts +2 -0
- package/src/executors/run-ios/compat.js +6 -0
- package/src/executors/run-ios/compat.js.map +1 -0
- package/src/executors/run-ios/run-ios.impl.d.ts +6 -0
- package/src/executors/run-ios/run-ios.impl.js +78 -0
- package/src/executors/run-ios/run-ios.impl.js.map +1 -0
- package/src/executors/run-ios/run-ios.impl.ts +120 -0
- package/src/executors/run-ios/schema.d.ts +12 -0
- package/src/executors/run-ios/schema.json +119 -0
- package/src/executors/start/compat.d.ts +2 -0
- package/src/executors/start/compat.js +6 -0
- package/src/executors/start/compat.js.map +1 -0
- package/src/executors/start/lib/is-packager-running.d.ts +1 -0
- package/src/executors/start/lib/is-packager-running.js +19 -0
- package/src/executors/start/lib/is-packager-running.js.map +1 -0
- package/src/executors/start/schema.d.ts +7 -0
- package/src/executors/start/schema.json +28 -0
- package/src/executors/start/start.impl.d.ts +8 -0
- package/src/executors/start/start.impl.js +99 -0
- package/src/executors/start/start.impl.js.map +1 -0
- package/src/executors/start/start.impl.ts +120 -0
- package/src/executors/storybook/compat.d.ts +2 -0
- package/src/executors/storybook/compat.js +6 -0
- package/src/executors/storybook/compat.js.map +1 -0
- package/src/executors/storybook/schema.d.ts +7 -0
- package/src/executors/storybook/schema.json +34 -0
- package/src/executors/storybook/storybook.impl.d.ts +5 -0
- package/src/executors/storybook/storybook.impl.js +76 -0
- package/src/executors/storybook/storybook.impl.js.map +1 -0
- package/src/executors/storybook/storybook.impl.ts +105 -0
- package/src/executors/sync-deps/compat.d.ts +2 -0
- package/src/executors/sync-deps/compat.js +6 -0
- package/src/executors/sync-deps/compat.js.map +1 -0
- package/src/executors/sync-deps/schema.d.ts +4 -0
- package/src/executors/sync-deps/schema.json +28 -0
- package/src/executors/sync-deps/sync-deps.impl.d.ts +8 -0
- package/src/executors/sync-deps/sync-deps.impl.js +62 -0
- package/src/executors/sync-deps/sync-deps.impl.js.map +1 -0
- package/src/executors/sync-deps/sync-deps.impl.ts +101 -0
- package/src/generators/application/application.d.ts +5 -0
- package/src/generators/application/application.js +40 -0
- package/src/generators/application/application.js.map +1 -0
- package/src/generators/application/application.spec.ts +214 -0
- package/src/generators/application/files/app/.ruby-version +1 -0
- package/src/generators/application/files/app/Gemfile.template +6 -0
- package/src/generators/application/files/app/android/app/build.gradle.template +184 -0
- package/src/generators/application/files/app/android/app/debug.keystore +0 -0
- package/src/generators/application/files/app/android/app/proguard-rules.pro +10 -0
- package/src/generators/application/files/app/android/app/src/androidTest/java/com/__lowerCaseName__/DetoxTest.java.template +30 -0
- package/src/generators/application/files/app/android/app/src/debug/AndroidManifest.xml.template +14 -0
- package/src/generators/application/files/app/android/app/src/debug/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +75 -0
- package/src/generators/application/files/app/android/app/src/main/AndroidManifest.xml.template +26 -0
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainActivity.java.template +35 -0
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainApplication.java.template +63 -0
- package/src/generators/application/files/app/android/app/src/main/res/drawable/rn_edit_text_material.xml +36 -0
- 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 +3 -0
- package/src/generators/application/files/app/android/app/src/main/res/values/styles.xml +9 -0
- package/src/generators/application/files/app/android/app/src/main/res/xml/network_security_config.xml +7 -0
- package/src/generators/application/files/app/android/app/src/release/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +20 -0
- package/src/generators/application/files/app/android/build.gradle.template +34 -0
- 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 +5 -0
- package/src/generators/application/files/app/android/gradle.properties +44 -0
- package/src/generators/application/files/app/android/gradlew.bat +89 -0
- package/src/generators/application/files/app/android/gradlew.template +234 -0
- package/src/generators/application/files/app/android/settings.gradle.template +7 -0
- package/src/generators/application/files/app/app.json.template +4 -0
- package/src/generators/application/files/app/babel.config.json.template +3 -0
- package/src/generators/application/files/app/ios/.xcode.env.template +12 -0
- package/src/generators/application/files/app/ios/Podfile.template +60 -0
- package/src/generators/application/files/app/ios/__className__/AppDelegate.h +6 -0
- package/src/generators/application/files/app/ios/__className__/AppDelegate.mm.template +36 -0
- package/src/generators/application/files/app/ios/__className__/Images.xcassets/AppIcon.appiconset/Contents.json +53 -0
- package/src/generators/application/files/app/ios/__className__/Images.xcassets/Contents.json +6 -0
- package/src/generators/application/files/app/ios/__className__/Info.plist.template +55 -0
- package/src/generators/application/files/app/ios/__className__/LaunchScreen.storyboard.template +47 -0
- package/src/generators/application/files/app/ios/__className__/main.m +10 -0
- package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +702 -0
- package/src/generators/application/files/app/ios/__className__.xcodeproj/xcshareddata/xcschemes/__className__.xcscheme.template +88 -0
- package/src/generators/application/files/app/ios/__className__.xcworkspace/contents.xcworkspacedata +10 -0
- package/src/generators/application/files/app/ios/__className__Tests/Info.plist +24 -0
- package/src/generators/application/files/app/ios/__className__Tests/__className__Tests.m +66 -0
- package/src/generators/application/files/app/metro.config.js.template +38 -0
- package/src/generators/application/files/app/package.json.template +15 -0
- package/src/generators/application/files/app/src/app/App.spec.tsx.template +9 -0
- package/src/generators/application/files/app/src/app/App.tsx.template +694 -0
- package/src/generators/application/files/app/src/main.tsx.template +4 -0
- package/src/generators/application/files/app/test-setup.ts.template +1 -0
- package/src/generators/application/files/app/tsconfig.app.json.template +9 -0
- package/src/generators/application/files/app/tsconfig.json.template +25 -0
- package/src/generators/application/lib/add-detox.d.ts +3 -0
- package/src/generators/application/lib/add-detox.js +16 -0
- package/src/generators/application/lib/add-detox.js.map +1 -0
- package/src/generators/application/lib/add-project.d.ts +3 -0
- package/src/generators/application/lib/add-project.js +83 -0
- package/src/generators/application/lib/add-project.js.map +1 -0
- package/src/generators/application/lib/create-application-files.d.ts +3 -0
- package/src/generators/application/lib/create-application-files.js +20 -0
- package/src/generators/application/lib/create-application-files.js.map +1 -0
- package/src/generators/application/lib/nomalize-options.spec.ts +138 -0
- package/src/generators/application/lib/normalize-options.d.ts +13 -0
- package/src/generators/application/lib/normalize-options.js +36 -0
- package/src/generators/application/lib/normalize-options.js.map +1 -0
- package/src/generators/application/schema.d.ts +19 -0
- package/src/generators/application/schema.json +89 -0
- package/src/generators/component/component.d.ts +5 -0
- package/src/generators/component/component.js +53 -0
- package/src/generators/component/component.js.map +1 -0
- package/src/generators/component/component.spec.ts +135 -0
- package/src/generators/component/files/__fileName__.spec.tsx__tmpl__ +11 -0
- package/src/generators/component/files/__fileName__.tsx__tmpl__ +32 -0
- package/src/generators/component/lib/add-import.d.ts +3 -0
- package/src/generators/component/lib/add-import.js +34 -0
- package/src/generators/component/lib/add-import.js.map +1 -0
- package/src/generators/component/lib/normalize-options.d.ts +8 -0
- package/src/generators/component/lib/normalize-options.js +58 -0
- package/src/generators/component/lib/normalize-options.js.map +1 -0
- package/src/generators/component/schema.d.ts +14 -0
- package/src/generators/component/schema.json +78 -0
- package/src/generators/component-story/component-story.d.ts +8 -0
- package/src/generators/component-story/component-story.js +113 -0
- package/src/generators/component-story/component-story.js.map +1 -0
- package/src/generators/component-story/component-story.spec.ts +433 -0
- package/src/generators/component-story/files/__componentFileName__.stories.__fileExt__ +24 -0
- package/src/generators/component-story/schema.d.ts +5 -0
- package/src/generators/component-story/schema.json +34 -0
- package/src/generators/init/init.d.ts +6 -0
- package/src/generators/init/init.js +58 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/init.spec.ts +81 -0
- package/src/generators/init/lib/add-git-ignore-entry.d.ts +2 -0
- package/src/generators/init/lib/add-git-ignore-entry.js +25 -0
- package/src/generators/init/lib/add-git-ignore-entry.js.map +1 -0
- package/src/generators/init/lib/gitignore-entries.d.ts +1 -0
- package/src/generators/init/lib/gitignore-entries.js +75 -0
- package/src/generators/init/lib/gitignore-entries.js.map +1 -0
- package/src/generators/init/schema.d.ts +7 -0
- package/src/generators/init/schema.json +40 -0
- package/src/generators/library/files/lib/README.md +7 -0
- package/src/generators/library/files/lib/babel.config.json.template +17 -0
- package/src/generators/library/files/lib/package.json__tmpl__ +4 -0
- package/src/generators/library/files/lib/src/index.ts__tmpl__ +0 -0
- package/src/generators/library/files/lib/test-setup.ts.template +1 -0
- package/src/generators/library/files/lib/tsconfig.json__tmpl__ +16 -0
- package/src/generators/library/files/lib/tsconfig.lib.json__tmpl__ +9 -0
- package/src/generators/library/lib/normalize-options.d.ts +13 -0
- package/src/generators/library/lib/normalize-options.js +26 -0
- package/src/generators/library/lib/normalize-options.js.map +1 -0
- package/src/generators/library/library.d.ts +5 -0
- package/src/generators/library/library.js +103 -0
- package/src/generators/library/library.js.map +1 -0
- package/src/generators/library/library.spec.ts +397 -0
- package/src/generators/library/schema.d.ts +22 -0
- package/src/generators/library/schema.json +102 -0
- package/src/generators/stories/schema.d.ts +5 -0
- package/src/generators/stories/schema.json +42 -0
- package/src/generators/stories/stories-app.spec.ts +145 -0
- package/src/generators/stories/stories-lib.spec.ts +113 -0
- package/src/generators/stories/stories.d.ts +6 -0
- package/src/generators/stories/stories.js +63 -0
- package/src/generators/stories/stories.js.map +1 -0
- package/src/generators/storybook-configuration/configuration.d.ts +5 -0
- package/src/generators/storybook-configuration/configuration.js +60 -0
- package/src/generators/storybook-configuration/configuration.js.map +1 -0
- package/src/generators/storybook-configuration/configuration.spec.ts +146 -0
- package/src/generators/storybook-configuration/files/app/storybook.ts.template +9 -0
- package/src/generators/storybook-configuration/files/app/toggle-storybook.tsx.template +114 -0
- package/src/generators/storybook-configuration/files/root/story-loader.js.template +13 -0
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.d.ts +6 -0
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.js +26 -0
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.js.map +1 -0
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.spec.ts +161 -0
- package/src/generators/storybook-configuration/lib/create-storybook-files.d.ts +6 -0
- package/src/generators/storybook-configuration/lib/create-storybook-files.js +45 -0
- package/src/generators/storybook-configuration/lib/create-storybook-files.js.map +1 -0
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.d.ts +7 -0
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js +30 -0
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js.map +1 -0
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts +65 -0
- package/src/generators/storybook-configuration/schema.d.ts +11 -0
- package/src/generators/storybook-configuration/schema.json +66 -0
- package/src/generators/upgrade-native/lib/create-native-files.d.ts +3 -0
- package/src/generators/upgrade-native/lib/create-native-files.js +15 -0
- package/src/generators/upgrade-native/lib/create-native-files.js.map +1 -0
- package/src/generators/upgrade-native/lib/normalize-options.d.ts +12 -0
- package/src/generators/upgrade-native/lib/normalize-options.js +28 -0
- package/src/generators/upgrade-native/lib/normalize-options.js.map +1 -0
- package/src/generators/upgrade-native/schema.d.ts +9 -0
- package/src/generators/upgrade-native/schema.json +41 -0
- package/src/generators/upgrade-native/upgrade-native.d.ts +9 -0
- package/src/generators/upgrade-native/upgrade-native.js +33 -0
- package/src/generators/upgrade-native/upgrade-native.js.map +1 -0
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.d.ts +8 -0
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.js +63 -0
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.js.map +1 -0
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.spec.ts +79 -0
- package/src/migrations/update-12-5-0/update-jest-for-react-native.d.ts +2 -0
- package/src/migrations/update-12-5-0/update-jest-for-react-native.js +62 -0
- package/src/migrations/update-12-5-0/update-jest-for-react-native.js.map +1 -0
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.d.ts +2 -0
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js +22 -0
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js.map +1 -0
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.spec.ts +48 -0
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.d.ts +6 -0
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.js +41 -0
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.js.map +1 -0
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.spec.ts +61 -0
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.d.ts +6 -0
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js +33 -0
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js.map +1 -0
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts +192 -0
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.d.ts +5 -0
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.js +39 -0
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.js.map +1 -0
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.spec.ts +84 -0
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.d.ts +5 -0
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.js +42 -0
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.js.map +1 -0
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.spec.ts +48 -0
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.d.ts +6 -0
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.js +33 -0
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.js.map +1 -0
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.spec.ts +190 -0
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.d.ts +5 -0
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.js +26 -0
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.js.map +1 -0
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.spec.ts +39 -0
- package/src/migrations/update-14-5-8/change-searchDir-storybook.d.ts +5 -0
- package/src/migrations/update-14-5-8/change-searchDir-storybook.js +26 -0
- package/src/migrations/update-14-5-8/change-searchDir-storybook.js.map +1 -0
- package/src/migrations/update-14-5-8/change-searchDir-storybook.spec.ts +39 -0
- package/src/migrations/update-14-6-0/remove-jest-transform.d.ts +5 -0
- package/src/migrations/update-14-6-0/remove-jest-transform.js +58 -0
- package/src/migrations/update-14-6-0/remove-jest-transform.js.map +1 -0
- package/src/migrations/update-14-6-0/remove-jest-transform.spec.ts +109 -0
- package/src/migrations/update-15-0-0/add-babel-inputs.d.ts +2 -0
- package/src/migrations/update-15-0-0/add-babel-inputs.js +13 -0
- package/src/migrations/update-15-0-0/add-babel-inputs.js.map +1 -0
- package/src/migrations/update-15-0-0/add-babel-inputs.spec.ts +73 -0
- package/src/migrations/update-15-9-1/add-build-ios-target.d.ts +5 -0
- package/src/migrations/update-15-9-1/add-build-ios-target.js +34 -0
- package/src/migrations/update-15-9-1/add-build-ios-target.js.map +1 -0
- package/src/migrations/update-15-9-1/add-build-ios-target.spec.ts +36 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +13 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.spec.ts +37 -0
- package/src/utils/add-jest.d.ts +2 -0
- package/src/utils/add-jest.js +38 -0
- package/src/utils/add-jest.js.map +1 -0
- package/src/utils/add-linting.d.ts +12 -0
- package/src/utils/add-linting.js +41 -0
- package/src/utils/add-linting.js.map +1 -0
- package/src/utils/add-linting.spec.ts +42 -0
- package/src/utils/chmod-android-gradle-files.d.ts +3 -0
- package/src/utils/chmod-android-gradle-files.js +24 -0
- package/src/utils/chmod-android-gradle-files.js.map +1 -0
- package/src/utils/ensure-node-modules-symlink.d.ts +9 -0
- package/src/utils/ensure-node-modules-symlink.js +29 -0
- package/src/utils/ensure-node-modules-symlink.js.map +1 -0
- package/src/utils/ensure-node-modules-symlink.spec.ts +108 -0
- package/src/utils/find-all-npm-dependencies.d.ts +2 -0
- package/src/utils/find-all-npm-dependencies.js +26 -0
- package/src/utils/find-all-npm-dependencies.js.map +1 -0
- package/src/utils/find-all-npm-dependencies.spec.ts +95 -0
- package/src/utils/format-file.d.ts +1 -0
- package/src/utils/format-file.js +17 -0
- package/src/utils/format-file.js.map +1 -0
- package/src/utils/get-cli-options.d.ts +8 -0
- package/src/utils/get-cli-options.js +31 -0
- package/src/utils/get-cli-options.js.map +1 -0
- package/src/utils/pod-install-task.d.ts +8 -0
- package/src/utils/pod-install-task.js +62 -0
- package/src/utils/pod-install-task.js.map +1 -0
- package/src/utils/symlink-task.d.ts +2 -0
- package/src/utils/symlink-task.js +19 -0
- package/src/utils/symlink-task.js.map +1 -0
- package/src/utils/testing-generators.d.ts +3 -0
- package/src/utils/testing-generators.js +36 -0
- package/src/utils/testing-generators.js.map +1 -0
- package/src/utils/versions.d.ts +20 -0
- package/src/utils/versions.js +24 -0
- package/src/utils/versions.js.map +1 -0
- package/typings/svg.d.ts +7 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"$id": "NxReactNativeBundle",
|
|
6
|
+
"$schema": "http://json-schema.org/schema",
|
|
7
|
+
"title": "Offline JS Bundle for React Native",
|
|
8
|
+
"description": "JS Bundle target options.",
|
|
9
|
+
"type": "object",
|
|
10
|
+
"presets": [
|
|
11
|
+
{
|
|
12
|
+
"name": "Bundle for a specific platform",
|
|
13
|
+
"keys": ["platform"]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "Bundle a development build",
|
|
17
|
+
"keys": ["dev"]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "Bundle to a specific output path",
|
|
21
|
+
"keys": ["bundleOutput"]
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"name": "Bundle without global cache",
|
|
25
|
+
"keys": ["resetCache"]
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"properties": {
|
|
29
|
+
"entryFile": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"description": "The entry file relative to project root.",
|
|
32
|
+
"x-completion-type": "file",
|
|
33
|
+
"x-completion-glob": "main@(.js|.ts)"
|
|
34
|
+
},
|
|
35
|
+
"platform": {
|
|
36
|
+
"enum": ["ios", "android"],
|
|
37
|
+
"alias": "p",
|
|
38
|
+
"description": "Platform to build for."
|
|
39
|
+
},
|
|
40
|
+
"transformer": {
|
|
41
|
+
"type": "string",
|
|
42
|
+
"description": "Specify a custom transformer to be used."
|
|
43
|
+
},
|
|
44
|
+
"dev": {
|
|
45
|
+
"type": "boolean",
|
|
46
|
+
"description": "Generate a development build.",
|
|
47
|
+
"default": true
|
|
48
|
+
},
|
|
49
|
+
"minify": {
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"description": "Allows overriding whether bundle is minified."
|
|
52
|
+
},
|
|
53
|
+
"bundleOutput": {
|
|
54
|
+
"type": "string",
|
|
55
|
+
"description": "The output path of the generated files.",
|
|
56
|
+
"x-completion-type": "directory"
|
|
57
|
+
},
|
|
58
|
+
"maxWorkers": {
|
|
59
|
+
"type": "number",
|
|
60
|
+
"description": "The number of workers we should parallelize the transformer on."
|
|
61
|
+
},
|
|
62
|
+
"sourcemapOutput": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"description": "File name where to store the sourcemap file for resulting bundle, ex. /tmp/groups.map."
|
|
65
|
+
},
|
|
66
|
+
"sourcemapSourcesRoot": {
|
|
67
|
+
"type": "string",
|
|
68
|
+
"description": "Path to make sourcemaps sources entries relative to, ex. /root/dir."
|
|
69
|
+
},
|
|
70
|
+
"sourcemapUseAbsolutePath": {
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"description": "Report SourceMapURL using its full path.",
|
|
73
|
+
"default": false
|
|
74
|
+
},
|
|
75
|
+
"assetsDest": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "Directory name where to store assets referenced in the bundle."
|
|
78
|
+
},
|
|
79
|
+
"resetCache": {
|
|
80
|
+
"type": "boolean",
|
|
81
|
+
"description": "Removes cached files.",
|
|
82
|
+
"default": false
|
|
83
|
+
},
|
|
84
|
+
"readGlobalCache": {
|
|
85
|
+
"type": "boolean",
|
|
86
|
+
"description": "Try to fetch transformed JS code from the global cache, if configured.",
|
|
87
|
+
"default": false
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"required": ["platform", "entryFile", "bundleOutput"],
|
|
91
|
+
"examplesFile": "../../../docs/bundle-examples.md"
|
|
92
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const ensure_symlink_impl_1 = require("./ensure-symlink.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(ensure_symlink_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/ensure-symlink/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,+DAA0D;AAE1D,kBAAe,IAAA,0BAAiB,EAAC,6BAAqB,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
|
|
5
|
+
function ensureSymlinkExecutor(_, context) {
|
|
6
|
+
return tslib_1.__asyncGenerator(this, arguments, function* ensureSymlinkExecutor_1() {
|
|
7
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
8
|
+
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
|
|
9
|
+
yield yield tslib_1.__await({ success: true });
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
exports.default = ensureSymlinkExecutor;
|
|
13
|
+
//# sourceMappingURL=ensure-symlink.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ensure-symlink.impl.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/ensure-symlink/ensure-symlink.impl.ts"],"names":[],"mappings":";;;AACA,yFAAmF;AAMnF,SAA+B,qBAAqB,CAClD,CAAC,EACD,OAAwB;;QAExB,MAAM,WAAW,GACf,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;QAEpE,IAAA,sDAAwB,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;QAEpD,4BAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA,CAAC;IAC1B,CAAC;CAAA;AAVD,wCAUC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { ensureNodeModulesSymlink } from '../../utils/ensure-node-modules-symlink';
|
|
3
|
+
|
|
4
|
+
export interface ReactNativeEnsureSymlinkOutput {
|
|
5
|
+
success: boolean;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default async function* ensureSymlinkExecutor(
|
|
9
|
+
_,
|
|
10
|
+
context: ExecutorContext
|
|
11
|
+
): AsyncGenerator<ReactNativeEnsureSymlinkOutput> {
|
|
12
|
+
const projectRoot =
|
|
13
|
+
context.projectsConfigurations.projects[context.projectName].root;
|
|
14
|
+
|
|
15
|
+
ensureNodeModulesSymlink(context.root, projectRoot);
|
|
16
|
+
|
|
17
|
+
yield { success: true };
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"$id": "NxReactNativeEnsureSymlink",
|
|
6
|
+
"$schema": "http://json-schema.org/schema",
|
|
7
|
+
"title": "Ensure Symlink for React Native",
|
|
8
|
+
"description": "Ensure workspace node_modules is symlink under app's node_modules folder.",
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {}
|
|
11
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const pod_install_impl_1 = require("./pod-install.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(pod_install_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/pod-install/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,yDAA4C;AAE5C,kBAAe,IAAA,0BAAiB,EAAC,0BAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { ReactNativePodInstallOptions } from './schema';
|
|
3
|
+
export interface ReactNativePodInstallOutput {
|
|
4
|
+
success: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default function podInstall(options: ReactNativePodInstallOptions, context: ExecutorContext): AsyncGenerator<ReactNativePodInstallOutput>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const pod_install_task_1 = require("../../utils/pod-install-task");
|
|
6
|
+
function podInstall(options, context) {
|
|
7
|
+
return tslib_1.__asyncGenerator(this, arguments, function* podInstall_1() {
|
|
8
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
9
|
+
const iosDirectory = (0, path_1.join)(context.root, projectRoot, 'ios');
|
|
10
|
+
yield tslib_1.__await((0, pod_install_task_1.runPodInstall)(iosDirectory, true, options.buildFolder)());
|
|
11
|
+
yield yield tslib_1.__await({ success: true });
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
exports.default = podInstall;
|
|
15
|
+
//# sourceMappingURL=pod-install.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pod-install.impl.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/pod-install/pod-install.impl.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAG5B,mEAA6D;AAO7D,SAA+B,UAAU,CACvC,OAAqC,EACrC,OAAwB;;QAExB,MAAM,WAAW,GACf,OAAO,CAAC,sBAAsB,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,IAAI,CAAC;QACpE,MAAM,YAAY,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;QAC5D,sBAAM,IAAA,gCAAa,EAAC,YAAY,EAAE,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,EAAE,CAAA,CAAC;QAE/D,4BAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA,CAAC;IAC1B,CAAC;CAAA;AAVD,6BAUC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { join } from 'path';
|
|
2
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
3
|
+
|
|
4
|
+
import { runPodInstall } from '../../utils/pod-install-task';
|
|
5
|
+
import { ReactNativePodInstallOptions } from './schema';
|
|
6
|
+
|
|
7
|
+
export interface ReactNativePodInstallOutput {
|
|
8
|
+
success: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default async function* podInstall(
|
|
12
|
+
options: ReactNativePodInstallOptions,
|
|
13
|
+
context: ExecutorContext
|
|
14
|
+
): AsyncGenerator<ReactNativePodInstallOutput> {
|
|
15
|
+
const projectRoot =
|
|
16
|
+
context.projectsConfigurations.projects[context.projectName].root;
|
|
17
|
+
const iosDirectory = join(context.root, projectRoot, 'ios');
|
|
18
|
+
await runPodInstall(iosDirectory, true, options.buildFolder)();
|
|
19
|
+
|
|
20
|
+
yield { success: true };
|
|
21
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"$id": "NxReactNativePodInstall",
|
|
6
|
+
"$schema": "http://json-schema.org/schema",
|
|
7
|
+
"title": "Run Pod Install for React Native iOS Project",
|
|
8
|
+
"description": "Run `pod install` for React Native iOS Project.",
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"buildFolder": {
|
|
12
|
+
"description": "Location for iOS build artifacts. Corresponds to Xcode's \"-derivedDataPath\". Relative to ios directory",
|
|
13
|
+
"type": "string",
|
|
14
|
+
"default": "./build"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"required": ["buildFolder"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const run_android_impl_1 = require("./run-android.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(run_android_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/run-android/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,yDAAoD;AAEpD,kBAAe,IAAA,0BAAiB,EAAC,0BAAkB,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { ReactNativeRunAndroidOptions } from './schema';
|
|
3
|
+
export interface ReactNativeRunAndroidOutput {
|
|
4
|
+
success: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default function runAndroidExecutor(options: ReactNativeRunAndroidOptions, context: ExecutorContext): AsyncGenerator<ReactNativeRunAndroidOutput>;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const path_1 = require("path");
|
|
5
|
+
const child_process_1 = require("child_process");
|
|
6
|
+
const ensure_node_modules_symlink_1 = require("../../utils/ensure-node-modules-symlink");
|
|
7
|
+
const sync_deps_impl_1 = require("../sync-deps/sync-deps.impl");
|
|
8
|
+
const start_impl_1 = require("../start/start.impl");
|
|
9
|
+
const chmod_android_gradle_files_1 = require("../../utils/chmod-android-gradle-files");
|
|
10
|
+
const get_cli_options_1 = require("../../utils/get-cli-options");
|
|
11
|
+
let childProcess;
|
|
12
|
+
function runAndroidExecutor(options, context) {
|
|
13
|
+
return tslib_1.__asyncGenerator(this, arguments, function* runAndroidExecutor_1() {
|
|
14
|
+
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
15
|
+
(0, ensure_node_modules_symlink_1.ensureNodeModulesSymlink)(context.root, projectRoot);
|
|
16
|
+
(0, chmod_android_gradle_files_1.chmodAndroidGradlewFiles)((0, path_1.join)(projectRoot, 'android'));
|
|
17
|
+
if (options.sync) {
|
|
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
|
+
}
|
|
20
|
+
try {
|
|
21
|
+
const tasks = [runCliRunAndroid(context.root, projectRoot, options)];
|
|
22
|
+
if (options.packager) {
|
|
23
|
+
tasks.push((0, start_impl_1.runCliStart)(context.root, projectRoot, {
|
|
24
|
+
port: options.port,
|
|
25
|
+
resetCache: options.resetCache,
|
|
26
|
+
interactive: options.interactive,
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
yield tslib_1.__await(Promise.all(tasks));
|
|
30
|
+
yield yield tslib_1.__await({ success: true });
|
|
31
|
+
}
|
|
32
|
+
finally {
|
|
33
|
+
if (childProcess) {
|
|
34
|
+
childProcess.kill();
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
exports.default = runAndroidExecutor;
|
|
40
|
+
function runCliRunAndroid(workspaceRoot, projectRoot, options) {
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
/**
|
|
43
|
+
* Call the react native cli with option `--no-packager`
|
|
44
|
+
* Not passing '--packager' due to cli will launch start command from the project root
|
|
45
|
+
*/
|
|
46
|
+
childProcess = (0, child_process_1.fork)((0, path_1.join)(workspaceRoot, './node_modules/react-native/cli.js'), ['run-android', ...createRunAndroidOptions(options), '--no-packager'], {
|
|
47
|
+
cwd: (0, path_1.join)(workspaceRoot, projectRoot),
|
|
48
|
+
env: Object.assign(Object.assign({}, process.env), { RCT_METRO_PORT: options.port.toString() }),
|
|
49
|
+
});
|
|
50
|
+
// Ensure the child process is killed when the parent exits
|
|
51
|
+
process.on('exit', () => childProcess.kill());
|
|
52
|
+
process.on('SIGTERM', () => childProcess.kill());
|
|
53
|
+
childProcess.on('error', (err) => {
|
|
54
|
+
reject(err);
|
|
55
|
+
});
|
|
56
|
+
childProcess.on('exit', (code) => {
|
|
57
|
+
if (code === 0) {
|
|
58
|
+
resolve(code);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
reject(code);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
const nxOptions = ['sync', 'packager'];
|
|
67
|
+
const startOptions = ['port', 'resetCache'];
|
|
68
|
+
const deprecatedOptions = ['variant', 'jetifier'];
|
|
69
|
+
function createRunAndroidOptions(options) {
|
|
70
|
+
return (0, get_cli_options_1.getCliOptions)(options, [...nxOptions, ...startOptions, ...deprecatedOptions], ['appId', 'appIdSuffix']);
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=run-android.impl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-android.impl.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/run-android/run-android.impl.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { ChildProcess, fork } from 'child_process';
|
|
4
|
+
|
|
5
|
+
import { ensureNodeModulesSymlink } from '../../utils/ensure-node-modules-symlink';
|
|
6
|
+
import {
|
|
7
|
+
displayNewlyAddedDepsMessage,
|
|
8
|
+
syncDeps,
|
|
9
|
+
} from '../sync-deps/sync-deps.impl';
|
|
10
|
+
import { ReactNativeRunAndroidOptions } from './schema';
|
|
11
|
+
import { runCliStart } from '../start/start.impl';
|
|
12
|
+
import { chmodAndroidGradlewFiles } from '../../utils/chmod-android-gradle-files';
|
|
13
|
+
import { getCliOptions } from '../../utils/get-cli-options';
|
|
14
|
+
|
|
15
|
+
export interface ReactNativeRunAndroidOutput {
|
|
16
|
+
success: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
let childProcess: ChildProcess;
|
|
20
|
+
|
|
21
|
+
export default async function* runAndroidExecutor(
|
|
22
|
+
options: ReactNativeRunAndroidOptions,
|
|
23
|
+
context: ExecutorContext
|
|
24
|
+
): AsyncGenerator<ReactNativeRunAndroidOutput> {
|
|
25
|
+
const projectRoot =
|
|
26
|
+
context.projectsConfigurations.projects[context.projectName].root;
|
|
27
|
+
ensureNodeModulesSymlink(context.root, projectRoot);
|
|
28
|
+
chmodAndroidGradlewFiles(join(projectRoot, 'android'));
|
|
29
|
+
|
|
30
|
+
if (options.sync) {
|
|
31
|
+
displayNewlyAddedDepsMessage(
|
|
32
|
+
context.projectName,
|
|
33
|
+
await syncDeps(
|
|
34
|
+
context.projectName,
|
|
35
|
+
projectRoot,
|
|
36
|
+
context.root,
|
|
37
|
+
context.projectGraph
|
|
38
|
+
)
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
try {
|
|
43
|
+
const tasks = [runCliRunAndroid(context.root, projectRoot, options)];
|
|
44
|
+
if (options.packager) {
|
|
45
|
+
tasks.push(
|
|
46
|
+
runCliStart(context.root, projectRoot, {
|
|
47
|
+
port: options.port,
|
|
48
|
+
resetCache: options.resetCache,
|
|
49
|
+
interactive: options.interactive,
|
|
50
|
+
})
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
await Promise.all(tasks);
|
|
55
|
+
|
|
56
|
+
yield { success: true };
|
|
57
|
+
} finally {
|
|
58
|
+
if (childProcess) {
|
|
59
|
+
childProcess.kill();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function runCliRunAndroid(
|
|
65
|
+
workspaceRoot: string,
|
|
66
|
+
projectRoot: string,
|
|
67
|
+
options: ReactNativeRunAndroidOptions
|
|
68
|
+
) {
|
|
69
|
+
return new Promise((resolve, reject) => {
|
|
70
|
+
/**
|
|
71
|
+
* Call the react native cli with option `--no-packager`
|
|
72
|
+
* Not passing '--packager' due to cli will launch start command from the project root
|
|
73
|
+
*/
|
|
74
|
+
childProcess = fork(
|
|
75
|
+
join(workspaceRoot, './node_modules/react-native/cli.js'),
|
|
76
|
+
['run-android', ...createRunAndroidOptions(options), '--no-packager'],
|
|
77
|
+
{
|
|
78
|
+
cwd: join(workspaceRoot, projectRoot),
|
|
79
|
+
env: { ...process.env, RCT_METRO_PORT: options.port.toString() },
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
|
|
83
|
+
// Ensure the child process is killed when the parent exits
|
|
84
|
+
process.on('exit', () => childProcess.kill());
|
|
85
|
+
process.on('SIGTERM', () => childProcess.kill());
|
|
86
|
+
|
|
87
|
+
childProcess.on('error', (err) => {
|
|
88
|
+
reject(err);
|
|
89
|
+
});
|
|
90
|
+
childProcess.on('exit', (code) => {
|
|
91
|
+
if (code === 0) {
|
|
92
|
+
resolve(code);
|
|
93
|
+
} else {
|
|
94
|
+
reject(code);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const nxOptions = ['sync', 'packager'];
|
|
101
|
+
const startOptions = ['port', 'resetCache'];
|
|
102
|
+
const deprecatedOptions = ['variant', 'jetifier'];
|
|
103
|
+
|
|
104
|
+
function createRunAndroidOptions(options: ReactNativeRunAndroidOptions) {
|
|
105
|
+
return getCliOptions<ReactNativeRunAndroidOptions>(
|
|
106
|
+
options,
|
|
107
|
+
[...nxOptions, ...startOptions, ...deprecatedOptions],
|
|
108
|
+
['appId', 'appIdSuffix']
|
|
109
|
+
);
|
|
110
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ReactNativeBuildAndroidOptions } from '../build-android/schema';
|
|
2
|
+
import { ReactNativeStartOptions } from '../start/schema';
|
|
3
|
+
|
|
4
|
+
// part of options from https://github.com/react-native-community/cli/blob/main/packages/cli-platform-android/src/commands/runAndroid/index.ts
|
|
5
|
+
export interface ReactNativeRunAndroidOptions
|
|
6
|
+
extends ReactNativeBuildAndroidOptions {
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated use mode instead
|
|
9
|
+
*/
|
|
10
|
+
variant: string;
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated no longer supported in react native cli
|
|
13
|
+
* https://github.com/react-native-community/cli/commit/7c003f2b1d9d80ec5c167614ba533a004272c685
|
|
14
|
+
*/
|
|
15
|
+
jetifier: boolean;
|
|
16
|
+
|
|
17
|
+
// react native options
|
|
18
|
+
appId: string;
|
|
19
|
+
appIdSuffix: string;
|
|
20
|
+
mainActiviy: string;
|
|
21
|
+
deviceId: string;
|
|
22
|
+
listDevices?: boolean;
|
|
23
|
+
binaryPath?: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"outputCapture": "direct-nodejs",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"$id": "NxReactNativeRunAndroid",
|
|
6
|
+
"$schema": "http://json-schema.org/schema",
|
|
7
|
+
"title": "Run Android application",
|
|
8
|
+
"description": "Run Android target options.",
|
|
9
|
+
"type": "object",
|
|
10
|
+
"presets": [
|
|
11
|
+
{
|
|
12
|
+
"name": "Run Android for the current device architecture",
|
|
13
|
+
"keys": ["activeArchOnly"]
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"name": "Lists all available Android devices and simulators",
|
|
17
|
+
"keys": ["listDevices"]
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "Run Android without metro cache",
|
|
21
|
+
"keys": ["resetCache"]
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"properties": {
|
|
25
|
+
"variant": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "Specify your app's build variant (e.g. `debug`, `release`).",
|
|
28
|
+
"default": "debug",
|
|
29
|
+
"examples": ["debug", "release"],
|
|
30
|
+
"x-deprecated": "Deprecated from @react-native-community/cli, use mode instead, e.g. mode=debug. Will be remove in Nx 17."
|
|
31
|
+
},
|
|
32
|
+
"jetifier": {
|
|
33
|
+
"type": "boolean",
|
|
34
|
+
"description": "Run Jetifier – the AndroidX transition tool. By default it runs before Gradle to ease working with libraries that don't support AndroidX yet.",
|
|
35
|
+
"x-deprecated": "Deprecated from @react-native-community/cli. Will be remove in Nx 17."
|
|
36
|
+
},
|
|
37
|
+
"appId": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"description": "Specify an `applicationId` to launch after build. If not specified, `package` from `AndroidManifest.xml` will be used."
|
|
40
|
+
},
|
|
41
|
+
"appIdSuffix": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"description": "Specify an `applicationIdSuffix` to launch after build."
|
|
44
|
+
},
|
|
45
|
+
"mainActivity": {
|
|
46
|
+
"type": "string",
|
|
47
|
+
"description": "Name of the activity to start.",
|
|
48
|
+
"default": "MainActivity"
|
|
49
|
+
},
|
|
50
|
+
"deviceId": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"description": "Builds your app and starts it on a specific device/simulator with the given device id (listed by running `adb devices` on the command line)."
|
|
53
|
+
},
|
|
54
|
+
"listDevices": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"description": "Lists all available Android devices and simulators and let you choose one to run the app",
|
|
57
|
+
"default": false
|
|
58
|
+
},
|
|
59
|
+
"binaryPath": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"description": "Path relative to project root where pre-built .apk binary lives."
|
|
62
|
+
},
|
|
63
|
+
"mode": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"description": "Specify your app's build variant",
|
|
66
|
+
"default": "debug",
|
|
67
|
+
"examples": ["debug", "release"],
|
|
68
|
+
"x-priority": "important"
|
|
69
|
+
},
|
|
70
|
+
"packager": {
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"description": "Launch packager while building",
|
|
73
|
+
"default": true
|
|
74
|
+
},
|
|
75
|
+
"port": {
|
|
76
|
+
"type": "number",
|
|
77
|
+
"description": "The port where the packager server is listening on.",
|
|
78
|
+
"default": 8081
|
|
79
|
+
},
|
|
80
|
+
"tasks": {
|
|
81
|
+
"type": "array",
|
|
82
|
+
"items": {
|
|
83
|
+
"type": "string"
|
|
84
|
+
},
|
|
85
|
+
"description": "Run custom Gradle tasks. By default it's \"assembleDebug\". Will override passed mode and variant arguments.",
|
|
86
|
+
"examples": [
|
|
87
|
+
"assembleDebug",
|
|
88
|
+
"assembleRelease",
|
|
89
|
+
"bundleDebug",
|
|
90
|
+
"bundleRelease",
|
|
91
|
+
"installDebug",
|
|
92
|
+
"installRelease"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
"activeArchOnly": {
|
|
96
|
+
"type": "boolean",
|
|
97
|
+
"description": "Build native libraries only for the current device architecture for debug builds.",
|
|
98
|
+
"examples": ["x86_64", "arm64-v8a"],
|
|
99
|
+
"default": false
|
|
100
|
+
},
|
|
101
|
+
"extraParams": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"description": "Custom params passed to gradle build command"
|
|
104
|
+
},
|
|
105
|
+
"interactive": {
|
|
106
|
+
"type": "boolean",
|
|
107
|
+
"description": "Explicitly select build type and flavour to use before running a build"
|
|
108
|
+
},
|
|
109
|
+
"sync": {
|
|
110
|
+
"type": "boolean",
|
|
111
|
+
"description": "Syncs npm dependencies to `package.json` (for React Native autolink).",
|
|
112
|
+
"default": true
|
|
113
|
+
},
|
|
114
|
+
"resetCache": {
|
|
115
|
+
"type": "boolean",
|
|
116
|
+
"description": "Resets metro cache.",
|
|
117
|
+
"default": false
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
"examplesFile": "../../../docs/run-android-examples.md"
|
|
121
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const devkit_1 = require("@nx/devkit");
|
|
4
|
+
const run_ios_impl_1 = require("./run-ios.impl");
|
|
5
|
+
exports.default = (0, devkit_1.convertNxExecutor)(run_ios_impl_1.default);
|
|
6
|
+
//# sourceMappingURL=compat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/run-ios/compat.ts"],"names":[],"mappings":";;AAAA,uCAA+C;AAE/C,iDAA4C;AAE5C,kBAAe,IAAA,0BAAiB,EAAC,sBAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExecutorContext } from '@nx/devkit';
|
|
2
|
+
import { ReactNativeRunIosOptions } from './schema';
|
|
3
|
+
export interface ReactNativeRunIosOutput {
|
|
4
|
+
success: boolean;
|
|
5
|
+
}
|
|
6
|
+
export default function runIosExecutor(options: ReactNativeRunIosOptions, context: ExecutorContext): AsyncGenerator<ReactNativeRunIosOutput>;
|