Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .changeset/assist-field-group-reset.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
'@sanity/assist': patch
"@sanity/assist": patch
---
Comment on lines 1 to 3

Keep the document's selected field group from resetting while editing AI Assist instructions. The instruction inspector no longer overwrites the host document pane's `path` param, so working with AI Assist inputs preserves the active field group tab.
10 changes: 10 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -436,6 +436,16 @@ pnpm add lodash-es
pnpm add lodash
```

**Catalog shared dependencies**

When a dependency is used by more than one package (two or more), manage its version in the pnpm [catalog](https://pnpm.io/catalogs) instead of repeating a literal range in each `package.json`:

1. Add the dependency and its version range to the default `catalog:` in `pnpm-workspace.yaml`.
2. Reference it from each `package.json` as `"dep-name": "catalog:"`.
3. Shared studio peers (`react`, `react-dom`, `sanity`, `styled-components`) use the named `peer` catalog (`catalog:peer`) — see above. For other cases where one package must stay on a different major than the rest, add a named catalog and reference it with `catalog:<name>`.

Leave niche one-off peers and `workspace:` protocol deps as they are. `pnpm add` runs with `catalogMode: prefer` (set in `pnpm-workspace.yaml`), so adding a dependency that already exists in a catalog reuses the catalog version automatically. pnpm has no built-in "used N times" enforcement, so apply this rule whenever you add or move shared dependencies.

### Formatting

We use [oxfmt](https://oxc.rs/docs/formatter.html):
Expand Down
2 changes: 2 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ catalogs:
sanity: ^5 || ^6.0.0-0
styled-components: ^6.1

# When running `pnpm add`, reuse a dependency's catalog version automatically if
# it already exists in a catalog, so shared deps stay aligned on a single version.
catalogMode: prefer
dedupeDirectDeps: true

Expand Down