1
1
import semver from 'semver'
2
2
3
3
import { isRuntime } from '../../utils/runtime.js'
4
- import { isPreviousMajor } from '../../utils/semver.js'
5
4
import { getPluginOrigin } from '../description.js'
6
5
import { BufferedLogs , logArray , logSubHeader , logWarningArray , logWarningSubHeader } from '../logger.js'
7
6
import { THEME } from '../theme.js'
@@ -149,7 +148,7 @@ const getUpgradeInstruction = function (loadedFrom, origin) {
149
148
// Print a warning message when plugins are using a version that is too recent
150
149
// and does not meet some `compatibility` expectations.
151
150
// 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 ) {
153
152
const incompatiblePlugins = pluginsOptions . filter ( hasIncompatibleVersion ) . map ( getIncompatiblePlugin )
154
153
155
154
if ( incompatiblePlugins . length === 0 ) {
@@ -161,16 +160,7 @@ export const logIncompatiblePlugins = function (logs, pluginsOptions) {
161
160
}
162
161
163
162
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
174
164
}
175
165
176
166
const getIncompatiblePlugin = function ( {
0 commit comments