@pnpm/error 2.0.0 → 2.1.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-2021 Zoltan Kochan and other contributors
4
+ Copyright (c) 2016-2022 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/README.md CHANGED
@@ -19,7 +19,7 @@ import PnpmError from '@pnpm/error'
19
19
 
20
20
  try {
21
21
  throw new PnpmError('THE_ERROR_CODE', 'The error message')
22
- } catch (err) {
22
+ } catch (err: any) { // eslint-disable-line
23
23
  console.log(err.code)
24
24
  //> ERR_PNPM_THE_ERROR_CODE
25
25
  console.log(err.message)
package/lib/index.d.ts CHANGED
@@ -25,3 +25,6 @@ export declare class FetchError extends PnpmError {
25
25
  readonly request: FetchErrorRequest;
26
26
  constructor(request: FetchErrorRequest, response: FetchErrorResponse, hint?: string);
27
27
  }
28
+ export declare class LockfileMissingDependencyError extends PnpmError {
29
+ constructor(depPath: string);
30
+ }
package/lib/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FetchError = void 0;
3
+ exports.LockfileMissingDependencyError = exports.FetchError = void 0;
4
+ const constants_1 = require("@pnpm/constants");
4
5
  class PnpmError extends Error {
5
6
  constructor(code, message, opts) {
6
7
  super(message);
@@ -37,4 +38,14 @@ function hideAuthInformation(authHeaderValue) {
37
38
  const [authType, token] = authHeaderValue.split(' ');
38
39
  return `${authType} ${token.substring(0, 4)}[hidden]`;
39
40
  }
41
+ class LockfileMissingDependencyError extends PnpmError {
42
+ constructor(depPath) {
43
+ const message = `Broken lockfile: no entry for '${depPath}' in ${constants_1.WANTED_LOCKFILE}`;
44
+ super('LOCKFILE_MISSING_DEPENDENCY', message, {
45
+ hint: 'This issue is probably caused by a badly resolved merge conflict.\n' +
46
+ 'To fix the lockfile, run \'pnpm install --no-frozen-lockfile\'.',
47
+ });
48
+ }
49
+ }
50
+ exports.LockfileMissingDependencyError = LockfileMissingDependencyError;
40
51
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,+CAAiD;AAEjD,MAAqB,SAAU,SAAQ,KAAK;IAK1C,YACE,IAAY,EACZ,OAAe,EACf,IAGC;QAED,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,YAAY,IAAI,EAAE,CAAA;QAC9B,IAAI,CAAC,IAAI,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,IAAI,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAA;IAChC,CAAC;CACF;AAlBD,4BAkBC;AAMD,MAAa,UAAW,SAAQ,SAAS;IAIvC,YACE,OAA0B,EAC1B,QAA4B,EAC5B,IAAa;QAEb,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,GAAG,KAAK,QAAQ,CAAC,UAAU,MAAM,QAAQ,CAAC,MAAM,EAAE,CAAA;QACjF,MAAM,eAAe,GAAG,OAAO,CAAC,eAAe;YAC7C,CAAC,CAAC,mBAAmB,CAAC,OAAO,CAAC,eAAe,CAAC;YAC9C,CAAC,CAAC,SAAS,CAAA;QACb,iGAAiG;QACjG,wDAAwD;QACxD,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;YACjF,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAA;YAChC,IAAI,eAAe,EAAE;gBACnB,IAAI,IAAI,qCAAqC,eAAe,EAAE,CAAA;aAC/D;iBAAM;gBACL,IAAI,IAAI,kDAAkD,CAAA;aAC3D;SACF;QACD,KAAK,CAAC,SAAS,QAAQ,CAAC,MAAM,EAAE,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;IAC1B,CAAC;CACF;AA3BD,gCA2BC;AAED,SAAS,mBAAmB,CAAE,eAAuB;IACnD,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IACpD,OAAO,GAAG,QAAQ,IAAI,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,UAAU,CAAA;AACvD,CAAC;AAED,MAAa,8BAA+B,SAAQ,SAAS;IAC3D,YAAa,OAAe;QAC1B,MAAM,OAAO,GAAG,kCAAkC,OAAO,QAAQ,2BAAe,EAAE,CAAA;QAClF,KAAK,CAAC,6BAA6B,EAAE,OAAO,EAAE;YAC5C,IAAI,EAAE,qEAAqE;gBACzE,iEAAiE;SACpE,CAAC,CAAA;IACJ,CAAC;CACF;AARD,wEAQC"}
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@pnpm/error",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "An error class for pnpm errors",
5
5
  "main": "lib/index.js",
6
- "typings": "lib/index.d.ts",
6
+ "types": "lib/index.d.ts",
7
7
  "files": [
8
8
  "lib",
9
9
  "!*.map"
@@ -11,14 +11,9 @@
11
11
  "engines": {
12
12
  "node": ">=12.17"
13
13
  },
14
- "scripts": {
15
- "lint": "eslint -c ../../eslint.json src/**/*.ts",
16
- "test": "pnpm run compile",
17
- "prepublishOnly": "pnpm run compile",
18
- "compile": "rimraf lib tsconfig.tsbuildinfo && tsc --build && pnpm run lint -- --fix"
19
- },
20
- "repository": "https://github.com/pnpm/pnpm/blob/master/packages/error",
14
+ "repository": "https://github.com/pnpm/pnpm/blob/main/packages/error",
21
15
  "keywords": [
16
+ "pnpm6",
22
17
  "pnpm",
23
18
  "error"
24
19
  ],
@@ -26,6 +21,17 @@
26
21
  "bugs": {
27
22
  "url": "https://github.com/pnpm/pnpm/issues"
28
23
  },
29
- "homepage": "https://github.com/pnpm/pnpm/blob/master/packages/error#readme",
30
- "funding": "https://opencollective.com/pnpm"
31
- }
24
+ "homepage": "https://github.com/pnpm/pnpm/blob/main/packages/error#readme",
25
+ "funding": "https://opencollective.com/pnpm",
26
+ "devDependencies": {
27
+ "@pnpm/error": "2.1.0"
28
+ },
29
+ "dependencies": {
30
+ "@pnpm/constants": "5.0.0"
31
+ },
32
+ "scripts": {
33
+ "lint": "eslint src/**/*.ts",
34
+ "test": "pnpm run compile",
35
+ "compile": "tsc --build && pnpm run lint --fix"
36
+ }
37
+ }
package/CHANGELOG.md DELETED
@@ -1,27 +0,0 @@
1
- # @pnpm/error
2
-
3
- ## 2.0.0
4
-
5
- ### Major Changes
6
-
7
- - 97b986fbc: Node.js 10 support is dropped. At least Node.js 12.17 is required for the package to work.
8
-
9
- ## 1.4.0
10
-
11
- ### Minor Changes
12
-
13
- - 0c5f1bcc9: Every error object has an optional "attempts" field.
14
-
15
- ## 1.3.1
16
-
17
- ### Patch Changes
18
-
19
- - 75a36deba: Report auth info on 404 errors as well.
20
-
21
- ## 1.3.0
22
-
23
- ### Minor Changes
24
-
25
- - 6d480dd7a: A new error class added for throwing fetch errors: FetchError.
26
-
27
- ## 1.2.1