refactor: Move checkStudioDependencyVersions into cli-build#1080
refactor: Move checkStudioDependencyVersions into cli-build#1080snocorp wants to merge 2 commits into
Conversation
|
Claude finished @snocorp's task in 2m 4s —— View job Review
No blocking issues. The refactor is clean: the function moves with its tests, the mock in NotesChangeset — not needed. This is a pure internal refactor: Minor observations (non-blocking):
|
📦 Bundle Stats —
|
| Metric | Value | vs main (f0906a0) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 10.97 MB | -98 B, -0.0% |
| Bundled (gzip) | 2.06 MB | -24 B, -0.0% |
| Import time | 837ms | -23ms, -2.7% |
bin:sanity
| Metric | Value | vs main (f0906a0) |
|---|---|---|
| Internal (raw) | 975 B | - |
| Internal (gzip) | 460 B | - |
| Bundled (raw) | 9.84 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 1.97s | -73ms, -3.6% |
🗺️ 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 (f0906a04)
| Metric | Value | vs main (f0906a0) |
|---|---|---|
| Internal (raw) | 95.5 KB | -721 B, -0.7% |
| Internal (gzip) | 22.5 KB | -40 B, -0.2% |
| Bundled (raw) | 21.60 MB | -721 B, -0.0% |
| Bundled (gzip) | 3.42 MB | -93 B, -0.0% |
| Import time | 787ms | -26ms, -3.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 — create-sanity
Compared against main (f0906a04)
| Metric | Value | vs main (f0906a0) |
|---|---|---|
| Internal (raw) | 976 B | - |
| Internal (gzip) | 507 B | - |
| Bundled (raw) | 50.7 KB | - |
| Bundled (gzip) | 12.6 KB | - |
| 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 Delta
Comparing 3 changed files against main @ Overall Coverage
|
Description
This PR moves checkStudioDependencyVersions into the cli-build package. This logic is used in both the build logic as well as the dev server logic and so it makes sense to move it and export it to be used by both. Eventually it will only need to be exported for the dev server part once the build logic is also moved.
Testing
Moved one unit test into the new package and fixed a mock in the main cli package. Unit tests pass and this is a relatively simple refactor.
Note
Medium Risk
Moderate risk because it changes cross-package wiring for a preflight check used by both
buildanddev, so a bad export path or dependency mismatch could fail CLI startup in those flows.Overview
checkStudioDependencyVersionsis relocated into@sanity/cli-buildand exposed via@sanity/cli-build/_internal, withbuildStudioandstartStudioDevServerupdated to import it from there.@sanity/cli-buildnow depends on@sanity/cli-coreplussemver(and types), updates TS path mapping accordingly, and the CLI build test suite adjusts mocks to target the new internal export.Reviewed by Cursor Bugbot for commit aa97bfc. Bugbot is set up for automated code reviews on this repo. Configure here.