ReviewOS

also looking at this

stacks/ts-cloud

feat(operations): fleet inventory, attach preflight, and the exports that were missing

#192
Merged glennmichael123 wants to merge feat/fleet-inventory-and-attach-preflight into main
11 files +1313 -5
packages/ts-cloud/src/deploy/site-ports.tsmodified+19-3
Changes to packages/ts-cloud/src/deploy/site-ports.ts
@@ -69,12 +69,28 @@ export const DEFAULT_SITE_PORT_RANGE: SitePortRange = { start: 3000, end: 3999 }
6969 * One project's registry fragment, as written by the deploy:
7070 * `JSON.stringify({ slug, ...RpxGatewayConfig })`.
7171 *
72 * Only the fields this module reads are declared. A fragment written by an older
73 * ts-cloud may be missing `slug`, which the writer defaults to `'app'`.
72 * Only the fields a reader here needs are declared. A fragment written by an
73 * older ts-cloud may be missing `slug`, which the writer defaults to `'app'`.
74 *
75 * The route fields beyond `from` are declared for the fleet inventory
76 * (`operations/inventory`), which answers "what is this box serving, for
77 * whom" from these same files. They are optional and additive: this module's
78 * port allocator still reads only `from`.
7479 */
7580export interface HostSiteFragment {
7681 slug?: string
77 proxies?: Array<{ from?: string | string[] }>
82 proxies?: Array<{
83 /** Public host the route is served under. */
84 to?: string
85 /** Path prefix within the host. Omitted means `/`. */
86 path?: string
87 /** Upstream(s) for an app route. */
88 from?: string | string[]
89 /** Served directory for a static route. */
90 static?: string | { dir?: string }
91 /** Target for a redirect route. */
92 redirect?: string | { to?: string }
93 }>
7894}
7995
8096/** Port -> the slug of the project that already serves it on this box. */