SIGN IN SIGN UP

fix: avoid workspace state parse crashes (#12094)

* fix: avoid workspace state parse crashes

* fix(workspace-state): write workspace state atomically

Port the atomic-write half of the pnpm fix for #12020 to pacquet.
pacquet's install/add/update/remove all call update_workspace_state,
and the on-disk file is shared with the pnpm CLI, so a non-atomic
fs::write could leave a torn file that a concurrent `pnpm run` reads
and crashes on. Write to a temp file in the same directory and rename
it into place, mirroring pnpm's switch to write-file-atomic.

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
Q
qybaihe committed
37669c200d3fff2db20a032bc092ed7dc797be45
Parent: 118e9be
Committed by GitHub <noreply@github.com> on 6/1/2026, 1:57:41 PM