Repository navigation
exclude same-scope dependencies from the dependency scoring check - #2939
Conversation
There was a problem hiding this comment.
We don't want to apply this tweak globally, since the dependencies data is used in multiple places.
Only the check logic in https://github.com/react-native-community/directory/blob/main/util/scoring.ts should be updated.
|
Thanks, makes sense. The count also drives the card, sorting and stats, so I'll leave it alone. One snag: the scoring check only gets
I'd go with 1. Which do you prefer? |
|
Let's go with an additional field for same scope dependencies count, and make it an optional, so we do not store 2k+ keys with Also, let's remove mocked test, we test things using local data present in repository instead, so we can see the impact on whole data set, not only on once case in isolation. |
Simek
left a comment
There was a problem hiding this comment.
Thanks for the quick update! 🙏 Tested the changes locally locally, LGTM! 🚀
Why & how
Fixes #2871
The "Has a lot of dependencies" check now ignores dependencies from the package's own npm scope. The stored
dependenciescount is unchanged, so the card, sorting, statistics and API still show the raw total.scripts/fetch-github-data.tscounts dependencies that share the package scope and stores them as an optionalgithub.stats.sameScopeDependencies, written only when greater than zero.util/scoring.tsusesdependencies - sameScopeDependencies > 25. Entries without the field score as before.types/index.tsadds the optional field.assets/data.jsonnow hassameScopeDependencieson the 141 scoped packages that have same-scope dependencies, withdependenciesrefreshed on those entries so the pair is consistent. I did not refresh other stats, to keep the data diff to the new field. Across the data set, only@impulse-ui-native/toolkitchanges score: all 35 of its dependencies are@impulse-ui-native/*, so it loses the penalty and goes from 20 to 30. Every other package with more than 25 dependencies keeps it.Checklist