Skip to content

fix(react-native): app creation should sync deps#31839

Merged
xiongemi merged 1 commit intomasterfrom
fix-react-native-start
Jul 15, 2025
Merged

fix(react-native): app creation should sync deps#31839
xiongemi merged 1 commit intomasterfrom
fix-react-native-start

Conversation

@xiongemi
Copy link
Copy Markdown
Contributor

@xiongemi xiongemi commented Jul 6, 2025

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-install after, it will work right away.

Related Issue(s)

Fixes #

@xiongemi xiongemi requested a review from a team as a code owner July 6, 2025 00:30
@xiongemi xiongemi requested a review from Coly010 July 6, 2025 00:30
@vercel
Copy link
Copy Markdown

vercel Bot commented Jul 6, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
nx-dev ✅ Ready (Inspect) Visit Preview Jul 15, 2025 6:17am

@nx-cloud
Copy link
Copy Markdown
Contributor

nx-cloud Bot commented Jul 6, 2025

View your CI Pipeline Execution ↗ for commit f3d4eff

Command Status Duration Result
nx affected --targets=lint,test,build,e2e,e2e-c... ✅ Succeeded 1m 12s View ↗
nx run-many -t check-imports check-commit check... ✅ Succeeded 13s View ↗
nx-cloud record -- nx-cloud conformance:check ✅ Succeeded 2s View ↗
nx-cloud record -- nx format:check ✅ Succeeded 4s View ↗
nx-cloud record -- nx sync:check ✅ Succeeded 3s View ↗
nx documentation ✅ Succeeded 33s View ↗
nx affected -t e2e-macos-local --parallel=1 --b... ✅ Succeeded 16m 24s View ↗

☁️ Nx Cloud last updated this comment at 2025-07-15 06:27:50 UTC

Comment thread packages/react-native/src/generators/application/application.ts Outdated
Comment thread packages/react-native/src/generators/application/application.ts
@xiongemi xiongemi requested a review from Copilot July 15, 2025 05:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 addSyncDepsTask and addPodInstallTask functions.
  • 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.name but this task uses options.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.name for the command but the rest of the code uses options.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`,

Comment thread packages/react-native/src/generators/application/application.ts Outdated
Comment thread e2e/react-native/src/react-native.test.ts
@xiongemi xiongemi force-pushed the fix-react-native-start branch from 7dddd6d to caa733d Compare July 15, 2025 05:49
@xiongemi xiongemi merged commit 1f56ead into master Jul 15, 2025
8 checks passed
@xiongemi xiongemi deleted the fix-react-native-start branch July 15, 2025 14:48
ndcunningham pushed a commit that referenced this pull request Jul 15, 2025
<!-- 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 #
@github-actions
Copy link
Copy Markdown
Contributor

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.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jul 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants