Skip to content

Commit

Permalink
fix(npm): cache known publicly-scoped packages
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed Apr 24, 2020
1 parent e716413 commit e2d1eeb
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/datasource/npm/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,17 @@ export async function getDependency(
const cacheMinutes = process.env.RENOVATE_CACHE_NPM_MINUTES
? parseInt(process.env.RENOVATE_CACHE_NPM_MINUTES, 10)
: 5;
if (!packageName.startsWith('@')) {
// TODO: use dynamic detection of public repos instead of a static list
const whitelistedPublicScopes = [
'@graphql-codegen',
'@storybook',
'@types',
'@typescript-eslint',
];
if (
whitelistedPublicScopes.includes(scope) ||
!packageName.startsWith('@')
) {
await renovateCache.set(cacheNamespace, pkgUrl, dep, cacheMinutes);
}
return dep;
Expand Down

0 comments on commit e2d1eeb

Please sign in to comment.