tldraw/tldraw
Deployment
How tldraw ships. The repo deploys multiple things: npm packages, Cloudflare Workers, a Vite/Next app, a VS Code extension, and Fly.io services.
What gets deployed where
| Artifact | Target | Workflow |
|---|---|---|
SDK packages (tldraw, @tldraw/editor, @tldraw/store, …) |
npm | .github/workflows/publish-new.yml, publish-canary.yml, publish-patch.yml, publish-manual.yml |
Templates (templates/*) |
npm + GitHub repos | .github/workflows/publish-templates.yml |
apps/dotcom/client |
Cloudflare Pages / Workers | .github/workflows/deploy-dotcom.yml |
apps/dotcom/sync-worker, asset-upload-worker, image-resize-worker, tldrawusercontent-worker |
Cloudflare Workers | .github/workflows/deploy-dotcom.yml |
apps/dotcom/zero-cache |
Fly.io (replication-manager + view-syncer) | invoked by deploy-dotcom.yml |
apps/bemo-worker |
Cloudflare Workers | .github/workflows/deploy-bemo.yml |
apps/analytics-worker |
Cloudflare Workers | .github/workflows/deploy-analytics.yml |
apps/mcp-app |
Cloudflare Workers | .github/workflows/deploy-mcp-app.yml |
apps/docs |
Vercel | configured in apps/docs/; deployed on push |
apps/vscode/extension |
VS Code Marketplace | .github/workflows/publish-vscode-extension.yml |
apps/vscode/editor |
npm (used by the extension) | .github/workflows/publish-editor-extensions.yml |
SDK release flow
graph LR
PR[PR merged] --> NextMdx[release notes in next.mdx]
NextMdx --> BumpVersions[.github/workflows/bump-versions.yml]
BumpVersions --> PublishNew[.github/workflows/publish-new.yml]
PublishNew --> Npm[npm registry]
PublishNew --> ArchiveNotes[archive next.mdx as v4.5.x.mdx]bump-versions.ymlopens a PR that bumps the version of every public package and writes the release-notes article. Merge that PR to trigger the publish.publish-new.ymlruns the actual publish.publish-canary.ymlpublishes prerelease versions to npm under thecanarytag for trunk-tracking testing.publish-patch.ymlships patch fixes fromrelease-vX.Ybranches.publish-manual.ymlis the manual escape hatch.
dotcom deploy flow
internal/scripts/deploy-dotcom.ts is the orchestrator. It handles:
- Cloudflare auth and Wrangler
deployfor each worker. - Static asset uploads to R2 / Cloudflare Pages.
- Fly.io app deploys for
zero-cache(replication-manager and view-syncer have separate fly apps; templates are inapps/dotcom/zero-cache/flyio-*.template.toml). - Sentry release tagging via
apps/dotcom/client/sentry-release-name.tsandsentry.properties. - DB migration coordination —
apps/dotcom/wait-for-migrations.shensures migrations finish before Zero starts.
The hot-fix path is .github/workflows/trigger-dotcom-hotfix.yml (one-off rebuild + deploy from a specific commit).
Staging
.github/workflows/staging-e2e.yml runs the full Playwright dotcom suite against a staging environment. .github/workflows/staging-cleanup-daily.yml cleans up stale staging resources. .github/workflows/prune-preview-deploys.yml removes old preview deploys.
Templates
.github/workflows/publish-templates.yml syncs each templates/* directory to its standalone GitHub repository so users can reference the templates by name in npx create-tldraw@latest.
VS Code extension
The extension publish flow is split into two workflows:
publish-editor-extensions.yml— publishes the editor JavaScript bundle that the extension consumes.publish-vscode-extension.yml— packages and publishes the actual extension to the marketplace.
Snapshot/restore for dotcom
apps/dotcom/snapshot-state.sh and apps/dotcom/restore-state.sh are operational scripts for snapshotting / restoring the production database state. Use with care.
Operational signals
- Production errors surface in Sentry (
apps/dotcom/client/sentry.client.config.ts). - Health check:
internal/health-worker/provides a worker that production observability hits. - The recent commit
f43f2cd36("scale Zero view-syncer to 7 machines") exemplifies how the team scales — by editing the fly.io template TOMLs inapps/dotcom/zero-cache/.
Related
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.