-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(peerDevDependencies): Use an array of package names in 'peerDevDe…
…pendencies' in conjunction with the standard 'peerDependencies' object to install peer deps as devDependencies. This now acts more as an extension of thstandard node packaging rather than adding completely custom behavior. Also removed check-peer-dependencies-optional-dependency because its postinstall script only gets runs when check-peer-dependencies-optional-dependency package is re-installed. So it was basically a failed experiment.
- Loading branch information
1 parent
8035295
commit 681a80b
Showing
7 changed files
with
71 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,34 +26,41 @@ Options: | |
|
||
--- | ||
|
||
## Installing peerDependencies as devDependencies | ||
|
||
If a package has a peerDependency that should be installed as a devDependency by, | ||
it can list the package name in "peerDevDependencies". | ||
This is not a standard and is only understood by this `check-peer-dependencies`. | ||
|
||
```json | ||
{ | ||
"name": "somepackage", | ||
"peerDependencies": { | ||
"react": "16.x", | ||
"react-dom": "16.x", | ||
"typescript": "~3.8.0", | ||
"eslint": "*" | ||
}, | ||
"peerDevDependencies": ["typescript", "eslint"] | ||
} | ||
``` | ||
|
||
## Example outputs: | ||
|
||
### No problems | ||
|
||
```bash | ||
~/projects/uirouter/sample-app-react master | ||
❯ npx check-peer-dependencies | ||
✅ @uirouter/[email protected] requires @uirouter/core >=5.0.0 (5.0.23 is installed) | ||
✅ [email protected] requires ajv ^6.9.1 (6.10.2 is installed) | ||
✅ @uirouter/[email protected] requires react ^16.3.0 (16.10.1 is installed) | ||
✅ [email protected] requires react ^16.0.0 (16.10.1 is installed) | ||
✅ [email protected] requires webpack ^2.0.0 || ^3.0.0 || ^4.0.0 (4.39.1 is installed) | ||
No problems found! | ||
✅ All peer dependencies are met | ||
``` | ||
|
||
### Missing peer dependency, solution found | ||
|
||
```bash | ||
~/projects/uirouter/angular-hybrid master ⇣ | ||
❯ npx check-peer-dependencies | ||
✅ @uirouter/[email protected] requires @angular/common ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (5.2.11 is installed) | ||
✅ @uirouter/[email protected] requires @angular/core ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (5.2.11 is installed) | ||
❌ @uirouter/[email protected] requires @angular/router ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (@angular/router is not installed) | ||
✅ @uirouter/[email protected] requires @angular/upgrade ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (5.2.11 is installed) | ||
✅ @uirouter/[email protected] requires @uirouter/core >=6.0.1 (6.0.1 is installed) | ||
✅ @uirouter/[email protected] requires angular ^1.5.0 (1.7.8 is installed) | ||
✅ @uirouter/[email protected] requires angular >=1.2.0 (1.7.8 is installed) | ||
✅ @uirouter/[email protected] requires rxjs ^6.0.0 (6.5.3 is installed) | ||
|
||
Searching for solutions: | ||
yarn add @angular/[email protected] | ||
|
@@ -63,21 +70,9 @@ yarn add @angular/[email protected] | |
|
||
```bash | ||
❯ npx check-peer-dependencies | ||
✅ @angular/[email protected] requires @angular/common 9.0.0-next.9 (9.0.0-next.9 is installed) | ||
❌ @uirouter/[email protected] requires @angular/common ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (9.0.0-next.9 is installed) | ||
✅ @angular/[email protected] requires @angular/compiler 9.0.0-next.9 (9.0.0-next.9 is installed) | ||
✅ @angular/[email protected] requires @angular/core 9.0.0-next.9 (9.0.0-next.9 is installed) | ||
❌ @uirouter/[email protected] requires @angular/core ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (9.0.0-next.9 is installed) | ||
✅ @angular/[email protected] requires @angular/platform-browser 9.0.0-next.9 (9.0.0-next.9 is installed) | ||
❌ @uirouter/[email protected] requires @angular/router ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (9.0.0-next.9 is installed) | ||
✅ @uirouter/[email protected] requires @uirouter/core >=6.0.1 (6.0.1 is installed) | ||
✅ @uirouter/[email protected] requires @uirouter/core >=5.0.0 (6.0.1 is installed) | ||
✅ [email protected] requires ajv ^6.0.0 (6.10.2 is installed) | ||
✅ @angular/[email protected] requires rxjs ^6.5.3 (6.5.3 is installed) | ||
✅ @uirouter/[email protected] requires rxjs ^6.0.0 (6.5.3 is installed) | ||
✅ [email protected] requires typescript >=1.8.0 <2.1.0 || >=1.9.0-dev || >=2.0.0-dev || || >=2.1.0-dev (3.5.3 is installed) | ||
✅ [email protected] requires webpack ^2.0.0 || ^3.0.0 || ^4.0.0 (4.41.0 is installed) | ||
✅ @angular/[email protected] requires zone.js ~0.10.2 (0.10.2 is installed) | ||
|
||
Searching for solutions: | ||
❌ Unable to find a version of @angular/common that satisfies the following peerDependencies: 9.0.0-next.9 and ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 | ||
|
@@ -86,6 +81,3 @@ Searching for solutions: | |
yarn upgrade @angular/[email protected] | ||
``` | ||
|
||
## Running as postinstall script using `yarn` package manager | ||
|
||
Please see [check-peer-dependencies-optional-dependency](https://github.com/christopherthielen/check-peer-dependencies/tree/master/packages/check-peer-dependencies-optional-dependency) |
36 changes: 0 additions & 36 deletions
36
packages/check-peer-dependencies-optional-dependency/README.md
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
packages/check-peer-dependencies-optional-dependency/package.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters