chore(cli): move @sanity/ui to devDependencies#1105
Conversation
|
Claude finished @runeb's task in 1m 23s —— View job ReviewNo blocking issues. The dependency move is correct and the lockfile/changeset story is consistent with the description. Verified
Nits (optional)
|
📦 Bundle Stats —
|
| Metric | Value | vs main (bf63c5f) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 10.97 MB | - |
| Bundled (gzip) | 2.06 MB | - |
| Import time | 843ms | -1ms, -0.1% |
bin:sanity
| Metric | Value | vs main (bf63c5f) |
|---|---|---|
| Internal (raw) | 1023 B | - |
| Internal (gzip) | 486 B | - |
| Bundled (raw) | 9.84 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 1.97s | -3ms, -0.1% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against main (bf63c5fd)
| Metric | Value | vs main (bf63c5f) |
|---|---|---|
| Internal (raw) | 95.5 KB | - |
| Internal (gzip) | 22.5 KB | - |
| Bundled (raw) | 21.61 MB | - |
| Bundled (gzip) | 3.42 MB | - |
| Import time | 793ms | -11ms, -1.4% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — create-sanity
Compared against main (bf63c5fd)
| Metric | Value | vs main (bf63c5f) |
|---|---|---|
| Internal (raw) | 908 B | - |
| Internal (gzip) | 483 B | - |
| Bundled (raw) | 931 B | - |
| Bundled (gzip) | 491 B | - |
| Import time | ❌ ChildProcess denied: node | - |
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
Coverage DeltaNo covered files changed in this PR. Overall Coverage
|
860a7d4 to
efcce16
Compare
efcce16 to
e2f17be
Compare
Description
Small cleanup:
@sanity/uiwas sitting in@sanity/cli's runtimedependencies, but the CLI only references it in a type position (typeof import('@sanity/ui')inresolveSchemaIcon.tsx). The actual runtime load goes throughresolveLocalPackageFrom('@sanity/ui', sanityUrl), which is anchored at the studio'snode_modules— that's intentional per ce07d42e, to avoid dual-React instances.So the CLI's own copy of
@sanity/uiwas never actually reached at runtime — it was just along for the ride on every install. Moving it todevDependencieskeeps types working while trimming what we ship.Measured by packing both versions and
npm install-ing each into a clean directory: 56 fewer packages, 27 MB less on disk per standalone install. The shrinkage comes from@sanity/uiitself plus its transitive closure —@sanity/color,@sanity/icons,styled-components, the@emotion/*family,framer-motion,@floating-ui/*, and a handful of markdown/HTML utility packages.(Note: bundle-stats reports no change because the CLI's published
dist/is byte-identical — swc transpile only, no bundling. The win is install-tree size, not bundle size.)What to review
One line in
packages/@sanity/cli/package.json(plus the lockfile). No source changes, no behavior change.Testing
pnpm check:types,check:lint,check:deps,build:cli, and the manifest test suite (58/58) all pass locally.Rebase note
Rebased onto main to clear the lockfile conflict from #1107 (
@types/nodebump) and #1065 (@sanity/codegenbump). The regenerated lockfile also contains a few incidental, metadata-only changes that reviewers may notice:@babel/helper-define-polyfill-provider@0.6.8consolidated ontoresolve@1.22.12instead of1.22.11. Both versions already existed in the lockfile on main (different consumers); pnpm just picked the newer of the two it already had.resolve@1.22.12a non-optional consumer, so itsoptional: trueflag (and the cascading flags on its transitive depsis-core-module@2.16.2andhasown@2.0.3) were dropped. No new packages, no real version bumps — purely pnpm recomputing reachability.Note
Low Risk
Low risk dependency metadata change: moves
@sanity/uifrom runtime to dev-only for@sanity/cli, with lockfile churn but no functional code changes.Overview
Reduces
@sanity/cliinstall footprint by moving@sanity/uifromdependenciestodevDependencieswhile keeping TypeScript type imports working.Adds a changeset to publish a patch release, and updates
pnpm-lock.yamlaccordingly (including minor pnpm recomputation/metadata changes aroundresolveand optional flags).Reviewed by Cursor Bugbot for commit e2f17be. Bugbot is set up for automated code reviews on this repo. Configure here.