chore: use pnpm to manage frontend deps (#659)

* chore: use pnpm to manage frontend deps

* typo: change content of tips

* docs: update node.js require version & replacement installation link

* feat: detect the Node.js version to ensure corepack is supported

* typo: remove chinese comment

* fix: lint CI config, use pnpm to install dependencies

* fix: nextui style error when using pnpm

* fix: ci setup pnpm cwd

* fix: frontend lint ci install deps crash

* fix: ci lint frontend missing package.json path

* fix: frontend lint ci add cache-dependency-path prop
This commit is contained in:
mashiro
2024-04-04 14:55:03 +08:00
committed by GitHub
parent 3adcb7ea56
commit 0fdc401f91
7 changed files with 8556 additions and 8 deletions

View File

@@ -18,7 +18,14 @@ build:
@python -m pip install pipenv
@python -m pipenv install -v
@echo "Setting up frontend environment..."
@cd frontend && npm install
@echo "Detect Node.js version..."
@cd frontend && node ./scripts/detect-node-version.js
@cd frontend && if [ -f node_modules/.package-lock.json ]; then \
echo "This project currently uses "pnpm" for dependency management. It has detected that dependencies were previously installed using "npm" and has automatically deleted the "node_modules" directory to prevent unnecessary conflicts."; \
rm -rf node_modules; \
fi
@which corepack > /dev/null || (echo "Installing corepack..." && npm install -g corepack)
@cd frontend && corepack enable && pnpm install
# Start backend
start-backend: