headlamp 0.1.14 → 0.1.15
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/README.md +12 -0
- package/dist/cli.cjs +20 -4
- package/dist/cli.cjs.map +2 -2
- package/dist/index.js +20 -4
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -69,7 +69,8 @@ var init_args = __esm({
|
|
|
69
69
|
coverageMaxFiles: (value) => ({ type: "coverageMaxFiles", value }),
|
|
70
70
|
coverageMaxHotspots: (value) => ({ type: "coverageMaxHotspots", value }),
|
|
71
71
|
coveragePageFit: (value) => ({ type: "coveragePageFit", value }),
|
|
72
|
-
changed: (value) => ({ type: "changed", value })
|
|
72
|
+
changed: (value) => ({ type: "changed", value }),
|
|
73
|
+
changedDepth: (value) => ({ type: "changedDepth", value })
|
|
73
74
|
};
|
|
74
75
|
Some = (value) => ({ _tag: "some", value });
|
|
75
76
|
None = { _tag: "none" };
|
|
@@ -290,6 +291,16 @@ var init_args = __esm({
|
|
|
290
291
|
const mode = raw === "staged" ? "staged" : raw === "unstaged" ? "unstaged" : raw === "branch" ? "branch" : "all";
|
|
291
292
|
return step([ActionBuilders.changed(mode)], true);
|
|
292
293
|
}),
|
|
294
|
+
// --changed.depth flag: maximum transitive import depth for changed selection refinement
|
|
295
|
+
rule.startsWith("--changed.depth=", (value) => {
|
|
296
|
+
const raw = (value.split("=")[1] ?? "").trim();
|
|
297
|
+
const num = Number(raw);
|
|
298
|
+
return step(Number.isFinite(num) && num > 0 ? [ActionBuilders.changedDepth(num)] : []);
|
|
299
|
+
}),
|
|
300
|
+
rule.withLookahead("--changed.depth", (_flag, lookahead) => {
|
|
301
|
+
const num = Number(String(lookahead).trim());
|
|
302
|
+
return step(Number.isFinite(num) && num > 0 ? [ActionBuilders.changedDepth(num)] : [], true);
|
|
303
|
+
}),
|
|
293
304
|
rule.withLookahead(
|
|
294
305
|
"-t",
|
|
295
306
|
(flag, lookahead) => step(
|
|
@@ -396,6 +407,8 @@ var init_args = __esm({
|
|
|
396
407
|
return { vitest: [], jest: [], coverage: false, coveragePageFit: action.value };
|
|
397
408
|
case "changed":
|
|
398
409
|
return { vitest: [], jest: [], coverage: false, changed: action.value };
|
|
410
|
+
case "changedDepth":
|
|
411
|
+
return { vitest: [], jest: [], coverage: false, changedDepth: action.value };
|
|
399
412
|
case "jestArg":
|
|
400
413
|
return { vitest: [], jest: [action.value], coverage: false };
|
|
401
414
|
case "vitestArg":
|
|
@@ -436,6 +449,7 @@ var init_args = __esm({
|
|
|
436
449
|
return {
|
|
437
450
|
...next,
|
|
438
451
|
...right.changed !== void 0 || left.changed !== void 0 ? { changed: right.changed ?? left.changed } : {},
|
|
452
|
+
...right.changedDepth !== void 0 || left.changedDepth !== void 0 ? { changedDepth: right.changedDepth ?? left.changedDepth } : {},
|
|
439
453
|
...right.coverageAbortOnFailure !== void 0 || left.coverageAbortOnFailure !== void 0 ? { coverageAbortOnFailure: right.coverageAbortOnFailure ?? left.coverageAbortOnFailure } : {},
|
|
440
454
|
...right.onlyFailures !== void 0 || left.onlyFailures !== void 0 ? { onlyFailures: right.onlyFailures ?? left.onlyFailures } : {},
|
|
441
455
|
...right.coverageDetail !== void 0 || left.coverageDetail !== void 0 ? { coverageDetail: right.coverageDetail ?? left.coverageDetail } : {},
|
|
@@ -526,7 +540,8 @@ var init_args = __esm({
|
|
|
526
540
|
coveragePageFit,
|
|
527
541
|
...contrib.editorCmd !== void 0 ? { editorCmd: contrib.editorCmd } : {},
|
|
528
542
|
...contrib.workspaceRoot !== void 0 ? { workspaceRoot: contrib.workspaceRoot } : {},
|
|
529
|
-
...contrib.changed !== void 0 ? { changed: contrib.changed } : {}
|
|
543
|
+
...contrib.changed !== void 0 ? { changed: contrib.changed } : {},
|
|
544
|
+
...contrib.changedDepth !== void 0 ? { changedDepth: contrib.changedDepth } : {}
|
|
530
545
|
};
|
|
531
546
|
return out;
|
|
532
547
|
};
|
|
@@ -8032,7 +8047,8 @@ var program = async () => {
|
|
|
8032
8047
|
coverageMaxFiles: coverageMaxFilesArg,
|
|
8033
8048
|
coverageMaxHotspots: coverageMaxHotspotsArg,
|
|
8034
8049
|
coveragePageFit,
|
|
8035
|
-
changed
|
|
8050
|
+
changed,
|
|
8051
|
+
changedDepth
|
|
8036
8052
|
} = deriveArgs(argv);
|
|
8037
8053
|
const getChangedFiles = async (mode, cwd) => {
|
|
8038
8054
|
const collect = async (cmd, args) => {
|
|
@@ -8504,7 +8520,7 @@ var program = async () => {
|
|
|
8504
8520
|
resolutionCache.set(key, resolved);
|
|
8505
8521
|
return resolved;
|
|
8506
8522
|
};
|
|
8507
|
-
const MAX_DEPTH = 5;
|
|
8523
|
+
const MAX_DEPTH = Number.isFinite(Number(changedDepth)) && Number(changedDepth) > 0 ? Number(changedDepth) : 5;
|
|
8508
8524
|
const seen = /* @__PURE__ */ new Set();
|
|
8509
8525
|
const matchesTransitively = async (absTestPath, depth) => {
|
|
8510
8526
|
if (depth > MAX_DEPTH) {
|