-
Notifications
You must be signed in to change notification settings - Fork 666
[lockfile-explorer] Rewrite lockfile parser to be more correct #5363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…eatePackageLockfileEntry()
…all the snapshots
| const rootRelativePath: Path | null = new Path('.').relative( | ||
| new Path(containingEntry.packageJsonFolderPath).concat(relativePath) | ||
| const rootRelativePath: string = lockfilePath.getAbsolute( | ||
| containingEntry.packageJsonFolderPath, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least as of pnpm@8, link: protocol paths are only resolved relative to the package.json section if encountered in importers:. If encountered in packages:, they are resolved relative to the pnpm workspace root.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. I guess those semantics are unavoidable, since the package.json folder location is nondeterministic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Repro here: octogonz/lockfile-explorer-edge-cases@e586bbb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fix: octogonz@6bebad4
…fixes3 # Conflicts: # common/config/subspaces/default/repo-state.json
Summary
Overhaul the lfxGraphLoader.ts, fixing a number of parser bugs in the process.
Details
@lifaon/pathdependency, replacing it with simple/fast handcoded functions. The key point is that we are manipulating well-behaved YAML strings, not actual filesystem paths.@pnpm/lockfile.types"."entryHow it was tested
Impacted documentation
None
@william2958 @iclanton