Add fallow static-analysis tooling and remove dead code#1119
Open
busbyk wants to merge 4 commits into
Open
Conversation
Set up fallow (dead-code / duplication / health audit) following the compliance happy path: fix the real findings, baseline the rest, and gate regressions in pre-commit + CI. Real fixes: - Rewrite 7 `src/payload-types` imports to the `@/payload-types` alias (clears fallow's bogus `src` unlisted-dependency finding) - Remove unused deps: axios, pluralize (+@types/pluralize), prism-react-renderer, @vercel/edge-config, @open-iframe-resizer/core, copyfiles .fallowrc.json ignores false positives fallow can't trace statically: - Generated files (payload-types, migrations, admin importMap route) - shadcn ui exports + intentional namespace-barrel field factories - Deps referenced only via config strings (eslint, sentry OTEL, tailwindcss-animate) and runtime DB infra (libsql, @libsql/client) Baselines (fallow-baselines/) capture remaining accepted debt: dead files/exports/types, circular deps, duplication, health hotspots. Gating: `pnpm fallow:audit` in .husky/pre-commit and a `fallow` CI job, both diff-scoped (--changed-since origin/main) so only new regressions fail. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Delete 10 files fallow flagged as unused, each verified against git history as genuinely orphaned (no importers; usages removed in past refactors): - exit-preview/GET.ts (x2) — inert duplicates of the sibling route.ts (Next App Router serves route.ts; GET.ts is not a route filename) - hooks/formatSlug.ts — superseded by fields/slug/formatSlug.ts - endpoints/seed/biographies-all.ts — never-imported seed split; the live seed path is biographies.ts (seedStaff) - utilities/useDebounce.ts — orphaned when @payloadcms/plugin-search was removed - utilities/tenancy/defaultTenantIdFromHeaders.ts — dropped when the tenancy model moved off the multi-tenant plugin (ADR 010) - components/PageRange + components/Pagination — unused; Pagination superseded by the shadcn ui/pagination - utilities/rbac/hasProviderAccess.ts — obsoleted by the events/courses split (ADR 012's "separate provider events" path); drift binding re-pointed (already covered by isProviderManager/byProviderRelationship) - fields/crmFields.ts — CRM integration field group removed from collections Kept: utilities/getDocumentBySlug.ts (useful cached slug fetch) and components/ui/button-group.tsx (vendored shadcn). Both remain accepted in the shrunk fallow baselines (dupes 9.4%->8.7%). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Preview deployment: https://tooling-fallow.preview.avy-fx.org |
Merging main brought 63 commits of new code into scope, so the diff-scoped audit surfaced pre-existing dupes/dead-code not captured in the baselines saved on the pre-merge tree. Re-snapshot the three baselines against the merged codebase. No code findings introduced by this branch; the kept files (getDocumentBySlug, shadcn button-group) remain the only accepted dead files. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
rchlfryn
approved these changes
Jun 19, 2026
rchlfryn
left a comment
Collaborator
There was a problem hiding this comment.
This is cool! Thanks for adding
Contributor
🤯 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Sets up
fallow(dead-code / duplication / health audit) following its compliance happy-path: fix the real findings, baseline the rest, and gate new regressions in pre-commit + CI. A second commit removes verified dead code.Related Issues
N/A
Key Changes
Setup (commit 1)
.fallowrc.jsonadapted to the single-src/layout: ignores generated files (payload-types, migrations, admin importMap), shadcn ui exports, namespace-barrel field factories, and config-string-only deps (eslint, sentry OTEL, tailwind, libsql DB infra)fallow-baselines/;fallow+fallow:auditscripts.husky/pre-commitstep + CIfallowjob (diff-scoped--changed-since origin/main)src/payload-types→@/payload-typesimports; removed 6 unused deps (axios, pluralize, prism-react-renderer, @vercel/edge-config, @open-iframe-resizer/core, copyfiles)Dead-code removal (commit 2)
getDocumentBySlug+ shadcnbutton-groupisProviderManager/byProviderRelationship); baselines shrank (dupes 9.4%→8.7%)How to test
pnpm fallow:audit --ci→ no issues.pnpm tscandpnpm test(417 passing) green. The CIfallowjob runs the audit on changed files.Migration Explanation
N/A — no schema/DB changes.
Future enhancements / Questions
Dead exports/types and circular deps remain baselined (accepted debt) for a future cleanup pass.