@theholocron/holocron-plugin-vercel 5.0.0-alpha.26 → 5.0.0-alpha.27

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/README.md CHANGED
@@ -64,9 +64,16 @@ Capability covers:
64
64
  an app) — `defaultFramework` only applies to `ensureProject()`'s
65
65
  Git-linked path.
66
66
  - `getDeployment()` — fetch a deployment by id
67
+ - `ensureCustomDomain()` — idempotent add (list → check → add). Adding
68
+ a domain new to the Vercel account returns `verified: false` with a
69
+ DNS verification challenge (usually a CNAME to a per-project target
70
+ Vercel generates — never a fixed well-known host); this method only
71
+ adds the domain, reading the challenge to finish DNS setup is the
72
+ caller's own job today (no `Wiki.dnsRecord()`-style shared surface
73
+ for it yet)
67
74
 
68
75
  Out of scope for alpha.0 (file a follow-up if needed):
69
76
 
70
- - Domain management (`addDomain` / `removeDomain`)
77
+ - Domain removal (`removeDomain`)
71
78
  - Deletion (`deleteProject`)
72
79
  - Marketplace integrations (e.g. `vercel install neon` for vault-managed databases)
package/dist/index.d.mts CHANGED
@@ -31,6 +31,21 @@ declare class VercelDeployment implements Deployment {
31
31
  }): Promise<DeploymentRecord>;
32
32
  getDeployment(deploymentId: string): Promise<DeploymentRecord>;
33
33
  deployFunction(projectId: string, config: DeployFunctionConfig): Promise<DeployFunctionResult>;
34
+ /**
35
+ * Idempotent — no-op when `hostname` is already on the project,
36
+ * matching `Deployment.ensureCustomDomain`'s contract (never break
37
+ * on re-runs, per CLAUDE.md's probe-then-act standard). Adding it
38
+ * the first time returns `verified: false` for a domain new to this
39
+ * Vercel account — Vercel needs a DNS record (usually CNAME, a
40
+ * unique per-project target) created before it routes traffic. This
41
+ * method only adds the domain; reading the verification challenge
42
+ * needed to finish is the caller's job (`client().domains.add()`'s
43
+ * own return value carries it) — Sentinel has no `holocron setup`
44
+ * orchestration to hand it to, so there's no shared "here's the DNS
45
+ * record" surface to route it through the way `Wiki.dnsRecord()`
46
+ * does today.
47
+ */
48
+ ensureCustomDomain(projectId: string, hostname: string): Promise<void>;
34
49
  private getProjectByName;
35
50
  }
36
51
  //#endregion
package/dist/index.mjs CHANGED
@@ -75,6 +75,25 @@ var VercelDeployment = class {
75
75
  url: raw.url
76
76
  };
77
77
  }
78
+ /**
79
+ * Idempotent — no-op when `hostname` is already on the project,
80
+ * matching `Deployment.ensureCustomDomain`'s contract (never break
81
+ * on re-runs, per CLAUDE.md's probe-then-act standard). Adding it
82
+ * the first time returns `verified: false` for a domain new to this
83
+ * Vercel account — Vercel needs a DNS record (usually CNAME, a
84
+ * unique per-project target) created before it routes traffic. This
85
+ * method only adds the domain; reading the verification challenge
86
+ * needed to finish is the caller's job (`client().domains.add()`'s
87
+ * own return value carries it) — Sentinel has no `holocron setup`
88
+ * orchestration to hand it to, so there's no shared "here's the DNS
89
+ * record" surface to route it through the way `Wiki.dnsRecord()`
90
+ * does today.
91
+ */
92
+ async ensureCustomDomain(projectId, hostname) {
93
+ const { domains: existing } = await this.client().domains.list(projectId);
94
+ if (existing.some((d) => d.name === hostname)) return;
95
+ await this.client().domains.add(projectId, hostname);
96
+ }
78
97
  async getProjectByName(name) {
79
98
  try {
80
99
  return mapProject(await this.client().projects.get(name));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/holocron-plugin-vercel",
3
- "version": "5.0.0-alpha.26",
3
+ "version": "5.0.0-alpha.27",
4
4
  "description": "Holocron plugin for Vercel. Implements the deployment capability against the Vercel REST API.",
5
5
  "keywords": [
6
6
  "deployment",
@@ -31,10 +31,10 @@
31
31
  ],
32
32
  "devDependencies": {
33
33
  "@theholocron/eslint-config": "^8.0.0",
34
- "@theholocron/http-client": "^1.22.0",
34
+ "@theholocron/http-client": "^1.23.0",
35
35
  "@theholocron/tsconfig": "^8.0.0",
36
36
  "@theholocron/tsdown-config": "^8.0.0",
37
- "@theholocron/vercel-client": "^1.22.0",
37
+ "@theholocron/vercel-client": "^1.23.0",
38
38
  "@theholocron/vitest-config": "^8.0.0",
39
39
  "@types/node": "^26",
40
40
  "@vitest/coverage-v8": "^4.1.11",
@@ -46,11 +46,11 @@
46
46
  "tsx": "4.23.12",
47
47
  "typescript": "^5.9.3",
48
48
  "vitest": "^4.1.11",
49
- "@theholocron/cli": "5.0.0-alpha.26"
49
+ "@theholocron/cli": "5.0.0-alpha.27"
50
50
  },
51
51
  "peerDependencies": {
52
- "@theholocron/vercel-client": "^1.22.0",
53
- "@theholocron/cli": "5.0.0-alpha.26"
52
+ "@theholocron/vercel-client": "^1.23.0",
53
+ "@theholocron/cli": "5.0.0-alpha.27"
54
54
  },
55
55
  "peerDependenciesMeta": {
56
56
  "@theholocron/vercel-client": {}