mirror of
https://github.com/Sagit-chu/flvx.git
synced 2026-09-28 07:36:38 +08:00
chore: migrate frontend package manager from npm to pnpm
This commit is contained in:
@@ -21,11 +21,14 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
node-version: '20.19.0'
|
node-version: '20.19.0'
|
||||||
|
|
||||||
|
- name: Install pnpm
|
||||||
|
run: npm install -g pnpm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm install --legacy-peer-deps
|
run: pnpm install --frozen-lockfile
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: pnpm run build
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
name: Build Go Backend
|
name: Build Go Backend
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ FLVX — traffic forwarding panel: Go admin API + Vite/React UI + Go agent.
|
|||||||
(cd go-backend && go test ./...)
|
(cd go-backend && go test ./...)
|
||||||
|
|
||||||
# Frontend
|
# Frontend
|
||||||
(cd vite-frontend && npm install --legacy-peer-deps)
|
(cd vite-frontend && pnpm install)
|
||||||
(cd vite-frontend && npm run dev) # host 0.0.0.0:3000
|
(cd vite-frontend && pnpm run dev) # host 0.0.0.0:3000
|
||||||
(cd vite-frontend && npm run build) # tsc && vite build
|
(cd vite-frontend && pnpm run build) # tsc && vite build
|
||||||
(cd vite-frontend && npm run lint) # eslint --fix (no typecheck command)
|
(cd vite-frontend && pnpm run lint) # eslint --fix (no typecheck command)
|
||||||
|
|
||||||
# Agent
|
# Agent
|
||||||
(cd go-gost && go run .)
|
(cd go-gost && go run .)
|
||||||
|
|||||||
+1
-1
@@ -82,7 +82,7 @@ python with_server.py --backend-port 8080 --frontend-port 5173 -- pytest -v
|
|||||||
# Custom server commands
|
# Custom server commands
|
||||||
python with_server.py \
|
python with_server.py \
|
||||||
--server "make run" --port 6365 --cwd go-backend \
|
--server "make run" --port 6365 --cwd go-backend \
|
||||||
--server "npm run dev" --port 3000 --cwd vite-frontend \
|
--server "pnpm run dev" --port 3000 --cwd vite-frontend \
|
||||||
-- pytest -v
|
-- pytest -v
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,7 @@ Examples:
|
|||||||
# Custom server configuration
|
# Custom server configuration
|
||||||
python with_server.py \\
|
python with_server.py \\
|
||||||
--server "make run" --port 6365 --cwd go-backend \\
|
--server "make run" --port 6365 --cwd go-backend \\
|
||||||
--server "npm run dev" --port 3000 --cwd vite-frontend \\
|
--server "pnpm run dev" --port 3000 --cwd vite-frontend \\
|
||||||
-- pytest -v
|
-- pytest -v
|
||||||
|
|
||||||
# Use custom backend port
|
# Use custom backend port
|
||||||
@@ -302,7 +302,7 @@ def build_servers(args) -> list[ServerProcess]:
|
|||||||
|
|
||||||
servers.append(
|
servers.append(
|
||||||
ServerProcess(
|
ServerProcess(
|
||||||
command="npm run dev",
|
command="pnpm run dev",
|
||||||
port=args.frontend_port,
|
port=args.frontend_port,
|
||||||
cwd=root / args.frontend_cwd,
|
cwd=root / args.frontend_cwd,
|
||||||
env=frontend_env,
|
env=frontend_env,
|
||||||
|
|||||||
@@ -24,7 +24,8 @@ dist-ssr
|
|||||||
*.sw?
|
*.sw?
|
||||||
|
|
||||||
|
|
||||||
pnpm-lock.yaml
|
yarn.lock
|
||||||
|
package-lock.json
|
||||||
yarn.lock
|
yarn.lock
|
||||||
package-lock.json
|
package-lock.json
|
||||||
bun.lockb
|
bun.lockb
|
||||||
@@ -33,8 +33,8 @@ React dashboard for FLVX. rolldown-vite + TypeScript + Tailwind v4 + shadcn/radi
|
|||||||
## Commands
|
## Commands
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install --legacy-peer-deps
|
pnpm install
|
||||||
npm run dev # http://0.0.0.0:3000
|
pnpm run dev # http://0.0.0.0:3000
|
||||||
npm run build # tsc && vite build
|
pnpm run build # tsc && vite build
|
||||||
npm run lint # eslint --fix
|
pnpm run lint # eslint --fix
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -3,11 +3,11 @@ FROM node:20.19.0 AS builder
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package*.json ./
|
COPY package.json pnpm-lock.yaml* ./
|
||||||
RUN npm install --legacy-peer-deps
|
RUN corepack enable pnpm && pnpm install --frozen-lockfile
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN pnpm run build
|
||||||
|
|
||||||
# 生产阶段
|
# 生产阶段
|
||||||
FROM nginx:stable-alpine AS production-stage
|
FROM nginx:stable-alpine AS production-stage
|
||||||
|
|||||||
@@ -23,16 +23,16 @@ git clone https://github.com/frontio-ai/vite-template.git
|
|||||||
|
|
||||||
### Install dependencies
|
### Install dependencies
|
||||||
|
|
||||||
You can use one of them `npm`, `yarn`, `pnpm`, `bun`, Example using `npm`:
|
You can use one of them `npm`, `yarn`, `pnpm`, `bun`, Example using `pnpm`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm install
|
pnpm install
|
||||||
```
|
```
|
||||||
|
|
||||||
### Run the development server
|
### Start development server
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
npm run dev
|
pnpm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
### Setup pnpm (optional)
|
### Setup pnpm (optional)
|
||||||
|
|||||||
Generated
+8999
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user