
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@backstage/plugin-todo-backend
Advanced tools
A Backstage backend plugin that lets you browse TODO comments in your source code
Backend for the @backstage/plugin-todo
plugin. Assists in scanning for and listing // TODO
comments in source code repositories.
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
:
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
:
// 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));
The included TodoReaderService
and TodoScmReader
works by reading source code of to the entity that is being viewed. The location source code is determined by the value of the backstage.io/source-location
annotation of the entity, and if that is missing it falls back to the backstage.io/managed-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.
The TodoScmReader
accepts a TodoParser
option, which can be used to configure your own parser. The default one is based on 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:
import {
TodoScmReader,
createTodoParser,
} from '@backstage/plugin-todo-backend';
// ...
const todoReader = TodoScmReader.fromConfig(config, {
logger,
reader,
parser: createTodoParser({
additionalTags: ['NOTE', 'XXX'],
}),
});
FAQs
A Backstage backend plugin that lets you browse TODO comments in your source code
The npm package @backstage/plugin-todo-backend receives a total of 0 weekly downloads. As such, @backstage/plugin-todo-backend popularity was classified as not popular.
We found that @backstage/plugin-todo-backend demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.