tldraw/tldraw
Configuration
Where runtime options, environment variables, and SDK options come from.
Editor options
packages/editor/src/lib/options.ts defines TLEditorOptions — the per-editor configuration object passed to <TldrawEditor options={...} /> and new Editor({ options }). It is the canonical place to look for "what knobs does the editor have?". Examples:
- Animation durations.
- Pointer/touch tolerance thresholds.
- Edge-scroll trigger zone width.
- Maximum shape count per page.
- Default fonts.
- Snap thresholds.
The defaults are exported as TLEditorOptionsDefaults; passed options merge into them.
SDK options
<Tldraw /> accepts a superset of the editor's options. Common props:
shapeUtils,tools,bindings— extend or replace the default sets.overrides— UI override schema (seepackages/tldraw/src/lib/ui/overrides.ts).assetUrls— overrides for icons and translations.onMount— callback that receives the constructedEditor.licenseKey— production license key.
Environment variables
Each app uses Vite/Next's standard env-loading. The conventions:
apps/dotcom/client— Vite envs prefixedVITE_…in.env*files. Thevite.config.tsexposesVITE_PREVIEW=1for preview builds.apps/docs— Next.js envs (NEXT_PUBLIC_…).apps/examples— Vite, mostly free of envs (the dev fixture intentionally has minimal config).- Workers (
apps/*-worker,apps/dotcom/*-worker) — secrets defined inwrangler.tomland pushed viawrangler secret put.
Cloudflare Worker config
Each worker workspace has its own wrangler.toml:
apps/bemo-worker/wrangler.tomlapps/dotcom/sync-worker/wrangler.tomlapps/dotcom/asset-upload-worker/wrangler.tomlapps/dotcom/image-resize-worker/wrangler.tomlapps/dotcom/tldrawusercontent-worker/wrangler.tomlapps/mcp-app/wrangler.tomlapps/analytics-worker/wrangler.toml
These declare bindings (R2 buckets, KV namespaces, Durable Objects, secrets) and routes. Read them when wiring a new binding.
Fly.io config
apps/dotcom/zero-cache/flyio-replication-manager.template.toml and apps/dotcom/zero-cache/flyio-view-syncer.template.toml are templated TOMLs. Recent churn is concentrated here as the team scales the view-syncer fleet.
Build config
- Repo root:
lazy.config.ts(lazyrepo task graph),eslint.config.mjs,.oxlintrc.json,.oxfmtrc.json,.prettierrc,.prettierignore,tsdoc.json,vitest.config.ts,lerna.json. - Per-package:
tsconfig.json,vitest.config.ts,playwright.config.tswhere applicable. - TypeScript shared configs:
internal/config/.
Husky and lint-staged
package.json configures lint-staged to run oxfmt --no-error-on-unmatched-pattern on every staged JS/TS/CSS/MD/JSON/YAML file. Husky hooks under .husky/ invoke lint-staged on commit.
Related
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.