cli: fix app:serve dependency warning

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-01-25 22:19:29 +01:00
parent 3bbf6125c6
commit 1b4ab0d44c
2 changed files with 10 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Updated the dependency warning that is baked into `app:serve` to only warn about packages that are not allowed to have duplicates.
+5 -5
View File
@@ -22,16 +22,16 @@ import { serveBundle } from '../../lib/bundler';
import { loadCliConfig } from '../../lib/config';
import { paths } from '../../lib/paths';
import { Lockfile } from '../../lib/versioning';
import { includedFilter } from '../versions/lint';
import { forbiddenDuplicatesFilter, includedFilter } from '../versions/lint';
export default async (cmd: Command) => {
const lockfile = await Lockfile.load(paths.resolveTargetRoot('yarn.lock'));
const result = lockfile.analyze({
filter: includedFilter,
});
const problemPackages = [...result.newVersions, ...result.newRanges].map(
({ name }) => name,
);
const problemPackages = [...result.newVersions, ...result.newRanges]
.map(({ name }) => name)
.filter(name => forbiddenDuplicatesFilter(name));
if (problemPackages.length > 1) {
console.log(
@@ -44,7 +44,7 @@ export default async (cmd: Command) => {
);
console.log(
chalk.yellow(
`⚠️ This can be resolved using the following command:
`⚠️ The following command may fix the issue, but it could also be an issue within one of your dependencies:
yarn backstage-cli versions:check --fix
`,