feat(workbench): setup#907
Conversation
|
Claude finished @gu-stav's task in 6m 1s —— View job Claude PR Review
A few issues worth fixing before this graduates from a tracking-only feature branch. 1. Typegen plugin is registered twice in dev mode (bug)In The existing tests use Fix: stop passing 2. Workbench requires authentication when only
|
📦 Bundle Stats —
|
| Metric | Value | vs main (dafed5c) |
|---|---|---|
| Internal (raw) | 2.1 KB | - |
| Internal (gzip) | 799 B | - |
| Bundled (raw) | 10.97 MB | +70 B, +0.0% |
| Bundled (gzip) | 2.06 MB | +14 B, +0.0% |
| Import time | 820ms | -13ms, -1.6% |
bin:sanity
| Metric | Value | vs main (dafed5c) |
|---|---|---|
| Internal (raw) | 1023 B | - |
| Internal (gzip) | 486 B | - |
| Bundled (raw) | 9.84 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 2.23s | +293ms, +15.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 — @sanity/cli-core
Compared against main (dafed5c3)
| Metric | Value | vs main (dafed5c) |
|---|---|---|
| Internal (raw) | 98.8 KB | +2.5 KB, +2.6% |
| Internal (gzip) | 23.3 KB | +667 B, +2.9% |
| Bundled (raw) | 21.64 MB | +2.2 KB, +0.0% |
| Bundled (gzip) | 3.43 MB | +682 B, +0.0% |
| Import time | 780ms | -1ms, -0.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 (dafed5c3)
| Metric | Value | vs main (dafed5c) |
|---|---|---|
| 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.
Coverage Delta
Comparing 42 changed files against main @ Overall Coverage
|
Preview this PR with pkg.pr.newRun the Sanity CLInpx https://pkg.pr.new/sanity-io/cli/@sanity/cli@e6795c3 <command>...Or upgrade project dependencies📦
|
770d32d to
f7b42c8
Compare
|
All alerts resolved. Learn more about Socket for GitHub. This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored. |
|
The axios security warning will be resolved by module-federation/core#4644 I think |
|
Rebased onto |
ffc8344 to
f2b1294
Compare
5e50a1d to
1e221bd
Compare
16e7dfe to
319ef83
Compare
905b492 to
cf3839a
Compare
Co-authored-by: Josh <joshua.ellis18@gmail.com> fix(workbench): allow for a dynamic port (#830)
) * feat(dev): forward CLI config organization id to workbench runtime * chore: update auto-generated changeset for PR #905 --------- Co-authored-by: ecospark[bot] <ecospark[bot]@users.noreply.github.com>
Co-authored-by: Gustav Hansen <gustav.hansen@sanity.io>
…913) Pass `reactRefreshHost` to `@vitejs/plugin-react` so federated Studio modules connect their react-refresh preamble to the workbench host, enabling component-level HMR across the module federation boundary. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(init): add promt for federation * chore: update auto-generated changeset for PR #988 --------- Co-authored-by: squiggler-app[bot] <265501495+squiggler-app[bot]@users.noreply.github.com>
* fix: types * chore: update auto-generated changeset for PR #989 --------- Co-authored-by: squiggler-app[bot] <265501495+squiggler-app[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(workbench): extend local application payloads * fix: types * fix: pr feedback * chore: improve tests * fix: concise * fix: pr feedback
* feat(init): use `workbench` dist-tag for `sanity` package * chore: update auto-generated changeset for PR #992 * test: add unit tests --------- Co-authored-by: squiggler-app[bot] <265501495+squiggler-app[bot]@users.noreply.github.com>
* fix(init): do not resolve dist tags * chore: update auto-generated changeset for PR #1000 --------- Co-authored-by: squiggler-app[bot] <265501495+squiggler-app[bot]@users.noreply.github.com>
* feat(dev): extract studio manifest and pass it for local applications * chore: update auto-generated changeset for PR #997 * fix: rework to use manifests for both * chore: update auto-generated changeset for PR #997 * fix: cleanup * chore: share cache dir constant * feat: extract manifest in background * fix: path resolution on windows * fix: pr feedback * fix: pr feedback --------- Co-Authored-By: squiggler-app[bot] <265501495+squiggler-app[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: squiggler-app[bot] <265501495+squiggler-app[bot]@users.noreply.github.com>
* fix(workbench): remove warmup for dependencies * chore: update auto-generated changeset for PR #1047 --------- Co-authored-by: squiggler-app[bot] <265501495+squiggler-app[bot]@users.noreply.github.com>
Adds `--federation` / `--no-federation` flag to `sanity init` and wires it through `initAction` so the value is passed to `initApp` / `initStudio` alongside the federation prompt added in #988. The flag plumbing was previously part of the rebase merge that resolved feat/workbench against main, and was dropped in the latest rebase.
* fix(workbench): prune stale lock files * fix: add back * chore: update auto-generated changeset for PR #1057 --------- Co-authored-by: squiggler-app[bot] <265501495+squiggler-app[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix(workbench): detect PID reuse on Windows via PowerShell * chore: update auto-generated changeset for PR #1067 * chore(changeset): rewrite changeset summary as user-facing description Co-authored-by: Rune Botten <runeb@users.noreply.github.com> * chore: update auto-generated changeset for PR #1067 --------- Co-authored-by: squiggler-app[bot] <265501495+squiggler-app[bot]@users.noreply.github.com> Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Rune Botten <runeb@users.noreply.github.com>
After rebasing onto main: - buildStudio.ts: plumb `federation` through `InternalBuildOptions` so the `!options.federation?.enabled` guard and the `federation` prop passed to `buildStaticFiles` resolve. Mirrors the same plumbing already done in buildApp.ts during the rebase. - buildStaticFiles.test.ts: `copyDir`/`writeFavicons` moved to `@sanity/cli-build/_internal` in main's #1062 refactor — point the mock at the new path. - startStudioDevServer.test.ts: `checkStudioDependencyVersions` moved to `@sanity/cli-build/_internal`; `getLocalPackageVersion` moved to `@sanity/cli-core` (main's #1062 and #1053). Update mocks accordingly.
Fix stale plugin mock paths and align typegen test assertions with the app dev server output.
# Conflicts: # packages/@sanity/cli/src/actions/manifest/extractManifest.ts # packages/@sanity/cli/src/commands/manifest/extract.ts
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
* refactor(workbench): drop reactRefreshHost plumbing now that federation owns HMR With `dev.remoteHmr: true` landing in `@module-federation/vite` (via workbench PR sanity-io/workbench#208), the federation plugin wires Fast Refresh through the host automatically. The workbench port no longer needs to leak from `devAction` down through `start{Studio,App}DevServer` → `startDevServer` → `getViteConfig` into `@vitejs/plugin-react`. Removing that field exposed `workbenchAvailable` as the last piece of workbench-derived state on `DevActionOptions`, used only to suppress a URL log suffix in the leaf starters. Hoisted that output into `devAction`, which already owns the "Workbench dev server started at …" line — all dev-server output formatting now lives in one place. Net: the build pipeline has zero awareness of whether a workbench host exists. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore: remove .__mf__temp gitignore entry The federation pipeline no longer creates `.__mf__temp` directories, so the gitignore entry (and the test asserting it gets scaffolded) are obsolete. Removes the entry from the template gitignore, the federated fixture, and the bootstrap test, and drops the changeset that introduced the entry since the change is no longer shipping. * fix(workbench): restore dev-server startup log lines The reactRefreshHost cleanup also dropped the "App dev server started on port X" and "...ms and running at http://..." lines from the leaf starters and replaced them with a single "${label} dev server started at ${appUrl}" line in devAction. That changed user-visible text and broke dev.test.ts on every shard. Restore the original log lines (and the workbenchAvailable plumbing they depend on for the no-workbench branch). The reactRefreshHost removal stays untouched — build pipeline still has zero awareness of workbench hosts. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> * chore(deps): bump @sanity/federation to 0.1.0-alpha.8 * test(cli): opt out of @module-federation/vite test-env guard in federated build test --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Description
Note
Please ignore this PR. It's just open to have visibility into the state of the feature branch.
What to review
Testing
Notes for release