Detalhes do pacote

check-peer-dependencies

christopherthielen142kMIT4.3.0

Checks peer dependencies of the current package. Offers solutions for any that are unmet.

nodejs, install, peer, dependencies

readme (leia-me)

check-peer-dependencies

Checks peer dependencies of the current NodeJS package. Offers solutions for any that are unmet.

This utility will recursively find all peerDependencies in your project's dependencies list. It checks if you have installed a package that meets the required peer dependency versions. If any peer dependencies are unmet, it will search for a compatible version to install.

Note: you must run npm install or yarn first in order to install all normal dependencies.

usage:

npx check-peer-dependencies [--yarn|--npm] [--install] [--help]

Options:

  -h, --help                       Print usage information             [boolean]
      --version                    Show version number                 [boolean]
      --yarn                       Force yarn package manager          [boolean]
      --npm                        Force npm package manager           [boolean]
      --orderBy                    Order the output by depender or dependee
                         [choices: "depender", "dependee"] [default: "dependee"]
      --debug                      Print debugging information
                                                      [boolean] [default: false]
      --verbose                    Prints every peer dependency, even those that
                                   are met            [boolean] [default: false]
      --ignore                     package name to ignore (may specify multiple)
                                                           [array] [default: []]
      --runOnlyOnRootDependencies  Run tool only on package root dependencies
                                                      [boolean] [default: false]
      --findSolutions              Search for solutions and print package
                                   installation commands
                                                      [boolean] [default: false]
      --install                    Install missing or incorrect peerDependencies
                                                      [boolean] [default: false]

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.

{
  "name": "somepackage",
  "peerDependencies": {
    "react": "16.x",
    "react-dom": "16.x",
    "typescript": "~3.8.0",
    "eslint": "*"
  },
  "peerDevDependencies": ["typescript", "eslint"]
}

Example outputs:

No problems

~/projects/uirouter/sample-app-react master
❯ npx check-peer-dependencies
✅  All peer dependencies are met

Missing peer dependency, solution found

~/projects/uirouter/angular-hybrid master ⇣
❯ npx check-peer-dependencies
❌  @uirouter/angular@5.0.0 requires @angular/router ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (@angular/router is not installed)

Searching for solutions:
yarn add @angular/router@8.2.10

Incorrect peer dependencies, some solutions found

❯ npx check-peer-dependencies
❌  @uirouter/angular@5.0.0 requires @angular/common ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (9.0.0-next.9 is installed)
❌  @uirouter/angular@5.0.0 requires @angular/core ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (9.0.0-next.9 is installed)
❌  @uirouter/angular@5.0.0 requires @angular/router ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 (9.0.0-next.9 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
❌  Unable to find a version of @angular/core that satisfies the following peerDependencies: 9.0.0-next.9 and ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0

yarn upgrade @angular/router@8.2.10

changelog (log de mudanças)

4.3.0 (2023-10-17)

Compare check-peer-dependencies versions 4.2.0 and 4.3.0

Bug Fixes

  • non-satisfied optional dependency should fail (7d43b0d)

4.2.0 (2023-03-13)

Compare check-peer-dependencies versions 4.1.0 and 4.2.0

Bug Fixes

  • Install peer deps as devDependencies if the peer dep came from a dev dependency (6ef3021), closes #21
  • Method for determining the installed version fails #27 (8058585)

4.1.0 (2021-11-28)

Compare check-peer-dependencies versions 4.0.0 and 4.1.0

Features

  • Add support for ignoring peer dependencies (via cli option or config stored in package.json) (5994c9c)
  • load checkPeerDependencies config from package.json (and merge with CLI options) (e2f0fee)

4.0.0 (2020-12-27)

Compare check-peer-dependencies versions 3.1.0 and 4.0.0

Features

  • prerelease: include prerelease when matching ranges, i.e. the range ">=6.0.0" matches "7.0.0-beta.1" (0493379)

BREAKING CHANGES

  • prerelease: Matches prerelease versions

3.1.0 (2020-12-23)

Compare check-peer-dependencies versions 3.0.0 and 3.1.0

Features

3.0.0 (2020-12-22)

Compare check-peer-dependencies versions 2.0.6 and 3.0.0

Features

  • findSolutions: Add a toggle to find solutions and print installation commands. (c34735a)
  • orderBy: Change default orderBy to 'dependee' (e77e069)
  • report: For a given unmet peer dependency, show every related peer dependency, even if currently met (516a259)

BREAKING CHANGES

  • orderBy: default order changed from 'depender' to 'dependee'
  • findSolutions: no longer prints installation commands by default, instead prints a message about using --install

2.0.6 (2020-09-20)

Compare check-peer-dependencies versions 2.0.5 and 2.0.6

Bug Fixes

  • Ignore missing optionalDependencies (25a89a7)

2.0.5 (2020-09-19)

Compare check-peer-dependencies versions 2.0.3 and 2.0.5

Features

  • Add an option to run tool in consumer package root dependencies only. (#7) (cd8f75a)

2.0.4 (2020-09-19)

Compare check-peer-dependencies versions 2.0.3 and 2.0.4

Features

  • Add an option to run tool in consumer package root dependencies only. (#7) (cd8f75a)

2.0.3 (2020-09-06)

Compare check-peer-dependencies versions 2.0.2 and 2.0.3

Bug Fixes

  • print warning if dependency path is not found instead of erroring. This allows optional dependencies to be ignored. (37c0296)

2.0.2 (2020-05-25)

Compare check-peer-dependencies versions 2.0.1 and 2.0.2

Bug Fixes

  • peerDevDependencies: Make peerDevDependency includes check a bit safer (2a1a183)
  • walkPackageDependency: only walk dev deps for the root package (e69c385)

Features

  • walkPackageDependencyTree: Check devDependencies too (9eba197)

2.0.1 (2020-04-10)

Compare check-peer-dependencies versions 2.0.0 and 2.0.1

Bug Fixes

  • peerDevDependencies: Use an array of package names in 'peerDevDependencies' in conjunction with the standard 'peerDependencies' object to install peer deps as devDependencies. (681a80b)

2.0.0 (2020-04-10)

Compare check-peer-dependencies versions 1.0.11 and 2.0.0

Features

  • peerDevDependencies: Add support for 'peerDevDependencies' -- 'peerDependencies' that should be installed as 'devDependencies' (47d40ef)

1.0.11 (2020-03-16)

Compare check-peer-dependencies versions 1.0.10 and 1.0.11

feat: Exit with exit code 1 if unmet peer dependencies are detected

1.0.10 (2020-03-03)

Compare check-peer-dependencies versions 1.0.9 and 1.0.10

Features

  • verbose: Turn off verbose logging by default (04cde8a)

1.0.9 (2019-12-31)

Compare check-peer-dependencies versions 1.0.8 and 1.0.9

Features

  • debug: Added a --debug cli flag (862232e)
  • orderBy: Added a --orderBy cli flag (9e7b8af)

1.0.8 (2019-12-27)

Compare check-peer-dependencies versions 1.0.7 and 1.0.8

Bug Fixes

  • Revert fix for breaking change in resolve package after they reverted the breaking change itself. (d25c43a)

1.0.7 (2019-11-25)

Compare check-peer-dependencies versions 1.0.6 and 1.0.7

Bug Fixes

  • Update packageFilter for breaking change in resolve package (15ade47)

1.0.6 (2019-11-25)

Compare check-peer-dependencies versions 1.0.5 and 1.0.6

Features

  • sort peer dependencies by depender package name first (3d656a6)
  • when recursively installing peer deps, don't re-process previously unmet peer deps (ce9fe3e)

1.0.5 (2019-11-24)

Compare check-peer-dependencies versions 1.0.4 and 1.0.5

Features

  • Recursively check for new unmet peer dependencies after installing when using --install (b632efb)

1.0.4 (2019-10-26)

Compare check-peer-dependencies versions 1.0.3 and 1.0.4

Bug Fixes

  • handle recursive package dependencies when walking package deps (87f6e99)

1.0.3 (2019-10-26)

Compare check-peer-dependencies versions 1.0.2 and 1.0.3

Features

  • findPossibleResolutions: Log error message if there is a problem parsing npm view output (a46c673)

1.0.2 (2019-10-15)

Compare check-peer-dependencies versions 1.0.1 and 1.0.2

Features

  • Add better support for packages installed via yalc (15af2ac)

1.0.1 (2019-10-15)

1.0.1

Features

  • add whitespace to output around package manager commands (cdd56ed)

1.0.0 (2019-10-14)

Initial release