@pnpm/prune-lockfile
Advanced tools
Comparing version 2.0.14 to 2.0.15
# @pnpm/prune-lockfile | ||
## 2.0.15 | ||
### Patch Changes | ||
- Updated dependencies [d54043ee4] | ||
- Updated dependencies [d54043ee4] | ||
- Updated dependencies [fcdad632f] | ||
- @pnpm/lockfile-types@2.1.0 | ||
- @pnpm/types@6.3.0 | ||
- @pnpm/constants@4.1.0 | ||
- dependency-path@5.0.4 | ||
## 2.0.14 | ||
@@ -4,0 +16,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { Lockfile, PackageSnapshots, ProjectSnapshot } from '@pnpm/lockfile-types'; | ||
import { Lockfile } from '@pnpm/lockfile-types'; | ||
import { PackageManifest } from '@pnpm/types'; | ||
@@ -6,9 +6,5 @@ export * from '@pnpm/lockfile-types'; | ||
warn?: (msg: string) => void; | ||
}): { | ||
packages: PackageSnapshots; | ||
importers: Record<string, ProjectSnapshot>; | ||
lockfileVersion: number; | ||
}; | ||
}): Lockfile; | ||
export declare function pruneLockfile(lockfile: Lockfile, pkg: PackageManifest, importerId: string, opts?: { | ||
warn?: (msg: string) => void; | ||
}): Lockfile; |
@@ -10,3 +10,3 @@ "use strict"; | ||
var __exportStar = (this && this.__exportStar) || function(m, exports) { | ||
for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) __createBinding(exports, m, p); | ||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); | ||
}; | ||
@@ -20,2 +20,3 @@ Object.defineProperty(exports, "__esModule", { value: true }); | ||
function pruneSharedLockfile(lockfile, opts) { | ||
var _a; | ||
const copiedPackages = !lockfile.packages ? {} : copyPackageSnapshots(lockfile.packages, { | ||
@@ -25,3 +26,3 @@ devDepPaths: R.unnest(R.values(lockfile.importers).map((deps) => { var _a; return resolvedDepsToDepPaths((_a = deps.devDependencies) !== null && _a !== void 0 ? _a : {}); })), | ||
prodDepPaths: R.unnest(R.values(lockfile.importers).map((deps) => { var _a; return resolvedDepsToDepPaths((_a = deps.dependencies) !== null && _a !== void 0 ? _a : {}); })), | ||
warn: opts && opts.warn || ((msg) => undefined), | ||
warn: (_a = opts === null || opts === void 0 ? void 0 : opts.warn) !== null && _a !== void 0 ? _a : ((msg) => undefined), | ||
}); | ||
@@ -56,12 +57,13 @@ const prunnedLockfile = { | ||
Object.keys(lockfileSpecs).forEach((depName) => { | ||
var _a, _b, _c; | ||
if (!allDeps.includes(depName)) | ||
return; | ||
specifiers[depName] = lockfileSpecs[depName]; | ||
if (importer.dependencies && importer.dependencies[depName]) { | ||
if ((_a = importer.dependencies) === null || _a === void 0 ? void 0 : _a[depName]) { | ||
lockfileDependencies[depName] = importer.dependencies[depName]; | ||
} | ||
else if (importer.optionalDependencies && importer.optionalDependencies[depName]) { | ||
else if ((_b = importer.optionalDependencies) === null || _b === void 0 ? void 0 : _b[depName]) { | ||
lockfileOptionalDependencies[depName] = importer.optionalDependencies[depName]; | ||
} | ||
else if (importer.devDependencies && importer.devDependencies[depName]) { | ||
else if ((_c = importer.devDependencies) === null || _c === void 0 ? void 0 : _c[depName]) { | ||
lockfileDevDependencies[depName] = importer.devDependencies[depName]; | ||
@@ -138,3 +140,3 @@ } | ||
for (const depPath of depPaths) { | ||
const key = `${depPath}:${opts.optional}:${opts.dev}`; | ||
const key = `${depPath}:${opts.optional.toString()}:${opts.dev.toString()}`; | ||
if (ctx.walked.has(key)) | ||
@@ -141,0 +143,0 @@ continue; |
{ | ||
"name": "@pnpm/prune-lockfile", | ||
"version": "2.0.14", | ||
"version": "2.0.15", | ||
"description": "Prune a pnpm-lock.yaml", | ||
@@ -8,3 +8,3 @@ "main": "lib/index.js", | ||
"engines": { | ||
"node": ">=10.13" | ||
"node": ">=10.16" | ||
}, | ||
@@ -16,3 +16,3 @@ "files": [ | ||
"scripts": { | ||
"lint": "tslint -c ../../tslint.json src/**/*.ts test/**/*.ts", | ||
"lint": "eslint -c ../../eslint.json src/**/*.ts test/**/*.ts", | ||
"_test": "cd ../.. && c8 --reporter lcov --reports-dir packages/prune-lockfile/coverage ts-node packages/prune-lockfile/test --type-check", | ||
@@ -37,13 +37,13 @@ "test": "pnpm run compile && pnpm run _test", | ||
"@pnpm/prune-lockfile": "link:", | ||
"@types/ramda": "^0.27.11", | ||
"@types/ramda": "^0.27.28", | ||
"yaml-tag": "1.1.0" | ||
}, | ||
"dependencies": { | ||
"@pnpm/constants": "4.0.0", | ||
"@pnpm/lockfile-types": "2.0.1", | ||
"@pnpm/types": "6.2.0", | ||
"dependency-path": "5.0.3", | ||
"ramda": "^0.27.0" | ||
"@pnpm/constants": "4.1.0", | ||
"@pnpm/lockfile-types": "2.1.0", | ||
"@pnpm/types": "6.3.0", | ||
"dependency-path": "5.0.4", | ||
"ramda": "^0.27.1" | ||
}, | ||
"funding": "https://opencollective.com/pnpm" | ||
} |
12467
181
+ Added@pnpm/constants@4.1.0(transitive)
+ Added@pnpm/lockfile-types@2.1.0(transitive)
+ Added@pnpm/types@6.3.0(transitive)
+ Addeddependency-path@5.0.4(transitive)
- Removed@pnpm/constants@4.0.0(transitive)
- Removed@pnpm/lockfile-types@2.0.1(transitive)
- Removed@pnpm/types@6.2.0(transitive)
- Removeddependency-path@5.0.3(transitive)
Updated@pnpm/constants@4.1.0
Updated@pnpm/lockfile-types@2.1.0
Updated@pnpm/types@6.3.0
Updateddependency-path@5.0.4
Updatedramda@^0.27.1