Skip to content

refactor(workbench): own interface derivation in workbench-cli#1336

Draft
gu-stav wants to merge 1 commit into
mainfrom
refactor/workbench-move-interfaces
Draft

refactor(workbench): own interface derivation in workbench-cli#1336
gu-stav wants to merge 1 commit into
mainfrom
refactor/workbench-move-interfaces

Conversation

@gu-stav

@gu-stav gu-stav commented Jun 22, 2026

Copy link
Copy Markdown
Member

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 new createRegistrySetTracker, and that startWorkbenchDevServer's registry watcher now uses it.

Testing

Existing unit tests moved with the code; added coverage for the shared registry tracker.

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.
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Stats — @sanity/cli

Compared against main (bf9fcfcc)

@sanity/cli

Metric Value vs main (bf9fcfc)
Internal (raw) 2.7 KB -
Internal (gzip) 1.0 KB -
Bundled (raw) 11.15 MB -
Bundled (gzip) 2.10 MB -
Import time 870ms +2ms, +0.2%

bin:sanity

Metric Value vs main (bf9fcfc)
Internal (raw) 782 B -
Internal (gzip) 423 B -
Bundled (raw) 9.87 MB -
Bundled (gzip) 1.77 MB -
Import time 2.01s +3ms, +0.2%

🗺️ 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 (bf9fcfcc)

Metric Value vs main (bf9fcfc)
Internal (raw) 106.7 KB -
Internal (gzip) 26.7 KB -
Bundled (raw) 21.71 MB -
Bundled (gzip) 3.45 MB -
Import time 790ms -4ms, -0.5%

🗺️ 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 (bf9fcfcc)

Metric Value vs main (bf9fcfc)
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.

@github-actions

Copy link
Copy Markdown
Contributor

Coverage Delta

File Statements
packages/@sanity/cli/src/actions/dev/registration/startDevManifestWatcher.ts 89.1% (±0%)
packages/@sanity/cli/src/actions/dev/registration/startDevServerRegistration.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/dev/workbench/startWorkbenchDevServer.ts 98.8% (- 0.1%)
packages/@sanity/workbench-cli/src/actions/dev/deriveInterfaces.ts 100.0% (new)
packages/@sanity/workbench-cli/src/actions/dev/interfaceSetId.ts 100.0% (new)

Comparing 5 changed files against main @ bf9fcfcc54c39ac346699e7a33b1b0919a429bfe

Overall Coverage

Metric Coverage
Statements 87.7% (+ 0.5%)
Branches 77.3% (+ 0.5%)
Functions 87.1% (+ 1.4%)
Lines 88.1% (+ 0.5%)

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.

1 participant