Skip to content
This repository was archived by the owner on Dec 4, 2022. It is now read-only.

Commit 6cd2d87

Browse files
amitgilad3GiladShoham
authored andcommitted
fix dependecies with dot in them (#51)
1 parent 7fe25e6 commit 6cd2d87

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
88
## [unreleased]
99

1010
- support link-files with "export { default as ... }"; syntax
11+
- fix merge of madge dependencies with package.json depdencies with dot in them
1112

1213
## [0.10.13] - 2018-03-21
1314

src/dependency-builder/build-tree.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export function resolveNodePackage(cwd: string, packageFullPath: string): Object
9696
if (packageJsonInfo) {
9797
// The +1 is for the / after the node_modules, we didn't enter it into the NODE_MODULES const because it makes problems on windows
9898
const packageRelativePath = packageFullPath.substring(packageFullPath.lastIndexOf(NODE_MODULES) + NODE_MODULES.length + 1, packageFullPath.length);
99-
99+
100100
const packageName = resolvePackageNameByPath(packageRelativePath);
101101
const packageVersion = R.path(['dependencies', packageName], packageJsonInfo) ||
102102
R.path(['devDependencies', packageName], packageJsonInfo) ||
@@ -397,7 +397,7 @@ export async function getDependencyTree(baseDir: string, consumerPath: string, f
397397
groups.forEach((fileDep) => {
398398
if (fileDep.packages && fileDep.packages.includes(pkg)) {
399399
fileDep.packages = fileDep.packages.filter(packageName => packageName !== pkg);
400-
lset(tree[fileDep['originFile']],`packages.${pkg}`, foundPackages[pkg]);
400+
lset(tree[fileDep['originFile']], ['packages',pkg], foundPackages[pkg]);
401401
}
402402
});
403403
});

0 commit comments

Comments
 (0)