@newskit-render/core 0.0.0-d55b7d88
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/.ci/trigger-circleci-workflow.sh +37 -0
- package/.eslintignore +23 -0
- package/.eslintrc +74 -0
- package/.prettierignore +19 -0
- package/.prettierrc +7 -0
- package/CHANGELOG.md +7638 -0
- package/Dockerfile +14 -0
- package/Dockerfile.withNewRelic +15 -0
- package/README.md +274 -0
- package/__tests__/pages/__snapshots__/brightcove.test.tsx.snap +20 -0
- package/__tests__/pages/__snapshots__/home.test.tsx.snap +1195 -0
- package/__tests__/pages/brightcove.test.tsx +34 -0
- package/__tests__/pages/empty.test.tsx +10 -0
- package/__tests__/pages/home.test.tsx +16 -0
- package/app-context/InstrumentationContextProvider.tsx +36 -0
- package/assets/fontFamily.ts +416 -0
- package/assets/fonts/Graphik-Black-App.ttf +0 -0
- package/assets/fonts/Graphik-BlackItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Bold-App.ttf +0 -0
- package/assets/fonts/Graphik-BoldItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Extralight-App.ttf +0 -0
- package/assets/fonts/Graphik-ExtralightItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Light-App.ttf +0 -0
- package/assets/fonts/Graphik-LightItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Medium-App.ttf +0 -0
- package/assets/fonts/Graphik-Medium-Web.woff2 +0 -0
- package/assets/fonts/Graphik-MediumItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Regular-App.ttf +0 -0
- package/assets/fonts/Graphik-Regular-Web.woff2 +0 -0
- package/assets/fonts/Graphik-RegularItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Semibold-App.ttf +0 -0
- package/assets/fonts/Graphik-Semibold-Web.woff2 +0 -0
- package/assets/fonts/Graphik-SemiboldItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Super-App.ttf +0 -0
- package/assets/fonts/Graphik-SuperItalic-App.ttf +0 -0
- package/assets/fonts/Graphik-Thin-App.ttf +0 -0
- package/assets/fonts/Graphik-ThinItalic-App.ttf +0 -0
- package/assets/fonts/Montserrat-Black.ttf +0 -0
- package/assets/fonts/Montserrat-BlackItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Bold.ttf +0 -0
- package/assets/fonts/Montserrat-BoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraBold.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraBoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraLight.ttf +0 -0
- package/assets/fonts/Montserrat-ExtraLightItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Italic.ttf +0 -0
- package/assets/fonts/Montserrat-Light.ttf +0 -0
- package/assets/fonts/Montserrat-LightItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Medium.ttf +0 -0
- package/assets/fonts/Montserrat-MediumItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Regular.ttf +0 -0
- package/assets/fonts/Montserrat-SemiBold.ttf +0 -0
- package/assets/fonts/Montserrat-SemiBoldItalic.ttf +0 -0
- package/assets/fonts/Montserrat-Thin.ttf +0 -0
- package/assets/fonts/Montserrat-ThinItalic.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Black-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-BlackItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Bold-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Bold-Web.woff2 +0 -0
- package/assets/fonts/PublicoHeadline-BoldItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Extrabold-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-ExtraboldItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Italic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Light-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-LightItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Medium-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-MediumItalic-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Roman-App.ttf +0 -0
- package/assets/fonts/PublicoHeadline-Roman-Web.woff2 +0 -0
- package/assets/fonts/PublicoText-Bold-App.ttf +0 -0
- package/assets/fonts/PublicoText-BoldItalic-App.ttf +0 -0
- package/assets/fonts/PublicoText-Italic-App.ttf +0 -0
- package/assets/fonts/PublicoText-Italic-Web.woff2 +0 -0
- package/assets/fonts/PublicoText-Roman-App.ttf +0 -0
- package/assets/fonts/PublicoText-Roman-Web.woff2 +0 -0
- package/assets/fonts/PublicoText-Semibold-App.ttf +0 -0
- package/assets/fonts/PublicoText-SemiboldItalic-App.ttf +0 -0
- package/assets/fonts/Roboto-Bold.ttf +0 -0
- package/assets/fonts/Roboto-Light.ttf +0 -0
- package/assets/fonts/Roboto-Medium.ttf +0 -0
- package/assets/fonts/Roboto-Regular.ttf +0 -0
- package/assets/fonts/TheSun-Bold.ttf +0 -0
- package/assets/fonts/TheSun-BoldItalic.ttf +0 -0
- package/assets/fonts/TheSun-HeavyCondensed.ttf +0 -0
- package/assets/fonts/TheSun-HeavyNarrow.ttf +0 -0
- package/assets/fonts/TheSun-Italic.ttf +0 -0
- package/assets/fonts/TheSun-Medium.ttf +0 -0
- package/assets/fonts/TheSun-MediumItalic.ttf +0 -0
- package/assets/fonts/TheSun-Regular.ttf +0 -0
- package/assets/fonts/TimesDigital-Bold.ttf +0 -0
- package/assets/fonts/TimesDigital-BoldItalic.ttf +0 -0
- package/assets/fonts/TimesDigital-BoldSC.ttf +0 -0
- package/assets/fonts/TimesDigital-Italic.ttf +0 -0
- package/assets/fonts/TimesDigital-Regular.ttf +0 -0
- package/assets/fonts/TimesDigital-RegularSC.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-Bold.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-BoldItalic.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-BoldSC.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-Italic.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-Regular.ttf +0 -0
- package/assets/fonts/TimesDigitalW04-RegularSC.ttf +0 -0
- package/assets/fonts/TimesModern-Regular.otf +0 -0
- package/assets/fonts/attribuitions.mdx +35 -0
- package/assets/fonts/bitter-medium.woff +0 -0
- package/assets/fonts/bitter-medium.woff2 +0 -0
- package/assets/fonts/bitter-mediumitalic.woff +0 -0
- package/assets/fonts/bitter-mediumitalic.woff2 +0 -0
- package/assets/fonts/bitter-regular.woff +0 -0
- package/assets/fonts/bitter-regular.woff2 +0 -0
- package/assets/fonts/bitter-semibold.woff +0 -0
- package/assets/fonts/bitter-semibold.woff2 +0 -0
- package/assets/fonts/dmmono-medium.woff +0 -0
- package/assets/fonts/dmmono-medium.woff2 +0 -0
- package/assets/fonts/dmsans-bold-webfont.woff +0 -0
- package/assets/fonts/dmsans-bold-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-bolditalic-webfont.woff +0 -0
- package/assets/fonts/dmsans-bolditalic-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-italic-webfont.woff +0 -0
- package/assets/fonts/dmsans-italic-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-medium-webfont.woff +0 -0
- package/assets/fonts/dmsans-medium-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-mediumitalic-webfont.woff +0 -0
- package/assets/fonts/dmsans-mediumitalic-webfont.woff2 +0 -0
- package/assets/fonts/dmsans-regular-webfont.woff +0 -0
- package/assets/fonts/dmsans-regular-webfont.woff2 +0 -0
- package/assets/fonts/notosans-bold-webfont.woff +0 -0
- package/assets/fonts/notosans-bold-webfont.woff2 +0 -0
- package/assets/fonts/notosans-italic-webfont.woff +0 -0
- package/assets/fonts/notosans-italic-webfont.woff2 +0 -0
- package/assets/fonts/notosans-medium-webfont.woff +0 -0
- package/assets/fonts/notosans-medium-webfont.woff2 +0 -0
- package/assets/fonts/notosans-regular-webfont.woff +0 -0
- package/assets/fonts/notosans-regular-webfont.woff2 +0 -0
- package/assets/fonts/poppins-bold-webfont.woff +0 -0
- package/assets/fonts/poppins-bold-webfont.woff2 +0 -0
- package/assets/fonts/poppins-bolditalic-webfont.woff +0 -0
- package/assets/fonts/poppins-bolditalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-extrabold-webfont.woff +0 -0
- package/assets/fonts/poppins-extrabold-webfont.woff2 +0 -0
- package/assets/fonts/poppins-extrabolditalic-webfont.woff +0 -0
- package/assets/fonts/poppins-extrabolditalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-italic-webfont.woff +0 -0
- package/assets/fonts/poppins-italic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-light-webfont.woff +0 -0
- package/assets/fonts/poppins-light-webfont.woff2 +0 -0
- package/assets/fonts/poppins-lightitalic-webfont.woff +0 -0
- package/assets/fonts/poppins-lightitalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-medium-webfont.woff +0 -0
- package/assets/fonts/poppins-medium-webfont.woff2 +0 -0
- package/assets/fonts/poppins-mediumitalic-webfont.woff +0 -0
- package/assets/fonts/poppins-mediumitalic-webfont.woff2 +0 -0
- package/assets/fonts/poppins-regular-webfont.woff +0 -0
- package/assets/fonts/poppins-regular-webfont.woff2 +0 -0
- package/assets/fonts/poppins-semibold-webfont.woff +0 -0
- package/assets/fonts/poppins-semibold-webfont.woff2 +0 -0
- package/assets/fonts/poppins-semibolditalic-webfont.woff +0 -0
- package/assets/fonts/poppins-semibolditalic-webfont.woff2 +0 -0
- package/assets/fonts/source-serif-pro-600.woff +0 -0
- package/assets/fonts/source-serif-pro-600.woff2 +0 -0
- package/assets/fonts/source-serif-pro-600italic.woff +0 -0
- package/assets/fonts/source-serif-pro-600italic.woff2 +0 -0
- package/assets/fonts/source-serif-pro-700.woff +0 -0
- package/assets/fonts/source-serif-pro-700.woff2 +0 -0
- package/assets/fonts/source-serif-pro-700italic.woff +0 -0
- package/assets/fonts/source-serif-pro-700italic.woff2 +0 -0
- package/assets/fonts/source-serif-pro-italic.woff +0 -0
- package/assets/fonts/source-serif-pro-italic.woff2 +0 -0
- package/assets/fonts/source-serif-pro-regular.woff +0 -0
- package/assets/fonts/source-serif-pro-regular.woff2 +0 -0
- package/components/AccountDropdown/AccountDropdown.tsx +65 -0
- package/components/AccountDropdown/__tests__/AcountDropdown.test.tsx +83 -0
- package/components/AccountDropdown/accounts.ts +47 -0
- package/components/AccountDropdown/index.tsx +2 -0
- package/components/AccountDropdown/utils.ts +21 -0
- package/components/ErrorPage/ErrorPage.tsx +135 -0
- package/components/ad/index.tsx +35 -0
- package/components/article/Highlights.tsx +77 -0
- package/components/article/MetaBox.tsx +50 -0
- package/components/article/RelatedArticles.tsx +53 -0
- package/components/article/RelatedTopics.tsx +59 -0
- package/components/article/ShareBarComponent.tsx +53 -0
- package/components/article/__tests__/__snapshots__/index.test.tsx.snap +1568 -0
- package/components/article/__tests__/index.test.tsx +171 -0
- package/components/article/__tests__/mocks.ts +105 -0
- package/components/article/index.tsx +320 -0
- package/components/common/BackToHomepage.tsx +37 -0
- package/components/common/NavLink.tsx +26 -0
- package/components/common/NewskitLogo.tsx +52 -0
- package/components/common/NewskitLogoShort.tsx +48 -0
- package/components/common/SectionTitleBar.tsx +57 -0
- package/components/common/ShareButton.tsx +18 -0
- package/components/common/ViewMoreButton.tsx +20 -0
- package/components/common/iconNavLink/IconNavLink.tsx +70 -0
- package/components/common/iconNavLink/__tests__/IconNavLink.test.tsx +35 -0
- package/components/common/iconNavLink/index.ts +3 -0
- package/components/common/iconNavLink/types.ts +24 -0
- package/components/common/icons/IconAccount.tsx +13 -0
- package/components/common/icons/IconFilledTwitter.tsx +14 -0
- package/components/common/icons/StyledIconFilledChevronRight.tsx +12 -0
- package/components/footer/__snapshots__/index.test.tsx.snap +192 -0
- package/components/footer/index.test.tsx +13 -0
- package/components/footer/index.tsx +151 -0
- package/components/header/banner-messages.ts +39 -0
- package/components/header/index.tsx +52 -0
- package/components/header/navigation-links.ts +20 -0
- package/components/layout/Gutter.tsx +11 -0
- package/components/layout/LayoutTemplate.tsx +26 -0
- package/components/layout/MainGrid.tsx +66 -0
- package/components/layout/index.tsx +3 -0
- package/components/layout/layoutTypes.ts +13 -0
- package/components/section/ArticleSlice.tsx +35 -0
- package/components/section/CollectionBlock.tsx +54 -0
- package/components/section/SectionContext.tsx +9 -0
- package/components/section/__tests__/ArticleSlice.test.tsx +128 -0
- package/components/section/__tests__/CollectionBlock.test.tsx +83 -0
- package/components/section/__tests__/pageBlock.test.tsx +24 -0
- package/components/section/__tests__/sectionUtils.test.ts +94 -0
- package/components/section/index.tsx +39 -0
- package/components/section/layouts/Block.tsx +79 -0
- package/components/section/layouts/FallBack.tsx +24 -0
- package/components/section/layouts/Lead.tsx +43 -0
- package/components/section/layouts/Rows.tsx +82 -0
- package/components/section/layouts/SectionTitle.tsx +57 -0
- package/components/section/layouts/__tests__/Lead.test.tsx +37 -0
- package/components/section/layouts/__tests__/Rows.test.tsx +40 -0
- package/components/section/layouts/__tests__/SectionTitle.test.tsx +37 -0
- package/components/section/layouts/__tests__/__snapshots__/Lead.test.tsx.snap +180 -0
- package/components/section/layouts/__tests__/__snapshots__/SectionTitle.test.tsx.snap +354 -0
- package/components/section/layouts/gridUtils.ts +21 -0
- package/components/section/layouts/index.tsx +4 -0
- package/components/section/layouts/types.ts +13 -0
- package/components/section/pageBlock.tsx +23 -0
- package/components/section/sectionUtils.ts +61 -0
- package/components/teaser/index.test.tsx +50 -0
- package/components/teaser/index.tsx +64 -0
- package/components/teaser/teaserVariants.ts +33 -0
- package/components/teaser/variant-types.ts +49 -0
- package/components/teaser/variants/featureVariant.ts +42 -0
- package/components/teaser/variants/horizontal.ts +14 -0
- package/components/teaser/variants/titleTeaserVariant.ts +32 -0
- package/components/teaser/variants/titleVertical.ts +24 -0
- package/components/utils/index.test.ts +12 -0
- package/components/utils/index.ts +6 -0
- package/config/__tests__/index.test.ts +54 -0
- package/config/environment.ts +80 -0
- package/config/index.ts +2 -0
- package/config/multiTenancy.ts +11 -0
- package/constants/index.ts +2 -0
- package/context/app-context/AppContext.test.tsx +56 -0
- package/context/app-context/holidayStopListContextOverrides.ts +18 -0
- package/context/app-context/index.tsx +34 -0
- package/context/app-context/paymentMethodContext.tsx +70 -0
- package/context/index.tsx +2 -0
- package/context/multi-tenancy/MultiTenancy.test.tsx +48 -0
- package/context/multi-tenancy/index.tsx +32 -0
- package/css/index.ts +15 -0
- package/cypress/axe/terminal-log.js +19 -0
- package/cypress/config/visual.config.ts +11 -0
- package/cypress/config/visual.skip.config.ts +10 -0
- package/cypress/e2e/account/accessibility.cy.js +88 -0
- package/cypress/e2e/account/banners.cy.js +169 -0
- package/cypress/e2e/account/cancellation.cy.js +219 -0
- package/cypress/e2e/account/holiday-stops.cy.js +109 -0
- package/cypress/e2e/account/main-api.cy.js +102 -0
- package/cypress/e2e/account/newsletters-and-alerts.cy.js +149 -0
- package/cypress/e2e/account/newsletters-page.cy.js +69 -0
- package/cypress/e2e/account/payment-page.cy.js +98 -0
- package/cypress/e2e/account/personal-details.cy.js +1161 -0
- package/cypress/e2e/account/subscription-and-billing.cy.js +434 -0
- package/cypress/e2e/checkout/account-creation.cy.js +8 -0
- package/cypress/e2e/checkout/payment-details.cy.js +19 -0
- package/cypress/e2e/core/home-page.cy.js +6 -0
- package/cypress/e2e/help-hub/accessibility.cy.js +35 -0
- package/cypress/e2e/help-hub/article-page.cy.js +115 -0
- package/cypress/e2e/help-hub/landing-page.cy.js +94 -0
- package/cypress/e2e/help-hub/result-page.cy.js +117 -0
- package/cypress/fixtures/empty.html +10 -0
- package/cypress/fixtures/example.json +5 -0
- package/cypress/fixtures/holiday-stops.json +40 -0
- package/cypress/fixtures/paymentFailure.js +24 -0
- package/cypress/fixtures/testDates.js +26 -0
- package/cypress/support/commands.js +125 -0
- package/cypress/support/consentValues.js +5839 -0
- package/cypress/support/e2e.js +22 -0
- package/cypress/support/users.js +58 -0
- package/cypress/visual/account/print-visual-regression.cy.js +9 -0
- package/cypress/visual/account/visual-regression.cy.js +40 -0
- package/cypress/visual/empty/empty.cy.js +5 -0
- package/cypress.config.ts +38 -0
- package/helpers/__tests__/getUser.test.ts +45 -0
- package/helpers/__tests__/logger.test.ts +62 -0
- package/helpers/__tests__/useThemeDropdownObject.test.ts +49 -0
- package/helpers/a11y.ts +7 -0
- package/helpers/addCacheHeaders.ts +8 -0
- package/helpers/getUser.ts +37 -0
- package/helpers/getYear.ts +1 -0
- package/helpers/global-types.ts +186 -0
- package/helpers/logger/getWinstonLogger.ts +19 -0
- package/helpers/logger/index.ts +20 -0
- package/helpers/logger/replaceConsoleWithLogger.ts +14 -0
- package/helpers/mocks/articleMock.ts +50 -0
- package/helpers/mocks/getPageMock.ts +369 -0
- package/helpers/mocks/getRadioPostMock.ts +71 -0
- package/helpers/mocks/getRadioPostsMock.ts +26 -0
- package/helpers/mocks/getRecommendationsMock.ts +20 -0
- package/helpers/mocks/index.ts +7 -0
- package/helpers/multiTenancy.ts +19 -0
- package/helpers/setupTests.ts +5 -0
- package/helpers/test-utils.tsx +33 -0
- package/helpers/useThemeDropdownObject.tsx +73 -0
- package/infrastructure/.circleci/config.yml +1187 -0
- package/infrastructure/INFRASTRUCTURE.md +142 -0
- package/infrastructure/build_and_deploy.png +0 -0
- package/infrastructure/helm/Chart.yaml +21 -0
- package/infrastructure/helm/templates/_helpers.tpl +87 -0
- package/infrastructure/helm/templates/deployment.yaml +45 -0
- package/infrastructure/helm/templates/horizontalpodautoscaler.yaml +21 -0
- package/infrastructure/helm/templates/ingress.yaml +31 -0
- package/infrastructure/helm/templates/networkpolicy.yaml +26 -0
- package/infrastructure/helm/templates/secret.yaml +12 -0
- package/infrastructure/helm/templates/service.yaml +15 -0
- package/infrastructure/helm/values-dev.yaml +39 -0
- package/infrastructure/helm/values-local.yaml +30 -0
- package/infrastructure/helm/values-pr.yaml +40 -0
- package/infrastructure/helm/values-prod.yaml +39 -0
- package/infrastructure/helm/values-staging.yaml +39 -0
- package/infrastructure/helm/values.yaml +44 -0
- package/infrastructure/pull_request.png +0 -0
- package/infrastructure/release-documentation-cli.config.json +18 -0
- package/infrastructure/remove_pr.png +0 -0
- package/infrastructure/terraform-ecr/dev.tfvars +3 -0
- package/infrastructure/terraform-ecr/ecr.tf +69 -0
- package/infrastructure/terraform-ecr/main.tf +3 -0
- package/infrastructure/terraform-ecr/variables.tf +19 -0
- package/infrastructure/terraform-ecr/versions.tf +12 -0
- package/infrastructure/terraform-newrelic/alerts.tf +290 -0
- package/infrastructure/terraform-newrelic/dashboards.tf +347 -0
- package/infrastructure/terraform-newrelic/dev.tfvars +3 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-dev.js +53 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-prod.js +54 -0
- package/infrastructure/terraform-newrelic/lighthouse-script-stage.js +54 -0
- package/infrastructure/terraform-newrelic/main.tf +11 -0
- package/infrastructure/terraform-newrelic/monitors.tf +11 -0
- package/infrastructure/terraform-newrelic/prod.tfvars +3 -0
- package/infrastructure/terraform-newrelic/staging.tfvars +3 -0
- package/infrastructure/terraform-newrelic/variables.tf +33 -0
- package/infrastructure/terraform-newrelic/versions.tf +18 -0
- package/jest.config.js +40 -0
- package/jest.config.pact.js +18 -0
- package/newrelic.js +86 -0
- package/next-env.d.ts +5 -0
- package/next.config.js +95 -0
- package/package.json +127 -0
- package/pages/_app.tsx +117 -0
- package/pages/_document.tsx +112 -0
- package/pages/_error.tsx +68 -0
- package/pages/account/add/[field].tsx +34 -0
- package/pages/account/cancellation/index.tsx +22 -0
- package/pages/account/delete/confirm/index.tsx +16 -0
- package/pages/account/delete/error/index.tsx +16 -0
- package/pages/account/delete/index.tsx +16 -0
- package/pages/account/delete/success/index.tsx +16 -0
- package/pages/account/dream-team/index.tsx +19 -0
- package/pages/account/edit/[field].tsx +45 -0
- package/pages/account/family/index.tsx +19 -0
- package/pages/account/holiday-stop/index.tsx +19 -0
- package/pages/account/holiday-stop/previous-holiday-stops.tsx +19 -0
- package/pages/account/holiday-stop/upcoming-holiday-stops.tsx +19 -0
- package/pages/account/index.tsx +33 -0
- package/pages/account/newsletters/index.tsx +19 -0
- package/pages/account/newsletters-and-alerts/index.tsx +24 -0
- package/pages/account/payment/[paymentMethod].tsx +37 -0
- package/pages/account/payment/index.tsx +23 -0
- package/pages/account/payment-methods/index.tsx +21 -0
- package/pages/account/subscription-and-billing/index.tsx +29 -0
- package/pages/api/account/get-session/index.ts +33 -0
- package/pages/api/account/invoice/index.ts +35 -0
- package/pages/api/account/mutate/index.ts +8 -0
- package/pages/api/account/query/index.ts +7 -0
- package/pages/api/auth/[...nextauth].ts +11 -0
- package/pages/api/competitions-sitemap.ts +19 -0
- package/pages/api/feed.ts +23 -0
- package/pages/api/health-check.ts +7 -0
- package/pages/api/news-sitemap.ts +18 -0
- package/pages/api/pages-sitemap.ts +27 -0
- package/pages/api/robots.ts +19 -0
- package/pages/api/sitemap.ts +24 -0
- package/pages/checkout/account-creation/index.tsx +13 -0
- package/pages/checkout/payment-details/index.tsx +10 -0
- package/pages/empty.tsx +6 -0
- package/pages/help-hub/article/[title]/index.tsx +25 -0
- package/pages/help-hub/error.tsx +23 -0
- package/pages/help-hub/index.tsx +51 -0
- package/pages/help-hub/results.tsx +25 -0
- package/pages/index.tsx +19 -0
- package/pages/player/brightcove.tsx +19 -0
- package/pages/rss/create/index.tsx +18 -0
- package/pages/rss/feed/[feedId]/index.tsx +21 -0
- package/pages/rss/index.tsx +18 -0
- package/public/ads.min.js +8175 -0
- package/public/assets/display-base-header.svg +25 -0
- package/public/assets/display-personalDetails-header-sun.svg +55 -0
- package/public/assets/display-personalDetails-header-times.svg +90 -0
- package/public/assets/display-personalDetails-header-vr.svg +46 -0
- package/public/assets/dream-team.svg +10 -0
- package/public/assets/navigationPrimary-brandMark-sun.svg +9 -0
- package/public/assets/navigationPrimary-brandMark-times.svg +18 -0
- package/public/assets/navigationPrimary-brandMark-vr.svg +10 -0
- package/public/assets/newsletters/bestoftimes-101.png +0 -0
- package/public/assets/newsletters/books-115.png +0 -0
- package/public/assets/newsletters/environment-140.png +0 -0
- package/public/assets/newsletters/fashion-108.png +0 -0
- package/public/assets/newsletters/food-106.png +0 -0
- package/public/assets/newsletters/football-111.png +0 -0
- package/public/assets/newsletters/ireland-152.png +0 -0
- package/public/assets/newsletters/law-121.png +0 -0
- package/public/assets/newsletters/money-107.png +0 -0
- package/public/assets/newsletters/moneymentor-150.png +0 -0
- package/public/assets/newsletters/placeholder.png +0 -0
- package/public/assets/newsletters/politics-119.png +0 -0
- package/public/assets/newsletters/property-113.png +0 -0
- package/public/assets/newsletters/puzzles-125.png +0 -0
- package/public/assets/newsletters/scotland-134.png +0 -0
- package/public/assets/newsletters/theatre-127.png +0 -0
- package/public/assets/newsletters/travel-149.png +0 -0
- package/public/assets/newsletters/tv-133.png +0 -0
- package/public/assets/newsletters/us-153.png +0 -0
- package/public/assets/no-subscription.svg +15 -0
- package/public/assets/pending-activation.svg +16 -0
- package/public/assets/personal-details-header.svg +91 -0
- package/public/assets/plchldr150x100.png +0 -0
- package/public/assets/previous-subscription.svg +15 -0
- package/public/assets/primary-navigation-logo-white.svg +6 -0
- package/public/assets/primary-navigation-logo.svg +6 -0
- package/public/assets/tls-logo-white.svg +3 -0
- package/public/favicon.ico +0 -0
- package/public/icon.png +0 -0
- package/public/prebid.min.js +1 -0
- package/queries/getPage.ts +100 -0
- package/queries/getRadioPost.ts +61 -0
- package/queries/getRadioPosts.ts +16 -0
- package/queries/getUserSubscription.ts +9 -0
- package/queries/index.ts +3 -0
- package/scripts/k8s-local.sh +137 -0
- package/scripts/nr-exports.sh +7 -0
- package/temp/_app.tsx +15 -0
- package/temp/_document.tsx +61 -0
- package/temp/app-context-test.tsx +51 -0
- package/temp/app-context.tsx +25 -0
- package/temp/config-index.ts +1 -0
- package/temp/context-index.tsx +1 -0
- package/temp/header.tsx +45 -0
- package/temp/next.config.js +56 -0
- package/tsconfig.json +51 -0
- package/tsconfig.test.json +6 -0
- package/validation/index.tsx +24 -0
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
resource "newrelic_one_dashboard" "frontend_dashboard" {
|
|
2
|
+
name = "${data.newrelic_entity.render_app.name} Dashboards"
|
|
3
|
+
|
|
4
|
+
page {
|
|
5
|
+
name = "${data.newrelic_entity.render_app.name} Frontend Dashboard"
|
|
6
|
+
|
|
7
|
+
widget_billboard {
|
|
8
|
+
title = "90th Percentile Metrics Overview"
|
|
9
|
+
row = 1
|
|
10
|
+
column = 1
|
|
11
|
+
|
|
12
|
+
nrql_query {
|
|
13
|
+
query = "SELECT percentile(firstContentfulPaint, 90), percentile(cumulativeLayoutShift, 90), percentile(largestContentfulPaint, 90), percentile(firstInputDelay, 90), percentile(windowLoad, 90) as 'Page Load', percentile(firstInputDelay, 90)/1000 FROM PageViewTiming WHERE appName = '${data.newrelic_entity.render_app.name}'"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
widget_bar {
|
|
18
|
+
title = "75% Largest Contentful Paint"
|
|
19
|
+
row = 1
|
|
20
|
+
column = 5
|
|
21
|
+
|
|
22
|
+
nrql_query {
|
|
23
|
+
query = "SELECT percentile(largestContentfulPaint, 75) FROM PageViewTiming FACET deviceType WHERE appName = '${data.newrelic_entity.render_app.name}'"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
widget_line {
|
|
28
|
+
title = "PageView Timings (Mobile)"
|
|
29
|
+
row = 1
|
|
30
|
+
column = 9
|
|
31
|
+
|
|
32
|
+
nrql_query {
|
|
33
|
+
query = "SELECT percentile(firstContentfulPaint, 50), percentile(firstInputDelay, 50), percentile(firstPaint, 50), percentile(largestContentfulPaint, 50), percentile(cumulativeLayoutShift, 50) FROM PageViewTiming TIMESERIES WHERE deviceType = 'Mobile' WHERE appName = '${data.newrelic_entity.render_app.name}'"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
widget_line {
|
|
38
|
+
title = "PageView Timings (Desktop/Tablet)"
|
|
39
|
+
row = 2
|
|
40
|
+
column = 1
|
|
41
|
+
|
|
42
|
+
nrql_query {
|
|
43
|
+
query = "SELECT percentile(firstContentfulPaint, 75), percentile(firstInputDelay, 75), percentile(firstPaint, 75), percentile(largestContentfulPaint, 75), percentile(cumulativeLayoutShift, 75), percentile(firstInputDelay, 75) FROM PageViewTiming TIMESERIES WHERE (deviceType = 'Desktop' OR deviceType = 'Tablet') WHERE appName = '${data.newrelic_entity.render_app.name}'"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
widget_bar {
|
|
48
|
+
title = "75% First Input Delay"
|
|
49
|
+
row = 2
|
|
50
|
+
column = 5
|
|
51
|
+
|
|
52
|
+
nrql_query {
|
|
53
|
+
query = "SELECT percentile(firstInputDelay, 75)/1000 FROM PageViewTiming FACET deviceType WHERE appName = '${data.newrelic_entity.render_app.name}'"
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
widget_bar {
|
|
58
|
+
title = "75% Cumulative Layout Shift"
|
|
59
|
+
row = 2
|
|
60
|
+
column = 9
|
|
61
|
+
|
|
62
|
+
nrql_query {
|
|
63
|
+
query = "SELECT percentile(cumulativeLayoutShift, 75) FROM PageViewTiming FACET deviceType WHERE appName = '${data.newrelic_entity.render_app.name}'"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
widget_bar {
|
|
68
|
+
title = "75% First Contentful Paint"
|
|
69
|
+
row = 3
|
|
70
|
+
column = 1
|
|
71
|
+
|
|
72
|
+
nrql_query {
|
|
73
|
+
query = "SELECT percentile(firstContentfulPaint, 75) FROM PageViewTiming FACET deviceType WHERE appName = '${data.newrelic_entity.render_app.name}'"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
widget_line {
|
|
78
|
+
title = "90% First Input Delay"
|
|
79
|
+
row = 3
|
|
80
|
+
column = 5
|
|
81
|
+
|
|
82
|
+
nrql_query {
|
|
83
|
+
query = "SELECT percentile(firstInputDelay, 90)/1000 FROM PageViewTiming FACET deviceType TIMESERIES WHERE deviceType IN ('Tablet','Mobile','Desktop') AND appName = '${data.newrelic_entity.render_app.name}'"
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
widget_bar {
|
|
88
|
+
title = "Load times"
|
|
89
|
+
row = 3
|
|
90
|
+
column = 9
|
|
91
|
+
|
|
92
|
+
nrql_query {
|
|
93
|
+
query = "SELECT average(duration) AS 'Average Page Load Time', median(duration) AS 'Median Page Load Time', percentile(duration, 95) AS '95th % Page Load Time' FROM BrowserInteraction EXTRAPOLATE WHERE appName = '${data.newrelic_entity.render_app.name}'"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
page {
|
|
99
|
+
name = "${data.newrelic_entity.render_app.name} Backend Dashboard"
|
|
100
|
+
|
|
101
|
+
widget_line {
|
|
102
|
+
title = "Unique Host Count"
|
|
103
|
+
row = 1
|
|
104
|
+
column = 1
|
|
105
|
+
|
|
106
|
+
nrql_query {
|
|
107
|
+
query = "SELECT uniqueCount(host) from Transaction where appName = '${data.newrelic_entity.render_app.name}' since 1 days ago TIMESERIES"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
widget_line {
|
|
112
|
+
title = "Transactions"
|
|
113
|
+
row = 1
|
|
114
|
+
column = 5
|
|
115
|
+
|
|
116
|
+
nrql_query {
|
|
117
|
+
query = "SELECT count(*) from PageView, Transaction where appName ='${data.newrelic_entity.render_app.name}' FACET eventType() timeseries AUTO since 1 day ago"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
widget_line {
|
|
122
|
+
title = "Application Start Up Events"
|
|
123
|
+
row = 1
|
|
124
|
+
column = 9
|
|
125
|
+
|
|
126
|
+
nrql_query {
|
|
127
|
+
query = "SELECT count(*) FROM APPLICATION_START WHERE appName='${data.newrelic_entity.render_app.name}' SINCE 1 day AGO COMPARE WITH 1 DAY AGO TIMESERIES"
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
widget_line {
|
|
132
|
+
title = "Uncaught Exceptions"
|
|
133
|
+
row = 2
|
|
134
|
+
column = 1
|
|
135
|
+
|
|
136
|
+
nrql_query {
|
|
137
|
+
query = "select count(*) from TransactionError where appName = '${data.newrelic_entity.render_app.name}' where message = 'uncaughtException' or message = 'unhandledRejection' SINCE 1 day AGO COMPARE WITH 1 DAY AGO TIMESERIES"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
widget_line {
|
|
142
|
+
title = "Transaction Errors %"
|
|
143
|
+
row = 2
|
|
144
|
+
column = 5
|
|
145
|
+
|
|
146
|
+
nrql_query {
|
|
147
|
+
query = "SELECT percentage(count(*), where `error.class` IS NOT NULL) from Transaction,TransactionError where appName = '${data.newrelic_entity.render_app.name}' AND httpResponseCode != 501 since 1 days ago TIMESERIES COMPARE WITH 1 day ago"
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
widget_line {
|
|
152
|
+
title = "Endpoint Usage"
|
|
153
|
+
row = 2
|
|
154
|
+
column = 9
|
|
155
|
+
|
|
156
|
+
nrql_query {
|
|
157
|
+
query = "SELECT count(*) from Transaction where appName= '${data.newrelic_entity.render_app.name}' facet name since 1 day ago TIMESERIES"
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
widget_line {
|
|
162
|
+
title = "Backend 503 Errors"
|
|
163
|
+
row = 3
|
|
164
|
+
column = 1
|
|
165
|
+
|
|
166
|
+
nrql_query {
|
|
167
|
+
query = "SELECT count(*) from TransactionError where appName = '${data.newrelic_entity.render_app.name}' and `error.message` like '%503: %' since 1 days ago TIMESERIES"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
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' WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
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 WHERE custom.url = '${var.lighthouseUrl}'"
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
}
|
|
@@ -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();
|
|
@@ -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 >.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}`;
|
|
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
|
+
|
|
@@ -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
|
+
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
provider "newrelic" {
|
|
2
|
+
account_id = var.newrelic_account_id
|
|
3
|
+
api_key = var.newrelic_api_key
|
|
4
|
+
region = "US"
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
data "newrelic_entity" "render_app" {
|
|
8
|
+
name = "${var.prefix}:${var.project_name}:${var.environment}"
|
|
9
|
+
type = "APPLICATION"
|
|
10
|
+
domain = "APM"
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
resource "newrelic_synthetics_script_monitor" "lighthouse-monitor" {
|
|
2
|
+
name = "${data.newrelic_entity.render_app.name} Lighthouse Monitor"
|
|
3
|
+
type = "SCRIPT_API"
|
|
4
|
+
locations_public = ["EU_WEST_2"]
|
|
5
|
+
period = "EVERY_30_MINUTES"
|
|
6
|
+
status = "ENABLED"
|
|
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
|
+
script_language = "JAVASCRIPT"
|
|
9
|
+
runtime_type = "NODE_API"
|
|
10
|
+
runtime_type_version = "16.10"
|
|
11
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
variable "newrelic_account_id" {
|
|
2
|
+
description = "NewRelic acccount ID"
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
variable "newrelic_api_key" {
|
|
6
|
+
description = "NewRelic personal API key"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
variable "newrelic_slack_webhook" {
|
|
10
|
+
description = "webhook that sends alerts to slack"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
variable "namespace" {
|
|
14
|
+
description = "The namespace used for kubernetes deployments"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
variable "environment" {
|
|
18
|
+
description = "Alias to be used when creating resources"
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
variable "prefix" {
|
|
22
|
+
description = "Prefix for all project services"
|
|
23
|
+
default = "<% PROJECT_PREFIX >"
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
variable "project_name" {
|
|
27
|
+
description = "The Project name"
|
|
28
|
+
default = "<% PROJECT_NAME >"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
variable "lighthouseUrl" {
|
|
32
|
+
description = "url to be analyzed by Lighthouse"
|
|
33
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
terraform {
|
|
2
|
+
required_providers {
|
|
3
|
+
newrelic = {
|
|
4
|
+
source = "newrelic/newrelic"
|
|
5
|
+
version = "3.14.0"
|
|
6
|
+
}
|
|
7
|
+
template = {
|
|
8
|
+
source = "hashicorp/template"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
backend "s3" {
|
|
13
|
+
bucket = "<% S3_BUCKET_NAME >"
|
|
14
|
+
region = "eu-west-1"
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
required_version = ">= 1.3.9"
|
|
18
|
+
}
|
package/jest.config.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
process.env.TZ = 'GMT'
|
|
2
|
+
|
|
3
|
+
const nextJest = require('next/jest')
|
|
4
|
+
|
|
5
|
+
const createJestConfig = nextJest({
|
|
6
|
+
// Provide the path to your Next.js app to load next.config.js and .env files in your test environment
|
|
7
|
+
dir: './',
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
const customJestConfig = {
|
|
11
|
+
setupFilesAfterEnv: ['<rootDir>/helpers/setupTests.ts'],
|
|
12
|
+
moduleDirectories: ['node_modules', '<rootDir>/'],
|
|
13
|
+
coverageThreshold: {
|
|
14
|
+
global: {
|
|
15
|
+
branches: 50,
|
|
16
|
+
functions: 90,
|
|
17
|
+
lines: 90,
|
|
18
|
+
statements: 90,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
moduleNameMapper: {
|
|
22
|
+
'^react$': '<rootDir>/node_modules/react',
|
|
23
|
+
'^newskit$': '<rootDir>/node_modules/newskit',
|
|
24
|
+
},
|
|
25
|
+
testEnvironment: 'jest-environment-jsdom',
|
|
26
|
+
watchPlugins: [
|
|
27
|
+
'jest-watch-typeahead/filename',
|
|
28
|
+
'jest-watch-typeahead/testname',
|
|
29
|
+
],
|
|
30
|
+
testPathIgnorePatterns: [
|
|
31
|
+
'<rootDir>/cypress/',
|
|
32
|
+
'<rootDir>/node_modules/',
|
|
33
|
+
'<rootDir>/.next/',
|
|
34
|
+
],
|
|
35
|
+
coveragePathIgnorePatterns: ['<rootDir>/config/environment.ts'],
|
|
36
|
+
testMatch: ['**/?(*.)+(test).[jt]s?(x)'],
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// createJestConfig is exported this way to ensure that next/jest can load the Next.js config which is async
|
|
40
|
+
module.exports = createJestConfig(customJestConfig)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
process.env.PORT = 4343
|
|
2
|
+
module.exports = {
|
|
3
|
+
testEnvironment: 'node',
|
|
4
|
+
testMatch: [
|
|
5
|
+
'<rootDir>/__pacts__/**/*.pact.ts',
|
|
6
|
+
],
|
|
7
|
+
globals: {
|
|
8
|
+
'ts-jest': {
|
|
9
|
+
tsconfig: 'tsconfig.test.json'
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
transform: {
|
|
13
|
+
'^.+\\.(ts|tsx)$': 'ts-jest',
|
|
14
|
+
},
|
|
15
|
+
modulePathIgnorePatterns: [],
|
|
16
|
+
moduleFileExtensions: ['ts', 'tsx', 'js', 'json'],
|
|
17
|
+
preset: 'ts-jest/presets/js-with-ts',
|
|
18
|
+
};
|