sniff-qa 0.8.1 → 0.9.1
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/.claude-plugin/icon.png +0 -0
- package/.claude-plugin/plugin.json +9 -2
- package/CHANGELOG.md +73 -0
- package/NOTICE +7 -4
- package/README.md +169 -102
- package/THIRD-PARTY-NOTICES.md +1800 -0
- package/dist/{accessibility-JXRMWF5Y.js → accessibility-42JOUOGH.js} +8 -2
- package/dist/{anthropic-api-ZR3UEB3Z.js → anthropic-api-VSG2X6FS.js} +7 -5
- package/dist/assert-budget-WG4BRCLX.js +10 -0
- package/dist/{caps-G3ZGJI7B.js → caps-YZPFNPIN.js} +3 -2
- package/dist/{chunk-VEI2O6AK.js → chunk-33JL2AB5.js} +14 -6
- package/dist/{chunk-7ZOFYET5.js → chunk-3E4W4H6S.js} +36 -16
- package/dist/{chunk-EGANHIIE.js → chunk-3NR2K5B3.js} +49 -5
- package/dist/chunk-3ROWRVZE.js +422 -0
- package/dist/{chunk-MYWWSM3V.js → chunk-3YFE3H23.js} +2 -1
- package/dist/{chunk-MMISGY2Q.js → chunk-4F6ZXOPE.js} +2 -1
- package/dist/chunk-A4TTASVS.js +27862 -0
- package/dist/{chunk-IXDUD2UG.js → chunk-AA744N7E.js} +2 -1
- package/dist/chunk-DZMX3VT2.js +267 -0
- package/dist/{chunk-NG2IGCAK.js → chunk-FR5QCJLH.js} +2 -1
- package/dist/{chunk-GV27IOMC.js → chunk-GC47B6MM.js} +2 -1
- package/dist/chunk-HP4TY3UY.js +80 -0
- package/dist/chunk-LZAPYYNR.js +4595 -0
- package/dist/{chunk-ZM6MGWO4.js → chunk-NBJLMLDA.js} +2 -1
- package/dist/chunk-RAGYZ54R.js +15480 -0
- package/dist/{chunk-GX36BPK7.js → chunk-RSGFFRXQ.js} +2 -2
- package/dist/chunk-SOBWDC35.js +38 -0
- package/dist/{chunk-CZKMOAXU.js → chunk-US4HFUCH.js} +3 -2
- package/dist/chunk-YM22FEIA.js +5807 -0
- package/dist/{ci-ISCWZJD3.js → ci-F6FUXT3O.js} +5 -3
- package/dist/{classifier-MWQMQ727.js → classifier-5FQ2FBTO.js} +3 -1
- package/dist/{claude-code-ZFTBQXY4.js → claude-code-J43C22IR.js} +7 -5
- package/dist/{claude-exploration-provider-QJH6IPYU.js → claude-exploration-provider-EWQNNE7D.js} +4 -3
- package/dist/cli/index.js +87 -35
- package/dist/compiler-sfc.cjs-JX56AWNS.js +48568 -0
- package/dist/crawl-KN7SW753.js +26 -0
- package/dist/{crawl-command-RDWGHZC4.js → crawl-command-Y45FIXNK.js} +14 -9
- package/dist/{cross-reference-MHNPSLEN.js → cross-reference-XOOBW6UZ.js} +3 -1
- package/dist/{dev-server-detector-XQ5AYPDT.js → dev-server-detector-FMFVKDJR.js} +3 -1
- package/dist/{discover-QKGMYPHK.js → discover-HA63UA4K.js} +20 -18
- package/dist/dist-3CYER35S.js +8 -0
- package/dist/{domain-UQ34YE4B.js → domain-FU3WIW64.js} +45 -30
- package/dist/{edge-cases-ZADKDZHL.js → edge-cases-B6IV3IKK.js} +3 -1
- package/dist/{element-extractor-OZTFBVKZ.js → element-extractor-QAG4MRUO.js} +18 -6
- package/dist/engine-AXB5O4ZH.js +39 -0
- package/dist/ensure-browsers-TNMHMLRS.js +147 -0
- package/dist/errors-NWB25P4K.js +8 -0
- package/dist/esm-IMWPYLSN.js +3469 -0
- package/dist/{fix-R33D34NP.js → fix-IXOEHAOS.js} +12 -5
- package/dist/{flakiness-OLJAY7CS.js → flakiness-7SSSM4SW.js} +3 -2
- package/dist/flakiness-CBKV4U54.js +12 -0
- package/dist/formatter-N4CC7SCM.js +176 -0
- package/dist/{framework-detector-ISSM2Q2I.js → framework-detector-4ZVHNT7N.js} +3 -1
- package/dist/generator-GGJYWYI2.js +8 -0
- package/dist/index.d.ts +15 -5
- package/dist/index.js +9 -6
- package/dist/{init-IQKT4ANC.js → init-POX5ZJ6V.js} +4 -2
- package/dist/json-4VOVHDQG.js +10 -0
- package/dist/{junit-GL44ATRR.js → junit-V24COOSR.js} +3 -1
- package/dist/{llm-VJAI6H6G.js → llm-TZ2WZGRZ.js} +3 -1
- package/dist/{loader-Z2DUGG5Z.js → loader-AMM63AOJ.js} +12 -3
- package/dist/mcp/server.js +13049 -73
- package/dist/{model-SP6HJN6J.js → model-BL2AID5Q.js} +6 -5
- package/dist/page-hooks-SECSGZR6.js +14 -0
- package/dist/{page-state-extractor-GYYLYRFR.js → page-state-extractor-AP4FQVLY.js} +3 -1
- package/dist/{performance-7HWKY5O2.js → performance-JVEYVBTV.js} +9 -3
- package/dist/{persistence-XLFJ5EY4.js → persistence-SHKJVSIS.js} +5 -4
- package/dist/{persistence-KTCRIGHU.js → persistence-SQ6QT3HP.js} +3 -1
- package/dist/picocolors-3W2AX5TJ.js +6 -0
- package/dist/pixelmatch-GATIVDQX.js +188 -0
- package/dist/png-HTC2G4ZG.js +2093 -0
- package/dist/{prompt-builder-D3FBH534.js → prompt-builder-EI2BFKLZ.js} +4 -2
- package/dist/{provider-BCKFVPTN.js → provider-O3UOALQH.js} +14 -12
- package/dist/{quality-run-YAURB242.js → quality-run-CTLX5YA5.js} +12 -10
- package/dist/{redaction-CHAIVPCF.js → redaction-QNBV5QZ3.js} +4 -3
- package/dist/{registry-5XCXUAYJ.js → registry-JBBTSD7I.js} +3 -1
- package/dist/{repo-analyzer-4OURSITY.js → repo-analyzer-4XITIIAF.js} +6 -4
- package/dist/{report-SDZWX25B.js → report-4UVJL7QV.js} +3 -1
- package/dist/{report-7FQFH4HW.js → report-BOVSPRCR.js} +8 -6
- package/dist/{response-parser-PUGNWF7S.js → response-parser-GHVJSYXQ.js} +3 -2
- package/dist/{route-discoverer-QBZCRQLJ.js → route-discoverer-ZXYJQIYE.js} +15 -8
- package/dist/{runner-RDVVIGBU.js → runner-DOLCFA3S.js} +10 -5
- package/dist/{runner-QHSYX7J2.js → runner-MCSDHFLN.js} +12 -7
- package/dist/{runner-AXZXNWYH.js → runner-MUBXHOIG.js} +10 -4
- package/dist/{scenarios-I7YYVTD2.js → scenarios-T2U6ZDRL.js} +3 -1
- package/dist/sdk-FQKA5HSQ.js +7184 -0
- package/dist/{source-5LS2B7TN.js → source-T5MHBY5G.js} +14 -7
- package/dist/{tiebreak-L5UFNKU2.js → tiebreak-SXBXPT7B.js} +3 -1
- package/dist/{unified-YSOTPG5B.js → unified-NUR2X5JV.js} +23 -21
- package/dist/{update-baselines-JYKUUIZG.js → update-baselines-TMERPIDV.js} +4 -2
- package/dist/version-FEHABGAH.js +10 -0
- package/dist/{visual-EUZG2STF.js → visual-XHFPFQFX.js} +5 -3
- package/dist/{workflow-template-6DADGPHA.js → workflow-template-7C5CCK67.js} +13 -7
- package/dist/{write-report-6RJWN54I.js → write-report-6Q4MXBYD.js} +5 -4
- package/package.json +21 -14
- package/dist/accessibility-JXRMWF5Y.js.map +0 -1
- package/dist/anthropic-api-ZR3UEB3Z.js.map +0 -1
- package/dist/assert-budget-NBF3JYM7.js +0 -9
- package/dist/assert-budget-NBF3JYM7.js.map +0 -1
- package/dist/caps-G3ZGJI7B.js.map +0 -1
- package/dist/chunk-7ZOFYET5.js.map +0 -1
- package/dist/chunk-CZKMOAXU.js.map +0 -1
- package/dist/chunk-EGANHIIE.js.map +0 -1
- package/dist/chunk-GV27IOMC.js.map +0 -1
- package/dist/chunk-GX36BPK7.js.map +0 -1
- package/dist/chunk-IXDUD2UG.js.map +0 -1
- package/dist/chunk-MMISGY2Q.js.map +0 -1
- package/dist/chunk-MYWWSM3V.js.map +0 -1
- package/dist/chunk-NG2IGCAK.js.map +0 -1
- package/dist/chunk-VEI2O6AK.js.map +0 -1
- package/dist/chunk-ZM6MGWO4.js.map +0 -1
- package/dist/ci-ISCWZJD3.js.map +0 -1
- package/dist/classifier-MWQMQ727.js.map +0 -1
- package/dist/claude-code-ZFTBQXY4.js.map +0 -1
- package/dist/claude-exploration-provider-QJH6IPYU.js.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/crawl-ZXZRF4Q7.js +0 -15
- package/dist/crawl-ZXZRF4Q7.js.map +0 -1
- package/dist/crawl-command-RDWGHZC4.js.map +0 -1
- package/dist/cross-reference-MHNPSLEN.js.map +0 -1
- package/dist/dev-server-detector-XQ5AYPDT.js.map +0 -1
- package/dist/discover-QKGMYPHK.js.map +0 -1
- package/dist/domain-UQ34YE4B.js.map +0 -1
- package/dist/edge-cases-ZADKDZHL.js.map +0 -1
- package/dist/element-extractor-OZTFBVKZ.js.map +0 -1
- package/dist/ensure-browsers-AYKMLUHV.js +0 -86
- package/dist/ensure-browsers-AYKMLUHV.js.map +0 -1
- package/dist/errors-RFEOR527.js +0 -7
- package/dist/errors-RFEOR527.js.map +0 -1
- package/dist/fix-R33D34NP.js.map +0 -1
- package/dist/flakiness-OLJAY7CS.js.map +0 -1
- package/dist/flakiness-OVC7KGN2.js +0 -11
- package/dist/flakiness-OVC7KGN2.js.map +0 -1
- package/dist/formatter-HC3LT3VH.js +0 -146
- package/dist/formatter-HC3LT3VH.js.map +0 -1
- package/dist/framework-detector-ISSM2Q2I.js.map +0 -1
- package/dist/generator-HIFV67NI.js +0 -7
- package/dist/generator-HIFV67NI.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/init-IQKT4ANC.js.map +0 -1
- package/dist/json-YDWEB33Q.js +0 -8
- package/dist/json-YDWEB33Q.js.map +0 -1
- package/dist/junit-GL44ATRR.js.map +0 -1
- package/dist/llm-VJAI6H6G.js.map +0 -1
- package/dist/loader-Z2DUGG5Z.js.map +0 -1
- package/dist/mcp/server.js.map +0 -1
- package/dist/model-SP6HJN6J.js.map +0 -1
- package/dist/page-hooks-6RALVZB5.js +0 -13
- package/dist/page-hooks-6RALVZB5.js.map +0 -1
- package/dist/page-state-extractor-GYYLYRFR.js.map +0 -1
- package/dist/performance-7HWKY5O2.js.map +0 -1
- package/dist/persistence-KTCRIGHU.js.map +0 -1
- package/dist/persistence-XLFJ5EY4.js.map +0 -1
- package/dist/prompt-builder-D3FBH534.js.map +0 -1
- package/dist/provider-BCKFVPTN.js.map +0 -1
- package/dist/quality-run-YAURB242.js.map +0 -1
- package/dist/redaction-CHAIVPCF.js.map +0 -1
- package/dist/registry-5XCXUAYJ.js.map +0 -1
- package/dist/repo-analyzer-4OURSITY.js.map +0 -1
- package/dist/report-7FQFH4HW.js.map +0 -1
- package/dist/report-SDZWX25B.js.map +0 -1
- package/dist/response-parser-PUGNWF7S.js.map +0 -1
- package/dist/route-discoverer-QBZCRQLJ.js.map +0 -1
- package/dist/runner-AXZXNWYH.js.map +0 -1
- package/dist/runner-QHSYX7J2.js.map +0 -1
- package/dist/runner-RDVVIGBU.js.map +0 -1
- package/dist/scenarios-I7YYVTD2.js.map +0 -1
- package/dist/source-5LS2B7TN.js.map +0 -1
- package/dist/tiebreak-L5UFNKU2.js.map +0 -1
- package/dist/unified-YSOTPG5B.js.map +0 -1
- package/dist/update-baselines-JYKUUIZG.js.map +0 -1
- package/dist/version-FLE7ZHDX.js +0 -7
- package/dist/version-FLE7ZHDX.js.map +0 -1
- package/dist/visual-EUZG2STF.js.map +0 -1
- package/dist/workflow-template-6DADGPHA.js.map +0 -1
- package/dist/write-report-6RJWN54I.js.map +0 -1
|
@@ -1,7 +1,15 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_out
|
|
4
|
+
} from "./chunk-YM22FEIA.js";
|
|
5
|
+
import {
|
|
6
|
+
__toESM
|
|
7
|
+
} from "./chunk-SOBWDC35.js";
|
|
8
|
+
|
|
1
9
|
// src/cli/commands/fix.ts
|
|
10
|
+
var import_fast_glob = __toESM(require_out(), 1);
|
|
2
11
|
import { readFile, writeFile } from "fs/promises";
|
|
3
12
|
import { relative } from "path";
|
|
4
|
-
import fg from "fast-glob";
|
|
5
13
|
var FIXABLE_RULES = [
|
|
6
14
|
{
|
|
7
15
|
id: "debug-debugger",
|
|
@@ -15,14 +23,14 @@ var FIXABLE_RULES = [
|
|
|
15
23
|
}
|
|
16
24
|
];
|
|
17
25
|
async function fixCommand(options) {
|
|
18
|
-
const pc = (await import("picocolors")).default;
|
|
26
|
+
const pc = (await import("./picocolors-3W2AX5TJ.js")).default;
|
|
19
27
|
if (!options.json) {
|
|
20
|
-
const { getVersion } = await import("./version-
|
|
28
|
+
const { getVersion } = await import("./version-FEHABGAH.js");
|
|
21
29
|
console.log(`
|
|
22
30
|
${pc.bold("sniff")} v${getVersion()} --fix
|
|
23
31
|
`);
|
|
24
32
|
}
|
|
25
|
-
const files = await
|
|
33
|
+
const files = await (0, import_fast_glob.default)(["**/*.{ts,tsx,js,jsx}"], {
|
|
26
34
|
cwd: options.rootDir,
|
|
27
35
|
ignore: [
|
|
28
36
|
"**/node_modules/**",
|
|
@@ -107,4 +115,3 @@ ${pc.bold("sniff")} v${getVersion()} --fix
|
|
|
107
115
|
export {
|
|
108
116
|
fixCommand
|
|
109
117
|
};
|
|
110
|
-
//# sourceMappingURL=fix-R33D34NP.js.map
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
1
2
|
import {
|
|
2
3
|
computeFlakeStatus
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-NBJLMLDA.js";
|
|
5
|
+
import "./chunk-SOBWDC35.js";
|
|
4
6
|
|
|
5
7
|
// src/discovery/report/flakiness.ts
|
|
6
8
|
function buildScenarioTestId(scenarioId, baseUrl) {
|
|
@@ -50,4 +52,3 @@ export {
|
|
|
50
52
|
markQuarantinedScenarios,
|
|
51
53
|
shouldFailCi
|
|
52
54
|
};
|
|
53
|
-
//# sourceMappingURL=flakiness-OLJAY7CS.js.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
buildTestId,
|
|
4
|
+
buildTestRunRecords,
|
|
5
|
+
computeFlakeStatus
|
|
6
|
+
} from "./chunk-NBJLMLDA.js";
|
|
7
|
+
import "./chunk-SOBWDC35.js";
|
|
8
|
+
export {
|
|
9
|
+
buildTestId,
|
|
10
|
+
buildTestRunRecords,
|
|
11
|
+
computeFlakeStatus
|
|
12
|
+
};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_picocolors
|
|
4
|
+
} from "./chunk-HP4TY3UY.js";
|
|
5
|
+
import {
|
|
6
|
+
__toESM
|
|
7
|
+
} from "./chunk-SOBWDC35.js";
|
|
8
|
+
|
|
9
|
+
// src/cli/formatter.ts
|
|
10
|
+
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
11
|
+
var SEVERITY_ORDER = ["critical", "high", "medium", "low", "info"];
|
|
12
|
+
var severityColors = {
|
|
13
|
+
critical: import_picocolors.default.red,
|
|
14
|
+
high: import_picocolors.default.red,
|
|
15
|
+
medium: import_picocolors.default.yellow,
|
|
16
|
+
low: import_picocolors.default.cyan,
|
|
17
|
+
info: import_picocolors.default.gray
|
|
18
|
+
};
|
|
19
|
+
var severityIcons = {
|
|
20
|
+
critical: "X",
|
|
21
|
+
high: "!",
|
|
22
|
+
medium: "~",
|
|
23
|
+
low: "-",
|
|
24
|
+
info: "i"
|
|
25
|
+
};
|
|
26
|
+
function groupBySeverity(findings) {
|
|
27
|
+
const groups = {
|
|
28
|
+
critical: [],
|
|
29
|
+
high: [],
|
|
30
|
+
medium: [],
|
|
31
|
+
low: [],
|
|
32
|
+
info: []
|
|
33
|
+
};
|
|
34
|
+
for (const finding of findings) {
|
|
35
|
+
groups[finding.severity].push(finding);
|
|
36
|
+
}
|
|
37
|
+
return groups;
|
|
38
|
+
}
|
|
39
|
+
var FAILING = ["critical", "high"];
|
|
40
|
+
function verdictHeader(findings) {
|
|
41
|
+
if (findings.length === 0) {
|
|
42
|
+
return [`${import_picocolors.default.bold("VERDICT")} ${import_picocolors.default.green("PASS")}: no issues found`];
|
|
43
|
+
}
|
|
44
|
+
const groups = groupBySeverity(findings);
|
|
45
|
+
const counts = SEVERITY_ORDER.filter((sev) => groups[sev].length > 0).map((sev) => `${groups[sev].length} ${sev}`).join(", ");
|
|
46
|
+
const failing = findings.some((f) => FAILING.includes(f.severity));
|
|
47
|
+
const word = failing ? import_picocolors.default.red("FAIL") : import_picocolors.default.green("PASS");
|
|
48
|
+
const gate = failing ? "" : ", none at a failing severity";
|
|
49
|
+
const lines = [
|
|
50
|
+
`${import_picocolors.default.bold("VERDICT")} ${word}: ${findings.length} issue${findings.length === 1 ? "" : "s"} (${counts})${gate}`,
|
|
51
|
+
""
|
|
52
|
+
];
|
|
53
|
+
const first = [...findings].sort((a, b) => SEVERITY_ORDER.indexOf(a.severity) - SEVERITY_ORDER.indexOf(b.severity)).slice(0, 3);
|
|
54
|
+
lines.push(first.length === findings.length ? "Fix these:" : "Fix these first:");
|
|
55
|
+
first.forEach((f, i) => {
|
|
56
|
+
const where = isBrowserFinding(f) ? f.url : `${f.filePath}:${f.line}`;
|
|
57
|
+
lines.push(` ${i + 1}. ${f.message} in ${where} [${f.severity}]`);
|
|
58
|
+
});
|
|
59
|
+
return lines;
|
|
60
|
+
}
|
|
61
|
+
function formatFindings(findings) {
|
|
62
|
+
if (findings.length === 0) {
|
|
63
|
+
return verdictHeader(findings).join("\n");
|
|
64
|
+
}
|
|
65
|
+
const lines = verdictHeader(findings);
|
|
66
|
+
const groups = groupBySeverity(findings);
|
|
67
|
+
for (const severity of SEVERITY_ORDER) {
|
|
68
|
+
const group = groups[severity];
|
|
69
|
+
if (group.length === 0) continue;
|
|
70
|
+
const color = severityColors[severity];
|
|
71
|
+
const icon = severityIcons[severity];
|
|
72
|
+
lines.push("");
|
|
73
|
+
lines.push(color(`${icon} ${severity.toUpperCase()} (${group.length})`));
|
|
74
|
+
for (const finding of group) {
|
|
75
|
+
lines.push(
|
|
76
|
+
` ${import_picocolors.default.dim(finding.filePath)}:${import_picocolors.default.yellow(String(finding.line))} ${finding.message}`
|
|
77
|
+
);
|
|
78
|
+
lines.push(` ${import_picocolors.default.dim(finding.snippet)}`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
const parts = [];
|
|
82
|
+
for (const severity of SEVERITY_ORDER) {
|
|
83
|
+
const count = groups[severity].length;
|
|
84
|
+
if (count > 0) {
|
|
85
|
+
parts.push(severityColors[severity](`${count} ${severity}`));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
lines.push("");
|
|
89
|
+
lines.push(`Found ${import_picocolors.default.bold(String(findings.length))} issues: ${parts.join(", ")}`);
|
|
90
|
+
return lines.join("\n");
|
|
91
|
+
}
|
|
92
|
+
var SCANNER_DISPLAY_NAMES = {
|
|
93
|
+
"e2e/": "Browser Tests",
|
|
94
|
+
"a11y/": "Accessibility",
|
|
95
|
+
"visual/": "Visual Regression",
|
|
96
|
+
"perf/": "Performance",
|
|
97
|
+
"source/": "Source Code"
|
|
98
|
+
};
|
|
99
|
+
function getScannerPrefix(ruleId) {
|
|
100
|
+
for (const prefix of Object.keys(SCANNER_DISPLAY_NAMES)) {
|
|
101
|
+
if (ruleId.startsWith(prefix)) {
|
|
102
|
+
return prefix;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
return "other/";
|
|
106
|
+
}
|
|
107
|
+
function isBrowserFinding(finding) {
|
|
108
|
+
return "url" in finding && "viewport" in finding;
|
|
109
|
+
}
|
|
110
|
+
function formatBrowserFindings(findings) {
|
|
111
|
+
if (findings.length === 0) {
|
|
112
|
+
return verdictHeader(findings).join("\n");
|
|
113
|
+
}
|
|
114
|
+
const lines = verdictHeader(findings);
|
|
115
|
+
const scannerGroups = /* @__PURE__ */ new Map();
|
|
116
|
+
for (const finding of findings) {
|
|
117
|
+
const prefix = getScannerPrefix(finding.ruleId);
|
|
118
|
+
if (!scannerGroups.has(prefix)) {
|
|
119
|
+
scannerGroups.set(prefix, []);
|
|
120
|
+
}
|
|
121
|
+
scannerGroups.get(prefix).push(finding);
|
|
122
|
+
}
|
|
123
|
+
let scannerCount = 0;
|
|
124
|
+
for (const [prefix, groupFindings] of scannerGroups) {
|
|
125
|
+
scannerCount++;
|
|
126
|
+
const displayName = SCANNER_DISPLAY_NAMES[prefix] ?? prefix.replace("/", "");
|
|
127
|
+
lines.push("");
|
|
128
|
+
lines.push(import_picocolors.default.blue(import_picocolors.default.bold(`[${displayName}]`)));
|
|
129
|
+
const sorted = [...groupFindings].sort(
|
|
130
|
+
(a, b) => SEVERITY_ORDER.indexOf(a.severity) - SEVERITY_ORDER.indexOf(b.severity)
|
|
131
|
+
);
|
|
132
|
+
for (const finding of sorted) {
|
|
133
|
+
const color = severityColors[finding.severity];
|
|
134
|
+
const icon = severityIcons[finding.severity];
|
|
135
|
+
const vpLabel = isBrowserFinding(finding) ? ` ${import_picocolors.default.magenta(`[${finding.viewport}]`)}` : "";
|
|
136
|
+
lines.push(
|
|
137
|
+
` ${color(`${icon}`)} ${color(finding.severity.toUpperCase())}${vpLabel} ${finding.message}`
|
|
138
|
+
);
|
|
139
|
+
lines.push(
|
|
140
|
+
` ${import_picocolors.default.dim(finding.filePath)}:${import_picocolors.default.yellow(String(finding.line))}`
|
|
141
|
+
);
|
|
142
|
+
if (finding.snippet) {
|
|
143
|
+
lines.push(` ${import_picocolors.default.dim(finding.snippet)}`);
|
|
144
|
+
}
|
|
145
|
+
if (isBrowserFinding(finding) && finding.screenshotPath) {
|
|
146
|
+
lines.push(` ${import_picocolors.default.dim(import_picocolors.default.underline(finding.screenshotPath))}`);
|
|
147
|
+
}
|
|
148
|
+
if (isBrowserFinding(finding) && finding.fixSuggestion) {
|
|
149
|
+
lines.push(` ${import_picocolors.default.green("Fix:")} ${finding.fixSuggestion}`);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const parts = [];
|
|
154
|
+
const groups = groupBySeverity(findings);
|
|
155
|
+
for (const severity of SEVERITY_ORDER) {
|
|
156
|
+
const count = groups[severity].length;
|
|
157
|
+
if (count > 0) {
|
|
158
|
+
parts.push(severityColors[severity](`${count} ${severity}`));
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
lines.push("");
|
|
162
|
+
lines.push(
|
|
163
|
+
`Found ${import_picocolors.default.bold(String(findings.length))} issues across ${scannerCount} scanners: ${parts.join(", ")}`
|
|
164
|
+
);
|
|
165
|
+
return lines.join("\n");
|
|
166
|
+
}
|
|
167
|
+
function formatProgress(viewport, url, findingCount) {
|
|
168
|
+
const suffix = findingCount === 0 ? import_picocolors.default.green("0 findings") : import_picocolors.default.yellow(`${findingCount} finding${findingCount !== 1 ? "s" : ""}`);
|
|
169
|
+
return ` ${import_picocolors.default.dim(`[${viewport}]`)} ${import_picocolors.default.dim(url)}... done (${suffix})`;
|
|
170
|
+
}
|
|
171
|
+
export {
|
|
172
|
+
formatBrowserFindings,
|
|
173
|
+
formatFindings,
|
|
174
|
+
formatProgress,
|
|
175
|
+
verdictHeader
|
|
176
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import "./chunk-SOBWDC35.js";
|
|
3
|
+
|
|
1
4
|
// src/analyzers/framework-detector.ts
|
|
2
5
|
import { readFile, access } from "fs/promises";
|
|
3
6
|
import { join } from "path";
|
|
@@ -92,4 +95,3 @@ async function detectFrameworks(rootDir) {
|
|
|
92
95
|
export {
|
|
93
96
|
detectFrameworks
|
|
94
97
|
};
|
|
95
|
-
//# sourceMappingURL=framework-detector-ISSM2Q2I.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -350,12 +350,22 @@ declare function renderHtmlReport(report: CrawlReport, opts?: {
|
|
|
350
350
|
title?: string;
|
|
351
351
|
}): string;
|
|
352
352
|
|
|
353
|
+
interface ReportTextOptions {
|
|
354
|
+
/** Show `uncertain` findings too. */
|
|
355
|
+
all?: boolean;
|
|
356
|
+
/**
|
|
357
|
+
* The real exit decision, when the caller has it (`--fail-on` plus the
|
|
358
|
+
* assert budget). Left out, the verdict fails on a critical or high finding.
|
|
359
|
+
*/
|
|
360
|
+
failed?: boolean;
|
|
361
|
+
/** Screenshot paths under this folder print relative to it. */
|
|
362
|
+
cwd?: string;
|
|
363
|
+
}
|
|
353
364
|
/**
|
|
354
|
-
* Render a CrawlReport
|
|
355
|
-
* findings
|
|
365
|
+
* Render a CrawlReport for the terminal. The order is fixed: the verdict, the
|
|
366
|
+
* findings to fix first, then every finding by severity. By default
|
|
367
|
+
* `uncertain` findings are hidden (shown with `all: true`).
|
|
356
368
|
*/
|
|
357
|
-
declare function formatReportText(report: CrawlReport, opts?:
|
|
358
|
-
all?: boolean;
|
|
359
|
-
}): string;
|
|
369
|
+
declare function formatReportText(report: CrawlReport, opts?: ReportTextOptions): string;
|
|
360
370
|
|
|
361
371
|
export { type AIProvider, type AnalysisResult, type ComponentInfo, type Confidence, type CrawlOptions, type CrawlReport, type ElementInfo, type Finding, type FrameworkInfo, type GeneratedTest, type QaFinding, type Reproduction, type RouteInfo, type RouteTestContext, type Severity, type SniffConfig, type SniffUserConfig, defineConfig, formatReportText, generateTests, renderHtmlReport, runCrawl };
|
package/dist/index.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
1
2
|
import {
|
|
2
3
|
generateTests
|
|
3
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-US4HFUCH.js";
|
|
4
5
|
import {
|
|
5
6
|
formatReportText,
|
|
6
7
|
runCrawl
|
|
7
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-3E4W4H6S.js";
|
|
8
9
|
import {
|
|
9
10
|
renderHtmlReport
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-3NR2K5B3.js";
|
|
12
|
+
import "./chunk-DZMX3VT2.js";
|
|
13
|
+
import "./chunk-RSGFFRXQ.js";
|
|
14
|
+
import "./chunk-33JL2AB5.js";
|
|
15
|
+
import "./chunk-AA744N7E.js";
|
|
16
|
+
import "./chunk-SOBWDC35.js";
|
|
13
17
|
|
|
14
18
|
// src/config/define-config.ts
|
|
15
19
|
function defineConfig(config) {
|
|
@@ -22,4 +26,3 @@ export {
|
|
|
22
26
|
renderHtmlReport,
|
|
23
27
|
runCrawl
|
|
24
28
|
};
|
|
25
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import "./chunk-SOBWDC35.js";
|
|
3
|
+
|
|
1
4
|
// src/cli/commands/init.ts
|
|
2
5
|
import { writeFile, readFile, access } from "fs/promises";
|
|
3
6
|
import { join } from "path";
|
|
@@ -89,7 +92,7 @@ function filenameFor(flavor) {
|
|
|
89
92
|
}
|
|
90
93
|
}
|
|
91
94
|
async function initCommand(options) {
|
|
92
|
-
const { cosmiconfig } = await import("
|
|
95
|
+
const { cosmiconfig } = await import("./dist-3CYER35S.js");
|
|
93
96
|
const cwd = process.cwd();
|
|
94
97
|
const explorer = cosmiconfig("sniff", {
|
|
95
98
|
searchPlaces: [
|
|
@@ -145,4 +148,3 @@ export {
|
|
|
145
148
|
detectInitFlavor,
|
|
146
149
|
initCommand
|
|
147
150
|
};
|
|
148
|
-
//# sourceMappingURL=init-IQKT4ANC.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import "./chunk-SOBWDC35.js";
|
|
3
|
+
|
|
4
|
+
// src/report/json.ts
|
|
5
|
+
function generateJsonReport(report) {
|
|
6
|
+
return JSON.stringify(report, null, 2);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
generateJsonReport
|
|
10
|
+
};
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import "./chunk-SOBWDC35.js";
|
|
3
|
+
|
|
1
4
|
// src/report/junit.ts
|
|
2
5
|
function xmlEscape(s) {
|
|
3
6
|
return s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
@@ -49,4 +52,3 @@ function generateJunitReport(report) {
|
|
|
49
52
|
export {
|
|
50
53
|
generateJunitReport
|
|
51
54
|
};
|
|
52
|
-
//# sourceMappingURL=junit-GL44ATRR.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import "./chunk-SOBWDC35.js";
|
|
3
|
+
|
|
1
4
|
// src/discovery/llm/cache.ts
|
|
2
5
|
import { createHash } from "crypto";
|
|
3
6
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
@@ -123,4 +126,3 @@ export {
|
|
|
123
126
|
resolveDiscoveryLLM,
|
|
124
127
|
writeLlmCache
|
|
125
128
|
};
|
|
126
|
-
//# sourceMappingURL=llm-VJAI6H6G.js.map
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import { createRequire as __sniffCreateRequire } from 'node:module'; const require = __sniffCreateRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
require_dist
|
|
4
|
+
} from "./chunk-LZAPYYNR.js";
|
|
5
|
+
import "./chunk-3ROWRVZE.js";
|
|
6
|
+
import "./chunk-HP4TY3UY.js";
|
|
7
|
+
import {
|
|
8
|
+
__toESM
|
|
9
|
+
} from "./chunk-SOBWDC35.js";
|
|
10
|
+
|
|
1
11
|
// src/config/loader.ts
|
|
2
|
-
|
|
12
|
+
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
3
13
|
|
|
4
14
|
// src/config/schema.ts
|
|
5
15
|
import { z } from "zod";
|
|
@@ -164,7 +174,7 @@ var sniffConfigSchema = z.object({
|
|
|
164
174
|
|
|
165
175
|
// src/config/loader.ts
|
|
166
176
|
async function loadConfig(searchFrom) {
|
|
167
|
-
const explorer = cosmiconfig("sniff", {
|
|
177
|
+
const explorer = (0, import_cosmiconfig.cosmiconfig)("sniff", {
|
|
168
178
|
searchPlaces: [
|
|
169
179
|
"package.json",
|
|
170
180
|
".sniffrc",
|
|
@@ -195,4 +205,3 @@ ${formatted}`);
|
|
|
195
205
|
export {
|
|
196
206
|
loadConfig
|
|
197
207
|
};
|
|
198
|
-
//# sourceMappingURL=loader-Z2DUGG5Z.js.map
|