mirror of
https://github.com/OpenHands/OpenHands.git
synced 2025-12-26 05:48:36 +08:00
Remove pnpm (#823)
* Remove pnpm * Remove from ci * Remove pnpm * Remove cache from lint
This commit is contained in:
parent
8f097f8643
commit
f40fe6ac28
11
.github/workflows/lint.yml
vendored
11
.github/workflows/lint.yml
vendored
@ -8,27 +8,20 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install PNPM
|
||||
uses: pnpm/action-setup@v3
|
||||
with:
|
||||
package_json_file: frontend/package.json
|
||||
|
||||
- name: Install Node.js 20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'pnpm'
|
||||
cache-dependency-path: 'frontend/pnpm-lock.yaml'
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
cd frontend
|
||||
pnpm install --frozen-lockfile
|
||||
npm install --frozen-lockfile
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
cd frontend
|
||||
pnpm run lint
|
||||
npm run lint
|
||||
|
||||
lint-python:
|
||||
name: Lint python
|
||||
|
||||
24
Makefile
24
Makefile
@ -36,16 +36,6 @@ build:
|
||||
echo "$(RED)npm is not installed. Please install Node.js to continue.$(RESET)"; \
|
||||
exit 1; \
|
||||
fi
|
||||
@echo "$(YELLOW)Checking pnpm installation...$(RESET)"
|
||||
@if command -v pnpm > /dev/null; then \
|
||||
PNPM_VERSION=$(shell pnpm --version); \
|
||||
echo "$(BLUE)pnpm is already installed. Version: $${PNPM_VERSION}$(RESET)"; \
|
||||
else \
|
||||
echo "$(YELLOW)pnpm is not installed. Installing corepack to enable pnpm...$(RESET)"; \
|
||||
npm install -g corepack; \
|
||||
corepack enable; \
|
||||
echo "$(BLUE)pnpm installed and enabled.$(RESET)"; \
|
||||
fi
|
||||
@echo "$(YELLOW)Checking Docker installation...$(RESET)"
|
||||
@if command -v docker > /dev/null; then \
|
||||
DOCKER_VERSION=$(shell docker --version | awk '{print $$3}'); \
|
||||
@ -70,11 +60,11 @@ build:
|
||||
@echo "$(GREEN)Setting up frontend environment...$(RESET)"
|
||||
@echo "$(YELLOW)Detect Node.js version...$(RESET)"
|
||||
@cd frontend && node ./scripts/detect-node-version.js
|
||||
@cd frontend && if [ -f node_modules/.package-lock.json ]; then \
|
||||
echo "$(YELLOW)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.$(RESET)"; \
|
||||
rm -rf node_modules; \
|
||||
fi
|
||||
@cd frontend && echo "$(BLUE)Enabling pnpm...$(RESET)" && corepack enable && echo "$(BLUE)Installing frontend dependencies with pnpm...$(RESET)" && pnpm install && echo "$(BLUE)Running make-i18n with pnpm...$(RESET)" && pnpm run make-i18n
|
||||
@cd frontend && \
|
||||
echo "$(BLUE)Installing frontend dependencies with npm...$(RESET)" && \
|
||||
npm install && \
|
||||
echo "$(BLUE)Running make-i18n with npm...$(RESET)" && \
|
||||
npm run make-i18n
|
||||
@echo "$(GREEN)Installing pre-commit hooks...$(RESET)"
|
||||
@git config --unset-all core.hooksPath || true
|
||||
@poetry run pre-commit install --config $(PRECOMMIT_CONFIG_PATH)
|
||||
@ -88,7 +78,7 @@ start-backend:
|
||||
# Start frontend
|
||||
start-frontend:
|
||||
@echo "$(GREEN)Starting frontend...$(RESET)"
|
||||
@cd frontend && BACKEND_HOST=$(BACKEND_HOST) FRONTEND_PORT=$(FRONTEND_PORT) pnpm run start
|
||||
@cd frontend && BACKEND_HOST=$(BACKEND_HOST) FRONTEND_PORT=$(FRONTEND_PORT) npm run start
|
||||
|
||||
# Run the app
|
||||
run:
|
||||
@ -102,7 +92,7 @@ run:
|
||||
@echo "$(YELLOW)Waiting for the backend to start...$(RESET)"
|
||||
@until nc -z localhost $(BACKEND_PORT); do sleep 0.1; done
|
||||
@echo "$(GREEN)Backend started successfully.$(RESET)"
|
||||
@cd frontend && echo "$(BLUE)Starting frontend with pnpm...$(RESET)" && pnpm run start -- --port $(FRONTEND_PORT)
|
||||
@cd frontend && echo "$(BLUE)Starting frontend with npm...$(RESET)" && npm run start -- --port $(FRONTEND_PORT)
|
||||
@echo "$(GREEN)Application started successfully.$(RESET)"
|
||||
|
||||
# Setup config.toml
|
||||
|
||||
5493
frontend/package-lock.json
generated
5493
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -48,7 +48,7 @@
|
||||
"test": "jest",
|
||||
"preview": "vite preview",
|
||||
"make-i18n": "node scripts/make-i18n-translations.cjs",
|
||||
"prelint": "pnpm run make-i18n",
|
||||
"prelint": "npm run make-i18n",
|
||||
"lint": "eslint src/**/*.ts* && prettier --check src/**/*.ts*",
|
||||
"prepare": "cd .. && husky install frontend/.husky"
|
||||
},
|
||||
@ -91,7 +91,7 @@
|
||||
"tailwindcss": "^3.4.2",
|
||||
"ts-jest": "^29.1.2"
|
||||
},
|
||||
"packageManager": "pnpm@8.15.6",
|
||||
"packageManager": "npm@10.5.0",
|
||||
"volta": {
|
||||
"node": "18.20.1"
|
||||
}
|
||||
|
||||
8518
frontend/pnpm-lock.yaml
generated
8518
frontend/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user