@shopify/cli 3.74.1 → 3.75.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/dist/assets/hydrogen/starter/CHANGELOG.md +99 -0
- package/dist/assets/hydrogen/starter/app/components/ProductForm.tsx +2 -1
- package/dist/assets/hydrogen/starter/app/root.tsx +12 -2
- package/dist/assets/hydrogen/starter/app/routes/collections._index.tsx +1 -0
- package/dist/assets/hydrogen/starter/package.json +10 -10
- package/dist/assets/hydrogen/starter/tsconfig.json +1 -1
- package/dist/assets/hydrogen/starter/vite.config.ts +1 -0
- package/dist/assets/hydrogen/tailwind/package.json +1 -1
- package/dist/assets/hydrogen/tailwind/tailwind.css +1 -1
- package/dist/assets/hydrogen/vite/package.json +1 -1
- package/dist/assets/hydrogen/vite/vite.config.js +1 -0
- package/dist/{chunk-Z4WWAZEY.js → chunk-245U5NQK.js} +4 -4
- package/dist/{chunk-5L3V3XN7.js → chunk-2TEPYAPA.js} +4 -4
- package/dist/{chunk-CKTTNTVQ.js → chunk-4EZQAZ74.js} +7 -7
- package/dist/{chunk-4VWVAF7H.js → chunk-4MJNU2QF.js} +3 -3
- package/dist/{chunk-C2KCEZK7.js → chunk-5CJ7VYH7.js} +2 -2
- package/dist/{chunk-XCOZPDGL.js → chunk-63Z76ANM.js} +2 -2
- package/dist/{chunk-7HJY7CZB.js → chunk-7CQUOSVH.js} +6 -6
- package/dist/{chunk-POKIPHUC.js → chunk-7HSAZRHC.js} +3 -3
- package/dist/{chunk-7DCZ4PEB.js → chunk-7OOACYZ4.js} +3 -3
- package/dist/{chunk-6N46HJWX.js → chunk-CV5T4LOB.js} +3 -3
- package/dist/{chunk-IVI5VH2V.js → chunk-DXX7H2IH.js} +2 -2
- package/dist/{chunk-S7L4E7JJ.js → chunk-FGC2O2I5.js} +6 -6
- package/dist/{chunk-X2GSBUQM.js → chunk-FTFTFTDU.js} +4 -4
- package/dist/{chunk-P6UIGUUZ.js → chunk-H3VLXETQ.js} +2 -2
- package/dist/{chunk-H6V3ZAMP.js → chunk-IEEXWVOL.js} +2 -2
- package/dist/{chunk-BGCAU2LM.js → chunk-IHA7JJN4.js} +2 -2
- package/dist/{chunk-GSDR4V4C.js → chunk-IMWIHPKY.js} +3 -3
- package/dist/{chunk-QVSOZYZT.js → chunk-IRNTKQVQ.js} +3 -3
- package/dist/{chunk-RAAPXB5S.js → chunk-JS6RLMBK.js} +3 -3
- package/dist/{chunk-DH65BORI.js → chunk-KR2ZEBN3.js} +5 -5
- package/dist/{chunk-DDHWVLT7.js → chunk-LJHVF5TJ.js} +9970 -9968
- package/dist/{chunk-5CLGH5PH.js → chunk-MP5RLDFN.js} +15 -8
- package/dist/{chunk-PLIMIFMY.js → chunk-MTPFCNYB.js} +3 -3
- package/dist/{chunk-POBZPEHK.js → chunk-NA34VFTA.js} +430 -207
- package/dist/{chunk-J673ZU5S.js → chunk-ORGKANED.js} +3 -3
- package/dist/{chunk-LOKVDI3S.js → chunk-P654UJXI.js} +15 -14
- package/dist/{chunk-FKB56THZ.js → chunk-PB3V422W.js} +5 -5
- package/dist/{chunk-AQFGEPN5.js → chunk-PDZHLRZ2.js} +8 -8
- package/dist/{chunk-VKUWRIWE.js → chunk-S3NMVYAF.js} +4 -4
- package/dist/{chunk-DNKTPUYV.js → chunk-SXT3JFLA.js} +4 -4
- package/dist/{chunk-6J2OGZ3N.js → chunk-U673QDO3.js} +2 -2
- package/dist/{chunk-MCL7WC6G.js → chunk-UEEQNXRY.js} +3 -3
- package/dist/{chunk-L5L7GDSR.js → chunk-UYZDNGSJ.js} +2 -2
- package/dist/{chunk-WYNFQEFV.js → chunk-VSC4NMYT.js} +3 -3
- package/dist/{chunk-CDQA3SST.js → chunk-VSKRQ3JT.js} +33 -29
- package/dist/{chunk-AKL7T64Q.js → chunk-Y53XECL6.js} +34 -34
- package/dist/{chunk-CGXWFHRF.js → chunk-Y5RMFD7I.js} +3 -3
- package/dist/{chunk-TLXMY7OM.js → chunk-YEOP3EMX.js} +94 -17
- package/dist/{chunk-TKPN642B.js → chunk-ZJSUUIVI.js} +14 -10
- package/dist/cli/commands/auth/logout.js +14 -15
- package/dist/cli/commands/auth/logout.test.js +16 -17
- package/dist/cli/commands/cache/clear.js +13 -14
- package/dist/cli/commands/debug/command-flags.js +13 -14
- package/dist/cli/commands/docs/generate.js +13 -14
- package/dist/cli/commands/docs/generate.test.js +14 -15
- package/dist/cli/commands/help.js +13 -14
- package/dist/cli/commands/kitchen-sink/async.js +14 -15
- package/dist/cli/commands/kitchen-sink/async.test.js +15 -16
- package/dist/cli/commands/kitchen-sink/index.js +16 -17
- package/dist/cli/commands/kitchen-sink/index.test.js +17 -18
- package/dist/cli/commands/kitchen-sink/prompts.js +14 -15
- package/dist/cli/commands/kitchen-sink/prompts.test.js +15 -16
- package/dist/cli/commands/kitchen-sink/static.js +14 -15
- package/dist/cli/commands/kitchen-sink/static.test.js +15 -16
- package/dist/cli/commands/notifications/generate.js +14 -15
- package/dist/cli/commands/notifications/list.js +14 -15
- package/dist/cli/commands/search.js +14 -15
- package/dist/cli/commands/upgrade.js +14 -15
- package/dist/cli/commands/upgrade.test.js +1 -2
- package/dist/cli/commands/version.js +14 -15
- package/dist/cli/commands/version.test.js +15 -16
- package/dist/cli/services/commands/notifications.js +8 -9
- package/dist/cli/services/commands/search.js +4 -5
- package/dist/cli/services/commands/search.test.js +5 -6
- package/dist/cli/services/commands/version.js +5 -6
- package/dist/cli/services/commands/version.test.js +7 -8
- package/dist/cli/services/kitchen-sink/async.js +4 -5
- package/dist/cli/services/kitchen-sink/prompts.js +4 -5
- package/dist/cli/services/kitchen-sink/static.js +4 -5
- package/dist/cli/services/upgrade.js +5 -6
- package/dist/cli/services/upgrade.test.js +8 -9
- package/dist/{custom-oclif-loader-YCFOTKOV.js → custom-oclif-loader-5N4JRQ46.js} +4 -5
- package/dist/{del-FBU5JYXS.js → del-2SYBVRHB.js} +2 -2
- package/dist/devtools-BA4WST2D.js +72 -0
- package/dist/{error-handler-S6ZLT6DF.js → error-handler-VQHDL26P.js} +11 -12
- package/dist/hooks/postrun.js +9 -10
- package/dist/hooks/prerun.js +9 -10
- package/dist/index.js +28956 -12558
- package/dist/{lib-E2DSNKUX.js → lib-SGEWXU7Z.js} +3 -3
- package/dist/{local-62JTGJVG.js → local-NKJECUJ3.js} +6 -5
- package/dist/{magic-string.es-PJMYOE6F.js → magic-string.es-BSVDQOZI.js} +32 -20
- package/dist/{morph-ACVSDUS7.js → morph-BTANDGVW.js} +9 -9
- package/dist/{node-M7KO76D7.js → node-RIZFDTN7.js} +17 -18
- package/dist/{node-package-manager-RXCBZVWU.js → node-package-manager-EOSRJYAN.js} +5 -6
- package/dist/{npa-JAX2F6CO.js → npa-E675GQOI.js} +123 -33
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/{ui-CEJ6R3AV.js → ui-II7LUT5P.js} +4 -5
- package/dist/{workerd-WLX2SY5E.js → workerd-SKOXR5SE.js} +16 -17
- package/oclif.manifest.json +33 -62
- package/package.json +11 -10
- package/dist/chunk-CFIKVUNW.js +0 -45
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
init_cjs_shims
|
|
11
11
|
} from "./chunk-PKR7KJ6P.js";
|
|
12
12
|
|
|
13
|
-
// ../../node_modules/.pnpm/lru-cache@10.
|
|
13
|
+
// ../../node_modules/.pnpm/lru-cache@10.4.3/node_modules/lru-cache/dist/commonjs/index.js
|
|
14
14
|
var require_commonjs = __commonJS({
|
|
15
|
-
"../../node_modules/.pnpm/lru-cache@10.
|
|
15
|
+
"../../node_modules/.pnpm/lru-cache@10.4.3/node_modules/lru-cache/dist/commonjs/index.js"(exports) {
|
|
16
16
|
"use strict";
|
|
17
17
|
init_cjs_shims();
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
@@ -76,14 +76,13 @@ var require_commonjs = __commonJS({
|
|
|
76
76
|
return this.heap[--this.length];
|
|
77
77
|
}
|
|
78
78
|
}, LRUCache = class _LRUCache {
|
|
79
|
-
//
|
|
80
|
-
// really *need* to be protected. The rest can be modified, as they just
|
|
81
|
-
// set defaults for various methods.
|
|
79
|
+
// options that cannot be changed without disaster
|
|
82
80
|
#max;
|
|
83
81
|
#maxSize;
|
|
84
82
|
#dispose;
|
|
85
83
|
#disposeAfter;
|
|
86
84
|
#fetchMethod;
|
|
85
|
+
#memoMethod;
|
|
87
86
|
/**
|
|
88
87
|
* {@link LRUCache.OptionsBase.ttl}
|
|
89
88
|
*/
|
|
@@ -229,6 +228,9 @@ var require_commonjs = __commonJS({
|
|
|
229
228
|
get fetchMethod() {
|
|
230
229
|
return this.#fetchMethod;
|
|
231
230
|
}
|
|
231
|
+
get memoMethod() {
|
|
232
|
+
return this.#memoMethod;
|
|
233
|
+
}
|
|
232
234
|
/**
|
|
233
235
|
* {@link LRUCache.OptionsBase.dispose} (read-only)
|
|
234
236
|
*/
|
|
@@ -242,7 +244,7 @@ var require_commonjs = __commonJS({
|
|
|
242
244
|
return this.#disposeAfter;
|
|
243
245
|
}
|
|
244
246
|
constructor(options) {
|
|
245
|
-
let { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
|
|
247
|
+
let { max = 0, ttl, ttlResolution = 1, ttlAutopurge, updateAgeOnGet, updateAgeOnHas, allowStale, dispose, disposeAfter, noDisposeOnSet, noUpdateTTL, maxSize = 0, maxEntrySize = 0, sizeCalculation, fetchMethod, memoMethod, noDeleteOnFetchRejection, noDeleteOnStaleGet, allowStaleOnFetchRejection, allowStaleOnFetchAbort, ignoreFetchAbort } = options;
|
|
246
248
|
if (max !== 0 && !isPosInt(max))
|
|
247
249
|
throw new TypeError("max option must be a nonnegative integer");
|
|
248
250
|
let UintArray = max ? getUintArray(max) : Array;
|
|
@@ -254,7 +256,9 @@ var require_commonjs = __commonJS({
|
|
|
254
256
|
if (typeof this.sizeCalculation != "function")
|
|
255
257
|
throw new TypeError("sizeCalculation set to non-function");
|
|
256
258
|
}
|
|
257
|
-
if (
|
|
259
|
+
if (memoMethod !== void 0 && typeof memoMethod != "function")
|
|
260
|
+
throw new TypeError("memoMethod must be a function if defined");
|
|
261
|
+
if (this.#memoMethod = memoMethod, fetchMethod !== void 0 && typeof fetchMethod != "function")
|
|
258
262
|
throw new TypeError("fetchMethod must be a function if specified");
|
|
259
263
|
if (this.#fetchMethod = fetchMethod, this.#hasFetchMethod = !!fetchMethod, this.#keyMap = /* @__PURE__ */ new Map(), this.#keyList = new Array(max).fill(void 0), this.#valList = new Array(max).fill(void 0), this.#next = new UintArray(max), this.#prev = new UintArray(max), this.#head = 0, this.#tail = 0, this.#free = Stack.create(max), this.#size = 0, this.#calculatedSize = 0, typeof dispose == "function" && (this.#dispose = dispose), typeof disposeAfter == "function" ? (this.#disposeAfter = disposeAfter, this.#disposed = []) : (this.#disposeAfter = void 0, this.#disposed = void 0), this.#hasDispose = !!this.#dispose, this.#hasDisposeAfter = !!this.#disposeAfter, this.noDisposeOnSet = !!noDisposeOnSet, this.noUpdateTTL = !!noUpdateTTL, this.noDeleteOnFetchRejection = !!noDeleteOnFetchRejection, this.allowStaleOnFetchRejection = !!allowStaleOnFetchRejection, this.allowStaleOnFetchAbort = !!allowStaleOnFetchAbort, this.ignoreFetchAbort = !!ignoreFetchAbort, this.maxEntrySize !== 0) {
|
|
260
264
|
if (this.#maxSize !== 0 && !isPosInt(this.#maxSize))
|
|
@@ -276,7 +280,8 @@ var require_commonjs = __commonJS({
|
|
|
276
280
|
}
|
|
277
281
|
}
|
|
278
282
|
/**
|
|
279
|
-
* Return the
|
|
283
|
+
* Return the number of ms left in the item's TTL. If item is not in cache,
|
|
284
|
+
* returns `0`. Returns `Infinity` if item is in cache without a defined TTL.
|
|
280
285
|
*/
|
|
281
286
|
getRemainingTTL(key) {
|
|
282
287
|
return this.#keyMap.has(key) ? 1 / 0 : 0;
|
|
@@ -286,7 +291,7 @@ var require_commonjs = __commonJS({
|
|
|
286
291
|
this.#ttls = ttls, this.#starts = starts, this.#setItemTTL = (index, ttl, start = perf.now()) => {
|
|
287
292
|
if (starts[index] = ttl !== 0 ? start : 0, ttls[index] = ttl, ttl !== 0 && this.ttlAutopurge) {
|
|
288
293
|
let t = setTimeout(() => {
|
|
289
|
-
this.#isStale(index) && this
|
|
294
|
+
this.#isStale(index) && this.#delete(this.#keyList[index], "expire");
|
|
290
295
|
}, ttl + 1);
|
|
291
296
|
t.unref && t.unref();
|
|
292
297
|
}
|
|
@@ -447,13 +452,14 @@ var require_commonjs = __commonJS({
|
|
|
447
452
|
return this.entries();
|
|
448
453
|
}
|
|
449
454
|
/**
|
|
450
|
-
* A String value that is used in the creation of the default string
|
|
451
|
-
* Called by the built-in method
|
|
455
|
+
* A String value that is used in the creation of the default string
|
|
456
|
+
* description of an object. Called by the built-in method
|
|
457
|
+
* `Object.prototype.toString`.
|
|
452
458
|
*/
|
|
453
459
|
[Symbol.toStringTag] = "LRUCache";
|
|
454
460
|
/**
|
|
455
461
|
* Find a value for which the supplied fn method returns a truthy value,
|
|
456
|
-
* similar to Array.find()
|
|
462
|
+
* similar to `Array.find()`. fn is called as `fn(value, key, cache)`.
|
|
457
463
|
*/
|
|
458
464
|
find(fn, getOptions = {}) {
|
|
459
465
|
for (let i of this.#indexes()) {
|
|
@@ -463,10 +469,15 @@ var require_commonjs = __commonJS({
|
|
|
463
469
|
}
|
|
464
470
|
}
|
|
465
471
|
/**
|
|
466
|
-
* Call the supplied function on each item in the cache, in order from
|
|
467
|
-
*
|
|
468
|
-
*
|
|
469
|
-
*
|
|
472
|
+
* Call the supplied function on each item in the cache, in order from most
|
|
473
|
+
* recently used to least recently used.
|
|
474
|
+
*
|
|
475
|
+
* `fn` is called as `fn(value, key, cache)`.
|
|
476
|
+
*
|
|
477
|
+
* If `thisp` is provided, function will be called in the `this`-context of
|
|
478
|
+
* the provided object, or the cache if no `thisp` object is provided.
|
|
479
|
+
*
|
|
480
|
+
* Does not update age or recenty of use, or iterate over stale values.
|
|
470
481
|
*/
|
|
471
482
|
forEach(fn, thisp = this) {
|
|
472
483
|
for (let i of this.#indexes()) {
|
|
@@ -491,14 +502,20 @@ var require_commonjs = __commonJS({
|
|
|
491
502
|
purgeStale() {
|
|
492
503
|
let deleted = !1;
|
|
493
504
|
for (let i of this.#rindexes({ allowStale: !0 }))
|
|
494
|
-
this.#isStale(i) && (this
|
|
505
|
+
this.#isStale(i) && (this.#delete(this.#keyList[i], "expire"), deleted = !0);
|
|
495
506
|
return deleted;
|
|
496
507
|
}
|
|
497
508
|
/**
|
|
498
509
|
* Get the extended info about a given entry, to get its value, size, and
|
|
499
|
-
* TTL info simultaneously.
|
|
500
|
-
*
|
|
501
|
-
*
|
|
510
|
+
* TTL info simultaneously. Returns `undefined` if the key is not present.
|
|
511
|
+
*
|
|
512
|
+
* Unlike {@link LRUCache#dump}, which is designed to be portable and survive
|
|
513
|
+
* serialization, the `start` value is always the current timestamp, and the
|
|
514
|
+
* `ttl` is a calculated remaining time to live (negative if expired).
|
|
515
|
+
*
|
|
516
|
+
* Always returns stale values, if their info is found in the cache, so be
|
|
517
|
+
* sure to check for expirations (ie, a negative {@link LRUCache.Entry#ttl})
|
|
518
|
+
* if relevant.
|
|
502
519
|
*/
|
|
503
520
|
info(key) {
|
|
504
521
|
let i = this.#keyMap.get(key);
|
|
@@ -519,7 +536,16 @@ var require_commonjs = __commonJS({
|
|
|
519
536
|
}
|
|
520
537
|
/**
|
|
521
538
|
* Return an array of [key, {@link LRUCache.Entry}] tuples which can be
|
|
522
|
-
* passed to
|
|
539
|
+
* passed to {@link LRLUCache#load}.
|
|
540
|
+
*
|
|
541
|
+
* The `start` fields are calculated relative to a portable `Date.now()`
|
|
542
|
+
* timestamp, even if `performance.now()` is available.
|
|
543
|
+
*
|
|
544
|
+
* Stale entries are always included in the `dump`, even if
|
|
545
|
+
* {@link LRUCache.OptionsBase.allowStale} is false.
|
|
546
|
+
*
|
|
547
|
+
* Note: this returns an actual array, not a generator, so it can be more
|
|
548
|
+
* easily passed around.
|
|
523
549
|
*/
|
|
524
550
|
dump() {
|
|
525
551
|
let arr = [];
|
|
@@ -539,8 +565,12 @@ var require_commonjs = __commonJS({
|
|
|
539
565
|
}
|
|
540
566
|
/**
|
|
541
567
|
* Reset the cache and load in the items in entries in the order listed.
|
|
542
|
-
*
|
|
543
|
-
*
|
|
568
|
+
*
|
|
569
|
+
* The shape of the resulting cache may be different if the same options are
|
|
570
|
+
* not used in both caches.
|
|
571
|
+
*
|
|
572
|
+
* The `start` fields are assumed to be calculated relative to a portable
|
|
573
|
+
* `Date.now()` timestamp, even if `performance.now()` is available.
|
|
544
574
|
*/
|
|
545
575
|
load(arr) {
|
|
546
576
|
this.clear();
|
|
@@ -557,13 +587,37 @@ var require_commonjs = __commonJS({
|
|
|
557
587
|
*
|
|
558
588
|
* Note: if `undefined` is specified as a value, this is an alias for
|
|
559
589
|
* {@link LRUCache#delete}
|
|
590
|
+
*
|
|
591
|
+
* Fields on the {@link LRUCache.SetOptions} options param will override
|
|
592
|
+
* their corresponding values in the constructor options for the scope
|
|
593
|
+
* of this single `set()` operation.
|
|
594
|
+
*
|
|
595
|
+
* If `start` is provided, then that will set the effective start
|
|
596
|
+
* time for the TTL calculation. Note that this must be a previous
|
|
597
|
+
* value of `performance.now()` if supported, or a previous value of
|
|
598
|
+
* `Date.now()` if not.
|
|
599
|
+
*
|
|
600
|
+
* Options object may also include `size`, which will prevent
|
|
601
|
+
* calling the `sizeCalculation` function and just use the specified
|
|
602
|
+
* number if it is a positive integer, and `noDisposeOnSet` which
|
|
603
|
+
* will prevent calling a `dispose` function in the case of
|
|
604
|
+
* overwrites.
|
|
605
|
+
*
|
|
606
|
+
* If the `size` (or return value of `sizeCalculation`) for a given
|
|
607
|
+
* entry is greater than `maxEntrySize`, then the item will not be
|
|
608
|
+
* added to the cache.
|
|
609
|
+
*
|
|
610
|
+
* Will update the recency of the entry.
|
|
611
|
+
*
|
|
612
|
+
* If the value is `undefined`, then this is an alias for
|
|
613
|
+
* `cache.delete(key)`. `undefined` is never stored in the cache.
|
|
560
614
|
*/
|
|
561
615
|
set(k, v, setOptions = {}) {
|
|
562
616
|
if (v === void 0)
|
|
563
617
|
return this.delete(k), this;
|
|
564
618
|
let { ttl = this.ttl, start, noDisposeOnSet = this.noDisposeOnSet, sizeCalculation = this.sizeCalculation, status } = setOptions, { noUpdateTTL = this.noUpdateTTL } = setOptions, size = this.#requireSize(k, v, setOptions.size || 0, sizeCalculation);
|
|
565
619
|
if (this.maxEntrySize && size > this.maxEntrySize)
|
|
566
|
-
return status && (status.set = "miss", status.maxEntrySizeExceeded = !0), this
|
|
620
|
+
return status && (status.set = "miss", status.maxEntrySizeExceeded = !0), this.#delete(k, "set"), this;
|
|
567
621
|
let index = this.#size === 0 ? void 0 : this.#keyMap.get(k);
|
|
568
622
|
if (index === void 0)
|
|
569
623
|
index = this.#size === 0 ? this.#tail : this.#free.length !== 0 ? this.#free.pop() : this.#size === this.#max ? this.#evict(!1) : this.#size, this.#keyList[index] = k, this.#valList[index] = v, this.#keyMap.set(k, index), this.#next[this.#tail] = index, this.#prev[index] = this.#tail, this.#tail = index, this.#size++, this.#addItemSize(index, size, status), status && (status.set = "add"), noUpdateTTL = !1;
|
|
@@ -621,6 +675,14 @@ var require_commonjs = __commonJS({
|
|
|
621
675
|
* Will return false if the item is stale, even though it is technically
|
|
622
676
|
* in the cache.
|
|
623
677
|
*
|
|
678
|
+
* Check if a key is in the cache, without updating the recency of
|
|
679
|
+
* use. Age is updated if {@link LRUCache.OptionsBase.updateAgeOnHas} is set
|
|
680
|
+
* to `true` in either the options or the constructor.
|
|
681
|
+
*
|
|
682
|
+
* Will return `false` if the item is stale, even though it is technically in
|
|
683
|
+
* the cache. The difference can be determined (if it matters) by using a
|
|
684
|
+
* `status` argument, and inspecting the `has` field.
|
|
685
|
+
*
|
|
624
686
|
* Will not update item age unless
|
|
625
687
|
* {@link LRUCache.OptionsBase.updateAgeOnHas} is set.
|
|
626
688
|
*/
|
|
@@ -667,10 +729,10 @@ var require_commonjs = __commonJS({
|
|
|
667
729
|
if (options.status && (aborted && !updateCache ? (options.status.fetchAborted = !0, options.status.fetchError = ac.signal.reason, ignoreAbort && (options.status.fetchAbortIgnored = !0)) : options.status.fetchResolved = !0), aborted && !ignoreAbort && !updateCache)
|
|
668
730
|
return fetchFail(ac.signal.reason);
|
|
669
731
|
let bf2 = p;
|
|
670
|
-
return this.#valList[index] === p && (v2 === void 0 ? bf2.__staleWhileFetching ? this.#valList[index] = bf2.__staleWhileFetching : this
|
|
732
|
+
return this.#valList[index] === p && (v2 === void 0 ? bf2.__staleWhileFetching ? this.#valList[index] = bf2.__staleWhileFetching : this.#delete(k, "fetch") : (options.status && (options.status.fetchUpdated = !0), this.set(k, v2, fetchOpts.options))), v2;
|
|
671
733
|
}, eb = (er) => (options.status && (options.status.fetchRejected = !0, options.status.fetchError = er), fetchFail(er)), fetchFail = (er) => {
|
|
672
734
|
let { aborted } = ac.signal, allowStaleAborted = aborted && options.allowStaleOnFetchAbort, allowStale = allowStaleAborted || options.allowStaleOnFetchRejection, noDelete = allowStale || options.noDeleteOnFetchRejection, bf2 = p;
|
|
673
|
-
if (this.#valList[index] === p && (!noDelete || bf2.__staleWhileFetching === void 0 ? this
|
|
735
|
+
if (this.#valList[index] === p && (!noDelete || bf2.__staleWhileFetching === void 0 ? this.#delete(k, "fetch") : allowStaleAborted || (this.#valList[index] = bf2.__staleWhileFetching)), allowStale)
|
|
674
736
|
return options.status && bf2.__staleWhileFetching !== void 0 && (options.status.returnedStale = !0), bf2.__staleWhileFetching;
|
|
675
737
|
if (bf2.__returned === bf2)
|
|
676
738
|
throw er;
|
|
@@ -756,6 +818,25 @@ var require_commonjs = __commonJS({
|
|
|
756
818
|
return status && (status.fetch = isStale ? "stale" : "refresh", staleVal && isStale && (status.returnedStale = !0)), staleVal ? p.__staleWhileFetching : p.__returned = p;
|
|
757
819
|
}
|
|
758
820
|
}
|
|
821
|
+
async forceFetch(k, fetchOptions = {}) {
|
|
822
|
+
let v = await this.fetch(k, fetchOptions);
|
|
823
|
+
if (v === void 0)
|
|
824
|
+
throw new Error("fetch() returned undefined");
|
|
825
|
+
return v;
|
|
826
|
+
}
|
|
827
|
+
memo(k, memoOptions = {}) {
|
|
828
|
+
let memoMethod = this.#memoMethod;
|
|
829
|
+
if (!memoMethod)
|
|
830
|
+
throw new Error("no memoMethod provided to constructor");
|
|
831
|
+
let { context, forceRefresh, ...options } = memoOptions, v = this.get(k, options);
|
|
832
|
+
if (!forceRefresh && v !== void 0)
|
|
833
|
+
return v;
|
|
834
|
+
let vv = memoMethod(k, v, {
|
|
835
|
+
options,
|
|
836
|
+
context
|
|
837
|
+
});
|
|
838
|
+
return this.set(k, vv, options), vv;
|
|
839
|
+
}
|
|
759
840
|
/**
|
|
760
841
|
* Return a value from the cache. Will update the recency of the cache
|
|
761
842
|
* entry found.
|
|
@@ -766,7 +847,7 @@ var require_commonjs = __commonJS({
|
|
|
766
847
|
let { allowStale = this.allowStale, updateAgeOnGet = this.updateAgeOnGet, noDeleteOnStaleGet = this.noDeleteOnStaleGet, status } = getOptions, index = this.#keyMap.get(k);
|
|
767
848
|
if (index !== void 0) {
|
|
768
849
|
let value = this.#valList[index], fetching = this.#isBackgroundFetch(value);
|
|
769
|
-
return status && this.#statusTTL(status, index), this.#isStale(index) ? (status && (status.get = "stale"), fetching ? (status && allowStale && value.__staleWhileFetching !== void 0 && (status.returnedStale = !0), allowStale ? value.__staleWhileFetching : void 0) : (noDeleteOnStaleGet || this
|
|
850
|
+
return status && this.#statusTTL(status, index), this.#isStale(index) ? (status && (status.get = "stale"), fetching ? (status && allowStale && value.__staleWhileFetching !== void 0 && (status.returnedStale = !0), allowStale ? value.__staleWhileFetching : void 0) : (noDeleteOnStaleGet || this.#delete(k, "expire"), status && allowStale && (status.returnedStale = !0), allowStale ? value : void 0)) : (status && (status.get = "hit"), fetching ? value.__staleWhileFetching : (this.#moveToTail(index), updateAgeOnGet && this.#updateItemAge(index), value));
|
|
770
851
|
} else status && (status.get = "miss");
|
|
771
852
|
}
|
|
772
853
|
#connect(p, n) {
|
|
@@ -777,19 +858,23 @@ var require_commonjs = __commonJS({
|
|
|
777
858
|
}
|
|
778
859
|
/**
|
|
779
860
|
* Deletes a key out of the cache.
|
|
861
|
+
*
|
|
780
862
|
* Returns true if the key was deleted, false otherwise.
|
|
781
863
|
*/
|
|
782
864
|
delete(k) {
|
|
865
|
+
return this.#delete(k, "delete");
|
|
866
|
+
}
|
|
867
|
+
#delete(k, reason) {
|
|
783
868
|
let deleted = !1;
|
|
784
869
|
if (this.#size !== 0) {
|
|
785
870
|
let index = this.#keyMap.get(k);
|
|
786
871
|
if (index !== void 0)
|
|
787
872
|
if (deleted = !0, this.#size === 1)
|
|
788
|
-
this
|
|
873
|
+
this.#clear(reason);
|
|
789
874
|
else {
|
|
790
875
|
this.#removeItemSize(index);
|
|
791
876
|
let v = this.#valList[index];
|
|
792
|
-
if (this.#isBackgroundFetch(v) ? v.__abortController.abort(new Error("deleted")) : (this.#hasDispose || this.#hasDisposeAfter) && (this.#hasDispose && this.#dispose?.(v, k,
|
|
877
|
+
if (this.#isBackgroundFetch(v) ? v.__abortController.abort(new Error("deleted")) : (this.#hasDispose || this.#hasDisposeAfter) && (this.#hasDispose && this.#dispose?.(v, k, reason), this.#hasDisposeAfter && this.#disposed?.push([v, k, reason])), this.#keyMap.delete(k), this.#keyList[index] = void 0, this.#valList[index] = void 0, index === this.#tail)
|
|
793
878
|
this.#tail = this.#prev[index];
|
|
794
879
|
else if (index === this.#head)
|
|
795
880
|
this.#head = this.#next[index];
|
|
@@ -813,13 +898,16 @@ var require_commonjs = __commonJS({
|
|
|
813
898
|
* Clear the cache entirely, throwing away all values.
|
|
814
899
|
*/
|
|
815
900
|
clear() {
|
|
901
|
+
return this.#clear("delete");
|
|
902
|
+
}
|
|
903
|
+
#clear(reason) {
|
|
816
904
|
for (let index of this.#rindexes({ allowStale: !0 })) {
|
|
817
905
|
let v = this.#valList[index];
|
|
818
906
|
if (this.#isBackgroundFetch(v))
|
|
819
907
|
v.__abortController.abort(new Error("deleted"));
|
|
820
908
|
else {
|
|
821
909
|
let k = this.#keyList[index];
|
|
822
|
-
this.#hasDispose && this.#dispose?.(v, k,
|
|
910
|
+
this.#hasDispose && this.#dispose?.(v, k, reason), this.#hasDisposeAfter && this.#disposed?.push([v, k, reason]);
|
|
823
911
|
}
|
|
824
912
|
}
|
|
825
913
|
if (this.#keyMap.clear(), this.#valList.fill(void 0), this.#keyList.fill(void 0), this.#ttls && this.#starts && (this.#ttls.fill(0), this.#starts.fill(0)), this.#sizes && this.#sizes.fill(0), this.#head = 0, this.#tail = 0, this.#free.length = 0, this.#calculatedSize = 0, this.#size = 0, this.#hasDisposeAfter && this.#disposed) {
|
|
@@ -1294,9 +1382,9 @@ var require_lib3 = __commonJS({
|
|
|
1294
1382
|
}
|
|
1295
1383
|
});
|
|
1296
1384
|
|
|
1297
|
-
// ../../node_modules/.pnpm/npm-package-arg@11.0.
|
|
1385
|
+
// ../../node_modules/.pnpm/npm-package-arg@11.0.3/node_modules/npm-package-arg/lib/npa.js
|
|
1298
1386
|
var require_npa = __commonJS({
|
|
1299
|
-
"../../node_modules/.pnpm/npm-package-arg@11.0.
|
|
1387
|
+
"../../node_modules/.pnpm/npm-package-arg@11.0.3/node_modules/npm-package-arg/lib/npa.js"(exports, module) {
|
|
1300
1388
|
init_cjs_shims();
|
|
1301
1389
|
module.exports = npa;
|
|
1302
1390
|
module.exports.resolve = resolve;
|
|
@@ -1464,6 +1552,8 @@ var require_npa = __commonJS({
|
|
|
1464
1552
|
throw new Error("nested aliases not supported");
|
|
1465
1553
|
if (!subSpec.registry)
|
|
1466
1554
|
throw new Error("aliases only work for registry deps");
|
|
1555
|
+
if (!subSpec.name)
|
|
1556
|
+
throw new Error("aliases must have a name");
|
|
1467
1557
|
return res.subSpec = subSpec, res.registry = !0, res.type = "alias", res.saveSpec = null, res.fetchSpec = null, res;
|
|
1468
1558
|
}
|
|
1469
1559
|
function fromRegistry(res) {
|
|
@@ -1485,4 +1575,4 @@ var require_npa = __commonJS({
|
|
|
1485
1575
|
}
|
|
1486
1576
|
});
|
|
1487
1577
|
export default require_npa();
|
|
1488
|
-
//# sourceMappingURL=npa-
|
|
1578
|
+
//# sourceMappingURL=npa-E675GQOI.js.map
|