Repository navigation
Fix pnpm 12 lockfile parsing ("Multiple documents are not supported") - #75
Open
maks-oleksyuk wants to merge 1 commit into
Open
maks-oleksyuk wants to merge 1 commit into
maks-oleksyuk wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
maks-oleksyuk
force-pushed
the
pr/pnpm12-multi-document-lockfile
branch
from
November 3, 2026 14:46
ecc719c to
c4ad313
Compare
Author
|
Failed CI runs do not affect the changes that have been made |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pnpm 12 (e.g.
"packageManager": "pnpm@12.17.0") writespnpm-lock.yamlas two YAML documents: the first one pins pnpm itself (packageManagerDependencies), the second one is the regular project lockfile.PnpmPackageLockpasses the whole file toYaml::parse(). Symfony YAML does not support multi-document files by design, so it throwsMultiple documents are not supported at line N (near "---"). Roster then logsFailed to parse pnpm-lock.yamland marks the scanner as failed, so no JS packages are detected for pnpm 12 projects (e.g. Boost no longer sees package versions).Fix
Split the contents on document separators (
/^---\s*$/m), drop empty chunks and parse the last document, which is the project lockfile.Why it doesn't break anything
Tests
Added a pnpm 12 fixture with two documents: the scanner no longer fails,
prettieris detected as a dev dependency, andpnpmis not listed. The test fails without the fix.Verified on a real pnpm 12.17.0 project: 0 → 78 packages detected, all 6 root devDependencies classified correctly.
Unrelated
composer testfailed onrector --dry-runon1.xwith the current Rector 2.8 (NegatedAndsToPositiveOrsRectorinBunPackageLock). Applied the equivalent condition rewrite (!(a && !b)→!a || b) so the full suite passes. Happy to drop it if you'd rather keep this PR focused.🤖 Generated with Claude Code