Skip to content

Commit 9bc670d

Browse files
Merge branch 'main' into patch-1
2 parents 9f889c1 + b2eae7d commit 9bc670d

File tree

179 files changed

+1145
-675
lines changed

Some content is hidden

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

179 files changed

+1145
-675
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ updates:
1313
- '@rollup/*'
1414
- '@types/react'
1515
- '@types/react-*'
16+
- 'caniuse-lite'
1617
- 'classnames'
1718
- 'nhsuk-frontend'
1819
- 'react'

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
run: corepack enable
2828

2929
- name: Set up Node.js
30-
uses: actions/setup-node@v5
30+
uses: actions/setup-node@v6
3131
with:
3232
cache: yarn
3333
node-version-file: .nvmrc

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
run: corepack enable
1919

2020
- name: Set up Node.js
21-
uses: actions/setup-node@v5
21+
uses: actions/setup-node@v6
2222
with:
2323
cache: yarn
2424
node-version-file: .nvmrc

.storybook/manager.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { addons } from 'storybook/manager-api';
2-
import nhsTheme from './theme';
31
import { startCase, upperFirst } from 'lodash';
2+
import { addons } from 'storybook/manager-api';
3+
4+
import nhsTheme from './theme.js';
45

56
const sentenceCase = (name = '') => {
67
if (!name || typeof name !== 'string') {

.storybook/theme.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { create } from 'storybook/theming/create';
2+
23
import packageJson from '../package.json' with { type: 'json' };
34

45
export default create({

.yarnrc.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,8 @@ packageExtensions:
1313
storybook@*:
1414
peerDependencies:
1515
"@testing-library/dom": "*"
16+
react: "*"
17+
react-dom: "*"
18+
vite@*:
19+
peerDependencies:
20+
rollup: "*"

eslint.config.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
import { join } from 'node:path';
2+
3+
import { includeIgnoreFile } from '@eslint/compat';
4+
import eslint from '@eslint/js';
5+
import { defineConfig, globalIgnores } from 'eslint/config';
26
import configPrettier from 'eslint-config-prettier/flat';
7+
import pluginImport from 'eslint-plugin-import';
8+
import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
39
import pluginReact from 'eslint-plugin-react';
410
import pluginReactHooks from 'eslint-plugin-react-hooks';
5-
import eslint from '@eslint/js';
6-
import pluginJsxA11y from 'eslint-plugin-jsx-a11y';
7-
import { includeIgnoreFile } from '@eslint/compat';
8-
import { defineConfig, globalIgnores } from 'eslint/config';
911
import globals from 'globals';
10-
import pluginImport from 'eslint-plugin-import';
1112
import pluginTypeScript from 'typescript-eslint';
1213

1314
const rootPath = import.meta.dirname;
@@ -44,8 +45,23 @@ export default defineConfig([
4445
'import/no-unresolved': 'off',
4546
'import/no-unused-modules': 'off',
4647

48+
// Always import Node.js packages from `node:*`
49+
'import/enforce-node-protocol-usage': ['error', 'always'],
50+
51+
// Check import or require statements are A-Z ordered
52+
'import/order': [
53+
'error',
54+
{
55+
'alphabetize': { order: 'asc' },
56+
'newlines-between': 'always',
57+
},
58+
],
59+
4760
// Prefer rules that are type aware
61+
'no-redeclare': 'off',
62+
'no-undef': 'off',
4863
'no-unused-vars': 'off',
64+
'@typescript-eslint/no-redeclare': 'error',
4965
'@typescript-eslint/no-unused-vars': [
5066
'error',
5167
{

package.json

Lines changed: 20 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,10 @@
1212
"import": "./dist/esm/components/*",
1313
"require": "./dist/cjs/components/*"
1414
},
15-
"#components": {
16-
"import": "./dist/esm/components/index.js",
17-
"require": "./dist/cjs/components/index.cjs"
18-
},
1915
"#patterns/*": {
2016
"import": "./dist/esm/patterns/*",
2117
"require": "./dist/cjs/patterns/*"
2218
},
23-
"#patterns": {
24-
"import": "./dist/esm/patterns/index.js",
25-
"require": "./dist/cjs/patterns/index.cjs"
26-
},
2719
"#util/*": {
2820
"import": "./dist/esm/util/*",
2921
"require": "./dist/cjs/util/*"
@@ -68,41 +60,41 @@
6860
"prepublishOnly": "yarn storybook --smoke-test"
6961
},
7062
"devDependencies": {
71-
"@babel/core": "^7.28.4",
72-
"@babel/preset-env": "^7.28.3",
73-
"@babel/preset-react": "^7.27.1",
74-
"@babel/preset-typescript": "^7.27.1",
75-
"@eslint/compat": "^1.4.0",
76-
"@eslint/js": "^9.37.0",
63+
"@babel/core": "^7.28.5",
64+
"@babel/preset-env": "^7.28.5",
65+
"@babel/preset-react": "^7.28.5",
66+
"@babel/preset-typescript": "^7.28.5",
67+
"@eslint/compat": "^1.4.1",
68+
"@eslint/js": "^9.39.0",
7769
"@rollup/plugin-babel": "^6.1.0",
78-
"@rollup/plugin-commonjs": "^28.0.6",
70+
"@rollup/plugin-commonjs": "^29.0.0",
7971
"@rollup/plugin-node-resolve": "^16.0.3",
80-
"@rollup/plugin-typescript": "^12.1.4",
81-
"@storybook/addon-docs": "9.1.10",
82-
"@storybook/addon-links": "^9.1.10",
83-
"@storybook/react-vite": "^9.1.10",
72+
"@rollup/plugin-typescript": "^12.3.0",
73+
"@storybook/addon-docs": "10.0.3",
74+
"@storybook/addon-links": "^10.0.3",
75+
"@storybook/react-vite": "^10.0.3",
8476
"@testing-library/dom": "^10.4.1",
8577
"@testing-library/jest-dom": "^6.9.1",
8678
"@testing-library/react": "^16.3.0",
8779
"@types/eslint": "^9.6.1",
8880
"@types/jest": "^30.0.0",
8981
"@types/jest-axe": "^3.5.9",
9082
"@types/lodash": "^4.17.20",
91-
"@types/node": "^24.7.2",
83+
"@types/node": "^24.10.0",
9284
"@types/react": "^19.2.2",
9385
"@types/react-dom": "^19.2.2",
9486
"babel-jest": "^30.2.0",
9587
"babel-plugin-module-resolver": "^5.0.2",
9688
"babel-plugin-replace-import-extension": "^1.1.5",
9789
"classnames": "^2.5.1",
98-
"eslint": "^9.37.0",
90+
"eslint": "^9.39.0",
9991
"eslint-config-prettier": "^10.1.8",
10092
"eslint-import-resolver-typescript": "^4.4.4",
10193
"eslint-plugin-import": "^2.32.0",
10294
"eslint-plugin-jsx-a11y": "^6.10.2",
10395
"eslint-plugin-react": "^7.37.5",
104-
"eslint-plugin-react-hooks": "^7.0.0",
105-
"globals": "^16.4.0",
96+
"eslint-plugin-react-hooks": "^7.0.1",
97+
"globals": "^16.5.0",
10698
"jest": "^30.2.0",
10799
"jest-axe": "^10.0.0",
108100
"jest-environment-jsdom": "^30.2.0",
@@ -112,14 +104,14 @@
112104
"prettier": "^3.6.2",
113105
"react": "^19.2.0",
114106
"react-dom": "^19.2.0",
115-
"rollup": "^4.52.4",
107+
"rollup": "^4.52.5",
116108
"rollup-preserve-directives": "^1.1.3",
117-
"sass-embedded": "^1.93.2",
118-
"storybook": "^9.1.10",
109+
"sass-embedded": "^1.93.3",
110+
"storybook": "^10.0.3",
119111
"tslib": "^2.8.1",
120112
"typescript": "^5.9.3",
121-
"typescript-eslint": "^8.46.1",
122-
"vite": "^7.1.11",
113+
"typescript-eslint": "^8.46.2",
114+
"vite": "^7.1.12",
123115
"vite-tsconfig-paths": "^5.1.4"
124116
},
125117
"peerDependencies": {

rollup.config.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import { join } from 'node:path';
1+
import { dirname, join, relative, resolve } from 'node:path';
2+
23
import { DEFAULT_EXTENSIONS as extensions } from '@babel/core';
34
import { babel } from '@rollup/plugin-babel';
45
import commonjs from '@rollup/plugin-commonjs';
56
import { nodeResolve } from '@rollup/plugin-node-resolve';
67
import typescript from '@rollup/plugin-typescript';
7-
import preserveDirectives from 'rollup-preserve-directives';
88
import { defineConfig } from 'rollup';
9+
import preserveDirectives from 'rollup-preserve-directives';
10+
911
import packageJson from './package.json' with { type: 'json' };
1012
import tsBuildConfig from './tsconfig.build.json' with { type: 'json' };
1113

@@ -38,6 +40,12 @@ export default defineConfig(
3840
preserveModulesRoot: 'src',
3941
sourcemap: true,
4042
sourcemapExcludeSources: true,
43+
44+
// Fix source map relative paths to sources
45+
sourcemapPathTransform: (relativeSourcePath, sourcemapPath) => {
46+
const sourcePath = resolve(sourcemapPath, relativeSourcePath);
47+
return relative(dirname(sourcemapPath), sourcePath);
48+
},
4149
},
4250
],
4351
external: ['react/jsx-runtime', ...external],

src/components/content-presentation/details/__tests__/Details.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { render } from '@testing-library/react';
22
import { createRef } from 'react';
3+
34
import { Details } from '..';
5+
46
import { renderClient, renderServer } from '#util/components';
57

68
describe('Details', () => {

0 commit comments

Comments
 (0)