…anity-io#2048)
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
Puts this repo on the same pnpm version and settings as
[sanity-io/ui](https://github.com/sanity-io/ui) `main`: `packageManager`
`[email protected]`, ui's pnpm settings in `pnpm-workspace.yaml`, ui's CI
setup action (`pnpm/setup@v3`) but with its store cache off, and a
lockfile regenerated with pnpm 12.6.0. The `Dedupe lockfile` workflow
stays, with the one change pnpm 12 needs.
## Builds on sanity-io#2044, supersedes sanity-io#2043, sanity-io#2044 and sanity-io#1131
- **sanity-io#2044** (pnpm 12.6.0 + `autoDedupe` + Vercel CLI bump) is the base.
Its commits are cherry-picked with `-x`. sanity-io#2044's interim
`installCommand` workaround in `dev/e2e-studio/vercel.json`, which it
later removed, is left out, so this PR doesn't touch any Vercel config.
sanity-io#2044 left CI on `pnpm/action-setup` + `actions/setup-node`; this PR
switches to ui's action.
- **sanity-io#2043** (Renovate's plain `packageManager` bump) fails `E2E /
deploy-preview`, because `vercel@57` can't parse pnpm 12's lockfile (see
below).
- **sanity-io#1131** (an early `pnpm/setup@v1` attempt) is covered by the CI
change here.
- **sanity-io#2018** (lockfile regenerated from scratch) is not superseded: it
re-resolves every dependency, which is out of this PR's scope.
## Changes
| | Before | After |
| --- | --- | --- |
| `packageManager` | `[email protected]` | `[email protected]` (as in ui) |
| `pnpm-workspace.yaml` | | `autoDedupe: true` and
`strictPeerDependencies: false` (as in ui) |
| `.github/actions/setup` | `pnpm/action-setup@v6` +
`actions/setup-node@v7` + `pnpm install` | ui's action (`pnpm/setup@v3`,
`runtime: node@lts`) with `cache: false`, where ui has `cache: true` |
| `.github/workflows/pnpm-if-needed.yml` (`Dedupe lockfile`) | runs
`pnpm dedupe` once | kept; runs `pnpm dedupe` twice |
| `vercel` (root devDependency) | `^57.0.0` | `^60.1.3` |
- **Lockfile:** main's lockfile after sanity-io#2039, plus this PR's changes as
pnpm 12.6.0 re-applied them. Those changes are the
`packageManagerDependencies` block, the `[email protected]` tree with the
optional-peer suffixes it brings, and `autoDedupe`'s dedupes: the same
`zod` and `gaxios` ones as the pending sanity-io#2052, plus the peer toggle
described below. No other versions change, and `[email protected]`
stays put. sanity-io#2039's refresh had already removed the three duplicates the
first revision collapsed.
- **Vercel CLI:** pnpm 12 writes the lockfile as two YAML documents.
`vercel@57`'s bundled `@vercel/build-utils` reads only the first, falls
back to npm, and fails on `workspace:*`, which is sanity-io#2043's failure.
`58.9.5` is the first CLI that parses it, and every release from
`58.7.0` on ships without npm provenance (still published from GitHub
Actions OIDC). So `trustPolicy: no-downgrade` needs the exact versions
pnpm reports as `ERR_PNPM_TRUST_DOWNGRADE` in `trustPolicyExclude`:
`[email protected]` and 31 `@vercel/*` packages.
- **CI setup:** `pnpm/setup` reads `packageManager`, installs Node LTS,
runs `pnpm install`, and caches pnpm's lockfile-verification verdict
across jobs, which saves the ~28s supply-chain check. `ailf-eval.yml`
passes `runtime: node@lts` instead of `node-version: lts/*`.
`release.yml` keeps `pnpm/action-setup` + `actions/setup-node`, as in
ui.
- **Store cache off, unlike ui** (commit `bddef7a4`). With `cache:
true`, `pnpm/setup` uploads a new ~645 MiB store entry after every job,
even for an unchanged lockfile, because its keys include the run id.
That was 12 entries (7.7 GB) per push here, evicting the Playwright
browser caches the e2e jobs reuse. With it off, test shards spend 16–19s
in setup and nothing afterwards, against 19–23s plus 9–12s of upload
with it on. ui keeps `cache: true` and has the same issue. Revert
`bddef7a4` to match ui.
- **`Dedupe lockfile` workflow kept, adapted for pnpm 12** (commit
`a7e1057f`). On the current lockfile, pnpm 12.6.0's `pnpm dedupe` isn't
idempotent. Each run toggles `@vitejs/devtools` and
`oxc-transform-react` in the peer suffixes of
`plugins/@sanity/debug-preview-url-secret-plugin`'s `sanity` and
`@sanity/tsdown-config` entries, without changing any version. Run once,
as before, the workflow would open a toggle-only PR after every lockfile
change on `main`, and each automerged dedupe PR would trigger the next.
A second run undoes the toggle and keeps real dedupes. An earlier commit
in this branch deleted the workflow; `82810b5e` reverts that.
- **Docs:** AGENTS.md, CONTRIBUTING.md and README.md now require pnpm
v12. AGENTS.md and `e2e/README.md` explain the two-document lockfile and
the Vercel CLI floor; per Copilot's review of sanity-io#2044, the trust-policy
wording only lists versions that pnpm reports as downgrades. AGENTS.md
also says not to commit lockfile diffs that only flip the peer toggle.
No changeset: no published package's manifest or runtime code changes,
as with the pnpm 11 bump in sanity-io#1579.
## Merge with main
`main` gained one commit after this branch started: Renovate's lock file
maintenance (sanity-io#2039, `cb68d65e`). It conflicted only in `pnpm-lock.yaml`.
`main` is merged in rather than rebased, so nothing was force-pushed.
The resolution takes main's lockfile and lets pnpm 12.6.0 re-apply this
PR's changes; `pnpm-workspace.yaml` needed no further changes. sanity-io#2039's
25 source files merged cleanly.
## What Cody needs to do
- **Add the "🤖 bot" label.** The agent's label tool can't edit PRs in
this repo.
- **Close sanity-io#2044 and sanity-io#1131** when this lands. Renovate autocloses sanity-io#2043.
The pending dedupe PR sanity-io#2052 is redundant, since its four lines are
already in this lockfile. It merges cleanly with this PR in either
order.
- **Vercel:** nothing to set up. No project, env var or `vercel.json`
changes; only the root `vercel` CLI devDependency moves.
- **Secrets and ruleset:** no new secrets, and the required checks
(`lint`, `build`, `test`, Socket) keep their names.
## Open questions
1. **Vercel CLI trust exclusions.** This is sanity-io#2044's call, which
overrides the reason sanity-io#1890 was closed: 32 exact versions without
provenance in `trustPolicyExclude`. Every future `vercel` bump has to
add its own versions, so Renovate's `vercel` PRs will fail their
artifact update until someone does. The alternative is e2e previews that
can't build on pnpm 12.
2. **`strictPeerDependencies: false`** matches ui but is already pnpm's
default; ui carried it over from an old `.npmrc`. Keep it for parity, or
drop it?
3. **Store cache in ui.** ui has the same per-job uploads. Turn its
store cache off too?
## Known pnpm 12.6.0 issue
The peer toggle also shows up locally. A fresh `pnpm install`, or the
implicit install pnpm runs before scripts when `node_modules` looks
stale, flips those two suffixes in `pnpm-lock.yaml`. Frozen installs,
which CI uses, never do. The lockfile before sanity-io#2039 didn't toggle; main's
refreshed resolutions exposed it, and it happens with `autoDedupe` off
too.
## Not in this PR
- vitest 5, oxfmt (sanity-io#2047), oxlint (sanity-io#2049) and the tsdown setup are
sibling PRs. Whichever lands later merges `main` and regenerates the
lockfile.
- ui's `packageExtensions` entry for `@testing-library/jest-dom` belongs
to its vitest 5 setup.
- ui's root `engines.node: ">=22.13"` and macOS test job are Node and
test-matrix changes, not pnpm. Plugins' tooling needs Node ≥ 22.18
anyway (AGENTS.md).
- Plugins-specific pnpm settings that ui doesn't have (`trustPolicy`,
`dedupePeers`, `dedupeDirectDeps`, `publicHoistPattern`) stay.
## Verification
- **Lockfile:** regenerated on `main` at `cb68d65e` by pnpm 12.6.0 run
directly on Node 24.21.0. A cold `pnpm install --frozen-lockfile` passes
the supply-chain check (2,615 entries), and without the Vercel
exclusions it fails with `ERR_PNPM_TRUST_DOWNGRADE`.
- **Dedupe workflow:** from the committed lockfile, from its toggled
state, and from the committed lockfile with sanity-io#2052's duplicates put back,
two `CI=true pnpm dedupe --config.ignore-scripts=true` runs give,
respectively, no change, no change, and exactly sanity-io#2052's dedupes. A
single run gives the toggle every time.
- **Local checks on the merged tree:** `pnpm lint`, `pnpm knip`, `pnpm
build` (52/52 tasks) and `pnpm test run` (224 files, 1,391 tests) pass.
- **CI:** everything passes on `bddef7a4`, including `deploy-preview`
(Vercel CLI 60.1.3 detects the lockfile and installs with pnpm 12.6.0)
and e2e on Chromium and Firefox. CI on `a7e1057f`, which only touches
the dedupe workflow and AGENTS.md, is running.
- **zizmor:** `zizmor .github` reports the same findings as on `main` at
every severity.
<!-- CURSOR_AGENT_PR_BODY_END -->
<div><a
href="https://cursor.com/agents/bc-0c45b56b-fd33-55f7-b22c-89bde73748e4?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a
href="https://cursor.com/background-agent?bcId=bc-0c45b56b-fd33-55f7-b22c-89bde73748e4&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div>
---------
Co-authored-by: Cursor Agent <[email protected]>
Summary
Brings this repo onto the same pnpm major that sanity-io/ui and sanity-io/sanity already run, following ui#2855 (pnpm → v12) and ui#2968 (
autoDedupe+ 12.6.0). Also force-bumps thevercelCLI, which pnpm 12's lockfile format requires.packageManager[email protected][email protected]vercel(root devDependency)^57.0.0^60.1.312.6.0is thelatestdist-tag on npm and the exact version both ui and sanity ship (12.7.0/12.8.0exist only undernext-12).Workspace settings
autoDedupe: trueis the one pnpm 12 setting ui and sanity have that this repo was missing. It was introduced in pnpm 12.6.0, which is why the bump lands at 12.6.0 rather than 12.3.x.Everything else in
pnpm-workspace.yamlis already recognized by pnpm 12 — which matters, because pnpm 12 fails withERR_PNPM_UNRECOGNIZED_WORKSPACE_SETTINGSon an unknown key instead of ignoring it. No catalog pins were touched.Lockfile (pnpm bump)
Three things moved, attributed with throwaway-worktree experiments. No dependency outside Vercel's tree was upgraded.
packageManagerDependenciespreamble (+158 lines) pinning[email protected]and its platform binaries — the same rewrite ui#2855 produced; pnpm 12.6.0 on an otherwise-unmodifiedmainproduces exactly this and nothing else.autoDedupecollapsed three redundant duplicates already in the tree:@sanity/icons5.2.1+5.2.2 → 5.2.2,@sanity/ui4.0.7+4.2.7 → 4.2.7,motion13.1.0+13.4.4 → 13.4.4. No new version introduced; nospecifier:line changed.minimumReleaseAgeExclude/trustPolicyExcludeentries pruned by the prune settings from Enable minimumReleaseAgeExcludePrune + trustPolicyExcludePrune so stale exclude entries are pruned on install/update/remove/dedupe #2024. Triggered byautoDedupe's lockfile rewrite, not by pnpm 12 (those settings only prune on a rewriting install). Every pruned entry was already absent frommain's lockfile.Attribution experiments
mainconfig, non-frozen installmainconfig +packageManagerbump onlypnpm-lock.yaml+158 only,pnpm-workspace.yamlno diffautoDedupe: trueVercel CLI force-bump
pnpm 12 writes
pnpm-lock.yamlas two YAML documents (a leading env document holdingpackageManagerDependencies).[email protected]bundles@vercel/[email protected], which parses it as one document, sovercel buildfell back to npm and died onUnsupported URL Type "workspace:". This failedE2E / deploy-previewon the first run.@vercel/build-utils13.35.0[email protected]cliType: npm❌14.0.1[email protected]cliType: npm❌14.0.5[email protected]cliType: pnpm✅14.13.1[email protected]cliType: pnpm✅The trust-policy trade-off. Every
vercelrelease from58.7.0on, along with its@vercel/*dependencies, ships without npm provenance attestations: Vercel rotated its trusted-publishing OIDC config. These releases still come through GitHub trusted publishing, from the same publisher, but no longer carry attestations.trustPolicy: no-downgraderejects them withERR_PNPM_TRUST_DOWNGRADE, which is why #1890 was closed. This PR deliberately overrides that decision by adding the exact versions totrustPolicyExclude—[email protected]plus 31@vercel/*packages, collected by loopingpnpm installuntil no downgrade remained. A comment inpnpm-workspace.yamlrecords why. No--config.trustPolicyoverride was used.Upkeep this creates: each future
vercelbump must re-add its exact versions (pnpm installnames them oneERR_PNPM_TRUST_DOWNGRADEat a time), whiletrustPolicyExcludePruneretires the old ones. Renovate PRs forvercelwill fail artifact updates until someone does that.The bump is scoped to Vercel's own dependency tree: comparing lockfiles, every changed package is a version added for
vercel@60's dependencies, while existing versions used elsewhere are kept and no package was removed. All flagse2e.ymlpasses (--yes,--environment,--prod,--prebuilt,-m/--meta,--token) still exist in v60.An earlier commit on this PR worked around the issue with an explicit
installCommandindev/e2e-studio/vercel.json. Now that the CLI detects pnpm natively (build-utils 14.13.1 → cliType pnpm, lockfileVersion 9), that override is removed;e2e/README.mdnow documents the58.9.5CLI floor and the exclude upkeep instead.Docs
AGENTS.md,CONTRIBUTING.md, andREADME.mdnow say pnpm v12.AGENTS.mdrecordsautoDedupeand its 12.6.0 floor; the two-document lockfile and why single-document parsers break on it; the older-pnpm-shim gotcha that leavespackageManagerDependenciesunwritten (the one ui#2968 hit); and that exclude pruning only happens on a lockfile-rewriting install.Deliberately not changed
pnpm/action-setup@v6uses are unpinned and readpackageManager; run logs confirmusing pnpm v12.6.0.constraintsentry to update.Dedupe lockfileworkflow: kept; withautoDedupeit should stop finding work.--unsafe-perm: fixed in pnpm 12.3.4, so 12.6.0 is clear.Verification
pnpm install --frozen-lockfilein a fresh clone (pnpm bump)pnpm install --frozen-lockfileafter the vercel bumppnpm lint/pnpm knippnpm buildpnpm testinstallCommandworkaround)Heads-up for
sanity-io/sanityIt is already on
[email protected], pinsvercel: ^57.0.0, and runs the samevercel buildsequence, so it looks exposed to the same failure.