yarn-plugin: validate version of yarn in yarn plugin
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
@@ -34,6 +34,7 @@
|
||||
"@backstage/release-manifests": "workspace:^",
|
||||
"@yarnpkg/core": "^4.0.3",
|
||||
"@yarnpkg/fslib": "^3.0.2",
|
||||
"chalk": "^4.0.0",
|
||||
"semver": "^7.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -21,10 +21,21 @@
|
||||
* @packageDocumentation
|
||||
*/
|
||||
|
||||
import { Plugin } from '@yarnpkg/core';
|
||||
import { Plugin, semverUtils, YarnVersion } from '@yarnpkg/core';
|
||||
import chalk from 'chalk';
|
||||
import { beforeWorkspacePacking } from './handlers/beforeWorkspacePacking';
|
||||
import { BackstageResolver } from './resolver/BackstageResolver';
|
||||
|
||||
if (!semverUtils.satisfiesWithPrereleases(YarnVersion, '^4.1.1')) {
|
||||
console.error();
|
||||
console.error(
|
||||
`${chalk.bold.red(
|
||||
'Unsupported yarn version.',
|
||||
)}: The Backstage yarn plugin only works with yarn ^4.1.1. Please upgrade yarn, or remove this plugin with "yarn plugin remove @yarnpkg/plugin-backstage".`,
|
||||
);
|
||||
console.error();
|
||||
}
|
||||
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user