@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 +2 -0
- package/CHANGELOG.md +8 -0
- package/infrastructure/terraform-newrelic/dashboards.tf +14 -14
- package/infrastructure/terraform-newrelic/dev.tfvars +2 -1
- package/infrastructure/terraform-newrelic/lighthouse-script-dev.js +53 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-prod.js +48 -40
- package/infrastructure/terraform-newrelic/lighthouse-script-stage.js +54 -0
- package/infrastructure/terraform-newrelic/monitors.tf +1 -1
- package/infrastructure/terraform-newrelic/prod.tfvars +2 -1
- package/infrastructure/terraform-newrelic/staging.tfvars +2 -1
- package/infrastructure/terraform-newrelic/variables.tf +4 -0
- package/package.json +14 -14
- package/infrastructure/terraform-newrelic/lighthouse-script.js +0 -46
package/.prettierignore
CHANGED
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
|
}
|
|
@@ -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
|
-
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
body.lighthouseResult.audits.metrics.details.items[0]
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
'performanceScore',
|
|
28
|
-
body.lighthouseResult.categories.
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
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
|
-
|
|
40
|
-
|
|
48
|
+
} catch (err) {
|
|
49
|
+
console.error("Error:", err);
|
|
50
|
+
|
|
41
51
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/core",
|
|
3
|
-
"version": "2.44.
|
|
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.
|
|
43
|
-
"@newskit-render/auth": "^1.3.
|
|
44
|
-
"@newskit-render/checkout": "^2.5.0",
|
|
45
|
-
"@newskit-render/feature-flags": "^1.4.
|
|
46
|
-
"@newskit-render/feed": "^1.4.
|
|
47
|
-
"@newskit-render/my-account": "^4.4.0",
|
|
48
|
-
"@newskit-render/shared-components": "^2.4.
|
|
49
|
-
"@newskit-render/standalone-components": "^2.5.
|
|
50
|
-
"@newskit-render/validation": "^1.5.
|
|
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.
|
|
79
|
-
"@typescript-eslint/parser": "5.
|
|
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.
|
|
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.
|
|
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
|
-
})
|