@pnpm/prune-lockfile
Advanced tools
Comparing version 6.0.2 to 6.1.0
import { type Lockfile } from '@pnpm/lockfile-types'; | ||
import { type PackageManifest } from '@pnpm/types'; | ||
import { type DepPath, type PackageManifest } from '@pnpm/types'; | ||
export * from '@pnpm/lockfile-types'; | ||
type DependenciesGraph = Record<DepPath, { | ||
optional?: boolean; | ||
}>; | ||
export declare function pruneSharedLockfile(lockfile: Lockfile, opts?: { | ||
dependenciesGraph?: DependenciesGraph; | ||
warn?: (msg: string) => void; | ||
}): Lockfile; | ||
export declare function pruneLockfile(lockfile: Lockfile, pkg: PackageManifest, importerId: string, opts?: { | ||
export declare function pruneLockfile(lockfile: Lockfile, pkg: PackageManifest, importerId: string, opts: { | ||
warn?: (msg: string) => void; | ||
dependenciesGraph?: DependenciesGraph; | ||
}): Lockfile; |
@@ -35,2 +35,3 @@ "use strict"; | ||
warn: opts?.warn ?? ((msg) => undefined), | ||
dependenciesGraph: opts?.dependenciesGraph, | ||
}); | ||
@@ -123,2 +124,3 @@ const prunedLockfile = { | ||
warn: opts.warn, | ||
dependenciesGraph: opts.dependenciesGraph, | ||
}; | ||
@@ -159,2 +161,5 @@ copyDependencySubGraph(ctx, opts.devDepPaths, { | ||
depLockfile.optional = true; | ||
if (ctx.dependenciesGraph?.[depPath]) { | ||
ctx.dependenciesGraph[depPath].optional = true; | ||
} | ||
} | ||
@@ -164,2 +169,5 @@ else { | ||
delete depLockfile.optional; | ||
if (ctx.dependenciesGraph?.[depPath]) { | ||
ctx.dependenciesGraph[depPath].optional = false; | ||
} | ||
} | ||
@@ -166,0 +174,0 @@ const newDependencies = resolvedDepsToDepPaths(depLockfile.dependencies ?? {}); |
{ | ||
"name": "@pnpm/prune-lockfile", | ||
"version": "6.0.2", | ||
"version": "6.1.0", | ||
"description": "Prune a pnpm-lock.yaml", | ||
@@ -29,3 +29,3 @@ "main": "lib/index.js", | ||
"yaml-tag": "1.1.0", | ||
"@pnpm/prune-lockfile": "6.0.2" | ||
"@pnpm/prune-lockfile": "6.1.0" | ||
}, | ||
@@ -32,0 +32,0 @@ "dependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16888
189