feat(deploy): implement resumable deploy wizard#260
Draft
wyattjoh wants to merge 9 commits into
Draft
Conversation
|
Contributor
Author
|
!snapshot |
Contributor
Snapshot publishednpm install -g clerk@1.3.1-snapshot.0dd30be
|
- Preserve completed providers when pausing OAuth setup mid-loop, so `clerk deploy --continue` can finish multi-provider stacks. - Surface a warning for OAuth providers enabled in dev that the wizard does not yet support, instead of silently skipping them. - Close the gutter as Paused (not Failed) when DNS verification times out, since the state is recoverable via --continue. - Tighten the production-domain regex to reject malformed inputs like example..com or example-.com before they reach the API.
Move deploy lifecycle endpoint wrappers into the shared PLAPI client while routing the deploy wizard through a command-local adapter that defaults to mocked operations until the backend endpoints are ready.
Contributor
Author
|
Stack: api-errors-and-deploy Part of a stacked PR chain. Do not merge manually. |
This was referenced May 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the first hidden
clerk deployimplementation for guiding a linked Clerk app from development setup toward production. In human mode the wizard validates clone compatibility, discovers enabled OAuth providers from the development instance config, asks for a user-owned production domain, creates a production instance, guides DNS setup, collects production OAuth credentials, and prints production next steps. In agent mode the command exits early with a structured deployment prompt for noninteractive use.Details
The hidden
clerk deploycommand registers with--debug,--continue, and--abortflags. Deploy API-shaped mocks live incommands/deploy/api.tsbehindFIXME(deploy)markers covering the full production-instance lifecycle: clone validation, instance creation, deploy-status polling, SSL/mail retry hooks, and production config patching. Each helper is sized so it can be swapped for a live Platform API call later.Paused deploy state persists in the CLI profile and records the app and development instance identity, production instance and domain ids, the active DNS or OAuth step, all enabled OAuth providers, and completed provider progress. The wizard supports safe pause/resume for DNS handoff, skipped OAuth setup, and prompt interruption: plain
clerk deployrefuses to start a second run while a bookmark exists, and--continuevalidates that the bookmark belongs to the currently linked project.OAuth credential flows are implemented for Google, GitHub, Microsoft, Apple, and Linear. Google can import a downloaded OAuth JSON file, Apple validates the selected
.p8private key file, and provider walkthroughs show the required production origins and redirect URLs. Deploy-specific copy helpers cover the plan summary, CNAME records, dashboard handoff, pause messaging, production summary, and post-deploy next steps. Spinner and log gutter rendering gain tone-aware rails for active, paused, cancelled, failed, and successful command states plus more robust prompt-exit handling. Key-shaped mock deploy values are replaced withMOCKED_NOT_REAL_FIXMEso the branch does not trip secret scanning.Reviewer notes
The command is hidden for now. The deploy lifecycle API calls are mocked by design; the only live read in the wizard is development instance config discovery via existing PLAPI plumbing. Production OAuth writes are also mocked while the production instance returned by the deploy flow is fake. The deploy README is updated with the current mocked endpoint surface, sequence diagram, OAuth credential shapes, and resume/abort behavior.
Test plan
bun run scripts/run-tests.ts --pattern 'packages/cli-core/src/commands/deploy/index.test.ts' --concurrency 1bun run typecheckbun run lint