* Convex.Deployment: take over production, create dev and preview deployments
- prod takes over the project's default production deployment without
--adopt and never deletes it, also with RemovalPolicy.destroy().
- dev and preview are created with POST /projects/{project_id}/create_deployment
and the name as reference or preview name. Reconcile looks the name up
first: a Convex create for an existing preview name deletes that preview.
A dev or preview deployment that is not in state needs --adopt.
- A projectId, type, or name change stops the deploy with
DeploymentIdentityChange. An expired preview is created again.
- The removal policy is retain for every type.
- FakeConvex answers the deployment routes from recorded payloads.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Convex.Code: push with the installed Convex CLI and expose the URLs
- Pushes on every apply with the convex package that cwd resolves, run with
the Node.js that runs Alchemy. Nothing is downloaded; command replaces it.
- The deploy key goes only into an env file with mode 0600 (--env-file) in
a temporary directory that is removed on success, failure, and
interruption. That directory is the CLI home, and CONVEX_* variables are
not passed on.
- The CLI output stays out of the logs. A failure shows the last lines with
the key removed.
- The key must fit the deployment before the push (DeployKeyMismatch), and
the CLI must name the same deployment after it (PushTargetMismatch). A
preview deploy key pushes with --preview-name, never --preview-create.
- env sets deployment variables before the push through the deployment API,
with the adoption rule of Convex.EnvironmentVariable.
- Outputs url, siteUrl, deploymentName, deployedAt, and envNames.
- Convex.Deploy stays, deprecated, so that state from 0.1 and 0.2 works.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Live test: push to production and to a preview with Deployment and Code
On a disposable tmp-alchemy-convex-<8 hex> project: take over production,
push the fixture app with a deploy key and one env variable, create a
preview deployment and push with the preview deploy key, push again to the
same preview, destroy the preview stage, keep production with the default
policy, then delete the project with RemovalPolicy.destroy(). A fetch guard
refuses project and deployment deletes outside tmp-alchemy-convex-*
projects, and cleanup runs after a failure too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Docs, composition example, and version 0.3.0
README sections for Convex.Deployment and Convex.Code, the composition
example with a Vite site, the preview stage variant, the Convex call that
each operation uses, data safety rules, and limits. examples/app has both
stages in one type-checked stack.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Deployment: follow the default production deployment, never delete a promoted one
Codex review round 1:
- [P1] Delete read only the type in state. A dev or preview deployment that
became a production deployment in Convex was deleted with
RemovalPolicy.destroy(). Delete now reads the live deployment and keeps it
when its type is prod.
- [P2] prod kept the old deployment after another production deployment
became the project default. Diff, read, and reconcile now resolve the
current default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Deployment: reference is not stable, a deleted project reads as absent
Codex review round 2:
- [P2] reference was in stables, so a dependent that used it kept the old
value when another production deployment became the default. Only
projectId, type, and previewName are stable now.
- [P2] A production read for a deleted project failed with the listing's 404
instead of reporting the deployment as absent. Read and diff treat that
404 as absent; reconcile still reports it.
README: a DeployKey on prod.name keeps its old key after a default switch.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>