Adjust types

Signed-off-by: Philipp Hugenroth <philipph@spotify.com>
This commit is contained in:
Philipp Hugenroth
2024-04-11 22:41:03 +02:00
parent ae4b56031e
commit 302f27edd2
2 changed files with 7 additions and 5 deletions
+2 -4
View File
@@ -182,9 +182,7 @@ export default async (opts: OptionValues) => {
parallelismFactor: 4,
items: unlocked,
async worker({ name }) {
let info = (await fetchPackageInfo(name)) as YarnInfoInspectData & {
backstage?: { moved: string };
};
let info = await fetchPackageInfo(name);
// TODO: To be removed
if (name === '@backstage/plugin-catalog-react') {
@@ -195,7 +193,7 @@ export default async (opts: OptionValues) => {
}
if (info.backstage?.moved) {
info = await fetchPackageInfo(info.backstage?.moved);
info = await fetchPackageInfo(info.backstage.moved);
moved.set(name, {
name: info.name,
range: `^${info['dist-tags'].latest}`,
+5 -1
View File
@@ -27,12 +27,16 @@ const DEP_TYPES = [
'optionalDependencies',
] as const;
// Package data as returned by `yarn info`
// Package data as returned by `yarn info`. This is an uncomplete type fullfilling the required needs in the CLI
export type YarnInfoInspectData = {
name: string;
'dist-tags': Record<string, string>;
versions: string[];
time: { [version: string]: string };
backstage?: {
role?: string;
moved?: string;
};
};
// Possible `yarn info` output