@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,214 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Tree,
|
|
3
|
+
getProjects,
|
|
4
|
+
readJson,
|
|
5
|
+
readProjectConfiguration,
|
|
6
|
+
} from '@nx/devkit';
|
|
7
|
+
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
|
8
|
+
import { Linter } from '@nx/linter';
|
|
9
|
+
import { reactNativeApplicationGenerator } from './application';
|
|
10
|
+
|
|
11
|
+
describe('app', () => {
|
|
12
|
+
let appTree: Tree;
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
appTree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
16
|
+
appTree.write('.gitignore', '');
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should update configuration', async () => {
|
|
20
|
+
await reactNativeApplicationGenerator(appTree, {
|
|
21
|
+
name: 'myApp',
|
|
22
|
+
displayName: 'myApp',
|
|
23
|
+
linter: Linter.EsLint,
|
|
24
|
+
e2eTestRunner: 'none',
|
|
25
|
+
install: false,
|
|
26
|
+
});
|
|
27
|
+
const projects = getProjects(appTree);
|
|
28
|
+
|
|
29
|
+
expect(projects.get('my-app').root).toEqual('apps/my-app');
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it('should update nx.json', async () => {
|
|
33
|
+
await reactNativeApplicationGenerator(appTree, {
|
|
34
|
+
name: 'myApp',
|
|
35
|
+
displayName: 'myApp',
|
|
36
|
+
tags: 'one,two',
|
|
37
|
+
linter: Linter.EsLint,
|
|
38
|
+
e2eTestRunner: 'none',
|
|
39
|
+
install: false,
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const projectConfiguration = readProjectConfiguration(appTree, 'my-app');
|
|
43
|
+
expect(projectConfiguration).toMatchObject({
|
|
44
|
+
tags: ['one', 'two'],
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('should generate files', async () => {
|
|
49
|
+
await reactNativeApplicationGenerator(appTree, {
|
|
50
|
+
name: 'myApp',
|
|
51
|
+
displayName: 'myApp',
|
|
52
|
+
linter: Linter.EsLint,
|
|
53
|
+
e2eTestRunner: 'none',
|
|
54
|
+
install: false,
|
|
55
|
+
});
|
|
56
|
+
expect(appTree.exists('apps/my-app/src/app/App.tsx')).toBeTruthy();
|
|
57
|
+
expect(appTree.exists('apps/my-app/src/main.tsx')).toBeTruthy();
|
|
58
|
+
|
|
59
|
+
const tsconfig = readJson(appTree, 'apps/my-app/tsconfig.json');
|
|
60
|
+
expect(tsconfig.extends).toEqual('../../tsconfig.base.json');
|
|
61
|
+
|
|
62
|
+
expect(appTree.exists('apps/my-app/.eslintrc.json')).toBe(true);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('should generate targets', async () => {
|
|
66
|
+
await reactNativeApplicationGenerator(appTree, {
|
|
67
|
+
name: 'myApp',
|
|
68
|
+
displayName: 'myApp',
|
|
69
|
+
linter: Linter.EsLint,
|
|
70
|
+
e2eTestRunner: 'none',
|
|
71
|
+
install: false,
|
|
72
|
+
});
|
|
73
|
+
const targets = readProjectConfiguration(appTree, 'my-app').targets;
|
|
74
|
+
console.log(targets.test);
|
|
75
|
+
expect(targets.test).toBeDefined();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it('should extend from root tsconfig.json when no tsconfig.base.json', async () => {
|
|
79
|
+
appTree.rename('tsconfig.base.json', 'tsconfig.json');
|
|
80
|
+
|
|
81
|
+
await reactNativeApplicationGenerator(appTree, {
|
|
82
|
+
name: 'myApp',
|
|
83
|
+
displayName: 'myApp',
|
|
84
|
+
linter: Linter.EsLint,
|
|
85
|
+
e2eTestRunner: 'none',
|
|
86
|
+
install: false,
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const tsconfig = readJson(appTree, 'apps/my-app/tsconfig.json');
|
|
90
|
+
expect(tsconfig.extends).toEqual('../../tsconfig.json');
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
describe('detox', () => {
|
|
94
|
+
it('should create e2e app with directory', async () => {
|
|
95
|
+
await reactNativeApplicationGenerator(appTree, {
|
|
96
|
+
name: 'myApp',
|
|
97
|
+
directory: 'myDir',
|
|
98
|
+
linter: Linter.EsLint,
|
|
99
|
+
e2eTestRunner: 'detox',
|
|
100
|
+
install: false,
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
const projects = getProjects(appTree);
|
|
104
|
+
expect(projects.get('my-dir-my-app').root).toEqual('apps/my-dir/my-app');
|
|
105
|
+
|
|
106
|
+
expect(
|
|
107
|
+
appTree.exists('apps/my-dir/my-app-e2e/.detoxrc.json')
|
|
108
|
+
).toBeTruthy();
|
|
109
|
+
const detoxrc = appTree.read(
|
|
110
|
+
'apps/my-dir/my-app-e2e/.detoxrc.json',
|
|
111
|
+
'utf-8'
|
|
112
|
+
);
|
|
113
|
+
// Strip trailing commas
|
|
114
|
+
const detoxrcJson = JSON.parse(
|
|
115
|
+
detoxrc.replace(/(?<=(true|false|null|["\d}\]])\s*),(?=\s*[}\]])/g, '')
|
|
116
|
+
);
|
|
117
|
+
expect(detoxrcJson.apps).toEqual({
|
|
118
|
+
'android.debug': {
|
|
119
|
+
binaryPath:
|
|
120
|
+
'../../../apps/my-dir/my-app/android/app/build/outputs/apk/debug/app-debug.apk',
|
|
121
|
+
build:
|
|
122
|
+
'cd ../../../apps/my-dir/my-app/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',
|
|
123
|
+
type: 'android.apk',
|
|
124
|
+
},
|
|
125
|
+
'android.release': {
|
|
126
|
+
binaryPath:
|
|
127
|
+
'../../../apps/my-dir/my-app/android/app/build/outputs/apk/release/app-release.apk',
|
|
128
|
+
build:
|
|
129
|
+
'cd ../../../apps/my-dir/my-app/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',
|
|
130
|
+
type: 'android.apk',
|
|
131
|
+
},
|
|
132
|
+
'ios.debug': {
|
|
133
|
+
binaryPath:
|
|
134
|
+
'../../../apps/my-dir/my-app/ios/build/Build/Products/Debug-iphonesimulator/MyApp.app',
|
|
135
|
+
build:
|
|
136
|
+
"cd ../../../apps/my-dir/my-app/ios && xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath ./build -quiet",
|
|
137
|
+
type: 'ios.app',
|
|
138
|
+
},
|
|
139
|
+
'ios.release': {
|
|
140
|
+
binaryPath:
|
|
141
|
+
'../../../apps/my-dir/my-app/ios/build/Build/Products/Release-iphonesimulator/MyApp.app',
|
|
142
|
+
build:
|
|
143
|
+
"cd ../../../apps/my-dir/my-app/ios && xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath ./build -quiet",
|
|
144
|
+
type: 'ios.app',
|
|
145
|
+
},
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
it('should create e2e app without directory', async () => {
|
|
150
|
+
await reactNativeApplicationGenerator(appTree, {
|
|
151
|
+
name: 'myApp',
|
|
152
|
+
linter: Linter.EsLint,
|
|
153
|
+
e2eTestRunner: 'detox',
|
|
154
|
+
install: false,
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
const projects = getProjects(appTree);
|
|
158
|
+
expect(projects.get('my-app').root).toEqual('apps/my-app');
|
|
159
|
+
|
|
160
|
+
const detoxrc = appTree.read('apps/my-app-e2e/.detoxrc.json', 'utf-8');
|
|
161
|
+
// Strip trailing commas
|
|
162
|
+
const detoxrcJson = JSON.parse(
|
|
163
|
+
detoxrc.replace(/(?<=(true|false|null|["\d}\]])\s*),(?=\s*[}\]])/g, '')
|
|
164
|
+
);
|
|
165
|
+
expect(detoxrcJson.apps).toEqual({
|
|
166
|
+
'android.debug': {
|
|
167
|
+
binaryPath:
|
|
168
|
+
'../../apps/my-app/android/app/build/outputs/apk/debug/app-debug.apk',
|
|
169
|
+
build:
|
|
170
|
+
'cd ../../apps/my-app/android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug',
|
|
171
|
+
type: 'android.apk',
|
|
172
|
+
},
|
|
173
|
+
'android.release': {
|
|
174
|
+
binaryPath:
|
|
175
|
+
'../../apps/my-app/android/app/build/outputs/apk/release/app-release.apk',
|
|
176
|
+
build:
|
|
177
|
+
'cd ../../apps/my-app/android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release',
|
|
178
|
+
type: 'android.apk',
|
|
179
|
+
},
|
|
180
|
+
'ios.debug': {
|
|
181
|
+
binaryPath:
|
|
182
|
+
'../../apps/my-app/ios/build/Build/Products/Debug-iphonesimulator/MyApp.app',
|
|
183
|
+
build:
|
|
184
|
+
"cd ../../apps/my-app/ios && xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration Debug -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath ./build -quiet",
|
|
185
|
+
type: 'ios.app',
|
|
186
|
+
},
|
|
187
|
+
'ios.release': {
|
|
188
|
+
binaryPath:
|
|
189
|
+
'../../apps/my-app/ios/build/Build/Products/Release-iphonesimulator/MyApp.app',
|
|
190
|
+
build:
|
|
191
|
+
"cd ../../apps/my-app/ios && xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration Release -sdk iphonesimulator -destination 'platform=iOS Simulator,name=iPhone 14' -derivedDataPath ./build -quiet",
|
|
192
|
+
type: 'ios.app',
|
|
193
|
+
},
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
describe('--skipPackageJson', () => {
|
|
199
|
+
it('should not add or update dependencies when true', async () => {
|
|
200
|
+
const packageJsonBefore = readJson(appTree, 'package.json');
|
|
201
|
+
|
|
202
|
+
await reactNativeApplicationGenerator(appTree, {
|
|
203
|
+
name: 'myApp',
|
|
204
|
+
displayName: 'myApp',
|
|
205
|
+
linter: Linter.EsLint,
|
|
206
|
+
e2eTestRunner: 'none',
|
|
207
|
+
install: false,
|
|
208
|
+
skipPackageJson: true,
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
expect(readJson(appTree, 'package.json')).toEqual(packageJsonBefore);
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.7.6
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
apply plugin: "com.android.application"
|
|
2
|
+
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
|
|
3
|
+
apply plugin: "com.facebook.react"
|
|
4
|
+
|
|
5
|
+
import com.android.build.OutputFile
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* This is the configuration block to customize your React Native Android app.
|
|
9
|
+
* By default you don't need to apply any configuration, just uncomment the lines you need.
|
|
10
|
+
*/
|
|
11
|
+
react {
|
|
12
|
+
/* Folders */
|
|
13
|
+
// The root of your project, i.e. where "package.json" lives. Default is '..'
|
|
14
|
+
// root = file("../")
|
|
15
|
+
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
|
|
16
|
+
// reactNativeDir = file("../node_modules/react-native")
|
|
17
|
+
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
|
|
18
|
+
// codegenDir = file("../node_modules/react-native-codegen")
|
|
19
|
+
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
|
|
20
|
+
// cliFile = file("../node_modules/react-native/cli.js")
|
|
21
|
+
|
|
22
|
+
/* Variants */
|
|
23
|
+
// The list of variants to that are debuggable. For those we're going to
|
|
24
|
+
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
|
|
25
|
+
// If you add flavors like lite, prod, etc. you'll have to list your debuggableVariants.
|
|
26
|
+
// debuggableVariants = ["liteDebug", "prodDebug"]
|
|
27
|
+
|
|
28
|
+
/* Bundling */
|
|
29
|
+
// A list containing the node command and its flags. Default is just 'node'.
|
|
30
|
+
// nodeExecutableAndArgs = ["node"]
|
|
31
|
+
//
|
|
32
|
+
// The command to run when bundling. By default is 'bundle'
|
|
33
|
+
// bundleCommand = "ram-bundle"
|
|
34
|
+
//
|
|
35
|
+
// The path to the CLI configuration file. Default is empty.
|
|
36
|
+
// bundleConfig = file(../rn-cli.config.js)
|
|
37
|
+
//
|
|
38
|
+
// The name of the generated asset file containing your JS bundle
|
|
39
|
+
// bundleAssetName = "MyApplication.android.bundle"
|
|
40
|
+
//
|
|
41
|
+
// The entry file for bundle generation. Default is 'index.android.js' or 'index.js'
|
|
42
|
+
// entryFile = file("../js/MyApplication.android.js")
|
|
43
|
+
//
|
|
44
|
+
// A list of extra flags to pass to the 'bundle' commands.
|
|
45
|
+
// See https://github.com/react-native-community/cli/blob/main/docs/commands.md#bundle
|
|
46
|
+
// extraPackagerArgs = []
|
|
47
|
+
|
|
48
|
+
/* Hermes Commands */
|
|
49
|
+
// The hermes compiler command to run. By default it is 'hermesc'
|
|
50
|
+
// hermesCommand = "$rootDir/my-custom-hermesc/bin/hermesc"
|
|
51
|
+
//
|
|
52
|
+
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
|
|
53
|
+
// hermesFlags = ["-O", "-output-source-map"]
|
|
54
|
+
entryFile = file("../../<%= entryFile %>")
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Set this to true to create four separate APKs instead of one,
|
|
59
|
+
* one for each native architecture. This is useful if you don't
|
|
60
|
+
* use App Bundles (https://developer.android.com/guide/app-bundle/)
|
|
61
|
+
* and want to have separate APKs to upload to the Play Store.
|
|
62
|
+
*/
|
|
63
|
+
def enableSeparateBuildPerCPUArchitecture = false
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
|
|
67
|
+
*/
|
|
68
|
+
def enableProguardInReleaseBuilds = false
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The preferred build flavor of JavaScriptCore (JSC)
|
|
72
|
+
*
|
|
73
|
+
* For example, to use the international variant, you can use:
|
|
74
|
+
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
|
|
75
|
+
*
|
|
76
|
+
* The international variant includes ICU i18n library and necessary data
|
|
77
|
+
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
|
|
78
|
+
* give correct results when using with locales other than en-US. Note that
|
|
79
|
+
* this variant is about 6MiB larger per architecture than default.
|
|
80
|
+
*/
|
|
81
|
+
def jscFlavor = 'org.webkit:android-jsc:+'
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Private function to get the list of Native Architectures you want to build.
|
|
85
|
+
* This reads the value from reactNativeArchitectures in your gradle.properties
|
|
86
|
+
* file and works together with the --active-arch-only flag of react-native run-android.
|
|
87
|
+
*/
|
|
88
|
+
def reactNativeArchitectures() {
|
|
89
|
+
def value = project.getProperties().get("reactNativeArchitectures")
|
|
90
|
+
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
android {
|
|
94
|
+
ndkVersion rootProject.ext.ndkVersion
|
|
95
|
+
|
|
96
|
+
compileSdkVersion rootProject.ext.compileSdkVersion
|
|
97
|
+
|
|
98
|
+
namespace "com.<%= lowerCaseName %>"
|
|
99
|
+
defaultConfig {
|
|
100
|
+
applicationId "com.<%= lowerCaseName %>"
|
|
101
|
+
minSdkVersion rootProject.ext.minSdkVersion
|
|
102
|
+
targetSdkVersion rootProject.ext.targetSdkVersion
|
|
103
|
+
versionCode 1
|
|
104
|
+
versionName "1.0"
|
|
105
|
+
<% if (e2eTestRunner === 'detox') { %>
|
|
106
|
+
testBuildType System.getProperty('testBuildType', 'debug')
|
|
107
|
+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
|
|
108
|
+
<% } %>
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
splits {
|
|
112
|
+
abi {
|
|
113
|
+
reset()
|
|
114
|
+
enable enableSeparateBuildPerCPUArchitecture
|
|
115
|
+
universalApk false // If true, also generate a universal APK
|
|
116
|
+
include (*reactNativeArchitectures())
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
signingConfigs {
|
|
120
|
+
debug {
|
|
121
|
+
storeFile file('debug.keystore')
|
|
122
|
+
storePassword 'android'
|
|
123
|
+
keyAlias 'androiddebugkey'
|
|
124
|
+
keyPassword 'android'
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
buildTypes {
|
|
128
|
+
debug {
|
|
129
|
+
signingConfig signingConfigs.debug
|
|
130
|
+
}
|
|
131
|
+
release {
|
|
132
|
+
// Caution! In production, you need to generate your own keystore file.
|
|
133
|
+
// see https://reactnative.dev/docs/signed-apk-android.
|
|
134
|
+
signingConfig signingConfigs.debug
|
|
135
|
+
minifyEnabled enableProguardInReleaseBuilds
|
|
136
|
+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
|
|
137
|
+
<% if (e2eTestRunner === 'detox') { %>
|
|
138
|
+
proguardFile "${rootProject.projectDir}/../node_modules/detox/android/detox/proguard-rules-app.pro"
|
|
139
|
+
<% } %>
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// applicationVariants are e.g. debug, release
|
|
144
|
+
applicationVariants.all { variant ->
|
|
145
|
+
variant.outputs.each { output ->
|
|
146
|
+
// For each separate APK per architecture, set a unique version code as described here:
|
|
147
|
+
// https://developer.android.com/studio/build/configure-apk-splits.html
|
|
148
|
+
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
|
|
149
|
+
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
|
|
150
|
+
def abi = output.getFilter(OutputFile.ABI)
|
|
151
|
+
if (abi != null) { // null for the universal-debug, universal-release variants
|
|
152
|
+
output.versionCodeOverride =
|
|
153
|
+
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
dependencies {
|
|
161
|
+
<% if (e2eTestRunner === 'detox') { %>
|
|
162
|
+
androidTestImplementation('com.wix:detox:+')
|
|
163
|
+
implementation 'androidx.appcompat:appcompat:1.1.0'
|
|
164
|
+
<% } %>
|
|
165
|
+
// The version of react-native is set by the React Native Gradle Plugin
|
|
166
|
+
implementation("com.facebook.react:react-android")
|
|
167
|
+
implementation project(':react-native-config')
|
|
168
|
+
|
|
169
|
+
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
|
|
170
|
+
|
|
171
|
+
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
|
|
172
|
+
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
|
|
173
|
+
exclude group:'com.squareup.okhttp3', module:'okhttp'
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
|
|
177
|
+
if (hermesEnabled.toBoolean()) {
|
|
178
|
+
implementation("com.facebook.react:hermes-android")
|
|
179
|
+
} else {
|
|
180
|
+
implementation jscFlavor
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Add project specific ProGuard rules here.
|
|
2
|
+
# By default, the flags in this file are appended to flags specified
|
|
3
|
+
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
|
|
4
|
+
# You can edit the include path and order by changing the proguardFiles
|
|
5
|
+
# directive in build.gradle.
|
|
6
|
+
#
|
|
7
|
+
# For more details, see
|
|
8
|
+
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
9
|
+
|
|
10
|
+
# Add any project specific keep options here:
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// Replace "com.<%= lowerCaseName %>" here and below with your app's package name from the top of MainActivity.java
|
|
2
|
+
package com.<%= lowerCaseName %>;
|
|
3
|
+
|
|
4
|
+
import com.wix.detox.Detox;
|
|
5
|
+
import com.wix.detox.config.DetoxConfig;
|
|
6
|
+
|
|
7
|
+
import org.junit.Rule;
|
|
8
|
+
import org.junit.Test;
|
|
9
|
+
import org.junit.runner.RunWith;
|
|
10
|
+
|
|
11
|
+
import androidx.test.ext.junit.runners.AndroidJUnit4;
|
|
12
|
+
import androidx.test.filters.LargeTest;
|
|
13
|
+
import androidx.test.rule.ActivityTestRule;
|
|
14
|
+
|
|
15
|
+
@RunWith(AndroidJUnit4.class)
|
|
16
|
+
@LargeTest
|
|
17
|
+
public class DetoxTest {
|
|
18
|
+
@Rule // (2)
|
|
19
|
+
public ActivityTestRule<MainActivity> mActivityRule = new ActivityTestRule<>(MainActivity.class, false, false);
|
|
20
|
+
|
|
21
|
+
@Test
|
|
22
|
+
public void runDetoxTests() {
|
|
23
|
+
DetoxConfig detoxConfig = new DetoxConfig();
|
|
24
|
+
detoxConfig.idlePolicyConfig.masterTimeoutSec = 90;
|
|
25
|
+
detoxConfig.idlePolicyConfig.idleResourceTimeoutSec = 60;
|
|
26
|
+
detoxConfig.rnContextLoadTimeoutSec = (BuildConfig.DEBUG ? 180 : 60);
|
|
27
|
+
|
|
28
|
+
Detox.runTests(mActivityRule, detoxConfig);
|
|
29
|
+
}
|
|
30
|
+
}
|
package/src/generators/application/files/app/android/app/src/debug/AndroidManifest.xml.template
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
+
xmlns:tools="http://schemas.android.com/tools">
|
|
4
|
+
|
|
5
|
+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
|
|
6
|
+
|
|
7
|
+
<application
|
|
8
|
+
android:usesCleartextTraffic="true"
|
|
9
|
+
tools:targetApi="28"
|
|
10
|
+
tools:ignore="GoogleAppIndexingWarning"
|
|
11
|
+
android:networkSecurityConfig="@xml/network_security_config">
|
|
12
|
+
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
|
|
13
|
+
</application>
|
|
14
|
+
</manifest>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
+
*
|
|
4
|
+
* <p>This source code is licensed under the MIT license found in the LICENSE file in the root
|
|
5
|
+
* directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
package com.<%= lowerCaseName %>;
|
|
8
|
+
|
|
9
|
+
import android.content.Context;
|
|
10
|
+
import com.facebook.flipper.android.AndroidFlipperClient;
|
|
11
|
+
import com.facebook.flipper.android.utils.FlipperUtils;
|
|
12
|
+
import com.facebook.flipper.core.FlipperClient;
|
|
13
|
+
import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin;
|
|
14
|
+
import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin;
|
|
15
|
+
import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin;
|
|
16
|
+
import com.facebook.flipper.plugins.inspector.DescriptorMapping;
|
|
17
|
+
import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin;
|
|
18
|
+
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor;
|
|
19
|
+
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
|
|
20
|
+
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
|
|
21
|
+
import com.facebook.react.ReactInstanceEventListener;
|
|
22
|
+
import com.facebook.react.ReactInstanceManager;
|
|
23
|
+
import com.facebook.react.bridge.ReactContext;
|
|
24
|
+
import com.facebook.react.modules.network.NetworkingModule;
|
|
25
|
+
import okhttp3.OkHttpClient;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Class responsible of loading Flipper inside your React Native application. This is the debug
|
|
29
|
+
* flavor of it. Here you can add your own plugins and customize the Flipper setup.
|
|
30
|
+
*/
|
|
31
|
+
public class ReactNativeFlipper {
|
|
32
|
+
public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) {
|
|
33
|
+
if (FlipperUtils.shouldEnableFlipper(context)) {
|
|
34
|
+
final FlipperClient client = AndroidFlipperClient.getInstance(context);
|
|
35
|
+
|
|
36
|
+
client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults()));
|
|
37
|
+
client.addPlugin(new DatabasesFlipperPlugin(context));
|
|
38
|
+
client.addPlugin(new SharedPreferencesFlipperPlugin(context));
|
|
39
|
+
client.addPlugin(CrashReporterPlugin.getInstance());
|
|
40
|
+
|
|
41
|
+
NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin();
|
|
42
|
+
NetworkingModule.setCustomClientBuilder(
|
|
43
|
+
new NetworkingModule.CustomClientBuilder() {
|
|
44
|
+
@Override
|
|
45
|
+
public void apply(OkHttpClient.Builder builder) {
|
|
46
|
+
builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
client.addPlugin(networkFlipperPlugin);
|
|
50
|
+
client.start();
|
|
51
|
+
|
|
52
|
+
// Fresco Plugin needs to ensure that ImagePipelineFactory is initialized
|
|
53
|
+
// Hence we run if after all native modules have been initialized
|
|
54
|
+
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
|
|
55
|
+
if (reactContext == null) {
|
|
56
|
+
reactInstanceManager.addReactInstanceEventListener(
|
|
57
|
+
new ReactInstanceEventListener() {
|
|
58
|
+
@Override
|
|
59
|
+
public void onReactContextInitialized(ReactContext reactContext) {
|
|
60
|
+
reactInstanceManager.removeReactInstanceEventListener(this);
|
|
61
|
+
reactContext.runOnNativeModulesQueueThread(
|
|
62
|
+
new Runnable() {
|
|
63
|
+
@Override
|
|
64
|
+
public void run() {
|
|
65
|
+
client.addPlugin(new FrescoFlipperPlugin());
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
} else {
|
|
71
|
+
client.addPlugin(new FrescoFlipperPlugin());
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
package/src/generators/application/files/app/android/app/src/main/AndroidManifest.xml.template
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
|
|
3
|
+
<uses-permission android:name="android.permission.INTERNET" />
|
|
4
|
+
|
|
5
|
+
<application
|
|
6
|
+
android:name=".MainApplication"
|
|
7
|
+
android:label="@string/app_name"
|
|
8
|
+
android:icon="@mipmap/ic_launcher"
|
|
9
|
+
android:roundIcon="@mipmap/ic_launcher_round"
|
|
10
|
+
android:allowBackup="false"
|
|
11
|
+
android:theme="@style/AppTheme"
|
|
12
|
+
android:networkSecurityConfig="@xml/network_security_config">
|
|
13
|
+
<activity
|
|
14
|
+
android:name=".MainActivity"
|
|
15
|
+
android:label="@string/app_name"
|
|
16
|
+
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
|
|
17
|
+
android:launchMode="singleTask"
|
|
18
|
+
android:windowSoftInputMode="adjustResize"
|
|
19
|
+
android:exported="true">
|
|
20
|
+
<intent-filter>
|
|
21
|
+
<action android:name="android.intent.action.MAIN" />
|
|
22
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
|
23
|
+
</intent-filter>
|
|
24
|
+
</activity>
|
|
25
|
+
</application>
|
|
26
|
+
</manifest>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
package com.<%= lowerCaseName %>;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.ReactActivity;
|
|
4
|
+
import com.facebook.react.ReactActivityDelegate;
|
|
5
|
+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
|
6
|
+
import com.facebook.react.defaults.DefaultReactActivityDelegate;
|
|
7
|
+
|
|
8
|
+
public class MainActivity extends ReactActivity {
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Returns the name of the main component registered from JavaScript. This is used to schedule
|
|
12
|
+
* rendering of the component.
|
|
13
|
+
*/
|
|
14
|
+
@Override
|
|
15
|
+
protected String getMainComponentName() {
|
|
16
|
+
return "<%= className %>";
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Returns the instance of the {@link ReactActivityDelegate}. Here we use a util class {@link
|
|
21
|
+
* DefaultReactActivityDelegate} which allows you to easily enable Fabric and Concurrent React
|
|
22
|
+
* (aka React 18) with two boolean flags.
|
|
23
|
+
*/
|
|
24
|
+
@Override
|
|
25
|
+
protected ReactActivityDelegate createReactActivityDelegate() {
|
|
26
|
+
return new DefaultReactActivityDelegate(
|
|
27
|
+
this,
|
|
28
|
+
getMainComponentName(),
|
|
29
|
+
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
|
|
30
|
+
DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
|
|
31
|
+
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
|
|
32
|
+
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
package com.<%= lowerCaseName %>;
|
|
2
|
+
|
|
3
|
+
import android.app.Application;
|
|
4
|
+
import com.facebook.react.PackageList;
|
|
5
|
+
import com.facebook.react.ReactApplication;
|
|
6
|
+
import com.facebook.react.ReactNativeHost;
|
|
7
|
+
import com.facebook.react.ReactPackage;
|
|
8
|
+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
|
|
9
|
+
import com.facebook.react.defaults.DefaultReactNativeHost;
|
|
10
|
+
import com.facebook.soloader.SoLoader;
|
|
11
|
+
import java.util.List;
|
|
12
|
+
import com.lugg.RNCConfig.RNCConfigPackage;
|
|
13
|
+
|
|
14
|
+
public class MainApplication extends Application implements ReactApplication {
|
|
15
|
+
|
|
16
|
+
private final ReactNativeHost mReactNativeHost =
|
|
17
|
+
new DefaultReactNativeHost(this) {
|
|
18
|
+
@Override
|
|
19
|
+
public boolean getUseDeveloperSupport() {
|
|
20
|
+
return BuildConfig.DEBUG;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@Override
|
|
24
|
+
protected List<ReactPackage> getPackages() {
|
|
25
|
+
@SuppressWarnings("UnnecessaryLocalVariable")
|
|
26
|
+
List<ReactPackage> packages = new PackageList(this).getPackages();
|
|
27
|
+
// Packages that cannot be autolinked yet can be added manually here, for example:
|
|
28
|
+
// packages.add(new MyReactNativePackage());
|
|
29
|
+
return packages;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Override
|
|
33
|
+
protected String getJSMainModuleName() {
|
|
34
|
+
return "<%= entryFile %>";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@Override
|
|
38
|
+
protected boolean isNewArchEnabled() {
|
|
39
|
+
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@Override
|
|
43
|
+
protected Boolean isHermesEnabled() {
|
|
44
|
+
return BuildConfig.IS_HERMES_ENABLED;
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
@Override
|
|
49
|
+
public ReactNativeHost getReactNativeHost() {
|
|
50
|
+
return mReactNativeHost;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@Override
|
|
54
|
+
public void onCreate() {
|
|
55
|
+
super.onCreate();
|
|
56
|
+
SoLoader.init(this, /* native exopackage */ false);
|
|
57
|
+
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
|
|
58
|
+
// If you opted-in for the New Architecture, we load the native entry point for this app.
|
|
59
|
+
DefaultNewArchitectureEntryPoint.load();
|
|
60
|
+
}
|
|
61
|
+
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
|
|
62
|
+
}
|
|
63
|
+
}
|