Open-Source Wikis

/

tldraw

/

Deployment

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.yml opens 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.yml runs the actual publish.
  • publish-canary.yml publishes prerelease versions to npm under the canary tag for trunk-tracking testing.
  • publish-patch.yml ships patch fixes from release-vX.Y branches.
  • publish-manual.yml is the manual escape hatch.

dotcom deploy flow

internal/scripts/deploy-dotcom.ts is the orchestrator. It handles:

  1. Cloudflare auth and Wrangler deploy for each worker.
  2. Static asset uploads to R2 / Cloudflare Pages.
  3. Fly.io app deploys for zero-cache (replication-manager and view-syncer have separate fly apps; templates are in apps/dotcom/zero-cache/flyio-*.template.toml).
  4. Sentry release tagging via apps/dotcom/client/sentry-release-name.ts and sentry.properties.
  5. DB migration coordination — apps/dotcom/wait-for-migrations.sh ensures 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 in apps/dotcom/zero-cache/.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Deployment – tldraw wiki | Factory