yarn-one-version-rule

0.0.9 • Public • Published

yarn-one-version-rule

Enforce the One Version Rule when working wth yarn workspaces.
When working with a monorepo, you want to have one version for each 3rd party package you import.
The benefits are:

  1. reducing collisions on runtime when importing two versions of the same package.
  2. reduce installation and fetching time
  3. having only one specific version is easier when working on a big monreporo, in terms of a concise api and knowledge sharing

More info from google The One Version Rule

Quick Start

npx yarn-one-version-rule

Global install

yarn add global yarn-one-version-rule

yarn-one-version-rule

Options

yarn-one-version-rule --help

Options:
      --version  Show version number                                   [boolean]
  -i, --ignore   list of packages to ignore in case of conflict          [array]
  -r, --root     the root dir of your workspaces                        [string]
  -v, --verbose  log extra info                                        [boolean]
  -h, --help     Show help                                             [boolean]

Ignore certain packages

npx yarn-one-version-rule --ignore=webpack --ignore=lodash

Example output

npx yarn-one-version-rule

you have several declarations of packages with different versions
package: @babel/runtime have multiple version declarations ^7.7.7, 7.12.1
package: inquirer have multiple version declarations 7.3.3, 6.3.1
package: ts-loader have multiple version declarations 6.2.2, 8.0.11
more about the "One Version Rule" https://opensource.google/docs/thirdparty/oneversion/

Dependents (0)

Package Sidebar

Install

npm i yarn-one-version-rule

Weekly Downloads

9

Version

0.0.9

License

MIT

Unpacked Size

7.56 kB

Total Files

8

Last publish

Collaborators

  • alonmiz