@nrwl/react-native 16.0.0-beta.0 → 16.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/executors.json +40 -40
- package/generators.json +2 -107
- package/index.d.ts +1 -5
- package/index.js +2 -11
- package/index.js.map +1 -1
- package/package.json +7 -25
- package/plugins/jest/svg-mock.js.map +1 -1
- package/plugins/with-nx-metro.d.ts +1 -8
- package/plugins/with-nx-metro.js +2 -29
- package/plugins/with-nx-metro.js.map +1 -1
- package/.eslintrc.json +0 -19
- package/README.md +0 -63
- package/migrations.json +0 -1285
- package/plugins/metro-resolver.d.ts +0 -1
- package/plugins/metro-resolver.js +0 -135
- package/plugins/metro-resolver.js.map +0 -1
- package/project.json +0 -61
- package/src/executors/build-android/build-android.impl.d.ts +0 -6
- package/src/executors/build-android/build-android.impl.js +0 -76
- package/src/executors/build-android/build-android.impl.js.map +0 -1
- package/src/executors/build-android/build-android.impl.ts +0 -108
- package/src/executors/build-android/compat.d.ts +0 -2
- package/src/executors/build-android/compat.js +0 -6
- package/src/executors/build-android/compat.js.map +0 -1
- package/src/executors/build-android/schema.d.ts +0 -31
- package/src/executors/build-android/schema.json +0 -102
- package/src/executors/build-ios/build-ios.impl.d.ts +0 -6
- package/src/executors/build-ios/build-ios.impl.js +0 -77
- package/src/executors/build-ios/build-ios.impl.js.map +0 -1
- package/src/executors/build-ios/build-ios.impl.ts +0 -118
- package/src/executors/build-ios/compat.d.ts +0 -2
- package/src/executors/build-ios/compat.js +0 -6
- package/src/executors/build-ios/compat.js.map +0 -1
- package/src/executors/build-ios/schema.d.ts +0 -22
- package/src/executors/build-ios/schema.json +0 -106
- package/src/executors/bundle/bundle.impl.d.ts +0 -6
- package/src/executors/bundle/bundle.impl.js +0 -58
- package/src/executors/bundle/bundle.impl.js.map +0 -1
- package/src/executors/bundle/bundle.impl.ts +0 -76
- package/src/executors/bundle/compat.d.ts +0 -2
- package/src/executors/bundle/compat.js +0 -6
- package/src/executors/bundle/compat.js.map +0 -1
- package/src/executors/bundle/schema.d.ts +0 -16
- package/src/executors/bundle/schema.json +0 -92
- package/src/executors/ensure-symlink/compat.d.ts +0 -2
- package/src/executors/ensure-symlink/compat.js +0 -6
- package/src/executors/ensure-symlink/compat.js.map +0 -1
- package/src/executors/ensure-symlink/ensure-symlink.impl.d.ts +0 -5
- package/src/executors/ensure-symlink/ensure-symlink.impl.js +0 -13
- package/src/executors/ensure-symlink/ensure-symlink.impl.js.map +0 -1
- package/src/executors/ensure-symlink/ensure-symlink.impl.ts +0 -18
- package/src/executors/ensure-symlink/schema.json +0 -11
- package/src/executors/pod-install/compat.d.ts +0 -2
- package/src/executors/pod-install/compat.js +0 -6
- package/src/executors/pod-install/compat.js.map +0 -1
- package/src/executors/pod-install/pod-install.impl.d.ts +0 -6
- package/src/executors/pod-install/pod-install.impl.js +0 -15
- package/src/executors/pod-install/pod-install.impl.js.map +0 -1
- package/src/executors/pod-install/pod-install.impl.ts +0 -21
- package/src/executors/pod-install/schema.d.ts +0 -3
- package/src/executors/pod-install/schema.json +0 -18
- package/src/executors/run-android/compat.d.ts +0 -2
- package/src/executors/run-android/compat.js +0 -6
- package/src/executors/run-android/compat.js.map +0 -1
- package/src/executors/run-android/run-android.impl.d.ts +0 -6
- package/src/executors/run-android/run-android.impl.js +0 -72
- package/src/executors/run-android/run-android.impl.js.map +0 -1
- package/src/executors/run-android/run-android.impl.ts +0 -110
- package/src/executors/run-android/schema.d.ts +0 -24
- package/src/executors/run-android/schema.json +0 -121
- package/src/executors/run-ios/compat.d.ts +0 -2
- package/src/executors/run-ios/compat.js +0 -6
- package/src/executors/run-ios/compat.js.map +0 -1
- package/src/executors/run-ios/run-ios.impl.d.ts +0 -6
- package/src/executors/run-ios/run-ios.impl.js +0 -78
- package/src/executors/run-ios/run-ios.impl.js.map +0 -1
- package/src/executors/run-ios/run-ios.impl.ts +0 -120
- package/src/executors/run-ios/schema.d.ts +0 -12
- package/src/executors/run-ios/schema.json +0 -119
- package/src/executors/start/compat.d.ts +0 -2
- package/src/executors/start/compat.js +0 -6
- package/src/executors/start/compat.js.map +0 -1
- package/src/executors/start/lib/is-packager-running.d.ts +0 -1
- package/src/executors/start/lib/is-packager-running.js +0 -19
- package/src/executors/start/lib/is-packager-running.js.map +0 -1
- package/src/executors/start/schema.d.ts +0 -7
- package/src/executors/start/schema.json +0 -28
- package/src/executors/start/start.impl.d.ts +0 -8
- package/src/executors/start/start.impl.js +0 -99
- package/src/executors/start/start.impl.js.map +0 -1
- package/src/executors/start/start.impl.ts +0 -120
- package/src/executors/storybook/compat.d.ts +0 -2
- package/src/executors/storybook/compat.js +0 -6
- package/src/executors/storybook/compat.js.map +0 -1
- package/src/executors/storybook/schema.d.ts +0 -7
- package/src/executors/storybook/schema.json +0 -34
- package/src/executors/storybook/storybook.impl.d.ts +0 -5
- package/src/executors/storybook/storybook.impl.js +0 -76
- package/src/executors/storybook/storybook.impl.js.map +0 -1
- package/src/executors/storybook/storybook.impl.ts +0 -105
- package/src/executors/sync-deps/compat.d.ts +0 -2
- package/src/executors/sync-deps/compat.js +0 -6
- package/src/executors/sync-deps/compat.js.map +0 -1
- package/src/executors/sync-deps/schema.d.ts +0 -4
- package/src/executors/sync-deps/schema.json +0 -28
- package/src/executors/sync-deps/sync-deps.impl.d.ts +0 -8
- package/src/executors/sync-deps/sync-deps.impl.js +0 -62
- package/src/executors/sync-deps/sync-deps.impl.js.map +0 -1
- package/src/executors/sync-deps/sync-deps.impl.ts +0 -101
- package/src/generators/application/application.d.ts +0 -5
- package/src/generators/application/application.js +0 -40
- package/src/generators/application/application.js.map +0 -1
- package/src/generators/application/application.spec.ts +0 -214
- package/src/generators/application/files/app/.ruby-version +0 -1
- package/src/generators/application/files/app/Gemfile.template +0 -6
- package/src/generators/application/files/app/android/app/build.gradle.template +0 -184
- package/src/generators/application/files/app/android/app/debug.keystore +0 -0
- package/src/generators/application/files/app/android/app/proguard-rules.pro +0 -10
- package/src/generators/application/files/app/android/app/src/androidTest/java/com/__lowerCaseName__/DetoxTest.java.template +0 -30
- package/src/generators/application/files/app/android/app/src/debug/AndroidManifest.xml.template +0 -14
- package/src/generators/application/files/app/android/app/src/debug/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +0 -75
- package/src/generators/application/files/app/android/app/src/main/AndroidManifest.xml.template +0 -26
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainActivity.java.template +0 -35
- package/src/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainApplication.java.template +0 -63
- package/src/generators/application/files/app/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -36
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- package/src/generators/application/files/app/android/app/src/main/res/values/strings.xml.template +0 -3
- package/src/generators/application/files/app/android/app/src/main/res/values/styles.xml +0 -9
- package/src/generators/application/files/app/android/app/src/main/res/xml/network_security_config.xml +0 -7
- package/src/generators/application/files/app/android/app/src/release/java/com/__lowerCaseName__/ReactNativeFlipper.java.template +0 -20
- package/src/generators/application/files/app/android/build.gradle.template +0 -34
- package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/src/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.properties +0 -5
- package/src/generators/application/files/app/android/gradle.properties +0 -44
- package/src/generators/application/files/app/android/gradlew.bat +0 -89
- package/src/generators/application/files/app/android/gradlew.template +0 -234
- package/src/generators/application/files/app/android/settings.gradle.template +0 -7
- package/src/generators/application/files/app/app.json.template +0 -4
- package/src/generators/application/files/app/babel.config.json.template +0 -3
- package/src/generators/application/files/app/ios/.xcode.env.template +0 -12
- package/src/generators/application/files/app/ios/Podfile.template +0 -60
- package/src/generators/application/files/app/ios/__className__/AppDelegate.h +0 -6
- package/src/generators/application/files/app/ios/__className__/AppDelegate.mm.template +0 -36
- package/src/generators/application/files/app/ios/__className__/Images.xcassets/AppIcon.appiconset/Contents.json +0 -53
- package/src/generators/application/files/app/ios/__className__/Images.xcassets/Contents.json +0 -6
- package/src/generators/application/files/app/ios/__className__/Info.plist.template +0 -55
- package/src/generators/application/files/app/ios/__className__/LaunchScreen.storyboard.template +0 -47
- package/src/generators/application/files/app/ios/__className__/main.m +0 -10
- package/src/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +0 -702
- package/src/generators/application/files/app/ios/__className__.xcodeproj/xcshareddata/xcschemes/__className__.xcscheme.template +0 -88
- package/src/generators/application/files/app/ios/__className__.xcworkspace/contents.xcworkspacedata +0 -10
- package/src/generators/application/files/app/ios/__className__Tests/Info.plist +0 -24
- package/src/generators/application/files/app/ios/__className__Tests/__className__Tests.m +0 -66
- package/src/generators/application/files/app/metro.config.js.template +0 -38
- package/src/generators/application/files/app/package.json.template +0 -15
- package/src/generators/application/files/app/src/app/App.spec.tsx.template +0 -9
- package/src/generators/application/files/app/src/app/App.tsx.template +0 -694
- package/src/generators/application/files/app/src/main.tsx.template +0 -4
- package/src/generators/application/files/app/test-setup.ts.template +0 -1
- package/src/generators/application/files/app/tsconfig.app.json.template +0 -9
- package/src/generators/application/files/app/tsconfig.json.template +0 -25
- package/src/generators/application/lib/add-detox.d.ts +0 -3
- package/src/generators/application/lib/add-detox.js +0 -16
- package/src/generators/application/lib/add-detox.js.map +0 -1
- package/src/generators/application/lib/add-project.d.ts +0 -3
- package/src/generators/application/lib/add-project.js +0 -83
- package/src/generators/application/lib/add-project.js.map +0 -1
- package/src/generators/application/lib/create-application-files.d.ts +0 -3
- package/src/generators/application/lib/create-application-files.js +0 -20
- package/src/generators/application/lib/create-application-files.js.map +0 -1
- package/src/generators/application/lib/nomalize-options.spec.ts +0 -138
- package/src/generators/application/lib/normalize-options.d.ts +0 -13
- package/src/generators/application/lib/normalize-options.js +0 -36
- package/src/generators/application/lib/normalize-options.js.map +0 -1
- package/src/generators/application/schema.d.ts +0 -19
- package/src/generators/application/schema.json +0 -89
- package/src/generators/component/component.d.ts +0 -5
- package/src/generators/component/component.js +0 -53
- package/src/generators/component/component.js.map +0 -1
- package/src/generators/component/component.spec.ts +0 -135
- package/src/generators/component/files/__fileName__.spec.tsx__tmpl__ +0 -11
- package/src/generators/component/files/__fileName__.tsx__tmpl__ +0 -32
- package/src/generators/component/lib/add-import.d.ts +0 -3
- package/src/generators/component/lib/add-import.js +0 -34
- package/src/generators/component/lib/add-import.js.map +0 -1
- package/src/generators/component/lib/normalize-options.d.ts +0 -8
- package/src/generators/component/lib/normalize-options.js +0 -58
- package/src/generators/component/lib/normalize-options.js.map +0 -1
- package/src/generators/component/schema.d.ts +0 -14
- package/src/generators/component/schema.json +0 -78
- package/src/generators/component-story/component-story.d.ts +0 -8
- package/src/generators/component-story/component-story.js +0 -113
- package/src/generators/component-story/component-story.js.map +0 -1
- package/src/generators/component-story/component-story.spec.ts +0 -433
- package/src/generators/component-story/files/__componentFileName__.stories.__fileExt__ +0 -24
- package/src/generators/component-story/schema.d.ts +0 -5
- package/src/generators/component-story/schema.json +0 -34
- package/src/generators/init/init.d.ts +0 -6
- package/src/generators/init/init.js +0 -58
- package/src/generators/init/init.js.map +0 -1
- package/src/generators/init/init.spec.ts +0 -81
- package/src/generators/init/lib/add-git-ignore-entry.d.ts +0 -2
- package/src/generators/init/lib/add-git-ignore-entry.js +0 -25
- package/src/generators/init/lib/add-git-ignore-entry.js.map +0 -1
- package/src/generators/init/lib/gitignore-entries.d.ts +0 -1
- package/src/generators/init/lib/gitignore-entries.js +0 -75
- package/src/generators/init/lib/gitignore-entries.js.map +0 -1
- package/src/generators/init/schema.d.ts +0 -7
- package/src/generators/init/schema.json +0 -40
- package/src/generators/library/files/lib/README.md +0 -7
- package/src/generators/library/files/lib/babel.config.json.template +0 -17
- package/src/generators/library/files/lib/package.json__tmpl__ +0 -4
- package/src/generators/library/files/lib/src/index.ts__tmpl__ +0 -0
- package/src/generators/library/files/lib/test-setup.ts.template +0 -1
- package/src/generators/library/files/lib/tsconfig.json__tmpl__ +0 -16
- package/src/generators/library/files/lib/tsconfig.lib.json__tmpl__ +0 -9
- package/src/generators/library/lib/normalize-options.d.ts +0 -13
- package/src/generators/library/lib/normalize-options.js +0 -26
- package/src/generators/library/lib/normalize-options.js.map +0 -1
- package/src/generators/library/library.d.ts +0 -5
- package/src/generators/library/library.js +0 -101
- package/src/generators/library/library.js.map +0 -1
- package/src/generators/library/library.spec.ts +0 -397
- package/src/generators/library/schema.d.ts +0 -22
- package/src/generators/library/schema.json +0 -102
- package/src/generators/stories/schema.d.ts +0 -5
- package/src/generators/stories/schema.json +0 -42
- package/src/generators/stories/stories-app.spec.ts +0 -145
- package/src/generators/stories/stories-lib.spec.ts +0 -113
- package/src/generators/stories/stories.d.ts +0 -6
- package/src/generators/stories/stories.js +0 -63
- package/src/generators/stories/stories.js.map +0 -1
- package/src/generators/storybook-configuration/configuration.d.ts +0 -5
- package/src/generators/storybook-configuration/configuration.js +0 -60
- package/src/generators/storybook-configuration/configuration.js.map +0 -1
- package/src/generators/storybook-configuration/configuration.spec.ts +0 -146
- package/src/generators/storybook-configuration/files/app/storybook.ts.template +0 -9
- package/src/generators/storybook-configuration/files/app/toggle-storybook.tsx.template +0 -114
- package/src/generators/storybook-configuration/files/root/story-loader.js.template +0 -13
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.d.ts +0 -6
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.js +0 -26
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.js.map +0 -1
- package/src/generators/storybook-configuration/lib/add-resolver-main-fields-to-metro-config.spec.ts +0 -161
- package/src/generators/storybook-configuration/lib/create-storybook-files.d.ts +0 -6
- package/src/generators/storybook-configuration/lib/create-storybook-files.js +0 -45
- package/src/generators/storybook-configuration/lib/create-storybook-files.js.map +0 -1
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.d.ts +0 -7
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js +0 -30
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.js.map +0 -1
- package/src/generators/storybook-configuration/lib/replace-app-import-with-storybook-toggle.spec.ts +0 -65
- package/src/generators/storybook-configuration/schema.d.ts +0 -11
- package/src/generators/storybook-configuration/schema.json +0 -66
- package/src/generators/upgrade-native/lib/create-native-files.d.ts +0 -3
- package/src/generators/upgrade-native/lib/create-native-files.js +0 -15
- package/src/generators/upgrade-native/lib/create-native-files.js.map +0 -1
- package/src/generators/upgrade-native/lib/normalize-options.d.ts +0 -12
- package/src/generators/upgrade-native/lib/normalize-options.js +0 -28
- package/src/generators/upgrade-native/lib/normalize-options.js.map +0 -1
- package/src/generators/upgrade-native/schema.d.ts +0 -9
- package/src/generators/upgrade-native/schema.json +0 -41
- package/src/generators/upgrade-native/upgrade-native.d.ts +0 -9
- package/src/generators/upgrade-native/upgrade-native.js +0 -33
- package/src/generators/upgrade-native/upgrade-native.js.map +0 -1
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.d.ts +0 -8
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.js +0 -63
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.js.map +0 -1
- package/src/migrations/update-12-10-0/add-react-native-svg-12-10-0.spec.ts +0 -79
- package/src/migrations/update-12-5-0/update-jest-for-react-native.d.ts +0 -2
- package/src/migrations/update-12-5-0/update-jest-for-react-native.js +0 -62
- package/src/migrations/update-12-5-0/update-jest-for-react-native.js.map +0 -1
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.d.ts +0 -2
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js +0 -22
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.js.map +0 -1
- package/src/migrations/update-13-5-0/add-babel-config-root-13-5-0.spec.ts +0 -48
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.d.ts +0 -6
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.js +0 -41
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.js.map +0 -1
- package/src/migrations/update-13-5-0/update-react-native-typing-svg-13-5-0.spec.ts +0 -61
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.d.ts +0 -6
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js +0 -33
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.js.map +0 -1
- package/src/migrations/update-14-0-0/add-project-root-metro-config-14-0-0.spec.ts +0 -192
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.d.ts +0 -5
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.js +0 -39
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.js.map +0 -1
- package/src/migrations/update-14-0-0/update-entry-file-bundle-14-0-0.spec.ts +0 -84
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.d.ts +0 -5
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.js +0 -42
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.js.map +0 -1
- package/src/migrations/update-14-0-2/change-main-to-class-name-14-0-2.spec.ts +0 -48
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.d.ts +0 -6
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.js +0 -33
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.js.map +0 -1
- package/src/migrations/update-14-2-1/rename-blockList-metro-config.spec.ts +0 -190
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.d.ts +0 -5
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.js +0 -26
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.js.map +0 -1
- package/src/migrations/update-14-5-5/add-exclude-sync-deps.spec.ts +0 -39
- package/src/migrations/update-14-5-8/change-searchDir-storybook.d.ts +0 -5
- package/src/migrations/update-14-5-8/change-searchDir-storybook.js +0 -26
- package/src/migrations/update-14-5-8/change-searchDir-storybook.js.map +0 -1
- package/src/migrations/update-14-5-8/change-searchDir-storybook.spec.ts +0 -39
- package/src/migrations/update-14-6-0/remove-jest-transform.d.ts +0 -5
- package/src/migrations/update-14-6-0/remove-jest-transform.js +0 -58
- package/src/migrations/update-14-6-0/remove-jest-transform.js.map +0 -1
- package/src/migrations/update-14-6-0/remove-jest-transform.spec.ts +0 -109
- package/src/migrations/update-15-0-0/add-babel-inputs.d.ts +0 -2
- package/src/migrations/update-15-0-0/add-babel-inputs.js +0 -13
- package/src/migrations/update-15-0-0/add-babel-inputs.js.map +0 -1
- package/src/migrations/update-15-0-0/add-babel-inputs.spec.ts +0 -73
- package/src/migrations/update-15-9-1/add-build-ios-target.d.ts +0 -5
- package/src/migrations/update-15-9-1/add-build-ios-target.js +0 -34
- package/src/migrations/update-15-9-1/add-build-ios-target.js.map +0 -1
- package/src/migrations/update-15-9-1/add-build-ios-target.spec.ts +0 -36
- package/src/utils/add-jest.d.ts +0 -2
- package/src/utils/add-jest.js +0 -38
- package/src/utils/add-jest.js.map +0 -1
- package/src/utils/add-linting.d.ts +0 -12
- package/src/utils/add-linting.js +0 -41
- package/src/utils/add-linting.js.map +0 -1
- package/src/utils/add-linting.spec.ts +0 -42
- package/src/utils/chmod-android-gradle-files.d.ts +0 -3
- package/src/utils/chmod-android-gradle-files.js +0 -24
- package/src/utils/chmod-android-gradle-files.js.map +0 -1
- package/src/utils/ensure-node-modules-symlink.d.ts +0 -9
- package/src/utils/ensure-node-modules-symlink.js +0 -29
- package/src/utils/ensure-node-modules-symlink.js.map +0 -1
- package/src/utils/ensure-node-modules-symlink.spec.ts +0 -108
- package/src/utils/find-all-npm-dependencies.d.ts +0 -2
- package/src/utils/find-all-npm-dependencies.js +0 -26
- package/src/utils/find-all-npm-dependencies.js.map +0 -1
- package/src/utils/find-all-npm-dependencies.spec.ts +0 -95
- package/src/utils/format-file.d.ts +0 -1
- package/src/utils/format-file.js +0 -17
- package/src/utils/format-file.js.map +0 -1
- package/src/utils/get-cli-options.d.ts +0 -8
- package/src/utils/get-cli-options.js +0 -31
- package/src/utils/get-cli-options.js.map +0 -1
- package/src/utils/pod-install-task.d.ts +0 -8
- package/src/utils/pod-install-task.js +0 -62
- package/src/utils/pod-install-task.js.map +0 -1
- package/src/utils/symlink-task.d.ts +0 -2
- package/src/utils/symlink-task.js +0 -19
- package/src/utils/symlink-task.js.map +0 -1
- package/src/utils/testing-generators.d.ts +0 -3
- package/src/utils/testing-generators.js +0 -36
- package/src/utils/testing-generators.js.map +0 -1
- package/src/utils/versions.d.ts +0 -20
- package/src/utils/versions.js +0 -24
- package/src/utils/versions.js.map +0 -1
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { join } from 'path';
|
|
2
|
-
import { ExecutorContext, logger } from '@nrwl/devkit';
|
|
3
|
-
import { fileExists } from '@nrwl/workspace/src/utilities/fileutils';
|
|
4
|
-
import * as chalk from 'chalk';
|
|
5
|
-
|
|
6
|
-
import { ReactNativeStorybookOptions } from './schema';
|
|
7
|
-
import { ChildProcess, fork } from 'child_process';
|
|
8
|
-
import {
|
|
9
|
-
displayNewlyAddedDepsMessage,
|
|
10
|
-
syncDeps,
|
|
11
|
-
} from '../sync-deps/sync-deps.impl';
|
|
12
|
-
|
|
13
|
-
let childProcess: ChildProcess;
|
|
14
|
-
|
|
15
|
-
export default async function* reactNatievStorybookExecutor(
|
|
16
|
-
options: ReactNativeStorybookOptions,
|
|
17
|
-
context: ExecutorContext
|
|
18
|
-
): AsyncGenerator<{ success: boolean }> {
|
|
19
|
-
const projectRoot =
|
|
20
|
-
context.projectsConfigurations.projects[context.projectName].root;
|
|
21
|
-
logger.info(
|
|
22
|
-
`${chalk.bold.cyan(
|
|
23
|
-
'info'
|
|
24
|
-
)} To see your Storybook stories on the device, you should start your mobile app for the <platform> of your choice (typically ios or android).`
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
// add storybook addons to app's package.json
|
|
28
|
-
const packageJsonPath = join(context.root, projectRoot, 'package.json');
|
|
29
|
-
if (fileExists(packageJsonPath))
|
|
30
|
-
displayNewlyAddedDepsMessage(
|
|
31
|
-
context.projectName,
|
|
32
|
-
await syncDeps(
|
|
33
|
-
context.projectName,
|
|
34
|
-
projectRoot,
|
|
35
|
-
context.root,
|
|
36
|
-
context.projectGraph,
|
|
37
|
-
[
|
|
38
|
-
'@storybook/addon-ondevice-actions',
|
|
39
|
-
'@storybook/addon-ondevice-backgrounds',
|
|
40
|
-
'@storybook/addon-ondevice-controls',
|
|
41
|
-
'@storybook/addon-ondevice-notes',
|
|
42
|
-
]
|
|
43
|
-
)
|
|
44
|
-
);
|
|
45
|
-
|
|
46
|
-
try {
|
|
47
|
-
await runCliStorybook(context.root, options);
|
|
48
|
-
yield { success: true };
|
|
49
|
-
} finally {
|
|
50
|
-
if (childProcess) {
|
|
51
|
-
childProcess.kill();
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function runCliStorybook(
|
|
57
|
-
workspaceRoot: string,
|
|
58
|
-
options: ReactNativeStorybookOptions
|
|
59
|
-
) {
|
|
60
|
-
return new Promise((resolve, reject) => {
|
|
61
|
-
childProcess = fork(
|
|
62
|
-
join(
|
|
63
|
-
workspaceRoot,
|
|
64
|
-
'./node_modules/react-native-storybook-loader/out/rnstl-cli.js'
|
|
65
|
-
),
|
|
66
|
-
createStorybookOptions(options),
|
|
67
|
-
{
|
|
68
|
-
cwd: workspaceRoot,
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
// Ensure the child process is killed when the parent exits
|
|
73
|
-
process.on('exit', () => childProcess.kill());
|
|
74
|
-
process.on('SIGTERM', () => childProcess.kill());
|
|
75
|
-
|
|
76
|
-
childProcess.on('error', (err) => {
|
|
77
|
-
reject(err);
|
|
78
|
-
});
|
|
79
|
-
childProcess.on('exit', (code) => {
|
|
80
|
-
if (code === 0) {
|
|
81
|
-
resolve(code);
|
|
82
|
-
} else {
|
|
83
|
-
reject(code);
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
function createStorybookOptions(options) {
|
|
90
|
-
return Object.keys(options).reduce((acc, k) => {
|
|
91
|
-
const v = options[k];
|
|
92
|
-
if (typeof v === 'boolean') {
|
|
93
|
-
if (v === true) {
|
|
94
|
-
acc.push(`--${k}`);
|
|
95
|
-
}
|
|
96
|
-
} else if (Array.isArray(v)) {
|
|
97
|
-
v.forEach((value) => {
|
|
98
|
-
acc.push(`--${k}`, value);
|
|
99
|
-
});
|
|
100
|
-
} else {
|
|
101
|
-
acc.push(`--${k}`, v);
|
|
102
|
-
}
|
|
103
|
-
return acc;
|
|
104
|
-
}, []);
|
|
105
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
4
|
-
const sync_deps_impl_1 = require("./sync-deps.impl");
|
|
5
|
-
exports.default = (0, devkit_1.convertNxExecutor)(sync_deps_impl_1.default);
|
|
6
|
-
//# sourceMappingURL=compat.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compat.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/sync-deps/compat.ts"],"names":[],"mappings":";;AAAA,yCAAiD;AAEjD,qDAAgD;AAEhD,kBAAe,IAAA,0BAAiB,EAAC,wBAAgB,CAAC,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"outputCapture": "direct-nodejs",
|
|
4
|
-
"cli": "nx",
|
|
5
|
-
"$id": "NxReactNativeSyncDeps",
|
|
6
|
-
"$schema": "http://json-schema.org/schema",
|
|
7
|
-
"title": "Sync Deps for React Native",
|
|
8
|
-
"description": "Updates `package.json` with project dependencies.",
|
|
9
|
-
"type": "object",
|
|
10
|
-
"properties": {
|
|
11
|
-
"include": {
|
|
12
|
-
"type": "array",
|
|
13
|
-
"items": {
|
|
14
|
-
"type": "string"
|
|
15
|
-
},
|
|
16
|
-
"default": [],
|
|
17
|
-
"description": "An array of additional npm packages to include."
|
|
18
|
-
},
|
|
19
|
-
"exclude": {
|
|
20
|
-
"type": "array",
|
|
21
|
-
"items": {
|
|
22
|
-
"type": "string"
|
|
23
|
-
},
|
|
24
|
-
"default": [],
|
|
25
|
-
"description": "An array of npm packages to exclude."
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ExecutorContext, ProjectGraph } from '@nrwl/devkit';
|
|
2
|
-
import { ReactNativeSyncDepsOptions } from './schema';
|
|
3
|
-
export interface ReactNativeSyncDepsOutput {
|
|
4
|
-
success: boolean;
|
|
5
|
-
}
|
|
6
|
-
export default function syncDepsExecutor(options: ReactNativeSyncDepsOptions, context: ExecutorContext): AsyncGenerator<ReactNativeSyncDepsOutput>;
|
|
7
|
-
export declare function syncDeps(projectName: string, projectRoot: string, workspaceRoot: string, projectGraph: ProjectGraph, include?: string[], exclude?: string[]): Promise<string[]>;
|
|
8
|
-
export declare function displayNewlyAddedDepsMessage(projectName: string, deps: string[]): void;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.displayNewlyAddedDepsMessage = exports.syncDeps = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const chalk = require("chalk");
|
|
7
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
8
|
-
const find_all_npm_dependencies_1 = require("../../utils/find-all-npm-dependencies");
|
|
9
|
-
function syncDepsExecutor(options, context) {
|
|
10
|
-
return tslib_1.__asyncGenerator(this, arguments, function* syncDepsExecutor_1() {
|
|
11
|
-
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
12
|
-
displayNewlyAddedDepsMessage(context.projectName, yield tslib_1.__await(syncDeps(context.projectName, projectRoot, context.root, context.projectGraph, typeof options.include === 'string'
|
|
13
|
-
? options.include.split(',')
|
|
14
|
-
: options.include, typeof options.exclude === 'string'
|
|
15
|
-
? options.exclude.split(',')
|
|
16
|
-
: options.exclude)));
|
|
17
|
-
yield yield tslib_1.__await({ success: true });
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
exports.default = syncDepsExecutor;
|
|
21
|
-
function syncDeps(projectName, projectRoot, workspaceRoot, projectGraph, include = [], exclude = []) {
|
|
22
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
let npmDeps = (0, find_all_npm_dependencies_1.findAllNpmDependencies)(projectGraph, projectName);
|
|
24
|
-
const packageJsonPath = (0, path_1.join)(workspaceRoot, projectRoot, 'package.json');
|
|
25
|
-
const packageJson = (0, devkit_1.readJsonFile)(packageJsonPath);
|
|
26
|
-
const newDeps = [];
|
|
27
|
-
let updated = false;
|
|
28
|
-
if (!packageJson.dependencies) {
|
|
29
|
-
packageJson.dependencies = {};
|
|
30
|
-
updated = true;
|
|
31
|
-
}
|
|
32
|
-
if (include && include.length) {
|
|
33
|
-
npmDeps.push(...include);
|
|
34
|
-
}
|
|
35
|
-
if (exclude && exclude.length) {
|
|
36
|
-
npmDeps = npmDeps.filter((dep) => !exclude.includes(dep));
|
|
37
|
-
}
|
|
38
|
-
npmDeps.forEach((dep) => {
|
|
39
|
-
if (!packageJson.dependencies[dep]) {
|
|
40
|
-
packageJson.dependencies[dep] = '*';
|
|
41
|
-
newDeps.push(dep);
|
|
42
|
-
updated = true;
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
if (updated) {
|
|
46
|
-
(0, devkit_1.writeJsonFile)(packageJsonPath, packageJson);
|
|
47
|
-
}
|
|
48
|
-
return newDeps;
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
exports.syncDeps = syncDeps;
|
|
52
|
-
function displayNewlyAddedDepsMessage(projectName, deps) {
|
|
53
|
-
if (deps.length > 0) {
|
|
54
|
-
devkit_1.logger.info(`${chalk.bold.cyan('info')} Added entries to 'package.json' for '${projectName}' (for autolink):
|
|
55
|
-
${deps.map((d) => chalk.bold.cyan(`"${d}": "*"`)).join('\n ')}`);
|
|
56
|
-
}
|
|
57
|
-
else {
|
|
58
|
-
devkit_1.logger.info(`${chalk.bold.cyan('info')} Dependencies for '${projectName}' are up to date! No changes made.`);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
exports.displayNewlyAddedDepsMessage = displayNewlyAddedDepsMessage;
|
|
62
|
-
//# sourceMappingURL=sync-deps.impl.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync-deps.impl.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/executors/sync-deps/sync-deps.impl.ts"],"names":[],"mappings":";;;;AAAA,+BAA4B;AAC5B,+BAA+B;AAC/B,yCAMsB;AAEtB,qFAA+E;AAQ/E,SAA+B,gBAAgB,CAC7C,OAAmC,EACnC,OAAwB;;QAExB,MAAM,WAAW,GACf,OAAO,CAAC,sBAAsB,CAAC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';
|
|
3
|
-
import {
|
|
4
|
-
ExecutorContext,
|
|
5
|
-
logger,
|
|
6
|
-
ProjectGraph,
|
|
7
|
-
readJsonFile,
|
|
8
|
-
writeJsonFile,
|
|
9
|
-
} from '@nrwl/devkit';
|
|
10
|
-
|
|
11
|
-
import { findAllNpmDependencies } from '../../utils/find-all-npm-dependencies';
|
|
12
|
-
|
|
13
|
-
import { ReactNativeSyncDepsOptions } from './schema';
|
|
14
|
-
|
|
15
|
-
export interface ReactNativeSyncDepsOutput {
|
|
16
|
-
success: boolean;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default async function* syncDepsExecutor(
|
|
20
|
-
options: ReactNativeSyncDepsOptions,
|
|
21
|
-
context: ExecutorContext
|
|
22
|
-
): AsyncGenerator<ReactNativeSyncDepsOutput> {
|
|
23
|
-
const projectRoot =
|
|
24
|
-
context.projectsConfigurations.projects[context.projectName].root;
|
|
25
|
-
displayNewlyAddedDepsMessage(
|
|
26
|
-
context.projectName,
|
|
27
|
-
await syncDeps(
|
|
28
|
-
context.projectName,
|
|
29
|
-
projectRoot,
|
|
30
|
-
context.root,
|
|
31
|
-
context.projectGraph,
|
|
32
|
-
typeof options.include === 'string'
|
|
33
|
-
? options.include.split(',')
|
|
34
|
-
: options.include,
|
|
35
|
-
typeof options.exclude === 'string'
|
|
36
|
-
? options.exclude.split(',')
|
|
37
|
-
: options.exclude
|
|
38
|
-
)
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
yield { success: true };
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export async function syncDeps(
|
|
45
|
-
projectName: string,
|
|
46
|
-
projectRoot: string,
|
|
47
|
-
workspaceRoot: string,
|
|
48
|
-
projectGraph: ProjectGraph,
|
|
49
|
-
include: string[] = [],
|
|
50
|
-
exclude: string[] = []
|
|
51
|
-
): Promise<string[]> {
|
|
52
|
-
let npmDeps = findAllNpmDependencies(projectGraph, projectName);
|
|
53
|
-
const packageJsonPath = join(workspaceRoot, projectRoot, 'package.json');
|
|
54
|
-
const packageJson = readJsonFile(packageJsonPath);
|
|
55
|
-
const newDeps = [];
|
|
56
|
-
let updated = false;
|
|
57
|
-
|
|
58
|
-
if (!packageJson.dependencies) {
|
|
59
|
-
packageJson.dependencies = {};
|
|
60
|
-
updated = true;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
if (include && include.length) {
|
|
64
|
-
npmDeps.push(...include);
|
|
65
|
-
}
|
|
66
|
-
if (exclude && exclude.length) {
|
|
67
|
-
npmDeps = npmDeps.filter((dep) => !exclude.includes(dep));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
npmDeps.forEach((dep) => {
|
|
71
|
-
if (!packageJson.dependencies[dep]) {
|
|
72
|
-
packageJson.dependencies[dep] = '*';
|
|
73
|
-
newDeps.push(dep);
|
|
74
|
-
updated = true;
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
if (updated) {
|
|
79
|
-
writeJsonFile(packageJsonPath, packageJson);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return newDeps;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export function displayNewlyAddedDepsMessage(
|
|
86
|
-
projectName: string,
|
|
87
|
-
deps: string[]
|
|
88
|
-
) {
|
|
89
|
-
if (deps.length > 0) {
|
|
90
|
-
logger.info(`${chalk.bold.cyan(
|
|
91
|
-
'info'
|
|
92
|
-
)} Added entries to 'package.json' for '${projectName}' (for autolink):
|
|
93
|
-
${deps.map((d) => chalk.bold.cyan(`"${d}": "*"`)).join('\n ')}`);
|
|
94
|
-
} else {
|
|
95
|
-
logger.info(
|
|
96
|
-
`${chalk.bold.cyan(
|
|
97
|
-
'info'
|
|
98
|
-
)} Dependencies for '${projectName}' are up to date! No changes made.`
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { GeneratorCallback, Tree } from '@nrwl/devkit';
|
|
2
|
-
import { Schema } from './schema';
|
|
3
|
-
export declare function reactNativeApplicationGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
|
-
export default reactNativeApplicationGenerator;
|
|
5
|
-
export declare const reactNativeApplicationSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reactNativeApplicationSchematic = exports.reactNativeApplicationGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
-
const pod_install_task_1 = require("../../utils/pod-install-task");
|
|
8
|
-
const symlink_task_1 = require("../../utils/symlink-task");
|
|
9
|
-
const add_linting_1 = require("../../utils/add-linting");
|
|
10
|
-
const add_jest_1 = require("../../utils/add-jest");
|
|
11
|
-
const chmod_android_gradle_files_1 = require("../../utils/chmod-android-gradle-files");
|
|
12
|
-
const normalize_options_1 = require("./lib/normalize-options");
|
|
13
|
-
const init_1 = require("../init/init");
|
|
14
|
-
const add_project_1 = require("./lib/add-project");
|
|
15
|
-
const create_application_files_1 = require("./lib/create-application-files");
|
|
16
|
-
const add_detox_1 = require("./lib/add-detox");
|
|
17
|
-
function reactNativeApplicationGenerator(host, schema) {
|
|
18
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
19
|
-
const options = (0, normalize_options_1.normalizeOptions)(host, schema);
|
|
20
|
-
(0, create_application_files_1.createApplicationFiles)(host, options);
|
|
21
|
-
(0, add_project_1.addProject)(host, options);
|
|
22
|
-
const initTask = yield (0, init_1.default)(host, Object.assign(Object.assign({}, options), { skipFormat: true }));
|
|
23
|
-
const lintTask = yield (0, add_linting_1.addLinting)(host, Object.assign(Object.assign({}, options), { projectRoot: options.appProjectRoot, tsConfigPaths: [
|
|
24
|
-
(0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
|
|
25
|
-
] }));
|
|
26
|
-
const jestTask = yield (0, add_jest_1.addJest)(host, options.unitTestRunner, options.projectName, options.appProjectRoot, options.js, options.skipPackageJson);
|
|
27
|
-
const detoxTask = yield (0, add_detox_1.addDetox)(host, options);
|
|
28
|
-
const symlinkTask = (0, symlink_task_1.runSymlink)(host.root, options.appProjectRoot);
|
|
29
|
-
const podInstallTask = (0, pod_install_task_1.runPodInstall)((0, path_1.join)(host.root, options.iosProjectRoot), options.install);
|
|
30
|
-
const chmodTaskGradlew = (0, chmod_android_gradle_files_1.chmodAndroidGradlewFilesTask)((0, path_1.join)(host.root, options.androidProjectRoot));
|
|
31
|
-
if (!options.skipFormat) {
|
|
32
|
-
yield (0, devkit_1.formatFiles)(host);
|
|
33
|
-
}
|
|
34
|
-
return (0, devkit_1.runTasksInSerial)(initTask, lintTask, jestTask, detoxTask, symlinkTask, podInstallTask, chmodTaskGradlew);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
exports.reactNativeApplicationGenerator = reactNativeApplicationGenerator;
|
|
38
|
-
exports.default = reactNativeApplicationGenerator;
|
|
39
|
-
exports.reactNativeApplicationSchematic = (0, devkit_1.convertNxGenerator)(reactNativeApplicationGenerator);
|
|
40
|
-
//# sourceMappingURL=application.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"application.js","sourceRoot":"","sources":["../../../../../../packages/react-native/src/generators/application/application.ts"],"names":[],"mappings":";;;;AAAA,+BAA4B;AAE5B,yCAOsB;AAEtB,mEAA6D;AAC7D,2DAAsD;AACtD,yDAAqD;AACrD,mDAA+C;AAC/C,uFAAsF;AAEtF,+DAA2D;AAC3D,uCAAyC;AACzC,mDAA+C;AAC/C,6EAAwE;AACxE,+CAA2C;AAG3C,SAAsB,+BAA+B,CACnD,IAAU,EACV,MAAc;;QAEd,MAAM,OAAO,GAAG,IAAA,oCAAgB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC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AAS,EACT,WAAW,EACX,cAAc,EACd,gBAAgB,CACjB,CAAC;IACJ,CAAC;CAAA;AAjDD,0EAiDC;AAED,kBAAe,+BAA+B,CAAC;AAClC,QAAA,+BAA+B,GAAG,IAAA,2BAAkB,EAC/D,+BAA+B,CAChC,CAAC"}
|
|
@@ -1,214 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Tree,
|
|
3
|
-
getProjects,
|
|
4
|
-
readJson,
|
|
5
|
-
readProjectConfiguration,
|
|
6
|
-
} from '@nrwl/devkit';
|
|
7
|
-
import { createTreeWithEmptyWorkspace } from '@nrwl/devkit/testing';
|
|
8
|
-
import { Linter } from '@nrwl/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
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.7.6
|