CMS (Sanity)
Sanity appears in two places: the standalone Studio in apps/cms, and the dormant CMS starter shipped inside the project template.
apps/cms — Sanity Studio
Section titled “apps/cms — Sanity Studio”A Sanity Studio (schemas + desk structure) trimmed from the turbo-solid starter. Schemas are organized under schemas/ as blocks, pages, settings, slices, and taxonomies. Runs with pnpm dev:cms on localhost:4700 (off Sanity’s default 3333 so outside studios never collide).
Shared Sanity settings (project ID, domains, locales) come from packages/config.
Connect CMS in the editor
Section titled “Connect CMS in the editor”Scaffolded projects include a Sanity starter (src/sanity/, sanity.config.ts, src/lib/sanity.ts) that stays dormant until connected. The editor’s Connect CMS flow (apps/app/src/lib/cms.ts):
- installs the Sanity dependencies into the project,
- writes
PUBLIC_SANITY_PROJECT_ID(and friends) to the project.env, - which activates
@sanity/astroand the embedded Studio at/adminvia the template’s env-guardedastro.config.mjs.
Schema deploy workaround
Section titled “Schema deploy workaround”The stock sanity schema deploy cannot be used from the app: the Sanity CLI 7.x vite/rolldown worker SIGABRTs and swallows its own error output. Instead the app bundles a Bun script (apps/app/src-tauri/scripts/sanity-deploy-cli.ts) that the deploy_schema Tauri command writes to a temp file and runs with the project’s Bun, authenticated by the developer’s existing Sanity CLI login.
Success or failure, the script’s output carries an PLYY_RESULT: line that the frontend parses (parseDeployResult in src/lib/cms.ts).
Shared packages
Section titled “Shared packages”packages/config— shared configuration consumed by the apps:sanity.ts(project settings),domains.ts,locales.tspackages/tailwind-config— shared Tailwind v4 theme (theme.css,styles.css) used by the desktop app and web app