Comments (6)
I'm closing this for now, but would gladly merge a reasonable PR.
from check-peer-dependencies.
Hi! Thanks for making and supporting a really useful library!
My use case is somewhat similar to what was originally described, but a little more particular – I'd like to ignore, but also restrict the violations to a specific set of known violations. We're effectively creating an allow-list of exceptions, so we can ratchet down those exceptions over time.
For that I made a custom script that does what was originally described here, but a node API that returned strings and statuses (rather than console.log / process.exit) would be helpful for that purpose. I imagine this use case is a little bit too niche to support as cli arguments, but maybe a node API would be useful for it. I've similarly made do with using exec
and parsing the output in the meantime though, so it's not a blocker for us using this library.
from check-peer-dependencies.
likewise for use with renovate... there are certain peer dependencies that I would like to skip, and to fail for anything else...
For reference, here is the bash script I'm using at the moment:
#!/bin/bash
set -e
# Set allowed missing peer dependencies
ALLOWED_MISSING=(
"jquery"
"popper.js"
)
# Set allowed incorrect peer dependencies
ALLOWED_INCORRECT=(
)
# Perform check for peer dependencies
if ! PEERCHECK=$(yarn check-peer-dependencies --yarn 2>&1); then
# Gather packages that are not installed
mapfile -t MISSING < <((grep '❌' <<<"$PEERCHECK") | grep -oP '(?<=\()[^ \(]+(?= is not installed)')
for PACKAGE in ${!MISSING[*]}; do
# Check if the missing package is not allowed to be
if ! [[ ${ALLOWED_MISSING[*]} =~ ${MISSING[$PACKAGE]} ]]; then
# Show full output and error
printf "%s\n" "${PEERCHECK[*]}"
exit 1
fi
done
# Gather packages that are the wrong version
mapfile -t WRONGVERSION < <((grep '❌' <<<"$PEERCHECK") | grep -oP '(?<= is required by ).+(?=@[^ ]+ \([^ ]+ is installed)')
for PACKAGE in ${!WRONGVERSION[*]}; do
# Check if the missing package is not allowed to be
if ! [[ ${ALLOWED_INCORRECT[*]} =~ ${WRONGVERSION[$PACKAGE]} ]]; then
# Show full output and error
printf "%s\n" "${PEERCHECK[*]}"
exit 1
fi
done
fi
Edits: Updating bash script
from check-peer-dependencies.
likewise for use with renovate... there are certain peer dependencies that I would like to skip, and to fail for anything else...
I added a cli option --ignore pkg1 --ignore pkg2
in version 4.1.0
from check-peer-dependencies.
I added a cli option
--ignore pkg1 --ignore pkg2
in version 4.1.0
Oh nice! Thanks I will check it out.
from check-peer-dependencies.
@christopherthielen That new cli option works for me so I no longer need my bash script. Thanks.
from check-peer-dependencies.
Related Issues (20)
- Error exit code
- Unable to resolve package fsevents error (While using this tool from Windows)
- [Feature request] yarn 2 support HOT 2
- [Feature request] Workspaces support HOT 1
- [Feature request] whitelist HOT 4
- Print list of peer dependencies HOT 1
- --install installs everything as non-dev dependency HOT 3
- Method for determining the installed version fails
- [Docs] Specify which version of npm this is for HOT 1
- [Feature request] Fail command if peer deps are not met HOT 3
- [Feature Request] Ability to filter out dependencies
- [Feature request] Support npm `overrides`
- Unable to find a version
- Feature: support --cwd or --prefix in order to change the working directory
- Security Vulnerability: Request to Upgrade Outdated 'semver' package (Version bump)
- Opposite to `--ignore` option HOT 3
- Broken?
- [Feature request] Support toogle includePrerelease options
- Unable to resolve terser HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from check-peer-dependencies.