scaffolder-backend: make alpha options optional
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend': patch
|
||||
---
|
||||
|
||||
Updated the alpha `scaffolderPlugin` to not require options.
|
||||
@@ -22,6 +22,7 @@ import {
|
||||
permissionModuleAllowAllPolicy,
|
||||
permissionPlugin,
|
||||
} from '@backstage/plugin-permission-backend/alpha';
|
||||
import { scaffolderPlugin } from '@backstage/plugin-scaffolder-backend/alpha';
|
||||
import { catalogModuleTemplateKind } from '@backstage/plugin-scaffolder-backend/alpha';
|
||||
import { searchModuleCatalogCollator } from '@backstage/plugin-search-backend-module-catalog/alpha';
|
||||
import { searchModuleExploreCollator } from '@backstage/plugin-search-backend-module-explore/alpha';
|
||||
@@ -44,6 +45,8 @@ backend.add(techdocsPlugin());
|
||||
backend.add(catalogPlugin());
|
||||
backend.add(catalogModuleTemplateKind());
|
||||
|
||||
backend.add(scaffolderPlugin());
|
||||
|
||||
// Search
|
||||
backend.add(searchPlugin());
|
||||
backend.add(searchModuleCatalogCollator());
|
||||
|
||||
@@ -40,7 +40,7 @@ export const scaffolderConditions: Conditions<{
|
||||
|
||||
// @alpha
|
||||
export const scaffolderPlugin: (
|
||||
options: ScaffolderPluginOptions,
|
||||
options?: ScaffolderPluginOptions | undefined,
|
||||
) => BackendFeature;
|
||||
|
||||
// @alpha
|
||||
|
||||
@@ -67,7 +67,7 @@ class ScaffolderActionsExtensionPointImpl
|
||||
* @alpha
|
||||
*/
|
||||
export const scaffolderPlugin = createBackendPlugin(
|
||||
(options: ScaffolderPluginOptions) => ({
|
||||
(options?: ScaffolderPluginOptions) => ({
|
||||
pluginId: 'scaffolder',
|
||||
register(env) {
|
||||
const actionsExtensions = new ScaffolderActionsExtensionPointImpl();
|
||||
@@ -101,10 +101,10 @@ export const scaffolderPlugin = createBackendPlugin(
|
||||
taskBroker,
|
||||
taskWorkers,
|
||||
additionalTemplateGlobals,
|
||||
} = options;
|
||||
} = options ?? {};
|
||||
const log = loggerToWinstonLogger(logger);
|
||||
|
||||
const actions = options.actions || [
|
||||
const actions = options?.actions || [
|
||||
...actionsExtensions.actions,
|
||||
...createBuiltinActions({
|
||||
integrations: ScmIntegrations.fromConfig(config),
|
||||
|
||||
@@ -70,11 +70,13 @@ export type CreateWorkerOptions = {
|
||||
* @public
|
||||
*/
|
||||
export class TaskWorker {
|
||||
private constructor(private readonly options: TaskWorkerOptions) {}
|
||||
private taskQueue: PQueue;
|
||||
|
||||
private taskQueue: PQueue = new PQueue({
|
||||
concurrency: this.options.concurrentTasksLimit,
|
||||
});
|
||||
private constructor(private readonly options: TaskWorkerOptions) {
|
||||
this.taskQueue = new PQueue({
|
||||
concurrency: options.concurrentTasksLimit,
|
||||
});
|
||||
}
|
||||
|
||||
static async create(options: CreateWorkerOptions): Promise<TaskWorker> {
|
||||
const {
|
||||
|
||||
Reference in New Issue
Block a user