From 35275ad5ffe0962cc5315450fabe801887e42484 Mon Sep 17 00:00:00 2001 From: Lukas Holzer Date: Thu, 14 Mar 2024 16:02:53 +0100 Subject: [PATCH 1/2] fix: show incompatible plugins for major changes as well --- packages/build/src/log/messages/compatibility.ts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/build/src/log/messages/compatibility.ts b/packages/build/src/log/messages/compatibility.ts index 3249a0da83..b3ce9e19b5 100644 --- a/packages/build/src/log/messages/compatibility.ts +++ b/packages/build/src/log/messages/compatibility.ts @@ -1,7 +1,6 @@ import semver from 'semver' import { isRuntime } from '../../utils/runtime.js' -import { isPreviousMajor } from '../../utils/semver.js' import { getPluginOrigin } from '../description.js' import { BufferedLogs, logArray, logSubHeader, logWarningArray, logWarningSubHeader } from '../logger.js' import { THEME } from '../theme.js' @@ -149,7 +148,7 @@ const getUpgradeInstruction = function (loadedFrom, origin) { // Print a warning message when plugins are using a version that is too recent // and does not meet some `compatibility` expectations. // This can only happen when they are installed to `package.json`. -export const logIncompatiblePlugins = function (logs, pluginsOptions) { +export const logIncompatiblePlugins = function (logs: BufferedLogs, pluginsOptions) { const incompatiblePlugins = pluginsOptions.filter(hasIncompatibleVersion).map(getIncompatiblePlugin) if (incompatiblePlugins.length === 0) { @@ -161,16 +160,7 @@ export const logIncompatiblePlugins = function (logs, pluginsOptions) { } const hasIncompatibleVersion = function ({ pluginPackageJson: { version }, compatibleVersion, compatWarning }) { - return ( - compatWarning !== '' && - version !== undefined && - compatibleVersion !== undefined && - // Using only the major version prevents printing this warning message when - // a site is using the right `compatibility` version, but is using the most - // recent version due to the time gap between `npm publish` and the - // `plugins.json` update - isPreviousMajor(compatibleVersion, version) - ) + return compatWarning !== '' && version !== undefined && compatibleVersion !== undefined } const getIncompatiblePlugin = function ({ From fe14b28b12471a0d624285cd395e8a7cbfd9e947 Mon Sep 17 00:00:00 2001 From: Lukas Holzer Date: Mon, 18 Mar 2024 10:06:06 +0100 Subject: [PATCH 2/2] chore: fix snapshots --- .../tests/plugins_list/snapshots/tests.js.md | 27 ++++++++++++++++++ .../plugins_list/snapshots/tests.js.snap | Bin 4585 -> 4669 bytes 2 files changed, 27 insertions(+) diff --git a/packages/build/tests/plugins_list/snapshots/tests.js.md b/packages/build/tests/plugins_list/snapshots/tests.js.md index 44a05e79b1..93548b26fa 100644 --- a/packages/build/tests/plugins_list/snapshots/tests.js.md +++ b/packages/build/tests/plugins_list/snapshots/tests.js.md @@ -820,6 +820,9 @@ Generated by [AVA](https://avajs.dev). > Loading plugins␊ - netlify-plugin-contextual-env 0-4-0 from netlify.toml and package.json (latest 0-4-0, expected 0-4-1, compatible 0-4-1)␊ ␊ + > Incompatible plugins␊ + - netlify-plugin-contextual-env 0-4-0: version 1.0.0 is the most recent version compatible with Node.js <100␊ + ␊ netlify-plugin-contextual-env (onPreBuild event) ␊ ────────────────────────────────────────────────────────────────␊ ␊ @@ -937,6 +940,9 @@ Generated by [AVA](https://avajs.dev). - netlify-plugin-contextual-env 0-1-0: latest version is 0-3-0␊ To upgrade this plugin, please remove it from "netlify.toml" and install it from the Netlify plugins directory instead (https://app.netlify.com/plugins)␊ ␊ + > Incompatible plugins␊ + - netlify-plugin-contextual-env 0-1-0: version 1.0.0 is the most recent version compatible with Node.js <100␊ + ␊ netlify-plugin-contextual-env (onPreBuild event) ␊ ────────────────────────────────────────────────────────────────␊ ␊ @@ -999,6 +1005,9 @@ Generated by [AVA](https://avajs.dev). - netlify-plugin-contextual-env 0-1-0: latest version is 0-3-0␊ To upgrade this plugin, please remove it from "netlify.toml" and install it from the Netlify plugins directory instead (https://app.netlify.com/plugins)␊ ␊ + > Incompatible plugins␊ + - netlify-plugin-contextual-env 0-1-0: version 1.0.0 is the most recent version compatible with Node.js <100␊ + ␊ netlify-plugin-contextual-env (onPreBuild event) ␊ ────────────────────────────────────────────────────────────────␊ ␊ @@ -1185,6 +1194,9 @@ Generated by [AVA](https://avajs.dev). - netlify-plugin-contextual-env 0-2-0: latest version is 0-3-0␊ To upgrade this plugin, please remove it from "netlify.toml" and install it from the Netlify plugins directory instead (https://app.netlify.com/plugins)␊ ␊ + > Incompatible plugins␊ + - netlify-plugin-contextual-env 0-2-0: version 1.0.0 is the most recent version compatible with Node.js 6 - 120␊ + ␊ netlify-plugin-contextual-env (onPreBuild event) ␊ ────────────────────────────────────────────────────────────────␊ ␊ @@ -1306,6 +1318,9 @@ Generated by [AVA](https://avajs.dev). Migration guide: http://test.com␊ To upgrade this plugin, please remove it from "netlify.toml" and install it from the Netlify plugins directory instead (https://app.netlify.com/plugins)␊ ␊ + > Incompatible plugins␊ + - netlify-plugin-contextual-env 0-1-0: version 1.0.0 is the most recent version compatible with Node.js <100␊ + ␊ netlify-plugin-contextual-env (onPreBuild event) ␊ ────────────────────────────────────────────────────────────────␊ ␊ @@ -1368,6 +1383,9 @@ Generated by [AVA](https://avajs.dev). - netlify-plugin-contextual-env 0-2-0: latest version is 0-3-0␊ To upgrade this plugin, please remove it from "netlify.toml" and install it from the Netlify plugins directory instead (https://app.netlify.com/plugins)␊ ␊ + > Incompatible plugins␊ + - netlify-plugin-contextual-env 0-2-0: version 1.0.0 is the most recent version compatible with ansi-styles@<3␊ + ␊ netlify-plugin-contextual-env (onPreBuild event) ␊ ────────────────────────────────────────────────────────────────␊ ␊ @@ -1604,6 +1622,9 @@ Generated by [AVA](https://avajs.dev). - netlify-plugin-contextual-env 0-2-0: latest version is 0-3-0␊ To upgrade this plugin, please remove it from "netlify.toml" and install it from the Netlify plugins directory instead (https://app.netlify.com/plugins)␊ ␊ + > Incompatible plugins␊ + - netlify-plugin-contextual-env 0-2-0: version 1.0.0 is the most recent version compatible with ansi-styles@<3, Node.js <100␊ + ␊ netlify-plugin-contextual-env (onPreBuild event) ␊ ────────────────────────────────────────────────────────────────␊ ␊ @@ -1666,6 +1687,9 @@ Generated by [AVA](https://avajs.dev). - netlify-plugin-contextual-env 0-2-0: latest version is 0-3-0␊ To upgrade this plugin, please remove it from "netlify.toml" and install it from the Netlify plugins directory instead (https://app.netlify.com/plugins)␊ ␊ + > Incompatible plugins␊ + - netlify-plugin-contextual-env 0-2-0: version 1.0.0 is the most recent version compatible with @netlify/dependency-with-range@<10␊ + ␊ netlify-plugin-contextual-env (onPreBuild event) ␊ ────────────────────────────────────────────────────────────────␊ ␊ @@ -2627,6 +2651,9 @@ Generated by [AVA](https://avajs.dev). - netlify-plugin-contextual-env 0-3-0: latest version is 1-0-0␊ To upgrade this plugin, please uninstall and re-install it from the Netlify plugins directory (https://app.netlify.com/plugins)␊ ␊ + > Incompatible plugins␊ + - netlify-plugin-contextual-env 0-3-0: version 1.0.0 is the most recent version compatible with Node.js <100␊ + ␊ netlify-plugin-contextual-env (onPreBuild event) ␊ ────────────────────────────────────────────────────────────────␊ ␊ diff --git a/packages/build/tests/plugins_list/snapshots/tests.js.snap b/packages/build/tests/plugins_list/snapshots/tests.js.snap index 094b1e70f11869f37e1928e8c28895074aba12a4..9d55f628c9db965b621db337c79adf18057823bf 100644 GIT binary patch literal 4669 zcmV-D62k34RzV9t*WIiMW4P~Z`7Kz$}T3FSa2`In#jK2hX*Tc5uD*4A74 z-xq%Kt>68PM_aYWNgi-JW`Pg${;U1sAAVTrRIA;9k7*>C;5C4oS&ep0ZM2)MW=r33 zKOlWs1Mq1#?sq^%F|7eaG!&945gk7jLUkY{-XZBznS6U!QK@9sHU|NdYPZK;sW_r? z_lN|{KS;k&1JL(A36<>Bbgib}dBmjpC<;1Yvf7oxJEY3oAXz}Udc=62MvV9OBjHgg zsZ5Jjy8(CND56|}&m!vSBG%yi<QxcqacE zfXOkfhPWFrIasJ-N4Y$SSfB9@__RmjKv!d$LGoJ-U_6YK?7-_cwdCCv={H72Gr1)> zcOZR|Mv_az6I{_(DkedL@}soI^cDR>k?>ptJS9e z&K1G;BbrzjdPKQ;Z{sY;W1$AR_Io1cezVzxLrOz^A$`~2-s6vDt#)O4Mdj*AS8_mg ztuqeop?t5FT$hT5;Kvcs@6s8s;I#Z|V^;r8`uP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