@antongolub/lockfile 0.0.0-snapshot.72 → 0.0.0-snapshot.73

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.
@@ -1487,6 +1487,13 @@ function distTagResolve(range, candidates) {
1487
1487
  const ids = eligible.map((c) => c.id).sort(cmpStr2);
1488
1488
  return { kind: "ambiguous", candidateIds: ids };
1489
1489
  }
1490
+ function catalogResolve(range, candidates) {
1491
+ if (!range.startsWith("catalog:")) return { kind: "none" };
1492
+ const eligible = candidates.filter((c) => c.sourceType === "tarball");
1493
+ if (eligible.length === 0) return { kind: "none" };
1494
+ if (eligible.length === 1) return { kind: "bound", id: eligible[0].id };
1495
+ return { kind: "ambiguous", candidateIds: eligible.map((c) => c.id).sort(cmpStr2) };
1496
+ }
1490
1497
  function overrideTargetFor(depName, declaredRange, consumerPath, overrides) {
1491
1498
  let best;
1492
1499
  let bestScore = -1;
@@ -2941,6 +2948,10 @@ function addEdgesFromBlock(builder, srcId, block, kind, index, patchDescriptorIn
2941
2948
  continue;
2942
2949
  }
2943
2950
  }
2951
+ if (dstId === void 0) {
2952
+ const result = catalogResolve(normalizedRange, ladder.candidatesByName.get(depName) ?? []);
2953
+ if (result.kind === "bound") dstId = result.id;
2954
+ }
2944
2955
  if (typeof dstId === "string" && !boundViaOverride && isRegistryRange(normalizedRange)) {
2945
2956
  const bound = nodeNameVersion(dstId);
2946
2957
  const siblings = bound === void 0 ? void 0 : ladder.patchSiblingsByBase.get(bound);
@@ -1487,6 +1487,13 @@ function distTagResolve(range, candidates) {
1487
1487
  const ids = eligible.map((c) => c.id).sort(cmpStr2);
1488
1488
  return { kind: "ambiguous", candidateIds: ids };
1489
1489
  }
1490
+ function catalogResolve(range, candidates) {
1491
+ if (!range.startsWith("catalog:")) return { kind: "none" };
1492
+ const eligible = candidates.filter((c) => c.sourceType === "tarball");
1493
+ if (eligible.length === 0) return { kind: "none" };
1494
+ if (eligible.length === 1) return { kind: "bound", id: eligible[0].id };
1495
+ return { kind: "ambiguous", candidateIds: eligible.map((c) => c.id).sort(cmpStr2) };
1496
+ }
1490
1497
  function overrideTargetFor(depName, declaredRange, consumerPath, overrides) {
1491
1498
  let best;
1492
1499
  let bestScore = -1;
@@ -2945,6 +2952,10 @@ function addEdgesFromBlock(builder, srcId, block, kind, index, patchDescriptorIn
2945
2952
  continue;
2946
2953
  }
2947
2954
  }
2955
+ if (dstId === void 0) {
2956
+ const result = catalogResolve(normalizedRange, ladder.candidatesByName.get(depName) ?? []);
2957
+ if (result.kind === "bound") dstId = result.id;
2958
+ }
2948
2959
  if (typeof dstId === "string" && !boundViaOverride && isRegistryRange(normalizedRange)) {
2949
2960
  const bound = nodeNameVersion(dstId);
2950
2961
  const siblings = bound === void 0 ? void 0 : ladder.patchSiblingsByBase.get(bound);
@@ -1487,6 +1487,13 @@ function distTagResolve(range, candidates) {
1487
1487
  const ids = eligible.map((c) => c.id).sort(cmpStr2);
1488
1488
  return { kind: "ambiguous", candidateIds: ids };
1489
1489
  }
1490
+ function catalogResolve(range, candidates) {
1491
+ if (!range.startsWith("catalog:")) return { kind: "none" };
1492
+ const eligible = candidates.filter((c) => c.sourceType === "tarball");
1493
+ if (eligible.length === 0) return { kind: "none" };
1494
+ if (eligible.length === 1) return { kind: "bound", id: eligible[0].id };
1495
+ return { kind: "ambiguous", candidateIds: eligible.map((c) => c.id).sort(cmpStr2) };
1496
+ }
1490
1497
  function overrideTargetFor(depName, declaredRange, consumerPath, overrides) {
1491
1498
  let best;
1492
1499
  let bestScore = -1;
@@ -2940,6 +2947,10 @@ function addEdgesFromBlock(builder, srcId, block, kind, index, patchDescriptorIn
2940
2947
  continue;
2941
2948
  }
2942
2949
  }
2950
+ if (dstId === void 0) {
2951
+ const result = catalogResolve(normalizedRange, ladder.candidatesByName.get(depName) ?? []);
2952
+ if (result.kind === "bound") dstId = result.id;
2953
+ }
2943
2954
  if (typeof dstId === "string" && !boundViaOverride && isRegistryRange(normalizedRange)) {
2944
2955
  const bound = nodeNameVersion(dstId);
2945
2956
  const siblings = bound === void 0 ? void 0 : ladder.patchSiblingsByBase.get(bound);
@@ -1487,6 +1487,13 @@ function distTagResolve(range, candidates) {
1487
1487
  const ids = eligible.map((c) => c.id).sort(cmpStr2);
1488
1488
  return { kind: "ambiguous", candidateIds: ids };
1489
1489
  }
1490
+ function catalogResolve(range, candidates) {
1491
+ if (!range.startsWith("catalog:")) return { kind: "none" };
1492
+ const eligible = candidates.filter((c) => c.sourceType === "tarball");
1493
+ if (eligible.length === 0) return { kind: "none" };
1494
+ if (eligible.length === 1) return { kind: "bound", id: eligible[0].id };
1495
+ return { kind: "ambiguous", candidateIds: eligible.map((c) => c.id).sort(cmpStr2) };
1496
+ }
1490
1497
  function overrideTargetFor(depName, declaredRange, consumerPath, overrides) {
1491
1498
  let best;
1492
1499
  let bestScore = -1;
@@ -2940,6 +2947,10 @@ function addEdgesFromBlock(builder, srcId, block, kind, index, patchDescriptorIn
2940
2947
  continue;
2941
2948
  }
2942
2949
  }
2950
+ if (dstId === void 0) {
2951
+ const result = catalogResolve(normalizedRange, ladder.candidatesByName.get(depName) ?? []);
2952
+ if (result.kind === "bound") dstId = result.id;
2953
+ }
2943
2954
  if (typeof dstId === "string" && !boundViaOverride && isRegistryRange(normalizedRange)) {
2944
2955
  const bound = nodeNameVersion(dstId);
2945
2956
  const siblings = bound === void 0 ? void 0 : ladder.patchSiblingsByBase.get(bound);
@@ -1487,6 +1487,13 @@ function distTagResolve(range, candidates) {
1487
1487
  const ids = eligible.map((c) => c.id).sort(cmpStr2);
1488
1488
  return { kind: "ambiguous", candidateIds: ids };
1489
1489
  }
1490
+ function catalogResolve(range, candidates) {
1491
+ if (!range.startsWith("catalog:")) return { kind: "none" };
1492
+ const eligible = candidates.filter((c) => c.sourceType === "tarball");
1493
+ if (eligible.length === 0) return { kind: "none" };
1494
+ if (eligible.length === 1) return { kind: "bound", id: eligible[0].id };
1495
+ return { kind: "ambiguous", candidateIds: eligible.map((c) => c.id).sort(cmpStr2) };
1496
+ }
1490
1497
  function overrideTargetFor(depName, declaredRange, consumerPath, overrides) {
1491
1498
  let best;
1492
1499
  let bestScore = -1;
@@ -2940,6 +2947,10 @@ function addEdgesFromBlock(builder, srcId, block, kind, index, patchDescriptorIn
2940
2947
  continue;
2941
2948
  }
2942
2949
  }
2950
+ if (dstId === void 0) {
2951
+ const result = catalogResolve(normalizedRange, ladder.candidatesByName.get(depName) ?? []);
2952
+ if (result.kind === "bound") dstId = result.id;
2953
+ }
2943
2954
  if (typeof dstId === "string" && !boundViaOverride && isRegistryRange(normalizedRange)) {
2944
2955
  const bound = nodeNameVersion(dstId);
2945
2956
  const siblings = bound === void 0 ? void 0 : ladder.patchSiblingsByBase.get(bound);
@@ -1487,6 +1487,13 @@ function distTagResolve(range, candidates) {
1487
1487
  const ids = eligible.map((c) => c.id).sort(cmpStr2);
1488
1488
  return { kind: "ambiguous", candidateIds: ids };
1489
1489
  }
1490
+ function catalogResolve(range, candidates) {
1491
+ if (!range.startsWith("catalog:")) return { kind: "none" };
1492
+ const eligible = candidates.filter((c) => c.sourceType === "tarball");
1493
+ if (eligible.length === 0) return { kind: "none" };
1494
+ if (eligible.length === 1) return { kind: "bound", id: eligible[0].id };
1495
+ return { kind: "ambiguous", candidateIds: eligible.map((c) => c.id).sort(cmpStr2) };
1496
+ }
1490
1497
  function overrideTargetFor(depName, declaredRange, consumerPath, overrides) {
1491
1498
  let best;
1492
1499
  let bestScore = -1;
@@ -2941,6 +2948,10 @@ function addEdgesFromBlock(builder, srcId, block, kind, index, patchDescriptorIn
2941
2948
  continue;
2942
2949
  }
2943
2950
  }
2951
+ if (dstId === void 0) {
2952
+ const result = catalogResolve(normalizedRange, ladder.candidatesByName.get(depName) ?? []);
2953
+ if (result.kind === "bound") dstId = result.id;
2954
+ }
2944
2955
  if (typeof dstId === "string" && !boundViaOverride && isRegistryRange(normalizedRange)) {
2945
2956
  const bound = nodeNameVersion(dstId);
2946
2957
  const siblings = bound === void 0 ? void 0 : ladder.patchSiblingsByBase.get(bound);
@@ -1487,6 +1487,13 @@ function distTagResolve(range, candidates) {
1487
1487
  const ids = eligible.map((c) => c.id).sort(cmpStr2);
1488
1488
  return { kind: "ambiguous", candidateIds: ids };
1489
1489
  }
1490
+ function catalogResolve(range, candidates) {
1491
+ if (!range.startsWith("catalog:")) return { kind: "none" };
1492
+ const eligible = candidates.filter((c) => c.sourceType === "tarball");
1493
+ if (eligible.length === 0) return { kind: "none" };
1494
+ if (eligible.length === 1) return { kind: "bound", id: eligible[0].id };
1495
+ return { kind: "ambiguous", candidateIds: eligible.map((c) => c.id).sort(cmpStr2) };
1496
+ }
1490
1497
  function overrideTargetFor(depName, declaredRange, consumerPath, overrides) {
1491
1498
  let best;
1492
1499
  let bestScore = -1;
@@ -2941,6 +2948,10 @@ function addEdgesFromBlock(builder, srcId, block, kind, index, patchDescriptorIn
2941
2948
  continue;
2942
2949
  }
2943
2950
  }
2951
+ if (dstId === void 0) {
2952
+ const result = catalogResolve(normalizedRange, ladder.candidatesByName.get(depName) ?? []);
2953
+ if (result.kind === "bound") dstId = result.id;
2954
+ }
2944
2955
  if (typeof dstId === "string" && !boundViaOverride && isRegistryRange(normalizedRange)) {
2945
2956
  const bound = nodeNameVersion(dstId);
2946
2957
  const siblings = bound === void 0 ? void 0 : ladder.patchSiblingsByBase.get(bound);
package/dist/index.js CHANGED
@@ -6382,6 +6382,13 @@ function distTagResolve(range, candidates) {
6382
6382
  const ids = eligible.map((c) => c.id).sort(cmpStr4);
6383
6383
  return { kind: "ambiguous", candidateIds: ids };
6384
6384
  }
6385
+ function catalogResolve(range, candidates) {
6386
+ if (!range.startsWith("catalog:")) return { kind: "none" };
6387
+ const eligible = candidates.filter((c) => c.sourceType === "tarball");
6388
+ if (eligible.length === 0) return { kind: "none" };
6389
+ if (eligible.length === 1) return { kind: "bound", id: eligible[0].id };
6390
+ return { kind: "ambiguous", candidateIds: eligible.map((c) => c.id).sort(cmpStr4) };
6391
+ }
6385
6392
  function overrideTargetFor(depName, declaredRange, consumerPath, overrides) {
6386
6393
  let best;
6387
6394
  let bestScore = -1;
@@ -7451,6 +7458,10 @@ function addEdgesFromBlock(builder, srcId, block, kind, index, patchDescriptorIn
7451
7458
  continue;
7452
7459
  }
7453
7460
  }
7461
+ if (dstId === void 0) {
7462
+ const result = catalogResolve(normalizedRange, ladder.candidatesByName.get(depName) ?? []);
7463
+ if (result.kind === "bound") dstId = result.id;
7464
+ }
7454
7465
  if (typeof dstId === "string" && !boundViaOverride && isRegistryRange(normalizedRange)) {
7455
7466
  const bound = nodeNameVersion(dstId);
7456
7467
  const siblings = bound === void 0 ? void 0 : ladder.patchSiblingsByBase.get(bound);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@antongolub/lockfile",
3
- "version": "0.0.0-snapshot.72",
3
+ "version": "0.0.0-snapshot.73",
4
4
  "private": false,
5
5
  "description": "Universal lockfile model and converter for npm, yarn, pnpm, bun",
6
6
  "type": "module",