11import semver from 'semver'
22
33import { isRuntime } from '../../utils/runtime.js'
4- import { isPreviousMajor } from '../../utils/semver.js'
54import { getPluginOrigin } from '../description.js'
65import { BufferedLogs , logArray , logSubHeader , logWarningArray , logWarningSubHeader } from '../logger.js'
76import { 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
163162const 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
176166const getIncompatiblePlugin = function ( {
0 commit comments