diff --git a/.changeset/icy-shoes-rest.md b/.changeset/icy-shoes-rest.md new file mode 100644 index 0000000000..12e43e135d --- /dev/null +++ b/.changeset/icy-shoes-rest.md @@ -0,0 +1,5 @@ +--- +"@pnpm/deps.graph-builder": patch +--- + +Add a JSDoc for the `lockfileToDepGraph` function. diff --git a/deps/graph-builder/src/lockfileToDepGraph.ts b/deps/graph-builder/src/lockfileToDepGraph.ts index 96a59d3dc1..4d4713d313 100644 --- a/deps/graph-builder/src/lockfileToDepGraph.ts +++ b/deps/graph-builder/src/lockfileToDepGraph.ts @@ -93,6 +93,15 @@ export interface LockfileToDepGraphResult { pkgLocationsByDepPath?: Record } +/** + * 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,