An open API service indexing awesome lists of open source software.

https://github.com/sky172839465/cwa-shop


https://github.com/sky172839465/cwa-shop

Last synced: 8 days ago
JSON representation

Awesome Lists containing this project

README

          



CWA SHOP ICON
 CWA SHOP







environment



NodeJS



18.15.0

quick start

1. fork repo
1. clone repo from your account
```shell
git clone https://github.com/YOUR_ACCOUNT/cwa-shop.git
```
1. open in vscode
```shell
code ./cwa-shop
```
1. install dependencies
```shell
npm i
```
1. start dev server
```shell
npm run dev
```

development

1. create change and commit to your remote branch
1. send pull-request
1. wait for status check success
- check linter
1. merge pr
1. trigger `main` branch push ci
- check linter
- bump version
- upload to github page

package usage



package
description




tailwindcss
style element in classname


daisyui
styled component with tailwindcss


i18next
i18n package


react-router-dom
single page application router


recoil
global react state management


swr
request status management


formik
control form flow


yup
form validation using in formik




dev package
description




husky
git commit hook


lint-staged
git hook trigger when staged files


vite
modern frontend development toolkit

npm script usage



script
description




npm run dev
localhost start dev server


npm run dev:mock
localhost start dev server and mock api by `vite-plugin-mock`


npm run dev:mockapi

localhost start dev server and mock api in promise object WITHOUT SEND REQUEST



npm run build
build in production


npm run build:gh
build in production for github page special environment(BrowerRoute not working)


npm run lint
check {js,jsx} coding style


npm run lint:fix
fix {js,jsx} incorrect coding style if possible


npm run preview
local start server for bundled file under `/dist` folder


npm run prepare
run on `npm i` / `npm install`, auto install `husky` for git hook


npm run prettier
check {json,md,yml,sh} coding style


npm run prettier:fix
fix {json,md,yml,sh} incorrect coding style if possible


npm run style
check {css} coding style


npm run style:fix
fix {css} incorrect coding style if possible

environment variable



variable
description




MOCK


  • `npm run dev` mock jsonplaceholder api

  • `npm run build` using mock data when fetch data failed





MOCK_AWS_API
mock aws api url start with `/${VITE_AWS_HOST_PREFIX}` (variable from env file)


BASENAME
replace route basename to `/cwa-shop` (only for github page)

query string



variable
description
example




MOCK
using MOCK=0 in url will force disabled api mock, useful in gh-page website (default all request in mock mode)
https://sky172839465.github.io/cwa-shop/internal?MOCK=0