yarn-plugin: validate version of yarn in yarn plugin

Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
MT Lewis
2024-04-23 10:01:22 +01:00
parent 2414d86668
commit a8bd40162c
3 changed files with 14 additions and 1 deletions
+1
View File
@@ -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": {
+12 -1
View File
@@ -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
*/
+1
View File
@@ -44721,6 +44721,7 @@ __metadata:
"@yarnpkg/builder": ^4.0.0
"@yarnpkg/core": ^4.0.3
"@yarnpkg/fslib": ^3.0.2
chalk: ^4.0.0
nodemon: ^3.0.1
semver: ^7.6.0
languageName: unknown