scaffolder-backend: migrate to use exports

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-01-16 00:51:27 +01:00
parent 2113984b96
commit 8fc53d440f
6 changed files with 71 additions and 29 deletions
@@ -0,0 +1,30 @@
## API Report File for "@backstage/plugin-scaffolder-backend"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { BackendFeature } from '@backstage/backend-plugin-api';
import { TaskBroker } from '@backstage/plugin-scaffolder-backend';
import { TemplateAction } from '@backstage/plugin-scaffolder-node';
import { TemplateFilter } from '@backstage/plugin-scaffolder-backend';
import { TemplateGlobal } from '@backstage/plugin-scaffolder-backend';
// @alpha
export const catalogModuleTemplateKind: () => BackendFeature;
// @alpha
export const scaffolderPlugin: (
options: ScaffolderPluginOptions,
) => BackendFeature;
// @alpha
export type ScaffolderPluginOptions = {
actions?: TemplateAction<any>[];
taskWorkers?: number;
taskBroker?: TaskBroker;
additionalTemplateFilters?: Record<string, TemplateFilter>;
additionalTemplateGlobals?: Record<string, TemplateGlobal>;
};
// (No @packageDocumentation comment for this package)
```
-18
View File
@@ -6,7 +6,6 @@
/// <reference types="node" />
import { ActionContext as ActionContext_2 } from '@backstage/plugin-scaffolder-node';
import { BackendFeature } from '@backstage/backend-plugin-api';
import { CatalogApi } from '@backstage/catalog-client';
import { CatalogProcessor } from '@backstage/plugin-catalog-backend';
import { CatalogProcessorEmit } from '@backstage/plugin-catalog-backend';
@@ -38,9 +37,6 @@ import { Writable } from 'stream';
// @public @deprecated (undocumented)
export type ActionContext<TInput extends JsonObject> = ActionContext_2<TInput>;
// @alpha
export const catalogModuleTemplateKind: () => BackendFeature;
// @public
export const createBuiltinActions: (
options: CreateBuiltInActionsOptions,
@@ -666,20 +662,6 @@ export class ScaffolderEntitiesProcessor implements CatalogProcessor {
validateEntityKind(entity: Entity): Promise<boolean>;
}
// @alpha
export const scaffolderPlugin: (
options: ScaffolderPluginOptions,
) => BackendFeature;
// @alpha
export type ScaffolderPluginOptions = {
actions?: TemplateAction_2<any>[];
taskWorkers?: number;
taskBroker?: TaskBroker;
additionalTemplateFilters?: Record<string, TemplateFilter>;
additionalTemplateGlobals?: Record<string, TemplateGlobal>;
};
// @public
export type SerializedTask = {
id: string;
+16 -6
View File
@@ -6,10 +6,21 @@
"types": "src/index.ts",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts",
"alphaTypes": "dist/index.alpha.d.ts"
"access": "public"
},
"exports": {
".": "./src/index.ts",
"./alpha": "./src/alpha.ts"
},
"typesVersions": {
"*": {
"*": [
"src/index.ts"
],
"alpha": [
"src/alpha.ts"
]
}
},
"backstage": {
"role": "backend-plugin"
@@ -25,7 +36,7 @@
],
"scripts": {
"start": "backstage-cli package start",
"build": "backstage-cli package build --experimental-type-build",
"build": "backstage-cli package build",
"lint": "backstage-cli package lint",
"test": "backstage-cli package test",
"prepack": "backstage-cli package prepack",
@@ -100,7 +111,6 @@
"yaml": "^2.0.0"
},
"files": [
"alpha",
"dist",
"migrations",
"config.d.ts",
@@ -26,8 +26,12 @@ import {
ScaffolderActionsExtensionPoint,
TemplateAction,
} from '@backstage/plugin-scaffolder-node';
import { TemplateFilter, TemplateGlobal } from './lib';
import { createBuiltinActions, TaskBroker } from './scaffolder';
import {
TemplateFilter,
TemplateGlobal,
TaskBroker,
} from '@backstage/plugin-scaffolder-backend';
import { createBuiltinActions } from './scaffolder';
import { createRouter } from './service/router';
/**
+19
View File
@@ -0,0 +1,19 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './modules';
export { scaffolderPlugin } from './ScaffolderPlugin';
export type { ScaffolderPluginOptions } from './ScaffolderPlugin';
-3
View File
@@ -24,8 +24,5 @@ export * from './scaffolder';
export * from './service/router';
export * from './lib';
export * from './processor';
export * from './modules';
export { scaffolderPlugin } from './ScaffolderPlugin';
export type { ScaffolderPluginOptions } from './ScaffolderPlugin';
export * from './deprecated';