@lerna/package-graph
Advanced tools
Comparing version 3.0.0 to 3.1.2
@@ -6,2 +6,14 @@ # Change Log | ||
<a name="3.1.2"></a> | ||
## [3.1.2](https://github.com/lerna/lerna/compare/v3.1.1...v3.1.2) (2018-08-20) | ||
### Bug Fixes | ||
* **package-graph:** Throw errors when package names are not unique ([387df2b](https://github.com/lerna/lerna/commit/387df2b)) | ||
<a name="3.0.0"></a> | ||
@@ -8,0 +20,0 @@ # [3.0.0](https://github.com/lerna/lerna/compare/v3.0.0-rc.0...v3.0.0) (2018-08-10) |
23
index.js
@@ -5,2 +5,3 @@ "use strict"; | ||
const semver = require("semver"); | ||
const ValidationError = require("@lerna/validation-error"); | ||
@@ -70,2 +71,24 @@ /** | ||
if (packages.size !== this.size) { | ||
// weed out the duplicates | ||
const seen = new Map(); | ||
for (const { name, location } of packages) { | ||
if (seen.has(name)) { | ||
seen.get(name).push(location); | ||
} else { | ||
seen.set(name, [location]); | ||
} | ||
} | ||
for (const [name, locations] of seen) { | ||
if (locations.length > 1) { | ||
throw new ValidationError( | ||
"ENAME", | ||
[`Package name "${name}" used in multiple packages:`, ...locations].join("\n\t") | ||
); | ||
} | ||
} | ||
} | ||
this.forEach((currentNode, currentName) => { | ||
@@ -72,0 +95,0 @@ const graphDependencies = |
{ | ||
"name": "@lerna/package-graph", | ||
"version": "3.0.0", | ||
"version": "3.1.2", | ||
"description": "Lerna's internal representation of a package graph", | ||
@@ -33,6 +33,7 @@ "keywords": [ | ||
"dependencies": { | ||
"@lerna/validation-error": "^3.0.0", | ||
"npm-package-arg": "^6.0.0", | ||
"semver": "^5.5.0" | ||
}, | ||
"gitHead": "0c40a17a7cd4e9acd8e7ec33ffacd1c1acef5dc6" | ||
"gitHead": "6abc0c95ae6fc6e613e74618d86a060ae218938c" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14453
234
3
+ Added@lerna/validation-error@3.13.0(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedaproba@1.2.0(transitive)
+ Addedare-we-there-yet@1.1.7(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addedgauge@2.7.4(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-fullwidth-code-point@1.0.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addednpmlog@4.1.2(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedstring-width@1.0.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwide-align@1.1.5(transitive)