@reventlessdev/reventless-infra 3.0.0-alpha.106 → 3.0.0-alpha.108

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.108 (2026-07-28)
7
+
8
+ ### Features
9
+
10
+ * **platform:** provision object stores from the fields that declare them ([b5e2a1e](https://github.com/ReventlessDev/reventless-core/commit/b5e2a1ec88099941c113e4963f9c4b346b96b0d6))
11
+
12
+
13
+ # 3.0.0-alpha.107 (2026-07-28)
14
+
15
+ ### Features
16
+
17
+ * **aws:** provision platform capabilities through framework helpers ([5f87c57](https://github.com/ReventlessDev/reventless-core/commit/5f87c57c7c117dccb44c88d6132e5270e8707bc2))
18
+
19
+
6
20
  # 3.0.0-alpha.106 (2026-07-27)
7
21
 
8
22
  ### Bug Fixes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-infra",
3
- "version": "3.0.0-alpha.106",
3
+ "version": "3.0.0-alpha.108",
4
4
  "description": "Infrastructure types for Reventless framework",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -16,10 +16,10 @@
16
16
  "sury": "11.0.0-alpha.4",
17
17
  "sury-ppx": "11.0.0-alpha.2",
18
18
  "uuid": "^13.0.0",
19
- "@reventlessdev/rescript-effect": "0.1.0-alpha.31",
20
- "@reventlessdev/rescript-uuid": "1.1.0-alpha.17",
21
19
  "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.17",
22
- "@reventlessdev/reventless-spec": "3.0.0-alpha.81"
20
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.83",
21
+ "@reventlessdev/rescript-uuid": "1.1.0-alpha.17",
22
+ "@reventlessdev/rescript-effect": "0.1.0-alpha.31"
23
23
  },
24
24
  "devDependencies": {
25
25
  "rescript": "12.3.0",
@@ -57,12 +57,65 @@ type pluginOutputs = Plugin.outputs
57
57
  // (AWS fronts it via CloudFront; in-memory ignores it). See
58
58
  // [docs/plans/done/ui-served-buckets.md].
59
59
  type servedBucket = {
60
- prefix: string,
60
+ // Stable stem for the CDN origin id and the per-bucket resource names. Distinct
61
+ // from the prefixes because a bucket can serve several of them.
62
+ id: string,
63
+ // Every path prefix served from this bucket. A list rather than a single value
64
+ // because a shared-layout stack puts several declared stores in one bucket, and
65
+ // a bucket may carry only ONE bucket policy — a per-prefix policy would have
66
+ // the second store silently overwrite the first store's CloudFront read grant,
67
+ // which deploys green and 404s half the objects. One entry per bucket makes
68
+ // that unrepresentable.
69
+ prefixes: array<string>,
61
70
  bucketId: Pulumi.Input.t<string>,
62
71
  bucketArn: Pulumi.Input.t<string>,
63
72
  bucketRegionalDomainName: Pulumi.Input.t<string>,
64
73
  }
65
74
 
75
+ // A provisioned object store, as returned by the framework's object-store
76
+ // capability helper. Carries every handle the platform needs to both write to
77
+ // the store (presigned PUTs against `bucketName`) and serve it read-only from
78
+ // the UI's origin — so the deployment hands over one value instead of restating
79
+ // the bucket three times in three shapes.
80
+ type objectStore = {
81
+ bucketName: Pulumi.Input.t<string>,
82
+ bucketId: Pulumi.Input.t<string>,
83
+ bucketArn: Pulumi.Input.t<string>,
84
+ bucketRegionalDomainName: Pulumi.Input.t<string>,
85
+ // The prefix this store's object keys are rooted at, and therefore the path
86
+ // it must be served under for a minted `/{key}` ref to resolve. Written once
87
+ // here and read by both the mint side (the presign service) and the serve
88
+ // side (the CDN behaviour), so the two cannot disagree — the property the
89
+ // single served prefix already had, now carried per store.
90
+ //
91
+ // Rooting keys at the store name in *every* layout is what keeps a stored ref
92
+ // independent of whether the store got its own bucket or a prefix inside a
93
+ // shared one. Refs live in an append-only log; one that encoded its bucket
94
+ // layout would be unrewritable and environment-specific.
95
+ keyPrefix: string,
96
+ }
97
+
98
+ /**
99
+ A capability a deployment declares it needs.
100
+
101
+ A real variant rather than a string pair so the platform and the plugin stacks
102
+ reference one nominal type, and so the compiler finds every consumer when the
103
+ set grows.
104
+
105
+ `ObjectStore`'s identity is `(plugin, store)`: two plugins that happen to pick
106
+ the same store name get two stores. That mirrors how a field's declaration is
107
+ read — an unqualified `@storageRef("productImages")` means *this* plugin's
108
+ store, and reaching another plugin's store is the qualified form.
109
+ */
110
+ type capability =
111
+ | ObjectStore({plugin: string, store: string})
112
+ | Geocoding
113
+
114
+ // A provisioned geocoding place index, as returned by the framework's geocoding
115
+ // capability helper. A record rather than a bare name so the handle can grow
116
+ // (ARN, data source) without moving every call site.
117
+ type geocoderIndex = {indexName: Pulumi.Input.t<string>}
118
+
66
119
  // Module type alias so StateViewSliceStream can reference the component T
67
120
  // without being confused by the `module StateViewSlice` declaration inside T.
68
121
  module type StateViewSliceComponentT = StateViewSlice.T
@@ -247,29 +300,31 @@ module type T = {
247
300
  endpoint at boot. In-memory platforms typically ignore this — the shell
248
301
  is served by `vite dev` against the running in-process GraphQL server. */
249
302
  type hostUiBundleConfig = {
250
- assetsDir: string,
251
- bundleVersion: string,
303
+ // Directory holding the built shell bundle. Defaults to the resolved
304
+ // `@reventlessdev/reventless-host-shell` dist, which is what every
305
+ // deployment wants; set it only to host a different bundle.
306
+ assetsDir?: string,
307
+ // Defaults to the `~version` passed to `deployPlatform`.
308
+ bundleVersion?: string,
252
309
  // Optional path to a static AutoUI `ui-hints.json`, read and written
253
310
  // verbatim as a BucketObject beside `config.json` at deploy time. Unset ⇒
254
311
  // no file written; the shell treats the 404 as "no hints" and boots
255
312
  // unchanged. In-memory platforms ignore this.
256
313
  uiHintsFile?: string,
257
- // Optional AWS Location place-index name. When set, the deploy provisions a
258
- // public geocoder Lambda Function URL and threads its URL into config.json
259
- // as `geocoderEndpoint`. Unset ⇒ no service, field omitted. In-memory
314
+ // Optional geocoding place index. When set, the deploy provisions a public
315
+ // geocoder Lambda Function URL and threads its URL into config.json as
316
+ // `geocoderEndpoint`. Unset ⇒ no service, field omitted. In-memory
260
317
  // platforms ignore this.
261
- geocoderPlaceIndex?: Pulumi.Input.t<string>,
262
- // Opt into the direct-to-S3 upload presign service. Requires
263
- // `uploadBucketName`; the deploy then provisions a public presign Lambda
264
- // Function URL and threads its URL into config.json as `uploadEndpoint`.
265
- enableUploads?: bool,
266
- // S3 bucket the upload presign service issues PUT URLs against. Required
267
- // when `enableUploads` is true.
268
- uploadBucketName?: Pulumi.Input.t<string>,
269
- // Buckets served read-only to the UI under a path prefix on the UI's own
270
- // origin (same-origin, private, CDN-fronted). Each entry adds a `{prefix}/*`
271
- // read path on the host-shell distribution. In-memory platforms ignore this.
272
- servedBuckets?: array<servedBucket>,
318
+ geocoderPlaceIndex?: geocoderIndex,
319
+ // Optional object store for direct-to-store uploads. When set, the deploy
320
+ // provisions a presign service against it, threads that service's URL into
321
+ // config.json as `uploadEndpoint`, and serves the store read-only from the
322
+ // UI's own origin under the presign service's prefix.
323
+ //
324
+ // The prefix is written once, by the framework, and consumed by both sides:
325
+ // a deployment cannot mint refs under one prefix and serve another.
326
+ // In-memory platforms ignore this.
327
+ uploadBucket?: objectStore,
273
328
  }
274
329
 
275
330
  /** Deploy a complete platform: creates the scheduler, builds each plugin,
@@ -282,10 +337,14 @@ module type T = {
282
337
  /** Deploy only the platform (admin components, scheduler, shared API).
283
338
  No plugins are deployed — each plugin deploys independently via `deployPlugin`.
284
339
  Pass `~hostUiBundle` to also host a static host-shell SPA from this stack.
340
+ Pass `~capabilities` to provision the stores the plugins' fields declare;
341
+ the store a field declares is the store that gets provisioned, named after
342
+ it and attributed to the plugin that owns it.
285
343
  Returns the Pulumi stack outputs dict for use as the ESM `default` export. */
286
344
  let deployPlatform: (
287
345
  ~version: string,
288
346
  ~hostUiBundle: hostUiBundleConfig=?,
347
+ ~capabilities: array<capability>=?,
289
348
  ) => dict<Pulumi.Output.t<JSON.t>>
290
349
 
291
350
  /** Deploy a single plugin as an independent stack.