Merge pull request #26775 from backstage/rugvip/no-balls

docs: remove function call from all backend feature installation instructions
This commit is contained in:
Patrik Oldsberg
2024-09-19 09:50:43 +02:00
committed by GitHub
17 changed files with 41 additions and 30 deletions
@@ -24,7 +24,7 @@ const backend = createBackend();
backend.add(import('@backstage/plugin-catalog-backend/alpha'));
// Features can also be installed using an explicit reference
backend.add(scaffolderPlugin());
backend.add(scaffolderPlugin);
// Start up the backend
backend.start();
@@ -41,7 +41,7 @@ The `createBackendPlugin` return value is exported as `examplePlugin`, which is
```ts
import { examplePlugin } from 'backstage-plugin-example-backend';
backend.add(examplePlugin());
backend.add(examplePlugin);
```
By convention every plugin package should export its plugin instance as the default export from the package:
@@ -675,7 +675,7 @@ backend.add(
import('@backstage/plugin-catalog-backend-module-scaffolder-entity-model'),
);
/* highlight-add-next-line */
backend.add(catalogModuleCustomExtensions());
backend.add(catalogModuleCustomExtensions);
```
This also requires that you have a dependency on the corresponding node package,
@@ -762,9 +762,9 @@ const otherPluginModuleCustomExtensions = createBackendModule({
const backend = createBackend();
backend.add(import('@backstage/plugin-events-backend/alpha'));
/* highlight-add-next-line */
backend.add(eventsModuleCustomExtensions());
backend.add(eventsModuleCustomExtensions);
/* highlight-add-next-line */
backend.add(otherPluginModuleCustomExtensions());
backend.add(otherPluginModuleCustomExtensions);
```
Here we've placed the module directly in the backend index file just to get
@@ -841,7 +841,7 @@ const scaffolderModuleCustomExtensions = createBackendModule({
const backend = createBackend();
backend.add(import('@backstage/plugin-scaffolder-backend/alpha'));
/* highlight-add-next-line */
backend.add(scaffolderModuleCustomExtensions());
backend.add(scaffolderModuleCustomExtensions);
```
This also requires that you have a dependency on the corresponding node package,
@@ -891,7 +891,7 @@ const scaffolderModuleCustomFilters = createBackendModule({
const backend = createBackend();
backend.add(import('@backstage/plugin-scaffolder-backend/alpha'));
/* highlight-add-next-line */
backend.add(scaffolderModuleCustomFilters());
backend.add(scaffolderModuleCustomFilters);
```
If you still use the legacy backend system, then you will use the `createRouter()` function of the `Scaffolder plugin`
+1 -1
View File
@@ -800,7 +800,7 @@ const techdocsCustomBuildStrategy = createBackendModule({
/* highlight-add-start */
backend.add(import('@backstage/plugin-techdocs-backend/alpha'));
backend.add(techdocsCustomBuildStrategy());
backend.add(techdocsCustomBuildStrategy);
/* highlight-add-end */
backend.start();
+1 -1
View File
@@ -169,7 +169,7 @@ const backend = createBackend();
backend.add(import('@backstage/plugin-catalog-backend/alpha'));
backend.add(githubOrgModule());
backend.add(githubOrgModule);
backend.start();
```
+2 -2
View File
@@ -34,9 +34,9 @@ Then add the following to your backend initialization:
// optional if you want to use AWS SQS instead of HTTP endpoints to receive external events
// backend.add(import('@backstage/plugin-events-backend-module-aws-sqs/alpha'));
// optional - event router for gitlab. See.: https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-gitlab/README.md
// backend.add(eventsModuleGitlabEventRouter());
// backend.add(eventsModuleGitlabEventRouter);
// optional - token validator for the gitlab topic
// backend.add(eventsModuleGitlabWebhook());
// backend.add(eventsModuleGitlabWebhook);
backend.add(import('@backstage/plugin-catalog-backend-module-gitlab/alpha'));
```
+2 -2
View File
@@ -39,9 +39,9 @@ Then add the following to your backend initialization:
// optional if you want to use AWS SQS instead of HTTP endpoints to receive external events
// backend.add(import('@backstage/plugin-events-backend-module-aws-sqs/alpha'));
// optional - event router for gitlab. See.: https://github.com/backstage/backstage/blob/master/plugins/events-backend-module-gitlab/README.md
// backend.add(eventsModuleGitlabEventRouter());
// backend.add(eventsModuleGitlabEventRouter);
// optional - token validator for the gitlab topic
// backend.add(eventsModuleGitlabWebhook());
// backend.add(eventsModuleGitlabWebhook);
backend.add(import('@backstage/plugin-catalog-backend-module-gitlab-org'));
```
+2 -2
View File
@@ -101,7 +101,7 @@ export const examplePlugin = createBackendPlugin({
The plugin can then be installed in the backend using the returned plugin factory function:
```ts
backend.add(examplePlugin());
backend.add(examplePlugin);
```
If we wanted our plugin to accept options as well, we'd accept the options as the second parameter of the register method:
@@ -266,7 +266,7 @@ class GoogleCloudLogger implements LoggerService {
const backend = createBackend();
// supplies additional or replacement services to the backend
backend.add(GoogleCloudLogger.factory());
backend.add(GoogleCloudLogger.factory);
```
## Testing