@faststore/lighthouse 1.9.8 → 1.9.14
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/CHANGELOG.md +740 -2272
- package/dist/index.d.ts +25 -0
- package/dist/index.js +35 -14
- package/dist/index.js.map +1 -1
- package/package.json +4 -6
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
interface Params {
|
|
2
|
+
server?: string;
|
|
3
|
+
urls: string[];
|
|
4
|
+
assertions?: any;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Some values, we took from the default lighthouse config
|
|
8
|
+
* throttling mobileSlow4G: https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/constants.js#L22
|
|
9
|
+
*/
|
|
10
|
+
declare const lhConfig: ({ urls, server, assertions }: Params) => {
|
|
11
|
+
ci: {
|
|
12
|
+
collect: {
|
|
13
|
+
url: string[];
|
|
14
|
+
};
|
|
15
|
+
assert: {
|
|
16
|
+
preset: string;
|
|
17
|
+
assertions: any;
|
|
18
|
+
};
|
|
19
|
+
upload: {
|
|
20
|
+
target: string;
|
|
21
|
+
urlReplacementPatterns: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export default lhConfig;
|
package/dist/index.js
CHANGED
|
@@ -11,46 +11,67 @@ const lhConfig = ({ urls, server, assertions = {} }) => {
|
|
|
11
11
|
},
|
|
12
12
|
assert: {
|
|
13
13
|
preset: 'lighthouse:no-pwa',
|
|
14
|
-
assertions:
|
|
14
|
+
assertions: {
|
|
15
15
|
// Final Ligthouse score Budgets
|
|
16
|
-
'categories:accessibility': ['error', { minScore: 1 }],
|
|
16
|
+
'categories:accessibility': ['error', { minScore: 1 }],
|
|
17
|
+
'categories:best-practices': ['error', { minScore: 1 }],
|
|
18
|
+
'categories:performance': ['error', { minScore: 0.95 }],
|
|
19
|
+
'categories:seo': ['error', { minScore: 1 }],
|
|
20
|
+
'categories:pwa': 'off',
|
|
17
21
|
// Lighthouse Metrics Budgets
|
|
18
22
|
// Minimal score for perf 90 on each metric
|
|
19
|
-
'first-contentful-paint': ['error', { maxNumericValue: 1800 }],
|
|
23
|
+
'first-contentful-paint': ['error', { maxNumericValue: 1800 }],
|
|
24
|
+
'speed-index': ['error', { maxNumericValue: 3387 }],
|
|
25
|
+
'largest-contentful-paint': ['error', { maxNumericValue: 2500 }],
|
|
26
|
+
interactive: ['error', { maxNumericValue: 3785 }],
|
|
27
|
+
'total-blocking-time': ['error', { maxNumericValue: 350 }],
|
|
28
|
+
'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }],
|
|
20
29
|
// Number of Requests Budgets
|
|
21
|
-
'resource-summary:font:count': ['error', { maxNumericValue: 3 }],
|
|
30
|
+
'resource-summary:font:count': ['error', { maxNumericValue: 3 }],
|
|
31
|
+
'resource-summary:image:count': ['error', { maxNumericValue: 20 }],
|
|
32
|
+
'resource-summary:script:count': ['error', { maxNumericValue: 15 }],
|
|
33
|
+
'resource-summary:stylesheet:count': [
|
|
22
34
|
'error',
|
|
23
35
|
{ maxNumericValue: 3 },
|
|
24
|
-
],
|
|
36
|
+
],
|
|
37
|
+
'resource-summary:third-party:count': [
|
|
25
38
|
'error',
|
|
26
39
|
{ maxNumericValue: 100 },
|
|
27
|
-
],
|
|
40
|
+
],
|
|
28
41
|
// Resource sizes Budgets
|
|
29
42
|
// To learn where this 1024 comes from: https://github.com/GoogleChrome/lighthouse-ci/blob/fe181b61b20205dba5962c40094b1c90983f1c5e/packages/utils/src/budgets-converter.js#L49
|
|
30
43
|
'resource-summary:document:size': [
|
|
31
44
|
'error',
|
|
32
45
|
{ maxNumericValue: 40 * 1024 },
|
|
33
|
-
],
|
|
46
|
+
],
|
|
47
|
+
'resource-summary:font:size': [
|
|
34
48
|
'error',
|
|
35
49
|
{ maxNumericValue: 70 * 1024 },
|
|
36
|
-
],
|
|
50
|
+
],
|
|
51
|
+
'resource-summary:image:size': [
|
|
37
52
|
'error',
|
|
38
53
|
{ maxNumericValue: 500 * 1024 },
|
|
39
|
-
],
|
|
54
|
+
],
|
|
55
|
+
'resource-summary:script:size': [
|
|
40
56
|
'error',
|
|
41
57
|
{ maxNumericValue: 200 * 1024 },
|
|
42
|
-
],
|
|
58
|
+
],
|
|
59
|
+
'resource-summary:stylesheet:size': [
|
|
43
60
|
'error',
|
|
44
61
|
{ maxNumericValue: 100 * 1024 },
|
|
45
|
-
],
|
|
62
|
+
],
|
|
63
|
+
'resource-summary:third-party:size': [
|
|
46
64
|
'error',
|
|
47
65
|
{ maxNumericValue: 500 * 1024 },
|
|
48
|
-
],
|
|
66
|
+
],
|
|
67
|
+
'resource-summary:total:size': [
|
|
49
68
|
'error',
|
|
50
69
|
{ maxNumericValue: 600 * 1024 },
|
|
51
|
-
],
|
|
70
|
+
],
|
|
52
71
|
// Extra Lighthouse Assertion rules
|
|
53
|
-
'unused-javascript': ['error', { maxLength: 10 }]
|
|
72
|
+
'unused-javascript': ['error', { maxLength: 10 }],
|
|
73
|
+
...assertions,
|
|
74
|
+
},
|
|
54
75
|
},
|
|
55
76
|
upload: {
|
|
56
77
|
target: 'temporary-public-storage',
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA;;;GAGG;AAEH,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,GAAG,EAAE,EAAU,EAAE,EAAE;IAC7D,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC,CAAA;IAElD,OAAO;QACL,EAAE,EAAE;YACF,OAAO,EAAE;gBACP,GAAG;aACJ;YACD,MAAM,EAAE;gBACN,MAAM,EAAE,mBAAmB;gBAC3B,UAAU;
|
|
1
|
+
{"version":3,"file":"index.js","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0B;gBAClC,sBAAsB,EAAE,WAAW;aACpC;SACF;KACF,CAAA;AACH,CAAC,CAAA;AAED,eAAe,QAAQ,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@faststore/lighthouse",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.14",
|
|
4
4
|
"author": "Emerson Laurentino",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -21,13 +21,11 @@
|
|
|
21
21
|
"scripts": {
|
|
22
22
|
"develop": "tsc --watch",
|
|
23
23
|
"build": "tsc",
|
|
24
|
-
"lint": "eslint src/**/*.ts"
|
|
25
|
-
"test": "tsdx test --passWithNoTests"
|
|
24
|
+
"lint": "eslint src/**/*.ts"
|
|
26
25
|
},
|
|
27
26
|
"devDependencies": {
|
|
28
|
-
"
|
|
29
|
-
"tsdx": "^0.14.1",
|
|
27
|
+
"shared": "^1.9.14",
|
|
30
28
|
"typescript": "^4.2.4"
|
|
31
29
|
},
|
|
32
|
-
"gitHead": "
|
|
30
|
+
"gitHead": "d37facb5b238781bb18ce48afb1b245e5c53038b"
|
|
33
31
|
}
|