@kennarddh/test-linaria-library v1.0.9
React JS Boilerplate
Guide
Install Dependencies
npm installEnvironment Variables
All environment variables for react application must start with APP_ prefix
To change env prefix change add or remove string from envPrefix variable in vite.config.json
Environtment variables can be accesed using env.<name> or import.meta.env.<name>. Prefix must be included.
Declare env types in src/env.d.ts in ImportMetaEnv interface
The environment variables can be found and modified in the .env file. They come with these default values:
# Port number (optional, default: 3000)
PORT=3000
# Open browser on start (optional, default: true) if value is other than "true" it will be read as false
OPEN_BROWSER=trueAvailable Scripts
In the project directory, you can run:
Start
Start development build
npm startBuild
build for production.
npm run buildPreview
Preview production build
npm run previewClean
Removes all the files generated by the build process.
npm run cleanLint Check
Finds errors in your code.
npm run lint:checkLint Fix
Fixes linting errors.
npm run lint:fixPrettier fix
Fix the code formatting.
npm run prettier:fixPrettier check
Check the code formatting.
npm run prettier:checkTest
Run all tests
npm run testWatch test
Watch changed test
npm run test:watchWatch all test
Watch all test
npm run test:watch:allTest coverage
Run test coverage
npm run test:coverageTest changed
Run tests related to changed files based on git (uncommitted files)
npm run test:changedNote
- Babel is only for jest to transpile typescript code. If you don't want to use babel you can use
vitest tsconfig.jsonis for react app typescript configurationtsconfig.node.jsonis for vite and other development tools typescript configuration that will not be included in build result- If you want to disable
pre-commitorpre-pushgit hook you can remove the hook inside.huskydirectory - If you want to disable dependabot you need to remove
.github/dependabot.yml - If you want to disable codeql analysis you need to remove
.github/workflows/codeql-analysis.yml