[wp-trac] [WordPress Trac] #40421: Commit or ignore `yarn.lock` file
WordPress Trac
noreply at wordpress.org
Wed Apr 12 13:56:40 UTC 2017
#40421: Commit or ignore `yarn.lock` file
------------------------------+-----------------------------
Reporter: jnylen0 | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Build/Test Tools | Version:
Severity: normal | Keywords:
Focuses: |
------------------------------+-----------------------------
For purposes of version control, we should do something with `yarn.lock`
in the root of the WP dev repository. [https://yarnpkg.com/en/ yarn] is a
much faster, more robust, and backwards-compatible alternative to `npm
install` which I have started using for Node.js projects. There are a lot
of benefits over `npm` which are detailed on [https://yarnpkg.com/en/ the
project's front page]. The main reason I use it is that it's many times
faster than `npm install`.
Unlike `npm`, `yarn` by default stores a list of the exact versions of all
dependencies expected to be installed. This is a good way to avoid
breakage if a package is updated with a bug, but still falls within the
version range expected by `npm`.
This version information is stored in the `yarn.lock` file after you run
`yarn`. There are two options for how to deal with this file and proceed
with this ticket: '''commit''' this file, or '''ignore''' it.
If we are interested in taking steps towards '''migrating to `yarn`''',
which I personally would like to see, then we should '''commit this
file'''. This does not impose a requirement that people start to use
`yarn`, rather it merely provides additional benefits if you do
(deterministic installs including all versions of sub-dependencies).
Alternatively, ignoring `yarn.lock` does not create any kind of
expectation that people must use `yarn` instead of `npm install`, though
personally I would recommend it. This will allow people to continue using
`yarn` if they wish, with a clean source tree.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40421>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list