-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Health report of package.json
for CI use
#1
Merged
Merged
Conversation
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
51050b1
to
08c5b8c
Compare
- parse package.json - fetch peer dependencies online - check if there are mismatches in peers - keep things testable via functional
08c5b8c
to
72c254e
Compare
Instead of looping twice over the dependencies, check whether they are satisfied via the registry call directly based on minimum range version or optional.
eb65f0e
to
ce37682
Compare
add more breathing room to CLI output
2610bd6
to
6e6735f
Compare
6e6735f
to
c79fa64
Compare
Ran a benchmark to compare parsing `typescript` and the results are incredible: - registry.npmjs.org ~ 75ms - unpkg.com ~ 150 µs (0.15ms) Instead of getting all possible versions of a package, it’s best to target a specific version directly.
package.json
package.json
for CI use
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
Adds a new script that audits a
package.json
file:dependencies
,devDependencies
andpeerDependencies
.In the future it could also:
peerDependencies
do not have a matching pinneddevDependencies
to the minimum matching the rangedevDependencies
peerDependencies
are mismatched@types/*
dependencies that are mismatchedBuilds on the ideas in guardian/dotcom-rendering#7003
How to test
Run the following script:
How can we measure success?
Less mismatched dependencies, no duplicate dependencies.
Have we considered potential risks?
There could be false positives or negatives if this is not done this right, which would prevent adoption.
Images