@faststore/lighthouse 1.9.10 → 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 +8 -0
- package/dist/index.d.ts +25 -0
- package/dist/index.js +36 -17
- package/dist/index.js.map +1 -1
- package/package.json +4 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.9.14](https://github.com/vtex/faststore/compare/v1.9.13...v1.9.14) (2022-06-23)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @faststore/lighthouse
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [1.9.10](https://github.com/vtex/faststore/compare/v1.9.9...v1.9.10) (2022-06-18)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @faststore/lighthouse
|
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
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
1
|
/**
|
|
4
2
|
* Some values, we took from the default lighthouse config
|
|
5
3
|
* throttling mobileSlow4G: https://github.com/GoogleChrome/lighthouse/blob/master/lighthouse-core/config/constants.js#L22
|
|
@@ -13,46 +11,67 @@ const lhConfig = ({ urls, server, assertions = {} }) => {
|
|
|
13
11
|
},
|
|
14
12
|
assert: {
|
|
15
13
|
preset: 'lighthouse:no-pwa',
|
|
16
|
-
assertions:
|
|
14
|
+
assertions: {
|
|
17
15
|
// Final Ligthouse score Budgets
|
|
18
|
-
'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',
|
|
19
21
|
// Lighthouse Metrics Budgets
|
|
20
22
|
// Minimal score for perf 90 on each metric
|
|
21
|
-
'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 }],
|
|
22
29
|
// Number of Requests Budgets
|
|
23
|
-
'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': [
|
|
24
34
|
'error',
|
|
25
35
|
{ maxNumericValue: 3 },
|
|
26
|
-
],
|
|
36
|
+
],
|
|
37
|
+
'resource-summary:third-party:count': [
|
|
27
38
|
'error',
|
|
28
39
|
{ maxNumericValue: 100 },
|
|
29
|
-
],
|
|
40
|
+
],
|
|
30
41
|
// Resource sizes Budgets
|
|
31
42
|
// To learn where this 1024 comes from: https://github.com/GoogleChrome/lighthouse-ci/blob/fe181b61b20205dba5962c40094b1c90983f1c5e/packages/utils/src/budgets-converter.js#L49
|
|
32
43
|
'resource-summary:document:size': [
|
|
33
44
|
'error',
|
|
34
45
|
{ maxNumericValue: 40 * 1024 },
|
|
35
|
-
],
|
|
46
|
+
],
|
|
47
|
+
'resource-summary:font:size': [
|
|
36
48
|
'error',
|
|
37
49
|
{ maxNumericValue: 70 * 1024 },
|
|
38
|
-
],
|
|
50
|
+
],
|
|
51
|
+
'resource-summary:image:size': [
|
|
39
52
|
'error',
|
|
40
53
|
{ maxNumericValue: 500 * 1024 },
|
|
41
|
-
],
|
|
54
|
+
],
|
|
55
|
+
'resource-summary:script:size': [
|
|
42
56
|
'error',
|
|
43
57
|
{ maxNumericValue: 200 * 1024 },
|
|
44
|
-
],
|
|
58
|
+
],
|
|
59
|
+
'resource-summary:stylesheet:size': [
|
|
45
60
|
'error',
|
|
46
61
|
{ maxNumericValue: 100 * 1024 },
|
|
47
|
-
],
|
|
62
|
+
],
|
|
63
|
+
'resource-summary:third-party:size': [
|
|
48
64
|
'error',
|
|
49
65
|
{ maxNumericValue: 500 * 1024 },
|
|
50
|
-
],
|
|
66
|
+
],
|
|
67
|
+
'resource-summary:total:size': [
|
|
51
68
|
'error',
|
|
52
69
|
{ maxNumericValue: 600 * 1024 },
|
|
53
|
-
],
|
|
70
|
+
],
|
|
54
71
|
// Extra Lighthouse Assertion rules
|
|
55
|
-
'unused-javascript': ['error', { maxLength: 10 }]
|
|
72
|
+
'unused-javascript': ['error', { maxLength: 10 }],
|
|
73
|
+
...assertions,
|
|
74
|
+
},
|
|
56
75
|
},
|
|
57
76
|
upload: {
|
|
58
77
|
target: 'temporary-public-storage',
|
|
@@ -61,5 +80,5 @@ const lhConfig = ({ urls, server, assertions = {} }) => {
|
|
|
61
80
|
},
|
|
62
81
|
};
|
|
63
82
|
};
|
|
64
|
-
|
|
83
|
+
export default lhConfig;
|
|
65
84
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
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,EAAE;oBACV,gCAAgC;oBAChC,0BAA0B,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;oBACtD,2BAA2B,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;oBACvD,wBAAwB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;oBACvD,gBAAgB,EAAE,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;oBAC5C,gBAAgB,EAAE,KAAK;oBAEvB,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AAe,EAAE,GAAG,GAAG,IAAI,EAAE;qBAChC;oBACD,kCAAkC,EAAE;wBAClC,OAAO;wBACP,EAAE,eAAe,EAAE,GAAG,GAAG,IAAI,EAAE;qBAChC;oBACD,mCAAmC,EAAE;wBACnC,OAAO;wBACP,EAAE,eAAe,EAAE,GAAG,GAAG,IAAI,EAAE;qBAChC;oBACD,6BAA6B,EAAE;wBAC7B,OAAO;wBACP,EAAE,eAAe,EAAE,GAAG,GAAG,IAAI,EAAE;qBAChC;oBAED,mCAAmC;oBACnC,mBAAmB,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;oBAEjD,GAAG,UAAU;iBACd;aACF;YACD,MAAM,EAAE;gBACN,MAAM,EAAE,0BAA0B;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
|
}
|