laxy-verify 1.0.0 → 1.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/dist/badge.d.ts +1 -1
- package/dist/badge.js +14 -11
- package/dist/build.d.ts +11 -11
- package/dist/build.js +67 -59
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +292 -257
- package/dist/comment.d.ts +20 -20
- package/dist/comment.js +82 -46
- package/dist/config.d.ts +34 -34
- package/dist/config.js +156 -118
- package/dist/detect.d.ts +10 -10
- package/dist/detect.js +133 -97
- package/dist/github.d.ts +8 -8
- package/dist/github.js +14 -11
- package/dist/grade.d.ts +37 -37
- package/dist/grade.js +64 -57
- package/dist/init.d.ts +1 -1
- package/dist/init.js +91 -55
- package/dist/lighthouse.d.ts +7 -7
- package/dist/lighthouse.js +130 -94
- package/dist/serve.d.ts +12 -12
- package/dist/serve.js +126 -83
- package/dist/status.d.ts +6 -6
- package/dist/status.js +36 -33
- package/package.json +2 -2
package/dist/badge.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function generateBadge(grade: string): string;
|
|
1
|
+
export declare function generateBadge(grade: string): string;
|
package/dist/badge.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateBadge = generateBadge;
|
|
4
|
+
function generateBadge(grade) {
|
|
5
|
+
const gradeLower = grade.toLowerCase();
|
|
6
|
+
const colors = {
|
|
7
|
+
gold: "yellow",
|
|
8
|
+
silver: "brightgreen",
|
|
9
|
+
bronze: "blue",
|
|
10
|
+
unverified: "lightgrey",
|
|
11
|
+
};
|
|
12
|
+
const color = colors[gradeLower] ?? "lightgrey";
|
|
13
|
+
return ``;
|
|
14
|
+
}
|
package/dist/build.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export interface BuildResult {
|
|
2
|
-
success: boolean;
|
|
3
|
-
durationMs: number;
|
|
4
|
-
errors: string[];
|
|
5
|
-
}
|
|
6
|
-
export declare class BuildError extends Error {
|
|
7
|
-
errors: string[];
|
|
8
|
-
timedOut: boolean;
|
|
9
|
-
constructor(message: string, errors: string[], timedOut?: boolean);
|
|
10
|
-
}
|
|
11
|
-
export declare function runBuild(command: string, timeoutSec: number): Promise<BuildResult>;
|
|
1
|
+
export interface BuildResult {
|
|
2
|
+
success: boolean;
|
|
3
|
+
durationMs: number;
|
|
4
|
+
errors: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare class BuildError extends Error {
|
|
7
|
+
errors: string[];
|
|
8
|
+
timedOut: boolean;
|
|
9
|
+
constructor(message: string, errors: string[], timedOut?: boolean);
|
|
10
|
+
}
|
|
11
|
+
export declare function runBuild(command: string, timeoutSec: number): Promise<BuildResult>;
|
package/dist/build.js
CHANGED
|
@@ -1,59 +1,67 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.BuildError = void 0;
|
|
7
|
+
exports.runBuild = runBuild;
|
|
8
|
+
const node_child_process_1 = require("node:child_process");
|
|
9
|
+
const tree_kill_1 = __importDefault(require("tree-kill"));
|
|
10
|
+
class BuildError extends Error {
|
|
11
|
+
errors;
|
|
12
|
+
timedOut;
|
|
13
|
+
constructor(message, errors, timedOut = false) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.errors = errors;
|
|
16
|
+
this.timedOut = timedOut;
|
|
17
|
+
this.name = "BuildError";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.BuildError = BuildError;
|
|
21
|
+
function runBuild(command, timeoutSec) {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
const startTime = Date.now();
|
|
24
|
+
const stderrLines = [];
|
|
25
|
+
const errorLines = [];
|
|
26
|
+
console.log(`\n Building: ${command}`);
|
|
27
|
+
const proc = (0, node_child_process_1.spawn)(command, { shell: true, stdio: ["ignore", "pipe", "pipe"] });
|
|
28
|
+
let timedOut = false;
|
|
29
|
+
const timer = setTimeout(() => {
|
|
30
|
+
timedOut = true;
|
|
31
|
+
if (proc.pid) {
|
|
32
|
+
(0, tree_kill_1.default)(proc.pid, "SIGKILL");
|
|
33
|
+
}
|
|
34
|
+
reject(new BuildError(`Build timed out after ${timeoutSec}s`, errorLines, true));
|
|
35
|
+
}, timeoutSec * 1000);
|
|
36
|
+
proc.stdout?.on("data", (chunk) => {
|
|
37
|
+
// Print build output to console
|
|
38
|
+
const lines = chunk.toString().split("\n").filter(Boolean);
|
|
39
|
+
for (const line of lines) {
|
|
40
|
+
console.log(` ${line}`);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
proc.stderr?.on("data", (chunk) => {
|
|
44
|
+
const text = chunk.toString();
|
|
45
|
+
const lines = text.split("\n").filter(Boolean);
|
|
46
|
+
stderrLines.push(...lines);
|
|
47
|
+
errorLines.push(...lines);
|
|
48
|
+
for (const line of lines) {
|
|
49
|
+
console.error(` ${line}`);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
proc.on("exit", (code) => {
|
|
53
|
+
clearTimeout(timer);
|
|
54
|
+
const durationMs = Date.now() - startTime;
|
|
55
|
+
const success = code === 0;
|
|
56
|
+
resolve({
|
|
57
|
+
success,
|
|
58
|
+
durationMs,
|
|
59
|
+
errors: success ? [] : errorLines,
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
proc.on("error", (err) => {
|
|
63
|
+
clearTimeout(timer);
|
|
64
|
+
reject(new BuildError(`Build process failed: ${err.message}`, errorLines));
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
export {};
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
export {};
|