vite_vitetest_react_starter
v0.0.0
Published
"Why another one" : Every time within within the team when we try to find the best library to use as base, the team's conversation gets towards to create from scratch! Why?
Readme
Component Library For Developer
"Why another one" : Every time within within the team when we try to find the best library to use as base, the team's conversation gets towards to create from scratch! Why?
Reason team doesn't want to use pre-made library
- It's hard to customize
- I like "Tailwind" but I prefer plain CSS/SCSS
- Too much to setup with existing project
So, here is our approach to "another one"
- No tailwind, only CSS/SCSS
- Just clone and have your own component library
- Copy and Paste if you prefer
- build only includes the code for the component used
This library is intended to use as your component library base. You can clone and change the way you like to meet your requirements. It comes with tree shaking so you don't have to worry about sizing.
Installation
use library as npm package
npm install @monaye/cpcpUse component in your project
import { Input } from '@monaye/cpcp'
export function Demo() {
return <Input type="text" placeholder="Your Name" />
}only include specific component as npm package
npm install @monaye/cpcp/Inputimport Input from '@monaye/cpcp/Input'
export function Demo() {
return <Input type="text" placeholder="Your Name" />
}only include specific component as copy and paste
- go to docs and find the coponent you'd like to use
- copy the component code (you many need to copy dependency component too)
- paste it into your project
use library as your based library
- Clone or fork this repo
git clone 'monaye/cpcp'- Add to your NPM profile
Thats All!
now you can [use specific component] or [use whole library] from your repo
npm install @yourname/yourProjectNameA vite-based react starter
Features
- vite + typescript + swr
- vitest
- sass
- prettier
Usage
1. Clone to local
git clone [email protected]:monaye/vite-vitest-react-ts-starter.git2. Install dependencies
npm install3. Development
npm run devInstalled Packages
Prettier
npm i -D prettier & eslint-config-prettierTesting Library Package
npm i -D vitest jsdom
npm i -D @testing-library/react @testing-library/jest-dom
npm i -D @vitest/ui @vitest/coverage-v8sass support
npm i -D sassAdded Commands
This starter template added few useful commands. For all avaiable commands, please look at the package.json.
Format project with Prettier
Run prettier on whole project including root path.
By default prettier ignore file patterns describe in ./.gitignore and ./.prettierignore
npm run formatRun vitest testing
By default vitest includes ['**/*.{test,spec}.?(c|m)[jt]s?(x)'].
npm run test
npm run test:ui
npm run test:coverage