From fb23951f696e9f30430e39d96c70ef42d48c2d1a Mon Sep 17 00:00:00 2001 From: 21120447 Date: Wed, 7 Aug 2024 19:07:04 +0700 Subject: [PATCH] :memo: docs: update README.md --- LICENSE | 21 +++++++++++ README.md | 99 +++++++++++++++++++++++++++++++++++++++++----------- package.json | 1 + 3 files changed, 100 insertions(+), 21 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..21892c3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Nguyen Nhat Hao + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index e1cdc89..75d5f50 100644 --- a/README.md +++ b/README.md @@ -1,30 +1,87 @@ -# React + TypeScript + Vite +![reactjs-vite-tailwindcss-boilerplate](https://user-images.githubusercontent.com/16243531/217138979-b854309c-4742-4275-a705-f9fec5158217.jpg) -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. +# React Tailwindcss Boilerplate build with Vite -Currently, two official plugins are available: +This is a boilerplate build with Vite, React 18, TypeScript, Vitest, Testing Library, Commitlint, TailwindCSS 3, Eslint and Prettier. -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh +## What is inside? -## Expanding the ESLint configuration +This project uses many tools like: -If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: +- [Vite](https://vitejs.dev) +- [ReactJS](https://reactjs.org) +- [TypeScript](https://www.typescriptlang.org) +- [Vitest](https://vitest.dev) +- [Testing Library](https://testing-library.com) +- [Commitlint gitmoji](https://www.npmjs.com/package/commitlint-config-gitmoji) +- [Tailwindcss](https://tailwindcss.com) +- [Eslint](https://eslint.org) +- [Prettier](https://prettier.io) -- Configure the top-level `parserOptions` property like this: +## Getting Started -```js -export default { - // other rules... - parserOptions: { - ecmaVersion: 'latest', - sourceType: 'module', - project: ['./tsconfig.json', './tsconfig.node.json', './tsconfig.app.json'], - tsconfigRootDir: __dirname, - }, -} +### Install + +Use this template or clone this repository. + +Install dependencies. + +```bash +yarn install +``` + +Serve with hot reload at . + +```bash +yarn run dev +``` + +### Lint + +```bash +# check lint +yarn run lint + +# fix lint +yarn run lint:fix ``` -- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` -- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` -- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list +### Typecheck + +```bash +yarn run typecheck +``` + +### Build + +```bash +yarn run build +``` + +### Test + +### Commitlint +#### Structure +The Gitmoji Structure of commit styles is below + +```bash +:gitmoji: type(scope?): subject +body? +footer? +``` + +Example + +```bash +:sparkles: feat(changelog): support chinese title + +:bug: fix(config): fix a subject bug + +:memo: docs: update README.md + +:bulb: docs(plugin): update comments +``` + +## License + +This project is licensed under the MIT License. \ No newline at end of file diff --git a/package.json b/package.json index 1304076..7f992cb 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", "prepare": "husky install", + "typecheck": "tsc --project tsconfig.json --noEmit", "lint:fix": "eslint --fix src --ext ts,tsx", "prettier": "prettier --check \"src/**/(*.tsx|*.ts|*.css|*.scss)\"", "prettier:fix": "prettier --write \"src/**/(*.tsx|*.ts|*.css|*.scss)\"",