@pnpm/error 1000.0.5 → 1100.0.0

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/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
1
  The MIT License (MIT)
2
2
 
3
3
  Copyright (c) 2015-2016 Rico Sta. Cruz and other contributors
4
- Copyright (c) 2016-2025 Zoltan Kochan and other contributors
4
+ Copyright (c) 2016-2026 Zoltan Kochan and other contributors
5
5
 
6
6
  Permission is hereby granted, free of charge, to any person obtaining a copy
7
7
  of this software and associated documentation files (the "Software"), to deal
package/lib/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export declare class PnpmError extends Error {
11
11
  constructor(code: string, message: string, opts?: {
12
12
  attempts?: number;
13
13
  hint?: string;
14
+ cause?: unknown;
14
15
  });
15
16
  }
16
17
  export interface FetchErrorResponse {
package/lib/index.js CHANGED
@@ -1,22 +1,18 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LockfileMissingDependencyError = exports.FetchError = exports.PnpmError = void 0;
4
- const constants_1 = require("@pnpm/constants");
5
- class PnpmError extends Error {
1
+ import { WANTED_LOCKFILE } from '@pnpm/constants';
2
+ export class PnpmError extends Error {
6
3
  code;
7
4
  hint;
8
5
  attempts;
9
6
  prefix;
10
7
  pkgsStack;
11
8
  constructor(code, message, opts) {
12
- super(message);
9
+ super(message, { cause: opts?.cause });
13
10
  this.code = code.startsWith('ERR_PNPM_') ? code : `ERR_PNPM_${code}`;
14
11
  this.hint = opts?.hint;
15
12
  this.attempts = opts?.attempts;
16
13
  }
17
14
  }
18
- exports.PnpmError = PnpmError;
19
- class FetchError extends PnpmError {
15
+ export class FetchError extends PnpmError {
20
16
  response;
21
17
  request;
22
18
  constructor(request, response, hint) {
@@ -43,7 +39,6 @@ class FetchError extends PnpmError {
43
39
  this.response = response;
44
40
  }
45
41
  }
46
- exports.FetchError = FetchError;
47
42
  function hideAuthInformation(authHeaderValue) {
48
43
  const [authType, token] = authHeaderValue.split(' ');
49
44
  if (token == null)
@@ -53,14 +48,13 @@ function hideAuthInformation(authHeaderValue) {
53
48
  }
54
49
  return `${authType} ${token.substring(0, 4)}[hidden]`;
55
50
  }
56
- class LockfileMissingDependencyError extends PnpmError {
51
+ export class LockfileMissingDependencyError extends PnpmError {
57
52
  constructor(depPath) {
58
- const message = `Broken lockfile: no entry for '${depPath}' in ${constants_1.WANTED_LOCKFILE}`;
53
+ const message = `Broken lockfile: no entry for '${depPath}' in ${WANTED_LOCKFILE}`;
59
54
  super('LOCKFILE_MISSING_DEPENDENCY', message, {
60
55
  hint: 'This issue is probably caused by a badly resolved merge conflict.\n' +
61
56
  'To fix the lockfile, run \'pnpm install --no-frozen-lockfile\'.',
62
57
  });
63
58
  }
64
59
  }
65
- exports.LockfileMissingDependencyError = LockfileMissingDependencyError;
66
60
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
1
  {
2
2
  "name": "@pnpm/error",
3
- "version": "1000.0.5",
3
+ "version": "1100.0.0",
4
4
  "description": "An error class for pnpm errors",
5
5
  "keywords": [
6
6
  "pnpm",
7
- "pnpm10",
7
+ "pnpm11",
8
8
  "error"
9
9
  ],
10
10
  "license": "MIT",
11
11
  "funding": "https://opencollective.com/pnpm",
12
- "repository": "https://github.com/pnpm/pnpm/blob/main/packages/error",
13
- "homepage": "https://github.com/pnpm/pnpm/blob/main/packages/error#readme",
12
+ "repository": "https://github.com/pnpm/pnpm/tree/main/core/error",
13
+ "homepage": "https://github.com/pnpm/pnpm/tree/main/core/error#readme",
14
14
  "bugs": {
15
15
  "url": "https://github.com/pnpm/pnpm/issues"
16
16
  },
17
- "type": "commonjs",
17
+ "type": "module",
18
18
  "main": "lib/index.js",
19
19
  "types": "lib/index.d.ts",
20
20
  "exports": {
@@ -25,21 +25,21 @@
25
25
  "!*.map"
26
26
  ],
27
27
  "dependencies": {
28
- "@pnpm/constants": "1001.3.1"
28
+ "@pnpm/constants": "1100.0.0"
29
29
  },
30
30
  "devDependencies": {
31
- "@pnpm/error": "1000.0.5"
31
+ "@pnpm/error": "1100.0.0"
32
32
  },
33
33
  "engines": {
34
- "node": ">=18.12"
34
+ "node": ">=22.13"
35
35
  },
36
36
  "jest": {
37
37
  "preset": "@pnpm/jest-config"
38
38
  },
39
39
  "scripts": {
40
40
  "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
41
- "_test": "jest",
42
- "test": "pnpm run compile && pnpm run _test",
43
- "compile": "tsc --build && pnpm run lint --fix"
41
+ "test": "pn compile && pn .test",
42
+ "compile": "tsgo --build && pn lint --fix",
43
+ ".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
44
44
  }
45
45
  }
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AAEjD,MAAa,SAAU,SAAQ,KAAK;IAClB,IAAI,CAAQ;IACZ,IAAI,CAAS;IACtB,QAAQ,CAAS;IACjB,MAAM,CAAS;IACf,SAAS,CAAuD;IACvE,YACE,IAAY,EACZ,OAAe,EACf,IAGC;QAED,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,YAAY,IAAI,EAAE,CAAA;QACpE,IAAI,CAAC,IAAI,GAAG,IAAI,EAAE,IAAI,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,EAAE,QAAQ,CAAA;IAChC,CAAC;CACF;AAnBD,8BAmBC;AAMD,MAAa,UAAW,SAAQ,SAAS;IACvB,QAAQ,CAAoB;IAC5B,OAAO,CAAmB;IAE1C,YACE,OAA0B,EAC1B,QAA4B,EAC5B,IAAa;QAEb,MAAM,QAAQ,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