Merge branch 'master' into techdocs/remove-warnings

Signed-off-by: Morgan Bentell <morgan.bentell@gmail.com>
This commit is contained in:
Morgan Bentell
2023-03-16 16:18:32 +01:00
committed by GitHub
1099 changed files with 36089 additions and 25992 deletions
+52
View File
@@ -1,5 +1,57 @@
# @backstage/plugin-techdocs-backend
## 1.6.0
### Minor Changes
- 92b495328bd: Introduced alpha export of the `techdocsPlugin` using the new backend system.
### Patch Changes
- 40298b02778: Techdocs backend explains a bit more about what might have caused the docs not being found when building techdocs.
- 928a12a9b3e: Internal refactor of `/alpha` exports.
- 52b0022dab7: Updated dependency `msw` to `^1.0.0`.
- Updated dependencies
- @backstage/catalog-client@1.4.0
- @backstage/plugin-techdocs-node@1.6.0
- @backstage/backend-common@0.18.3
- @backstage/errors@1.1.5
- @backstage/backend-plugin-api@0.5.0
- @backstage/catalog-model@1.2.1
- @backstage/plugin-catalog-common@1.0.12
- @backstage/integration@1.4.3
- @backstage/plugin-permission-common@0.7.4
- @backstage/config@1.0.7
- @backstage/plugin-search-common@1.2.2
## 1.5.4-next.2
### Patch Changes
- Updated dependencies
- @backstage/plugin-techdocs-node@1.6.0-next.2
- @backstage/backend-common@0.18.3-next.2
- @backstage/config@1.0.7-next.0
- @backstage/integration@1.4.3-next.0
## 1.5.4-next.1
### Patch Changes
- 40298b02778: Techdocs backend explains a bit more about what might have caused the docs not being found when building techdocs.
- 52b0022dab7: Updated dependency `msw` to `^1.0.0`.
- Updated dependencies
- @backstage/errors@1.1.5-next.0
- @backstage/plugin-techdocs-node@1.6.0-next.1
- @backstage/backend-common@0.18.3-next.1
- @backstage/catalog-client@1.4.0-next.1
- @backstage/integration@1.4.3-next.0
- @backstage/plugin-permission-common@0.7.4-next.0
- @backstage/config@1.0.7-next.0
- @backstage/catalog-model@1.2.1-next.1
- @backstage/plugin-catalog-common@1.0.12-next.1
- @backstage/plugin-search-common@1.2.2-next.0
## 1.5.4-next.0
### Patch Changes
@@ -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)
```
@@ -35,7 +35,7 @@ Check out the [Markdown Guide](https://www.markdownguide.org/) to learn more abo
simply create documentation.
You can also learn more about how to configure and setup this documentation in Backstage,
[read up on the TechDocs Overview](https://backstage.io/docs/features/techdocs/techdocs-overview).
[read up on the TechDocs Overview](https://backstage.io/docs/features/techdocs/).
## Image Example
+17 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@backstage/plugin-techdocs-backend",
"description": "The Backstage backend plugin that renders technical documentation for your components",
"version": "1.5.4-next.0",
"version": "1.6.0",
"main": "src/index.ts",
"types": "src/index.ts",
"license": "Apache-2.0",
@@ -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"
},
@@ -34,6 +49,7 @@
},
"dependencies": {
"@backstage/backend-common": "workspace:^",
"@backstage/backend-plugin-api": "workspace:^",
"@backstage/catalog-client": "workspace:^",
"@backstage/catalog-model": "workspace:^",
"@backstage/config": "workspace:^",
+16
View File
@@ -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';
+95
View File
@@ -0,0 +1,95 @@
/*
* 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.
*/
import {
DockerContainerRunner,
loggerToWinstonLogger,
cacheToPluginCacheManager,
} from '@backstage/backend-common';
import {
coreServices,
createBackendPlugin,
} from '@backstage/backend-plugin-api';
import {
Preparers,
Generators,
Publisher,
} from '@backstage/plugin-techdocs-node';
import Docker from 'dockerode';
import { createRouter } from '@backstage/plugin-techdocs-backend';
/**
* The TechDocs plugin is responsible for serving and building documentation for any entity.
* @alpha
*/
export const techdocsPlugin = createBackendPlugin({
pluginId: 'techdocs',
register(env) {
env.registerInit({
deps: {
config: coreServices.config,
logger: coreServices.logger,
urlReader: coreServices.urlReader,
http: coreServices.httpRouter,
discovery: coreServices.discovery,
cache: coreServices.cache,
},
async init({ config, logger, urlReader, http, discovery, cache }) {
const winstonLogger = loggerToWinstonLogger(logger);
// Preparers are responsible for fetching source files for documentation.
const preparers = await Preparers.fromConfig(config, {
reader: urlReader,
logger: winstonLogger,
});
// Docker client (conditionally) used by the generators, based on techdocs.generators config.
const dockerClient = new Docker();
const containerRunner = new DockerContainerRunner({ dockerClient });
// Generators are used for generating documentation sites.
const generators = await Generators.fromConfig(config, {
logger: winstonLogger,
containerRunner,
});
// Publisher is used for
// 1. Publishing generated files to storage
// 2. Fetching files from storage and passing them to TechDocs frontend.
const publisher = await Publisher.fromConfig(config, {
logger: winstonLogger,
discovery: discovery,
});
// checks if the publisher is working and logs the result
await publisher.getReadiness();
const cacheManager = cacheToPluginCacheManager(cache);
http.use(
await createRouter({
logger: winstonLogger,
cache: cacheManager,
preparers,
generators,
publisher,
config,
discovery,
}),
);
},
});
},
});