@antongolub/lockfile 0.0.0-snapshot.62 → 0.0.0-snapshot.64
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/{_npm-flat-types-CNIJpuMe.d.ts → _npm-flat-types-CR16JZFS.d.ts} +1 -1
- package/dist/{_pnpm-flat-core-Bx_-WTrC.d.ts → _pnpm-flat-core-DmGs4UQu.d.ts} +1 -1
- package/dist/{_yarn-berry-core-B56PpQ7F.d.ts → _yarn-berry-core-BhE-AhmX.d.ts} +1 -1
- package/dist/complete.d.ts +2 -2
- package/dist/formats/bun-text.d.ts +1 -1
- package/dist/formats/bun-text.js +68 -38
- package/dist/formats/npm-1.d.ts +1 -1
- package/dist/formats/npm-1.js +103 -44
- package/dist/formats/npm-2.d.ts +2 -2
- package/dist/formats/npm-2.js +159 -92
- package/dist/formats/npm-3.d.ts +2 -2
- package/dist/formats/npm-3.js +138 -76
- package/dist/formats/pnpm-v5.d.ts +1 -1
- package/dist/formats/pnpm-v5.js +122 -69
- package/dist/formats/pnpm-v6.d.ts +2 -2
- package/dist/formats/pnpm-v6.js +130 -76
- package/dist/formats/pnpm-v9.d.ts +2 -2
- package/dist/formats/pnpm-v9.js +130 -76
- package/dist/formats/yarn-berry-v10.d.ts +2 -2
- package/dist/formats/yarn-berry-v10.js +145 -72
- package/dist/formats/yarn-berry-v4.d.ts +2 -2
- package/dist/formats/yarn-berry-v4.js +145 -72
- package/dist/formats/yarn-berry-v5.d.ts +2 -2
- package/dist/formats/yarn-berry-v5.js +145 -72
- package/dist/formats/yarn-berry-v6.d.ts +2 -2
- package/dist/formats/yarn-berry-v6.js +145 -72
- package/dist/formats/yarn-berry-v7.d.ts +2 -2
- package/dist/formats/yarn-berry-v7.js +145 -72
- package/dist/formats/yarn-berry-v8.d.ts +2 -2
- package/dist/formats/yarn-berry-v8.js +145 -72
- package/dist/formats/yarn-berry-v9.d.ts +2 -2
- package/dist/formats/yarn-berry-v9.js +145 -72
- package/dist/formats/yarn-classic.d.ts +1 -1
- package/dist/formats/yarn-classic.js +123 -49
- package/dist/{graph-1poNzYjw.d.ts → graph-CPo-SvS2.d.ts} +1 -0
- package/dist/index.d.ts +5 -5
- package/dist/index.js +459 -320
- package/dist/{modify-BwXRiMLu.d.ts → modify-DuBV5-5V.d.ts} +2 -2
- package/dist/modify.d.ts +3 -3
- package/dist/modify.js +25 -18
- package/dist/{optimize-D3h1vGSq.d.ts → optimize-B6TOjYyj.d.ts} +1 -1
- package/dist/optimize.d.ts +2 -2
- package/dist/optimize.js +1 -1
- package/dist/registry.d.ts +11 -7
- package/dist/registry.js +42 -37
- package/dist/{types-DC8j2G_4.d.ts → types-BPMSHpCF.d.ts} +1 -1
- package/package.json +3 -2
package/dist/complete.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N as NodeId, D as Diagnostic, G as Graph, E as EdgeTriple, a as Node, b as EdgeKind } from './graph-
|
|
2
|
-
import { R as RegistryAdapter } from './types-
|
|
1
|
+
import { N as NodeId, D as Diagnostic, G as Graph, E as EdgeTriple, a as Node, b as EdgeKind } from './graph-CPo-SvS2.js';
|
|
2
|
+
import { R as RegistryAdapter } from './types-BPMSHpCF.js';
|
|
3
3
|
|
|
4
4
|
interface CompletionSeed {
|
|
5
5
|
/** NodeIds the modifier added in the just-completed mutate phase. */
|
package/dist/formats/bun-text.js
CHANGED
|
@@ -126,11 +126,12 @@ function tarballKeyInputsOfNode(node) {
|
|
|
126
126
|
var cmpStr = (a, b) => a < b ? -1 : a > b ? 1 : 0;
|
|
127
127
|
var cmpAlias = (a, b) => a === b ? 0 : a === void 0 ? -1 : b === void 0 ? 1 : cmpStr(a, b);
|
|
128
128
|
var cmpEdgeBy = (end) => (a, b) => {
|
|
129
|
+
var _a, _b;
|
|
129
130
|
const c = cmpStr(end === "dst" ? a.dst : a.src, end === "dst" ? b.dst : b.src);
|
|
130
131
|
if (c !== 0) return c;
|
|
131
132
|
const k = cmpStr(a.kind, b.kind);
|
|
132
133
|
if (k !== 0) return k;
|
|
133
|
-
return cmpAlias(a.attrs
|
|
134
|
+
return cmpAlias((_a = a.attrs) == null ? void 0 : _a.alias, (_b = b.attrs) == null ? void 0 : _b.alias);
|
|
134
135
|
};
|
|
135
136
|
function emptyState() {
|
|
136
137
|
return {
|
|
@@ -166,7 +167,10 @@ function removeMatching(arr, pred) {
|
|
|
166
167
|
arr.splice(i, 1);
|
|
167
168
|
return true;
|
|
168
169
|
}
|
|
169
|
-
var tripleKey = (e) =>
|
|
170
|
+
var tripleKey = (e) => {
|
|
171
|
+
var _a;
|
|
172
|
+
return `${e.src}\0${e.kind}\0${e.dst}\0${((_a = e.attrs) == null ? void 0 : _a.alias) ?? ""}`;
|
|
173
|
+
};
|
|
170
174
|
function rebindNodeId(s, oldId, newId, newNode) {
|
|
171
175
|
s.nodes.set(newId, newNode);
|
|
172
176
|
s.nodes.delete(oldId);
|
|
@@ -177,7 +181,10 @@ function rebindNodeId(s, oldId, newId, newNode) {
|
|
|
177
181
|
const peerInc = s.incoming.get(e.dst);
|
|
178
182
|
if (peerInc) {
|
|
179
183
|
const idx = peerInc.findIndex(
|
|
180
|
-
(x) =>
|
|
184
|
+
(x) => {
|
|
185
|
+
var _a, _b;
|
|
186
|
+
return x.src === oldId && x.kind === e.kind && x.dst === e.dst && ((_a = x.attrs) == null ? void 0 : _a.alias) === ((_b = e.attrs) == null ? void 0 : _b.alias);
|
|
187
|
+
}
|
|
181
188
|
);
|
|
182
189
|
if (idx >= 0) peerInc[idx] = e;
|
|
183
190
|
}
|
|
@@ -189,7 +196,10 @@ function rebindNodeId(s, oldId, newId, newNode) {
|
|
|
189
196
|
const peerOut = s.outgoing.get(e.src);
|
|
190
197
|
if (peerOut) {
|
|
191
198
|
const idx = peerOut.findIndex(
|
|
192
|
-
(x) =>
|
|
199
|
+
(x) => {
|
|
200
|
+
var _a, _b;
|
|
201
|
+
return x.src === e.src && x.kind === e.kind && x.dst === oldId && ((_a = x.attrs) == null ? void 0 : _a.alias) === ((_b = e.attrs) == null ? void 0 : _b.alias);
|
|
202
|
+
}
|
|
193
203
|
);
|
|
194
204
|
if (idx >= 0) peerOut[idx] = e;
|
|
195
205
|
}
|
|
@@ -202,12 +212,14 @@ function protocolOf(range) {
|
|
|
202
212
|
return /^[a-z][a-z0-9+.-]*$/i.test(prefix) ? prefix : void 0;
|
|
203
213
|
}
|
|
204
214
|
function isPublishedSelfLink(edge) {
|
|
205
|
-
|
|
215
|
+
var _a;
|
|
216
|
+
const range = (_a = edge.attrs) == null ? void 0 : _a.range;
|
|
206
217
|
if (range === void 0) return false;
|
|
207
218
|
const proto = protocolOf(range);
|
|
208
219
|
return proto === void 0 || proto === "npm";
|
|
209
220
|
}
|
|
210
221
|
function validate(s) {
|
|
222
|
+
var _a, _b, _c, _d, _e;
|
|
211
223
|
for (const d of s.diagnostics) {
|
|
212
224
|
if (d.severity === "error") {
|
|
213
225
|
throw new GraphError("INVARIANT_VIOLATION", `unresolved error diagnostic: ${d.code} \u2014 ${d.message}`);
|
|
@@ -224,7 +236,7 @@ function validate(s) {
|
|
|
224
236
|
}
|
|
225
237
|
const k = tripleKey(e);
|
|
226
238
|
if (seen.has(k)) {
|
|
227
|
-
const aliasSuffix = e.attrs
|
|
239
|
+
const aliasSuffix = ((_a = e.attrs) == null ? void 0 : _a.alias) !== void 0 ? ` (alias=${e.attrs.alias})` : "";
|
|
228
240
|
throw new GraphError("INVARIANT_VIOLATION", `duplicate edge: ${e.src} \u2192${e.kind} ${e.dst}${aliasSuffix}`);
|
|
229
241
|
}
|
|
230
242
|
seen.add(k);
|
|
@@ -234,14 +246,14 @@ function validate(s) {
|
|
|
234
246
|
if (node.workspacePath !== void 0) {
|
|
235
247
|
const inc = s.incoming.get(id) ?? [];
|
|
236
248
|
for (const edge of inc) {
|
|
237
|
-
if (s.nodes.get(edge.src)
|
|
238
|
-
if (s.tarballs.get(stripPeerContextFromNodeId(edge.src))
|
|
249
|
+
if (((_b = s.nodes.get(edge.src)) == null ? void 0 : _b.workspacePath) !== void 0) continue;
|
|
250
|
+
if (((_d = (_c = s.tarballs.get(stripPeerContextFromNodeId(edge.src))) == null ? void 0 : _c.resolution) == null ? void 0 : _d.type) === "directory") continue;
|
|
239
251
|
if (isPublishedSelfLink(edge)) {
|
|
240
252
|
s.diagnostics.push({
|
|
241
253
|
code: "SEAL_PUBLISHED_SELF_LINK",
|
|
242
254
|
subject: id,
|
|
243
255
|
severity: "info",
|
|
244
|
-
message: `published self-link: ${edge.src} \u2192${edge.kind} ${id} (range ${edge.attrs
|
|
256
|
+
message: `published self-link: ${edge.src} \u2192${edge.kind} ${id} (range ${(_e = edge.attrs) == null ? void 0 : _e.range}) \u2014 published dependency resolved to co-located workspace`
|
|
245
257
|
});
|
|
246
258
|
continue;
|
|
247
259
|
}
|
|
@@ -315,9 +327,9 @@ var GraphImpl = class _GraphImpl {
|
|
|
315
327
|
}
|
|
316
328
|
}
|
|
317
329
|
*walk(seeds, opts) {
|
|
318
|
-
const direction = opts
|
|
319
|
-
const kinds = opts
|
|
320
|
-
const maxDepth = opts
|
|
330
|
+
const direction = (opts == null ? void 0 : opts.direction) ?? "out";
|
|
331
|
+
const kinds = opts == null ? void 0 : opts.kinds;
|
|
332
|
+
const maxDepth = (opts == null ? void 0 : opts.maxDepth) ?? Infinity;
|
|
321
333
|
const visited = /* @__PURE__ */ new Set();
|
|
322
334
|
const initial = Array.isArray(seeds) ? seeds : [seeds];
|
|
323
335
|
const stack = [];
|
|
@@ -525,8 +537,11 @@ var GraphImpl = class _GraphImpl {
|
|
|
525
537
|
if (!next.nodes.has(src)) throw new GraphError("PATCH_REJECTED", `addEdge: src ${src} missing`);
|
|
526
538
|
if (!next.nodes.has(dst)) throw new GraphError("PATCH_REJECTED", `addEdge: dst ${dst} missing`);
|
|
527
539
|
const existing = next.outgoing.get(src) ?? [];
|
|
528
|
-
const newAlias = attrs
|
|
529
|
-
if (existing.some((e2) =>
|
|
540
|
+
const newAlias = attrs == null ? void 0 : attrs.alias;
|
|
541
|
+
if (existing.some((e2) => {
|
|
542
|
+
var _a;
|
|
543
|
+
return e2.dst === dst && e2.kind === kind && ((_a = e2.attrs) == null ? void 0 : _a.alias) === newAlias;
|
|
544
|
+
})) {
|
|
530
545
|
const aliasSuffix = newAlias !== void 0 ? ` (alias=${newAlias})` : "";
|
|
531
546
|
throw new GraphError("PATCH_REJECTED", `addEdge: duplicate ${src} \u2192${kind} ${dst}${aliasSuffix}`);
|
|
532
547
|
}
|
|
@@ -536,16 +551,20 @@ var GraphImpl = class _GraphImpl {
|
|
|
536
551
|
applied.push({ kind: "edge-added", subject: { src, dst, kind } });
|
|
537
552
|
},
|
|
538
553
|
removeEdge(src, dst, kind) {
|
|
554
|
+
var _a, _b;
|
|
539
555
|
const outs = next.outgoing.get(src);
|
|
540
556
|
let removedAlias;
|
|
541
|
-
const found = outs
|
|
557
|
+
const found = (outs == null ? void 0 : outs.findIndex((e) => e.dst === dst && e.kind === kind)) ?? -1;
|
|
542
558
|
if (!outs || found < 0) {
|
|
543
559
|
throw new GraphError("PATCH_REJECTED", `removeEdge: ${src} \u2192${kind} ${dst} missing`);
|
|
544
560
|
}
|
|
545
|
-
removedAlias = outs[found]
|
|
561
|
+
removedAlias = (_b = (_a = outs[found]) == null ? void 0 : _a.attrs) == null ? void 0 : _b.alias;
|
|
546
562
|
outs.splice(found, 1);
|
|
547
563
|
const ins = next.incoming.get(dst);
|
|
548
|
-
if (ins) removeMatching(ins, (e) =>
|
|
564
|
+
if (ins) removeMatching(ins, (e) => {
|
|
565
|
+
var _a2;
|
|
566
|
+
return e.src === src && e.kind === kind && ((_a2 = e.attrs) == null ? void 0 : _a2.alias) === removedAlias;
|
|
567
|
+
});
|
|
549
568
|
applied.push({ kind: "edge-removed", subject: { src, dst, kind } });
|
|
550
569
|
},
|
|
551
570
|
replacePeerContext(id, peers) {
|
|
@@ -740,12 +759,14 @@ function bunTextWouldCollapse(specifier) {
|
|
|
740
759
|
return isWorkspaceSpecifier(specifier);
|
|
741
760
|
}
|
|
742
761
|
function isWorkspaceEdge(edge) {
|
|
743
|
-
|
|
762
|
+
var _a;
|
|
763
|
+
return ((_a = edge.attrs) == null ? void 0 : _a.workspace) === true;
|
|
744
764
|
}
|
|
745
765
|
function workspaceRangeOfEdge(edge, dst) {
|
|
766
|
+
var _a, _b;
|
|
746
767
|
if (!isWorkspaceEdge(edge)) return void 0;
|
|
747
|
-
if (edge.attrs
|
|
748
|
-
const specifier = edge.attrs
|
|
768
|
+
if (((_a = edge.attrs) == null ? void 0 : _a.workspaceRange) !== void 0) return edge.attrs.workspaceRange;
|
|
769
|
+
const specifier = ((_b = edge.attrs) == null ? void 0 : _b.range) ?? "";
|
|
749
770
|
const sourceLooksProtocol = isWorkspaceSpecifier(specifier);
|
|
750
771
|
const canonicalSpecifier = sourceLooksProtocol ? specifier : "";
|
|
751
772
|
if (dst.version === void 0 || dst.version === "") return { specifier: canonicalSpecifier };
|
|
@@ -938,7 +959,8 @@ function rememberSidecar(graph, sidecar) {
|
|
|
938
959
|
sidecarByGraph.set(graph, sidecar);
|
|
939
960
|
}
|
|
940
961
|
function getBunOverridesCanonical(graph) {
|
|
941
|
-
|
|
962
|
+
var _a;
|
|
963
|
+
return (_a = sidecarByGraph.get(graph)) == null ? void 0 : _a.canonicalOverrides;
|
|
942
964
|
}
|
|
943
965
|
function check(input) {
|
|
944
966
|
if (!/"lockfileVersion"\s*:\s*1\b/.test(input)) return false;
|
|
@@ -1026,7 +1048,7 @@ function parse(input, _options = {}) {
|
|
|
1026
1048
|
continue;
|
|
1027
1049
|
}
|
|
1028
1050
|
const wsManifest = workspaces[parsed2.path];
|
|
1029
|
-
const wsVersion = wsManifest
|
|
1051
|
+
const wsVersion = (wsManifest == null ? void 0 : wsManifest.version) ?? "0.0.0";
|
|
1030
1052
|
const wsId = `${parsed2.name}@${wsVersion}`;
|
|
1031
1053
|
if (!seenNodeIds.has(wsId)) {
|
|
1032
1054
|
seenNodeIds.add(wsId);
|
|
@@ -1155,24 +1177,28 @@ function parse(input, _options = {}) {
|
|
|
1155
1177
|
}
|
|
1156
1178
|
}
|
|
1157
1179
|
function stringify(graph, options = {}) {
|
|
1180
|
+
var _a, _b, _c;
|
|
1158
1181
|
const sidecar = sidecarByGraph.get(graph);
|
|
1159
|
-
const emitDiagnostic = (diagnostic) =>
|
|
1182
|
+
const emitDiagnostic = (diagnostic) => {
|
|
1183
|
+
var _a2;
|
|
1184
|
+
return (_a2 = options.onDiagnostic) == null ? void 0 : _a2.call(options, diagnostic);
|
|
1185
|
+
};
|
|
1160
1186
|
const warnedPatches = /* @__PURE__ */ new Set();
|
|
1161
1187
|
const warnedPeerVirt = /* @__PURE__ */ new Set();
|
|
1162
1188
|
const rootNode = locateRootNode(graph, sidecar);
|
|
1163
1189
|
const memberNodes = Array.from(graph.nodes()).filter((n) => n.workspacePath !== void 0 && n.workspacePath !== "").sort((a, b) => cmpStr2(a.workspacePath, b.workspacePath));
|
|
1164
1190
|
const workspacesBlock = {
|
|
1165
|
-
"": buildWorkspaceManifest(graph, rootNode, sidecar
|
|
1191
|
+
"": buildWorkspaceManifest(graph, rootNode, (_a = sidecar == null ? void 0 : sidecar.workspaces.get("")) == null ? void 0 : _a.manifest, emitDiagnostic)
|
|
1166
1192
|
};
|
|
1167
1193
|
for (const member of memberNodes) {
|
|
1168
1194
|
const path = member.workspacePath;
|
|
1169
|
-
workspacesBlock[path] = buildWorkspaceManifest(graph, member, sidecar
|
|
1195
|
+
workspacesBlock[path] = buildWorkspaceManifest(graph, member, (_b = sidecar == null ? void 0 : sidecar.workspaces.get(path)) == null ? void 0 : _b.manifest, emitDiagnostic);
|
|
1170
1196
|
}
|
|
1171
1197
|
const packagesBlock = {};
|
|
1172
1198
|
for (const member of [...memberNodes].sort((a, b) => cmpStr2(a.name, b.name))) {
|
|
1173
1199
|
packagesBlock[member.name] = [`${member.name}@workspace:${member.workspacePath}`];
|
|
1174
1200
|
}
|
|
1175
|
-
const regularNodes = Array.from(graph.nodes()).filter((n) => n.id !== rootNode
|
|
1201
|
+
const regularNodes = Array.from(graph.nodes()).filter((n) => n.id !== (rootNode == null ? void 0 : rootNode.id) && n.workspacePath === void 0).sort(
|
|
1176
1202
|
(a, b) => cmpStr2(a.name, b.name) || cmpStr2(a.version, b.version) || (a.patch === void 0 ? 0 : 1) - (b.patch === void 0 ? 0 : 1)
|
|
1177
1203
|
);
|
|
1178
1204
|
const warnedResolutions = /* @__PURE__ */ new Set();
|
|
@@ -1187,7 +1213,7 @@ function stringify(graph, options = {}) {
|
|
|
1187
1213
|
}
|
|
1188
1214
|
emittedNameVersion.add(nameVersion);
|
|
1189
1215
|
const inner = buildInnerBlock(graph, node, sidecar);
|
|
1190
|
-
const integritySrc = graph.tarballOf(node.id)
|
|
1216
|
+
const integritySrc = (_c = graph.tarballOf(node.id)) == null ? void 0 : _c.integrity;
|
|
1191
1217
|
const integrity = (integritySrc && emitSri(integritySrc)) ?? "";
|
|
1192
1218
|
const key = chooseNodeEmitKey(node, sidecar, packagesBlock);
|
|
1193
1219
|
packagesBlock[key] = [`${node.name}@${node.version}`, "", inner, integrity];
|
|
@@ -1201,10 +1227,10 @@ function stringify(graph, options = {}) {
|
|
|
1201
1227
|
out.overrides = overridesBlock;
|
|
1202
1228
|
}
|
|
1203
1229
|
out.packages = packagesBlock;
|
|
1204
|
-
if (sidecar
|
|
1230
|
+
if ((sidecar == null ? void 0 : sidecar.patchedDependencies) !== void 0 && Object.keys(sidecar.patchedDependencies).length > 0) {
|
|
1205
1231
|
out.patchedDependencies = sortRecord(sidecar.patchedDependencies);
|
|
1206
1232
|
}
|
|
1207
|
-
if (sidecar
|
|
1233
|
+
if ((sidecar == null ? void 0 : sidecar.trustedDependencies) !== void 0 && sidecar.trustedDependencies.length > 0) {
|
|
1208
1234
|
out.trustedDependencies = [...sidecar.trustedDependencies].sort(cmpStr2);
|
|
1209
1235
|
}
|
|
1210
1236
|
const json = renderJsonc(out);
|
|
@@ -1214,8 +1240,8 @@ function resolveOverridesBlock(callerOverrides, sidecar, emitDiagnostic) {
|
|
|
1214
1240
|
if (callerOverrides !== void 0) {
|
|
1215
1241
|
return callerOverrides.length > 0 ? projectOverrides(callerOverrides, "npm", emitDiagnostic) : void 0;
|
|
1216
1242
|
}
|
|
1217
|
-
if (sidecar
|
|
1218
|
-
if (sidecar
|
|
1243
|
+
if ((sidecar == null ? void 0 : sidecar.nativeOverrides) !== void 0) return sidecar.nativeOverrides;
|
|
1244
|
+
if ((sidecar == null ? void 0 : sidecar.canonicalOverrides) !== void 0 && sidecar.canonicalOverrides.length > 0) {
|
|
1219
1245
|
return projectOverrides(sidecar.canonicalOverrides, "npm", emitDiagnostic);
|
|
1220
1246
|
}
|
|
1221
1247
|
return void 0;
|
|
@@ -1539,7 +1565,7 @@ function isWorkspaceProtocolRange(range) {
|
|
|
1539
1565
|
return range.startsWith("workspace:");
|
|
1540
1566
|
}
|
|
1541
1567
|
function locateRootNode(graph, sidecar) {
|
|
1542
|
-
if (sidecar
|
|
1568
|
+
if ((sidecar == null ? void 0 : sidecar.rootId) !== void 0) {
|
|
1543
1569
|
const node = graph.getNode(sidecar.rootId);
|
|
1544
1570
|
if (node !== void 0) return node;
|
|
1545
1571
|
}
|
|
@@ -1554,6 +1580,7 @@ function locateRootNode(graph, sidecar) {
|
|
|
1554
1580
|
return void 0;
|
|
1555
1581
|
}
|
|
1556
1582
|
function buildWorkspaceManifest(graph, workspaceNode, sidecarManifest, emitDiagnostic = () => void 0) {
|
|
1583
|
+
var _a;
|
|
1557
1584
|
const out = {};
|
|
1558
1585
|
if (workspaceNode !== void 0) {
|
|
1559
1586
|
out.name = workspaceNode.name;
|
|
@@ -1572,7 +1599,7 @@ function buildWorkspaceManifest(graph, workspaceNode, sidecarManifest, emitDiagn
|
|
|
1572
1599
|
for (const edge of graph.out(workspaceNode.id)) {
|
|
1573
1600
|
const dst = graph.getNode(edge.dst);
|
|
1574
1601
|
if (dst === void 0) continue;
|
|
1575
|
-
const range = edge.attrs
|
|
1602
|
+
const range = (_a = edge.attrs) == null ? void 0 : _a.range;
|
|
1576
1603
|
if (typeof range !== "string") continue;
|
|
1577
1604
|
const target = edge.kind === "dep" ? dependencies : edge.kind === "dev" ? devDependencies : edge.kind === "optional" ? optionalDependencies : edge.kind === "peer" ? peerDependencies : void 0;
|
|
1578
1605
|
if (target === void 0) continue;
|
|
@@ -1601,18 +1628,19 @@ function buildWorkspaceManifest(graph, workspaceNode, sidecarManifest, emitDiagn
|
|
|
1601
1628
|
return out;
|
|
1602
1629
|
}
|
|
1603
1630
|
function buildInnerBlock(graph, node, sidecar) {
|
|
1631
|
+
var _a, _b, _c;
|
|
1604
1632
|
const dependencies = {};
|
|
1605
1633
|
const optionalDependencies = {};
|
|
1606
1634
|
const peerDependencies = {};
|
|
1607
1635
|
for (const edge of graph.out(node.id)) {
|
|
1608
1636
|
const dst = graph.getNode(edge.dst);
|
|
1609
1637
|
if (dst === void 0) continue;
|
|
1610
|
-
const range = edge.attrs
|
|
1638
|
+
const range = (_a = edge.attrs) == null ? void 0 : _a.range;
|
|
1611
1639
|
if (typeof range !== "string") continue;
|
|
1612
1640
|
const target = edge.kind === "dep" || edge.kind === "dev" ? dependencies : edge.kind === "optional" ? optionalDependencies : edge.kind === "peer" ? peerDependencies : void 0;
|
|
1613
1641
|
if (target !== void 0) target[dst.name] = range;
|
|
1614
1642
|
}
|
|
1615
|
-
for (const [key, range] of sidecar
|
|
1643
|
+
for (const [key, range] of (sidecar == null ? void 0 : sidecar.peerDeclarations) ?? []) {
|
|
1616
1644
|
const sep = key.indexOf("|");
|
|
1617
1645
|
if (sep < 0 || key.slice(0, sep) !== node.id) continue;
|
|
1618
1646
|
const peerName = key.slice(sep + 1);
|
|
@@ -1622,12 +1650,13 @@ function buildInnerBlock(graph, node, sidecar) {
|
|
|
1622
1650
|
if (Object.keys(dependencies).length > 0) inner.dependencies = sortRecord(dependencies);
|
|
1623
1651
|
if (Object.keys(optionalDependencies).length > 0) inner.optionalDependencies = sortRecord(optionalDependencies);
|
|
1624
1652
|
if (Object.keys(peerDependencies).length > 0) inner.peerDependencies = sortRecord(peerDependencies);
|
|
1625
|
-
const stashedBin = sidecar
|
|
1653
|
+
const stashedBin = (_c = (_b = sidecar == null ? void 0 : sidecar.nodes.get(node.id)) == null ? void 0 : _b.inner) == null ? void 0 : _c.bin;
|
|
1626
1654
|
if (stashedBin !== void 0) inner.bin = stashedBin;
|
|
1627
1655
|
return inner;
|
|
1628
1656
|
}
|
|
1629
1657
|
function chooseNodeEmitKey(node, sidecar, alreadyEmitted) {
|
|
1630
|
-
|
|
1658
|
+
var _a;
|
|
1659
|
+
const stored = (_a = sidecar == null ? void 0 : sidecar.nodes.get(node.id)) == null ? void 0 : _a.packagesKey;
|
|
1631
1660
|
if (stored !== void 0 && alreadyEmitted[stored] === void 0) {
|
|
1632
1661
|
return stored;
|
|
1633
1662
|
}
|
|
@@ -1645,8 +1674,9 @@ function warnPatchDrop(node, warned, emitDiagnostic) {
|
|
|
1645
1674
|
);
|
|
1646
1675
|
}
|
|
1647
1676
|
function warnResolutionDrop(graph, node, warned, emitDiagnostic) {
|
|
1677
|
+
var _a;
|
|
1648
1678
|
if (warned.has(node.id)) return;
|
|
1649
|
-
const canonical = graph.tarballOf(node.id)
|
|
1679
|
+
const canonical = (_a = graph.tarballOf(node.id)) == null ? void 0 : _a.resolution;
|
|
1650
1680
|
if (canonical === void 0) return;
|
|
1651
1681
|
if (canonical.type === "tarball") return;
|
|
1652
1682
|
if (canonical.type === "unknown" && node.patch !== void 0) return;
|
package/dist/formats/npm-1.d.ts
CHANGED