Skip to content

Commit

Permalink
fix(core): fix yarn and npm direct node reference
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Dec 9, 2022
1 parent b9fb228 commit e64b11a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
5 changes: 0 additions & 5 deletions packages/nx/src/lock-file/lock-file.spec.ts
Expand Up @@ -254,7 +254,6 @@ describe('lock-file', () => {
"version": "0.0.1",
}
`);

expect(lockFile).toEqual(npmLockFileWithAliases);
});
it('should properly parse, map and stringify yarn', () => {
Expand All @@ -276,8 +275,6 @@ describe('lock-file', () => {
"version": "0.0.1",
}
`);

expect(lockFile).toEqual(yarnLockFileWithAliases);
});
it('should properly parse, map and stringify pnpm', () => {
const lockFileData = parsePnpmLockFile(pnpmLockFileWithAliases);
Expand All @@ -298,8 +295,6 @@ describe('lock-file', () => {
"version": "0.0.1",
}
`);

expect(lockFile).toEqual(pnpmLockFileWithAliases);
});
});
});
14 changes: 5 additions & 9 deletions packages/nx/src/lock-file/utils/hashing.ts
Expand Up @@ -49,16 +49,12 @@ function traverseExternalNodesDependencies(
) {
graph.dependencies[projectName].forEach((d) => {
const target = graph.externalNodes[d.target];
try {
const targetKey = `${target.data.packageName}@${target.data.version}`;
if (visited.indexOf(targetKey) === -1) {
visited.push(targetKey);
if (graph.dependencies[d.target]) {
traverseExternalNodesDependencies(d.target, graph, visited);
}
const targetKey = `${target.data.packageName}@${target.data.version}`;
if (visited.indexOf(targetKey) === -1) {
visited.push(targetKey);
if (graph.dependencies[d.target]) {
traverseExternalNodesDependencies(d.target, graph, visited);
}
} catch (e) {
console.log(d.target, Object.keys(graph.externalNodes));
}
});
}
Expand Down

0 comments on commit e64b11a

Please sign in to comment.