@nomicfoundation/hardhat-utils 3.0.0-next.2 → 3.0.0-next.21

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.
Files changed (49) hide show
  1. package/dist/src/bigint.d.ts.map +1 -1
  2. package/dist/src/bigint.js +1 -0
  3. package/dist/src/bigint.js.map +1 -1
  4. package/dist/src/debug.d.ts.map +1 -1
  5. package/dist/src/error.d.ts +19 -2
  6. package/dist/src/error.d.ts.map +1 -1
  7. package/dist/src/error.js +22 -2
  8. package/dist/src/error.js.map +1 -1
  9. package/dist/src/fs.d.ts +35 -3
  10. package/dist/src/fs.d.ts.map +1 -1
  11. package/dist/src/fs.js +155 -25
  12. package/dist/src/fs.js.map +1 -1
  13. package/dist/src/internal/lang.d.ts +1 -0
  14. package/dist/src/internal/lang.d.ts.map +1 -1
  15. package/dist/src/internal/lang.js +28 -0
  16. package/dist/src/internal/lang.js.map +1 -1
  17. package/dist/src/lang.d.ts +19 -0
  18. package/dist/src/lang.d.ts.map +1 -1
  19. package/dist/src/lang.js +22 -1
  20. package/dist/src/lang.js.map +1 -1
  21. package/dist/src/package.d.ts +12 -0
  22. package/dist/src/package.d.ts.map +1 -1
  23. package/dist/src/package.js.map +1 -1
  24. package/dist/src/path.d.ts +2 -2
  25. package/dist/src/path.d.ts.map +1 -1
  26. package/dist/src/path.js +12 -3
  27. package/dist/src/path.js.map +1 -1
  28. package/dist/src/request.d.ts +17 -7
  29. package/dist/src/request.d.ts.map +1 -1
  30. package/dist/src/request.js +13 -5
  31. package/dist/src/request.js.map +1 -1
  32. package/dist/src/stream.d.ts +1 -1
  33. package/dist/src/stream.js +1 -1
  34. package/dist/src/subprocess.js +1 -1
  35. package/dist/src/subprocess.js.map +1 -1
  36. package/dist/src/synchronization.js +4 -4
  37. package/dist/src/synchronization.js.map +1 -1
  38. package/package.json +9 -13
  39. package/src/bigint.ts +1 -0
  40. package/src/error.ts +26 -2
  41. package/src/fs.ts +196 -28
  42. package/src/internal/lang.ts +38 -0
  43. package/src/lang.ts +26 -1
  44. package/src/package.ts +26 -0
  45. package/src/path.ts +16 -6
  46. package/src/request.ts +25 -9
  47. package/src/stream.ts +1 -1
  48. package/src/subprocess.ts +1 -1
  49. package/src/synchronization.ts +4 -4
package/src/stream.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Writable } from "node:stream";
2
2
 
3
3
  /**
4
- * Creates a Tansform that writes everything to actualWritable, without closing it
4
+ * Creates a Transform that writes everything to actualWritable, without closing it
5
5
  * when finished.
6
6
  *
7
7
  * This is useful to pipe things to stdout, without closing it, while being
package/src/subprocess.ts CHANGED
@@ -33,7 +33,7 @@ export async function spawnDetachedSubProcess(
33
33
  const subprocessArgs = [absolutePathToSubProcessFile, ...args];
34
34
 
35
35
  if (absolutePathToSubProcessFile.endsWith(".ts")) {
36
- subprocessArgs.unshift("--import", "tsx/esm");
36
+ subprocessArgs.unshift("--import", import.meta.resolve("tsx/esm"));
37
37
  }
38
38
 
39
39
  const subprocess = spawn(process.execPath, subprocessArgs, {
@@ -13,7 +13,7 @@ import path from "node:path";
13
13
 
14
14
  import debug from "debug";
15
15
 
16
- import { ensureError } from "./error.js";
16
+ import { ensureNodeErrnoExceptionError } from "./error.js";
17
17
  import { FileSystemAccessError } from "./errors/fs.js";
18
18
  import { sleep } from "./lang.js";
19
19
 
@@ -62,7 +62,7 @@ export class MultiProcessMutex {
62
62
  fs.writeFileSync(this.#mutexFilePath, "", { flag: "wx+" });
63
63
  return true;
64
64
  } catch (e) {
65
- ensureError<NodeJS.ErrnoException>(e);
65
+ ensureNodeErrnoExceptionError(e);
66
66
 
67
67
  if (e.code === "EEXIST") {
68
68
  // File already exists, so the mutex is already acquired
@@ -91,7 +91,7 @@ export class MultiProcessMutex {
91
91
  try {
92
92
  fileStat = fs.statSync(this.#mutexFilePath);
93
93
  } catch (e) {
94
- ensureError<NodeJS.ErrnoException>(e);
94
+ ensureNodeErrnoExceptionError(e);
95
95
 
96
96
  if (e.code === "ENOENT") {
97
97
  // The file might have been deleted by another process while this function was trying to access it.
@@ -113,7 +113,7 @@ export class MultiProcessMutex {
113
113
  log(`Deleting mutex file at path '${this.#mutexFilePath}'`);
114
114
  fs.unlinkSync(this.#mutexFilePath);
115
115
  } catch (e) {
116
- ensureError<NodeJS.ErrnoException>(e);
116
+ ensureNodeErrnoExceptionError(e);
117
117
 
118
118
  if (e.code === "ENOENT") {
119
119
  // The file might have been deleted by another process while this function was trying to access it.