diff --git a/.babelrc b/.babelrc index 5498a9fc45..4857e4a7a5 100644 --- a/.babelrc +++ b/.babelrc @@ -2,7 +2,7 @@ "presets": [ ["@babel/preset-env", { "targets": { - "node": "14" + "node": "18" } }] ] diff --git a/.eslintrc.json b/.eslintrc.json index 6343730338..0608a46d9d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,5 +1,5 @@ { - "parser": "babel-eslint", + "parser": "@babel/eslint-parser", "plugins": ["prettier"], "extends": ["prettier"], "env": { @@ -23,6 +23,7 @@ "no-var": [1], "one-var": [0], "max-len": [0, { "code": 140, "ignoreUrls": true }], - "comma-dangle": ["error", "always-multiline"] + "comma-dangle": ["error", "always-multiline"], + "arrow-parens": 1 } } diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index b2b2ba2a73..15d5b095e9 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,5 +1,19 @@ + + ### What is the context of this PR? + Describe what you have changed and why, link to other PRs or Issues as appropriate. -### How to review +### How to review this PR + Describe the steps required to test the changes (include screenshots if appropriate). + +### Checklist + +This needs to be completed by the person raising the PR. + + + +- [ ] I have selected the correct Project for this PR (Design System) and selected the correct status +- [ ] I have selected the correct Assignee +- [ ] I have linked the correct Issue diff --git a/.github/release.yml b/.github/release.yml index 6e2f1f4ba6..5f2dbc990d 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -7,6 +7,9 @@ changelog: labels: - Component - Pattern + - title: Accessibility improvements + labels: + - Accessibility - title: Enhancements labels: - Enhancement @@ -16,6 +19,9 @@ changelog: - title: Documentation labels: - Documentation + - title: Dependency updates + labels: + - Dependencies - title: Other changes labels: - "*" diff --git a/.github/workflows/check-checklist.yml b/.github/workflows/check-checklist.yml new file mode 100644 index 0000000000..dcc1f43782 --- /dev/null +++ b/.github/workflows/check-checklist.yml @@ -0,0 +1,17 @@ +name: Checklist Checker +on: + pull_request: + types: + - opened + - edited + - synchronize + - reopened + +jobs: + check-tasks: + name: Check tasks + runs-on: ubuntu-latest + steps: + - uses: mheap/require-checklist-action@v2 + with: + requireChecklist: true diff --git a/.github/workflows/check-labels.yml b/.github/workflows/check-labels.yml new file mode 100644 index 0000000000..eaa7ba5fa3 --- /dev/null +++ b/.github/workflows/check-labels.yml @@ -0,0 +1,22 @@ +name: Label Checker +on: + pull_request: + types: + - opened + - synchronize + - reopened + - labeled + - unlabeled + +jobs: + check-labels: + name: Check labels + runs-on: ubuntu-latest + permissions: + pull-requests: read + steps: + - uses: docker://onsdigital/github-pr-label-checker:v1.2.7 + with: + one_of: Breaking changes,Accessibility,Bug,Documentation,Dependencies,Enhancement,Example + none_of: Awaiting resource,Do not merge,Duplicate,Needs validating,Not doing + repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/lighthouse-ci.yml b/.github/workflows/lighthouse-ci.yml index e1551071c2..606e82bed2 100644 --- a/.github/workflows/lighthouse-ci.yml +++ b/.github/workflows/lighthouse-ci.yml @@ -7,16 +7,16 @@ jobs: name: Lighthouse CI runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.sha }} - name: Read .nvmrc file - run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)" - id: nvm + id: read-nvmrc-file + run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT - name: Install Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: - node-version: "${{ steps.nvm.outputs.NVMRC }}" + node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}" - name: Install dependencies run: yarn install - name: Build pages diff --git a/.github/workflows/npm-bundle.yml b/.github/workflows/npm-bundle.yml index c1fe0075da..6e98b69dc2 100644 --- a/.github/workflows/npm-bundle.yml +++ b/.github/workflows/npm-bundle.yml @@ -8,13 +8,17 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Use Node.js 14.15.0 - uses: actions/checkout@v2 + - name: Read .nvmrc file + id: read-nvmrc-file + run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT + - name: Use Node.js + uses: actions/checkout@v3 with: ref: ${{ github.event.release.target_commitish }} - - uses: actions/setup-node@v1 + - name: Install Node + uses: actions/setup-node@v3 with: - node-version: 14.15.0 + node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}" registry-url: https://registry.npmjs.org/ - run: yarn install - run: git config --global user.name "${{ github.actor }}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ee3706184..71ccd9a1d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,10 +6,14 @@ jobs: add-templates-to-release: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - name: Read .nvmrc file + id: read-nvmrc-file + run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT + - name: Install Node + uses: actions/setup-node@v3 with: - node-version: '14' + node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}" - name: Install dependencies run: yarn install - name: Build templates diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index a6cab97493..1281932595 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -11,11 +11,14 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 + - name: Read .nvmrc file + id: read-nvmrc-file + run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT - name: Install Node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: "14" + node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}" - name: Install dependencies run: yarn install - name: Run macro and script tests @@ -41,14 +44,17 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: lfs: true url: https://github.com/ONSdigital/design-system.git + - name: Read .nvmrc file + id: read-nvmrc-file + run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_OUTPUT - name: Install Node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: "16" + node-version: "${{ steps.read-nvmrc-file.outputs.nvmrc }}" - name: Install dependencies run: yarn install - name: Install Docker @@ -72,4 +78,3 @@ jobs: { "title": "By", "value": "${{ github.actor }}", "short": true }, { "title": "Branch", "value": "${{ github.head_ref }}", "short": true }, { "title": "View job", "value": "${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}"}] - diff --git a/.gitignore b/.gitignore index 72b42dbdbe..01c527cf65 100644 --- a/.gitignore +++ b/.gitignore @@ -6,10 +6,14 @@ coverage/ .vscode/ .idea/ package-lock.json +.husky/pre-push +.husky/post-commit +.husky/post-merge # Generated from visual regression tests backstop_data/bitmaps_test/ backstop_data/html_report/ +backstop.config-for-docker.json # npm package folders /components/ @@ -21,6 +25,8 @@ backstop_data/html_report/ /img/ /scripts/ /scss/ +/js/ +/layout/ secrets.yml diff --git a/.nvmrc b/.nvmrc index 55d1782166..860cc5000a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v14.15.0 +v18.17.1 diff --git a/.stylelintrc.yml b/.stylelintrc.yml index ac3d42fc1d..bc7a9f14a1 100644 --- a/.stylelintrc.yml +++ b/.stylelintrc.yml @@ -5,6 +5,7 @@ extends: - stylelint-config-sass-guidelines plugins: - stylelint-scss + - stylelint-order rules: # Line Spacing rule-empty-line-before: @@ -39,7 +40,8 @@ rules: - ignoreProperties: - 'box-orient' - ignoreAtRules: ['each', 'else', 'extend', 'for', 'function', 'if', 'include', 'mixin', 'return', 'while'] - + # Imports + import-notation: 'string' # Nesting max-nesting-depth: - 5 diff --git a/README.md b/README.md index cf21e821e4..dc33c69c1d 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ To enable this we use [nvm (Node Version Manager)](https://github.com/creationix ```bash yarn install +husky install ``` ### Start a local server diff --git a/__snapshots__/layout/_template.spec.js.snap b/__snapshots__/layout/_template.spec.js.snap index f2d42f5896..d4ca07ac93 100644 --- a/__snapshots__/layout/_template.spec.js.snap +++ b/__snapshots__/layout/_template.spec.js.snap @@ -1,30 +1,30 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`base page template matches the body block override snapshot 1`] = ` -" - - - +" + + + Social survey - - - + + + - - - - - - - - - - + + + + + + + + + + @@ -33,12 +33,12 @@ exports[`base page template matches the body block override snapshot 1`] = ` - - - - - - + + + + + + @@ -72,35 +72,34 @@ exports[`base page template matches the body block override snapshot 1`] = ` - " `; exports[`base page template matches the favicons block override snapshot 1`] = ` -" - - - +" + + + Social survey - - - + + + - - - - - - - - - - + + + + + + + + + + @@ -116,13 +115,14 @@ exports[`base page template matches the favicons block override snapshot 1`] = ` -
-
+
+
- Skip to main content + + Skip to main content @@ -137,7 +137,7 @@ exports[`base page template matches the favicons block override snapshot 1`] = ` -
+