Repository navigation
refactor: remove @sanity/themer - #3057
Conversation
@sanity/themer is developed and published from sanity-io/plugins. Remove its `themerTool` from the studio together with the `@sanity/themer` dependency, instead of installing it from npm. The `@sanity/themer-legacy` tool, the legacy docs schemas and the docs export script stay.
@sanity/themer is developed and published from sanity-io/plugins (plugins/@sanity/themer). Remove packages/themer and drop it from the build and test scripts, pkg.pr.new and the docs. Nothing left in ui depends on it, so there is no catalog entry for it, and the catalog drops lightningcss, which only its tsdown config imported (the @sanity/ui build output is unchanged). ui's Storybook has no themer-only stories to remove; a composition ref to plugins' Storybook can be added once it has a URL. @sanity/themer-legacy stays until it moves to sanity-io/themer.
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
The prerequisite transfer PR remains unmerged, so this PR must be returned to draft as its description requires.
Review effort: Balanced
Findings: 1
What changed in this PR
Removes @sanity/themer from this monorepo after transferring ownership to sanity-io/plugins.
Changes:
- Deletes the package, source, tests, and build configuration.
- Removes the Studio integration and root build/test/publishing references.
- Updates documentation, workspace catalog, and lockfile.
| File | Description |
|---|---|
.github/workflows/pkg-pr-new.yml |
Stops preview-publishing the package. |
AGENTS.md |
Documents the package’s new repository. |
CONTRIBUTING.md |
Removes the package from testing guidance. |
README.md |
Updates ownership and test documentation. |
apps/studio/package.json |
Removes the workspace dependency. |
apps/studio/sanity.config.ts |
Removes the current themer tool. |
package.json |
Removes package build and test commands. |
packages/themer/CHANGELOG.md |
Removes package release history. |
packages/themer/README.md |
Removes package documentation. |
packages/themer/package.json |
Removes the package manifest. |
packages/themer/src/index.ts |
Removes root exports. |
packages/themer/src/legacy/index.ts |
Removes legacy re-exports. |
packages/themer/src/legacy/reexport.test.ts |
Removes legacy export tests. |
packages/themer/src/lib/mix.ts |
Removes color validation helper. |
packages/themer/src/theme/buildPalette.ts |
Removes palette generation. |
packages/themer/src/theme/buildTheme.ts |
Removes theme generation. |
packages/themer/src/theme/hsl.ts |
Removes color conversion utilities. |
packages/themer/src/theme/options.ts |
Removes theme option handling. |
packages/themer/src/theme/presets.ts |
Removes theme presets. |
packages/themer/src/theme/theme.test.ts |
Removes theme tests. |
packages/themer/src/tool/AnimatedColorWheelIcon.tsx |
Removes animated tool icon. |
packages/themer/src/tool/ImageFileButton.tsx |
Removes image picker control. |
packages/themer/src/tool/ImagePaletteSection.css.ts |
Removes palette section styles. |
packages/themer/src/tool/ImagePaletteSection.tsx |
Removes image palette UI. |
packages/themer/src/tool/PasteThemeDialog.tsx |
Removes shared-theme dialog. |
packages/themer/src/tool/RemovedThemes.css.ts |
Removes removed-theme styles. |
packages/themer/src/tool/RemovedThemes.tsx |
Removes restoration UI. |
packages/themer/src/tool/ResizableSidebar.css.ts |
Removes sidebar styles. |
packages/themer/src/tool/ResizableSidebar.tsx |
Removes resizable sidebar. |
packages/themer/src/tool/ScrollArea.css.ts |
Removes scroll-area styles. |
packages/themer/src/tool/ScrollArea.tsx |
Removes scroll-area components. |
packages/themer/src/tool/ThemeCard.css.ts |
Removes theme-card styles. |
packages/themer/src/tool/ThemeCard.tsx |
Removes theme-card UI. |
packages/themer/src/tool/ThemeEditor.css.ts |
Removes editor styles. |
packages/themer/src/tool/ThemeEditor.tsx |
Removes theme editor. |
packages/themer/src/tool/ThemeList.css.ts |
Removes theme-list styles. |
packages/themer/src/tool/ThemeList.tsx |
Removes theme list. |
packages/themer/src/tool/ThemePreview.css.ts |
Removes preview styles. |
packages/themer/src/tool/ThemePreview.tsx |
Removes theme preview. |
packages/themer/src/tool/ThemeSnippetDialog.tsx |
Removes snippet dialog. |
packages/themer/src/tool/ThemeThumbnail.tsx |
Removes theme thumbnails. |
packages/themer/src/tool/ThemerLayout.css.ts |
Removes tool layout styles. |
packages/themer/src/tool/ThemerLayout.tsx |
Removes tool layout integration. |
packages/themer/src/tool/ThemerNavbar.tsx |
Removes navbar integration. |
packages/themer/src/tool/ThemerSidebar.css.ts |
Removes sidebar header styles. |
packages/themer/src/tool/ThemerSidebar.tsx |
Removes sidebar UI. |
packages/themer/src/tool/TooltipButton.tsx |
Removes tooltip button helper. |
packages/themer/src/tool/colorWheel.test.ts |
Removes icon animation tests. |
packages/themer/src/tool/colorWheel.ts |
Removes icon animation logic. |
packages/themer/src/tool/context.ts |
Removes tool context. |
packages/themer/src/tool/imageFile.ts |
Removes image decoding. |
packages/themer/src/tool/imagePalette.test.ts |
Removes palette tests. |
packages/themer/src/tool/imagePalette.ts |
Removes palette extraction. |
packages/themer/src/tool/index.ts |
Removes tool exports. |
packages/themer/src/tool/machine.test.ts |
Removes state-machine tests. |
packages/themer/src/tool/machine.ts |
Removes tool state machine. |
packages/themer/src/tool/options.ts |
Removes option comparison helpers. |
packages/themer/src/tool/plugin.test.ts |
Removes plugin tests. |
packages/themer/src/tool/plugin.tsx |
Removes Studio plugin definition. |
packages/themer/src/tool/share.test.ts |
Removes sharing tests. |
packages/themer/src/tool/share.ts |
Removes theme-code sharing. |
packages/themer/src/tool/sidebarWidth.ts |
Removes sidebar width constants. |
packages/themer/src/tool/snippet.ts |
Removes snippet generation. |
packages/themer/src/tool/storage.test.ts |
Removes persistence tests. |
packages/themer/src/tool/storage.ts |
Removes tool persistence. |
packages/themer/src/tool/themes.test.ts |
Removes theme-list tests. |
packages/themer/src/tool/themes.ts |
Removes theme-list modeling. |
packages/themer/src/tool/useImagePalette.ts |
Removes image palette hook. |
packages/themer/src/tool/usePrefersReducedMotion.ts |
Removes motion preference hook. |
packages/themer/src/tool/useStudioNavbarHeight.ts |
Removes navbar measurement hook. |
packages/themer/src/tool/useThemeCodes.ts |
Removes sharing hooks. |
packages/themer/src/tool/useTypedDeferredValue.test.tsx |
Removes deferred-value tests. |
packages/themer/src/tool/useTypedDeferredValue.ts |
Removes deferred-value hook. |
packages/themer/tsconfig.json |
Removes TypeScript configuration. |
packages/themer/tsdown.config.mts |
Removes package build configuration. |
packages/themer/typings/babel-plugin-react-compiler.d.ts |
Removes compiler type shim. |
packages/themer/vitest.config.ts |
Removes test configuration. |
pnpm-lock.yaml |
Removes package importer dependencies. |
pnpm-workspace.yaml |
Removes its direct Lightning CSS catalog entry. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "author": "Sanity.io <hello@sanity.io>", | ||
| "scripts": { | ||
| "build": "pnpm --filter @sanity/ui build && pnpm --filter @sanity/themer-legacy build && pnpm --filter @sanity/themer build && pnpm --filter figma-plugin-sanity-ui build", | ||
| "build": "pnpm --filter @sanity/ui build && pnpm --filter @sanity/themer-legacy build && pnpm --filter figma-plugin-sanity-ui build", |

Keep this a draft until sanity-io/plugins#2046 merges. That PR moves
@sanity/themerinto sanity-io/plugins (plugins/@sanity/themer), where it will be published from next (0.8.1).This PR removes the package from ui, following the pattern of #3048 and #3056.
@sanity/themer-legacystays until sanity-io/themer#379 merges.What changed
packages/themer.apps/studio): the@sanity/themerdependency and itsthemerToolare gone entirely, not switched to the catalog. The@sanity/themer-legacytool, the legacy docs schemas andscripts/export-docs-to-code.tsstay.@sanity/themer, so there's no catalog entry for it and no changeset.@sanity/themer-legacydoesn't depend on it; the dependency ran the other way.@sanity/uinor the Figma plugin.lightningcss, which onlypackages/themer's tsdown config imported.@sanity/ui's build still runs its lightningcss pass through the vanilla-extract tsdown plugin, and itsdistis byte-identical tomain(97 files).buildandtestscripts drop@sanity/themer.pkg-pr-new.ymlstops publishing./packages/themer.stories/themestories only use@sanity/ui, so they stay. There's no composition ref for themer, since plugins' Storybook doesn't have a URL yet. One can be added next to color, icons and logos once it does.@sanity/themerlives in sanity-io/plugins.autoDedupeon or off.What you need to do
Now: nothing. Keep this as a draft.
Once #2046 merges:
@sanity/themer0.8.1 publishes from sanity-io/plugins'release.ymlthrough its Version Packages PR.@sanity/themerout of ui's pending changesets. For example, Renovate's dependency changesets list every package that uses the bumped dependency. Otherwise ui'srelease.ymlwould try to publish@sanity/themertoo. There are none right now.maininto this branch (no force push), regenerate the lockfile if it conflicts, confirm CI is green, then mark it ready for review.@sanity/themer.apps/storybook/.storybook/main.ts, like the color, icons and logos refs.Nothing is undeployed. After this merges, the
ui-studioVercel deployment and the nextsanity deployof the hosted studio no longer include@sanity/themer's tool. The themer-legacy tool is still there.Verification
From a fresh clone with
pnpm install --frozen-lockfile, on Node 22.22 and pnpm 12.6.0, all of these pass:oxfmt --check,pnpm lint(0 warnings and 0 errors),pnpm knipandpnpm build(@sanity/ui,@sanity/themer-legacy, the Figma plugin).pnpm test:@sanity/ui183 tests plus 1 skipped, and@sanity/themer-legacy38 tests.pnpm test:browser: 58 files, 249 tests, unchanged.pnpm storybook:build,pnpm --filter sanity-ui-studio buildandpnpm --filter sanity-ui-docs build.