@reventlessdev/reventless-aws 3.0.0-alpha.343 → 3.0.0-alpha.345

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.
Files changed (234) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/package.json +11 -11
  3. package/scripts/ProvisionIdentity.res +8 -3
  4. package/src/Platform.res +327 -328
  5. package/src/Platform.res.mjs +4 -2
  6. package/src/Platform_Casts.res +13 -4
  7. package/src/adapter/Api/AppSyncEventsSigner_Ops.res +8 -4
  8. package/src/adapter/Api/AppSync_EventsApi.res +12 -14
  9. package/src/adapter/Api/AppSync_Resolver_Native.res +3 -4
  10. package/src/adapter/Api/AppSync_Resolver_Retrying.res +78 -70
  11. package/src/adapter/Api/AppSync_SourceApiAssociation_Retrying.res +11 -8
  12. package/src/adapter/Api/Platform_AdminScan_Ops.res +15 -14
  13. package/src/adapter/Api/Platform_ComponentDefinitions_Lambda.res +10 -2
  14. package/src/adapter/Api/Platform_ComponentDefinitions_Lambda_Ops.res +40 -50
  15. package/src/adapter/Api/Platform_UIFragments_Lambda.res +39 -32
  16. package/src/adapter/Api/Platform_UIFragments_Lambda_Ops.res +5 -2
  17. package/src/adapter/Auth/Auth_ActiveRolePoolAttachment.res +0 -1
  18. package/src/adapter/Auth/Auth_ActiveRoleStore.res +1 -2
  19. package/src/adapter/Auth/Auth_ActiveRoleStore_Schema.res +1 -4
  20. package/src/adapter/Auth/Auth_ActiveRoleTrigger_Ops.res +5 -2
  21. package/src/adapter/Auth/Auth_Cognito.res +3 -9
  22. package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync.res +1 -4
  23. package/src/adapter/CommandGenerator/CommandGeneratorResolvers_AppSync_NoOp.res +3 -1
  24. package/src/adapter/CommandGenerator/InboundTranslationResolvers_AppSync.res +1 -4
  25. package/src/adapter/CommandTopic/CommandTopicChannel_SQS.res +7 -4
  26. package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Async.res +6 -1
  27. package/src/adapter/CommandTopic/CommandTopicChannel_SQS_FIFO.res +7 -4
  28. package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Runtime.res +24 -18
  29. package/src/adapter/CommandTopic/CommandTopicChannel_SQS_Sync.res +9 -4
  30. package/src/adapter/CommandTopic/CommandTopicRegistry.res +1 -4
  31. package/src/adapter/Counter/CounterHandler_DynamoDbStream.res +15 -15
  32. package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb.res +9 -5
  33. package/src/adapter/DcbEventLog/DcbEventLogStorage_DynamoDb_Runtime.res +179 -213
  34. package/src/adapter/EventCollector/EventCollectorChannel_DynamoDbStream.res +5 -5
  35. package/src/adapter/EventCollector/EventCollectorChannel_Helpers.res +6 -2
  36. package/src/adapter/EventCollector/EventCollectorChannel_SQS.res +14 -7
  37. package/src/adapter/EventCollector/EventCollectorChannel_SQS_FIFO.res +14 -7
  38. package/src/adapter/EventCollector/EventCollectorChannel_SQS_Runtime.res +6 -3
  39. package/src/adapter/EventLog/EventLogStorage_DynamoDbStream.res +6 -1
  40. package/src/adapter/EventLog/EventLogStorage_DynamoDb_Runtime.res +13 -17
  41. package/src/adapter/EventLog/EventLogStorage_Postgres.res +7 -4
  42. package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync.res +12 -7
  43. package/src/adapter/EventLogSubscription/EventLogSubscription_AppSync_Ops.res +4 -2
  44. package/src/adapter/EventTopic/EventTopicPublisher_DynamoDbStream.res +3 -2
  45. package/src/adapter/EventTopic/EventTopicPublisher_SNS.res +20 -12
  46. package/src/adapter/EventTopic/EventTopicPublisher_SNS_FIFO.res +21 -9
  47. package/src/adapter/EventTopic/EventTopicPublisher_SNS_Runtime.res +5 -3
  48. package/src/adapter/Geocoder/Geocoder_AwsLocation_Resolver.res +6 -3
  49. package/src/adapter/Mcp/MCP_Lambda.res +31 -46
  50. package/src/adapter/Messaging/Messaging_Ses_Backend.res +11 -7
  51. package/src/adapter/Messaging/Messaging_Ses_Backend.res.mjs +2 -4
  52. package/src/adapter/Monitoring/Monitoring_CloudWatch.res +16 -16
  53. package/src/adapter/Postgres/PgChangeFeedRelay_Builder.res +5 -10
  54. package/src/adapter/Postgres/PgChangeFeedRelay_Runtime.res +4 -2
  55. package/src/adapter/Postgres/PgConnection.res +6 -5
  56. package/src/adapter/Postgres/PgMigration_Builder.res +4 -8
  57. package/src/adapter/Postgres/PgRuntime.res +4 -7
  58. package/src/adapter/QueryDb/PgQueryResolver_Builder.res +9 -11
  59. package/src/adapter/QueryDb/PgQueryResolver_Lambda.res +22 -21
  60. package/src/adapter/QueryDb/QueryDbResolvers_AppSync.res +114 -111
  61. package/src/adapter/QueryDb/QueryDbResolvers_Lambda.res +1 -7
  62. package/src/adapter/QueryDb/QueryDbStorage.res +4 -2
  63. package/src/adapter/QueryDb/QueryDbStorage_DynamoDb.res +23 -24
  64. package/src/adapter/QueryDb/QueryDbStorage_DynamoDbStream.res +8 -2
  65. package/src/adapter/QueryDb/QueryDbStorage_DynamoDb_Runtime.res +71 -73
  66. package/src/adapter/QueryDb/QueryDbStorage_Postgres.res +5 -2
  67. package/src/adapter/QueryDb/QueryInterceptor_Provisioning.res +1 -4
  68. package/src/adapter/QueryEngine/QueryEngine_DynamoDb.res +8 -2
  69. package/src/adapter/Runtime/AggregateRuntime_Builder_Micro.res +73 -81
  70. package/src/adapter/Runtime/AggregateRuntime_Builder_Micro_Async.res +72 -78
  71. package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate.res +44 -67
  72. package/src/adapter/Runtime/AggregateRuntime_Builder_PerAggregate_Async.res +44 -67
  73. package/src/adapter/Runtime/AggregateRuntime_Builder_Single.res +53 -82
  74. package/src/adapter/Runtime/AggregateRuntime_Builder_Single_Async.res +47 -77
  75. package/src/adapter/Runtime/AutomationSliceEntryPoint_Ops.res +18 -11
  76. package/src/adapter/Runtime/AutomationSliceRuntime_Builder_Single.res +80 -97
  77. package/src/adapter/Runtime/CounterEntryPoint_Ops.res +2 -7
  78. package/src/adapter/Runtime/DcbCommandTopicEntryPoint_Ops.res +16 -10
  79. package/src/adapter/Runtime/EventCollectorEntryPoint_Ops.res +24 -15
  80. package/src/adapter/Runtime/EventCollectorRuntime_Builder_PerEventCollector.res +17 -37
  81. package/src/adapter/Runtime/EventCollectorRuntime_Builder_Single.res +31 -57
  82. package/src/adapter/Runtime/EventMapperEntryPoint_Ops.res +18 -24
  83. package/src/adapter/Runtime/ExtensionPointEntryPoint_Ops.res +1 -5
  84. package/src/adapter/Runtime/ExtensionPointRuntime_Builder_PerExtensionPoint.res +4 -3
  85. package/src/adapter/Runtime/HeartbeatEntryPoint.res +0 -1
  86. package/src/adapter/Runtime/PgChangeFeedRelayEntryPoint.res +4 -2
  87. package/src/adapter/Runtime/PgMigrationEntryPoint.res +0 -1
  88. package/src/adapter/Runtime/PgQueryResolverEntryPoint_Ops.res +3 -2
  89. package/src/adapter/Runtime/PluginExtensionPointEntryPoint.res +1 -2
  90. package/src/adapter/Runtime/ProjectionEntryPoint_Ops.res +4 -5
  91. package/src/adapter/Runtime/RuntimeEnvironment_Lambda.res +22 -10
  92. package/src/adapter/Runtime/RuntimeExtensionEntryPoint_Ops.res +8 -2
  93. package/src/adapter/Runtime/SideEffectHandlerRuntime_Builder_Single.res +14 -31
  94. package/src/adapter/Runtime/StateChangeSliceRuntime_Builder_Single.res +16 -17
  95. package/src/adapter/Runtime/StateViewSliceEntryPoint_Ops.res +10 -9
  96. package/src/adapter/Runtime/StateViewSliceRuntime_Builder_Single.res +46 -52
  97. package/src/adapter/Runtime/StreamRoutedEntryPoint_Ops.res +36 -41
  98. package/src/adapter/Runtime/TaskBucketEntryPoint_Ops.res +31 -37
  99. package/src/adapter/Runtime/TaskRuntime_Builder_PerBucket.res +6 -7
  100. package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents.res +4 -6
  101. package/src/adapter/ScheduledPublisher/ScheduledPublisher_CloudWatchEvents_Runtime.res +2 -6
  102. package/src/adapter/StateTopic/StateTopic_AppSync.res +21 -16
  103. package/src/adapter/StateTopic/StateTopic_AppSync_Ops.res +36 -32
  104. package/src/adapter/Task/TaskBucket_S3.res +6 -1
  105. package/src/adapter/Upload/Upload_Claim_S3.res +17 -20
  106. package/src/adapter/Upload/Upload_Claim_S3_Ops.res +5 -2
  107. package/src/adapter/Upload/Upload_Presign_S3.res +51 -49
  108. package/src/capability/Capability_Geocoding_AwsLocation.res +4 -1
  109. package/src/capability/Capability_Messaging.res +4 -5
  110. package/src/capability/Capability_Messaging_Ses.res +3 -1
  111. package/src/capability/Capability_ObjectStore_S3.res +1 -7
  112. package/src/components/Api/AppSync_Adapter.res +28 -41
  113. package/src/components/Api/AppSync_SdlDecorate.res +38 -30
  114. package/src/components/AutomationSlice_Builder.res +6 -4
  115. package/src/components/ExtensionPoint_Builder.res +9 -10
  116. package/src/components/InboundTranslationSlice_Builder.res +7 -8
  117. package/src/components/OutboundTranslationSlice_Builder.res +14 -8
  118. package/src/components/OutboundTranslationSlice_Builder.res.mjs +1 -1
  119. package/src/components/SideEffectHandler_Single.res +4 -4
  120. package/src/components/StateViewSlice_Builder.res +6 -4
  121. package/src/components/StateViewSlice_Builder_Stream.res +6 -4
  122. package/src/components/Task_Builder_PerBucket.res +10 -11
  123. package/src/plugin/cloner/ClonerRunner_Fargate.res +3 -10
  124. package/src/plugin/cloner/ClonerRunner_Fargate_Runtime.res +1 -4
  125. package/src/plugin/heartbeat/HeartbeatRunner_CloudWatchEvents.res +5 -5
  126. package/src/plugin/runtime/PluginExtensionPointRuntime_Builder.res +19 -21
  127. package/src/plugin/runtime/PluginRuntime_Builder.res +167 -188
  128. package/src/plugin/runtime/Util_PluginMessage_Runtime.res +6 -5
  129. package/src/plugin/stack/Plugin_Stack.res +104 -103
  130. package/src/util/Util_AlarmSpec.res +2 -1
  131. package/src/util/Util_AppSync.res +8 -2
  132. package/src/util/Util_AppSync_Caller.res +15 -14
  133. package/src/util/Util_Bundle.res +144 -67
  134. package/src/util/Util_Bundle.res.mjs +64 -13
  135. package/src/util/Util_CognitoGroupUser_Runtime.res +32 -34
  136. package/src/util/Util_Cognito_Runtime.res +11 -7
  137. package/src/util/Util_DeadLetterQueue.res +12 -2
  138. package/src/util/Util_DynamoDb.res +5 -3
  139. package/src/util/Util_DynamoDbStream.res +7 -3
  140. package/src/util/Util_DynamoDbStream_Runtime.res +1 -2
  141. package/src/util/Util_DynamoDb_Runtime.res +23 -41
  142. package/src/util/Util_HostUiDomain.res +6 -1
  143. package/src/util/Util_Kinesis_Runtime.res +10 -11
  144. package/src/util/Util_Lambda.res +12 -5
  145. package/src/util/Util_LambdaEnvBudget.res +5 -5
  146. package/src/util/Util_LambdaLogging.res +1 -2
  147. package/src/util/Util_LogGroup_Adopting.res +1 -4
  148. package/src/util/Util_ResourceNaming.res +1 -2
  149. package/src/util/Util_SNS.res +8 -3
  150. package/src/util/Util_SNS_FIFO.res +1 -1
  151. package/src/util/Util_SNS_Runtime.res +11 -10
  152. package/src/util/Util_SQS.res +4 -2
  153. package/src/util/Util_SQS_FIFO.res +5 -2
  154. package/src/util/Util_SQS_Runtime.res +37 -36
  155. package/src/util/Util_ShellConfig.res +3 -2
  156. package/src/util/Util_StaticBundle.res +1 -3
  157. package/src/util/Util_StoreLayout.res +4 -1
  158. package/tests/AWS_TagsTest.res +16 -5
  159. package/tests/AppSyncEventsSigner_OpsTest.res +11 -2
  160. package/tests/AppSync_AdapterTest.res +203 -224
  161. package/tests/AppSync_Resolver_RetryingTest.res +64 -44
  162. package/tests/AppSync_RetirementNarrowingTest.res +59 -46
  163. package/tests/AppSync_SdlDecorateTest.res +22 -20
  164. package/tests/AppSync_SourceApiAssociation_RetryingTest.res +40 -22
  165. package/tests/Auth_ActiveRolePoolAttachmentTest.res +114 -107
  166. package/tests/Auth_ActiveRoleStoreTest.res +12 -9
  167. package/tests/Auth_ActiveRoleStore_SchemaTest.res +2 -1
  168. package/tests/Auth_ActiveRoleTrigger_OpsTest.res +20 -16
  169. package/tests/Auth_CognitoTest.res +31 -46
  170. package/tests/AutomationSliceEntryPoint_OpsTest.res +69 -67
  171. package/tests/BakeConvergenceTest.res +22 -25
  172. package/tests/Capability_MessagingTest.res +28 -12
  173. package/tests/CommandTopicQueuePolicyTest.res +1 -2
  174. package/tests/CounterEntryPoint_OpsTest.res +3 -7
  175. package/tests/DcbEventLogStorage_DynamoDb_RuntimeTest.res +306 -210
  176. package/tests/EventCollectorConnectLambdaPreviewTest.res +14 -7
  177. package/tests/EventCollectorEntryPoint_OpsTest.res +12 -4
  178. package/tests/EventCollectorPluginDefinitionAssetTest.res +18 -11
  179. package/tests/EventCollectorReadyGateTest.res +5 -4
  180. package/tests/EventLogStorage_DynamoDb_RuntimeTest.res +1 -2
  181. package/tests/EventMapperEntryPoint_OpsTest.res +1 -3
  182. package/tests/ExtensionPointEntryPoint_OpsTest.res +1 -4
  183. package/tests/HandlerFactoryDispatchTest.res +97 -70
  184. package/tests/MCP_LambdaTest.res +16 -27
  185. package/tests/PgChangeFeedRelay_IntegrationTest.res +123 -93
  186. package/tests/PgChangeFeedRelay_RuntimeTest.res +13 -10
  187. package/tests/PgMigrationEntryPoint_IntegrationTest.res +0 -1
  188. package/tests/PgPipeline_IntegrationTest.res +80 -66
  189. package/tests/PgQueryDbUnion_IntegrationTest.res +1 -2
  190. package/tests/PgQueryResolverEntryPoint_OpsTest.res +2 -6
  191. package/tests/PgQueryResolver_LambdaTest.res +41 -24
  192. package/tests/Platform_AdminScan_OpsTest.res +4 -1
  193. package/tests/Platform_ComponentDefinitions_Lambda_OpsTest.res +137 -129
  194. package/tests/ProjectionEntryPoint_DisplayNameTest.res +7 -3
  195. package/tests/ProjectionEntryPoint_UnionStampTest.res +3 -2
  196. package/tests/ProvisionIdentityTest.res +2 -6
  197. package/tests/QueryDbOwnerIndexTableTest.res +6 -4
  198. package/tests/QueryDbResolvers_AppSyncTest.res +23 -16
  199. package/tests/QueryInterceptor_LambdaTest.res +11 -13
  200. package/tests/ReadModelEntryPoint_OpsTest.res +43 -41
  201. package/tests/RuntimeExtensionEntryPoint_OpsTest.res +4 -3
  202. package/tests/SideEffectEntryPoint_OpsTest.res +23 -18
  203. package/tests/StateChangeDescriptorParityTest.res +28 -26
  204. package/tests/StateTopicKeySchemaTest.res +18 -15
  205. package/tests/StateViewSliceEntryPoint_OpsTest.res +55 -44
  206. package/tests/TaskBucketEntryPoint_OpsTest.res +13 -13
  207. package/tests/Upload_ClaimTest.res +3 -3
  208. package/tests/Util_AwsErrorTest.res +4 -7
  209. package/tests/Util_BundleDependencyClosureTest.res +41 -3
  210. package/tests/Util_BundleDependencyClosureTest.res.mjs +11 -0
  211. package/tests/Util_BundleEsmLoaderTest.res +3 -3
  212. package/tests/Util_BundleResolveTest.res +4 -6
  213. package/tests/Util_BundleRuntimeExtensionTest.res +17 -18
  214. package/tests/Util_DcbMetricsTest.res +6 -6
  215. package/tests/Util_DynamoDbStreamTest.res +4 -5
  216. package/tests/Util_DynamoDbTest.res +3 -2
  217. package/tests/Util_LambdaEnvBudgetTest.res +22 -18
  218. package/tests/Util_LambdaLoggingTest.res +9 -8
  219. package/tests/Util_LogGroup_AdoptingTest.res +10 -5
  220. package/tests/Util_LogRetentionTest.res +6 -2
  221. package/tests/Util_OwnerScopeEnvTest.res +10 -8
  222. package/tests/Util_SQS_RuntimeTest.res +5 -7
  223. package/tests/Util_ShellConfigTest.res +7 -17
  224. package/tests/Util_StaticBundleTest.res +3 -8
  225. package/tests/Util_StoreLayoutTest.res +17 -12
  226. package/tests/integration/AggregateEntryPoint_IntegrationTest.res +1 -4
  227. package/tests/integration/DcbCommandTopicEntryPoint_IntegrationTest.res +15 -15
  228. package/tests/integration/DcbEventLogStorage_DynamoDb_IntegrationTest.res +296 -232
  229. package/tests/integration/DcbIntegrationHarness.res +8 -8
  230. package/tests/integration/EpCompositeSlice.res +16 -8
  231. package/tests/integration/QueryDbUnion_DynamoDb_IntegrationTest.res +8 -10
  232. package/tests/integration/StateViewSliceEntryPoint_IntegrationTest.res +10 -10
  233. package/tests/integration/SvsTestSlice_Projection.res +1 -3
  234. package/tests/util/Util_AlarmSpecTest.res +62 -49
@@ -62,8 +62,17 @@ export const rule = () => Rules.check();
62
62
  ),
63
63
  ],
64
64
  )
65
- let _ = writePkg(~root=rulesRoot, ~name=rulesName, [("src/Rules.res.mjs", `export const check = () => true;
66
- `)])
65
+ let _ = writePkg(
66
+ ~root=rulesRoot,
67
+ ~name=rulesName,
68
+ [
69
+ (
70
+ "src/Rules.res.mjs",
71
+ `export const check = () => true;
72
+ `,
73
+ ),
74
+ ],
75
+ )
67
76
 
68
77
  let closureOf = (packageDirs: dict<string>) => {
69
78
  Util_Bundle.addImportedPackageClosure(packageDirs)
@@ -100,11 +109,40 @@ describe("Util_Bundle — bundled user packages carry their imports", () => {
100
109
  expect(bundled->Array.includes("@fixture/never-installed"))->toBe(false)
101
110
  })
102
111
 
112
+ testSync("a package the framework merely resolves is still bundled", () => {
113
+ // The layer carries reventless-aws's dependency closure and nothing else.
114
+ // A consumer with a hoisted node_modules puts every package at the root,
115
+ // where the framework's own resolution reaches it by walking up — so
116
+ // resolvability said "the layer has it" about packages the layer has never
117
+ // held, and they were dropped from the archive. `sury` above is genuinely a
118
+ // framework dependency; these are not, and must ride along.
119
+ expect(Util_Bundle.isFrameworkPackage("@fixture/closure-trait"))->toBe(false)
120
+ // A real, published, @reventlessdev-scoped package that is not a dependency
121
+ // of reventless-aws: scope is not what decides this.
122
+ expect(Util_Bundle.isFrameworkPackage("@reventlessdev/reventless-local"))->toBe(false)
123
+ })
124
+
125
+ testSync("the framework's own closure is recognised", () => {
126
+ expect(Util_Bundle.isFrameworkPackage("@reventlessdev/reventless-aws"))->toBe(true)
127
+ expect(Util_Bundle.isFrameworkPackage("sury"))->toBe(true)
128
+ })
129
+
130
+ testSync("a package the layer adds outside that closure counts as the layer's", () => {
131
+ // @rescript/runtime is a transitive of `rescript`, which the layer excludes
132
+ // as a build tool, so it is absent from the production closure while the
133
+ // layer carries it explicitly. Every compiled ReScript file imports it, and
134
+ // it is 19 MB — treating it as a user package puts that in every archive.
135
+ expect(Util_Bundle.isFrameworkPackage("@rescript/runtime"))->toBe(true)
136
+ })
137
+
103
138
  testSync("framework packages are starting points, not walked", () => {
104
139
  // Walking reventless-aws would reach its deploy-time-only imports (the
105
140
  // @pulumi bindings) and add tens of megabytes to every archive.
106
141
  let packageDirs = Dict.fromArray([
107
- ("@reventlessdev/reventless-aws", Util_Bundle.resolvePackageRoot("@reventlessdev/reventless-aws")),
142
+ (
143
+ "@reventlessdev/reventless-aws",
144
+ Util_Bundle.resolvePackageRoot("@reventlessdev/reventless-aws"),
145
+ ),
108
146
  ])
109
147
  expect(closureOf(packageDirs)->Dict.keysToArray->Array.length)->toBe(1)
110
148
  })
@@ -106,6 +106,17 @@ globalThis.describe("Util_Bundle — bundled user packages carry their imports",
106
106
  let bundled = Object.keys((Util_Bundle$ReventlessAws.addImportedPackageClosure(packageDirs), packageDirs));
107
107
  globalThis.expect(bundled.includes("@fixture/never-installed")).toBe(false);
108
108
  });
109
+ globalThis.test("a package the framework merely resolves is still bundled", () => {
110
+ globalThis.expect(Util_Bundle$ReventlessAws.isFrameworkPackage("@fixture/closure-trait")).toBe(false);
111
+ globalThis.expect(Util_Bundle$ReventlessAws.isFrameworkPackage("@reventlessdev/reventless-local")).toBe(false);
112
+ });
113
+ globalThis.test("the framework's own closure is recognised", () => {
114
+ globalThis.expect(Util_Bundle$ReventlessAws.isFrameworkPackage("@reventlessdev/reventless-aws")).toBe(true);
115
+ globalThis.expect(Util_Bundle$ReventlessAws.isFrameworkPackage("sury")).toBe(true);
116
+ });
117
+ globalThis.test("a package the layer adds outside that closure counts as the layer's", () => {
118
+ globalThis.expect(Util_Bundle$ReventlessAws.isFrameworkPackage("@rescript/runtime")).toBe(true);
119
+ });
109
120
  globalThis.test("framework packages are starting points, not walked", () => {
110
121
  let packageDirs = Object.fromEntries([[
111
122
  "@reventlessdev/reventless-aws",
@@ -22,9 +22,9 @@ describe("Util_Bundle ESM loader — env-var contract", () => {
22
22
 
23
23
  describe("Util_Bundle ESM loader — file cross-references", () => {
24
24
  testSync("register-hook registers exactly the layer-resolver filename", () => {
25
- expect(Util_Bundle.registerHookSource->String.includes(Util_Bundle.layerResolverFileName))->toBe(
26
- true,
27
- )
25
+ expect(
26
+ Util_Bundle.registerHookSource->String.includes(Util_Bundle.layerResolverFileName),
27
+ )->toBe(true)
28
28
  expect(Util_Bundle.registerHookSource->String.includes("register("))->toBe(true)
29
29
  })
30
30
 
@@ -5,14 +5,12 @@ open JestGlobals
5
5
  // than one of reventless-aws's own dependencies. realpath because macOS hands
6
6
  // out /var/... symlinks for tmpdir while require.resolve reports /private/var.
7
7
  let makeProject = (pkgName: string): (string, string) => {
8
- let project =
9
- NodeFs.realpathSync(NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "pulumi-project-"])))
8
+ let project = NodeFs.realpathSync(
9
+ NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "pulumi-project-"])),
10
+ )
10
11
  let pkgDir = NodePath.join([NodePath.join([project, "node_modules"]), pkgName])
11
12
  NodeFs.mkdirSync(pkgDir, {recursive: true})
12
- NodeFs.writeFileSync(
13
- NodePath.join([pkgDir, "package.json"]),
14
- `{"name":"","version":"9.9.9"}`,
15
- )
13
+ NodeFs.writeFileSync(NodePath.join([pkgDir, "package.json"]), `{"name":"","version":"9.9.9"}`)
16
14
  (project, pkgDir)
17
15
  }
18
16
 
@@ -24,9 +24,10 @@ let makePkg = (name: string, files: array<(string, string)>): string => {
24
24
 
25
25
  let fileUrl = (absPath: string) => "file://" ++ absPath
26
26
 
27
- let extensionModule = (~companions: array<string>=[], url: string): module(
28
- ReventlessCore.RuntimeExtension.Extension
29
- ) => {
27
+ let extensionModule = (
28
+ ~companions: array<string>=[],
29
+ url: string,
30
+ ): module(ReventlessCore.RuntimeExtension.Extension) => {
30
31
  module E = {
31
32
  let moduleUrl = url
32
33
  let companionModuleUrls = companions
@@ -104,8 +105,8 @@ describe("Util_Bundle — runtime-extension companion packages", () => {
104
105
  beforeEach(() => ReventlessCore.RuntimeExtension.reset())
105
106
  afterAll(() => {
106
107
  ReventlessCore.RuntimeExtension.reset()
107
- [extRoot, companionRoot, badRoot]->Array.forEach(root =>
108
- NodeFs.rmSync(root, {recursive: true, force: true})
108
+ [extRoot, companionRoot, badRoot]->Array.forEach(
109
+ root => NodeFs.rmSync(root, {recursive: true, force: true}),
109
110
  )
110
111
  })
111
112
 
@@ -135,10 +136,7 @@ describe("Util_Bundle — runtime-extension companion packages", () => {
135
136
 
136
137
  let companionFile = NodePath.join([companionRoot, "src/Companion.res.mjs"])
137
138
  let original = NodeFs.readFileSync(companionFile)
138
- NodeFs.writeFileSync(
139
- companionFile,
140
- original ++ "export const changed = true;\n",
141
- )
139
+ NodeFs.writeFileSync(companionFile, original ++ "export const changed = true;\n")
142
140
  let after = build().sourceCodeHash
143
141
  NodeFs.writeFileSync(companionFile, original)
144
142
 
@@ -147,21 +145,22 @@ describe("Util_Bundle — runtime-extension companion packages", () => {
147
145
 
148
146
  testSync("an empty registry leaves the archive byte-identical", () => {
149
147
  let withSeam = build().sourceCodeHash
150
- let withoutSeam =
151
- Util_Bundle.buildCodeArchive(
152
- ~entryPointModule="@reventlessdev/reventless-aws/src/adapter/Runtime/Entry.res.mjs",
153
- ~packageDirs=Dict.make(),
154
- ~bundleRuntimeExtensions=false,
155
- ).sourceCodeHash
148
+ let withoutSeam = Util_Bundle.buildCodeArchive(
149
+ ~entryPointModule="@reventlessdev/reventless-aws/src/adapter/Runtime/Entry.res.mjs",
150
+ ~packageDirs=Dict.make(),
151
+ ~bundleRuntimeExtensions=false,
152
+ ).sourceCodeHash
156
153
  expect(withSeam)->toBe(withoutSeam)
157
154
  })
158
155
 
159
156
  testSync("an undeclared, un-bundled import fails the archive build, naming the remedy", () => {
160
157
  ReventlessCore.RuntimeExtension.use(extensionModule(badUrl))
161
158
 
162
- switch caughtMessage(() => {
163
- let _ = build()
164
- }) {
159
+ switch caughtMessage(
160
+ () => {
161
+ let _ = build()
162
+ },
163
+ ) {
165
164
  | None => JsError.throwWithMessage("expected buildCodeArchive to throw")
166
165
  | Some(message) =>
167
166
  expect(message->String.includes(badPkgName))->toBe(true)
@@ -8,15 +8,13 @@ open JestGlobals
8
8
 
9
9
  describe("Util_DcbMetrics.transformationFor", () => {
10
10
  testSync("never sets defaultValue — it is mutually exclusive with dimensions", () =>
11
- Util_DcbMetrics.metricNames->Array.forEach(m =>
12
- expect(Util_DcbMetrics.transformationFor(m).defaultValue)->toBe(None)
11
+ Util_DcbMetrics.metricNames->Array.forEach(
12
+ m => expect(Util_DcbMetrics.transformationFor(m).defaultValue)->toBe(None),
13
13
  )
14
14
  )
15
15
 
16
16
  testSync("dimensions the metric by slice", () =>
17
- expect(
18
- Util_DcbMetrics.transformationFor("AppendRetry").dimensions->Option.isSome,
19
- )->toBe(true)
17
+ expect(Util_DcbMetrics.transformationFor("AppendRetry").dimensions->Option.isSome)->toBe(true)
20
18
  )
21
19
 
22
20
  testSync("counts into the DCB namespace", () =>
@@ -30,6 +28,8 @@ describe("Util_DcbMetrics.transformationFor", () => {
30
28
 
31
29
  describe("Util_DcbMetrics.patternFor", () => {
32
30
  testSync("selects one metric's lines by its marker", () =>
33
- expect(Util_DcbMetrics.patternFor("AppendRetry"))->toBe(`{ $.reventlessMetric = "AppendRetry" }`)
31
+ expect(
32
+ Util_DcbMetrics.patternFor("AppendRetry"),
33
+ )->toBe(`{ $.reventlessMetric = "AppendRetry" }`)
34
34
  )
35
35
  })
@@ -33,11 +33,10 @@ describe("Util_DynamoDbStream.toStreamResource", () => {
33
33
  })
34
34
 
35
35
  test("answers its own stream ARN", async () => {
36
- let arn =
37
- await tableResource
38
- ->Util_DynamoDbStream.toStreamResource
39
- ->Util_DynamoDbStream.streamArnFromDynamoDbTableResource
40
- ->resolve
36
+ let arn = await tableResource
37
+ ->Util_DynamoDbStream.toStreamResource
38
+ ->Util_DynamoDbStream.streamArnFromDynamoDbTableResource
39
+ ->resolve
41
40
  expect(arn)->toBe(streamArn)
42
41
  })
43
42
  })
@@ -35,8 +35,9 @@ describe("Util_DynamoDb.toResourceInfo", () => {
35
35
  })
36
36
 
37
37
  test("carries a sort key when the table has one", async () => {
38
- let resourceInfo =
39
- await table(~rangeKey=Nullable.make("seq"))->Util_DynamoDb.toResourceInfo->resolve
38
+ let resourceInfo = await table(~rangeKey=Nullable.make("seq"))
39
+ ->Util_DynamoDb.toResourceInfo
40
+ ->resolve
40
41
  expect(resourceInfo)->toEqual(
41
42
  ReventlessInfra.Adapter.StorageKeys({partitionKey: "id", sortKey: Some("seq")}),
42
43
  )
@@ -21,8 +21,8 @@ let throws = (f: unit => 'a): option<string> =>
21
21
 
22
22
  describe("Util_LambdaEnvBudget.check", () => {
23
23
  testSync("passes a small environment", () => {
24
- let msg = throws(() =>
25
- Util_LambdaEnvBudget.check(~lambdaName="Small", ~handlerConfigJson=`{"queueUrl":"q"}`)
24
+ let msg = throws(
25
+ () => Util_LambdaEnvBudget.check(~lambdaName="Small", ~handlerConfigJson=`{"queueUrl":"q"}`),
26
26
  )
27
27
  expect(msg)->toEqual(None)
28
28
  })
@@ -39,19 +39,21 @@ describe("Util_LambdaEnvBudget.check", () => {
39
39
  testSync("counts the queue-URL var names toward the exact total", () => {
40
40
  // Sized so HANDLER_CONFIG alone fits and the var NAMES alone push it over —
41
41
  // the names are known at check time, so this must throw rather than warn.
42
- let keys = Array.make(~length=40, "")->Array.mapWithIndex((_, i) =>
43
- `PTA_AVeryLongAggregateNameNumber${i->Int.toString}_QUEUE_URL`
44
- )
42
+ let keys =
43
+ Array.make(~length=40, "")->Array.mapWithIndex(
44
+ (_, i) => `PTA_AVeryLongAggregateNameNumber${i->Int.toString}_QUEUE_URL`,
45
+ )
45
46
  let keyBytes = keys->Array.reduce(0, (acc, k) => acc + String.length(k))
46
47
  let fixed = Util_LambdaEnvBudget.frameworkVarsBytes + String.length("HANDLER_CONFIG")
47
48
  // Just past the limit on the exact total alone — the names are enough.
48
49
  let json = String.repeat("a", budget - fixed - keyBytes + 1)
49
- let msg = throws(() =>
50
- Util_LambdaEnvBudget.check(
51
- ~lambdaName="ManyTargets",
52
- ~handlerConfigJson=json,
53
- ~outputValuedKeys=keys,
54
- )
50
+ let msg = throws(
51
+ () =>
52
+ Util_LambdaEnvBudget.check(
53
+ ~lambdaName="ManyTargets",
54
+ ~handlerConfigJson=json,
55
+ ~outputValuedKeys=keys,
56
+ ),
55
57
  )
56
58
  expect(msg->Option.isSome)->toBe(true)
57
59
  })
@@ -59,19 +61,21 @@ describe("Util_LambdaEnvBudget.check", () => {
59
61
  testSync("only estimating over the limit warns rather than throwing", () => {
60
62
  // Exact total sits under the limit; it is the per-URL allowance that crosses
61
63
  // it. The deploy must be allowed to proceed and find out.
62
- let keys = Array.make(~length=20, "")->Array.mapWithIndex((_, i) => `PTA_A${i->Int.toString}_URL`)
64
+ let keys =
65
+ Array.make(~length=20, "")->Array.mapWithIndex((_, i) => `PTA_A${i->Int.toString}_URL`)
63
66
  let exact =
64
67
  Util_LambdaEnvBudget.frameworkVarsBytes +
65
68
  String.length("HANDLER_CONFIG") +
66
69
  keys->Array.reduce(0, (acc, k) => acc + String.length(k))
67
70
  let room = budget - exact - 100
68
71
  let json = String.repeat("a", room)
69
- let msg = throws(() =>
70
- Util_LambdaEnvBudget.check(
71
- ~lambdaName="Estimated",
72
- ~handlerConfigJson=json,
73
- ~outputValuedKeys=keys,
74
- )
72
+ let msg = throws(
73
+ () =>
74
+ Util_LambdaEnvBudget.check(
75
+ ~lambdaName="Estimated",
76
+ ~handlerConfigJson=json,
77
+ ~outputValuedKeys=keys,
78
+ ),
75
79
  )
76
80
  expect(msg)->toEqual(None)
77
81
  })
@@ -21,9 +21,9 @@ describe("Util_LambdaLogging.logGroupNameFor", () => {
21
21
  })
22
22
 
23
23
  testSync("is stack-scoped, so environments of one project cannot collide", () =>
24
- expect(nameFor(~stack="pr-42", ~name="AllReadModels"))->not_->toBe(
25
- nameFor(~stack="alpha", ~name="AllReadModels"),
26
- )
24
+ expect(nameFor(~stack="pr-42", ~name="AllReadModels"))
25
+ ->not_
26
+ ->toBe(nameFor(~stack="alpha", ~name="AllReadModels"))
27
27
  )
28
28
 
29
29
  // The regression this scoping exists for. Every plugin of one platform is its
@@ -54,17 +54,18 @@ describe("Util_LambdaLogging.logGroupNameFor", () => {
54
54
  // the estate and send an operator to a nonexistent group on the other half.
55
55
  describe("Util_LambdaLogging.autoCreatedLogGroupNameFor", () => {
56
56
  testSync("is the group Lambda makes from the PHYSICAL name, suffix and all", () =>
57
- expect(Util_LambdaLogging.autoCreatedLogGroupNameFor(~physicalName="AllReadModels-0287438"))
58
- ->toBe("/aws/lambda/AllReadModels-0287438")
57
+ expect(
58
+ Util_LambdaLogging.autoCreatedLogGroupNameFor(~physicalName="AllReadModels-0287438"),
59
+ )->toBe("/aws/lambda/AllReadModels-0287438")
59
60
  )
60
61
 
61
62
  // The two shapes must not converge: the managed name is chosen from the static
62
63
  // name so it survives a replacement, the auto-created one is not. If these ever
63
64
  // matched, the managed group would be racing the auto-create it exists to avoid.
64
65
  testSync("never equals the managed name for the same unit", () =>
65
- expect(
66
- Util_LambdaLogging.autoCreatedLogGroupNameFor(~physicalName="AllReadModels-0287438"),
67
- )->not_->toBe(
66
+ expect(Util_LambdaLogging.autoCreatedLogGroupNameFor(~physicalName="AllReadModels-0287438"))
67
+ ->not_
68
+ ->toBe(
68
69
  Util_LambdaLogging.logGroupNameFor(
69
70
  ~project="online-shop-catalog-aws",
70
71
  ~stack="alpha",
@@ -27,7 +27,10 @@ describe("Util_LogGroup_Adopting.isAlreadyExistsError", () => {
27
27
  testSync("true for the error this provider exists to absorb", () =>
28
28
  expect(
29
29
  Adopting.isAlreadyExistsError(
30
- mkErr(~name="ResourceAlreadyExistsException", ~message="The specified log group already exists"),
30
+ mkErr(
31
+ ~name="ResourceAlreadyExistsException",
32
+ ~message="The specified log group already exists",
33
+ ),
31
34
  ),
32
35
  )->toBe(true)
33
36
  )
@@ -42,7 +45,9 @@ describe("Util_LogGroup_Adopting.isAlreadyExistsError", () => {
42
45
 
43
46
  testSync("false for a permission failure, which must still fail loudly", () =>
44
47
  expect(
45
- Adopting.isAlreadyExistsError(mkErr(~name="AccessDeniedException", ~message="not authorized")),
48
+ Adopting.isAlreadyExistsError(
49
+ mkErr(~name="AccessDeniedException", ~message="not authorized"),
50
+ ),
46
51
  )->toBe(false)
47
52
  )
48
53
  })
@@ -85,9 +90,9 @@ describe("Util_LogGroup_Adopting.sameTags", () => {
85
90
  )
86
91
 
87
92
  testSync("sees a changed value", () =>
88
- expect(
89
- Adopting.sameTags(Dict.fromArray([("a", "1")]), Dict.fromArray([("a", "2")])),
90
- )->toBe(false)
93
+ expect(Adopting.sameTags(Dict.fromArray([("a", "1")]), Dict.fromArray([("a", "2")])))->toBe(
94
+ false,
95
+ )
91
96
  )
92
97
 
93
98
  testSync("sees an added key", () =>
@@ -39,11 +39,15 @@ describe("Util_LogRetention.retentionDaysFor", () => {
39
39
  // The config key is the escape hatch — a stack dialled without a code change,
40
40
  // including `0` (never expire) as an explicit opt-in.
41
41
  testSync("a config override wins over the tier default", () =>
42
- expect(Util_LogRetention.retentionDaysFor(~stack="alpha", ~prodStacks, ~configOverride=14))->toBe(14)
42
+ expect(
43
+ Util_LogRetention.retentionDaysFor(~stack="alpha", ~prodStacks, ~configOverride=14),
44
+ )->toBe(14)
43
45
  )
44
46
 
45
47
  testSync("0 = never expire is expressible via the override", () =>
46
- expect(Util_LogRetention.retentionDaysFor(~stack="prod", ~prodStacks, ~configOverride=0))->toBe(0)
48
+ expect(Util_LogRetention.retentionDaysFor(~stack="prod", ~prodStacks, ~configOverride=0))->toBe(
49
+ 0,
50
+ )
47
51
  )
48
52
  })
49
53
 
@@ -19,11 +19,13 @@ let withElevated = (groups, f) => {
19
19
 
20
20
  describe("Util_OwnerScopeEnv — the elevated-groups carrier", () => {
21
21
  testSync("writes what OwnerScope reads back", () => {
22
- let encoded = withElevated(["Admin", "Support"], () =>
23
- switch Util_OwnerScopeEnv.entry() {
24
- | Some((_, value)) => value->Obj.magic
25
- | None => ""
26
- }
22
+ let encoded = withElevated(
23
+ ["Admin", "Support"],
24
+ () =>
25
+ switch Util_OwnerScopeEnv.entry() {
26
+ | Some((_, value)) => value->Obj.magic
27
+ | None => ""
28
+ },
27
29
  )
28
30
  // The round trip, not the spelling: a separator change on either side fails.
29
31
  expect(Reventless.OwnerScope.parseElevatedGroups(encoded))->toEqual(["Admin", "Support"])
@@ -47,9 +49,9 @@ describe("Util_OwnerScopeEnv — the elevated-groups carrier", () => {
47
49
  testSync("a caller that pinned the variable wins", () => {
48
50
  let variables = Dict.fromArray([(Util_OwnerScopeEnv.key, "Pinned"->Obj.magic)])
49
51
  withElevated(["Admin"], () => Util_OwnerScopeEnv.applyElevatedGroupsDefault(variables))
50
- expect(variables->Dict.get(Util_OwnerScopeEnv.key)->Option.getOr(""->Obj.magic)->Obj.magic)->toBe(
51
- "Pinned",
52
- )
52
+ expect(
53
+ variables->Dict.get(Util_OwnerScopeEnv.key)->Option.getOr(""->Obj.magic)->Obj.magic,
54
+ )->toBe("Pinned")
53
55
  })
54
56
 
55
57
  testSync("adds nothing when the deployment named no elevated groups", () => {
@@ -1,8 +1,7 @@
1
1
  open JestGlobals
2
2
 
3
3
  let shortId = "environment:alpha#platformName:online-shop#pluginName:Catalog"
4
- let longId =
5
- "componentName:DcbEventLog#environment:alpha#platformName:online-shop-platform-aws#pluginName:Catalog#resourceName:CatalogDcbEventLog-428c0a8"
4
+ let longId = "componentName:DcbEventLog#environment:alpha#platformName:online-shop-platform-aws#pluginName:Catalog#resourceName:CatalogDcbEventLog-428c0a8"
6
5
 
7
6
  describe("Util_SQS_Runtime.safeGroupId", () => {
8
7
  testSync("returns id unchanged when ≤ 128 chars", () => {
@@ -19,12 +18,11 @@ describe("Util_SQS_Runtime.safeGroupId", () => {
19
18
  })
20
19
 
21
20
  testSync("returns different hashes for different long ids", () => {
22
- let longId2 =
23
- "componentName:Products#environment:alpha#platformName:online-shop-platform-aws#pluginName:Catalog#resourceName:ProductsTable-abc1234"
21
+ let longId2 = "componentName:Products#environment:alpha#platformName:online-shop-platform-aws#pluginName:Catalog#resourceName:ProductsTable-abc1234"
24
22
  expect(longId2->String.length > 128)->toBe(true)
25
- expect(
26
- Util_SQS_Runtime.safeGroupId(longId) == Util_SQS_Runtime.safeGroupId(longId2)
27
- )->toBe(false)
23
+ expect(Util_SQS_Runtime.safeGroupId(longId) == Util_SQS_Runtime.safeGroupId(longId2))->toBe(
24
+ false,
25
+ )
28
26
  })
29
27
 
30
28
  testSync("returns same hash for the same long id (deterministic)", () => {
@@ -33,9 +33,7 @@ describe("Util_ShellConfig.fields — viewModes", () => {
33
33
  expect(out->get("viewModes"))->toEqual(
34
34
  JSON.Encode.array([JSON.Encode.string("map"), JSON.Encode.string("graph")]),
35
35
  )
36
- expect(out->get("mapStyle"))->toEqual(
37
- JSON.Encode.string("https://tiles.example/style.json"),
38
- )
36
+ expect(out->get("mapStyle"))->toEqual(JSON.Encode.string("https://tiles.example/style.json"))
39
37
  expect(out->get("graphLayout"))->toEqual(JSON.Encode.string("dagre"))
40
38
  })
41
39
  })
@@ -43,7 +41,7 @@ describe("Util_ShellConfig.fields — viewModes", () => {
43
41
  describe("Util_ShellConfig.fields — bakedManifest", () => {
44
42
  let bake = (~key: option<string>=?): ReventlessInfra.Platform.bakedManifest => {
45
43
  components: [{plugin: "Catalog", views: ["Products"], commands: []}],
46
- key: ?key,
44
+ ?key,
47
45
  }
48
46
 
49
47
  testSync("unset ⇒ no manifestUrl, so every caller keeps the admin path", () => {
@@ -202,8 +200,8 @@ describe("Util_ShellConfig.fields — journeys", () => {
202
200
  ->Array.filterMap(JSON.Decode.string),
203
201
  )
204
202
  expect(published)->toEqual(
205
- ReventlessCore.Platform_BakedManifest.files(~config=bake)->Array.map(((key, _)) =>
206
- "/" ++ key
203
+ ReventlessCore.Platform_BakedManifest.files(~config=bake)->Array.map(
204
+ ((key, _)) => "/" ++ key,
207
205
  ),
208
206
  )
209
207
  })
@@ -215,9 +213,7 @@ describe("Util_ShellConfig.fields — journeys", () => {
215
213
  let _ = Util_ShellConfig.fields(
216
214
  ~computed,
217
215
  ~bakedManifest=withJourneys(~journeys=[shopper]),
218
- ~shellConfig=Dict.fromArray([
219
- ("journeyManifestUrls", JSON.Encode.object(Dict.make())),
220
- ]),
216
+ ~shellConfig=Dict.fromArray([("journeyManifestUrls", JSON.Encode.object(Dict.make()))]),
221
217
  )
222
218
  None
223
219
  } catch {
@@ -239,12 +235,7 @@ describe("Util_ShellConfig.fields — shellConfig passthrough", () => {
239
235
  ("accessTiers", JSON.Encode.array([JSON.Encode.string("public")])),
240
236
  ]),
241
237
  )
242
- expect(out->Dict.keysToArray)->toEqual([
243
- "apiEndpoint",
244
- "region",
245
- "platformName",
246
- "accessTiers",
247
- ])
238
+ expect(out->Dict.keysToArray)->toEqual(["apiEndpoint", "region", "platformName", "accessTiers"])
248
239
  expect(out->get("platformName"))->toEqual(JSON.Encode.string("Online Shop"))
249
240
  })
250
241
 
@@ -277,8 +268,7 @@ describe("Util_ShellConfig.fields — shellConfig passthrough", () => {
277
268
  // These assert the property that removes that window, not the spelling.
278
269
  describe("Util_ShellConfig.identityFields", () => {
279
270
  let fields = Util_ShellConfig.identityFields(~providerId="eu-west-1_x", ~clientId="7cl13nt")
280
- let get = key =>
281
- fields->Array.find(((k, _)) => k == key)->Option.map(((_, v)) => v)
271
+ let get = key => fields->Array.find(((k, _)) => k == key)->Option.map(((_, v)) => v)
282
272
 
283
273
  testSync("the new spelling is present", () =>
284
274
  expect((get("identityProviderId"), get("identityProviderClientId")))->toEqual((
@@ -31,13 +31,9 @@ describe("Util_StaticBundle.contentTypeFor", () => {
31
31
  )
32
32
  )
33
33
  testSync("json", () =>
34
- expect(Util_StaticBundle.contentTypeFor("data.json"))->toBe(
35
- "application/json; charset=utf-8",
36
- )
37
- )
38
- testSync("svg", () =>
39
- expect(Util_StaticBundle.contentTypeFor("logo.svg"))->toBe("image/svg+xml")
34
+ expect(Util_StaticBundle.contentTypeFor("data.json"))->toBe("application/json; charset=utf-8")
40
35
  )
36
+ testSync("svg", () => expect(Util_StaticBundle.contentTypeFor("logo.svg"))->toBe("image/svg+xml"))
41
37
  testSync("woff2", () =>
42
38
  expect(Util_StaticBundle.contentTypeFor("font.woff2"))->toBe("font/woff2")
43
39
  )
@@ -92,8 +88,7 @@ describe("Util_StaticBundle.walk", () => {
92
88
  testSync("identical contents produce identical hashes", () => {
93
89
  let dir = makeFixture()
94
90
  let entries = Util_StaticBundle.walk(dir)
95
- let indexEntry =
96
- entries->Array.find(e => e.relativePath == "index.html")->Option.getUnsafe
91
+ let indexEntry = entries->Array.find(e => e.relativePath == "index.html")->Option.getUnsafe
97
92
  let indexHash = indexEntry.contentHash
98
93
  let dir2 = NodeFs.mkdtempSync(NodePath.join([NodeOs.tmpdir(), "static-bundle-"]))
99
94
  NodeFs.writeFileSync(NodePath.join([dir2, "index.html"]), "<html></html>")
@@ -4,11 +4,15 @@ let prodStacks = Util_HostUiDomain.defaultProdStacks
4
4
 
5
5
  describe("Util_StoreLayout.layoutFor", () => {
6
6
  testSync("a prod-named stack gets a bucket per store", () =>
7
- expect(Util_StoreLayout.layoutFor(~stack="prod", ~prodStacks))->toEqual(Util_StoreLayout.PerStore)
7
+ expect(Util_StoreLayout.layoutFor(~stack="prod", ~prodStacks))->toEqual(
8
+ Util_StoreLayout.PerStore,
9
+ )
8
10
  )
9
11
 
10
12
  testSync("'main' is production too, by the shared prod list", () =>
11
- expect(Util_StoreLayout.layoutFor(~stack="main", ~prodStacks))->toEqual(Util_StoreLayout.PerStore)
13
+ expect(Util_StoreLayout.layoutFor(~stack="main", ~prodStacks))->toEqual(
14
+ Util_StoreLayout.PerStore,
15
+ )
12
16
  )
13
17
 
14
18
  testSync("alpha shares one bucket", () =>
@@ -34,9 +38,9 @@ describe("Util_StoreLayout.layoutFor", () => {
34
38
  )
35
39
 
36
40
  testSync("adding it to the prod list is the fix", () =>
37
- expect(Util_StoreLayout.layoutFor(~stack="production", ~prodStacks=["prod", "production"]))->toEqual(
38
- Util_StoreLayout.PerStore,
39
- )
41
+ expect(
42
+ Util_StoreLayout.layoutFor(~stack="production", ~prodStacks=["prod", "production"]),
43
+ )->toEqual(Util_StoreLayout.PerStore)
40
44
  )
41
45
  })
42
46
 
@@ -91,18 +95,18 @@ describe("Util_StoreLayout.coverageFor", () => {
91
95
  )
92
96
 
93
97
  testSync("declaring nothing is covered, whatever the platform provisions", () =>
94
- expect(Util_StoreLayout.coverageFor(~required=[], ~provisioned=["Catalog.productImages"]))->toEqual(
95
- Util_StoreLayout.Covered,
96
- )
98
+ expect(
99
+ Util_StoreLayout.coverageFor(~required=[], ~provisioned=["Catalog.productImages"]),
100
+ )->toEqual(Util_StoreLayout.Covered)
97
101
  )
98
102
 
99
103
  // A platform provisioning nothing has not adopted capability provisioning.
100
104
  // Failing it would break deployments that work today, so this is the arm that
101
105
  // must NOT be a hard error.
102
106
  testSync("a platform provisioning nothing has not adopted, rather than got it wrong", () =>
103
- expect(Util_StoreLayout.coverageFor(~required=["Catalog.productImages"], ~provisioned=[]))->toEqual(
104
- Util_StoreLayout.NotAdopted(["Catalog.productImages"]),
105
- )
107
+ expect(
108
+ Util_StoreLayout.coverageFor(~required=["Catalog.productImages"], ~provisioned=[]),
109
+ )->toEqual(Util_StoreLayout.NotAdopted(["Catalog.productImages"]))
106
110
  )
107
111
 
108
112
  // The case that shipped: the platform declared the store under a lowercased
@@ -282,7 +286,8 @@ describe("Util_StoreLayout.pendingExpiryFor", () => {
282
286
  // Guessing at what a typo meant, in the one setting that deletes objects, is
283
287
  // not a service — an unreadable entry leaves the store accumulating.
284
288
  testSync("a malformed or non-positive entry is ignored, not defaulted", () => {
285
- let of_ = c => Util_StoreLayout.pendingExpiryFor(~config=Some(c), ~store="Catalog.productImages")
289
+ let of_ = c =>
290
+ Util_StoreLayout.pendingExpiryFor(~config=Some(c), ~store="Catalog.productImages")
286
291
  expect((
287
292
  of_("Catalog.productImages"),
288
293
  of_("Catalog.productImages="),
@@ -73,10 +73,7 @@ let buildAppSyncEvent = (~id, ~name): JSON.t => {
73
73
  ("id", id->JSON.Encode.string),
74
74
  ("name", name->JSON.Encode.string),
75
75
  ])
76
- let meta = Dict.fromArray([
77
- ("user", "agg-test"->JSON.Encode.string),
78
- ("ip", JSON.Encode.null),
79
- ])
76
+ let meta = Dict.fromArray([("user", "agg-test"->JSON.Encode.string), ("ip", JSON.Encode.null)])
80
77
  Dict.fromArray([
81
78
  ("command", "Add"->JSON.Encode.string),
82
79
  ("arguments", arguments->JSON.Encode.object),