Skip to content

Commit

Permalink
fix: Remove deprecation warning and emit errors instead for version c…
Browse files Browse the repository at this point in the history
…onflicts when strictModuleVersions is set.
  • Loading branch information
chriseppstein committed Mar 27, 2020
1 parent cc00552 commit 8334e0e
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions packages/eyeglass/src/Eyeglass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,25 +128,16 @@ const VERSION_WARNINGS_ISSUED: Dict<boolean> = {};
function checkDependencyConflicts(this: IEyeglass): void {
let conflicts = this.modules.issues.dependencies.versions;
let strictMode = this.options.eyeglass.strictModuleVersions;
let deprecatedWarn = false;
if (typeof strictMode === "undefined") {
strictMode = "warn";
}
// XXX Remove prior to next major release.
if (strictMode === true) {
strictMode = "warn";
deprecatedWarn = true;
}
for (let conflict of conflicts) {
let message = `Version conflict for eyeglass module '${conflict.name}': ${conflict.requested.version} was requested but it was globally resolved to ${conflict.resolved.version}.`;
if (strictMode === false) {
debug(message);
} else if (strictMode === "warn") {
if (!VERSION_WARNINGS_ISSUED[message]) {
console.error(`WARNING: ${message}`);
if (deprecatedWarn) {
console.error("WARNING: Because strictModuleVersions is true, the previous warning will become an error in the next major release. Consider setting strictModuleVersions to 'warn' for now.");
}
VERSION_WARNINGS_ISSUED[message] = true;
}
} else if (strictMode === true) {
Expand Down

0 comments on commit 8334e0e

Please sign in to comment.