Skip to content

Commit 6de405c

Browse files
Merge branch 'main' into skip-chromatic-check
2 parents d2135cf + 80315a4 commit 6de405c

77 files changed

Lines changed: 3285 additions & 3249 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.npmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
save-prefix=''
2+
public-hoist-pattern[]=*eslint*
3+
confirmModulesPurge=false

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.18.0
1+
22

ab-testing/config/abTests.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,19 @@ const ABTests: ABTest[] = [
146146
groups: ["control", "variant"],
147147
shouldForceMetricsCollection: true,
148148
},
149+
{
150+
name: "commercial-prebid-price-floor",
151+
description:
152+
"Measure the impact on bid response rate o f enforcing a minimum $0.10 bid floor on all Prebid ad slots.",
153+
owners: ["commercial.dev@guardian.co.uk"],
154+
expirationDate: "2026-05-07",
155+
type: "client",
156+
status: "ON",
157+
audienceSize: 0 / 100,
158+
audienceSpace: "A",
159+
groups: ["control", "variant"],
160+
shouldForceMetricsCollection: true,
161+
},
149162
];
150163

151164
const activeABtests = ABTests.filter((test) => test.status === "ON");

ab-testing/frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
"@guardian/ab-testing-config": "workspace:ab-testing-config",
1616
"@sveltejs/adapter-auto": "^6.0.0",
1717
"@sveltejs/adapter-static": "^3.0.8",
18-
"@sveltejs/kit": "^2.52.2",
18+
"@sveltejs/kit": "^2.57.1",
1919
"@sveltejs/vite-plugin-svelte": "^5.0.0",
2020
"svelte": "^5.53.3",
2121
"svelte-check": "^4.0.0",
2222
"typescript": "^5.0.0",
23-
"vite": "^6.2.6"
23+
"vite": "^6.4.2"
2424
}
2525
}

dotcom-rendering/Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This container is used in our CICD pipelines for running E2E and regression tests.
22
# Keep the Node version in sync with `.nvmrc`
3-
FROM node:22.18.0-alpine
3+
FROM node:22
44

55
WORKDIR /opt/app/dotcom-rendering/dotcom-rendering
66

dotcom-rendering/fixtures/manual/trails.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,6 @@ export const selfHostedLoopVideo53Card = {
747747
height: 720,
748748
},
749749
],
750-
751750
aspectRatio: 5 / 3,
752751
},
753752
} satisfies DCRFrontCard;

dotcom-rendering/scripts/check-node-versions.mjs

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ const nvmrc = (await readFile('../.nvmrc', 'utf-8'))
1515
// We don’t care about leading or trailing whitespace
1616
.trim();
1717

18-
/** Matches `x.y.z` pattern */
19-
const nodeVersionPattern = /^\d+\.\d+\.\d+$/;
18+
/** Matches `x` pattern */
19+
const nodeVersionPattern = /^\d+$/;
2020
const nodeVersion = nvmrc.match(nodeVersionPattern)?.[0] ?? undefined;
2121

2222
if (!nodeVersion) {
2323
warn(
2424
'Node version in .nvmrc has incorrect pattern:',
25-
`\`${nvmrc}\` does not match \`x.y.z\``,
25+
`Please specify a major version only (e.g. \`20\`). Full semantic versions (\`x.y.z\`) are not supported. You entered: \`${nvmrc}\``,
2626
);
2727
process.exit(1);
2828
} else {
@@ -36,13 +36,13 @@ const requiredNodeVersionMatches =
3636
/** @type {const} @satisfies {ReadonlyArray<{filepath: string, pattern: RegExp, matchLevel: MatchLevel}>}*/ ([
3737
{
3838
filepath: 'Containerfile',
39-
pattern: /^FROM node:(.+)-alpine$/m,
40-
matchLevel: 'patch',
39+
pattern: /^FROM node:(\d+)/m,
40+
matchLevel: 'major',
4141
},
4242
{
4343
filepath: 'scripts/deploy/riff-raff.yaml',
44-
pattern: /^ +Recipe: dotcom-rendering.*-node-(\d+\.\d+\.\d+).*?$/m,
45-
matchLevel: 'patch',
44+
pattern: /^ +Recipe: dotcom-rendering.*-node-(\d+).*?$/m,
45+
matchLevel: 'major',
4646
},
4747
{
4848
filepath: 'package.json',
@@ -68,15 +68,22 @@ const requiredNodeVersionMatches =
6868
* @returns boolean
6969
*/
7070
const versionMatches = (a, b, matchLevel) => {
71-
const semverA = semverParse(a);
71+
const semverA = semverParse(a) ?? semverParse(`${a}.0.0`);
72+
const semverB = semverParse(b) ?? semverParse(`${b}.0.0`);
7273

7374
switch (matchLevel) {
7475
case 'major':
75-
return semverSatisfies(b, `${semverA?.major}.x.x`);
76+
return semverA?.major === semverB?.major;
7677
case 'minor':
77-
return semverSatisfies(b, `${semverA?.major}.${semverA?.minor}.x`);
78+
return semverSatisfies(
79+
semverB?.version ?? b,
80+
`${semverA?.major}.${semverA?.minor}.x`,
81+
);
7882
case 'patch':
79-
return semverSatisfies(b, a);
83+
return semverSatisfies(
84+
semverB?.version ?? b,
85+
semverA?.version ?? a,
86+
);
8087
}
8188
};
8289

dotcom-rendering/scripts/deploy/riff-raff.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ templates:
1010
amiEncrypted: true
1111
amiTags:
1212
# Keep the Node version in sync with `.nvmrc`
13-
Recipe: dotcom-rendering-ARM-jammy-node-22.18.0
13+
Recipe: dotcom-rendering-ARM-jammy-node-22
1414
AmigoStage: PROD
1515
deployments:
1616
frontend-static:
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
import type { Meta, StoryObj } from '@storybook/react-webpack5';
2+
import { CricketMatchHeader } from './CricketMatchHeader';
3+
4+
const meta = {
5+
component: CricketMatchHeader,
6+
} satisfies Meta<typeof CricketMatchHeader>;
7+
8+
export default meta;
9+
10+
type Story = StoryObj<typeof meta>;
11+
12+
export const Fixture = {
13+
args: {
14+
edition: 'UK',
15+
match: {
16+
kind: 'Fixture',
17+
series: 'Ashes 2025–2026',
18+
competition: 'Second Test Match',
19+
venue: 'Brisbane Cricket Ground',
20+
matchDate: new Date('2026-01-26'),
21+
homeTeam: {
22+
paID: 'f7f611a1-e667-2aa2-c3e0-6dbc6981cfa4',
23+
name: 'Australia',
24+
},
25+
awayTeam: {
26+
paID: 'a359844f-fc07-9cfa-d4cc-9a9ac0d5d075',
27+
name: 'England',
28+
},
29+
innings: [],
30+
},
31+
},
32+
} satisfies Story;
33+
34+
export const Live = {
35+
args: {
36+
edition: 'UK',
37+
match: {
38+
...Fixture.args.match,
39+
kind: 'Live',
40+
day: 2,
41+
innings: [
42+
{
43+
declared: false,
44+
forfeited: false,
45+
battingTeam: 'Australia',
46+
runsScored: 169,
47+
overs: '20.0',
48+
fallOfWicket: 0,
49+
},
50+
{
51+
declared: false,
52+
forfeited: false,
53+
battingTeam: 'England',
54+
runsScored: 173,
55+
overs: '19.3',
56+
fallOfWicket: 3,
57+
},
58+
],
59+
},
60+
},
61+
} satisfies Story;
62+
63+
export const LiveYetToBat = {
64+
name: 'Live (Team yet to bat)',
65+
args: {
66+
edition: 'UK',
67+
match: {
68+
...Fixture.args.match,
69+
kind: 'Live',
70+
day: 2,
71+
innings: [
72+
{
73+
declared: false,
74+
forfeited: false,
75+
battingTeam: 'Australia',
76+
runsScored: 169,
77+
overs: '20.0',
78+
fallOfWicket: 10,
79+
},
80+
],
81+
},
82+
},
83+
} satisfies Story;
84+
85+
export const Result = {
86+
args: {
87+
edition: 'UK',
88+
match: {
89+
...Fixture.args.match,
90+
kind: 'Result',
91+
day: 4,
92+
innings: [
93+
{
94+
declared: false,
95+
forfeited: false,
96+
battingTeam: 'Australia',
97+
runsScored: 245,
98+
overs: '65.0',
99+
fallOfWicket: 10,
100+
},
101+
{
102+
declared: false,
103+
forfeited: false,
104+
battingTeam: 'England',
105+
runsScored: 361,
106+
overs: '89.5',
107+
fallOfWicket: 10,
108+
},
109+
{
110+
declared: false,
111+
forfeited: false,
112+
battingTeam: 'Australia',
113+
runsScored: 258,
114+
overs: '78.1',
115+
fallOfWicket: 10,
116+
},
117+
{
118+
declared: false,
119+
forfeited: false,
120+
battingTeam: 'England',
121+
runsScored: 364,
122+
overs: '92.5',
123+
fallOfWicket: 10,
124+
},
125+
],
126+
},
127+
},
128+
} satisfies Story;
129+
130+
export const ResultWinByWickets = {
131+
args: {
132+
edition: 'UK',
133+
match: {
134+
...Fixture.args.match,
135+
kind: 'Result',
136+
innings: [
137+
{
138+
declared: false,
139+
forfeited: false,
140+
battingTeam: 'Australia',
141+
runsScored: 186,
142+
overs: '16.2',
143+
fallOfWicket: 3,
144+
},
145+
{
146+
declared: false,
147+
forfeited: false,
148+
battingTeam: 'England',
149+
runsScored: 182,
150+
overs: '20.0',
151+
fallOfWicket: 8,
152+
},
153+
],
154+
},
155+
},
156+
} satisfies Story;
157+
158+
export const ResultDrawn = {
159+
args: {
160+
edition: 'UK',
161+
match: {
162+
...Fixture.args.match,
163+
kind: 'Result',
164+
day: 4,
165+
innings: [
166+
{
167+
declared: false,
168+
forfeited: false,
169+
battingTeam: 'Australia',
170+
runsScored: 302,
171+
overs: '120.3',
172+
fallOfWicket: 10,
173+
},
174+
{
175+
declared: false,
176+
forfeited: false,
177+
battingTeam: 'England',
178+
runsScored: 226,
179+
overs: '60.2',
180+
fallOfWicket: 10,
181+
},
182+
{
183+
declared: true,
184+
forfeited: false,
185+
battingTeam: 'Australia',
186+
runsScored: 218,
187+
overs: '72.5',
188+
fallOfWicket: 5,
189+
},
190+
{
191+
declared: false,
192+
forfeited: false,
193+
battingTeam: 'England',
194+
runsScored: 239,
195+
overs: '67.4',
196+
fallOfWicket: 7,
197+
},
198+
],
199+
},
200+
},
201+
} satisfies Story;

0 commit comments

Comments
 (0)