# @kevinbds/techdocs-common

> Common functionalities for TechDocs, to be shared between techdocs-backend plugin and techdocs-cli

Latest version **0.11.9** (published 2022-06-06) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @kevinbds/techdocs-common
pnpm add @kevinbds/techdocs-common
yarn add @kevinbds/techdocs-common
bun add @kevinbds/techdocs-common
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; high quality score; popular repo.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 0.11.9 |
| Published | 2022-06-06 |
| First published | 2022-06-03 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 22 |
| Unpacked size | 266.9 KB |
| Known vulnerabilities | 0 (+5 in 5 direct dependencies) |
| Install scripts | no |
| GitHub stars | 34376 |
| Maintainers | kevinbds |
| Keywords | techdocs, backstage |

## Links

- npm: https://www.npmjs.com/package/@kevinbds/techdocs-common
- Repository: https://github.com/backstage/backstage
- Homepage: https://backstage.io/
- Issues: https://github.com/backstage/backstage/issues
- npm.io page: https://npm.io/package/@kevinbds/techdocs-common

## Dependencies (22)

- [json5](https://npm.io/package/json5.md) ^2.1.3
- [aws-sdk](https://npm.io/package/aws-sdk.md) ^2.840.0
- [express](https://npm.io/package/express.md) ^4.17.1
- [js-yaml](https://npm.io/package/js-yaml.md) ^4.0.0
- [mock-fs](https://npm.io/package/mock-fs.md) ^5.1.0
- [p-limit](https://npm.io/package/p-limit.md) ^3.1.0
- [winston](https://npm.io/package/winston.md) ^3.2.1
- [fs-extra](https://npm.io/package/fs-extra.md) 9.1.0
- [mime-types](https://npm.io/package/mime-types.md) ^2.1.27
- [git-url-parse](https://npm.io/package/git-url-parse.md) ^11.6.0
- [@types/express](https://npm.io/package/@types/express.md) ^4.17.6
- [@azure/identity](https://npm.io/package/@azure/identity.md) ^2.0.1
- [@backstage/config](https://npm.io/package/@backstage/config.md) ^0.1.13
- [@backstage/errors](https://npm.io/package/@backstage/errors.md) ^0.2.0
- [recursive-readdir](https://npm.io/package/recursive-readdir.md) ^2.2.2
- [@azure/storage-blob](https://npm.io/package/@azure/storage-blob.md) ^12.5.0
- [@google-cloud/storage](https://npm.io/package/@google-cloud/storage.md) ^5.6.0
- [@backstage/integration](https://npm.io/package/@backstage/integration.md) ^0.7.2
- [@backstage/catalog-model](https://npm.io/package/@backstage/catalog-model.md) ^0.9.10
- [@backstage/search-common](https://npm.io/package/@backstage/search-common.md) ^0.2.2
- [@backstage/backend-common](https://npm.io/package/@backstage/backend-common.md) ^0.10.6
- [@trendyol-js/openstack-swift-sdk](https://npm.io/package/@trendyol-js/openstack-swift-sdk.md) ^0.0.5

## Recent versions

- 0.11.9 (latest) — 2022-06-06
- 0.11.8 — 2022-06-06
- 0.11.7 — 2022-06-06
- 0.11.6 — 2022-06-03

## README

# @kevinbds/techdocs-common

Common 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.

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 `github: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).

---
_Source: https://npm.io/package/@kevinbds/techdocs-common · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
