refactor: rename merge-lockfiles to merge-lockfile-changes

This commit is contained in:
Zoltan Kochan
2020-11-07 01:39:22 +02:00
parent 3776b5a525
commit 5a07d73afe
12 changed files with 22 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
---
"@pnpm/merge-lockfiles": major
"@pnpm/merge-lockfile-changes": major
---
Initial release.

View File

@@ -49,7 +49,7 @@
"@pnpm/constants": "workspace:4.1.0",
"@pnpm/error": "workspace:1.3.1",
"@pnpm/lockfile-types": "workspace:2.1.1",
"@pnpm/merge-lockfiles": "workspace:^0.0.0",
"@pnpm/merge-lockfile-changes": "workspace:^0.0.0",
"@pnpm/types": "workspace:6.3.1",
"@zkochan/rimraf": "^1.0.0",
"js-yaml": "^3.14.0",

View File

@@ -1,5 +1,5 @@
import { Lockfile } from '@pnpm/lockfile-types'
import mergeLockfiles from '@pnpm/merge-lockfiles'
import mergeLockfilesChanges from '@pnpm/merge-lockfile-changes'
import yaml = require('js-yaml')
const MERGE_CONFLICT_PARENT = '|||||||'
@@ -10,7 +10,7 @@ const MERGE_CONFLICT_OURS = '<<<<<<<'
export function autofixMergeConflicts (fileContent: string) {
const { ours, theirs } = parseMergeFile(fileContent)
const oursParsed = yaml.safeLoad(ours) as Lockfile
return mergeLockfiles({
return mergeLockfilesChanges({
base: oursParsed,
ours: oursParsed,
theirs: yaml.safeLoad(theirs) as Lockfile,

View File

@@ -19,7 +19,7 @@
"path": "../lockfile-types"
},
{
"path": "../merge-lockfiles"
"path": "../merge-lockfile-changes"
},
{
"path": "../types"

View File

@@ -1,11 +1,11 @@
# @pnpm/merge-lockfiles
# @pnpm/merge-lockfile-changes
> Merges lockfiles. Can automatically fix merge conflicts
## Install
```
pnpm add @pnpm/merge-lockfiles
pnpm add @pnpm/merge-lockfile-changes
```
## License

View File

@@ -1,5 +1,5 @@
{
"name": "@pnpm/merge-lockfiles",
"name": "@pnpm/merge-lockfile-changes",
"version": "0.0.0",
"description": "Merges lockfiles. Can automatically fix merge conflicts",
"main": "lib/index.js",
@@ -18,7 +18,7 @@
"prepublishOnly": "pnpm run compile",
"compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build"
},
"repository": "https://github.com/pnpm/pnpm/blob/master/packages/merge-lockfiles",
"repository": "https://github.com/pnpm/pnpm/blob/master/packages/merge-lockfile-changes",
"keywords": [
"pnpm",
"shrinkwrap",
@@ -29,7 +29,7 @@
"bugs": {
"url": "https://github.com/pnpm/pnpm/issues"
},
"homepage": "https://github.com/pnpm/pnpm/blob/master/packages/merge-lockfiles#readme",
"homepage": "https://github.com/pnpm/pnpm/blob/master/packages/merge-lockfile-changes#readme",
"dependencies": {
"@pnpm/lockfile-types": "workspace:^2.1.1",
"ramda": "^0.27.1",

View File

@@ -2,7 +2,7 @@ import { Lockfile } from '@pnpm/lockfile-types'
import R = require('ramda')
import semver = require('semver')
export default function mergeLockfile (
export default function mergeLockfileChanges (
opts: {
base: Lockfile
ours: Lockfile
@@ -110,4 +110,4 @@ function mergeVersions (ourValue: string, baseValue: string, theirValue: string,
return ourValue
}
return theirValue
}
}

View File

@@ -1,5 +1,5 @@
import { Lockfile } from '@pnpm/lockfile-types'
import mergeLockfile from '../src'
import mergeLockfileChanges from '../src'
const simpleLockfile = {
importers: {
@@ -24,7 +24,7 @@ const simpleLockfile = {
test('fails when specifiers differ', () => {
expect(() => {
mergeLockfile({
mergeLockfileChanges({
base: simpleLockfile,
ours: {
...simpleLockfile,
@@ -49,7 +49,7 @@ test('fails when specifiers differ', () => {
})
test('picks the newer version when dependencies differ inside importer', () => {
const mergedLockfile = mergeLockfile({
const mergedLockfile = mergeLockfileChanges({
base: simpleLockfile,
ours: {
...simpleLockfile,
@@ -110,7 +110,7 @@ test('picks the newer version when dependencies differ inside package', () => {
},
},
}
const mergedLockfile = mergeLockfile({
const mergedLockfile = mergeLockfileChanges({
base,
ours: {
...base,
@@ -219,7 +219,7 @@ test('picks the newer version when dependencies differ inside package', () => {
})
test('prefers our lockfile resolutions when it has newer packages', () => {
const mergedLockfile = mergeLockfile({
const mergedLockfile = mergeLockfileChanges({
base: simpleLockfile,
ours: {
...simpleLockfile,
@@ -301,7 +301,7 @@ test('prefers our lockfile resolutions when it has newer packages', () => {
})
test('prefers our lockfile resolutions when it has newer packages', () => {
const mergedLockfile = mergeLockfile({
const mergedLockfile = mergeLockfileChanges({
base: simpleLockfile,
theirs: {
...simpleLockfile,
@@ -380,4 +380,4 @@ test('prefers our lockfile resolutions when it has newer packages', () => {
},
},
})
})
})

6
pnpm-lock.yaml generated
View File

@@ -938,7 +938,7 @@ importers:
'@pnpm/constants': 'link:../constants'
'@pnpm/error': 'link:../error'
'@pnpm/lockfile-types': 'link:../lockfile-types'
'@pnpm/merge-lockfiles': 'link:../merge-lockfiles'
'@pnpm/merge-lockfile-changes': 'link:../merge-lockfile-changes'
'@pnpm/types': 'link:../types'
'@zkochan/rimraf': 1.0.0
js-yaml: 3.14.0
@@ -964,7 +964,7 @@ importers:
'@pnpm/lockfile-file': 'link:'
'@pnpm/lockfile-types': 'workspace:2.1.1'
'@pnpm/logger': ^3.2.2
'@pnpm/merge-lockfiles': 'workspace:^0.0.0'
'@pnpm/merge-lockfile-changes': 'workspace:^0.0.0'
'@pnpm/types': 'workspace:6.3.1'
'@types/js-yaml': ^3.12.5
'@types/mz': ^2.7.2
@@ -1125,7 +1125,7 @@ importers:
specifiers:
'@pnpm/matcher': 'link:'
escape-string-regexp: ^4.0.0
packages/merge-lockfiles:
packages/merge-lockfile-changes:
dependencies:
'@pnpm/lockfile-types': 'link:../lockfile-types'
ramda: 0.27.1