From 254e34dbcaffe1b915c2b5fc8c354fa83e133bdf Mon Sep 17 00:00:00 2001 From: chan Date: Thu, 14 May 2026 16:29:27 +0900 Subject: [PATCH] =?UTF-8?q?chore:=20=EB=AA=A8=EB=85=B8=EB=A0=88=ED=8F=AC?= =?UTF-8?q?=20=EA=B5=AC=EC=B6=95=EC=97=90=20=EB=94=B0=EB=A5=B8=20Docker=20?= =?UTF-8?q?=EC=BB=A8=ED=85=8C=EC=9D=B4=EB=84=88=20=EB=B0=8F=20=EB=9F=B0?= =?UTF-8?q?=ED=83=80=EC=9E=84=20=EC=8A=A4=ED=81=AC=EB=A6=BD=ED=8A=B8=20?= =?UTF-8?q?=EB=8C=80=EC=9D=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adminfront/scripts/runtime-mode.sh | 24 +++++++++++++++++++----- deploy/templates/docker-compose.yaml | 3 +++ devfront/scripts/runtime-mode.sh | 24 +++++++++++++++++++----- orgfront/scripts/runtime-mode.sh | 24 +++++++++++++++++++----- 4 files changed, 60 insertions(+), 15 deletions(-) diff --git a/adminfront/scripts/runtime-mode.sh b/adminfront/scripts/runtime-mode.sh index 817ca498..3a5ddadd 100644 --- a/adminfront/scripts/runtime-mode.sh +++ b/adminfront/scripts/runtime-mode.sh @@ -36,21 +36,35 @@ if [ "${1:-}" = "--print-mode" ]; then fi ensure_frontend_dependencies() { - if [ ! -f package.json ] || [ ! -f package-lock.json ]; then + # If common workspace exists, manage dependencies from there + if [ -d /common ] && [ -f /common/package.json ]; then + WORKSPACE_DIR="/common" + LOCK_FILE="/common/pnpm-lock.yaml" + else + WORKSPACE_DIR="." + LOCK_FILE="package-lock.json" + fi + + if [ ! -f "$WORKSPACE_DIR/package.json" ]; then return 0 fi if command -v sha256sum >/dev/null 2>&1; then - deps_hash="$(sha256sum package.json package-lock.json | sha256sum | awk '{print $1}')" + deps_hash="$(sha256sum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | sha256sum | awk '{print $1}')" else - deps_hash="$(cksum package.json package-lock.json | cksum | awk '{print $1}')" + deps_hash="$(cksum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | cksum | awk '{print $1}')" fi deps_stamp="node_modules/.baron-deps-hash" installed_hash="$(cat "$deps_stamp" 2>/dev/null || true)" if [ "$installed_hash" != "$deps_hash" ]; then - echo "Installing frontend dependencies from package-lock.json..." - npm ci + echo "Installing frontend dependencies..." + if [ "$WORKSPACE_DIR" = "/common" ]; then + npm install -g pnpm + (cd /common && pnpm install) + else + npm ci + fi mkdir -p node_modules printf '%s\n' "$deps_hash" > "$deps_stamp" fi diff --git a/deploy/templates/docker-compose.yaml b/deploy/templates/docker-compose.yaml index a991083b..d8bc843a 100644 --- a/deploy/templates/docker-compose.yaml +++ b/deploy/templates/docker-compose.yaml @@ -321,6 +321,7 @@ services: ports: - "${ADMINFRONT_PORT}:5173" volumes: + - ../../common:/common - ../../adminfront:/app - ./adminfront/vite.config.ts:/app/vite.config.ts:ro - ./adminfront/auth.ts:/app/src/lib/auth.ts:ro @@ -335,6 +336,7 @@ services: ports: - "${DEVFRONT_PORT}:5173" volumes: + - ../../common:/common - ../../devfront:/app - ./devfront/vite.config.ts:/app/vite.config.ts:ro - ./devfront/auth.ts:/app/src/lib/auth.ts:ro @@ -349,6 +351,7 @@ services: ports: - "${ORGFRONT_PORT}:5175" volumes: + - ../../common:/common - ../../orgfront:/app - ./orgfront/vite.config.ts:/app/vite.config.ts:ro - ./orgfront/auth.ts:/app/src/lib/auth.ts:ro diff --git a/devfront/scripts/runtime-mode.sh b/devfront/scripts/runtime-mode.sh index 83b47b41..ada440ef 100644 --- a/devfront/scripts/runtime-mode.sh +++ b/devfront/scripts/runtime-mode.sh @@ -36,21 +36,35 @@ if [ "${1:-}" = "--print-mode" ]; then fi ensure_frontend_dependencies() { - if [ ! -f package.json ] || [ ! -f package-lock.json ]; then + # If common workspace exists, manage dependencies from there + if [ -d /common ] && [ -f /common/package.json ]; then + WORKSPACE_DIR="/common" + LOCK_FILE="/common/pnpm-lock.yaml" + else + WORKSPACE_DIR="." + LOCK_FILE="package-lock.json" + fi + + if [ ! -f "$WORKSPACE_DIR/package.json" ]; then return 0 fi if command -v sha256sum >/dev/null 2>&1; then - deps_hash="$(sha256sum package.json package-lock.json | sha256sum | awk '{print $1}')" + deps_hash="$(sha256sum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | sha256sum | awk '{print $1}')" else - deps_hash="$(cksum package.json package-lock.json | cksum | awk '{print $1}')" + deps_hash="$(cksum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | cksum | awk '{print $1}')" fi deps_stamp="node_modules/.baron-deps-hash" installed_hash="$(cat "$deps_stamp" 2>/dev/null || true)" if [ "$installed_hash" != "$deps_hash" ]; then - echo "Installing frontend dependencies from package-lock.json..." - npm ci + echo "Installing frontend dependencies..." + if [ "$WORKSPACE_DIR" = "/common" ]; then + npm install -g pnpm + (cd /common && pnpm install) + else + npm ci + fi mkdir -p node_modules printf '%s\n' "$deps_hash" > "$deps_stamp" fi diff --git a/orgfront/scripts/runtime-mode.sh b/orgfront/scripts/runtime-mode.sh index caec8753..3ce80ca1 100644 --- a/orgfront/scripts/runtime-mode.sh +++ b/orgfront/scripts/runtime-mode.sh @@ -36,21 +36,35 @@ if [ "${1:-}" = "--print-mode" ]; then fi ensure_frontend_dependencies() { - if [ ! -f package.json ] || [ ! -f package-lock.json ]; then + # If common workspace exists, manage dependencies from there + if [ -d /common ] && [ -f /common/package.json ]; then + WORKSPACE_DIR="/common" + LOCK_FILE="/common/pnpm-lock.yaml" + else + WORKSPACE_DIR="." + LOCK_FILE="package-lock.json" + fi + + if [ ! -f "$WORKSPACE_DIR/package.json" ]; then return 0 fi if command -v sha256sum >/dev/null 2>&1; then - deps_hash="$(sha256sum package.json package-lock.json | sha256sum | awk '{print $1}')" + deps_hash="$(sha256sum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | sha256sum | awk '{print $1}')" else - deps_hash="$(cksum package.json package-lock.json | cksum | awk '{print $1}')" + deps_hash="$(cksum "$WORKSPACE_DIR/package.json" "$LOCK_FILE" 2>/dev/null | cksum | awk '{print $1}')" fi deps_stamp="node_modules/.baron-deps-hash" installed_hash="$(cat "$deps_stamp" 2>/dev/null || true)" if [ "$installed_hash" != "$deps_hash" ]; then - echo "Installing frontend dependencies from package-lock.json..." - npm ci + echo "Installing frontend dependencies..." + if [ "$WORKSPACE_DIR" = "/common" ]; then + npm install -g pnpm + (cd /common && pnpm install) + else + npm ci + fi mkdir -p node_modules printf '%s\n' "$deps_hash" > "$deps_stamp" fi