Skip to content

Commit 883622a

Browse files
committed
add readme page from scratch
1 parent 59b7635 commit 883622a

File tree

5 files changed

+27
-3
lines changed

5 files changed

+27
-3
lines changed

backstage/packages/app/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"cy:run": "cypress run --browser chrome"
1919
},
2020
"dependencies": {
21+
"@axis-backstage/plugin-readme": "^0.7.1",
2122
"@backstage/app-defaults": "^1.4.5",
2223
"@backstage/catalog-model": "^1.4.3",
2324
"@backstage/cli": "^0.26.2",
@@ -82,4 +83,4 @@
8283
"files": [
8384
"dist"
8485
]
85-
}
86+
}

backstage/packages/app/src/components/catalog/EntityPage.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ import {
6969
import { Button, Grid } from '@material-ui/core';
7070
import React from 'react';
7171
import { EntityAboutCard } from '../AboutCard/AboutCard';
72+
import { ReadmeCard } from '@axis-backstage/plugin-readme';
7273

7374
const TECHDOCS_ANNOTATION = 'backstage.io/techdocs-ref';
7475
const ANNOTATIONS_DOCS_URL =
@@ -147,9 +148,12 @@ const entityWarningContent = (
147148
const overviewContent = (
148149
<Grid container spacing={3} alignItems="stretch">
149150
{entityWarningContent}
150-
<Grid item md={6}>
151+
<Grid item xs={12} md={6}>
151152
<EntityAboutCard variant="gridItem" />
152153
</Grid>
154+
<Grid item xs={12} md={4}>
155+
<ReadmeCard />
156+
</Grid>
153157
<Grid item md={6} xs={12}>
154158
<EntityCatalogGraphCard variant="gridItem" height={400} />
155159
</Grid>

backstage/packages/backend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"build-image": "docker build ../.. -f Dockerfile --tag backstage"
1717
},
1818
"dependencies": {
19+
"@axis-backstage/plugin-readme-backend": "^0.6.0",
1920
"@backstage/backend-common": "^0.23.2",
2021
"@backstage/backend-tasks": "^0.5.12",
2122
"@backstage/catalog-client": "^1.4.6",
@@ -56,4 +57,4 @@
5657
"files": [
5758
"dist"
5859
]
59-
}
60+
}

backstage/packages/backend/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import auth from './plugins/auth';
1919
import catalog from './plugins/catalog';
2020
import gitlab from './plugins/gitlab';
2121
import proxy from './plugins/proxy';
22+
import readme from './plugins/readme';
2223
import scaffolder from './plugins/scaffolder';
2324
import search from './plugins/search';
2425
import techdocs from './plugins/techdocs';
@@ -74,6 +75,7 @@ async function main() {
7475
const scaffolderEnv = useHotMemoize(module, () => createEnv('scaffolder'));
7576
const authEnv = useHotMemoize(module, () => createEnv('auth'));
7677
const proxyEnv = useHotMemoize(module, () => createEnv('proxy'));
78+
const readmeEnv = useHotMemoize(module, () => createEnv('readme'));
7779
const techdocsEnv = useHotMemoize(module, () => createEnv('techdocs'));
7880
const searchEnv = useHotMemoize(module, () => createEnv('search'));
7981
const gitlabEnv = useHotMemoize(module, () => createEnv('gitlab'));
@@ -84,6 +86,7 @@ async function main() {
8486
apiRouter.use('/auth', await auth(authEnv));
8587
apiRouter.use('/techdocs', await techdocs(techdocsEnv));
8688
apiRouter.use('/proxy', await proxy(proxyEnv));
89+
apiRouter.use('/readme', await proxy(readmeEnv));
8790
apiRouter.use('/search', await search(searchEnv));
8891
apiRouter.use('/gitlab', await gitlab(gitlabEnv));
8992

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { createRouter } from '@axis-backstage/plugin-readme-backend';
2+
import { Router } from 'express';
3+
import { PluginEnvironment } from '../types';
4+
5+
export default async function createPlugin(
6+
env: PluginEnvironment,
7+
): Promise<Router> {
8+
return await createRouter({
9+
logger: env.logger,
10+
config: env.config,
11+
reader: env.reader,
12+
discovery: env.discovery,
13+
tokenManager: env.tokenManager,
14+
});
15+
}

0 commit comments

Comments
 (0)