code review feedback
Signed-off-by: Brian Phillips <28457+brianphillips@users.noreply.github.com>
This commit is contained in:
@@ -2,4 +2,13 @@
|
||||
'@backstage/plugin-devtools-backend': patch
|
||||
---
|
||||
|
||||
Add DevTools configuration to enable dependency listing to be filtered with custom prefixes
|
||||
Add DevTools configuration to enable dependency listing to be filtered with custom prefixes. For instance, in your `app-config.yaml`:
|
||||
|
||||
```yaml
|
||||
devTools:
|
||||
info:
|
||||
packagePrefixes:
|
||||
- @backstage/
|
||||
- @roadiehq/backstage-
|
||||
- @spotify/backstage-
|
||||
```
|
||||
|
||||
Vendored
+8
-3
@@ -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)),
|
||||
);
|
||||
|
||||
@@ -408,18 +408,18 @@ export const customDevToolsPage = <DevToolsPage />;
|
||||
|
||||
## Configuration
|
||||
|
||||
The following sections outline the configuration for the DevTools plugin
|
||||
The following sections outline the configuration for the DevTools plugin.
|
||||
|
||||
### Package Dependencies
|
||||
|
||||
By default, only packages with names starting with `@backstage/` will be listed on the main "Info" tab. If you would like additional packages to be listed, you can specify the package prefixes in your `app-config.yaml`. For example, to include backstage plugins provided by the core application as well as `@roadiehq` and `@spotify`:
|
||||
By default, only packages with names starting with `@backstage` and `@internal` will be listed on the main "Info" tab. If you would like additional packages to be listed, you can specify the package prefixes (not regular expressions) in your `app-config.yaml`. For example, to not only provide version information about backstage plugins provided by the core application (`@backstage/*` modules) but also `@roadiehq` and `@spotify` plugins, you can specify this configuration:
|
||||
|
||||
```yaml
|
||||
devTools:
|
||||
packagePrefixes:
|
||||
- @backstage/
|
||||
- @roadiehq/backstage-
|
||||
- @spotify/backstage-
|
||||
info:
|
||||
packagePrefixes:
|
||||
- @roadiehq/backstage-
|
||||
- @spotify/backstage-
|
||||
```
|
||||
|
||||
### External Dependencies Configuration
|
||||
|
||||
Reference in New Issue
Block a user