Files
pnpm/package.json
T
Zoltan Kochan aa8d0ab9af feat(run): task concurrency groups with machine-wide limits (#15010)
Add task concurrency groups to pnpm v12. A task in pnpm-workspace.yaml
names a `concurrencyGroup`, and `concurrencyGroups` gives each group a
limit: at most that many tasks of the group run at once on the machine,
counted across every pnpm process. A task past the limit waits for a
running one to finish and prints who holds the slots.

A group's pool is N slot files under `<stateDir>/run-slots/<group>/`. A
task takes an exclusive advisory lock on one in `run_stages` and holds it
for every stage of its script, so the single-project run, the recursive
run, and the tasks a `pnpm pipeline` runs in-process are all counted,
each project's task separately. The operating system releases the lock
when the holder ends, however it ends, so a killed holder never leaves a
stale slot. `pnpm exec` names no task and is not gated.

A holder lists its group in `PNPM_HELD_CONCURRENCY_GROUPS` for the
scripts it spawns. A nested `pnpm run` of a task in the same group runs
under the slot its parent holds, which is what keeps a script that calls
`pnpm run` from waiting on itself under a limit of one.

`concurrencyGroups` merges entry by entry across the configuration
layers, so a machine can lower one group's limit through
`PNPM_CONFIG_CONCURRENCY_GROUPS` without restating the rest.

Every process that is meant to be counted has to start as
`pnpm <script>`, so the root manifest gains scripts that wrap the just
recipes and node scripts (`test:rust`, `test:rust-affected`,
`test:rust-smoke`, `check:rust`, `lint:rust`, `ready:rust`,
`pre-push:rust`), the pre-push hook runs its Rust checks through one,
and the agent guide, the testing-changes skill, and the contributing
guide name the pnpm scripts first.

This repository's own task declarations wait for a pnpm release that
knows the field: the pinned CLI rejects an unknown task setting, so
adding `concurrencyGroup` to pnpm-workspace.yaml now would break every
command for it.
2026-09-17 13:38:21 +02:00

97 lines
5.1 KiB
JSON

{
"name": "monorepo-root",
"private": true,
"scripts": {
"bump": "node pnpm11/__utils__/scripts/src/bump.ts",
"prepare": "husky",
"pretest": "pn compile-only && pn prepare-fixtures",
"prepare-fixtures": "pn --dir=pnpm11/__fixtures__ prepareFixtures",
"lint": "pn spellcheck && pn lint:meta && pn check:versioning && pn lint:ts",
"spellcheck": "cspell \"**/*.ts\" \"**/README.md\" \".changeset/*.md\" --no-progress",
"lint:ts": "eslint \"**/src/**/*.ts\" \"**/test/**/*.ts\" --cache --concurrency auto",
"test-all": "pn pretest && pn lint && pn test-pkgs-all",
"ci:test-all": "pn prepare-fixtures && pn test-pkgs-all-report-summary",
"remove-temp-dir": "shx rm -rf ../pnpm_tmp",
"test-pkgs-all": "pn remove-temp-dir && pn --no-sort --workspace-concurrency=1 -r .test",
"test-pkgs-all-report-summary": "pn remove-temp-dir && pn --no-sort --workspace-concurrency=1 -r --report-summary .test",
"test-branch": "pn pretest && pn lint && git remote set-branches --add origin main && git fetch origin main && pn test-pkgs-branch",
"ci:test-branch": "pn prepare-fixtures && pn test-pkgs-branch",
"test-pkgs-branch": "pn remove-temp-dir && pn --workspace-concurrency=1 --filter=...[origin/main] --no-sort --if-present .test",
"compile-only": "tsgo --build pnpm11/workspace/workspace-manifest-reader pnpm11/workspace/projects-reader && pnx node@runtime:26.8.2 pnpm11/__utils__/scripts/src/typecheck-only.ts && pn -F=pnpm compile",
"compile": "pn compile-only && pn update-manifests",
"build:pnpm": "cargo build --release --bin pnpm",
"ready:rust": "just ready",
"test:rust": "node pnpm/scripts/run-rust-tests.mjs",
"test:rust-affected": "node pnpm/scripts/test-affected.mjs",
"test:rust-smoke": "node pnpm/scripts/run-rust-tests.mjs --profile smoke",
"check:rust": "just check",
"lint:rust": "just lint",
"fix:rust": "just fix",
"pre-push:rust": "bash pnpm/scripts/pre-push-rust.sh",
"make-lcov": "shx mkdir -p coverage && lcov-result-merger 'pnpm11/**/coverage/lcov.info' 'coverage/lcov.info'",
"update-manifests": "pn meta-updater && pn install",
"meta-updater": "pn --filter=@pnpm-private/updater compile && pn exec meta-updater",
"lint:meta": "pn meta-updater --test",
"check:versioning": "tsgo --build pnpm11/__utils__/scripts && node pnpm11/__utils__/scripts/lib/check-versioning-invariants.js",
"copy-artifacts": "node pnpm11/__utils__/scripts/src/copy-artifacts.ts",
"make-release-description": "pn --filter=@pnpm/get-release-text run write-release-text",
"check:npm-signing-keys": "node pnpm11/deps/security/signatures/scripts/update-npm-signing-keys.mjs",
"update:npm-signing-keys": "node pnpm11/deps/security/signatures/scripts/update-npm-signing-keys.mjs --update",
"check:node-release-keys": "node pnpm11/crypto/shasums-file/scripts/update-node-release-keys.mjs",
"update:node-release-keys": "node pnpm11/crypto/shasums-file/scripts/update-node-release-keys.mjs --update",
"release": "pn --filter=@pnpm/exe run build-artifacts && pn --filter=@pnpm/exe publish --tag=next-11 --access=public --provenance && pn publish --filter=!pnpm --filter=!@pnpm/exe --access=public --provenance && pn publish --filter=pnpm --tag=next-11 --access=public --provenance",
"dev-setup": "pn -C=./pnpm11/pnpm/dev link -g",
"ci:compile": "pn compile-only",
"ci:lint": "pn lint",
"ci:test-chunk": "node .github/scripts/run-ts-tests-chunk.mjs",
"ci:rust-test": "just test-pacquet",
"ci:pnpr-test": "just test-pnpr",
"ci:rust-clippy": "cargo clippy --locked --workspace --all-targets -- -D warnings",
"ci:rust-doc": "cargo doc --no-deps --workspace --document-private-items",
"ci:rust-deny": "cargo deny check",
"ci:rust-fmt": "node pnpm/scripts/rustfmt.mjs --all -- --check",
"ci:toml-fmt": "taplo format --check",
"ci:rust-dylint": "cargo dylint --all -- --all-targets --workspace",
"ci:build-pnpr": "cargo build --locked --release -p pnpr --bin pnpr -p pnpr-fixtures --bin pnpr-prepare"
},
"devDependencies": {
"@commitlint/cli": "catalog:",
"@commitlint/config-conventional": "catalog:",
"@commitlint/prompt-cli": "catalog:",
"@pnpm/eslint-config": "workspace:*",
"@pnpm/jest-config": "workspace:*",
"@pnpm/meta-updater": "catalog:",
"@pnpm/tgz-fixtures": "catalog:",
"@pnpm/tsconfig": "workspace:*",
"@types/jest": "catalog:",
"@types/node": "catalog:",
"@types/picomatch": "catalog:",
"@typescript/native-preview": "catalog:",
"c8": "catalog:",
"cross-env": "catalog:",
"cspell": "catalog:",
"eslint": "catalog:",
"eslint-plugin-regexp": "catalog:",
"husky": "catalog:",
"jest": "catalog:",
"keyv": "catalog:",
"lcov-result-merger": "catalog:",
"rimraf": "catalog:",
"shx": "catalog:",
"typescript": "catalog:"
},
"packageManager": "pnpm@12.4.2",
"devEngines": {
"packageManager": {
"name": "pnpm",
"version": "12.4.2",
"onFail": "download"
},
"runtime": {
"name": "node",
"version": "26.8.2",
"onFail": "download"
}
}
}