refactor(techdocs): deprecate ShouldBuildParameters type
Signed-off-by: Phil Kuang <pkuang@factset.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import { CatalogClient } from '@backstage/catalog-client';
|
||||
import { Config } from '@backstage/config';
|
||||
import { DefaultTechDocsCollatorFactory as DefaultTechDocsCollatorFactory_2 } from '@backstage/plugin-search-backend-module-techdocs';
|
||||
import { DocsBuildStrategy as DocsBuildStrategy_2 } from '@backstage/plugin-techdocs-node';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import express from 'express';
|
||||
import { GeneratorBuilder } from '@backstage/plugin-techdocs-node';
|
||||
import { Knex } from 'knex';
|
||||
@@ -17,7 +18,6 @@ import { PluginCacheManager } from '@backstage/backend-common';
|
||||
import { PluginEndpointDiscovery } from '@backstage/backend-common';
|
||||
import { PreparerBuilder } from '@backstage/plugin-techdocs-node';
|
||||
import { PublisherBase } from '@backstage/plugin-techdocs-node';
|
||||
import { ShouldBuildParameters as ShouldBuildParameters_2 } from '@backstage/plugin-techdocs-node';
|
||||
import type { TechDocsCollatorFactoryOptions as TechDocsCollatorFactoryOptions_2 } from '@backstage/plugin-search-backend-module-techdocs';
|
||||
import { TechDocsDocument as TechDocsDocument_2 } from '@backstage/plugin-techdocs-node';
|
||||
import { TokenManager } from '@backstage/backend-common';
|
||||
@@ -85,7 +85,9 @@ export type RouterOptions =
|
||||
| OutOfTheBoxDeploymentOptions;
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type ShouldBuildParameters = ShouldBuildParameters_2;
|
||||
export type ShouldBuildParameters = {
|
||||
entity: Entity;
|
||||
};
|
||||
|
||||
// @public @deprecated (undocumented)
|
||||
export type TechDocsCollatorFactoryOptions = TechDocsCollatorFactoryOptions_2;
|
||||
|
||||
@@ -20,9 +20,9 @@
|
||||
* @packageDocumentation
|
||||
*/
|
||||
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import {
|
||||
DocsBuildStrategy as _DocsBuildStrategy,
|
||||
ShouldBuildParameters as _ShouldBuildParameters,
|
||||
TechDocsDocument as _TechDocsDocument,
|
||||
} from '@backstage/plugin-techdocs-node';
|
||||
|
||||
@@ -49,9 +49,11 @@ export type {
|
||||
export type DocsBuildStrategy = _DocsBuildStrategy;
|
||||
/**
|
||||
* @public
|
||||
* @deprecated import from `@backstage/plugin-techdocs-node` instead
|
||||
* @deprecated use direct type definition instead
|
||||
*/
|
||||
export type ShouldBuildParameters = _ShouldBuildParameters;
|
||||
export type ShouldBuildParameters = {
|
||||
entity: Entity;
|
||||
};
|
||||
/**
|
||||
* @public
|
||||
* @deprecated import from `@backstage/plugin-techdocs-node` instead
|
||||
|
||||
@@ -13,11 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
import { Config } from '@backstage/config';
|
||||
import {
|
||||
DocsBuildStrategy,
|
||||
ShouldBuildParameters,
|
||||
} from '@backstage/plugin-techdocs-node';
|
||||
import { DocsBuildStrategy } from '@backstage/plugin-techdocs-node';
|
||||
|
||||
export class DefaultDocsBuildStrategy implements DocsBuildStrategy {
|
||||
private readonly config: Config;
|
||||
@@ -30,7 +28,7 @@ export class DefaultDocsBuildStrategy implements DocsBuildStrategy {
|
||||
return new DefaultDocsBuildStrategy(config);
|
||||
}
|
||||
|
||||
async shouldBuild(_: ShouldBuildParameters): Promise<boolean> {
|
||||
async shouldBuild(_: { entity: Entity }): Promise<boolean> {
|
||||
return this.config.getString('techdocs.builder') === 'local';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user