Register the shared Git configuration file (.gitconfig):
git config --local include.path ../.gitconfig
Install PNPM:
curl -fsSL https://get.pnpm.io/install.sh | sh -
Install Node dependencies, including the requisite version of Node if necessary (defined in .npmrc):
pnpm install
Ensure that any essential environment variables are defined (consult .env.development).
For sensitive environment variables or ones that should otherwise not be committed, use a .local
file, e.g. .env.development.local
.
When adding a dependency upon a new environment variable, be sure to update the .env.development and .env.production files in order to document it.
Any environment variable whose name is prefixed with VITE_
will be exposed to the Vite processed code.
pnpm dev
pnpm build
pnpm preview
Be sure to run pnpm build
first.
Deploy (to Github Pages)
Push to main
branch to trigger a deployment to Github Pages via a Github Action/workflow:
git push origin main
To deploy manually (not recommended):
pnpm deploy
pnpm lint
Or fix lints:
pnpm lint:fix
For more targetted linting, the following are also available:
pnpm lint:js
pnpm lint:js:fix
pnpm lint:css
pnpm lint:css:fix
Format with Prettier
pnpm format
Or fix formatting issues:
pnpm format:fix
Spellcheck with CSpell
pnpm spelling
Or launch an interactive script to add unrecognised words to the list of ignoreWords
in cspell.config.yaml:
pnpm spelling:fix
- Git hooks are managed by Husky.
- Commit message linting is provided by commitlint. Messages should conform to the Conventional Commit specification. See .commitlintrc.yaml for details.
- Git branch name linting is provided by branch-name-lint (actually we use a fork that we currently maintain). See .branch-name-lint.json for details.
- lint-staged ensures that pre-commit checks (linting, formatting, and spell checking) are only run on staged files.