diff --git a/.changeset/short-seahorses-kiss.md b/.changeset/short-seahorses-kiss.md new file mode 100644 index 0000000000..0127e4c575 --- /dev/null +++ b/.changeset/short-seahorses-kiss.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-techdocs': patch +--- + +Change deprecated local references to import from shared `plugin-techdocs-react` plugin diff --git a/plugins/techdocs/api-report.md b/plugins/techdocs/api-report.md index 6e14c52939..27af44bb13 100644 --- a/plugins/techdocs/api-report.md +++ b/plugins/techdocs/api-report.md @@ -20,11 +20,14 @@ import { ReactNode } from 'react'; import { ResultHighlight } from '@backstage/plugin-search-common'; import { RouteRef } from '@backstage/core-plugin-api'; import { SearchResultListItemExtensionProps } from '@backstage/plugin-search-react'; +import { SyncResult as SyncResult_2 } from '@backstage/plugin-techdocs-react'; import { TableColumn } from '@backstage/core-components'; import { TableOptions } from '@backstage/core-components'; import { TableProps } from '@backstage/core-components'; +import { TechDocsApi as TechDocsApi_2 } from '@backstage/plugin-techdocs-react'; import { TechDocsEntityMetadata as TechDocsEntityMetadata_2 } from '@backstage/plugin-techdocs-react'; import { TechDocsMetadata as TechDocsMetadata_2 } from '@backstage/plugin-techdocs-react'; +import { TechDocsStorageApi as TechDocsStorageApi_2 } from '@backstage/plugin-techdocs-react'; import { ToolbarProps } from '@material-ui/core'; import { UserListFilterKind } from '@backstage/plugin-catalog-react'; @@ -237,7 +240,7 @@ export interface TechDocsApi { export const techdocsApiRef: ApiRef; // @public -export class TechDocsClient implements TechDocsApi { +export class TechDocsClient implements TechDocsApi_2 { constructor(options: { configApi: Config; discoveryApi: DiscoveryApi; @@ -442,7 +445,7 @@ export interface TechDocsStorageApi { export const techdocsStorageApiRef: ApiRef; // @public -export class TechDocsStorageClient implements TechDocsStorageApi { +export class TechDocsStorageClient implements TechDocsStorageApi_2 { constructor(options: { configApi: Config; discoveryApi: DiscoveryApi; @@ -471,6 +474,6 @@ export class TechDocsStorageClient implements TechDocsStorageApi { syncEntityDocs( entityId: CompoundEntityRef, logHandler?: (line: string) => void, - ): Promise; + ): Promise; } ``` diff --git a/plugins/techdocs/src/client.ts b/plugins/techdocs/src/client.ts index 499a56580c..8680e14468 100644 --- a/plugins/techdocs/src/client.ts +++ b/plugins/techdocs/src/client.ts @@ -23,11 +23,13 @@ import { } from '@backstage/core-plugin-api'; import { NotFoundError, ResponseError } from '@backstage/errors'; import { + SyncResult, + TechDocsApi, TechDocsEntityMetadata, TechDocsMetadata, + TechDocsStorageApi, } from '@backstage/plugin-techdocs-react'; import { EventSourcePolyfill } from 'event-source-polyfill'; -import { SyncResult, TechDocsApi, TechDocsStorageApi } from './api'; /** * API to talk to `techdocs-backend`. @@ -189,7 +191,7 @@ export class TechDocsStorageClient implements TechDocsStorageApi { * @param entityId - Object containing entity data like name, namespace, etc. * @param logHandler - Callback to receive log messages from the build process * @returns Whether documents are currently synchronized to newest version - * @throws Throws error on error from sync endpoint in Techdocs Backend + * @throws Throws error on error from sync endpoint in TechDocs Backend */ async syncEntityDocs( entityId: CompoundEntityRef, diff --git a/plugins/techdocs/src/home/components/TechDocsPageWrapper.tsx b/plugins/techdocs/src/home/components/TechDocsPageWrapper.tsx index 52511bda19..a6192c13ee 100644 --- a/plugins/techdocs/src/home/components/TechDocsPageWrapper.tsx +++ b/plugins/techdocs/src/home/components/TechDocsPageWrapper.tsx @@ -29,7 +29,7 @@ export type TechDocsPageWrapperProps = { }; /** - * Component wrapping a techdocs page with Page and Header components + * Component wrapping a TechDocs page with Page and Header components * * @public */ diff --git a/plugins/techdocs/src/reader/README.md b/plugins/techdocs/src/reader/README.md index fe1d1ff488..58697298c6 100644 --- a/plugins/techdocs/src/reader/README.md +++ b/plugins/techdocs/src/reader/README.md @@ -2,7 +2,7 @@ The TechDocs reader is a component that fetches a remote page, runs transformers on it and renders it into a shadow dom. -Currently there's no easy way to customize which transformers to run or add new ones. If that is needed you would have to fork the techdocs plugin and make your changes in that fork. +Currently there's no easy way to customize which transformers to run or add new ones. If that is needed you would have to fork the TechDocs plugin and make your changes in that fork. Transformers are functions that optionally takes in parameters from the Reader.tsx component and returns a function which gets passed the DOM of the fetched page. A very simple transformer can look like this.