@pnpm/lockfile.fs 1100.0.6 → 1100.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/read.d.ts CHANGED
@@ -19,6 +19,7 @@ export declare function readWantedLockfile(pkgPath: string, opts: {
19
19
  useGitBranchLockfile?: boolean;
20
20
  mergeGitBranchLockfiles?: boolean;
21
21
  }): Promise<LockfileObject | null>;
22
+ export declare function wantedLockfileHasMergeConflictsSync(pkgPath: string): boolean;
22
23
  export declare function createLockfileObject(importerIds: ProjectId[], opts: {
23
24
  lockfileVersion: string;
24
25
  autoInstallPeers: boolean;
package/lib/read.js CHANGED
@@ -1,4 +1,4 @@
1
- import { promises as fs } from 'node:fs';
1
+ import fs, { promises as fsp } from 'node:fs';
2
2
  import path from 'node:path';
3
3
  import util from 'node:util';
4
4
  import { LOCKFILE_VERSION, WANTED_LOCKFILE, } from '@pnpm/constants';
@@ -28,11 +28,23 @@ export async function readWantedLockfileAndAutofixConflicts(pkgPath, opts) {
28
28
  export async function readWantedLockfile(pkgPath, opts) {
29
29
  return (await _readWantedLockfile(pkgPath, opts)).lockfile;
30
30
  }
31
+ export function wantedLockfileHasMergeConflictsSync(pkgPath) {
32
+ try {
33
+ const lockfileRawContent = stripBom(fs.readFileSync(path.join(pkgPath, WANTED_LOCKFILE), 'utf8'));
34
+ return isDiff(extractMainDocument(lockfileRawContent));
35
+ }
36
+ catch (err) {
37
+ if (util.types.isNativeError(err) && 'code' in err && err.code === 'ENOENT') {
38
+ return false;
39
+ }
40
+ throw err;
41
+ }
42
+ }
31
43
  async function _read(lockfilePath, prefix, // only for logging
32
44
  opts) {
33
45
  let lockfileRawContent;
34
46
  try {
35
- lockfileRawContent = stripBom(await fs.readFile(lockfilePath, 'utf8'));
47
+ lockfileRawContent = stripBom(await fsp.readFile(lockfilePath, 'utf8'));
36
48
  }
37
49
  catch (err) {
38
50
  if (!(util.types.isNativeError(err) && 'code' in err && err.code === 'ENOENT')) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/lockfile.fs",
3
- "version": "1100.0.6",
3
+ "version": "1100.0.8",
4
4
  "description": "Read/write pnpm-lock.yaml files",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -31,21 +31,21 @@
31
31
  "js-yaml": "npm:@zkochan/js-yaml@0.0.11",
32
32
  "normalize-path": "^3.0.0",
33
33
  "ramda": "npm:@pnpm/ramda@0.28.1",
34
- "semver": "^7.7.4",
34
+ "semver": "^7.7.2",
35
35
  "strip-bom": "^5.0.0",
36
- "write-file-atomic": "^7.0.1",
37
- "@pnpm/deps.path": "1100.0.2",
36
+ "write-file-atomic": "^7.0.0",
38
37
  "@pnpm/constants": "1100.0.0",
38
+ "@pnpm/deps.path": "1100.0.3",
39
39
  "@pnpm/error": "1100.0.0",
40
- "@pnpm/lockfile.merger": "1100.0.4",
41
- "@pnpm/object.key-sorting": "1100.0.0",
40
+ "@pnpm/lockfile.merger": "1100.0.5",
41
+ "@pnpm/lockfile.types": "1100.0.5",
42
+ "@pnpm/lockfile.utils": "1100.0.7",
42
43
  "@pnpm/network.git-utils": "1100.0.1",
43
- "@pnpm/lockfile.utils": "1100.0.6",
44
- "@pnpm/types": "1101.0.0",
45
- "@pnpm/lockfile.types": "1100.0.4"
44
+ "@pnpm/types": "1101.1.0",
45
+ "@pnpm/object.key-sorting": "1100.0.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "@pnpm/logger": "^1001.0.1"
48
+ "@pnpm/logger": ">=1001.0.0 <1002.0.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@jest/globals": "30.3.0",
@@ -57,7 +57,7 @@
57
57
  "tempy": "3.0.0",
58
58
  "write-yaml-file": "^6.0.0",
59
59
  "yaml-tag": "1.1.0",
60
- "@pnpm/lockfile.fs": "1100.0.6",
60
+ "@pnpm/lockfile.fs": "1100.0.8",
61
61
  "@pnpm/logger": "1100.0.0"
62
62
  },
63
63
  "engines": {