Skip to content

feat(tools): add an interactive cache cleaner - #52

Merged
ReinaldoAssis merged 1 commit into
mainfrom
feat/clean-caches
Oct 23, 2026
Merged

ReinaldoAssis merged 1 commit into
mainfrom
feat/clean-caches

Conversation

@ReinaldoAssis

Copy link
Copy Markdown
Owner

O que muda

  • tools/clean.mjs + npm run clean: TUI com setas/espaço para marcar alvos e enter para confirmar.
  • Alvos fixos: builds do projeto (src-tauri/target, .svelte-kit, build, Gradle/Xcode build dirs, node_modules) e caches de toolchain (Gradle, Cargo, npm, pnpm, Playwright, Xcode, CoreSimulator, Homebrew).
  • Flags: --list, --json, --dry-run, --yes, --only=id,id.
  • Segurança: lista fixa, recusa repo/home/ancestrais, apaga symlink sem seguir o destino.
  • Medição com du quando existe; walker em JS no Windows.

Verificação

  • npm run check — 0 erros
  • npm test — 284 testes
  • npm run build — ok
  • TUI dirigida por pty real: render, toggle e plano
  • Deleção real de 1,3 MB (android-gradle-root) com resumo de espaço

Notas

  • node_modules aparece desmarcado por padrão.
  • Nenhuma dependência nova.

Build caches and toolchain caches were being cleaned by hand with du + rm,
which is slow to audit and easy to get wrong. `npm run clean` now knows a
fixed list of targets, measures each one, and opens a TUI where space
toggles a target and enter confirms:

- project builds: Rust target/, .svelte-kit, build/, Android and Xcode
  build dirs, node_modules (listed but unselected by default)
- toolchain caches: Gradle, Cargo, npm, pnpm, Playwright, Xcode
  DerivedData/DeviceSupport, CoreSimulator, Homebrew
- flags for automation: --list, --json, --dry-run, --yes, --only=id,id

Safety: the target list is fixed in the script, deletion refuses the repo
root, the home directory and any ancestor of them, and symlinks are removed
instead of followed. Sizes use du when available and a JS walker otherwise.
@ReinaldoAssis
ReinaldoAssis merged commit 72bbd16 into main Oct 23, 2026
4 checks passed
@ReinaldoAssis
ReinaldoAssis deleted the feat/clean-caches branch October 23, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant