@shopify/create-app 3.80.6 → 3.81.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.
Files changed (36) hide show
  1. package/dist/{chunk-I2T7RMPE.js → chunk-24FFN3UF.js} +26 -26
  2. package/dist/{chunk-3INFDIM3.js → chunk-2YVW3FGK.js} +42 -507
  3. package/dist/{chunk-3HCB5FCE.js → chunk-7O563I7I.js} +275 -76
  4. package/dist/{chunk-TJM3YBLQ.js → chunk-CTFDRWUN.js} +15 -12
  5. package/dist/{chunk-25SITN3I.js → chunk-ILI5X6PP.js} +2 -2
  6. package/dist/{chunk-LUDVCV3T.js → chunk-NQJJHSZI.js} +5 -5
  7. package/dist/{chunk-LDEHFRUQ.js → chunk-PTSAUW2T.js} +15 -10
  8. package/dist/{chunk-NRDSLF6O.js → chunk-QU7DXDZR.js} +243 -219
  9. package/dist/{chunk-LQ2ZKVR6.js → chunk-UMUTXITN.js} +87 -4
  10. package/dist/{chunk-LH5HVQQC.js → chunk-VMUIREUQ.js} +2 -2
  11. package/dist/{chunk-CDBXAE2F.js → chunk-Y2JP6WFP.js} +99 -11
  12. package/dist/{chunk-4EUXP4ED.js → chunk-YTTZ5B56.js} +32 -33
  13. package/dist/{custom-oclif-loader-SD7F6FMU.js → custom-oclif-loader-ZSOO2BP2.js} +7 -8
  14. package/dist/{del-KB2YLEEB.js → del-MOZRBB7Y.js} +4 -4
  15. package/dist/{devtools-J4QAI6HR.js → devtools-LDCSRUXB.js} +4 -4
  16. package/dist/{error-handler-2FLOQDU4.js → error-handler-6K7FR77V.js} +11 -12
  17. package/dist/hooks/postrun.js +9 -10
  18. package/dist/hooks/prerun.js +9 -10
  19. package/dist/{http-proxy-KGLXPNEY.js → http-proxy-LHSVRGJ5.js} +14 -10
  20. package/dist/index.js +11742 -5691
  21. package/dist/index.test.js +10022 -8822
  22. package/dist/lib-UJ7YNLH4.js +11 -0
  23. package/dist/{local-DLZ7G4Q5.js → local-BYAIQCJB.js} +9 -14
  24. package/dist/{magic-string.es-BSVDQOZI.js → magic-string.es-UZAAPNRE.js} +42 -36
  25. package/dist/{node-package-manager-EFQ7S3IA.js → node-package-manager-ZN2SJLTP.js} +8 -9
  26. package/dist/{out-5KP5WGIK.js → out-NKJPLKLB.js} +2 -2
  27. package/dist/{path-GWAZZN2N.js → path-COZT77T2.js} +2 -3
  28. package/dist/toml_patch_bg.wasm +0 -0
  29. package/dist/tsconfig.tsbuildinfo +1 -1
  30. package/dist/{ui-OSSJNNUO.js → ui-RJQBCWRN.js} +7 -10
  31. package/oclif.manifest.json +1 -1
  32. package/package.json +6 -7
  33. package/dist/chunk-3I3GQNEW.js +0 -95
  34. package/dist/chunk-ZUCWDIGE.js +0 -111
  35. package/dist/lib-TMSQAG3Q.js +0 -11
  36. package/dist/toml-patch-wasm-J5VGG6WG.js +0 -140
@@ -19,11 +19,11 @@ import {
19
19
  require_semver,
20
20
  runWithTimer,
21
21
  writeFile
22
- } from "./chunk-NRDSLF6O.js";
22
+ } from "./chunk-QU7DXDZR.js";
23
23
  import {
24
24
  dirname,
25
25
  joinPath
26
- } from "./chunk-ZUCWDIGE.js";
26
+ } from "./chunk-Y2JP6WFP.js";
27
27
  import {
28
28
  __commonJS,
29
29
  __require,
@@ -2397,9 +2397,9 @@ var require_data = __commonJS({
2397
2397
  }
2398
2398
  });
2399
2399
 
2400
- // ../../node_modules/.pnpm/fast-uri@3.0.5/node_modules/fast-uri/lib/scopedChars.js
2400
+ // ../../node_modules/.pnpm/fast-uri@3.0.6/node_modules/fast-uri/lib/scopedChars.js
2401
2401
  var require_scopedChars = __commonJS({
2402
- "../../node_modules/.pnpm/fast-uri@3.0.5/node_modules/fast-uri/lib/scopedChars.js"(exports, module) {
2402
+ "../../node_modules/.pnpm/fast-uri@3.0.6/node_modules/fast-uri/lib/scopedChars.js"(exports, module) {
2403
2403
  "use strict";
2404
2404
  init_cjs_shims();
2405
2405
  var HEX = {
@@ -2432,9 +2432,9 @@ var require_scopedChars = __commonJS({
2432
2432
  }
2433
2433
  });
2434
2434
 
2435
- // ../../node_modules/.pnpm/fast-uri@3.0.5/node_modules/fast-uri/lib/utils.js
2435
+ // ../../node_modules/.pnpm/fast-uri@3.0.6/node_modules/fast-uri/lib/utils.js
2436
2436
  var require_utils = __commonJS({
2437
- "../../node_modules/.pnpm/fast-uri@3.0.5/node_modules/fast-uri/lib/utils.js"(exports, module) {
2437
+ "../../node_modules/.pnpm/fast-uri@3.0.6/node_modules/fast-uri/lib/utils.js"(exports, module) {
2438
2438
  "use strict";
2439
2439
  init_cjs_shims();
2440
2440
  var { HEX } = require_scopedChars(), IPV4_REG = /^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;
@@ -2566,12 +2566,12 @@ var require_utils = __commonJS({
2566
2566
  }
2567
2567
  });
2568
2568
 
2569
- // ../../node_modules/.pnpm/fast-uri@3.0.5/node_modules/fast-uri/lib/schemes.js
2569
+ // ../../node_modules/.pnpm/fast-uri@3.0.6/node_modules/fast-uri/lib/schemes.js
2570
2570
  var require_schemes = __commonJS({
2571
- "../../node_modules/.pnpm/fast-uri@3.0.5/node_modules/fast-uri/lib/schemes.js"(exports, module) {
2571
+ "../../node_modules/.pnpm/fast-uri@3.0.6/node_modules/fast-uri/lib/schemes.js"(exports, module) {
2572
2572
  "use strict";
2573
2573
  init_cjs_shims();
2574
- var UUID_REG = /^[\da-f]{8}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{4}\b-[\da-f]{12}$/iu, URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
2574
+ var UUID_REG = /^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu, URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
2575
2575
  function isSecure(wsComponents) {
2576
2576
  return typeof wsComponents.secure == "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
2577
2577
  }
@@ -2661,9 +2661,9 @@ var require_schemes = __commonJS({
2661
2661
  }
2662
2662
  });
2663
2663
 
2664
- // ../../node_modules/.pnpm/fast-uri@3.0.5/node_modules/fast-uri/index.js
2664
+ // ../../node_modules/.pnpm/fast-uri@3.0.6/node_modules/fast-uri/index.js
2665
2665
  var require_fast_uri = __commonJS({
2666
- "../../node_modules/.pnpm/fast-uri@3.0.5/node_modules/fast-uri/index.js"(exports, module) {
2666
+ "../../node_modules/.pnpm/fast-uri@3.0.6/node_modules/fast-uri/index.js"(exports, module) {
2667
2667
  "use strict";
2668
2668
  init_cjs_shims();
2669
2669
  var { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = require_utils(), SCHEMES = require_schemes();
@@ -2736,7 +2736,7 @@ var require_fast_uri = __commonJS({
2736
2736
  } else
2737
2737
  parsed.host = ipv4result.host, isIP = !0;
2738
2738
  }
2739
- parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && !parsed.path && parsed.query === void 0 ? parsed.reference = "same-document" : parsed.scheme === void 0 ? parsed.reference = "relative" : parsed.fragment === void 0 ? parsed.reference = "absolute" : parsed.reference = "uri", options.reference && options.reference !== "suffix" && options.reference !== parsed.reference && (parsed.error = parsed.error || "URI is not a " + options.reference + " reference.");
2739
+ parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path ? parsed.reference = "same-document" : parsed.scheme === void 0 ? parsed.reference = "relative" : parsed.fragment === void 0 ? parsed.reference = "absolute" : parsed.reference = "uri", options.reference && options.reference !== "suffix" && options.reference !== parsed.reference && (parsed.error = parsed.error || "URI is not a " + options.reference + " reference.");
2740
2740
  let schemeHandler = SCHEMES[(options.scheme || parsed.scheme || "").toLowerCase()];
2741
2741
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === !1 && nonSimpleDomain(parsed.host))
2742
2742
  try {
@@ -2744,7 +2744,7 @@ var require_fast_uri = __commonJS({
2744
2744
  } catch (e) {
2745
2745
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
2746
2746
  }
2747
- (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) && (gotEncoding && parsed.scheme !== void 0 && (parsed.scheme = unescape(parsed.scheme)), gotEncoding && parsed.host !== void 0 && (parsed.host = unescape(parsed.host)), parsed.path && parsed.path.length && (parsed.path = escape(unescape(parsed.path))), parsed.fragment && parsed.fragment.length && (parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment)))), schemeHandler && schemeHandler.parse && schemeHandler.parse(parsed, options);
2747
+ (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) && (gotEncoding && parsed.scheme !== void 0 && (parsed.scheme = unescape(parsed.scheme)), gotEncoding && parsed.host !== void 0 && (parsed.host = unescape(parsed.host)), parsed.path && (parsed.path = escape(unescape(parsed.path))), parsed.fragment && (parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment)))), schemeHandler && schemeHandler.parse && schemeHandler.parse(parsed, options);
2748
2748
  } else
2749
2749
  parsed.error = parsed.error || "URI can not be parsed.";
2750
2750
  return parsed;
@@ -5106,9 +5106,9 @@ var require_source = __commonJS({
5106
5106
  }
5107
5107
  });
5108
5108
 
5109
- // ../../node_modules/.pnpm/http-cache-semantics@4.1.1/node_modules/http-cache-semantics/index.js
5109
+ // ../../node_modules/.pnpm/http-cache-semantics@4.2.0/node_modules/http-cache-semantics/index.js
5110
5110
  var require_http_cache_semantics = __commonJS({
5111
- "../../node_modules/.pnpm/http-cache-semantics@4.1.1/node_modules/http-cache-semantics/index.js"(exports, module) {
5111
+ "../../node_modules/.pnpm/http-cache-semantics@4.2.0/node_modules/http-cache-semantics/index.js"(exports, module) {
5112
5112
  "use strict";
5113
5113
  init_cjs_shims();
5114
5114
  var statusCodeCacheableByDefault = /* @__PURE__ */ new Set([
@@ -5189,6 +5189,17 @@ var require_http_cache_semantics = __commonJS({
5189
5189
  return parts.join(", ");
5190
5190
  }
5191
5191
  module.exports = class {
5192
+ /**
5193
+ * Creates a new CachePolicy instance.
5194
+ * @param {HttpRequest} req - Incoming client request.
5195
+ * @param {HttpResponse} res - Received server response.
5196
+ * @param {Object} [options={}] - Configuration options.
5197
+ * @param {boolean} [options.shared=true] - Is the cache shared (a public proxy)? `false` for personal browser caches.
5198
+ * @param {number} [options.cacheHeuristic=0.1] - Fallback heuristic (age fraction) for cache duration.
5199
+ * @param {number} [options.immutableMinTimeToLive=86400000] - Minimum TTL for immutable responses in milliseconds.
5200
+ * @param {boolean} [options.ignoreCargoCult=false] - Detect nonsense cache headers, and override them.
5201
+ * @param {any} [options._fromObject] - Internal parameter for deserialization. Do not use.
5202
+ */
5192
5203
  constructor(req, res, {
5193
5204
  shared,
5194
5205
  cacheHeuristic,
@@ -5202,13 +5213,21 @@ var require_http_cache_semantics = __commonJS({
5202
5213
  }
5203
5214
  if (!res || !res.headers)
5204
5215
  throw Error("Response headers missing");
5205
- this._assertRequestHasHeaders(req), this._responseTime = this.now(), this._isShared = shared !== !1, this._cacheHeuristic = cacheHeuristic !== void 0 ? cacheHeuristic : 0.1, this._immutableMinTtl = immutableMinTimeToLive !== void 0 ? immutableMinTimeToLive : 24 * 3600 * 1e3, this._status = "status" in res ? res.status : 200, this._resHeaders = res.headers, this._rescc = parseCacheControl(res.headers["cache-control"]), this._method = "method" in req ? req.method : "GET", this._url = req.url, this._host = req.headers.host, this._noAuthorization = !req.headers.authorization, this._reqHeaders = res.headers.vary ? req.headers : null, this._reqcc = parseCacheControl(req.headers["cache-control"]), ignoreCargoCult && "pre-check" in this._rescc && "post-check" in this._rescc && (delete this._rescc["pre-check"], delete this._rescc["post-check"], delete this._rescc["no-cache"], delete this._rescc["no-store"], delete this._rescc["must-revalidate"], this._resHeaders = Object.assign({}, this._resHeaders, {
5216
+ this._assertRequestHasHeaders(req), this._responseTime = this.now(), this._isShared = shared !== !1, this._ignoreCargoCult = !!ignoreCargoCult, this._cacheHeuristic = cacheHeuristic !== void 0 ? cacheHeuristic : 0.1, this._immutableMinTtl = immutableMinTimeToLive !== void 0 ? immutableMinTimeToLive : 24 * 3600 * 1e3, this._status = "status" in res ? res.status : 200, this._resHeaders = res.headers, this._rescc = parseCacheControl(res.headers["cache-control"]), this._method = "method" in req ? req.method : "GET", this._url = req.url, this._host = req.headers.host, this._noAuthorization = !req.headers.authorization, this._reqHeaders = res.headers.vary ? req.headers : null, this._reqcc = parseCacheControl(req.headers["cache-control"]), this._ignoreCargoCult && "pre-check" in this._rescc && "post-check" in this._rescc && (delete this._rescc["pre-check"], delete this._rescc["post-check"], delete this._rescc["no-cache"], delete this._rescc["no-store"], delete this._rescc["must-revalidate"], this._resHeaders = Object.assign({}, this._resHeaders, {
5206
5217
  "cache-control": formatCacheControl(this._rescc)
5207
5218
  }), delete this._resHeaders.expires, delete this._resHeaders.pragma), res.headers["cache-control"] == null && /no-cache/.test(res.headers.pragma) && (this._rescc["no-cache"] = !0);
5208
5219
  }
5220
+ /**
5221
+ * You can monkey-patch it for testing.
5222
+ * @returns {number} Current time in milliseconds.
5223
+ */
5209
5224
  now() {
5210
5225
  return Date.now();
5211
5226
  }
5227
+ /**
5228
+ * Determines if the response is storable in a cache.
5229
+ * @returns {boolean} `false` if can never be cached.
5230
+ */
5212
5231
  storable() {
5213
5232
  return !!(!this._reqcc["no-store"] && // A cache MUST NOT store a response to any request, unless:
5214
5233
  // The request method is understood by the cache and defined as being cacheable, and
@@ -5224,26 +5243,118 @@ var require_http_cache_semantics = __commonJS({
5224
5243
  this._rescc["max-age"] || this._isShared && this._rescc["s-maxage"] || this._rescc.public || // has a status code that is defined as cacheable by default
5225
5244
  statusCodeCacheableByDefault.has(this._status)));
5226
5245
  }
5246
+ /**
5247
+ * @returns {boolean} true if expiration is explicitly defined.
5248
+ */
5227
5249
  _hasExplicitExpiration() {
5228
- return this._isShared && this._rescc["s-maxage"] || this._rescc["max-age"] || this._resHeaders.expires;
5250
+ return !!(this._isShared && this._rescc["s-maxage"] || this._rescc["max-age"] || this._resHeaders.expires);
5229
5251
  }
5252
+ /**
5253
+ * @param {HttpRequest} req - a request
5254
+ * @throws {Error} if the headers are missing.
5255
+ */
5230
5256
  _assertRequestHasHeaders(req) {
5231
5257
  if (!req || !req.headers)
5232
5258
  throw Error("Request headers missing");
5233
5259
  }
5260
+ /**
5261
+ * Checks if the request matches the cache and can be satisfied from the cache immediately,
5262
+ * without having to make a request to the server.
5263
+ *
5264
+ * This doesn't support `stale-while-revalidate`. See `evaluateRequest()` for a more complete solution.
5265
+ *
5266
+ * @param {HttpRequest} req - The new incoming HTTP request.
5267
+ * @returns {boolean} `true`` if the cached response used to construct this cache policy satisfies the request without revalidation.
5268
+ */
5234
5269
  satisfiesWithoutRevalidation(req) {
5235
- this._assertRequestHasHeaders(req);
5270
+ return !this.evaluateRequest(req).revalidation;
5271
+ }
5272
+ /**
5273
+ * @param {{headers: Record<string, string>, synchronous: boolean}|undefined} revalidation - Revalidation information, if any.
5274
+ * @returns {{response: {headers: Record<string, string>}, revalidation: {headers: Record<string, string>, synchronous: boolean}|undefined}} An object with a cached response headers and revalidation info.
5275
+ */
5276
+ _evaluateRequestHitResult(revalidation) {
5277
+ return {
5278
+ response: {
5279
+ headers: this.responseHeaders()
5280
+ },
5281
+ revalidation
5282
+ };
5283
+ }
5284
+ /**
5285
+ * @param {HttpRequest} request - new incoming
5286
+ * @param {boolean} synchronous - whether revalidation must be synchronous (not s-w-r).
5287
+ * @returns {{headers: Record<string, string>, synchronous: boolean}} An object with revalidation headers and a synchronous flag.
5288
+ */
5289
+ _evaluateRequestRevalidation(request, synchronous) {
5290
+ return {
5291
+ synchronous,
5292
+ headers: this.revalidationHeaders(request)
5293
+ };
5294
+ }
5295
+ /**
5296
+ * @param {HttpRequest} request - new incoming
5297
+ * @returns {{response: undefined, revalidation: {headers: Record<string, string>, synchronous: boolean}}} An object indicating no cached response and revalidation details.
5298
+ */
5299
+ _evaluateRequestMissResult(request) {
5300
+ return {
5301
+ response: void 0,
5302
+ revalidation: this._evaluateRequestRevalidation(request, !0)
5303
+ };
5304
+ }
5305
+ /**
5306
+ * Checks if the given request matches this cache entry, and how the cache can be used to satisfy it. Returns an object with:
5307
+ *
5308
+ * ```
5309
+ * {
5310
+ * // If defined, you must send a request to the server.
5311
+ * revalidation: {
5312
+ * headers: {}, // HTTP headers to use when sending the revalidation response
5313
+ * // If true, you MUST wait for a response from the server before using the cache
5314
+ * // If false, this is stale-while-revalidate. The cache is stale, but you can use it while you update it asynchronously.
5315
+ * synchronous: bool,
5316
+ * },
5317
+ * // If defined, you can use this cached response.
5318
+ * response: {
5319
+ * headers: {}, // Updated cached HTTP headers you must use when responding to the client
5320
+ * },
5321
+ * }
5322
+ * ```
5323
+ * @param {HttpRequest} req - new incoming HTTP request
5324
+ * @returns {{response: {headers: Record<string, string>}|undefined, revalidation: {headers: Record<string, string>, synchronous: boolean}|undefined}} An object containing keys:
5325
+ * - revalidation: { headers: Record<string, string>, synchronous: boolean } Set if you should send this to the origin server
5326
+ * - response: { headers: Record<string, string> } Set if you can respond to the client with these cached headers
5327
+ */
5328
+ evaluateRequest(req) {
5329
+ if (this._assertRequestHasHeaders(req), this._rescc["must-revalidate"])
5330
+ return this._evaluateRequestMissResult(req);
5331
+ if (!this._requestMatches(req, !1))
5332
+ return this._evaluateRequestMissResult(req);
5236
5333
  let requestCC = parseCacheControl(req.headers["cache-control"]);
5237
- return requestCC["no-cache"] || /no-cache/.test(req.headers.pragma) || requestCC["max-age"] && this.age() > requestCC["max-age"] || requestCC["min-fresh"] && this.timeToLive() < 1e3 * requestCC["min-fresh"] || this.stale() && !(requestCC["max-stale"] && !this._rescc["must-revalidate"] && (requestCC["max-stale"] === !0 || requestCC["max-stale"] > this.age() - this.maxAge())) ? !1 : this._requestMatches(req, !1);
5334
+ return requestCC["no-cache"] || /no-cache/.test(req.headers.pragma) ? this._evaluateRequestMissResult(req) : requestCC["max-age"] && this.age() > toNumberOrZero(requestCC["max-age"]) ? this._evaluateRequestMissResult(req) : requestCC["min-fresh"] && this.maxAge() - this.age() < toNumberOrZero(requestCC["min-fresh"]) ? this._evaluateRequestMissResult(req) : this.stale() ? "max-stale" in requestCC && (requestCC["max-stale"] === !0 || requestCC["max-stale"] > this.age() - this.maxAge()) ? this._evaluateRequestHitResult(void 0) : this.useStaleWhileRevalidate() ? this._evaluateRequestHitResult(this._evaluateRequestRevalidation(req, !1)) : this._evaluateRequestMissResult(req) : this._evaluateRequestHitResult(void 0);
5238
5335
  }
5336
+ /**
5337
+ * @param {HttpRequest} req - check if this is for the same cache entry
5338
+ * @param {boolean} allowHeadMethod - allow a HEAD method to match.
5339
+ * @returns {boolean} `true` if the request matches.
5340
+ */
5239
5341
  _requestMatches(req, allowHeadMethod) {
5240
- return (!this._url || this._url === req.url) && this._host === req.headers.host && // the request method associated with the stored response allows it to be used for the presented request, and
5342
+ return !!((!this._url || this._url === req.url) && this._host === req.headers.host && // the request method associated with the stored response allows it to be used for the presented request, and
5241
5343
  (!req.method || this._method === req.method || allowHeadMethod && req.method === "HEAD") && // selecting header fields nominated by the stored response (if any) match those presented, and
5242
- this._varyMatches(req);
5344
+ this._varyMatches(req));
5243
5345
  }
5346
+ /**
5347
+ * Determines whether storing authenticated responses is allowed.
5348
+ * @returns {boolean} `true` if allowed.
5349
+ */
5244
5350
  _allowsStoringAuthenticated() {
5245
- return this._rescc["must-revalidate"] || this._rescc.public || this._rescc["s-maxage"];
5351
+ return !!(this._rescc["must-revalidate"] || this._rescc.public || this._rescc["s-maxage"]);
5246
5352
  }
5353
+ /**
5354
+ * Checks whether the Vary header in the response matches the new request.
5355
+ * @param {HttpRequest} req - incoming HTTP request
5356
+ * @returns {boolean} `true` if the vary headers match.
5357
+ */
5247
5358
  _varyMatches(req) {
5248
5359
  if (!this._resHeaders.vary)
5249
5360
  return !0;
@@ -5254,6 +5365,11 @@ var require_http_cache_semantics = __commonJS({
5254
5365
  if (req.headers[name] !== this._reqHeaders[name]) return !1;
5255
5366
  return !0;
5256
5367
  }
5368
+ /**
5369
+ * Creates a copy of the given headers without any hop-by-hop headers.
5370
+ * @param {Record<string, string>} inHeaders - old headers from the cached response
5371
+ * @returns {Record<string, string>} A new headers object without hop-by-hop headers.
5372
+ */
5257
5373
  _copyWithoutHopByHopHeaders(inHeaders) {
5258
5374
  let headers = {};
5259
5375
  for (let name in inHeaders)
@@ -5269,13 +5385,18 @@ var require_http_cache_semantics = __commonJS({
5269
5385
  }
5270
5386
  return headers;
5271
5387
  }
5388
+ /**
5389
+ * Returns the response headers adjusted for serving the cached response.
5390
+ * Removes hop-by-hop headers and updates the Age and Date headers.
5391
+ * @returns {Record<string, string>} The adjusted response headers.
5392
+ */
5272
5393
  responseHeaders() {
5273
5394
  let headers = this._copyWithoutHopByHopHeaders(this._resHeaders), age = this.age();
5274
5395
  return age > 3600 * 24 && !this._hasExplicitExpiration() && this.maxAge() > 3600 * 24 && (headers.warning = (headers.warning ? `${headers.warning}, ` : "") + '113 - "rfc7234 5.5.4"'), headers.age = `${Math.round(age)}`, headers.date = new Date(this.now()).toUTCString(), headers;
5275
5396
  }
5276
5397
  /**
5277
- * Value of the Date response header or current time if Date was invalid
5278
- * @return timestamp
5398
+ * Returns the Date header value from the response or the current time if invalid.
5399
+ * @returns {number} Timestamp (in milliseconds) representing the Date header or response time.
5279
5400
  */
5280
5401
  date() {
5281
5402
  let serverDate = Date.parse(this._resHeaders.date);
@@ -5284,22 +5405,26 @@ var require_http_cache_semantics = __commonJS({
5284
5405
  /**
5285
5406
  * Value of the Age header, in seconds, updated for the current time.
5286
5407
  * May be fractional.
5287
- *
5288
- * @return Number
5408
+ * @returns {number} The age in seconds.
5289
5409
  */
5290
5410
  age() {
5291
5411
  let age = this._ageValue(), residentTime = (this.now() - this._responseTime) / 1e3;
5292
5412
  return age + residentTime;
5293
5413
  }
5414
+ /**
5415
+ * @returns {number} The Age header value as a number.
5416
+ */
5294
5417
  _ageValue() {
5295
5418
  return toNumberOrZero(this._resHeaders.age);
5296
5419
  }
5297
5420
  /**
5298
- * Value of applicable max-age (or heuristic equivalent) in seconds. This counts since response's `Date`.
5421
+ * Possibly outdated value of applicable max-age (or heuristic equivalent) in seconds.
5422
+ * This counts since response's `Date`.
5299
5423
  *
5300
5424
  * For an up-to-date value, see `timeToLive()`.
5301
5425
  *
5302
- * @return Number
5426
+ * Returns the maximum age (freshness lifetime) of the response in seconds.
5427
+ * @returns {number} The max-age value in seconds.
5303
5428
  */
5304
5429
  maxAge() {
5305
5430
  if (!this.storable() || this._rescc["no-cache"] || this._isShared && this._resHeaders["set-cookie"] && !this._rescc.public && !this._rescc.immutable || this._resHeaders.vary === "*")
@@ -5327,27 +5452,59 @@ var require_http_cache_semantics = __commonJS({
5327
5452
  }
5328
5453
  return defaultMinTtl;
5329
5454
  }
5455
+ /**
5456
+ * Remaining time this cache entry may be useful for, in *milliseconds*.
5457
+ * You can use this as an expiration time for your cache storage.
5458
+ *
5459
+ * Prefer this method over `maxAge()`, because it includes other factors like `age` and `stale-while-revalidate`.
5460
+ * @returns {number} Time-to-live in milliseconds.
5461
+ */
5330
5462
  timeToLive() {
5331
5463
  let age = this.maxAge() - this.age(), staleIfErrorAge = age + toNumberOrZero(this._rescc["stale-if-error"]), staleWhileRevalidateAge = age + toNumberOrZero(this._rescc["stale-while-revalidate"]);
5332
- return Math.max(0, age, staleIfErrorAge, staleWhileRevalidateAge) * 1e3;
5464
+ return Math.round(Math.max(0, age, staleIfErrorAge, staleWhileRevalidateAge) * 1e3);
5333
5465
  }
5466
+ /**
5467
+ * If true, this cache entry is past its expiration date.
5468
+ * Note that stale cache may be useful sometimes, see `evaluateRequest()`.
5469
+ * @returns {boolean} `false` doesn't mean it's fresh nor usable
5470
+ */
5334
5471
  stale() {
5335
5472
  return this.maxAge() <= this.age();
5336
5473
  }
5474
+ /**
5475
+ * @returns {boolean} `true` if `stale-if-error` condition allows use of a stale response.
5476
+ */
5337
5477
  _useStaleIfError() {
5338
5478
  return this.maxAge() + toNumberOrZero(this._rescc["stale-if-error"]) > this.age();
5339
5479
  }
5480
+ /** See `evaluateRequest()` for a more complete solution
5481
+ * @returns {boolean} `true` if `stale-while-revalidate` is currently allowed.
5482
+ */
5340
5483
  useStaleWhileRevalidate() {
5341
- return this.maxAge() + toNumberOrZero(this._rescc["stale-while-revalidate"]) > this.age();
5484
+ let swr = toNumberOrZero(this._rescc["stale-while-revalidate"]);
5485
+ return swr > 0 && this.maxAge() + swr > this.age();
5342
5486
  }
5487
+ /**
5488
+ * Creates a `CachePolicy` instance from a serialized object.
5489
+ * @param {Object} obj - The serialized object.
5490
+ * @returns {CachePolicy} A new CachePolicy instance.
5491
+ */
5343
5492
  static fromObject(obj) {
5344
5493
  return new this(void 0, void 0, { _fromObject: obj });
5345
5494
  }
5495
+ /**
5496
+ * @param {any} obj - The serialized object.
5497
+ * @throws {Error} If already initialized or if the object is invalid.
5498
+ */
5346
5499
  _fromObject(obj) {
5347
5500
  if (this._responseTime) throw Error("Reinitialized");
5348
5501
  if (!obj || obj.v !== 1) throw Error("Invalid serialization");
5349
- this._responseTime = obj.t, this._isShared = obj.sh, this._cacheHeuristic = obj.ch, this._immutableMinTtl = obj.imm !== void 0 ? obj.imm : 24 * 3600 * 1e3, this._status = obj.st, this._resHeaders = obj.resh, this._rescc = obj.rescc, this._method = obj.m, this._url = obj.u, this._host = obj.h, this._noAuthorization = obj.a, this._reqHeaders = obj.reqh, this._reqcc = obj.reqcc;
5502
+ this._responseTime = obj.t, this._isShared = obj.sh, this._cacheHeuristic = obj.ch, this._immutableMinTtl = obj.imm !== void 0 ? obj.imm : 24 * 3600 * 1e3, this._ignoreCargoCult = !!obj.icc, this._status = obj.st, this._resHeaders = obj.resh, this._rescc = obj.rescc, this._method = obj.m, this._url = obj.u, this._host = obj.h, this._noAuthorization = obj.a, this._reqHeaders = obj.reqh, this._reqcc = obj.reqcc;
5350
5503
  }
5504
+ /**
5505
+ * Serializes the `CachePolicy` instance into a JSON-serializable object.
5506
+ * @returns {Object} The serialized object.
5507
+ */
5351
5508
  toObject() {
5352
5509
  return {
5353
5510
  v: 1,
@@ -5355,6 +5512,7 @@ var require_http_cache_semantics = __commonJS({
5355
5512
  sh: this._isShared,
5356
5513
  ch: this._cacheHeuristic,
5357
5514
  imm: this._immutableMinTtl,
5515
+ icc: this._ignoreCargoCult,
5358
5516
  st: this._status,
5359
5517
  resh: this._resHeaders,
5360
5518
  rescc: this._rescc,
@@ -5372,6 +5530,8 @@ var require_http_cache_semantics = __commonJS({
5372
5530
  *
5373
5531
  * Hop by hop headers are always stripped.
5374
5532
  * Revalidation headers may be added or removed, depending on request.
5533
+ * @param {HttpRequest} incomingReq - The incoming HTTP request.
5534
+ * @returns {Record<string, string>} The headers for the revalidation request.
5375
5535
  */
5376
5536
  revalidationHeaders(incomingReq) {
5377
5537
  this._assertRequestHasHeaders(incomingReq);
@@ -5393,21 +5553,31 @@ var require_http_cache_semantics = __commonJS({
5393
5553
  * Returns {policy, modified} where modified is a boolean indicating
5394
5554
  * whether the response body has been modified, and old cached body can't be used.
5395
5555
  *
5396
- * @return {Object} {policy: CachePolicy, modified: Boolean}
5556
+ * @param {HttpRequest} request - The latest HTTP request asking for the cached entry.
5557
+ * @param {HttpResponse} response - The latest revalidation HTTP response from the origin server.
5558
+ * @returns {{policy: CachePolicy, modified: boolean, matches: boolean}} The updated policy and modification status.
5559
+ * @throws {Error} If the response headers are missing.
5397
5560
  */
5398
5561
  revalidatedPolicy(request, response) {
5399
5562
  if (this._assertRequestHasHeaders(request), this._useStaleIfError() && isErrorResponse(response))
5400
5563
  return {
5564
+ policy: this,
5401
5565
  modified: !1,
5402
- matches: !1,
5403
- policy: this
5566
+ matches: !0
5404
5567
  };
5405
5568
  if (!response || !response.headers)
5406
5569
  throw Error("Response headers missing");
5407
5570
  let matches = !1;
5408
- if (response.status !== void 0 && response.status != 304 ? matches = !1 : response.headers.etag && !/^\s*W\//.test(response.headers.etag) ? matches = this._resHeaders.etag && this._resHeaders.etag.replace(/^\s*W\//, "") === response.headers.etag : this._resHeaders.etag && response.headers.etag ? matches = this._resHeaders.etag.replace(/^\s*W\//, "") === response.headers.etag.replace(/^\s*W\//, "") : this._resHeaders["last-modified"] ? matches = this._resHeaders["last-modified"] === response.headers["last-modified"] : !this._resHeaders.etag && !this._resHeaders["last-modified"] && !response.headers.etag && !response.headers["last-modified"] && (matches = !0), !matches)
5571
+ response.status !== void 0 && response.status != 304 ? matches = !1 : response.headers.etag && !/^\s*W\//.test(response.headers.etag) ? matches = this._resHeaders.etag && this._resHeaders.etag.replace(/^\s*W\//, "") === response.headers.etag : this._resHeaders.etag && response.headers.etag ? matches = this._resHeaders.etag.replace(/^\s*W\//, "") === response.headers.etag.replace(/^\s*W\//, "") : this._resHeaders["last-modified"] ? matches = this._resHeaders["last-modified"] === response.headers["last-modified"] : !this._resHeaders.etag && !this._resHeaders["last-modified"] && !response.headers.etag && !response.headers["last-modified"] && (matches = !0);
5572
+ let optionsCopy = {
5573
+ shared: this._isShared,
5574
+ cacheHeuristic: this._cacheHeuristic,
5575
+ immutableMinTimeToLive: this._immutableMinTtl,
5576
+ ignoreCargoCult: this._ignoreCargoCult
5577
+ };
5578
+ if (!matches)
5409
5579
  return {
5410
- policy: new this.constructor(request, response),
5580
+ policy: new this.constructor(request, response, optionsCopy),
5411
5581
  // Client receiving 304 without body, even if it's invalid/mismatched has no option
5412
5582
  // but to reuse a cached body. We don't have a good way to tell clients to do
5413
5583
  // error recovery in such case.
@@ -5423,11 +5593,7 @@ var require_http_cache_semantics = __commonJS({
5423
5593
  headers
5424
5594
  });
5425
5595
  return {
5426
- policy: new this.constructor(request, newResponse, {
5427
- shared: this._isShared,
5428
- cacheHeuristic: this._cacheHeuristic,
5429
- immutableMinTimeToLive: this._immutableMinTtl
5430
- }),
5596
+ policy: new this.constructor(request, newResponse, optionsCopy),
5431
5597
  modified: !1,
5432
5598
  matches: !0
5433
5599
  };
@@ -8183,9 +8349,9 @@ var require_config_chain = __commonJS({
8183
8349
  }
8184
8350
  });
8185
8351
 
8186
- // ../../node_modules/.pnpm/@pnpm+npm-conf@2.2.2/node_modules/@pnpm/npm-conf/lib/envKeyToSetting.js
8352
+ // ../../node_modules/.pnpm/@pnpm+npm-conf@2.3.1/node_modules/@pnpm/npm-conf/lib/envKeyToSetting.js
8187
8353
  var require_envKeyToSetting = __commonJS({
8188
- "../../node_modules/.pnpm/@pnpm+npm-conf@2.2.2/node_modules/@pnpm/npm-conf/lib/envKeyToSetting.js"(exports, module) {
8354
+ "../../node_modules/.pnpm/@pnpm+npm-conf@2.3.1/node_modules/@pnpm/npm-conf/lib/envKeyToSetting.js"(exports, module) {
8189
8355
  init_cjs_shims();
8190
8356
  module.exports = function(x) {
8191
8357
  let colonIndex = x.indexOf(":");
@@ -8249,12 +8415,12 @@ var require_dist3 = __commonJS({
8249
8415
  }
8250
8416
  });
8251
8417
 
8252
- // ../../node_modules/.pnpm/@pnpm+npm-conf@2.2.2/node_modules/@pnpm/npm-conf/lib/util.js
8418
+ // ../../node_modules/.pnpm/@pnpm+npm-conf@2.3.1/node_modules/@pnpm/npm-conf/lib/util.js
8253
8419
  var require_util2 = __commonJS({
8254
- "../../node_modules/.pnpm/@pnpm+npm-conf@2.2.2/node_modules/@pnpm/npm-conf/lib/util.js"(exports) {
8420
+ "../../node_modules/.pnpm/@pnpm+npm-conf@2.3.1/node_modules/@pnpm/npm-conf/lib/util.js"(exports) {
8255
8421
  "use strict";
8256
8422
  init_cjs_shims();
8257
- var fs3 = __require("fs"), path4 = __require("path"), { envReplace } = require_dist3(), parseField = (types2, field, key) => {
8423
+ var fs3 = __require("fs"), path4 = __require("path"), { envReplace } = require_dist3(), parseKey = (key) => typeof key != "string" ? key : envReplace(key, process.env), parseField = (types2, field, key) => {
8258
8424
  if (typeof field != "string")
8259
8425
  return field;
8260
8426
  let typeList = [].concat(types2[key]), isPath = typeList.indexOf(path4) !== -1, isBool = typeList.indexOf(Boolean) !== -1, isString2 = typeList.indexOf(String) !== -1, isNumber = typeList.indexOf(Number) !== -1;
@@ -8309,12 +8475,13 @@ var require_util2 = __commonJS({
8309
8475
  exports.envReplace = envReplace;
8310
8476
  exports.findPrefix = findPrefix;
8311
8477
  exports.parseField = parseField;
8478
+ exports.parseKey = parseKey;
8312
8479
  }
8313
8480
  });
8314
8481
 
8315
- // ../../node_modules/.pnpm/@pnpm+npm-conf@2.2.2/node_modules/@pnpm/npm-conf/lib/types.js
8482
+ // ../../node_modules/.pnpm/@pnpm+npm-conf@2.3.1/node_modules/@pnpm/npm-conf/lib/types.js
8316
8483
  var require_types2 = __commonJS({
8317
- "../../node_modules/.pnpm/@pnpm+npm-conf@2.2.2/node_modules/@pnpm/npm-conf/lib/types.js"(exports) {
8484
+ "../../node_modules/.pnpm/@pnpm+npm-conf@2.3.1/node_modules/@pnpm/npm-conf/lib/types.js"(exports) {
8318
8485
  "use strict";
8319
8486
  init_cjs_shims();
8320
8487
  var path4 = __require("path"), Stream = __require("stream").Stream, url = __require("url"), Umask = () => {
@@ -8447,9 +8614,9 @@ var require_types2 = __commonJS({
8447
8614
  }
8448
8615
  });
8449
8616
 
8450
- // ../../node_modules/.pnpm/@pnpm+npm-conf@2.2.2/node_modules/@pnpm/npm-conf/lib/conf.js
8617
+ // ../../node_modules/.pnpm/@pnpm+npm-conf@2.3.1/node_modules/@pnpm/npm-conf/lib/conf.js
8451
8618
  var require_conf = __commonJS({
8452
- "../../node_modules/.pnpm/@pnpm+npm-conf@2.2.2/node_modules/@pnpm/npm-conf/lib/conf.js"(exports, module) {
8619
+ "../../node_modules/.pnpm/@pnpm+npm-conf@2.3.1/node_modules/@pnpm/npm-conf/lib/conf.js"(exports, module) {
8453
8620
  "use strict";
8454
8621
  init_cjs_shims();
8455
8622
  var { readCAFileSync } = require_dist2(), fs3 = __require("fs"), path4 = __require("path"), { ConfigChain } = require_config_chain(), envKeyToSetting = require_envKeyToSetting(), util = require_util2(), Conf2 = class extends ConfigChain {
@@ -8460,8 +8627,10 @@ var require_conf = __commonJS({
8460
8627
  // https://github.com/npm/cli/blob/latest/lib/config/core.js#L326-L338
8461
8628
  add(data, marker) {
8462
8629
  try {
8463
- for (let x of Object.keys(data))
8464
- data[x] = this._parseField(data[x], x);
8630
+ for (let [key, value] of Object.entries(data)) {
8631
+ let substKey = util.parseKey(key);
8632
+ substKey !== key && delete data[key], data[substKey] = this._parseField(value, substKey);
8633
+ }
8465
8634
  } catch (error) {
8466
8635
  throw error;
8467
8636
  }
@@ -8478,7 +8647,7 @@ var require_conf = __commonJS({
8478
8647
  } catch (error) {
8479
8648
  if (error.code === "ENOENT")
8480
8649
  this.add({}, marker);
8481
- else
8650
+ else if (error.code !== "EISDIR")
8482
8651
  return `Issue while reading "${file}". ${error.message}`;
8483
8652
  }
8484
8653
  }
@@ -8487,7 +8656,10 @@ var require_conf = __commonJS({
8487
8656
  env = env || process.env;
8488
8657
  let conf = {};
8489
8658
  return Object.keys(env).filter((x) => /^npm_config_/i.test(x)).forEach((x) => {
8490
- env[x] && (conf[envKeyToSetting(x.substr(11))] = env[x]);
8659
+ if (!env[x])
8660
+ return;
8661
+ let key = envKeyToSetting(x.substr(11)), rawVal = env[x];
8662
+ conf[key] = deserializeEnvVal(key, rawVal);
8491
8663
  }), super.addEnv("", conf, "env");
8492
8664
  }
8493
8665
  // https://github.com/npm/cli/blob/latest/lib/config/load-prefix.js
@@ -8551,13 +8723,27 @@ var require_conf = __commonJS({
8551
8723
  }
8552
8724
  }
8553
8725
  };
8726
+ function deserializeEnvVal(envKey, envValue) {
8727
+ function deserializeList(envValue2) {
8728
+ let npmConfigSep = `
8729
+
8730
+ `;
8731
+ return envValue2.indexOf(npmConfigSep) ? envValue2.split(npmConfigSep) : envValue2.split(",");
8732
+ }
8733
+ switch (envKey) {
8734
+ case "hoist-pattern":
8735
+ case "public-hoist-pattern":
8736
+ return deserializeList(envValue);
8737
+ }
8738
+ return envValue;
8739
+ }
8554
8740
  module.exports = Conf2;
8555
8741
  }
8556
8742
  });
8557
8743
 
8558
- // ../../node_modules/.pnpm/@pnpm+npm-conf@2.2.2/node_modules/@pnpm/npm-conf/lib/defaults.js
8744
+ // ../../node_modules/.pnpm/@pnpm+npm-conf@2.3.1/node_modules/@pnpm/npm-conf/lib/defaults.js
8559
8745
  var require_defaults2 = __commonJS({
8560
- "../../node_modules/.pnpm/@pnpm+npm-conf@2.2.2/node_modules/@pnpm/npm-conf/lib/defaults.js"(exports) {
8746
+ "../../node_modules/.pnpm/@pnpm+npm-conf@2.3.1/node_modules/@pnpm/npm-conf/lib/defaults.js"(exports) {
8561
8747
  "use strict";
8562
8748
  init_cjs_shims();
8563
8749
  var os3 = __require("os"), path4 = __require("path"), temp = os3.tmpdir(), uidOrPid = process.getuid ? process.getuid() : process.pid, hasUnicode = () => !0, isWindows = process.platform === "win32", osenv = {
@@ -8696,9 +8882,9 @@ var require_defaults2 = __commonJS({
8696
8882
  }
8697
8883
  });
8698
8884
 
8699
- // ../../node_modules/.pnpm/@pnpm+npm-conf@2.2.2/node_modules/@pnpm/npm-conf/index.js
8885
+ // ../../node_modules/.pnpm/@pnpm+npm-conf@2.3.1/node_modules/@pnpm/npm-conf/index.js
8700
8886
  var require_npm_conf = __commonJS({
8701
- "../../node_modules/.pnpm/@pnpm+npm-conf@2.2.2/node_modules/@pnpm/npm-conf/index.js"(exports, module) {
8887
+ "../../node_modules/.pnpm/@pnpm+npm-conf@2.3.1/node_modules/@pnpm/npm-conf/index.js"(exports, module) {
8702
8888
  "use strict";
8703
8889
  init_cjs_shims();
8704
8890
  var path4 = __require("path"), Conf2 = require_conf(), _defaults = require_defaults2();
@@ -8742,11 +8928,11 @@ var require_npm_conf = __commonJS({
8742
8928
  }
8743
8929
  });
8744
8930
 
8745
- // ../../node_modules/.pnpm/registry-auth-token@5.0.2/node_modules/registry-auth-token/index.js
8931
+ // ../../node_modules/.pnpm/registry-auth-token@5.1.0/node_modules/registry-auth-token/index.js
8746
8932
  var require_registry_auth_token = __commonJS({
8747
- "../../node_modules/.pnpm/registry-auth-token@5.0.2/node_modules/registry-auth-token/index.js"(exports, module) {
8933
+ "../../node_modules/.pnpm/registry-auth-token@5.1.0/node_modules/registry-auth-token/index.js"(exports, module) {
8748
8934
  init_cjs_shims();
8749
- var url = __require("url"), npmConf = require_npm_conf(), tokenKey = ":_authToken", legacyTokenKey = ":_auth", userKey = ":username", passwordKey = ":_password";
8935
+ var npmConf = require_npm_conf(), tokenKey = ":_authToken", legacyTokenKey = ":_auth", userKey = ":username", passwordKey = ":_password";
8750
8936
  module.exports = function() {
8751
8937
  let checkUrl, options;
8752
8938
  arguments.length >= 2 ? (checkUrl = arguments[0], options = Object.assign({}, arguments[1])) : typeof arguments[0] == "string" ? checkUrl = arguments[0] : options = Object.assign({}, arguments[0]), options = options || {};
@@ -8757,16 +8943,24 @@ var require_registry_auth_token = __commonJS({
8757
8943
  }
8758
8944
  } : npmConf()).config, checkUrl = checkUrl || options.npmrc.get("registry") || npmConf.defaults.registry, getRegistryAuthInfo(checkUrl, options) || getLegacyAuthInfo(options.npmrc);
8759
8945
  };
8946
+ function urlResolve(from, to) {
8947
+ let resolvedUrl = new URL(to, new URL(from.startsWith("//") ? `./${from}` : from, "resolve://"));
8948
+ if (resolvedUrl.protocol === "resolve:") {
8949
+ let { pathname, search, hash } = resolvedUrl;
8950
+ return pathname + search + hash;
8951
+ }
8952
+ return resolvedUrl.toString();
8953
+ }
8760
8954
  function getRegistryAuthInfo(checkUrl, options) {
8761
- let parsed = url.parse(checkUrl, !1, !0), pathname;
8955
+ let parsed = checkUrl instanceof URL ? checkUrl : new URL(checkUrl.startsWith("//") ? `http:${checkUrl}` : checkUrl), pathname;
8762
8956
  for (; pathname !== "/" && parsed.pathname !== pathname; ) {
8763
8957
  pathname = parsed.pathname || "/";
8764
8958
  let regUrl = "//" + parsed.host + pathname.replace(/\/$/, ""), authInfo = getAuthInfoForUrl(regUrl, options.npmrc);
8765
8959
  if (authInfo)
8766
8960
  return authInfo;
8767
8961
  if (!options.recursive)
8768
- return /\/$/.test(checkUrl) ? void 0 : getRegistryAuthInfo(url.resolve(checkUrl, "."), options);
8769
- parsed.pathname = url.resolve(normalizePath(pathname), "..") || "/";
8962
+ return /\/$/.test(checkUrl) ? void 0 : getRegistryAuthInfo(new URL("./", parsed), options);
8963
+ parsed.pathname = urlResolve(normalizePath(pathname), "..") || "/";
8770
8964
  }
8771
8965
  }
8772
8966
  function getLegacyAuthInfo(npmrc) {
@@ -9158,26 +9352,26 @@ init_cjs_shims();
9158
9352
  init_cjs_shims();
9159
9353
  import path from "node:path";
9160
9354
 
9161
- // ../../node_modules/.pnpm/when-exit@2.1.2/node_modules/when-exit/dist/node/index.js
9355
+ // ../../node_modules/.pnpm/when-exit@2.1.4/node_modules/when-exit/dist/node/index.js
9162
9356
  init_cjs_shims();
9163
9357
 
9164
- // ../../node_modules/.pnpm/when-exit@2.1.2/node_modules/when-exit/dist/node/interceptor.js
9358
+ // ../../node_modules/.pnpm/when-exit@2.1.4/node_modules/when-exit/dist/node/interceptor.js
9165
9359
  init_cjs_shims();
9166
9360
  import process5 from "node:process";
9167
9361
 
9168
- // ../../node_modules/.pnpm/when-exit@2.1.2/node_modules/when-exit/dist/node/constants.js
9362
+ // ../../node_modules/.pnpm/when-exit@2.1.4/node_modules/when-exit/dist/node/constants.js
9169
9363
  init_cjs_shims();
9170
9364
  import process4 from "node:process";
9171
9365
  var IS_LINUX = process4.platform === "linux", IS_WINDOWS = process4.platform === "win32";
9172
9366
 
9173
- // ../../node_modules/.pnpm/when-exit@2.1.2/node_modules/when-exit/dist/node/signals.js
9367
+ // ../../node_modules/.pnpm/when-exit@2.1.4/node_modules/when-exit/dist/node/signals.js
9174
9368
  init_cjs_shims();
9175
9369
  var Signals = ["SIGABRT", "SIGALRM", "SIGHUP", "SIGINT", "SIGTERM"];
9176
9370
  IS_WINDOWS || Signals.push("SIGVTALRM", "SIGXCPU", "SIGXFSZ", "SIGUSR2", "SIGTRAP", "SIGSYS", "SIGQUIT", "SIGIOT");
9177
9371
  IS_LINUX && Signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SIGSTKFLT", "SIGUNUSED");
9178
9372
  var signals_default = Signals;
9179
9373
 
9180
- // ../../node_modules/.pnpm/when-exit@2.1.2/node_modules/when-exit/dist/node/interceptor.js
9374
+ // ../../node_modules/.pnpm/when-exit@2.1.4/node_modules/when-exit/dist/node/interceptor.js
9181
9375
  var Interceptor = class {
9182
9376
  /* CONSTRUCTOR */
9183
9377
  constructor() {
@@ -9191,14 +9385,17 @@ var Interceptor = class {
9191
9385
  }, this.hook = () => {
9192
9386
  process5.once("exit", () => this.exit());
9193
9387
  for (let signal of signals_default)
9194
- process5.once(signal, () => this.exit(signal));
9388
+ try {
9389
+ process5.once(signal, () => this.exit(signal));
9390
+ } catch {
9391
+ }
9195
9392
  }, this.register = (callback) => (this.callbacks.add(callback), () => {
9196
9393
  this.callbacks.delete(callback);
9197
9394
  }), this.hook();
9198
9395
  }
9199
9396
  }, interceptor_default = new Interceptor();
9200
9397
 
9201
- // ../../node_modules/.pnpm/when-exit@2.1.2/node_modules/when-exit/dist/node/index.js
9398
+ // ../../node_modules/.pnpm/when-exit@2.1.4/node_modules/when-exit/dist/node/index.js
9202
9399
  var whenExit = interceptor_default.register, node_default = whenExit;
9203
9400
 
9204
9401
  // ../../node_modules/.pnpm/atomically@2.0.3/node_modules/atomically/dist/utils/temp.js
@@ -13423,10 +13620,12 @@ function packageManagerFromUserAgent(env = process.env) {
13423
13620
  return env.npm_config_user_agent?.includes("yarn") ? "yarn" : env.npm_config_user_agent?.includes("pnpm") ? "pnpm" : env.npm_config_user_agent?.includes("bun") ? "bun" : env.npm_config_user_agent?.includes("npm") ? "npm" : "unknown";
13424
13621
  }
13425
13622
  async function getPackageManager(fromDirectory) {
13426
- let directory = await captureOutput("npm", ["prefix"], { cwd: fromDirectory });
13427
- outputDebug(outputContent`Obtaining the dependency manager in directory ${outputToken.path(directory)}...`);
13428
- let packageJson2 = joinPath(directory, "package.json");
13429
- if (!await fileExists(packageJson2))
13623
+ let directory, packageJson2;
13624
+ try {
13625
+ directory = await captureOutput("npm", ["prefix"], { cwd: fromDirectory }), outputDebug(outputContent`Obtaining the dependency manager in directory ${outputToken.path(directory)}...`), packageJson2 = joinPath(directory, "package.json");
13626
+ } catch {
13627
+ }
13628
+ if (!directory || !packageJson2 || !await fileExists(packageJson2))
13430
13629
  return packageManagerFromUserAgent();
13431
13630
  let yarnLockPath = joinPath(directory, yarnLockfile), pnpmLockPath = joinPath(directory, pnpmLockfile), bunLockPath = joinPath(directory, bunLockfile);
13432
13631
  return await fileExists(yarnLockPath) ? "yarn" : await fileExists(pnpmLockPath) ? "pnpm" : await fileExists(bunLockPath) ? "bun" : "npm";
@@ -13708,4 +13907,4 @@ deep-extend/lib/deep-extend.js:
13708
13907
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
13709
13908
  *)
13710
13909
  */
13711
- //# sourceMappingURL=chunk-3HCB5FCE.js.map
13910
+ //# sourceMappingURL=chunk-7O563I7I.js.map