@pnpm/merge-lockfile-changes
Advanced tools
Comparing version 1.0.1 to 2.0.0
# @pnpm/merge-lockfile-changes | ||
## 2.0.0 | ||
### Major Changes | ||
- 97b986fbc: Node.js 10 support is dropped. At least Node.js 12.17 is required for the package to work. | ||
### Patch Changes | ||
- Updated dependencies [97b986fbc] | ||
- Updated dependencies [6871d74b2] | ||
- @pnpm/lockfile-types@3.0.0 | ||
## 1.0.1 | ||
@@ -4,0 +16,0 @@ |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const R = require("ramda"); | ||
const semver = require("semver"); | ||
const comver_to_semver_1 = __importDefault(require("comver-to-semver")); | ||
const R = __importStar(require("ramda")); | ||
const semver_1 = __importDefault(require("semver")); | ||
function mergeLockfileChanges(ours, theirs) { | ||
@@ -9,3 +32,5 @@ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p; | ||
importers: {}, | ||
lockfileVersion: Math.max(theirs.lockfileVersion, ours.lockfileVersion), | ||
lockfileVersion: semver_1.default.gt((0, comver_to_semver_1.default)(theirs.lockfileVersion.toString()), (0, comver_to_semver_1.default)(ours.lockfileVersion.toString())) | ||
? theirs.lockfileVersion | ||
: ours.lockfileVersion, | ||
}; | ||
@@ -18,3 +43,3 @@ for (const importerId of Array.from(new Set([...Object.keys(ours.importers), ...Object.keys(theirs.importers)]))) { | ||
newLockfile.importers[importerId][key] = mergeDict((_b = (_a = ours.importers[importerId]) === null || _a === void 0 ? void 0 : _a[key]) !== null && _b !== void 0 ? _b : {}, (_d = (_c = theirs.importers[importerId]) === null || _c === void 0 ? void 0 : _c[key]) !== null && _d !== void 0 ? _d : {}, mergeVersions); | ||
if (!Object.keys(newLockfile.importers[importerId][key]).length) { | ||
if (Object.keys(newLockfile.importers[importerId][key]).length === 0) { | ||
delete newLockfile.importers[importerId][key]; | ||
@@ -35,3 +60,3 @@ } | ||
pkg[key] = mergeDict((_o = ourPkg === null || ourPkg === void 0 ? void 0 : ourPkg[key]) !== null && _o !== void 0 ? _o : {}, (_p = theirPkg === null || theirPkg === void 0 ? void 0 : theirPkg[key]) !== null && _p !== void 0 ? _p : {}, mergeVersions); | ||
if (!Object.keys(pkg[key]).length) { | ||
if (Object.keys(pkg[key]).length === 0) { | ||
delete pkg[key]; | ||
@@ -68,3 +93,3 @@ } | ||
const [theirVersion] = theirValue.split('_'); | ||
if (semver.gt(ourVersion, theirVersion)) { | ||
if (semver_1.default.gt(ourVersion, theirVersion)) { | ||
return ourValue; | ||
@@ -71,0 +96,0 @@ } |
{ | ||
"name": "@pnpm/merge-lockfile-changes", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "Merges lockfiles. Can automatically fix merge conflicts", | ||
@@ -8,3 +8,3 @@ "main": "lib/index.js", | ||
"engines": { | ||
"node": ">=10.16" | ||
"node": ">=12.17" | ||
}, | ||
@@ -20,3 +20,3 @@ "files": [ | ||
"prepublishOnly": "pnpm run compile", | ||
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build" | ||
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build && pnpm run lint -- --fix" | ||
}, | ||
@@ -29,3 +29,2 @@ "repository": "https://github.com/pnpm/pnpm/blob/master/packages/merge-lockfile-changes", | ||
], | ||
"author": "Zoltan Kochan <z@kochan.io> (https://www.kochan.io/)", | ||
"license": "MIT", | ||
@@ -37,3 +36,4 @@ "bugs": { | ||
"dependencies": { | ||
"@pnpm/lockfile-types": "2.2.0", | ||
"@pnpm/lockfile-types": "3.0.0", | ||
"comver-to-semver": "^1.0.0", | ||
"ramda": "^0.27.1", | ||
@@ -40,0 +40,0 @@ "semver": "^7.3.4" |
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
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
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
7841
97
4
1
+ Addedcomver-to-semver@^1.0.0
+ Added@pnpm/lockfile-types@3.0.0(transitive)
+ Addedcomver-to-semver@1.0.0(transitive)
- Removed@pnpm/lockfile-types@2.2.0(transitive)
Updated@pnpm/lockfile-types@3.0.0