This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- @vitejs/plugin-react uses Babel for Fast Refresh
- @vitejs/plugin-react-swc uses SWC for Fast Refresh
The required framework dependencies are defined in the .tool-versions
file.
Install asdf-vm to manage the Node.js version.
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level
parserOptions
property like this:
export default {
// other rules...
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.json", "./tsconfig.node.json"],
tsconfigRootDir: __dirname,
},
};
- Replace
plugin:@typescript-eslint/recommended
toplugin:@typescript-eslint/recommended-type-checked
orplugin:@typescript-eslint/strict-type-checked
- Optionally add
plugin:@typescript-eslint/stylistic-type-checked
- Install eslint-plugin-react and add
plugin:react/recommended
&plugin:react/jsx-runtime
to theextends
list
Environment variables are set in the respective .env.<environment>
file.
The releases to the dev
server are done automatically on merge to the
main
Git branch. Releases to stage
and production
are done using Git
tags. Werf/Helm is used to deploy into these environments.
After pushing your changes through a merge request to the main
Git branch
or using a Git tag, the CI process will then automatically build and release
the application to the corresponding servers.
To create a new release for stage
or production
, a Git tag needs to be
created pointing to the desired commit. You can use annotated tags or normal
tags. The tag name should follow the vYYYYMMDD-XX
format, being X an integer.
Tags for stage follow the same format as production tags, but post-fixing
-rc
. The time format needs to be on UTC-0.
To generate the tags, you should use the following command (recommended):
deploy/release.rb -e <environment>
Or using the manual method in which you will need to determine the appropriate tag release value:
git tag "v$(date --utc +%Y%m%d)-01-rc"
Toggle
Pull from the remote:
git fetch --tags
Use the release (stage or production) tag as the new base:
git checkout v20YYMMDD-xx-rc
Create or checkout the hotfix branch:
git checkout -b hotfix/stage
Bring the commits you need:
git cherry-pick xxxxxxx
Push your changes:
git push origin hotfix/stage
Create and push the tag:
deploy/release.rb -e <environment> --push
Or doing it manually:
git tag "v$(date --utc +%Y%m%d)-01-rc"
git push origin "v$(date --utc +%Y%m%d)-01-rc"
- Stage
v20210924-01-rc
- Production
v20210924-01