Skip to content

Commit

Permalink
fix(core): improve yarn external node dependencies mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Nov 7, 2022
1 parent 6f8add5 commit 1f29250
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ Array [
exports[`lock-file mapLockFileDataToExternalNodes yarn should map successfully complex lock file 1`] = `
Object {
"data": Object {
"hash": "1e61b9db38c17534ce427d40ce84f9c03b4c439253f659e9a48513a10a52b465",
"hash": "6562d56c136e9e359c74fb6843da8deb66890de8e61e49ee766ad9cee2be6878",
"packageName": "nx",
"version": "14.7.5",
},
Expand Down
13 changes: 3 additions & 10 deletions packages/nx/src/utils/lock-file/yarn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,9 @@ export function transitiveDependencyYarnLookup(
return version;
}

// const nestedVersion = Object.values(versions).find((v) =>
// v.packageMeta.some(p => p.path.indexOf(`${parentPackage}/node_modules/${packageName}`) !== -1));

// if (nestedVersion) {
// return nestedVersion.version;
// }

// otherwise search for the matching version
return Object.values(versions).find((v) => satisfies(v.version, version))
?.version;
return Object.values(versions).find((v) =>
v.packageMeta.some((p) => p === `${packageName}@${version}`)
).version;
}

/**
Expand Down

0 comments on commit 1f29250

Please sign in to comment.