@newskit-render/core 1.9.0 → 1.13.3
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/.eslintignore +1 -0
- package/CHANGELOG.md +146 -0
- package/README.md +1 -1
- package/{context → app-context}/AppContext.test.tsx +3 -2
- package/{context → app-context}/AppContext.tsx +3 -3
- package/{context → app-context}/__snapshots__/AppContext.test.tsx.snap +0 -0
- package/components/header/index.tsx +1 -1
- package/infrastructure/.circleci/config.yml +1 -0
- package/infrastructure/terraform-newrelic/dashboards.tf +176 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-prod.js +46 -0
- package/infrastructure/terraform-newrelic/lighthouse-script.js +46 -0
- package/infrastructure/terraform-newrelic/monitors.tf +12 -0
- package/next-env.d.ts +0 -1
- package/next.config.js +37 -32
- package/package.json +22 -9
- package/pages/_app.tsx +38 -1
- package/pages/account/cancellation/index.tsx +6 -5
- package/pages/account/edit/[field].tsx +11 -2
- package/pages/account/index.tsx +9 -2
- package/pages/account/newsletters-and-alerts/index.tsx +10 -1
- package/pages/account/payment/index.tsx +8 -1
- package/pages/account/subscription-and-billing/index.tsx +14 -1
- package/pages/checkout/account-creation/index.tsx +8 -1
- package/pages/checkout/payment-details/index.tsx +8 -1
- package/public/MyAccount/display-personalDetails-header-sun.svg +55 -0
- package/public/MyAccount/display-personalDetails-header-times.svg +90 -0
- package/public/MyAccount/display-personalDetails-header-vr.svg +46 -0
- package/public/MyAccount/navigationPrimary-brandMark-sun.svg +3 -0
- package/public/MyAccount/navigationPrimary-brandMark-times.svg +18 -0
- package/public/MyAccount/navigationPrimary-brandMark-vr.svg +10 -0
- package/public/fonts/GillSansMTStd-Bold.otf +0 -0
- package/public/fonts/GillSansMTStd-BoldCondensed.otf +0 -0
- package/public/fonts/GillSansMTStd-BoldItalic.otf +0 -0
- package/public/fonts/GillSansMTStd-Book.otf +0 -0
- package/public/fonts/GillSansMTStd-BookItalic.otf +0 -0
- package/public/fonts/GillSansMTStd-Condensed.otf +0 -0
- package/public/fonts/GillSansMTStd-ExtraBold.otf +0 -0
- package/public/fonts/GillSansMTStd-Heavy.otf +0 -0
- package/public/fonts/GillSansMTStd-HeavyItalic.otf +0 -0
- package/public/fonts/GillSansMTStd-Light.otf +0 -0
- package/public/fonts/GillSansMTStd-LightItalic.otf +0 -0
- package/public/fonts/GillSansMTStd-Medium.otf +0 -0
- package/public/fonts/GillSansMTStd-MediumItalic.otf +0 -0
- package/public/fonts/GillSansMTStd-UltraBold.otf +0 -0
- package/public/fonts/GillSansMTStd-UltraBoldCond.otf +0 -0
- package/public/fonts/Montserrat-Black.ttf +0 -0
- package/public/fonts/Montserrat-BlackItalic.ttf +0 -0
- package/public/fonts/Montserrat-Bold.ttf +0 -0
- package/public/fonts/Montserrat-BoldItalic.ttf +0 -0
- package/public/fonts/Montserrat-ExtraBold.ttf +0 -0
- package/public/fonts/Montserrat-ExtraBoldItalic.ttf +0 -0
- package/public/fonts/Montserrat-ExtraLight.ttf +0 -0
- package/public/fonts/Montserrat-ExtraLightItalic.ttf +0 -0
- package/public/fonts/Montserrat-Italic.ttf +0 -0
- package/public/fonts/Montserrat-Light.ttf +0 -0
- package/public/fonts/Montserrat-LightItalic.ttf +0 -0
- package/public/fonts/Montserrat-Medium.ttf +0 -0
- package/public/fonts/Montserrat-MediumItalic.ttf +0 -0
- package/public/fonts/Montserrat-Regular.ttf +0 -0
- package/public/fonts/Montserrat-SemiBold.ttf +0 -0
- package/public/fonts/Montserrat-SemiBoldItalic.ttf +0 -0
- package/public/fonts/Montserrat-Thin.ttf +0 -0
- package/public/fonts/Montserrat-ThinItalic.ttf +0 -0
- package/public/fonts/TheSun-Bold.ttf +0 -0
- package/public/fonts/TheSun-BoldItalic.ttf +0 -0
- package/public/fonts/TheSun-HeavyCondensed.ttf +0 -0
- package/public/fonts/TheSun-HeavyNarrow.ttf +0 -0
- package/public/fonts/TheSun-Italic.ttf +0 -0
- package/public/fonts/TheSun-Medium.ttf +0 -0
- package/public/fonts/TheSun-MediumItalic.ttf +0 -0
- package/public/fonts/TheSun-Regular.ttf +0 -0
- package/public/fonts/TimesDigital-Bold.ttf +0 -0
- package/public/fonts/TimesDigital-BoldItalic.ttf +0 -0
- package/public/fonts/TimesDigital-BoldSC.ttf +0 -0
- package/public/fonts/TimesDigital-Italic.ttf +0 -0
- package/public/fonts/TimesDigital-Regular.ttf +0 -0
- package/public/fonts/TimesDigital-RegularSC.ttf +0 -0
- package/public/fonts/TimesDigitalW04-Bold.ttf +0 -0
- package/public/fonts/TimesDigitalW04-BoldItalic.ttf +0 -0
- package/public/fonts/TimesDigitalW04-BoldSC.ttf +0 -0
- package/public/fonts/TimesDigitalW04-Italic.ttf +0 -0
- package/public/fonts/TimesDigitalW04-Regular.ttf +0 -0
- package/public/fonts/TimesDigitalW04-RegularSC.ttf +0 -0
- package/tsconfig.json +1 -1
package/.eslintignore
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,152 @@
|
|
|
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.13.3](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.13.2...@newskit-render/core@1.13.3) (2022-01-19)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.13.2](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.13.1...@newskit-render/core@1.13.2) (2022-01-18)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [1.13.1](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.13.0...@newskit-render/core@1.13.1) (2022-01-18)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# [1.13.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.12.1...@newskit-render/core@1.13.0) (2022-01-14)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* **PPDSR-604:** Add husky & commitlint ([#558](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/558)) ([c67fc76](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/c67fc76276c8607f7604ae6ac0d0cae1ecb5b4f0))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [1.12.1](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.12.0...@newskit-render/core@1.12.1) (2022-01-13)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# [1.12.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.11.4...@newskit-render/core@1.12.0) (2022-01-13)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Features
|
|
53
|
+
|
|
54
|
+
* **PPDSR-632:** Fix newsletter query ([#559](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/559)) ([38085d1](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/38085d1418bb42237a41b4bad0394fc8cabdf2a4))
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
## [1.11.4](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.11.3...@newskit-render/core@1.11.4) (2022-01-13)
|
|
61
|
+
|
|
62
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## [1.11.3](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.11.2...@newskit-render/core@1.11.3) (2022-01-11)
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
### Bug Fixes
|
|
72
|
+
|
|
73
|
+
* update release cli version ([#556](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/556)) ([d613fe1](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/d613fe1f5b96fc3f66547f2310a12c0b3810e940))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
## [1.11.2](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.11.1...@newskit-render/core@1.11.2) (2022-01-11)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
### Bug Fixes
|
|
83
|
+
|
|
84
|
+
* bump release-cli to latest to fix pipeline ([#554](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/554)) ([46a0c13](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/46a0c13231f89445360126bc596476ca13716b37))
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## [1.11.1](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.11.0...@newskit-render/core@1.11.1) (2022-01-07)
|
|
91
|
+
|
|
92
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
# [1.11.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.10.1...@newskit-render/core@1.11.0) (2022-01-06)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Features
|
|
102
|
+
|
|
103
|
+
* **PPDSR-605:** Move PrimaryNavigation to Shared Components ([#550](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/550)) ([fcc1cda](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/fcc1cda59d4cfcc42b1487ee8ba782c7d5f83bb7))
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
## [1.10.1](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.10.0...@newskit-render/core@1.10.1) (2022-01-05)
|
|
110
|
+
|
|
111
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
# [1.10.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.9.3...@newskit-render/core@1.10.0) (2022-01-05)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
### Features
|
|
121
|
+
|
|
122
|
+
* **PPDSR-594:** Add themes to account package ([#538](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/538)) ([e34a53a](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/e34a53a944ae8d1420c27459f1ef5ca3ba4160d0))
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
## [1.9.3](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.9.2...@newskit-render/core@1.9.3) (2022-01-05)
|
|
129
|
+
|
|
130
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
## [1.9.2](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.9.1...@newskit-render/core@1.9.2) (2022-01-04)
|
|
137
|
+
|
|
138
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
## [1.9.1](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.9.0...@newskit-render/core@1.9.1) (2022-01-04)
|
|
145
|
+
|
|
146
|
+
**Note:** Version bump only for package @newskit-render/core
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
6
152
|
# [1.9.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.8.0...@newskit-render/core@1.9.0) (2022-01-04)
|
|
7
153
|
|
|
8
154
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @newskit-render/core
|
|
2
2
|
|
|
3
|
-
А website
|
|
3
|
+
А template website built using Next.js.
|
|
4
4
|
|
|
5
5
|
This package is used by [@newskit-render/create-render-app](https://www.npmjs.com/package/@newskit-render/create-render-app) as a template structure to scaffold the newly created projects which the users of @newskit-render/create-render-app can use and modify for their purposes.
|
|
6
6
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { render } from 'react-dom'
|
|
3
3
|
import { act } from 'react-dom/test-utils'
|
|
4
|
-
import {
|
|
4
|
+
import { sharedTheme } from '@newskit-render/shared-components'
|
|
5
|
+
import { renderCustomDarkTheme } from '../theme'
|
|
5
6
|
import { AppContextProvider, AppContext } from './AppContext'
|
|
6
7
|
|
|
7
8
|
const container = document.createElement('div')
|
|
@@ -30,7 +31,7 @@ describe('AppContext tests', () => {
|
|
|
30
31
|
container
|
|
31
32
|
)
|
|
32
33
|
|
|
33
|
-
expect(container.textContent).toBe(JSON.stringify(
|
|
34
|
+
expect(container.textContent).toBe(JSON.stringify(sharedTheme))
|
|
34
35
|
})
|
|
35
36
|
|
|
36
37
|
it('setTheme should switch the theme', () => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import { UncompiledTheme } from 'newskit'
|
|
3
|
-
import {
|
|
3
|
+
import { sharedTheme } from '@newskit-render/shared-components'
|
|
4
4
|
|
|
5
5
|
type AppContextType = {
|
|
6
6
|
theme: UncompiledTheme
|
|
@@ -8,11 +8,11 @@ type AppContextType = {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
const AppContext = React.createContext({
|
|
11
|
-
theme:
|
|
11
|
+
theme: sharedTheme,
|
|
12
12
|
} as AppContextType)
|
|
13
13
|
|
|
14
14
|
const AppContextProvider = ({ children }: { children: JSX.Element }) => {
|
|
15
|
-
const [theme, setTheme] = useState(
|
|
15
|
+
const [theme, setTheme] = useState(sharedTheme)
|
|
16
16
|
|
|
17
17
|
return (
|
|
18
18
|
<AppContext.Provider value={{ theme, setTheme }}>
|
|
File without changes
|
|
@@ -21,7 +21,7 @@ import { MainGrid } from '../layout/MainGrid'
|
|
|
21
21
|
import NewsKitLogoFull from '../common/NewskitLogo'
|
|
22
22
|
import NewsKitLogoShort from '../common/NewskitLogoShort'
|
|
23
23
|
import NavLink from '../common/NavLink'
|
|
24
|
-
import { AppContext } from '../../context/AppContext'
|
|
24
|
+
import { AppContext } from '../../app-context/AppContext'
|
|
25
25
|
import { getKey } from '../../helpers/articleUtil'
|
|
26
26
|
import { handleEnterKeyPress } from '../../helpers/a11y'
|
|
27
27
|
import { UserData, VxInstance } from '../../helpers/global-types'
|
|
@@ -239,6 +239,7 @@ orbs:
|
|
|
239
239
|
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set envs.TEALIUM_ENV=${TEALIUM_ENV}"' >> $BASH_ENV
|
|
240
240
|
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.NEW_RELIC_LICENSE_KEY=${NEW_RELIC_LICENSE_KEY}"' >> $BASH_ENV
|
|
241
241
|
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.MAIN_GRAPHQL_URL=${MAIN_GRAPHQL_URL}"' >> $BASH_ENV
|
|
242
|
+
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.MAIN_COOKIE_NAME=${MAIN_COOKIE_NAME}"' >> $BASH_ENV
|
|
242
243
|
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.MAIN_USER_ID=${MAIN_USER_ID}"' >> $BASH_ENV
|
|
243
244
|
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.MAIN_AUDIENCE=${MAIN_AUDIENCE}"' >> $BASH_ENV
|
|
244
245
|
echo 'export HELM_OPT_SET="$HELM_OPT_SET --set secret.items.MAIN_OAUTH_TOKEN=${MAIN_OAUTH_TOKEN}"' >> $BASH_ENV
|
|
@@ -169,3 +169,179 @@ resource "newrelic_one_dashboard" "frontend_dashboard" {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
+
|
|
173
|
+
resource "newrelic_one_dashboard" "lighthouse_dashboard" {
|
|
174
|
+
name = "${data.newrelic_entity.render_app.name} Lighthouse Dashboard"
|
|
175
|
+
|
|
176
|
+
page {
|
|
177
|
+
name = "${data.newrelic_entity.render_app.name} Lighthouse Metrics Dashboard"
|
|
178
|
+
|
|
179
|
+
widget_billboard {
|
|
180
|
+
title = "Lighthouse Metrics"
|
|
181
|
+
row = 1
|
|
182
|
+
column = 1
|
|
183
|
+
height = 3
|
|
184
|
+
width = 4
|
|
185
|
+
|
|
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'"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
widget_line {
|
|
192
|
+
title = "Lighthouse Metrics-trending"
|
|
193
|
+
row = 1
|
|
194
|
+
column = 5
|
|
195
|
+
height = 3
|
|
196
|
+
width = 8
|
|
197
|
+
|
|
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"
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
widget_bar {
|
|
204
|
+
title = "First Contentful Paint"
|
|
205
|
+
row = 4
|
|
206
|
+
column = 1
|
|
207
|
+
height = 3
|
|
208
|
+
width = 4
|
|
209
|
+
|
|
210
|
+
nrql_query {
|
|
211
|
+
query = "FROM SyntheticCheck SELECT average(custom.firstContentfulPaint) FACET custom.url"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
widget_line {
|
|
216
|
+
title = "First Contentful Paint"
|
|
217
|
+
row = 4
|
|
218
|
+
column = 5
|
|
219
|
+
height = 3
|
|
220
|
+
width = 8
|
|
221
|
+
|
|
222
|
+
nrql_query {
|
|
223
|
+
query = "FROM SyntheticCheck SELECT average(custom.firstContentfulPaint) FACET custom.url TIMESERIES AUTO"
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
widget_bar {
|
|
228
|
+
title = "Largest Contentful Paint"
|
|
229
|
+
row = 7
|
|
230
|
+
column = 1
|
|
231
|
+
height = 3
|
|
232
|
+
width = 4
|
|
233
|
+
|
|
234
|
+
nrql_query {
|
|
235
|
+
query = "FROM SyntheticCheck SELECT average(custom.largestContentfulPaint) FACET custom.url"
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
widget_line {
|
|
240
|
+
title = "Largest Contentful Paint"
|
|
241
|
+
row = 7
|
|
242
|
+
column = 5
|
|
243
|
+
height = 3
|
|
244
|
+
width = 8
|
|
245
|
+
|
|
246
|
+
nrql_query {
|
|
247
|
+
query = "FROM SyntheticCheck SELECT average(custom.largestContentfulPaint) FACET custom.url TIMESERIES AUTO"
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
widget_bar {
|
|
252
|
+
title = "TTI"
|
|
253
|
+
row = 10
|
|
254
|
+
column = 1
|
|
255
|
+
height = 3
|
|
256
|
+
width = 4
|
|
257
|
+
|
|
258
|
+
nrql_query {
|
|
259
|
+
query = "FROM SyntheticCheck SELECT average(custom.interactive) as 'TTI' FACET custom.url"
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
widget_line {
|
|
264
|
+
title = "TTI - trending"
|
|
265
|
+
row = 10
|
|
266
|
+
column = 5
|
|
267
|
+
height = 3
|
|
268
|
+
width = 8
|
|
269
|
+
|
|
270
|
+
nrql_query {
|
|
271
|
+
query = "FROM SyntheticCheck SELECT average(custom.interactive) FACET custom.url TIMESERIES AUTO"
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
widget_bar {
|
|
276
|
+
title = "Total Blocking Time (TBT)"
|
|
277
|
+
row = 13
|
|
278
|
+
column = 1
|
|
279
|
+
height = 3
|
|
280
|
+
width = 4
|
|
281
|
+
|
|
282
|
+
nrql_query {
|
|
283
|
+
query = "FROM SyntheticCheck SELECT average(custom.totalBlockingTime) FACET custom.url"
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
widget_line {
|
|
288
|
+
title = "Total Blocking Time (TBT) - trending"
|
|
289
|
+
row = 13
|
|
290
|
+
column = 5
|
|
291
|
+
height = 3
|
|
292
|
+
width = 8
|
|
293
|
+
|
|
294
|
+
nrql_query {
|
|
295
|
+
query = "FROM SyntheticCheck SELECT average(custom.totalBlockingTime) FACET custom.url TIMESERIES AUTO"
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
widget_bar {
|
|
300
|
+
title = "Cumulative Layout Shift (CLS)"
|
|
301
|
+
row = 16
|
|
302
|
+
column = 1
|
|
303
|
+
height = 3
|
|
304
|
+
width = 4
|
|
305
|
+
|
|
306
|
+
nrql_query {
|
|
307
|
+
query = "FROM SyntheticCheck SELECT average(custom.cumulativeLayoutShift) FACET custom.url"
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
widget_line {
|
|
312
|
+
title = "Cumulative Layout Shift (CLS)"
|
|
313
|
+
row = 16
|
|
314
|
+
column = 5
|
|
315
|
+
height = 3
|
|
316
|
+
width = 8
|
|
317
|
+
|
|
318
|
+
nrql_query {
|
|
319
|
+
query = "FROM SyntheticCheck SELECT average(custom.cumulativeLayoutShift) FACET custom.url TIMESERIES AUTO"
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
widget_bar {
|
|
324
|
+
title = "Speed Index"
|
|
325
|
+
row = 19
|
|
326
|
+
column = 1
|
|
327
|
+
height = 3
|
|
328
|
+
width = 4
|
|
329
|
+
|
|
330
|
+
nrql_query {
|
|
331
|
+
query = "FROM SyntheticCheck SELECT average(custom.speedIndex) FACET custom.url"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
widget_line {
|
|
336
|
+
title = "Speed Index - trading"
|
|
337
|
+
row = 19
|
|
338
|
+
column = 5
|
|
339
|
+
height = 3
|
|
340
|
+
width = 8
|
|
341
|
+
|
|
342
|
+
nrql_query {
|
|
343
|
+
query = "FROM SyntheticCheck SELECT average(custom.speedIndex) FACET custom.url TIMESERIES AUTO"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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.prod.ceng.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
|
+
})
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
})
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
resource "newrelic_synthetics_monitor" "lighthouse-monitor" {
|
|
2
|
+
name = "${data.newrelic_entity.render_app.name} Lighthouse Monitor"
|
|
3
|
+
type = "SCRIPT_API"
|
|
4
|
+
frequency = 30
|
|
5
|
+
status = "ENABLED"
|
|
6
|
+
locations = ["AWS_EU_WEST_2"]
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
resource "newrelic_synthetics_monitor_script" "lighthouse-script" {
|
|
10
|
+
monitor_id = newrelic_synthetics_monitor.lighthouse-monitor.id
|
|
11
|
+
text = "${var.environment}" == "prod" ? file("${path.module}/lighthouse-script-prod.js") : file("${path.module}/lighthouse-script.js")
|
|
12
|
+
}
|
package/next-env.d.ts
CHANGED
package/next.config.js
CHANGED
|
@@ -5,38 +5,43 @@ const withTM = require('next-transpile-modules')([
|
|
|
5
5
|
'@newskit-render/my-account',
|
|
6
6
|
'@newskit-render/validation',
|
|
7
7
|
])
|
|
8
|
+
const withBundleAnalyzer = require('@next/bundle-analyzer')({
|
|
9
|
+
enabled: process.env.ANALYZE === 'true',
|
|
10
|
+
})
|
|
8
11
|
|
|
9
|
-
module.exports =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
module.exports = withBundleAnalyzer(
|
|
13
|
+
withTM({
|
|
14
|
+
webpack: (config, options) => {
|
|
15
|
+
if (options.isServer) {
|
|
16
|
+
config.externals = ['react', ...config.externals]
|
|
17
|
+
}
|
|
14
18
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
config.resolve.alias.newskit = path.resolve(
|
|
20
|
+
__dirname,
|
|
21
|
+
'.',
|
|
22
|
+
'node_modules',
|
|
23
|
+
'newskit'
|
|
24
|
+
)
|
|
25
|
+
config.resolve.alias.react = path.resolve(
|
|
26
|
+
__dirname,
|
|
27
|
+
'.',
|
|
28
|
+
'node_modules',
|
|
29
|
+
'react'
|
|
30
|
+
)
|
|
27
31
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
})
|
|
32
|
+
return config
|
|
33
|
+
},
|
|
34
|
+
async rewrites() {
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
source: '/sitemap.xml',
|
|
38
|
+
destination: '/api/sitemap',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
source: '/news-sitemap.xml',
|
|
42
|
+
destination: '/api/news-sitemap',
|
|
43
|
+
},
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
})
|
|
47
|
+
)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@newskit-render/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.13.3",
|
|
4
4
|
"description": "Newskit Render - Core package",
|
|
5
5
|
"author": "",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -24,17 +24,20 @@
|
|
|
24
24
|
"pact:test": "NEWSKIT_API_ENV_URL='http://localhost:4343' jest --config=jest.config.pact.js",
|
|
25
25
|
"pact:publish": "pact-broker publish ./__pacts__/pacts --consumer-app-version=$(git describe --match '*core*' --abbrev=0) --tag='dev' --broker-base-url=$PACT_BROKER_URL --broker-token=$PACT_BROKER_TOKEN",
|
|
26
26
|
"lint": "eslint --ext .js,.jsx,.ts,.tsx . --color && prettier --check './**/*.{js,jsx,ts,tsx,json}'",
|
|
27
|
-
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --color --fix && prettier --write './**/*.{js,jsx,ts,tsx,json}'"
|
|
27
|
+
"lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --color --fix && prettier --write './**/*.{js,jsx,ts,tsx,json}'",
|
|
28
|
+
"precommit:lint": "eslint",
|
|
29
|
+
"precommit": "lint-staged",
|
|
30
|
+
"analyze": "ANALYZE=true next build"
|
|
28
31
|
},
|
|
29
32
|
"dependencies": {
|
|
30
33
|
"@apollo/client": "^3.4.16",
|
|
31
|
-
"@newskit-render/api": "^0.
|
|
32
|
-
"@newskit-render/auth": "^0.
|
|
33
|
-
"@newskit-render/checkout": "^0.
|
|
34
|
-
"@newskit-render/my-account": "^0.
|
|
35
|
-
"@newskit-render/shared-components": "^0.
|
|
36
|
-
"@newskit-render/sitemap": "^0.
|
|
37
|
-
"@newskit-render/validation": "^0.
|
|
34
|
+
"@newskit-render/api": "^0.8.0",
|
|
35
|
+
"@newskit-render/auth": "^0.25.0",
|
|
36
|
+
"@newskit-render/checkout": "^0.15.0",
|
|
37
|
+
"@newskit-render/my-account": "^0.123.0",
|
|
38
|
+
"@newskit-render/shared-components": "^0.25.0",
|
|
39
|
+
"@newskit-render/sitemap": "^0.28.0",
|
|
40
|
+
"@newskit-render/validation": "^0.30.0",
|
|
38
41
|
"cross-fetch": "^3.1.4",
|
|
39
42
|
"graphql": "^15.6.0",
|
|
40
43
|
"newrelic": "^7.1.0",
|
|
@@ -48,6 +51,7 @@
|
|
|
48
51
|
"devDependencies": {
|
|
49
52
|
"@apollo/react-testing": "^4.0.0",
|
|
50
53
|
"@emotion/jest": "^11.3.0",
|
|
54
|
+
"@next/bundle-analyzer": "^12.0.8",
|
|
51
55
|
"@pact-foundation/pact": "^9.12.1",
|
|
52
56
|
"@testing-library/jest-dom": "^5.11.4",
|
|
53
57
|
"@testing-library/react": "^11.0.2",
|
|
@@ -75,6 +79,7 @@
|
|
|
75
79
|
"jest": "^27.2.4",
|
|
76
80
|
"jest-junit": "^12.0.0",
|
|
77
81
|
"jest-watch-typeahead": "^0.6.3",
|
|
82
|
+
"lint-staged": "^12.1.7",
|
|
78
83
|
"next-transpile-modules": "^8.0.0",
|
|
79
84
|
"prettier": "^2.0.5",
|
|
80
85
|
"prettier-eslint": "^11.0.0",
|
|
@@ -83,6 +88,14 @@
|
|
|
83
88
|
"typescript": "^4.4.3",
|
|
84
89
|
"wait-on": "^5.3.0"
|
|
85
90
|
},
|
|
91
|
+
"precommit": [
|
|
92
|
+
"precommit"
|
|
93
|
+
],
|
|
94
|
+
"lint-staged": {
|
|
95
|
+
"**/*.(ts|tsx)": [
|
|
96
|
+
"yarn run precommit:lint"
|
|
97
|
+
]
|
|
98
|
+
},
|
|
86
99
|
"publishConfig": {
|
|
87
100
|
"access": "public"
|
|
88
101
|
},
|