code review feedback

Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com>
This commit is contained in:
Brian Phillips
2023-07-24 21:44:26 -05:00
parent 2b4f77a4e9
commit 366a6b98fc
4 changed files with 27 additions and 13 deletions
+8 -3
View File
@@ -41,9 +41,14 @@ export interface Config {
}>;
};
/**
* A list of package prefixes that DevTools will use for filtering all available dependencies
* (default is ["@backstage"])
* Info configuration
*/
packagePrefixes?: string[];
info?: {
/**
* A list of package prefixes that DevTools will use for filtering all available dependencies
* (default is ["@backstage"])
*/
packagePrefixes?: string[];
};
};
}
@@ -219,9 +219,9 @@ export class DevToolsBackendApi {
const lockfilePath = paths.resolveTargetRoot('yarn.lock');
const lockfile = await Lockfile.load(lockfilePath);
const prefixes = this.config.getOptionalStringArray(
'devTools.packagePrefixes',
) ?? ['@backstage/'];
const prefixes = ['@backstage', '@internal'].concat(
this.config.getOptionalStringArray('devTools.info.packagePrefixes') ?? [],
);
const deps = [...lockfile.keys()].filter(n =>
prefixes.some(prefix => n.startsWith(prefix)),
);