Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stefanbuck/peer-version-check
Check whether every peerDependency is defined as a devDependency
https://github.com/stefanbuck/peer-version-check
checker cli cli-app devdependencies peerdependencies semantic semver version
Last synced: 3 months ago
JSON representation
Check whether every peerDependency is defined as a devDependency
- Host: GitHub
- URL: https://github.com/stefanbuck/peer-version-check
- Owner: stefanbuck
- Created: 2018-06-01T23:15:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-06-03T19:52:08.000Z (over 6 years ago)
- Last Synced: 2024-09-14T12:23:19.495Z (4 months ago)
- Topics: checker, cli, cli-app, devdependencies, peerdependencies, semantic, semver, version
- Language: JavaScript
- Homepage:
- Size: 55.7 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# peer-version-check [![Build Status](https://travis-ci.com/stefanbuck/peer-version-check.svg?branch=master)](https://travis-ci.com/stefanbuck/peer-version-check)
> Check whether every peerDependency is defined as a devDependency
As we all know, npm 3 changed to not install peerDependencies automatically. peerDependencies are still be useful and used by many package authors these days.
As a package author it's quite anoying during development that peerDependencies are not installed automacily anymore. There is an open feature request in the yarn repostiroy to [allow install peerDependencies during development](https://github.com/yarnpkg/yarn/issues/1503).
Recently one of my colleague suggested me to add them as devDependencies. Obviously duplicating is not the best solution, but it works. However there is a risk that they can get out of sync easily. To solve this issue, I wrote this CLI which checks if every peerDependency is defined as a devDependency with the same semver range.
## Install
```
$ npm install peer-version-check
```## Usage
### On travis-ci
```
before_script:
npx peer-version-check
```### Command line
```
$ peer-version-check (optional)
```## Example
```
$ peer-version-check ./package.jsonExpected devDependency 'lodash' to be:
^4.0.0
Found:
^3.0.0
```Exits with code 0 if every peerDependency is defined as a devDependency with the same semver range. If not exits with code 1 and an error message.
## Related
[Common npm mistakes](https://medium.com/@jacob.h.page/common-npm-mistakes-51bf8989079f) - Excellent article to read
## License
MIT © [Stefan Buck](http://stefanbuck.com)