@nx/react-native 23.0.0-pr.35465.2bc2643 → 23.0.0-rc.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/{index.d.ts → dist/index.d.ts} +0 -1
- package/{plugin.d.ts → dist/plugin.d.ts} +0 -1
- package/dist/plugins/jest/svg-mock.d.ts +1 -0
- package/{plugins → dist/plugins}/jest/svg-mock.js +2 -0
- package/{plugins → dist/plugins}/metro-resolver.d.ts +0 -1
- package/{plugins → dist/plugins}/metro-resolver.js +2 -2
- package/{plugins → dist/plugins}/plugin.d.ts +3 -4
- package/{plugins → dist/plugins}/plugin.js +63 -36
- package/{plugins → dist/plugins}/with-nx-metro.d.ts +0 -1
- package/dist/readme-template.md +18 -0
- package/{src → dist/src}/executors/build-android/build-android.impl.d.ts +0 -1
- package/{src → dist/src}/executors/build-android/build-android.impl.js +2 -0
- package/{src → dist/src}/executors/build-android/schema.json +1 -0
- package/{src → dist/src}/executors/build-ios/build-ios.impl.d.ts +0 -1
- package/{src → dist/src}/executors/build-ios/build-ios.impl.js +2 -0
- package/{src → dist/src}/executors/build-ios/schema.json +1 -0
- package/{src → dist/src}/executors/bundle/bundle.impl.d.ts +0 -1
- package/{src → dist/src}/executors/bundle/bundle.impl.js +2 -0
- package/{src → dist/src}/executors/bundle/schema.json +1 -0
- package/{src → dist/src}/executors/ensure-symlink/ensure-symlink.impl.d.ts +0 -1
- package/{src → dist/src}/executors/pod-install/pod-install.impl.d.ts +0 -1
- package/{src → dist/src}/executors/pod-install/pod-install.impl.js +2 -0
- package/{src → dist/src}/executors/pod-install/schema.json +1 -0
- package/{src → dist/src}/executors/run-android/run-android.impl.d.ts +0 -1
- package/{src → dist/src}/executors/run-android/run-android.impl.js +2 -0
- package/{src → dist/src}/executors/run-android/schema.json +1 -0
- package/{src → dist/src}/executors/run-ios/run-ios.impl.d.ts +0 -1
- package/{src → dist/src}/executors/run-ios/run-ios.impl.js +2 -0
- package/{src → dist/src}/executors/run-ios/schema.json +1 -0
- package/{src → dist/src}/executors/start/lib/is-packager-running.d.ts +0 -1
- package/{src → dist/src}/executors/start/schema.json +1 -0
- package/{src → dist/src}/executors/start/start.impl.d.ts +0 -1
- package/{src → dist/src}/executors/start/start.impl.js +2 -0
- package/{src → dist/src}/executors/storybook/storybook.impl.d.ts +0 -5
- package/{src → dist/src}/executors/storybook/storybook.impl.js +0 -4
- package/{src → dist/src}/executors/sync-deps/sync-deps.impl.d.ts +0 -1
- package/dist/src/executors/upgrade/schema.json +12 -0
- package/{src → dist/src}/executors/upgrade/upgrade.impl.d.ts +0 -1
- package/{src → dist/src}/executors/upgrade/upgrade.impl.js +2 -0
- package/{src → dist/src}/generators/application/application.d.ts +0 -1
- package/{src → dist/src}/generators/application/application.js +9 -8
- package/{src → dist/src}/generators/application/lib/add-e2e.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/add-e2e.js +3 -5
- package/{src → dist/src}/generators/application/lib/add-project.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/add-project.js +4 -0
- package/{src → dist/src}/generators/application/lib/create-application-files.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/normalize-options.d.ts +0 -1
- package/{src → dist/src}/generators/application/lib/normalize-options.js +5 -5
- package/{src → dist/src}/generators/component/component.d.ts +0 -1
- package/{src → dist/src}/generators/component/component.js +5 -4
- package/{src → dist/src}/generators/component/lib/add-import.d.ts +0 -1
- package/{src → dist/src}/generators/component/lib/add-import.js +2 -2
- package/{src → dist/src}/generators/component/lib/normalize-options.d.ts +2 -3
- package/{src → dist/src}/generators/component/lib/normalize-options.js +5 -6
- package/{src → dist/src}/generators/component/schema.d.ts +0 -5
- package/{src → dist/src}/generators/component/schema.json +0 -5
- package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.d.ts +0 -1
- package/{src → dist/src}/generators/convert-to-inferred/convert-to-inferred.js +6 -5
- package/{src → dist/src}/generators/convert-to-inferred/lib/create-process-options.d.ts +1 -2
- package/{src → dist/src}/generators/convert-to-inferred/lib/post-target-transformer.d.ts +1 -2
- package/{src → dist/src}/generators/convert-to-inferred/lib/post-target-transformer.js +2 -2
- package/dist/src/generators/convert-to-inferred/lib/process-start-options.d.ts +2 -0
- package/{src → dist/src}/generators/init/init.d.ts +0 -1
- package/{src → dist/src}/generators/init/init.js +8 -6
- package/{src → dist/src}/generators/init/lib/add-git-ignore-entry.d.ts +0 -1
- package/{src → dist/src}/generators/init/lib/gitignore-entries.d.ts +0 -1
- package/{src → dist/src}/generators/init/schema.d.ts +1 -1
- package/{src → dist/src}/generators/init/schema.json +1 -1
- package/{src → dist/src}/generators/library/lib/normalize-options.d.ts +0 -1
- package/{src → dist/src}/generators/library/lib/normalize-options.js +5 -5
- package/{src → dist/src}/generators/library/library.d.ts +0 -1
- package/{src → dist/src}/generators/library/library.js +18 -20
- package/{src → dist/src}/generators/web-configuration/lib/normalize-schema.d.ts +0 -1
- package/{src → dist/src}/generators/web-configuration/lib/webpack-targets.d.ts +0 -1
- package/{src → dist/src}/generators/web-configuration/web-configuration.d.ts +0 -1
- package/{src → dist/src}/generators/web-configuration/web-configuration.js +11 -39
- package/{src → dist/src}/migrations/update-21-4-0/remove-deprecated-deps.d.ts +0 -1
- package/{src → dist/src}/migrations/update-21-4-0/upgrade-react-native-projects.d.ts +0 -1
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.d.ts +9 -0
- package/dist/src/migrations/update-23-0-0/migrate-create-nodes-v2-to-create-nodes.js +225 -0
- package/{src → dist/src}/utils/add-jest.d.ts +2 -3
- package/{src → dist/src}/utils/add-linting.d.ts +0 -1
- package/{src → dist/src}/utils/add-linting.js +11 -12
- package/{src → dist/src}/utils/chmod-android-gradle-files.d.ts +0 -1
- package/dist/src/utils/deprecation.d.ts +2 -0
- package/dist/src/utils/deprecation.js +19 -0
- package/{src → dist/src}/utils/ensure-dependencies.d.ts +0 -1
- package/dist/src/utils/ensure-dependencies.js +34 -0
- package/{src → dist/src}/utils/ensure-node-modules-symlink.d.ts +0 -1
- package/{src → dist/src}/utils/find-all-npm-dependencies.d.ts +0 -1
- package/{src → dist/src}/utils/get-cli-options.d.ts +0 -1
- package/{src → dist/src}/utils/pod-install-task.d.ts +0 -1
- package/{src → dist/src}/utils/react-native-project-detection.d.ts +0 -1
- package/{src → dist/src}/utils/react-native-project-detection.js +2 -2
- package/{src → dist/src}/utils/testing-generators.d.ts +0 -1
- package/dist/src/utils/versions.d.ts +33 -0
- package/dist/src/utils/versions.js +73 -0
- package/dist/typings/svg.d.ts +7 -0
- package/executors.json +22 -22
- package/generators.json +12 -12
- package/migrations.json +48 -36
- package/package.json +86 -14
- package/index.d.ts.map +0 -1
- package/plugin.d.ts.map +0 -1
- package/plugins/jest/svg-mock.d.ts +0 -1
- package/plugins/jest/svg-mock.d.ts.map +0 -1
- package/plugins/metro-resolver.d.ts.map +0 -1
- package/plugins/plugin.d.ts.map +0 -1
- package/plugins/with-nx-metro.d.ts.map +0 -1
- package/src/executors/build-android/build-android.impl.d.ts.map +0 -1
- package/src/executors/build-ios/build-ios.impl.d.ts.map +0 -1
- package/src/executors/bundle/bundle.impl.d.ts.map +0 -1
- package/src/executors/ensure-symlink/ensure-symlink.impl.d.ts.map +0 -1
- package/src/executors/pod-install/pod-install.impl.d.ts.map +0 -1
- package/src/executors/run-android/run-android.impl.d.ts.map +0 -1
- package/src/executors/run-ios/run-ios.impl.d.ts.map +0 -1
- package/src/executors/start/lib/is-packager-running.d.ts.map +0 -1
- package/src/executors/start/start.impl.d.ts.map +0 -1
- package/src/executors/storybook/storybook.impl.d.ts.map +0 -1
- package/src/executors/sync-deps/sync-deps.impl.d.ts.map +0 -1
- package/src/executors/upgrade/schema.json +0 -11
- package/src/executors/upgrade/upgrade.impl.d.ts.map +0 -1
- package/src/generators/application/application.d.ts.map +0 -1
- package/src/generators/application/lib/add-e2e.d.ts.map +0 -1
- package/src/generators/application/lib/add-project.d.ts.map +0 -1
- package/src/generators/application/lib/create-application-files.d.ts.map +0 -1
- package/src/generators/application/lib/normalize-options.d.ts.map +0 -1
- package/src/generators/component/component.d.ts.map +0 -1
- package/src/generators/component/lib/add-import.d.ts.map +0 -1
- package/src/generators/component/lib/normalize-options.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/convert-to-inferred.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/lib/create-process-options.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/lib/post-target-transformer.d.ts.map +0 -1
- package/src/generators/convert-to-inferred/lib/process-start-options.d.ts +0 -3
- package/src/generators/convert-to-inferred/lib/process-start-options.d.ts.map +0 -1
- package/src/generators/init/init.d.ts.map +0 -1
- package/src/generators/init/lib/add-git-ignore-entry.d.ts.map +0 -1
- package/src/generators/init/lib/gitignore-entries.d.ts.map +0 -1
- package/src/generators/library/lib/normalize-options.d.ts.map +0 -1
- package/src/generators/library/library.d.ts.map +0 -1
- package/src/generators/web-configuration/lib/normalize-schema.d.ts.map +0 -1
- package/src/generators/web-configuration/lib/webpack-targets.d.ts.map +0 -1
- package/src/generators/web-configuration/web-configuration.d.ts.map +0 -1
- package/src/migrations/update-21-4-0/remove-deprecated-deps.d.ts.map +0 -1
- package/src/migrations/update-21-4-0/upgrade-react-native-projects.d.ts.map +0 -1
- package/src/utils/add-jest.d.ts.map +0 -1
- package/src/utils/add-linting.d.ts.map +0 -1
- package/src/utils/chmod-android-gradle-files.d.ts.map +0 -1
- package/src/utils/ensure-dependencies.d.ts.map +0 -1
- package/src/utils/ensure-dependencies.js +0 -33
- package/src/utils/ensure-node-modules-symlink.d.ts.map +0 -1
- package/src/utils/find-all-npm-dependencies.d.ts.map +0 -1
- package/src/utils/get-cli-options.d.ts.map +0 -1
- package/src/utils/pod-install-task.d.ts.map +0 -1
- package/src/utils/react-native-project-detection.d.ts.map +0 -1
- package/src/utils/testing-generators.d.ts.map +0 -1
- package/src/utils/versions.d.ts +0 -21
- package/src/utils/versions.d.ts.map +0 -1
- package/src/utils/versions.js +0 -23
- /package/{LICENSE → dist/LICENSE} +0 -0
- /package/{index.js → dist/index.js} +0 -0
- /package/{plugin.js → dist/plugin.js} +0 -0
- /package/{plugins → dist/plugins}/with-nx-metro.js +0 -0
- /package/{src → dist/src}/executors/build-android/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/build-ios/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/bundle/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/ensure-symlink/ensure-symlink.impl.js +0 -0
- /package/{src → dist/src}/executors/ensure-symlink/schema.json +0 -0
- /package/{src → dist/src}/executors/pod-install/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/run-android/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/run-ios/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/start/lib/is-packager-running.js +0 -0
- /package/{src → dist/src}/executors/start/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/storybook/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/storybook/schema.json +0 -0
- /package/{src → dist/src}/executors/sync-deps/schema.d.ts +0 -0
- /package/{src → dist/src}/executors/sync-deps/schema.json +0 -0
- /package/{src → dist/src}/executors/sync-deps/sync-deps.impl.js +0 -0
- /package/{src → dist/src}/executors/upgrade/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/application/files/app/.babelrc.js.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/Gemfile.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/build.gradle.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/debug.keystore +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/proguard-rules.pro +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/debug/AndroidManifest.xml.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/AndroidManifest.xml.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainActivity.kt.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/java/com/__lowerCaseName__/MainApplication.kt.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/drawable/rn_edit_text_material.xml +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/values/strings.xml.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/app/src/main/res/values/styles.xml +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/build.gradle.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/gradle/wrapper/gradle-wrapper.properties +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/gradle.properties +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/gradlew.bat +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/gradlew.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/android/settings.gradle.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/app.json.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/ios/.xcode.env.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/ios/Podfile.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/ios/__className__/AppDelegate.swift.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/ios/__className__/Images.xcassets/AppIcon.appiconset/Contents.json +0 -0
- /package/{src → dist/src}/generators/application/files/app/ios/__className__/Images.xcassets/Contents.json +0 -0
- /package/{src → dist/src}/generators/application/files/app/ios/__className__/Info.plist.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/ios/__className__/LaunchScreen.storyboard.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/ios/__className__/PrivacyInfo.xcprivacy +0 -0
- /package/{src → dist/src}/generators/application/files/app/ios/__className__.xcodeproj/project.pbxproj.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/ios/__className__.xcodeproj/xcshareddata/xcschemes/__className__.xcscheme.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/ios/__className__.xcworkspace/contents.xcworkspacedata +0 -0
- /package/{src → dist/src}/generators/application/files/app/metro.config.js.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/package.json.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/src/app/App.spec.tsx.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/src/main.tsx.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/tsconfig.app.json.template +0 -0
- /package/{src → dist/src}/generators/application/files/app/tsconfig.json.template +0 -0
- /package/{src → dist/src}/generators/application/files/nx-welcome/claimed/src/app/App.tsx.template +0 -0
- /package/{src → dist/src}/generators/application/files/nx-welcome/not-configured/src/app/App.tsx.template +0 -0
- /package/{src → dist/src}/generators/application/files/nx-welcome/unclaimed/src/app/App.tsx.template +0 -0
- /package/{src → dist/src}/generators/application/lib/create-application-files.js +0 -0
- /package/{src → dist/src}/generators/application/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/application/schema.json +0 -0
- /package/{src → dist/src}/generators/component/files/js/__fileName__.__ext__ +0 -0
- /package/{src → dist/src}/generators/component/files/js/__fileName__.spec.__ext__ +0 -0
- /package/{src → dist/src}/generators/component/files/ts/__fileName__.__ext__ +0 -0
- /package/{src → dist/src}/generators/component/files/ts/__fileName__.spec.__ext__ +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/lib/create-process-options.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/lib/process-start-options.js +0 -0
- /package/{src → dist/src}/generators/convert-to-inferred/schema.json +0 -0
- /package/{src → dist/src}/generators/init/lib/add-git-ignore-entry.js +0 -0
- /package/{src → dist/src}/generators/init/lib/gitignore-entries.js +0 -0
- /package/{src → dist/src}/generators/library/files/lib/.babelrc.js.template +0 -0
- /package/{src → dist/src}/generators/library/files/lib/README.md +0 -0
- /package/{src → dist/src}/generators/library/files/lib/src/index.ts.template +0 -0
- /package/{src → dist/src}/generators/library/files/lib/tsconfig.json.template +0 -0
- /package/{src → dist/src}/generators/library/files/lib/tsconfig.lib.json.template +0 -0
- /package/{src → dist/src}/generators/library/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/library/schema.json +0 -0
- /package/{src → dist/src}/generators/web-configuration/files/base-vite/.babelrc.js.template +0 -0
- /package/{src → dist/src}/generators/web-configuration/files/base-vite/index.html__tmpl__ +0 -0
- /package/{src → dist/src}/generators/web-configuration/files/base-vite/public/favicon.ico +0 -0
- /package/{src → dist/src}/generators/web-configuration/files/base-vite/src/assets/.gitkeep +0 -0
- /package/{src → dist/src}/generators/web-configuration/files/base-vite/src/main-web.tsx__tmpl__ +0 -0
- /package/{src → dist/src}/generators/web-configuration/files/base-vite/vite.config.mts__tmpl__ +0 -0
- /package/{src → dist/src}/generators/web-configuration/files/base-webpack/.babelrc.js.template +0 -0
- /package/{src → dist/src}/generators/web-configuration/files/base-webpack/src/assets/.gitkeep +0 -0
- /package/{src → dist/src}/generators/web-configuration/files/base-webpack/src/favicon.ico +0 -0
- /package/{src → dist/src}/generators/web-configuration/files/base-webpack/src/index.html__tmpl__ +0 -0
- /package/{src → dist/src}/generators/web-configuration/files/base-webpack/src/main-web.tsx__tmpl__ +0 -0
- /package/{src → dist/src}/generators/web-configuration/files/base-webpack/webpack.config.js__tmpl__ +0 -0
- /package/{src → dist/src}/generators/web-configuration/lib/normalize-schema.js +0 -0
- /package/{src → dist/src}/generators/web-configuration/lib/webpack-targets.js +0 -0
- /package/{src → dist/src}/generators/web-configuration/schema.d.ts +0 -0
- /package/{src → dist/src}/generators/web-configuration/schema.json +0 -0
- /package/{src → dist/src}/migrations/update-21-4-0/remove-deprecated-deps.js +0 -0
- /package/{src → dist/src}/migrations/update-21-4-0/upgrade-react-native-projects.js +0 -0
- /package/{src → dist/src}/utils/add-jest.js +0 -0
- /package/{src → dist/src}/utils/chmod-android-gradle-files.js +0 -0
- /package/{src → dist/src}/utils/ensure-node-modules-symlink.js +0 -0
- /package/{src → dist/src}/utils/find-all-npm-dependencies.js +0 -0
- /package/{src → dist/src}/utils/get-cli-options.js +0 -0
- /package/{src → dist/src}/utils/pod-install-task.js +0 -0
- /package/{src → dist/src}/utils/testing-generators.js +0 -0
|
@@ -2,11 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addProject = addProject;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const deprecation_1 = require("../../../utils/deprecation");
|
|
5
6
|
function addProject(host, options) {
|
|
6
7
|
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
7
8
|
const hasPlugin = nxJson.plugins?.some((p) => typeof p === 'string'
|
|
8
9
|
? p === '@nx/react-native/plugin'
|
|
9
10
|
: p.plugin === '@nx/react-native/plugin');
|
|
11
|
+
if (!hasPlugin) {
|
|
12
|
+
(0, deprecation_1.warnReactNativeExecutorGenerating)();
|
|
13
|
+
}
|
|
10
14
|
const project = {
|
|
11
15
|
root: options.appProjectRoot,
|
|
12
16
|
sourceRoot: `${options.appProjectRoot}/src`,
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
async function normalizeOptions(host, options) {
|
|
8
|
-
await (0,
|
|
9
|
-
const { projectName, names: projectNames, projectRoot: appProjectRoot, importPath, } = await (0,
|
|
8
|
+
await (0, internal_1.ensureRootProjectName)(options, 'application');
|
|
9
|
+
const { projectName, names: projectNames, projectRoot: appProjectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
10
10
|
name: options.name,
|
|
11
11
|
projectType: 'application',
|
|
12
12
|
directory: options.directory,
|
|
@@ -19,7 +19,7 @@ async function normalizeOptions(host, options) {
|
|
|
19
19
|
const iosProjectRoot = (0, devkit_1.joinPathFragments)(appProjectRoot, 'ios');
|
|
20
20
|
const androidProjectRoot = (0, devkit_1.joinPathFragments)(appProjectRoot, 'android');
|
|
21
21
|
const rootProject = appProjectRoot === '.';
|
|
22
|
-
const isTsSolutionSetup = (0,
|
|
22
|
+
const isTsSolutionSetup = (0, internal_2.isUsingTsSolutionSetup)(host);
|
|
23
23
|
const appProjectName = !isTsSolutionSetup || options.name ? projectName : importPath;
|
|
24
24
|
const e2eProjectName = rootProject ? 'e2e' : `${appProjectName}-e2e`;
|
|
25
25
|
const e2eProjectRoot = rootProject ? 'e2e' : `${appProjectRoot}-e2e`;
|
|
@@ -4,10 +4,11 @@ exports.reactNativeComponentGenerator = reactNativeComponentGenerator;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
6
6
|
const add_import_1 = require("./lib/add-import");
|
|
7
|
-
const
|
|
7
|
+
const internal_1 = require("@nx/js/internal");
|
|
8
8
|
const path_1 = require("path");
|
|
9
|
-
const
|
|
9
|
+
const versions_1 = require("../../utils/versions");
|
|
10
10
|
async function reactNativeComponentGenerator(host, schema) {
|
|
11
|
+
(0, versions_1.assertSupportedReactNativeVersion)(host);
|
|
11
12
|
const options = await (0, normalize_options_1.normalizeOptions)(host, schema);
|
|
12
13
|
createComponentFiles(host, options);
|
|
13
14
|
addExportsToBarrel(host, options);
|
|
@@ -27,11 +28,11 @@ function createComponentFiles(host, options) {
|
|
|
27
28
|
let tsModule;
|
|
28
29
|
function addExportsToBarrel(host, options) {
|
|
29
30
|
if (!tsModule) {
|
|
30
|
-
tsModule = (0,
|
|
31
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
31
32
|
}
|
|
32
33
|
const workspace = (0, devkit_1.getProjects)(host);
|
|
33
34
|
const proj = workspace.get(options.projectName);
|
|
34
|
-
const isApp = (0,
|
|
35
|
+
const isApp = (0, internal_1.getProjectType)(host, proj.root, proj.projectType) === 'application';
|
|
35
36
|
if (options.export && !isApp) {
|
|
36
37
|
const indexFilePath = (0, devkit_1.joinPathFragments)(...(options.projectSourceRoot
|
|
37
38
|
? [options.projectSourceRoot]
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addImport = addImport;
|
|
4
4
|
const js_1 = require("@nx/js");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/js/internal");
|
|
7
7
|
let tsModule;
|
|
8
8
|
function addImport(source, statement) {
|
|
9
9
|
if (!tsModule) {
|
|
10
|
-
tsModule = (0,
|
|
10
|
+
tsModule = (0, internal_1.ensureTypescript)();
|
|
11
11
|
}
|
|
12
12
|
const allImports = (0, js_1.findNodes)(source, tsModule.SyntaxKind.ImportDeclaration);
|
|
13
13
|
if (allImports.length > 0) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Tree } from '@nx/devkit';
|
|
2
|
-
import { type FileExtensionType } from '@nx/devkit/
|
|
2
|
+
import { type FileExtensionType } from '@nx/devkit/internal';
|
|
3
3
|
import { Schema } from '../schema';
|
|
4
|
-
export interface NormalizedSchema extends
|
|
4
|
+
export interface NormalizedSchema extends Schema {
|
|
5
5
|
directory: string;
|
|
6
6
|
projectSourceRoot: string;
|
|
7
7
|
fileName: string;
|
|
@@ -13,4 +13,3 @@ export interface NormalizedSchema extends Omit<Schema, 'js'> {
|
|
|
13
13
|
projectRoot: string;
|
|
14
14
|
}
|
|
15
15
|
export declare function normalizeOptions(host: Tree, options: Schema): Promise<NormalizedSchema>;
|
|
16
|
-
//# sourceMappingURL=normalize-options.d.ts.map
|
|
@@ -2,21 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
async function normalizeOptions(host, options) {
|
|
8
|
-
const { artifactName: name, directory, fileName, filePath, fileExtension, fileExtensionType, project: projectName, } = await (0,
|
|
8
|
+
const { artifactName: name, directory, fileName, filePath, fileExtension, fileExtensionType, project: projectName, } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(host, {
|
|
9
9
|
path: options.path,
|
|
10
10
|
name: options.name,
|
|
11
11
|
allowedFileExtensions: ['js', 'jsx', 'ts', 'tsx'],
|
|
12
|
-
fileExtension:
|
|
13
|
-
js: options.js,
|
|
12
|
+
fileExtension: 'tsx',
|
|
14
13
|
});
|
|
15
14
|
const project = (0, devkit_1.getProjects)(host).get(projectName);
|
|
16
15
|
const { className } = (0, devkit_1.names)(name);
|
|
17
16
|
const { root, sourceRoot: projectSourceRoot, projectType } = project;
|
|
18
17
|
if (options.export &&
|
|
19
|
-
(0,
|
|
18
|
+
(0, internal_2.getProjectType)(host, root, projectType) === 'application') {
|
|
20
19
|
devkit_1.logger.warn(`The "--export" option should not be used with applications and will do nothing.`);
|
|
21
20
|
}
|
|
22
21
|
options.classComponent = options.classComponent ?? false;
|
|
@@ -8,9 +8,4 @@ export interface Schema {
|
|
|
8
8
|
export?: boolean;
|
|
9
9
|
classComponent?: boolean;
|
|
10
10
|
skipFormat?: boolean;
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* @deprecated Provide the full file path including the file extension in the `path` option. This option will be removed in Nx v21.
|
|
14
|
-
*/
|
|
15
|
-
js?: boolean;
|
|
16
11
|
}
|
|
@@ -37,11 +37,6 @@
|
|
|
37
37
|
"type": "string",
|
|
38
38
|
"description": "The component symbol name. Defaults to the last segment of the file path."
|
|
39
39
|
},
|
|
40
|
-
"js": {
|
|
41
|
-
"type": "boolean",
|
|
42
|
-
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
43
|
-
"x-deprecated": "Provide the full file path including the file extension in the `path` option. This option will be removed in Nx v21."
|
|
44
|
-
},
|
|
45
40
|
"skipTests": {
|
|
46
41
|
"type": "boolean",
|
|
47
42
|
"description": "When true, does not create `spec.ts` test files for the new component.",
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.convertToInferred = convertToInferred;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const executor_to_plugin_migrator_1 = require("@nx/devkit/src/generators/plugin-migrations/executor-to-plugin-migrator");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
6
|
const plugin_1 = require("../../../plugins/plugin");
|
|
8
7
|
const post_target_transformer_1 = require("./lib/post-target-transformer");
|
|
9
8
|
const process_start_options_1 = require("./lib/process-start-options");
|
|
10
9
|
const create_process_options_1 = require("./lib/create-process-options");
|
|
10
|
+
const versions_1 = require("../../utils/versions");
|
|
11
11
|
async function convertToInferred(tree, options) {
|
|
12
|
+
(0, versions_1.assertSupportedReactNativeVersion)(tree);
|
|
12
13
|
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
13
|
-
const migrationLogs = new
|
|
14
|
-
const migratedProjects = await (0,
|
|
14
|
+
const migrationLogs = new internal_1.AggregatedLog();
|
|
15
|
+
const migratedProjects = await (0, internal_1.migrateProjectExecutorsToPlugin)(tree, projectGraph, '@nx/react-native/plugin', plugin_1.createNodesV2, {
|
|
15
16
|
buildAndroidTargetName: 'build-android',
|
|
16
17
|
buildIosTargetName: 'build-ios',
|
|
17
18
|
bundleTargetName: 'bundle',
|
|
@@ -80,7 +81,7 @@ async function convertToInferred(tree, options) {
|
|
|
80
81
|
},
|
|
81
82
|
], options.project);
|
|
82
83
|
if (migratedProjects.size === 0) {
|
|
83
|
-
throw new
|
|
84
|
+
throw new internal_1.NoTargetsToMigrateError();
|
|
84
85
|
}
|
|
85
86
|
if (!options.skipFormat) {
|
|
86
87
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { AggregatedLog } from '@nx/devkit/
|
|
1
|
+
import type { AggregatedLog } from '@nx/devkit/internal';
|
|
2
2
|
/**
|
|
3
3
|
* Logic copied from `packages/react-native/src/utils/get-cli-options.ts`,
|
|
4
4
|
* which was used by most executors to map their options to CLI options.
|
|
5
5
|
*/
|
|
6
6
|
export declare function createProcessOptions(executorName: string, optionKeysToIgnore: string[], optionKeysInCamelName: string[]): (projectName: string, options: any, migrationLogs: AggregatedLog) => void;
|
|
7
|
-
//# sourceMappingURL=create-process-options.d.ts.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { TargetConfiguration, Tree } from '@nx/devkit';
|
|
2
|
-
import type
|
|
2
|
+
import { type AggregatedLog } from '@nx/devkit/internal';
|
|
3
3
|
export declare function postTargetTransformer(migrationLogs: AggregatedLog, processOptions?: (projectName: string, options: any, migrationLogs: AggregatedLog) => void): (target: TargetConfiguration, _tree: Tree, projectDetails: {
|
|
4
4
|
projectName: string;
|
|
5
5
|
root: string;
|
|
6
6
|
}, inferredTargetConfiguration: TargetConfiguration) => TargetConfiguration<any>;
|
|
7
|
-
//# sourceMappingURL=post-target-transformer.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.postTargetTransformer = postTargetTransformer;
|
|
4
|
-
const
|
|
4
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
5
|
function postTargetTransformer(migrationLogs, processOptions) {
|
|
6
6
|
return (target, _tree, projectDetails, inferredTargetConfiguration) => {
|
|
7
7
|
if (target.options && processOptions) {
|
|
@@ -24,7 +24,7 @@ function postTargetTransformer(migrationLogs, processOptions) {
|
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
if (target.outputs) {
|
|
27
|
-
(0,
|
|
27
|
+
(0, internal_1.processTargetOutputs)(target, [], inferredTargetConfiguration, {
|
|
28
28
|
projectName: projectDetails.projectName,
|
|
29
29
|
projectRoot: projectDetails.root,
|
|
30
30
|
});
|
|
@@ -4,4 +4,3 @@ export declare function reactNativeInitGenerator(host: Tree, schema: Schema): Pr
|
|
|
4
4
|
export declare function reactNativeInitGeneratorInternal(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
5
5
|
export declare function updateDependencies(host: Tree, schema: Schema): GeneratorCallback;
|
|
6
6
|
export default reactNativeInitGenerator;
|
|
7
|
-
//# sourceMappingURL=init.d.ts.map
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.reactNativeInitGenerator = reactNativeInitGenerator;
|
|
4
4
|
exports.reactNativeInitGeneratorInternal = reactNativeInitGeneratorInternal;
|
|
5
5
|
exports.updateDependencies = updateDependencies;
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
|
|
8
8
|
const plugin_1 = require("../../../plugins/plugin");
|
|
9
9
|
const versions_1 = require("../../utils/versions");
|
|
10
10
|
const add_git_ignore_entry_1 = require("./lib/add-git-ignore-entry");
|
|
@@ -15,13 +15,14 @@ function reactNativeInitGenerator(host, schema) {
|
|
|
15
15
|
});
|
|
16
16
|
}
|
|
17
17
|
async function reactNativeInitGeneratorInternal(host, schema) {
|
|
18
|
+
(0, versions_1.assertSupportedReactNativeVersion)(host);
|
|
18
19
|
(0, add_git_ignore_entry_1.addGitIgnoreEntry)(host);
|
|
19
20
|
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
20
21
|
const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
|
|
21
22
|
nxJson.useInferencePlugins !== false;
|
|
22
23
|
schema.addPlugin ??= addPluginDefault;
|
|
23
24
|
if (schema.addPlugin) {
|
|
24
|
-
await (0,
|
|
25
|
+
await (0, internal_1.addPlugin)(host, await (0, devkit_1.createProjectGraphAsync)(), '@nx/react-native/plugin', plugin_1.createNodesV2, {
|
|
25
26
|
startTargetName: ['start', 'react-native:start', 'react-native-start'],
|
|
26
27
|
upgradeTargetName: [
|
|
27
28
|
'update',
|
|
@@ -76,15 +77,16 @@ async function reactNativeInitGeneratorInternal(host, schema) {
|
|
|
76
77
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
77
78
|
}
|
|
78
79
|
function updateDependencies(host, schema) {
|
|
80
|
+
const rnVersions = (0, versions_1.versions)(host);
|
|
79
81
|
return (0, devkit_1.addDependenciesToPackageJson)(host, {
|
|
80
82
|
react: versions_1.reactVersion,
|
|
81
83
|
'react-dom': versions_1.reactDomVersion,
|
|
82
|
-
'react-native':
|
|
84
|
+
'react-native': rnVersions.reactNativeVersion,
|
|
83
85
|
}, {
|
|
84
86
|
'@nx/react-native': versions_1.nxVersion,
|
|
85
|
-
'metro-config':
|
|
86
|
-
'metro-resolver':
|
|
87
|
-
}, undefined, schema.keepExistingVersions);
|
|
87
|
+
'metro-config': rnVersions.metroVersion,
|
|
88
|
+
'metro-resolver': rnVersions.metroVersion,
|
|
89
|
+
}, undefined, schema.keepExistingVersions ?? true);
|
|
88
90
|
}
|
|
89
91
|
function moveDependency(host) {
|
|
90
92
|
return (0, devkit_1.removeDependenciesFromPackageJson)(host, ['@nx/react-native'], []);
|
|
@@ -1,2 +1 @@
|
|
|
1
1
|
export declare const gitIgnoreEntriesForReactNative = "\n# React Native\n\n# OSX\n#\n.DS_Store\n\n# Xcode\n#\nbuild/\n*.pbxuser\n!default.pbxuser\n*.mode1v3\n!default.mode1v3\n*.mode2v3\n!default.mode2v3\n*.perspectivev3\n!default.perspectivev3\nxcuserdata\n*.xccheckout\n*.moved-aside\nDerivedData\n*.hmap\n*.ipa\n*.xcuserstate\n**/.xcode.env.local\n\n# Android/IntelliJ\n#\nbuild/\n.idea\n.gradle\nlocal.properties\n*.iml\n*.hprof\n.cxx/\n*.keystore\n!debug.keystore\n\n# node.js\n#\nnode_modules/\nnpm-debug.log\nyarn-error.log\n\n# fastlane\n#\n# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the\n# screenshots whenever they are needed.\n# For more information about the recommended setup visit:\n# https://docs.fastlane.tools/best-practices/source-control/\n\n**/fastlane/report.xml\n**/fastlane/Preview.html\n**/fastlane/screenshots\n**/fastlane/test_output\n\n# Bundle artifact\n*.jsbundle\n\n# Ruby / CocoaPods\n**/Pods/\n**/vendor/bundle/\n\n# Temporary files created by Metro to check the health of the file watcher\n.metro-health-check*\n\n# testing\n/coverage\n";
|
|
2
|
-
//# sourceMappingURL=gitignore-entries.d.ts.map
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.normalizeOptions = normalizeOptions;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
7
|
async function normalizeOptions(host, options) {
|
|
8
|
-
await (0,
|
|
9
|
-
const { projectName, names: projectNames, projectRoot, importPath, } = await (0,
|
|
8
|
+
await (0, internal_1.ensureRootProjectName)(options, 'library');
|
|
9
|
+
const { projectName, names: projectNames, projectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
|
|
10
10
|
name: options.name,
|
|
11
11
|
projectType: 'library',
|
|
12
12
|
directory: options.directory,
|
|
@@ -19,7 +19,7 @@ async function normalizeOptions(host, options) {
|
|
|
19
19
|
const parsedTags = options.tags
|
|
20
20
|
? options.tags.split(',').map((s) => s.trim())
|
|
21
21
|
: [];
|
|
22
|
-
const isUsingTsSolutionConfig = (0,
|
|
22
|
+
const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
|
|
23
23
|
const normalized = {
|
|
24
24
|
...options,
|
|
25
25
|
fileName: projectName,
|
|
@@ -3,4 +3,3 @@ import { Schema } from './schema';
|
|
|
3
3
|
export declare function reactNativeLibraryGenerator(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
4
|
export declare function reactNativeLibraryGeneratorInternal(host: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
5
5
|
export default reactNativeLibraryGenerator;
|
|
6
|
-
//# sourceMappingURL=library.d.ts.map
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.reactNativeLibraryGenerator = reactNativeLibraryGenerator;
|
|
4
4
|
exports.reactNativeLibraryGeneratorInternal = reactNativeLibraryGeneratorInternal;
|
|
5
5
|
const tslib_1 = require("tslib");
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
7
|
const devkit_1 = require("@nx/devkit");
|
|
7
8
|
const js_1 = require("@nx/js");
|
|
8
9
|
const init_1 = tslib_1.__importDefault(require("../init/init"));
|
|
@@ -11,14 +12,10 @@ const add_jest_1 = require("../../utils/add-jest");
|
|
|
11
12
|
const component_1 = tslib_1.__importDefault(require("../component/component"));
|
|
12
13
|
const normalize_options_1 = require("./lib/normalize-options");
|
|
13
14
|
const ensure_dependencies_1 = require("../../utils/ensure-dependencies");
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
|
|
17
|
-
const add_rollup_build_target_1 = require("@nx/react/src/generators/library/lib/add-rollup-build-target");
|
|
18
|
-
const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
|
|
15
|
+
const internal_2 = require("@nx/js/internal");
|
|
16
|
+
const internal_3 = require("@nx/react/internal");
|
|
19
17
|
const path_1 = require("path");
|
|
20
18
|
const versions_1 = require("../../utils/versions");
|
|
21
|
-
const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
|
|
22
19
|
async function reactNativeLibraryGenerator(host, schema) {
|
|
23
20
|
return await reactNativeLibraryGeneratorInternal(host, {
|
|
24
21
|
addPlugin: false,
|
|
@@ -27,8 +24,9 @@ async function reactNativeLibraryGenerator(host, schema) {
|
|
|
27
24
|
});
|
|
28
25
|
}
|
|
29
26
|
async function reactNativeLibraryGeneratorInternal(host, schema) {
|
|
27
|
+
(0, versions_1.assertSupportedReactNativeVersion)(host);
|
|
30
28
|
const tasks = [];
|
|
31
|
-
const addTsPlugin = (0,
|
|
29
|
+
const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host, schema.addPlugin);
|
|
32
30
|
const jsInitTask = await (0, js_1.initGenerator)(host, {
|
|
33
31
|
...schema,
|
|
34
32
|
addTsPlugin,
|
|
@@ -46,7 +44,7 @@ async function reactNativeLibraryGeneratorInternal(host, schema) {
|
|
|
46
44
|
}
|
|
47
45
|
createFiles(host, options);
|
|
48
46
|
if (options.isUsingTsSolutionConfig) {
|
|
49
|
-
await (0,
|
|
47
|
+
await (0, internal_2.addProjectToTsSolutionWorkspace)(host, options.projectRoot);
|
|
50
48
|
}
|
|
51
49
|
const addProjectTask = await addProject(host, options);
|
|
52
50
|
if (addProjectTask) {
|
|
@@ -62,32 +60,31 @@ async function reactNativeLibraryGeneratorInternal(host, schema) {
|
|
|
62
60
|
tasks.push(lintTask);
|
|
63
61
|
const jestTask = await (0, add_jest_1.addJest)(host, options.unitTestRunner, options.name, options.projectRoot, options.js, options.skipPackageJson, options.addPlugin, 'tsconfig.lib.json');
|
|
64
62
|
tasks.push(jestTask);
|
|
65
|
-
const relativeCwd = (0,
|
|
66
|
-
const path = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src/lib', options.fileName);
|
|
63
|
+
const relativeCwd = (0, internal_1.getRelativeCwd)();
|
|
64
|
+
const path = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src/lib', options.js ? `${options.fileName}.js` : options.fileName);
|
|
67
65
|
const componentTask = await (0, component_1.default)(host, {
|
|
68
66
|
path: relativeCwd ? (0, path_1.relative)(relativeCwd, path) : path,
|
|
69
67
|
skipTests: options.unitTestRunner === 'none',
|
|
70
68
|
export: true,
|
|
71
69
|
skipFormat: true,
|
|
72
|
-
js: options.js,
|
|
73
70
|
});
|
|
74
71
|
tasks.push(() => componentTask);
|
|
75
72
|
if (options.publishable) {
|
|
76
|
-
tasks.push(await (0,
|
|
73
|
+
tasks.push(await (0, internal_2.releaseTasks)(host));
|
|
77
74
|
}
|
|
78
75
|
if (!options.skipTsConfig && !options.isUsingTsSolutionConfig) {
|
|
79
76
|
(0, js_1.addTsConfigPath)(host, options.importPath, [
|
|
80
77
|
(0, devkit_1.joinPathFragments)(options.projectRoot, './src', 'index.' + (options.js ? 'js' : 'ts')),
|
|
81
78
|
]);
|
|
82
79
|
}
|
|
83
|
-
(0,
|
|
80
|
+
(0, internal_2.updateTsconfigFiles)(host, options.projectRoot, 'tsconfig.lib.json', {
|
|
84
81
|
jsx: 'react-jsx',
|
|
85
82
|
module: 'esnext',
|
|
86
83
|
moduleResolution: 'bundler',
|
|
87
84
|
}, options.linter === 'eslint'
|
|
88
85
|
? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
|
|
89
86
|
: undefined);
|
|
90
|
-
(0,
|
|
87
|
+
(0, internal_2.sortPackageJsonFields)(host, options.projectRoot);
|
|
91
88
|
if (!options.skipFormat) {
|
|
92
89
|
await (0, devkit_1.formatFiles)(host);
|
|
93
90
|
}
|
|
@@ -96,11 +93,12 @@ async function reactNativeLibraryGeneratorInternal(host, schema) {
|
|
|
96
93
|
tasks.push(() => (0, devkit_1.installPackagesTask)(host, true));
|
|
97
94
|
}
|
|
98
95
|
tasks.push(() => {
|
|
99
|
-
(0,
|
|
96
|
+
(0, internal_1.logShowProjectCommand)(options.name);
|
|
100
97
|
});
|
|
101
98
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
102
99
|
}
|
|
103
100
|
async function addProject(host, options) {
|
|
101
|
+
const rnVersions = (0, versions_1.versions)(host);
|
|
104
102
|
const project = {
|
|
105
103
|
root: options.projectRoot,
|
|
106
104
|
sourceRoot: (0, devkit_1.joinPathFragments)(options.projectRoot, 'src'),
|
|
@@ -121,7 +119,7 @@ async function addProject(host, options) {
|
|
|
121
119
|
files: options.publishable ? ['dist', '!**/*.tsbuildinfo'] : undefined,
|
|
122
120
|
peerDependencies: {
|
|
123
121
|
react: versions_1.reactVersion,
|
|
124
|
-
'react-native':
|
|
122
|
+
'react-native': rnVersions.reactNativeVersion,
|
|
125
123
|
},
|
|
126
124
|
};
|
|
127
125
|
if (options.name !== options.importPath) {
|
|
@@ -135,7 +133,7 @@ async function addProject(host, options) {
|
|
|
135
133
|
else {
|
|
136
134
|
if (options.publishable) {
|
|
137
135
|
const nxJson = (0, devkit_1.readJson)(host, 'nx.json');
|
|
138
|
-
await (0,
|
|
136
|
+
await (0, internal_2.addReleaseConfigForNonTsSolution)(host, options.name, project);
|
|
139
137
|
}
|
|
140
138
|
(0, devkit_1.addProjectConfiguration)(host, options.name, project);
|
|
141
139
|
}
|
|
@@ -145,7 +143,7 @@ async function addProject(host, options) {
|
|
|
145
143
|
options.buildable) {
|
|
146
144
|
(0, devkit_1.writeJson)(host, (0, devkit_1.joinPathFragments)(options.projectRoot, 'package.json'), packageJson);
|
|
147
145
|
if (options.publishable) {
|
|
148
|
-
await (0,
|
|
146
|
+
await (0, internal_2.addReleaseConfigForTsSolution)(host, options.name, project);
|
|
149
147
|
(0, devkit_1.updateProjectConfiguration)(host, options.name, project);
|
|
150
148
|
}
|
|
151
149
|
}
|
|
@@ -156,7 +154,7 @@ async function addProject(host, options) {
|
|
|
156
154
|
'react',
|
|
157
155
|
'react-dom',
|
|
158
156
|
]);
|
|
159
|
-
const rollupTask = await (0,
|
|
157
|
+
const rollupTask = await (0, internal_3.addRollupBuildTarget)(host, {
|
|
160
158
|
...options,
|
|
161
159
|
format: ['cjs', 'esm'],
|
|
162
160
|
style: 'none',
|
|
@@ -167,7 +165,7 @@ async function addProject(host, options) {
|
|
|
167
165
|
json.peerDependencies = {
|
|
168
166
|
...json.peerDependencies,
|
|
169
167
|
react: versions_1.reactVersion,
|
|
170
|
-
'react-native':
|
|
168
|
+
'react-native': rnVersions.reactNativeVersion,
|
|
171
169
|
};
|
|
172
170
|
return json;
|
|
173
171
|
});
|
|
@@ -6,4 +6,3 @@ export declare function createBuildTarget(tree: Tree, options: NormalizedSchema)
|
|
|
6
6
|
export declare function createServeTarget(options: NormalizedSchema): TargetConfiguration;
|
|
7
7
|
export declare function createNxWebpackPluginOptions(tree: Tree, options: NormalizedSchema): WithNxOptions & WithReactOptions;
|
|
8
8
|
export declare function determineTsConfig(tree: Tree, options: NormalizedSchema): "tsconfig.app.json" | "tsconfig.lib.json" | "tsconfig.json";
|
|
9
|
-
//# sourceMappingURL=webpack-targets.d.ts.map
|
|
@@ -10,4 +10,3 @@ import { WebConfigurationGeneratorSchema } from './schema';
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function webConfigurationGenerator(tree: Tree, options: WebConfigurationGeneratorSchema): Promise<GeneratorCallback>;
|
|
12
12
|
export default webConfigurationGenerator;
|
|
13
|
-
//# sourceMappingURL=web-configuration.d.ts.map
|