From 88d3983f26f401c8b667f7004a82709c6202f258 Mon Sep 17 00:00:00 2001 From: Yuzhong Zhang <141388234+BetterAndBetterII@users.noreply.github.com> Date: Sat, 5 Jul 2025 23:39:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B9=E7=9B=AE=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=8E=E6=9E=84=E5=BB=BA=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 本次提交包含以下主要更改: 1. 更新 `.gitignore` 文件,移除对子目录环境变量文件的忽略。 2. 修改 `excalidraw-complete.Dockerfile`,将构建工具从 `npm` 更改为 `pnpm`,并移除不必要的补丁步骤。 3. 更新 GitHub Actions 工作流 `docker-build.yml`,移除对子模块的递归检出。 4. 修改 `excalidraw/.env.production` 文件,调整后端 API 地址为本地开发环境,并更新 Firebase 配置。 5. 移除 `husky` 相关依赖及配置,简化项目依赖。 这些更改旨在优化开发环境配置,提高构建效率,并简化项目依赖管理。 --- .github/workflows/docker-build.yml | 2 -- .gitignore | 1 - excalidraw-complete.Dockerfile | 8 +------- excalidraw/.env.production | 18 +++++++++--------- excalidraw/.husky/pre-commit | 2 -- excalidraw/package.json | 2 -- excalidraw/pnpm-lock.yaml | 10 ---------- 7 files changed, 10 insertions(+), 33 deletions(-) delete mode 100644 excalidraw/.husky/pre-commit diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index e965b5b..9ffd180 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -20,8 +20,6 @@ jobs: steps: - name: Checkout repository uses: actions/checkout@v4 - with: - submodules: recursive - name: Log in to Container Registry uses: docker/login-action@v3 diff --git a/.gitignore b/.gitignore index a1b74ea..0234a98 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,3 @@ excalidraw-complete node_modules .env *.env -*/*.env diff --git a/excalidraw-complete.Dockerfile b/excalidraw-complete.Dockerfile index f6ecc60..6fbeb26 100644 --- a/excalidraw-complete.Dockerfile +++ b/excalidraw-complete.Dockerfile @@ -1,16 +1,10 @@ # 前端构建阶段 FROM node:18 AS frontend-builder WORKDIR /app -# 安装 patch 工具 -RUN apt-get update && apt-get install -y patch # 复制 excalidraw 子模块 COPY excalidraw/ ./excalidraw/ -# 复制补丁文件 -COPY frontend.patch ./ -# 应用前端补丁 -RUN cd excalidraw && patch -p1 < ../frontend.patch # 构建前端 -RUN cd excalidraw && npm install && cd excalidraw-app && npm run build:app:docker +RUN cd excalidraw && pnpm install && cd excalidraw-app && pnpm build:app:docker # 后端构建阶段 FROM golang:alpine AS backend-builder diff --git a/excalidraw/.env.production b/excalidraw/.env.production index 0c71585..26a13ba 100644 --- a/excalidraw/.env.production +++ b/excalidraw/.env.production @@ -1,17 +1,17 @@ -VITE_APP_BACKEND_V2_GET_URL=https://json.excalidraw.com/api/v2/ -VITE_APP_BACKEND_V2_POST_URL=https://json.excalidraw.com/api/v2/post/ +VITE_APP_BACKEND_V2_GET_URL=http://localhost:3002/api/v2/ +VITE_APP_BACKEND_V2_POST_URL=http://localhost:3002/api/v2/post/ VITE_APP_LIBRARY_URL=https://libraries.excalidraw.com -VITE_APP_LIBRARY_BACKEND=https://us-central1-excalidraw-room-persistence.cloudfunctions.net/libraries +VITE_APP_LIBRARY_BACKEND=http://localhost:3002/libraries -VITE_APP_PLUS_LP=https://plus.excalidraw.com -VITE_APP_PLUS_APP=https://app.excalidraw.com +VITE_APP_PLUS_LP=http://localhost:3002/plus/ +VITE_APP_PLUS_APP=http://localhost:3002/app/ -VITE_APP_AI_BACKEND=https://oss-ai.excalidraw.com +VITE_APP_AI_BACKEND=http://localhost:3002/ai/ # socket server URL used for collaboration -VITE_APP_WS_SERVER_URL=https://oss-collab.excalidraw.com +VITE_APP_WS_SERVER_URL=http://localhost:3002 -VITE_APP_FIREBASE_CONFIG='{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"excalidraw-room-persistence.firebaseapp.com","databaseURL":"https://excalidraw-room-persistence.firebaseio.com","projectId":"excalidraw-room-persistence","storageBucket":"excalidraw-room-persistence.appspot.com","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}' +VITE_APP_FIREBASE_CONFIG='{"apiKey":"AIzaSyAd15pYlMci_xIp9ko6wkEsDzAAA0Dn0RU","authDomain":"","databaseURL":"","projectId":"excalidraw-room-persistence","storageBucket":"","messagingSenderId":"654800341332","appId":"1:654800341332:web:4a692de832b55bd57ce0c1"}' -VITE_APP_DISABLE_TRACKING= +VITE_APP_DISABLE_TRACKING=yes diff --git a/excalidraw/.husky/pre-commit b/excalidraw/.husky/pre-commit deleted file mode 100644 index ab2a5ac..0000000 --- a/excalidraw/.husky/pre-commit +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -# yarn lint-staged diff --git a/excalidraw/package.json b/excalidraw/package.json index 17ea780..0dcae17 100644 --- a/excalidraw/package.json +++ b/excalidraw/package.json @@ -39,7 +39,6 @@ "eslint-config-react-app": "7.0.1", "eslint-plugin-prettier": "3.3.1", "http-server": "14.1.1", - "husky": "7.0.4", "jsdom": "22.1.0", "lint-staged": "12.3.7", "pepjs": "0.5.3", @@ -70,7 +69,6 @@ "fix": "pnpm fix:other && pnpm fix:code", "locales-coverage": "node scripts/build-locales-coverage.js", "locales-coverage:description": "node scripts/locales-coverage-description.js", - "prepare": "husky install", "prettier": "prettier \"**/*.{css,scss,json,md,html,yml}\" --ignore-path=.eslintignore", "start": "pnpm --filter excalidraw-app start", "start:app:production": "pnpm build && npx http-server build -a localhost -p 5001 -o", diff --git a/excalidraw/pnpm-lock.yaml b/excalidraw/pnpm-lock.yaml index 0b7e706..592acc7 100644 --- a/excalidraw/pnpm-lock.yaml +++ b/excalidraw/pnpm-lock.yaml @@ -93,9 +93,6 @@ importers: http-server: specifier: 14.1.1 version: 14.1.1 - husky: - specifier: 7.0.4 - version: 7.0.4 jsdom: specifier: 22.1.0 version: 22.1.0 @@ -4419,11 +4416,6 @@ packages: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} - husky@7.0.4: - resolution: {integrity: sha512-vbaCKN2QLtP/vD4yvs6iz6hBEo6wkSzs8HpRah1Z6aGmF2KW5PdYuAd7uX5a+OyBZHBhd+TFLqgjUgytQr4RvQ==} - engines: {node: '>=12'} - hasBin: true - i18next-browser-languagedetector@6.1.4: resolution: {integrity: sha512-wukWnFeU7rKIWT66VU5i8I+3Zc4wReGcuDK2+kuFhtoxBRGWGdvYI9UQmqNL/yQH1KogWwh+xGEaIPH8V/i2Zg==} @@ -12647,8 +12639,6 @@ snapshots: human-signals@5.0.0: {} - husky@7.0.4: {} - i18next-browser-languagedetector@6.1.4: dependencies: '@babel/runtime': 7.27.6