@nomicfoundation/hardhat-utils 4.0.4 → 4.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/CHANGELOG.md +24 -0
- 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 +57 -0
- package/dist/src/fs.d.ts.map +1 -1
- package/dist/src/fs.js +200 -25
- package/dist/src/fs.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 +12 -0
- package/dist/src/internal/fs.d.ts.map +1 -0
- package/dist/src/internal/fs.js +42 -0
- package/dist/src/internal/fs.js.map +1 -0
- package/dist/src/runtime.d.ts +13 -0
- package/dist/src/runtime.d.ts.map +1 -0
- package/dist/src/runtime.js +34 -0
- package/dist/src/runtime.js.map +1 -0
- 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 +171 -2
- package/dist/src/synchronization.js.map +1 -1
- package/package.json +4 -4
- package/src/debug.ts +73 -28
- package/src/fast-semver.ts +95 -0
- package/src/fs.ts +272 -35
- package/src/internal/debug.ts +119 -0
- package/src/internal/fs.ts +57 -0
- package/src/runtime.ts +45 -0
- package/src/subprocess.ts +2 -0
- package/src/synchronization.ts +211 -3
|
@@ -118,4 +118,101 @@ export declare class AsyncMutex {
|
|
|
118
118
|
*/
|
|
119
119
|
exclusiveRun<ReturnT>(f: () => ReturnT): Promise<Awaited<ReturnT>>;
|
|
120
120
|
}
|
|
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;IAUpD;;;;;;;;OAQG;IACU,OAAO,IAAI,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CA+XrD;AAED;;;;;GAKG;AACH,qBAAa,UAAU;;IAIrB;;;;;;OAMG;IACU,YAAY,CAAC,OAAO,EAC/B,CAAC,EAAE,MAAM,OAAO,GACf,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;CA+B7B;AAiBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,qBAAa,kBAAkB,CAAC,MAAM;;IAGpC;;;;;;;;;;;;OAYG;IACU,YAAY,CACvB,GAAG,EAAE,MAAM,EACX,EAAE,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,GACxB,OAAO,CAAC,MAAM,CAAC;IAkDlB;;;;;;;;;;;;;;;OAeG;IACI,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAQ5C;;;;;;OAMG;IACK,eAAe,IAAI,gBAAgB,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAQ7D;;;;;;;OAOG;IACI,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAIhC;;;OAGG;IACI,KAAK,IAAI,IAAI;CA2BrB"}
|
|
@@ -2,13 +2,13 @@ import { randomUUID } from "node:crypto";
|
|
|
2
2
|
import * as fs from "node:fs";
|
|
3
3
|
import * as os from "node:os";
|
|
4
4
|
import * as path from "node:path";
|
|
5
|
-
import
|
|
5
|
+
import { createDebug } from "./debug.js";
|
|
6
6
|
import { ensureError, ensureNodeErrnoExceptionError } from "./error.js";
|
|
7
7
|
import { BaseMultiProcessMutexError, IncompatibleHostnameMultiProcessMutexError, IncompatiblePlatformMultiProcessMutexError, IncompatibleUidMultiProcessMutexError, InvalidMultiProcessMutexPathError, MultiProcessMutexError, MultiProcessMutexTimeoutError, StaleMultiProcessMutexError, } from "./errors/synchronization.js";
|
|
8
8
|
import { ensureDir } from "./fs.js";
|
|
9
9
|
import { sleep } from "./lang.js";
|
|
10
10
|
export { IncompatibleHostnameMultiProcessMutexError, IncompatibleMultiProcessMutexError, IncompatiblePlatformMultiProcessMutexError, IncompatibleUidMultiProcessMutexError, InvalidMultiProcessMutexPathError, MultiProcessMutexError, MultiProcessMutexTimeoutError, StaleMultiProcessMutexError, } from "./errors/synchronization.js";
|
|
11
|
-
const log =
|
|
11
|
+
const log = createDebug("hardhat:utils:synchronization");
|
|
12
12
|
const PROCESS_SESSION_ID = randomUUID();
|
|
13
13
|
const DEFAULT_TIMEOUT_MS = 60_000;
|
|
14
14
|
const DEFAULT_INITIAL_POLL_INTERVAL_MS = 5;
|
|
@@ -498,4 +498,173 @@ export class AsyncMutex {
|
|
|
498
498
|
});
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
|
+
/**
|
|
502
|
+
* A class that deduplicates the concurrent computations of an asynchronous
|
|
503
|
+
* operation based on a string key, by sharing the same Promise for all
|
|
504
|
+
* concurrent calls.
|
|
505
|
+
*
|
|
506
|
+
* This class is useful when the operation is expensive, or you need to
|
|
507
|
+
* guarantee that it's only executed once per key.
|
|
508
|
+
*
|
|
509
|
+
* For this cache to work correctly, the operation has to be either idempotent,
|
|
510
|
+
* or virtually idempotent (e.g. reading the same file multiple times in a very
|
|
511
|
+
* short time, in a context where it shouldn't be changed).
|
|
512
|
+
*
|
|
513
|
+
* The results of the first operation run per key are cached during the lifetime
|
|
514
|
+
* of the class, or until the `delete` or `clear` methods are called.
|
|
515
|
+
*
|
|
516
|
+
* Note that you should always use the same function/operation per cache key. If
|
|
517
|
+
* you call `getOrCompute` with the same key but different functions, the
|
|
518
|
+
* first function will be used for all the calls.
|
|
519
|
+
*
|
|
520
|
+
* Notes on async stack traces: This class is designed to preserve as much as
|
|
521
|
+
* possible of the producer async stack trace, including the place where the
|
|
522
|
+
* first `getOrCompute` computation is started and where the producer throws. To
|
|
523
|
+
* achieve this, you should provide an async lambda of the shape
|
|
524
|
+
* `async () => await myFunction()`, instead of directly passing `myFunction`.
|
|
525
|
+
* You should also try to immediately await the calls to `getOrCompute`.
|
|
526
|
+
*
|
|
527
|
+
* Concurrent callers for the same in-flight computation receive the same
|
|
528
|
+
* original thrown value, so their own `getOrCompute` call site won't
|
|
529
|
+
* necessarily be present in the error stack.
|
|
530
|
+
*
|
|
531
|
+
* Notes on concurrency: `getOrCompute` stores the in-flight promise in the
|
|
532
|
+
* cache before invoking the producer function. Subsequent calls with the same
|
|
533
|
+
* key, including synchronous same-key reentrant calls from the producer,
|
|
534
|
+
* observe that promise and await the same computation instead of invoking their
|
|
535
|
+
* own function. A producer must still not await a same-key reentrant call
|
|
536
|
+
* before completing, because it would wait on its own in-flight result.
|
|
537
|
+
*
|
|
538
|
+
* This guarantee only applies while the cache entry remains installed. Calling
|
|
539
|
+
* `delete` or `clear` during an in-flight computation lets later callers start
|
|
540
|
+
* a new computation, and the older in-flight result won't repopulate the cache.
|
|
541
|
+
*/
|
|
542
|
+
export class SharedPromiseCache {
|
|
543
|
+
#cache = new Map();
|
|
544
|
+
/**
|
|
545
|
+
* Returns the cached value associated to the key, or computes it if needed,
|
|
546
|
+
* guaranteeing that it's only computed once per key.
|
|
547
|
+
*
|
|
548
|
+
* @param key The cache key associated to the value.
|
|
549
|
+
* @param fn The function that computes the value when it's not cached. Please
|
|
550
|
+
* read the class docs to understand the requirements it should meet.
|
|
551
|
+
* @returns The value.
|
|
552
|
+
* @throws The original value thrown or rejected by the function. Concurrent
|
|
553
|
+
* callers for the same in-flight computation observe the same thrown value, so
|
|
554
|
+
* their stack reflects the original computation, not necessarily each
|
|
555
|
+
* awaiting call site.
|
|
556
|
+
*/
|
|
557
|
+
async getOrCompute(key, fn) {
|
|
558
|
+
const cached = this.#cache.get(key);
|
|
559
|
+
if (cached !== undefined) {
|
|
560
|
+
if (!(cached instanceof Promise)) {
|
|
561
|
+
return cached.value;
|
|
562
|
+
}
|
|
563
|
+
const cachedResult = await cached;
|
|
564
|
+
this.#updateResolvedPromiseCache(key, cached, cachedResult);
|
|
565
|
+
if (cachedResult.success) {
|
|
566
|
+
return cachedResult.value;
|
|
567
|
+
}
|
|
568
|
+
throw cachedResult.error;
|
|
569
|
+
}
|
|
570
|
+
// Create and cache the in-flight promise before invoking `fn`, because
|
|
571
|
+
// `fn` can synchronously re-enter `getOrCompute` with the same key. The
|
|
572
|
+
// reentrant call must observe this promise instead of a cache miss, or it
|
|
573
|
+
// could start a second computation for the same key.
|
|
574
|
+
//
|
|
575
|
+
// `Promise.withResolvers` lets the first caller still await `fn` directly,
|
|
576
|
+
// preserving the producer async stack.
|
|
577
|
+
const { promise, resolve } = Promise.withResolvers();
|
|
578
|
+
this.#cache.set(key, promise);
|
|
579
|
+
let result;
|
|
580
|
+
try {
|
|
581
|
+
const value = await fn();
|
|
582
|
+
result = { success: true, value };
|
|
583
|
+
}
|
|
584
|
+
catch (error) {
|
|
585
|
+
result = { success: false, error };
|
|
586
|
+
}
|
|
587
|
+
resolve(result);
|
|
588
|
+
this.#updateResolvedPromiseCache(key, promise, result);
|
|
589
|
+
if (result.success) {
|
|
590
|
+
return result.value;
|
|
591
|
+
}
|
|
592
|
+
throw result.error;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Returns the cached value associated to the key without invoking any
|
|
596
|
+
* producer. If the entry is in-flight, the value is not yet available and
|
|
597
|
+
* this method returns `undefined` exactly as it would for a missing key.
|
|
598
|
+
*
|
|
599
|
+
* Use this for synchronous fast-path lookups; if the result is `undefined`
|
|
600
|
+
* and you still want to compute the value, fall through to `getOrCompute`.
|
|
601
|
+
*
|
|
602
|
+
* Note that if `ValueT` includes `undefined` as a valid value, you won't be
|
|
603
|
+
* able to distinguish between a cached `undefined` and a missing/in-flight
|
|
604
|
+
* entry, but that's an intentional tradeoff to keep this method simple.
|
|
605
|
+
*
|
|
606
|
+
* @param key The cache key.
|
|
607
|
+
* @returns The cached value, or `undefined` if the key is missing or
|
|
608
|
+
* in-flight.
|
|
609
|
+
*/
|
|
610
|
+
peek(key) {
|
|
611
|
+
const cached = this.#cache.get(key);
|
|
612
|
+
if (cached === undefined || cached instanceof Promise) {
|
|
613
|
+
return undefined;
|
|
614
|
+
}
|
|
615
|
+
return cached.value;
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Iterates over the entries that are successfully resolved, yielding
|
|
619
|
+
* `[key, value]` pairs. In-flight entries are skipped because their value
|
|
620
|
+
* is not yet known, and failed ones are removed from the cache.
|
|
621
|
+
*
|
|
622
|
+
* Producers are never invoked.
|
|
623
|
+
*/
|
|
624
|
+
*resolvedEntries() {
|
|
625
|
+
for (const [key, cached] of this.#cache) {
|
|
626
|
+
if (!(cached instanceof Promise)) {
|
|
627
|
+
yield [key, cached.value];
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* Deletes the cached value associated to the key, if any. Note that this does
|
|
633
|
+
* not cancel any ongoing operation. Callers that already observed the
|
|
634
|
+
* in-flight promise will still wait for the original operation to complete,
|
|
635
|
+
* but callers that start after the deletion may start a new computation.
|
|
636
|
+
*
|
|
637
|
+
* @param key The cache key to delete.
|
|
638
|
+
*/
|
|
639
|
+
delete(key) {
|
|
640
|
+
this.#cache.delete(key);
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Clears the cache, removing all the stored values, but without cancelling
|
|
644
|
+
* any ongoing operation.
|
|
645
|
+
*/
|
|
646
|
+
clear() {
|
|
647
|
+
this.#cache.clear();
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Updates the cache if needed once a promise got resolved.
|
|
651
|
+
*
|
|
652
|
+
* @param key The cache key.
|
|
653
|
+
* @param promise The promise that got resolved.
|
|
654
|
+
* @param result The result of the resolved promise.
|
|
655
|
+
*/
|
|
656
|
+
#updateResolvedPromiseCache(key, promise, result) {
|
|
657
|
+
// We only update the cache if the cached promise is still the one that got
|
|
658
|
+
// resolved, which may not always be the case. The reason is that the
|
|
659
|
+
// resolved promise may have been deleted and/or replaced in the cache.
|
|
660
|
+
if (this.#cache.get(key) === promise) {
|
|
661
|
+
if (result.success) {
|
|
662
|
+
this.#cache.set(key, { success: true, value: result.value });
|
|
663
|
+
}
|
|
664
|
+
else {
|
|
665
|
+
this.#cache.delete(key);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
}
|
|
501
670
|
//# sourceMappingURL=synchronization.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"synchronization.js","sourceRoot":"","sources":["../../src/synchronization.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,WAAW,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EACL,0BAA0B,EAC1B,0CAA0C,EAC1C,0CAA0C,EAC1C,qCAAqC,EACrC,iCAAiC,EACjC,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAElC,OAAO,EACL,0CAA0C,EAC1C,kCAAkC,EAClC,0CAA0C,EAC1C,qCAAqC,EACrC,iCAAiC,EACjC,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,6BAA6B,CAAC;AAErC,MAAM,GAAG,GAAG,KAAK,CAAC,kCAAkC,CAAC,CAAC;AAEtD,MAAM,kBAAkB,GAAG,UAAU,EAA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AOG;IACI,MAAM,CAAC,GAAW;QACvB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC1B,CAAC;IAED;;;OAGG;IACI,KAAK;QACV,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;IACtB,CAAC;IAED;;;;;;OAMG;IACH,2BAA2B,CACzB,GAAW,EACX,OAAsD,EACtD,MAA4C;QAE5C,2EAA2E;QAC3E,qEAAqE;QACrE,uEAAuE;QACvE,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC;YACrC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACnB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC;YAC/D,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAC1B,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nomicfoundation/hardhat-utils",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Utilities for Hardhat and its plugins",
|
|
5
5
|
"homepage": "https://github.com/NomicFoundation/hardhat/tree/main/packages/hardhat-utils",
|
|
6
6
|
"repository": {
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"./env": "./dist/src/env.js",
|
|
24
24
|
"./error": "./dist/src/error.js",
|
|
25
25
|
"./eth": "./dist/src/eth.js",
|
|
26
|
+
"./fast-semver": "./dist/src/fast-semver.js",
|
|
26
27
|
"./format": "./dist/src/format.js",
|
|
27
28
|
"./fs": "./dist/src/fs.js",
|
|
28
29
|
"./global-dir": "./dist/src/global-dir.js",
|
|
@@ -33,6 +34,7 @@
|
|
|
33
34
|
"./panic-errors": "./dist/src/panic-errors.js",
|
|
34
35
|
"./path": "./dist/src/path.js",
|
|
35
36
|
"./request": "./dist/src/request.js",
|
|
37
|
+
"./runtime": "./dist/src/runtime.js",
|
|
36
38
|
"./string": "./dist/src/string.js",
|
|
37
39
|
"./stream": "./dist/src/stream.js",
|
|
38
40
|
"./subprocess": "./dist/src/subprocess.js",
|
|
@@ -52,9 +54,8 @@
|
|
|
52
54
|
"README.md"
|
|
53
55
|
],
|
|
54
56
|
"devDependencies": {
|
|
55
|
-
"@nomicfoundation/hardhat-node-test-reporter": "^3.0.
|
|
57
|
+
"@nomicfoundation/hardhat-node-test-reporter": "^3.0.6",
|
|
56
58
|
"@types/bn.js": "^5.1.5",
|
|
57
|
-
"@types/debug": "^4.1.7",
|
|
58
59
|
"@types/node": "^22.0.0",
|
|
59
60
|
"c8": "^9.1.0",
|
|
60
61
|
"eslint": "9.25.1",
|
|
@@ -66,7 +67,6 @@
|
|
|
66
67
|
},
|
|
67
68
|
"dependencies": {
|
|
68
69
|
"@streamparser/json-node": "^0.0.22",
|
|
69
|
-
"debug": "^4.3.2",
|
|
70
70
|
"env-paths": "^2.2.0",
|
|
71
71
|
"ethereum-cryptography": "^2.2.1",
|
|
72
72
|
"fast-equals": "^5.4.0",
|
package/src/debug.ts
CHANGED
|
@@ -1,38 +1,83 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { formatWithOptions } from "node:util";
|
|
2
|
+
|
|
3
|
+
import { NOOP, isEnabled, selectColor, useColors } from "./internal/debug.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* A logger function returned by {@link createDebug}.
|
|
7
|
+
* The `enabled` property is `true` when the logger will produce output.
|
|
8
|
+
*/
|
|
9
|
+
export interface DebugLogger {
|
|
10
|
+
(format: unknown, ...args: unknown[]): void;
|
|
11
|
+
readonly enabled: boolean;
|
|
12
|
+
}
|
|
2
13
|
|
|
3
14
|
/**
|
|
4
|
-
*
|
|
15
|
+
* Creates a namespaced logger controlled by the `DEBUG` env var.
|
|
5
16
|
*
|
|
6
|
-
*
|
|
17
|
+
* If `namespace` matches `DEBUG`, the logger writes to `process.stderr`;
|
|
18
|
+
* otherwise, it is a no-op. Additionally, `logger.enabled` is `true` when
|
|
19
|
+
* the namespace matches `DEBUG`, allowing you to conditionally run expensive
|
|
20
|
+
* diagnostics.
|
|
7
21
|
*
|
|
8
|
-
*
|
|
22
|
+
* `DEBUG` should be a comma- or whitespace-separated list of patterns.
|
|
23
|
+
* `*` is a wildcard and a leading `-` negates a pattern (e.g.
|
|
24
|
+
* `hardhat:*,-hardhat:noisy`).
|
|
9
25
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
26
|
+
* Messages are formatted using `node:util.format`, allowing you to use format
|
|
27
|
+
* specifiers like `%O`, `%o`, `%s`, `%d`, `%j`. Extra arguments without a
|
|
28
|
+
* matching specifier are inspected automatically.
|
|
29
|
+
*
|
|
30
|
+
* Output is colorized per namespace when `stderr` is a TTY. Set
|
|
31
|
+
* `DEBUG_COLORS=no` or `false` to disable colors.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const log = createDebug("hardhat:utils:foo");
|
|
36
|
+
* log("Starting up");
|
|
37
|
+
* log("Received %O", payload);
|
|
38
|
+
* log("Saved data", id, filePath);
|
|
39
|
+
*
|
|
40
|
+
* if (log.enabled) {
|
|
41
|
+
* // expensive diagnostics that should only run while debugging
|
|
14
42
|
* }
|
|
15
43
|
* ```
|
|
44
|
+
*
|
|
45
|
+
* ```sh
|
|
46
|
+
* DEBUG="hardhat:*,-hardhat:noisy" DEBUG_COLORS=no pnpm hardhat run script.js
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @param namespace Namespace used for filtering and as the log prefix.
|
|
50
|
+
* @returns Logger function, or a shared no-op if disabled.
|
|
16
51
|
*/
|
|
17
|
-
export function
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
52
|
+
export function createDebug(namespace: string): DebugLogger {
|
|
53
|
+
if (!isEnabled(namespace, process.env.DEBUG ?? "")) {
|
|
54
|
+
return NOOP;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const colors = useColors();
|
|
58
|
+
const color = colors ? selectColor(namespace) : undefined;
|
|
59
|
+
const prefix =
|
|
60
|
+
color !== undefined
|
|
61
|
+
? `\x1b[38;5;${color};1m ${namespace}\x1b[0m`
|
|
62
|
+
: ` ${namespace}`;
|
|
63
|
+
const suffixOpen = color !== undefined ? `\x1b[38;5;${color}m` : "";
|
|
64
|
+
const suffixClose = color !== undefined ? `\x1b[0m` : "";
|
|
65
|
+
let prev = 0;
|
|
66
|
+
|
|
67
|
+
const logger = (format: unknown, ...args: unknown[]): void => {
|
|
68
|
+
const now = Date.now();
|
|
69
|
+
const diff = prev === 0 ? 0 : now - prev;
|
|
70
|
+
prev = now;
|
|
71
|
+
|
|
72
|
+
const body =
|
|
73
|
+
args.length === 0 && typeof format === "string"
|
|
74
|
+
? format
|
|
75
|
+
: formatWithOptions({ colors }, format, ...args);
|
|
76
|
+
|
|
77
|
+
process.stderr.write(
|
|
78
|
+
`${prefix} ${body} ${suffixOpen}+${diff}ms${suffixClose}\n`,
|
|
79
|
+
);
|
|
37
80
|
};
|
|
81
|
+
|
|
82
|
+
return Object.assign(logger, { enabled: true });
|
|
38
83
|
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A small, fast subset of semver: strict `MAJOR.MINOR.PATCH` parsing and
|
|
3
|
+
* triple-wise comparison helpers.
|
|
4
|
+
*
|
|
5
|
+
* This module exists because the full `semver` package is slow to load and is
|
|
6
|
+
* overkill for the many call sites in Hardhat that compare against hard-coded
|
|
7
|
+
* `x.y.z` literals. For range grammar (caret/tilde, disjunctions, prerelease
|
|
8
|
+
* subset, etc.) keep using `semver`.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export type SemverVersion = [major: number, minor: number, patch: number];
|
|
12
|
+
|
|
13
|
+
const VERSION_REGEX = /^(\d+)\.(\d+)\.(\d+)(?:\+[0-9A-Za-z.-]+)?$/;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Parses a strict `MAJOR.MINOR.PATCH` version string into a `SemverVersion`
|
|
17
|
+
* tuple.
|
|
18
|
+
*
|
|
19
|
+
* An optional `+build` suffix is accepted and stripped silently. A
|
|
20
|
+
* `-prerelease` suffix is rejected.
|
|
21
|
+
*
|
|
22
|
+
* @param version The version string to parse.
|
|
23
|
+
* @returns The parsed `SemverVersion`, or `undefined` if the input does not
|
|
24
|
+
* match the strict `\d+\.\d+\.\d+` shape.
|
|
25
|
+
*/
|
|
26
|
+
export function parseVersion(version: string): SemverVersion | undefined {
|
|
27
|
+
const match = VERSION_REGEX.exec(version);
|
|
28
|
+
if (match === null) {
|
|
29
|
+
return undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* `Array#sort`-style comparator for `SemverVersion` tuples: returns a negative
|
|
37
|
+
* number, zero, or a positive number depending on whether `a` is lower than,
|
|
38
|
+
* equal to, or greater than `b`.
|
|
39
|
+
*/
|
|
40
|
+
export function compare(a: SemverVersion, b: SemverVersion): number {
|
|
41
|
+
if (a[0] !== b[0]) {
|
|
42
|
+
return a[0] - b[0];
|
|
43
|
+
}
|
|
44
|
+
if (a[1] !== b[1]) {
|
|
45
|
+
return a[1] - b[1];
|
|
46
|
+
}
|
|
47
|
+
return a[2] - b[2];
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Returns `true` if `a` and `b` represent the same `MAJOR.MINOR.PATCH`.
|
|
52
|
+
*/
|
|
53
|
+
export function equals(a: SemverVersion, b: SemverVersion): boolean {
|
|
54
|
+
return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Returns `true` if `compared` is strictly lower than `comparator`.
|
|
59
|
+
*/
|
|
60
|
+
export function lowerThan(
|
|
61
|
+
compared: SemverVersion,
|
|
62
|
+
comparator: SemverVersion,
|
|
63
|
+
): boolean {
|
|
64
|
+
return compare(compared, comparator) < 0;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Returns `true` if `compared` is lower than or equal to `comparator`.
|
|
69
|
+
*/
|
|
70
|
+
export function lowerThanOrEqual(
|
|
71
|
+
compared: SemverVersion,
|
|
72
|
+
comparator: SemverVersion,
|
|
73
|
+
): boolean {
|
|
74
|
+
return compare(compared, comparator) <= 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Returns `true` if `compared` is strictly greater than `comparator`.
|
|
79
|
+
*/
|
|
80
|
+
export function greaterThan(
|
|
81
|
+
compared: SemverVersion,
|
|
82
|
+
comparator: SemverVersion,
|
|
83
|
+
): boolean {
|
|
84
|
+
return compare(compared, comparator) > 0;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Returns `true` if `compared` is greater than or equal to `comparator`.
|
|
89
|
+
*/
|
|
90
|
+
export function greaterThanOrEqual(
|
|
91
|
+
compared: SemverVersion,
|
|
92
|
+
comparator: SemverVersion,
|
|
93
|
+
): boolean {
|
|
94
|
+
return compare(compared, comparator) >= 0;
|
|
95
|
+
}
|