feat(workbench): merge app group + priority into the core-app manifest#1146
feat(workbench): merge app group + priority into the core-app manifest#1146gu-stav wants to merge 3 commits into
Conversation
Carries dock placement from `unstable_defineApp({ group, priority })` into
the core-app manifest, so it deploys and — for local `sanity dev` apps —
rides the existing dev-server registry → workbench websocket. Editing
group/priority in `sanity.cli.ts` re-extracts the manifest and the dock
re-sorts live, no restart (the watcher/registry/ws path already handles
manifest changes). `priority: 0` is preserved (not dropped as falsy).
|
Claude finished @gu-stav's task in 2m 21s —— View job Claude PR Review
Issues1. The export default defineCliConfig({app: {group: 'dock.system', priority: 20, title: 'My App'}})without Pick one:
The first option is cheaper and matches the type. Fix this → 2. Missing changeset — this PR adds public type surface ( ---
'@sanity/cli-core': minor
'@sanity/cli': minor
---
Add `app.group` and `app.priority` to `unstable_defineApp` to control dock placement and sort order for core apps.3. Type asymmetry between config and manifest — Notes
|
📦 Bundle Stats —
|
| Metric | Value | vs feat/workbench-define-app-name (c496368) |
|---|---|---|
| Internal (raw) | 2.4 KB | - |
| Internal (gzip) | 922 B | - |
| Bundled (raw) | 11.08 MB | - |
| Bundled (gzip) | 2.08 MB | - |
| Import time | 855ms | -35ms, -4.0% |
bin:sanity
| Metric | Value | vs feat/workbench-define-app-name (c496368) |
|---|---|---|
| Internal (raw) | 1023 B | - |
| Internal (gzip) | 486 B | - |
| Bundled (raw) | 9.84 MB | - |
| Bundled (gzip) | 1.77 MB | - |
| Import time | 2.04s | +20ms, +1.0% |
🗺️ 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 feat/workbench-define-app-name (c496368b)
| Metric | Value | vs feat/workbench-define-app-name (c496368) |
|---|---|---|
| Internal (raw) | 102.3 KB | - |
| Internal (gzip) | 24.7 KB | - |
| Bundled (raw) | 21.75 MB | - |
| Bundled (gzip) | 3.45 MB | - |
| Import time | 802ms | +2ms, +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 — create-sanity
Compared against feat/workbench-define-app-name (c496368b)
| Metric | Value | vs feat/workbench-define-app-name (c496368) |
|---|---|---|
| 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 35 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@4265702 <command>...Or upgrade project dependencies📦
|
The CLI side of US2 — dock placement (
002-workbench-extension-api), stacked on #1143. Companion to workbench PR #235.Carries
group/priorityfromunstable_defineAppinto the core-app manifest:coreAppManifestSchema+CliConfig.apptype gaingroup/priority.extractCoreAppManifestmerges them alongsidetitle/icon(priority: 0preserved, not dropped as falsy).For local
sanity devapps this rides the existing path with no new wiring: the config watcher re-extracts the manifest onsanity.cli.tsedits →registration.updaterewrites the dev-server registry entry →watchRegistry→ws.send('sanity:workbench:local-applications'). So editing group/priority live re-sorts the dock without a restart (FR-024). The registry validates against the same extendedcoreAppManifestSchema, so the fields aren't stripped.Added unit coverage in
extractCoreAppManifest.test.ts(merge +priority: 0).Note: the workbench canaries declaring
group/priority(and clean cross-repo types) need this CLI to ship its@sanity/federationbump first — until then the workbench side keeps that as local WIP.