@reventlessdev/reventless-aws 3.0.0-alpha.207 → 3.0.0-alpha.208

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.208 (2026-07-13)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **admin:** materialise ApiSchemaPush Source.Id at runtime (part 2) ([e64eeae](https://github.com/ReventlessDev/reventless-core/commit/e64eeae9fd08c03dcadf600aac733840790772e4)), closes [#9](https://github.com/ReventlessDev/reventless-core/issues/9) [#10](https://github.com/ReventlessDev/reventless-core/issues/10)
11
+
12
+
6
13
  # 3.0.0-alpha.207 (2026-07-13)
7
14
 
8
15
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-aws",
3
- "version": "3.0.0-alpha.207",
3
+ "version": "3.0.0-alpha.208",
4
4
  "description": "AWS adapters for Reventless",
5
5
  "license": "Apache-2.0",
6
6
  "dependencies": {
@@ -9,15 +9,15 @@
9
9
  "sury": "11.0.0-alpha.4",
10
10
  "uuid": "^13.0.0",
11
11
  "@reventlessdev/rescript-effect": "0.1.0-alpha.27",
12
- "@reventlessdev/rescript-aws-sdk": "2.2.0-alpha.21",
13
- "@reventlessdev/rescript-pulumi-aws": "2.4.0-alpha.50",
14
12
  "@reventlessdev/rescript-jest": "1.0.0-alpha.7",
15
13
  "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.15",
16
- "@reventlessdev/reventless-core": "3.0.0-alpha.164",
14
+ "@reventlessdev/rescript-pulumi-aws": "2.4.0-alpha.50",
15
+ "@reventlessdev/rescript-aws-sdk": "2.2.0-alpha.21",
17
16
  "@reventlessdev/rescript-uuid": "1.1.0-alpha.15",
18
- "@reventlessdev/reventless-infra": "3.0.0-alpha.98",
17
+ "@reventlessdev/reventless-core": "3.0.0-alpha.164",
19
18
  "@reventlessdev/reventless-interop": "3.0.0-alpha.26",
20
19
  "@reventlessdev/reventless-postgres": "3.0.0-alpha.28",
20
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.98",
21
21
  "@reventlessdev/reventless-spec": "3.0.0-alpha.76"
22
22
  },
23
23
  "devDependencies": {
@@ -1288,7 +1288,7 @@ function MakeWithConfig(Config) {
1288
1288
  AdminApiSchemaPushHandler.make("AdminApiSchemaPush", [{
1289
1289
  Source: {
1290
1290
  name: ApiSchemaPush$ReventlessAws.Source.name,
1291
- Id: Id$Reventless.$$String,
1291
+ Id: ApiSchemaPush$ReventlessAws.Source.Id,
1292
1292
  eventSchema: ApiSchemaPush$ReventlessAws.Source.eventSchema
1293
1293
  },
1294
1294
  moduleUrl: ApiSchemaPush$ReventlessAws.moduleUrl,
@@ -2708,7 +2708,7 @@ function Make($star) {
2708
2708
  AdminApiSchemaPushHandler.make("AdminApiSchemaPush", [{
2709
2709
  Source: {
2710
2710
  name: ApiSchemaPush$ReventlessAws.Source.name,
2711
- Id: Id$Reventless.$$String,
2711
+ Id: ApiSchemaPush$ReventlessAws.Source.Id,
2712
2712
  eventSchema: ApiSchemaPush$ReventlessAws.Source.eventSchema
2713
2713
  },
2714
2714
  moduleUrl: ApiSchemaPush$ReventlessAws.moduleUrl,
@@ -14,15 +14,31 @@
14
14
  // is loaded via dynamic import so no @aws-sdk / provider code is statically captured
15
15
  // beyond what the SideEffectHandler Lambda already bundles (runtime-purity — see
16
16
  // reference_pulumi_leaks_into_lambda_runtime_graph).
17
- // `include` (not a bare `module Source = …` alias) is deliberate. SideEffectHandler_Callback
18
- // reads Source.{name,eventSchema,Id} reflectively off this module's compiled export at cold
19
- // start, but ApiSchemaPush only uses Source at the TYPE level (Source.event, Source.Id.t,
20
- // Source.fragmentSnapshotEntry) a bare module alias is dead-shaken by ReScript to
21
- // `let Source;` (undefined), crashing the handler with "Cannot read properties of undefined
22
- // (reading 'eventSchema')". `include` materialises the module's runtime values into the export
23
- // while keeping full type transparency for the pattern match below.
17
+ module Spec = ReventlessCore.ApiFragmentRegistrySpec
18
+
19
+ // Source is built EXPLICITLY rather than aliasing/including the spec. SideEffectHandler_Callback
20
+ // reads Source.{name,eventSchema,Id.schema} reflectively off this module's compiled export at
21
+ // Lambda cold start, but the spec uses these only at the TYPE level, so ReScript dead-shakes
22
+ // them: a bare `module Source = Spec` alias erases the whole binding to `let Source;`, and even
23
+ // the spec's own @@reventless.spec-injected `module Id` compiles to `let Id;` (undefined) — the
24
+ // cross-module runtime reflection is invisible to ReScript's optimiser (deploy-time is fine
25
+ // because Platform.res hand-wires these values). Both surfaced on deploy as "Cannot read
26
+ // properties of undefined (reading 'eventSchema' / 'schema')". Forwarding name/eventSchema (real
27
+ // spec exports) and re-binding Id (String — the singleton registry id, matching Platform.res's
28
+ // hand-wiring) materialises all three, while the type aliases keep full transparency for the
29
+ // pattern match below.
24
30
  module Source = {
25
- include ReventlessCore.ApiFragmentRegistrySpec
31
+ type event = Spec.event
32
+ type fragmentSnapshotEntry = Spec.fragmentSnapshotEntry
33
+ // `include` (not `module Id = Reventless.Id.String`) — a bare module alias compiles to
34
+ // `Id: undefined` in the Source record (Id is only type-projected via Source.Id.t), and
35
+ // SideEffectHandler_Callback's `Source.Id.schema` reflective read crashes at cold start.
36
+ // `include` materialises the Id module's runtime values into the record.
37
+ module Id = {
38
+ include Reventless.Id.String
39
+ }
40
+ let name = Spec.name
41
+ let eventSchema = Spec.eventSchema
26
42
  }
27
43
 
28
44
  let moduleUrl: string = %raw(`import.meta.url`)
@@ -1,8 +1,31 @@
1
1
  // Generated by ReScript, PLEASE EDIT WITH CARE
2
2
 
3
+ import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
3
4
  import * as ApiFragmentRegistrySpec$ReventlessCore from "@reventlessdev/reventless-core/src/admin/ApiFragmentRegistry/ApiFragmentRegistrySpec.res.mjs";
4
5
 
5
- let Source = ApiFragmentRegistrySpec$ReventlessCore;
6
+ let Id_schema = Id$Reventless.$$String.schema;
7
+
8
+ let Id_make = Id$Reventless.$$String.make;
9
+
10
+ let Id_makeFromString = Id$Reventless.$$String.makeFromString;
11
+
12
+ let Id_toString = Id$Reventless.$$String.toString;
13
+
14
+ let Id_cmp = Id$Reventless.$$String.cmp;
15
+
16
+ let Id = {
17
+ schema: Id_schema,
18
+ make: Id_make,
19
+ makeFromString: Id_makeFromString,
20
+ toString: Id_toString,
21
+ cmp: Id_cmp
22
+ };
23
+
24
+ let Source = {
25
+ Id: Id,
26
+ name: ApiFragmentRegistrySpec$ReventlessCore.name,
27
+ eventSchema: ApiFragmentRegistrySpec$ReventlessCore.eventSchema
28
+ };
6
29
 
7
30
  let moduleUrl = import.meta.url;
8
31
 
@@ -29,7 +52,10 @@ async function execute(_id, _meta, event, _queryEngine) {
29
52
  return await pushApiSchema(jsSnapshot);
30
53
  }
31
54
 
55
+ let Spec;
56
+
32
57
  export {
58
+ Spec,
33
59
  Source,
34
60
  moduleUrl,
35
61
  pushApiSchema,
@@ -21,4 +21,12 @@ describe("ApiSchemaPush SideEffect Source (runtime materialisation)", () => {
21
21
  let tags = Reventless.DcbTag.extractAllVariantNames(ApiSchemaPush.Source.eventSchema)
22
22
  expect(tags)->toContain("ApiSchemaComputed")
23
23
  })
24
+
25
+ testSync("Source.Id is a live module — the reflective id round-trip does not crash", () => {
26
+ // SideEffectHandler_Callback reads `Source.Id.schema` on the id-bearing registry events.
27
+ // A bare `module Id` alias compiles to `Id: undefined` in the Source record, so any access
28
+ // (makeFromString/toString/schema) throws "reading 'schema'"/undefined on a regression.
29
+ let id = "registry"->ApiSchemaPush.Source.Id.makeFromString
30
+ expect(id->ApiSchemaPush.Source.Id.toString)->toBe("registry")
31
+ })
24
32
  })
@@ -11,6 +11,10 @@ globalThis.describe("ApiSchemaPush SideEffect Source (runtime materialisation)",
11
11
  let tags = DcbTag$Reventless.extractAllVariantNames(ApiSchemaPush$ReventlessAws.Source.eventSchema);
12
12
  globalThis.expect(tags).toContain("ApiSchemaComputed");
13
13
  });
14
+ globalThis.test("Source.Id is a live module — the reflective id round-trip does not crash", () => {
15
+ let id = ApiSchemaPush$ReventlessAws.Source.Id.makeFromString("registry");
16
+ globalThis.expect(ApiSchemaPush$ReventlessAws.Source.Id.toString(id)).toBe("registry");
17
+ });
14
18
  });
15
19
 
16
20
  /* Not a pure module */