Files
pnpm/workspace/state/package.json
qybaihe 37669c200d 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>
2026-06-01 15:57:41 +02:00

59 lines
1.6 KiB
JSON

{
"name": "@pnpm/workspace.state",
"version": "1100.0.17",
"description": "Track the list of actual paths of workspace packages in a cache",
"keywords": [
"pnpm",
"pnpm11",
"mtime"
],
"license": "MIT",
"funding": "https://opencollective.com/pnpm",
"repository": "https://github.com/pnpm/pnpm/tree/main/workspace/state",
"homepage": "https://github.com/pnpm/pnpm/tree/main/workspace/state#readme",
"bugs": {
"url": "https://github.com/pnpm/pnpm/issues"
},
"type": "module",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"exports": {
".": "./lib/index.js"
},
"files": [
"lib",
"!*.map"
],
"scripts": {
"test": "pn compile && pn .test",
"lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
"prepublishOnly": "tsgo --build",
"compile": "tsgo --build && pn lint --fix",
".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
},
"dependencies": {
"@pnpm/catalogs.types": "workspace:*",
"@pnpm/config.reader": "workspace:*",
"@pnpm/types": "workspace:*",
"ramda": "catalog:",
"write-file-atomic": "catalog:"
},
"peerDependencies": {
"@pnpm/logger": "catalog:"
},
"devDependencies": {
"@jest/globals": "catalog:",
"@pnpm/logger": "workspace:*",
"@pnpm/prepare": "workspace:*",
"@pnpm/workspace.state": "workspace:*",
"@types/ramda": "catalog:",
"@types/write-file-atomic": "catalog:"
},
"engines": {
"node": ">=22.13"
},
"jest": {
"preset": "@pnpm/jest-config"
}
}