Skip to content

Update creaternw scripts to use RNW devDependencies #14491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 7, 2025

Conversation

jonthysell
Copy link
Contributor

@jonthysell jonthysell commented Apr 4, 2025

Description

The new creaternwapp.cmd and creaternwlib.cmd scripts have an issue where new RN projects won't use the range qualifier in peerDependencies (so you ask for react-native@^0.74.0 and you get react-native@0.74.0 even though react-native@0.74.5 exists).

This PR fixes the script to, when determining which react and react-native version to use, to look at react-native-windows's devDependency, which is more reliable than the peerDependency.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Why

Unexpectedly having the wrong RN project version causes all sorts of build issues and confusion, and is easy to miss.

What

See above.

Screenshots

N/A

Testing

Verfied it works for new projects.

Changelog

Should this change be included in the release notes: no

Microsoft Reviewers: Open in CodeFlow

@jonthysell jonthysell requested review from a team as code owners April 4, 2025 23:02
@jonthysell jonthysell enabled auto-merge (squash) April 4, 2025 23:03
@jonthysell jonthysell added the Workstream: Developer Experience Support the RNW developer inner-loop. label Apr 4, 2025
@jonthysell jonthysell disabled auto-merge April 4, 2025 23:03
@jonthysell jonthysell enabled auto-merge (squash) April 4, 2025 23:03
@jonthysell jonthysell merged commit 96b0e0b into microsoft:main Apr 7, 2025
60 checks passed
@jonthysell jonthysell deleted the fixcreatescripts branch April 9, 2025 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Workstream: Developer Experience Support the RNW developer inner-loop.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants