Skip to content

feat(scripts): enhance find-unused.sh with deeper cross-referencing#1351

Merged
jcllobet merged 1 commit intodevfrom
feat/improve-find-unused-script
Apr 4, 2026
Merged

feat(scripts): enhance find-unused.sh with deeper cross-referencing#1351
jcllobet merged 1 commit intodevfrom
feat/improve-find-unused-script

Conversation

@jcllobet
Copy link
Copy Markdown
Collaborator

@jcllobet jcllobet commented Apr 4, 2026

Summary

Enhances scripts/find-unused.sh with deeper cross-referencing to reduce false positives and improve output clarity. All existing functionality is preserved — this only adds new capabilities on top.

Improvements over the previous version

  • Sibling repo CI/CD cross-referencing — scans workflows, Dockerfiles, and build scripts in sibling repos and factory-level CI for references to unused files
  • Expanded infra coverage — uses glob patterns to index build configs (vite, tailwind, postcss, next, drizzle, tsup, playwright), docker-compose files, .opencode skill scripts, and all build scripts across workspaces
  • tsconfig.json checking — includes all tsconfig*.json files in the search set for path aliases and includes
  • Progress indicator — shows [N/M] filepath while cross-referencing each file
  • Two-bucket display — separates output into "UNUSED — safe to remove" (red) and "REVIEW — referenced in infra/CI" (yellow/cyan), instead of a single mixed list
  • Smart generic name filtering — avoids false-positive sibling repo matches on generic filenames like index, utils, config, etc.
  • Better ref formatting — shows up to 3 short paths per reference with (+N more) for overflow
  • Path-based search — searches by both filename and full relative path for more precise matches
  • Updated routing dirs — added apps/share/app/, expanded ee/apps/landing/app/ coverage

What stays the same

  • knip-based detection (knip --include files)
  • Convention pattern matching (postinstall, drizzle.config, Tauri hooks)
  • File-based routing directory exclusions
  • Ignore prefixes for scripts/dev tools
  • Sorted-by-date output within each bucket

Test plan

  • Ran old script — 0 unused files detected (clean)
  • Ran new script — 0 unused files detected (clean), sibling repo indexing works
  • Run on a branch with known unused files to verify cross-referencing catches them
  • Verify sibling repo detection works from the actual repo root (not worktree)

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Apr 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openwork-app Ready Ready Preview, Comment Apr 4, 2026 11:16pm
openwork-den Ready Ready Preview, Comment Apr 4, 2026 11:16pm
openwork-den-worker-proxy Ready Ready Preview, Comment Apr 4, 2026 11:16pm
openwork-landing Ready Ready Preview, Comment, Open in v0 Apr 4, 2026 11:16pm
openwork-share Ready Ready Preview, Comment Apr 4, 2026 11:16pm

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

The following comment was made by an LLM, it may be inaccurate:

Extends the unused file detection script with sibling repo CI/CD
cross-referencing, expanded infra coverage (build configs, tsconfig,
docker-compose, .opencode skills), progress indicator, two-bucket
output display, and smart generic filename filtering.

Handles standalone openwork without factory layout gracefully —
auto-detects whether _repos/ exists and skips sibling checks if not.
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