Recreate a shell of @backstage/techdocs-common for smooth deprecation process
Signed-off-by: Eric Peterson <ericpeterson@spotify.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-techdocs-node': patch
|
||||
---
|
||||
|
||||
Renamed `@backstage/techdocs-common` to `@backstage/plugin-techdocs-node`.
|
||||
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'@backstage/techdocs-common': patch
|
||||
---
|
||||
|
||||
**DEPRECATION**
|
||||
|
||||
The `@backstage/techdocs-common` package is being renamed `@backstage/plugin-techdocs-node`. We may continue to publish changes to `@backstage/techdocs-common` for a time, but will stop doing so in the near future. If you depend on this package, you should update your dependencies to point at the renamed package.
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
extends: [require.resolve('@backstage/cli/config/eslint.backend')],
|
||||
};
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,53 @@
|
||||
# @backstage/techdocs-common
|
||||
|
||||
**WARNING**: This package is moving to `@backstage/plugin-techdocs-node`.
|
||||
Please update any dependencies you may have, as this package will no longer be
|
||||
published or updated in the near future.
|
||||
|
||||
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](/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:
|
||||
|
||||
```js
|
||||
async () => {
|
||||
const preparedDir = await preparer.prepare(entity);
|
||||
|
||||
const parsedLocationAnnotation = getLocationForEntity(entity);
|
||||
const { resultDir } = await generator.run({
|
||||
directory: preparedDir,
|
||||
dockerClient: dockerClient,
|
||||
parsedLocationAnnotation,
|
||||
});
|
||||
|
||||
await publisher.publish({
|
||||
entity: entity,
|
||||
directory: resultDir,
|
||||
});
|
||||
};
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
Currently the build process is split up in these three stages.
|
||||
|
||||
- Preparers
|
||||
- Generators
|
||||
- Publishers
|
||||
|
||||
Preparers read your entity data and creates a working directory with your documentation source code. For example if you have set your `backstage.io/techdocs-ref` to `url:https://github.com/backstage/backstage.git` it will clone that repository to a temp folder and pass that on to the generator.
|
||||
|
||||
Generators takes the prepared source and runs the `techdocs-container` on it. It then passes on the output folder of that build to the publisher.
|
||||
|
||||
Publishers gets a folder path from the generator and publish it to your storage solution. Read documentation to know more about configuring storage solutions.
|
||||
http://backstage.io/docs/features/techdocs/configuration
|
||||
|
||||
Any of these can be extended. We want to extend our support to most of the storage providers (Publishers) and source code host providers (Preparers).
|
||||
@@ -0,0 +1,9 @@
|
||||
## API Report File for "@backstage/techdocs-common"
|
||||
|
||||
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
|
||||
|
||||
```ts
|
||||
export * from '@backstage/plugin-techdocs-node';
|
||||
|
||||
// (No @packageDocumentation comment for this package)
|
||||
```
|
||||
@@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "@backstage/techdocs-common",
|
||||
"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",
|
||||
"private": false,
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"main": "dist/index.cjs.js",
|
||||
"types": "dist/index.d.ts"
|
||||
},
|
||||
"backstage": {
|
||||
"role": "node-library"
|
||||
},
|
||||
"homepage": "https://backstage.io",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/backstage/backstage",
|
||||
"directory": "packages/techdocs-common"
|
||||
},
|
||||
"keywords": [
|
||||
"techdocs",
|
||||
"backstage"
|
||||
],
|
||||
"license": "Apache-2.0",
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "backstage-cli package build",
|
||||
"lint": "backstage-cli package lint",
|
||||
"test": "backstage-cli package test",
|
||||
"prepack": "backstage-cli package prepack",
|
||||
"postpack": "backstage-cli package postpack",
|
||||
"clean": "backstage-cli package clean",
|
||||
"start": "backstage-cli package start"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/backstage/backstage/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/plugin-techdocs-node": "^0.11.11"
|
||||
},
|
||||
"devDependencies": {},
|
||||
"jest": {
|
||||
"roots": [
|
||||
".."
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2020 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 * from '@backstage/plugin-techdocs-node';
|
||||
Reference in New Issue
Block a user