diff --git a/.changeset/large-feet-wash.md b/.changeset/large-feet-wash.md index 15e3c54b42..d663661725 100644 --- a/.changeset/large-feet-wash.md +++ b/.changeset/large-feet-wash.md @@ -1,6 +1,5 @@ --- '@backstage/plugin-techdocs-backend': minor -'example-backend-next': minor --- -Expose the techdocs-backend plugin using the new plugin system +Added alpha export of the `techdocsPlugin` using the new backend system diff --git a/packages/backend-next/src/index.ts b/packages/backend-next/src/index.ts index 0f7af110e9..8f8984b192 100644 --- a/packages/backend-next/src/index.ts +++ b/packages/backend-next/src/index.ts @@ -19,7 +19,7 @@ import { catalogModuleTemplateKind } from '@backstage/plugin-scaffolder-backend/ import { createBackend } from '@backstage/backend-defaults'; import { appPlugin } from '@backstage/plugin-app-backend/alpha'; import { todoPlugin } from '@backstage/plugin-todo-backend'; -import { techdocsPlugin } from '@backstage/plugin-techdocs-backend'; +import { techdocsPlugin } from '@backstage/plugin-techdocs-backend/alpha'; const backend = createBackend(); diff --git a/plugins/techdocs-backend/alpha-api-report.md b/plugins/techdocs-backend/alpha-api-report.md new file mode 100644 index 0000000000..16db84c216 --- /dev/null +++ b/plugins/techdocs-backend/alpha-api-report.md @@ -0,0 +1,12 @@ +## API Report File for "@backstage/plugin-techdocs-backend" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts +import { BackendFeature } from '@backstage/backend-plugin-api'; + +// @alpha +export const techdocsPlugin: () => BackendFeature; + +// (No @packageDocumentation comment for this package) +``` diff --git a/plugins/techdocs-backend/api-report.md b/plugins/techdocs-backend/api-report.md index fe8db9a135..1f6aa1d66a 100644 --- a/plugins/techdocs-backend/api-report.md +++ b/plugins/techdocs-backend/api-report.md @@ -5,7 +5,6 @@ ```ts /// -import { BackendFeature } from '@backstage/backend-plugin-api'; import { CatalogApi } from '@backstage/catalog-client'; import { CatalogClient } from '@backstage/catalog-client'; import { Config } from '@backstage/config'; @@ -130,8 +129,5 @@ export type TechDocsCollatorOptions = { export { TechDocsDocument }; -// @public -export const techdocsPlugin: () => BackendFeature; - export * from '@backstage/plugin-techdocs-node'; ``` diff --git a/plugins/techdocs-backend/package.json b/plugins/techdocs-backend/package.json index 6389487eec..1d2f4400eb 100644 --- a/plugins/techdocs-backend/package.json +++ b/plugins/techdocs-backend/package.json @@ -10,6 +10,21 @@ "main": "dist/index.cjs.js", "types": "dist/index.d.ts" }, + "exports": { + ".": "./src/index.ts", + "./alpha": "./src/alpha.ts", + "./package.json": "./package.json" + }, + "typesVersions": { + "*": { + "alpha": [ + "src/alpha.ts" + ], + "package.json": [ + "package.json" + ] + } + }, "backstage": { "role": "backend-plugin" }, diff --git a/plugins/techdocs-backend/src/alpha.ts b/plugins/techdocs-backend/src/alpha.ts new file mode 100644 index 0000000000..1a36c5a1f5 --- /dev/null +++ b/plugins/techdocs-backend/src/alpha.ts @@ -0,0 +1,16 @@ +/* + * Copyright 2023 The Backstage Authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +export { techdocsPlugin } from './plugin'; diff --git a/plugins/techdocs-backend/src/index.ts b/plugins/techdocs-backend/src/index.ts index 06259d3d3c..dc5d87d1b3 100644 --- a/plugins/techdocs-backend/src/index.ts +++ b/plugins/techdocs-backend/src/index.ts @@ -37,7 +37,6 @@ export type { TechDocsCollatorFactoryOptions, TechDocsCollatorOptions, } from './search'; -export { techdocsPlugin } from './plugin'; /** * @deprecated Use directly from @backstage/plugin-techdocs-node diff --git a/plugins/techdocs-backend/src/plugin.ts b/plugins/techdocs-backend/src/plugin.ts index 7cffcc8fbd..4b0ebbe366 100644 --- a/plugins/techdocs-backend/src/plugin.ts +++ b/plugins/techdocs-backend/src/plugin.ts @@ -30,11 +30,11 @@ import { Publisher, } from '@backstage/plugin-techdocs-node'; import Docker from 'dockerode'; -import { createRouter } from './service'; +import { createRouter } from '@backstage/plugin-techdocs-backend'; /** * The TechDocs plugin is responsible for serving and building documentation for any entity. - * @public + * @alpha */ export const techdocsPlugin = createBackendPlugin({ pluginId: 'techdocs-backend',