docs: remove function call from all backend feature installation instructions
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
---
|
||||
'@backstage/backend-dynamic-feature-service': patch
|
||||
'@backstage/plugin-search-backend-module-techdocs': patch
|
||||
'@backstage/plugin-search-backend-module-catalog': patch
|
||||
'@backstage/plugin-search-backend-module-explore': patch
|
||||
'@backstage/plugin-events-backend-module-github': patch
|
||||
'@backstage/plugin-events-backend-module-gitlab': patch
|
||||
'@backstage/plugin-events-node': patch
|
||||
---
|
||||
|
||||
Updated backend installation instructions.
|
||||
@@ -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`
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -169,7 +169,7 @@ const backend = createBackend();
|
||||
|
||||
backend.add(import('@backstage/plugin-catalog-backend/alpha'));
|
||||
|
||||
backend.add(githubOrgModule());
|
||||
backend.add(githubOrgModule);
|
||||
|
||||
backend.start();
|
||||
```
|
||||
|
||||
@@ -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'));
|
||||
```
|
||||
|
||||
|
||||
@@ -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'));
|
||||
```
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -15,8 +15,8 @@ In the `backend` application, it can be enabled by adding the `backend-dynamic-f
|
||||
```ts
|
||||
const backend = createBackend();
|
||||
+
|
||||
+ backend.add(dynamicPluginsFeatureDiscoveryServiceFactory()) // overridden version of the FeatureDiscoveryService which provides features loaded by dynamic plugins
|
||||
+ backend.add(dynamicPluginsServiceFactory())
|
||||
+ backend.add(dynamicPluginsFeatureDiscoveryServiceFactory) // overridden version of the FeatureDiscoveryService which provides features loaded by dynamic plugins
|
||||
+ backend.add(dynamicPluginsServiceFactory)
|
||||
+
|
||||
```
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ yarn --cwd packages/backend add @backstage/plugin-events-backend-module-github
|
||||
// packages/backend/src/index.ts
|
||||
import { eventsModuleGithubEventRouter } from '@backstage/plugin-events-backend-module-github/alpha';
|
||||
// ...
|
||||
backend.add(eventsModuleGithubEventRouter());
|
||||
backend.add(eventsModuleGithubEventRouter);
|
||||
```
|
||||
|
||||
#### Legacy Backend System
|
||||
@@ -50,7 +50,7 @@ await eventRouter.subscribe();
|
||||
// packages/backend/src/index.ts
|
||||
import { eventsModuleGithubWebhook } from '@backstage/plugin-events-backend-module-github/alpha';
|
||||
// ...
|
||||
backend.add(eventsModuleGithubWebhook());
|
||||
backend.add(eventsModuleGithubWebhook);
|
||||
```
|
||||
|
||||
#### Legacy Backend System
|
||||
|
||||
@@ -32,7 +32,7 @@ yarn --cwd packages/backend add @backstage/plugin-events-backend-module-gitlab
|
||||
// packages/backend/src/index.ts
|
||||
import { eventsModuleGitlabEventRouter } from '@backstage/plugin-events-backend-module-gitlab/alpha';
|
||||
// ...
|
||||
backend.add(eventsModuleGitlabEventRouter());
|
||||
backend.add(eventsModuleGitlabEventRouter);
|
||||
```
|
||||
|
||||
#### Legacy Backend System
|
||||
@@ -49,7 +49,7 @@ await eventRouter.subscribe();
|
||||
// packages/backend/src/index.ts
|
||||
import { eventsModuleGitlabWebhook } from '@backstage/plugin-events-backend-module-gitlab/alpha';
|
||||
// ...
|
||||
backend.add(eventsModuleGitlabWebhook());
|
||||
backend.add(eventsModuleGitlabWebhook);
|
||||
```
|
||||
|
||||
#### Legacy Backend System
|
||||
|
||||
@@ -78,5 +78,5 @@ and your custom implementation:
|
||||
|
||||
```diff
|
||||
// packages/backend/src/index.ts
|
||||
+ backend.add(customEventsServiceFactory());
|
||||
+ backend.add(customEventsServiceFactory);
|
||||
```
|
||||
|
||||
@@ -20,8 +20,8 @@ import { searchPlugin } from '@backstage/plugin-search-backend/alpha';
|
||||
import { searchModuleCatalogCollator } from '@backstage/plugin-search-backend-module-catalog/alpha';
|
||||
|
||||
const backend = createBackend();
|
||||
backend.add(searchPlugin());
|
||||
backend.add(searchModuleCatalogCollator());
|
||||
backend.add(searchPlugin);
|
||||
backend.add(searchModuleCatalogCollator);
|
||||
backend.start();
|
||||
```
|
||||
|
||||
@@ -54,8 +54,8 @@ const customTransformer: CatalogCollatorEntityTransformer = entity => ({
|
||||
});
|
||||
|
||||
const backend = createBackend();
|
||||
backend.add(searchPlugin());
|
||||
backend.add(searchModuleCatalogCollator());
|
||||
backend.add(searchPlugin);
|
||||
backend.add(searchModuleCatalogCollator);
|
||||
backend.add(
|
||||
createBackendModule({
|
||||
pluginId: 'search',
|
||||
|
||||
@@ -20,8 +20,8 @@ import { searchPlugin } from '@backstage/plugin-search-backend/alpha';
|
||||
import { searchModuleExploreCollator } from '@backstage/plugin-search-backend-module-explore/alpha';
|
||||
|
||||
const backend = createBackend();
|
||||
backend.add(searchPlugin());
|
||||
backend.add(searchModuleExploreCollator());
|
||||
backend.add(searchPlugin);
|
||||
backend.add(searchModuleExploreCollator);
|
||||
backend.start();
|
||||
```
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ import { searchPlugin } from '@backstage/plugin-search-backend/alpha';
|
||||
import { searchModuleTechDocsCollator } from '@backstage/plugin-search-backend-module-techdocs/alpha';
|
||||
|
||||
const backend = createBackend();
|
||||
backend.add(searchPlugin());
|
||||
backend.add(searchModuleTechDocsCollator());
|
||||
backend.add(searchPlugin);
|
||||
backend.add(searchModuleTechDocsCollator);
|
||||
backend.start();
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user