@reventlessdev/reventless-aws 3.0.0-alpha.206 → 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,20 @@
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
+
13
+ # 3.0.0-alpha.207 (2026-07-13)
14
+
15
+ ### Bug Fixes
16
+
17
+ * **admin:** materialise ApiSchemaPush SideEffect Source at runtime ([57a61d9](https://github.com/ReventlessDev/reventless-core/commit/57a61d98fa11dfe3de188cc299c89abdeea41457))
18
+
19
+
6
20
  # 3.0.0-alpha.206 (2026-07-13)
7
21
 
8
22
  **Note:** Version bump only for package @reventlessdev/reventless-aws
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-aws",
3
- "version": "3.0.0-alpha.206",
3
+ "version": "3.0.0-alpha.208",
4
4
  "description": "AWS adapters for Reventless",
5
5
  "license": "Apache-2.0",
6
6
  "dependencies": {
@@ -8,16 +8,16 @@
8
8
  "@aws-sdk/client-cloudfront": "3.970.0",
9
9
  "sury": "11.0.0-alpha.4",
10
10
  "uuid": "^13.0.0",
11
- "@reventlessdev/rescript-aws-sdk": "2.2.0-alpha.21",
12
11
  "@reventlessdev/rescript-effect": "0.1.0-alpha.27",
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",
14
+ "@reventlessdev/rescript-pulumi-aws": "2.4.0-alpha.50",
15
+ "@reventlessdev/rescript-aws-sdk": "2.2.0-alpha.21",
16
16
  "@reventlessdev/rescript-uuid": "1.1.0-alpha.15",
17
17
  "@reventlessdev/reventless-core": "3.0.0-alpha.164",
18
- "@reventlessdev/reventless-infra": "3.0.0-alpha.98",
19
- "@reventlessdev/reventless-postgres": "3.0.0-alpha.28",
20
18
  "@reventlessdev/reventless-interop": "3.0.0-alpha.26",
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": {
@@ -1287,9 +1287,9 @@ function MakeWithConfig(Config) {
1287
1287
  ]).apply(param => {
1288
1288
  AdminApiSchemaPushHandler.make("AdminApiSchemaPush", [{
1289
1289
  Source: {
1290
- name: ApiFragmentRegistrySpec$ReventlessCore.name,
1291
- Id: Id$Reventless.$$String,
1292
- eventSchema: ApiFragmentRegistrySpec$ReventlessCore.eventSchema
1290
+ name: ApiSchemaPush$ReventlessAws.Source.name,
1291
+ Id: ApiSchemaPush$ReventlessAws.Source.Id,
1292
+ eventSchema: ApiSchemaPush$ReventlessAws.Source.eventSchema
1293
1293
  },
1294
1294
  moduleUrl: ApiSchemaPush$ReventlessAws.moduleUrl,
1295
1295
  execute: ApiSchemaPush$ReventlessAws.execute
@@ -2707,9 +2707,9 @@ function Make($star) {
2707
2707
  ]).apply(param => {
2708
2708
  AdminApiSchemaPushHandler.make("AdminApiSchemaPush", [{
2709
2709
  Source: {
2710
- name: ApiFragmentRegistrySpec$ReventlessCore.name,
2711
- Id: Id$Reventless.$$String,
2712
- eventSchema: ApiFragmentRegistrySpec$ReventlessCore.eventSchema
2710
+ name: ApiSchemaPush$ReventlessAws.Source.name,
2711
+ Id: ApiSchemaPush$ReventlessAws.Source.Id,
2712
+ eventSchema: ApiSchemaPush$ReventlessAws.Source.eventSchema
2713
2713
  },
2714
2714
  moduleUrl: ApiSchemaPush$ReventlessAws.moduleUrl,
2715
2715
  execute: ApiSchemaPush$ReventlessAws.execute
@@ -14,7 +14,32 @@
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
- module Source = ReventlessCore.ApiFragmentRegistrySpec
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.
30
+ module Source = {
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
42
+ }
18
43
 
19
44
  let moduleUrl: string = %raw(`import.meta.url`)
20
45
 
@@ -1,5 +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";
4
+ import * as ApiFragmentRegistrySpec$ReventlessCore from "@reventlessdev/reventless-core/src/admin/ApiFragmentRegistry/ApiFragmentRegistrySpec.res.mjs";
5
+
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
+ };
3
29
 
4
30
  let moduleUrl = import.meta.url;
5
31
 
@@ -26,9 +52,10 @@ async function execute(_id, _meta, event, _queryEngine) {
26
52
  return await pushApiSchema(jsSnapshot);
27
53
  }
28
54
 
29
- let Source;
55
+ let Spec;
30
56
 
31
57
  export {
58
+ Spec,
32
59
  Source,
33
60
  moduleUrl,
34
61
  pushApiSchema,
@@ -0,0 +1,32 @@
1
+ // Regression guard for the ApiSchemaPush SideEffect "Source erasure" deploy-only bug.
2
+ //
3
+ // SideEffectHandler_Callback.Make reads Source.{name,eventSchema,Id} reflectively off
4
+ // the imported ApiSchemaPush module at Lambda cold start. ApiSchemaPush only uses Source
5
+ // at the TYPE level, so a bare `module Source = …` alias gets dead-shaken by ReScript to
6
+ // `let Source;` (undefined) — crashing the handler with "Cannot read properties of
7
+ // undefined (reading 'eventSchema')" and hanging the deploy waiter. The `include` in
8
+ // ApiSchemaPush.res materialises Source's runtime values. These assertions dereference
9
+ // exactly the fields the runtime reads, so a regression (alias reintroduced) fails here
10
+ // instead of only on a live deploy.
11
+
12
+ open JestGlobals
13
+
14
+ describe("ApiSchemaPush SideEffect Source (runtime materialisation)", () => {
15
+ testSync("Source.name is the registry aggregate name", () => {
16
+ expect(ApiSchemaPush.Source.name)->toBe("ApiFragmentRegistry")
17
+ })
18
+
19
+ testSync("Source.eventSchema is a live schema — extractAllVariantNames succeeds", () => {
20
+ // Mirrors SideEffectHandler_Callback.Make: throws if Source is erased to undefined.
21
+ let tags = Reventless.DcbTag.extractAllVariantNames(ApiSchemaPush.Source.eventSchema)
22
+ expect(tags)->toContain("ApiSchemaComputed")
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
+ })
32
+ })
@@ -0,0 +1,20 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
4
+ import * as ApiSchemaPush$ReventlessAws from "../src/adapter/Api/ApiSchemaPush.res.mjs";
5
+
6
+ globalThis.describe("ApiSchemaPush SideEffect Source (runtime materialisation)", () => {
7
+ globalThis.test("Source.name is the registry aggregate name", () => {
8
+ globalThis.expect(ApiSchemaPush$ReventlessAws.Source.name).toBe("ApiFragmentRegistry");
9
+ });
10
+ globalThis.test("Source.eventSchema is a live schema — extractAllVariantNames succeeds", () => {
11
+ let tags = DcbTag$Reventless.extractAllVariantNames(ApiSchemaPush$ReventlessAws.Source.eventSchema);
12
+ globalThis.expect(tags).toContain("ApiSchemaComputed");
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
+ });
18
+ });
19
+
20
+ /* Not a pure module */