events-node: migrate to use exports

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-01-16 01:04:13 +01:00
parent 7543832df1
commit 334baa32b0
5 changed files with 70 additions and 29 deletions
+36
View File
@@ -0,0 +1,36 @@
## API Report File for "@backstage/plugin-events-node"
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { ExtensionPoint } from '@backstage/backend-plugin-api';
// @alpha (undocumented)
export interface EventsExtensionPoint {
// Warning: (ae-forgotten-export) The symbol "HttpPostIngressOptions" needs to be exported by the entry point alpha.d.ts
//
// (undocumented)
addHttpPostIngress(options: HttpPostIngressOptions): void;
// Warning: (ae-forgotten-export) The symbol "EventPublisher" needs to be exported by the entry point alpha.d.ts
//
// (undocumented)
addPublishers(
...publishers: Array<EventPublisher | Array<EventPublisher>>
): void;
// Warning: (ae-forgotten-export) The symbol "EventSubscriber" needs to be exported by the entry point alpha.d.ts
//
// (undocumented)
addSubscribers(
...subscribers: Array<EventSubscriber | Array<EventSubscriber>>
): void;
// Warning: (ae-forgotten-export) The symbol "EventBroker" needs to be exported by the entry point alpha.d.ts
//
// (undocumented)
setEventBroker(eventBroker: EventBroker): void;
}
// @alpha (undocumented)
export const eventsExtensionPoint: ExtensionPoint<EventsExtensionPoint>;
// (No @packageDocumentation comment for this package)
```
-21
View File
@@ -3,8 +3,6 @@
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
```ts
import { ExtensionPoint } from '@backstage/backend-plugin-api';
// @public
export interface EventBroker {
publish(params: EventParams): Promise<void>;
@@ -40,25 +38,6 @@ export abstract class EventRouter implements EventPublisher, EventSubscriber {
abstract supportsEventTopics(): string[];
}
// @alpha (undocumented)
export interface EventsExtensionPoint {
// (undocumented)
addHttpPostIngress(options: HttpPostIngressOptions): void;
// (undocumented)
addPublishers(
...publishers: Array<EventPublisher | Array<EventPublisher>>
): void;
// (undocumented)
addSubscribers(
...subscribers: Array<EventSubscriber | Array<EventSubscriber>>
): void;
// (undocumented)
setEventBroker(eventBroker: EventBroker): void;
}
// @alpha (undocumented)
export const eventsExtensionPoint: ExtensionPoint<EventsExtensionPoint>;
// @public
export interface EventSubscriber {
onEvent(params: EventParams): Promise<void>;
+16 -6
View File
@@ -6,17 +6,28 @@
"types": "src/index.ts",
"license": "Apache-2.0",
"publishConfig": {
"access": "public",
"alphaTypes": "dist/index.alpha.d.ts",
"main": "dist/index.cjs.js",
"types": "dist/index.d.ts"
"access": "public"
},
"exports": {
".": "./src/index.ts",
"./alpha": "./src/alpha.ts"
},
"typesVersions": {
"*": {
"*": [
"src/index.ts"
],
"alpha": [
"src/alpha.ts"
]
}
},
"backstage": {
"role": "node-library"
},
"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",
"clean": "backstage-cli package clean",
@@ -30,7 +41,6 @@
"@backstage/cli": "workspace:^"
},
"files": [
"alpha",
"dist"
]
}
+18
View File
@@ -0,0 +1,18 @@
/*
* Copyright 2023 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 type { EventsExtensionPoint } from './extensions';
export { eventsExtensionPoint } from './extensions';
-2
View File
@@ -21,5 +21,3 @@
*/
export * from './api';
export type { EventsExtensionPoint } from './extensions';
export { eventsExtensionPoint } from './extensions';