Skip to content

govuk-one-login/account-components

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2,656 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

account-components

This repo contains the code for Account Components

Set up and installation

  • In GitHub create a personal access token which has read:packages permission and in the configuration file for your shell export a variable called NODE_AUTH_TOKEN with the value of the personal access token
  • 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 dependencies with npm run install-all
  • Install Git Hooks with npm run install-git-hooks
  • Run npm run run:all to start all the local servers. The frontend will be available at http://localhost:6002, the stubs at http://localhost:6003 and the API at http://localhost:6004. The frontend and stubs will watch for changes and rebuild on demand but the API will not and needs to be restarted for changes to take effect.

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
  • npm run generate-config-types to generate TypeScript types from the App Config JSON schema
  • npm run build:all to build everything
  • 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 to run SAM validation against the 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 api-specs:validate to validate the OpenAPI specs
  • 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 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

 
 
 

Contributors