@@ -286,15 +286,23 @@ export async function extractPackageFile(
286
286
}
287
287
288
288
const githubBaseUrl = extraConfig . githubBaseUrl ;
289
- const deps = components . map ( ( v : CommodoreDependency ) => ( {
290
- depName : `${ v . name } in ${ fileName } ` ,
291
- packageName : v . url . startsWith ( githubBaseUrl )
292
- ? v . url . slice ( githubBaseUrl . length ) . replace ( / \. g i t $ / , '' )
293
- : v . url ,
294
- currentValue : v . version ,
295
- datasource : v . url . startsWith ( githubBaseUrl )
296
- ? githubRelease . GithubReleasesDatasource . id
297
- : gitRef . GitRefsDatasource . id ,
298
- } ) ) ;
289
+ const deps = components
290
+ . filter ( ( dep : CommodoreDependency ) => {
291
+ if ( dep . url !== undefined ) return true ;
292
+ logger . warn (
293
+ `Could not infer package for dependency: ${ dep . name } in ${ fileName } . Skipping package.`
294
+ ) ;
295
+ return false ;
296
+ } )
297
+ . map ( ( v : CommodoreDependency ) => ( {
298
+ depName : `${ v . name } in ${ fileName } ` ,
299
+ packageName : v . url ?. startsWith ( githubBaseUrl )
300
+ ? v . url . slice ( githubBaseUrl . length ) . replace ( / \. g i t $ / , '' )
301
+ : v . url ,
302
+ currentValue : v . version ,
303
+ datasource : v . url ?. startsWith ( githubBaseUrl )
304
+ ? githubRelease . GithubReleasesDatasource . id
305
+ : gitRef . GitRefsDatasource . id ,
306
+ } ) ) ;
299
307
return { deps } ;
300
308
}
0 commit comments