Skip to content

refactor(workbench): orchestrate the workbench dev run in workbench-cli#1339

Draft
gu-stav wants to merge 1 commit into
refactor/workbench-move-dev-serverfrom
refactor/workbench-slim-devaction
Draft

refactor(workbench): orchestrate the workbench dev run in workbench-cli#1339
gu-stav wants to merge 1 commit into
refactor/workbench-move-dev-serverfrom
refactor/workbench-slim-devaction

Conversation

@gu-stav

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

Copy link
Copy Markdown
Member

Description

devAction had grown into a ~240-line orchestrator carrying the workbench lock, app-server supervision, registry wiring, and signal teardown — moving all of it into one startWorkbenchDev entry leaves devAction a small dispatcher that injects the CLI-domain pieces and lazy-loads the package, so a plain sanity dev never touches workbench-cli.

What to review

The new startWorkbenchDev + appServerSupervisor, the slimmed devAction dispatcher, and workbenchAvailableannounceUrl. One behaviour delta: teardown is now a sequential reverse unwind (was a parallel allSettled), which keeps the watcher stopping before the app server closes.

Testing

Orchestration tests moved to startWorkbenchDev/appServerSupervisor; devAction tests now cover the dispatch + injection.

devAction was a 240-line orchestrator carrying the workbench lock,
app-server supervision, registry wiring, and signal teardown. Move all of
it into a `startWorkbenchDev` entry the CLI delegates to, leaving devAction
a small dispatcher that injects the CLI-domain pieces and lazy-loads the
package so a plain `sanity dev` never touches it.
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle Stats — @sanity/cli

Compared against refactor/workbench-move-dev-server (92b1d6e5)

@sanity/cli

Metric Value vs refactor/workbench-move-dev-server (92b1d6e)
Internal (raw) 2.7 KB -
Internal (gzip) 1.0 KB -
Bundled (raw) 11.15 MB -
Bundled (gzip) 2.10 MB -
Import time 886ms +18ms, +2.0%

bin:sanity

Metric Value vs refactor/workbench-move-dev-server (92b1d6e)
Internal (raw) 782 B -
Internal (gzip) 423 B -
Bundled (raw) 9.87 MB -
Bundled (gzip) 1.77 MB -
Import time 1.98s +8ms, +0.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 — @sanity/cli-core

Compared against refactor/workbench-move-dev-server (92b1d6e5)

Metric Value vs refactor/workbench-move-dev-server (92b1d6e)
Internal (raw) 106.7 KB -
Internal (gzip) 26.7 KB -
Bundled (raw) 21.71 MB -
Bundled (gzip) 3.45 MB -
Import time 786ms +12ms, +1.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 refactor/workbench-move-dev-server (92b1d6e5)

Metric Value vs refactor/workbench-move-dev-server (92b1d6e)
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/devAction.ts 64.3% (+ 8.9%)
packages/@sanity/cli/src/actions/dev/servers/startAppDevServer.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/dev/servers/startStudioDevServer.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/manifest/extractStudioManifest.ts 20.0% (new)
packages/@sanity/workbench-cli/src/actions/dev/appServerSupervisor.ts 100.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)
packages/@sanity/workbench-cli/src/actions/dev/startWorkbenchDev.ts 95.8% (new)
packages/@sanity/workbench-cli/src/actions/dev/startWorkbenchDevServer.ts 98.8% (new)
packages/@sanity/workbench-cli/src/actions/dev/writeWorkbenchRuntime.ts 100.0% (new)

Comparing 12 changed files against main @ bf9fcfcc54c39ac346699e7a33b1b0919a429bfe

Overall Coverage

Metric Coverage
Statements 87.7% (+ 0.5%)
Branches 77.3% (+ 0.5%)
Functions 87.2% (+ 1.5%)
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