feat(cli): add domains claim command for cross-store domain ownership#3084
Conversation
Add `catalyst domains claim <domain>` so users can claim ownership of a custom domain that is already in use on another store. Publishing the ownership-verification TXT record and then claiming releases the domain from the other store and binds it to the current project. The Domains API returns the TXT record in the `meta.ownership_verification` field of a cross-store collision. Surface it as a typed DomainOwnershipVerificationError so both `domains add` (on a 409 collision) and `domains claim` (on a 422 unverified claim) print the record and the next step instead of an opaque error. Refs LTRAC-1106 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: f500436 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Bundle Size ReportComparing against baseline from No bundle size changes detected. |
Unlighthouse Performance Comparison — VercelComparing PR preview deployment Unlighthouse scores vs production Unlighthouse scores. Summary ScoreAggregate score across all categories as reported by Unlighthouse.
Category Scores
Core Web Vitals
|
|
Testing Not added Added Already exists but to different project Domain already added to another store: |
|
@jorgemoya can you add a screenshot or the log output of adding a domain that is already taken where it returns the claim records? |
738cd8f to
6d780bc
Compare
431b401 to
6d780bc
Compare
When `domains add` hits a domain already in use on another store, the WARN line echoed the V3 error's title and field message, which repeat each other. Print a concise, purpose-written line instead and let the DNS record plus next-step guidance carry the detail. Same tidy-up for `domains claim`'s not-yet-verified message. Follows the existing convention of mapping a detected error condition to CLI-authored guidance (see UnauthorizedError, the "API not enabled" 403s). Refs LTRAC-1106 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Linear: LTRAC-1106
What/Why?
The
catalyst domains claimcommand was missed from the initial Native Hosting CLI work. It lets a user claim ownership of a custom domain that is already in use on another store/project — publish the ownership-verification TXT record, then runclaimto release the domain from the other store and bind it to the current project (POST .../projects/{project_uuid}/domains/{domain}/claim).The Domains API returns the TXT record to publish in the
meta.ownership_verificationfield of a cross-store collision. Rather than let it surface as an opaque error, it's parsed into a typedDomainOwnershipVerificationErrorso:domains add— on a409cross-store collision, prints the TXT record plusThen run: catalyst domains claim <domain>.domains claim— on a422not-yet-verified claim, reprints the TXT record so the user can publish it and retry.claimmirrorsadd/status: after a successful claim it shows the domain status, and--waitpolls until the domain leavespendingverification.Docs (CLI reference + native-hosting getting-started) are updated in a separate
docs-v2change.Testing
pnpm --filter @bigcommerce/catalyst test src/cli/commands/domains.spec.ts(31 passing), pluspnpm typecheckandpnpm lint. New coverage:claimDomainsuccess +422verification error, theclaimcommand (success, unverified TXT reprint,--wait), and theaddcross-store collision path. Verifiedcatalyst domains claim --helpon the built CLI.Migration
None.