Merge branch 'master' into rugvip/test-port
This commit is contained in:
@@ -1,5 +1,16 @@
|
||||
# @backstage/plugin-todo
|
||||
|
||||
## 0.1.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- a125278b81: Refactor out the deprecated path and icon from RouteRefs
|
||||
- Updated dependencies
|
||||
- @backstage/catalog-model@0.9.7
|
||||
- @backstage/plugin-catalog-react@0.6.4
|
||||
- @backstage/core-components@0.7.4
|
||||
- @backstage/core-plugin-api@0.2.0
|
||||
|
||||
## 0.1.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -2,6 +2,77 @@
|
||||
|
||||
This plugin lists `// TODO` comments in source code. It currently exports a single component extension for use on entity pages.
|
||||
|
||||
## Setup
|
||||
|
||||
1. Run:
|
||||
|
||||
```bash
|
||||
# From your Backstage root directory
|
||||
yarn --cwd packages/app add @backstage/plugin-todo
|
||||
yarn --cwd packages/backend add @backstage/plugin-todo-backend
|
||||
```
|
||||
|
||||
2. Add the plugin backend:
|
||||
|
||||
In a new file named `todo.ts` under `backend/src/plugins`:
|
||||
|
||||
```js
|
||||
import { Router } from 'express';
|
||||
import { CatalogClient } from '@backstage/catalog-client';
|
||||
import {
|
||||
createRouter,
|
||||
TodoReaderService,
|
||||
TodoScmReader,
|
||||
} from '@backstage/plugin-todo-backend';
|
||||
import { PluginEnvironment } from '../types';
|
||||
|
||||
export default async function createPlugin({
|
||||
logger,
|
||||
reader,
|
||||
config,
|
||||
discovery,
|
||||
}: PluginEnvironment): Promise<Router> {
|
||||
const todoReader = TodoScmReader.fromConfig(config, {
|
||||
logger,
|
||||
reader,
|
||||
});
|
||||
const catalogClient = new CatalogClient({ discoveryApi: discovery });
|
||||
const todoService = new TodoReaderService({
|
||||
todoReader,
|
||||
catalogClient,
|
||||
});
|
||||
|
||||
return await createRouter({ todoService });
|
||||
}
|
||||
```
|
||||
|
||||
And then add to `packages/backend/src/index.ts`:
|
||||
|
||||
```js
|
||||
// In packages/backend/src/index.ts
|
||||
import todo from './plugins/todo';
|
||||
// ...
|
||||
async function main() {
|
||||
// ...
|
||||
const todoEnv = useHotMemoize(module, () => createEnv('todo'));
|
||||
// ...
|
||||
apiRouter.use('/todo', await todo(todoEnv));
|
||||
```
|
||||
|
||||
3. Add the plugin as a tab to your service entities:
|
||||
|
||||
```jsx
|
||||
// In packages/app/src/components/catalog/EntityPage.tsx
|
||||
import { EntityTodoContent } from '@backstage/plugin-todo';
|
||||
|
||||
const serviceEntityPage = (
|
||||
<EntityLayout>
|
||||
{/* other tabs... */}
|
||||
<EntityLayout.Route path="/todo" title="Todo">
|
||||
<EntityTodoContent />
|
||||
</EntityLayout.Route>
|
||||
```
|
||||
|
||||
## Format
|
||||
|
||||
The default parser uses [Leasot](https://github.com/pgilad/leasot), which supports a wide range of languages. By default it supports the `TODO` and `FIXME` tags, along with `@` prefix and author reference through with either a `(<name>)` suffix or trailing `/<name>`. For more information on how to configure the parser, see `@backstage/plugin-todo-backend`.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@backstage/plugin-todo",
|
||||
"description": "A Backstage plugin that lets you browse TODO comments in your source code",
|
||||
"version": "0.1.14",
|
||||
"version": "0.1.15",
|
||||
"main": "src/index.ts",
|
||||
"types": "src/index.ts",
|
||||
"license": "Apache-2.0",
|
||||
@@ -27,11 +27,11 @@
|
||||
"clean": "backstage-cli clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@backstage/catalog-model": "^0.9.5",
|
||||
"@backstage/core-components": "^0.7.3",
|
||||
"@backstage/core-plugin-api": "^0.1.13",
|
||||
"@backstage/catalog-model": "^0.9.7",
|
||||
"@backstage/core-components": "^0.7.4",
|
||||
"@backstage/core-plugin-api": "^0.2.0",
|
||||
"@backstage/errors": "^0.1.3",
|
||||
"@backstage/plugin-catalog-react": "^0.6.1",
|
||||
"@backstage/plugin-catalog-react": "^0.6.4",
|
||||
"@backstage/theme": "^0.2.13",
|
||||
"@material-ui/core": "^4.12.2",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
@@ -41,10 +41,10 @@
|
||||
"react-use": "^17.2.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@backstage/cli": "^0.8.2",
|
||||
"@backstage/core-app-api": "^0.1.20",
|
||||
"@backstage/dev-utils": "^0.2.12",
|
||||
"@backstage/test-utils": "^0.1.21",
|
||||
"@backstage/cli": "^0.9.0",
|
||||
"@backstage/core-app-api": "^0.1.22",
|
||||
"@backstage/dev-utils": "^0.2.13",
|
||||
"@backstage/test-utils": "^0.1.22",
|
||||
"@testing-library/jest-dom": "^5.10.1",
|
||||
"@testing-library/react": "^11.2.5",
|
||||
"@testing-library/user-event": "^13.1.8",
|
||||
|
||||
@@ -16,5 +16,5 @@
|
||||
import { createRouteRef } from '@backstage/core-plugin-api';
|
||||
|
||||
export const rootRouteRef = createRouteRef({
|
||||
title: 'todo',
|
||||
id: 'todo',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user