@newskit-render/core 2.44.0 → 2.44.1-alpha.1

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/.prettierignore CHANGED
@@ -15,3 +15,5 @@ cypress/plugins
15
15
  cypress/support
16
16
  public/*
17
17
  infrastructure/helm/*
18
+ infrastructure/terraform-newrelic/*.js
19
+ terraform-newrelic/*.js
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
+ # [2.44.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@2.44.0-alpha.7...@newskit-render/core@2.44.0) (2023-02-14)
7
+
8
+ **Note:** Version bump only for package @newskit-render/core
9
+
10
+
11
+
12
+
13
+
6
14
  # [2.43.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@2.43.0-alpha.2...@newskit-render/core@2.43.0) (2023-02-08)
7
15
 
8
16
  **Note:** Version bump only for package @newskit-render/core
@@ -184,7 +184,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
184
184
  width = 4
185
185
 
186
186
  nrql_query {
187
- query = "FROM SyntheticCheck SELECT average(custom.firstContentfulPaint) as 'FCP', average(custom.largestContentfulPaint) as 'LCP', average(custom.interactive) as 'TTI', average(custom.totalBlockingTime) as 'TBT', average(custom.cumulativeLayoutShift) as 'CLS', average(custom.speedIndex) as 'Speed Index'"
187
+ query = "FROM SyntheticCheck SELECT average(custom.firstContentfulPaint) as 'FCP', average(custom.largestContentfulPaint) as 'LCP', average(custom.interactive) as 'TTI', average(custom.totalBlockingTime) as 'TBT', average(custom.cumulativeLayoutShift) as 'CLS', average(custom.speedIndex) as 'Speed Index' WHERE custom.url = '${var.lighthouseUrl}'"
188
188
  }
189
189
  }
190
190
 
@@ -196,7 +196,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
196
196
  width = 8
197
197
 
198
198
  nrql_query {
199
- query = "FROM SyntheticCheck SELECT average(custom.firstContentfulPaint) as 'FCP', average(custom.largestContentfulPaint) as 'LCP', average(custom.interactive) as 'TTI', average(custom.totalBlockingTime) as 'TBT', average(custom.cumulativeLayoutShift) as 'CLS', average(custom.speedIndex) as 'Speed Index' TIMESERIES AUTO"
199
+ query = "FROM SyntheticCheck SELECT average(custom.firstContentfulPaint) as 'FCP', average(custom.largestContentfulPaint) as 'LCP', average(custom.interactive) as 'TTI', average(custom.totalBlockingTime) as 'TBT', average(custom.cumulativeLayoutShift) as 'CLS', average(custom.speedIndex) as 'Speed Index' TIMESERIES AUTO WHERE custom.url = '${var.lighthouseUrl}'"
200
200
  }
201
201
  }
202
202
 
@@ -208,7 +208,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
208
208
  width = 4
209
209
 
210
210
  nrql_query {
211
- query = "FROM SyntheticCheck SELECT average(custom.firstContentfulPaint) FACET custom.url"
211
+ query = "FROM SyntheticCheck SELECT average(custom.firstContentfulPaint) FACET custom.url WHERE custom.url = '${var.lighthouseUrl}'"
212
212
  }
213
213
  }
214
214
 
@@ -220,7 +220,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
220
220
  width = 8
221
221
 
222
222
  nrql_query {
223
- query = "FROM SyntheticCheck SELECT average(custom.firstContentfulPaint) FACET custom.url TIMESERIES AUTO"
223
+ query = "FROM SyntheticCheck SELECT average(custom.firstContentfulPaint) FACET custom.url TIMESERIES AUTO WHERE custom.url = '${var.lighthouseUrl}'"
224
224
  }
225
225
  }
226
226
 
@@ -232,7 +232,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
232
232
  width = 4
233
233
 
234
234
  nrql_query {
235
- query = "FROM SyntheticCheck SELECT average(custom.largestContentfulPaint) FACET custom.url"
235
+ query = "FROM SyntheticCheck SELECT average(custom.largestContentfulPaint) FACET custom.url WHERE custom.url = '${var.lighthouseUrl}'"
236
236
  }
237
237
  }
238
238
 
@@ -244,7 +244,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
244
244
  width = 8
245
245
 
246
246
  nrql_query {
247
- query = "FROM SyntheticCheck SELECT average(custom.largestContentfulPaint) FACET custom.url TIMESERIES AUTO"
247
+ query = "FROM SyntheticCheck SELECT average(custom.largestContentfulPaint) FACET custom.url TIMESERIES AUTO WHERE custom.url = '${var.lighthouseUrl}'"
248
248
  }
249
249
  }
250
250
 
@@ -256,7 +256,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
256
256
  width = 4
257
257
 
258
258
  nrql_query {
259
- query = "FROM SyntheticCheck SELECT average(custom.interactive) as 'TTI' FACET custom.url"
259
+ query = "FROM SyntheticCheck SELECT average(custom.interactive) as 'TTI' FACET custom.url WHERE custom.url = '${var.lighthouseUrl}'"
260
260
  }
261
261
  }
262
262
 
@@ -268,7 +268,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
268
268
  width = 8
269
269
 
270
270
  nrql_query {
271
- query = "FROM SyntheticCheck SELECT average(custom.interactive) FACET custom.url TIMESERIES AUTO"
271
+ query = "FROM SyntheticCheck SELECT average(custom.interactive) FACET custom.url TIMESERIES AUTO WHERE custom.url = '${var.lighthouseUrl}'"
272
272
  }
273
273
  }
274
274
 
@@ -280,7 +280,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
280
280
  width = 4
281
281
 
282
282
  nrql_query {
283
- query = "FROM SyntheticCheck SELECT average(custom.totalBlockingTime) FACET custom.url"
283
+ query = "FROM SyntheticCheck SELECT average(custom.totalBlockingTime) FACET custom.url WHERE custom.url = '${var.lighthouseUrl}'"
284
284
  }
285
285
  }
286
286
 
@@ -292,7 +292,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
292
292
  width = 8
293
293
 
294
294
  nrql_query {
295
- query = "FROM SyntheticCheck SELECT average(custom.totalBlockingTime) FACET custom.url TIMESERIES AUTO"
295
+ query = "FROM SyntheticCheck SELECT average(custom.totalBlockingTime) FACET custom.url TIMESERIES AUTO WHERE custom.url = '${var.lighthouseUrl}'"
296
296
  }
297
297
  }
298
298
 
@@ -304,7 +304,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
304
304
  width = 4
305
305
 
306
306
  nrql_query {
307
- query = "FROM SyntheticCheck SELECT average(custom.cumulativeLayoutShift) FACET custom.url"
307
+ query = "FROM SyntheticCheck SELECT average(custom.cumulativeLayoutShift) FACET custom.url WHERE custom.url = '${var.lighthouseUrl}'"
308
308
  }
309
309
  }
310
310
 
@@ -316,7 +316,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
316
316
  width = 8
317
317
 
318
318
  nrql_query {
319
- query = "FROM SyntheticCheck SELECT average(custom.cumulativeLayoutShift) FACET custom.url TIMESERIES AUTO"
319
+ query = "FROM SyntheticCheck SELECT average(custom.cumulativeLayoutShift) FACET custom.url TIMESERIES AUTO WHERE custom.url = '${var.lighthouseUrl}'"
320
320
  }
321
321
  }
322
322
 
@@ -328,7 +328,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
328
328
  width = 4
329
329
 
330
330
  nrql_query {
331
- query = "FROM SyntheticCheck SELECT average(custom.speedIndex) FACET custom.url"
331
+ query = "FROM SyntheticCheck SELECT average(custom.speedIndex) FACET custom.url WHERE custom.url = '${var.lighthouseUrl}'"
332
332
  }
333
333
  }
334
334
 
@@ -340,7 +340,7 @@ resource "newrelic_one_dashboard" "lighthouse_dashboard" {
340
340
  width = 8
341
341
 
342
342
  nrql_query {
343
- query = "FROM SyntheticCheck SELECT average(custom.speedIndex) FACET custom.url TIMESERIES AUTO"
343
+ query = "FROM SyntheticCheck SELECT average(custom.speedIndex) FACET custom.url TIMESERIES AUTO WHERE custom.url = '${var.lighthouseUrl}'"
344
344
  }
345
345
  }
346
346
  }
@@ -1,2 +1,3 @@
1
1
  environment = "dev"
2
- namespace = "<% PROJECT_NAME >-dev"
2
+ namespace = "<% PROJECT_NAME >-dev"
3
+ lighthouseUrl = "https://<% PROJECT_NAME >.ceng-dev.newsuk.tech/"
@@ -0,0 +1,53 @@
1
+ /* To get Google Page Speed API Key - https://developers.google.com/speed/docs/insights/v5/get-started */
2
+
3
+ got = require('got');
4
+
5
+ let categories = ['SEO', 'ACCESSIBILITY', 'BEST_PRACTICES', 'PERFORMANCE', 'PWA'];
6
+ let endpoint = 'https://www.googleapis.com/pagespeedonline/v5/runPagespeed?key='+ $secure.<% PROJECT_NAME >_PAGESPEED_INSIGHTS_API_KEY + '&';
7
+ const strategy = "desktop";
8
+ let settings = {'url': 'https://<% PROJECT_NAME >.ceng-dev.newsuk.tech/', 'strategy': strategy};
9
+ const options = {
10
+ method: 'GET',
11
+ headers: {
12
+ 'Content-Type': 'application/json',
13
+ }
14
+ };
15
+ categories.forEach((item, i) => {
16
+ endpoint += `category=${item}&`;
17
+ });
18
+ endpoint += `url=${settings.url}&`;
19
+ endpoint += `strategy=${strategy}`;
20
+
21
+
22
+ const getData = async () => {
23
+ try {
24
+ const body = await got.get(endpoint, options)
25
+ .json();
26
+ let lighthouseMetrics = body.lighthouseResult.audits.metrics.details.items[0];
27
+ console.log(body.lighthouseResult.configSettings.onlyCategories);
28
+ $util.insights.set('url', settings.url);
29
+ $util.insights.set('deviceType', settings.strategy);
30
+ $util.insights.set('performanceScore', body.lighthouseResult.categories.performance.score * 100);
31
+ $util.insights.set('accessibilityScore', body.lighthouseResult.categories.accessibility.score * 100);
32
+ console.log('accessibilityScore', body.lighthouseResult.categories.accessibility.score * 100);
33
+ $util.insights.set('bestPracticesScore', body.lighthouseResult.categories['best-practices'].score * 100);
34
+ console.log('bestPracticesScore', body.lighthouseResult.categories['best-practices'].score * 100);
35
+ $util.insights.set('seoScore', body.lighthouseResult.categories.seo.score * 100);
36
+ console.log('seoScore', body.lighthouseResult.categories.seo.score * 100);
37
+ $util.insights.set('pwaScore', body.lighthouseResult.categories.pwa.score * 100);
38
+ console.log('pwaScore', body.lighthouseResult.categories.pwa.score * 100);
39
+
40
+ for (let attributeName in lighthouseMetrics) {
41
+ if (lighthouseMetrics.hasOwnProperty(attributeName)) {
42
+ if (!attributeName.includes('Ts')) {
43
+ console.log(attributeName + ": " + lighthouseMetrics[attributeName]);
44
+ $util.insights.set(attributeName, lighthouseMetrics[attributeName]);
45
+ }
46
+ }
47
+ }
48
+ } catch (err) {
49
+ console.error("Error:", err);
50
+
51
+ }
52
+ };
53
+ getData();
@@ -1,46 +1,54 @@
1
- /** API SETUP - remove this section to run in New Relic Synthetics **/
2
- // if ($http == null) { var $http = require('request'); }
3
- /** API SETUP - remove this section to run in New Relic Synthetics **/
1
+ /* To get Google Page Speed API Key - https://developers.google.com/speed/docs/insights/v5/get-started */
4
2
 
5
- var settings = {
6
- url: 'https://newskit-render.prod.ceng.newsuk.tech/',
7
- category: 'performance',
8
- strategy: 'desktop',
9
- }
3
+ got = require('got');
4
+
5
+ let categories = ['SEO', 'ACCESSIBILITY', 'BEST_PRACTICES', 'PERFORMANCE', 'PWA'];
6
+ let endpoint = 'https://www.googleapis.com/pagespeedonline/v5/runPagespeed?key='+ $secure.<% PROJECT_NAME >_PAGESPEED_INSIGHTS_API_KEY + '&';
7
+ const strategy = "desktop";
8
+ let settings = {'url': 'https://<% PROJECT_NAME >.prod.ceng.newsuk.tech/', 'strategy': strategy};
9
+ const options = {
10
+ method: 'GET',
11
+ headers: {
12
+ 'Content-Type': 'application/json',
13
+ }
14
+ };
15
+ categories.forEach((item, i) => {
16
+ endpoint += `category=${item}&`;
17
+ });
18
+ endpoint += `url=${settings.url}&`;
19
+ endpoint += `strategy=${strategy}`;
10
20
 
11
- var options = {
12
- method: 'GET',
13
- url: 'https://www.googleapis.com/pagespeedonline/v5/runPagespeed',
14
- headers: null,
15
- qs: settings,
16
- json: true,
17
- }
18
21
 
19
- $http(options, function (error, response, body) {
20
- if (!error && response.statusCode == 200) {
21
- if (response.statusCode == 200) {
22
- var lighthouseMetrics =
23
- body.lighthouseResult.audits.metrics.details.items[0]
24
- $util.insights.set('url', settings.url)
25
- $util.insights.set('deviceType', settings.strategy)
26
- $util.insights.set(
27
- 'performanceScore',
28
- body.lighthouseResult.categories.performance.score
29
- )
22
+ const getData = async () => {
23
+ try {
24
+ const body = await got.get(endpoint, options)
25
+ .json();
26
+ let lighthouseMetrics = body.lighthouseResult.audits.metrics.details.items[0];
27
+ console.log(body.lighthouseResult.configSettings.onlyCategories);
28
+ $util.insights.set('url', settings.url);
29
+ $util.insights.set('deviceType', settings.strategy);
30
+ $util.insights.set('performanceScore', body.lighthouseResult.categories.performance.score * 100);
31
+ $util.insights.set('accessibilityScore', body.lighthouseResult.categories.accessibility.score * 100);
32
+ console.log('accessibilityScore', body.lighthouseResult.categories.accessibility.score * 100);
33
+ $util.insights.set('bestPracticesScore', body.lighthouseResult.categories['best-practices'].score * 100);
34
+ console.log('bestPracticesScore', body.lighthouseResult.categories['best-practices'].score * 100);
35
+ $util.insights.set('seoScore', body.lighthouseResult.categories.seo.score * 100);
36
+ console.log('seoScore', body.lighthouseResult.categories.seo.score * 100);
37
+ $util.insights.set('pwaScore', body.lighthouseResult.categories.pwa.score * 100);
38
+ console.log('pwaScore', body.lighthouseResult.categories.pwa.score * 100);
30
39
 
31
- for (var attributeName in lighthouseMetrics) {
32
- if (lighthouseMetrics.hasOwnProperty(attributeName)) {
33
- if (!attributeName.includes('Ts')) {
34
- console.log(attributeName + ': ' + lighthouseMetrics[attributeName])
35
- $util.insights.set(attributeName, lighthouseMetrics[attributeName])
36
- }
40
+ for (let attributeName in lighthouseMetrics) {
41
+ if (lighthouseMetrics.hasOwnProperty(attributeName)) {
42
+ if (!attributeName.includes('Ts')) {
43
+ console.log(attributeName + ": " + lighthouseMetrics[attributeName]);
44
+ $util.insights.set(attributeName, lighthouseMetrics[attributeName]);
45
+ }
46
+ }
37
47
  }
38
- }
39
- } else {
40
- console.log('Non-200 HTTP response: ' + response.statusCode)
48
+ } catch (err) {
49
+ console.error("Error:", err);
50
+
41
51
  }
42
- } else {
43
- console.log('rsp code: ' + response.statusCode)
44
- console.log(error)
45
- }
46
- })
52
+ };
53
+ getData();
54
+
@@ -0,0 +1,54 @@
1
+ /* To get Google Page Speed API Key - https://developers.google.com/speed/docs/insights/v5/get-started */
2
+
3
+ got = require('got');
4
+
5
+ let categories = ['SEO', 'ACCESSIBILITY', 'BEST_PRACTICES', 'PERFORMANCE', 'PWA'];
6
+ let endpoint = 'https://www.googleapis.com/pagespeedonline/v5/runPagespeed?key='+ $secure.<% PROJECT_NAME >_PAGESPEED_INSIGHTS_API_KEY + '&';
7
+ const strategy = "desktop";
8
+ let settings = {'url': 'https://<% PROJECT_NAME >.staging.ceng.newsuk.tech/', 'strategy': strategy};
9
+ const options = {
10
+ method: 'GET',
11
+ headers: {
12
+ 'Content-Type': 'application/json',
13
+ }
14
+ };
15
+ categories.forEach((item, i) => {
16
+ endpoint += `category=${item}&`;
17
+ });
18
+ endpoint += `url=${settings.url}&`;
19
+ endpoint += `strategy=${strategy}`;
20
+
21
+
22
+ const getData = async () => {
23
+ try {
24
+ const body = await got.get(endpoint, options)
25
+ .json();
26
+ let lighthouseMetrics = body.lighthouseResult.audits.metrics.details.items[0];
27
+ console.log(body.lighthouseResult.configSettings.onlyCategories);
28
+ $util.insights.set('url', settings.url);
29
+ $util.insights.set('deviceType', settings.strategy);
30
+ $util.insights.set('performanceScore', body.lighthouseResult.categories.performance.score * 100);
31
+ $util.insights.set('accessibilityScore', body.lighthouseResult.categories.accessibility.score * 100);
32
+ console.log('accessibilityScore', body.lighthouseResult.categories.accessibility.score * 100);
33
+ $util.insights.set('bestPracticesScore', body.lighthouseResult.categories['best-practices'].score * 100);
34
+ console.log('bestPracticesScore', body.lighthouseResult.categories['best-practices'].score * 100);
35
+ $util.insights.set('seoScore', body.lighthouseResult.categories.seo.score * 100);
36
+ console.log('seoScore', body.lighthouseResult.categories.seo.score * 100);
37
+ $util.insights.set('pwaScore', body.lighthouseResult.categories.pwa.score * 100);
38
+ console.log('pwaScore', body.lighthouseResult.categories.pwa.score * 100);
39
+
40
+ for (let attributeName in lighthouseMetrics) {
41
+ if (lighthouseMetrics.hasOwnProperty(attributeName)) {
42
+ if (!attributeName.includes('Ts')) {
43
+ console.log(attributeName + ": " + lighthouseMetrics[attributeName]);
44
+ $util.insights.set(attributeName, lighthouseMetrics[attributeName]);
45
+ }
46
+ }
47
+ }
48
+ } catch (err) {
49
+ console.error("Error:", err);
50
+
51
+ }
52
+ };
53
+ getData();
54
+
@@ -4,7 +4,7 @@ resource "newrelic_synthetics_script_monitor" "lighthouse-monitor" {
4
4
  locations_public = ["EU_WEST_2"]
5
5
  period = "EVERY_30_MINUTES"
6
6
  status = "ENABLED"
7
- script = var.environment == "prod" ? file("${path.module}/lighthouse-script-prod.js") : file("${path.module}/lighthouse-script.js")
7
+ script = var.environment == "prod" ? file("${path.module}/lighthouse-script-prod.js") : var.environment == "dev" ? file("${path.module}/lighthouse-script-dev.js") : file("${path.module}/lighthouse-script-stage.js")
8
8
  script_language = "JAVASCRIPT"
9
9
  runtime_type = "NODE_API"
10
10
  runtime_type_version = "16.10"
@@ -1,2 +1,3 @@
1
1
  environment = "prod"
2
- namespace = "<% PROJECT_NAME >-prod"
2
+ namespace = "<% PROJECT_NAME >-prod"
3
+ lighthouseUrl = "https://<% PROJECT_NAME >.prod.ceng.newsuk.tech/"
@@ -1,2 +1,3 @@
1
1
  environment = "staging"
2
- namespace = "<% PROJECT_NAME >-staging"
2
+ namespace = "<% PROJECT_NAME >-staging"
3
+ lighthouseUrl = "https://<% PROJECT_NAME >.staging.ceng.newsuk.tech/"
@@ -27,3 +27,7 @@ variable "project_name" {
27
27
  description = "The Project name"
28
28
  default = "<% PROJECT_NAME >"
29
29
  }
30
+
31
+ variable "lighthouseUrl" {
32
+ description = "url to be analyzed by Lighthouse"
33
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newskit-render/core",
3
- "version": "2.44.0",
3
+ "version": "2.44.1-alpha.1",
4
4
  "description": "Newskit Render - Core package",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -39,15 +39,15 @@
39
39
  "@emotion-icons/material-outlined": "3.14.0",
40
40
  "@emotion/react": "11.9.3",
41
41
  "@emotion/styled": "11.9.3",
42
- "@newskit-render/api": "^1.6.5",
43
- "@newskit-render/auth": "^1.3.9",
44
- "@newskit-render/checkout": "^2.5.0",
45
- "@newskit-render/feature-flags": "^1.4.10",
46
- "@newskit-render/feed": "^1.4.15",
47
- "@newskit-render/my-account": "^4.4.0",
48
- "@newskit-render/shared-components": "^2.4.1",
49
- "@newskit-render/standalone-components": "^2.5.1",
50
- "@newskit-render/validation": "^1.5.11",
42
+ "@newskit-render/api": "^1.6.6-alpha.0",
43
+ "@newskit-render/auth": "^1.3.10-alpha.0",
44
+ "@newskit-render/checkout": "^2.5.1-alpha.0",
45
+ "@newskit-render/feature-flags": "^1.4.11-alpha.0",
46
+ "@newskit-render/feed": "^1.4.16-alpha.0",
47
+ "@newskit-render/my-account": "^4.4.1-alpha.0",
48
+ "@newskit-render/shared-components": "^2.4.2-alpha.0",
49
+ "@newskit-render/standalone-components": "^2.5.2-alpha.0",
50
+ "@newskit-render/validation": "^1.5.12-alpha.0",
51
51
  "@next/font": "13.1.6",
52
52
  "cross-fetch": "3.1.5",
53
53
  "graphql": "16.6.0",
@@ -75,17 +75,17 @@
75
75
  "@types/react": "18.0.26",
76
76
  "@types/react-dom": "18.0.10",
77
77
  "@types/react-helmet": "6.1.0",
78
- "@typescript-eslint/eslint-plugin": "5.48.1",
79
- "@typescript-eslint/parser": "5.48.1",
78
+ "@typescript-eslint/eslint-plugin": "5.51.0",
79
+ "@typescript-eslint/parser": "5.51.0",
80
80
  "axe-core": "4.3.4",
81
81
  "babel-jest": "26.3.0",
82
82
  "cypress": "10.0.0",
83
83
  "cypress-axe": "1.1.0",
84
- "eslint": "8.30.0",
84
+ "eslint": "8.34.0",
85
85
  "eslint-config-airbnb": "19.0.4",
86
86
  "eslint-config-airbnb-typescript": "17.0.0",
87
87
  "eslint-config-next": "13.1.2",
88
- "eslint-config-prettier": "8.5.0",
88
+ "eslint-config-prettier": "8.6.0",
89
89
  "eslint-import-resolver-typescript": "3.5.2",
90
90
  "eslint-plugin-cypress": "2.12.1",
91
91
  "eslint-plugin-flowtype": "8.0.3",
@@ -1,46 +0,0 @@
1
- /** API SETUP - remove this section to run in New Relic Synthetics **/
2
- // if ($http == null) { var $http = require('request'); }
3
- /** API SETUP - remove this section to run in New Relic Synthetics **/
4
-
5
- var settings = {
6
- url: 'https://newskit-render.ceng-dev.newsuk.tech/',
7
- category: 'performance',
8
- strategy: 'desktop',
9
- }
10
-
11
- var options = {
12
- method: 'GET',
13
- url: 'https://www.googleapis.com/pagespeedonline/v5/runPagespeed',
14
- headers: null,
15
- qs: settings,
16
- json: true,
17
- }
18
-
19
- $http(options, function (error, response, body) {
20
- if (!error && response.statusCode == 200) {
21
- if (response.statusCode == 200) {
22
- var lighthouseMetrics =
23
- body.lighthouseResult.audits.metrics.details.items[0]
24
- $util.insights.set('url', settings.url)
25
- $util.insights.set('deviceType', settings.strategy)
26
- $util.insights.set(
27
- 'performanceScore',
28
- body.lighthouseResult.categories.performance.score
29
- )
30
-
31
- for (var attributeName in lighthouseMetrics) {
32
- if (lighthouseMetrics.hasOwnProperty(attributeName)) {
33
- if (!attributeName.includes('Ts')) {
34
- console.log(attributeName + ': ' + lighthouseMetrics[attributeName])
35
- $util.insights.set(attributeName, lighthouseMetrics[attributeName])
36
- }
37
- }
38
- }
39
- } else {
40
- console.log('Non-200 HTTP response: ' + response.statusCode)
41
- }
42
- } else {
43
- console.log('rsp code: ' + response.statusCode)
44
- console.log(error)
45
- }
46
- })