Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Contributing to the CLI

Jon Thysell edited this pageNov 11, 2024 ·34 revisions

Where stuff lives

Parts of the CLI:

  1. CLI Package: The commands that run withreact-native <command> are here:
    [Root]\packages\@react-native-windows\cli
  2. Template files used withreact-native init-windows can be found here:
    [Root]\vnext\templates

Testing local changes to RNW or its CLI commands on existing in-repo projects

If you've made local changes to your RNW repo, or to one of the CLI commands (such asreact-native run-windows,react-native autolink-windows, etc.), the easiest way to do so is to test one of the many RNW apps already existing in the repo, such aspackages/e2e-test-app orpackages/sample-app-fabric.

If you want to debug a CLI command as it runs, you can do so by running the command in a new "JavaScript Debug Terminal" in VSCode.

Testing local changes to RNW or its CLI commands on a new project

SeeCreating new projects to test specific RNW versions, specificallyUsing your local RNW repo.

Again, if you want to debug a CLI command as it runs, you can do so by running the command in a new "JavaScript Debug Terminal" in VSCode.

Testingreact-native-windows-init on older projects (RNW < 0.75)

If you are making local changes to the oldreact-native-windows-init code, you can build and run it locally:

  1. Build thereact-native-windows-init package (packages/react-native-windows-init) locally usingyarn build`
  2. Manually call into the CLI by usingnode <root>\packages\react-native-windows-init\bin.js [...] rather than callingnpx react-native-windows-init [...]

Note, you can pass parameters to that as usual, or usenode --inspect-brk ... to allow you to attach to the call using VSCode.

Also note that this willonly test the changes made directly to thereact-native-windows-init package. The other packages will be downloaded from npmjs.org (according to the version you specified with--version) during the process.

Note: If you want to test local changes to RNW or its CLI commands on projects you want to create usingreact-native-windows-init, you'll need to use the--devMode option when running that command. Sincereact-native-windows-init takes responsibility for callingyarn add react-native-windows, the--devMode option will tell the script to also callyarn link on your behalf too. Note this only works for classic Yarn and still requires you to register your repo withyarn link in yourvnext folder.

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp