fix(react-native): app creation should sync deps#31839
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
View your CI Pipeline Execution ↗ for commit f3d4eff
☁️ Nx Cloud last updated this comment at |
There was a problem hiding this comment.
Pull Request Overview
This PR ensures that React Native application generators always synchronize dependencies and set up Pod install tasks, regardless of the install option.
- Extracts dependency sync and Pod install logic into
addSyncDepsTaskandaddPodInstallTaskfunctions. - Always enqueues both sync-deps and pod-install callbacks during app generation.
- Adds E2E tests to verify that generated apps have React and React Native dependencies.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/react-native/src/generators/application/application.ts | Refactored inline syncDeps and runPodInstall into dedicated task functions. |
| e2e/react-native/src/react-native.test.ts | Added a test to confirm dependencies are synced in the generated app. |
| e2e/react-native/src/react-native-legacy.test.ts | Added a legacy-path test for dependency synchronization. |
Comments suppressed due to low confidence (2)
packages/react-native/src/generators/application/application.ts:162
- The original inline code used
options.namebut this task usesoptions.projectName. Ensure consistency between the two properties or consolidate to a single field to avoid mismatches.
options.projectName,
packages/react-native/src/generators/application/application.ts:183
- This log uses
options.namefor the command but the rest of the code usesoptions.projectName. Align on the same property so the suggested CLI command matches.
`run 'nx run ${options.name}:pod-install' to install native modules before running iOS app`,
7dddd6d to
caa733d
Compare
caa733d to
f3d4eff
Compare
<!-- Please make sure you have read the submission guidelines before posting an PR --> <!-- https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr --> <!-- Please make sure that your commit message follows our format --> <!-- Example: `fix(nx): must begin with lowercase` --> <!-- If this is a particularly complex change or feature addition, you can request a dedicated Nx release for this pull request branch. Mention someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they will confirm if the PR warrants its own release for testing purposes, and generate it for you if appropriate. --> <!-- This is the behavior we have today --> currently, when options.install=true (need to do pod install), it only syncs deps. <!-- This is the behavior we should expect with the changes in this PR --> make it sync deps regardless of options.install, so when developers choose to run `pod-install` after, it will work right away. <!-- Please link the issue being fixed so it gets closed when this is merged. --> Fixes #
|
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
Current Behavior
currently, when options.install=true (need to do pod install), it only syncs deps.
Expected Behavior
make it sync deps regardless of options.install, so when developers choose to run
pod-installafter, it will work right away.Related Issue(s)
Fixes #