@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 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
@@ -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: Object.assign({
14
+ assertions: {
17
15
  // Final Ligthouse score Budgets
18
- 'categories:accessibility': ['error', { minScore: 1 }], 'categories:best-practices': ['error', { minScore: 1 }], 'categories:performance': ['error', { minScore: 0.95 }], 'categories:seo': ['error', { minScore: 1 }], 'categories:pwa': 'off',
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 }], 'speed-index': ['error', { maxNumericValue: 3387 }], 'largest-contentful-paint': ['error', { maxNumericValue: 2500 }], interactive: ['error', { maxNumericValue: 3785 }], 'total-blocking-time': ['error', { maxNumericValue: 350 }], 'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }],
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 }], 'resource-summary:image:count': ['error', { maxNumericValue: 20 }], 'resource-summary:script:count': ['error', { maxNumericValue: 15 }], 'resource-summary:stylesheet:count': [
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
- ], 'resource-summary:third-party:count': [
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
- ], 'resource-summary:font:size': [
46
+ ],
47
+ 'resource-summary:font:size': [
36
48
  'error',
37
49
  { maxNumericValue: 70 * 1024 },
38
- ], 'resource-summary:image:size': [
50
+ ],
51
+ 'resource-summary:image:size': [
39
52
  'error',
40
53
  { maxNumericValue: 500 * 1024 },
41
- ], 'resource-summary:script:size': [
54
+ ],
55
+ 'resource-summary:script:size': [
42
56
  'error',
43
57
  { maxNumericValue: 200 * 1024 },
44
- ], 'resource-summary:stylesheet:size': [
58
+ ],
59
+ 'resource-summary:stylesheet:size': [
45
60
  'error',
46
61
  { maxNumericValue: 100 * 1024 },
47
- ], 'resource-summary:third-party:size': [
62
+ ],
63
+ 'resource-summary:third-party:size': [
48
64
  'error',
49
65
  { maxNumericValue: 500 * 1024 },
50
- ], 'resource-summary:total:size': [
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 }] }, assertions),
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
- exports.default = lhConfig;
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":";;AAMA;;;GAGG;AAEH,MAAM,QAAQ,GAAG,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,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F;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.10",
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
- "@vtex/tsconfig": "^0.5.6",
29
- "tsdx": "^0.14.1",
27
+ "shared": "^1.9.14",
30
28
  "typescript": "^4.2.4"
31
29
  },
32
- "gitHead": "7865d21a4a22495f3828bcc3f1d00e556c63d66f"
30
+ "gitHead": "d37facb5b238781bb18ce48afb1b245e5c53038b"
33
31
  }