From 89856dad91043ef078ebe4cbd78fc2578c96d260 Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 18 Apr 2024 10:11:45 +0200 Subject: [PATCH 1/2] Patch from PR #24351 Signed-off-by: blam --- .changeset/migrate-1713426449436.md | 6 ++ plugins/todo-backend/README.md | 79 +------------------- plugins/todo-backend/package.json | 6 +- plugins/todo/README.md | 108 +--------------------------- plugins/todo/package.json | 6 +- 5 files changed, 18 insertions(+), 187 deletions(-) create mode 100644 .changeset/migrate-1713426449436.md diff --git a/.changeset/migrate-1713426449436.md b/.changeset/migrate-1713426449436.md new file mode 100644 index 0000000000000..cd37254fb799a --- /dev/null +++ b/.changeset/migrate-1713426449436.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-todo': patch +'@backstage/plugin-todo-backend': patch +--- + +These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository. diff --git a/plugins/todo-backend/README.md b/plugins/todo-backend/README.md index 0aec607b93295..3e2558bb51895 100644 --- a/plugins/todo-backend/README.md +++ b/plugins/todo-backend/README.md @@ -1,78 +1,3 @@ -# @backstage/plugin-todo-backend +# Deprecated -Backend for the `@backstage/plugin-todo` plugin. Assists in scanning for and listing `// TODO` comments in source code repositories. - -## Installation - -Install the `@backstage/plugin-todo-backend` package in your backend packages, and then integrate the plugin using the following default setup for `src/plugins/todo.ts`: - -```ts -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( - env: PluginEnvironment, -): Promise { - const todoReader = TodoScmReader.fromConfig(env.config, { - logger: env.logger, - reader: env.reader, - }); - - const catalogClient = new CatalogClient({ - discoveryApi: env.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)); -``` - -## Scanned Files - -The included `TodoReaderService` and `TodoScmReader` works by getting the entity source location from the catalog. - -The location source code is determined automatically. In case of the source code of the component is not in the same place of the entity YAML file, you can explicitly set the value of the [`backstage.io/source-location`](https://backstage.io/docs/features/software-catalog/well-known-annotations#backstageiosource-location) annotation of the entity, and if that is missing it falls back to the [`backstage.io/managed-by-location `](https://backstage.io/docs/features/software-catalog/well-known-annotations#backstageiomanaged-by-location) annotation. Only `url` locations are currently supported, meaning locally configured `file` locations won't work. Also note that dot-files and folders are ignored. - -## Parser Configuration - -The `TodoScmReader` accepts a `TodoParser` option, which can be used to configure your own parser. The default one is based on [Leasot](https://github.com/pgilad/leasot) and supports a wide range of languages. You can add to the list of supported tags by configuring your own version of the built-in parser, for example: - -```ts -import { - TodoScmReader, - createTodoParser, -} from '@backstage/plugin-todo-backend'; - -// ... - -const todoReader = TodoScmReader.fromConfig(env.config, { - logger: env.logger, - reader: env.reader, - parser: createTodoParser({ - additionalTags: ['NOTE', 'XXX'], - }), -}); -``` +This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-todo-backend` instead. diff --git a/plugins/todo-backend/package.json b/plugins/todo-backend/package.json index cb6b3787c1864..043c523a46e9b 100644 --- a/plugins/todo-backend/package.json +++ b/plugins/todo-backend/package.json @@ -3,7 +3,8 @@ "version": "0.3.16", "description": "A Backstage backend plugin that lets you browse TODO comments in your source code", "backstage": { - "role": "backend-plugin" + "role": "backend-plugin", + "moved": "@backstage-community/plugin-todo-backend" }, "publishConfig": { "access": "public", @@ -53,5 +54,6 @@ "@backstage/repo-tools": "workspace:^", "@types/supertest": "^2.0.8", "supertest": "^6.1.3" - } + }, + "deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-todo-backend instead." } diff --git a/plugins/todo/README.md b/plugins/todo/README.md index fd3a7f4733c2a..01be891a423d7 100644 --- a/plugins/todo/README.md +++ b/plugins/todo/README.md @@ -1,107 +1,3 @@ -# @backstage/plugin-todo +# Deprecated -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( - env: PluginEnvironment, -): Promise { - const todoReader = TodoScmReader.fromConfig(env.config, { - logger: env.logger, - reader: env.reader, - }); - - const catalogClient = new CatalogClient({ - discoveryApi: env.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 = ( - - {/* other tabs... */} - - - -``` - -## 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 `()` suffix or trailing `/`. For more information on how to configure the parser, see `@backstage/plugin-todo-backend`. - -Below are some examples of formats that are supported by default: - -```ts -// TODO: Ideally this would be working - -// TODO(Rugvip): Not sure why this works, investigate - -// @todo: This worked last Monday /Rugvip - -// FIXME Nobody knows why this is here -``` - -Note that trailing comments are not supported, the following TODO would not be listed: - -```ts -function reverse(str: string) { - return str.reverse(); // TODO: optimize -} -``` - -The scanner also ignores all dot-files and directories, meaning TODOs inside of those will not be listed. - -## Extensions - -| name | description | -| ------------------- | ------------------------------------------------------------------------------- | -| `EntityTodoContent` | Content for an entity page, showing a table of TODO items for the given entity. | +This package has been moved to the [backstage-community/plugins](https://github.com/backstage/community-plugins) repository. Migrate to using `@backstage-community/plugin-todo` instead. diff --git a/plugins/todo/package.json b/plugins/todo/package.json index 2574b8347407f..5a2764c5b16fd 100644 --- a/plugins/todo/package.json +++ b/plugins/todo/package.json @@ -3,7 +3,8 @@ "version": "0.2.38", "description": "A Backstage plugin that lets you browse TODO comments in your source code", "backstage": { - "role": "frontend-plugin" + "role": "frontend-plugin", + "moved": "@backstage-community/plugin-todo" }, "publishConfig": { "access": "public", @@ -54,5 +55,6 @@ "react": "^16.13.1 || ^17.0.0 || ^18.0.0", "react-dom": "^16.13.1 || ^17.0.0 || ^18.0.0", "react-router-dom": "6.0.0-beta.0 || ^6.3.0" - } + }, + "deprecated": "This package has been moved to the backstage/community-plugins repository. You should migrate to using @backstage-community/plugin-todo instead." } From 841349f0b1ed4a094f817fb0983457669302fcda Mon Sep 17 00:00:00 2001 From: blam Date: Thu, 18 Apr 2024 10:12:22 +0200 Subject: [PATCH 2/2] Generate Release Signed-off-by: blam --- .changeset/migrate-1713426449436.md | 6 ------ package.json | 2 +- packages/app-next/CHANGELOG.md | 7 +++++++ packages/app-next/package.json | 2 +- packages/app/CHANGELOG.md | 7 +++++++ packages/app/package.json | 2 +- packages/backend-next/CHANGELOG.md | 7 +++++++ packages/backend-next/package.json | 2 +- packages/backend/CHANGELOG.md | 8 ++++++++ packages/backend/package.json | 2 +- plugins/todo-backend/CHANGELOG.md | 6 ++++++ plugins/todo-backend/package.json | 2 +- plugins/todo/CHANGELOG.md | 6 ++++++ plugins/todo/package.json | 2 +- 14 files changed, 48 insertions(+), 13 deletions(-) delete mode 100644 .changeset/migrate-1713426449436.md diff --git a/.changeset/migrate-1713426449436.md b/.changeset/migrate-1713426449436.md deleted file mode 100644 index cd37254fb799a..0000000000000 --- a/.changeset/migrate-1713426449436.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@backstage/plugin-todo': patch -'@backstage/plugin-todo-backend': patch ---- - -These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository. diff --git a/package.json b/package.json index 7ccbce417d3f1..3109d60f77c30 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "root", - "version": "1.26.0", + "version": "1.26.1", "private": true, "repository": { "type": "git", diff --git a/packages/app-next/CHANGELOG.md b/packages/app-next/CHANGELOG.md index 8b24a1e2d1269..e44221bfc687e 100644 --- a/packages/app-next/CHANGELOG.md +++ b/packages/app-next/CHANGELOG.md @@ -1,5 +1,12 @@ # example-app-next +## 0.0.11 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-todo@0.2.39 + ## 0.0.10 ### Patch Changes diff --git a/packages/app-next/package.json b/packages/app-next/package.json index d98cc91a57d7d..0569d74311353 100644 --- a/packages/app-next/package.json +++ b/packages/app-next/package.json @@ -1,6 +1,6 @@ { "name": "example-app-next", - "version": "0.0.10", + "version": "0.0.11", "private": true, "repository": { "type": "git", diff --git a/packages/app/CHANGELOG.md b/packages/app/CHANGELOG.md index 1d298af75235a..f5f95bf94ba3d 100644 --- a/packages/app/CHANGELOG.md +++ b/packages/app/CHANGELOG.md @@ -1,5 +1,12 @@ # example-app +## 0.2.97 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-todo@0.2.39 + ## 0.2.96 ### Patch Changes diff --git a/packages/app/package.json b/packages/app/package.json index f1911474e4b7e..3297f194fcdf6 100644 --- a/packages/app/package.json +++ b/packages/app/package.json @@ -1,6 +1,6 @@ { "name": "example-app", - "version": "0.2.96", + "version": "0.2.97", "backstage": { "role": "frontend" }, diff --git a/packages/backend-next/CHANGELOG.md b/packages/backend-next/CHANGELOG.md index 70dac3ac7f1bb..521b9a45768d5 100644 --- a/packages/backend-next/CHANGELOG.md +++ b/packages/backend-next/CHANGELOG.md @@ -1,5 +1,12 @@ # example-backend-next +## 0.0.26 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-todo-backend@0.3.17 + ## 0.0.25 ### Patch Changes diff --git a/packages/backend-next/package.json b/packages/backend-next/package.json index 757e4b269f342..a72d0559e8c1b 100644 --- a/packages/backend-next/package.json +++ b/packages/backend-next/package.json @@ -1,6 +1,6 @@ { "name": "example-backend-next", - "version": "0.0.25", + "version": "0.0.26", "main": "dist/index.cjs.js", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/packages/backend/CHANGELOG.md b/packages/backend/CHANGELOG.md index b0bf1a8b9107c..18bb203801504 100644 --- a/packages/backend/CHANGELOG.md +++ b/packages/backend/CHANGELOG.md @@ -1,5 +1,13 @@ # example-backend +## 0.2.98 + +### Patch Changes + +- Updated dependencies + - @backstage/plugin-todo-backend@0.3.17 + - example-app@0.2.97 + ## 0.2.97 ### Patch Changes diff --git a/packages/backend/package.json b/packages/backend/package.json index aa128febbbf3c..1b7986bb3312f 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "example-backend", - "version": "0.2.97", + "version": "0.2.98", "main": "dist/index.cjs.js", "types": "src/index.ts", "license": "Apache-2.0", diff --git a/plugins/todo-backend/CHANGELOG.md b/plugins/todo-backend/CHANGELOG.md index 3dad3cca275f1..e4b7fe01a0bc1 100644 --- a/plugins/todo-backend/CHANGELOG.md +++ b/plugins/todo-backend/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/plugin-todo-backend +## 0.3.17 + +### Patch Changes + +- 89856da: These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository. + ## 0.3.16 ### Patch Changes diff --git a/plugins/todo-backend/package.json b/plugins/todo-backend/package.json index 043c523a46e9b..ff85a8b748218 100644 --- a/plugins/todo-backend/package.json +++ b/plugins/todo-backend/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-todo-backend", - "version": "0.3.16", + "version": "0.3.17", "description": "A Backstage backend plugin that lets you browse TODO comments in your source code", "backstage": { "role": "backend-plugin", diff --git a/plugins/todo/CHANGELOG.md b/plugins/todo/CHANGELOG.md index c4941faee1483..e7d2cc8008004 100644 --- a/plugins/todo/CHANGELOG.md +++ b/plugins/todo/CHANGELOG.md @@ -1,5 +1,11 @@ # @backstage/plugin-todo +## 0.2.39 + +### Patch Changes + +- 89856da: These packages have been migrated to the [backstage/community-plugins](https://github.com/backstage/community-plugins) repository. + ## 0.2.38 ### Patch Changes diff --git a/plugins/todo/package.json b/plugins/todo/package.json index 5a2764c5b16fd..2b06897531a3a 100644 --- a/plugins/todo/package.json +++ b/plugins/todo/package.json @@ -1,6 +1,6 @@ { "name": "@backstage/plugin-todo", - "version": "0.2.38", + "version": "0.2.39", "description": "A Backstage plugin that lets you browse TODO comments in your source code", "backstage": { "role": "frontend-plugin",