From 49ceacc5997c889c111432ee9204b3929d17fa87 Mon Sep 17 00:00:00 2001 From: tedraykov Date: Mon, 24 Oct 2022 15:28:25 +0300 Subject: [PATCH] fix: update no longer fail when deprecated plugins exist Signed-off-by: tedraykov --- commands/update.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/commands/update.js b/commands/update.js index 4b5e25c..3f18ba2 100644 --- a/commands/update.js +++ b/commands/update.js @@ -111,12 +111,18 @@ export default async function update(options) { const remoteDependencies = await getRemoteDependencies(); const outdatedPackages = pluginPackages - .map(({ name, version }) => ({ - name, - version, - remoteVersion: remoteDependencies[name], - outdated: compareVersions.compare(cleanVersion(remoteDependencies[name]), cleanVersion(version), ">") - })) + .map(({ name, version }) => { + const remoteDependency = remoteDependencies[name]; + if (remoteDependency === undefined) { + Logger.warn(`Plugin ${name} used by the local project has been officially deprecated.`); + } + return { + name, + version, + remoteVersion: remoteDependencies[name], + outdated: remoteDependency && compareVersions.compare(cleanVersion(remoteDependency), cleanVersion(version), ">") + }; + }) .filter(({ outdated }) => outdated); if (outdatedPackages.length === 0) {