Use @backstage/plugin-techdocs-node instead of @backstage/techdocs-common

Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
Eric Peterson
2022-03-03 13:33:47 +01:00
parent 84a8788794
commit 91bf1e6c1a
34 changed files with 54 additions and 47 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
# @backstage/techdocs-common
# @backstage/plugin-techdocs-node
## 0.11.11
+5 -5
View File
@@ -1,15 +1,15 @@
# @backstage/techdocs-common
# @backstage/plugin-techdocs-node
Common functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli
Common node.js functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli
This package is used by `techdocs-backend` to serve docs from different types of publishers (Google GCS, Local, etc.).
It is also used to build docs and publish them to storage, by both `techdocs-backend` and `techdocs-cli`.
## Usage
Create a preparer instance from the [preparers available](/packages/techdocs-common/src/stages/prepare) at which takes an Entity instance.
Run the [docs generator](/packages/techdocs-common/src/stages/generate) on the prepared directory.
Publish the generated directory files to a [storage](/packages/techdocs-common/src/stages/publish) of your choice.
Create a preparer instance from the [preparers available](/plugins/techdocs-node/src/stages/prepare) at which takes an Entity instance.
Run the [docs generator](/plugins/techdocs-node/src/stages/generate) on the prepared directory.
Publish the generated directory files to a [storage](/plugins/techdocs-node/src/stages/publish) of your choice.
Example:
+1 -1
View File
@@ -1,4 +1,4 @@
## API Report File for "@backstage/techdocs-common"
## API Report File for "@backstage/plugin-techdocs-node"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "@backstage/techdocs-common",
"description": "Common functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli",
"name": "@backstage/plugin-techdocs-node",
"description": "Common node.js functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli",
"version": "0.11.11",
"main": "src/index.ts",
"types": "src/index.ts",
@@ -17,7 +17,7 @@
"repository": {
"type": "git",
"url": "https://github.com/backstage/backstage",
"directory": "packages/techdocs-common"
"directory": "plugins/techdocs-node"
},
"keywords": [
"techdocs",
@@ -51,7 +51,7 @@ import { ForwardedError } from '@backstage/errors';
export class TechdocsGenerator implements GeneratorBase {
/**
* The default docker image (and version) used to generate content. Public
* and static so that techdocs-common consumers can use the same version.
* and static so that techdocs-node consumers can use the same version.
*/
public static readonly defaultDockerImage = 'spotify/techdocs:v0.3.7';
private readonly logger: Logger;
@@ -24,7 +24,7 @@ import path from 'path';
import fs from 'fs-extra';
import { AwsS3Publish } from './awsS3';
// NOTE: /packages/techdocs-common/__mocks__ is being used to mock aws-sdk client library
// NOTE: /plugins/techdocs-node/__mocks__ is being used to mock aws-sdk client library
const rootDir = (global as any).rootDir; // Set by setupTests.ts
@@ -24,7 +24,7 @@ import path from 'path';
import fs from 'fs-extra';
import { AzureBlobStoragePublish } from './azureBlobStorage';
// NOTE: /packages/techdocs-common/__mocks__ is being used to mock Azure client library
// NOTE: /plugins/techdocs-node/__mocks__ is being used to mock Azure client library
const rootDir = (global as any).rootDir; // Set by setupTests.ts
@@ -24,7 +24,7 @@ import path from 'path';
import fs from 'fs-extra';
import { GoogleGCSPublish } from './googleStorage';
// NOTE: /packages/techdocs-common/__mocks__ is being used to mock Google Cloud Storage client library
// NOTE: /plugins/techdocs-node/__mocks__ is being used to mock Google Cloud Storage client library
const rootDir = (global as any).rootDir; // Set by setupTests.ts
@@ -49,7 +49,7 @@ try {
);
} catch (err) {
// This will most probably never be used.
// The try/catch is introduced so that techdocs-cli can import @backstage/techdocs-common
// The try/catch is introduced so that techdocs-cli can import @backstage/plugin-techdocs-node
// on CI/CD without installing techdocs backend plugin.
staticDocsDir = os.tmpdir();
}
@@ -29,7 +29,7 @@ import path from 'path';
import { OpenStackSwiftPublish } from './openStackSwift';
import { PublisherBase, TechDocsMetadata } from './types';
// NOTE: /packages/techdocs-common/__mocks__ is being used to mock @trendyol-js/openstack-swift-sdk client library
// NOTE: /plugins/techdocs-node/__mocks__ is being used to mock @trendyol-js/openstack-swift-sdk client library
const createMockEntity = (annotations = {}): Entity => {
return {
@@ -153,7 +153,7 @@ export interface PublisherBase {
* `techdocs-cli` version `{0.x.y}` and `techdocs-backend` version `{0.x.y}`.
*
* Implementation of this method is unnecessary in publishers introduced
* after version `{0.x.y}` of `techdocs-common`.
* after version `{0.x.y}` of `techdocs-node`.
*/
migrateDocsCase?(migrateRequest: MigrateRequest): Promise<void>;
}