@entifix/testing-unit 0.19.0 → 0.20.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.
|
@@ -10,6 +10,9 @@ export interface PushChannelUnderTest {
|
|
|
10
10
|
subscribe(topic: string, listener: (event: DomainEvent) => void): () => void;
|
|
11
11
|
onConnect(listener: () => void): () => void;
|
|
12
12
|
onResync(listener: (topics: readonly string[]) => void): () => void;
|
|
13
|
+
connection(): 'open' | 'reconnecting' | 'closed';
|
|
14
|
+
onConnectionChange(listener: () => void): () => void;
|
|
15
|
+
reconnect(): void;
|
|
13
16
|
}
|
|
14
17
|
/**
|
|
15
18
|
* One channel, and the server side of it as the adapter's transport would
|
|
@@ -25,6 +28,8 @@ export interface PushChannelHarness {
|
|
|
25
28
|
readonly push: (topics: readonly string[], event: DomainEvent) => void;
|
|
26
29
|
/** The server asks for `topics` to be read again. */
|
|
27
30
|
readonly resync: (topics: readonly string[]) => void;
|
|
31
|
+
/** The transport drops: still retrying, or given up. */
|
|
32
|
+
readonly drop: (state: 'reconnecting' | 'closed') => void;
|
|
28
33
|
}
|
|
29
34
|
/**
|
|
30
35
|
* The event every case pushes. Its name is registered by the caller's own
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"push-channel.contract.d.ts","sourceRoot":"","sources":["../../src/contracts/push-channel.contract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;IAC7E,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,KAAK,IAAI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ACH,eAAO,MAAM,wBAAwB,GAAI,IAAI,MAAM,KAAG,WAOpD,CAAC;AAEH;;;;;;;;;GASG;AACH,eAAO,MAAM,2BAA2B,GACtC,MAAM,MAAM,EACZ,MAAM,MAAM,kBAAkB,KAC7B,IAyHF,CAAC"}
|
|
@@ -129,6 +129,29 @@ import { describe, expect, it, vi } from 'vitest';
|
|
|
129
129
|
]);
|
|
130
130
|
expect(resynced).toHaveBeenCalledTimes(1);
|
|
131
131
|
});
|
|
132
|
+
it('says when the stream drops and when it is back, and reopens on request', ()=>{
|
|
133
|
+
const h = make();
|
|
134
|
+
const changed = vi.fn();
|
|
135
|
+
const stop = h.channel.onConnectionChange(changed);
|
|
136
|
+
subscribe(h, 'entity:x', vi.fn());
|
|
137
|
+
h.settle();
|
|
138
|
+
// A stream still opening is not news.
|
|
139
|
+
expect(h.channel.connection()).toBe('open');
|
|
140
|
+
h.connect();
|
|
141
|
+
expect(changed).not.toHaveBeenCalled();
|
|
142
|
+
h.drop('reconnecting');
|
|
143
|
+
expect(h.channel.connection()).toBe('reconnecting');
|
|
144
|
+
h.drop('closed');
|
|
145
|
+
expect(h.channel.connection()).toBe('closed');
|
|
146
|
+
h.channel.reconnect();
|
|
147
|
+
h.settle();
|
|
148
|
+
h.connect();
|
|
149
|
+
expect(h.channel.connection()).toBe('open');
|
|
150
|
+
expect(changed).toHaveBeenCalledTimes(3);
|
|
151
|
+
stop();
|
|
152
|
+
h.drop('reconnecting');
|
|
153
|
+
expect(changed).toHaveBeenCalledTimes(3);
|
|
154
|
+
});
|
|
132
155
|
});
|
|
133
156
|
};
|
|
134
157
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/contracts/push-channel.contract.ts"],"sourcesContent":["import type { DomainEvent } from '@entifix/core';\nimport { describe, expect, it, vi } from 'vitest';\n\n/**\n * The browser push port as a case exercises it.\n *\n * Declared here structurally rather than imported, because the package that\n * owns the port depends on this one for its own specs; any `PushChannel`\n * satisfies it.\n */\nexport interface PushChannelUnderTest {\n subscribe(topic: string, listener: (event: DomainEvent) => void): () => void;\n onConnect(listener: () => void): () => void;\n onResync(listener: (topics: readonly string[]) => void): () => void;\n}\n\n/**\n * One channel, and the server side of it as the adapter's transport would\n * play it.\n */\nexport interface PushChannelHarness {\n readonly channel: PushChannelUnderTest;\n /** Lets the channel act on a change of interest, such as a pending reopen. */\n readonly settle: () => void;\n /** The transport (re)connects. */\n readonly connect: () => void;\n /** The server pushes `event`, naming the topics it matched. */\n readonly push: (topics: readonly string[], event: DomainEvent) => void;\n /** The server asks for `topics` to be read again. */\n readonly resync: (topics: readonly string[]) => void;\n}\n\n/**\n * The event every case pushes. Its name is registered by the caller's own\n * spec support when its transport decodes through the registry.\n */\nexport const pushChannelContractEvent = (id: string): DomainEvent => ({\n name: 'push-channel-contract.thing.changed',\n id,\n source: 'contract',\n at: '2026-11-02T00:00:00.000Z',\n audience: [{ kind: 'organization', id: 'a' }],\n data: { n: 1 },\n});\n\n/**\n * What every browser push channel must guarantee\n * ([ADR 0021](../../../../../docs/adr/0021-server-push-and-the-multiplexed-channel.md)):\n * an event reaches the listeners of the topics it names and nobody else, once\n * per listener; an unsubscribed listener hears nothing more; a connect listener\n * hears every (re)connection and is told at once when it registers on a\n * connected channel; and a resync names only topics still subscribed.\n *\n * `make` builds a fresh channel and its harness for each case.\n */\nexport const describePushChannelContract = (\n name: string,\n make: () => PushChannelHarness,\n): void => {\n const subscribe = (\n { channel }: PushChannelHarness,\n topic: string,\n listener: (event: DomainEvent) => void,\n ) => channel.subscribe(topic, listener);\n\n describe(`${name} — the push-channel contract`, () => {\n it('delivers an event to the listeners of the topics it names, and no others', () => {\n const h = make();\n const x = vi.fn();\n const y = vi.fn();\n subscribe(h, 'entity:x', x);\n subscribe(h, 'entity:y', y);\n h.settle();\n h.connect();\n h.push(['entity:x'], pushChannelContractEvent('e1'));\n expect(x).toHaveBeenCalledWith(\n expect.objectContaining({ id: 'e1', data: { n: 1 } }),\n );\n expect(y).not.toHaveBeenCalled();\n });\n\n it('delivers once to a listener subscribed to two of the topics an event names', () => {\n const h = make();\n const listener = vi.fn();\n subscribe(h, 'entity:x', listener);\n subscribe(h, 'record:x:1', listener);\n h.settle();\n h.connect();\n h.push(['entity:x', 'record:x:1'], pushChannelContractEvent('e1'));\n expect(listener).toHaveBeenCalledTimes(1);\n });\n\n it('ignores a topic the frame names but nobody here subscribed to', () => {\n const h = make();\n const listener = vi.fn();\n subscribe(h, 'entity:x', listener);\n h.settle();\n h.connect();\n h.push(['entity:z'], pushChannelContractEvent('e1'));\n expect(listener).not.toHaveBeenCalled();\n });\n\n it('stops delivering to a listener that unsubscribed, and tolerates a second unsubscribe', () => {\n const h = make();\n const gone = vi.fn();\n const kept = vi.fn();\n const unsubscribe = subscribe(h, 'entity:x', gone);\n subscribe(h, 'entity:x', kept);\n h.settle();\n h.connect();\n unsubscribe();\n unsubscribe();\n h.settle();\n h.push(['entity:x'], pushChannelContractEvent('e1'));\n expect(gone).not.toHaveBeenCalled();\n expect(kept).toHaveBeenCalledTimes(1);\n });\n\n it('tells a connect listener of every connection, and at once when already connected', () => {\n const h = make();\n const early = vi.fn();\n h.channel.onConnect(early);\n subscribe(h, 'entity:x', vi.fn());\n h.settle();\n h.connect();\n h.connect();\n expect(early).toHaveBeenCalledTimes(2);\n\n const late = vi.fn();\n const stop = h.channel.onConnect(late);\n expect(late).toHaveBeenCalledTimes(1);\n stop();\n h.connect();\n expect(late).toHaveBeenCalledTimes(1);\n });\n\n it('names only topics still subscribed in a resync, and stays silent with none', () => {\n const h = make();\n const resynced = vi.fn();\n const stop = h.channel.onResync(resynced);\n subscribe(h, 'entity:x', vi.fn());\n h.settle();\n h.connect();\n h.resync(['entity:x', 'entity:gone']);\n h.resync(['entity:gone']);\n expect(resynced).toHaveBeenCalledTimes(1);\n expect(resynced).toHaveBeenCalledWith(['entity:x']);\n stop();\n h.resync(['entity:x']);\n expect(resynced).toHaveBeenCalledTimes(1);\n });\n });\n};\n"],"names":["describe","expect","it","vi","pushChannelContractEvent","id","name","source","at","audience","kind","data","n","describePushChannelContract","make","subscribe","channel","topic","listener","h","x","fn","y","settle","connect","push","toHaveBeenCalledWith","objectContaining","not","toHaveBeenCalled","toHaveBeenCalledTimes","gone","kept","unsubscribe","early","onConnect","late","stop","resynced","onResync","resync"],"mappings":"AACA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,EAAE,QAAQ,SAAS;AA+BlD;;;CAGC,GACD,OAAO,MAAMC,2BAA2B,CAACC,KAA6B,CAAA;QACpEC,MAAM;QACND;QACAE,QAAQ;QACRC,IAAI;QACJC,UAAU;YAAC;gBAAEC,MAAM;gBAAgBL,IAAI;YAAI;SAAE;QAC7CM,MAAM;YAAEC,GAAG;QAAE;IACf,CAAA,EAAG;AAEH;;;;;;;;;CASC,GACD,OAAO,MAAMC,8BAA8B,CACzCP,MACAQ;IAEA,MAAMC,YAAY,CAChB,EAAEC,OAAO,EAAsB,EAC/BC,OACAC,WACGF,QAAQD,SAAS,CAACE,OAAOC;IAE9BlB,SAAS,GAAGM,KAAK,4BAA4B,CAAC,EAAE;QAC9CJ,GAAG,4EAA4E;YAC7E,MAAMiB,IAAIL;YACV,MAAMM,IAAIjB,GAAGkB,EAAE;YACf,MAAMC,IAAInB,GAAGkB,EAAE;YACfN,UAAUI,GAAG,YAAYC;YACzBL,UAAUI,GAAG,YAAYG;YACzBH,EAAEI,MAAM;YACRJ,EAAEK,OAAO;YACTL,EAAEM,IAAI,CAAC;gBAAC;aAAW,EAAErB,yBAAyB;YAC9CH,OAAOmB,GAAGM,oBAAoB,CAC5BzB,OAAO0B,gBAAgB,CAAC;gBAAEtB,IAAI;gBAAMM,MAAM;oBAAEC,GAAG;gBAAE;YAAE;YAErDX,OAAOqB,GAAGM,GAAG,CAACC,gBAAgB;QAChC;QAEA3B,GAAG,8EAA8E;YAC/E,MAAMiB,IAAIL;YACV,MAAMI,WAAWf,GAAGkB,EAAE;YACtBN,UAAUI,GA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,CAAC;YACnCO;YACAlB,EAAEK,OAAO;YACTvB,OAAOmC,MAAMN,qBAAqB,CAAC;QACrC;QAEA5B,GAAG,8EAA8E;YAC/E,MAAMiB,IAAIL;YACV,MAAMwB,WAAWnC,GAAGkB,EAAE;YACtB,MAAMgB,OAAOlB,EAAEH,OAAO,CAACuB,QAAQ,CAACD;YAChCvB,UAAUI,GAAG,YAAYhB,GAAGkB,EAAE;YAC9BF,EAAEI,MAAM;YACRJ,EAAEK,OAAO;YACTL,EAAEqB,MAAM,CAAC;gBAAC;gBAAY;aAAc;YACpCrB,EAAEqB,MAAM,CAAC;gBAAC;aAAc;YACxBvC,OAAOqC,UAAUR,qBAAqB,CAAC;YACvC7B,OAAOqC,UAAUZ,oBAAoB,CAAC;gBAAC;aAAW;YAClDW;YACAlB,EAAEqB,MAAM,CAAC;gBAAC;aAAW;YACrBvC,OAAOqC,UAAUR,qBAAqB,CAAC;QACzC;IACF;AACF,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../src/contracts/push-channel.contract.ts"],"sourcesContent":["import type { DomainEvent } from '@entifix/core';\nimport { describe, expect, it, vi } from 'vitest';\n\n/**\n * The browser push port as a case exercises it.\n *\n * Declared here structurally rather than imported, because the package that\n * owns the port depends on this one for its own specs; any `PushChannel`\n * satisfies it.\n */\nexport interface PushChannelUnderTest {\n subscribe(topic: string, listener: (event: DomainEvent) => void): () => void;\n onConnect(listener: () => void): () => void;\n onResync(listener: (topics: readonly string[]) => void): () => void;\n connection(): 'open' | 'reconnecting' | 'closed';\n onConnectionChange(listener: () => void): () => void;\n reconnect(): void;\n}\n\n/**\n * One channel, and the server side of it as the adapter's transport would\n * play it.\n */\nexport interface PushChannelHarness {\n readonly channel: PushChannelUnderTest;\n /** Lets the channel act on a change of interest, such as a pending reopen. */\n readonly settle: () => void;\n /** The transport (re)connects. */\n readonly connect: () => void;\n /** The server pushes `event`, naming the topics it matched. */\n readonly push: (topics: readonly string[], event: DomainEvent) => void;\n /** The server asks for `topics` to be read again. */\n readonly resync: (topics: readonly string[]) => void;\n /** The transport drops: still retrying, or given up. */\n readonly drop: (state: 'reconnecting' | 'closed') => void;\n}\n\n/**\n * The event every case pushes. Its name is registered by the caller's own\n * spec support when its transport decodes through the registry.\n */\nexport const pushChannelContractEvent = (id: string): DomainEvent => ({\n name: 'push-channel-contract.thing.changed',\n id,\n source: 'contract',\n at: '2026-11-02T00:00:00.000Z',\n audience: [{ kind: 'organization', id: 'a' }],\n data: { n: 1 },\n});\n\n/**\n * What every browser push channel must guarantee\n * ([ADR 0021](../../../../../docs/adr/0021-server-push-and-the-multiplexed-channel.md)):\n * an event reaches the listeners of the topics it names and nobody else, once\n * per listener; an unsubscribed listener hears nothing more; a connect listener\n * hears every (re)connection and is told at once when it registers on a\n * connected channel; and a resync names only topics still subscribed.\n *\n * `make` builds a fresh channel and its harness for each case.\n */\nexport const describePushChannelContract = (\n name: string,\n make: () => PushChannelHarness,\n): void => {\n const subscribe = (\n { channel }: PushChannelHarness,\n topic: string,\n listener: (event: DomainEvent) => void,\n ) => channel.subscribe(topic, listener);\n\n describe(`${name} — the push-channel contract`, () => {\n it('delivers an event to the listeners of the topics it names, and no others', () => {\n const h = make();\n const x = vi.fn();\n const y = vi.fn();\n subscribe(h, 'entity:x', x);\n subscribe(h, 'entity:y', y);\n h.settle();\n h.connect();\n h.push(['entity:x'], pushChannelContractEvent('e1'));\n expect(x).toHaveBeenCalledWith(\n expect.objectContaining({ id: 'e1', data: { n: 1 } }),\n );\n expect(y).not.toHaveBeenCalled();\n });\n\n it('delivers once to a listener subscribed to two of the topics an event names', () => {\n const h = make();\n const listener = vi.fn();\n subscribe(h, 'entity:x', listener);\n subscribe(h, 'record:x:1', listener);\n h.settle();\n h.connect();\n h.push(['entity:x', 'record:x:1'], pushChannelContractEvent('e1'));\n expect(listener).toHaveBeenCalledTimes(1);\n });\n\n it('ignores a topic the frame names but nobody here subscribed to', () => {\n const h = make();\n const listener = vi.fn();\n subscribe(h, 'entity:x', listener);\n h.settle();\n h.connect();\n h.push(['entity:z'], pushChannelContractEvent('e1'));\n expect(listener).not.toHaveBeenCalled();\n });\n\n it('stops delivering to a listener that unsubscribed, and tolerates a second unsubscribe', () => {\n const h = make();\n const gone = vi.fn();\n const kept = vi.fn();\n const unsubscribe = subscribe(h, 'entity:x', gone);\n subscribe(h, 'entity:x', kept);\n h.settle();\n h.connect();\n unsubscribe();\n unsubscribe();\n h.settle();\n h.push(['entity:x'], pushChannelContractEvent('e1'));\n expect(gone).not.toHaveBeenCalled();\n expect(kept).toHaveBeenCalledTimes(1);\n });\n\n it('tells a connect listener of every connection, and at once when already connected', () => {\n const h = make();\n const early = vi.fn();\n h.channel.onConnect(early);\n subscribe(h, 'entity:x', vi.fn());\n h.settle();\n h.connect();\n h.connect();\n expect(early).toHaveBeenCalledTimes(2);\n\n const late = vi.fn();\n const stop = h.channel.onConnect(late);\n expect(late).toHaveBeenCalledTimes(1);\n stop();\n h.connect();\n expect(late).toHaveBeenCalledTimes(1);\n });\n\n it('names only topics still subscribed in a resync, and stays silent with none', () => {\n const h = make();\n const resynced = vi.fn();\n const stop = h.channel.onResync(resynced);\n subscribe(h, 'entity:x', vi.fn());\n h.settle();\n h.connect();\n h.resync(['entity:x', 'entity:gone']);\n h.resync(['entity:gone']);\n expect(resynced).toHaveBeenCalledTimes(1);\n expect(resynced).toHaveBeenCalledWith(['entity:x']);\n stop();\n h.resync(['entity:x']);\n expect(resynced).toHaveBeenCalledTimes(1);\n });\n\n it('says when the stream drops and when it is back, and reopens on request', () => {\n const h = make();\n const changed = vi.fn();\n const stop = h.channel.onConnectionChange(changed);\n subscribe(h, 'entity:x', vi.fn());\n h.settle();\n // A stream still opening is not news.\n expect(h.channel.connection()).toBe('open');\n h.connect();\n expect(changed).not.toHaveBeenCalled();\n\n h.drop('reconnecting');\n expect(h.channel.connection()).toBe('reconnecting');\n h.drop('closed');\n expect(h.channel.connection()).toBe('closed');\n\n h.channel.reconnect();\n h.settle();\n h.connect();\n expect(h.channel.connection()).toBe('open');\n expect(changed).toHaveBeenCalledTimes(3);\n\n stop();\n h.drop('reconnecting');\n expect(changed).toHaveBeenCalledTimes(3);\n });\n });\n};\n"],"names":["describe","expect","it","vi","pushChannelContractEvent","id","name","source","at","audience","kind","data","n","describePushChannelContract","make","subscribe","channel","topic","listener","h","x","fn","y","settle","connect","push","toHaveBeenCalledWith","objectContaining","not","toHaveBeenCalled","toHaveBeenCalledTimes","gone","kept","unsubscribe","early","onConnect","late","stop","resynced","onResync","resync","changed","onConnectionChange","connection","toBe","drop","reconnect"],"mappings":"AACA,SAASA,QAAQ,EAAEC,MAAM,EAAEC,EAAE,EAAEC,EAAE,QAAQ,SAAS;AAoClD;;;CAGC,GACD,OAAO,MAAMC,2BAA2B,CAACC,KAA6B,CAAA;QACpEC,MAAM;QACND;QACAE,QAAQ;QACRC,IAAI;QACJC,UAAU;YAAC;gBAAEC,MAAM;gBAAgBL,IAAI;YAAI;SAAE;QAC7CM,MAAM;YAAEC,GAAG;QAAE;IACf,CAAA,EAAG;AAEH;;;;;;;;;CASC,GACD,OAAO,MAAMC,8BAA8B,CACzCP,MACAQ;IAEA,MAAMC,YAAY,CAChB,EAAEC,OAAO,EAAsB,EAC/BC,OACAC,WACGF,QAAQD,SAAS,CAACE,OAAOC;IAE9BlB,SAAS,GAAGM,KAAK,4BAA4B,CAAC,EAAE;QAC9CJ,GAAG,4EAA4E;YAC7E,MAAMiB,IAAIL;YACV,MAAMM,IAAIjB,GAAGkB,EAAE;YACf,MAAMC,IAAInB,GAAGkB,EAAE;YACfN,UAAUI,GAAG,YAAYC;YACzBL,UAAUI,GAAG,YAAYG;YACzBH,EAAEI,MAAM;YACRJ,EAAEK,OAAO;YACTL,EAAEM,IAAI,CAAC;gBAAC;aAAW,EAAErB,yBAAyB;YAC9CH,OAAOmB,GAAGM,oBAAoB,CAC5BzB,OAAO0B,gBAAgB,CAAC;gBAAEtB,IAAI;gBAAMM,MAAM;oBAAEC,GAAG;gBAAE;YAA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AAU,IAAIC,IAAI,CAAC;YAEpCzB,EAAEH,OAAO,CAAC8B,SAAS;YACnB3B,EAAEI,MAAM;YACRJ,EAAEK,OAAO;YACTvB,OAAOkB,EAAEH,OAAO,CAAC2B,UAAU,IAAIC,IAAI,CAAC;YACpC3C,OAAOwC,SAASX,qBAAqB,CAAC;YAEtCO;YACAlB,EAAE0B,IAAI,CAAC;YACP5C,OAAOwC,SAASX,qBAAqB,CAAC;QACxC;IACF;AACF,EAAE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@entifix/testing-unit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Test doubles for entifix: in-memory ports, driver fakes for Mongo, Redis, RabbitMQ and SQL, MSW handlers and port contract suites.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@swc/helpers": "0.5.23",
|
|
75
|
-
"@entifix/
|
|
76
|
-
"@entifix/transactions": "0.
|
|
77
|
-
"@entifix/
|
|
75
|
+
"@entifix/core": "0.20.0",
|
|
76
|
+
"@entifix/transactions": "0.20.0",
|
|
77
|
+
"@entifix/business": "0.20.0"
|
|
78
78
|
},
|
|
79
79
|
"peerDependencies": {
|
|
80
80
|
"@testing-library/react": "*",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"msw": ">=3",
|
|
83
83
|
"react": "*",
|
|
84
84
|
"vitest": "*",
|
|
85
|
-
"@entifix/react-controls": "0.
|
|
85
|
+
"@entifix/react-controls": "0.20.0"
|
|
86
86
|
},
|
|
87
87
|
"peerDependenciesMeta": {
|
|
88
88
|
"@entifix/react-controls": {
|