From adffb7c1e183fef903906f0167ba5cb5e2939f26 Mon Sep 17 00:00:00 2001 From: kaivanwong Date: Mon, 6 May 2024 10:59:07 +0800 Subject: [PATCH] feat: update docs --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 911d785..5ec8f42 100644 --- a/README.md +++ b/README.md @@ -21,19 +21,67 @@ If you just want to develop locally, you can [create a repo](https://github.com Just run and visit http://localhost:1977. ```bash -pnpm dev +npn run dev ``` +> Node.js version 18 or higher is required for this project. + To build the App, you can run: ```bash -pnpm build +npm run build ``` You will then see the `dist` folder generated for publishing, which you can preview locally with the following command. ```bash -pnpm preview +npm run preview +``` + +## Use pnpm / yarn + +If you want to use pnpm or yarn as a package management tool, please refer to the following steps. + +> If `preinstall` exists in `scripts`, remove it first. + +### pnpm + +Replace `"pre-commit": "npx lint-staged"` in package.json with `"pre-commit": "pnpm lint-staged"`. + +And replace `"*": "npm run lint:fix"` with `"*": "pnpm lint:fix"`. + +Like this: + +```json +{ + // ... + "simple-git-hooks": { + "pre-commit": "pnpm lint-staged" + }, + "lint-staged": { + "*": "pnpm lint:fix" + } +} +``` + +### yarn + +Replace `"pre-commit": "npx lint-staged"` in package.json with `"pre-commit": "yarn lint-staged"`. + +And replace `"*": "npm run lint:fix"` with `"*": "yarn lint:fix"`. + +Like this: + +```json +{ + // ... + "simple-git-hooks": { + "pre-commit": "yarn lint-staged" + }, + "lint-staged": { + "*": "yarn lint:fix" + } +} ``` ## License