@axis-backstage/plugin-readme-backend 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +12 -28
- package/package.json +3 -3
package/CHANGELOG.md
ADDED
package/README.md
CHANGED
|
@@ -2,19 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Welcome to the readme backend plugin!
|
|
4
4
|
|
|
5
|
-
The plugin retrieves README
|
|
6
|
-
|
|
7
|
-
The plugin searches for a README file in the entity source location with any of the following file types:
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
{ name: 'README', type: 'text/plain' },
|
|
11
|
-
{ name: 'README.md', type: 'text/markdown' },
|
|
12
|
-
{ name: 'README.rst', type: 'text/plain' },
|
|
13
|
-
{ name: 'README.txt', type: 'text/plain' },
|
|
14
|
-
{ name: 'README.MD', type: 'text/markdown' },
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
The plugin can also handle symlinks.
|
|
5
|
+
The plugin retrieves README files from the entity source location. The corresponding frontend plugin responsible for displaying this information is the [Readme plugin](https://github.com/AxisCommunications/backstage-plugins/blob/main/plugins/readme).
|
|
18
6
|
|
|
19
7
|
## Setup
|
|
20
8
|
|
|
@@ -26,7 +14,7 @@ Install the plugin by following the example below:
|
|
|
26
14
|
|
|
27
15
|
```bash
|
|
28
16
|
# From your Backstage root directory
|
|
29
|
-
yarn
|
|
17
|
+
yarn --cwd packages/backend add @axis-backstage/plugin-readme-backend
|
|
30
18
|
```
|
|
31
19
|
|
|
32
20
|
### Integrating
|
|
@@ -40,16 +28,16 @@ Here's how to get the backend plugin up and running:
|
|
|
40
28
|
import { Router } from 'express';
|
|
41
29
|
import { PluginEnvironment } from '../types';
|
|
42
30
|
|
|
43
|
-
|
|
44
|
-
|
|
31
|
+
export default async function createPlugin(
|
|
32
|
+
env: PluginEnvironment,
|
|
45
33
|
): Promise<Router> {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
34
|
+
return await createRouter({
|
|
35
|
+
logger: env.logger,
|
|
36
|
+
config: env.config,
|
|
37
|
+
reader: env.reader,
|
|
38
|
+
discovery: env.discovery,
|
|
39
|
+
tokenManager: env.tokenManager,
|
|
40
|
+
});
|
|
53
41
|
}
|
|
54
42
|
```
|
|
55
43
|
|
|
@@ -68,10 +56,6 @@ Here's how to get the backend plugin up and running:
|
|
|
68
56
|
}
|
|
69
57
|
```
|
|
70
58
|
|
|
71
|
-
3. Now run `yarn start-backend` from the repo root.
|
|
72
|
-
|
|
73
|
-
4. In another terminal, run the command: `curl localhost:7007/api/readme/health`. The request should return `{"status":"ok"}`.
|
|
74
|
-
|
|
75
59
|
### New Backend System
|
|
76
60
|
|
|
77
61
|
The Readme backend plugin has support for the [new backend system](https://backstage.io/docs/backend-system/). Here is how you can set it up:
|
|
@@ -111,4 +95,4 @@ annotations:
|
|
|
111
95
|
|
|
112
96
|
#### README Not Found for Entity
|
|
113
97
|
|
|
114
|
-
This error indicates that no README, README.md, README.rst, README.txt, or README.MD file was found for that entity. To resolve this error, ensure that there is a README file located in the entity source location with one of the following formats: **md**, **rst**, or **txt**.
|
|
98
|
+
This error indicates that no README, README.md, README.rst, README.txt, or README.MD file was found for that entity. To resolve this error, ensure that there is a README file located in the entity source location with one of the following formats: **md**, **rst**, or **txt**. The plugin can also handle symlinks.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axis-backstage/plugin-readme-backend",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"main": "dist/index.cjs.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"postpack": "backstage-cli package postpack"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@backstage/backend-common": "^0.19.
|
|
25
|
+
"@backstage/backend-common": "^0.19.9",
|
|
26
26
|
"@backstage/backend-plugin-api": "^0.6.7",
|
|
27
27
|
"@backstage/catalog-client": "^1.4.6",
|
|
28
28
|
"@backstage/catalog-model": "^1.4.3",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"yn": "^4.0.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@backstage/cli": "^0.
|
|
40
|
+
"@backstage/cli": "^0.24.0",
|
|
41
41
|
"@types/supertest": "^2.0.12",
|
|
42
42
|
"msw": "^1.0.0",
|
|
43
43
|
"supertest": "^6.2.4"
|