@pnpm/error 1100.2.0 → 1100.2.1
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/CHANGELOG.md +6 -0
- package/lib/index.d.ts +10 -0
- package/lib/index.js +13 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @pnpm/error
|
|
2
2
|
|
|
3
|
+
## 1100.2.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- `pnpm install` now works in StackBlitz WebContainers on projects without a lockfile. It used to fail there with `ENOENT ... pnpm-lock.yaml`, because pnpm did not recognize the errors that WebContainers return from asynchronous file system calls [#15649](https://github.com/pnpm/pnpm/issues/15649).
|
|
8
|
+
|
|
3
9
|
## 1100.2.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/lib/index.d.ts
CHANGED
|
@@ -68,3 +68,13 @@ export declare function redactAndSanitizeMultiline(text: string): string;
|
|
|
68
68
|
export declare class LockfileMissingDependencyError extends PnpmError {
|
|
69
69
|
constructor(depPath: string);
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Whether `value` is an `Error`, whichever way the runtime created it.
|
|
73
|
+
*
|
|
74
|
+
* `util.types.isNativeError` misses the errors that StackBlitz WebContainers
|
|
75
|
+
* reject asynchronous `fs` calls with: they inherit from `Error`, but the
|
|
76
|
+
* native constructor did not create them. `instanceof Error` misses errors
|
|
77
|
+
* from another realm, such as the ones code under Jest's VM contexts catches.
|
|
78
|
+
* Either check passing is enough.
|
|
79
|
+
*/
|
|
80
|
+
export declare function isError(value: unknown): value is Error;
|
package/lib/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import util from 'node:util';
|
|
1
2
|
import { WANTED_LOCKFILE } from '@pnpm/constants';
|
|
2
3
|
export class PnpmError extends Error {
|
|
3
4
|
code;
|
|
@@ -219,4 +220,16 @@ export class LockfileMissingDependencyError extends PnpmError {
|
|
|
219
220
|
});
|
|
220
221
|
}
|
|
221
222
|
}
|
|
223
|
+
/**
|
|
224
|
+
* Whether `value` is an `Error`, whichever way the runtime created it.
|
|
225
|
+
*
|
|
226
|
+
* `util.types.isNativeError` misses the errors that StackBlitz WebContainers
|
|
227
|
+
* reject asynchronous `fs` calls with: they inherit from `Error`, but the
|
|
228
|
+
* native constructor did not create them. `instanceof Error` misses errors
|
|
229
|
+
* from another realm, such as the ones code under Jest's VM contexts catches.
|
|
230
|
+
* Either check passing is enough.
|
|
231
|
+
*/
|
|
232
|
+
export function isError(value) {
|
|
233
|
+
return util.types.isNativeError(value) || value instanceof Error;
|
|
234
|
+
}
|
|
222
235
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/error",
|
|
3
|
-
"version": "1100.2.
|
|
3
|
+
"version": "1100.2.1",
|
|
4
4
|
"description": "An error class for pnpm errors",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@jest/globals": "30.4.1",
|
|
35
|
-
"@pnpm/error": "1100.2.
|
|
35
|
+
"@pnpm/error": "1100.2.1"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=22.13"
|