Skip to content

govuk-one-login/account-components

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

account-components

This repo contains the code for Account Components

Set up and installation

  • Copy solutions/frontend/.env.sample to solutions/frontend/.env and replace any placeholder values as appropriate
  • Copy solutions/stubs/.env.sample to solutions/stubs/.env and replace any placeholder values as appropriate
  • Copy solutions/api/env.json.sample to solutions/api/env.json and replace any placeholder values as appropriate
  • Install NVM or FNM and select the correct Node version by running nvm use or fnm use
  • Install Docker
  • Install Homebrew
  • Install Brewfile dependencies with npm run install-brewfile
  • Install NPM dependencies with npm ci
  • Install Git Hooks with npm run install-git-hooks
  • Run cd solutions/integration-tests && npm ci to install integration testing dependencies
  • Run npm run run:all to start all the local servers and watch for changes. The frontend will be available at http://localhost:6002, the stubs at http://localhost:6003 and the API at http://localhost:6004.

Updating Node version

When updating the Node version you will need to update the following:

  • engines.node field in all package.json files
  • all .nvmrc files (the version should correspond to the lowest version which matches the engines.node field in the associated package.json file)
  • Node version used by Lambda functions
  • Node version used in Docker images
  • ensure the base TSConfig installed as a development dependency in package.json and used in tsconfig.json corresponds with the Node version being used e.g. for Node 24 use the base TSConfig @tsconfig/node24
  • ensure the major version of @types/node installed as a development dependency in package.json corresponds with the Node version being used
  • where ESBuild is used (e.g. in Lambda Metadata in CloudFormation templates) ensure that the configured target matches the target in the base TSConfig e.g. the base TSConfig @tsconfig/node24 sets a target of es2024 and therefore the ESBuild target should be es2024 too.

Useful commands

There are various commands which can be run manually and which may also be run by Git hooks and in CI:

  • npm run run:all to run the everything necessary to run the app locally and watch for changes
  • npm run run:frontend to run the frontend locally and watch for changes
  • npm run build:frontend to build the frontend
  • npm run run:stubs to run the stubs locally and watch for changes
  • npm run build:stubs to build the stubs
  • npm run run:api to run the API locally and watch for changes
  • npm run generate-config-types to generate TypeScript types from the App Config JSON schema
  • npm run build:api to build the API
  • npm run build:core to build core
  • npm run test to run Vitest tests
  • npm run test:watch to run Vitest tests in watch mode
  • npm run test:coverage to run Vitest tests and report coverage
  • npm run check-types to run TypeScript type checking
  • npm run format to run Prettier formatting
  • npm run eslint to run ESLint
  • npm run knip to run Knip
  • npm run tflint to lint Terraform files
  • npm run cfnlint to lint CloudFormation templates with the file extension .cf.yaml
  • npm run sam-validate:frontend to run SAM validation against the frontend CloudFormation template
  • npm run sam-validate:stubs to run SAM validation against the stubs CloudFormation template
  • npm run sam-validate:core to run SAM validation against the core CloudFormation template
  • npm run sam-validate:api to run SAM validation against the API CloudFormation template
  • npm run check-gh-actions to check GitHub Actions with Zizmor
  • npm run detect-secrets to detect secrets which should not be in the repo. False positives can be ignored with comments
  • npm run config:validate to validate the application's config
  • npm run audit to check for NPM package vulnerabilities and check package signature integrity

If these commands detect issues it may be possible to fix them by running:

  • npm run format:fix
  • npm run eslint:fix
  • npm run knip:fix
  • npm run tflint:fix
  • npm run cfnlint:fix
  • npm run check-gh-actions:fix

Integration testing

See Integration testing README

About

Account Components - making common journeys resuable across Account Pod

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 9