Skip to content

Commit

Permalink
Merge branch 'main' of github.com:nationalarchives/tna-frontend into …
Browse files Browse the repository at this point in the history
…feature/hero-cards
  • Loading branch information
ahosgood committed Feb 15, 2024
2 parents 9192b13 + 2ef2286 commit 27acb4d
Show file tree
Hide file tree
Showing 119 changed files with 4,088 additions and 2,594 deletions.
4 changes: 2 additions & 2 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install dependencies
Expand Down
8 changes: 6 additions & 2 deletions .github/actions/prototype-kit-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install dependencies
Expand Down Expand Up @@ -39,13 +39,15 @@ runs:
echo -e "{% from \"nationalarchives/components/button/macro.njk\" import tnaButton %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/card/macro.njk\" import tnaCard %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/checkboxes/macro.njk\" import tnaCheckboxes %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/compound-filters/macro.njk\" import tnaCompoundFilters %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/cookie-banner/macro.njk\" import tnaCookieBanner %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/date-input/macro.njk\" import tnaDateInput %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/date-search/macro.njk\" import tnaDateSearch %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/featured-records/macro.njk\" import tnaFeaturedRecords %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/filters/macro.njk\" import tnaFilters %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/footer/macro.njk\" import tnaFooter %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/gallery/macro.njk\" import tnaGallery %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/global-header/macro.njk\" import tnaGlobalHeader %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/grid/macro.njk\" import tnaGrid %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/header/macro.njk\" import tnaHeader %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
echo -e "{% from \"nationalarchives/components/hero/macro.njk\" import tnaHero %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html &&
Expand All @@ -70,13 +72,15 @@ runs:
echo "{{ tnaButton({text:\"I am a button\",url:\"#\"}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaCard({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaCheckboxes({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaCompoundFilters({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaCookieBanner({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaDateInput({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaDateSearch({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaFeaturedRecords({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaFilters({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaFooter({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaGallery({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaGlobalHeader({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaGrid({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaHeader({}) }}" >> prototype/app/views/index.html &&
echo "{{ tnaHero({}) }}" >> prototype/app/views/index.html &&
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/test-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ on:
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install dependencies
Expand All @@ -17,7 +17,7 @@ runs:
run: mkdir temp && npm run validatehtml
shell: bash
- name: Build Storybook
run: npm run build
run: npm run build --test
shell: bash
- name: Start Storybook
run: npm start &
Expand Down
59 changes: 47 additions & 12 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Get and validate version number
id: get-version
run: |
Expand All @@ -26,7 +26,7 @@ jobs:
needs:
- check
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Lint
uses: ./.github/actions/lint

Expand All @@ -35,7 +35,7 @@ jobs:
needs:
- check
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Tests
uses: ./.github/actions/tests

Expand All @@ -44,7 +44,7 @@ jobs:
needs:
- check
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Test build package
uses: ./.github/actions/test-package

Expand All @@ -53,7 +53,7 @@ jobs:
needs:
- test-package
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: GOV.UK prototype kit test
uses: ./.github/actions/prototype-kit-test

Expand All @@ -67,8 +67,8 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org/
Expand Down Expand Up @@ -101,37 +101,72 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org/
scope: '@nationalarchives'
- name: Install dependencies
run: npm ci
- name: Build package
run: ./tasks/build-cookie-banner-package.sh
run: ./tasks/cookie-banner/build-cookie-banner-package.sh
- name: Check npm credentials
run: npm whoami
- name: Publish to npm
run: cd package-cookie-banner && npm publish
- name: Rename package directory
run: mv package "tna-frontend-cookie-banner-${{ needs.check.outputs.version }}"
run: mv package-cookie-banner "tna-frontend-cookie-banner-${{ needs.check.outputs.version }}"
- name: Compress package
run: zip -r "tna-frontend-cookie-banner-${{ needs.check.outputs.version }}.zip" "tna-frontend-cookie-banner-${{ needs.check.outputs.version }}"
- name: Upload the package to the GitHub release
run: gh release upload "v${{ needs.check.outputs.version }}" "tna-frontend-cookie-banner-${{ needs.check.outputs.version }}.zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

publish-npm-global-header:
runs-on: ubuntu-latest
needs:
- check
- lint
- tests
- prototype-kit
- publish-npm
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
registry-url: https://registry.npmjs.org/
scope: '@nationalarchives'
- name: Install dependencies
run: npm ci
- name: Build package
run: ./tasks/global-header/build-global-header-package.sh
- name: Check npm credentials
run: npm whoami
- name: Publish to npm
run: cd package-global-header && npm publish
- name: Rename package directory
run: mv package-global-header "tna-frontend-global-header-${{ needs.check.outputs.version }}"
- name: Compress package
run: zip -r "tna-frontend-global-header-${{ needs.check.outputs.version }}.zip" "tna-frontend-global-header-${{ needs.check.outputs.version }}"
- name: Upload the package to the GitHub release
run: gh release upload "v${{ needs.check.outputs.version }}" "tna-frontend-global-header-${{ needs.check.outputs.version }}.zip"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

notify-slack:
runs-on: ubuntu-latest
needs:
- check
- publish-npm
- publish-npm-cookie-banner
- publish-npm-global-header
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Get release notes
id: get-release-notes
run: ./tasks/get-release-notes.sh "${{ needs.check.outputs.version }}" > RELEASE_NOTES.txt
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install dependencies
Expand All @@ -52,10 +52,10 @@ jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install dependencies
Expand Down
18 changes: 9 additions & 9 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
chromatic:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
- name: Install dependencies
Expand All @@ -29,10 +29,10 @@ jobs:
projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
storybookBuildDir: storybook
exitZeroOnChanges: true
onlyChanged: true
externals: |
- ".storybook/**"
- "src/nationalarchives/variables/**"
- "src/nationalarchives/tools/**"
- "src/nationalarchives/utilities/**"
- "src/nationalarchives/lib/**"
# onlyChanged: true
# externals: |
# - ".storybook/**"
# - "src/nationalarchives/variables/**"
# - "src/nationalarchives/tools/**"
# - "src/nationalarchives/utilities/**"
# - "src/nationalarchives/lib/**"
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Lint
uses: ./.github/actions/lint

tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Tests
uses: ./.github/actions/tests

test-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Test build package
uses: ./.github/actions/test-package

Expand All @@ -36,6 +36,6 @@ jobs:
needs:
- test-package
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: GOV.UK prototype kit test
uses: ./.github/actions/prototype-kit-test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ __snapshots__
node_modules
package
package-cookie-banner
package-global-header
storybook
*.zip
*.tgz
Expand Down
1 change: 0 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module.exports = {
"@storybook/addon-a11y",
"@storybook/addon-interactions",
"@storybook/addon-mdx-gfm",
"@chromaui/addon-visual-tests",
],
framework: {
name: "@storybook/html-webpack5",
Expand Down
35 changes: 0 additions & 35 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,38 +28,3 @@
document.addEventListener("DOMContentLoaded", removeAllClasses, false);
}
</script>
<!-- <link
rel="preload"
href="/static/media/src/nationalarchives/assets/fonts/OpenSans-Medium.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>
<link
rel="preload"
href="/static/media/src/nationalarchives/assets/fonts/OpenSans-Bold.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>
<link
rel="preload"
href="/static/media/src/nationalarchives/assets/fonts/RobotoMono-Regular.ttf"
as="font"
type="font/ttf"
crossorigin="anonymous"
/>
<link
rel="preload"
href="/static/media/src/nationalarchives/assets/fonts/fa-solid-900.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/>
<link
rel="preload"
href="/static/media/src/nationalarchives/assets/fonts/fa-brands-400.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous"
/> -->
12 changes: 2 additions & 10 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import "../src/nationalarchives/all.scss";
import "../src/nationalarchives/font-awesome.scss";
import { a11yConfig } from "./storybook-config";
import { customViewports } from "./viewports";
import Cookies from "../src/nationalarchives/lib/cookies.mjs";

document.documentElement.classList.add(
"tna-template",
"tna-template--light-theme",
"tna-template--yellow-accent",
);
if (window.self !== window.top) {
Expand Down Expand Up @@ -42,13 +44,3 @@ export const decorators = [
return Story();
},
];

// const fontLoader = async () => ({
// fonts: await Promise.all([
// document.fonts.load("normal 1em Open Sans"),
// document.fonts.load("bold 1em Open Sans"),
// document.fonts.load("normal 1em Roboto Mono"),
// ]),
// });

// export const loaders = isChromatic() && document.fonts ? [fontLoader] : [];
Loading

0 comments on commit 27acb4d

Please sign in to comment.