Skip to content

refactor(workbench): move dev-server registration into workbench-cli#1337

Closed
gu-stav wants to merge 1 commit into
refactor/workbench-move-interfacesfrom
refactor/workbench-move-registration
Closed

refactor(workbench): move dev-server registration into workbench-cli#1337
gu-stav wants to merge 1 commit into
refactor/workbench-move-interfacesfrom
refactor/workbench-move-registration

Conversation

@gu-stav

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

Copy link
Copy Markdown
Member

Description

Registration drives the registry, so it belongs beside it; the CLI now injects only what it owns — the resolved app id and the manifest extractor — keeping workbench-cli free of CLI config/manifest conventions.

What to review

The injected appId/extractManifest seam on startDevServerRegistration, and the deprecated-id check moving up to the caller.

Testing

Registration + manifest-watcher unit tests moved with the code; the deprecation tests are relocated to the devAction suite.


Note

Medium Risk
Touches workbench dev registration and manifest watching on the critical sanity dev path; behavior should be equivalent but wiring and test placement changed.

Overview
Moves startDevServerRegistration from @sanity/cli into @sanity/workbench-cli and re-exports it on @sanity/workbench-cli/dev, next to the dev-server registry.

devAction now calls that export and injects CLI-owned concerns: checkForDeprecatedAppId and getAppId run before registration, and an extractManifest callback picks studio vs core-app extraction (extractStudioManifest / extractCoreAppManifest). Workbench-cli no longer imports CLI manifest helpers or appId utilities.

Registration tests live in workbench-cli with a slimmer extractManifest / appId API; deprecated app.id vs deployment.appId coverage moves to the devAction unit suite. extractStudioManifest import paths are corrected under actions/manifest, and the manifest watcher uses local dev modules plus subdebug from cli-core instead of a CLI devDebug helper.

Reviewed by Cursor Bugbot for commit bf3050c. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Stats — @sanity/cli

Compared against refactor/workbench-move-interfaces (cd231d6d)

@sanity/cli

Metric Value vs refactor/workbench-move-interfaces (cd231d6)
Internal (raw) 2.7 KB -
Internal (gzip) 1.0 KB -
Bundled (raw) 11.16 MB -
Bundled (gzip) 2.10 MB -
Import time 680ms -3ms, -0.4%

bin:sanity

Metric Value vs refactor/workbench-move-interfaces (cd231d6)
Internal (raw) 782 B -
Internal (gzip) 423 B -
Bundled (raw) 9.87 MB -
Bundled (gzip) 1.78 MB -
Import time 703ms -20ms, -2.8%

🗺️ 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 refactor/workbench-move-interfaces (cd231d6d)

Metric Value vs refactor/workbench-move-interfaces (cd231d6)
Internal (raw) 106.7 KB -
Internal (gzip) 26.7 KB -
Bundled (raw) 21.72 MB -
Bundled (gzip) 3.46 MB -
Import time 597ms -7ms, -1.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 refactor/workbench-move-interfaces (cd231d6d)

Metric Value vs refactor/workbench-move-interfaces (cd231d6)
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

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Coverage Delta

File Statements
packages/@sanity/cli/src/actions/dev/devAction.ts 97.1% (- 2.9%)
packages/@sanity/cli/src/actions/dev/workbench/startWorkbenchDevServer.ts 98.8% (- 0.1%)
packages/@sanity/cli/src/actions/manifest/extractStudioManifest.ts 20.0% (new)
packages/@sanity/workbench-cli/src/actions/dev/deriveInterfaces.ts 100.0% (new)
packages/@sanity/workbench-cli/src/actions/dev/interfaceSetId.ts 100.0% (new)
packages/@sanity/workbench-cli/src/actions/dev/startDevManifestWatcher.ts 89.4% (new)
packages/@sanity/workbench-cli/src/actions/dev/startDevServerRegistration.ts 100.0% (new)

Comparing 7 changed files against main @ 8d59d3b3a0d859137e9a54dc5301ea88e4418fce

Overall Coverage

Metric Coverage
Statements 74.2% (±0%)
Branches 64.2% (±0%)
Functions 69.0% (- 0.1%)
Lines 74.8% (±0%)

Registration drives the registry, so it belongs beside it; the CLI now
injects only what it owns — the resolved app id and the manifest
extractor — keeping workbench-cli free of CLI config/manifest conventions.
@gu-stav gu-stav force-pushed the refactor/workbench-move-interfaces branch from e702336 to cd231d6 Compare June 24, 2026 09:19
@gu-stav gu-stav force-pushed the refactor/workbench-move-registration branch from ae71654 to bf3050c Compare June 24, 2026 09:19
@gu-stav gu-stav marked this pull request as ready for review June 24, 2026 09:47
@gu-stav gu-stav requested a review from a team as a code owner June 24, 2026 09:47
@gu-stav gu-stav requested a review from joshuaellis June 24, 2026 09:47
@gu-stav gu-stav deleted the branch refactor/workbench-move-interfaces June 24, 2026 11:22
@gu-stav gu-stav closed this Jun 24, 2026
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.

2 participants