This a React v18 + TypeScript + Vitest and React Testing Library + Github Actions starter template built with Vite.
- ⚡️ Vite
- ⚛️ React v18 with TypeScript
- 🧪 Vitest + React Testing Library
- 🚀 Github Actions with deployment on Github Pages
- VSCode settings & extensions recommendations
- EditorConfig
- ESLint & Prettier configured (with
eslint-plugin-prettier)
- Husky
commitlint@commit-msglint-staged@precommit
- Build, Test and Coverage Analysis (with Codecov) at each commit
- Deploy to Github Pages on main branch (see deployment of this repo here)
npx degit pchmn/kuzpot app_name
Project was built using
pnpm. If you want to usenpmoryarn, just don't forget to update Github Actions workflow (.github/workflows/ci.yml).
pnpm ipnpm dev# normal build
pnpm build
# build with 404.html file added for Github Pages included
pnpm build:ciSee explanation of
404.htmlfile here
# without coverage
pnpm test
# with coverage
pnpm test:cipnpm serveIf you want to use Github Actions in your repo, you'll need to make little configuration.
Actual workflow is:
Build and test application on all commits
Create a Github personal access token (with repo and workflow permissions) and add it as a PERSONAL_ACCESS_TOKEN secret in your repo
Run Codecov analysis on all commits
Create a Codecov token for your repo and add it as a CODECOV_TOKEN secret in your repo
Manual deploy to Github Pages (only main branch)
- Replace
baseconfig invite.config.tsto match your repo name - Create
GIT_AUTHOR_NAMEandGIT_AUTHOR_EMAILsecrets in your repo (it will be the author of commits togh-pagesbranch) - If you want to keep manual deployments, you need to create a new environment with manual approve in your repo, and then replace
environmentconfig in thedeployjob in.github/workflows/ci.yml:environment.name= name of the environment created in your repoenvironment.url= link to your github pages
There are modifications on index.html, and a new 404.html file in the project to make it work well with Github Pages.
See https://github.com/rafgraph/spa-github-pages for more info.
