-
Notifications
You must be signed in to change notification settings - Fork 141
Contributor Guide
This document collects various tips, conventions, and procedures that may be useful to Popcode contributors. In particular, any code review feedback that invokes a general principle should be accompanied by a section in this document (which will be expanded as demanded by that rule).
yarn’s dependency resolution algorithm often results in multiple versions of the same package being installed, even when there is one version that satisfies all constraints. The yarn-deduplicate tool is designed to mitigate this by operating on an existing yarn.lock file, merging together duplicate dependencies wherever possible. To run it in Popcode, run this:
$ yarn deduplicatePopcode’s CI includes a check for duplicate dependencies, and will fail if yarn deduplicate needs to be run.
If your pull request adds, updates, or removes package dependencies, it’s important that the changes to the yarn.lock file reflect the differences in package.json, and nothing more. Particularly in the case of a merge conflict with master, yarn will sometimes inadvertently upgrade unrelated package dependencies when auto-resolving the conflict.
The easiest way to ensure that the changes to yarn.lock are kept to the necessary minimum is to do this:
$ git checkout master -- yarn.lock
$ yarn install
$ yarn deduplicateIf you’re dealing with a merge conflict in the middle of a rebase, do this instead:
$ git checkout HEAD -- yarn.lock
$ yarn install
$ yarn deduplicate
$ git add yarn.lock
$ git rebase --continue