This is the Sanity visual-editing-monorepo (pnpm + Turborepo). Products are publishable libraries in packages/*; demo/test apps live in apps/* and exercise them against Sanity's hosted Content Lake. Standard commands live in the root package.json and each package's turbo.json — reference those rather than duplicating.
- Default devex scope (Storybook only): by maintainer preference, the default dev environment targets only the
@sanity/visual-editingStorybook (the overlays demo) plus package-level lint/test/build. The framework demo apps and the Studio (apps/next,apps/live-next,apps/page-builder-demo,apps/studio) are out of scope by default because they require Sanity secrets/login. Don't request those secrets unless explicitly asked to run those apps. Note: there is noapps/storybook— Storybook is served frompackages/visual-editing. - Toolchain: Node 20.19+ (VM has Node 22 LTS) and pnpm 10.34.1 are preinstalled. The update script runs
pnpm install. - Build packages first: apps depend on
workspace:*package builds. Runpnpm build(buildspackages/*, excludes apps) before running apps, or use the wired-uppnpm dev:*scripts which build deps + studio, then watch.pnpm dev(no target) builds packages then watches everything. - Lint / test:
pnpm lintandpnpm test(Vitest unit + typecheck). Tests need no running services or backend and are the fastest correctness signal. - No local backend: all content comes from Sanity's hosted Content Lake (project
hiomol4a, defined inpackages/@repo/env/index.ts). There is no database/container to run locally. - Primary run path (in scope):
pnpm storybook:visual-editing(Storybook on :6006) renders the@sanity/visual-editing"Overlays" stories with clickable edit overlays and needs no token or backend — use it to demonstrate the core overlay product. You can also run it directly frompackages/visual-editingviapnpm storybook. - Out-of-scope apps (need secrets):
apps/next(:3001),apps/live-next(:3009), andapps/page-builder-demo(:3005)throwat request time withoutSANITY_API_READ_TOKEN(seeapps/*/src/**/sanity.*.tsand.env.local/.env.example).live-next/page-builder-demoalso expectSANITY_API_BROWSER_TOKEN. The Studio (apps/studio, :3333,sanity dev) additionally needs a Sanity login (sanity login/SANITY_AUTH_TOKEN). Only run these if explicitly requested and secrets are provided. - Extracted schemas are committed: each demo app has its extracted Sanity schema checked into git as
apps/*/schema.json, used bysanity typegen generate. After changing@repo/sanity-schema, runpnpm typegen(root script) to re-extract the schemas and regenerate the typegen output, then commit the results. Thesanity schema extractstep prints harmless warnings about workspaces declaring differentauthconfigs; these are non-fatal.