https://github.com/logzio/yarn-one-version-rule
Enforce the One Version Rule on yarn workspaces
https://github.com/logzio/yarn-one-version-rule
Last synced: 6 days ago
JSON representation
Enforce the One Version Rule on yarn workspaces
- Host: GitHub
- URL: https://github.com/logzio/yarn-one-version-rule
- Owner: logzio
- License: mit
- Created: 2020-12-01T13:36:31.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-01-12T07:44:10.000Z (over 3 years ago)
- Last Synced: 2025-05-30T13:42:40.911Z (17 days ago)
- Language: JavaScript
- Size: 88.9 KB
- Stars: 6
- Watchers: 7
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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 sharingMore info from google [The One Version Rule](https://opensource.google/docs/thirdparty/oneversion)
## Quick Start
```sh
npx yarn-one-version-rule
```## Global install
```sh
yarn add global yarn-one-version-ruleyarn-one-version-rule
```## Options
```
yarn-one-version-rule --helpOptions:
--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
```sh
npx yarn-one-version-rule --ignore=webpack --ignore=lodash
```### Example output
```sh
npx yarn-one-version-ruleyou 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/
```