@rizom/ops 0.2.0-alpha.220 → 0.2.0-alpha.222

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.
@@ -0,0 +1,9 @@
1
+ export interface PreviewDomainOptions {
2
+ sharedDomain?: string | undefined;
3
+ }
4
+ /**
5
+ * Public operator-facing wrapper around the runtime's preview-domain rule.
6
+ * Keeping deploy resolution on this function prevents DNS, proxy, and runtime
7
+ * metadata from drifting onto different host shapes.
8
+ */
9
+ export declare function derivePreviewDomain(domain: string, options?: PreviewDomainOptions): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rizom/ops",
3
- "version": "0.2.0-alpha.220",
3
+ "version": "0.2.0-alpha.222",
4
4
  "description": "Operator CLI for managing private brain fleet registry repos",
5
5
  "keywords": [
6
6
  "brains",
@@ -22,6 +22,7 @@
22
22
  "devDependencies": {
23
23
  "@brains/deploy-support": "workspace:*",
24
24
  "@brains/eslint-config": "workspace:*",
25
+ "@brains/site-composition": "workspace:*",
25
26
  "@brains/typescript-config": "workspace:*",
26
27
  "@brains/utils": "workspace:*",
27
28
  "@types/bun": "^1.3.14",
@@ -1,6 +1,6 @@
1
1
  import { readFileSync } from "node:fs";
2
2
 
3
- import { loadPilotRegistry } from "@rizom/ops";
3
+ import { derivePreviewDomain, loadPilotRegistry } from "@rizom/ops";
4
4
 
5
5
  import {
6
6
  parseEnvFile,
@@ -30,11 +30,9 @@ const user = registry.users.find((entry) => entry.handle === handle);
30
30
  if (!user) {
31
31
  throw new Error(`Unknown user handle: ${handle}`);
32
32
  }
33
- const previewDomain = resolvePreviewDomain(
34
- handle,
35
- brainDomain,
36
- registry.pilot.domainSuffix,
37
- );
33
+ const previewDomain = derivePreviewDomain(brainDomain, {
34
+ sharedDomain: registry.pilot.domainSuffix,
35
+ });
38
36
  const wwwDomain = isFleetDomain(
39
37
  handle,
40
38
  brainDomain,
@@ -77,23 +75,6 @@ for (const [key, value] of Object.entries(outputs)) {
77
75
  writeGitHubOutput(key, value);
78
76
  }
79
77
 
80
- function resolvePreviewDomain(
81
- userHandle: string,
82
- domain: string,
83
- pilotDomainSuffix: string,
84
- ): string {
85
- if (!isFleetDomain(userHandle, domain, pilotDomainSuffix)) {
86
- return `preview.${domain}`;
87
- }
88
-
89
- const fleetZone = pilotDomainSuffix.replace(/^\./, "");
90
- if (!fleetZone) {
91
- throw new Error(`Could not derive preview domain from ${domain}`);
92
- }
93
-
94
- return `${userHandle}-preview.${fleetZone}`;
95
- }
96
-
97
78
  function isFleetDomain(
98
79
  userHandle: string,
99
80
  domain: string,