diff --git a/.changeset/hungry-paws-dress.md b/.changeset/hungry-paws-dress.md index ede5358d58..b227a77e72 100644 --- a/.changeset/hungry-paws-dress.md +++ b/.changeset/hungry-paws-dress.md @@ -1,5 +1,6 @@ --- '@backstage/plugin-user-settings': patch +'@backstage/plugin-techdocs': patch '@backstage/plugin-tech-radar': patch '@backstage/plugin-graphiql': patch '@backstage/plugin-search': patch diff --git a/plugins/techdocs/alpha-api-report.md b/plugins/techdocs/alpha-api-report.md index 5fd1374114..bc6b8926cf 100644 --- a/plugins/techdocs/alpha-api-report.md +++ b/plugins/techdocs/alpha-api-report.md @@ -4,12 +4,22 @@ ```ts import { AnyExternalRoutes } from '@backstage/frontend-plugin-api'; -import { AnyRoutes } from '@backstage/frontend-plugin-api'; import { BackstagePlugin } from '@backstage/frontend-plugin-api'; import { Extension } from '@backstage/frontend-plugin-api'; +import { RouteRef } from '@backstage/frontend-plugin-api'; // @alpha (undocumented) -const _default: BackstagePlugin; +const _default: BackstagePlugin< + { + root: RouteRef; + docRoot: RouteRef<{ + name: string; + kind: string; + namespace: string; + }>; + }, + AnyExternalRoutes +>; export default _default; // @alpha (undocumented) diff --git a/plugins/techdocs/src/alpha.tsx b/plugins/techdocs/src/alpha.tsx index 2f991f2fcc..f4d4da6e93 100644 --- a/plugins/techdocs/src/alpha.tsx +++ b/plugins/techdocs/src/alpha.tsx @@ -35,6 +35,7 @@ import { techdocsStorageApiRef, } from '@backstage/plugin-techdocs-react'; import { TechDocsClient, TechDocsStorageClient } from './client'; +import { convertLegacyRouteRef } from '@backstage/core-plugin-api/alpha'; const rootRouteRef = createRouteRef({ id: 'plugin.techdocs.indexPage', @@ -76,7 +77,7 @@ export const TechDocsSearchResultListItemExtension = const TechDocsIndexPage = createPageExtension({ id: 'plugin.techdocs.indexPage', defaultPath: '/docs', - routeRef: rootRouteRef, + routeRef: convertLegacyRouteRef(rootRouteRef), loader: () => import('./home/components/TechDocsIndexPage').then(m => ( @@ -94,7 +95,7 @@ const TechDocsReaderPage = createPageExtension({ import('./reader/components/TechDocsReaderPage').then(m => ( )), - routeRef: rootDocsRouteRef, + routeRef: convertLegacyRouteRef(rootDocsRouteRef), defaultPath: '/docs/:namespace/:kind/:name/*', }); @@ -153,4 +154,8 @@ export default createPlugin({ techDocsStorage, TechDocsSearchResultListItemExtension, ], + routes: { + root: convertLegacyRouteRef(rootRouteRef), + docRoot: convertLegacyRouteRef(rootDocsRouteRef), + }, });