@nomicfoundation/hardhat-utils 4.0.5 → 4.1.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 +22 -0
- package/dist/src/bytecode.d.ts +4 -0
- package/dist/src/bytecode.d.ts.map +1 -1
- package/dist/src/bytecode.js +12 -7
- package/dist/src/bytecode.js.map +1 -1
- package/dist/src/crypto.d.ts.map +1 -1
- package/dist/src/crypto.js +10 -2
- package/dist/src/crypto.js.map +1 -1
- package/dist/src/debug.d.ts +40 -8
- package/dist/src/debug.d.ts.map +1 -1
- package/dist/src/debug.js +54 -18
- package/dist/src/debug.js.map +1 -1
- package/dist/src/fast-semver.d.ts +49 -0
- package/dist/src/fast-semver.d.ts.map +1 -0
- package/dist/src/fast-semver.js +73 -0
- package/dist/src/fast-semver.js.map +1 -0
- package/dist/src/fs.d.ts +47 -0
- package/dist/src/fs.d.ts.map +1 -1
- package/dist/src/fs.js +204 -48
- package/dist/src/fs.js.map +1 -1
- package/dist/src/internal/bytecode.d.ts +11 -0
- package/dist/src/internal/bytecode.d.ts.map +1 -1
- package/dist/src/internal/bytecode.js +39 -2
- package/dist/src/internal/bytecode.js.map +1 -1
- package/dist/src/internal/debug.d.ts +35 -0
- package/dist/src/internal/debug.d.ts.map +1 -0
- package/dist/src/internal/debug.js +91 -0
- package/dist/src/internal/debug.js.map +1 -0
- package/dist/src/internal/fs.d.ts +15 -0
- package/dist/src/internal/fs.d.ts.map +1 -1
- package/dist/src/internal/fs.js +44 -0
- package/dist/src/internal/fs.js.map +1 -1
- package/dist/src/internal/global-dir.d.ts +2 -2
- package/dist/src/internal/global-dir.d.ts.map +1 -1
- package/dist/src/internal/global-dir.js +7 -1
- package/dist/src/internal/global-dir.js.map +1 -1
- package/dist/src/internal/lang.d.ts +3 -2
- package/dist/src/internal/lang.d.ts.map +1 -1
- package/dist/src/internal/lang.js +12 -6
- package/dist/src/internal/lang.js.map +1 -1
- package/dist/src/lang.js +2 -2
- package/dist/src/lang.js.map +1 -1
- package/dist/src/request.d.ts +11 -11
- package/dist/src/request.d.ts.map +1 -1
- package/dist/src/request.js +6 -6
- package/dist/src/request.js.map +1 -1
- package/dist/src/subprocess.d.ts +2 -0
- package/dist/src/subprocess.d.ts.map +1 -1
- package/dist/src/subprocess.js +1 -0
- package/dist/src/subprocess.js.map +1 -1
- package/dist/src/synchronization.d.ts +97 -0
- package/dist/src/synchronization.d.ts.map +1 -1
- package/dist/src/synchronization.js +177 -8
- package/dist/src/synchronization.js.map +1 -1
- package/package.json +3 -4
- package/src/bytecode.ts +15 -6
- package/src/crypto.ts +15 -2
- package/src/debug.ts +73 -28
- package/src/fast-semver.ts +95 -0
- package/src/fs.ts +282 -76
- package/src/internal/bytecode.ts +64 -5
- package/src/internal/debug.ts +119 -0
- package/src/internal/fs.ts +70 -0
- package/src/internal/global-dir.ts +10 -4
- package/src/internal/lang.ts +15 -6
- package/src/lang.ts +2 -2
- package/src/request.ts +16 -16
- package/src/subprocess.ts +2 -0
- package/src/synchronization.ts +217 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../src/internal/fs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../../src/internal/fs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAStC;;;GAGG;AACH,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBnB;AAED;;;GAGG;AACH,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,MAAM,EACpB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAiBlB;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,CAAC,EAAE,CAAC,kBAAkB,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,EACpE,eAAe,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,GAC1E,OAAO,CAAC,IAAI,CAAC,CAyBf;AAED;;;;;;GAMG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EAAE,EACjB,OAAO,CAAC,EAAE,CAAC,iBAAiB,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,GAClE,OAAO,CAAC,IAAI,CAAC,CAkBf"}
|
package/dist/src/internal/fs.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fsPromises from "node:fs/promises";
|
|
2
|
+
import path from "node:path";
|
|
2
3
|
import { ensureNodeErrnoExceptionError } from "../error.js";
|
|
3
4
|
import { FileSystemAccessError, NotADirectoryError } from "../errors/fs.js";
|
|
4
5
|
import { isDirectory } from "../fs.js";
|
|
@@ -39,4 +40,47 @@ export async function isDirectoryDirentAware(absolutePath, dirent) {
|
|
|
39
40
|
}
|
|
40
41
|
return await isDirectory(absolutePath);
|
|
41
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Recursively walk the directory tree rooted at `dirFrom`, appending the
|
|
45
|
+
* absolute paths of every file accepted by `matches` to `results`. Descent
|
|
46
|
+
* into a subdirectory is gated by `directoryFilter`. When either callback is
|
|
47
|
+
* omitted, every file or directory is accepted.
|
|
48
|
+
*/
|
|
49
|
+
export async function collectAllFilesMatching(dirFrom, results, matches, directoryFilter) {
|
|
50
|
+
const dirContent = await readdirWithFileTypesOrEmpty(dirFrom);
|
|
51
|
+
await Promise.all(dirContent.map(async (dirent) => {
|
|
52
|
+
const absolutePathToFile = path.join(dirFrom, dirent.name);
|
|
53
|
+
if (await isDirectoryDirentAware(absolutePathToFile, dirent)) {
|
|
54
|
+
if (directoryFilter === undefined ||
|
|
55
|
+
(await directoryFilter(absolutePathToFile))) {
|
|
56
|
+
await collectAllFilesMatching(absolutePathToFile, results, matches, directoryFilter);
|
|
57
|
+
}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
else if (matches === undefined || (await matches(absolutePathToFile))) {
|
|
61
|
+
results.push(absolutePathToFile);
|
|
62
|
+
}
|
|
63
|
+
}));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Recursively walk the directory tree rooted at `dirFrom`, appending the
|
|
67
|
+
* absolute paths of every directory accepted by `matches` to `results`. When
|
|
68
|
+
* a directory matches, its descendants are not explored; when it does not,
|
|
69
|
+
* the walk continues into its subdirectories. When `matches` is omitted,
|
|
70
|
+
* every directory is accepted and recursion stops at the top level.
|
|
71
|
+
*/
|
|
72
|
+
export async function collectAllDirectoriesMatching(dirFrom, results, matches) {
|
|
73
|
+
const dirContent = await readdirWithFileTypesOrEmpty(dirFrom);
|
|
74
|
+
await Promise.all(dirContent.map(async (dirent) => {
|
|
75
|
+
const absolutePathToFile = path.join(dirFrom, dirent.name);
|
|
76
|
+
if (!(await isDirectoryDirentAware(absolutePathToFile, dirent))) {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (matches === undefined || (await matches(absolutePathToFile))) {
|
|
80
|
+
results.push(absolutePathToFile);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
await collectAllDirectoriesMatching(absolutePathToFile, results, matches);
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
42
86
|
//# sourceMappingURL=fs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../../src/internal/fs.ts"],"names":[],"mappings":"AAEA,OAAO,UAAU,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"fs.js","sourceRoot":"","sources":["../../../src/internal/fs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AC3D,IAAI,CAAC,CAAC,MAAM,sBAAsB,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;YAChE,OAAO;QACT,CAAC;QAED,IAAI,OAAO,KAAK,SAAS,IAAI,CAAC,MAAM,OAAO,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC;YACjE,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;YACjC,OAAO;QACT,CAAC;QAED,MAAM,6BAA6B,CAAC,kBAAkB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC5E,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { Paths } from "env-paths";
|
|
2
2
|
export declare const HARDHAT_PACKAGE_NAME = "hardhat";
|
|
3
|
-
export declare function generatePaths(packageName: string): Promise<
|
|
3
|
+
export declare function generatePaths(packageName: string): Promise<Paths>;
|
|
4
4
|
//# sourceMappingURL=global-dir.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-dir.d.ts","sourceRoot":"","sources":["../../../src/internal/global-dir.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"global-dir.d.ts","sourceRoot":"","sources":["../../../src/internal/global-dir.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,eAAO,MAAM,oBAAoB,YAAY,CAAC;AAO9C,wBAAsB,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAKvE"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import envPaths from "env-paths";
|
|
2
1
|
export const HARDHAT_PACKAGE_NAME = "hardhat";
|
|
2
|
+
// We don't load env-paths on startup because this module is transitively
|
|
3
|
+
// imported from many places but generatePaths is rarely called during
|
|
4
|
+
// bootstrap.
|
|
5
|
+
let envPaths;
|
|
3
6
|
export async function generatePaths(packageName) {
|
|
7
|
+
if (envPaths === undefined) {
|
|
8
|
+
({ default: envPaths } = await import("env-paths"));
|
|
9
|
+
}
|
|
4
10
|
return envPaths(packageName);
|
|
5
11
|
}
|
|
6
12
|
//# sourceMappingURL=global-dir.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"global-dir.js","sourceRoot":"","sources":["../../../src/internal/global-dir.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"global-dir.js","sourceRoot":"","sources":["../../../src/internal/global-dir.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,oBAAoB,GAAG,SAAS,CAAC;AAE9C,yEAAyE;AACzE,sEAAsE;AACtE,aAAa;AACb,IAAI,QAA+C,CAAC;AAEpD,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,WAAmB;IACrD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,MAAM,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import type Rfdc from "rfdc";
|
|
2
|
+
export declare function getDeepCloneFunction(): Promise<ReturnType<typeof Rfdc>>;
|
|
2
3
|
export declare function deepMergeImpl<T extends object, S extends object>(target: T, source: S, shouldOverwriteUndefined: boolean): T & S;
|
|
3
4
|
/**
|
|
4
5
|
* Performs a custom deep equality check using `fast-equals` with specific overrides.
|
|
@@ -7,5 +8,5 @@ export declare function deepMergeImpl<T extends object, S extends object>(target
|
|
|
7
8
|
* @param y The second value to compare.
|
|
8
9
|
* @returns True if the values are deeply equal, false otherwise.
|
|
9
10
|
*/
|
|
10
|
-
export declare function customFastEqual<T>(x: T, y: T): boolean
|
|
11
|
+
export declare function customFastEqual<T>(x: T, y: T): Promise<boolean>;
|
|
11
12
|
//# sourceMappingURL=lang.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lang.d.ts","sourceRoot":"","sources":["../../../src/internal/lang.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lang.d.ts","sourceRoot":"","sources":["../../../src/internal/lang.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAS7B,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,UAAU,CAAC,OAAO,IAAI,CAAC,CAAC,CAO7E;AAED,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,MAAM,EAC9D,MAAM,EAAE,CAAC,EACT,MAAM,EAAE,CAAC,EACT,wBAAwB,EAAE,OAAO,GAChC,CAAC,GAAG,CAAC,CAmCP;AAOD;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,CAyBrE"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { createCustomEqual } from "fast-equals";
|
|
2
|
-
import rfdc from "rfdc";
|
|
3
1
|
import { isObject } from "../lang.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
// We don't load rfdc on startup because it adds unnecessary
|
|
3
|
+
// overhead when this module is transitively imported but deep clone
|
|
4
|
+
// is not used.
|
|
5
|
+
let clone;
|
|
6
|
+
export async function getDeepCloneFunction() {
|
|
7
|
+
if (clone === undefined) {
|
|
8
|
+
const { default: rfdc } = await import("rfdc");
|
|
7
9
|
clone = rfdc();
|
|
8
10
|
}
|
|
9
11
|
return clone;
|
|
@@ -37,6 +39,9 @@ export function deepMergeImpl(target, source, shouldOverwriteUndefined) {
|
|
|
37
39
|
}
|
|
38
40
|
return result;
|
|
39
41
|
}
|
|
42
|
+
// We don't load fast-equals on startup because it adds unnecessary
|
|
43
|
+
// overhead when this module is transitively imported but deep equal
|
|
44
|
+
// is not used.
|
|
40
45
|
let cachedCustomEqual;
|
|
41
46
|
/**
|
|
42
47
|
* Performs a custom deep equality check using `fast-equals` with specific overrides.
|
|
@@ -45,10 +50,11 @@ let cachedCustomEqual;
|
|
|
45
50
|
* @param y The second value to compare.
|
|
46
51
|
* @returns True if the values are deeply equal, false otherwise.
|
|
47
52
|
*/
|
|
48
|
-
export function customFastEqual(x, y) {
|
|
53
|
+
export async function customFastEqual(x, y) {
|
|
49
54
|
if (cachedCustomEqual !== undefined) {
|
|
50
55
|
return cachedCustomEqual(x, y);
|
|
51
56
|
}
|
|
57
|
+
const { createCustomEqual } = await import("fast-equals");
|
|
52
58
|
cachedCustomEqual = createCustomEqual({
|
|
53
59
|
createCustomConfig: (defaultConfig) => ({
|
|
54
60
|
areTypedArraysEqual: (a, b, state) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lang.js","sourceRoot":"","sources":["../../../src/internal/lang.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"lang.js","sourceRoot":"","sources":["../../../src/internal/lang.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,4DAA4D;AAC5D,oEAAoE;AACpE,eAAe;AACf,IAAI,KAA0C,CAAC;AAE/C,MAAM,CAAC,KAAK,UAAU,oBAAoB;IACxC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC;QAC/C,KAAK,GAAG,IAAI,EAAE,CAAC;IACjB,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,MAAS,EACT,MAAS,EACT,wBAAiC;IAEjC;kFAC8E;IAC9E,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,EAAW,CAAC;IAEtC;0FACsF;IAC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nC,2EAA2E;gBAC3E,4EAA4E;gBAC5E,6EAA6E;gBAC7E,mDAAmD;gBACnD,kDAAkD;gBAClD,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC7C,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBACrB,CAAC;gBAED,OAAO,aAAa,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;YACxD,CAAC;SACF,CAAC;KACH,CAAC,CAAC;IAEH,OAAO,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACjC,CAAC"}
|
package/dist/src/lang.js
CHANGED
|
@@ -6,7 +6,7 @@ import { customFastEqual, deepMergeImpl, getDeepCloneFunction, } from "./interna
|
|
|
6
6
|
* @returns The deep clone of the provided value.
|
|
7
7
|
*/
|
|
8
8
|
export async function deepClone(value) {
|
|
9
|
-
const _deepClone = getDeepCloneFunction();
|
|
9
|
+
const _deepClone = await getDeepCloneFunction();
|
|
10
10
|
return _deepClone(value);
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -17,7 +17,7 @@ export async function deepClone(value) {
|
|
|
17
17
|
* @returns True if the values are deeply equal, false otherwise.
|
|
18
18
|
*/
|
|
19
19
|
export async function deepEqual(x, y) {
|
|
20
|
-
return customFastEqual(x, y);
|
|
20
|
+
return await customFastEqual(x, y);
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Deeply merges two objects.
|
package/dist/src/lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lang.js","sourceRoot":"","sources":["../../src/lang.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,aAAa,EACb,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAE5B;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAI,KAAQ;I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2
|
+
import type * as Undici from "undici";
|
|
3
3
|
export declare const DEFAULT_TIMEOUT_IN_MILLISECONDS = 300000;
|
|
4
4
|
export declare const DEFAULT_MAX_REDIRECTS = 10;
|
|
5
5
|
export declare const DEFAULT_POOL_MAX_CONNECTIONS = 128;
|
|
6
6
|
export declare const DEFAULT_USER_AGENT = "Hardhat";
|
|
7
|
-
export type Dispatcher =
|
|
8
|
-
export type TestDispatcher =
|
|
9
|
-
export type Interceptable =
|
|
7
|
+
export type Dispatcher = Undici.Dispatcher;
|
|
8
|
+
export type TestDispatcher = Undici.MockAgent;
|
|
9
|
+
export type Interceptable = Undici.Interceptable;
|
|
10
10
|
/**
|
|
11
11
|
* Options to configure the dispatcher.
|
|
12
12
|
*
|
|
@@ -54,7 +54,7 @@ export interface HttpResponse {
|
|
|
54
54
|
* @throws RequestTimeoutError If the request times out.
|
|
55
55
|
* @throws RequestError If the request fails for any other reason.
|
|
56
56
|
*/
|
|
57
|
-
export declare function getRequest(url: string, requestOptions?: RequestOptions, dispatcherOrDispatcherOptions?:
|
|
57
|
+
export declare function getRequest(url: string, requestOptions?: RequestOptions, dispatcherOrDispatcherOptions?: Undici.Dispatcher | DispatcherOptions): Promise<HttpResponse>;
|
|
58
58
|
/**
|
|
59
59
|
* Performs a POST request with a JSON body.
|
|
60
60
|
*
|
|
@@ -68,7 +68,7 @@ export declare function getRequest(url: string, requestOptions?: RequestOptions,
|
|
|
68
68
|
* @throws RequestTimeoutError If the request times out.
|
|
69
69
|
* @throws RequestError If the request fails for any other reason.
|
|
70
70
|
*/
|
|
71
|
-
export declare function postJsonRequest(url: string, body: unknown, requestOptions?: RequestOptions, dispatcherOrDispatcherOptions?:
|
|
71
|
+
export declare function postJsonRequest(url: string, body: unknown, requestOptions?: RequestOptions, dispatcherOrDispatcherOptions?: Undici.Dispatcher | DispatcherOptions): Promise<HttpResponse>;
|
|
72
72
|
/**
|
|
73
73
|
* Performs a POST request with a form body.
|
|
74
74
|
*
|
|
@@ -82,7 +82,7 @@ export declare function postJsonRequest(url: string, body: unknown, requestOptio
|
|
|
82
82
|
* @throws RequestTimeoutError If the request times out.
|
|
83
83
|
* @throws RequestError If the request fails for any other reason.
|
|
84
84
|
*/
|
|
85
|
-
export declare function postFormRequest(url: string, body: unknown, requestOptions?: RequestOptions, dispatcherOrDispatcherOptions?:
|
|
85
|
+
export declare function postFormRequest(url: string, body: unknown, requestOptions?: RequestOptions, dispatcherOrDispatcherOptions?: Undici.Dispatcher | DispatcherOptions): Promise<HttpResponse>;
|
|
86
86
|
/**
|
|
87
87
|
* Downloads a file from a url to a destination path.
|
|
88
88
|
*
|
|
@@ -94,12 +94,12 @@ export declare function postFormRequest(url: string, body: unknown, requestOptio
|
|
|
94
94
|
* @throws RequestTimeoutError If the request times out.
|
|
95
95
|
* @throws DownloadFailedError If the download fails for any other reason.
|
|
96
96
|
*/
|
|
97
|
-
export declare function download(url: string, destination: string, requestOptions?: RequestOptions, dispatcherOrDispatcherOptions?:
|
|
97
|
+
export declare function download(url: string, destination: string, requestOptions?: RequestOptions, dispatcherOrDispatcherOptions?: Undici.Dispatcher | DispatcherOptions): Promise<void>;
|
|
98
98
|
/**
|
|
99
99
|
* Creates a dispatcher based on the provided options.
|
|
100
|
-
* If the `proxy` option is set, it creates a {@link
|
|
101
|
-
* If the `pool` option is set to `true`, it creates a {@link
|
|
102
|
-
* Otherwise, it creates a basic {@link
|
|
100
|
+
* If the `proxy` option is set, it creates a {@link Undici.ProxyAgent} dispatcher.
|
|
101
|
+
* If the `pool` option is set to `true`, it creates a {@link Undici.Pool} dispatcher.
|
|
102
|
+
* Otherwise, it creates a basic {@link Undici.Agent} dispatcher.
|
|
103
103
|
*
|
|
104
104
|
* @param url The url to make requests to.
|
|
105
105
|
* @param options The options to configure the dispatcher. See {@link DispatcherOptions}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/request.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK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,CAO/C;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAoB3D;AAED,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC"}
|
package/dist/src/request.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { open } from "node:fs/promises";
|
|
2
2
|
import querystring from "node:querystring";
|
|
3
|
-
import
|
|
3
|
+
import { pipeline } from "node:stream/promises";
|
|
4
4
|
import { ensureError } from "./error.js";
|
|
5
5
|
import { DownloadError, RequestError, DispatcherError, } from "./errors/request.js";
|
|
6
6
|
import { move, remove } from "./fs.js";
|
|
7
7
|
import { generateTempFilePath, getBaseDispatcherOptions, getBaseRequestOptions, getBasicDispatcher, getPoolDispatcher, getProxyDispatcher, handleError, } from "./internal/request.js";
|
|
8
|
-
export const DEFAULT_TIMEOUT_IN_MILLISECONDS = 300_000; // Aligned with
|
|
8
|
+
export const DEFAULT_TIMEOUT_IN_MILLISECONDS = 300_000; // Aligned with undici
|
|
9
9
|
export const DEFAULT_MAX_REDIRECTS = 10;
|
|
10
10
|
export const DEFAULT_POOL_MAX_CONNECTIONS = 128;
|
|
11
11
|
export const DEFAULT_USER_AGENT = "Hardhat";
|
|
@@ -143,7 +143,7 @@ export async function download(url, destination, requestOptions = {}, dispatcher
|
|
|
143
143
|
try {
|
|
144
144
|
fileHandle = await open(tempFilePath, "w");
|
|
145
145
|
const fileStream = fileHandle.createWriteStream();
|
|
146
|
-
await
|
|
146
|
+
await pipeline(body, fileStream);
|
|
147
147
|
}
|
|
148
148
|
finally {
|
|
149
149
|
// NOTE: Historically, not closing the file handle caused issues on Windows,
|
|
@@ -168,9 +168,9 @@ export async function download(url, destination, requestOptions = {}, dispatcher
|
|
|
168
168
|
}
|
|
169
169
|
/**
|
|
170
170
|
* Creates a dispatcher based on the provided options.
|
|
171
|
-
* If the `proxy` option is set, it creates a {@link
|
|
172
|
-
* If the `pool` option is set to `true`, it creates a {@link
|
|
173
|
-
* Otherwise, it creates a basic {@link
|
|
171
|
+
* If the `proxy` option is set, it creates a {@link Undici.ProxyAgent} dispatcher.
|
|
172
|
+
* If the `pool` option is set to `true`, it creates a {@link Undici.Pool} dispatcher.
|
|
173
|
+
* Otherwise, it creates a basic {@link Undici.Agent} dispatcher.
|
|
174
174
|
*
|
|
175
175
|
* @param url The url to make requests to.
|
|
176
176
|
* @param options The options to configure the dispatcher. See {@link DispatcherOptions}.
|
package/dist/src/request.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/request.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,
|
|
1
|
+
{"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/request.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EACL,aAAa,EACb,YAAY,EACZ,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EACxB,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,WAAW,GACZ,MAAM,uBAAuB,CAAC;AAE/B,MAAM,CAAC,MAAM,+BAA+B,GAAG,OAAO,CAAC,CAAC,sBAAsB;AAC9E,MAAM,CAAC,MAAM,qBAAqB,GAAG,EAAE,CAAC;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GAAG,CAAC,UAAU,CACvB,CAAC;IACJ,CAAC;SAAM,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QAChC,OAAO,CACL,OAAO,CAAC,GAAG,CAAC,UAAU;YACtB,OAAO,CAAC,GAAG,CAAC,UAAU;YACtB,OAAO,CAAC,GAAG,CAAC,WAAW;YACvB,OAAO,CAAC,GAAG,CAAC,WAAW,CACxB,CAAC;IACJ,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,aAAa,EACb,YAAY,EACZ,mBAAmB,EACnB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC"}
|
package/dist/src/subprocess.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subprocess.d.ts","sourceRoot":"","sources":["../../src/subprocess.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"subprocess.d.ts","sourceRoot":"","sources":["../../src/subprocess.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,EAC/B,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,2BAA2B,EAAE,8BAA8B,EAAE,CAAC;AAEvE;;;;;;;;;;GAUG;AACH,wBAAsB,uBAAuB,CAC3C,4BAA4B,EAAE,MAAM,EACpC,IAAI,GAAE,MAAM,EAAO,EACnB,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAC/B,OAAO,CAAC,IAAI,CAAC,CAsBf"}
|
package/dist/src/subprocess.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { SubprocessFileNotFoundError, SubprocessPathIsDirectoryError, } from "./errors/subprocess.js";
|
|
3
3
|
import { exists, isDirectory } from "./fs.js";
|
|
4
|
+
export { SubprocessFileNotFoundError, SubprocessPathIsDirectoryError };
|
|
4
5
|
/**
|
|
5
6
|
* Spawns a detached subprocess to execute a given file with optional arguments.
|
|
6
7
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subprocess.js","sourceRoot":"","sources":["../../src/subprocess.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,GAC/B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE9C;;;;;;;;;;GAUG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAC3C,4BAAoC,EACpC,OAAiB,EAAE,EACnB,MAA8B,EAAE;IAEhC,IAAI,CAAC,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC;QAC3D,MAAM,IAAI,2BAA2B,CAAC,4BAA4B,CAAC,CAAC;IACtE,CAAC;IAED,IAAI,CAAC,MAAM,WAAW,CAAC,4BAA4B,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC/D,MAAM,IAAI,8BAA8B,CAAC,4BAA4B,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,cAAc,GAAG,CAAC,4BAA4B,EAAE,GAAG,IAAI,CAAC,CAAC;IAE/D,IAAI,4BAA4B,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACjD,cAAc,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE,cAAc,EAAE;QACzD,QAAQ,EAAE,IAAI;QACd,GAAG;QACH,KAAK,EAAE,QAAQ;KAChB,CAAC,CAAC;IAEH,UAAU,CAAC,KAAK,EAAE,CAAC;AACrB,CAAC"}
|
|
1
|
+
{"version":3,"file":"subprocess.js","sourceRoot":"","sources":["../../src/subprocess.ts"],"names":[],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}
|
|
121
|
+
/**
|
|
122
|
+
* A class that deduplicates the concurrent computations of an asynchronous
|
|
123
|
+
* operation based on a string key, by sharing the same Promise for all
|
|
124
|
+
* concurrent calls.
|
|
125
|
+
*
|
|
126
|
+
* This class is useful when the operation is expensive, or you need to
|
|
127
|
+
* guarantee that it's only executed once per key.
|
|
128
|
+
*
|
|
129
|
+
* For this cache to work correctly, the operation has to be either idempotent,
|
|
130
|
+
* or virtually idempotent (e.g. reading the same file multiple times in a very
|
|
131
|
+
* short time, in a context where it shouldn't be changed).
|
|
132
|
+
*
|
|
133
|
+
* The results of the first operation run per key are cached during the lifetime
|
|
134
|
+
* of the class, or until the `delete` or `clear` methods are called.
|
|
135
|
+
*
|
|
136
|
+
* Note that you should always use the same function/operation per cache key. If
|
|
137
|
+
* you call `getOrCompute` with the same key but different functions, the
|
|
138
|
+
* first function will be used for all the calls.
|
|
139
|
+
*
|
|
140
|
+
* Notes on async stack traces: This class is designed to preserve as much as
|
|
141
|
+
* possible of the producer async stack trace, including the place where the
|
|
142
|
+
* first `getOrCompute` computation is started and where the producer throws. To
|
|
143
|
+
* achieve this, you should provide an async lambda of the shape
|
|
144
|
+
* `async () => await myFunction()`, instead of directly passing `myFunction`.
|
|
145
|
+
* You should also try to immediately await the calls to `getOrCompute`.
|
|
146
|
+
*
|
|
147
|
+
* Concurrent callers for the same in-flight computation receive the same
|
|
148
|
+
* original thrown value, so their own `getOrCompute` call site won't
|
|
149
|
+
* necessarily be present in the error stack.
|
|
150
|
+
*
|
|
151
|
+
* Notes on concurrency: `getOrCompute` stores the in-flight promise in the
|
|
152
|
+
* cache before invoking the producer function. Subsequent calls with the same
|
|
153
|
+
* key, including synchronous same-key reentrant calls from the producer,
|
|
154
|
+
* observe that promise and await the same computation instead of invoking their
|
|
155
|
+
* own function. A producer must still not await a same-key reentrant call
|
|
156
|
+
* before completing, because it would wait on its own in-flight result.
|
|
157
|
+
*
|
|
158
|
+
* This guarantee only applies while the cache entry remains installed. Calling
|
|
159
|
+
* `delete` or `clear` during an in-flight computation lets later callers start
|
|
160
|
+
* a new computation, and the older in-flight result won't repopulate the cache.
|
|
161
|
+
*/
|
|
162
|
+
export declare class SharedPromiseCache<ValueT> {
|
|
163
|
+
#private;
|
|
164
|
+
/**
|
|
165
|
+
* Returns the cached value associated to the key, or computes it if needed,
|
|
166
|
+
* guaranteeing that it's only computed once per key.
|
|
167
|
+
*
|
|
168
|
+
* @param key The cache key associated to the value.
|
|
169
|
+
* @param fn The function that computes the value when it's not cached. Please
|
|
170
|
+
* read the class docs to understand the requirements it should meet.
|
|
171
|
+
* @returns The value.
|
|
172
|
+
* @throws The original value thrown or rejected by the function. Concurrent
|
|
173
|
+
* callers for the same in-flight computation observe the same thrown value, so
|
|
174
|
+
* their stack reflects the original computation, not necessarily each
|
|
175
|
+
* awaiting call site.
|
|
176
|
+
*/
|
|
177
|
+
getOrCompute(key: string, fn: () => Promise<ValueT>): Promise<ValueT>;
|
|
178
|
+
/**
|
|
179
|
+
* Returns the cached value associated to the key without invoking any
|
|
180
|
+
* producer. If the entry is in-flight, the value is not yet available and
|
|
181
|
+
* this method returns `undefined` exactly as it would for a missing key.
|
|
182
|
+
*
|
|
183
|
+
* Use this for synchronous fast-path lookups; if the result is `undefined`
|
|
184
|
+
* and you still want to compute the value, fall through to `getOrCompute`.
|
|
185
|
+
*
|
|
186
|
+
* Note that if `ValueT` includes `undefined` as a valid value, you won't be
|
|
187
|
+
* able to distinguish between a cached `undefined` and a missing/in-flight
|
|
188
|
+
* entry, but that's an intentional tradeoff to keep this method simple.
|
|
189
|
+
*
|
|
190
|
+
* @param key The cache key.
|
|
191
|
+
* @returns The cached value, or `undefined` if the key is missing or
|
|
192
|
+
* in-flight.
|
|
193
|
+
*/
|
|
194
|
+
peek(key: string): ValueT | undefined;
|
|
195
|
+
/**
|
|
196
|
+
* Iterates over the entries that are successfully resolved, yielding
|
|
197
|
+
* `[key, value]` pairs. In-flight entries are skipped because their value
|
|
198
|
+
* is not yet known, and failed ones are removed from the cache.
|
|
199
|
+
*
|
|
200
|
+
* Producers are never invoked.
|
|
201
|
+
*/
|
|
202
|
+
resolvedEntries(): IterableIterator<[string, ValueT]>;
|
|
203
|
+
/**
|
|
204
|
+
* Deletes the cached value associated to the key, if any. Note that this does
|
|
205
|
+
* not cancel any ongoing operation. Callers that already observed the
|
|
206
|
+
* in-flight promise will still wait for the original operation to complete,
|
|
207
|
+
* but callers that start after the deletion may start a new computation.
|
|
208
|
+
*
|
|
209
|
+
* @param key The cache key to delete.
|
|
210
|
+
*/
|
|
211
|
+
delete(key: string): void;
|
|
212
|
+
/**
|
|
213
|
+
* Clears the cache, removing all the stored values, but without cancelling
|
|
214
|
+
* any ongoing operation.
|
|
215
|
+
*/
|
|
216
|
+
clear(): void;
|
|
217
|
+
}
|
|
121
218
|
//# sourceMappingURL=synchronization.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"synchronization.d.ts","sourceRoot":"","sources":["../../src/synchronization.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"synchronization.d.ts","sourceRoot":"","sources":["../../src/synchronization.ts"],"names":[],"mappings":"AAoBA,OAAO,EACL,0CAA0C,EAC1C,kCAAkC,EAClC,0CAA0C,EAC1C,qCAAqC,EACrC,iCAAiC,EACjC,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AAgCrC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuEG;AACH,qBAAa,iBAAiB;;IAK5B;;;;;;;;OAQG;gBAED,kBAAkB,EAAE,MAAM,EAC1B,OAAO,CAAC,EAAE,MAAM,EAChB,mBAAmB,CAAC,EAAE,MAAM;IAY9B;;;;;OAKG;IACU,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IA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