@theholocron/lighthouse-config 7.13.1 → 7.14.0
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/index.cjs +27 -0
- package/dist/index.d.mts +45 -0
- package/package.json +11 -6
- /package/dist/{index.d.ts → index.d.cts} +0 -0
- /package/dist/{index.js → index.mjs} +0 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region index.ts
|
|
3
|
+
const defaultAssertions = {
|
|
4
|
+
"bf-cache": ["warn", { minScore: .9 }],
|
|
5
|
+
"errors-in-console": ["warn", { minScore: .9 }],
|
|
6
|
+
"font-display": ["warn", { minScore: .9 }],
|
|
7
|
+
label: ["warn", { minScore: .9 }],
|
|
8
|
+
"largest-contentful-paint": ["warn", { minScore: .9 }],
|
|
9
|
+
"lcp-lazy-loaded": ["warn", { minScore: .9 }],
|
|
10
|
+
"non-composited-animations": ["warn", { minScore: .9 }],
|
|
11
|
+
"prioritize-lcp-image": ["warn", { minScore: .9 }],
|
|
12
|
+
"unused-javascript": ["warn", { maxLength: 0 }],
|
|
13
|
+
"uses-long-cache-ttl": ["warn", { maxLength: 0 }]
|
|
14
|
+
};
|
|
15
|
+
function defineConfig({ url, startServerCommand, assertions = defaultAssertions, uploadTarget = "temporary-public-storage" }) {
|
|
16
|
+
return { ci: {
|
|
17
|
+
collect: {
|
|
18
|
+
url: Array.isArray(url) ? url : [url],
|
|
19
|
+
...startServerCommand ? { startServerCommand } : {}
|
|
20
|
+
},
|
|
21
|
+
assert: { assertions },
|
|
22
|
+
upload: { target: uploadTarget }
|
|
23
|
+
} };
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
exports.defaultAssertions = defaultAssertions;
|
|
27
|
+
exports.defineConfig = defineConfig;
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
//#region index.d.ts
|
|
2
|
+
type AssertionLevel = "off" | "warn" | "error";
|
|
3
|
+
type MinScoreAssertion = [AssertionLevel, {
|
|
4
|
+
minScore: number;
|
|
5
|
+
}];
|
|
6
|
+
type MaxLengthAssertion = [AssertionLevel, {
|
|
7
|
+
maxLength: number;
|
|
8
|
+
}];
|
|
9
|
+
interface LighthouseAssertion {
|
|
10
|
+
"bf-cache"?: MinScoreAssertion;
|
|
11
|
+
"errors-in-console"?: MinScoreAssertion;
|
|
12
|
+
"font-display"?: MinScoreAssertion;
|
|
13
|
+
label?: MinScoreAssertion;
|
|
14
|
+
"largest-contentful-paint"?: MinScoreAssertion;
|
|
15
|
+
"lcp-lazy-loaded"?: MinScoreAssertion;
|
|
16
|
+
"non-composited-animations"?: MinScoreAssertion;
|
|
17
|
+
"prioritize-lcp-image"?: MinScoreAssertion;
|
|
18
|
+
"unused-javascript"?: MaxLengthAssertion;
|
|
19
|
+
"uses-long-cache-ttl"?: MaxLengthAssertion;
|
|
20
|
+
[key: string]: MinScoreAssertion | MaxLengthAssertion | undefined;
|
|
21
|
+
}
|
|
22
|
+
declare const defaultAssertions: LighthouseAssertion;
|
|
23
|
+
interface LighthouseConfigOptions {
|
|
24
|
+
url: string | string[];
|
|
25
|
+
startServerCommand?: string;
|
|
26
|
+
assertions?: LighthouseAssertion;
|
|
27
|
+
/** @default "temporary-public-storage" */
|
|
28
|
+
uploadTarget?: string;
|
|
29
|
+
}
|
|
30
|
+
declare function defineConfig({ url, startServerCommand, assertions, uploadTarget }: LighthouseConfigOptions): {
|
|
31
|
+
ci: {
|
|
32
|
+
collect: {
|
|
33
|
+
startServerCommand?: string | undefined;
|
|
34
|
+
url: string[];
|
|
35
|
+
};
|
|
36
|
+
assert: {
|
|
37
|
+
assertions: LighthouseAssertion;
|
|
38
|
+
};
|
|
39
|
+
upload: {
|
|
40
|
+
target: string;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
//#endregion
|
|
45
|
+
export { LighthouseAssertion, LighthouseConfigOptions, defaultAssertions, defineConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/lighthouse-config",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.14.0",
|
|
4
4
|
"description": "A Lighthouse CI configuration for auditing performance and accessibility within the Galaxy.",
|
|
5
5
|
"homepage": "https://github.com/theholocron/configs/tree/main/packages/lighthouse-config#readme",
|
|
6
6
|
"bugs": "https://github.com/theholocron/configs/issues",
|
|
@@ -24,14 +24,19 @@
|
|
|
24
24
|
"tsdown": "^0.22.14",
|
|
25
25
|
"typescript": "^5.9.3",
|
|
26
26
|
"vitest": "^4.1.10",
|
|
27
|
-
"@theholocron/tsconfig": "7.
|
|
28
|
-
"@theholocron/vitest-config": "7.
|
|
27
|
+
"@theholocron/tsconfig": "7.14.0",
|
|
28
|
+
"@theholocron/vitest-config": "7.14.0"
|
|
29
29
|
},
|
|
30
30
|
"exports": {
|
|
31
31
|
".": {
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
"import": {
|
|
33
|
+
"types": "./dist/index.d.mts",
|
|
34
|
+
"default": "./dist/index.mjs"
|
|
35
|
+
},
|
|
36
|
+
"require": {
|
|
37
|
+
"types": "./dist/index.d.cts",
|
|
38
|
+
"default": "./dist/index.cjs"
|
|
39
|
+
}
|
|
35
40
|
},
|
|
36
41
|
"./package.json": "./package.json"
|
|
37
42
|
},
|
|
File without changes
|
|
File without changes
|