Bootstrap a TypeScript application with Vite dev server and Continuous Delivery
We aim to use the current active LTS version of nodejs, which is v20 at the time of writing. There is a .node-version
file to simplify setup using nodenv.
For E2E and a11y testing with Playwright you will need to install the supported browsers:
npx playwright install
npx playwright install msedge
For the provided Git hooks you will need to install lefthook (git hook manager) and talisman (secrets scanner):
brew install lefthook talisman
./run.sh init
The following hooks are specified in the lefthook.yml
:
commitlint
- write conventional commit messageslint
- avoid commiting code violating linting rulesformat
- avoid commiting wrongly formatted code
Before pushing, the following checks are additionally ran:
licenses-audit
- useslicense-checker
to verify depency licensessecrets-audit
- avoid accidental pushes of secrets and sensitive information
This template contains a security.txt, where you probably want to update the expiration date. The following entries may also be added:
Policy: https://raw.githubusercontent.com/digitalservicebund/<<REPO_NAME>>/main/SECURITY.md
Canonical: https://<<PROJECT_URL>>/.well-known/security.txt
The project uses Vite to provide a bundler-less dev server, available via npm run dev
.
The application has
- unit tests (using Jest)
- end-to-end tests (using Playwright)
- accessibility tests (using Axe and Playwright)
Test commands
- Run unit tests:
npm test
- Run unit tests with watcher:
npm test -- --watch
- Gather coverage:
npm run coverage
- Run E2E tests:
npm run test:e2e
- Run a11y tests:
npm run test:a11y
The project uses ESLint for linting and Prettier. for formatting.
Commands
- Check style:
npm run style:check
- Autofix style issues:
npm run style:fix
- Check lint:
npm run lint:check
- Autofix lint issues:
npm run lint:fix
The docs/adr
directory contains architecture decisions.
For adding new records the adr-tools command-line tool is useful but not strictly necessary:
brew install adr-tools