@nx/react-native 23.0.0-pr.35465.2bc2643 → 23.0.0-rc.0
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
|
@@ -1,41 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.webConfigurationGenerator = webConfigurationGenerator;
|
|
37
4
|
const devkit_1 = require("@nx/devkit");
|
|
38
|
-
const
|
|
5
|
+
const internal_1 = require("@nx/react/internal");
|
|
39
6
|
const versions_1 = require("../../utils/versions");
|
|
40
7
|
const normalize_schema_1 = require("./lib/normalize-schema");
|
|
41
8
|
const webpack_targets_1 = require("./lib/webpack-targets");
|
|
@@ -48,6 +15,7 @@ const webpack_targets_1 = require("./lib/webpack-targets");
|
|
|
48
15
|
* @param options
|
|
49
16
|
*/
|
|
50
17
|
async function webConfigurationGenerator(tree, options) {
|
|
18
|
+
(0, versions_1.assertSupportedReactNativeVersion)(tree);
|
|
51
19
|
const normalizedSchema = (0, normalize_schema_1.normalizeSchema)(tree, options);
|
|
52
20
|
const tasks = [];
|
|
53
21
|
// install react-native-web
|
|
@@ -55,7 +23,7 @@ async function webConfigurationGenerator(tree, options) {
|
|
|
55
23
|
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
56
24
|
'react-native-web': versions_1.reactNativeWebVersion,
|
|
57
25
|
'react-native-svg-web': versions_1.reactNativeSvgWebVersion,
|
|
58
|
-
});
|
|
26
|
+
}, undefined, true);
|
|
59
27
|
tasks.push(installTask);
|
|
60
28
|
}
|
|
61
29
|
// apply webpack or vite init generator
|
|
@@ -69,7 +37,7 @@ async function webConfigurationGenerator(tree, options) {
|
|
|
69
37
|
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, './files/base-webpack'), normalizedSchema.projectRoot, {
|
|
70
38
|
...normalizedSchema,
|
|
71
39
|
tmpl: '',
|
|
72
|
-
webpackPluginOptions: (0,
|
|
40
|
+
webpackPluginOptions: (0, internal_1.hasWebpackPlugin)(tree)
|
|
73
41
|
? (0, webpack_targets_1.createNxWebpackPluginOptions)(tree, normalizedSchema)
|
|
74
42
|
: null,
|
|
75
43
|
});
|
|
@@ -77,7 +45,7 @@ async function webConfigurationGenerator(tree, options) {
|
|
|
77
45
|
if (!options.skipPackageJson) {
|
|
78
46
|
tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
79
47
|
'@types/react-dom': versions_1.typesReactDomVersion,
|
|
80
|
-
}));
|
|
48
|
+
}, undefined, true));
|
|
81
49
|
}
|
|
82
50
|
if (!options.skipFormat) {
|
|
83
51
|
await (0, devkit_1.formatFiles)(tree);
|
|
@@ -114,10 +82,14 @@ async function addBundlerConfiguration(tree, normalizedSchema) {
|
|
|
114
82
|
});
|
|
115
83
|
tasks.push(webpackInitTask);
|
|
116
84
|
if (!normalizedSchema.skipPackageJson) {
|
|
117
|
-
const { ensureDependencies } =
|
|
85
|
+
const { ensureDependencies, } = require('@nx/webpack/internal');
|
|
118
86
|
tasks.push(ensureDependencies(tree, { uiFramework: 'react' }));
|
|
119
87
|
}
|
|
120
|
-
if (!(0,
|
|
88
|
+
if (!(0, internal_1.hasWebpackPlugin)(tree)) {
|
|
89
|
+
// Mirrors warnWebpackExecutorGenerating from @nx/webpack/src/utils/deprecation.
|
|
90
|
+
// Inlined to avoid a cross-package import where react-native does not
|
|
91
|
+
// declare a TypeScript project reference to webpack.
|
|
92
|
+
devkit_1.logger.warn('Generating targets that use the deprecated `@nx/webpack:webpack` and `@nx/webpack:dev-server` executors. These executors will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` next to migrate these targets to the `@nx/webpack/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
|
|
121
93
|
const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, normalizedSchema.project);
|
|
122
94
|
projectConfiguration.targets = {
|
|
123
95
|
...projectConfiguration.targets,
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
2
|
+
export default function migrateCreateNodesV2ToCreateNodes(tree: Tree): Promise<void>;
|
|
3
|
+
/**
|
|
4
|
+
* Rewrites named imports and re-exports of `createNodesV2` to `createNodes`
|
|
5
|
+
* when they come from one of the given module specifiers. Only the named
|
|
6
|
+
* bindings are touched — the module specifier, the `import`/`export` keyword,
|
|
7
|
+
* any `type` modifier, and any default import are left untouched.
|
|
8
|
+
*/
|
|
9
|
+
export declare function rewriteCreateNodesV2Imports(source: string, specifiers: ReadonlySet<string>): string;
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = migrateCreateNodesV2ToCreateNodes;
|
|
4
|
+
exports.rewriteCreateNodesV2Imports = rewriteCreateNodesV2Imports;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const TS_EXTENSIONS = ['.ts', '.tsx', '.cts', '.mts'];
|
|
7
|
+
const DEPRECATED_NAME = 'createNodesV2';
|
|
8
|
+
const CANONICAL_NAME = 'createNodes';
|
|
9
|
+
// Module specifiers from which `@nx/react-native` publicly exposes `createNodesV2`.
|
|
10
|
+
// A named import or re-export of `createNodesV2` from one of these is rewritten
|
|
11
|
+
// to the canonical `createNodes` export.
|
|
12
|
+
const TARGET_SPECIFIERS = new Set([
|
|
13
|
+
'@nx/react-native/plugin',
|
|
14
|
+
]);
|
|
15
|
+
let ts;
|
|
16
|
+
async function migrateCreateNodesV2ToCreateNodes(tree) {
|
|
17
|
+
let touchedCount = 0;
|
|
18
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => {
|
|
19
|
+
if (!TS_EXTENSIONS.some((ext) => filePath.endsWith(ext))) {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const original = tree.read(filePath, 'utf-8');
|
|
23
|
+
if (!original || !original.includes(DEPRECATED_NAME)) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
const updated = rewriteCreateNodesV2Imports(original, TARGET_SPECIFIERS);
|
|
27
|
+
if (updated !== original) {
|
|
28
|
+
tree.write(filePath, updated);
|
|
29
|
+
touchedCount += 1;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
if (touchedCount > 0) {
|
|
33
|
+
devkit_1.logger.info(`Renamed \`${DEPRECATED_NAME}\` imports to \`${CANONICAL_NAME}\` in ${touchedCount} file(s).`);
|
|
34
|
+
}
|
|
35
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Rewrites named imports and re-exports of `createNodesV2` to `createNodes`
|
|
39
|
+
* when they come from one of the given module specifiers. Only the named
|
|
40
|
+
* bindings are touched — the module specifier, the `import`/`export` keyword,
|
|
41
|
+
* any `type` modifier, and any default import are left untouched.
|
|
42
|
+
*/
|
|
43
|
+
function rewriteCreateNodesV2Imports(source, specifiers) {
|
|
44
|
+
ts ??= (0, devkit_1.ensurePackage)('typescript', '*');
|
|
45
|
+
const sourceFile = ts.createSourceFile('tmp.ts', source, ts.ScriptTarget.Latest,
|
|
46
|
+
/* setParentNodes */ true, ts.ScriptKind.TSX);
|
|
47
|
+
const changes = [];
|
|
48
|
+
let renameLocalUsages = false;
|
|
49
|
+
for (const stmt of sourceFile.statements) {
|
|
50
|
+
if (ts.isImportDeclaration(stmt)) {
|
|
51
|
+
renameLocalUsages =
|
|
52
|
+
collectImportRewrite(sourceFile, stmt, specifiers, changes) ||
|
|
53
|
+
renameLocalUsages;
|
|
54
|
+
}
|
|
55
|
+
else if (ts.isExportDeclaration(stmt)) {
|
|
56
|
+
collectExportRewrite(sourceFile, stmt, specifiers, changes);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// Renaming a local `createNodesV2` import binding to `createNodes` (a lone
|
|
60
|
+
// `{ createNodesV2 }`, or one deduped against an existing `createNodes`)
|
|
61
|
+
// changes the name in scope, so value references to `createNodesV2` in the
|
|
62
|
+
// file body must be renamed too — otherwise they dangle. Aliased imports and
|
|
63
|
+
// re-exports keep their local name, so they never trigger this.
|
|
64
|
+
if (renameLocalUsages) {
|
|
65
|
+
collectValueUsageRewrites(sourceFile, changes);
|
|
66
|
+
}
|
|
67
|
+
return changes.length > 0 ? (0, devkit_1.applyChangesToString)(source, changes) : source;
|
|
68
|
+
}
|
|
69
|
+
function isTargetSpecifier(node, specifiers) {
|
|
70
|
+
return ts.isStringLiteral(node) && specifiers.has(node.text);
|
|
71
|
+
}
|
|
72
|
+
function collectImportRewrite(sourceFile, stmt, specifiers, changes) {
|
|
73
|
+
if (!isTargetSpecifier(stmt.moduleSpecifier, specifiers)) {
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
const namedBindings = stmt.importClause?.namedBindings;
|
|
77
|
+
// Only `import { ... }` carries renameable named bindings. `import x`,
|
|
78
|
+
// `import * as ns`, and side-effect imports reference the module wholesale
|
|
79
|
+
// and keep working through the `createNodesV2` runtime alias, so we leave
|
|
80
|
+
// them be. A mixed `import def, { createNodesV2 }` still has its named
|
|
81
|
+
// bindings rewritten below — the default binding is untouched.
|
|
82
|
+
if (!namedBindings || !ts.isNamedImports(namedBindings)) {
|
|
83
|
+
return false;
|
|
84
|
+
}
|
|
85
|
+
// The local `createNodesV2` binding only disappears when it is imported
|
|
86
|
+
// without an alias — a lone `{ createNodesV2 }` or one deduped against an
|
|
87
|
+
// existing `createNodes`. `{ createNodesV2 as x }` keeps the local `x`, so
|
|
88
|
+
// its in-file usages are unaffected and must not be rewritten.
|
|
89
|
+
const localBindingRenamed = namedBindings.elements.some((el) => el.name.text === DEPRECATED_NAME &&
|
|
90
|
+
(el.propertyName ?? el.name).text === DEPRECATED_NAME);
|
|
91
|
+
rewriteNamedBindings(sourceFile, namedBindings, changes);
|
|
92
|
+
return localBindingRenamed;
|
|
93
|
+
}
|
|
94
|
+
function collectExportRewrite(sourceFile, stmt, specifiers, changes) {
|
|
95
|
+
if (!stmt.moduleSpecifier ||
|
|
96
|
+
!isTargetSpecifier(stmt.moduleSpecifier, specifiers)) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// `export { ... } from '...'` can be rewritten; `export * from '...'` has no
|
|
100
|
+
// named bindings to rename.
|
|
101
|
+
if (!stmt.exportClause || !ts.isNamedExports(stmt.exportClause)) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
rewriteNamedBindings(sourceFile, stmt.exportClause, changes);
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Re-renders the `{ ... }` of a named import/export, renaming any
|
|
108
|
+
* `createNodesV2` specifier to `createNodes`. If renaming would collide with a
|
|
109
|
+
* `createNodes` that is already present (e.g. `{ createNodes, createNodesV2 }`),
|
|
110
|
+
* the duplicate is dropped. Returns without recording a change when the binding
|
|
111
|
+
* list contains no `createNodesV2`.
|
|
112
|
+
*/
|
|
113
|
+
function rewriteNamedBindings(sourceFile, namedBindings, changes) {
|
|
114
|
+
const elements = namedBindings.elements;
|
|
115
|
+
const hasDeprecated = elements.some((el) => (el.propertyName ?? el.name).text === DEPRECATED_NAME);
|
|
116
|
+
if (!hasDeprecated) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const seen = new Set();
|
|
120
|
+
const rendered = [];
|
|
121
|
+
for (const el of elements) {
|
|
122
|
+
const text = renderSpecifier(el);
|
|
123
|
+
if (!seen.has(text)) {
|
|
124
|
+
seen.add(text);
|
|
125
|
+
rendered.push(text);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const start = namedBindings.getStart(sourceFile);
|
|
129
|
+
changes.push({
|
|
130
|
+
type: devkit_1.ChangeType.Delete,
|
|
131
|
+
start,
|
|
132
|
+
length: namedBindings.getEnd() - start,
|
|
133
|
+
}, {
|
|
134
|
+
type: devkit_1.ChangeType.Insert,
|
|
135
|
+
index: start,
|
|
136
|
+
text: `{ ${rendered.join(', ')} }`,
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
function renderSpecifier(el) {
|
|
140
|
+
const typePrefix = el.isTypeOnly ? 'type ' : '';
|
|
141
|
+
const rename = (name) => name === DEPRECATED_NAME ? CANONICAL_NAME : name;
|
|
142
|
+
// `{ name }` — no alias, so the local binding follows the rename.
|
|
143
|
+
if (!el.propertyName) {
|
|
144
|
+
return `${typePrefix}${rename(el.name.text)}`;
|
|
145
|
+
}
|
|
146
|
+
// `{ propertyName as name }` — only the imported (left) side is renamed; the
|
|
147
|
+
// local alias is preserved. A now-redundant alias such as
|
|
148
|
+
// `createNodesV2 as createNodes` collapses to `createNodes`.
|
|
149
|
+
const canonicalImported = rename(el.propertyName.text);
|
|
150
|
+
const localName = el.name.text;
|
|
151
|
+
return canonicalImported === localName
|
|
152
|
+
? `${typePrefix}${localName}`
|
|
153
|
+
: `${typePrefix}${canonicalImported} as ${localName}`;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Renames value references of `createNodesV2` to `createNodes` in the file
|
|
157
|
+
* body. Only called once a local `createNodesV2` import binding has actually
|
|
158
|
+
* been renamed, so these references would otherwise dangle. Occurrences that
|
|
159
|
+
* are not references to that binding are skipped: the import/export
|
|
160
|
+
* declarations themselves, property accesses (`x.createNodesV2`), qualified
|
|
161
|
+
* type names, object-literal keys, and declaration names that shadow the
|
|
162
|
+
* import. A shorthand property (`{ createNodesV2 }`) is expanded to
|
|
163
|
+
* `{ createNodesV2: createNodes }` so the property key is preserved. Strings
|
|
164
|
+
* and comments are never `Identifier` nodes, so they are left alone.
|
|
165
|
+
*/
|
|
166
|
+
function collectValueUsageRewrites(sourceFile, changes) {
|
|
167
|
+
const visit = (node) => {
|
|
168
|
+
if (ts.isIdentifier(node) &&
|
|
169
|
+
node.text === DEPRECATED_NAME &&
|
|
170
|
+
isRenamableValueUsage(node)) {
|
|
171
|
+
const start = node.getStart(sourceFile);
|
|
172
|
+
changes.push({
|
|
173
|
+
type: devkit_1.ChangeType.Delete,
|
|
174
|
+
start,
|
|
175
|
+
length: node.getEnd() - start,
|
|
176
|
+
}, {
|
|
177
|
+
type: devkit_1.ChangeType.Insert,
|
|
178
|
+
index: start,
|
|
179
|
+
text: ts.isShorthandPropertyAssignment(node.parent)
|
|
180
|
+
? `${DEPRECATED_NAME}: ${CANONICAL_NAME}`
|
|
181
|
+
: CANONICAL_NAME,
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
node.forEachChild(visit);
|
|
185
|
+
};
|
|
186
|
+
sourceFile.forEachChild(visit);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Whether a `createNodesV2` identifier is a value reference to the renamed
|
|
190
|
+
* import binding, as opposed to a position that must be left untouched.
|
|
191
|
+
*/
|
|
192
|
+
function isRenamableValueUsage(node) {
|
|
193
|
+
const parent = node.parent;
|
|
194
|
+
if (!parent) {
|
|
195
|
+
return false;
|
|
196
|
+
}
|
|
197
|
+
// Import/export bindings — already handled by the declaration rewrite.
|
|
198
|
+
if (ts.isImportSpecifier(parent) ||
|
|
199
|
+
ts.isExportSpecifier(parent) ||
|
|
200
|
+
ts.isImportClause(parent) ||
|
|
201
|
+
ts.isNamespaceImport(parent)) {
|
|
202
|
+
return false;
|
|
203
|
+
}
|
|
204
|
+
// `x.createNodesV2` / `X.createNodesV2` — a member name, not the binding.
|
|
205
|
+
if (ts.isPropertyAccessExpression(parent) && parent.name === node) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
if (ts.isQualifiedName(parent) && parent.right === node) {
|
|
209
|
+
return false;
|
|
210
|
+
}
|
|
211
|
+
// `{ createNodesV2: ... }` — an object-literal key, not the binding.
|
|
212
|
+
if (ts.isPropertyAssignment(parent) && parent.name === node) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
// A declaration whose name shadows the import (variable, param, etc.).
|
|
216
|
+
if ((ts.isVariableDeclaration(parent) ||
|
|
217
|
+
ts.isParameter(parent) ||
|
|
218
|
+
ts.isBindingElement(parent) ||
|
|
219
|
+
ts.isFunctionDeclaration(parent) ||
|
|
220
|
+
ts.isClassDeclaration(parent)) &&
|
|
221
|
+
parent.name === node) {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
return true;
|
|
225
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { Tree } from '@nx/devkit';
|
|
2
|
-
export declare function addJest(host: Tree, unitTestRunner: 'jest' | 'none', projectName: string, appProjectRoot: string, js: boolean, skipPackageJson: boolean, addPlugin: boolean, runtimeTsconfigFileName: string): Promise<
|
|
3
|
-
//# sourceMappingURL=add-jest.d.ts.map
|
|
1
|
+
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
|
+
export declare function addJest(host: Tree, unitTestRunner: 'jest' | 'none', projectName: string, appProjectRoot: string, js: boolean, skipPackageJson: boolean, addPlugin: boolean, runtimeTsconfigFileName: string): Promise<GeneratorCallback>;
|
|
@@ -3,9 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addLinting = addLinting;
|
|
4
4
|
const eslint_1 = require("@nx/eslint");
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const flat_config_1 = require("@nx/eslint/src/utils/flat-config");
|
|
6
|
+
const react_1 = require("@nx/react");
|
|
7
|
+
const internal_1 = require("@nx/eslint/internal");
|
|
9
8
|
async function addLinting(host, options) {
|
|
10
9
|
if (options.linter === 'none') {
|
|
11
10
|
return () => { };
|
|
@@ -23,8 +22,8 @@ async function addLinting(host, options) {
|
|
|
23
22
|
});
|
|
24
23
|
tasks.push(lintTask);
|
|
25
24
|
// Add ignored dependencies and files to dependency-checks rule
|
|
26
|
-
if ((0,
|
|
27
|
-
(0,
|
|
25
|
+
if ((0, internal_1.isEslintConfigSupported)(host)) {
|
|
26
|
+
(0, internal_1.updateOverrideInLintConfig)(host, options.projectRoot, (override) => Boolean(override.rules?.['@nx/dependency-checks']), (override) => {
|
|
28
27
|
const rule = override.rules['@nx/dependency-checks'];
|
|
29
28
|
if (Array.isArray(rule) && rule.length > 1) {
|
|
30
29
|
// Ensure ignoredDependencies array exists
|
|
@@ -47,23 +46,23 @@ async function addLinting(host, options) {
|
|
|
47
46
|
return override;
|
|
48
47
|
});
|
|
49
48
|
}
|
|
50
|
-
if ((0,
|
|
51
|
-
if ((0,
|
|
52
|
-
(0,
|
|
49
|
+
if ((0, internal_1.isEslintConfigSupported)(host)) {
|
|
50
|
+
if ((0, internal_1.useFlatConfig)(host)) {
|
|
51
|
+
(0, internal_1.addPredefinedConfigToFlatLintConfig)(host, options.projectRoot, 'flat/react', { checkBaseConfig: true });
|
|
53
52
|
// Add an empty rules object to users know how to add/override rules
|
|
54
|
-
(0,
|
|
53
|
+
(0, internal_1.addOverrideToLintConfig)(host, options.projectRoot, {
|
|
55
54
|
files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
|
|
56
55
|
rules: {},
|
|
57
56
|
});
|
|
58
57
|
}
|
|
59
58
|
else {
|
|
60
|
-
const addExtendsTask = (0,
|
|
59
|
+
const addExtendsTask = (0, internal_1.addExtendsToLintConfig)(host, options.projectRoot, {
|
|
61
60
|
name: 'plugin:@nx/react',
|
|
62
61
|
needCompatFixup: true,
|
|
63
62
|
});
|
|
64
63
|
tasks.push(addExtendsTask);
|
|
65
64
|
}
|
|
66
|
-
(0,
|
|
65
|
+
(0, internal_1.addIgnoresToLintConfig)(host, options.projectRoot, [
|
|
67
66
|
'public',
|
|
68
67
|
'.cache',
|
|
69
68
|
'node_modules',
|
|
@@ -71,7 +70,7 @@ async function addLinting(host, options) {
|
|
|
71
70
|
]);
|
|
72
71
|
}
|
|
73
72
|
if (!options.skipPackageJson) {
|
|
74
|
-
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host,
|
|
73
|
+
const installTask = (0, devkit_1.addDependenciesToPackageJson)(host, react_1.extraEslintDependencies.dependencies, react_1.extraEslintDependencies.devDependencies, undefined, true);
|
|
75
74
|
tasks.push(installTask);
|
|
76
75
|
}
|
|
77
76
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { GeneratorCallback } from '@nx/devkit';
|
|
2
2
|
export declare function chmodAndroidGradlewFiles(androidFolder: string): void;
|
|
3
3
|
export declare function chmodAndroidGradlewFilesTask(androidFolder: string): GeneratorCallback;
|
|
4
|
-
//# sourceMappingURL=chmod-android-gradle-files.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.warnReactNativeExecutorDeprecation = warnReactNativeExecutorDeprecation;
|
|
4
|
+
exports.warnReactNativeExecutorGenerating = warnReactNativeExecutorGenerating;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
// TODO(v24): Remove the @nx/react-native:build-android, :build-ios, :bundle,
|
|
7
|
+
// :pod-install, :run-android, :run-ios, :start, and :upgrade executors. The
|
|
8
|
+
// inferred plugin (@nx/react-native/plugin) and the convert-to-inferred
|
|
9
|
+
// generator stay supported. (`:storybook`, `:sync-deps`, and `:ensure-symlink`
|
|
10
|
+
// are Nx-specific glue with no inferred replacement and stay as-is.)
|
|
11
|
+
function buildMessage(executorName) {
|
|
12
|
+
return `The \`@nx/react-native:${executorName}\` executor is deprecated and will be removed in Nx v24. Run \`nx g @nx/react-native:convert-to-inferred\` to migrate to the \`@nx/react-native/plugin\` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.`;
|
|
13
|
+
}
|
|
14
|
+
function warnReactNativeExecutorDeprecation(executorName) {
|
|
15
|
+
devkit_1.logger.warn(buildMessage(executorName));
|
|
16
|
+
}
|
|
17
|
+
function warnReactNativeExecutorGenerating() {
|
|
18
|
+
devkit_1.logger.warn('Generating targets that use the deprecated `@nx/react-native:build-android`, `@nx/react-native:build-ios`, `@nx/react-native:bundle`, `@nx/react-native:pod-install`, `@nx/react-native:run-android`, `@nx/react-native:run-ios`, `@nx/react-native:start`, and `@nx/react-native:upgrade` executors. These executors will be removed in Nx v24. Run `nx g @nx/react-native:convert-to-inferred` next to migrate these targets to the `@nx/react-native/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
|
|
19
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ensureDependencies = ensureDependencies;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/react/internal");
|
|
6
|
+
const versions_1 = require("./versions");
|
|
7
|
+
function ensureDependencies(tree, unitTestRunner) {
|
|
8
|
+
const isPnpm = (0, devkit_1.detectPackageManager)(tree.root) === 'pnpm';
|
|
9
|
+
const rnVersions = (0, versions_1.versions)(tree);
|
|
10
|
+
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
11
|
+
'@types/node': versions_1.typesNodeVersion,
|
|
12
|
+
'@types/react': versions_1.typesReactVersion,
|
|
13
|
+
'@react-native/babel-preset': rnVersions.reactNativeBabelPresetVersion,
|
|
14
|
+
'@react-native/metro-config': rnVersions.reactNativeMetroConfigVersion,
|
|
15
|
+
'@react-native-community/cli': rnVersions.reactNativeCommunityCliVersion,
|
|
16
|
+
'@react-native-community/cli-platform-android': rnVersions.reactNativeCommunityCliPlatformAndroidVersion,
|
|
17
|
+
'@react-native-community/cli-platform-ios': rnVersions.reactNativeCommunityCliPlatformIosVersion,
|
|
18
|
+
'react-native-svg-transformer': versions_1.reactNativeSvgTransformerVersion,
|
|
19
|
+
'react-native-svg': versions_1.reactNativeSvgVersion,
|
|
20
|
+
'@babel/preset-react': internal_1.babelPresetReactVersion,
|
|
21
|
+
'@babel/core': internal_1.babelCoreVersion,
|
|
22
|
+
...(unitTestRunner === 'jest'
|
|
23
|
+
? {
|
|
24
|
+
'@testing-library/react-native': versions_1.testingLibraryReactNativeVersion,
|
|
25
|
+
'react-test-renderer': versions_1.reactTestRendererVersion,
|
|
26
|
+
}
|
|
27
|
+
: {}),
|
|
28
|
+
...(isPnpm
|
|
29
|
+
? {
|
|
30
|
+
'@babel/runtime': versions_1.babelRuntimeVersion, // @babel/runtime is used by react-native-svg
|
|
31
|
+
}
|
|
32
|
+
: {}),
|
|
33
|
+
}, undefined, true);
|
|
34
|
+
}
|
|
@@ -12,4 +12,3 @@ export declare function isReactNativeProject(tree: Tree, projectRoot: string): P
|
|
|
12
12
|
* Gets all React Native projects in the workspace
|
|
13
13
|
*/
|
|
14
14
|
export declare function getAllReactNativeProjects(tree: Tree, projects: Map<string, any>): Promise<string[]>;
|
|
15
|
-
//# sourceMappingURL=react-native-project-detection.d.ts.map
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.isReactNativeProject = isReactNativeProject;
|
|
4
4
|
exports.getAllReactNativeProjects = getAllReactNativeProjects;
|
|
5
5
|
const devkit_1 = require("@nx/devkit");
|
|
6
|
-
const
|
|
6
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
async function getAppConfig(tree, projectRoot, appConfigPath) {
|
|
8
8
|
const absolutePath = (0, devkit_1.joinPathFragments)(tree.root, projectRoot, appConfigPath);
|
|
9
|
-
return (0,
|
|
9
|
+
return (0, internal_1.loadConfigFile)(absolutePath);
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Determines if a project is a React Native project by checking for specific files
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type Tree } from '@nx/devkit';
|
|
2
|
+
export declare const nxVersion: any;
|
|
3
|
+
export declare const minSupportedReactNativeVersion = "0.83.0";
|
|
4
|
+
export declare function assertSupportedReactNativeVersion(tree: Tree): void;
|
|
5
|
+
export declare const reactNativeVersion = "~0.84.1";
|
|
6
|
+
export declare const reactNativeBabelPresetVersion = "~0.84.1";
|
|
7
|
+
export declare const reactNativeMetroConfigVersion = "~0.84.1";
|
|
8
|
+
export declare const metroVersion = "~0.83.0";
|
|
9
|
+
export declare const reactNativeCommunityCliVersion = "~20.1.0";
|
|
10
|
+
export declare const reactNativeCommunityCliPlatformAndroidVersion = "~20.1.0";
|
|
11
|
+
export declare const reactNativeCommunityCliPlatformIosVersion = "~20.1.0";
|
|
12
|
+
export declare const typesNodeVersion = "^22.0.0";
|
|
13
|
+
export declare const reactNativeWebVersion = "~0.21.0";
|
|
14
|
+
export declare const reactVersion = "^19.2.0";
|
|
15
|
+
export declare const reactDomVersion = "^19.2.0";
|
|
16
|
+
export declare const typesReactVersion = "^19.2.0";
|
|
17
|
+
export declare const typesReactDomVersion = "^19.2.0";
|
|
18
|
+
export declare const testingLibraryReactNativeVersion = "~13.2.0";
|
|
19
|
+
export declare const reactTestRendererVersion = "^19.2.0";
|
|
20
|
+
export declare const reactNativeSvgTransformerVersion = "~1.5.1";
|
|
21
|
+
export declare const reactNativeSvgVersion = "~15.15.0";
|
|
22
|
+
export declare const reactNativeSvgWebVersion = "~1.0.9";
|
|
23
|
+
export declare const babelRuntimeVersion = "~7.27.6";
|
|
24
|
+
export type ReactNativeVersions = {
|
|
25
|
+
reactNativeVersion: string;
|
|
26
|
+
reactNativeBabelPresetVersion: string;
|
|
27
|
+
reactNativeMetroConfigVersion: string;
|
|
28
|
+
metroVersion: string;
|
|
29
|
+
reactNativeCommunityCliVersion: string;
|
|
30
|
+
reactNativeCommunityCliPlatformAndroidVersion: string;
|
|
31
|
+
reactNativeCommunityCliPlatformIosVersion: string;
|
|
32
|
+
};
|
|
33
|
+
export declare function versions(tree: Tree): ReactNativeVersions;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.babelRuntimeVersion = exports.reactNativeSvgWebVersion = exports.reactNativeSvgVersion = exports.reactNativeSvgTransformerVersion = exports.reactTestRendererVersion = exports.testingLibraryReactNativeVersion = exports.typesReactDomVersion = exports.typesReactVersion = exports.reactDomVersion = exports.reactVersion = exports.reactNativeWebVersion = exports.typesNodeVersion = exports.reactNativeCommunityCliPlatformIosVersion = exports.reactNativeCommunityCliPlatformAndroidVersion = exports.reactNativeCommunityCliVersion = exports.metroVersion = exports.reactNativeMetroConfigVersion = exports.reactNativeBabelPresetVersion = exports.reactNativeVersion = exports.minSupportedReactNativeVersion = exports.nxVersion = void 0;
|
|
4
|
+
exports.assertSupportedReactNativeVersion = assertSupportedReactNativeVersion;
|
|
5
|
+
exports.versions = versions;
|
|
6
|
+
const path_1 = require("path");
|
|
7
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
8
|
+
const semver_1 = require("semver");
|
|
9
|
+
exports.nxVersion = require((0, path_1.join)('@nx/react-native', 'package.json')).version;
|
|
10
|
+
// React Native's tiered support policy lists 0.85 and 0.84 as Active and 0.83 as
|
|
11
|
+
// End-of-Cycle. The plugin supports the 0.83–0.84 window for now (0.85 is a
|
|
12
|
+
// follow-up — it relocated its Jest preset to @react-native/jest-preset, which
|
|
13
|
+
// needs a separate generator change). Below 0.83 generators throw via
|
|
14
|
+
// assertSupportedReactNativeVersion.
|
|
15
|
+
exports.minSupportedReactNativeVersion = '0.83.0';
|
|
16
|
+
function assertSupportedReactNativeVersion(tree) {
|
|
17
|
+
(0, internal_1.assertSupportedPackageVersion)(tree, 'react-native', exports.minSupportedReactNativeVersion);
|
|
18
|
+
}
|
|
19
|
+
// Fresh-install constants point at the latest supported minor (0.84, Active line).
|
|
20
|
+
exports.reactNativeVersion = '~0.84.1';
|
|
21
|
+
exports.reactNativeBabelPresetVersion = '~0.84.1';
|
|
22
|
+
exports.reactNativeMetroConfigVersion = '~0.84.1';
|
|
23
|
+
exports.metroVersion = '~0.83.0';
|
|
24
|
+
exports.reactNativeCommunityCliVersion = '~20.1.0';
|
|
25
|
+
exports.reactNativeCommunityCliPlatformAndroidVersion = '~20.1.0';
|
|
26
|
+
exports.reactNativeCommunityCliPlatformIosVersion = '~20.1.0';
|
|
27
|
+
// Stable across the supported RN minors (0.83 and 0.84 both ship React 19.2).
|
|
28
|
+
exports.typesNodeVersion = '^22.0.0';
|
|
29
|
+
exports.reactNativeWebVersion = '~0.21.0';
|
|
30
|
+
exports.reactVersion = '^19.2.0';
|
|
31
|
+
exports.reactDomVersion = '^19.2.0';
|
|
32
|
+
exports.typesReactVersion = '^19.2.0';
|
|
33
|
+
exports.typesReactDomVersion = '^19.2.0';
|
|
34
|
+
exports.testingLibraryReactNativeVersion = '~13.2.0';
|
|
35
|
+
exports.reactTestRendererVersion = '^19.2.0';
|
|
36
|
+
exports.reactNativeSvgTransformerVersion = '~1.5.1';
|
|
37
|
+
exports.reactNativeSvgVersion = '~15.15.0';
|
|
38
|
+
exports.reactNativeSvgWebVersion = '~1.0.9';
|
|
39
|
+
exports.babelRuntimeVersion = '~7.27.6';
|
|
40
|
+
// latestVersions reuses the top-level exports so `import { reactNativeVersion }`
|
|
41
|
+
// stays valid for the fresh-install path while versions(tree).reactNativeVersion
|
|
42
|
+
// is the route-aware value.
|
|
43
|
+
const latestVersions = {
|
|
44
|
+
reactNativeVersion: exports.reactNativeVersion,
|
|
45
|
+
reactNativeBabelPresetVersion: exports.reactNativeBabelPresetVersion,
|
|
46
|
+
reactNativeMetroConfigVersion: exports.reactNativeMetroConfigVersion,
|
|
47
|
+
metroVersion: exports.metroVersion,
|
|
48
|
+
reactNativeCommunityCliVersion: exports.reactNativeCommunityCliVersion,
|
|
49
|
+
reactNativeCommunityCliPlatformAndroidVersion: exports.reactNativeCommunityCliPlatformAndroidVersion,
|
|
50
|
+
reactNativeCommunityCliPlatformIosVersion: exports.reactNativeCommunityCliPlatformIosVersion,
|
|
51
|
+
};
|
|
52
|
+
// Keyed by React Native MINOR — RN is on the 0.x line, so the major is always 0.
|
|
53
|
+
// 0.84 is the default (latestVersions); 0.83 is the one older supported lane.
|
|
54
|
+
const versionMap = {
|
|
55
|
+
83: {
|
|
56
|
+
reactNativeVersion: '~0.83.9',
|
|
57
|
+
reactNativeBabelPresetVersion: '~0.83.9',
|
|
58
|
+
reactNativeMetroConfigVersion: '~0.83.9',
|
|
59
|
+
metroVersion: '~0.83.0',
|
|
60
|
+
reactNativeCommunityCliVersion: '~20.0.0',
|
|
61
|
+
reactNativeCommunityCliPlatformAndroidVersion: '~20.0.0',
|
|
62
|
+
reactNativeCommunityCliPlatformIosVersion: '~20.0.0',
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
// Returns the install constants for the detected RN minor. Above the highest
|
|
66
|
+
// known minor (or when RN isn't installed) falls through to latest — no throw.
|
|
67
|
+
function versions(tree) {
|
|
68
|
+
const installedReactNativeVersion = (0, internal_1.getDeclaredPackageVersion)(tree, 'react-native');
|
|
69
|
+
if (!installedReactNativeVersion) {
|
|
70
|
+
return latestVersions;
|
|
71
|
+
}
|
|
72
|
+
return versionMap[(0, semver_1.minor)(installedReactNativeVersion)] ?? latestVersions;
|
|
73
|
+
}
|