mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-06 08:43:36 +02:00
Bring back in package-lock.json
This commit is contained in:
@@ -8,7 +8,6 @@ wheels/
|
||||
# Virtual environments
|
||||
.venv
|
||||
frontend/node_modules/
|
||||
frontend/package-lock.json
|
||||
frontend/test-results/
|
||||
|
||||
# Frontend build output (built from source by end users)
|
||||
|
||||
@@ -223,7 +223,7 @@ MESHCORE_SERIAL_PORT=/dev/cu.usbserial-0001 uv run uvicorn app.main:app --reload
|
||||
|
||||
```bash
|
||||
cd frontend
|
||||
npm install
|
||||
npm ci
|
||||
npm run dev # http://localhost:5173, proxies /api to :8000
|
||||
```
|
||||
|
||||
@@ -237,7 +237,7 @@ Terminal 2: `cd frontend && npm run dev`
|
||||
In production, the FastAPI backend serves the compiled frontend. Build the frontend first:
|
||||
|
||||
```bash
|
||||
cd frontend && npm install && npm run build && cd ..
|
||||
cd frontend && npm ci && npm run build && cd ..
|
||||
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||
```
|
||||
|
||||
|
||||
+2
-2
@@ -5,8 +5,8 @@ ARG COMMIT_HASH=unknown
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
COPY frontend/package.json frontend/.npmrc ./
|
||||
RUN npm install
|
||||
COPY frontend/package.json frontend/package-lock.json frontend/.npmrc ./
|
||||
RUN npm ci
|
||||
|
||||
COPY frontend/ ./
|
||||
RUN VITE_COMMIT_HASH=${COMMIT_HASH} npm run build
|
||||
|
||||
@@ -77,7 +77,7 @@ cd Remote-Terminal-for-MeshCore
|
||||
uv sync
|
||||
|
||||
# Build frontend
|
||||
cd frontend && npm install && npm run build && cd ..
|
||||
cd frontend && npm ci && npm run build && cd ..
|
||||
|
||||
# Run server
|
||||
uv run uvicorn app.main:app --host 0.0.0.0 --port 8000
|
||||
@@ -175,7 +175,7 @@ uv run uvicorn app.main:app --reload
|
||||
|
||||
```bash
|
||||
cd frontend
|
||||
npm install
|
||||
npm ci
|
||||
npm run dev # Dev server at http://localhost:5173 (proxies API to :8000)
|
||||
npm run build # Production build to dist/
|
||||
```
|
||||
@@ -287,7 +287,7 @@ sudo -u remoteterm uv sync
|
||||
|
||||
# Build frontend (required for the backend to serve the web UI)
|
||||
cd /opt/remoteterm/frontend
|
||||
sudo -u remoteterm npm install
|
||||
sudo -u remoteterm npm ci
|
||||
sudo -u remoteterm npm run build
|
||||
|
||||
# Install and start service
|
||||
|
||||
@@ -164,7 +164,5 @@ def register_frontend_missing_fallback(app: FastAPI) -> None:
|
||||
async def frontend_not_built():
|
||||
return JSONResponse(
|
||||
status_code=404,
|
||||
content={
|
||||
"detail": "Frontend not built. Run: cd frontend && npm install && npm run build"
|
||||
},
|
||||
content={"detail": "Frontend not built. Run: cd frontend && npm ci && npm run build"},
|
||||
)
|
||||
|
||||
@@ -7,7 +7,6 @@ set -euo pipefail
|
||||
|
||||
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
|
||||
OUT="${1:-$REPO_ROOT/LICENSES.md}"
|
||||
FRONTEND_DOCKER_LOCK="$REPO_ROOT/frontend/package-lock.docker.json"
|
||||
FRONTEND_LICENSE_IMAGE="${FRONTEND_LICENSE_IMAGE:-node:20-slim}"
|
||||
FRONTEND_LICENSE_NPM="${FRONTEND_LICENSE_NPM:-10.9.5}"
|
||||
|
||||
@@ -72,7 +71,6 @@ frontend_licenses_docker() {
|
||||
set -euo pipefail
|
||||
cp -a /src/frontend ./frontend
|
||||
cd frontend
|
||||
cp package-lock.docker.json package-lock.json
|
||||
npm i -g npm@$FRONTEND_LICENSE_NPM >/dev/null
|
||||
npm ci --ignore-scripts >/dev/null
|
||||
node /src/scripts/print_frontend_licenses.cjs
|
||||
@@ -80,11 +78,7 @@ frontend_licenses_docker() {
|
||||
}
|
||||
|
||||
frontend_licenses() {
|
||||
if [ -f "$FRONTEND_DOCKER_LOCK" ]; then
|
||||
frontend_licenses_docker
|
||||
else
|
||||
frontend_licenses_local
|
||||
fi
|
||||
frontend_licenses_docker
|
||||
}
|
||||
|
||||
# ── Assemble ─────────────────────────────────────────────────────────
|
||||
|
||||
@@ -35,7 +35,7 @@ run_combo() {
|
||||
npm i -g npm@${npm_version}
|
||||
echo 'Using Node:' \$(node -v)
|
||||
echo 'Using npm:' \$(npm -v)
|
||||
npm install
|
||||
npm ci
|
||||
npm run build
|
||||
"
|
||||
|
||||
|
||||
@@ -38,8 +38,8 @@ export default defineConfig({
|
||||
command: `bash -c '
|
||||
echo "[e2e] $(date +%T.%3N) Starting webServer command..."
|
||||
if [ ! -d frontend/dist ]; then
|
||||
echo "[e2e] $(date +%T.%3N) frontend/dist missing — running npm install + build"
|
||||
cd frontend && npm install && npm run build
|
||||
echo "[e2e] $(date +%T.%3N) frontend/dist missing — running npm ci + build"
|
||||
cd frontend && npm ci && npm run build
|
||||
echo "[e2e] $(date +%T.%3N) Frontend build complete"
|
||||
else
|
||||
echo "[e2e] $(date +%T.%3N) frontend/dist exists — skipping build"
|
||||
|
||||
@@ -28,7 +28,7 @@ def test_missing_dist_logs_error_and_keeps_app_running(tmp_path, caplog):
|
||||
with TestClient(app) as client:
|
||||
resp = client.get("/")
|
||||
assert resp.status_code == 404
|
||||
assert "npm install" in resp.json()["detail"]
|
||||
assert "npm ci" in resp.json()["detail"]
|
||||
assert "npm run build" in resp.json()["detail"]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user