Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c47e68c
feat: workbench dev server (#770)
gu-stav Mar 24, 2026
bfb48f8
feat(dev): forward CLI config organization id to workbench runtime (#…
gu-stav Apr 9, 2026
b5c11d0
feat: add federation vite plugin (#826)
joshuaellis Apr 9, 2026
94e946c
feat: improve warmup files when federation is enabled (#906)
joshuaellis Apr 9, 2026
d6481c8
fix: update lockfile
gu-stav Apr 10, 2026
2964984
feat(dev): enable react-refresh for shared dev-server HMR [SDK-1187] …
joshuaellis Apr 10, 2026
a6c01d8
chore(deps): bump @sanity/federation from 0.1.0-alpha.2 to 0.1.0-alpha.3
gu-stav Apr 10, 2026
3c630cd
fix(workbench): require `sanity/workbench` and no `@sanity/workbench`…
gu-stav Apr 10, 2026
ab7cd8a
feat(federation): pass additional props to federation plugin (#918)
joshuaellis Apr 10, 2026
bc7d3c6
chore: add changeset for cli-core
joshuaellis Apr 10, 2026
9a96153
fix(dev): disable strict ports for applications (#930)
gu-stav Apr 13, 2026
fba09f5
ci: auto-release dist tag for feature branch (#931)
gu-stav Apr 13, 2026
1cd3a9b
feat(workbench): support only running one workbench instance and find…
joshuaellis Apr 15, 2026
4babd9d
fix: remove load-in-dashboard flag from dev command
joshuaellis Apr 15, 2026
86a1e3f
fix(workbench): propagate staging env to workbench dev server (#964)
joshuaellis Apr 16, 2026
6810b9a
fix: update snapshot release workflow (#965)
gu-stav Apr 16, 2026
a8d7c08
chore(workflow): ensure we NEVER have the ability to do PROD release
joshuaellis Apr 16, 2026
a9b1567
fix(workbench): externalize sanity and @sanity/workbench (#971)
gu-stav Apr 17, 2026
4a0d4c7
fix(workbench): use the same clock for workbench lock (#972)
gu-stav Apr 17, 2026
8e50a77
fix(federation): align fixture react/styled-components with main
joshuaellis Apr 17, 2026
fa6fdcd
feat(workbench): resolve organization id from project [SDK-1277] (#973)
joshuaellis Apr 17, 2026
1ef26fa
feat(init): add promt for federation (#988)
gu-stav Apr 21, 2026
03e3a39
fix(init): types for federation prompt (#989)
gu-stav Apr 21, 2026
8e8ea3d
chore(cli): bump @sanity/federation to 0.1.0-alpha.6 (#990)
joshuaellis Apr 21, 2026
5b982eb
feat(workbench): extend local application payloads (#987)
gu-stav Apr 21, 2026
bc66408
feat(init): use `workbench` dist-tag for `sanity` package (#992)
gu-stav Apr 22, 2026
7f496fb
fix(init): do not resolve dist tags (#1000)
gu-stav Apr 22, 2026
cec3c8c
feat(dev): extract manifests for local applications (#997)
gu-stav Apr 23, 2026
c5a21e6
fix: recover workbench rebase
gu-stav May 7, 2026
cb5dbca
fix: update lockfile
gu-stav May 7, 2026
5cdbbae
fix(cli): apply user vite config to federation builds [SDK-1281] (#1005)
joshuaellis Apr 23, 2026
0987f92
fix(workbench): remove warmup for dependencies (#1047)
gu-stav May 5, 2026
4418327
fix: pass `--no-federation` to all e2e tests
gu-stav May 5, 2026
e5e92de
feat(init): add --federation CLI flag
gu-stav May 7, 2026
26c89ac
fix(workbench): prune stale lock files (#1057)
gu-stav May 8, 2026
de55f71
refactor: reorganise branch additions in a coherent way (#1064)
joshuaellis May 8, 2026
e484b23
fix(workbench): throw error on invalid `SANITY_INTERNAL_WORKBENCH_REM…
gu-stav May 8, 2026
773e0a2
fix(workbench): detect PID reuse on Windows via PowerShell (#1067)
gu-stav May 11, 2026
98596ad
fix: post-rebase compile + test fixes
gu-stav May 20, 2026
007a278
chore: regenerate pnpm-lock.yaml after rebase
gu-stav May 20, 2026
fcf69a8
chore: apply formatting
gu-stav May 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/bump-federation-alpha-6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sanity/cli": patch
---

bump @sanity/federation to 0.1.0-alpha.6
5 changes: 5 additions & 0 deletions .changeset/clear-dragons-search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sanity/cli-core': minor
---

Add federation to CLI config
5 changes: 5 additions & 0 deletions .changeset/fancy-cycles-strive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@sanity/cli": patch
---

externalize sanity and @sanity/workbench
6 changes: 6 additions & 0 deletions .changeset/pr-1000.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': patch
---

do not resolve dist tags
6 changes: 6 additions & 0 deletions .changeset/pr-1005.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': patch
---

apply user vite config to federation builds [SDK-1281]
7 changes: 7 additions & 0 deletions .changeset/pr-1022.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- auto-generated -->
---
'@sanity/cli-core': patch
'@sanity/cli': patch
---

watch for changes of the cli config file
6 changes: 6 additions & 0 deletions .changeset/pr-1027.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': patch
---

forward CLI project id for local applications
6 changes: 6 additions & 0 deletions .changeset/pr-1028.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': patch
---

fix(workbench): add `__mf__temp` directory to .gitignore
6 changes: 6 additions & 0 deletions .changeset/pr-1042.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': patch
---

perf(workbench): preload workbench and warmup dev-server files
6 changes: 6 additions & 0 deletions .changeset/pr-1047.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': patch
---

fix(workbench): remove warmup for dependencies
6 changes: 6 additions & 0 deletions .changeset/pr-1057.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': patch
---

fix(workbench): prune stale lock files
6 changes: 6 additions & 0 deletions .changeset/pr-1066.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': patch
---

fix(workbench): throw error on invalid `SANITY_INTERNAL_WORKBENCH_REMOTE_URL`
6 changes: 6 additions & 0 deletions .changeset/pr-1067.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': patch
---

fix(workbench): detect PID reuse on Windows via PowerShell
5 changes: 5 additions & 0 deletions .changeset/pr-770.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sanity/cli': minor
---

Enforce single workbench instance with dev-server registry, fix PID-reuse detection and signal cleanup
5 changes: 5 additions & 0 deletions .changeset/pr-905.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sanity/cli': minor
---

Support passing organization ID to the workbench dev server
5 changes: 5 additions & 0 deletions .changeset/pr-930.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sanity/cli': patch
---

Prevent dev server from failing to start when the default port is already in use
6 changes: 6 additions & 0 deletions .changeset/pr-964.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': patch
---

propagate staging env to workbench dev server
5 changes: 5 additions & 0 deletions .changeset/pr-972.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sanity/cli': patch
---

use the same clock for workbench locks
6 changes: 6 additions & 0 deletions .changeset/pr-988.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': minor
---

add promt for federation
6 changes: 6 additions & 0 deletions .changeset/pr-989.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': patch
---

types for federation promt
6 changes: 6 additions & 0 deletions .changeset/pr-992.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': minor
---

use `workbench` dist-tag for `sanity` package
6 changes: 6 additions & 0 deletions .changeset/pr-997.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- auto-generated -->
---
'@sanity/cli': minor
---

extract manifests for local applications
5 changes: 5 additions & 0 deletions .changeset/sdk-1277-workbench-resolve-org-id.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sanity/cli': minor
---

Resolve the workbench organization ID from the configured project when `app.organizationId` is not set in the CLI config
5 changes: 5 additions & 0 deletions .changeset/workbench-pass-appid.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sanity/cli': minor
---

Workbench now displays each local application's title and icon and can match local applications to their remote counterparts by ID.
75 changes: 7 additions & 68 deletions .github/workflows/snapshot-release.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
name: Snapshot Release

on:
push:
branches:
# Note: this needs to be removed before the feature branch gets merged to main
- feat/workbench
workflow_dispatch:
inputs:
tag:
description: 'npm dist-tag for the snapshot release'
required: false
default: 'snapshot'
# TODO: revert to "snapshot" before the feature branch gets merged to main
default: 'workbench'
type: string
forceBump:
description: 'Force a version bump for all packages'
Expand Down Expand Up @@ -58,83 +63,17 @@ jobs:

- name: Configure npm registry
run: echo '//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}' > .npmrc

- name: Generate changeset for all packages
if: ${{ inputs.forceBump != 'false' }}
run: |
PACKAGES=$(pnpm ls -r --json --depth -1 | jq -r '.[] | select(.private != true) | .name')
{
echo '---'
for pkg in $PACKAGES; do
echo "'${pkg}': ${{ inputs.forceBump }}"
done
echo '---'
echo ''
echo 'Force snapshot release'
} > .changeset/force-snapshot.md

- name: Create snapshot versions
if: ${{ inputs.forceBump == 'false' }}
run: pnpm changeset version --snapshot
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}

- name: Create release versions
if: ${{ inputs.forceBump != 'false' }}
run: pnpm changeset version
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}

- name: Commit and push version changes
if: ${{ inputs.forceBump != 'false' }}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git"
git add -A
git commit -m "chore: version packages"
git push origin HEAD:${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}

- name: Build packages
run: pnpm run build:cli

- name: Publish snapshot packages
if: ${{ inputs.forceBump == 'false' }}
run: pnpm changeset publish --tag "$DIST_TAG" 2>&1 | tee publish-output.txt
run: pnpm changeset publish --tag "workbench" 2>&1 | tee publish-output.txt
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Snapshot publish ignores user-provided dist-tag input

Medium Severity

The pnpm changeset publish command hardcodes --tag "workbench" instead of using the $DIST_TAG environment variable (which is still set from inputs.tag on the next line). Any workflow_dispatch invocation with a custom tag value will be silently ignored, and packages will always be published under the workbench dist-tag. The forceBump input definition also remains but all steps that referenced it were removed, making it dead configuration.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 007a278. Configure here.

env:
DIST_TAG: ${{ inputs.tag }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- name: Publish release packages
if: ${{ inputs.forceBump != 'false' }}
run: pnpm changeset publish 2>&1 | tee publish-output.txt
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NPM_CONFIG_PROVENANCE: true

- name: Push tags and create GitHub releases
if: ${{ inputs.forceBump != 'false' }}
run: |
git push origin --tags
for tag in $(git tag --points-at HEAD); do
gh release create "$tag" --generate-notes
done
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}

- name: Summary
run: |
echo "## Snapshot Release" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**dist-tag:** \`${{ inputs.tag }}\`" >> $GITHUB_STEP_SUMMARY
echo "**branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
echo "**commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Published packages" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
grep 'New tag:' publish-output.txt >> $GITHUB_STEP_SUMMARY || echo "No packages published" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
31 changes: 31 additions & 0 deletions fixtures/federated-studio/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# Dependencies
/node_modules
/.pnp
.pnp.js

# Compiled Sanity Studio
/dist

# Temporary Sanity runtime, generated by the CLI on every dev server start
/.sanity

# Logs
/logs
*.log

# Coverage directory used by testing tools
/coverage

# Misc
.DS_Store
*.pem

# Typescript
*.tsbuildinfo

# Dotenv and similar local-only files
*.local

.__mf__temp
24 changes: 24 additions & 0 deletions fixtures/federated-studio/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "federated-studio",
"version": "1.0.0",
"private": true,
"keywords": [
"sanity"
],
"license": "MIT",
"type": "module",
"scripts": {
"dev": "sanity dev",
"build:fixture": "sanity build"
},
"dependencies": {
"react": "^19.2.5",
"react-dom": "^19.2.5",
"sanity": "catalog:",
"styled-components": "^6.4.0"
},
"devDependencies": {
"@types/react": "^19.2.14",
"typescript": "^5.9.3"
}
}
14 changes: 14 additions & 0 deletions fixtures/federated-studio/sanity.cli.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {defineCliConfig} from 'sanity/cli'

export default defineCliConfig({
api: {
dataset: 'test',
projectId: 'ppsg7ml5',
},
deployment: {
autoUpdates: true,
},
federation: {
enabled: true,
},
})
17 changes: 17 additions & 0 deletions fixtures/federated-studio/sanity.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'

import {schemaTypes} from './schemaTypes'

export default defineConfig({
title: 'Basic Studio',

dataset: 'test',
projectId: 'ppsg7ml5',

plugins: [structureTool()],

schema: {
types: schemaTypes,
},
})
1 change: 1 addition & 0 deletions fixtures/federated-studio/schemaTypes/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const schemaTypes = []
17 changes: 17 additions & 0 deletions fixtures/federated-studio/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "ES2017",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "Preserve",
"moduleDetection": "force",
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
},
"include": ["**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
}
1 change: 1 addition & 0 deletions packages/@sanity/cli-core/src/_exports/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export {type Output, type SanityOrgUser} from '../types.js'
export {doImport} from '../util/doImport.js'
export * from '../util/environment/mockBrowserEnvironment.js'
export * from '../util/getLocalPackageVersion.js'
export * from '../util/getSanityConfigDir.js'
export * from '../util/getSanityEnvVar.js'
export * from '../util/getSanityUrl.js'
export * from '../util/importModule.js'
Expand Down
Loading
Loading