ortoni-report 2.0.9 → 3.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/LICENSE.md +675 -675
- package/changelog.md +347 -305
- package/dist/chunk-ZSIRUQUA.mjs +68 -0
- package/dist/cli/cli.d.mts +1 -0
- package/dist/cli/cli.js +21 -25789
- package/dist/cli/cli.mjs +2 -3052
- package/dist/ortoni-report.d.mts +115 -0
- package/dist/ortoni-report.d.ts +109 -103
- package/dist/ortoni-report.js +105 -29430
- package/dist/ortoni-report.mjs +92 -6696
- package/dist/style/main.css +80 -93
- package/dist/views/head.hbs +10 -10
- package/dist/views/main.hbs +1248 -599
- package/dist/views/project.hbs +237 -237
- package/dist/views/sidebar.hbs +236 -0
- package/dist/views/summaryCard.hbs +14 -7
- package/dist/views/testIcons.hbs +12 -12
- package/dist/views/testPanel.hbs +44 -44
- package/dist/views/testStatus.hbs +8 -8
- package/dist/views/userInfo.hbs +270 -208
- package/package.json +55 -56
- package/readme.md +212 -178
- package/dist/chunk-RHM5OWYN.mjs +0 -22816
- package/dist/views/navbar.hbs +0 -36
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
2
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
3
|
+
}) : x)(function(x) {
|
|
4
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
5
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
// src/utils/expressServer.ts
|
|
9
|
+
import express from "express";
|
|
10
|
+
import path from "path";
|
|
11
|
+
import { spawn } from "child_process";
|
|
12
|
+
function startReportServer(reportFolder, reportFilename, port = 2004, open) {
|
|
13
|
+
const app = express();
|
|
14
|
+
app.use(express.static(reportFolder));
|
|
15
|
+
app.get("/", (_req, res) => {
|
|
16
|
+
try {
|
|
17
|
+
res.sendFile(path.resolve(reportFolder, reportFilename));
|
|
18
|
+
} catch (error) {
|
|
19
|
+
console.error("Ortoni-Report: Error sending report file:", error);
|
|
20
|
+
res.status(500).send("Error loading report");
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
try {
|
|
24
|
+
const server = app.listen(port, () => {
|
|
25
|
+
console.log(`Server is running at http://localhost:${port}
|
|
26
|
+
Press Ctrl+C to stop.`);
|
|
27
|
+
if (open === "always" || open === "on-failure") {
|
|
28
|
+
try {
|
|
29
|
+
openBrowser(`http://localhost:${port}`);
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error("Ortoni-Report: Error opening browser:", error);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
server.on("error", (error) => {
|
|
36
|
+
if (error.code === "EADDRINUSE") {
|
|
37
|
+
console.error(`Ortoni-Report: Port ${port} is already in use. Trying a different port...`);
|
|
38
|
+
} else {
|
|
39
|
+
console.error("Ortoni-Report: Server error:", error);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
} catch (error) {
|
|
43
|
+
console.error("Ortoni-Report: Error starting the server:", error);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function openBrowser(url) {
|
|
47
|
+
const platform = process.platform;
|
|
48
|
+
let command;
|
|
49
|
+
try {
|
|
50
|
+
if (platform === "win32") {
|
|
51
|
+
command = "cmd";
|
|
52
|
+
spawn(command, ["/c", "start", url]);
|
|
53
|
+
} else if (platform === "darwin") {
|
|
54
|
+
command = "open";
|
|
55
|
+
spawn(command, [url]);
|
|
56
|
+
} else {
|
|
57
|
+
command = "xdg-open";
|
|
58
|
+
spawn(command, [url]);
|
|
59
|
+
}
|
|
60
|
+
} catch (error) {
|
|
61
|
+
console.error("Ortoni-Report: Error opening the browser:", error);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export {
|
|
66
|
+
__require,
|
|
67
|
+
startReportServer
|
|
68
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#!/usr/bin/env node
|