refactor(CatalogAnalysisExtensionPoint): update function signature

Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
Phil Kuang
2023-10-24 12:27:36 -04:00
parent 39aaeda5ce
commit 88b673aa76
5 changed files with 9 additions and 11 deletions
-1
View File
@@ -1,7 +1,6 @@
---
'@backstage/plugin-catalog-backend': minor
'@backstage/plugin-catalog-node': minor
'@backstage/plugin-catalog-backend-module-github': patch
---
Support adding location analyzers in new catalog analysis extension point and move `AnalyzeOptions` and `ScmLocationAnalyzer` types to `@backstage/plugin-catalog-node`
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-backend-module-github': patch
---
Import `AnalyzeOptions` and `ScmLocationAnalyzer` types from `@backstage/plugin-catalog-node`
@@ -77,10 +77,8 @@ class CatalogAnalysisExtensionPointImpl
{
#locationAnalyzers = new Array<ScmLocationAnalyzer>();
addLocationAnalyzers(
...analyzers: Array<ScmLocationAnalyzer | Array<ScmLocationAnalyzer>>
): void {
this.#locationAnalyzers.push(...analyzers.flat());
addLocationAnalyzer(analyzer: ScmLocationAnalyzer): void {
this.#locationAnalyzers.push(analyzer);
}
get locationAnalyzers() {
+1 -3
View File
@@ -14,9 +14,7 @@ import { ServiceRef } from '@backstage/backend-plugin-api';
// @alpha (undocumented)
export interface CatalogAnalysisExtensionPoint {
// (undocumented)
addLocationAnalyzers(
...analyzers: Array<ScmLocationAnalyzer | Array<ScmLocationAnalyzer>>
): void;
addLocationAnalyzer(analyzer: ScmLocationAnalyzer): void;
}
// @alpha (undocumented)
+1 -3
View File
@@ -46,9 +46,7 @@ export const catalogProcessingExtensionPoint =
* @alpha
*/
export interface CatalogAnalysisExtensionPoint {
addLocationAnalyzers(
...analyzers: Array<ScmLocationAnalyzer | Array<ScmLocationAnalyzer>>
): void;
addLocationAnalyzer(analyzer: ScmLocationAnalyzer): void;
}
/**