@workit-dev/pi 1.0.2 → 1.0.4
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/workit.js +6 -3
- package/package.json +1 -1
package/dist/workit.js
CHANGED
|
@@ -15242,6 +15242,7 @@ var DOC_EXT = /\.(?:md|mdx|markdown|rst|adoc)$/iu;
|
|
|
15242
15242
|
var DOC_NAMES = /^(?:license|licence|notice|authors|changelog|changes|contributors)$/iu;
|
|
15243
15243
|
var INSTRUCTIONS = /(?:^|\/)(?:AGENTS|CLAUDE|GEMINI|SKILL)\.md$|(?:^|\/)(?:skills|agents|commands|rules|prompts)\/[^/]+/iu;
|
|
15244
15244
|
var TEST_PATH = /(?:^|\/)(?:test|tests|__tests__)\/|\.(?:test|spec)\.[^/]+$|_test\.[^/]+$/iu;
|
|
15245
|
+
var plural = (count, noun) => `${count} ${noun}${count === 1 ? "" : "s"}`;
|
|
15245
15246
|
var basename = (file) => file.slice(file.lastIndexOf("/") + 1);
|
|
15246
15247
|
var isDoc = (file) => !INSTRUCTIONS.test(file) && (DOC_EXT.test(file) || DOC_NAMES.test(basename(file)));
|
|
15247
15248
|
function kindOf(file) {
|
|
@@ -15300,6 +15301,8 @@ function computeLane(input) {
|
|
|
15300
15301
|
const behavior = kinds.filter((entry) => entry.kind === "behavior" || entry.kind === "test" || entry.kind === "lockfile");
|
|
15301
15302
|
const lines = behavior.filter((entry) => entry.kind !== "lockfile").reduce((sum, entry) => sum + entry.file.added + entry.file.deleted, 0);
|
|
15302
15303
|
const opaque = behavior.filter((entry) => entry.kind === "lockfile" || entry.file.binary);
|
|
15304
|
+
const diffLines = input.files.reduce((sum, file) => sum + file.added + file.deleted, 0);
|
|
15305
|
+
const counted = diffLines === lines && input.files.length === behavior.length ? "" : ` counted (the whole diff is ${plural(diffLines, "line")} in ${plural(input.files.length, "file")}; docs, comments, formatting, generated copies and lockfile lines are not counted)`;
|
|
15303
15306
|
const result = (lane, reasons) => ({
|
|
15304
15307
|
lane,
|
|
15305
15308
|
reasons,
|
|
@@ -15319,9 +15322,9 @@ function computeLane(input) {
|
|
|
15319
15322
|
input.files.length ? "only docs, comments, formatting or generated copies changed" : "no changes"
|
|
15320
15323
|
]);
|
|
15321
15324
|
if (lines >= fullMinLines)
|
|
15322
|
-
return result("full", [`large diff: ${lines} lines (≥ ${fullMinLines})`]);
|
|
15325
|
+
return result("full", [`large diff: ${lines} lines (≥ ${fullMinLines})${counted}`]);
|
|
15323
15326
|
if (lines > selfMaxLines)
|
|
15324
|
-
return result("focused", [`${lines} lines changed (> ${selfMaxLines})`]);
|
|
15327
|
+
return result("focused", [`${lines} lines changed (> ${selfMaxLines})${counted}`]);
|
|
15325
15328
|
if (behavior.length > selfMaxFiles)
|
|
15326
15329
|
return result("focused", [`${behavior.length} behavior files changed (> ${selfMaxFiles})`]);
|
|
15327
15330
|
if (opaque.length)
|
|
@@ -15329,7 +15332,7 @@ function computeLane(input) {
|
|
|
15329
15332
|
`a lockfile or binary changed: ${opaque.slice(0, 3).map((entry) => entry.file.path).join(", ")}${opaque.length > 3 ? ", …" : ""}`
|
|
15330
15333
|
]);
|
|
15331
15334
|
return result("self", [
|
|
15332
|
-
`small change: ${lines
|
|
15335
|
+
`small change: ${plural(lines, "line")} in ${plural(behavior.length, "file")}${counted}, no risk path`
|
|
15333
15336
|
]);
|
|
15334
15337
|
}
|
|
15335
15338
|
function untrackedStat(cwd, file) {
|