@backstage/plugin-signals 0.0.0-nightly-20240118021622
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 +13 -0
- package/README.md +44 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.esm.js +179 -0
- package/dist/index.esm.js.map +1 -0
- package/package.json +55 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @backstage/plugin-signals
|
|
2
|
+
|
|
3
|
+
## 0.0.0-nightly-20240118021622
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 047bead: Add support to subscribe and publish messages through signals plugins
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/plugin-signals-react@0.0.0-nightly-20240118021622
|
|
10
|
+
- @backstage/core-components@0.13.10
|
|
11
|
+
- @backstage/core-plugin-api@1.8.2
|
|
12
|
+
- @backstage/theme@0.5.0
|
|
13
|
+
- @backstage/types@1.1.1
|
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# signals
|
|
2
|
+
|
|
3
|
+
Welcome to the signals plugin!
|
|
4
|
+
|
|
5
|
+
Signals plugin allows backend plugins to publish messages to frontend plugins.
|
|
6
|
+
|
|
7
|
+
## Getting started
|
|
8
|
+
|
|
9
|
+
This plugin contains client that can receive messages from the backend. To get started,
|
|
10
|
+
see installation instructions from `@backstage/plugin-signals-node`, `@backstage/plugin-signals-backend`.
|
|
11
|
+
|
|
12
|
+
To install the plugin, you have to add the following to your `packages/app/src/plugins.ts`:
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
export { signalsPlugin } from '@backstage/plugin-signals';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
And make sure that your `packages/app/src/App.tsx` contains:
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import * as plugins from './plugins';
|
|
22
|
+
|
|
23
|
+
const app = createApp({
|
|
24
|
+
// ...
|
|
25
|
+
plugins: Object.values(plugins),
|
|
26
|
+
// ...
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Now you can utilize the API from other plugins using the `@backstage/plugin-signals-react` package or simply by:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { signalsApiRef } from '@backstage/plugin-signals-react';
|
|
34
|
+
|
|
35
|
+
const signals = useApi(signalsApiRef);
|
|
36
|
+
const { unsubscribe } = signals.subscribe(
|
|
37
|
+
'myplugin:topic',
|
|
38
|
+
(message: JsonObject) => {
|
|
39
|
+
console.log(message);
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
// Remember to unsubscribe
|
|
43
|
+
unsubscribe();
|
|
44
|
+
```
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as _backstage_core_plugin_api from '@backstage/core-plugin-api';
|
|
2
|
+
import { IdentityApi, DiscoveryApi } from '@backstage/core-plugin-api';
|
|
3
|
+
import { SignalApi } from '@backstage/plugin-signals-react';
|
|
4
|
+
import { JsonObject } from '@backstage/types';
|
|
5
|
+
|
|
6
|
+
/** @public */
|
|
7
|
+
declare const signalsPlugin: _backstage_core_plugin_api.BackstagePlugin<{}, {}>;
|
|
8
|
+
|
|
9
|
+
/** @public */
|
|
10
|
+
declare class SignalClient implements SignalApi {
|
|
11
|
+
private identity;
|
|
12
|
+
private discoveryApi;
|
|
13
|
+
private connectTimeout;
|
|
14
|
+
private reconnectTimeout;
|
|
15
|
+
static readonly DEFAULT_CONNECT_TIMEOUT_MS: number;
|
|
16
|
+
static readonly DEFAULT_RECONNECT_TIMEOUT_MS: number;
|
|
17
|
+
private ws;
|
|
18
|
+
private subscriptions;
|
|
19
|
+
private messageQueue;
|
|
20
|
+
private reconnectTo;
|
|
21
|
+
static create(options: {
|
|
22
|
+
identity: IdentityApi;
|
|
23
|
+
discoveryApi: DiscoveryApi;
|
|
24
|
+
connectTimeout?: number;
|
|
25
|
+
reconnectTimeout?: number;
|
|
26
|
+
}): SignalClient;
|
|
27
|
+
private constructor();
|
|
28
|
+
subscribe(channel: string, onMessage: (message: JsonObject) => void): {
|
|
29
|
+
unsubscribe: () => void;
|
|
30
|
+
};
|
|
31
|
+
private send;
|
|
32
|
+
private connect;
|
|
33
|
+
private handleMessage;
|
|
34
|
+
private reconnect;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { SignalClient, signalsPlugin };
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { createPlugin, createApiFactory, identityApiRef, discoveryApiRef } from '@backstage/core-plugin-api';
|
|
2
|
+
import { signalApiRef } from '@backstage/plugin-signals-react';
|
|
3
|
+
import { v4 } from 'uuid';
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
7
|
+
var __publicField = (obj, key, value) => {
|
|
8
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
9
|
+
return value;
|
|
10
|
+
};
|
|
11
|
+
const WS_CLOSE_NORMAL = 1e3;
|
|
12
|
+
const WS_CLOSE_GOING_AWAY = 1001;
|
|
13
|
+
const _SignalClient = class _SignalClient {
|
|
14
|
+
constructor(identity, discoveryApi, connectTimeout, reconnectTimeout) {
|
|
15
|
+
this.identity = identity;
|
|
16
|
+
this.discoveryApi = discoveryApi;
|
|
17
|
+
this.connectTimeout = connectTimeout;
|
|
18
|
+
this.reconnectTimeout = reconnectTimeout;
|
|
19
|
+
__publicField(this, "ws", null);
|
|
20
|
+
__publicField(this, "subscriptions", /* @__PURE__ */ new Map());
|
|
21
|
+
__publicField(this, "messageQueue", []);
|
|
22
|
+
__publicField(this, "reconnectTo");
|
|
23
|
+
}
|
|
24
|
+
static create(options) {
|
|
25
|
+
const {
|
|
26
|
+
identity,
|
|
27
|
+
discoveryApi,
|
|
28
|
+
connectTimeout = _SignalClient.DEFAULT_CONNECT_TIMEOUT_MS,
|
|
29
|
+
reconnectTimeout = _SignalClient.DEFAULT_RECONNECT_TIMEOUT_MS
|
|
30
|
+
} = options;
|
|
31
|
+
return new _SignalClient(
|
|
32
|
+
identity,
|
|
33
|
+
discoveryApi,
|
|
34
|
+
connectTimeout,
|
|
35
|
+
reconnectTimeout
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
subscribe(channel, onMessage) {
|
|
39
|
+
const subscriptionId = v4();
|
|
40
|
+
const exists = [...this.subscriptions.values()].find(
|
|
41
|
+
(sub) => sub.channel === channel
|
|
42
|
+
);
|
|
43
|
+
this.subscriptions.set(subscriptionId, {
|
|
44
|
+
channel,
|
|
45
|
+
callback: onMessage
|
|
46
|
+
});
|
|
47
|
+
this.connect().then(() => {
|
|
48
|
+
if (!exists) {
|
|
49
|
+
this.send({ action: "subscribe", channel });
|
|
50
|
+
}
|
|
51
|
+
}).catch(() => {
|
|
52
|
+
this.reconnect();
|
|
53
|
+
});
|
|
54
|
+
const unsubscribe = () => {
|
|
55
|
+
var _a;
|
|
56
|
+
const sub = this.subscriptions.get(subscriptionId);
|
|
57
|
+
if (!sub) {
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
this.subscriptions.delete(subscriptionId);
|
|
61
|
+
const multipleExists = [...this.subscriptions.values()].find(
|
|
62
|
+
(s) => s.channel === channel
|
|
63
|
+
);
|
|
64
|
+
if (!multipleExists) {
|
|
65
|
+
this.send({ action: "unsubscribe", channel: sub.channel });
|
|
66
|
+
}
|
|
67
|
+
if (this.subscriptions.size === 0) {
|
|
68
|
+
(_a = this.ws) == null ? void 0 : _a.close(WS_CLOSE_NORMAL);
|
|
69
|
+
this.ws = null;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
return { unsubscribe };
|
|
73
|
+
}
|
|
74
|
+
send(data) {
|
|
75
|
+
const jsonMessage = JSON.stringify(data);
|
|
76
|
+
if (jsonMessage.length === 0) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
|
|
80
|
+
if (data) {
|
|
81
|
+
this.messageQueue.unshift(jsonMessage);
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
for (const msg of this.messageQueue) {
|
|
86
|
+
this.ws.send(msg);
|
|
87
|
+
}
|
|
88
|
+
this.messageQueue = [];
|
|
89
|
+
if (data) {
|
|
90
|
+
this.ws.send(jsonMessage);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async connect() {
|
|
94
|
+
if (this.ws && this.ws.readyState === WebSocket.OPEN) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const apiUrl = await this.discoveryApi.getBaseUrl("signals");
|
|
98
|
+
const { token } = await this.identity.getCredentials();
|
|
99
|
+
const url = new URL(apiUrl);
|
|
100
|
+
url.protocol = url.protocol === "http:" ? "ws:" : "wss:";
|
|
101
|
+
this.ws = new WebSocket(url.toString(), token);
|
|
102
|
+
this.ws.onmessage = (data) => {
|
|
103
|
+
this.handleMessage(data);
|
|
104
|
+
};
|
|
105
|
+
this.ws.onerror = () => {
|
|
106
|
+
this.reconnect();
|
|
107
|
+
};
|
|
108
|
+
this.ws.onclose = (ev) => {
|
|
109
|
+
if (ev.code !== WS_CLOSE_NORMAL && ev.code !== WS_CLOSE_GOING_AWAY) {
|
|
110
|
+
this.reconnect();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
let connectSleep = 0;
|
|
114
|
+
while (this.ws && this.ws.readyState !== WebSocket.OPEN && connectSleep < this.connectTimeout) {
|
|
115
|
+
await new Promise((r) => setTimeout(r, 100));
|
|
116
|
+
connectSleep += 100;
|
|
117
|
+
}
|
|
118
|
+
if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {
|
|
119
|
+
throw new Error("Connect timeout");
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
handleMessage(data) {
|
|
123
|
+
try {
|
|
124
|
+
const json = JSON.parse(data.data);
|
|
125
|
+
if (json.channel) {
|
|
126
|
+
for (const sub of this.subscriptions.values()) {
|
|
127
|
+
if (sub.channel === json.channel) {
|
|
128
|
+
sub.callback(json.message);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
} catch (e) {
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
reconnect() {
|
|
136
|
+
if (this.reconnectTo) {
|
|
137
|
+
clearTimeout(this.reconnectTo);
|
|
138
|
+
}
|
|
139
|
+
this.reconnectTo = setTimeout(() => {
|
|
140
|
+
this.reconnectTo = null;
|
|
141
|
+
if (this.ws) {
|
|
142
|
+
this.ws.close();
|
|
143
|
+
}
|
|
144
|
+
this.ws = null;
|
|
145
|
+
this.connect().then(() => {
|
|
146
|
+
for (const sub of this.subscriptions.values()) {
|
|
147
|
+
this.send({ action: "subscribe", channel: sub.channel });
|
|
148
|
+
}
|
|
149
|
+
}).catch(() => {
|
|
150
|
+
this.reconnect();
|
|
151
|
+
});
|
|
152
|
+
}, this.reconnectTimeout);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
__publicField(_SignalClient, "DEFAULT_CONNECT_TIMEOUT_MS", 1e3);
|
|
156
|
+
__publicField(_SignalClient, "DEFAULT_RECONNECT_TIMEOUT_MS", 5e3);
|
|
157
|
+
let SignalClient = _SignalClient;
|
|
158
|
+
|
|
159
|
+
const signalsPlugin = createPlugin({
|
|
160
|
+
id: "signals",
|
|
161
|
+
apis: [
|
|
162
|
+
createApiFactory({
|
|
163
|
+
api: signalApiRef,
|
|
164
|
+
deps: {
|
|
165
|
+
identity: identityApiRef,
|
|
166
|
+
discoveryApi: discoveryApiRef
|
|
167
|
+
},
|
|
168
|
+
factory: ({ identity, discoveryApi }) => {
|
|
169
|
+
return SignalClient.create({
|
|
170
|
+
identity,
|
|
171
|
+
discoveryApi
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
]
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
export { SignalClient, signalsPlugin };
|
|
179
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/api/SignalClient.ts","../src/plugin.ts"],"sourcesContent":["/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { SignalApi } from '@backstage/plugin-signals-react';\nimport { JsonObject } from '@backstage/types';\nimport { DiscoveryApi, IdentityApi } from '@backstage/core-plugin-api';\nimport { v4 as uuid } from 'uuid';\n\ntype Subscription = {\n channel: string;\n callback: (message: JsonObject) => void;\n};\n\nconst WS_CLOSE_NORMAL = 1000;\nconst WS_CLOSE_GOING_AWAY = 1001;\n\n/** @public */\nexport class SignalClient implements SignalApi {\n static readonly DEFAULT_CONNECT_TIMEOUT_MS: number = 1000;\n static readonly DEFAULT_RECONNECT_TIMEOUT_MS: number = 5000;\n private ws: WebSocket | null = null;\n private subscriptions: Map<string, Subscription> = new Map();\n private messageQueue: string[] = [];\n private reconnectTo: any;\n\n static create(options: {\n identity: IdentityApi;\n discoveryApi: DiscoveryApi;\n connectTimeout?: number;\n reconnectTimeout?: number;\n }) {\n const {\n identity,\n discoveryApi,\n connectTimeout = SignalClient.DEFAULT_CONNECT_TIMEOUT_MS,\n reconnectTimeout = SignalClient.DEFAULT_RECONNECT_TIMEOUT_MS,\n } = options;\n return new SignalClient(\n identity,\n discoveryApi,\n connectTimeout,\n reconnectTimeout,\n );\n }\n\n private constructor(\n private identity: IdentityApi,\n private discoveryApi: DiscoveryApi,\n private connectTimeout: number,\n private reconnectTimeout: number,\n ) {}\n\n subscribe(\n channel: string,\n onMessage: (message: JsonObject) => void,\n ): { unsubscribe: () => void } {\n const subscriptionId = uuid();\n const exists = [...this.subscriptions.values()].find(\n sub => sub.channel === channel,\n );\n this.subscriptions.set(subscriptionId, {\n channel: channel,\n callback: onMessage,\n });\n\n this.connect()\n .then(() => {\n // Do not subscribe twice to same channel even there is multiple callbacks\n if (!exists) {\n this.send({ action: 'subscribe', channel });\n }\n })\n .catch(() => {\n this.reconnect();\n });\n\n const unsubscribe = () => {\n const sub = this.subscriptions.get(subscriptionId);\n if (!sub) {\n return;\n }\n this.subscriptions.delete(subscriptionId);\n const multipleExists = [...this.subscriptions.values()].find(\n s => s.channel === channel,\n );\n // If there are subscriptions still listening to this channel, do not\n // unsubscribe from the server\n if (!multipleExists) {\n this.send({ action: 'unsubscribe', channel: sub.channel });\n }\n\n // If there are no subscriptions, close the connection\n if (this.subscriptions.size === 0) {\n this.ws?.close(WS_CLOSE_NORMAL);\n this.ws = null;\n }\n };\n\n return { unsubscribe };\n }\n\n private send(data?: JsonObject): void {\n const jsonMessage = JSON.stringify(data);\n if (jsonMessage.length === 0) {\n return;\n }\n\n if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {\n if (data) {\n this.messageQueue.unshift(jsonMessage);\n }\n return;\n }\n\n // First send queue\n for (const msg of this.messageQueue) {\n this.ws!.send(msg);\n }\n this.messageQueue = [];\n if (data) {\n this.ws!.send(jsonMessage);\n }\n }\n\n private async connect() {\n if (this.ws && this.ws.readyState === WebSocket.OPEN) {\n return;\n }\n\n const apiUrl = await this.discoveryApi.getBaseUrl('signals');\n const { token } = await this.identity.getCredentials();\n\n const url = new URL(apiUrl);\n url.protocol = url.protocol === 'http:' ? 'ws:' : 'wss:';\n this.ws = new WebSocket(url.toString(), token);\n\n this.ws.onmessage = (data: MessageEvent) => {\n this.handleMessage(data);\n };\n\n this.ws.onerror = () => {\n this.reconnect();\n };\n\n this.ws.onclose = (ev: CloseEvent) => {\n if (ev.code !== WS_CLOSE_NORMAL && ev.code !== WS_CLOSE_GOING_AWAY) {\n this.reconnect();\n }\n };\n\n // Wait until connection is open\n let connectSleep = 0;\n while (\n this.ws &&\n this.ws.readyState !== WebSocket.OPEN &&\n connectSleep < this.connectTimeout\n ) {\n await new Promise(r => setTimeout(r, 100));\n connectSleep += 100;\n }\n\n if (!this.ws || this.ws.readyState !== WebSocket.OPEN) {\n throw new Error('Connect timeout');\n }\n }\n\n private handleMessage(data: MessageEvent) {\n try {\n const json = JSON.parse(data.data) as JsonObject;\n if (json.channel) {\n for (const sub of this.subscriptions.values()) {\n if (sub.channel === json.channel) {\n sub.callback(json.message as JsonObject);\n }\n }\n }\n } catch (e) {\n // NOOP\n }\n }\n\n private reconnect() {\n if (this.reconnectTo) {\n clearTimeout(this.reconnectTo);\n }\n\n this.reconnectTo = setTimeout(() => {\n this.reconnectTo = null;\n if (this.ws) {\n this.ws.close();\n }\n this.ws = null;\n this.connect()\n .then(() => {\n // Resubscribe to existing channels in case we lost connection\n for (const sub of this.subscriptions.values()) {\n this.send({ action: 'subscribe', channel: sub.channel });\n }\n })\n .catch(() => {\n this.reconnect();\n });\n }, this.reconnectTimeout);\n }\n}\n","/*\n * Copyright 2023 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport {\n createApiFactory,\n createPlugin,\n discoveryApiRef,\n identityApiRef,\n} from '@backstage/core-plugin-api';\nimport { signalApiRef } from '@backstage/plugin-signals-react';\nimport { SignalClient } from './api/SignalClient';\n\n/** @public */\nexport const signalsPlugin = createPlugin({\n id: 'signals',\n apis: [\n createApiFactory({\n api: signalApiRef,\n deps: {\n identity: identityApiRef,\n discoveryApi: discoveryApiRef,\n },\n factory: ({ identity, discoveryApi }) => {\n return SignalClient.create({\n identity,\n discoveryApi,\n });\n },\n }),\n ],\n});\n"],"names":["uuid"],"mappings":";;;;;;;;;;AAyBA,MAAM,eAAkB,GAAA,GAAA,CAAA;AACxB,MAAM,mBAAsB,GAAA,IAAA,CAAA;AAGrB,MAAM,aAAA,GAAN,MAAM,aAAkC,CAAA;AAAA,EA4BrC,WACE,CAAA,QAAA,EACA,YACA,EAAA,cAAA,EACA,gBACR,EAAA;AAJQ,IAAA,IAAA,CAAA,QAAA,GAAA,QAAA,CAAA;AACA,IAAA,IAAA,CAAA,YAAA,GAAA,YAAA,CAAA;AACA,IAAA,IAAA,CAAA,cAAA,GAAA,cAAA,CAAA;AACA,IAAA,IAAA,CAAA,gBAAA,GAAA,gBAAA,CAAA;AA7BV,IAAA,aAAA,CAAA,IAAA,EAAQ,IAAuB,EAAA,IAAA,CAAA,CAAA;AAC/B,IAAQ,aAAA,CAAA,IAAA,EAAA,eAAA,sBAA+C,GAAI,EAAA,CAAA,CAAA;AAC3D,IAAA,aAAA,CAAA,IAAA,EAAQ,gBAAyB,EAAC,CAAA,CAAA;AAClC,IAAQ,aAAA,CAAA,IAAA,EAAA,aAAA,CAAA,CAAA;AAAA,GA2BL;AAAA,EAzBH,OAAO,OAAO,OAKX,EAAA;AACD,IAAM,MAAA;AAAA,MACJ,QAAA;AAAA,MACA,YAAA;AAAA,MACA,iBAAiB,aAAa,CAAA,0BAAA;AAAA,MAC9B,mBAAmB,aAAa,CAAA,4BAAA;AAAA,KAC9B,GAAA,OAAA,CAAA;AACJ,IAAA,OAAO,IAAI,aAAA;AAAA,MACT,QAAA;AAAA,MACA,YAAA;AAAA,MACA,cAAA;AAAA,MACA,gBAAA;AAAA,KACF,CAAA;AAAA,GACF;AAAA,EASA,SAAA,CACE,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AAgB,CAAA,CAAA;AAAA,GAC1B;AACF,CAAA,CAAA;AA1LE,aAAA,CADW,eACK,4BAAqC,EAAA,GAAA,CAAA,CAAA;AACrD,aAAA,CAFW,eAEK,8BAAuC,EAAA,GAAA,CAAA,CAAA;AAFlD,IAAM,YAAN,GAAA;;ACJA,MAAM,gBAAgB,YAAa,CAAA;AAAA,EACxC,EAAI,EAAA,SAAA;AAAA,EACJ,IAAM,EAAA;AAAA,IACJ,gBAAiB,CAAA;AAAA,MACf,GAAK,EAAA,YAAA;AAAA,MACL,IAAM,EAAA;AAAA,QACJ,QAAU,EAAA,cAAA;AAAA,QACV,YAAc,EAAA,eAAA;AAAA,OAChB;AAAA,MACA,OAAS,EAAA,CAAC,EAAE,QAAA,EAAU,cAAmB,KAAA;AACvC,QAAA,OAAO,aAAa,MAAO,CAAA;AAAA,UACzB,QAAA;AAAA,UACA,YAAA;AAAA,SACD,CAAA,CAAA;AAAA,OACH;AAAA,KACD,CAAA;AAAA,GACH;AACF,CAAC;;;;"}
|
package/package.json
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@backstage/plugin-signals",
|
|
3
|
+
"version": "0.0.0-nightly-20240118021622",
|
|
4
|
+
"main": "dist/index.esm.js",
|
|
5
|
+
"types": "dist/index.d.ts",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public",
|
|
9
|
+
"main": "dist/index.esm.js",
|
|
10
|
+
"types": "dist/index.d.ts"
|
|
11
|
+
},
|
|
12
|
+
"backstage": {
|
|
13
|
+
"role": "frontend-plugin"
|
|
14
|
+
},
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"scripts": {
|
|
17
|
+
"start": "backstage-cli package start",
|
|
18
|
+
"build": "backstage-cli package build",
|
|
19
|
+
"lint": "backstage-cli package lint",
|
|
20
|
+
"test": "backstage-cli package test",
|
|
21
|
+
"clean": "backstage-cli package clean",
|
|
22
|
+
"prepack": "backstage-cli package prepack",
|
|
23
|
+
"postpack": "backstage-cli package postpack"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@backstage/core-components": "^0.13.10",
|
|
27
|
+
"@backstage/core-plugin-api": "^1.8.2",
|
|
28
|
+
"@backstage/plugin-signals-react": "^0.0.0-nightly-20240118021622",
|
|
29
|
+
"@backstage/theme": "^0.5.0",
|
|
30
|
+
"@backstage/types": "^1.1.1",
|
|
31
|
+
"@material-ui/core": "^4.12.4",
|
|
32
|
+
"@material-ui/icons": "^4.9.1",
|
|
33
|
+
"@material-ui/lab": "^4.0.0-alpha.61",
|
|
34
|
+
"react-use": "^17.2.4",
|
|
35
|
+
"uuid": "^8.0.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"react": "^16.13.1 || ^17.0.0"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@backstage/cli": "^0.0.0-nightly-20240118021622",
|
|
42
|
+
"@backstage/core-app-api": "^1.11.3",
|
|
43
|
+
"@backstage/dev-utils": "^1.0.26",
|
|
44
|
+
"@backstage/test-utils": "^0.0.0-nightly-20240118021622",
|
|
45
|
+
"@testing-library/jest-dom": "^6.0.0",
|
|
46
|
+
"@testing-library/react": "^14.0.0",
|
|
47
|
+
"@testing-library/user-event": "^14.0.0",
|
|
48
|
+
"jest-websocket-mock": "^2.5.0",
|
|
49
|
+
"msw": "^1.0.0"
|
|
50
|
+
},
|
|
51
|
+
"files": [
|
|
52
|
+
"dist"
|
|
53
|
+
],
|
|
54
|
+
"module": "./dist/index.esm.js"
|
|
55
|
+
}
|