@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,397 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readJson,
|
|
3
|
+
readProjectConfiguration,
|
|
4
|
+
Tree,
|
|
5
|
+
updateJson,
|
|
6
|
+
} from '@nx/devkit';
|
|
7
|
+
import { createTreeWithEmptyWorkspace } from '@nx/devkit/testing';
|
|
8
|
+
import libraryGenerator from './library';
|
|
9
|
+
import { Linter } from '@nx/linter';
|
|
10
|
+
import { Schema } from './schema';
|
|
11
|
+
|
|
12
|
+
describe('lib', () => {
|
|
13
|
+
let appTree: Tree;
|
|
14
|
+
|
|
15
|
+
const defaultSchema: Schema = {
|
|
16
|
+
name: 'myLib',
|
|
17
|
+
linter: Linter.EsLint,
|
|
18
|
+
skipFormat: false,
|
|
19
|
+
skipTsConfig: false,
|
|
20
|
+
unitTestRunner: 'jest',
|
|
21
|
+
strict: true,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
beforeEach(() => {
|
|
25
|
+
appTree = createTreeWithEmptyWorkspace({ layout: 'apps-libs' });
|
|
26
|
+
appTree.write('.gitignore', '');
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe('not nested', () => {
|
|
30
|
+
it('should update project.json', async () => {
|
|
31
|
+
await libraryGenerator(appTree, { ...defaultSchema, tags: 'one,two' });
|
|
32
|
+
const projectConfiguration = readProjectConfiguration(appTree, 'my-lib');
|
|
33
|
+
expect(projectConfiguration.root).toEqual('libs/my-lib');
|
|
34
|
+
expect(projectConfiguration.targets.build).toBeUndefined();
|
|
35
|
+
expect(projectConfiguration.targets.lint).toEqual({
|
|
36
|
+
executor: '@nrwl/linter:eslint',
|
|
37
|
+
outputs: ['{options.outputFile}'],
|
|
38
|
+
options: {
|
|
39
|
+
lintFilePatterns: ['libs/my-lib/**/*.{ts,tsx,js,jsx}'],
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
expect(projectConfiguration.tags).toEqual(['one', 'two']);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should update root tsconfig.base.json', async () => {
|
|
46
|
+
await libraryGenerator(appTree, defaultSchema);
|
|
47
|
+
const tsconfigJson = readJson(appTree, '/tsconfig.base.json');
|
|
48
|
+
expect(tsconfigJson.compilerOptions.paths['@proj/my-lib']).toEqual([
|
|
49
|
+
'libs/my-lib/src/index.ts',
|
|
50
|
+
]);
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('should update root tsconfig.json when no tsconfig.base.json', async () => {
|
|
54
|
+
appTree.rename('tsconfig.base.json', 'tsconfig.json');
|
|
55
|
+
|
|
56
|
+
await libraryGenerator(appTree, defaultSchema);
|
|
57
|
+
|
|
58
|
+
const tsconfigJson = readJson(appTree, '/tsconfig.json');
|
|
59
|
+
expect(tsconfigJson.compilerOptions.paths['@proj/my-lib']).toEqual([
|
|
60
|
+
'libs/my-lib/src/index.ts',
|
|
61
|
+
]);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it('should update root tsconfig.base.json (no existing path mappings)', async () => {
|
|
65
|
+
updateJson(appTree, 'tsconfig.base.json', (json) => {
|
|
66
|
+
json.compilerOptions.paths = undefined;
|
|
67
|
+
return json;
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
await libraryGenerator(appTree, defaultSchema);
|
|
71
|
+
const tsconfigJson = readJson(appTree, '/tsconfig.base.json');
|
|
72
|
+
expect(tsconfigJson.compilerOptions.paths['@proj/my-lib']).toEqual([
|
|
73
|
+
'libs/my-lib/src/index.ts',
|
|
74
|
+
]);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('should create a local tsconfig.json', async () => {
|
|
78
|
+
await libraryGenerator(appTree, defaultSchema);
|
|
79
|
+
|
|
80
|
+
const tsconfigJson = readJson(appTree, 'libs/my-lib/tsconfig.json');
|
|
81
|
+
expect(tsconfigJson.extends).toBe('../../tsconfig.base.json');
|
|
82
|
+
expect(tsconfigJson.references).toEqual([
|
|
83
|
+
{
|
|
84
|
+
path: './tsconfig.lib.json',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
path: './tsconfig.spec.json',
|
|
88
|
+
},
|
|
89
|
+
]);
|
|
90
|
+
expect(
|
|
91
|
+
tsconfigJson.compilerOptions.forceConsistentCasingInFileNames
|
|
92
|
+
).toEqual(true);
|
|
93
|
+
expect(tsconfigJson.compilerOptions.strict).toEqual(true);
|
|
94
|
+
expect(tsconfigJson.compilerOptions.noImplicitReturns).toEqual(true);
|
|
95
|
+
expect(tsconfigJson.compilerOptions.noFallthroughCasesInSwitch).toEqual(
|
|
96
|
+
true
|
|
97
|
+
);
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
it('should extend from root tsconfig.json when no tsconfig.base.json', async () => {
|
|
101
|
+
appTree.rename('tsconfig.base.json', 'tsconfig.json');
|
|
102
|
+
|
|
103
|
+
await libraryGenerator(appTree, defaultSchema);
|
|
104
|
+
|
|
105
|
+
const tsconfigJson = readJson(appTree, 'libs/my-lib/tsconfig.json');
|
|
106
|
+
expect(tsconfigJson.extends).toBe('../../tsconfig.json');
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
it('should extend the local tsconfig.json with tsconfig.spec.json', async () => {
|
|
110
|
+
await libraryGenerator(appTree, defaultSchema);
|
|
111
|
+
const tsconfigJson = readJson(appTree, 'libs/my-lib/tsconfig.spec.json');
|
|
112
|
+
expect(tsconfigJson.extends).toEqual('./tsconfig.json');
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it('should extend the local tsconfig.json with tsconfig.lib.json', async () => {
|
|
116
|
+
await libraryGenerator(appTree, defaultSchema);
|
|
117
|
+
const tsconfigJson = readJson(appTree, 'libs/my-lib/tsconfig.lib.json');
|
|
118
|
+
expect(tsconfigJson.extends).toEqual('./tsconfig.json');
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
describe('nested', () => {
|
|
123
|
+
it('should update nx.json', async () => {
|
|
124
|
+
await libraryGenerator(appTree, {
|
|
125
|
+
...defaultSchema,
|
|
126
|
+
directory: 'myDir',
|
|
127
|
+
tags: 'one',
|
|
128
|
+
});
|
|
129
|
+
const projectConfiguration = readProjectConfiguration(
|
|
130
|
+
appTree,
|
|
131
|
+
'my-dir-my-lib'
|
|
132
|
+
);
|
|
133
|
+
expect(projectConfiguration).toMatchObject({
|
|
134
|
+
tags: ['one'],
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
await libraryGenerator(appTree, {
|
|
138
|
+
...defaultSchema,
|
|
139
|
+
name: 'myLib2',
|
|
140
|
+
directory: 'myDir',
|
|
141
|
+
tags: 'one,two',
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const lib2ProjectConfiguration = readProjectConfiguration(
|
|
145
|
+
appTree,
|
|
146
|
+
'my-dir-my-lib2'
|
|
147
|
+
);
|
|
148
|
+
expect(lib2ProjectConfiguration).toMatchObject({
|
|
149
|
+
tags: ['one', 'two'],
|
|
150
|
+
});
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('should update project.json', async () => {
|
|
154
|
+
await libraryGenerator(appTree, { ...defaultSchema, directory: 'myDir' });
|
|
155
|
+
const projectConfiguration = readProjectConfiguration(
|
|
156
|
+
appTree,
|
|
157
|
+
'my-dir-my-lib'
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
expect(projectConfiguration.root).toEqual('libs/my-dir/my-lib');
|
|
161
|
+
expect(projectConfiguration.targets.lint).toEqual({
|
|
162
|
+
executor: '@nrwl/linter:eslint',
|
|
163
|
+
outputs: ['{options.outputFile}'],
|
|
164
|
+
options: {
|
|
165
|
+
lintFilePatterns: ['libs/my-dir/my-lib/**/*.{ts,tsx,js,jsx}'],
|
|
166
|
+
},
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
it('should update root tsconfig.base.json', async () => {
|
|
171
|
+
await libraryGenerator(appTree, { ...defaultSchema, directory: 'myDir' });
|
|
172
|
+
const tsconfigJson = readJson(appTree, '/tsconfig.base.json');
|
|
173
|
+
expect(tsconfigJson.compilerOptions.paths['@proj/my-dir/my-lib']).toEqual(
|
|
174
|
+
['libs/my-dir/my-lib/src/index.ts']
|
|
175
|
+
);
|
|
176
|
+
expect(
|
|
177
|
+
tsconfigJson.compilerOptions.paths['my-dir-my-lib/*']
|
|
178
|
+
).toBeUndefined();
|
|
179
|
+
});
|
|
180
|
+
|
|
181
|
+
it('should update root tsconfig.json when no tsconfig.base.json', async () => {
|
|
182
|
+
appTree.rename('tsconfig.base.json', 'tsconfig.json');
|
|
183
|
+
|
|
184
|
+
await libraryGenerator(appTree, { ...defaultSchema, directory: 'myDir' });
|
|
185
|
+
|
|
186
|
+
const tsconfigJson = readJson(appTree, '/tsconfig.json');
|
|
187
|
+
expect(tsconfigJson.compilerOptions.paths['@proj/my-dir/my-lib']).toEqual(
|
|
188
|
+
['libs/my-dir/my-lib/src/index.ts']
|
|
189
|
+
);
|
|
190
|
+
expect(
|
|
191
|
+
tsconfigJson.compilerOptions.paths['my-dir-my-lib/*']
|
|
192
|
+
).toBeUndefined();
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
it('should create a local tsconfig.json', async () => {
|
|
196
|
+
await libraryGenerator(appTree, { ...defaultSchema, directory: 'myDir' });
|
|
197
|
+
|
|
198
|
+
const tsconfigJson = readJson(
|
|
199
|
+
appTree,
|
|
200
|
+
'libs/my-dir/my-lib/tsconfig.json'
|
|
201
|
+
);
|
|
202
|
+
expect(tsconfigJson.extends).toBe('../../../tsconfig.base.json');
|
|
203
|
+
expect(tsconfigJson.references).toEqual([
|
|
204
|
+
{
|
|
205
|
+
path: './tsconfig.lib.json',
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
path: './tsconfig.spec.json',
|
|
209
|
+
},
|
|
210
|
+
]);
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
it('should extend from root tsconfig.json when no tsconfig.base.json', async () => {
|
|
214
|
+
appTree.rename('tsconfig.base.json', 'tsconfig.json');
|
|
215
|
+
|
|
216
|
+
await libraryGenerator(appTree, { ...defaultSchema, directory: 'myDir' });
|
|
217
|
+
|
|
218
|
+
const tsconfigJson = readJson(
|
|
219
|
+
appTree,
|
|
220
|
+
'libs/my-dir/my-lib/tsconfig.json'
|
|
221
|
+
);
|
|
222
|
+
expect(tsconfigJson.extends).toBe('../../../tsconfig.json');
|
|
223
|
+
});
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
describe('--unit-test-runner none', () => {
|
|
227
|
+
it('should not generate test configuration', async () => {
|
|
228
|
+
await libraryGenerator(appTree, {
|
|
229
|
+
...defaultSchema,
|
|
230
|
+
unitTestRunner: 'none',
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
expect(appTree.exists('libs/my-lib/tsconfig.spec.json')).toBeFalsy();
|
|
234
|
+
expect(appTree.exists('libs/my-lib/jest.config.ts')).toBeFalsy();
|
|
235
|
+
const projectConfiguration = readProjectConfiguration(appTree, 'my-lib');
|
|
236
|
+
expect(projectConfiguration.targets.test).toBeUndefined();
|
|
237
|
+
expect(projectConfiguration.targets.lint).toMatchObject({
|
|
238
|
+
executor: '@nrwl/linter:eslint',
|
|
239
|
+
options: {
|
|
240
|
+
lintFilePatterns: ['libs/my-lib/**/*.{ts,tsx,js,jsx}'],
|
|
241
|
+
},
|
|
242
|
+
outputs: ['{options.outputFile}'],
|
|
243
|
+
});
|
|
244
|
+
});
|
|
245
|
+
});
|
|
246
|
+
|
|
247
|
+
describe('--buildable', () => {
|
|
248
|
+
it('should have a builder defined', async () => {
|
|
249
|
+
await libraryGenerator(appTree, {
|
|
250
|
+
...defaultSchema,
|
|
251
|
+
buildable: true,
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
const projectConfiguration = readProjectConfiguration(appTree, 'my-lib');
|
|
255
|
+
|
|
256
|
+
expect(projectConfiguration.targets.build).toBeDefined();
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
describe('--publishable', () => {
|
|
261
|
+
it('should add build architect', async () => {
|
|
262
|
+
await libraryGenerator(appTree, {
|
|
263
|
+
...defaultSchema,
|
|
264
|
+
publishable: true,
|
|
265
|
+
importPath: '@proj/my-lib',
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
const projectConfiguration = readProjectConfiguration(appTree, 'my-lib');
|
|
269
|
+
|
|
270
|
+
expect(projectConfiguration.targets.build).toMatchObject({
|
|
271
|
+
executor: '@nrwl/web:rollup',
|
|
272
|
+
outputs: ['{options.outputPath}'],
|
|
273
|
+
options: {
|
|
274
|
+
external: ['react/jsx-runtime', 'react-native'],
|
|
275
|
+
entryFile: 'libs/my-lib/src/index.ts',
|
|
276
|
+
outputPath: 'dist/libs/my-lib',
|
|
277
|
+
project: 'libs/my-lib/package.json',
|
|
278
|
+
tsConfig: 'libs/my-lib/tsconfig.lib.json',
|
|
279
|
+
rollupConfig: '@nrwl/react/plugins/bundle-rollup',
|
|
280
|
+
},
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
|
|
284
|
+
it('should fail if no importPath is provided with publishable', async () => {
|
|
285
|
+
expect.assertions(1);
|
|
286
|
+
|
|
287
|
+
try {
|
|
288
|
+
await libraryGenerator(appTree, {
|
|
289
|
+
...defaultSchema,
|
|
290
|
+
directory: 'myDir',
|
|
291
|
+
publishable: true,
|
|
292
|
+
});
|
|
293
|
+
} catch (e) {
|
|
294
|
+
expect(e.message).toContain(
|
|
295
|
+
'For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)'
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
it('should add package.json and .babelrc', async () => {
|
|
301
|
+
await libraryGenerator(appTree, {
|
|
302
|
+
...defaultSchema,
|
|
303
|
+
publishable: true,
|
|
304
|
+
importPath: '@proj/my-lib',
|
|
305
|
+
});
|
|
306
|
+
|
|
307
|
+
const packageJson = readJson(appTree, '/libs/my-lib/package.json');
|
|
308
|
+
expect(packageJson.name).toEqual('@proj/my-lib');
|
|
309
|
+
expect(appTree.exists('/libs/my-lib/.babelrc'));
|
|
310
|
+
});
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
describe('--js', () => {
|
|
314
|
+
it('should generate JS files', async () => {
|
|
315
|
+
await libraryGenerator(appTree, {
|
|
316
|
+
...defaultSchema,
|
|
317
|
+
js: true,
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
expect(appTree.exists('/libs/my-lib/src/index.js')).toBe(true);
|
|
321
|
+
});
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
describe('--importPath', () => {
|
|
325
|
+
it('should update the package.json & tsconfig with the given import path', async () => {
|
|
326
|
+
await libraryGenerator(appTree, {
|
|
327
|
+
...defaultSchema,
|
|
328
|
+
publishable: true,
|
|
329
|
+
directory: 'myDir',
|
|
330
|
+
importPath: '@myorg/lib',
|
|
331
|
+
});
|
|
332
|
+
const packageJson = readJson(appTree, 'libs/my-dir/my-lib/package.json');
|
|
333
|
+
const tsconfigJson = readJson(appTree, '/tsconfig.base.json');
|
|
334
|
+
|
|
335
|
+
expect(packageJson.name).toBe('@myorg/lib');
|
|
336
|
+
expect(
|
|
337
|
+
tsconfigJson.compilerOptions.paths[packageJson.name]
|
|
338
|
+
).toBeDefined();
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
it('should fail if the same importPath has already been used', async () => {
|
|
342
|
+
await libraryGenerator(appTree, {
|
|
343
|
+
...defaultSchema,
|
|
344
|
+
name: 'myLib1',
|
|
345
|
+
publishable: true,
|
|
346
|
+
importPath: '@myorg/lib',
|
|
347
|
+
});
|
|
348
|
+
|
|
349
|
+
try {
|
|
350
|
+
await libraryGenerator(appTree, {
|
|
351
|
+
...defaultSchema,
|
|
352
|
+
name: 'myLib2',
|
|
353
|
+
publishable: true,
|
|
354
|
+
importPath: '@myorg/lib',
|
|
355
|
+
});
|
|
356
|
+
} catch (e) {
|
|
357
|
+
expect(e.message).toContain(
|
|
358
|
+
'You already have a library using the import path'
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
expect.assertions(1);
|
|
363
|
+
});
|
|
364
|
+
});
|
|
365
|
+
|
|
366
|
+
describe('--no-strict', () => {
|
|
367
|
+
it('should not add options for strict mode', async () => {
|
|
368
|
+
await libraryGenerator(appTree, {
|
|
369
|
+
...defaultSchema,
|
|
370
|
+
strict: false,
|
|
371
|
+
});
|
|
372
|
+
const tsconfigJson = readJson(appTree, '/libs/my-lib/tsconfig.json');
|
|
373
|
+
|
|
374
|
+
expect(
|
|
375
|
+
tsconfigJson.compilerOptions.forceConsistentCasingInFileNames
|
|
376
|
+
).not.toBeDefined();
|
|
377
|
+
expect(tsconfigJson.compilerOptions.strict).not.toBeDefined();
|
|
378
|
+
expect(tsconfigJson.compilerOptions.noImplicitReturns).not.toBeDefined();
|
|
379
|
+
expect(
|
|
380
|
+
tsconfigJson.compilerOptions.noFallthroughCasesInSwitch
|
|
381
|
+
).not.toBeDefined();
|
|
382
|
+
});
|
|
383
|
+
});
|
|
384
|
+
|
|
385
|
+
describe('--skipPackageJson', () => {
|
|
386
|
+
it('should not add or update dependencies when true', async () => {
|
|
387
|
+
const packageJsonBefore = readJson(appTree, 'package.json');
|
|
388
|
+
|
|
389
|
+
await libraryGenerator(appTree, {
|
|
390
|
+
...defaultSchema,
|
|
391
|
+
skipPackageJson: true,
|
|
392
|
+
});
|
|
393
|
+
|
|
394
|
+
expect(readJson(appTree, 'package.json')).toEqual(packageJsonBefore);
|
|
395
|
+
});
|
|
396
|
+
});
|
|
397
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Linter } from '@nx/linter';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Same as the @nrwl/react library schema, except it removes keys: style, component, routing, appProject
|
|
5
|
+
*/
|
|
6
|
+
export interface Schema {
|
|
7
|
+
name: string;
|
|
8
|
+
directory?: string;
|
|
9
|
+
skipTsConfig: boolean;
|
|
10
|
+
skipFormat: boolean;
|
|
11
|
+
tags?: string;
|
|
12
|
+
pascalCaseFiles?: boolean;
|
|
13
|
+
unitTestRunner: 'jest' | 'none';
|
|
14
|
+
linter: Linter;
|
|
15
|
+
publishable?: boolean;
|
|
16
|
+
buildable?: boolean;
|
|
17
|
+
importPath?: string;
|
|
18
|
+
js?: boolean;
|
|
19
|
+
strict?: boolean;
|
|
20
|
+
setParserOptionsProject?: boolean;
|
|
21
|
+
skipPackageJson?: boolean; //default is false
|
|
22
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cli": "nx",
|
|
3
|
+
"$id": "NxReactNativeLibrary",
|
|
4
|
+
"$schema": "http://json-schema.org/schema",
|
|
5
|
+
"title": "Create a React Native Library for Nx",
|
|
6
|
+
"description": "Create a React Native Library for Nx.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"examples": [
|
|
9
|
+
{
|
|
10
|
+
"command": "nx g @nrwl/react-native:lib mylib --directory=myapp",
|
|
11
|
+
"description": "Generate `libs/myapp/mylib`"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"properties": {
|
|
15
|
+
"name": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Library name.",
|
|
18
|
+
"$default": {
|
|
19
|
+
"$source": "argv",
|
|
20
|
+
"index": 0
|
|
21
|
+
},
|
|
22
|
+
"x-prompt": "What name would you like to use for the library?",
|
|
23
|
+
"pattern": "^[a-zA-Z].*$"
|
|
24
|
+
},
|
|
25
|
+
"directory": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"description": "A directory where the lib is placed.",
|
|
28
|
+
"alias": "dir",
|
|
29
|
+
"x-priority": "important"
|
|
30
|
+
},
|
|
31
|
+
"linter": {
|
|
32
|
+
"description": "The tool to use for running lint checks.",
|
|
33
|
+
"type": "string",
|
|
34
|
+
"enum": ["eslint"],
|
|
35
|
+
"default": "eslint"
|
|
36
|
+
},
|
|
37
|
+
"unitTestRunner": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"enum": ["jest", "none"],
|
|
40
|
+
"description": "Test runner to use for unit tests.",
|
|
41
|
+
"default": "jest"
|
|
42
|
+
},
|
|
43
|
+
"tags": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "Add tags to the library (used for linting).",
|
|
46
|
+
"alias": "t"
|
|
47
|
+
},
|
|
48
|
+
"skipFormat": {
|
|
49
|
+
"description": "Skip formatting files.",
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"default": false,
|
|
52
|
+
"x-priority": "internal"
|
|
53
|
+
},
|
|
54
|
+
"skipTsConfig": {
|
|
55
|
+
"type": "boolean",
|
|
56
|
+
"default": false,
|
|
57
|
+
"description": "Do not update `tsconfig.json` for development experience.",
|
|
58
|
+
"x-priority": "internal"
|
|
59
|
+
},
|
|
60
|
+
"pascalCaseFiles": {
|
|
61
|
+
"type": "boolean",
|
|
62
|
+
"description": "Use pascal case component file name (e.g. `App.tsx`).",
|
|
63
|
+
"alias": "P",
|
|
64
|
+
"default": false
|
|
65
|
+
},
|
|
66
|
+
"publishable": {
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"description": "Create a publishable library."
|
|
69
|
+
},
|
|
70
|
+
"buildable": {
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"default": false,
|
|
73
|
+
"description": "Generate a buildable library."
|
|
74
|
+
},
|
|
75
|
+
"importPath": {
|
|
76
|
+
"type": "string",
|
|
77
|
+
"description": "The library name used to import it, like `@myorg/my-awesome-lib`."
|
|
78
|
+
},
|
|
79
|
+
"js": {
|
|
80
|
+
"type": "boolean",
|
|
81
|
+
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
82
|
+
"default": false
|
|
83
|
+
},
|
|
84
|
+
"strict": {
|
|
85
|
+
"type": "boolean",
|
|
86
|
+
"description": "Whether to enable tsconfig strict mode or not.",
|
|
87
|
+
"default": true
|
|
88
|
+
},
|
|
89
|
+
"setParserOptionsProject": {
|
|
90
|
+
"type": "boolean",
|
|
91
|
+
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
92
|
+
"default": false
|
|
93
|
+
},
|
|
94
|
+
"skipPackageJson": {
|
|
95
|
+
"description": "Do not add dependencies to `package.json`.",
|
|
96
|
+
"type": "boolean",
|
|
97
|
+
"default": false,
|
|
98
|
+
"x-priority": "internal"
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"required": ["name"]
|
|
102
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "NxReactNativeStorybookStories",
|
|
5
|
+
"title": "Generate React Native Storybook stories",
|
|
6
|
+
"description": "Generate stories/specs for all components declared in a React Native project.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"project": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"aliases": ["name", "projectName"],
|
|
12
|
+
"description": "Project for which to generate stories.",
|
|
13
|
+
"$default": {
|
|
14
|
+
"$source": "projectName",
|
|
15
|
+
"index": 0
|
|
16
|
+
},
|
|
17
|
+
"x-prompt": "For which project do you want to generate stories?"
|
|
18
|
+
},
|
|
19
|
+
"ignorePaths": {
|
|
20
|
+
"type": "array",
|
|
21
|
+
"description": "Paths to ignore when looking for components.",
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"description": "Path to ignore."
|
|
25
|
+
},
|
|
26
|
+
"examples": [
|
|
27
|
+
"apps/my-app/src/not-stories/**",
|
|
28
|
+
"**/**/src/**/not-stories/**",
|
|
29
|
+
"libs/my-lib/**/*.something.ts",
|
|
30
|
+
"**/**/src/**/*.other.*",
|
|
31
|
+
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
"skipFormat": {
|
|
35
|
+
"description": "Skip formatting files.",
|
|
36
|
+
"type": "boolean",
|
|
37
|
+
"default": false,
|
|
38
|
+
"x-priority": "internal"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"required": ["project"]
|
|
42
|
+
}
|