Skip to content

Commit 34ad6b7

Browse files
Joshua Batesjakeb-nhs
authored andcommitted
Migrate nhsuk-frontend v8, bringing components into line with the current style guide.
1 parent 72d109f commit 34ad6b7

File tree

424 files changed

+22455
-19225
lines changed

Some content is hidden

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

424 files changed

+22455
-19225
lines changed

.babelrc

Lines changed: 0 additions & 11 deletions
This file was deleted.

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
jest.config.js
2+
.eslintrc.js
3+
rollup.config.mjs
4+
dist

.eslintrc

Lines changed: 0 additions & 41 deletions
This file was deleted.

.eslintrc.js

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
module.exports = {
2+
parserOptions: {
3+
project: './tsconfig.json',
4+
tsconfigRootDir: __dirname,
5+
},
6+
env: {
7+
browser: true,
8+
jest: true,
9+
},
10+
settings: {
11+
'import/resolver': {
12+
typescript: {},
13+
},
14+
react: {
15+
version: 'detect',
16+
},
17+
},
18+
extends: [
19+
'plugin:react/recommended',
20+
'plugin:@typescript-eslint/recommended',
21+
'prettier',
22+
'plugin:import/errors',
23+
'plugin:import/warnings',
24+
'plugin:import/typescript',
25+
'plugin:jsx-a11y/recommended',
26+
'plugin:react-hooks/recommended',
27+
],
28+
rules: {
29+
'react/prop-types': 0,
30+
'jsx-a11y/anchor-has-content': 0,
31+
'jsx-a11y/alt-text': 0,
32+
'jsx-a11y/heading-has-content': 0,
33+
'react-hooks/exhaustive-deps': 0,
34+
},
35+
overrides: [
36+
{
37+
files: ['*.stories.tsx'],
38+
rules: { '@typescript-eslint/no-unused-vars': 'off' },
39+
},
40+
],
41+
};

.github/workflows/ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,24 @@
11
name: CI Build
22

3-
on:
3+
on:
44
push:
55
branches: main
6-
pull_request:
6+
pull_request:
77

88
jobs:
99
build:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v1
13+
- uses: actions/checkout@v4
14+
- name: Set up Node.js
15+
uses: actions/setup-node@v2
16+
with:
17+
node-version: '18.x'
18+
- name: Enable corepack
19+
run: corepack enable
20+
- name: Set Yarn version
21+
run: yarn set version stable
1422
- name: Yarn Install
1523
run: yarn
1624
- name: Lint

.github/workflows/release.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,39 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@v1
13-
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Set up Node.js
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: '18.x'
20+
21+
- name: Enable corepack
22+
run: corepack enable
23+
24+
- name: Set Yarn version
25+
run: yarn set version stable
26+
1427
- name: Yarn Install
1528
run: yarn
16-
29+
1730
- name: Lint
18-
run: yarn lint
19-
31+
run: yarn lint:ci
32+
2033
- name: Jest Tests
2134
run: yarn test:ci
22-
35+
2336
- name: Typescript build
2437
run: yarn build
25-
38+
2639
- name: Set Version to Release Tag Name
2740
run: |
28-
yarn version --new-version ${{ github.event.release.tag_name }} --no-git-tag-version
29-
41+
yarn version ${{ github.event.release.tag_name }}
42+
3043
- name: Publish to npm, publish pre-release as beta
31-
uses: JS-DevTools/npm-publish@v1
44+
uses: JS-DevTools/npm-publish@v1
3245
with:
3346
token: ${{ secrets.NPM_TOKEN }}
3447
tag: ${{ github.event.release.prerelease && 'beta' || 'latest' }}

.gitignore

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
logs
33
*.log
44
npm-debug.log*
5-
yarn-debug.log*
6-
yarn-error.log*
75
lerna-debug.log*
86

97
# Diagnostic reports (https://nodejs.org/api/report.html)
@@ -65,6 +63,18 @@ typings/
6563
# Output of 'npm pack'
6664
*.tgz
6765

66+
# Yarn files
67+
yarn-error.log
68+
yarn-debug.log*
69+
yarn-error.log*
70+
.pnp.*
71+
.yarn/*
72+
!.yarn/patches
73+
!.yarn/plugins
74+
!.yarn/releases
75+
!.yarn/sdks
76+
!.yarn/versions
77+
6878
# Yarn Integrity file
6979
.yarn-integrity
7080

@@ -108,8 +118,9 @@ dist
108118

109119
# Custom
110120
lib/
111-
yarn-error.log
112121
storybook-static/
113122

114123
# IDEA files
115124
.idea/
125+
126+
.DS_Store

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18

.storybook/main.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
import type { StorybookConfig } from '@storybook/react-vite';
2+
import { mergeConfig } from 'vite';
3+
import tsConfigPaths from 'vite-tsconfig-paths';
4+
25
const config: StorybookConfig = {
36
stories: ['../stories/**/*.stories.@(ts|tsx)', '../stories/**/*.mdx'],
47
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
@@ -9,5 +12,13 @@ const config: StorybookConfig = {
912
docs: {
1013
autodocs: true,
1114
},
15+
typescript: {
16+
reactDocgen: 'react-docgen-typescript',
17+
},
18+
viteFinal(config) {
19+
return mergeConfig(config, {
20+
plugins: [tsConfigPaths()],
21+
});
22+
},
1223
};
1324
export default config;

.storybook/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { addons } from '@storybook/addons';
1+
import { addons } from '@storybook/manager-api';
22
import nhsTheme from './theme';
33

44
addons.setConfig({

0 commit comments

Comments
 (0)