@newskit-render/core 1.11.3 → 1.17.4

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.
Files changed (89) hide show
  1. package/.eslintignore +5 -1
  2. package/CHANGELOG.md +168 -0
  3. package/__tests__/pages/[articleSlug].test.tsx +1 -1
  4. package/__tests__/pages/__snapshots__/home.test.tsx.snap +1 -1
  5. package/__tests__/pages/home.test.tsx +1 -0
  6. package/components/article/__tests__/__snapshots__/index.test.tsx.snap +1 -1
  7. package/components/header/index.test.tsx +1 -1
  8. package/components/header/index.tsx +9 -5
  9. package/components/section/__tests__/ArticleSlice.test.tsx +32 -24
  10. package/helpers/a11y.ts +8 -6
  11. package/helpers/mocks/articleMock.ts +8 -4
  12. package/helpers/mocks/getRadioPostMock.ts +4 -2
  13. package/helpers/mocks/getUniversalArticleMock.ts +8 -4
  14. package/infrastructure/.circleci/config.yml +1 -0
  15. package/next.config.js +37 -32
  16. package/package.json +63 -50
  17. package/pages/[section]/[articleId]/[articleSlug].tsx +1 -0
  18. package/pages/[section]/index.tsx +1 -0
  19. package/pages/_app.tsx +172 -0
  20. package/pages/_document.tsx +13 -8
  21. package/pages/index.tsx +1 -0
  22. package/public/fonts/bitter-medium.woff +0 -0
  23. package/public/fonts/bitter-medium.woff2 +0 -0
  24. package/public/fonts/bitter-mediumitalic.woff +0 -0
  25. package/public/fonts/bitter-mediumitalic.woff2 +0 -0
  26. package/public/fonts/bitter-regular.woff +0 -0
  27. package/public/fonts/bitter-regular.woff2 +0 -0
  28. package/public/fonts/bitter-semibold.woff +0 -0
  29. package/public/fonts/bitter-semibold.woff2 +0 -0
  30. package/public/fonts/dmmono-medium.woff +0 -0
  31. package/public/fonts/dmmono-medium.woff2 +0 -0
  32. package/public/fonts/dmsans-bold-webfont.woff +0 -0
  33. package/public/fonts/dmsans-bold-webfont.woff2 +0 -0
  34. package/public/fonts/dmsans-bolditalic-webfont.woff +0 -0
  35. package/public/fonts/dmsans-bolditalic-webfont.woff2 +0 -0
  36. package/public/fonts/dmsans-italic-webfont.woff +0 -0
  37. package/public/fonts/dmsans-italic-webfont.woff2 +0 -0
  38. package/public/fonts/dmsans-medium-webfont.woff +0 -0
  39. package/public/fonts/dmsans-medium-webfont.woff2 +0 -0
  40. package/public/fonts/dmsans-mediumitalic-webfont.woff +0 -0
  41. package/public/fonts/dmsans-mediumitalic-webfont.woff2 +0 -0
  42. package/public/fonts/dmsans-regular-webfont.woff +0 -0
  43. package/public/fonts/dmsans-regular-webfont.woff2 +0 -0
  44. package/public/fonts/notosans-bold-webfont.woff +0 -0
  45. package/public/fonts/notosans-bold-webfont.woff2 +0 -0
  46. package/public/fonts/notosans-italic-webfont.woff +0 -0
  47. package/public/fonts/notosans-italic-webfont.woff2 +0 -0
  48. package/public/fonts/notosans-medium-webfont.woff +0 -0
  49. package/public/fonts/notosans-medium-webfont.woff2 +0 -0
  50. package/public/fonts/notosans-regular-webfont.woff +0 -0
  51. package/public/fonts/notosans-regular-webfont.woff2 +0 -0
  52. package/public/fonts/poppins-bold-webfont.woff +0 -0
  53. package/public/fonts/poppins-bold-webfont.woff2 +0 -0
  54. package/public/fonts/poppins-bolditalic-webfont.woff +0 -0
  55. package/public/fonts/poppins-bolditalic-webfont.woff2 +0 -0
  56. package/public/fonts/poppins-extrabold-webfont.woff +0 -0
  57. package/public/fonts/poppins-extrabold-webfont.woff2 +0 -0
  58. package/public/fonts/poppins-extrabolditalic-webfont.woff +0 -0
  59. package/public/fonts/poppins-extrabolditalic-webfont.woff2 +0 -0
  60. package/public/fonts/poppins-italic-webfont.woff +0 -0
  61. package/public/fonts/poppins-italic-webfont.woff2 +0 -0
  62. package/public/fonts/poppins-light-webfont.woff +0 -0
  63. package/public/fonts/poppins-light-webfont.woff2 +0 -0
  64. package/public/fonts/poppins-lightitalic-webfont.woff +0 -0
  65. package/public/fonts/poppins-lightitalic-webfont.woff2 +0 -0
  66. package/public/fonts/poppins-medium-webfont.woff +0 -0
  67. package/public/fonts/poppins-medium-webfont.woff2 +0 -0
  68. package/public/fonts/poppins-mediumitalic-webfont.woff +0 -0
  69. package/public/fonts/poppins-mediumitalic-webfont.woff2 +0 -0
  70. package/public/fonts/poppins-regular-webfont.woff +0 -0
  71. package/public/fonts/poppins-regular-webfont.woff2 +0 -0
  72. package/public/fonts/poppins-semibold-webfont.woff +0 -0
  73. package/public/fonts/poppins-semibold-webfont.woff2 +0 -0
  74. package/public/fonts/poppins-semibolditalic-webfont.woff +0 -0
  75. package/public/fonts/poppins-semibolditalic-webfont.woff2 +0 -0
  76. package/public/fonts/source-serif-pro-600.woff +0 -0
  77. package/public/fonts/source-serif-pro-600.woff2 +0 -0
  78. package/public/fonts/source-serif-pro-600italic.woff +0 -0
  79. package/public/fonts/source-serif-pro-600italic.woff2 +0 -0
  80. package/public/fonts/source-serif-pro-700.woff +0 -0
  81. package/public/fonts/source-serif-pro-700.woff2 +0 -0
  82. package/public/fonts/source-serif-pro-700italic.woff +0 -0
  83. package/public/fonts/source-serif-pro-700italic.woff2 +0 -0
  84. package/public/fonts/source-serif-pro-italic.woff +0 -0
  85. package/public/fonts/source-serif-pro-italic.woff2 +0 -0
  86. package/public/fonts/source-serif-pro-regular.woff +0 -0
  87. package/public/fonts/source-serif-pro-regular.woff2 +0 -0
  88. package/public/prebid.min.js +1 -0
  89. package/temp/_document.tsx +1 -1
package/.eslintignore CHANGED
@@ -13,4 +13,8 @@ next-env.d.ts
13
13
  helpers/setupTests.ts
14
14
  newrelic.js
15
15
  infrastructure/helm/*
16
- infrastructure/terraform-newrelic/*.js
16
+ infrastructure/terraform-newrelic/*.js
17
+
18
+ # for after scaffold
19
+ helm/*
20
+ terraform-newrelic/*.js
package/CHANGELOG.md CHANGED
@@ -3,6 +3,174 @@
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.17.4](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.17.3...@newskit-render/core@1.17.4) (2022-01-27)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **PPDSR-654:** change logo aria-label ([#574](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/574)) ([7562b5f](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/7562b5f5deb4a857881db3d06dfbbeb36e69701f))
12
+
13
+
14
+
15
+
16
+
17
+ ## [1.17.3](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.17.2...@newskit-render/core@1.17.3) (2022-01-27)
18
+
19
+ **Note:** Version bump only for package @newskit-render/core
20
+
21
+
22
+
23
+
24
+
25
+ ## [1.17.2](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.17.1...@newskit-render/core@1.17.2) (2022-01-27)
26
+
27
+ **Note:** Version bump only for package @newskit-render/core
28
+
29
+
30
+
31
+
32
+
33
+ ## [1.17.1](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.17.0...@newskit-render/core@1.17.1) (2022-01-25)
34
+
35
+ **Note:** Version bump only for package @newskit-render/core
36
+
37
+
38
+
39
+
40
+
41
+ # [1.17.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.16.0...@newskit-render/core@1.17.0) (2022-01-25)
42
+
43
+
44
+ ### Features
45
+
46
+ * **PPDSR-618:** Fix lint errors when cra is scaffold ([#568](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/568)) ([a9e176a](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/a9e176a5f6f944eb8755624ebb5c692a86b2207d))
47
+
48
+
49
+
50
+
51
+
52
+ # [1.16.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.15.0...@newskit-render/core@1.16.0) (2022-01-25)
53
+
54
+
55
+ ### Features
56
+
57
+ * **PPDSR-566:** remove carrot from dependencies ([#572](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/572)) ([a00f25a](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/a00f25a871f023b6008fe06a1391e83328d3ad58))
58
+
59
+
60
+
61
+
62
+
63
+ # [1.15.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.14.2...@newskit-render/core@1.15.0) (2022-01-25)
64
+
65
+
66
+ ### Features
67
+
68
+ * **PPDSR-638:** Remove ads from Account/Checkout ([#570](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/570)) ([03400f6](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/03400f6cf4bd63a54c5c6720b8a12e120d30bbff))
69
+
70
+
71
+
72
+
73
+
74
+ ## [1.14.2](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.14.1...@newskit-render/core@1.14.2) (2022-01-24)
75
+
76
+ **Note:** Version bump only for package @newskit-render/core
77
+
78
+
79
+
80
+
81
+
82
+ ## [1.14.1](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.14.0...@newskit-render/core@1.14.1) (2022-01-20)
83
+
84
+ **Note:** Version bump only for package @newskit-render/core
85
+
86
+
87
+
88
+
89
+
90
+ # [1.14.0](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.13.4...@newskit-render/core@1.14.0) (2022-01-20)
91
+
92
+
93
+ ### Features
94
+
95
+ * **PPDSR-543:** Update newskitAPI session ([#564](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/564)) ([1e60be8](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/1e60be84984fc5fa163a9ab2e29d1e6a4eb4a935))
96
+
97
+
98
+
99
+
100
+
101
+ ## [1.13.4](https://github.com/newscorp-ghfb/ncu-newskit-render/compare/@newskit-render/core@1.13.3...@newskit-render/core@1.13.4) (2022-01-19)
102
+
103
+
104
+ ### Bug Fixes
105
+
106
+ * **PPDSR-628:** add new fonts ([#557](https://github.com/newscorp-ghfb/ncu-newskit-render/issues/557)) ([541bc58](https://github.com/newscorp-ghfb/ncu-newskit-render/commit/541bc5832dea4abd7d94f93f9c5ff32704da2326))
107
+
108
+
109
+
110
+
111
+
112
+ ## [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)
113
+
114
+ **Note:** Version bump only for package @newskit-render/core
115
+
116
+
117
+
118
+
119
+
120
+ ## [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)
121
+
122
+ **Note:** Version bump only for package @newskit-render/core
123
+
124
+
125
+
126
+
127
+
128
+ ## [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)
129
+
130
+ **Note:** Version bump only for package @newskit-render/core
131
+
132
+
133
+
134
+
135
+
136
+ # [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)
137
+
138
+
139
+ ### Features
140
+
141
+ * **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))
142
+
143
+
144
+
145
+
146
+
147
+ ## [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)
148
+
149
+ **Note:** Version bump only for package @newskit-render/core
150
+
151
+
152
+
153
+
154
+
155
+ # [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)
156
+
157
+
158
+ ### Features
159
+
160
+ * **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))
161
+
162
+
163
+
164
+
165
+
166
+ ## [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)
167
+
168
+ **Note:** Version bump only for package @newskit-render/core
169
+
170
+
171
+
172
+
173
+
6
174
  ## [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)
7
175
 
8
176
 
@@ -138,7 +138,7 @@ describe('Article', () => {
138
138
  req: { headers: { cookie: 'some-cookie' } },
139
139
  res: { setHeader: setHeaderMock },
140
140
  })
141
- expect(response).toEqual({ props: { ...props } })
141
+ expect(response).toEqual({ props: { ...props, showAds: true } })
142
142
  expect(setHeaderMock).toHaveBeenCalledWith(
143
143
  'Cache-Control',
144
144
  'public, s-maxage=10, stale-while-revalidate=59'
@@ -475,7 +475,7 @@ exports[`getServerSideProps Homepage 1`] = `
475
475
  class="emotion-4"
476
476
  >
477
477
  <a
478
- aria-label="Home Page"
478
+ aria-label="Logo Link"
479
479
  class="emotion-5"
480
480
  href="/"
481
481
  >
@@ -61,6 +61,7 @@ describe('getServerSideProps', () => {
61
61
  title: 'Test title',
62
62
  },
63
63
  },
64
+ showAds: true,
64
65
  },
65
66
  })
66
67
  )
@@ -475,7 +475,7 @@ exports[`Article should render tile and sub title 1`] = `
475
475
  class="emotion-4"
476
476
  >
477
477
  <a
478
- aria-label="Home Page"
478
+ aria-label="Logo Link"
479
479
  class="emotion-5"
480
480
  href="/"
481
481
  >
@@ -37,7 +37,7 @@ describe('Header tests', () => {
37
37
 
38
38
  test('render links', () => {
39
39
  const { getByLabelText } = renderWithTheme(Header)
40
- expect(getByLabelText('Home Page')).toHaveAttribute('href', '/')
40
+ expect(getByLabelText('Logo Link')).toHaveAttribute('href', '/')
41
41
  expect(getByLabelText('Section One Link')).toHaveAttribute(
42
42
  'href',
43
43
  '/section-one'
@@ -54,21 +54,25 @@ const StyledHeader = styled.div`
54
54
  const pastDueBanner = {
55
55
  firstNotice: {
56
56
  title: "We haven't been able to take payment",
57
- text: 'You may need to update your payment details to keep your subscription.',
57
+ text:
58
+ 'You may need to update your payment details to keep your subscription.',
58
59
  button: 'Update payment details',
59
60
  },
60
61
  secondNotice: {
61
62
  title: 'Act now to keep your subscription',
62
- text: 'We’ve tried several times, but haven’t been able to take payment. Please update your payment details to keep your subscription.',
63
+ text:
64
+ 'We’ve tried several times, but haven’t been able to take payment. Please update your payment details to keep your subscription.',
63
65
  button: 'Update payment details',
64
66
  },
65
67
  terminated: {
66
68
  title: 'Your subscription has been terminated',
67
- text: 'We didn’t receive payment for your subscription. To reactivate it, please call 0800 018 5177.',
69
+ text:
70
+ 'We didn’t receive payment for your subscription. To reactivate it, please call 0800 018 5177.',
68
71
  },
69
72
  cancelled: {
70
73
  title: 'Your subscription has been cancelled.',
71
- text: 'You’ll no longer have access to subscription benefits. To re-activate call 0800 555 1234.',
74
+ text:
75
+ 'You’ll no longer have access to subscription benefits. To re-activate call 0800 555 1234.',
72
76
  },
73
77
  treshold: {
74
78
  firstNotice: 26,
@@ -184,7 +188,7 @@ const Header: React.FC<{ user: UserData }> = ({ user }) => {
184
188
  type="standalone"
185
189
  overrides={{ stylePreset: 'linkStandaloneInverse' }}
186
190
  href="/"
187
- aria-label="Home Page"
191
+ aria-label="Logo Link"
188
192
  >
189
193
  <Visible md lg xl>
190
194
  <NewsKitLogoFull color="white" size="sizing120" />
@@ -34,18 +34,22 @@ describe('ArticleSlice', () => {
34
34
  })
35
35
 
36
36
  test('Handle SECONDARY_4 article-block Index Page', () => {
37
- const { getByTestId, getAllByTestId, getAllByRole, queryByTestId } =
38
- renderWithTheme(SectionContext.Provider, {
39
- value: {
40
- isIndexPage: true,
41
- },
42
- children: (
43
- <ArticleSlice
44
- slice={getPageMock.page.body[0].children[1]}
45
- collection={getPageMock.page.body[0]}
46
- />
47
- ),
48
- })
37
+ const {
38
+ getByTestId,
39
+ getAllByTestId,
40
+ getAllByRole,
41
+ queryByTestId,
42
+ } = renderWithTheme(SectionContext.Provider, {
43
+ value: {
44
+ isIndexPage: true,
45
+ },
46
+ children: (
47
+ <ArticleSlice
48
+ slice={getPageMock.page.body[0].children[1]}
49
+ collection={getPageMock.page.body[0]}
50
+ />
51
+ ),
52
+ })
49
53
  expect(queryByTestId('SectionTitleBar')).not.toBeInTheDocument()
50
54
  expect(getByTestId('SECONDARY_4-Grid')).toBeInTheDocument()
51
55
  expect(getAllByTestId(/titleTeaserVertical-/).length).toEqual(4)
@@ -67,18 +71,22 @@ describe('ArticleSlice', () => {
67
71
  })
68
72
 
69
73
  test('Handle SECONDARY_4_ODD article-block Index Page', () => {
70
- const { getByTestId, getAllByTestId, getAllByRole, queryByTestId } =
71
- renderWithTheme(SectionContext.Provider, {
72
- value: {
73
- isIndexPage: true,
74
- },
75
- children: (
76
- <ArticleSlice
77
- slice={getPageMock.page.body[0].children[5]}
78
- collection={getPageMock.page.body[0]}
79
- />
80
- ),
81
- })
74
+ const {
75
+ getByTestId,
76
+ getAllByTestId,
77
+ getAllByRole,
78
+ queryByTestId,
79
+ } = renderWithTheme(SectionContext.Provider, {
80
+ value: {
81
+ isIndexPage: true,
82
+ },
83
+ children: (
84
+ <ArticleSlice
85
+ slice={getPageMock.page.body[0].children[5]}
86
+ collection={getPageMock.page.body[0]}
87
+ />
88
+ ),
89
+ })
82
90
  expect(getByTestId('SectionTitleBar')).toBeInTheDocument()
83
91
  expect(queryByTestId('addTopSpace')).toBeInTheDocument()
84
92
  expect(getByTestId('SECONDARY_4_ODD-Grid')).toBeInTheDocument()
package/helpers/a11y.ts CHANGED
@@ -1,7 +1,9 @@
1
- export const handleEnterKeyPress =
2
- (onClick: () => void) =>
3
- ({ key }: { key: string }) => {
4
- if (key === 'Enter') {
5
- onClick()
6
- }
1
+ export const handleEnterKeyPress = (onClick: () => void) => ({
2
+ key,
3
+ }: {
4
+ key: string
5
+ }) => {
6
+ if (key === 'Enter') {
7
+ onClick()
7
8
  }
9
+ }
@@ -26,25 +26,29 @@ export const relatedArticles = [
26
26
  {
27
27
  title: 'Prince Harry',
28
28
  tag: 'NEWS',
29
- text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
29
+ text:
30
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
30
31
  href: imagePlaceholderHref('70x50'),
31
32
  },
32
33
  {
33
34
  title: 'Meghan Markle',
34
35
  tag: 'SPORT',
35
- text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
36
+ text:
37
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
36
38
  href: imagePlaceholderHref('70x50'),
37
39
  },
38
40
  {
39
41
  title: 'Royal Family',
40
42
  tag: 'CULTURE',
41
- text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
43
+ text:
44
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
42
45
  href: imagePlaceholderHref('70x50'),
43
46
  },
44
47
  {
45
48
  title: 'Royal Family',
46
49
  tag: 'CORONAVIRUS',
47
- text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
50
+ text:
51
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut a sodales leo. Cras egestas nisl libero, vitae viverra justo gravida quis.',
48
52
  href: imagePlaceholderHref('70x50'),
49
53
  },
50
54
  ]
@@ -29,7 +29,8 @@ export default [
29
29
  italic: false,
30
30
  underline: false,
31
31
  monospace: false,
32
- text: 'Proin eget tortor risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; ',
32
+ text:
33
+ 'Proin eget tortor risus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; ',
33
34
  },
34
35
  {
35
36
  type: 'text',
@@ -45,7 +46,8 @@ export default [
45
46
  italic: false,
46
47
  underline: false,
47
48
  monospace: false,
48
- text: ', auctor sit amet aliquam vel, ullamcorper sit amet ligula. Donec rutrum congue leo eget malesuada. Proin eget tortor risus. Sed porttitor lectus nibh. Donec sollicitudin molestie malesuada.',
49
+ text:
50
+ ', auctor sit amet aliquam vel, ullamcorper sit amet ligula. Donec rutrum congue leo eget malesuada. Proin eget tortor risus. Sed porttitor lectus nibh. Donec sollicitudin molestie malesuada.',
49
51
  },
50
52
  ],
51
53
  },
@@ -51,17 +51,21 @@ export default [
51
51
  summary: {
52
52
  children: [
53
53
  {
54
- text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
54
+ text:
55
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
55
56
  },
56
57
  {
57
- text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
58
+ text:
59
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
58
60
  },
59
61
  {
60
62
  url: 'http://this-is-a-url/',
61
- text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
63
+ text:
64
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
62
65
  },
63
66
  {
64
- text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
67
+ text:
68
+ 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis eget lorem vel nunc feugiat malesuada ut ac nisi. Morbi odio ipsum, dignissim nec turpis vel, laoreet condimentum tortor. Duis laoreet tincidunt ullamcorper.',
65
69
  },
66
70
  ],
67
71
  },
@@ -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
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 = withTM({
10
- webpack: (config, options) => {
11
- if (options.isServer) {
12
- config.externals = ['react', ...config.externals]
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
- config.resolve.alias.newskit = path.resolve(
16
- __dirname,
17
- '.',
18
- 'node_modules',
19
- 'newskit'
20
- )
21
- config.resolve.alias.react = path.resolve(
22
- __dirname,
23
- '.',
24
- 'node_modules',
25
- 'react'
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
- return config
29
- },
30
- async rewrites() {
31
- return [
32
- {
33
- source: '/sitemap.xml',
34
- destination: '/api/sitemap',
35
- },
36
- {
37
- source: '/news-sitemap.xml',
38
- destination: '/api/news-sitemap',
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.11.3",
3
+ "version": "1.17.4",
4
4
  "description": "Newskit Render - Core package",
5
5
  "author": "",
6
6
  "license": "UNLICENSED",
@@ -24,64 +24,77 @@
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
- "@apollo/client": "^3.4.16",
31
- "@newskit-render/api": "^0.6.0",
32
- "@newskit-render/auth": "^0.23.0",
33
- "@newskit-render/checkout": "^0.12.0",
34
- "@newskit-render/my-account": "^0.119.0",
35
- "@newskit-render/shared-components": "^0.22.0",
36
- "@newskit-render/sitemap": "^0.26.0",
37
- "@newskit-render/validation": "^0.28.0",
38
- "cross-fetch": "^3.1.4",
39
- "graphql": "^15.6.0",
40
- "newrelic": "^7.1.0",
33
+ "@apollo/client": "3.4.16",
34
+ "@newskit-render/api": "^0.10.1",
35
+ "@newskit-render/auth": "^0.26.1",
36
+ "@newskit-render/checkout": "^0.16.1",
37
+ "@newskit-render/my-account": "^0.126.1",
38
+ "@newskit-render/shared-components": "^0.27.1",
39
+ "@newskit-render/sitemap": "^0.29.1",
40
+ "@newskit-render/validation": "^0.31.1",
41
+ "cross-fetch": "3.1.5",
42
+ "graphql": "15.6.0",
43
+ "newrelic": "7.1.0",
41
44
  "newskit": "4.3.1",
42
- "next": "^12.0.2",
43
- "react": "^17.0.1",
44
- "react-dom": "^17.0.2",
45
- "react-helmet": "^6.1.0",
45
+ "next": "12.0.8",
46
+ "react": "17.0.2",
47
+ "react-dom": "17.0.2",
48
+ "react-helmet": "6.1.0",
46
49
  "react-hook-form": "7.8.4"
47
50
  },
48
51
  "devDependencies": {
49
- "@apollo/react-testing": "^4.0.0",
50
- "@emotion/jest": "^11.3.0",
51
- "@pact-foundation/pact": "^9.12.1",
52
- "@testing-library/jest-dom": "^5.11.4",
53
- "@testing-library/react": "^11.0.2",
54
- "@types/newrelic": "^7.0.0",
55
- "@types/react": "^16.9.49",
56
- "@types/react-helmet": "^6.1.0",
57
- "@typescript-eslint/eslint-plugin": "^3.7.1",
58
- "@typescript-eslint/parser": "^3.7.1",
59
- "babel-jest": "^26.3.0",
52
+ "@apollo/react-testing": "4.0.0",
53
+ "@emotion/jest": "11.3.0",
54
+ "@next/bundle-analyzer": "12.0.8",
55
+ "@pact-foundation/pact": "9.12.1",
56
+ "@testing-library/jest-dom": "5.11.4",
57
+ "@testing-library/react": "11.0.2",
58
+ "@types/newrelic": "7.0.0",
59
+ "@types/react": "17.0.2",
60
+ "@types/react-helmet": "6.1.0",
61
+ "@typescript-eslint/eslint-plugin": "3.7.1",
62
+ "@typescript-eslint/parser": "3.7.1",
63
+ "babel-jest": "26.3.0",
60
64
  "cypress": "9.0.0",
61
- "eslint": "^6.6.0",
62
- "eslint-config-airbnb": "^18.2.0",
63
- "eslint-config-airbnb-typescript": "^9.0.0",
64
- "eslint-config-prettier": "^6.11.0",
65
- "eslint-config-react-app": "^5.2.1",
66
- "eslint-import-resolver-typescript": "^2.0.0",
67
- "eslint-loader": "^4.0.2",
68
- "eslint-plugin-cypress": "^2.11.2",
69
- "eslint-plugin-flowtype": "^5.2.0",
70
- "eslint-plugin-import": "^2.22.1",
65
+ "eslint": "6.6.0",
66
+ "eslint-config-airbnb": "18.2.0",
67
+ "eslint-config-airbnb-typescript": "9.0.0",
68
+ "eslint-config-prettier": "6.11.0",
69
+ "eslint-config-react-app": "5.2.1",
70
+ "eslint-import-resolver-typescript": "2.0.0",
71
+ "eslint-loader": "4.0.2",
72
+ "eslint-plugin-cypress": "2.11.2",
73
+ "eslint-plugin-flowtype": "5.2.0",
74
+ "eslint-plugin-import": "2.22.1",
71
75
  "eslint-plugin-jsx-a11y": "6.2.3",
72
- "eslint-plugin-prettier": "^3.1.4",
76
+ "eslint-plugin-prettier": "3.1.4",
73
77
  "eslint-plugin-react": "7.19.0",
74
- "eslint-plugin-react-hooks": "^1.6.1",
75
- "jest": "^27.2.4",
76
- "jest-junit": "^12.0.0",
77
- "jest-watch-typeahead": "^0.6.3",
78
- "next-transpile-modules": "^8.0.0",
79
- "prettier": "^2.0.5",
80
- "prettier-eslint": "^11.0.0",
81
- "prettier-eslint-cli": "^5.0.0",
82
- "ts-jest": "^27.0.5",
83
- "typescript": "^4.4.3",
84
- "wait-on": "^5.3.0"
78
+ "eslint-plugin-react-hooks": "1.6.1",
79
+ "jest": "27.2.4",
80
+ "jest-junit": "12.0.0",
81
+ "jest-watch-typeahead": "0.6.3",
82
+ "lint-staged": "12.1.7",
83
+ "next-transpile-modules": "8.0.0",
84
+ "prettier": "2.0.5",
85
+ "prettier-eslint": "11.0.0",
86
+ "prettier-eslint-cli": "5.0.0",
87
+ "ts-jest": "27.0.5",
88
+ "typescript": "4.4.3",
89
+ "wait-on": "5.3.0"
90
+ },
91
+ "precommit": [
92
+ "precommit"
93
+ ],
94
+ "lint-staged": {
95
+ "**/*.(ts|tsx)": [
96
+ "yarn run precommit:lint"
97
+ ]
85
98
  },
86
99
  "publishConfig": {
87
100
  "access": "public"
@@ -70,6 +70,7 @@ export async function getServerSideProps(context) {
70
70
  twitterUsername: process.env.TWITTER_USERNAME || '',
71
71
  siteHost: process.env.SITE_HOST || '',
72
72
  gscId: process.env.GSC_ID || '',
73
+ showAds: true,
73
74
  // user,
74
75
  },
75
76
  }
@@ -38,6 +38,7 @@ export async function getServerSideProps(context) {
38
38
  props: {
39
39
  page: data.page,
40
40
  isIndexPage: true,
41
+ showAds: true,
41
42
  // user,
42
43
  },
43
44
  }
package/pages/_app.tsx CHANGED
@@ -49,6 +49,178 @@ const GlobalStyling = css`
49
49
  font-family: TheSun-Medium;
50
50
  src: url('/fonts/TheSun-Medium.ttf') format('truetype');
51
51
  }
52
+ @font-face {
53
+ font-family: 'DM Sans';
54
+ src: url('/fonts/dmsans-regular-webfont.woff2') format('woff2'),
55
+ url('/fonts/dmsans-regular-webfont.woff') format('woff');
56
+ font-style: normal;
57
+ font-weight: 400;
58
+ font-display: swap;
59
+ }
60
+ @font-face {
61
+ font-family: 'DM Sans';
62
+ src: url('/fonts/dmsans-italic-webfont.woff2') format('woff2'),
63
+ url('/fonts/dmsans-italic-webfont.woff') format('woff');
64
+ font-style: italic;
65
+ font-weight: 400;
66
+ font-display: swap;
67
+ }
68
+ @font-face {
69
+ font-family: 'DM Sans';
70
+ src: url('/fonts/dmsans-medium-webfont.woff2') format('woff2'),
71
+ url('/fonts/dmsans-medium-webfont.woff') format('woff');
72
+ font-style: normal;
73
+ font-weight: 500;
74
+ font-display: swap;
75
+ }
76
+ @font-face {
77
+ font-family: 'DM Sans';
78
+ src: url('/fonts/dmsans-mediumitalic-webfont.woff2') format('woff2'),
79
+ url('/fonts/dmsans-mediumitalic-webfont.woff') format('woff');
80
+ font-style: italic;
81
+ font-weight: 500;
82
+ font-display: swap;
83
+ }
84
+ @font-face {
85
+ font-family: 'DM Sans';
86
+ src: url('/fonts/dmsans-bold-webfont.woff2') format('woff2'),
87
+ url('/fonts/dmsans-bold-webfont.woff') format('woff');
88
+ font-style: normal;
89
+ font-weight: 700;
90
+ font-display: swap;
91
+ }
92
+ @font-face {
93
+ font-family: 'DM Sans';
94
+ src: url('/fonts/dmsans-bolditalic-webfont.woff2') format('woff2'),
95
+ url('/fonts/dmsans-bolditalic-webfont.woff') format('woff');
96
+ font-style: italic;
97
+ font-weight: 700;
98
+ font-display: swap;
99
+ }
100
+ @font-face {
101
+ font-family: 'Poppins';
102
+ src: url('/fonts/poppins-bold-webfont.woff2') format('woff2'),
103
+ url('/fonts/poppins-bold-webfont.woff') format('woff');
104
+ font-weight: 700;
105
+ font-style: normal;
106
+ }
107
+ @font-face {
108
+ font-family: 'Poppins';
109
+ src: url('/fonts/poppins-bolditalic-webfont.woff2') format('woff2'),
110
+ url('/fonts/poppins-bolditalic-webfont.woff') format('woff');
111
+ font-weight: normal;
112
+ font-style: italic;
113
+ }
114
+ @font-face {
115
+ font-family: 'Poppins';
116
+ src: url('/fonts/poppins-extrabold-webfont.woff2') format('woff2'),
117
+ url('/fonts/poppins-extrabold-webfont.woff') format('woff');
118
+ font-weight: 800;
119
+ font-style: normal;
120
+ }
121
+ @font-face {
122
+ font-family: 'Poppins';
123
+ src: url('/fonts/poppins-extrabolditalic-webfont.woff2') format('woff2'),
124
+ url('/fonts/poppins-extrabolditalic-webfont.woff') format('woff');
125
+ font-weight: 800;
126
+ font-style: italic;
127
+ }
128
+ @font-face {
129
+ font-family: 'Poppins';
130
+ src: url('/fonts/poppins-italic-webfont.woff2') format('woff2'),
131
+ url('/fonts/poppins-italic-webfont.woff') format('woff');
132
+ font-weight: 400;
133
+ font-style: italic;
134
+ }
135
+ @font-face {
136
+ font-family: 'Poppins';
137
+ src: url('/fonts/poppins-light-webfont.woff2') format('woff2'),
138
+ url('/fonts/poppins-light-webfont.woff') format('woff');
139
+ font-weight: 300;
140
+ font-style: normal;
141
+ }
142
+ @font-face {
143
+ font-family: 'Poppins';
144
+ src: url('/fonts/poppins-lightitalic-webfont.woff2') format('woff2'),
145
+ url('/fonts/poppins-lightitalic-webfont.woff') format('woff');
146
+ font-weight: 300;
147
+ font-style: italic;
148
+ }
149
+ @font-face {
150
+ font-family: 'Poppins';
151
+ src: url('/fonts/poppins-medium-webfont.woff2') format('woff2'),
152
+ url('/fonts/poppins-medium-webfont.woff') format('woff');
153
+ font-weight: 500;
154
+ font-style: normal;
155
+ }
156
+ @font-face {
157
+ font-family: 'Poppins';
158
+ src: url('/fonts/poppins-mediumitalic-webfont.woff2') format('woff2'),
159
+ url('/fonts/poppins-mediumitalic-webfont.woff') format('woff');
160
+ font-weight: 500;
161
+ font-style: italic;
162
+ }
163
+ @font-face {
164
+ font-family: 'Poppins';
165
+ src: url('/fonts/poppins-regular-webfont.woff2') format('woff2'),
166
+ url('/fonts/poppins-regular-webfont.woff') format('woff');
167
+ font-weight: 400;
168
+ font-style: normal;
169
+ }
170
+ @font-face {
171
+ font-family: 'Poppins';
172
+ src: url('/fonts/poppins-semibold-webfont.woff2') format('woff2'),
173
+ url('/fonts/poppins-semibold-webfont.woff') format('woff');
174
+ font-weight: 600;
175
+ font-style: normal;
176
+ }
177
+ @font-face {
178
+ font-family: 'Poppins';
179
+ src: url('/fonts/poppins-semibolditalic-webfont.woff2') format('woff2'),
180
+ url('/fonts/poppins-semibolditalic-webfont.woff') format('woff');
181
+ font-weight: 600;
182
+ font-style: italic;
183
+ }
184
+ @font-face {
185
+ font-family: 'DM Mono';
186
+ src: url('/fonts/dmmono-medium.woff2') format('woff2'),
187
+ url('/fonts/dmmono-medium.woff') format('woff');
188
+ font-style: normal;
189
+ font-weight: 500;
190
+ font-display: swap;
191
+ }
192
+ @font-face {
193
+ font-family: 'Bitter';
194
+ src: url('/fonts/bitter-regular.woff2') format('woff2'),
195
+ url('/fonts/bitter-regular.woff') format('woff');
196
+ font-style: normal;
197
+ font-weight: 400;
198
+ font-display: swap;
199
+ }
200
+ @font-face {
201
+ font-family: 'Bitter';
202
+ src: url('/fonts/bitter-medium.woff2') format('woff2'),
203
+ url('/fonts/bitter-medium.woff') format('woff');
204
+ font-style: normal;
205
+ font-weight: 500;
206
+ font-display: swap;
207
+ }
208
+ @font-face {
209
+ font-family: 'Bitter';
210
+ src: url('/fonts/bitter-mediumitalic.woff2') format('woff2'),
211
+ url('/fonts/bitter-mediumitalic.woff') format('woff');
212
+ font-style: italic;
213
+ font-weight: 500;
214
+ font-display: swap;
215
+ }
216
+ @font-face {
217
+ font-family: 'Bitter';
218
+ src: url('/fonts/bitter-semibold.woff2') format('woff2'),
219
+ url('/fonts/bitter-semibold.woff') format('woff');
220
+ font-style: normal;
221
+ font-weight: 600;
222
+ font-display: swap;
223
+ }
52
224
 
53
225
  html,
54
226
  body {
@@ -32,6 +32,7 @@ export default class MyDocument extends Document {
32
32
 
33
33
  render() {
34
34
  const helmet = Helmet.rewind()
35
+ const { showAds } = this.props.__NEXT_DATA__.props.pageProps
35
36
  return (
36
37
  <Html lang="en">
37
38
  <Head>
@@ -62,14 +63,18 @@ export default class MyDocument extends Document {
62
63
  />
63
64
  )}
64
65
  <meta name="robots" content="noindex" />
65
- <script
66
- type="text/javascript"
67
- src="https://ads.newskit.co.uk/prebid.newskit.min.js"
68
- />
69
- <script
70
- type="text/javascript"
71
- src="https://ads.newskit.co.uk/ads.newskit.min.js"
72
- />
66
+ {showAds && (
67
+ <>
68
+ <script
69
+ type="text/javascript"
70
+ src="https://ads.newskit.co.uk/prebid.newskit.min.js"
71
+ />
72
+ <script
73
+ type="text/javascript"
74
+ src="https://ads.newskit.co.uk/ads.newskit.min.js"
75
+ />
76
+ </>
77
+ )}
73
78
  </Head>
74
79
  <body>
75
80
  {TEALIUM_ACCOUNT_ID && (
package/pages/index.tsx CHANGED
@@ -35,6 +35,7 @@ export async function getServerSideProps(context) {
35
35
  return {
36
36
  props: {
37
37
  page,
38
+ showAds: true,
38
39
  // user: (user || null),
39
40
  },
40
41
  }
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ console.log('Please speak to commercial to get a link to your ad library CDN link')
@@ -23,7 +23,7 @@ export default class MyDocument extends Document {
23
23
 
24
24
  render() {
25
25
  const helmet = Helmet.rewind()
26
-
26
+ <% SHOWADS >
27
27
  return (
28
28
  <Html lang="en">
29
29
  <Head>