From 4163fab312c11f2407670f1337684fc0935d773b Mon Sep 17 00:00:00 2001 From: Ruben Nogueira <40404708+rubnogueira@users.noreply.github.com> Date: Fri, 26 Dec 2025 03:46:00 +0000 Subject: [PATCH] feat: pnpm clean (#156) * feat: pnpm clean * fix: pnpm use prune --- lib/clean/dev.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/clean/dev.sh b/lib/clean/dev.sh index 80a6d43..9206aad 100644 --- a/lib/clean/dev.sh +++ b/lib/clean/dev.sh @@ -30,6 +30,24 @@ clean_dev_npm() { note_activity fi + # Clean pnpm store cache + local pnpm_default_store=~/Library/pnpm/store + if command -v pnpm > /dev/null 2>&1; then + # Use pnpm's built-in prune command + clean_tool_cache "pnpm store prune" pnpm store prune + note_activity + # Get the actual store path to check if default is orphaned + local pnpm_store_path + pnpm_store_path=$(run_with_timeout 5 pnpm store path 2>/dev/null) || pnpm_store_path="" + # If store path is different from default, clean the orphaned default + if [[ -n "$pnpm_store_path" && "$pnpm_store_path" != "$pnpm_default_store" ]]; then + safe_clean "$pnpm_default_store"/* "pnpm store (orphaned)" + fi + else + # pnpm not installed, clean default location + safe_clean "$pnpm_default_store"/* "pnpm store" + fi + # Clean alternative package manager caches safe_clean ~/.tnpm/_cacache/* "tnpm cache directory" safe_clean ~/.tnpm/_logs/* "tnpm logs"