@pnpm/hooks.pnpmfile 1002.1.3 → 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.
@@ -1,4 +1,3 @@
1
- import assert from 'node:assert';
2
1
  import fs from 'node:fs';
3
2
  import { createRequire } from 'node:module';
4
3
  import path from 'node:path';
@@ -77,7 +76,9 @@ export async function requirePnpmfile(pnpmFilePath, prefix) {
77
76
  console.error(err);
78
77
  process.exit(1);
79
78
  }
80
- assert(util.types.isNativeError(err));
79
+ if (!util.types.isNativeError(err)) {
80
+ throw new PnpmFileFailError(pnpmFilePath, toError(err));
81
+ }
81
82
  if (!('code' in err && (err.code === 'MODULE_NOT_FOUND' || err.code === 'ERR_MODULE_NOT_FOUND')) ||
82
83
  pnpmFileExistsSync(pnpmFilePath)) {
83
84
  throw new PnpmFileFailError(pnpmFilePath, err);
@@ -91,4 +92,14 @@ function pnpmFileExistsSync(pnpmFilePath) {
91
92
  : `${pnpmFilePath}.cjs`;
92
93
  return fs.existsSync(pnpmFileRealName);
93
94
  }
95
+ function toError(err) {
96
+ if (err instanceof Error)
97
+ return err;
98
+ try {
99
+ return new Error(String(err), { cause: err });
100
+ }
101
+ catch {
102
+ return new Error('[non-Error value thrown]', { cause: err });
103
+ }
104
+ }
94
105
  //# sourceMappingURL=requirePnpmfile.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/hooks.pnpmfile",
3
- "version": "1002.1.3",
3
+ "version": "1100.0.0",
4
4
  "description": "Reading a .pnpmfile.cjs",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -26,22 +26,22 @@
26
26
  "dependencies": {
27
27
  "chalk": "^5.6.0",
28
28
  "path-absolute": "^2.0.0",
29
- "@pnpm/crypto.hash": "1000.2.1",
30
- "@pnpm/error": "1000.0.5",
31
- "@pnpm/hooks.types": "1001.0.12",
32
- "@pnpm/lockfile.types": "1002.0.2",
33
- "@pnpm/types": "1000.9.0",
34
- "@pnpm/store.controller-types": "1004.1.0",
35
- "@pnpm/core-loggers": "1001.0.4"
29
+ "@pnpm/core-loggers": "1100.0.0",
30
+ "@pnpm/error": "1100.0.0",
31
+ "@pnpm/crypto.hash": "1100.0.0",
32
+ "@pnpm/hooks.types": "1100.0.0",
33
+ "@pnpm/lockfile.types": "1100.0.0",
34
+ "@pnpm/store.controller-types": "1100.0.0",
35
+ "@pnpm/types": "1100.0.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@pnpm/logger": ">=1001.0.0 <1002.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@pnpm/fetching.fetcher-base": "1001.0.2",
42
- "@pnpm/hooks.pnpmfile": "1002.1.3",
43
- "@pnpm/logger": "1001.0.1",
44
- "@pnpm/test-fixtures": "1000.0.0"
41
+ "@pnpm/fetching.fetcher-base": "1100.0.0",
42
+ "@pnpm/hooks.pnpmfile": "1100.0.0",
43
+ "@pnpm/logger": "1100.0.0",
44
+ "@pnpm/test-fixtures": "1100.0.0"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=22.13"
@@ -51,8 +51,8 @@
51
51
  },
52
52
  "scripts": {
53
53
  "lint": "eslint \"src/**/*.ts\" \"test/**/*.ts\"",
54
- "_test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest",
55
- "test": "pnpm run compile && pnpm run _test",
56
- "compile": "tsgo --build && pnpm run lint --fix"
54
+ "test": "pn compile && pn .test",
55
+ "compile": "tsgo --build && pn lint --fix",
56
+ ".test": "cross-env NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules --disable-warning=ExperimentalWarning --disable-warning=DEP0169\" jest"
57
57
  }
58
58
  }