Minor fixes in tech insights plugins readme

Signed-off-by: Jarek Łukow <jlukow@box.com>
This commit is contained in:
jluk-box
2021-11-25 12:27:35 +01:00
committed by Jarek Łukow
parent 63f3b46b86
commit c6c8b8e53e
3 changed files with 15 additions and 5 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-tech-insights-backend': patch
'@backstage/plugin-tech-insights-backend-module-jsonfc': patch
---
Minor fixes in Readme to make the examples more directly usable.
@@ -51,8 +51,10 @@ By default this implementation comes with an in-memory storage to store checks.
Checks for this FactChecker are constructed as [`json-rules-engine` compatible JSON rules](https://github.com/CacheControl/json-rules-engine/blob/master/docs/rules.md#conditions). A check could look like the following for example:
```ts
import { TechInsightJsonRuleCheck } from '../types';
import { JSON_RULE_ENGINE_CHECK_TYPE } from '../constants';
import {
JSON_RULE_ENGINE_CHECK_TYPE,
TechInsightJsonRuleCheck,
} from '@backstage/plugin-tech-insights-backend-module-jsonfc';
export const exampleCheck: TechInsightJsonRuleCheck = {
id: 'demodatacheck', // Unique identifier of this check
+5 -3
View File
@@ -42,7 +42,7 @@ export default async function createPlugin({
});
return await createRouter({
...(await builder.build()),
...(await builder),
logger,
config,
});
@@ -74,10 +74,10 @@ With the `techInsights.ts` router setup in place, add the router to
At this point the Tech Insights backend is installed in your backend package, but
you will not have any fact retrievers present in your application. To have the implemented FactRetrieverEngine within this package to be able to retrieve and store fact data into the database, you need to add these.
To create factRetrieverRegistration you need to implement `FactRetriever` interface defined in `@backstage/plugin-tech-insights-common` package. After you have implemented this interface you can wrap that into a registration object like follows:
To create factRetrieverRegistration you need to implement `FactRetriever` interface defined in `@backstage/plugin-tech-insights-node` package (see [Creating fact retrievers](#creating-fact-retrievers) for details). After you have implemented this interface you can wrap that into a registration object like follows:
```ts
import { createFactRetrieverRegistration } from './createFactRetriever';
import { createFactRetrieverRegistration } from '@backstage/plugin-tech-insights-backend';
const myFactRetriever = {
/**
@@ -134,6 +134,8 @@ A Fact Retriever consist of four required and one optional parts:
An example implementation of a FactRetriever could for example be as follows:
```ts
import { FactRetriever } from '@backstage/plugin-tech-insights-node';
const myFactRetriever: FactRetriever = {
id: 'documentation-number-factretriever', // unique identifier of the fact retriever
version: '0.1.1', // SemVer version number of this fact retriever schema. This should be incremented if the implementation changes