Skip to content

feat(projects): stale node_modules cleanup from inactive projects#23

Merged
Sstark97 merged 1 commit intomainfrom
feature/issue-13-stale-node-modules
Feb 5, 2026
Merged

feat(projects): stale node_modules cleanup from inactive projects#23
Sstark97 merged 1 commit intomainfrom
feature/issue-13-stale-node-modules

Conversation

@Sstark97
Copy link
Owner

@Sstark97 Sstark97 commented Feb 5, 2026

Summary

  • Nuevo módulo src/modules/project_cleanup.sh que escanea HOME dinámicamente buscando node_modules en proyectos inactivos y los elimina tras confirmación.
  • Conectado como flag --projects en el CLI, incluido en --all.
  • 14 unit tests cubriendo helpers, dry-run, analyze mode y escenarios mixtos activo/inactivo.

How it works

  • find desde HOME con maxdepth configurable (default 6), excluyendo Library, .Trash y node_modules anidados.
  • Inactividad se determina buscando archivos modificados dentro del umbral (NODE_MODULES_STALE_DAYS=90), ignorando node_modules/ y .git/.
  • Solo se elimina el directorio node_modules — el proyecto queda intacto, npm install lo restaura.

Test plan

  • make test pasa (129 unit + 11 e2e)
  • devsweep --dry-run --projects no elimina nada
  • devsweep --analyze --projects muestra proyectos detectados
  • Proyectos activos no se tocan en ningún modo

Scan HOME dynamically for node_modules in projects inactive longer
than NODE_MODULES_STALE_DAYS (default 90). Excludes Library, .Trash,
nested node_modules, and .git from activity checks.

- src/modules/project_cleanup.sh: new module with scan, inactivity
  detection, dry-run, analyze-mode, and confirmed bulk delete
- bin/devsweep: wired as --projects flag, included in --all
- src/utils/config.sh: NODE_MODULES_STALE_DAYS and MAX_DEPTH constants
- 14 unit tests covering helpers, dry-run, analyze, mixed scenarios

Closes #13
@Sstark97 Sstark97 merged commit 477f18f into main Feb 5, 2026
2 checks passed
@Sstark97 Sstark97 deleted the feature/issue-13-stale-node-modules branch February 5, 2026 11:08
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