modestbench 0.0.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/CHANGELOG.md +45 -0
- package/LICENSE.md +55 -0
- package/README.md +699 -0
- package/dist/bootstrap.cjs +37 -0
- package/dist/bootstrap.cjs.map +1 -0
- package/dist/bootstrap.d.cts +17 -0
- package/dist/bootstrap.d.cts.map +1 -0
- package/dist/bootstrap.d.ts +17 -0
- package/dist/bootstrap.d.ts.map +1 -0
- package/dist/bootstrap.js +33 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/cli/commands/history.cjs +459 -0
- package/dist/cli/commands/history.cjs.map +1 -0
- package/dist/cli/commands/history.d.cts +34 -0
- package/dist/cli/commands/history.d.cts.map +1 -0
- package/dist/cli/commands/history.d.ts +34 -0
- package/dist/cli/commands/history.d.ts.map +1 -0
- package/dist/cli/commands/history.js +422 -0
- package/dist/cli/commands/history.js.map +1 -0
- package/dist/cli/commands/init.cjs +566 -0
- package/dist/cli/commands/init.cjs.map +1 -0
- package/dist/cli/commands/init.d.cts +26 -0
- package/dist/cli/commands/init.d.cts.map +1 -0
- package/dist/cli/commands/init.d.ts +26 -0
- package/dist/cli/commands/init.d.ts.map +1 -0
- package/dist/cli/commands/init.js +562 -0
- package/dist/cli/commands/init.js.map +1 -0
- package/dist/cli/commands/run.cjs +285 -0
- package/dist/cli/commands/run.cjs.map +1 -0
- package/dist/cli/commands/run.d.cts +37 -0
- package/dist/cli/commands/run.d.cts.map +1 -0
- package/dist/cli/commands/run.d.ts +37 -0
- package/dist/cli/commands/run.d.ts.map +1 -0
- package/dist/cli/commands/run.js +248 -0
- package/dist/cli/commands/run.js.map +1 -0
- package/dist/cli/index.cjs +523 -0
- package/dist/cli/index.cjs.map +1 -0
- package/dist/cli/index.d.cts +58 -0
- package/dist/cli/index.d.cts.map +1 -0
- package/dist/cli/index.d.ts +58 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +515 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config/manager.cjs +370 -0
- package/dist/config/manager.cjs.map +1 -0
- package/dist/config/manager.d.cts +46 -0
- package/dist/config/manager.d.cts.map +1 -0
- package/dist/config/manager.d.ts +46 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/manager.js +333 -0
- package/dist/config/manager.js.map +1 -0
- package/dist/config/schema.cjs +182 -0
- package/dist/config/schema.cjs.map +1 -0
- package/dist/config/schema.d.cts +51 -0
- package/dist/config/schema.d.cts.map +1 -0
- package/dist/config/schema.d.ts +51 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +145 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/constants.cjs +22 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.cts +10 -0
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.ts +10 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +19 -0
- package/dist/constants.js.map +1 -0
- package/dist/core/benchmark-schema.cjs +135 -0
- package/dist/core/benchmark-schema.cjs.map +1 -0
- package/dist/core/benchmark-schema.d.cts +139 -0
- package/dist/core/benchmark-schema.d.cts.map +1 -0
- package/dist/core/benchmark-schema.d.ts +139 -0
- package/dist/core/benchmark-schema.d.ts.map +1 -0
- package/dist/core/benchmark-schema.js +132 -0
- package/dist/core/benchmark-schema.js.map +1 -0
- package/dist/core/engine.cjs +669 -0
- package/dist/core/engine.cjs.map +1 -0
- package/dist/core/engine.d.cts +128 -0
- package/dist/core/engine.d.cts.map +1 -0
- package/dist/core/engine.d.ts +128 -0
- package/dist/core/engine.d.ts.map +1 -0
- package/dist/core/engine.js +632 -0
- package/dist/core/engine.js.map +1 -0
- package/dist/core/engines/accurate-engine.cjs +292 -0
- package/dist/core/engines/accurate-engine.cjs.map +1 -0
- package/dist/core/engines/accurate-engine.d.cts +63 -0
- package/dist/core/engines/accurate-engine.d.cts.map +1 -0
- package/dist/core/engines/accurate-engine.d.ts +63 -0
- package/dist/core/engines/accurate-engine.d.ts.map +1 -0
- package/dist/core/engines/accurate-engine.js +288 -0
- package/dist/core/engines/accurate-engine.js.map +1 -0
- package/dist/core/engines/index.cjs +21 -0
- package/dist/core/engines/index.cjs.map +1 -0
- package/dist/core/engines/index.d.cts +16 -0
- package/dist/core/engines/index.d.cts.map +1 -0
- package/dist/core/engines/index.d.ts +16 -0
- package/dist/core/engines/index.d.ts.map +1 -0
- package/dist/core/engines/index.js +16 -0
- package/dist/core/engines/index.js.map +1 -0
- package/dist/core/engines/tinybench-engine.cjs +286 -0
- package/dist/core/engines/tinybench-engine.cjs.map +1 -0
- package/dist/core/engines/tinybench-engine.d.cts +18 -0
- package/dist/core/engines/tinybench-engine.d.cts.map +1 -0
- package/dist/core/engines/tinybench-engine.d.ts +18 -0
- package/dist/core/engines/tinybench-engine.d.ts.map +1 -0
- package/dist/core/engines/tinybench-engine.js +282 -0
- package/dist/core/engines/tinybench-engine.js.map +1 -0
- package/dist/core/error-manager.cjs +303 -0
- package/dist/core/error-manager.cjs.map +1 -0
- package/dist/core/error-manager.d.cts +77 -0
- package/dist/core/error-manager.d.cts.map +1 -0
- package/dist/core/error-manager.d.ts +77 -0
- package/dist/core/error-manager.d.ts.map +1 -0
- package/dist/core/error-manager.js +299 -0
- package/dist/core/error-manager.js.map +1 -0
- package/dist/core/loader.cjs +287 -0
- package/dist/core/loader.cjs.map +1 -0
- package/dist/core/loader.d.cts +55 -0
- package/dist/core/loader.d.cts.map +1 -0
- package/dist/core/loader.d.ts +55 -0
- package/dist/core/loader.d.ts.map +1 -0
- package/dist/core/loader.js +250 -0
- package/dist/core/loader.js.map +1 -0
- package/dist/core/stats-utils.cjs +99 -0
- package/dist/core/stats-utils.cjs.map +1 -0
- package/dist/core/stats-utils.d.cts +50 -0
- package/dist/core/stats-utils.d.cts.map +1 -0
- package/dist/core/stats-utils.d.ts +50 -0
- package/dist/core/stats-utils.d.ts.map +1 -0
- package/dist/core/stats-utils.js +94 -0
- package/dist/core/stats-utils.js.map +1 -0
- package/dist/index.cjs +64 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +22 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/progress/manager.cjs +325 -0
- package/dist/progress/manager.cjs.map +1 -0
- package/dist/progress/manager.d.cts +125 -0
- package/dist/progress/manager.d.cts.map +1 -0
- package/dist/progress/manager.d.ts +125 -0
- package/dist/progress/manager.d.ts.map +1 -0
- package/dist/progress/manager.js +321 -0
- package/dist/progress/manager.js.map +1 -0
- package/dist/reporters/csv.cjs +250 -0
- package/dist/reporters/csv.cjs.map +1 -0
- package/dist/reporters/csv.d.cts +92 -0
- package/dist/reporters/csv.d.cts.map +1 -0
- package/dist/reporters/csv.d.ts +92 -0
- package/dist/reporters/csv.d.ts.map +1 -0
- package/dist/reporters/csv.js +246 -0
- package/dist/reporters/csv.js.map +1 -0
- package/dist/reporters/human.cjs +516 -0
- package/dist/reporters/human.cjs.map +1 -0
- package/dist/reporters/human.d.cts +86 -0
- package/dist/reporters/human.d.cts.map +1 -0
- package/dist/reporters/human.d.ts +86 -0
- package/dist/reporters/human.d.ts.map +1 -0
- package/dist/reporters/human.js +509 -0
- package/dist/reporters/human.js.map +1 -0
- package/dist/reporters/index.cjs +17 -0
- package/dist/reporters/index.cjs.map +1 -0
- package/dist/reporters/index.d.cts +10 -0
- package/dist/reporters/index.d.cts.map +1 -0
- package/dist/reporters/index.d.ts +10 -0
- package/dist/reporters/index.d.ts.map +1 -0
- package/dist/reporters/index.js +10 -0
- package/dist/reporters/index.js.map +1 -0
- package/dist/reporters/json.cjs +215 -0
- package/dist/reporters/json.cjs.map +1 -0
- package/dist/reporters/json.d.cts +79 -0
- package/dist/reporters/json.d.cts.map +1 -0
- package/dist/reporters/json.d.ts +79 -0
- package/dist/reporters/json.d.ts.map +1 -0
- package/dist/reporters/json.js +211 -0
- package/dist/reporters/json.js.map +1 -0
- package/dist/reporters/registry.cjs +255 -0
- package/dist/reporters/registry.cjs.map +1 -0
- package/dist/reporters/registry.d.cts +155 -0
- package/dist/reporters/registry.d.cts.map +1 -0
- package/dist/reporters/registry.d.ts +155 -0
- package/dist/reporters/registry.d.ts.map +1 -0
- package/dist/reporters/registry.js +249 -0
- package/dist/reporters/registry.js.map +1 -0
- package/dist/reporters/simple.cjs +328 -0
- package/dist/reporters/simple.cjs.map +1 -0
- package/dist/reporters/simple.d.cts +51 -0
- package/dist/reporters/simple.d.cts.map +1 -0
- package/dist/reporters/simple.d.ts +51 -0
- package/dist/reporters/simple.d.ts.map +1 -0
- package/dist/reporters/simple.js +321 -0
- package/dist/reporters/simple.js.map +1 -0
- package/dist/schema/modestbench-config.schema.json +162 -0
- package/dist/storage/history.cjs +456 -0
- package/dist/storage/history.cjs.map +1 -0
- package/dist/storage/history.d.cts +99 -0
- package/dist/storage/history.d.cts.map +1 -0
- package/dist/storage/history.d.ts +99 -0
- package/dist/storage/history.d.ts.map +1 -0
- package/dist/storage/history.js +452 -0
- package/dist/storage/history.js.map +1 -0
- package/dist/types/cli.cjs +21 -0
- package/dist/types/cli.cjs.map +1 -0
- package/dist/types/cli.d.cts +296 -0
- package/dist/types/cli.d.cts.map +1 -0
- package/dist/types/cli.d.ts +296 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/cli.js +18 -0
- package/dist/types/cli.js.map +1 -0
- package/dist/types/core.cjs +14 -0
- package/dist/types/core.cjs.map +1 -0
- package/dist/types/core.d.cts +380 -0
- package/dist/types/core.d.cts.map +1 -0
- package/dist/types/core.d.ts +380 -0
- package/dist/types/core.d.ts.map +1 -0
- package/dist/types/core.js +13 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/index.cjs +27 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.cts +11 -0
- package/dist/types/index.d.cts.map +1 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +11 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/interfaces.cjs +10 -0
- package/dist/types/interfaces.cjs.map +1 -0
- package/dist/types/interfaces.d.cts +381 -0
- package/dist/types/interfaces.d.cts.map +1 -0
- package/dist/types/interfaces.d.ts +381 -0
- package/dist/types/interfaces.d.ts.map +1 -0
- package/dist/types/interfaces.js +9 -0
- package/dist/types/interfaces.js.map +1 -0
- package/dist/types/utility.cjs +92 -0
- package/dist/types/utility.cjs.map +1 -0
- package/dist/types/utility.d.cts +330 -0
- package/dist/types/utility.d.cts.map +1 -0
- package/dist/types/utility.d.ts +330 -0
- package/dist/types/utility.d.ts.map +1 -0
- package/dist/types/utility.js +78 -0
- package/dist/types/utility.js.map +1 -0
- package/package.json +211 -0
- package/src/bootstrap.ts +35 -0
- package/src/cli/commands/history.ts +569 -0
- package/src/cli/commands/init.ts +658 -0
- package/src/cli/commands/run.ts +346 -0
- package/src/cli/index.ts +642 -0
- package/src/config/manager.ts +387 -0
- package/src/config/schema.ts +188 -0
- package/src/constants.ts +21 -0
- package/src/core/benchmark-schema.ts +185 -0
- package/src/core/engine.ts +888 -0
- package/src/core/engines/accurate-engine.ts +408 -0
- package/src/core/engines/index.ts +16 -0
- package/src/core/engines/tinybench-engine.ts +335 -0
- package/src/core/error-manager.ts +372 -0
- package/src/core/loader.ts +324 -0
- package/src/core/stats-utils.ts +135 -0
- package/src/index.ts +46 -0
- package/src/progress/manager.ts +415 -0
- package/src/reporters/csv.ts +368 -0
- package/src/reporters/human.ts +707 -0
- package/src/reporters/index.ts +10 -0
- package/src/reporters/json.ts +302 -0
- package/src/reporters/registry.ts +349 -0
- package/src/reporters/simple.ts +459 -0
- package/src/storage/history.ts +600 -0
- package/src/types/cli.ts +312 -0
- package/src/types/core.ts +414 -0
- package/src/types/index.ts +18 -0
- package/src/types/interfaces.ts +451 -0
- package/src/types/utility.ts +446 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reporters/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,oCAAuC;AAA9B,qGAAA,WAAW,OAAA;AACpB,wCAA2C;AAAlC,yGAAA,aAAa,OAAA;AACtB,sCAAyC;AAAhC,uGAAA,YAAY,OAAA;AACrB,0CAA6C;AAApC,2GAAA,cAAc,OAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModestBench Reporters
|
|
3
|
+
*
|
|
4
|
+
* Export all available reporters and registry functionality.
|
|
5
|
+
*/
|
|
6
|
+
export { CsvReporter } from "./csv.cjs";
|
|
7
|
+
export { HumanReporter } from "./human.cjs";
|
|
8
|
+
export { JsonReporter } from "./json.cjs";
|
|
9
|
+
export { SimpleReporter } from "./simple.cjs";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reporters/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,kBAAiB;AACvC,OAAO,EAAE,aAAa,EAAE,oBAAmB;AAC3C,OAAO,EAAE,YAAY,EAAE,mBAAkB;AACzC,OAAO,EAAE,cAAc,EAAE,qBAAoB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModestBench Reporters
|
|
3
|
+
*
|
|
4
|
+
* Export all available reporters and registry functionality.
|
|
5
|
+
*/
|
|
6
|
+
export { CsvReporter } from "./csv.js";
|
|
7
|
+
export { HumanReporter } from "./human.js";
|
|
8
|
+
export { JsonReporter } from "./json.js";
|
|
9
|
+
export { SimpleReporter } from "./simple.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/reporters/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,iBAAiB;AACvC,OAAO,EAAE,aAAa,EAAE,mBAAmB;AAC3C,OAAO,EAAE,YAAY,EAAE,kBAAkB;AACzC,OAAO,EAAE,cAAc,EAAE,oBAAoB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModestBench Reporters
|
|
3
|
+
*
|
|
4
|
+
* Export all available reporters and registry functionality.
|
|
5
|
+
*/
|
|
6
|
+
export { CsvReporter } from "./csv.js";
|
|
7
|
+
export { HumanReporter } from "./human.js";
|
|
8
|
+
export { JsonReporter } from "./json.js";
|
|
9
|
+
export { SimpleReporter } from "./simple.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/reporters/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,iBAAiB;AACvC,OAAO,EAAE,aAAa,EAAE,mBAAmB;AAC3C,OAAO,EAAE,YAAY,EAAE,kBAAkB;AACzC,OAAO,EAAE,cAAc,EAAE,oBAAoB"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* ModestBench JSON Reporter
|
|
4
|
+
*
|
|
5
|
+
* Outputs benchmark results in structured JSON format. Suitable for machine
|
|
6
|
+
* processing, CI/CD integration, and data analysis.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.JsonReporter = void 0;
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
11
|
+
const node_path_1 = require("node:path");
|
|
12
|
+
const registry_js_1 = require("./registry.cjs");
|
|
13
|
+
/**
|
|
14
|
+
* JSON reporter for structured output
|
|
15
|
+
*/
|
|
16
|
+
class JsonReporter extends registry_js_1.BaseReporter {
|
|
17
|
+
currentRun;
|
|
18
|
+
includeMetadata;
|
|
19
|
+
includeStatistics;
|
|
20
|
+
outputPath;
|
|
21
|
+
prettyPrint;
|
|
22
|
+
quiet;
|
|
23
|
+
statistics = {
|
|
24
|
+
taskCount: 0,
|
|
25
|
+
totalIterations: 0,
|
|
26
|
+
totalOpsPerSecond: 0,
|
|
27
|
+
};
|
|
28
|
+
constructor(options = {}) {
|
|
29
|
+
super('json', options);
|
|
30
|
+
this.outputPath = options.outputPath;
|
|
31
|
+
this.prettyPrint = options.prettyPrint ?? true;
|
|
32
|
+
this.includeStatistics = options.includeStatistics ?? true;
|
|
33
|
+
this.includeMetadata = options.includeMetadata ?? true;
|
|
34
|
+
this.quiet = options.quiet ?? false;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Check if statistics are included
|
|
38
|
+
*/
|
|
39
|
+
areStatisticsIncluded() {
|
|
40
|
+
return this.includeStatistics;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get the output path (if configured)
|
|
44
|
+
*/
|
|
45
|
+
getOutputPath() {
|
|
46
|
+
return this.outputPath;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Check if metadata is included
|
|
50
|
+
*/
|
|
51
|
+
isMetadataIncluded() {
|
|
52
|
+
return this.includeMetadata;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Check if pretty printing is enabled
|
|
56
|
+
*/
|
|
57
|
+
isPrettyPrintEnabled() {
|
|
58
|
+
return this.prettyPrint;
|
|
59
|
+
}
|
|
60
|
+
async onEnd(run) {
|
|
61
|
+
const output = this.buildJsonOutput(run);
|
|
62
|
+
if (this.outputPath) {
|
|
63
|
+
await this.writeToFile(output);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
this.writeToStdout(output);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
onError(error) {
|
|
70
|
+
// For JSON reporter, we'll include errors in the final output
|
|
71
|
+
// but we can also log to stderr for immediate feedback
|
|
72
|
+
console.error('JSON Reporter Error:', error.message);
|
|
73
|
+
}
|
|
74
|
+
onFileEnd(_result) {
|
|
75
|
+
// No-op for JSON reporter
|
|
76
|
+
}
|
|
77
|
+
onFileStart(_file) {
|
|
78
|
+
// No-op for JSON reporter
|
|
79
|
+
}
|
|
80
|
+
onProgress(_state) {
|
|
81
|
+
// No-op for JSON reporter - we don't output progress in JSON format
|
|
82
|
+
}
|
|
83
|
+
onStart(run) {
|
|
84
|
+
this.currentRun = run;
|
|
85
|
+
this.resetStatistics();
|
|
86
|
+
}
|
|
87
|
+
onSuiteEnd(_result) {
|
|
88
|
+
// No-op for JSON reporter
|
|
89
|
+
}
|
|
90
|
+
onSuiteStart(_suite) {
|
|
91
|
+
// No-op for JSON reporter
|
|
92
|
+
}
|
|
93
|
+
onTaskResult(result) {
|
|
94
|
+
if (!result.error) {
|
|
95
|
+
this.updateStatistics(result);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
onTaskStart(_task) {
|
|
99
|
+
// No-op for JSON reporter
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Build the complete JSON output structure
|
|
103
|
+
*/
|
|
104
|
+
buildJsonOutput(run) {
|
|
105
|
+
const output = {
|
|
106
|
+
meta: {
|
|
107
|
+
format: 'modestbench-json',
|
|
108
|
+
timestamp: new Date().toISOString(),
|
|
109
|
+
version: '0.1.0', // TODO: Get from package.json
|
|
110
|
+
},
|
|
111
|
+
run: this.includeMetadata ? run : this.sanitizeRun(run),
|
|
112
|
+
};
|
|
113
|
+
if (this.includeStatistics) {
|
|
114
|
+
const stats = {
|
|
115
|
+
averageOpsPerSecond: this.statistics.taskCount > 0
|
|
116
|
+
? this.statistics.totalOpsPerSecond / this.statistics.taskCount
|
|
117
|
+
: 0,
|
|
118
|
+
totalIterations: this.statistics.totalIterations,
|
|
119
|
+
...(this.statistics.fastestTask && {
|
|
120
|
+
fastestTask: this.statistics.fastestTask,
|
|
121
|
+
}),
|
|
122
|
+
...(this.statistics.slowestTask && {
|
|
123
|
+
slowestTask: this.statistics.slowestTask,
|
|
124
|
+
}),
|
|
125
|
+
};
|
|
126
|
+
output.statistics = stats;
|
|
127
|
+
}
|
|
128
|
+
return output;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Reset statistics tracking
|
|
132
|
+
*/
|
|
133
|
+
resetStatistics() {
|
|
134
|
+
this.statistics = {
|
|
135
|
+
taskCount: 0,
|
|
136
|
+
totalIterations: 0,
|
|
137
|
+
totalOpsPerSecond: 0,
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Remove potentially sensitive metadata from run data
|
|
142
|
+
*/
|
|
143
|
+
sanitizeRun(run) {
|
|
144
|
+
let sanitized = {
|
|
145
|
+
...run,
|
|
146
|
+
environment: {
|
|
147
|
+
...run.environment,
|
|
148
|
+
env: {}, // Remove environment variables
|
|
149
|
+
hostname: 'redacted', // Remove hostname
|
|
150
|
+
},
|
|
151
|
+
};
|
|
152
|
+
if (run.git) {
|
|
153
|
+
sanitized = {
|
|
154
|
+
...sanitized,
|
|
155
|
+
git: {
|
|
156
|
+
...run.git,
|
|
157
|
+
author: 'redacted', // Remove author info
|
|
158
|
+
},
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
return sanitized;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Update running statistics with a task result
|
|
165
|
+
*/
|
|
166
|
+
updateStatistics(result) {
|
|
167
|
+
this.statistics.totalIterations += result.iterations;
|
|
168
|
+
this.statistics.totalOpsPerSecond += result.opsPerSecond;
|
|
169
|
+
this.statistics.taskCount++;
|
|
170
|
+
// Track fastest task
|
|
171
|
+
if (!this.statistics.fastestTask ||
|
|
172
|
+
result.mean < this.statistics.fastestTask.mean) {
|
|
173
|
+
this.statistics.fastestTask = result;
|
|
174
|
+
}
|
|
175
|
+
// Track slowest task
|
|
176
|
+
if (!this.statistics.slowestTask ||
|
|
177
|
+
result.mean > this.statistics.slowestTask.mean) {
|
|
178
|
+
this.statistics.slowestTask = result;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* Write JSON output to file
|
|
183
|
+
*/
|
|
184
|
+
async writeToFile(output) {
|
|
185
|
+
if (!this.outputPath) {
|
|
186
|
+
throw new Error('Output path not specified');
|
|
187
|
+
}
|
|
188
|
+
try {
|
|
189
|
+
// Ensure directory exists
|
|
190
|
+
const dir = (0, node_path_1.dirname)(this.outputPath);
|
|
191
|
+
(0, node_fs_1.mkdirSync)(dir, { recursive: true });
|
|
192
|
+
// Write JSON file
|
|
193
|
+
const jsonString = this.prettyPrint
|
|
194
|
+
? JSON.stringify(output, null, 2)
|
|
195
|
+
: JSON.stringify(output);
|
|
196
|
+
(0, node_fs_1.writeFileSync)(this.outputPath, jsonString, 'utf8');
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
throw new Error(`Failed to write JSON output to ${this.outputPath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Write JSON output to stdout
|
|
204
|
+
*/
|
|
205
|
+
writeToStdout(output) {
|
|
206
|
+
// Always write to stdout when no output path is specified
|
|
207
|
+
// The quiet flag only affects progress messages (stderr), not data output
|
|
208
|
+
const jsonString = this.prettyPrint
|
|
209
|
+
? JSON.stringify(output, null, 2)
|
|
210
|
+
: JSON.stringify(output);
|
|
211
|
+
console.log(jsonString);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
exports.JsonReporter = JsonReporter;
|
|
215
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/reporters/json.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,qCAAmD;AACnD,yCAAoC;AAUpC,gDAA6C;AAuB7C;;GAEG;AACH,MAAa,YAAa,SAAQ,0BAAY;IACp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AAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAC/G,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACK,aAAa,CAAC,MAAkB;QACtC,0DAA0D;QAC1D,0EAA0E;QAC1E,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW;YACjC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;YACjC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;QAE3B,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;IAC1B,CAAC;CACF;AAjQD,oCAiQC"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModestBench JSON Reporter
|
|
3
|
+
*
|
|
4
|
+
* Outputs benchmark results in structured JSON format. Suitable for machine
|
|
5
|
+
* processing, CI/CD integration, and data analysis.
|
|
6
|
+
*/
|
|
7
|
+
import type { BenchmarkRun, FileResult, ProgressState, SuiteResult, TaskResult } from "../types/index.cjs";
|
|
8
|
+
import { BaseReporter } from "./registry.cjs";
|
|
9
|
+
/**
|
|
10
|
+
* JSON reporter for structured output
|
|
11
|
+
*/
|
|
12
|
+
export declare class JsonReporter extends BaseReporter {
|
|
13
|
+
private currentRun?;
|
|
14
|
+
private readonly includeMetadata;
|
|
15
|
+
private readonly includeStatistics;
|
|
16
|
+
private readonly outputPath?;
|
|
17
|
+
private readonly prettyPrint;
|
|
18
|
+
private readonly quiet;
|
|
19
|
+
private statistics;
|
|
20
|
+
constructor(options?: {
|
|
21
|
+
includeMetadata?: boolean;
|
|
22
|
+
includeStatistics?: boolean;
|
|
23
|
+
outputPath?: string;
|
|
24
|
+
prettyPrint?: boolean;
|
|
25
|
+
quiet?: boolean;
|
|
26
|
+
verbose?: boolean;
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Check if statistics are included
|
|
30
|
+
*/
|
|
31
|
+
areStatisticsIncluded(): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Get the output path (if configured)
|
|
34
|
+
*/
|
|
35
|
+
getOutputPath(): string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Check if metadata is included
|
|
38
|
+
*/
|
|
39
|
+
isMetadataIncluded(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Check if pretty printing is enabled
|
|
42
|
+
*/
|
|
43
|
+
isPrettyPrintEnabled(): boolean;
|
|
44
|
+
onEnd(run: BenchmarkRun): Promise<void>;
|
|
45
|
+
onError(error: Error): void;
|
|
46
|
+
onFileEnd(_result: FileResult): void;
|
|
47
|
+
onFileStart(_file: string): void;
|
|
48
|
+
onProgress(_state: ProgressState): void;
|
|
49
|
+
onStart(run: BenchmarkRun): void;
|
|
50
|
+
onSuiteEnd(_result: SuiteResult): void;
|
|
51
|
+
onSuiteStart(_suite: string): void;
|
|
52
|
+
onTaskResult(result: TaskResult): void;
|
|
53
|
+
onTaskStart(_task: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Build the complete JSON output structure
|
|
56
|
+
*/
|
|
57
|
+
private buildJsonOutput;
|
|
58
|
+
/**
|
|
59
|
+
* Reset statistics tracking
|
|
60
|
+
*/
|
|
61
|
+
private resetStatistics;
|
|
62
|
+
/**
|
|
63
|
+
* Remove potentially sensitive metadata from run data
|
|
64
|
+
*/
|
|
65
|
+
private sanitizeRun;
|
|
66
|
+
/**
|
|
67
|
+
* Update running statistics with a task result
|
|
68
|
+
*/
|
|
69
|
+
private updateStatistics;
|
|
70
|
+
/**
|
|
71
|
+
* Write JSON output to file
|
|
72
|
+
*/
|
|
73
|
+
private writeToFile;
|
|
74
|
+
/**
|
|
75
|
+
* Write JSON output to stdout
|
|
76
|
+
*/
|
|
77
|
+
private writeToStdout;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","s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AAY,GAAG,IAAI;IAKhC,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAItC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIlC,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAMtC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhC;;OAEG;IACH,OAAO,CAAC,eAAe;IA+BvB;;OAEG;IACH,OAAO,CAAC,eAAe;IAQvB;;OAEG;IACH,OAAO,CAAC,WAAW;IAuBnB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAsBxB;;OAEG;YACW,WAAW;IAuBzB;;OAEG;IACH,OAAO,CAAC,aAAa;CAStB"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModestBench JSON Reporter
|
|
3
|
+
*
|
|
4
|
+
* Outputs benchmark results in structured JSON format. Suitable for machine
|
|
5
|
+
* processing, CI/CD integration, and data analysis.
|
|
6
|
+
*/
|
|
7
|
+
import type { BenchmarkRun, FileResult, ProgressState, SuiteResult, TaskResult } from "../types/index.js";
|
|
8
|
+
import { BaseReporter } from "./registry.js";
|
|
9
|
+
/**
|
|
10
|
+
* JSON reporter for structured output
|
|
11
|
+
*/
|
|
12
|
+
export declare class JsonReporter extends BaseReporter {
|
|
13
|
+
private currentRun?;
|
|
14
|
+
private readonly includeMetadata;
|
|
15
|
+
private readonly includeStatistics;
|
|
16
|
+
private readonly outputPath?;
|
|
17
|
+
private readonly prettyPrint;
|
|
18
|
+
private readonly quiet;
|
|
19
|
+
private statistics;
|
|
20
|
+
constructor(options?: {
|
|
21
|
+
includeMetadata?: boolean;
|
|
22
|
+
includeStatistics?: boolean;
|
|
23
|
+
outputPath?: string;
|
|
24
|
+
prettyPrint?: boolean;
|
|
25
|
+
quiet?: boolean;
|
|
26
|
+
verbose?: boolean;
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Check if statistics are included
|
|
30
|
+
*/
|
|
31
|
+
areStatisticsIncluded(): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Get the output path (if configured)
|
|
34
|
+
*/
|
|
35
|
+
getOutputPath(): string | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* Check if metadata is included
|
|
38
|
+
*/
|
|
39
|
+
isMetadataIncluded(): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Check if pretty printing is enabled
|
|
42
|
+
*/
|
|
43
|
+
isPrettyPrintEnabled(): boolean;
|
|
44
|
+
onEnd(run: BenchmarkRun): Promise<void>;
|
|
45
|
+
onError(error: Error): void;
|
|
46
|
+
onFileEnd(_result: FileResult): void;
|
|
47
|
+
onFileStart(_file: string): void;
|
|
48
|
+
onProgress(_state: ProgressState): void;
|
|
49
|
+
onStart(run: BenchmarkRun): void;
|
|
50
|
+
onSuiteEnd(_result: SuiteResult): void;
|
|
51
|
+
onSuiteStart(_suite: string): void;
|
|
52
|
+
onTaskResult(result: TaskResult): void;
|
|
53
|
+
onTaskStart(_task: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Build the complete JSON output structure
|
|
56
|
+
*/
|
|
57
|
+
private buildJsonOutput;
|
|
58
|
+
/**
|
|
59
|
+
* Reset statistics tracking
|
|
60
|
+
*/
|
|
61
|
+
private resetStatistics;
|
|
62
|
+
/**
|
|
63
|
+
* Remove potentially sensitive metadata from run data
|
|
64
|
+
*/
|
|
65
|
+
private sanitizeRun;
|
|
66
|
+
/**
|
|
67
|
+
* Update running statistics with a task result
|
|
68
|
+
*/
|
|
69
|
+
private updateStatistics;
|
|
70
|
+
/**
|
|
71
|
+
* Write JSON output to file
|
|
72
|
+
*/
|
|
73
|
+
private writeToFile;
|
|
74
|
+
/**
|
|
75
|
+
* Write JSON output to stdout
|
|
76
|
+
*/
|
|
77
|
+
private writeToStdout;
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=json.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceR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EAAE,YAAY,GAAG,IAAI;IAKhC,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAItC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAIlC,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAMtC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI;IAIhC;;OAEG;IACH,OAAO,CAAC,eAAe;IA+BvB;;OAEG;IACH,OAAO,CAAC,eAAe;IAQvB;;OAEG;IACH,OAAO,CAAC,WAAW;IAuBnB;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAsBxB;;OAEG;YACW,WAAW;IAuBzB;;OAEG;IACH,OAAO,CAAC,aAAa;CAStB"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ModestBench JSON Reporter
|
|
3
|
+
*
|
|
4
|
+
* Outputs benchmark results in structured JSON format. Suitable for machine
|
|
5
|
+
* processing, CI/CD integration, and data analysis.
|
|
6
|
+
*/
|
|
7
|
+
import { mkdirSync, writeFileSync } from 'node:fs';
|
|
8
|
+
import { dirname } from 'node:path';
|
|
9
|
+
import { BaseReporter } from "./registry.js";
|
|
10
|
+
/**
|
|
11
|
+
* JSON reporter for structured output
|
|
12
|
+
*/
|
|
13
|
+
export class JsonReporter extends BaseReporter {
|
|
14
|
+
currentRun;
|
|
15
|
+
includeMetadata;
|
|
16
|
+
includeStatistics;
|
|
17
|
+
outputPath;
|
|
18
|
+
prettyPrint;
|
|
19
|
+
quiet;
|
|
20
|
+
statistics = {
|
|
21
|
+
taskCount: 0,
|
|
22
|
+
totalIterations: 0,
|
|
23
|
+
totalOpsPerSecond: 0,
|
|
24
|
+
};
|
|
25
|
+
constructor(options = {}) {
|
|
26
|
+
super('json', options);
|
|
27
|
+
this.outputPath = options.outputPath;
|
|
28
|
+
this.prettyPrint = options.prettyPrint ?? true;
|
|
29
|
+
this.includeStatistics = options.includeStatistics ?? true;
|
|
30
|
+
this.includeMetadata = options.includeMetadata ?? true;
|
|
31
|
+
this.quiet = options.quiet ?? false;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Check if statistics are included
|
|
35
|
+
*/
|
|
36
|
+
areStatisticsIncluded() {
|
|
37
|
+
return this.includeStatistics;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Get the output path (if configured)
|
|
41
|
+
*/
|
|
42
|
+
getOutputPath() {
|
|
43
|
+
return this.outputPath;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Check if metadata is included
|
|
47
|
+
*/
|
|
48
|
+
isMetadataIncluded() {
|
|
49
|
+
return this.includeMetadata;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Check if pretty printing is enabled
|
|
53
|
+
*/
|
|
54
|
+
isPrettyPrintEnabled() {
|
|
55
|
+
return this.prettyPrint;
|
|
56
|
+
}
|
|
57
|
+
async onEnd(run) {
|
|
58
|
+
const output = this.buildJsonOutput(run);
|
|
59
|
+
if (this.outputPath) {
|
|
60
|
+
await this.writeToFile(output);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
this.writeToStdout(output);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
onError(error) {
|
|
67
|
+
// For JSON reporter, we'll include errors in the final output
|
|
68
|
+
// but we can also log to stderr for immediate feedback
|
|
69
|
+
console.error('JSON Reporter Error:', error.message);
|
|
70
|
+
}
|
|
71
|
+
onFileEnd(_result) {
|
|
72
|
+
// No-op for JSON reporter
|
|
73
|
+
}
|
|
74
|
+
onFileStart(_file) {
|
|
75
|
+
// No-op for JSON reporter
|
|
76
|
+
}
|
|
77
|
+
onProgress(_state) {
|
|
78
|
+
// No-op for JSON reporter - we don't output progress in JSON format
|
|
79
|
+
}
|
|
80
|
+
onStart(run) {
|
|
81
|
+
this.currentRun = run;
|
|
82
|
+
this.resetStatistics();
|
|
83
|
+
}
|
|
84
|
+
onSuiteEnd(_result) {
|
|
85
|
+
// No-op for JSON reporter
|
|
86
|
+
}
|
|
87
|
+
onSuiteStart(_suite) {
|
|
88
|
+
// No-op for JSON reporter
|
|
89
|
+
}
|
|
90
|
+
onTaskResult(result) {
|
|
91
|
+
if (!result.error) {
|
|
92
|
+
this.updateStatistics(result);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
onTaskStart(_task) {
|
|
96
|
+
// No-op for JSON reporter
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Build the complete JSON output structure
|
|
100
|
+
*/
|
|
101
|
+
buildJsonOutput(run) {
|
|
102
|
+
const output = {
|
|
103
|
+
meta: {
|
|
104
|
+
format: 'modestbench-json',
|
|
105
|
+
timestamp: new Date().toISOString(),
|
|
106
|
+
version: '0.1.0', // TODO: Get from package.json
|
|
107
|
+
},
|
|
108
|
+
run: this.includeMetadata ? run : this.sanitizeRun(run),
|
|
109
|
+
};
|
|
110
|
+
if (this.includeStatistics) {
|
|
111
|
+
const stats = {
|
|
112
|
+
averageOpsPerSecond: this.statistics.taskCount > 0
|
|
113
|
+
? this.statistics.totalOpsPerSecond / this.statistics.taskCount
|
|
114
|
+
: 0,
|
|
115
|
+
totalIterations: this.statistics.totalIterations,
|
|
116
|
+
...(this.statistics.fastestTask && {
|
|
117
|
+
fastestTask: this.statistics.fastestTask,
|
|
118
|
+
}),
|
|
119
|
+
...(this.statistics.slowestTask && {
|
|
120
|
+
slowestTask: this.statistics.slowestTask,
|
|
121
|
+
}),
|
|
122
|
+
};
|
|
123
|
+
output.statistics = stats;
|
|
124
|
+
}
|
|
125
|
+
return output;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Reset statistics tracking
|
|
129
|
+
*/
|
|
130
|
+
resetStatistics() {
|
|
131
|
+
this.statistics = {
|
|
132
|
+
taskCount: 0,
|
|
133
|
+
totalIterations: 0,
|
|
134
|
+
totalOpsPerSecond: 0,
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Remove potentially sensitive metadata from run data
|
|
139
|
+
*/
|
|
140
|
+
sanitizeRun(run) {
|
|
141
|
+
let sanitized = {
|
|
142
|
+
...run,
|
|
143
|
+
environment: {
|
|
144
|
+
...run.environment,
|
|
145
|
+
env: {}, // Remove environment variables
|
|
146
|
+
hostname: 'redacted', // Remove hostname
|
|
147
|
+
},
|
|
148
|
+
};
|
|
149
|
+
if (run.git) {
|
|
150
|
+
sanitized = {
|
|
151
|
+
...sanitized,
|
|
152
|
+
git: {
|
|
153
|
+
...run.git,
|
|
154
|
+
author: 'redacted', // Remove author info
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
return sanitized;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Update running statistics with a task result
|
|
162
|
+
*/
|
|
163
|
+
updateStatistics(result) {
|
|
164
|
+
this.statistics.totalIterations += result.iterations;
|
|
165
|
+
this.statistics.totalOpsPerSecond += result.opsPerSecond;
|
|
166
|
+
this.statistics.taskCount++;
|
|
167
|
+
// Track fastest task
|
|
168
|
+
if (!this.statistics.fastestTask ||
|
|
169
|
+
result.mean < this.statistics.fastestTask.mean) {
|
|
170
|
+
this.statistics.fastestTask = result;
|
|
171
|
+
}
|
|
172
|
+
// Track slowest task
|
|
173
|
+
if (!this.statistics.slowestTask ||
|
|
174
|
+
result.mean > this.statistics.slowestTask.mean) {
|
|
175
|
+
this.statistics.slowestTask = result;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Write JSON output to file
|
|
180
|
+
*/
|
|
181
|
+
async writeToFile(output) {
|
|
182
|
+
if (!this.outputPath) {
|
|
183
|
+
throw new Error('Output path not specified');
|
|
184
|
+
}
|
|
185
|
+
try {
|
|
186
|
+
// Ensure directory exists
|
|
187
|
+
const dir = dirname(this.outputPath);
|
|
188
|
+
mkdirSync(dir, { recursive: true });
|
|
189
|
+
// Write JSON file
|
|
190
|
+
const jsonString = this.prettyPrint
|
|
191
|
+
? JSON.stringify(output, null, 2)
|
|
192
|
+
: JSON.stringify(output);
|
|
193
|
+
writeFileSync(this.outputPath, jsonString, 'utf8');
|
|
194
|
+
}
|
|
195
|
+
catch (error) {
|
|
196
|
+
throw new Error(`Failed to write JSON output to ${this.outputPath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Write JSON output to stdout
|
|
201
|
+
*/
|
|
202
|
+
writeToStdout(output) {
|
|
203
|
+
// Always write to stdout when no output path is specified
|
|
204
|
+
// The quiet flag only affects progress messages (stderr), not data output
|
|
205
|
+
const jsonString = this.prettyPrint
|
|
206
|
+
? JSON.stringify(output, null, 2)
|
|
207
|
+
: JSON.stringify(output);
|
|
208
|
+
console.log(jsonString);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/reporters/json.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUpC,OAAO,EAAE,YAAY,EAAE,sBAAsB;AAuB7C;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,YAAY;IACpC,UAAU,CAAgB;IAEjB,eAAe,CAAU;IAEzB,iBAAiB,CAAU;IAE3B,UAAU,CAAsB;IAEhC,WAAW,CAAU;IAErB,KAAK,CAAU;IAExB,UAAU,GAMd;QACF,SAAS,EAAE,CAAC;QACZ,eAAe,EAAE,CAAC;QAClB,iBAAiB,EAAE,CAAC;KACrB,CAAC;IAEF,YACE,UAOI,EAAE;QAEN,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAEvB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;QACrC,IAAI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