ortoni-report 4.0.1-beta.0 → 4.0.1-beta.3

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.
Files changed (37) hide show
  1. package/dist/chunk-4RZ5C7KY.mjs +744 -0
  2. package/dist/{chunk-MPZLDOCN.mjs → chunk-HOOC3MDY.mjs} +305 -304
  3. package/dist/chunk-ISCRDMPY.mjs +693 -0
  4. package/dist/{chunk-INS3E7E6.mjs → chunk-P72FKFLZ.mjs} +352 -298
  5. package/dist/chunk-S45BZGXX.mjs +744 -0
  6. package/dist/{chunk-OZS6QIJS.mjs → chunk-ZG4JPYLC.mjs} +352 -298
  7. package/dist/{chunk-TI33PMMQ.mjs → chunk-ZSPTPISU.mjs} +352 -299
  8. package/dist/{cli/cli.js → cli.js} +403 -189
  9. package/dist/cli.mjs +206 -0
  10. package/dist/index.html +2 -2
  11. package/dist/ortoni-report.d.mts +7 -0
  12. package/dist/ortoni-report.d.ts +7 -0
  13. package/dist/ortoni-report.js +189 -72
  14. package/dist/ortoni-report.mjs +9 -5
  15. package/package.json +11 -4
  16. package/dist/chunk-45EJSEX2.mjs +0 -632
  17. package/dist/chunk-75EAJL2U.mjs +0 -632
  18. package/dist/chunk-A6HCKATU.mjs +0 -76
  19. package/dist/chunk-FGIYOFIC.mjs +0 -632
  20. package/dist/chunk-FHKWBHU6.mjs +0 -633
  21. package/dist/chunk-GLICR3VS.mjs +0 -637
  22. package/dist/chunk-HFO6XSKC.mjs +0 -633
  23. package/dist/chunk-HOZD6YIV.mjs +0 -634
  24. package/dist/chunk-IJO2YIFE.mjs +0 -637
  25. package/dist/chunk-JEIWNUQY.mjs +0 -632
  26. package/dist/chunk-JPLAGYR7.mjs +0 -632
  27. package/dist/chunk-NM6ULN2O.mjs +0 -632
  28. package/dist/chunk-P57227VN.mjs +0 -633
  29. package/dist/chunk-QMTRYN5N.js +0 -635
  30. package/dist/chunk-Z5NBP5TS.mjs +0 -635
  31. package/dist/cli/cli.cjs +0 -678
  32. package/dist/cli/cli.d.cts +0 -1
  33. package/dist/cli/cli.mjs +0 -103
  34. package/dist/ortoni-report.cjs +0 -2134
  35. package/dist/ortoni-report.d.cts +0 -111
  36. /package/dist/{cli/cli.d.mts → cli.d.mts} +0 -0
  37. /package/dist/{cli/cli.d.ts → cli.d.ts} +0 -0
package/dist/cli/cli.mjs DELETED
@@ -1,103 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- DatabaseManager,
4
- FileManager,
5
- HTMLGenerator,
6
- startReportServer
7
- } from "../chunk-MPZLDOCN.mjs";
8
-
9
- // src/cli/cli.ts
10
- import { program } from "commander";
11
- import * as fs2 from "fs";
12
- import * as path2 from "path";
13
-
14
- // src/cli/mergeData.ts
15
- import * as fs from "fs";
16
- import * as path from "path";
17
- async function mergeAllData(options) {
18
- const projectRoot = process.cwd();
19
- const folderPath = path.resolve(projectRoot, options.dir || "ortoni-report");
20
- console.info(`Ortoni Report: Merging shard files in folder: ${folderPath}`);
21
- const shardFiles = fs.readdirSync(folderPath).filter((f) => f.startsWith("ortoni-shard-") && f.endsWith(".json"));
22
- if (shardFiles.length === 0) {
23
- console.error("Ortoni Report: \u274C No shard files found to merge.");
24
- process.exit(1);
25
- }
26
- let allResults = [];
27
- let projectSet = /* @__PURE__ */ new Set();
28
- let totalDuration = 0;
29
- let mergedUserConfig = null;
30
- let mergedUserMeta = null;
31
- for (const file of shardFiles) {
32
- const shardData = JSON.parse(
33
- fs.readFileSync(path.join(folderPath, file), "utf-8")
34
- );
35
- allResults.push(...shardData.results);
36
- shardData.projectSet.forEach((p) => projectSet.add(p));
37
- totalDuration += shardData.duration;
38
- if (!mergedUserConfig && shardData.userConfig)
39
- mergedUserConfig = shardData.userConfig;
40
- if (!mergedUserMeta && shardData.userMeta)
41
- mergedUserMeta = shardData.userMeta;
42
- }
43
- const dbManager = new DatabaseManager();
44
- await dbManager.initialize(
45
- path.join(folderPath, "ortoni-data-history.sqlite")
46
- );
47
- const runId = await dbManager.saveTestRun();
48
- if (typeof runId === "number") {
49
- await dbManager.saveTestResults(runId, allResults);
50
- } else {
51
- console.error("Ortoni Report: \u274C Failed to save test run to database.");
52
- }
53
- const htmlGenerator = new HTMLGenerator(
54
- { ...mergedUserConfig, meta: mergedUserMeta?.meta },
55
- dbManager
56
- );
57
- const finalReportData = await htmlGenerator.generateFinalReport(
58
- allResults.filter((r) => r.status !== "skipped"),
59
- totalDuration,
60
- allResults,
61
- projectSet
62
- );
63
- const fileManager = new FileManager(folderPath);
64
- const outputFileName = options.file || "ortoni-report.html";
65
- const outputFilenamePath = path.join(folderPath, outputFileName);
66
- const outputPath = fileManager.writeReportFile(
67
- outputFilenamePath,
68
- finalReportData
69
- );
70
- console.log(`\u2705 Final merged report generated at ${outputPath}`);
71
- }
72
-
73
- // src/cli/cli.ts
74
- program.version("4.0.1").description("Ortoni Report - CLI");
75
- program.command("show-report").description("Open Ortoni Report").option(
76
- "-d, --dir <path>",
77
- "Path to the folder containing the report",
78
- "ortoni-report"
79
- ).option(
80
- "-f, --file <filename>",
81
- "Name of the report file",
82
- "ortoni-report.html"
83
- ).option("-p, --port <port>", "Port to run the server", "2004").action((options) => {
84
- const projectRoot = process.cwd();
85
- const folderPath = path2.resolve(projectRoot, options.dir);
86
- const filePath = path2.resolve(folderPath, options.file);
87
- const port = parseInt(options.port) || 2004;
88
- if (!fs2.existsSync(filePath)) {
89
- console.error(
90
- `\u274C Error: The file "${filePath}" does not exist in "${folderPath}".`
91
- );
92
- process.exit(1);
93
- }
94
- startReportServer(folderPath, path2.basename(filePath), port, "always");
95
- });
96
- program.command("merge-report").description("Merge sharded reports into one final report").option(
97
- "-d, --dir <path>",
98
- "Path to the folder containing shard files",
99
- "ortoni-report"
100
- ).option("-f, --file <filename>", "Output report file", "ortoni-report.html").action(async (options) => {
101
- await mergeAllData(options);
102
- });
103
- program.parse(process.argv);