refactor(workbench): own interface derivation in workbench-cli#1336
Merged
Conversation
Contributor
📦 Bundle Stats —
|
| Metric | Value | vs main (8d59d3b) |
|---|---|---|
| Internal (raw) | 2.7 KB | - |
| Internal (gzip) | 1.0 KB | - |
| Bundled (raw) | 11.16 MB | - |
| Bundled (gzip) | 2.10 MB | - |
| Import time | 876ms | -1ms, -0.1% |
bin:sanity
| Metric | Value | vs main (8d59d3b) |
|---|---|---|
| Internal (raw) | 782 B | - |
| Internal (gzip) | 423 B | - |
| Bundled (raw) | 9.87 MB | - |
| Bundled (gzip) | 1.78 MB | - |
| Import time | 2.01s | +65ms, +3.3% |
🗺️ 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 (8d59d3b3)
| Metric | Value | vs main (8d59d3b) |
|---|---|---|
| Internal (raw) | 106.7 KB | - |
| Internal (gzip) | 26.7 KB | - |
| Bundled (raw) | 21.72 MB | - |
| Bundled (gzip) | 3.46 MB | - |
| Import time | 786ms | +21ms, +2.7% |
🗺️ 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 (8d59d3b3)
| Metric | Value | vs main (8d59d3b) |
|---|---|---|
| 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.
Contributor
Coverage Delta
Comparing 5 changed files against main @ Overall Coverage
|
Interface derivation and set-change detection are registry concerns; co-locating them removes the cross-package import and lets the app-rebuild and host-reload checks share one set differ.
e702336 to
cd231d6
Compare
joshuaellis
reviewed
Jun 24, 2026
| * its registry entry: `views` → panels, `services` → workers, `entry` → the | ||
| * navigable `app` view (`entry_point` is the raw `src`, not a resolved URL). | ||
| * `undefined` for a non-branded app; a studio that declares `entry` is rejected | ||
| * (FR-026, studio app views are not implemented yet). |
joshuaellis
approved these changes
Jun 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Interface derivation and set-change detection are dev-server-registry concerns, so they belong in the package that owns the registry — and consolidating them lets the app-side rebuild check and the workbench-side reload check share one set differ instead of two hand-rolled trackers.
What to review
The moved
deriveInterfaces/interfaceSetId, the newcreateRegistrySetTracker, and thatstartWorkbenchDevServer's registry watcher now uses it.Testing
Existing unit tests moved with the code; added coverage for the shared registry tracker.
Note
Low Risk
Pure refactor with behavior preserved; dev orchestration only, covered by moved and new unit tests.
Overview
Moves
deriveInterfaces,interfaceSetId,trackInterfaceSet, and the newcreateInterfacesTrackerfrom@sanity/cliinto@sanity/workbench-cli/dev, alongside the dev-server registry they describe.The CLI now imports those helpers from workbench-cli (
startDevServerRegistration,startDevManifestWatcher,startWorkbenchDevServer). The workbench registry watcher drops its inlineMap+interfaceSetIdlogic in favor ofcreateInterfacesTracker().hasChanged(servers)for full-reload vs soft reconcile.Tests move with the implementation;
@sanity/workbench-cli/devmocks in CLI tests useimportOriginalso pure tracking/derivation still runs under test. New unit tests covercreateInterfacesTracker(first snapshot, new apps, reorders).Reviewed by Cursor Bugbot for commit cd231d6. Bugbot is set up for automated code reviews on this repo. Configure here.