diff --git a/.changeset/techdocs-hold-me-closer.md b/.changeset/techdocs-hold-me-closer.md index 04bbf5088f..544ba41cd8 100644 --- a/.changeset/techdocs-hold-me-closer.md +++ b/.changeset/techdocs-hold-me-closer.md @@ -1,7 +1,9 @@ --- -'@backstage/techdocs-addons': minor +'@backstage/plugin-techdocs-react': minor --- -Introducing `@backstage/techdocs-addons`, a web library you can use to create TechDocs addons. +This package will house frontend utilities related to TechDocs to be shared across other frontend Backstage packages. + +In this release, it introduces a framework that can be used create TechDocs addons. Note: this package is not necessarily stable yet. After iteration on this package, its stability will be signaled by a major-version bump. diff --git a/.changeset/techdocs-until-you-puke.md b/.changeset/techdocs-until-you-puke.md index 74578b1067..97d39a9095 100644 --- a/.changeset/techdocs-until-you-puke.md +++ b/.changeset/techdocs-until-you-puke.md @@ -8,7 +8,7 @@ To customize the standalone TechDocs reader page experience, update your `/packa ```diff import { TechDocsIndexPage, TechDocsReaderPage } from '@backstage/plugin-techdocs'; -+ import { TechDocsAddons } from '@backstage/techdocs-addons'; ++ import { TechDocsAddons } from '@backstage/plugin-techdocs-react'; + import { SomeAddon } from '@backstage/plugin-some-plugin'; // ... @@ -30,7 +30,7 @@ To customize the TechDocs reader experience on the Catalog entity page, update y ```diff import { EntityTechdocsContent } from '@backstage/plugin-techdocs'; -+ import { TechDocsAddons } from '@backstage/techdocs-addons'; ++ import { TechDocsAddons } from '@backstage/plugin-techdocs-react'; + import { SomeAddon } from '@backstage/plugin-some-plugin'; // ... diff --git a/packages/techdocs-addons/README.md b/packages/techdocs-addons/README.md deleted file mode 100644 index 050adbbaef..0000000000 --- a/packages/techdocs-addons/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# @backstage/techdocs-addons - -This package provides a TechDocs Addons framework used to create and consume TechDocs Addons. - -## Installation - -Install the package: - -```sh -yarn add @backstage/techdocs-addons -``` diff --git a/packages/techdocs-cli-embedded-app/package.json b/packages/techdocs-cli-embedded-app/package.json index c7c65ad55f..e4db841955 100644 --- a/packages/techdocs-cli-embedded-app/package.json +++ b/packages/techdocs-cli-embedded-app/package.json @@ -17,7 +17,7 @@ "@backstage/integration-react": "^1.0.1-next.1", "@backstage/plugin-catalog": "^1.1.0-next.1", "@backstage/plugin-techdocs": "^1.0.1-next.1", - "@backstage/techdocs-addons": "^0.0.0", + "@backstage/plugin-techdocs-react": "^0.0.0", "@backstage/test-utils": "^1.0.1-next.1", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.11.0", diff --git a/packages/techdocs-cli-embedded-app/src/App.tsx b/packages/techdocs-cli-embedded-app/src/App.tsx index 4583a1bc0e..04a068d989 100644 --- a/packages/techdocs-cli-embedded-app/src/App.tsx +++ b/packages/techdocs-cli-embedded-app/src/App.tsx @@ -27,7 +27,7 @@ import { createTechDocsAddon, TechDocsAddons, TechDocsAddonLocations, -} from '@backstage/techdocs-addons'; +} from '@backstage/plugin-techdocs-react'; import { createApp } from '@backstage/app-defaults'; import { FlatRoutes } from '@backstage/core-app-api'; import { CatalogEntityPage } from '@backstage/plugin-catalog'; diff --git a/packages/techdocs-addons/.eslintrc.js b/plugins/techdocs-react/.eslintrc.js similarity index 100% rename from packages/techdocs-addons/.eslintrc.js rename to plugins/techdocs-react/.eslintrc.js diff --git a/plugins/techdocs-react/README.md b/plugins/techdocs-react/README.md new file mode 100644 index 0000000000..244e8c70da --- /dev/null +++ b/plugins/techdocs-react/README.md @@ -0,0 +1,9 @@ +# @backstage/plugin-techdocs-react + +This package provides frontend utilities for TechDocs and Addons. + +## Installation + +```sh +yarn add @backstage/plugin-techdocs-react +``` diff --git a/packages/techdocs-addons/api-report.md b/plugins/techdocs-react/api-report.md similarity index 95% rename from packages/techdocs-addons/api-report.md rename to plugins/techdocs-react/api-report.md index 573361e5a7..5139df06cc 100644 --- a/packages/techdocs-addons/api-report.md +++ b/plugins/techdocs-react/api-report.md @@ -1,4 +1,4 @@ -## API Report File for "@backstage/techdocs-addons" +## API Report File for "@backstage/plugin-techdocs-react" > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). diff --git a/packages/techdocs-addons/package.json b/plugins/techdocs-react/package.json similarity index 90% rename from packages/techdocs-addons/package.json rename to plugins/techdocs-react/package.json index 5635c9c6fe..742ac5137d 100644 --- a/packages/techdocs-addons/package.json +++ b/plugins/techdocs-react/package.json @@ -1,6 +1,6 @@ { - "name": "@backstage/techdocs-addons", - "description": "TechDocs Addons Framework", + "name": "@backstage/plugin-techdocs-react", + "description": "Shared frontend utilities for TechDocs and Addons", "version": "0.0.0", "private": false, "publishConfig": { @@ -15,7 +15,7 @@ "repository": { "type": "git", "url": "https://github.com/backstage/backstage", - "directory": "packages/techdocs-addons" + "directory": "plugins/techdocs-react" }, "keywords": [ "backstage", diff --git a/packages/techdocs-addons/src/addons.tsx b/plugins/techdocs-react/src/addons.tsx similarity index 100% rename from packages/techdocs-addons/src/addons.tsx rename to plugins/techdocs-react/src/addons.tsx diff --git a/packages/techdocs-addons/src/index.ts b/plugins/techdocs-react/src/index.ts similarity index 100% rename from packages/techdocs-addons/src/index.ts rename to plugins/techdocs-react/src/index.ts diff --git a/packages/techdocs-addons/src/types.ts b/plugins/techdocs-react/src/types.ts similarity index 97% rename from packages/techdocs-addons/src/types.ts rename to plugins/techdocs-react/src/types.ts index 9775e9a10e..d50e78623b 100644 --- a/packages/techdocs-addons/src/types.ts +++ b/plugins/techdocs-react/src/types.ts @@ -68,7 +68,7 @@ export enum TechDocsAddonLocations { * the react component that would be rendered in place of all instances of * the markdown illustrated above. * - * The `@backstage/techdocs-addons` plugin would need to be updated to, in + * The `@backstage/plugin-techdocs-react` package would need to be updated to, in * cases where such addons had been registered, find all instances of the * rendered markdown (e.g. `CatalogEntityCard`) and * replace them with react portals to the addon component. diff --git a/plugins/techdocs/package.json b/plugins/techdocs/package.json index d383edc40b..d44e1da550 100644 --- a/plugins/techdocs/package.json +++ b/plugins/techdocs/package.json @@ -46,7 +46,7 @@ "@backstage/plugin-catalog-react": "^1.0.1-next.2", "@backstage/plugin-catalog": "^1.1.0-next.2", "@backstage/plugin-search": "^0.7.5-next.0", - "@backstage/techdocs-addons": "^0.0.0", + "@backstage/plugin-techdocs-react": "^0.0.0", "@backstage/version-bridge": "^1.0.0", "@backstage/theme": "^0.2.15", "@material-ui/core": "^4.12.2", diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.tsx b/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.tsx index e26cd5a3d6..ea8493a183 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPage/TechDocsReaderPage.tsx @@ -19,7 +19,7 @@ import { useOutlet, useParams } from 'react-router-dom'; import { Page } from '@backstage/core-components'; import { CompoundEntityRef } from '@backstage/catalog-model'; -import { TECHDOCS_ADDONS_WRAPPER_KEY } from '@backstage/techdocs-addons'; +import { TECHDOCS_ADDONS_WRAPPER_KEY } from '@backstage/plugin-techdocs-react'; import { TechDocsReaderPageRenderFunction } from '../../../types'; diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx index 41bf6d3af7..ce4322f1c9 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPageContent/TechDocsReaderPageContent.tsx @@ -23,7 +23,7 @@ import { StylesProvider, jssPreset } from '@material-ui/styles'; import { useTechDocsAddons, TechDocsAddonLocations as locations, -} from '@backstage/techdocs-addons'; +} from '@backstage/plugin-techdocs-react'; import { CompoundEntityRef } from '@backstage/catalog-model'; import { Content, Progress } from '@backstage/core-components'; diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPageHeader/TechDocsReaderPageHeader.tsx b/plugins/techdocs/src/reader/components/TechDocsReaderPageHeader/TechDocsReaderPageHeader.tsx index 0658078411..0c705c5fa9 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPageHeader/TechDocsReaderPageHeader.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPageHeader/TechDocsReaderPageHeader.tsx @@ -23,7 +23,7 @@ import CodeIcon from '@material-ui/icons/Code'; import { TechDocsAddonLocations as locations, useTechDocsAddons, -} from '@backstage/techdocs-addons'; +} from '@backstage/plugin-techdocs-react'; import { EntityRefLink, EntityRefLinks, diff --git a/plugins/techdocs/src/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.tsx b/plugins/techdocs/src/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.tsx index 5e89a09fea..436bdbff9e 100644 --- a/plugins/techdocs/src/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.tsx +++ b/plugins/techdocs/src/reader/components/TechDocsReaderPageSubheader/TechDocsReaderPageSubheader.tsx @@ -21,7 +21,7 @@ import { Box, Toolbar, ToolbarProps, withStyles } from '@material-ui/core'; import { TechDocsAddonLocations as locations, useTechDocsAddons, -} from '@backstage/techdocs-addons'; +} from '@backstage/plugin-techdocs-react'; /** * Renders the reader page subheader. diff --git a/scripts/api-extractor.ts b/scripts/api-extractor.ts index 3d2d776262..946968c759 100644 --- a/scripts/api-extractor.ts +++ b/scripts/api-extractor.ts @@ -225,7 +225,6 @@ const NO_WARNING_PACKAGES = [ 'packages/integration', 'packages/integration-react', 'packages/search-common', - 'packages/techdocs-addons', 'packages/techdocs-common', 'packages/test-utils', 'packages/theme', @@ -261,6 +260,7 @@ const NO_WARNING_PACKAGES = [ 'plugins/techdocs', 'plugins/techdocs-backend', 'plugins/techdocs-node', + 'plugins/techdocs-react', 'plugins/tech-insights', 'plugins/tech-insights-backend', 'plugins/tech-insights-backend-module-jsonfc',