diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 6f20e7270c..70ac638788 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -55,7 +55,7 @@ jobs: # All rendering apps deployment - name: Upload rendering apps to RiffRaff - uses: guardian/actions-riff-raff@v4 + uses: guardian/actions-riff-raff@v4.1.2 with: githubToken: ${{ secrets.GITHUB_TOKEN }} roleArn: ${{ secrets.GU_RIFF_RAFF_ROLE_ARN }} diff --git a/dotcom-rendering/package.json b/dotcom-rendering/package.json index 6ab042c52b..16fe2eba18 100644 --- a/dotcom-rendering/package.json +++ b/dotcom-rendering/package.json @@ -41,7 +41,7 @@ "@guardian/bridget": "8.1.0", "@guardian/browserslist-config": "6.1.0", "@guardian/cdk": "50.13.0", - "@guardian/commercial": "23.7.4", + "@guardian/commercial": "24.0.0", "@guardian/core-web-vitals": "7.0.0", "@guardian/eslint-config": "7.0.1", "@guardian/eslint-config-typescript": "9.0.1", diff --git a/dotcom-rendering/src/lib/getFrontsAdPositions.ts b/dotcom-rendering/src/lib/getFrontsAdPositions.ts index 4d0fd72fa1..44179f544c 100644 --- a/dotcom-rendering/src/lib/getFrontsAdPositions.ts +++ b/dotcom-rendering/src/lib/getFrontsAdPositions.ts @@ -12,6 +12,7 @@ type GroupedCounts = { veryBig: number; big: number; standard: number; + splash: number; }; type AdCandidate = Pick; @@ -75,13 +76,14 @@ const getMobileAdPositions = (collections: AdCandidate[]): number[] => { * * A result of 3 would approximately be the height of a typical desktop viewport (~900px). * A result of 1 would be a third of the height, a result of 1.5 would be half, etc. + * A result of 6 indicates a container is at least double the height of a typical desktop viewport. */ const getCollectionHeight = ( collction: Pick< DCRCollectionType, 'collectionType' | 'containerPalette' | 'grouped' >, -): 0.5 | 1 | 1.5 | 2 | 2.5 | 3 => { +): 0.5 | 1 | 1.5 | 2 | 2.5 | 3 | 6 => { const { collectionType, containerPalette, grouped } = collction; if (containerPalette === 'PodcastPalette') { @@ -95,18 +97,22 @@ const getCollectionHeight = ( veryBig: grouped.veryBig.length, big: grouped.big.length, standard: grouped.standard.length, + splash: grouped.splash.length, }; switch (collectionType) { // Some thrashers are very small. Since we'd prefer to have ads above content rather than thrashers, // err on the side of inserting fewer ads, by setting the number on the small side for thrashers case 'fixed/thrasher': + case 'scrollable/small': return 0.5; case 'fixed/small/slow-IV': case 'fixed/small/slow-V-mpu': case 'nav/list': case 'nav/media-list': + case 'scrollable/medium': + case 'static/medium/4': return 1; case 'fixed/small/slow-I': @@ -116,6 +122,7 @@ const getCollectionHeight = ( case 'fixed/small/fast-VIII': case 'fixed/video': case 'fixed/video/vertical': + case 'scrollable/feature': return 1.5; case 'fixed/medium/slow-VI': @@ -123,6 +130,7 @@ const getCollectionHeight = ( case 'fixed/medium/slow-XII-mpu': case 'fixed/medium/fast-XI': case 'fixed/medium/fast-XII': + case 'static/feature/2': return 2; case 'fixed/large/slow-XIV': @@ -157,6 +165,29 @@ const getCollectionHeight = ( } return 1; + case 'flexible/special': + if (groupedCounts.snap && !groupedCounts.splash) { + return 1.5; + } else if (groupedCounts.splash && !groupedCounts.standard) { + return 2.5; + } else { + return 3; + } + + case 'flexible/general': + if (groupedCounts.splash && !groupedCounts.standard) { + return 2.5; + } else if (groupedCounts.splash && groupedCounts.standard > 2) { + return 6; + } else if ( + grouped.splash[0]?.boostLevel === 'megaboost' || + grouped.splash[0]?.boostLevel === 'gigaboost' + ) { + return 6; + } else { + return 3; + } + default: return 1; // Unknown collection type. } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a238575d84..9adc5e49b7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -338,8 +338,8 @@ importers: specifier: 50.13.0 version: 50.13.0(@swc/core@1.9.2)(@types/node@20.14.10)(aws-cdk-lib@2.100.0)(aws-cdk@2.100.0)(constructs@10.3.0)(typescript@5.5.3) '@guardian/commercial': - specifier: 23.7.4 - version: 23.7.4(@guardian/ab-core@8.0.0)(@guardian/core-web-vitals@7.0.0)(@guardian/identity-auth-frontend@4.0.0)(@guardian/identity-auth@2.1.0)(@guardian/libs@19.2.1)(@guardian/source@8.0.0)(react-dom@18.3.1)(react@18.3.1)(typescript@5.5.3) + specifier: 24.0.0 + version: 24.0.0(@guardian/ab-core@8.0.0)(@guardian/core-web-vitals@7.0.0)(@guardian/identity-auth-frontend@4.0.0)(@guardian/identity-auth@2.1.0)(@guardian/libs@19.2.1)(@guardian/source@8.0.0)(react-dom@18.3.1)(react@18.3.1)(typescript@5.5.3) '@guardian/core-web-vitals': specifier: 7.0.0 version: 7.0.0(@guardian/libs@19.2.1)(tslib@2.6.2)(typescript@5.5.3)(web-vitals@4.2.3) @@ -3849,31 +3849,31 @@ packages: - typescript dev: false - /@guardian/commercial@23.7.4(@guardian/ab-core@8.0.0)(@guardian/core-web-vitals@7.0.0)(@guardian/identity-auth-frontend@4.0.0)(@guardian/identity-auth@2.1.0)(@guardian/libs@19.2.1)(@guardian/source@8.0.0)(react-dom@18.3.1)(react@18.3.1)(typescript@5.5.3): - resolution: {integrity: sha512-VMRRWR0pUMcZkDYfJ8kf8LD5OK/x29WPjbphizCAB0h7zJTeRKhUiJfQQ3l0YNZA+MrRXzY+PZIaf2IZvQJbGg==} + /@guardian/commercial@24.0.0(@guardian/ab-core@8.0.0)(@guardian/core-web-vitals@7.0.0)(@guardian/identity-auth-frontend@4.0.0)(@guardian/identity-auth@2.1.0)(@guardian/libs@19.2.1)(@guardian/source@8.0.0)(react-dom@18.3.1)(react@18.3.1)(typescript@5.5.3): + resolution: {integrity: sha512-GlM/kkyDXHySjnmy0L6byzIQCV9ZER39YufTQR151uK404AwPF7Mgxyr3oj0erkUh6jEyQfwfn5VXqEUTk6/vw==} peerDependencies: '@guardian/ab-core': ^8.0.0 - '@guardian/core-web-vitals': ^7.0.0 - '@guardian/identity-auth': ^3.0.0 - '@guardian/identity-auth-frontend': ^5.0.0 + '@guardian/core-web-vitals': ^8.0.1 + '@guardian/identity-auth': ^4.0.0 + '@guardian/identity-auth-frontend': ^6.0.0 '@guardian/libs': ^19.1.0 '@guardian/source': ^8.0.0 - typescript: ~5.5.3 + typescript: ~5.5.2 dependencies: '@guardian/ab-core': 8.0.0(tslib@2.6.2)(typescript@5.5.3) '@guardian/core-web-vitals': 7.0.0(@guardian/libs@19.2.1)(tslib@2.6.2)(typescript@5.5.3)(web-vitals@4.2.3) '@guardian/identity-auth': 2.1.0(@guardian/libs@19.2.1)(tslib@2.6.2)(typescript@5.5.3) '@guardian/identity-auth-frontend': 4.0.0(@guardian/identity-auth@2.1.0)(@guardian/libs@19.2.1)(tslib@2.6.2)(typescript@5.5.3) '@guardian/libs': 19.2.1(tslib@2.6.2)(typescript@5.5.3) - '@guardian/prebid.js': 8.52.0-8(react-dom@18.3.1)(react@18.3.1)(tslib@2.6.2)(typescript@5.5.3) + '@guardian/prebid.js': 8.52.0-10(react-dom@18.3.1)(react@18.3.1)(tslib@2.8.1)(typescript@5.5.3) '@guardian/source': 8.0.0(@emotion/react@11.11.3)(@types/react@18.3.1)(react@18.3.1)(tslib@2.6.2)(typescript@5.5.3) '@octokit/core': 6.1.2 fastdom: 1.0.12 lodash-es: 4.17.21 process: 0.11.10 - tslib: 2.6.2 + tslib: 2.8.1 typescript: 5.5.3 - web-vitals: 4.2.3 + web-vitals: 4.2.4 transitivePeerDependencies: - arc-templates - atpl @@ -4024,7 +4024,7 @@ packages: '@typescript-eslint/parser': 6.18.0(eslint@8.56.0)(typescript@5.5.3) eslint: 8.56.0 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@6.18.0)(eslint-plugin-import@2.29.1)(eslint@8.56.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.18.0)(eslint@8.56.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.18.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) tslib: 2.6.2 typescript: 5.5.3 transitivePeerDependencies: @@ -4132,7 +4132,7 @@ packages: typescript: 5.5.3 dev: false - /@guardian/libs@18.0.0(tslib@2.6.2)(typescript@5.5.3): + /@guardian/libs@18.0.0(tslib@2.8.1)(typescript@5.5.3): resolution: {integrity: sha512-V/aVeCg3yEDBiw6ykAIRux3HCpORKPAzTReDogg2ZHf8BV0v7P2ysc/etO5TW4+8FVd6X8SpX3GmTP3YePx8FQ==} peerDependencies: tslib: ^2.6.2 @@ -4141,7 +4141,7 @@ packages: typescript: optional: true dependencies: - tslib: 2.6.2 + tslib: 2.8.1 typescript: 5.5.3 dev: false @@ -4165,8 +4165,8 @@ packages: '@guardian/tsconfig': 1.0.0 dev: false - /@guardian/prebid.js@8.52.0-8(react-dom@18.3.1)(react@18.3.1)(tslib@2.6.2)(typescript@5.5.3): - resolution: {integrity: sha512-JQ9unudgn5DAwLoqEiBdjuEaEFOhR9JZhjHD46pm4306C1XfYF0ts3YWIT9poq6vN1tbMQJw0NQeyXcL5QGIcA==} + /@guardian/prebid.js@8.52.0-10(react-dom@18.3.1)(react@18.3.1)(tslib@2.8.1)(typescript@5.5.3): + resolution: {integrity: sha512-/oGFQ3GlwzJOfc7Fe1AiTI2XCjPcco7fDDli4FDJx0GAuiJDuzL6hEogqATXJzbmaXx3zp21nRgyxYh+ykR1AA==} engines: {node: '>=12.0.0'} dependencies: '@babel/core': 7.26.0 @@ -4174,7 +4174,7 @@ packages: '@babel/preset-env': 7.26.0(@babel/core@7.26.0) '@babel/register': 7.24.6(@babel/core@7.26.0) '@babel/runtime': 7.26.0 - '@guardian/libs': 18.0.0(tslib@2.6.2)(typescript@5.5.3) + '@guardian/libs': 18.0.0(tslib@2.8.1)(typescript@5.5.3) core-js: 3.33.3 core-js-pure: 3.38.1 criteo-direct-rsa-validate: 1.1.0 @@ -6191,7 +6191,7 @@ packages: react-docgen-typescript: 2.2.2(typescript@5.5.3) tslib: 2.6.2 typescript: 5.5.3 - webpack: 5.97.1(esbuild@0.18.20)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.9.2)(esbuild@0.18.20)(webpack-cli@5.1.4) transitivePeerDependencies: - supports-color dev: false @@ -7749,8 +7749,8 @@ packages: webpack: 5.x.x webpack-cli: 5.x.x dependencies: - webpack: 5.97.1(esbuild@0.18.20)(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.97.1) + webpack: 5.97.1(@swc/core@1.9.2)(esbuild@0.18.20)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.1.0)(webpack@5.97.1) dev: false /@webpack-cli/info@2.0.2(webpack-cli@5.1.4)(webpack@5.97.1): @@ -7760,8 +7760,8 @@ packages: webpack: 5.x.x webpack-cli: 5.x.x dependencies: - webpack: 5.97.1(esbuild@0.18.20)(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.97.1) + webpack: 5.97.1(@swc/core@1.9.2)(esbuild@0.18.20)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.1.0)(webpack@5.97.1) dev: false /@webpack-cli/serve@2.0.5(webpack-cli@5.1.4)(webpack-dev-server@5.1.0)(webpack@5.97.1): @@ -7775,8 +7775,8 @@ packages: webpack-dev-server: optional: true dependencies: - webpack: 5.97.1(esbuild@0.18.20)(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.97.1) + webpack: 5.97.1(@swc/core@1.9.2)(esbuild@0.18.20)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.1.0)(webpack@5.97.1) webpack-dev-server: 5.1.0(webpack-cli@5.1.4)(webpack@5.97.1) dev: false @@ -8384,7 +8384,7 @@ packages: '@babel/core': 7.26.0 find-cache-dir: 4.0.0 schema-utils: 4.2.0 - webpack: 5.97.1(esbuild@0.18.20)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.9.2)(esbuild@0.18.20)(webpack-cli@5.1.4) dev: false /babel-plugin-istanbul@6.1.1: @@ -9552,7 +9552,7 @@ packages: postcss-modules-values: 4.0.0(postcss@8.4.47) postcss-value-parser: 4.2.0 semver: 7.5.4 - webpack: 5.97.1(esbuild@0.18.20)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.9.2)(esbuild@0.18.20)(webpack-cli@5.1.4) dev: false /css-loader@7.1.2(webpack@5.97.1): @@ -10530,7 +10530,7 @@ packages: enhanced-resolve: 5.17.0 eslint: 8.56.0 eslint-module-utils: 2.8.0(@typescript-eslint/parser@6.18.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.18.0)(eslint@8.56.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@6.18.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.56.0) fast-glob: 3.3.2 get-tsconfig: 4.7.2 is-core-module: 2.15.1 @@ -11536,7 +11536,7 @@ packages: semver: 7.5.4 tapable: 2.2.1 typescript: 5.5.3 - webpack: 5.97.1(esbuild@0.18.20)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.9.2)(esbuild@0.18.20)(webpack-cli@5.1.4) dev: false /form-data-encoder@2.1.4: @@ -16720,7 +16720,7 @@ packages: peerDependencies: webpack: ^5.0.0 dependencies: - webpack: 5.97.1(esbuild@0.18.20)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.9.2)(esbuild@0.18.20)(webpack-cli@5.1.4) dev: false /stylelint-config-recommended@14.0.0(stylelint@16.5.0): @@ -17206,7 +17206,7 @@ packages: semver: 7.5.4 source-map: 0.7.4 typescript: 5.5.3 - webpack: 5.97.1(esbuild@0.18.20)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.9.2)(esbuild@0.18.20)(webpack-cli@5.1.4) dev: false /ts-node@10.9.2(@swc/core@1.9.2)(@types/node@16.18.68)(typescript@5.1.6): @@ -17341,6 +17341,10 @@ packages: resolution: {integrity: sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==} dev: false + /tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} + dev: false + /tsutils@3.21.0(typescript@5.5.3): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} engines: {node: '>= 6'} @@ -17840,6 +17844,10 @@ packages: resolution: {integrity: sha512-/CFAm1mNxSmOj6i0Co+iGFJ58OS4NRGVP+AWS/l509uIK5a1bSoIVaHz/ZumpHTfHSZBpgrJ+wjfpAOrTHok5Q==} dev: false + /web-vitals@4.2.4: + resolution: {integrity: sha512-r4DIlprAGwJ7YM11VZp4R884m0Vmgr6EAKe3P+kO0PPj3Unqyvv59rczf6UiGcb9Z8QxZVcqKNwv/g0WNdWwsw==} + dev: false + /webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: false @@ -17980,7 +17988,7 @@ packages: mime-types: 2.1.35 range-parser: 1.2.1 schema-utils: 4.2.0 - webpack: 5.97.1(esbuild@0.18.20)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.9.2)(esbuild@0.18.20)(webpack-cli@5.1.4) dev: false /webpack-dev-middleware@7.4.2(webpack@5.97.1): @@ -18040,8 +18048,8 @@ packages: serve-index: 1.9.1 sockjs: 0.3.24 spdy: 4.0.2 - webpack: 5.97.1(esbuild@0.18.20)(webpack-cli@5.1.4) - webpack-cli: 5.1.4(webpack-dev-server@5.1.0)(webpack@5.97.1) + webpack: 5.97.1(@swc/core@1.9.2)(esbuild@0.18.20)(webpack-cli@5.1.4) + webpack-cli: 5.1.4(webpack-bundle-analyzer@4.10.2)(webpack-dev-server@5.1.0)(webpack@5.97.1) webpack-dev-middleware: 7.4.2(webpack@5.97.1) ws: 8.18.0 transitivePeerDependencies: @@ -18086,7 +18094,7 @@ packages: webpack: ^5.47.0 dependencies: tapable: 2.2.1 - webpack: 5.97.1(esbuild@0.18.20)(webpack-cli@5.1.4) + webpack: 5.97.1(@swc/core@1.9.2)(esbuild@0.18.20)(webpack-cli@5.1.4) webpack-sources: 2.3.1 dev: false patched: true