Merged PR 54: Update for clean pnpm store before pnpm build

Update for clean pnpm store before pnpm build
This commit is contained in:
Tianyong Qiu 2025-03-24 04:32:20 +00:00
commit c32b0563eb

View File

@ -787,15 +787,17 @@ if true ; then
cp pnpm-lock.yaml /tmp/pnpm-lock.yaml.bak cp pnpm-lock.yaml /tmp/pnpm-lock.yaml.bak
fi fi
# Remove node_modules directory
rm -rf node_modules rm -rf node_modules
# 4⃣ Install dependencies
pnpm store prune
# 4⃣ Install dependencies (ensuring lockfile updates) # 4⃣ Install dependencies (ensuring lockfile updates)
pnpm install --no-frozen-lockfile \\ pnpm install --no-frozen-lockfile \\
--shamefully-hoist \\ --shamefully-hoist \\
--link-workspace-packages false \\ --link-workspace-packages false \\
--store-dir /home/devbox/.pnpm-store --store-dir /home/tmp/.pnpm-store
# 4⃣ Build the frontend # 4⃣ Build the frontend
pnpm run build pnpm run build
@ -1197,21 +1199,24 @@ docker exec -i "$DEVBOX_NAME" bash <<EOF
# Clean up old dependencies # Clean up old dependencies
rm -rf node_modules rm -rf node_modules
# Clean up old pnpm store
pnpm store prune
# Backup the pnpm-lock.yaml file # Backup the pnpm-lock.yaml file
if [ -f "pnpm-lock.yaml" ]; then if [ -f "pnpm-lock.yaml" ]; then
mv pnpm-lock.yaml /tmp/pnpm-lock.yaml.bak mv pnpm-lock.yaml /tmp/pnpm-lock.yaml.bak
fi fi
# if /home/devbox/.pnpm-store exists, remove it # if /home/tmp/.pnpm-store exists, remove it
if [ -d "/home/devbox/.pnpm-store" ]; then if [ -d "/home/tmp/.pnpm-store" ]; then
rm -rf /home/devbox/.pnpm-store rm -rf /home/tmp/.pnpm-store
fi fi
# Install dependencies # Install dependencies
pnpm install --no-frozen-lockfile \\ pnpm install --no-frozen-lockfile \\
--shamefully-hoist \\ --shamefully-hoist \\
--link-workspace-packages false \\ --link-workspace-packages false \\
--store-dir /home/devbox/.pnpm-store || { --store-dir /home/tmp/.pnpm-store || {
echo echo
echo "============================================================================================" echo "============================================================================================"
echo echo