diff --git a/.changeset/seven-tips-more.md b/.changeset/seven-tips-more.md new file mode 100644 index 0000000000..fcb51e30aa --- /dev/null +++ b/.changeset/seven-tips-more.md @@ -0,0 +1,133 @@ +--- +'@backstage/create-app': patch +--- + +Adjust template to the latest changes in the `api-docs` plugin. + +## Template Changes + +While updating to the latest `api-docs` plugin, the following changes are necessary for the `create-app` template in your `app/src/components/catalog/EntityPage.tsx`. This adds: + +- A custom entity page for API entities +- Changes the API tab to include the new `ConsumedApisCard` and `ProvidedApisCard` that link to the API entity. + +```diff + import { ++ ApiDefinitionCard, +- Router as ApiDocsRouter, ++ ConsumedApisCard, ++ ProvidedApisCard, ++ ConsumedApisCard, ++ ConsumingComponentsCard, ++ ProvidedApisCard, ++ ProvidingComponentsCard + } from '@backstage/plugin-api-docs'; + +... + ++const ComponentApisContent = ({ entity }: { entity: Entity }) => ( ++ ++ ++ ++ ++ ++ ++ ++ ++); + + const ServiceEntityPage = ({ entity }: { entity: Entity }) => ( + + } + /> + } + /> + } ++ element={} + /> +... + +-export const EntityPage = () => { +- const { entity } = useEntity(); +- switch (entity?.spec?.type) { +- case 'service': +- return ; +- case 'website': +- return ; +- default: +- return ; +- } +-}; + ++export const ComponentEntityPage = ({ entity }: { entity: Entity }) => { ++ switch (entity?.spec?.type) { ++ case 'service': ++ return ; ++ case 'website': ++ return ; ++ default: ++ return ; ++ } ++}; ++ ++const ApiOverviewContent = ({ entity }: { entity: Entity }) => ( ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++); ++ ++const ApiDefinitionContent = ({ entity }: { entity: ApiEntity }) => ( ++ ++ ++ ++ ++ ++); ++ ++const ApiEntityPage = ({ entity }: { entity: Entity }) => ( ++ ++ } ++ /> ++ } ++ /> ++ ++); ++ ++export const EntityPage = () => { ++ const { entity } = useEntity(); ++ ++ switch (entity?.kind?.toLowerCase()) { ++ case 'component': ++ return ; ++ case 'api': ++ return ; ++ default: ++ return ; ++ } ++}; +```