Allow package prefixes to be customized for DevTools dependency listing
Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com>
This commit is contained in:
Vendored
+5
@@ -40,5 +40,10 @@ export interface Config {
|
||||
target: string;
|
||||
}>;
|
||||
};
|
||||
/**
|
||||
* A list of package prefixes that DevTools will use for filtering all available dependencies
|
||||
* (default is ["@backstage"])
|
||||
*/
|
||||
packagePrefixes?: string[];
|
||||
};
|
||||
}
|
||||
|
||||
@@ -219,7 +219,12 @@ export class DevToolsBackendApi {
|
||||
const lockfilePath = paths.resolveTargetRoot('yarn.lock');
|
||||
const lockfile = await Lockfile.load(lockfilePath);
|
||||
|
||||
const deps = [...lockfile.keys()].filter(n => n.startsWith('@backstage/'));
|
||||
const prefixes = this.config.getOptionalStringArray(
|
||||
'devTools.packagePrefixes',
|
||||
) ?? ['@backstage/'];
|
||||
const deps = [...lockfile.keys()].filter(n =>
|
||||
prefixes.some(prefix => n.startsWith(prefix)),
|
||||
);
|
||||
|
||||
const infoDependencies: PackageDependency[] = [];
|
||||
for (const dep of deps) {
|
||||
|
||||
Reference in New Issue
Block a user