@reventlessdev/reventless-core 3.0.0-alpha.151 → 3.0.0-alpha.152
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
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 3.0.0-alpha.152 (2026-07-10)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **plugin-lifecycle:** expose command/event/consumed-event metadata on plugin hooks for StateChange/StateView slices ([194abf3](https://github.com/ReventlessDev/reventless-core/commit/194abf30460ae0140a7900d8ca67d671b15deb3a))
|
|
11
|
+
|
|
12
|
+
|
|
6
13
|
# 3.0.0-alpha.151 (2026-07-10)
|
|
7
14
|
|
|
8
15
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-core",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.152",
|
|
4
4
|
"description": "Core package for Reventless framework",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -29,16 +29,16 @@
|
|
|
29
29
|
"sury": "11.0.0-alpha.4",
|
|
30
30
|
"uuid": "^13.0.0",
|
|
31
31
|
"@reventlessdev/rescript-effect": "0.1.0-alpha.25",
|
|
32
|
-
"@reventlessdev/rescript-hash-object": "1.2.0-alpha.10",
|
|
33
|
-
"@reventlessdev/rescript-node-streams": "1.1.0-alpha.10",
|
|
34
32
|
"@reventlessdev/rescript-fast-csv": "1.2.0-alpha.11",
|
|
33
|
+
"@reventlessdev/rescript-hash-object": "1.2.0-alpha.10",
|
|
35
34
|
"@reventlessdev/rescript-jest": "1.0.0-alpha.6",
|
|
36
35
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.14",
|
|
36
|
+
"@reventlessdev/rescript-node-streams": "1.1.0-alpha.10",
|
|
37
37
|
"@reventlessdev/rescript-ssh2": "1.1.0-alpha.11",
|
|
38
38
|
"@reventlessdev/rescript-uuid": "1.1.0-alpha.14",
|
|
39
39
|
"@reventlessdev/reventless-infra": "3.0.0-alpha.93",
|
|
40
|
-
"@reventlessdev/reventless-
|
|
41
|
-
"@reventlessdev/reventless-
|
|
40
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.71",
|
|
41
|
+
"@reventlessdev/reventless-interop": "3.0.0-alpha.24"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"rescript": "^12.3.0",
|
|
@@ -398,14 +398,6 @@ module Make = (
|
|
|
398
398
|
({name: R.Spec.name, kind: "ReadModel", schema}: Plugin_Helpers.pluginBuiltComponent)
|
|
399
399
|
})
|
|
400
400
|
|
|
401
|
-
let mapNames = (d: dict<_>, kind: string) =>
|
|
402
|
-
d
|
|
403
|
-
->Dict.keysToArray
|
|
404
|
-
->Array.map(name => {
|
|
405
|
-
let schema: Plugin_Helpers.pluginDeployedSchema = {}
|
|
406
|
-
({Plugin_Helpers.name, kind, schema}: Plugin_Helpers.pluginBuiltComponent)
|
|
407
|
-
})
|
|
408
|
-
|
|
409
401
|
// Routing slices (automation / inbound + outbound translation) expose their
|
|
410
402
|
// command/event wiring and routing target on the hook surface, at parity
|
|
411
403
|
// with aggregates and read models — mirroring the metadata Plugin_Structure
|
|
@@ -457,15 +449,44 @@ module Make = (
|
|
|
457
449
|
)
|
|
458
450
|
)
|
|
459
451
|
|
|
452
|
+
// StateChange / StateView slices carry no routing target, but they do carry
|
|
453
|
+
// command / event / consumed-event types. Surface those on the hook at parity
|
|
454
|
+
// with aggregates, read models, and routing slices — mirroring the metadata
|
|
455
|
+
// Plugin_Structure records on the static plugin def. Type strings stay
|
|
456
|
+
// unqualified to match the aggregate/read-model entries already on this same
|
|
457
|
+
// hook surface (Plugin_Structure additionally prefixes them with the plugin
|
|
458
|
+
// name).
|
|
459
|
+
let stateSchemas: Dict.t<Plugin_Helpers.pluginDeployedSchema> = Dict.make()
|
|
460
|
+
stateChangeSlices->Array.forEach((module(Scs: ReventlessInfra.StateChangeSlice.T)) =>
|
|
461
|
+
stateSchemas->Dict.set(
|
|
462
|
+
Scs.Spec.name,
|
|
463
|
+
{
|
|
464
|
+
commandTypes: extractTypes(Scs.Spec.commandSchema),
|
|
465
|
+
eventTypes: extractEventTypes(Scs.Spec.eventSchema->S.castToUnknown),
|
|
466
|
+
consumedEventTypes: extractEventTypes(Scs.Spec.consumedEventSchema->S.castToUnknown),
|
|
467
|
+
},
|
|
468
|
+
)
|
|
469
|
+
)
|
|
470
|
+
stateViewSlices->Array.forEach((module(Svs: ReventlessInfra.StateViewSlice.T)) =>
|
|
471
|
+
stateSchemas->Dict.set(
|
|
472
|
+
Svs.Spec.name,
|
|
473
|
+
{consumedEventTypes: extractEventTypes(Svs.Spec.consumedEventSchema->S.castToUnknown)},
|
|
474
|
+
)
|
|
475
|
+
)
|
|
476
|
+
|
|
460
477
|
// Component set still derives from the DCB outputs dict (unchanged
|
|
461
478
|
// membership); enrich + register the schema where a matching spec module
|
|
462
479
|
// was found above, so the deployed hook surfaces it too (the built-hook
|
|
463
480
|
// components carry it inline).
|
|
464
|
-
let
|
|
481
|
+
let enrichedComponents = (
|
|
482
|
+
d: dict<_>,
|
|
483
|
+
kind: string,
|
|
484
|
+
schemas: Dict.t<Plugin_Helpers.pluginDeployedSchema>,
|
|
485
|
+
) =>
|
|
465
486
|
d
|
|
466
487
|
->Dict.keysToArray
|
|
467
488
|
->Array.map(name => {
|
|
468
|
-
let schema =
|
|
489
|
+
let schema = schemas->Dict.get(name)->Option.getOr({})
|
|
469
490
|
Plugin_Helpers.componentSchemaRegistry->Dict.set(name, schema)
|
|
470
491
|
({Plugin_Helpers.name, kind, schema}: Plugin_Helpers.pluginBuiltComponent)
|
|
471
492
|
})
|
|
@@ -473,11 +494,19 @@ module Make = (
|
|
|
473
494
|
let components = Array.flat([
|
|
474
495
|
aggregateComponents,
|
|
475
496
|
readModelComponents,
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
497
|
+
enrichedComponents(dcbResult.stateChangeSlicesOutputs, "StateChangeSlice", stateSchemas),
|
|
498
|
+
enrichedComponents(dcbResult.stateViewSlicesOutputs, "StateViewSlice", stateSchemas),
|
|
499
|
+
enrichedComponents(dcbResult.automationSlicesOutputs, "AutomationSlice", routingSchemas),
|
|
500
|
+
enrichedComponents(
|
|
501
|
+
dcbResult.outboundTranslationSlicesOutputs,
|
|
502
|
+
"OutboundTranslationSlice",
|
|
503
|
+
routingSchemas,
|
|
504
|
+
),
|
|
505
|
+
enrichedComponents(
|
|
506
|
+
dcbResult.inboundTranslationSlicesOutputs,
|
|
507
|
+
"InboundTranslationSlice",
|
|
508
|
+
routingSchemas,
|
|
509
|
+
),
|
|
481
510
|
])
|
|
482
511
|
|
|
483
512
|
switch Plugin_Helpers.onPluginBuiltHook.contents {
|
|
@@ -300,11 +300,6 @@ function Make(Spec) {
|
|
|
300
300
|
schema: schema
|
|
301
301
|
};
|
|
302
302
|
});
|
|
303
|
-
let mapNames = (d, kind) => Object.keys(d).map(name => ({
|
|
304
|
-
name: name,
|
|
305
|
-
kind: kind,
|
|
306
|
-
schema: {}
|
|
307
|
-
}));
|
|
308
303
|
let routingSchemas = {};
|
|
309
304
|
automationSlices.forEach(As => {
|
|
310
305
|
let consumedEventTypes = Belt_SetString.toArray(Belt_SetString.fromArray(As.Automation.mappings.flatMap(M => DcbTag$Reventless.extractVariantNames(M.sourceEventSchema))));
|
|
@@ -327,8 +322,21 @@ function Make(Spec) {
|
|
|
327
322
|
targetName: Its.Spec.targetName
|
|
328
323
|
};
|
|
329
324
|
});
|
|
330
|
-
let
|
|
331
|
-
|
|
325
|
+
let stateSchemas = {};
|
|
326
|
+
stateChangeSlices.forEach(Scs => {
|
|
327
|
+
stateSchemas[Scs.Spec.name] = {
|
|
328
|
+
commandTypes: DcbTag$Reventless.extractAllVariantNames(Scs.Spec.commandSchema),
|
|
329
|
+
eventTypes: DcbTag$Reventless.extractVariantNames(Scs.Spec.eventSchema),
|
|
330
|
+
consumedEventTypes: DcbTag$Reventless.extractVariantNames(Scs.Spec.consumedEventSchema)
|
|
331
|
+
};
|
|
332
|
+
});
|
|
333
|
+
stateViewSlices.forEach(Svs => {
|
|
334
|
+
stateSchemas[Svs.Spec.name] = {
|
|
335
|
+
consumedEventTypes: DcbTag$Reventless.extractVariantNames(Svs.Spec.consumedEventSchema)
|
|
336
|
+
};
|
|
337
|
+
});
|
|
338
|
+
let enrichedComponents = (d, kind, schemas) => Object.keys(d).map(name => {
|
|
339
|
+
let schema = Stdlib_Option.getOr(schemas[name], {});
|
|
332
340
|
Plugin_Helpers$ReventlessCore.componentSchemaRegistry[name] = schema;
|
|
333
341
|
return {
|
|
334
342
|
name: name,
|
|
@@ -339,11 +347,11 @@ function Make(Spec) {
|
|
|
339
347
|
let components = [
|
|
340
348
|
aggregateComponents,
|
|
341
349
|
readModelComponents,
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
350
|
+
enrichedComponents(dcbResult.stateChangeSlicesOutputs, "StateChangeSlice", stateSchemas),
|
|
351
|
+
enrichedComponents(dcbResult.stateViewSlicesOutputs, "StateViewSlice", stateSchemas),
|
|
352
|
+
enrichedComponents(dcbResult.automationSlicesOutputs, "AutomationSlice", routingSchemas),
|
|
353
|
+
enrichedComponents(dcbResult.outboundTranslationSlicesOutputs, "OutboundTranslationSlice", routingSchemas),
|
|
354
|
+
enrichedComponents(dcbResult.inboundTranslationSlicesOutputs, "InboundTranslationSlice", routingSchemas)
|
|
347
355
|
].flat();
|
|
348
356
|
let hook = Plugin_Helpers$ReventlessCore.onPluginBuiltHook.contents;
|
|
349
357
|
if (hook !== undefined) {
|