chore: document how lockfileToDepGraph returns a partial graph (#9806)

This commit is contained in:
Brandon Cheng
2025-07-30 05:35:14 -04:00
committed by GitHub
parent 9908269a12
commit e9b589cd5f
2 changed files with 14 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
---
"@pnpm/deps.graph-builder": patch
---
Add a JSDoc for the `lockfileToDepGraph` function.

View File

@@ -93,6 +93,15 @@ export interface LockfileToDepGraphResult {
pkgLocationsByDepPath?: Record<string, string[]>
}
/**
* Generate a dependency graph from lockfiles.
*
* If a current lockfile is provided, this function only includes new or changed
* packages in the graph. In other words, the graph returned will be a set
* subtraction of the packages in the wanted lockfile minus the current
* lockfile. This behavior can be configured with the `includeUnchangedDeps`
* option.
*/
export async function lockfileToDepGraph (
lockfile: LockfileObject,
currentLockfile: LockfileObject | null,