perfgraph 0.1.0
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/LICENSE +21 -0
- package/README.md +280 -0
- package/dist/causal/builder.d.ts +34 -0
- package/dist/causal/builder.d.ts.map +1 -0
- package/dist/causal/builder.js +132 -0
- package/dist/causal/builder.js.map +1 -0
- package/dist/causal/index.d.ts +11 -0
- package/dist/causal/index.d.ts.map +1 -0
- package/dist/causal/index.js +10 -0
- package/dist/causal/index.js.map +1 -0
- package/dist/causal/rules/js.d.ts +49 -0
- package/dist/causal/rules/js.d.ts.map +1 -0
- package/dist/causal/rules/js.js +209 -0
- package/dist/causal/rules/js.js.map +1 -0
- package/dist/causal/rules/layout.d.ts +39 -0
- package/dist/causal/rules/layout.d.ts.map +1 -0
- package/dist/causal/rules/layout.js +169 -0
- package/dist/causal/rules/layout.js.map +1 -0
- package/dist/causal/rules/lcp.d.ts +49 -0
- package/dist/causal/rules/lcp.d.ts.map +1 -0
- package/dist/causal/rules/lcp.js +250 -0
- package/dist/causal/rules/lcp.js.map +1 -0
- package/dist/causal/rules/network.d.ts +39 -0
- package/dist/causal/rules/network.d.ts.map +1 -0
- package/dist/causal/rules/network.js +140 -0
- package/dist/causal/rules/network.js.map +1 -0
- package/dist/causal/types.d.ts +142 -0
- package/dist/causal/types.d.ts.map +1 -0
- package/dist/causal/types.js +88 -0
- package/dist/causal/types.js.map +1 -0
- package/dist/cli/analyze.d.ts +33 -0
- package/dist/cli/analyze.d.ts.map +1 -0
- package/dist/cli/analyze.js +137 -0
- package/dist/cli/analyze.js.map +1 -0
- package/dist/cli/collect.d.ts +28 -0
- package/dist/cli/collect.d.ts.map +1 -0
- package/dist/cli/collect.js +125 -0
- package/dist/cli/collect.js.map +1 -0
- package/dist/cli/extract.d.ts +31 -0
- package/dist/cli/extract.d.ts.map +1 -0
- package/dist/cli/extract.js +135 -0
- package/dist/cli/extract.js.map +1 -0
- package/dist/cli/mcp.d.ts +14 -0
- package/dist/cli/mcp.d.ts.map +1 -0
- package/dist/cli/mcp.js +53 -0
- package/dist/cli/mcp.js.map +1 -0
- package/dist/cli/normalize.d.ts +58 -0
- package/dist/cli/normalize.d.ts.map +1 -0
- package/dist/cli/normalize.js +179 -0
- package/dist/cli/normalize.js.map +1 -0
- package/dist/cli/report.d.ts +33 -0
- package/dist/cli/report.d.ts.map +1 -0
- package/dist/cli/report.js +137 -0
- package/dist/cli/report.js.map +1 -0
- package/dist/cli/run.d.ts +49 -0
- package/dist/cli/run.d.ts.map +1 -0
- package/dist/cli/run.js +243 -0
- package/dist/cli/run.js.map +1 -0
- package/dist/collect/buffer-monitor.d.ts +25 -0
- package/dist/collect/buffer-monitor.d.ts.map +1 -0
- package/dist/collect/buffer-monitor.js +69 -0
- package/dist/collect/buffer-monitor.js.map +1 -0
- package/dist/collect/console.d.ts +25 -0
- package/dist/collect/console.d.ts.map +1 -0
- package/dist/collect/console.js +82 -0
- package/dist/collect/console.js.map +1 -0
- package/dist/collect/coverage.d.ts +26 -0
- package/dist/collect/coverage.d.ts.map +1 -0
- package/dist/collect/coverage.js +99 -0
- package/dist/collect/coverage.js.map +1 -0
- package/dist/collect/dom.d.ts +37 -0
- package/dist/collect/dom.d.ts.map +1 -0
- package/dist/collect/dom.js +118 -0
- package/dist/collect/dom.js.map +1 -0
- package/dist/collect/lighthouse.d.ts +41 -0
- package/dist/collect/lighthouse.d.ts.map +1 -0
- package/dist/collect/lighthouse.js +111 -0
- package/dist/collect/lighthouse.js.map +1 -0
- package/dist/collect/network.d.ts +32 -0
- package/dist/collect/network.d.ts.map +1 -0
- package/dist/collect/network.js +236 -0
- package/dist/collect/network.js.map +1 -0
- package/dist/collect/orchestrator.d.ts +23 -0
- package/dist/collect/orchestrator.d.ts.map +1 -0
- package/dist/collect/orchestrator.js +350 -0
- package/dist/collect/orchestrator.js.map +1 -0
- package/dist/collect/performance.d.ts +28 -0
- package/dist/collect/performance.d.ts.map +1 -0
- package/dist/collect/performance.js +108 -0
- package/dist/collect/performance.js.map +1 -0
- package/dist/collect/runtime.d.ts +26 -0
- package/dist/collect/runtime.d.ts.map +1 -0
- package/dist/collect/runtime.js +81 -0
- package/dist/collect/runtime.js.map +1 -0
- package/dist/collect/session.d.ts +58 -0
- package/dist/collect/session.d.ts.map +1 -0
- package/dist/collect/session.js +162 -0
- package/dist/collect/session.js.map +1 -0
- package/dist/collect/trace.d.ts +40 -0
- package/dist/collect/trace.d.ts.map +1 -0
- package/dist/collect/trace.js +127 -0
- package/dist/collect/trace.js.map +1 -0
- package/dist/collect/types.d.ts +317 -0
- package/dist/collect/types.d.ts.map +1 -0
- package/dist/collect/types.js +12 -0
- package/dist/collect/types.js.map +1 -0
- package/dist/distill/insights.d.ts +67 -0
- package/dist/distill/insights.d.ts.map +1 -0
- package/dist/distill/insights.js +317 -0
- package/dist/distill/insights.js.map +1 -0
- package/dist/distill/summaries.d.ts +71 -0
- package/dist/distill/summaries.d.ts.map +1 -0
- package/dist/distill/summaries.js +165 -0
- package/dist/distill/summaries.js.map +1 -0
- package/dist/extract/critical-path.d.ts +17 -0
- package/dist/extract/critical-path.d.ts.map +1 -0
- package/dist/extract/critical-path.js +95 -0
- package/dist/extract/critical-path.js.map +1 -0
- package/dist/extract/index.d.ts +16 -0
- package/dist/extract/index.d.ts.map +1 -0
- package/dist/extract/index.js +32 -0
- package/dist/extract/index.js.map +1 -0
- package/dist/extract/js-hotspots.d.ts +15 -0
- package/dist/extract/js-hotspots.d.ts.map +1 -0
- package/dist/extract/js-hotspots.js +22 -0
- package/dist/extract/js-hotspots.js.map +1 -0
- package/dist/extract/layout-shifts.d.ts +19 -0
- package/dist/extract/layout-shifts.d.ts.map +1 -0
- package/dist/extract/layout-shifts.js +47 -0
- package/dist/extract/layout-shifts.js.map +1 -0
- package/dist/extract/lcp-breakdown.d.ts +19 -0
- package/dist/extract/lcp-breakdown.d.ts.map +1 -0
- package/dist/extract/lcp-breakdown.js +110 -0
- package/dist/extract/lcp-breakdown.js.map +1 -0
- package/dist/extract/main-thread.d.ts +16 -0
- package/dist/extract/main-thread.d.ts.map +1 -0
- package/dist/extract/main-thread.js +41 -0
- package/dist/extract/main-thread.js.map +1 -0
- package/dist/extract/render-blocking.d.ts +16 -0
- package/dist/extract/render-blocking.d.ts.map +1 -0
- package/dist/extract/render-blocking.js +79 -0
- package/dist/extract/render-blocking.js.map +1 -0
- package/dist/extract/third-party.d.ts +15 -0
- package/dist/extract/third-party.d.ts.map +1 -0
- package/dist/extract/third-party.js +127 -0
- package/dist/extract/third-party.js.map +1 -0
- package/dist/extract/types.d.ts +183 -0
- package/dist/extract/types.d.ts.map +1 -0
- package/dist/extract/types.js +118 -0
- package/dist/extract/types.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +188 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/handlers.d.ts +72 -0
- package/dist/mcp/handlers.d.ts.map +1 -0
- package/dist/mcp/handlers.js +285 -0
- package/dist/mcp/handlers.js.map +1 -0
- package/dist/mcp/progress.d.ts +37 -0
- package/dist/mcp/progress.d.ts.map +1 -0
- package/dist/mcp/progress.js +51 -0
- package/dist/mcp/progress.js.map +1 -0
- package/dist/mcp/prompts.d.ts +57 -0
- package/dist/mcp/prompts.d.ts.map +1 -0
- package/dist/mcp/prompts.js +225 -0
- package/dist/mcp/prompts.js.map +1 -0
- package/dist/mcp/resources.d.ts +48 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +149 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/server.d.ts +34 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +452 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/types.d.ts +47 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +67 -0
- package/dist/mcp/types.js.map +1 -0
- package/dist/normalize/clock.d.ts +40 -0
- package/dist/normalize/clock.d.ts.map +1 -0
- package/dist/normalize/clock.js +96 -0
- package/dist/normalize/clock.js.map +1 -0
- package/dist/normalize/dom-ir.d.ts +16 -0
- package/dist/normalize/dom-ir.d.ts.map +1 -0
- package/dist/normalize/dom-ir.js +48 -0
- package/dist/normalize/dom-ir.js.map +1 -0
- package/dist/normalize/index.d.ts +23 -0
- package/dist/normalize/index.d.ts.map +1 -0
- package/dist/normalize/index.js +118 -0
- package/dist/normalize/index.js.map +1 -0
- package/dist/normalize/lighthouse-insights.d.ts +27 -0
- package/dist/normalize/lighthouse-insights.d.ts.map +1 -0
- package/dist/normalize/lighthouse-insights.js +318 -0
- package/dist/normalize/lighthouse-insights.js.map +1 -0
- package/dist/normalize/lighthouse-ir.d.ts +25 -0
- package/dist/normalize/lighthouse-ir.d.ts.map +1 -0
- package/dist/normalize/lighthouse-ir.js +151 -0
- package/dist/normalize/lighthouse-ir.js.map +1 -0
- package/dist/normalize/network-ir.d.ts +23 -0
- package/dist/normalize/network-ir.d.ts.map +1 -0
- package/dist/normalize/network-ir.js +180 -0
- package/dist/normalize/network-ir.js.map +1 -0
- package/dist/normalize/runtime-ir.d.ts +18 -0
- package/dist/normalize/runtime-ir.d.ts.map +1 -0
- package/dist/normalize/runtime-ir.js +114 -0
- package/dist/normalize/runtime-ir.js.map +1 -0
- package/dist/normalize/trace-ir.d.ts +20 -0
- package/dist/normalize/trace-ir.d.ts.map +1 -0
- package/dist/normalize/trace-ir.js +224 -0
- package/dist/normalize/trace-ir.js.map +1 -0
- package/dist/normalize/types.d.ts +536 -0
- package/dist/normalize/types.d.ts.map +1 -0
- package/dist/normalize/types.js +242 -0
- package/dist/normalize/types.js.map +1 -0
- package/dist/output/manifest.d.ts +44 -0
- package/dist/output/manifest.d.ts.map +1 -0
- package/dist/output/manifest.js +232 -0
- package/dist/output/manifest.js.map +1 -0
- package/dist/output/toon.d.ts +19 -0
- package/dist/output/toon.d.ts.map +1 -0
- package/dist/output/toon.js +22 -0
- package/dist/output/toon.js.map +1 -0
- package/dist/output/writer.d.ts +31 -0
- package/dist/output/writer.d.ts.map +1 -0
- package/dist/output/writer.js +51 -0
- package/dist/output/writer.js.map +1 -0
- package/dist/report/analyzer.d.ts +29 -0
- package/dist/report/analyzer.d.ts.map +1 -0
- package/dist/report/analyzer.js +330 -0
- package/dist/report/analyzer.js.map +1 -0
- package/dist/report/index.d.ts +13 -0
- package/dist/report/index.d.ts.map +1 -0
- package/dist/report/index.js +12 -0
- package/dist/report/index.js.map +1 -0
- package/dist/report/markdown.d.ts +21 -0
- package/dist/report/markdown.d.ts.map +1 -0
- package/dist/report/markdown.js +182 -0
- package/dist/report/markdown.js.map +1 -0
- package/dist/report/remediations.d.ts +42 -0
- package/dist/report/remediations.d.ts.map +1 -0
- package/dist/report/remediations.js +179 -0
- package/dist/report/remediations.js.map +1 -0
- package/dist/report/scorer.d.ts +35 -0
- package/dist/report/scorer.d.ts.map +1 -0
- package/dist/report/scorer.js +72 -0
- package/dist/report/scorer.js.map +1 -0
- package/dist/report/types.d.ts +201 -0
- package/dist/report/types.d.ts.map +1 -0
- package/dist/report/types.js +149 -0
- package/dist/report/types.js.map +1 -0
- package/dist/shared/fs-utils.d.ts +12 -0
- package/dist/shared/fs-utils.d.ts.map +1 -0
- package/dist/shared/fs-utils.js +44 -0
- package/dist/shared/fs-utils.js.map +1 -0
- package/dist/shared/types.d.ts +69 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +18 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/shared/utils.d.ts +6 -0
- package/dist/shared/utils.d.ts.map +1 -0
- package/dist/shared/utils.js +9 -0
- package/dist/shared/utils.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output writer — creates timestamped directories and writes JSON data.
|
|
3
|
+
*/
|
|
4
|
+
import { mkdir, writeFile } from 'node:fs/promises';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
/**
|
|
7
|
+
* Create a timestamped output directory under the given base path.
|
|
8
|
+
*
|
|
9
|
+
* Directory format: `perfgraph_<hostname>_<YYYYMMDD_HHmmss>`
|
|
10
|
+
*
|
|
11
|
+
* @param basePath - Base directory for output
|
|
12
|
+
* @param url - Source URL (used to extract hostname for directory naming)
|
|
13
|
+
* @returns Absolute path to the created directory
|
|
14
|
+
*/
|
|
15
|
+
export async function createOutputDir(basePath, url) {
|
|
16
|
+
const hostname = new URL(url).hostname.replace(/[^a-zA-Z0-9.-]/g, '_');
|
|
17
|
+
const now = new Date();
|
|
18
|
+
const pad = (n) => String(n).padStart(2, '0');
|
|
19
|
+
const timestamp = `${now.getFullYear()}${pad(now.getMonth() + 1)}${pad(now.getDate())}_${pad(now.getHours())}${pad(now.getMinutes())}${pad(now.getSeconds())}`;
|
|
20
|
+
const dirName = `perfgraph_${hostname}_${timestamp}`;
|
|
21
|
+
const dirPath = join(basePath, dirName);
|
|
22
|
+
await mkdir(dirPath, { recursive: true });
|
|
23
|
+
return dirPath;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Write a JSON-serializable value to a file inside the given directory.
|
|
27
|
+
*
|
|
28
|
+
* @param dir - Target directory
|
|
29
|
+
* @param filename - File name (e.g. "trace.json")
|
|
30
|
+
* @param data - Data to serialize as JSON
|
|
31
|
+
* @returns Full path to the written file
|
|
32
|
+
*/
|
|
33
|
+
export async function writeJsonFile(dir, filename, data) {
|
|
34
|
+
const filePath = join(dir, filename);
|
|
35
|
+
await writeFile(filePath, JSON.stringify(data, null, 2), 'utf-8');
|
|
36
|
+
return filePath;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Write a warnings file to the given directory.
|
|
40
|
+
*
|
|
41
|
+
* @param dir - Target directory
|
|
42
|
+
* @param warnings - Array of warning strings
|
|
43
|
+
* @returns Full path to the written file
|
|
44
|
+
*/
|
|
45
|
+
export async function writeWarnings(dir, warnings) {
|
|
46
|
+
return writeJsonFile(dir, 'warnings.json', {
|
|
47
|
+
warnings,
|
|
48
|
+
timestamp: new Date().toISOString(),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=writer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../../src/output/writer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,QAAgB,EAAE,GAAW;IACjE,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC;IACvE,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC;IACvB,MAAM,GAAG,GAAG,CAAC,CAAS,EAAU,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,GAAG,GAAG,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;IAC/J,MAAM,OAAO,GAAG,aAAa,QAAQ,IAAI,SAAS,EAAE,CAAC;IACrD,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IACxC,MAAM,KAAK,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1C,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAW,EAAE,QAAgB,EAAE,IAAa;IAC9E,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IACrC,MAAM,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;IAClE,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,GAAW,EAAE,QAAkB;IACjE,OAAO,aAAa,CAAC,GAAG,EAAE,eAAe,EAAE;QACzC,QAAQ;QACR,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;KACpC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Report Analyzer — core logic for Phase 5.
|
|
3
|
+
*
|
|
4
|
+
* Takes CausalGraph + FeatureSet and produces a comprehensive Report:
|
|
5
|
+
* - Extracts causal chains (root cause → intermediate → impact)
|
|
6
|
+
* - Builds flat issue list with remediation texts
|
|
7
|
+
* - Computes overall score
|
|
8
|
+
* - Generates prioritized recommendations
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
import type { CausalGraph } from '../causal/types.js';
|
|
13
|
+
import type { FeatureSet } from '../extract/types.js';
|
|
14
|
+
import type { Report } from './types.js';
|
|
15
|
+
/**
|
|
16
|
+
* Build a comprehensive Report from a CausalGraph and FeatureSet.
|
|
17
|
+
*
|
|
18
|
+
* Pure function: same inputs → same Report.
|
|
19
|
+
*
|
|
20
|
+
* @param graph - The CausalGraph from Phase 4
|
|
21
|
+
* @param features - The FeatureSet from Phase 3 (optional — included in report as-is)
|
|
22
|
+
* @returns A fully populated Report
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildReport(graph: CausalGraph, features?: FeatureSet, lighthousePerformance?: number): Report;
|
|
25
|
+
/**
|
|
26
|
+
* Check whether a report has actionable issues.
|
|
27
|
+
*/
|
|
28
|
+
export declare function hasActionableIssues(report: Report): boolean;
|
|
29
|
+
//# sourceMappingURL=analyzer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../../src/report/analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,WAAW,EAA0B,MAAM,oBAAoB,CAAC;AAC9E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EACV,MAAM,EAOP,MAAM,YAAY,CAAC;AAsHpB;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,WAAW,EAClB,QAAQ,CAAC,EAAE,UAAU,EACrB,qBAAqB,CAAC,EAAE,MAAM,GAC7B,MAAM,CAyOR;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE3D"}
|
|
@@ -0,0 +1,330 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Report Analyzer — core logic for Phase 5.
|
|
3
|
+
*
|
|
4
|
+
* Takes CausalGraph + FeatureSet and produces a comprehensive Report:
|
|
5
|
+
* - Extracts causal chains (root cause → intermediate → impact)
|
|
6
|
+
* - Builds flat issue list with remediation texts
|
|
7
|
+
* - Computes overall score
|
|
8
|
+
* - Generates prioritized recommendations
|
|
9
|
+
*
|
|
10
|
+
* @packageDocumentation
|
|
11
|
+
*/
|
|
12
|
+
import { Graph, alg } from '@dagrejs/graphlib';
|
|
13
|
+
import { ReportSchema } from './types.js';
|
|
14
|
+
import { computeScore } from './scorer.js';
|
|
15
|
+
import { getRemediation } from './remediations.js';
|
|
16
|
+
// ---------------------------------------------------------------------------
|
|
17
|
+
// Constants
|
|
18
|
+
// ---------------------------------------------------------------------------
|
|
19
|
+
const REPORT_VERSION = '1.0.0';
|
|
20
|
+
// ---------------------------------------------------------------------------
|
|
21
|
+
// Helpers
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
/**
|
|
24
|
+
* Reconstruct a graphlib Graph from a CausalGraph for traversal.
|
|
25
|
+
*/
|
|
26
|
+
function rebuildGraph(graph) {
|
|
27
|
+
const g = new Graph({ directed: true });
|
|
28
|
+
for (const node of graph.nodes) {
|
|
29
|
+
g.setNode(node.id, node);
|
|
30
|
+
}
|
|
31
|
+
for (const edge of graph.edges) {
|
|
32
|
+
if (!g.hasNode(edge.source)) {
|
|
33
|
+
g.setNode(edge.source, { id: edge.source, label: edge.source, type: 'bottleneck' });
|
|
34
|
+
}
|
|
35
|
+
if (!g.hasNode(edge.target)) {
|
|
36
|
+
g.setNode(edge.target, { id: edge.target, label: edge.target, type: 'impact' });
|
|
37
|
+
}
|
|
38
|
+
g.setEdge(edge.source, edge.target, edge);
|
|
39
|
+
}
|
|
40
|
+
return g;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* DFS from a node to find all paths to sink nodes.
|
|
44
|
+
* Uses simple recursion with visited set to avoid infinite loops.
|
|
45
|
+
*/
|
|
46
|
+
function findPathsToSinks(g, nodeId, visited = new Set()) {
|
|
47
|
+
if (visited.has(nodeId))
|
|
48
|
+
return [];
|
|
49
|
+
visited.add(nodeId);
|
|
50
|
+
const outEdges = g.outEdges(nodeId) ?? [];
|
|
51
|
+
// If no outgoing edges, this is a sink — return path with just this node
|
|
52
|
+
if (outEdges.length === 0) {
|
|
53
|
+
return [[nodeId]];
|
|
54
|
+
}
|
|
55
|
+
const paths = [];
|
|
56
|
+
for (const edge of outEdges) {
|
|
57
|
+
const subPaths = findPathsToSinks(g, edge.w, new Set(visited));
|
|
58
|
+
for (const sub of subPaths) {
|
|
59
|
+
paths.push([nodeId, ...sub]);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return paths;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Find the overall confidence for a chain (lowest in the path).
|
|
66
|
+
*/
|
|
67
|
+
function chainConfidence(path, edges) {
|
|
68
|
+
const confOrder = { strong: 3, medium: 2, weak: 1 };
|
|
69
|
+
let minConf = 3;
|
|
70
|
+
for (let i = 0; i < path.length - 1; i++) {
|
|
71
|
+
const edge = edges.find((e) => e.source === path[i] && e.target === path[i + 1]);
|
|
72
|
+
if (edge) {
|
|
73
|
+
minConf = Math.min(minConf, confOrder[edge.confidence] ?? 1);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const reverse = { 3: 'strong', 2: 'medium', 1: 'weak' };
|
|
77
|
+
return reverse[minConf] ?? 'weak';
|
|
78
|
+
}
|
|
79
|
+
// ---------------------------------------------------------------------------
|
|
80
|
+
// Category mapping for recommendations
|
|
81
|
+
// ---------------------------------------------------------------------------
|
|
82
|
+
function categorizeNode(nodeId, ruleId) {
|
|
83
|
+
if (!ruleId) {
|
|
84
|
+
if (nodeId.includes('lcp') || nodeId.includes('ttfb') || nodeId.includes('rb-'))
|
|
85
|
+
return 'LCP';
|
|
86
|
+
if (nodeId.includes('js-') || nodeId.includes('tbt') || nodeId.includes('inp'))
|
|
87
|
+
return 'JavaScript';
|
|
88
|
+
if (nodeId.includes('net-') || nodeId.includes('chain') || nodeId.includes('request') || nodeId.includes('bandwidth'))
|
|
89
|
+
return 'Network';
|
|
90
|
+
if (nodeId.includes('layout') || nodeId.includes('cls') || nodeId.includes('dom'))
|
|
91
|
+
return 'Layout';
|
|
92
|
+
return 'Performance';
|
|
93
|
+
}
|
|
94
|
+
if (ruleId.startsWith('lcp'))
|
|
95
|
+
return 'LCP';
|
|
96
|
+
if (ruleId.startsWith('net'))
|
|
97
|
+
return 'Network';
|
|
98
|
+
if (ruleId.startsWith('js'))
|
|
99
|
+
return 'JavaScript';
|
|
100
|
+
if (ruleId.startsWith('layout'))
|
|
101
|
+
return 'Layout';
|
|
102
|
+
return 'Performance';
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Build a deterministic chain ID from a rule ID and path length.
|
|
106
|
+
*/
|
|
107
|
+
function buildChainId(ruleId, path) {
|
|
108
|
+
return `${ruleId}:${path.length}`;
|
|
109
|
+
}
|
|
110
|
+
// ---------------------------------------------------------------------------
|
|
111
|
+
// Main analyzer
|
|
112
|
+
// ---------------------------------------------------------------------------
|
|
113
|
+
/**
|
|
114
|
+
* Build a comprehensive Report from a CausalGraph and FeatureSet.
|
|
115
|
+
*
|
|
116
|
+
* Pure function: same inputs → same Report.
|
|
117
|
+
*
|
|
118
|
+
* @param graph - The CausalGraph from Phase 4
|
|
119
|
+
* @param features - The FeatureSet from Phase 3 (optional — included in report as-is)
|
|
120
|
+
* @returns A fully populated Report
|
|
121
|
+
*/
|
|
122
|
+
export function buildReport(graph, features, lighthousePerformance) {
|
|
123
|
+
const g = rebuildGraph(graph);
|
|
124
|
+
// -----------------------------------------------------------------------
|
|
125
|
+
// 1. Build causal chains
|
|
126
|
+
// -----------------------------------------------------------------------
|
|
127
|
+
const sources = g.sources();
|
|
128
|
+
const nodeMap = new Map(graph.nodes.map((n) => [n.id, n]));
|
|
129
|
+
const allPaths = [];
|
|
130
|
+
const seenPaths = new Set();
|
|
131
|
+
for (const source of sources) {
|
|
132
|
+
const paths = findPathsToSinks(g, source);
|
|
133
|
+
for (const path of paths) {
|
|
134
|
+
if (path.length < 2)
|
|
135
|
+
continue; // skip single-node "chains"
|
|
136
|
+
// Determine ruleId from the first edge
|
|
137
|
+
const firstEdge = graph.edges.find((e) => e.source === path[0] && e.target === path[1]);
|
|
138
|
+
const ruleId = firstEdge?.ruleId ?? 'unknown';
|
|
139
|
+
// Deduplicate identical paths
|
|
140
|
+
const pathKey = `${ruleId}:${path.join('→')}`;
|
|
141
|
+
if (seenPaths.has(pathKey))
|
|
142
|
+
continue;
|
|
143
|
+
seenPaths.add(pathKey);
|
|
144
|
+
allPaths.push({ ruleId, path });
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
const chains = allPaths.map(({ ruleId, path }) => {
|
|
148
|
+
const chainId = buildChainId(ruleId, path);
|
|
149
|
+
const headId = path[0];
|
|
150
|
+
const tailId = path[path.length - 1];
|
|
151
|
+
const firstNode = nodeMap.get(headId) ?? { label: headId };
|
|
152
|
+
const lastNode = nodeMap.get(tailId) ?? { label: tailId };
|
|
153
|
+
const conf = chainConfidence(path, graph.edges);
|
|
154
|
+
// Highest severity in the chain
|
|
155
|
+
let maxSev = 'info';
|
|
156
|
+
for (const p of path) {
|
|
157
|
+
const n = nodeMap.get(p);
|
|
158
|
+
if (n?.severity === 'critical') {
|
|
159
|
+
maxSev = 'critical';
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
if (n?.severity === 'warning')
|
|
163
|
+
maxSev = 'warning';
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
id: chainId,
|
|
167
|
+
rootCause: firstNode.label,
|
|
168
|
+
impact: lastNode.label,
|
|
169
|
+
confidence: conf,
|
|
170
|
+
severity: maxSev,
|
|
171
|
+
path: path.map((nodeId) => {
|
|
172
|
+
const n = nodeMap.get(nodeId);
|
|
173
|
+
return {
|
|
174
|
+
nodeId,
|
|
175
|
+
label: n?.label ?? nodeId,
|
|
176
|
+
type: n?.type ?? 'bottleneck',
|
|
177
|
+
severity: n?.severity,
|
|
178
|
+
};
|
|
179
|
+
}),
|
|
180
|
+
length: path.length,
|
|
181
|
+
};
|
|
182
|
+
});
|
|
183
|
+
// -----------------------------------------------------------------------
|
|
184
|
+
// 2. Build issues (flat list, sorted by severity)
|
|
185
|
+
// -----------------------------------------------------------------------
|
|
186
|
+
// Map each node to a chain ID
|
|
187
|
+
const nodeToChain = new Map();
|
|
188
|
+
for (const chain of chains) {
|
|
189
|
+
for (const step of chain.path) {
|
|
190
|
+
// Prefer shorter chain (more direct causal link)
|
|
191
|
+
const existing = nodeToChain.get(step.nodeId);
|
|
192
|
+
if (!existing || chain.length < 3) {
|
|
193
|
+
nodeToChain.set(step.nodeId, chain.id);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
// Find edge confidence for each node (confidence of the edge leading INTO it)
|
|
198
|
+
const nodeInConfidence = new Map();
|
|
199
|
+
for (const edge of graph.edges) {
|
|
200
|
+
nodeInConfidence.set(edge.target, edge.confidence);
|
|
201
|
+
}
|
|
202
|
+
const issues = graph.nodes.map((node) => {
|
|
203
|
+
// Determine the rule ID for remediation lookup
|
|
204
|
+
const incomingEdge = graph.edges.find((e) => e.target === node.id);
|
|
205
|
+
const ruleId = incomingEdge?.ruleId;
|
|
206
|
+
const confidence = nodeInConfidence.get(node.id) ?? 'weak';
|
|
207
|
+
return {
|
|
208
|
+
id: node.id,
|
|
209
|
+
label: node.label,
|
|
210
|
+
type: node.type,
|
|
211
|
+
severity: node.severity ?? 'info',
|
|
212
|
+
value: node.value,
|
|
213
|
+
unit: node.unit,
|
|
214
|
+
threshold: node.threshold,
|
|
215
|
+
confidence,
|
|
216
|
+
remediation: getRemediation(node.id, {
|
|
217
|
+
evidence: node.evidence,
|
|
218
|
+
value: node.value,
|
|
219
|
+
unit: node.unit,
|
|
220
|
+
nodeType: node.type,
|
|
221
|
+
ruleId,
|
|
222
|
+
}),
|
|
223
|
+
chainId: nodeToChain.get(node.id) ?? 'standalone',
|
|
224
|
+
evidence: node.evidence,
|
|
225
|
+
};
|
|
226
|
+
});
|
|
227
|
+
// Sort: critical first, then warning, then info
|
|
228
|
+
const sevOrder = { critical: 0, warning: 1, info: 2 };
|
|
229
|
+
issues.sort((a, b) => (sevOrder[a.severity] ?? 3) - (sevOrder[b.severity] ?? 3));
|
|
230
|
+
// -----------------------------------------------------------------------
|
|
231
|
+
// 3. Build summary
|
|
232
|
+
// -----------------------------------------------------------------------
|
|
233
|
+
const criticalCount = issues.filter((i) => i.severity === 'critical').length;
|
|
234
|
+
const warningCount = issues.filter((i) => i.severity === 'warning').length;
|
|
235
|
+
const infoCount = issues.filter((i) => i.severity === 'info').length;
|
|
236
|
+
const scoreResult = computeScore(graph, lighthousePerformance);
|
|
237
|
+
const score = typeof scoreResult === 'string' ? scoreResult : scoreResult.score;
|
|
238
|
+
const scoreExplanation = typeof scoreResult === 'object' ? scoreResult.explanation : undefined;
|
|
239
|
+
// Top 5 issues (sorted by severity, then by confidence: strong > medium > weak)
|
|
240
|
+
const confOrder = { strong: 0, medium: 1, weak: 2 };
|
|
241
|
+
const sortedTop = [...issues].sort((a, b) => {
|
|
242
|
+
const sevCmp = (sevOrder[a.severity] ?? 3) - (sevOrder[b.severity] ?? 3);
|
|
243
|
+
if (sevCmp !== 0)
|
|
244
|
+
return sevCmp;
|
|
245
|
+
return (confOrder[a.confidence] ?? 3) - (confOrder[b.confidence] ?? 3);
|
|
246
|
+
});
|
|
247
|
+
const topIssues = sortedTop.slice(0, 5).map((i) => ({
|
|
248
|
+
id: i.id,
|
|
249
|
+
label: i.label,
|
|
250
|
+
severity: i.severity,
|
|
251
|
+
confidence: i.confidence,
|
|
252
|
+
}));
|
|
253
|
+
const summary = {
|
|
254
|
+
score,
|
|
255
|
+
criticalIssues: criticalCount,
|
|
256
|
+
warnings: warningCount,
|
|
257
|
+
infos: infoCount,
|
|
258
|
+
topIssues,
|
|
259
|
+
lighthousePerformance,
|
|
260
|
+
scoreExplanation,
|
|
261
|
+
};
|
|
262
|
+
// -----------------------------------------------------------------------
|
|
263
|
+
// 4. Build recommendations
|
|
264
|
+
// -----------------------------------------------------------------------
|
|
265
|
+
const recommendations = [];
|
|
266
|
+
const recSeen = new Set();
|
|
267
|
+
// Build recommendations from critical and warning issues
|
|
268
|
+
const actionableIssues = issues.filter((i) => i.severity === 'critical' || i.severity === 'warning');
|
|
269
|
+
for (const issue of actionableIssues) {
|
|
270
|
+
const cat = categorizeNode(issue.id);
|
|
271
|
+
// Deduplicate by category + action prefix
|
|
272
|
+
const dedupKey = `${cat}:${issue.remediation.slice(0, 80)}`;
|
|
273
|
+
if (recSeen.has(dedupKey))
|
|
274
|
+
continue;
|
|
275
|
+
recSeen.add(dedupKey);
|
|
276
|
+
const priority = issue.severity === 'critical' ? 'critical' : 'high';
|
|
277
|
+
// Extract action from remediation (first sentence)
|
|
278
|
+
const actionEnd = issue.remediation.indexOf('. ');
|
|
279
|
+
const action = actionEnd > 0
|
|
280
|
+
? issue.remediation.slice(0, actionEnd + 1)
|
|
281
|
+
: issue.remediation;
|
|
282
|
+
recommendations.push({
|
|
283
|
+
priority,
|
|
284
|
+
category: cat,
|
|
285
|
+
title: issue.label,
|
|
286
|
+
description: issue.remediation,
|
|
287
|
+
action,
|
|
288
|
+
expectedImpact: issue.type === 'impact'
|
|
289
|
+
? 'Target metric improvement'
|
|
290
|
+
: 'Eliminates bottleneck in the degradation chain',
|
|
291
|
+
relatedIssues: issues
|
|
292
|
+
.filter((other) => other.chainId === issue.chainId && other.id !== issue.id)
|
|
293
|
+
.map((other) => other.id),
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
// Sort recommendations: critical first, then high, then medium, then low
|
|
297
|
+
const recPriority = { critical: 0, high: 1, medium: 2, low: 3 };
|
|
298
|
+
recommendations.sort((a, b) => (recPriority[a.priority] ?? 4) - (recPriority[b.priority] ?? 4));
|
|
299
|
+
// -----------------------------------------------------------------------
|
|
300
|
+
// 5. Build metadata
|
|
301
|
+
// -----------------------------------------------------------------------
|
|
302
|
+
const meta = {
|
|
303
|
+
url: graph.metadata.targetUrl ?? features?.url ?? '',
|
|
304
|
+
analyzedAt: new Date().toISOString(),
|
|
305
|
+
reportVersion: REPORT_VERSION,
|
|
306
|
+
featureCount: graph.metadata.featureCount,
|
|
307
|
+
graphNodeCount: graph.metadata.totalNodes,
|
|
308
|
+
graphEdgeCount: graph.metadata.totalEdges,
|
|
309
|
+
ruleCount: graph.metadata.ruleCount,
|
|
310
|
+
};
|
|
311
|
+
// -----------------------------------------------------------------------
|
|
312
|
+
// 6. Assemble + validate
|
|
313
|
+
// -----------------------------------------------------------------------
|
|
314
|
+
const report = {
|
|
315
|
+
meta,
|
|
316
|
+
summary,
|
|
317
|
+
issues,
|
|
318
|
+
chains,
|
|
319
|
+
recommendations,
|
|
320
|
+
features: features ?? null,
|
|
321
|
+
};
|
|
322
|
+
return ReportSchema.parse(report);
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Check whether a report has actionable issues.
|
|
326
|
+
*/
|
|
327
|
+
export function hasActionableIssues(report) {
|
|
328
|
+
return report.summary.criticalIssues > 0 || report.summary.warnings > 0;
|
|
329
|
+
}
|
|
330
|
+
//# sourceMappingURL=analyzer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analyzer.js","sourceRoot":"","sources":["../../src/report/analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAY/C,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E,MAAM,cAAc,GAAG,OAAO,CAAC;AAE/B,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E;;GAEG;AACH,SAAS,YAAY,CAAC,KAAkB;IACtC,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAExC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAC/B,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC3B,CAAC;IACD,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,EAAE,CAAC;QAC/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Q,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAC1E,CAAC;IAEF,0EAA0E;IAC1E,oBAAoB;IACpB,0EAA0E;IAE1E,MAAM,IAAI,GAAe;QACvB,GAAG,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS,IAAI,QAAQ,EAAE,GAAG,IAAI,EAAE;QACpD,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;QACpC,aAAa,EAAE,cAAc;QAC7B,YAAY,EAAE,KAAK,CAAC,QAAQ,CAAC,YAAY;QACzC,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,UAAU;QACzC,cAAc,EAAE,KAAK,CAAC,QAAQ,CAAC,UAAU;QACzC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,SAAS;KACpC,CAAC;IAEF,0EAA0E;IAC1E,yBAAyB;IACzB,0EAA0E;IAE1E,MAAM,MAAM,GAAW;QACrB,IAAI;QACJ,OAAO;QACP,MAAM;QACN,MAAM;QACN,eAAe;QACf,QAAQ,EAAE,QAAQ,IAAI,IAAI;KAC3B,CAAC;IAEF,OAAO,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc;IAChD,OAAO,MAAM,CAAC,OAAO,CAAC,cAAc,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Report Generator — Phase 5 public API.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { buildReport } from '../report/index.js';
|
|
6
|
+
* const report = buildReport(causalGraph, featureSet);
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export { buildReport, hasActionableIssues } from './analyzer.js';
|
|
11
|
+
export type { Report, ReportMeta, ReportSummary, ReportIssue, CausalChain, Recommendation, TopIssue, ReportScore, RecommendationPriority, } from './types.js';
|
|
12
|
+
export { getRemediation } from './remediations.js';
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/report/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACjE,YAAY,EACV,MAAM,EACN,UAAU,EACV,aAAa,EACb,WAAW,EACX,WAAW,EACX,cAAc,EACd,QAAQ,EACR,WAAW,EACX,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Report Generator — Phase 5 public API.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { buildReport } from '../report/index.js';
|
|
6
|
+
* const report = buildReport(causalGraph, featureSet);
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export { buildReport, hasActionableIssues } from './analyzer.js';
|
|
11
|
+
export { getRemediation } from './remediations.js';
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/report/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAYjE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Markdown report generator — produces a human-readable performance report
|
|
3
|
+
* from a PerfGraph {@link Report} and optional {@link Insights}.
|
|
4
|
+
*
|
|
5
|
+
* The output is designed for direct consumption by developers and includes
|
|
6
|
+
* score summary, all issues with severities, causal chains, recommendations,
|
|
7
|
+
* and Lighthouse insights when available.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
11
|
+
import type { Report } from './types.js';
|
|
12
|
+
import type { Insights } from '../distill/insights.js';
|
|
13
|
+
/**
|
|
14
|
+
* Generate a human-readable markdown report from a PerfGraph Report + Insights.
|
|
15
|
+
*
|
|
16
|
+
* @param report - The structured report from `buildReport()`
|
|
17
|
+
* @param insights - Optional Lighthouse-derived insights from `buildInsights()`
|
|
18
|
+
* @returns A formatted Markdown string
|
|
19
|
+
*/
|
|
20
|
+
export declare function buildReportMarkdown(report: Report, insights?: Insights): string;
|
|
21
|
+
//# sourceMappingURL=markdown.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.d.ts","sourceRoot":"","sources":["../../src/report/markdown.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAyBvD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,QAAQ,GAClB,MAAM,CA4KR"}
|