@backstage/plugin-events-node 0.3.0-next.1 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,123 @@
1
1
  # @backstage/plugin-events-node
2
2
 
3
+ ## 0.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - eff3ca9: BREAKING CHANGE: Migrate `EventRouter` implementations from `EventBroker` to `EventsService`.
8
+
9
+ `EventRouter` uses the new `EventsService` instead of the `EventBroker` now,
10
+ causing a breaking change to its signature.
11
+
12
+ All of its extensions and implementations got adjusted accordingly.
13
+ (`SubTopicEventRouter`, `AzureDevOpsEventRouter`, `BitbucketCloudEventRouter`,
14
+ `GerritEventRouter`, `GithubEventRouter`, `GitlabEventRouter`)
15
+
16
+ Required adjustments were made to all backend modules for the new backend system,
17
+ now also making use of the `eventsServiceRef` instead of the `eventsExtensionPoint`.
18
+
19
+ **Migration:**
20
+
21
+ Example for implementations of `SubTopicEventRouter`:
22
+
23
+ ```diff
24
+ import {
25
+ EventParams,
26
+ + EventsService,
27
+ SubTopicEventRouter,
28
+ } from '@backstage/plugin-events-node';
29
+
30
+ export class GithubEventRouter extends SubTopicEventRouter {
31
+ - constructor() {
32
+ - super('github');
33
+ + constructor(options: { events: EventsService }) {
34
+ + super({
35
+ + events: options.events,
36
+ + topic: 'github',
37
+ + });
38
+ }
39
+
40
+ + protected getSubscriberId(): string {
41
+ + return 'GithubEventRouter';
42
+ + }
43
+ +
44
+ // ...
45
+ }
46
+ ```
47
+
48
+ Example for a direct extension of `EventRouter`:
49
+
50
+ ```diff
51
+ class MyEventRouter extends EventRouter {
52
+ - constructor(/* ... */) {
53
+ + constructor(options: {
54
+ + events: EventsService;
55
+ + // ...
56
+ + }) {
57
+ - super();
58
+ // ...
59
+ + super({
60
+ + events: options.events,
61
+ + topics: topics,
62
+ + });
63
+ }
64
+ +
65
+ + protected getSubscriberId(): string {
66
+ + return 'MyEventRouter';
67
+ + }
68
+ -
69
+ - supportsEventTopics(): string[] {
70
+ - return this.topics;
71
+ - }
72
+ }
73
+ ```
74
+
75
+ ### Patch Changes
76
+
77
+ - 56969b6: Add new `EventsService` as well as `eventsServiceRef` for the new backend system.
78
+
79
+ **Summary:**
80
+
81
+ - new:
82
+ `EventsService`, `eventsServiceRef`, `TestEventsService`
83
+ - deprecated:
84
+ `EventBroker`, `EventPublisher`, `EventSubscriber`, `DefaultEventBroker`, `EventsBackend`,
85
+ most parts of `EventsExtensionPoint` (alpha),
86
+ `TestEventBroker`, `TestEventPublisher`, `TestEventSubscriber`
87
+
88
+ Add the `eventsServiceRef` as dependency to your backend plugins
89
+ or backend plugin modules.
90
+
91
+ **Details:**
92
+
93
+ The previous implementation using the `EventsExtensionPoint` was added in the early stages
94
+ of the new backend system and does not respect the plugin isolation.
95
+ This made it not compatible anymore with the new backend system.
96
+
97
+ Additionally, the previous interfaces had some room for simplification,
98
+ supporting less exposure of internal concerns as well.
99
+
100
+ Hereby, this change adds a new `EventsService` interface as replacement for the now deprecated `EventBroker`.
101
+ The new interface does not require any `EventPublisher` or `EventSubscriber` interfaces anymore.
102
+ Instead, it is expected that the `EventsService` gets passed into publishers and subscribers,
103
+ and used internally. There is no need to expose anything of that at their own interfaces.
104
+
105
+ Most parts of `EventsExtensionPoint` (alpha) are deprecated as well and were not usable
106
+ (by other plugins or their modules) anyway.
107
+
108
+ The `DefaultEventBroker` implementation is deprecated and wraps the new `DefaultEventsService` implementation.
109
+ Optionally, an instance can be passed as argument to allow mixed setups to operate alongside.
110
+
111
+ - Updated dependencies
112
+ - @backstage/backend-plugin-api@0.6.14
113
+
114
+ ## 0.3.0-next.2
115
+
116
+ ### Patch Changes
117
+
118
+ - Updated dependencies
119
+ - @backstage/backend-plugin-api@0.6.14-next.2
120
+
3
121
  ## 0.3.0-next.1
4
122
 
5
123
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-events-node",
3
- "version": "0.3.0-next.1",
3
+ "version": "0.3.0",
4
4
  "main": "../dist/alpha.cjs.js",
5
5
  "types": "../dist/alpha.d.ts"
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-events-node",
3
3
  "description": "The plugin-events-node module for @backstage/plugin-events-backend",
4
- "version": "0.3.0-next.1",
4
+ "version": "0.3.0",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -40,11 +40,11 @@
40
40
  "postpack": "backstage-cli package postpack"
41
41
  },
42
42
  "dependencies": {
43
- "@backstage/backend-plugin-api": "^0.6.14-next.1"
43
+ "@backstage/backend-plugin-api": "^0.6.14"
44
44
  },
45
45
  "devDependencies": {
46
- "@backstage/backend-common": "^0.21.4-next.1",
47
- "@backstage/cli": "^0.25.3-next.1"
46
+ "@backstage/backend-common": "^0.21.4",
47
+ "@backstage/cli": "^0.26.0"
48
48
  },
49
49
  "files": [
50
50
  "dist",