Skip to content

Commit 35275ad

Browse files
author
Lukas Holzer
committed
fix: show incompatible plugins for major changes as well
1 parent 1594f6b commit 35275ad

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

packages/build/src/log/messages/compatibility.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import semver from 'semver'
22

33
import { isRuntime } from '../../utils/runtime.js'
4-
import { isPreviousMajor } from '../../utils/semver.js'
54
import { getPluginOrigin } from '../description.js'
65
import { BufferedLogs, logArray, logSubHeader, logWarningArray, logWarningSubHeader } from '../logger.js'
76
import { THEME } from '../theme.js'
@@ -149,7 +148,7 @@ const getUpgradeInstruction = function (loadedFrom, origin) {
149148
// Print a warning message when plugins are using a version that is too recent
150149
// and does not meet some `compatibility` expectations.
151150
// This can only happen when they are installed to `package.json`.
152-
export const logIncompatiblePlugins = function (logs, pluginsOptions) {
151+
export const logIncompatiblePlugins = function (logs: BufferedLogs, pluginsOptions) {
153152
const incompatiblePlugins = pluginsOptions.filter(hasIncompatibleVersion).map(getIncompatiblePlugin)
154153

155154
if (incompatiblePlugins.length === 0) {
@@ -161,16 +160,7 @@ export const logIncompatiblePlugins = function (logs, pluginsOptions) {
161160
}
162161

163162
const hasIncompatibleVersion = function ({ pluginPackageJson: { version }, compatibleVersion, compatWarning }) {
164-
return (
165-
compatWarning !== '' &&
166-
version !== undefined &&
167-
compatibleVersion !== undefined &&
168-
// Using only the major version prevents printing this warning message when
169-
// a site is using the right `compatibility` version, but is using the most
170-
// recent version due to the time gap between `npm publish` and the
171-
// `plugins.json` update
172-
isPreviousMajor(compatibleVersion, version)
173-
)
163+
return compatWarning !== '' && version !== undefined && compatibleVersion !== undefined
174164
}
175165

176166
const getIncompatiblePlugin = function ({

0 commit comments

Comments
 (0)