laxy-verify 1.2.0 → 1.2.2
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/README.md +12 -17
- package/dist/audit/broken-links.d.ts +21 -21
- package/dist/audit/broken-links.js +86 -86
- package/dist/auth.d.ts +11 -11
- package/dist/auth.js +222 -222
- package/dist/cli.js +868 -806
- package/dist/comment.d.ts +21 -21
- package/dist/comment.js +125 -125
- package/dist/config.d.ts +13 -0
- package/dist/config.js +43 -3
- package/dist/crawler.d.ts +36 -36
- package/dist/crawler.js +357 -357
- package/dist/e2e.d.ts +49 -49
- package/dist/e2e.js +565 -565
- package/dist/entitlement.d.ts +11 -11
- package/dist/entitlement.js +90 -90
- package/dist/init.js +87 -87
- package/dist/multi-viewport.d.ts +31 -31
- package/dist/multi-viewport.js +298 -298
- package/dist/playwright-runner.d.ts +16 -16
- package/dist/playwright-runner.js +208 -208
- package/dist/report-markdown.d.ts +39 -39
- package/dist/report-markdown.js +386 -386
- package/dist/security-audit.d.ts +9 -9
- package/dist/security-audit.js +64 -64
- package/dist/serve.d.ts +13 -13
- package/dist/serve.js +196 -196
- package/dist/trend.d.ts +50 -50
- package/dist/trend.js +148 -148
- package/dist/verification-core/index.d.ts +3 -3
- package/dist/verification-core/index.js +19 -19
- package/dist/verification-core/report.d.ts +14 -14
- package/dist/verification-core/report.js +409 -409
- package/dist/verification-core/tier-policy.d.ts +13 -13
- package/dist/verification-core/tier-policy.js +60 -60
- package/dist/verification-core/types.d.ts +108 -108
- package/dist/verification-core/types.js +2 -2
- package/dist/visual-diff.d.ts +26 -26
- package/dist/visual-diff.js +178 -178
- package/package.json +1 -1
package/dist/entitlement.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export interface EntitlementFeatures {
|
|
2
|
-
plan: string;
|
|
3
|
-
github_actions: boolean;
|
|
4
|
-
queue_priority: boolean;
|
|
5
|
-
parallel_execution: boolean;
|
|
6
|
-
}
|
|
7
|
-
export type TestablePlan = "free" | "pro" | "team";
|
|
8
|
-
export declare function normalizePlan(plan?: string | null): TestablePlan;
|
|
9
|
-
export declare function getEntitlements(): Promise<EntitlementFeatures>;
|
|
10
|
-
export declare function applyPlanOverride(features: EntitlementFeatures, overridePlan?: TestablePlan): EntitlementFeatures;
|
|
11
|
-
export declare function printPlanBanner(features: EntitlementFeatures): void;
|
|
1
|
+
export interface EntitlementFeatures {
|
|
2
|
+
plan: string;
|
|
3
|
+
github_actions: boolean;
|
|
4
|
+
queue_priority: boolean;
|
|
5
|
+
parallel_execution: boolean;
|
|
6
|
+
}
|
|
7
|
+
export type TestablePlan = "free" | "pro" | "team";
|
|
8
|
+
export declare function normalizePlan(plan?: string | null): TestablePlan;
|
|
9
|
+
export declare function getEntitlements(): Promise<EntitlementFeatures>;
|
|
10
|
+
export declare function applyPlanOverride(features: EntitlementFeatures, overridePlan?: TestablePlan): EntitlementFeatures;
|
|
11
|
+
export declare function printPlanBanner(features: EntitlementFeatures): void;
|
package/dist/entitlement.js
CHANGED
|
@@ -1,90 +1,90 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizePlan = normalizePlan;
|
|
4
|
-
exports.getEntitlements = getEntitlements;
|
|
5
|
-
exports.applyPlanOverride = applyPlanOverride;
|
|
6
|
-
exports.printPlanBanner = printPlanBanner;
|
|
7
|
-
/**
|
|
8
|
-
* Fetches account entitlements for laxy-verify.
|
|
9
|
-
*
|
|
10
|
-
* The CLI asks /api/v1/cli-entitlement for the current plan and enabled automation flags.
|
|
11
|
-
* Responses are cached briefly to avoid repeated network calls during a single run.
|
|
12
|
-
* If the request fails or the user is not logged in, the CLI safely falls back to the unlocked verification defaults.
|
|
13
|
-
*/
|
|
14
|
-
const auth_js_1 = require("./auth.js");
|
|
15
|
-
const FREE_FEATURES = {
|
|
16
|
-
plan: "free",
|
|
17
|
-
// Automation features — not available without login
|
|
18
|
-
github_actions: false,
|
|
19
|
-
queue_priority: false,
|
|
20
|
-
parallel_execution: false,
|
|
21
|
-
};
|
|
22
|
-
let cache = null;
|
|
23
|
-
const CACHE_TTL_MS = 5 * 60 * 1000;
|
|
24
|
-
const PLAN_RANK = {
|
|
25
|
-
free: 0,
|
|
26
|
-
pro: 1,
|
|
27
|
-
team: 2,
|
|
28
|
-
};
|
|
29
|
-
function normalizePlan(plan) {
|
|
30
|
-
if (plan === "pro")
|
|
31
|
-
return "pro";
|
|
32
|
-
if (plan === "team")
|
|
33
|
-
return "team";
|
|
34
|
-
return "free";
|
|
35
|
-
}
|
|
36
|
-
function getPlanRank(plan) {
|
|
37
|
-
return PLAN_RANK[plan ?? "free"] ?? 0;
|
|
38
|
-
}
|
|
39
|
-
async function getEntitlements() {
|
|
40
|
-
if (cache && Date.now() - cache.fetchedAt < CACHE_TTL_MS) {
|
|
41
|
-
return cache.features;
|
|
42
|
-
}
|
|
43
|
-
const token = (0, auth_js_1.loadToken)();
|
|
44
|
-
if (!token)
|
|
45
|
-
return FREE_FEATURES;
|
|
46
|
-
try {
|
|
47
|
-
const res = await fetch(`${auth_js_1.LAXY_API_URL}/api/v1/cli-entitlement`, {
|
|
48
|
-
headers: { Authorization: `Bearer ${token}` },
|
|
49
|
-
});
|
|
50
|
-
if (!res.ok) {
|
|
51
|
-
if (res.status === 401) {
|
|
52
|
-
console.error(" Note: your CLI session is no longer valid. Run laxy-verify login again to refresh your account metadata.");
|
|
53
|
-
}
|
|
54
|
-
return FREE_FEATURES;
|
|
55
|
-
}
|
|
56
|
-
const features = (await res.json());
|
|
57
|
-
cache = { features, fetchedAt: Date.now() };
|
|
58
|
-
return features;
|
|
59
|
-
}
|
|
60
|
-
catch {
|
|
61
|
-
return FREE_FEATURES;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
function applyPlanOverride(features, overridePlan) {
|
|
65
|
-
if (!overridePlan)
|
|
66
|
-
return features;
|
|
67
|
-
const isTeam = overridePlan === "team";
|
|
68
|
-
const isPro = overridePlan === "pro" || overridePlan === "team";
|
|
69
|
-
return {
|
|
70
|
-
...features,
|
|
71
|
-
plan: overridePlan,
|
|
72
|
-
// All verification features run on every plan
|
|
73
|
-
// github_actions — Pro and Team
|
|
74
|
-
github_actions: isPro,
|
|
75
|
-
// queue_priority, parallel_execution — Team only
|
|
76
|
-
queue_priority: isTeam,
|
|
77
|
-
parallel_execution: isTeam,
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
function printPlanBanner(features) {
|
|
81
|
-
const planLabels = {
|
|
82
|
-
free: "Free",
|
|
83
|
-
pro: "Pro",
|
|
84
|
-
team: "Team",
|
|
85
|
-
};
|
|
86
|
-
const label = planLabels[features.plan] ?? features.plan;
|
|
87
|
-
if (features.plan !== "free") {
|
|
88
|
-
console.log(` Plan: ${label}`);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizePlan = normalizePlan;
|
|
4
|
+
exports.getEntitlements = getEntitlements;
|
|
5
|
+
exports.applyPlanOverride = applyPlanOverride;
|
|
6
|
+
exports.printPlanBanner = printPlanBanner;
|
|
7
|
+
/**
|
|
8
|
+
* Fetches account entitlements for laxy-verify.
|
|
9
|
+
*
|
|
10
|
+
* The CLI asks /api/v1/cli-entitlement for the current plan and enabled automation flags.
|
|
11
|
+
* Responses are cached briefly to avoid repeated network calls during a single run.
|
|
12
|
+
* If the request fails or the user is not logged in, the CLI safely falls back to the unlocked verification defaults.
|
|
13
|
+
*/
|
|
14
|
+
const auth_js_1 = require("./auth.js");
|
|
15
|
+
const FREE_FEATURES = {
|
|
16
|
+
plan: "free",
|
|
17
|
+
// Automation features — not available without login
|
|
18
|
+
github_actions: false,
|
|
19
|
+
queue_priority: false,
|
|
20
|
+
parallel_execution: false,
|
|
21
|
+
};
|
|
22
|
+
let cache = null;
|
|
23
|
+
const CACHE_TTL_MS = 5 * 60 * 1000;
|
|
24
|
+
const PLAN_RANK = {
|
|
25
|
+
free: 0,
|
|
26
|
+
pro: 1,
|
|
27
|
+
team: 2,
|
|
28
|
+
};
|
|
29
|
+
function normalizePlan(plan) {
|
|
30
|
+
if (plan === "pro")
|
|
31
|
+
return "pro";
|
|
32
|
+
if (plan === "team")
|
|
33
|
+
return "team";
|
|
34
|
+
return "free";
|
|
35
|
+
}
|
|
36
|
+
function getPlanRank(plan) {
|
|
37
|
+
return PLAN_RANK[plan ?? "free"] ?? 0;
|
|
38
|
+
}
|
|
39
|
+
async function getEntitlements() {
|
|
40
|
+
if (cache && Date.now() - cache.fetchedAt < CACHE_TTL_MS) {
|
|
41
|
+
return cache.features;
|
|
42
|
+
}
|
|
43
|
+
const token = (0, auth_js_1.loadToken)();
|
|
44
|
+
if (!token)
|
|
45
|
+
return FREE_FEATURES;
|
|
46
|
+
try {
|
|
47
|
+
const res = await fetch(`${auth_js_1.LAXY_API_URL}/api/v1/cli-entitlement`, {
|
|
48
|
+
headers: { Authorization: `Bearer ${token}` },
|
|
49
|
+
});
|
|
50
|
+
if (!res.ok) {
|
|
51
|
+
if (res.status === 401) {
|
|
52
|
+
console.error(" Note: your CLI session is no longer valid. Run laxy-verify login again to refresh your account metadata.");
|
|
53
|
+
}
|
|
54
|
+
return FREE_FEATURES;
|
|
55
|
+
}
|
|
56
|
+
const features = (await res.json());
|
|
57
|
+
cache = { features, fetchedAt: Date.now() };
|
|
58
|
+
return features;
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return FREE_FEATURES;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function applyPlanOverride(features, overridePlan) {
|
|
65
|
+
if (!overridePlan)
|
|
66
|
+
return features;
|
|
67
|
+
const isTeam = overridePlan === "team";
|
|
68
|
+
const isPro = overridePlan === "pro" || overridePlan === "team";
|
|
69
|
+
return {
|
|
70
|
+
...features,
|
|
71
|
+
plan: overridePlan,
|
|
72
|
+
// All verification features run on every plan
|
|
73
|
+
// github_actions — Pro and Team
|
|
74
|
+
github_actions: isPro,
|
|
75
|
+
// queue_priority, parallel_execution — Team only
|
|
76
|
+
queue_priority: isTeam,
|
|
77
|
+
parallel_execution: isTeam,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
function printPlanBanner(features) {
|
|
81
|
+
const planLabels = {
|
|
82
|
+
free: "Free",
|
|
83
|
+
pro: "Pro",
|
|
84
|
+
team: "Team",
|
|
85
|
+
};
|
|
86
|
+
const label = planLabels[features.plan] ?? features.plan;
|
|
87
|
+
if (features.plan !== "free") {
|
|
88
|
+
console.log(` Plan: ${label}`);
|
|
89
|
+
}
|
|
90
|
+
}
|
package/dist/init.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.runInit = runInit;
|
|
37
|
-
const fs = __importStar(require("node:fs"));
|
|
38
|
-
const path = __importStar(require("node:path"));
|
|
39
|
-
const detect_js_1 = require("./detect.js");
|
|
40
|
-
function runInit(dir) {
|
|
41
|
-
const laxyYmlPath = path.join(dir, ".laxy.yml");
|
|
42
|
-
const workflowDir = path.join(dir, ".github", "workflows");
|
|
43
|
-
const workflowPath = path.join(workflowDir, "laxy-verify.yml");
|
|
44
|
-
const gitignorePath = path.join(dir, ".gitignore");
|
|
45
|
-
if (fs.existsSync(laxyYmlPath)) {
|
|
46
|
-
console.log(".laxy.yml already exists. Skipping. Delete it to regenerate.");
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
let detectedFramework = null;
|
|
50
|
-
let detectedPort = 3000;
|
|
51
|
-
try {
|
|
52
|
-
const detected = (0, detect_js_1.detect)(dir);
|
|
53
|
-
detectedFramework = detected.framework ?? "auto";
|
|
54
|
-
detectedPort = detected.port;
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
// Keep defaults when auto-detection fails.
|
|
58
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.runInit = runInit;
|
|
37
|
+
const fs = __importStar(require("node:fs"));
|
|
38
|
+
const path = __importStar(require("node:path"));
|
|
39
|
+
const detect_js_1 = require("./detect.js");
|
|
40
|
+
function runInit(dir) {
|
|
41
|
+
const laxyYmlPath = path.join(dir, ".laxy.yml");
|
|
42
|
+
const workflowDir = path.join(dir, ".github", "workflows");
|
|
43
|
+
const workflowPath = path.join(workflowDir, "laxy-verify.yml");
|
|
44
|
+
const gitignorePath = path.join(dir, ".gitignore");
|
|
45
|
+
if (fs.existsSync(laxyYmlPath)) {
|
|
46
|
+
console.log(".laxy.yml already exists. Skipping. Delete it to regenerate.");
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
let detectedFramework = null;
|
|
50
|
+
let detectedPort = 3000;
|
|
51
|
+
try {
|
|
52
|
+
const detected = (0, detect_js_1.detect)(dir);
|
|
53
|
+
detectedFramework = detected.framework ?? "auto";
|
|
54
|
+
detectedPort = detected.port;
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
// Keep defaults when auto-detection fails.
|
|
58
|
+
}
|
|
59
59
|
const ymlContent = `# Generated by laxy-verify --init
|
|
60
60
|
# See https://github.com/SUNgm24/Laxy/tree/main/laxy-verify for full docs
|
|
61
61
|
framework: ${detectedFramework} # auto-detected
|
|
@@ -67,15 +67,15 @@ thresholds:
|
|
|
67
67
|
accessibility: 85
|
|
68
68
|
seo: 80
|
|
69
69
|
best_practices: 80
|
|
70
|
-
`;
|
|
71
|
-
fs.writeFileSync(laxyYmlPath, ymlContent, "utf-8");
|
|
72
|
-
console.log("Created .laxy.yml");
|
|
73
|
-
}
|
|
74
|
-
if (fs.existsSync(workflowPath)) {
|
|
75
|
-
console.log(".github/workflows/laxy-verify.yml already exists. Skipping.");
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
fs.mkdirSync(workflowDir, { recursive: true });
|
|
70
|
+
`;
|
|
71
|
+
fs.writeFileSync(laxyYmlPath, ymlContent, "utf-8");
|
|
72
|
+
console.log("Created .laxy.yml");
|
|
73
|
+
}
|
|
74
|
+
if (fs.existsSync(workflowPath)) {
|
|
75
|
+
console.log(".github/workflows/laxy-verify.yml already exists. Skipping.");
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
fs.mkdirSync(workflowDir, { recursive: true });
|
|
79
79
|
const workflowContent = `name: Laxy Verify
|
|
80
80
|
on:
|
|
81
81
|
pull_request:
|
|
@@ -132,23 +132,23 @@ jobs:
|
|
|
132
132
|
path: .laxy-result.json
|
|
133
133
|
retention-days: 30
|
|
134
134
|
overwrite: true
|
|
135
|
-
`;
|
|
136
|
-
fs.writeFileSync(workflowPath, workflowContent, "utf-8");
|
|
137
|
-
console.log("Created .github/workflows/laxy-verify.yml");
|
|
138
|
-
}
|
|
139
|
-
const gitignoreEntries = [".lighthouseci/", ".laxy-result.json"];
|
|
140
|
-
if (fs.existsSync(gitignorePath)) {
|
|
141
|
-
const existing = fs.readFileSync(gitignorePath, "utf-8");
|
|
142
|
-
const lines = existing.split("\n").map((line) => line.trim());
|
|
143
|
-
const missing = gitignoreEntries.filter((entry) => !lines.includes(entry));
|
|
144
|
-
if (missing.length > 0) {
|
|
145
|
-
fs.appendFileSync(gitignorePath, `${missing.join("\n")}\n`, "utf-8");
|
|
146
|
-
console.log(`Appended to .gitignore: ${missing.join(", ")}`);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
fs.writeFileSync(gitignorePath, `${gitignoreEntries.join("\n")}\n`, "utf-8");
|
|
151
|
-
console.log("Created .gitignore");
|
|
152
|
-
}
|
|
153
|
-
console.log("\n Done. Run 'npx laxy-verify .' to verify your project.");
|
|
154
|
-
}
|
|
135
|
+
`;
|
|
136
|
+
fs.writeFileSync(workflowPath, workflowContent, "utf-8");
|
|
137
|
+
console.log("Created .github/workflows/laxy-verify.yml");
|
|
138
|
+
}
|
|
139
|
+
const gitignoreEntries = [".lighthouseci/", ".laxy-result.json"];
|
|
140
|
+
if (fs.existsSync(gitignorePath)) {
|
|
141
|
+
const existing = fs.readFileSync(gitignorePath, "utf-8");
|
|
142
|
+
const lines = existing.split("\n").map((line) => line.trim());
|
|
143
|
+
const missing = gitignoreEntries.filter((entry) => !lines.includes(entry));
|
|
144
|
+
if (missing.length > 0) {
|
|
145
|
+
fs.appendFileSync(gitignorePath, `${missing.join("\n")}\n`, "utf-8");
|
|
146
|
+
console.log(`Appended to .gitignore: ${missing.join(", ")}`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
fs.writeFileSync(gitignorePath, `${gitignoreEntries.join("\n")}\n`, "utf-8");
|
|
151
|
+
console.log("Created .gitignore");
|
|
152
|
+
}
|
|
153
|
+
console.log("\n Done. Run 'npx laxy-verify .' to verify your project.");
|
|
154
|
+
}
|
package/dist/multi-viewport.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import type { LighthouseScores } from "./grade.js";
|
|
2
|
-
export interface ViewportScreenshotDiff {
|
|
3
|
-
viewport: string;
|
|
4
|
-
diffPercent: number;
|
|
5
|
-
baselineCreated: boolean;
|
|
6
|
-
}
|
|
7
|
-
export interface ViewportScores {
|
|
8
|
-
desktop: LighthouseScores | null;
|
|
9
|
-
tablet: LighthouseScores | null;
|
|
10
|
-
mobile: LighthouseScores | null;
|
|
11
|
-
}
|
|
12
|
-
export declare function runMultiViewportLighthouse(port: number): Promise<ViewportScores & {
|
|
13
|
-
screenshotDiffs?: ViewportScreenshotDiff[];
|
|
14
|
-
}>;
|
|
15
|
-
export declare function printMultiViewportResults(scores: ViewportScores, thresholds: {
|
|
16
|
-
performance: number;
|
|
17
|
-
accessibility: number;
|
|
18
|
-
seo: number;
|
|
19
|
-
bestPractices: number;
|
|
20
|
-
}): void;
|
|
21
|
-
export declare function allViewportsPass(scores: ViewportScores, thresholds: {
|
|
22
|
-
performance: number;
|
|
23
|
-
accessibility: number;
|
|
24
|
-
seo: number;
|
|
25
|
-
bestPractices: number;
|
|
26
|
-
}): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Pro-tier mobile Lighthouse check — single mobile run without
|
|
29
|
-
* full multi-viewport overhead. Lets Pro users catch mobile regressions.
|
|
30
|
-
*/
|
|
31
|
-
export declare function runMobileLighthouse(port: number): Promise<LighthouseScores | null>;
|
|
1
|
+
import type { LighthouseScores } from "./grade.js";
|
|
2
|
+
export interface ViewportScreenshotDiff {
|
|
3
|
+
viewport: string;
|
|
4
|
+
diffPercent: number;
|
|
5
|
+
baselineCreated: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface ViewportScores {
|
|
8
|
+
desktop: LighthouseScores | null;
|
|
9
|
+
tablet: LighthouseScores | null;
|
|
10
|
+
mobile: LighthouseScores | null;
|
|
11
|
+
}
|
|
12
|
+
export declare function runMultiViewportLighthouse(port: number): Promise<ViewportScores & {
|
|
13
|
+
screenshotDiffs?: ViewportScreenshotDiff[];
|
|
14
|
+
}>;
|
|
15
|
+
export declare function printMultiViewportResults(scores: ViewportScores, thresholds: {
|
|
16
|
+
performance: number;
|
|
17
|
+
accessibility: number;
|
|
18
|
+
seo: number;
|
|
19
|
+
bestPractices: number;
|
|
20
|
+
}): void;
|
|
21
|
+
export declare function allViewportsPass(scores: ViewportScores, thresholds: {
|
|
22
|
+
performance: number;
|
|
23
|
+
accessibility: number;
|
|
24
|
+
seo: number;
|
|
25
|
+
bestPractices: number;
|
|
26
|
+
}): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Pro-tier mobile Lighthouse check — single mobile run without
|
|
29
|
+
* full multi-viewport overhead. Lets Pro users catch mobile regressions.
|
|
30
|
+
*/
|
|
31
|
+
export declare function runMobileLighthouse(port: number): Promise<LighthouseScores | null>;
|