fetch-yarn-deps: handle yarn.lock deps without a resolved url
This commit is contained in:
parent
d544d8d66c
commit
2400268a38
@ -12,6 +12,15 @@ const fixupYarnLock = async (lockContents, verbose) => {
|
|||||||
const fixedData = Object.fromEntries(
|
const fixedData = Object.fromEntries(
|
||||||
Object.entries(lockData.object)
|
Object.entries(lockData.object)
|
||||||
.map(([dep, pkg]) => {
|
.map(([dep, pkg]) => {
|
||||||
|
if (pkg.resolved === undefined) {
|
||||||
|
console.warn(`no resolved URL for package ${dep}`)
|
||||||
|
var maybeFile = dep.split("@", 2)[1]
|
||||||
|
if (maybeFile.startsWith("file:")) {
|
||||||
|
console.log(`Rewriting URL for local file dependency ${dep}`)
|
||||||
|
pkg.resolved = maybeFile
|
||||||
|
}
|
||||||
|
return [dep, pkg]
|
||||||
|
}
|
||||||
const [ url, hash ] = pkg.resolved.split("#", 2)
|
const [ url, hash ] = pkg.resolved.split("#", 2)
|
||||||
|
|
||||||
if (hash || url.startsWith("https://codeload.github.com")) {
|
if (hash || url.startsWith("https://codeload.github.com")) {
|
||||||
|
Loading…
Reference in New Issue
Block a user