ortoni-report 4.0.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.
- package/dist/chunk-4RZ5C7KY.mjs +744 -0
- package/dist/chunk-HOOC3MDY.mjs +632 -0
- package/dist/chunk-ISCRDMPY.mjs +693 -0
- package/dist/chunk-P72FKFLZ.mjs +692 -0
- package/dist/chunk-S45BZGXX.mjs +744 -0
- package/dist/chunk-ZG4JPYLC.mjs +692 -0
- package/dist/chunk-ZSPTPISU.mjs +692 -0
- package/dist/cli.js +911 -0
- package/dist/cli.mjs +206 -0
- package/dist/index.html +2 -2
- package/dist/ortoni-report.d.mts +8 -0
- package/dist/ortoni-report.d.ts +8 -0
- package/dist/ortoni-report.js +226 -82
- package/dist/ortoni-report.mjs +64 -576
- package/package.json +11 -4
- package/dist/chunk-A6HCKATU.mjs +0 -76
- package/dist/cli/cli.js +0 -106
- package/dist/cli/cli.mjs +0 -23
- /package/dist/{cli/cli.d.mts → cli.d.mts} +0 -0
- /package/dist/{cli/cli.d.ts → cli.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ortoni-report",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1-beta.3",
|
|
4
4
|
"description": "Playwright Report By LetCode with Koushik",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"tsc": "tsc",
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
"release": "npm publish"
|
|
9
9
|
},
|
|
10
10
|
"bin": {
|
|
11
|
-
"ortoni-report": "./dist/cli
|
|
11
|
+
"ortoni-report": "./dist/cli.js"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
|
-
"dist",
|
|
14
|
+
"dist/",
|
|
15
|
+
"dist/index.html",
|
|
15
16
|
"README.md",
|
|
16
17
|
"CHANGELOG.md"
|
|
17
18
|
],
|
|
@@ -52,5 +53,11 @@
|
|
|
52
53
|
},
|
|
53
54
|
"main": "dist/ortoni-report.js",
|
|
54
55
|
"module": "dist/ortoni-report.mjs",
|
|
55
|
-
"types": "dist/ortoni-report.d.ts"
|
|
56
|
+
"types": "dist/ortoni-report.d.ts",
|
|
57
|
+
"exports": {
|
|
58
|
+
".": {
|
|
59
|
+
"require": "./dist/ortoni-report.js",
|
|
60
|
+
"import": "./dist/ortoni-report.mjs"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
56
63
|
}
|
package/dist/chunk-A6HCKATU.mjs
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
4
|
-
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
5
|
-
}) : x)(function(x) {
|
|
6
|
-
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
7
|
-
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
8
|
-
});
|
|
9
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
10
|
-
|
|
11
|
-
// src/utils/expressServer.ts
|
|
12
|
-
import express from "express";
|
|
13
|
-
import path from "path";
|
|
14
|
-
import { spawn } from "child_process";
|
|
15
|
-
function startReportServer(reportFolder, reportFilename, port = 2004, open) {
|
|
16
|
-
const app = express();
|
|
17
|
-
app.use(express.static(reportFolder));
|
|
18
|
-
app.get("/", (_req, res) => {
|
|
19
|
-
try {
|
|
20
|
-
res.sendFile(path.resolve(reportFolder, reportFilename));
|
|
21
|
-
} catch (error) {
|
|
22
|
-
console.error("Ortoni-Report: Error sending report file:", error);
|
|
23
|
-
res.status(500).send("Error loading report");
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
try {
|
|
27
|
-
const server = app.listen(port, () => {
|
|
28
|
-
console.log(
|
|
29
|
-
`Server is running at http://localhost:${port}
|
|
30
|
-
Press Ctrl+C to stop.`
|
|
31
|
-
);
|
|
32
|
-
if (open === "always" || open === "on-failure") {
|
|
33
|
-
try {
|
|
34
|
-
openBrowser(`http://localhost:${port}`);
|
|
35
|
-
} catch (error) {
|
|
36
|
-
console.error("Ortoni-Report: Error opening browser:", error);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
server.on("error", (error) => {
|
|
41
|
-
if (error.code === "EADDRINUSE") {
|
|
42
|
-
console.error(
|
|
43
|
-
`Ortoni-Report: Port ${port} is already in use. Trying a different port...`
|
|
44
|
-
);
|
|
45
|
-
} else {
|
|
46
|
-
console.error("Ortoni-Report: Server error:", error);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
} catch (error) {
|
|
50
|
-
console.error("Ortoni-Report: Error starting the server:", error);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function openBrowser(url) {
|
|
54
|
-
const platform = process.platform;
|
|
55
|
-
let command;
|
|
56
|
-
try {
|
|
57
|
-
if (platform === "win32") {
|
|
58
|
-
command = "cmd";
|
|
59
|
-
spawn(command, ["/c", "start", url]);
|
|
60
|
-
} else if (platform === "darwin") {
|
|
61
|
-
command = "open";
|
|
62
|
-
spawn(command, [url]);
|
|
63
|
-
} else {
|
|
64
|
-
command = "xdg-open";
|
|
65
|
-
spawn(command, [url]);
|
|
66
|
-
}
|
|
67
|
-
} catch (error) {
|
|
68
|
-
console.error("Ortoni-Report: Error opening the browser:", error);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export {
|
|
73
|
-
__require,
|
|
74
|
-
__publicField,
|
|
75
|
-
startReportServer
|
|
76
|
-
};
|
package/dist/cli/cli.js
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
var __create = Object.create;
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
-
}
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
-
mod
|
|
24
|
-
));
|
|
25
|
-
|
|
26
|
-
// src/cli/cli.ts
|
|
27
|
-
var import_commander = require("commander");
|
|
28
|
-
|
|
29
|
-
// src/utils/expressServer.ts
|
|
30
|
-
var import_express = __toESM(require("express"));
|
|
31
|
-
var import_path = __toESM(require("path"));
|
|
32
|
-
var import_child_process = require("child_process");
|
|
33
|
-
function startReportServer(reportFolder, reportFilename, port = 2004, open) {
|
|
34
|
-
const app = (0, import_express.default)();
|
|
35
|
-
app.use(import_express.default.static(reportFolder));
|
|
36
|
-
app.get("/", (_req, res) => {
|
|
37
|
-
try {
|
|
38
|
-
res.sendFile(import_path.default.resolve(reportFolder, reportFilename));
|
|
39
|
-
} catch (error) {
|
|
40
|
-
console.error("Ortoni-Report: Error sending report file:", error);
|
|
41
|
-
res.status(500).send("Error loading report");
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
try {
|
|
45
|
-
const server = app.listen(port, () => {
|
|
46
|
-
console.log(
|
|
47
|
-
`Server is running at http://localhost:${port}
|
|
48
|
-
Press Ctrl+C to stop.`
|
|
49
|
-
);
|
|
50
|
-
if (open === "always" || open === "on-failure") {
|
|
51
|
-
try {
|
|
52
|
-
openBrowser(`http://localhost:${port}`);
|
|
53
|
-
} catch (error) {
|
|
54
|
-
console.error("Ortoni-Report: Error opening browser:", error);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
server.on("error", (error) => {
|
|
59
|
-
if (error.code === "EADDRINUSE") {
|
|
60
|
-
console.error(
|
|
61
|
-
`Ortoni-Report: Port ${port} is already in use. Trying a different port...`
|
|
62
|
-
);
|
|
63
|
-
} else {
|
|
64
|
-
console.error("Ortoni-Report: Server error:", error);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
} catch (error) {
|
|
68
|
-
console.error("Ortoni-Report: Error starting the server:", error);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
function openBrowser(url) {
|
|
72
|
-
const platform = process.platform;
|
|
73
|
-
let command;
|
|
74
|
-
try {
|
|
75
|
-
if (platform === "win32") {
|
|
76
|
-
command = "cmd";
|
|
77
|
-
(0, import_child_process.spawn)(command, ["/c", "start", url]);
|
|
78
|
-
} else if (platform === "darwin") {
|
|
79
|
-
command = "open";
|
|
80
|
-
(0, import_child_process.spawn)(command, [url]);
|
|
81
|
-
} else {
|
|
82
|
-
command = "xdg-open";
|
|
83
|
-
(0, import_child_process.spawn)(command, [url]);
|
|
84
|
-
}
|
|
85
|
-
} catch (error) {
|
|
86
|
-
console.error("Ortoni-Report: Error opening the browser:", error);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// src/cli/cli.ts
|
|
91
|
-
var fs = __toESM(require("fs"));
|
|
92
|
-
var path2 = __toESM(require("path"));
|
|
93
|
-
import_commander.program.version("2.0.9").description("Ortoni Playwright Test Report CLI");
|
|
94
|
-
import_commander.program.command("show-report").description("Open the generated Ortoni report").option("-d, --dir <path>", "Path to the folder containing the report", "ortoni-report").option("-f, --file <filename>", "Name of the report file", "ortoni-report.html").option("-p, --port <port>", "Number of the port", "2004").action((options) => {
|
|
95
|
-
const projectRoot = process.cwd();
|
|
96
|
-
const folderPath = path2.resolve(projectRoot, options.dir);
|
|
97
|
-
const filePath = path2.resolve(folderPath, options.file);
|
|
98
|
-
const port = parseInt(options.port) || 2004;
|
|
99
|
-
const fullFilePath = path2.resolve(process.cwd(), folderPath, filePath);
|
|
100
|
-
if (!fs.existsSync(fullFilePath)) {
|
|
101
|
-
console.error(`Error: The file "${filePath}" does not exist in the folder "${folderPath}".`);
|
|
102
|
-
process.exit(1);
|
|
103
|
-
}
|
|
104
|
-
startReportServer(folderPath, path2.basename(filePath), port, "always");
|
|
105
|
-
});
|
|
106
|
-
import_commander.program.parse(process.argv);
|
package/dist/cli/cli.mjs
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
startReportServer
|
|
4
|
-
} from "../chunk-A6HCKATU.mjs";
|
|
5
|
-
|
|
6
|
-
// src/cli/cli.ts
|
|
7
|
-
import { program } from "commander";
|
|
8
|
-
import * as fs from "fs";
|
|
9
|
-
import * as path from "path";
|
|
10
|
-
program.version("2.0.9").description("Ortoni Playwright Test Report CLI");
|
|
11
|
-
program.command("show-report").description("Open the generated Ortoni report").option("-d, --dir <path>", "Path to the folder containing the report", "ortoni-report").option("-f, --file <filename>", "Name of the report file", "ortoni-report.html").option("-p, --port <port>", "Number of the port", "2004").action((options) => {
|
|
12
|
-
const projectRoot = process.cwd();
|
|
13
|
-
const folderPath = path.resolve(projectRoot, options.dir);
|
|
14
|
-
const filePath = path.resolve(folderPath, options.file);
|
|
15
|
-
const port = parseInt(options.port) || 2004;
|
|
16
|
-
const fullFilePath = path.resolve(process.cwd(), folderPath, filePath);
|
|
17
|
-
if (!fs.existsSync(fullFilePath)) {
|
|
18
|
-
console.error(`Error: The file "${filePath}" does not exist in the folder "${folderPath}".`);
|
|
19
|
-
process.exit(1);
|
|
20
|
-
}
|
|
21
|
-
startReportServer(folderPath, path.basename(filePath), port, "always");
|
|
22
|
-
});
|
|
23
|
-
program.parse(process.argv);
|
|
File without changes
|
|
File without changes
|