diff --git a/.gitignore b/.gitignore index 59c88033c8..5519202f13 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ .eslintcache /node_modules /packages/*/node_modules/ +/private/*/node_modules/ +# yarn.lock is the source of truth, pnpm-lock.yaml is generated by `pnpm import` +pnpm-lock.yaml /coverage /reports npm-debug.log* diff --git a/README.md b/README.md index 4ecddd9069..827917e5ef 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,17 @@ Meta has adopted a Code of Conduct that we expect project participants to adhere Read our [contributing guide](https://github.com/react/metro/blob/main/CONTRIBUTING.md) to learn about our development process, how to propose bug fixes and improvements, and how to build and test your changes to Metro. +### Package managers + +Metro is developed with Yarn (v1), and `yarn.lock` is the source of truth for dependency versions - commit changes to `yarn.lock`, not `pnpm-lock.yaml`. + +pnpm is also supported, by generating a (git-ignored) `pnpm-lock.yaml` from `yarn.lock`: + +```sh +pnpm import +pnpm install --frozen-lockfile +``` + ### Discussions Larger discussions and proposals concerning React Native and Metro are discussed in [**@react-native-community/discussions-and-proposals**](https://github.com/react-native-community/discussions-and-proposals). diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 0000000000..50fb6c40c4 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,7 @@ +packages: + - packages/* + - private/* + +# Metro's packages depend on each other by exact version - link them locally +# rather than fetching them from npm. +linkWorkspacePackages: true