nudojs 1.3.14 → 1.3.16
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/index.js +398 -167
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -21075,19 +21075,36 @@ function mergeGuardInto(list, g) {
|
|
|
21075
21075
|
if (grainA !== grainB) prev.grain = "nullish";
|
|
21076
21076
|
if (prev.memberKey === void 0 && g.memberKey !== void 0) prev.memberKey = g.memberKey;
|
|
21077
21077
|
}
|
|
21078
|
+
function appendReceiverGuards(test, out) {
|
|
21079
|
+
const facts = [];
|
|
21080
|
+
collectReceiverFacts(test, "both", facts);
|
|
21081
|
+
for (const f of facts) {
|
|
21082
|
+
const prev = out.find((x) => x.name === f.name && x.arm === f.arm);
|
|
21083
|
+
if (!prev) {
|
|
21084
|
+
out.push(f);
|
|
21085
|
+
continue;
|
|
21086
|
+
}
|
|
21087
|
+
const grainA = prev.grain ?? "nullish";
|
|
21088
|
+
const grainB = f.grain ?? "nullish";
|
|
21089
|
+
if (grainA !== grainB) prev.grain = "nullish";
|
|
21090
|
+
if (prev.memberKey === void 0 && f.memberKey !== void 0) prev.memberKey = f.memberKey;
|
|
21091
|
+
}
|
|
21092
|
+
}
|
|
21078
21093
|
function nullishGuardsOf(test) {
|
|
21079
21094
|
const t = test;
|
|
21080
21095
|
if (t?.type === "LogicalExpression" && (t.operator === "||" || t.operator === "&&")) {
|
|
21081
21096
|
const wantArm = t.operator === "||" ? "alt" : "cons";
|
|
21082
|
-
const
|
|
21097
|
+
const out2 = [];
|
|
21083
21098
|
for (const g2 of [...nullishGuardsOf(t.left), ...nullishGuardsOf(t.right)]) {
|
|
21084
21099
|
if (g2.arm !== wantArm) continue;
|
|
21085
|
-
mergeGuardInto(
|
|
21100
|
+
mergeGuardInto(out2, g2);
|
|
21086
21101
|
}
|
|
21087
|
-
return
|
|
21102
|
+
return out2;
|
|
21088
21103
|
}
|
|
21089
21104
|
const g = nullishGuardOf(test);
|
|
21090
|
-
|
|
21105
|
+
const out = g ? [g] : [];
|
|
21106
|
+
appendReceiverGuards(test, out);
|
|
21107
|
+
return out;
|
|
21091
21108
|
}
|
|
21092
21109
|
function typeGuardOf(test) {
|
|
21093
21110
|
const t = test;
|
|
@@ -21178,7 +21195,7 @@ function narrowDiscriminantArmThunks(thunk, guards, arm, forkBindingNames) {
|
|
|
21178
21195
|
).join(", ");
|
|
21179
21196
|
return `((${params}) => ${thunk})(${args})`;
|
|
21180
21197
|
}
|
|
21181
|
-
var TYPEOF_NAMES2, isStrLitNode, typeofArgName, memberGuardTarget, assignGuardTarget, isPrimLitNode;
|
|
21198
|
+
var TYPEOF_NAMES2, isStrLitNode, typeofArgName, memberGuardTarget, assignGuardTarget, methodReceiverTarget, collectReceiverFacts, isPrimLitNode;
|
|
21182
21199
|
var init_stmt_predicates = __esm({
|
|
21183
21200
|
"../core/src/algebra/exec/transpile/stmt-predicates.ts"() {
|
|
21184
21201
|
"use strict";
|
|
@@ -21208,9 +21225,17 @@ var init_stmt_predicates = __esm({
|
|
|
21208
21225
|
const t = n;
|
|
21209
21226
|
const m = t?.type === "ChainExpression" ? t.expression : t;
|
|
21210
21227
|
if (m?.type !== "MemberExpression" && m?.type !== "OptionalMemberExpression") return void 0;
|
|
21211
|
-
if (m.computed) return void 0;
|
|
21212
21228
|
if (m.object?.type !== "Identifier" || !m.object.name) return void 0;
|
|
21213
21229
|
const p = m.property;
|
|
21230
|
+
if (m.computed) {
|
|
21231
|
+
if (p?.type === "NumericLiteral" && typeof p.value === "number") {
|
|
21232
|
+
return { name: m.object.name, key: String(p.value) };
|
|
21233
|
+
}
|
|
21234
|
+
if (p?.type === "StringLiteral" && typeof p.value === "string" && /^-?\d+$/.test(p.value)) {
|
|
21235
|
+
return { name: m.object.name, key: p.value };
|
|
21236
|
+
}
|
|
21237
|
+
return void 0;
|
|
21238
|
+
}
|
|
21214
21239
|
const key = p?.type === "Identifier" ? p.name : p?.type === "StringLiteral" && typeof p.value === "string" ? p.value : void 0;
|
|
21215
21240
|
if (key === void 0) return void 0;
|
|
21216
21241
|
return { name: m.object.name, key };
|
|
@@ -21222,6 +21247,59 @@ var init_stmt_predicates = __esm({
|
|
|
21222
21247
|
}
|
|
21223
21248
|
return void 0;
|
|
21224
21249
|
};
|
|
21250
|
+
methodReceiverTarget = (callee) => {
|
|
21251
|
+
const c = callee;
|
|
21252
|
+
if (c?.type !== "MemberExpression") return void 0;
|
|
21253
|
+
const o = c.object;
|
|
21254
|
+
if (o?.type === "Identifier" && o.name) return { name: o.name };
|
|
21255
|
+
if (o?.type === "MemberExpression") return memberGuardTarget(o);
|
|
21256
|
+
return void 0;
|
|
21257
|
+
};
|
|
21258
|
+
collectReceiverFacts = (n, ctx2, out) => {
|
|
21259
|
+
if (ctx2 === null || !n || typeof n !== "object") return;
|
|
21260
|
+
const t = n;
|
|
21261
|
+
switch (t.type) {
|
|
21262
|
+
case "LogicalExpression":
|
|
21263
|
+
if (t.operator === "&&" || t.operator === "||") {
|
|
21264
|
+
const rArm = t.operator === "&&" ? "cons" : "alt";
|
|
21265
|
+
collectReceiverFacts(t.left, ctx2, out);
|
|
21266
|
+
collectReceiverFacts(
|
|
21267
|
+
t.right,
|
|
21268
|
+
ctx2 === "both" || ctx2 === rArm ? rArm : null,
|
|
21269
|
+
out
|
|
21270
|
+
);
|
|
21271
|
+
} else if (t.operator === "??") {
|
|
21272
|
+
collectReceiverFacts(t.left, ctx2, out);
|
|
21273
|
+
}
|
|
21274
|
+
return;
|
|
21275
|
+
case "ConditionalExpression":
|
|
21276
|
+
collectReceiverFacts(t.test, ctx2, out);
|
|
21277
|
+
return;
|
|
21278
|
+
case "CallExpression": {
|
|
21279
|
+
const recv = methodReceiverTarget(t.callee);
|
|
21280
|
+
if (recv) {
|
|
21281
|
+
for (const arm of ctx2 === "both" ? ["cons", "alt"] : [ctx2]) {
|
|
21282
|
+
out.push({
|
|
21283
|
+
name: recv.name,
|
|
21284
|
+
arm,
|
|
21285
|
+
grain: "nullish",
|
|
21286
|
+
...recv.key !== void 0 ? { memberKey: recv.key } : {}
|
|
21287
|
+
});
|
|
21288
|
+
}
|
|
21289
|
+
}
|
|
21290
|
+
collectReceiverFacts(t.callee, ctx2, out);
|
|
21291
|
+
for (const a of t.arguments ?? []) collectReceiverFacts(a, ctx2, out);
|
|
21292
|
+
return;
|
|
21293
|
+
}
|
|
21294
|
+
default:
|
|
21295
|
+
collectReceiverFacts(t.left, ctx2, out);
|
|
21296
|
+
collectReceiverFacts(t.right, ctx2, out);
|
|
21297
|
+
collectReceiverFacts(t.argument, ctx2, out);
|
|
21298
|
+
collectReceiverFacts(t.object, ctx2, out);
|
|
21299
|
+
if (t.computed) collectReceiverFacts(t.property, ctx2, out);
|
|
21300
|
+
return;
|
|
21301
|
+
}
|
|
21302
|
+
};
|
|
21225
21303
|
isPrimLitNode = (n) => {
|
|
21226
21304
|
const t = n;
|
|
21227
21305
|
if (t?.type === "StringLiteral") return typeof t.value === "string";
|
|
@@ -30568,25 +30646,75 @@ function $removeUndefined(a) {
|
|
|
30568
30646
|
}
|
|
30569
30647
|
function $removeMemberNullish(a, key) {
|
|
30570
30648
|
if (!a || typeof a !== "object" || !("shape" in a)) return a;
|
|
30649
|
+
if (a.shape.k === "sum") {
|
|
30650
|
+
const members = a.shape.members;
|
|
30651
|
+
const kept = [];
|
|
30652
|
+
let changed = false;
|
|
30653
|
+
for (const m of members) {
|
|
30654
|
+
const r2 = memberSlotTruthyRefine(m, key);
|
|
30655
|
+
if (r2.kind === "prune") {
|
|
30656
|
+
changed = true;
|
|
30657
|
+
continue;
|
|
30658
|
+
}
|
|
30659
|
+
if (r2.kind === "keep") {
|
|
30660
|
+
kept.push(m);
|
|
30661
|
+
continue;
|
|
30662
|
+
}
|
|
30663
|
+
changed = true;
|
|
30664
|
+
const sh = m.shape;
|
|
30665
|
+
const next2 = { ...m, shape: { ...sh, slots: { ...sh.slots, [key]: r2.slot } } };
|
|
30666
|
+
migrateAccessors(m, next2);
|
|
30667
|
+
migrateInvariants(m, next2);
|
|
30668
|
+
migrateNullProto(m, next2);
|
|
30669
|
+
kept.push(next2);
|
|
30670
|
+
}
|
|
30671
|
+
if (!changed || kept.length === 0) return a;
|
|
30672
|
+
return kept.length === 1 ? kept[0] : { ...a, shape: { k: "sum", members: kept } };
|
|
30673
|
+
}
|
|
30571
30674
|
if (a.shape.k !== "obj") return a;
|
|
30572
30675
|
const slots = a.shape.slots;
|
|
30573
30676
|
if (!Object.prototype.hasOwnProperty.call(slots, key)) return a;
|
|
30677
|
+
const r = memberSlotTruthyRefine(a, key);
|
|
30678
|
+
if (r.kind !== "refine") return a;
|
|
30679
|
+
const next = { ...a, shape: { ...a.shape, slots: { ...slots, [key]: r.slot } } };
|
|
30680
|
+
migrateAccessors(a, next);
|
|
30681
|
+
migrateInvariants(a, next);
|
|
30682
|
+
migrateNullProto(a, next);
|
|
30683
|
+
return next;
|
|
30684
|
+
}
|
|
30685
|
+
function definitelyNullishAbs(a) {
|
|
30686
|
+
if (isNullishLitAbs(a)) return true;
|
|
30687
|
+
if (a.shape.k === "sum") {
|
|
30688
|
+
const members = a.shape.members;
|
|
30689
|
+
return members.length > 0 && members.every((m) => isNullishLitAbs(m));
|
|
30690
|
+
}
|
|
30691
|
+
return false;
|
|
30692
|
+
}
|
|
30693
|
+
function memberSlotTruthyRefine(m, key) {
|
|
30694
|
+
if (m.shape.k !== "obj") return { kind: "keep" };
|
|
30695
|
+
const slots = m.shape.slots;
|
|
30696
|
+
if (!Object.prototype.hasOwnProperty.call(slots, key)) {
|
|
30697
|
+
const sh = m.shape;
|
|
30698
|
+
if (sh.open || sh.index) return { kind: "keep" };
|
|
30699
|
+
if (OBJECT_PROTO_METHOD_NAMES2.has(key) || key === "constructor") return { kind: "keep" };
|
|
30700
|
+
if (accessorTable.get(m)?.has(key)) return { kind: "keep" };
|
|
30701
|
+
return { kind: "prune" };
|
|
30702
|
+
}
|
|
30703
|
+
if (accessorTable.get(m)?.get(key)?.get) return { kind: "keep" };
|
|
30574
30704
|
const slot = slots[key];
|
|
30705
|
+
if (definitelyNullishAbs(slot.value)) return { kind: "prune" };
|
|
30575
30706
|
let value = slot.value;
|
|
30576
|
-
let changed = false;
|
|
30577
30707
|
if (!definitelyNotNullishShape(value.shape) && value.shape.k === "sum") {
|
|
30578
30708
|
const members = value.shape.members;
|
|
30579
|
-
const kept = members.filter((
|
|
30709
|
+
const kept = members.filter((x) => !isNullishLitAbs(x));
|
|
30580
30710
|
if (kept.length > 0 && kept.length < members.length) {
|
|
30581
30711
|
value = kept.length === 1 ? kept[0] : { ...value, shape: { k: "sum", members: kept } };
|
|
30582
|
-
changed = true;
|
|
30583
30712
|
}
|
|
30584
30713
|
}
|
|
30585
|
-
if (slot.optional)
|
|
30586
|
-
if (!changed) return a;
|
|
30714
|
+
if (value === slot.value && !slot.optional) return { kind: "keep" };
|
|
30587
30715
|
const next = { ...slot, value };
|
|
30588
30716
|
delete next.optional;
|
|
30589
|
-
return {
|
|
30717
|
+
return { kind: "refine", slot: next };
|
|
30590
30718
|
}
|
|
30591
30719
|
function typeofOfMember(m) {
|
|
30592
30720
|
const t = m.term;
|
|
@@ -30695,6 +30823,8 @@ var init_async = __esm({
|
|
|
30695
30823
|
init_term();
|
|
30696
30824
|
init_pred();
|
|
30697
30825
|
init_objects();
|
|
30826
|
+
init_builtins();
|
|
30827
|
+
init_members();
|
|
30698
30828
|
init_leq();
|
|
30699
30829
|
init_abs_fn();
|
|
30700
30830
|
init_surface();
|
|
@@ -32186,10 +32316,32 @@ function execRegexBrand(re, method, args) {
|
|
|
32186
32316
|
if (method === "test") {
|
|
32187
32317
|
return abs({ k: "prim", type: "boolean" }, void 0, void 0, "partial");
|
|
32188
32318
|
}
|
|
32189
|
-
|
|
32190
|
-
|
|
32191
|
-
|
|
32192
|
-
|
|
32319
|
+
let probe = null;
|
|
32320
|
+
try {
|
|
32321
|
+
probe = new RegExp(`${parts.pat}|`).exec("");
|
|
32322
|
+
} catch {
|
|
32323
|
+
probe = null;
|
|
32324
|
+
}
|
|
32325
|
+
const nullArm = abs({ k: "unknown" }, { op: "lit", value: null }, void 0, "exact");
|
|
32326
|
+
if (!probe) {
|
|
32327
|
+
const element = joinAbs(str(), undefAbs());
|
|
32328
|
+
return joinAbs(nullArm, abs({ k: "arr", element }, void 0, void 0, "path"));
|
|
32329
|
+
}
|
|
32330
|
+
const ng = probe.length - 1;
|
|
32331
|
+
const slots = {
|
|
32332
|
+
"0": { value: str() },
|
|
32333
|
+
length: { value: numLit(probe.length) },
|
|
32334
|
+
index: { value: num() },
|
|
32335
|
+
input: { value: str() }
|
|
32336
|
+
};
|
|
32337
|
+
for (let i = 1; i <= ng; i++) {
|
|
32338
|
+
slots[String(i)] = { value: joinAbs(str(), undefAbs()) };
|
|
32339
|
+
}
|
|
32340
|
+
const groupNames = probe.groups ? Object.keys(probe.groups) : [];
|
|
32341
|
+
slots["groups"] = {
|
|
32342
|
+
value: groupNames.length ? objOf(Object.fromEntries(groupNames.map((n) => [n, { value: joinAbs(str(), undefAbs()) }]))) : undefAbs()
|
|
32343
|
+
};
|
|
32344
|
+
return joinAbs(nullArm, abs({ k: "obj", slots }, void 0, void 0, "path"));
|
|
32193
32345
|
}
|
|
32194
32346
|
try {
|
|
32195
32347
|
return regexExecWithState(re, method, subject).result;
|
|
@@ -41403,8 +41555,8 @@ function formatEffectiveInterfaceDisplay(eff) {
|
|
|
41403
41555
|
if (eff.returns) s += ` \u2192 ${formatConstraint(eff.returns.constraint)}`;
|
|
41404
41556
|
return s;
|
|
41405
41557
|
}
|
|
41406
|
-
function formatInterfaceTierLine(source) {
|
|
41407
|
-
return
|
|
41558
|
+
function formatInterfaceTierLine(source, active = true) {
|
|
41559
|
+
return `${active ? "\u25CF" : "\u25CB"} contract / ${INTERFACE_SOURCE_ABBR[source]}`;
|
|
41408
41560
|
}
|
|
41409
41561
|
function interfaceTierOf(source, fnName, fromFile, opts = {}) {
|
|
41410
41562
|
if (!localNamedExports(source).has(fnName)) return void 0;
|
|
@@ -41418,7 +41570,7 @@ function interfaceTierOf(source, fnName, fromFile, opts = {}) {
|
|
|
41418
41570
|
function interfaceSourceOf(source, fnName, fromFile, opts = {}) {
|
|
41419
41571
|
return interfaceTierOf(source, fnName, fromFile, opts)?.source;
|
|
41420
41572
|
}
|
|
41421
|
-
var MAX_INTERFACE_DIAGS, interfaceDiagChannel, sidecarLoadFailureSlot, MAX_SIDECAR_FP_NODES, LAZY_DISPLAY_DEPTH;
|
|
41573
|
+
var MAX_INTERFACE_DIAGS, interfaceDiagChannel, sidecarLoadFailureSlot, MAX_SIDECAR_FP_NODES, LAZY_DISPLAY_DEPTH, INTERFACE_SOURCE_ABBR;
|
|
41422
41574
|
var init_interface = __esm({
|
|
41423
41575
|
"../core/src/algebra/interface.ts"() {
|
|
41424
41576
|
"use strict";
|
|
@@ -41443,6 +41595,11 @@ var init_interface = __esm({
|
|
|
41443
41595
|
registerCollectorScopeParticipant((body) => sidecarLoadFailureSlot.runScoped(body));
|
|
41444
41596
|
MAX_SIDECAR_FP_NODES = 64;
|
|
41445
41597
|
LAZY_DISPLAY_DEPTH = 2;
|
|
41598
|
+
INTERFACE_SOURCE_ABBR = {
|
|
41599
|
+
handwritten: "hw",
|
|
41600
|
+
generated: "gen",
|
|
41601
|
+
implicit: "imp"
|
|
41602
|
+
};
|
|
41446
41603
|
}
|
|
41447
41604
|
});
|
|
41448
41605
|
|
|
@@ -41666,11 +41823,11 @@ function sidecarSpecsOf(source) {
|
|
|
41666
41823
|
(spec) => (spec.startsWith(".") || spec.startsWith("/")) && (spec.endsWith(".nudo.js") || spec.endsWith(".nudo.ts"))
|
|
41667
41824
|
);
|
|
41668
41825
|
}
|
|
41669
|
-
function
|
|
41826
|
+
function tryLoadDeps(loadModule, spec, from) {
|
|
41670
41827
|
try {
|
|
41671
|
-
return loadModule(spec, from);
|
|
41828
|
+
return { src: loadModule(spec, from), err: false };
|
|
41672
41829
|
} catch {
|
|
41673
|
-
return void 0;
|
|
41830
|
+
return { src: void 0, err: true };
|
|
41674
41831
|
}
|
|
41675
41832
|
}
|
|
41676
41833
|
function loadModuleDepsFingerprint(source, loadModule, fromFile) {
|
|
@@ -41683,16 +41840,35 @@ function loadModuleDepsFingerprint(source, loadModule, fromFile) {
|
|
|
41683
41840
|
);
|
|
41684
41841
|
let n = 0;
|
|
41685
41842
|
let truncated = false;
|
|
41843
|
+
let readError = false;
|
|
41844
|
+
const load = (spec, from) => {
|
|
41845
|
+
const a = tryLoadDeps(loadModule, spec, from);
|
|
41846
|
+
if (a.err) readError = true;
|
|
41847
|
+
return a;
|
|
41848
|
+
};
|
|
41686
41849
|
const finish = () => {
|
|
41687
41850
|
parts.sort();
|
|
41688
|
-
|
|
41851
|
+
const prefix2 = truncated ? "trunc:" : readError ? "readerr:" : "";
|
|
41852
|
+
return {
|
|
41853
|
+
fp: `${prefix2}${parts.join(",")}`,
|
|
41854
|
+
paths,
|
|
41855
|
+
contents,
|
|
41856
|
+
truncated,
|
|
41857
|
+
readError
|
|
41858
|
+
};
|
|
41689
41859
|
};
|
|
41690
41860
|
const absorbSidecarClosure = (entryFile) => {
|
|
41691
41861
|
const sidecarPath = sidecarPathOf(entryFile);
|
|
41692
41862
|
if (seen.has(sidecarPath)) return;
|
|
41693
41863
|
const sidecarSpec = `./${sidecarPath.slice(sidecarPath.lastIndexOf("/") + 1)}`;
|
|
41694
|
-
const
|
|
41695
|
-
if (
|
|
41864
|
+
const root = load(sidecarSpec, entryFile);
|
|
41865
|
+
if (root.err) {
|
|
41866
|
+
paths.push(sidecarPath);
|
|
41867
|
+
contents.push({ path: sidecarPath, content: null });
|
|
41868
|
+
return;
|
|
41869
|
+
}
|
|
41870
|
+
if (root.src === void 0) return;
|
|
41871
|
+
const sidecarSrc = root.src;
|
|
41696
41872
|
if (n >= MAX_LOAD_DEP_NODES) {
|
|
41697
41873
|
truncated = true;
|
|
41698
41874
|
return;
|
|
@@ -41715,7 +41891,7 @@ function loadModuleDepsFingerprint(source, loadModule, fromFile) {
|
|
|
41715
41891
|
if (seen.has(path)) continue;
|
|
41716
41892
|
seen.add(path);
|
|
41717
41893
|
n++;
|
|
41718
|
-
const src =
|
|
41894
|
+
const src = load(cur.spec, cur.from).src;
|
|
41719
41895
|
parts.push(`sidecar:${path}=${src === void 0 ? "miss" : hashSource(src)}`);
|
|
41720
41896
|
paths.push(path);
|
|
41721
41897
|
contents.push({ path, content: src ?? null });
|
|
@@ -41736,7 +41912,7 @@ function loadModuleDepsFingerprint(source, loadModule, fromFile) {
|
|
|
41736
41912
|
if (seen.has(path)) continue;
|
|
41737
41913
|
seen.add(path);
|
|
41738
41914
|
n++;
|
|
41739
|
-
const src =
|
|
41915
|
+
const src = load(cur.spec, cur.from).src;
|
|
41740
41916
|
parts.push(`${path}=${src === void 0 ? "miss" : hashSource(src)}`);
|
|
41741
41917
|
paths.push(path);
|
|
41742
41918
|
contents.push({ path, content: src ?? null });
|
|
@@ -42390,7 +42566,7 @@ function loadModuleId(fn2) {
|
|
|
42390
42566
|
}
|
|
42391
42567
|
function refineDepsFingerprint(source, refine) {
|
|
42392
42568
|
if (!refine?.loadModule || !refine.fromFile) {
|
|
42393
|
-
return { fp: "-", paths: [], contents: [], truncated: false };
|
|
42569
|
+
return { fp: "-", paths: [], contents: [], truncated: false, readError: false };
|
|
42394
42570
|
}
|
|
42395
42571
|
return loadModuleDepsFingerprint(source, refine.loadModule, refine.fromFile);
|
|
42396
42572
|
}
|
|
@@ -42406,7 +42582,7 @@ function moduleMapId(m) {
|
|
|
42406
42582
|
function generalizeMemoKey(fnName, source, opts) {
|
|
42407
42583
|
const r = opts.refine;
|
|
42408
42584
|
const budget = opts.budget ?? defaultLeakBudget;
|
|
42409
|
-
const deps = opts.depsFp ?? (r ? refineDepsFingerprint(source, r) : { fp: "-", paths: [], contents: [], truncated: false });
|
|
42585
|
+
const deps = opts.depsFp ?? (r ? refineDepsFingerprint(source, r) : { fp: "-", paths: [], contents: [], truncated: false, readError: false });
|
|
42410
42586
|
const sc = opts.sidecarFp ?? (r?.loadModule && r.fromFile ? sidecarClosureFingerprint(r.fromFile, r) : void 0);
|
|
42411
42587
|
const scPath = sc !== void 0 && !sc.startsWith("trunc:") && r?.fromFile ? sidecarPathOf(r.fromFile) : void 0;
|
|
42412
42588
|
const srcPart = generalizeSourceKeyPart(source, fnName, opts.file);
|
|
@@ -42424,7 +42600,7 @@ function generalizeMemoKey(fnName, source, opts) {
|
|
|
42424
42600
|
return {
|
|
42425
42601
|
key,
|
|
42426
42602
|
depPaths: scPath !== void 0 ? [...deps.paths, scPath] : deps.paths,
|
|
42427
|
-
truncated: deps.truncated || (sc?.startsWith("trunc:") ?? false)
|
|
42603
|
+
truncated: deps.truncated || deps.readError || (sc?.startsWith("trunc:") ?? false)
|
|
42428
42604
|
};
|
|
42429
42605
|
}
|
|
42430
42606
|
function generalizeMemoGet(key) {
|
|
@@ -45625,7 +45801,7 @@ function loadModuleId2(fn2) {
|
|
|
45625
45801
|
}
|
|
45626
45802
|
function checkDepsFingerprint(source, opts) {
|
|
45627
45803
|
if (!opts.loadModule || !opts.fromFile) {
|
|
45628
|
-
return { fp: "-", paths: [], contents: [], truncated: false };
|
|
45804
|
+
return { fp: "-", paths: [], contents: [], truncated: false, readError: false };
|
|
45629
45805
|
}
|
|
45630
45806
|
return loadModuleDepsFingerprint(source, opts.loadModule, opts.fromFile);
|
|
45631
45807
|
}
|
|
@@ -46216,7 +46392,9 @@ function checkSourceInScope(filePath, source, phi2, opts) {
|
|
|
46216
46392
|
const stable = stableAnalyzeKeySource(source);
|
|
46217
46393
|
const depsFp = checkDepsFingerprint(stable, callOpts);
|
|
46218
46394
|
const sidecarFp = callOpts.loadModule && callOpts.fromFile ? sidecarClosureFingerprint(callOpts.fromFile, callOpts) : void 0;
|
|
46219
|
-
const allowMemo = useMemo && !depsFp.truncated &&
|
|
46395
|
+
const allowMemo = useMemo && !depsFp.truncated && // 读错误轮键不可信(#135):错误轮报告(nudo:interface-load)与真 miss 轮
|
|
46396
|
+
// (干净)若共享 miss 键会互为跨次陈旧命中——不读也不写 memo
|
|
46397
|
+
!depsFp.readError && !(sidecarFp?.startsWith("trunc:") ?? false);
|
|
46220
46398
|
if (allowMemo) {
|
|
46221
46399
|
memoKey = checkMemoKey(filePath, stable, opts, depsFp, sidecarFp);
|
|
46222
46400
|
const hit = checkMemoGet(memoKey);
|
|
@@ -47384,6 +47562,7 @@ __export(src_exports, {
|
|
|
47384
47562
|
CONSTRAINT_BUILDER_NAMES: () => CONSTRAINT_BUILDER_NAMES,
|
|
47385
47563
|
CONSTRAINT_EXPR_RE: () => CONSTRAINT_EXPR_RE,
|
|
47386
47564
|
DEFAULT_MAX_LOOP_ITERS: () => DEFAULT_MAX_LOOP_ITERS,
|
|
47565
|
+
INTERFACE_SOURCE_ABBR: () => INTERFACE_SOURCE_ABBR,
|
|
47387
47566
|
MAX_EVAL_CALL_DEPTH: () => MAX_EVAL_CALL_DEPTH,
|
|
47388
47567
|
MAX_EVAL_TOTAL_CALLS: () => MAX_EVAL_TOTAL_CALLS,
|
|
47389
47568
|
NudoLoopSignal: () => NudoLoopSignal,
|
|
@@ -48006,12 +48185,16 @@ function collectAbsInlays(source, opts) {
|
|
|
48006
48185
|
const inlays = [];
|
|
48007
48186
|
const refineOpts = opts?.loadModule || opts?.fromFile ? {
|
|
48008
48187
|
...opts.loadModule ? { loadModule: opts.loadModule } : {},
|
|
48009
|
-
...opts.fromFile ? { fromFile: opts.fromFile } : {}
|
|
48188
|
+
...opts.fromFile ? { fromFile: opts.fromFile } : {},
|
|
48189
|
+
...opts.autoBind !== void 0 ? { autoBind: opts.autoBind } : {}
|
|
48010
48190
|
} : void 0;
|
|
48011
48191
|
for (const { name, node } of listFunctions(source)) {
|
|
48012
48192
|
let g;
|
|
48013
48193
|
try {
|
|
48014
|
-
g = generalizeFromAst(name, source,
|
|
48194
|
+
g = generalizeFromAst(name, source, {
|
|
48195
|
+
...refineOpts ? { refine: refineOpts } : {},
|
|
48196
|
+
...opts?.modules ? { modules: opts.modules } : {}
|
|
48197
|
+
});
|
|
48015
48198
|
} catch {
|
|
48016
48199
|
continue;
|
|
48017
48200
|
}
|
|
@@ -49749,7 +49932,7 @@ var init_resolve_npm = __esm({
|
|
|
49749
49932
|
});
|
|
49750
49933
|
|
|
49751
49934
|
// ../service/src/load-module.ts
|
|
49752
|
-
import {
|
|
49935
|
+
import { statSync as statSync2, readFileSync as readFileSync3 } from "fs";
|
|
49753
49936
|
import { dirname as dirname3, resolve as resolve2, join as join3 } from "path";
|
|
49754
49937
|
function moduleResolveCandidates(spec, fromFile) {
|
|
49755
49938
|
const p = resolve2(dirname3(resolve2(fromFile)), spec);
|
|
@@ -49761,18 +49944,21 @@ function moduleResolveCandidates(spec, fromFile) {
|
|
|
49761
49944
|
}
|
|
49762
49945
|
function resolveModuleFile(spec, fromFile) {
|
|
49763
49946
|
for (const cand of moduleResolveCandidates(spec, fromFile)) {
|
|
49764
|
-
|
|
49947
|
+
let st;
|
|
49948
|
+
try {
|
|
49949
|
+
st = statSync2(cand);
|
|
49950
|
+
} catch (e) {
|
|
49951
|
+
const code2 = e?.code;
|
|
49952
|
+
if (code2 === "ENOENT" || code2 === "ENOTDIR" || code2 === "EISDIR") continue;
|
|
49953
|
+
throw new ModuleReadError(cand, e);
|
|
49954
|
+
}
|
|
49955
|
+
if (!st.isDirectory()) return cand;
|
|
49765
49956
|
}
|
|
49766
49957
|
return void 0;
|
|
49767
49958
|
}
|
|
49768
49959
|
function defaultLoadModule(spec, fromFile) {
|
|
49769
49960
|
if (!spec.startsWith(".") && !spec.startsWith("/")) return void 0;
|
|
49770
|
-
|
|
49771
|
-
try {
|
|
49772
|
-
cand = resolveModuleFile(spec, fromFile);
|
|
49773
|
-
} catch {
|
|
49774
|
-
return void 0;
|
|
49775
|
-
}
|
|
49961
|
+
const cand = resolveModuleFile(spec, fromFile);
|
|
49776
49962
|
if (!cand) return void 0;
|
|
49777
49963
|
try {
|
|
49778
49964
|
return readFileSync3(cand, "utf-8");
|
|
@@ -49808,7 +49994,7 @@ var init_load_module = __esm({
|
|
|
49808
49994
|
});
|
|
49809
49995
|
|
|
49810
49996
|
// ../service/src/static-imports.ts
|
|
49811
|
-
import { readFileSync as readFileSync4, existsSync as
|
|
49997
|
+
import { readFileSync as readFileSync4, existsSync as existsSync3 } from "fs";
|
|
49812
49998
|
import { resolve as resolve3, dirname as dirname4, join as join4 } from "path";
|
|
49813
49999
|
function resolveRelative(fromFile, spec) {
|
|
49814
50000
|
if (!spec.startsWith(".") && !spec.startsWith("/")) return void 0;
|
|
@@ -49826,7 +50012,7 @@ function resolveRelative(fromFile, spec) {
|
|
|
49826
50012
|
join4(base, "index.mjs"),
|
|
49827
50013
|
join4(base, "index.ts")
|
|
49828
50014
|
]) {
|
|
49829
|
-
if (
|
|
50015
|
+
if (existsSync3(cand)) return cand;
|
|
49830
50016
|
}
|
|
49831
50017
|
return void 0;
|
|
49832
50018
|
}
|
|
@@ -49958,7 +50144,7 @@ function collectStaticImports(entryFile, maxDepth = 8) {
|
|
|
49958
50144
|
const { file, depth } = queue.shift();
|
|
49959
50145
|
if (seen.has(file) || depth > maxDepth) continue;
|
|
49960
50146
|
seen.add(file);
|
|
49961
|
-
if (!
|
|
50147
|
+
if (!existsSync3(file)) continue;
|
|
49962
50148
|
const source = readFileSync4(file, "utf8");
|
|
49963
50149
|
const mod2 = analyzeExportsFromSource(file, source);
|
|
49964
50150
|
graph.set(file, mod2);
|
|
@@ -49979,7 +50165,7 @@ var init_static_imports = __esm({
|
|
|
49979
50165
|
});
|
|
49980
50166
|
|
|
49981
50167
|
// ../service/src/analyzer-module-load.ts
|
|
49982
|
-
import { readFileSync as readFileSync5, existsSync as
|
|
50168
|
+
import { readFileSync as readFileSync5, existsSync as existsSync4, statSync as statSync3 } from "fs";
|
|
49983
50169
|
import { resolve as resolve4 } from "path";
|
|
49984
50170
|
function resolveModule(source, fromDir) {
|
|
49985
50171
|
const extensions = [...MODULE_RESOLVE_EXTS];
|
|
@@ -49991,17 +50177,17 @@ function resolveModule(source, fromDir) {
|
|
|
49991
50177
|
const basePath = resolve4(fromDir, source);
|
|
49992
50178
|
for (const ext of ["", ...extensions]) {
|
|
49993
50179
|
const candidate = basePath + ext;
|
|
49994
|
-
if (!
|
|
50180
|
+
if (!existsSync4(candidate)) continue;
|
|
49995
50181
|
if (statSync3(candidate).isDirectory()) {
|
|
49996
50182
|
let entry = null;
|
|
49997
50183
|
const pkgPath = resolve4(candidate, "package.json");
|
|
49998
|
-
if (
|
|
50184
|
+
if (existsSync4(pkgPath)) {
|
|
49999
50185
|
try {
|
|
50000
50186
|
const main = JSON.parse(readFileSync5(pkgPath, "utf-8")).main;
|
|
50001
50187
|
if (typeof main === "string") {
|
|
50002
50188
|
for (const e of ["", ...extensions]) {
|
|
50003
50189
|
const p = resolve4(candidate, main + e);
|
|
50004
|
-
if (
|
|
50190
|
+
if (existsSync4(p) && statSync3(p).isFile()) {
|
|
50005
50191
|
entry = p;
|
|
50006
50192
|
break;
|
|
50007
50193
|
}
|
|
@@ -50013,7 +50199,7 @@ function resolveModule(source, fromDir) {
|
|
|
50013
50199
|
if (!entry) {
|
|
50014
50200
|
for (const e of ["", ...extensions]) {
|
|
50015
50201
|
const p = resolve4(candidate, "index" + e);
|
|
50016
|
-
if (
|
|
50202
|
+
if (existsSync4(p) && statSync3(p).isFile()) {
|
|
50017
50203
|
entry = p;
|
|
50018
50204
|
break;
|
|
50019
50205
|
}
|
|
@@ -57293,9 +57479,9 @@ function analysisFileCacheKey(filePath, source, activeCases, externalCallRecords
|
|
|
57293
57479
|
let noCache = false;
|
|
57294
57480
|
try {
|
|
57295
57481
|
const fp = loadModuleDepsFingerprint(source, effectiveLoader, filePath);
|
|
57296
|
-
if (fp.truncated) {
|
|
57482
|
+
if (fp.truncated || fp.readError) {
|
|
57297
57483
|
noCache = true;
|
|
57298
|
-
depSeg =
|
|
57484
|
+
depSeg = `${fp.truncated ? "trunc" : "readerr"}:${fp.paths.length}`;
|
|
57299
57485
|
} else {
|
|
57300
57486
|
depSeg = hashSource(fp.fp);
|
|
57301
57487
|
}
|
|
@@ -59655,7 +59841,7 @@ var init_lru_map2 = __esm({
|
|
|
59655
59841
|
});
|
|
59656
59842
|
|
|
59657
59843
|
// ../service/src/evaluator/env-loader.ts
|
|
59658
|
-
import { readFileSync as readFileSync6, existsSync as
|
|
59844
|
+
import { readFileSync as readFileSync6, existsSync as existsSync5, statSync as statSync4, mkdirSync, writeFileSync } from "fs";
|
|
59659
59845
|
import { resolve as resolvePath, join as joinPath } from "path";
|
|
59660
59846
|
import { pathToFileURL } from "url";
|
|
59661
59847
|
import { createRequire as createRequire2 } from "module";
|
|
@@ -59692,7 +59878,7 @@ function isPathEnvName(name, baseDir) {
|
|
|
59692
59878
|
if (name in envFactories) return false;
|
|
59693
59879
|
if (name.includes("/") || name.startsWith("./") || name.startsWith("../")) return true;
|
|
59694
59880
|
const resolved = resolvePath(baseDir, name);
|
|
59695
|
-
return resolved.endsWith(".ts") &&
|
|
59881
|
+
return resolved.endsWith(".ts") && existsSync5(resolved);
|
|
59696
59882
|
}
|
|
59697
59883
|
function rewriteBareImports(text) {
|
|
59698
59884
|
const require3 = createRequire2(import.meta.url);
|
|
@@ -59823,7 +60009,7 @@ async function preloadPathEnvs(envNames, baseDir) {
|
|
|
59823
60009
|
for (const name of envNames) {
|
|
59824
60010
|
if (!isPathEnvName(name, baseDir)) continue;
|
|
59825
60011
|
const resolved = resolvePath(baseDir, name);
|
|
59826
|
-
if (!
|
|
60012
|
+
if (!existsSync5(resolved)) {
|
|
59827
60013
|
recordPathEnvError(resolved, baseDir, new Error(`path env not found: ${resolved}`));
|
|
59828
60014
|
continue;
|
|
59829
60015
|
}
|
|
@@ -60073,13 +60259,22 @@ function pkgStatFp(pkgPath) {
|
|
|
60073
60259
|
try {
|
|
60074
60260
|
const st = statSync5(pkgPath);
|
|
60075
60261
|
return `${st.mtimeMs}:${st.size}`;
|
|
60076
|
-
} catch {
|
|
60077
|
-
|
|
60262
|
+
} catch (err) {
|
|
60263
|
+
if (err instanceof Error && err.code === "ENOENT") {
|
|
60264
|
+
return void 0;
|
|
60265
|
+
}
|
|
60266
|
+
throw err;
|
|
60078
60267
|
}
|
|
60079
60268
|
}
|
|
60080
60269
|
function projectConfigMemoHit(entry) {
|
|
60081
60270
|
for (const { pkgPath, fp } of entry.chain) {
|
|
60082
|
-
|
|
60271
|
+
let current;
|
|
60272
|
+
try {
|
|
60273
|
+
current = pkgStatFp(pkgPath);
|
|
60274
|
+
} catch {
|
|
60275
|
+
return false;
|
|
60276
|
+
}
|
|
60277
|
+
if (current !== fp) return false;
|
|
60083
60278
|
}
|
|
60084
60279
|
return true;
|
|
60085
60280
|
}
|
|
@@ -60107,7 +60302,18 @@ function findProjectConfig(startDir) {
|
|
|
60107
60302
|
if (hit && projectConfigMemoHit(hit)) return hit.result;
|
|
60108
60303
|
while (dir !== root) {
|
|
60109
60304
|
const pkgPath = resolve6(dir, "package.json");
|
|
60110
|
-
|
|
60305
|
+
let statFp;
|
|
60306
|
+
try {
|
|
60307
|
+
statFp = pkgStatFp(pkgPath);
|
|
60308
|
+
} catch (err) {
|
|
60309
|
+
memoEntry.chain.push({ pkgPath, fp: STAT_ERROR_FP });
|
|
60310
|
+
process.stderr?.write?.(
|
|
60311
|
+
`nudo: package.json stat failed at ${pkgPath} (${err instanceof Error ? err.message : String(err)}); project config disabled for this subtree (defaults + env apply)
|
|
60312
|
+
`
|
|
60313
|
+
);
|
|
60314
|
+
applyBForkBudgetFromConfig(null);
|
|
60315
|
+
return memoize(null);
|
|
60316
|
+
}
|
|
60111
60317
|
memoEntry.chain.push({ pkgPath, fp: statFp });
|
|
60112
60318
|
if (statFp !== void 0) {
|
|
60113
60319
|
let pkg;
|
|
@@ -60136,7 +60342,7 @@ function findProjectConfig(startDir) {
|
|
|
60136
60342
|
applyBForkBudgetFromConfig(null);
|
|
60137
60343
|
return memoize(null);
|
|
60138
60344
|
}
|
|
60139
|
-
var DEFAULT_ANALYSIS_EXCLUDE, DEFAULT_ANALYSIS_MODE, projectConfigMemo, MAX_PROJECT_CONFIG_MEMO, projectConfigDiskReads;
|
|
60345
|
+
var DEFAULT_ANALYSIS_EXCLUDE, DEFAULT_ANALYSIS_MODE, projectConfigMemo, MAX_PROJECT_CONFIG_MEMO, projectConfigDiskReads, STAT_ERROR_FP;
|
|
60140
60346
|
var init_config = __esm({
|
|
60141
60347
|
"../service/src/evaluator/config.ts"() {
|
|
60142
60348
|
"use strict";
|
|
@@ -60151,6 +60357,7 @@ var init_config = __esm({
|
|
|
60151
60357
|
projectConfigMemo = /* @__PURE__ */ new Map();
|
|
60152
60358
|
MAX_PROJECT_CONFIG_MEMO = 128;
|
|
60153
60359
|
projectConfigDiskReads = 0;
|
|
60360
|
+
STAT_ERROR_FP = "\0stat-error";
|
|
60154
60361
|
}
|
|
60155
60362
|
});
|
|
60156
60363
|
|
|
@@ -274941,7 +275148,7 @@ var init_harvest_dts = __esm({
|
|
|
274941
275148
|
});
|
|
274942
275149
|
|
|
274943
275150
|
// ../harvester/src/dts-contract-draft.ts
|
|
274944
|
-
import { readFileSync as readFileSync9, existsSync as
|
|
275151
|
+
import { readFileSync as readFileSync9, existsSync as existsSync6, statSync as statSync7, readdirSync } from "fs";
|
|
274945
275152
|
import { basename, dirname as dirname6, join as join5 } from "path";
|
|
274946
275153
|
function keywordDsl(node) {
|
|
274947
275154
|
switch (node.kind) {
|
|
@@ -275226,7 +275433,7 @@ function readDtsFiles(paths, maxFiles = 16) {
|
|
|
275226
275433
|
}
|
|
275227
275434
|
};
|
|
275228
275435
|
for (const p of paths) {
|
|
275229
|
-
if (!
|
|
275436
|
+
if (!existsSync6(p)) continue;
|
|
275230
275437
|
const st = statSync7(p);
|
|
275231
275438
|
if (st.isDirectory()) walk(p, 0);
|
|
275232
275439
|
else if (/\.d\.ts$/.test(p) || /\.(m)?ts$/.test(p)) {
|
|
@@ -275236,7 +275443,7 @@ function readDtsFiles(paths, maxFiles = 16) {
|
|
|
275236
275443
|
return out.slice(0, maxFiles);
|
|
275237
275444
|
}
|
|
275238
275445
|
function dtsToContractDraft(dtsFiles, label) {
|
|
275239
|
-
const files = dtsFiles.filter((f) =>
|
|
275446
|
+
const files = dtsFiles.filter((f) => existsSync6(f));
|
|
275240
275447
|
const exports = [];
|
|
275241
275448
|
let skippedFiles = 0;
|
|
275242
275449
|
for (const file of files) {
|
|
@@ -275292,16 +275499,16 @@ var init_dts_contract_draft = __esm({
|
|
|
275292
275499
|
});
|
|
275293
275500
|
|
|
275294
275501
|
// ../harvester/src/harvest-package.ts
|
|
275295
|
-
import { existsSync as
|
|
275502
|
+
import { existsSync as existsSync7, readdirSync as readdirSync2, statSync as statSync8, readFileSync as readFileSync10 } from "fs";
|
|
275296
275503
|
import { join as join6, resolve as resolve7, dirname as dirname7, basename as basename2 } from "path";
|
|
275297
275504
|
function resolvePackageRoot(pkg, fromDir = process.cwd()) {
|
|
275298
275505
|
let dir = resolve7(fromDir);
|
|
275299
275506
|
const bare = pkg.replace(/^@/, "").replace(/\//g, "__");
|
|
275300
275507
|
for (let i = 0; i < 8; i++) {
|
|
275301
275508
|
const typesPath = join6(dir, "node_modules", "@types", bare);
|
|
275302
|
-
if (
|
|
275509
|
+
if (existsSync7(typesPath)) return typesPath;
|
|
275303
275510
|
const pkgPath = join6(dir, "node_modules", pkg);
|
|
275304
|
-
if (
|
|
275511
|
+
if (existsSync7(pkgPath)) return pkgPath;
|
|
275305
275512
|
const parent = resolve7(dir, "..");
|
|
275306
275513
|
if (parent === dir) break;
|
|
275307
275514
|
dir = parent;
|
|
@@ -275350,13 +275557,13 @@ function collectDtsFiles(root, maxFiles = 8) {
|
|
|
275350
275557
|
}
|
|
275351
275558
|
function entryDtsFromPackageJson(root) {
|
|
275352
275559
|
const pj = join6(root, "package.json");
|
|
275353
|
-
if (!
|
|
275560
|
+
if (!existsSync7(pj)) return void 0;
|
|
275354
275561
|
try {
|
|
275355
275562
|
const raw = JSON.parse(readFileSync10(pj, "utf8"));
|
|
275356
275563
|
const entry = raw.types ?? raw.typings;
|
|
275357
275564
|
if (typeof entry === "string" && entry.endsWith(".d.ts")) {
|
|
275358
275565
|
const p = resolve7(root, entry);
|
|
275359
|
-
if (
|
|
275566
|
+
if (existsSync7(p)) {
|
|
275360
275567
|
const st = statSync8(p);
|
|
275361
275568
|
if (st.size <= MAX_DTS_BYTES) return p;
|
|
275362
275569
|
}
|
|
@@ -275373,7 +275580,7 @@ function collectDtsFromEntry(entry, maxFiles = 200) {
|
|
|
275373
275580
|
const RELATIVE_FROM_REGEX = /\bfrom\s+["'](\.[^"']+)["']/g;
|
|
275374
275581
|
while (queue.length > 0 && files.length < maxFiles) {
|
|
275375
275582
|
const current = queue.shift();
|
|
275376
|
-
if (seen.has(current) || !
|
|
275583
|
+
if (seen.has(current) || !existsSync7(current)) continue;
|
|
275377
275584
|
seen.add(current);
|
|
275378
275585
|
if (!current.endsWith(".d.ts")) continue;
|
|
275379
275586
|
files.push(current);
|
|
@@ -275390,7 +275597,7 @@ function collectDtsFromEntry(entry, maxFiles = 200) {
|
|
|
275390
275597
|
for (const match of text.matchAll(RELATIVE_FROM_REGEX)) {
|
|
275391
275598
|
const base = resolve7(dir, match[1]);
|
|
275392
275599
|
for (const candidate of [`${base}.d.ts`, join6(base, "index.d.ts")]) {
|
|
275393
|
-
if (
|
|
275600
|
+
if (existsSync7(candidate)) {
|
|
275394
275601
|
queue.push(candidate);
|
|
275395
275602
|
break;
|
|
275396
275603
|
}
|
|
@@ -275403,10 +275610,10 @@ function harvestPackage(pkg, fromDir, maxFiles = 24) {
|
|
|
275403
275610
|
const root = resolvePackageRoot(pkg, fromDir);
|
|
275404
275611
|
if (!root) return { error: `package not found: ${pkg}` };
|
|
275405
275612
|
const entry = entryDtsFromPackageJson(root) ?? join6(root, "index.d.ts");
|
|
275406
|
-
let dtsFiles =
|
|
275613
|
+
let dtsFiles = existsSync7(entry) ? collectDtsFromEntry(entry, maxFiles) : [];
|
|
275407
275614
|
if (dtsFiles.length === 0) {
|
|
275408
275615
|
const collected = collectDtsFiles(root, maxFiles);
|
|
275409
|
-
dtsFiles = entry &&
|
|
275616
|
+
dtsFiles = entry && existsSync7(entry) && !collected.includes(entry) ? [entry, ...collected.filter((f) => f !== entry)].slice(0, maxFiles) : collected;
|
|
275410
275617
|
}
|
|
275411
275618
|
if (dtsFiles.length === 0) {
|
|
275412
275619
|
return { error: `no .d.ts under ${root}` };
|
|
@@ -275718,7 +275925,7 @@ var init_harvest_json = __esm({
|
|
|
275718
275925
|
|
|
275719
275926
|
// ../harvester/src/harvest-disk.ts
|
|
275720
275927
|
import { createHash as createHash3 } from "crypto";
|
|
275721
|
-
import { existsSync as
|
|
275928
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync2, readFileSync as readFileSync11, writeFileSync as writeFileSync2 } from "fs";
|
|
275722
275929
|
import { homedir } from "os";
|
|
275723
275930
|
import { join as join7, dirname as dirname8 } from "path";
|
|
275724
275931
|
function depsCacheRoot() {
|
|
@@ -275757,7 +275964,7 @@ function diskPath(root, key) {
|
|
|
275757
275964
|
function readHarvestDisk(root, key) {
|
|
275758
275965
|
try {
|
|
275759
275966
|
const p = diskPath(root, key);
|
|
275760
|
-
if (!
|
|
275967
|
+
if (!existsSync8(p)) return void 0;
|
|
275761
275968
|
const parsed = JSON.parse(readFileSync11(p, "utf8"));
|
|
275762
275969
|
if (parsed?.abi !== HARVEST_DISK_ABI) return void 0;
|
|
275763
275970
|
return parsed.value;
|
|
@@ -275785,10 +275992,10 @@ function listPackageDts(pkg, fromDir, maxFiles) {
|
|
|
275785
275992
|
return void 0;
|
|
275786
275993
|
}
|
|
275787
275994
|
})();
|
|
275788
|
-
let dtsFiles = entry &&
|
|
275995
|
+
let dtsFiles = entry && existsSync8(entry) ? collectDtsFromEntry(entry, Math.max(maxFiles, 24)) : [];
|
|
275789
275996
|
if (dtsFiles.length === 0) {
|
|
275790
275997
|
const collected = collectDtsFiles(root, maxFiles);
|
|
275791
|
-
dtsFiles = entry &&
|
|
275998
|
+
dtsFiles = entry && existsSync8(entry) && !collected.includes(entry) ? [entry, ...collected.filter((f) => f !== entry)].slice(0, maxFiles) : collected;
|
|
275792
275999
|
}
|
|
275793
276000
|
if (dtsFiles.length === 0) return null;
|
|
275794
276001
|
return { root, dtsFiles, pkgVersion: readPkgVersion(root) };
|
|
@@ -276129,7 +276336,7 @@ var init_harvest_to_abs = __esm({
|
|
|
276129
276336
|
});
|
|
276130
276337
|
|
|
276131
276338
|
// ../harvester/src/harvest-node.ts
|
|
276132
|
-
import { existsSync as
|
|
276339
|
+
import { existsSync as existsSync9, statSync as statSync9, readFileSync as readFileSync12 } from "fs";
|
|
276133
276340
|
import { join as join8 } from "path";
|
|
276134
276341
|
function notFoundCacheKey(fromDir) {
|
|
276135
276342
|
return `not-found|@types/node|${fromDir ?? ""}`;
|
|
@@ -276213,7 +276420,7 @@ function harvestNodeTypes(fromDir, maxFiles = HARVEST_NODE_DEFAULT_MAX_FILES, ma
|
|
|
276213
276420
|
};
|
|
276214
276421
|
}
|
|
276215
276422
|
const root = resolvePackageRoot("@types/node", fromDir) ?? resolvePackageRoot("node", fromDir);
|
|
276216
|
-
if (!root || !
|
|
276423
|
+
if (!root || !existsSync9(root)) {
|
|
276217
276424
|
const missKey = notFoundCacheKey(fromDir);
|
|
276218
276425
|
const miss = nodeHarvestCache.get(missKey);
|
|
276219
276426
|
if (miss) {
|
|
@@ -277415,7 +277622,7 @@ function evalCacheSlotKey(filePath, mode) {
|
|
|
277415
277622
|
function evalDepKey(source, filePath, loadModule) {
|
|
277416
277623
|
try {
|
|
277417
277624
|
const fp = loadModuleDepsFingerprint(source, loadModule ?? defaultLoadModule, filePath);
|
|
277418
|
-
if (fp.truncated) return null;
|
|
277625
|
+
if (fp.truncated || fp.readError) return null;
|
|
277419
277626
|
return hashSource(fp.fp);
|
|
277420
277627
|
} catch {
|
|
277421
277628
|
return null;
|
|
@@ -278189,7 +278396,7 @@ var init_analyzer_orchestrate_calls = __esm({
|
|
|
278189
278396
|
});
|
|
278190
278397
|
|
|
278191
278398
|
// ../service/src/entry-variants.ts
|
|
278192
|
-
import { existsSync as
|
|
278399
|
+
import { existsSync as existsSync10, readFileSync as readFileSync14 } from "fs";
|
|
278193
278400
|
import { dirname as dirname12, join as join9, resolve as resolve8 } from "path";
|
|
278194
278401
|
function collectConditionFaces(val) {
|
|
278195
278402
|
const browser = [];
|
|
@@ -278303,7 +278510,7 @@ function findOwningPackage(fromFile) {
|
|
|
278303
278510
|
const root = resolve8("/");
|
|
278304
278511
|
for (; ; ) {
|
|
278305
278512
|
const pkgPath = join9(dir, "package.json");
|
|
278306
|
-
if (
|
|
278513
|
+
if (existsSync10(pkgPath)) {
|
|
278307
278514
|
try {
|
|
278308
278515
|
const pkg = JSON.parse(readFileSync14(pkgPath, "utf-8"));
|
|
278309
278516
|
return { path: pkgPath, dir, pkg };
|
|
@@ -278620,7 +278827,7 @@ function computeFnDepSegment(source, loadModule, filePath) {
|
|
|
278620
278827
|
let fnDepFailClosed = false;
|
|
278621
278828
|
try {
|
|
278622
278829
|
const dfp = loadModuleDepsFingerprint(source, loadModule ?? defaultLoadModule, filePath);
|
|
278623
|
-
if (dfp.truncated) {
|
|
278830
|
+
if (dfp.truncated || dfp.readError) {
|
|
278624
278831
|
fnDepFailClosed = true;
|
|
278625
278832
|
fnDepSeg = null;
|
|
278626
278833
|
} else {
|
|
@@ -279688,7 +279895,7 @@ var init_target_path = __esm({
|
|
|
279688
279895
|
|
|
279689
279896
|
// ../service/src/analysis-scope.ts
|
|
279690
279897
|
import { dirname as dirname16 } from "path";
|
|
279691
|
-
import { existsSync as
|
|
279898
|
+
import { existsSync as existsSync11 } from "fs";
|
|
279692
279899
|
function filterDiagnosticsByLevel(diags, level) {
|
|
279693
279900
|
if (level === "verbose") return diags;
|
|
279694
279901
|
if (level === "off") return [];
|
|
@@ -279732,7 +279939,7 @@ function shouldAnalyzeFile(filePath, source, config) {
|
|
|
279732
279939
|
if (cfg.mode === "directives") return false;
|
|
279733
279940
|
if (text !== void 0 && hasExport(text)) return true;
|
|
279734
279941
|
try {
|
|
279735
|
-
if (
|
|
279942
|
+
if (existsSync11(sidecarPathOf(filePath))) return true;
|
|
279736
279943
|
} catch {
|
|
279737
279944
|
}
|
|
279738
279945
|
return false;
|
|
@@ -280038,7 +280245,7 @@ import {
|
|
|
280038
280245
|
mkdirSync as mkdirSync3,
|
|
280039
280246
|
readFileSync as readFileSync15,
|
|
280040
280247
|
writeFileSync as writeFileSync3,
|
|
280041
|
-
existsSync as
|
|
280248
|
+
existsSync as existsSync12,
|
|
280042
280249
|
rmSync,
|
|
280043
280250
|
renameSync,
|
|
280044
280251
|
unlinkSync
|
|
@@ -280083,7 +280290,7 @@ function monorepoLogicalPath(posixPath) {
|
|
|
280083
280290
|
let dir = dirname17(posixPath);
|
|
280084
280291
|
let workspacesRoot;
|
|
280085
280292
|
for (; ; ) {
|
|
280086
|
-
if (
|
|
280293
|
+
if (existsSync12(join10(dir, "pnpm-workspace.yaml")) || existsSync12(join10(dir, "lerna.json"))) {
|
|
280087
280294
|
return toPosix(relative3(dir, posixPath)) || void 0;
|
|
280088
280295
|
}
|
|
280089
280296
|
if (!workspacesRoot) {
|
|
@@ -280206,7 +280413,7 @@ var init_disk_cache = __esm({
|
|
|
280206
280413
|
if (!this.enabled || !this.root) return void 0;
|
|
280207
280414
|
try {
|
|
280208
280415
|
const p = this.pathFor(key);
|
|
280209
|
-
if (!
|
|
280416
|
+
if (!existsSync12(p)) return void 0;
|
|
280210
280417
|
const raw = readFileSync15(p, "utf8");
|
|
280211
280418
|
const parsed = JSON.parse(raw);
|
|
280212
280419
|
if (parsed?.abi !== ANALYSIS_ABI) return void 0;
|
|
@@ -280228,7 +280435,7 @@ var init_disk_cache = __esm({
|
|
|
280228
280435
|
} catch {
|
|
280229
280436
|
if (tmp) {
|
|
280230
280437
|
try {
|
|
280231
|
-
if (
|
|
280438
|
+
if (existsSync12(tmp)) unlinkSync(tmp);
|
|
280232
280439
|
} catch {
|
|
280233
280440
|
}
|
|
280234
280441
|
}
|
|
@@ -280447,7 +280654,7 @@ import {
|
|
|
280447
280654
|
mkdirSync as mkdirSync4,
|
|
280448
280655
|
readFileSync as readFileSync16,
|
|
280449
280656
|
writeFileSync as writeFileSync4,
|
|
280450
|
-
existsSync as
|
|
280657
|
+
existsSync as existsSync13,
|
|
280451
280658
|
rmSync as rmSync2,
|
|
280452
280659
|
renameSync as renameSync2,
|
|
280453
280660
|
unlinkSync as unlinkSync2
|
|
@@ -280636,7 +280843,7 @@ function monorepoLogicalPath2(posixPath) {
|
|
|
280636
280843
|
let dir = dirname18(posixPath);
|
|
280637
280844
|
let workspacesRoot;
|
|
280638
280845
|
for (; ; ) {
|
|
280639
|
-
if (
|
|
280846
|
+
if (existsSync13(join11(dir, "pnpm-workspace.yaml")) || existsSync13(join11(dir, "lerna.json"))) {
|
|
280640
280847
|
return toPosix2(relative4(dir, posixPath)) || void 0;
|
|
280641
280848
|
}
|
|
280642
280849
|
if (!workspacesRoot) {
|
|
@@ -280732,7 +280939,7 @@ var init_chunk_4TAFH6ZZ = __esm({
|
|
|
280732
280939
|
if (!this.enabled || !this.root) return void 0;
|
|
280733
280940
|
try {
|
|
280734
280941
|
const p = this.pathFor(key);
|
|
280735
|
-
if (!
|
|
280942
|
+
if (!existsSync13(p)) return void 0;
|
|
280736
280943
|
const raw = readFileSync16(p, "utf8");
|
|
280737
280944
|
const parsed = JSON.parse(raw);
|
|
280738
280945
|
if (parsed?.abi !== ANALYSIS_ABI2) return void 0;
|
|
@@ -280754,7 +280961,7 @@ var init_chunk_4TAFH6ZZ = __esm({
|
|
|
280754
280961
|
} catch {
|
|
280755
280962
|
if (tmp) {
|
|
280756
280963
|
try {
|
|
280757
|
-
if (
|
|
280964
|
+
if (existsSync13(tmp)) unlinkSync2(tmp);
|
|
280758
280965
|
} catch {
|
|
280759
280966
|
}
|
|
280760
280967
|
}
|
|
@@ -280771,8 +280978,8 @@ var init_chunk_4TAFH6ZZ = __esm({
|
|
|
280771
280978
|
}
|
|
280772
280979
|
});
|
|
280773
280980
|
|
|
280774
|
-
// ../service/dist/chunk-
|
|
280775
|
-
import { readFileSync as readFileSync17, existsSync as
|
|
280981
|
+
// ../service/dist/chunk-EGGGBJDA.js
|
|
280982
|
+
import { readFileSync as readFileSync17, existsSync as existsSync14, statSync as statSync11, mkdirSync as mkdirSync5, writeFileSync as writeFileSync5 } from "fs";
|
|
280776
280983
|
import { resolve as resolvePath2, join as joinPath2 } from "path";
|
|
280777
280984
|
import { pathToFileURL as pathToFileURL2 } from "url";
|
|
280778
280985
|
import { createRequire as createRequire5 } from "module";
|
|
@@ -280831,7 +281038,7 @@ function isPathEnvName2(name, baseDir) {
|
|
|
280831
281038
|
if (name in envFactories2) return false;
|
|
280832
281039
|
if (name.includes("/") || name.startsWith("./") || name.startsWith("../")) return true;
|
|
280833
281040
|
const resolved = resolvePath2(baseDir, name);
|
|
280834
|
-
return resolved.endsWith(".ts") &&
|
|
281041
|
+
return resolved.endsWith(".ts") && existsSync14(resolved);
|
|
280835
281042
|
}
|
|
280836
281043
|
function rewriteBareImports2(text) {
|
|
280837
281044
|
const require22 = createRequire5(import.meta.url);
|
|
@@ -280938,7 +281145,7 @@ async function preloadPathEnvs2(envNames, baseDir) {
|
|
|
280938
281145
|
for (const name of envNames) {
|
|
280939
281146
|
if (!isPathEnvName2(name, baseDir)) continue;
|
|
280940
281147
|
const resolved = resolvePath2(baseDir, name);
|
|
280941
|
-
if (!
|
|
281148
|
+
if (!existsSync14(resolved)) {
|
|
280942
281149
|
recordPathEnvError2(resolved, baseDir, new Error(`path env not found: ${resolved}`));
|
|
280943
281150
|
continue;
|
|
280944
281151
|
}
|
|
@@ -281108,13 +281315,22 @@ function pkgStatFp2(pkgPath) {
|
|
|
281108
281315
|
try {
|
|
281109
281316
|
const st = statSync22(pkgPath);
|
|
281110
281317
|
return `${st.mtimeMs}:${st.size}`;
|
|
281111
|
-
} catch {
|
|
281112
|
-
|
|
281318
|
+
} catch (err) {
|
|
281319
|
+
if (err instanceof Error && err.code === "ENOENT") {
|
|
281320
|
+
return void 0;
|
|
281321
|
+
}
|
|
281322
|
+
throw err;
|
|
281113
281323
|
}
|
|
281114
281324
|
}
|
|
281115
281325
|
function projectConfigMemoHit2(entry) {
|
|
281116
281326
|
for (const { pkgPath, fp } of entry.chain) {
|
|
281117
|
-
|
|
281327
|
+
let current;
|
|
281328
|
+
try {
|
|
281329
|
+
current = pkgStatFp2(pkgPath);
|
|
281330
|
+
} catch {
|
|
281331
|
+
return false;
|
|
281332
|
+
}
|
|
281333
|
+
if (current !== fp) return false;
|
|
281118
281334
|
}
|
|
281119
281335
|
return true;
|
|
281120
281336
|
}
|
|
@@ -281136,7 +281352,18 @@ function findProjectConfig2(startDir) {
|
|
|
281136
281352
|
if (hit && projectConfigMemoHit2(hit)) return hit.result;
|
|
281137
281353
|
while (dir !== root) {
|
|
281138
281354
|
const pkgPath = resolve10(dir, "package.json");
|
|
281139
|
-
|
|
281355
|
+
let statFp;
|
|
281356
|
+
try {
|
|
281357
|
+
statFp = pkgStatFp2(pkgPath);
|
|
281358
|
+
} catch (err) {
|
|
281359
|
+
memoEntry.chain.push({ pkgPath, fp: STAT_ERROR_FP2 });
|
|
281360
|
+
process.stderr?.write?.(
|
|
281361
|
+
`nudo: package.json stat failed at ${pkgPath} (${err instanceof Error ? err.message : String(err)}); project config disabled for this subtree (defaults + env apply)
|
|
281362
|
+
`
|
|
281363
|
+
);
|
|
281364
|
+
applyBForkBudgetFromConfig2(null);
|
|
281365
|
+
return memoize(null);
|
|
281366
|
+
}
|
|
281140
281367
|
memoEntry.chain.push({ pkgPath, fp: statFp });
|
|
281141
281368
|
if (statFp !== void 0) {
|
|
281142
281369
|
let pkg;
|
|
@@ -281307,9 +281534,9 @@ function resolveNpmJsEntryDetailed2(source, fromDir) {
|
|
|
281307
281534
|
}
|
|
281308
281535
|
return { path: tryInsidePkg2(pkgDir, subpath, tryFile), exportsUnresolved: false };
|
|
281309
281536
|
}
|
|
281310
|
-
var BUILTIN_ERROR_CLASSES2, BUILTIN_PROTOTYPE_CLASSES2, numA2, strA2, boolA2, unkA2, undefA2, nullA2, OBJECT_PROTOTYPE_METHODS2, BUILTIN_PROTOTYPE_METHOD_APPROXIMATIONS2, BoundedLruMap4, envFactories2, impliedDeps2, PATH_ENV_CACHE_MAX2, PATH_ENV_BY_PATH_MAX2, PATH_ENV_BASE_DIRS_MAX2, pathEnvCache2, pathEnvByPath2, pathEnvBaseDirs2, pathEnvFiles2, pathEnvLoadErrors2, DEFAULT_SESSION_CACHE_LIMITS2, HARD_CAP2, explicit2, fromProject2, DEFAULT_ANALYSIS_EXCLUDE2, DEFAULT_ANALYSIS_MODE2, projectConfigMemo2, MAX_PROJECT_CONFIG_MEMO2, projectConfigDiskReads2, JS_CONDITIONS2;
|
|
281311
|
-
var
|
|
281312
|
-
"../service/dist/chunk-
|
|
281537
|
+
var BUILTIN_ERROR_CLASSES2, BUILTIN_PROTOTYPE_CLASSES2, numA2, strA2, boolA2, unkA2, undefA2, nullA2, OBJECT_PROTOTYPE_METHODS2, BUILTIN_PROTOTYPE_METHOD_APPROXIMATIONS2, BoundedLruMap4, envFactories2, impliedDeps2, PATH_ENV_CACHE_MAX2, PATH_ENV_BY_PATH_MAX2, PATH_ENV_BASE_DIRS_MAX2, pathEnvCache2, pathEnvByPath2, pathEnvBaseDirs2, pathEnvFiles2, pathEnvLoadErrors2, DEFAULT_SESSION_CACHE_LIMITS2, HARD_CAP2, explicit2, fromProject2, DEFAULT_ANALYSIS_EXCLUDE2, DEFAULT_ANALYSIS_MODE2, projectConfigMemo2, MAX_PROJECT_CONFIG_MEMO2, projectConfigDiskReads2, STAT_ERROR_FP2, JS_CONDITIONS2;
|
|
281538
|
+
var init_chunk_EGGGBJDA = __esm({
|
|
281539
|
+
"../service/dist/chunk-EGGGBJDA.js"() {
|
|
281313
281540
|
"use strict";
|
|
281314
281541
|
init_src();
|
|
281315
281542
|
init_es();
|
|
@@ -281586,17 +281813,18 @@ var init_chunk_RKFQ6H4V = __esm({
|
|
|
281586
281813
|
projectConfigMemo2 = /* @__PURE__ */ new Map();
|
|
281587
281814
|
MAX_PROJECT_CONFIG_MEMO2 = 128;
|
|
281588
281815
|
projectConfigDiskReads2 = 0;
|
|
281816
|
+
STAT_ERROR_FP2 = "\0stat-error";
|
|
281589
281817
|
JS_CONDITIONS2 = ["node", "require", "import", "default", "browser"];
|
|
281590
281818
|
}
|
|
281591
281819
|
});
|
|
281592
281820
|
|
|
281593
|
-
// ../service/dist/chunk-
|
|
281594
|
-
import {
|
|
281821
|
+
// ../service/dist/chunk-MV2LPYT2.js
|
|
281822
|
+
import { statSync as statSync12, readFileSync as readFileSync18 } from "fs";
|
|
281595
281823
|
import { dirname as dirname20, resolve as resolve11, join as join13 } from "path";
|
|
281596
281824
|
import { readFileSync as readFileSync42, statSync as statSync33 } from "fs";
|
|
281597
281825
|
import { dirname as dirname32 } from "path";
|
|
281598
281826
|
import { dirname as dirname42 } from "path";
|
|
281599
|
-
import { existsSync as
|
|
281827
|
+
import { existsSync as existsSync32, readFileSync as readFileSync52 } from "fs";
|
|
281600
281828
|
import { dirname as dirname52, join as join32, resolve as resolve42 } from "path";
|
|
281601
281829
|
import { dirname as dirname82 } from "path";
|
|
281602
281830
|
import { realpathSync as realpathSync2 } from "fs";
|
|
@@ -281612,18 +281840,21 @@ function moduleResolveCandidates2(spec, fromFile) {
|
|
|
281612
281840
|
}
|
|
281613
281841
|
function resolveModuleFile2(spec, fromFile) {
|
|
281614
281842
|
for (const cand of moduleResolveCandidates2(spec, fromFile)) {
|
|
281615
|
-
|
|
281843
|
+
let st;
|
|
281844
|
+
try {
|
|
281845
|
+
st = statSync12(cand);
|
|
281846
|
+
} catch (e) {
|
|
281847
|
+
const code2 = e?.code;
|
|
281848
|
+
if (code2 === "ENOENT" || code2 === "ENOTDIR" || code2 === "EISDIR") continue;
|
|
281849
|
+
throw new ModuleReadError2(cand, e);
|
|
281850
|
+
}
|
|
281851
|
+
if (!st.isDirectory()) return cand;
|
|
281616
281852
|
}
|
|
281617
281853
|
return void 0;
|
|
281618
281854
|
}
|
|
281619
281855
|
function defaultLoadModule2(spec, fromFile) {
|
|
281620
281856
|
if (!spec.startsWith(".") && !spec.startsWith("/")) return void 0;
|
|
281621
|
-
|
|
281622
|
-
try {
|
|
281623
|
-
cand = resolveModuleFile2(spec, fromFile);
|
|
281624
|
-
} catch {
|
|
281625
|
-
return void 0;
|
|
281626
|
-
}
|
|
281857
|
+
const cand = resolveModuleFile2(spec, fromFile);
|
|
281627
281858
|
if (!cand) return void 0;
|
|
281628
281859
|
try {
|
|
281629
281860
|
return readFileSync18(cand, "utf-8");
|
|
@@ -282054,9 +282285,9 @@ function analysisFileCacheKey2(filePath, source, activeCases, externalCallRecord
|
|
|
282054
282285
|
let noCache = false;
|
|
282055
282286
|
try {
|
|
282056
282287
|
const fp = loadModuleDepsFingerprint(source, effectiveLoader, filePath);
|
|
282057
|
-
if (fp.truncated) {
|
|
282288
|
+
if (fp.truncated || fp.readError) {
|
|
282058
282289
|
noCache = true;
|
|
282059
|
-
depSeg =
|
|
282290
|
+
depSeg = `${fp.truncated ? "trunc" : "readerr"}:${fp.paths.length}`;
|
|
282060
282291
|
} else {
|
|
282061
282292
|
depSeg = hashSource(fp.fp);
|
|
282062
282293
|
}
|
|
@@ -283008,7 +283239,7 @@ function evalCacheSlotKey2(filePath, mode) {
|
|
|
283008
283239
|
function evalDepKey2(source, filePath, loadModule) {
|
|
283009
283240
|
try {
|
|
283010
283241
|
const fp = loadModuleDepsFingerprint(source, loadModule ?? defaultLoadModule2, filePath);
|
|
283011
|
-
if (fp.truncated) return null;
|
|
283242
|
+
if (fp.truncated || fp.readError) return null;
|
|
283012
283243
|
return hashSource(fp.fp);
|
|
283013
283244
|
} catch {
|
|
283014
283245
|
return null;
|
|
@@ -283753,7 +283984,7 @@ function findOwningPackage2(fromFile) {
|
|
|
283753
283984
|
const root = resolve42("/");
|
|
283754
283985
|
for (; ; ) {
|
|
283755
283986
|
const pkgPath = join32(dir, "package.json");
|
|
283756
|
-
if (
|
|
283987
|
+
if (existsSync32(pkgPath)) {
|
|
283757
283988
|
try {
|
|
283758
283989
|
const pkg = JSON.parse(readFileSync52(pkgPath, "utf-8"));
|
|
283759
283990
|
return { path: pkgPath, dir, pkg };
|
|
@@ -284134,7 +284365,7 @@ function computeFnDepSegment2(source, loadModule, filePath) {
|
|
|
284134
284365
|
let fnDepFailClosed = false;
|
|
284135
284366
|
try {
|
|
284136
284367
|
const dfp = loadModuleDepsFingerprint(source, loadModule ?? defaultLoadModule2, filePath);
|
|
284137
|
-
if (dfp.truncated) {
|
|
284368
|
+
if (dfp.truncated || dfp.readError) {
|
|
284138
284369
|
fnDepFailClosed = true;
|
|
284139
284370
|
fnDepSeg = null;
|
|
284140
284371
|
} else {
|
|
@@ -285098,10 +285329,10 @@ function analyzeFile2(filePath, source, activeCases, externalCallRecords, loadMo
|
|
|
285098
285329
|
});
|
|
285099
285330
|
}
|
|
285100
285331
|
var MODULE_RESOLVE_EXTS2, ModuleReadError2, neverAbs2, undefAbs4, MAX_RECORD_TYPE_NODES2, ABS_MODULE_CACHE_MAX2, absModuleCache2, ENV_DEPENDENTS_MAX2, ENV_DEPENDENTS_PER_KEY_MAX2, envDependents2, analysisByFile2, fnAnalysisCache2, envHarvestConflictCollectorSlot2, evalRunByFile2, KNOWN_GLOBALS2, DEFAULT_CALLSITE_BUDGET2, COLLAPSE_LITERAL_THRESHOLD2;
|
|
285101
|
-
var
|
|
285102
|
-
"../service/dist/chunk-
|
|
285332
|
+
var init_chunk_MV2LPYT2 = __esm({
|
|
285333
|
+
"../service/dist/chunk-MV2LPYT2.js"() {
|
|
285103
285334
|
"use strict";
|
|
285104
|
-
|
|
285335
|
+
init_chunk_EGGGBJDA();
|
|
285105
285336
|
init_src2();
|
|
285106
285337
|
init_src();
|
|
285107
285338
|
init_src2();
|
|
@@ -285259,14 +285490,14 @@ __export(emit_exports, {
|
|
|
285259
285490
|
wrapReturnNullable: () => wrapReturnNullable,
|
|
285260
285491
|
writeInterfaceDraft: () => writeInterfaceDraft
|
|
285261
285492
|
});
|
|
285262
|
-
import { readFileSync as readFileSync19, existsSync as
|
|
285493
|
+
import { readFileSync as readFileSync19, existsSync as existsSync15 } from "fs";
|
|
285263
285494
|
import { dirname as dirname21, resolve as resolve12 } from "path";
|
|
285264
285495
|
import { existsSync as existsSync23, readFileSync as readFileSync23, writeFileSync as writeFileSync6, renameSync as renameSync3, unlinkSync as unlinkSync3 } from "fs";
|
|
285265
285496
|
import { basename as basename3, dirname as dirname23, relative as relative6, resolve as resolve23 } from "path";
|
|
285266
285497
|
import { randomBytes as randomBytes3 } from "crypto";
|
|
285267
|
-
import { existsSync as
|
|
285498
|
+
import { existsSync as existsSync33, readFileSync as readFileSync33, writeFileSync as writeFileSync22, realpathSync as realpathSync3 } from "fs";
|
|
285268
285499
|
import { basename as basename22, dirname as dirname33, isAbsolute as isAbsolute5, join as join14, relative as relative23 } from "path";
|
|
285269
|
-
import { existsSync as
|
|
285500
|
+
import { existsSync as existsSync42, readFileSync as readFileSync43 } from "fs";
|
|
285270
285501
|
import { basename as basename32, dirname as dirname43, relative as relative32, resolve as resolve32 } from "path";
|
|
285271
285502
|
import { relative as relative42, resolve as resolve43 } from "path";
|
|
285272
285503
|
import { existsSync as existsSync52, readFileSync as readFileSync53, renameSync as renameSync22, unlinkSync as unlinkSync22, writeFileSync as writeFileSync32 } from "fs";
|
|
@@ -285328,7 +285559,7 @@ async function interfaceSurface(filePath, opts = {}) {
|
|
|
285328
285559
|
if (autoBind !== false) {
|
|
285329
285560
|
const openSc = loadModule(`./${sc.slice(sc.lastIndexOf("/") + 1)}`, abs2);
|
|
285330
285561
|
if (openSc !== void 0) sidecarSource = openSc;
|
|
285331
|
-
else if (
|
|
285562
|
+
else if (existsSync15(sc)) sidecarSource = readFileSync19(sc, "utf-8");
|
|
285332
285563
|
}
|
|
285333
285564
|
} catch {
|
|
285334
285565
|
sidecarSource = void 0;
|
|
@@ -287134,7 +287365,7 @@ function writeInterfaceDraft(filePath, draftSource, opts = {}) {
|
|
|
287134
287365
|
}
|
|
287135
287366
|
}
|
|
287136
287367
|
const draftable = opts.draftable !== void 0 ? opts.draftable : opts.entries !== void 0 ? isDraftableEntry(opts.entries) : /export\s+const\s+[\p{ID_Start}$_][\p{ID_Continue}$]*\s*=/u.test(draftSource);
|
|
287137
|
-
const prev =
|
|
287368
|
+
const prev = existsSync33(draftPath) ? readFileSync33(draftPath, "utf-8") : void 0;
|
|
287138
287369
|
const changed = prev !== draftSource;
|
|
287139
287370
|
const written = !opts.dryRun && changed && draftable;
|
|
287140
287371
|
if (written) {
|
|
@@ -287459,7 +287690,7 @@ function importLocalMap(source, fromFile) {
|
|
|
287459
287690
|
const raw = resolve32(base, spec);
|
|
287460
287691
|
let modulePath = null;
|
|
287461
287692
|
for (const cand of [raw, `${raw}.js`, `${raw}.ts`, `${raw}.mjs`]) {
|
|
287462
|
-
if (
|
|
287693
|
+
if (existsSync42(cand)) {
|
|
287463
287694
|
modulePath = cand;
|
|
287464
287695
|
break;
|
|
287465
287696
|
}
|
|
@@ -287483,7 +287714,7 @@ function deriveFromRoot(filePath, opts = {}) {
|
|
|
287483
287714
|
const autoBind = opts.autoBind ?? interfaceConfig2(findProjectConfig2(dirname43(abs2))?.config).autoBind;
|
|
287484
287715
|
const loadModule = opts.loadModule ?? defaultLoadModule2;
|
|
287485
287716
|
const sidecarPath = sidecarPathOf(abs2);
|
|
287486
|
-
const sidecarSrc =
|
|
287717
|
+
const sidecarSrc = existsSync42(sidecarPath) && !isNodeModulesPath(sidecarPath) ? readFileSync43(sidecarPath, "utf-8") : "";
|
|
287487
287718
|
const fnNames = topLevelFnNames(source);
|
|
287488
287719
|
const roots = [];
|
|
287489
287720
|
const plans = [];
|
|
@@ -287611,7 +287842,7 @@ function deriveOneRoot(plan, source, file, modules, importLocals, label) {
|
|
|
287611
287842
|
targetFile = file;
|
|
287612
287843
|
}
|
|
287613
287844
|
if (isNodeModulesPath(targetFile)) continue;
|
|
287614
|
-
if (!
|
|
287845
|
+
if (!existsSync42(targetFile)) continue;
|
|
287615
287846
|
const key = `${targetFile}::${targetExport}`;
|
|
287616
287847
|
let agg = byCallee.get(key);
|
|
287617
287848
|
if (!agg) {
|
|
@@ -289696,8 +289927,8 @@ var init_emit2 = __esm({
|
|
|
289696
289927
|
"../service/dist/emit/index.js"() {
|
|
289697
289928
|
"use strict";
|
|
289698
289929
|
init_chunk_4TAFH6ZZ();
|
|
289699
|
-
|
|
289700
|
-
|
|
289930
|
+
init_chunk_MV2LPYT2();
|
|
289931
|
+
init_chunk_EGGGBJDA();
|
|
289701
289932
|
init_src();
|
|
289702
289933
|
init_src();
|
|
289703
289934
|
init_internal();
|
|
@@ -289959,7 +290190,7 @@ __export(migrate_exports, {
|
|
|
289959
290190
|
stripTsToJs: () => stripTsToJs
|
|
289960
290191
|
});
|
|
289961
290192
|
import {
|
|
289962
|
-
existsSync as
|
|
290193
|
+
existsSync as existsSync21,
|
|
289963
290194
|
mkdirSync as mkdirSync7,
|
|
289964
290195
|
readFileSync as readFileSync28,
|
|
289965
290196
|
readdirSync as readdirSync4,
|
|
@@ -289980,7 +290211,7 @@ function readJson(path) {
|
|
|
289980
290211
|
}
|
|
289981
290212
|
function writeFileAtomic(path, data) {
|
|
289982
290213
|
const dir = dirname29(path);
|
|
289983
|
-
if (!
|
|
290214
|
+
if (!existsSync21(dir)) mkdirSync7(dir, { recursive: true });
|
|
289984
290215
|
const tmp = `${path}.tmp-${process.pid}-${Date.now()}`;
|
|
289985
290216
|
try {
|
|
289986
290217
|
writeFileSync11(tmp, data, "utf-8");
|
|
@@ -289998,7 +290229,7 @@ function writeJson(path, value) {
|
|
|
289998
290229
|
`);
|
|
289999
290230
|
}
|
|
290000
290231
|
function snapshotFile(path) {
|
|
290001
|
-
if (!
|
|
290232
|
+
if (!existsSync21(path)) return { path, kind: "missing" };
|
|
290002
290233
|
try {
|
|
290003
290234
|
if (statSync16(path).isFile()) {
|
|
290004
290235
|
return { path, kind: "file", content: readFileSync28(path, "utf-8") };
|
|
@@ -290010,7 +290241,7 @@ function snapshotFile(path) {
|
|
|
290010
290241
|
}
|
|
290011
290242
|
function restoreSnapshot(snap) {
|
|
290012
290243
|
if (snap.kind === "missing") {
|
|
290013
|
-
if (
|
|
290244
|
+
if (existsSync21(snap.path)) rmSync3(snap.path, { force: true });
|
|
290014
290245
|
return;
|
|
290015
290246
|
}
|
|
290016
290247
|
if (snap.kind === "file") writeFileAtomic(snap.path, snap.content);
|
|
@@ -290107,7 +290338,7 @@ function unquoteYamlScalar(s) {
|
|
|
290107
290338
|
}
|
|
290108
290339
|
function parsePnpmWorkspacePackages(root) {
|
|
290109
290340
|
const yamlPath = join18(root, "pnpm-workspace.yaml");
|
|
290110
|
-
if (!
|
|
290341
|
+
if (!existsSync21(yamlPath)) return [];
|
|
290111
290342
|
let text;
|
|
290112
290343
|
try {
|
|
290113
290344
|
text = readFileSync28(yamlPath, "utf-8");
|
|
@@ -290169,17 +290400,17 @@ function packageRoots(root) {
|
|
|
290169
290400
|
if (w.startsWith("!")) continue;
|
|
290170
290401
|
if (w.endsWith("/*") || w.endsWith("/**")) {
|
|
290171
290402
|
const base = join18(root, w.replace(/\/\*\*?$/, ""));
|
|
290172
|
-
if (!
|
|
290403
|
+
if (!existsSync21(base)) continue;
|
|
290173
290404
|
for (const name of readdirSync4(base)) {
|
|
290174
290405
|
const p = join18(base, name);
|
|
290175
|
-
if (!
|
|
290406
|
+
if (!existsSync21(join18(p, "package.json"))) continue;
|
|
290176
290407
|
if (seen.has(p)) continue;
|
|
290177
290408
|
seen.add(p);
|
|
290178
290409
|
roots.push(p);
|
|
290179
290410
|
}
|
|
290180
290411
|
} else {
|
|
290181
290412
|
const p = join18(root, w);
|
|
290182
|
-
if (!
|
|
290413
|
+
if (!existsSync21(join18(p, "package.json"))) continue;
|
|
290183
290414
|
if (seen.has(p)) continue;
|
|
290184
290415
|
seen.add(p);
|
|
290185
290416
|
roots.push(p);
|
|
@@ -290407,7 +290638,7 @@ function findWorkflowDir(from) {
|
|
|
290407
290638
|
let cur = resolve19(from);
|
|
290408
290639
|
for (let i = 0; i < 6; i++) {
|
|
290409
290640
|
const wf = join18(cur, ".github", "workflows");
|
|
290410
|
-
if (
|
|
290641
|
+
if (existsSync21(wf) && statSync16(wf).isDirectory()) return wf;
|
|
290411
290642
|
const parent = dirname29(cur);
|
|
290412
290643
|
if (parent === cur) break;
|
|
290413
290644
|
cur = parent;
|
|
@@ -290453,7 +290684,7 @@ function rewriteWorkflowsNear(from, opts = {}) {
|
|
|
290453
290684
|
}
|
|
290454
290685
|
function resolveMigrateRoot(rootDir) {
|
|
290455
290686
|
const raw = resolve19(rootDir);
|
|
290456
|
-
if (!
|
|
290687
|
+
if (!existsSync21(raw)) {
|
|
290457
290688
|
throw new Error(`not found: ${rootDir}`);
|
|
290458
290689
|
}
|
|
290459
290690
|
return statSync16(raw).isDirectory() ? raw : dirname29(raw);
|
|
@@ -290477,9 +290708,9 @@ function migrateStatus(rootDir) {
|
|
|
290477
290708
|
...pkg?.devDependencies ?? {}
|
|
290478
290709
|
};
|
|
290479
290710
|
const markerPath = join18(r, ".nudo", "migrate-retired.json");
|
|
290480
|
-
const retired =
|
|
290711
|
+
const retired = existsSync21(markerPath) && statSync16(markerPath).isFile();
|
|
290481
290712
|
const retiringPath = join18(r, ".nudo", "migrate-retiring.json");
|
|
290482
|
-
const retiring = !retired &&
|
|
290713
|
+
const retiring = !retired && existsSync21(retiringPath) && statSync16(retiringPath).isFile();
|
|
290483
290714
|
const blockers = [];
|
|
290484
290715
|
if (retiring) {
|
|
290485
290716
|
blockers.push(
|
|
@@ -290500,9 +290731,9 @@ function migrateStatus(rootDir) {
|
|
|
290500
290731
|
}
|
|
290501
290732
|
rows.push({
|
|
290502
290733
|
root: relative12(process.cwd(), r) || ".",
|
|
290503
|
-
packageJson:
|
|
290734
|
+
packageJson: existsSync21(pkgPath),
|
|
290504
290735
|
typescriptDep: Boolean(deps.typescript),
|
|
290505
|
-
tsconfig:
|
|
290736
|
+
tsconfig: existsSync21(join18(r, "tsconfig.json")),
|
|
290506
290737
|
tscScripts,
|
|
290507
290738
|
tsFiles,
|
|
290508
290739
|
tsxFiles,
|
|
@@ -290542,7 +290773,7 @@ async function migrateStrip(paths, opts = {}) {
|
|
|
290542
290773
|
const files = [];
|
|
290543
290774
|
for (const p of paths) {
|
|
290544
290775
|
const abs2 = resolve19(p);
|
|
290545
|
-
if (!
|
|
290776
|
+
if (!existsSync21(abs2)) {
|
|
290546
290777
|
throw new Error(`not found: ${p}`);
|
|
290547
290778
|
}
|
|
290548
290779
|
if (statSync16(abs2).isDirectory()) {
|
|
@@ -290566,9 +290797,9 @@ async function migrateStrip(paths, opts = {}) {
|
|
|
290566
290797
|
const outFile = TSX_EXT.has(ext) ? file.replace(/\.tsx$/i, ".jsx") : file.replace(/\.tsx$/i, ".js").replace(/\.mts$/i, ".mjs").replace(/\.cts$/i, ".cjs").replace(/\.ts$/i, ".js");
|
|
290567
290798
|
const wouldClobberNonTs = outFile === file && !isStripSource(file);
|
|
290568
290799
|
if (opts.write && !wouldClobberNonTs) {
|
|
290569
|
-
if (opts.backup &&
|
|
290800
|
+
if (opts.backup && existsSync21(file) && !existsSync21(`${file}.bak`)) {
|
|
290570
290801
|
renameSync4(file, `${file}.bak`);
|
|
290571
|
-
} else if (opts.backup !== true &&
|
|
290802
|
+
} else if (opts.backup !== true && existsSync21(file) && extname(file).toLowerCase() !== extname(outFile).toLowerCase()) {
|
|
290572
290803
|
}
|
|
290573
290804
|
writeFileSync11(outFile, code2, "utf-8");
|
|
290574
290805
|
}
|
|
@@ -290578,7 +290809,7 @@ async function migrateStrip(paths, opts = {}) {
|
|
|
290578
290809
|
const draft = await draftInterface(outFile, { source: code2, bodyAccesses: true });
|
|
290579
290810
|
if (draft.draftSource && draft.draftSource.trim().length > 0) {
|
|
290580
290811
|
const sc = sidecarPathOf(outFile);
|
|
290581
|
-
if (!
|
|
290812
|
+
if (!existsSync21(sc)) {
|
|
290582
290813
|
mkdirSync7(dirname29(sc), { recursive: true });
|
|
290583
290814
|
writeFileSync11(sc, draft.draftSource, "utf-8");
|
|
290584
290815
|
sidecarDraft = sc;
|
|
@@ -290618,7 +290849,7 @@ async function migrateVerify(paths, opts = {}) {
|
|
|
290618
290849
|
const files = [];
|
|
290619
290850
|
for (const p of paths) {
|
|
290620
290851
|
const abs2 = resolve19(p);
|
|
290621
|
-
if (!
|
|
290852
|
+
if (!existsSync21(abs2)) {
|
|
290622
290853
|
throw new Error(`not found: ${p}`);
|
|
290623
290854
|
}
|
|
290624
290855
|
if (statSync16(abs2).isDirectory()) {
|
|
@@ -290715,7 +290946,7 @@ function migrateRetire(rootDir, opts = {}) {
|
|
|
290715
290946
|
mkdirSync7(markerDir, { recursive: true });
|
|
290716
290947
|
commitWriteSet(root, ops);
|
|
290717
290948
|
const retiring = join18(markerDir, "migrate-retiring.json");
|
|
290718
|
-
if (
|
|
290949
|
+
if (existsSync21(retiring)) rmSync3(retiring, { force: true });
|
|
290719
290950
|
}
|
|
290720
290951
|
return {
|
|
290721
290952
|
root: relative12(process.cwd(), root) || ".",
|
|
@@ -290889,13 +291120,13 @@ init_src4();
|
|
|
290889
291120
|
init_src2();
|
|
290890
291121
|
init_emit2();
|
|
290891
291122
|
init_evaluator_api();
|
|
290892
|
-
import { readFileSync as readFileSync21, writeFileSync as writeFileSync7, existsSync as
|
|
291123
|
+
import { readFileSync as readFileSync21, writeFileSync as writeFileSync7, existsSync as existsSync17 } from "fs";
|
|
290893
291124
|
import { resolve as resolve14, dirname as dirname25, basename as basename6 } from "path";
|
|
290894
291125
|
|
|
290895
291126
|
// src/commands/shared.ts
|
|
290896
291127
|
init_emit2();
|
|
290897
291128
|
init_src4();
|
|
290898
|
-
import { readFileSync as readFileSync20, existsSync as
|
|
291129
|
+
import { readFileSync as readFileSync20, existsSync as existsSync16, watch, readdirSync as readdirSync3, statSync as statSync13 } from "fs";
|
|
290899
291130
|
import { resolve as resolve13, dirname as dirname24, relative as relative7, join as join15, basename as basename5 } from "path";
|
|
290900
291131
|
function usageError(message, fix) {
|
|
290901
291132
|
console.error(message);
|
|
@@ -290937,7 +291168,7 @@ function collectExternalRecords(sites, errorSink) {
|
|
|
290937
291168
|
const records = [];
|
|
290938
291169
|
for (const site of sites) {
|
|
290939
291170
|
const sitePath = resolve13(site);
|
|
290940
|
-
if (!
|
|
291171
|
+
if (!existsSync16(sitePath)) {
|
|
290941
291172
|
const err = {
|
|
290942
291173
|
path: sitePath,
|
|
290943
291174
|
code: "nudo:path-missing-callsite",
|
|
@@ -290969,7 +291200,7 @@ function collectNudoFiles(dir) {
|
|
|
290969
291200
|
}
|
|
290970
291201
|
function resolveTargetsCollect(path) {
|
|
290971
291202
|
const resolved = resolve13(path);
|
|
290972
|
-
if (!
|
|
291203
|
+
if (!existsSync16(resolved)) {
|
|
290973
291204
|
return {
|
|
290974
291205
|
targets: [],
|
|
290975
291206
|
errors: [
|
|
@@ -291021,12 +291252,12 @@ function resolveTargets(path) {
|
|
|
291021
291252
|
}
|
|
291022
291253
|
function startWatch(paths, runOne, label, onRoundStart) {
|
|
291023
291254
|
const resolvedList = paths.map((p) => resolve13(p));
|
|
291024
|
-
const isDir = resolvedList.some((p) =>
|
|
291255
|
+
const isDir = resolvedList.some((p) => existsSync16(p) && statSync13(p).isDirectory());
|
|
291025
291256
|
const primary = resolvedList[0];
|
|
291026
291257
|
const getFiles = () => {
|
|
291027
291258
|
const out = [];
|
|
291028
291259
|
for (const p of resolvedList) {
|
|
291029
|
-
if (!
|
|
291260
|
+
if (!existsSync16(p)) continue;
|
|
291030
291261
|
if (statSync13(p).isDirectory()) out.push(...collectNudoFiles(p));
|
|
291031
291262
|
else out.push(p);
|
|
291032
291263
|
}
|
|
@@ -291122,7 +291353,7 @@ function startWatch(paths, runOne, label, onRoundStart) {
|
|
|
291122
291353
|
debounceTimer = setTimeout(() => {
|
|
291123
291354
|
const changedFiles = [...pendingChanged];
|
|
291124
291355
|
pendingChanged.clear();
|
|
291125
|
-
if (changedFiles.some((f) => !
|
|
291356
|
+
if (changedFiles.some((f) => !existsSync16(f))) getAnalysisSession().clear();
|
|
291126
291357
|
runIncremental(changedFiles).catch(() => {
|
|
291127
291358
|
});
|
|
291128
291359
|
}, 200);
|
|
@@ -291489,7 +291720,7 @@ async function loadCheckCache(filePath, source, opts) {
|
|
|
291489
291720
|
if (autoBind !== false) {
|
|
291490
291721
|
try {
|
|
291491
291722
|
const scPath = sidecarPathOf(filePath);
|
|
291492
|
-
if (
|
|
291723
|
+
if (existsSync17(scPath)) sidecarContent = readFileSync21(scPath, "utf-8");
|
|
291493
291724
|
} catch {
|
|
291494
291725
|
sidecarContent = null;
|
|
291495
291726
|
}
|
|
@@ -291760,7 +291991,7 @@ async function runCheckFix(opts) {
|
|
|
291760
291991
|
const sidecar = sidecarPathOf(file);
|
|
291761
291992
|
let sidecarText;
|
|
291762
291993
|
try {
|
|
291763
|
-
sidecarText =
|
|
291994
|
+
sidecarText = existsSync17(sidecar) ? readFileSync21(sidecar, "utf-8") : void 0;
|
|
291764
291995
|
} catch {
|
|
291765
291996
|
sidecarText = void 0;
|
|
291766
291997
|
}
|
|
@@ -292378,7 +292609,7 @@ function registerTestCommand(program3) {
|
|
|
292378
292609
|
// src/commands/contract.ts
|
|
292379
292610
|
init_emit2();
|
|
292380
292611
|
init_src4();
|
|
292381
|
-
import { readFileSync as readFileSync25, existsSync as
|
|
292612
|
+
import { readFileSync as readFileSync25, existsSync as existsSync18, statSync as statSync14, writeFileSync as writeFileSync9, realpathSync as realpathSync4 } from "fs";
|
|
292382
292613
|
import { resolve as resolve16, dirname as dirname27, relative as relative9, join as join16, basename as basename7, isAbsolute as isAbsolute6 } from "path";
|
|
292383
292614
|
async function runContractPrint(file, records) {
|
|
292384
292615
|
const { interfaceSurface: interfaceSurface2 } = await Promise.resolve().then(() => (init_emit2(), emit_exports));
|
|
@@ -292408,8 +292639,8 @@ async function runContractFromDts(paths, opts) {
|
|
|
292408
292639
|
}
|
|
292409
292640
|
let label = "dts";
|
|
292410
292641
|
let dtsFiles = [];
|
|
292411
|
-
const fileLike = paths.filter((p) =>
|
|
292412
|
-
const barePkgs = paths.filter((p) => !
|
|
292642
|
+
const fileLike = paths.filter((p) => existsSync18(p));
|
|
292643
|
+
const barePkgs = paths.filter((p) => !existsSync18(p));
|
|
292413
292644
|
for (const p of fileLike) {
|
|
292414
292645
|
const abs2 = resolve16(p);
|
|
292415
292646
|
if (statSync14(abs2).isDirectory()) {
|
|
@@ -292419,7 +292650,7 @@ async function runContractFromDts(paths, opts) {
|
|
|
292419
292650
|
dtsFiles.push(abs2);
|
|
292420
292651
|
} else {
|
|
292421
292652
|
const sibling = abs2.replace(/\.[cm]?[jt]sx?$/, ".d.ts");
|
|
292422
|
-
if (
|
|
292653
|
+
if (existsSync18(sibling)) dtsFiles.push(sibling);
|
|
292423
292654
|
}
|
|
292424
292655
|
}
|
|
292425
292656
|
for (const pkg of barePkgs) {
|
|
@@ -292530,7 +292761,7 @@ async function runContractDraft(file, opts) {
|
|
|
292530
292761
|
let dir = dirname27(filePath);
|
|
292531
292762
|
const fsRoot = resolve16("/");
|
|
292532
292763
|
while (dir !== fsRoot) {
|
|
292533
|
-
if (
|
|
292764
|
+
if (existsSync18(join16(dir, "package.json"))) {
|
|
292534
292765
|
projectRoot = dir;
|
|
292535
292766
|
break;
|
|
292536
292767
|
}
|
|
@@ -293009,7 +293240,7 @@ function registerExportCommand(program3) {
|
|
|
293009
293240
|
|
|
293010
293241
|
// src/commands/health.ts
|
|
293011
293242
|
init_src4();
|
|
293012
|
-
import { readFileSync as readFileSync27, existsSync as
|
|
293243
|
+
import { readFileSync as readFileSync27, existsSync as existsSync20, statSync as statSync15 } from "fs";
|
|
293013
293244
|
import { resolve as resolve18, dirname as dirname28 } from "path";
|
|
293014
293245
|
async function healthFile(filePath, records) {
|
|
293015
293246
|
const report = { file: displayPathOf(filePath), functions: 0, entryOnly: 0, uncovered: [] };
|
|
@@ -293105,7 +293336,7 @@ async function runHealth(paths, opts) {
|
|
|
293105
293336
|
const reports = [];
|
|
293106
293337
|
for (const p of targetPaths) {
|
|
293107
293338
|
const abs2 = resolve18(p);
|
|
293108
|
-
if (!
|
|
293339
|
+
if (!existsSync20(abs2)) {
|
|
293109
293340
|
reports.push({ file: displayPathOf(abs2), functions: 0, entryOnly: 0, uncovered: [], error: `File not found: ${displayPathOf(abs2)}` });
|
|
293110
293341
|
continue;
|
|
293111
293342
|
}
|