@reventlessdev/reventless-local 3.0.0-alpha.142 → 3.0.0-alpha.143
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 +14 -0
- package/package.json +8 -8
- package/src/Platform.res +252 -110
- package/src/Platform.res.mjs +522 -166
- package/src/adapter/Api/LocalGraphQL_SubscriptionResolvers.res +3 -3
- package/src/components/Aggregate_Builder.res +1 -0
- package/src/components/Aggregate_Builder.res.mjs +5 -0
- package/tests/PluginEventDecodeTest.res +47 -0
- package/tests/PluginEventDecodeTest.res.mjs +33 -0
- package/tests/adapter/GraphQLSubscriptionBridgeTest.res +6 -7
- package/tests/adapter/GraphQLSubscriptionBridgeTest.res.mjs +2 -3
- package/tests/plugin/ApiFragmentRegistry_GWT.res +103 -0
- package/tests/plugin/ApiFragmentRegistry_GWT.res.mjs +196 -0
- package/tests/plugin/ApiFragments_GWT.res +103 -0
- package/tests/plugin/ApiFragments_GWT.res.mjs +170 -0
- package/tests/plugin/PluginBehavior_GWT.res +2 -18
- package/tests/plugin/PluginBehavior_GWT.res.mjs +0 -37
- package/tests/plugin/Plugin_Fixtures.res +0 -7
- package/tests/plugin/Plugin_Fixtures.res.mjs +0 -21
- package/tests/plugin/PluginsProjection_GWT.res +0 -12
- package/tests/plugin/PluginsProjection_GWT.res.mjs +0 -19
- package/tests/plugin/UiFragmentRegistry_GWT.res +53 -0
- package/tests/plugin/UiFragmentRegistry_GWT.res.mjs +92 -0
- package/tests/plugin/UiFragments_GWT.res +55 -0
- package/tests/plugin/UiFragments_GWT.res.mjs +84 -0
- package/tests/plugin/UIFragmentRegistryProjection_GWT.res +0 -72
- package/tests/plugin/UIFragmentRegistryProjection_GWT.res.mjs +0 -117
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
open ReventlessCore
|
|
2
|
-
open PluginSpec
|
|
3
|
-
open Plugin_Fixtures
|
|
4
|
-
module UIFragmentRegistryProjectionTest = ReventlessGwt.MultiSourceProjection_GWT.Make(
|
|
5
|
-
UIFragmentRegistryProjection.UIFragmentRegistryMapping,
|
|
6
|
-
)
|
|
7
|
-
open UIFragmentRegistryProjectionTest
|
|
8
|
-
|
|
9
|
-
let registeredState: UIFragmentRegistryReadModelSpec.state = {
|
|
10
|
-
pluginId: ReventlessGwt.TestFixtures.id,
|
|
11
|
-
remoteEntryUrl: uiManifest.remoteEntryUrl,
|
|
12
|
-
panels: uiManifest.panels,
|
|
13
|
-
pages: uiManifest.pages,
|
|
14
|
-
registeredAt: ReventlessGwt.TestFixtures.meta.time,
|
|
15
|
-
updatedAt: ReventlessGwt.TestFixtures.meta.time,
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
let updatedManifest: Reventless.Plugin.uiFragmentManifest = {
|
|
19
|
-
remoteEntryUrl: "https://cdn.example.com/plugin@2.0/remoteEntry.js",
|
|
20
|
-
panels: [],
|
|
21
|
-
pages: [],
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
describe("UIFragmentRegistryProjection:", () => {
|
|
25
|
-
test("UIFragmentRegistered creates entry", () =>
|
|
26
|
-
givenEvents([])
|
|
27
|
-
->whenEvent(UIFragmentRegistered({pluginId: pluginDefinition.id, manifest: uiManifest}))
|
|
28
|
-
->thenState(registeredState)
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
test("UIFragmentUpdated updates manifest fields", () =>
|
|
32
|
-
givenEvents([UIFragmentRegistered({pluginId: pluginDefinition.id, manifest: uiManifest})])
|
|
33
|
-
->whenEvent(
|
|
34
|
-
UIFragmentUpdated({
|
|
35
|
-
pluginId: pluginDefinition.id,
|
|
36
|
-
previousManifest: uiManifest,
|
|
37
|
-
newManifest: updatedManifest,
|
|
38
|
-
}),
|
|
39
|
-
)
|
|
40
|
-
->thenState({
|
|
41
|
-
...registeredState,
|
|
42
|
-
remoteEntryUrl: updatedManifest.remoteEntryUrl,
|
|
43
|
-
panels: updatedManifest.panels,
|
|
44
|
-
pages: updatedManifest.pages,
|
|
45
|
-
updatedAt: ReventlessGwt.TestFixtures.meta.time,
|
|
46
|
-
})
|
|
47
|
-
)
|
|
48
|
-
|
|
49
|
-
test("UIFragmentDeregistered removes entry", () =>
|
|
50
|
-
givenEvents([UIFragmentRegistered({pluginId: pluginDefinition.id, manifest: uiManifest})])
|
|
51
|
-
->whenEvent(UIFragmentDeregistered({pluginId: pluginDefinition.id}))
|
|
52
|
-
->thenNoState
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
test("VersionConnected is ignored", () =>
|
|
56
|
-
givenEvents([UIFragmentRegistered({pluginId: pluginDefinition.id, manifest: uiManifest})])
|
|
57
|
-
->whenEvent(VersionConnected(pluginDefinition))
|
|
58
|
-
->thenState(registeredState)
|
|
59
|
-
)
|
|
60
|
-
|
|
61
|
-
test("VersionDisconnected is ignored", () =>
|
|
62
|
-
givenEvents([UIFragmentRegistered({pluginId: pluginDefinition.id, manifest: uiManifest})])
|
|
63
|
-
->whenEvent(VersionDisconnected(pluginDefinition))
|
|
64
|
-
->thenState(registeredState)
|
|
65
|
-
)
|
|
66
|
-
|
|
67
|
-
test("VersionDetected is ignored", () =>
|
|
68
|
-
givenEvents([UIFragmentRegistered({pluginId: pluginDefinition.id, manifest: uiManifest})])
|
|
69
|
-
->whenEvent(VersionDetected("1"))
|
|
70
|
-
->thenState(registeredState)
|
|
71
|
-
)
|
|
72
|
-
})
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
|
|
3
|
-
import * as TestFixtures$ReventlessGwt from "@reventlessdev/reventless-gwt/src/TestFixtures.res.mjs";
|
|
4
|
-
import * as Plugin_Fixtures$ReventlessLocal from "./Plugin_Fixtures.res.mjs";
|
|
5
|
-
import * as MultiSourceProjection_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/MultiSourceProjection_GWT.res.mjs";
|
|
6
|
-
import * as UIFragmentRegistryProjection$ReventlessCore from "@reventlessdev/reventless-core/src/admin/UIFragmentRegistryProjection.res.mjs";
|
|
7
|
-
|
|
8
|
-
let UIFragmentRegistryProjectionTest = MultiSourceProjection_GWT$ReventlessGwt.Make(UIFragmentRegistryProjection$ReventlessCore.UIFragmentRegistryMapping);
|
|
9
|
-
|
|
10
|
-
let registeredState_remoteEntryUrl = Plugin_Fixtures$ReventlessLocal.uiManifest.remoteEntryUrl;
|
|
11
|
-
|
|
12
|
-
let registeredState_panels = Plugin_Fixtures$ReventlessLocal.uiManifest.panels;
|
|
13
|
-
|
|
14
|
-
let registeredState_pages = Plugin_Fixtures$ReventlessLocal.uiManifest.pages;
|
|
15
|
-
|
|
16
|
-
let registeredState_registeredAt = TestFixtures$ReventlessGwt.meta.time;
|
|
17
|
-
|
|
18
|
-
let registeredState_updatedAt = TestFixtures$ReventlessGwt.meta.time;
|
|
19
|
-
|
|
20
|
-
let registeredState = {
|
|
21
|
-
pluginId: TestFixtures$ReventlessGwt.id,
|
|
22
|
-
remoteEntryUrl: registeredState_remoteEntryUrl,
|
|
23
|
-
panels: registeredState_panels,
|
|
24
|
-
pages: registeredState_pages,
|
|
25
|
-
registeredAt: registeredState_registeredAt,
|
|
26
|
-
updatedAt: registeredState_updatedAt
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
let updatedManifest_panels = [];
|
|
30
|
-
|
|
31
|
-
let updatedManifest_pages = [];
|
|
32
|
-
|
|
33
|
-
let updatedManifest = {
|
|
34
|
-
remoteEntryUrl: "https://cdn.example.com/plugin@2.0/remoteEntry.js",
|
|
35
|
-
panels: updatedManifest_panels,
|
|
36
|
-
pages: updatedManifest_pages
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
UIFragmentRegistryProjectionTest.describe("UIFragmentRegistryProjection:", () => {
|
|
40
|
-
UIFragmentRegistryProjectionTest.test("UIFragmentRegistered creates entry", undefined, () => UIFragmentRegistryProjectionTest.thenState(UIFragmentRegistryProjectionTest.whenEvent(UIFragmentRegistryProjectionTest.givenEvents([]), {
|
|
41
|
-
TAG: "UIFragmentRegistered",
|
|
42
|
-
_0: {
|
|
43
|
-
pluginId: Plugin_Fixtures$ReventlessLocal.pluginDefinition.id,
|
|
44
|
-
manifest: Plugin_Fixtures$ReventlessLocal.uiManifest
|
|
45
|
-
}
|
|
46
|
-
}), registeredState));
|
|
47
|
-
UIFragmentRegistryProjectionTest.test("UIFragmentUpdated updates manifest fields", undefined, () => UIFragmentRegistryProjectionTest.thenState(UIFragmentRegistryProjectionTest.whenEvent(UIFragmentRegistryProjectionTest.givenEvents([{
|
|
48
|
-
TAG: "UIFragmentRegistered",
|
|
49
|
-
_0: {
|
|
50
|
-
pluginId: Plugin_Fixtures$ReventlessLocal.pluginDefinition.id,
|
|
51
|
-
manifest: Plugin_Fixtures$ReventlessLocal.uiManifest
|
|
52
|
-
}
|
|
53
|
-
}]), {
|
|
54
|
-
TAG: "UIFragmentUpdated",
|
|
55
|
-
_0: {
|
|
56
|
-
pluginId: Plugin_Fixtures$ReventlessLocal.pluginDefinition.id,
|
|
57
|
-
previousManifest: Plugin_Fixtures$ReventlessLocal.uiManifest,
|
|
58
|
-
newManifest: updatedManifest
|
|
59
|
-
}
|
|
60
|
-
}), {
|
|
61
|
-
pluginId: TestFixtures$ReventlessGwt.id,
|
|
62
|
-
remoteEntryUrl: "https://cdn.example.com/plugin@2.0/remoteEntry.js",
|
|
63
|
-
panels: updatedManifest_panels,
|
|
64
|
-
pages: updatedManifest_pages,
|
|
65
|
-
registeredAt: registeredState_registeredAt,
|
|
66
|
-
updatedAt: TestFixtures$ReventlessGwt.meta.time
|
|
67
|
-
}));
|
|
68
|
-
UIFragmentRegistryProjectionTest.test("UIFragmentDeregistered removes entry", undefined, () => UIFragmentRegistryProjectionTest.thenNoState(UIFragmentRegistryProjectionTest.whenEvent(UIFragmentRegistryProjectionTest.givenEvents([{
|
|
69
|
-
TAG: "UIFragmentRegistered",
|
|
70
|
-
_0: {
|
|
71
|
-
pluginId: Plugin_Fixtures$ReventlessLocal.pluginDefinition.id,
|
|
72
|
-
manifest: Plugin_Fixtures$ReventlessLocal.uiManifest
|
|
73
|
-
}
|
|
74
|
-
}]), {
|
|
75
|
-
TAG: "UIFragmentDeregistered",
|
|
76
|
-
_0: {
|
|
77
|
-
pluginId: Plugin_Fixtures$ReventlessLocal.pluginDefinition.id
|
|
78
|
-
}
|
|
79
|
-
})));
|
|
80
|
-
UIFragmentRegistryProjectionTest.test("VersionConnected is ignored", undefined, () => UIFragmentRegistryProjectionTest.thenState(UIFragmentRegistryProjectionTest.whenEvent(UIFragmentRegistryProjectionTest.givenEvents([{
|
|
81
|
-
TAG: "UIFragmentRegistered",
|
|
82
|
-
_0: {
|
|
83
|
-
pluginId: Plugin_Fixtures$ReventlessLocal.pluginDefinition.id,
|
|
84
|
-
manifest: Plugin_Fixtures$ReventlessLocal.uiManifest
|
|
85
|
-
}
|
|
86
|
-
}]), {
|
|
87
|
-
TAG: "VersionConnected",
|
|
88
|
-
_0: Plugin_Fixtures$ReventlessLocal.pluginDefinition
|
|
89
|
-
}), registeredState));
|
|
90
|
-
UIFragmentRegistryProjectionTest.test("VersionDisconnected is ignored", undefined, () => UIFragmentRegistryProjectionTest.thenState(UIFragmentRegistryProjectionTest.whenEvent(UIFragmentRegistryProjectionTest.givenEvents([{
|
|
91
|
-
TAG: "UIFragmentRegistered",
|
|
92
|
-
_0: {
|
|
93
|
-
pluginId: Plugin_Fixtures$ReventlessLocal.pluginDefinition.id,
|
|
94
|
-
manifest: Plugin_Fixtures$ReventlessLocal.uiManifest
|
|
95
|
-
}
|
|
96
|
-
}]), {
|
|
97
|
-
TAG: "VersionDisconnected",
|
|
98
|
-
_0: Plugin_Fixtures$ReventlessLocal.pluginDefinition
|
|
99
|
-
}), registeredState));
|
|
100
|
-
UIFragmentRegistryProjectionTest.test("VersionDetected is ignored", undefined, () => UIFragmentRegistryProjectionTest.thenState(UIFragmentRegistryProjectionTest.whenEvent(UIFragmentRegistryProjectionTest.givenEvents([{
|
|
101
|
-
TAG: "UIFragmentRegistered",
|
|
102
|
-
_0: {
|
|
103
|
-
pluginId: Plugin_Fixtures$ReventlessLocal.pluginDefinition.id,
|
|
104
|
-
manifest: Plugin_Fixtures$ReventlessLocal.uiManifest
|
|
105
|
-
}
|
|
106
|
-
}]), {
|
|
107
|
-
TAG: "VersionDetected",
|
|
108
|
-
_0: "1"
|
|
109
|
-
}), registeredState));
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
export {
|
|
113
|
-
UIFragmentRegistryProjectionTest,
|
|
114
|
-
registeredState,
|
|
115
|
-
updatedManifest,
|
|
116
|
-
}
|
|
117
|
-
/* UIFragmentRegistryProjectionTest Not a pure module */
|