Skip to content

refactor: remove @sanity/themer-legacy - #3070

Merged
stipsan merged 7 commits into
mainfrom
cody/remove-themer-legacy-from-ui-3adf
Sep 30, 2026
Merged

stipsan merged 7 commits into
mainfrom
cody/remove-themer-legacy-from-ui-3adf

Conversation

@stipsan

@stipsan stipsan commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

@sanity/themer-legacy is developed and published from sanity-io/themer now that sanity-io/themer#379 has merged, and 0.2.2 has already been published from there. This PR removes it from ui completely, following the pattern of #3057.

What changed

  • Removed: packages/themer-legacy, including its typings/babel-plugin-react-compiler.d.ts.
  • Studio (apps/studio): the themer-legacy tool and the @sanity/themer-legacy dependency are gone entirely, not switched to the catalog. With refactor: remove @sanity/themer #3057, the studio no longer has any themer tools. The legacy docs schemas and scripts/export-docs-to-code.ts stay.
  • Nothing else in ui uses @sanity/themer-legacy, so there's no catalog entry for it. Every catalog entry it used still has another user, so none were dropped.
  • Release config: .changeset/config.json drops bumpVersionsWithWorkspaceProtocolOnly. feat(themer-legacy): extract the legacy generator into @sanity/themer-legacy #2960 added it only to keep Changesets from rewriting this package's deliberate @sanity/ui ^4 range, and no other package uses a non-workspace range, so releases are unaffected.
  • No changeset and no version bump: the PR adds, changes or removes no .changeset/*.md file, and nothing ui publishes changes. changeset status --since=origin/main lists no packages to bump.
  • Config: the root build and test scripts, knip and pkg-pr-new.yml drop the package. oxlint, the workspace globs and the other workflows had no themer-legacy entries.
  • Storybook: there are no themer-legacy stories, and there's no ref.
  • Docs: README, CONTRIBUTING and AGENTS.md say @sanity/themer-legacy lives in sanity-io/themer.
  • Lockfile: pure removal, and identical with autoDedupe on or off. Merges of main took main's lockfile and regenerated it rather than hand-merging it.

Merge order with Version Packages (#3064)

Either order works now. #3064 bumps only @sanity/ui to 4.2.8, and the two PRs change no files in common. If #3064 merges first, ui's changeset publish skips @sanity/themer-legacy because its version on main, 0.2.1, is already on npm.

What you need to do

  • npm trusted publishing: npm allows up to 10 trusted publishers per package, so sanity-io/ui's release.yml may still be registered for @sanity/themer-legacy next to sanity-io/themer's. You may want to remove it.
  • Changesets parity: the destination repos copied bumpVersionsWithWorkspaceProtocolOnly: true from ui's config when they matched it. It does nothing there. Drop it in those repos if you want exact parity, or tell me to keep it in ui.
  • Nothing is undeployed. After this merges, the ui-studio Vercel deployment and the next sanity deploy of the hosted studio no longer include the themer-legacy tool.

Verification

  • CI is green on the head commit: lint, build and knip, unit tests on Ubuntu and macOS, coverage, the Storybook browser tests, and the Vercel builds of the docs, studio, Storybook and workshop.
  • pnpm install --frozen-lockfile passes on pnpm 12.8.1, and a non-frozen install leaves the lockfile unchanged.
  • oxfmt --check flags only .changeset/dependencies-GH-3062.md. That file stays byte-identical to main, where it fails the same way, and CI runs no format check.
Open in Web Open in Cursor 

@sanity/themer-legacy is developed and published from sanity-io/themer.
Remove its `themerTool` from the studio together with the
`@sanity/themer-legacy` dependency, instead of installing it from npm. The
legacy docs schemas and the docs export script stay.
@sanity/themer-legacy is developed and published from sanity-io/themer.
Remove packages/themer-legacy (with its react-compiler typings) and drop it
from the build and test scripts, knip, pkg.pr.new and the docs. Nothing left
in ui depends on it, so there is no catalog entry for it, and every catalog
entry it used still has another user.

Release config: the pending oxc-transform-react changeset no longer lists
the package, so the next Version Packages PR only bumps @sanity/ui, and
.changeset/config.json drops bumpVersionsWithWorkspaceProtocolOnly, which
#2960 added only to keep Changesets from rewriting this package's deliberate
@sanity/ui ^4 range. No other package uses a non-workspace range, so the
remaining releases are unaffected. ui's Storybook has no themer stories and
gets no themer ref.
@changeset-bot

changeset-bot Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e7e1133

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@vercel

vercel Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
sanity-ui-storybook Ready Ready Preview Sep 30, 2026 11:03am UTC
ui-docs Ready Ready Preview Sep 30, 2026 11:03am UTC
ui-studio Ready Ready Preview Sep 30, 2026 11:03am UTC
1 Skipped Deployment
Project Deployment Actions Updated
sanity-ui-workshop Ignored Ignored Sep 30, 2026 11:03am UTC

Request Review

…gacy-from-ui-3adf

# Conflicts:
#	.changeset/dependencies-GH-3065.md
#	pnpm-lock.yaml
Renovate's changeset for the sanity ^6.17.0 bump (#3069) only lists
@sanity/themer-legacy, which this branch removes (@sanity/ui doesn't depend
on sanity). Like the deleted oxc-transform-react changeset, it would
otherwise make ui release a package that now lives in sanity-io/themer, and
Changesets fails on a changeset for a package outside the workspace.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The transferred package and all corresponding workspace, Studio, release, build, test, lockfile, and documentation references are consistently removed.

Review effort: Balanced
Findings: None

What changed in this PR

Removes @sanity/themer-legacy after its ownership moved to sanity-io/themer, eliminating the local package and Studio integration.

Changes:

  • Deletes the complete legacy package implementation and tests.
  • Removes Studio, build, test, preview-publishing, lockfile, and release configuration references.
  • Updates repository documentation to identify the package’s new home.
File Description
.changeset/​config.json Removes the package-specific version-bumping workaround.
.changeset/​dependencies-GH-3062.md Normalizes quote formatting.
.github/​workflows/​pkg-pr-new.yml Stops publishing package previews.
AGENTS.md Documents the external package location and revised tooling.
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 legacy Themer Studio plugin.
knip.jsonc Removes the deleted package’s exception.
package.json Drops the package from root build and test scripts.
packages/​themer-legacy/​CHANGELOG.md Removes package release history.
packages/​themer-legacy/​README.md Removes package documentation.
packages/​themer-legacy/​package.json Removes the package manifest.
packages/​themer-legacy/​src/​generator/​__fixtures__/​hosted.ts Removes hosted-service fixtures.
packages/​themer-legacy/​src/​generator/​applyHues.ts Removes hue-default merging logic.
packages/​themer-legacy/​src/​generator/​createTheme.ts Removes the public theme generator.
packages/​themer-legacy/​src/​generator/​createTonesFromHues.ts Removes tint generation logic.
packages/​themer-legacy/​src/​generator/​defaults.ts Removes default theme exports.
packages/​themer-legacy/​src/​generator/​dropUndefined.ts Removes the hue cleanup helper.
packages/​themer-legacy/​src/​generator/​legacy.test.ts Removes generator compatibility tests.
packages/​themer-legacy/​src/​generator/​palette.ts Removes the vendored legacy palette.
packages/​themer-legacy/​src/​generator/​parseHuesFromSearchParams.ts Removes URL parameter parsing.
packages/​themer-legacy/​src/​generator/​presets.ts Removes legacy theme presets.
packages/​themer-legacy/​src/​generator/​themeFromHues.ts Removes legacy theme construction.
packages/​themer-legacy/​src/​generator/​types.ts Removes generator API types.
packages/​themer-legacy/​src/​index.ts Removes the package entry point.
packages/​themer-legacy/​src/​lib/​mix.test.ts Removes color-mixing tests.
packages/​themer-legacy/​src/​lib/​mix.ts Removes color-mixing utilities.
packages/​themer-legacy/​src/​tool/​HueFields.tsx Removes hue editor controls.
packages/​themer-legacy/​src/​tool/​ThemerLayout.tsx Removes the Studio preview layout.
packages/​themer-legacy/​src/​tool/​ThemerNavbar.tsx Removes the navbar integration.
packages/​themer-legacy/​src/​tool/​ThemerSidebar.tsx Removes the editor sidebar.
packages/​themer-legacy/​src/​tool/​TintStrip.tsx Removes tint preview controls.
packages/​themer-legacy/​src/​tool/​context.ts Removes shared tool state.
packages/​themer-legacy/​src/​tool/​hues.test.ts Removes hue utility tests.
packages/​themer-legacy/​src/​tool/​hues.ts Removes hue utilities.
packages/​themer-legacy/​src/​tool/​huesReducer.test.ts Removes reducer tests.
packages/​themer-legacy/​src/​tool/​huesReducer.ts Removes draft-state reduction logic.
packages/​themer-legacy/​src/​tool/​index.ts Removes the tool entry point.
packages/​themer-legacy/​src/​tool/​plugin.test.ts Removes plugin registration tests.
packages/​themer-legacy/​src/​tool/​plugin.tsx Removes the Studio plugin definition.
packages/​themer-legacy/​src/​tool/​storage.test.ts Removes draft-storage tests.
packages/​themer-legacy/​src/​tool/​storage.ts Removes persisted draft handling.
packages/​themer-legacy/​src/​tool/​theme.test.ts Removes preview-theme tests.
packages/​themer-legacy/​tsconfig.json Removes TypeScript configuration.
packages/​themer-legacy/​tsdown.config.mts Removes build configuration.
packages/​themer-legacy/​typings/​babel-plugin-react-compiler.d.ts Removes the compiler typing stub.
packages/​themer-legacy/​vitest.config.ts Removes test configuration.
pnpm-lock.yaml Removes package and Studio importer entries.
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.

Running oxfmt on this branch rewrote the quotes in Renovate's
.changeset/dependencies-GH-3062.md, which this PR has no reason to touch.
Restore main's version so the PR changes no changeset file. The release
plan is the same either way: @sanity/ui patch, from #3062.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The migrated package and all functional references are removed consistently, with its destination repository already merged.

Review effort: Balanced
Findings: None

Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

@stipsan
stipsan merged commit fd4693a into main Sep 30, 2026
17 checks passed
@stipsan
stipsan deleted the cody/remove-themer-legacy-from-ui-3adf branch September 30, 2026 11:23

This branch was successfully deployed

3 active deployments
Preview – ui-docs — e7e11336 Deployed Sep 30, 2026 by vercel[bot]
Preview – sanity-ui-storybook — e7e11336 Deployed Sep 30, 2026 by vercel[bot]
Preview – ui-studio — e7e11336 Deployed Sep 30, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants