Skip to content

Migrate @sanity/dashboard and the dashboard widget plugins to the monorepo#977

Draft
stipsan wants to merge 424 commits into
mainfrom
cursor/migrate-dashboard-plugins-41b3
Draft

Migrate @sanity/dashboard and the dashboard widget plugins to the monorepo#977
stipsan wants to merge 424 commits into
mainfrom
cursor/migrate-dashboard-plugins-41b3

Conversation

@stipsan

@stipsan stipsan commented Jun 12, 2026

Copy link
Copy Markdown
Member

Transfers four plugins into the monorepo using the copy plugin generator (full git history preserved via git subtree):

Notable changes during transfer

  • All four plugins are now ESM-only, built with React Compiler, and require React 19.2+ / Sanity v5+ / Node 20.19+ (major changesets included for each).
  • Widget plugins declare @sanity/dashboard as a peer dependency (^5 || ^6.0.0-0) plus a workspace:^ dev dependency.
  • document-list: lodashlodash-es, @sanity/ui/rxjs moved to catalog versions.
  • netlify: removed legacy rxjs@6, react-props-stream, and abort-controller dependencies; the stream-based widget wrapper was rewritten as a plain React component with identical behavior (config mapping + fire-and-forget build hook POST).
  • vercel: migrated @sanity/ui v2 → v3 (catalog), migrated useTheme().sanity.color.card.enabled to the v2 theme API (useTheme_v2), replaced the removed theme.sanity.color.spot.red with @sanity/color, added @types/object-hash. Also fixed a React Compiler crash: deploymentTarget!._id in the delete handler caused _id to be hoisted into a render-time memo dependency, crashing the "Create deployment target" dialog when no target exists (verified before/after in the test studio).
  • dashboard: migrated deprecated theme APIs to getTheme_v2, replaced deprecated space/columns props with gap/gridTemplateColumns, replaced createElement with JSX, removed unused NotFoundWidget, fixed an a11y issue in the Project users retry link.
  • Test studio gets a dedicated dashboard-example workspace with one dashboard tool tab per plugin (Dashboard, Document List, Netlify, Vercel), and the root README plugins table lists all four plugins.
  • Root .oxlintrc.json gains a targeted override disabling no-unsafe-type-assertion for the vercel plugin's XState machines (the canonical XState v5 typing pattern relies on {} as Context assertions).
  • Merged main (Sanity Studio v6 catalog upgrade + pkg-utils 10.5.4): regenerated pnpm-lock.yaml against the v6 catalog and re-verified all four plugins build, lint, test, and render correctly under Studio v6.

Demo

dashboard_plugins_demo_all_four_widgets.mp4

Dashboard tab with Project info and Project users widgets
Document list widgets showing a newly created demo document
Netlify deploys widget with two sites
Vercel create deployment target dialog
Dashboard workspace rendering on Sanity Studio v6 after merging main

Transfer verification

  • Trusted publishing configured:
    • npm trust github @sanity/dashboard --file=release.yml --repository=sanity-io/plugins
    • npm trust github sanity-plugin-dashboard-widget-document-list --file=release.yml --repository=sanity-io/plugins
    • npm trust github sanity-plugin-dashboard-widget-netlify --file=release.yml --repository=sanity-io/plugins
    • npm trust github sanity-plugin-dashboard-widget-vercel --file=release.yml --repository=sanity-io/plugins
  • package.json dependencies/peerDependencies/exports verified against original repos
  • Test studio example wired and manually verified (pnpm dev, see demo video; re-verified on Studio v6 after merging main)
  • pnpm format, pnpm knip, pnpm lint, pnpm build, pnpm test run all pass
  • Major changesets added with validated breaking changes (one per plugin)

Maintainer follow-up

To show artifacts inline, enable in settings.

Open in Web Open in Cursor 

KJHeartbreaker and others added 25 commits December 29, 2025 13:51
Co-authored-by: Cody Olsen <81981+stipsan@users.noreply.github.com>
…51c7eac1572d545df'

git-subtree-dir: plugins/@sanity/dashboard
git-subtree-mainline: 064dc6b
git-subtree-split: e5003ff
…it 'a90673b4b1df0b1a52948d0f1f890aab7bc2ab14'

git-subtree-dir: plugins/sanity-plugin-dashboard-widget-document-list
git-subtree-mainline: 94b60aa
git-subtree-split: a90673b
…46f6366eec3f55d8617d88d488d230391f49e4'

git-subtree-dir: plugins/sanity-plugin-dashboard-widget-netlify
git-subtree-mainline: ecb2a74
git-subtree-split: 9646f63
…ecf9a4b8f7cd86d6ff0af515effd2375229d8'

git-subtree-dir: plugins/sanity-plugin-dashboard-widget-vercel
git-subtree-mainline: 988eecd
git-subtree-split: 42cecf9
… handler to avoid React Compiler hoisting crash
@changeset-bot

changeset-bot Bot commented Jun 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: bbb88fd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@sanity/dashboard Major
sanity-plugin-dashboard-widget-document-list Major
sanity-plugin-dashboard-widget-netlify Major
sanity-plugin-dashboard-widget-vercel Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel

vercel Bot commented Jun 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
plugins-studio Ready Ready Preview, Comment Jun 12, 2026 3:00pm

Request Review

@stipsan stipsan added the 🤖 bot label Jun 12, 2026 — with Cursor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.