chore(faxina): rebased cleanup of dead files + lint drift (replaces #53)#92
chore(faxina): rebased cleanup of dead files + lint drift (replaces #53)#92adm01-debug wants to merge 9 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
This pull request has been ignored for the connected project Preview Branches by Supabase. |
- AUDITORIA_REDEPLOY_PROMO_GIFTS_2026-05-13_15-32 (1).md was a stale browser-download duplicate (note the " (1)" suffix); no consumers. - src/test/setup.ts was orphan — vitest.config.ts uses tests/setup.ts. https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
audit/db-frontend-coverage.json (9.7k lines) and audit/internal-schema.tsv (1.5k lines) are local audit outputs. .gitignore already declared the intent — "Outputs de auditoria/triage — gerados localmente, não devem versionar" — but these two slipped through. Adds explicit patterns and removes them from the index (filesystem copies retained for local devs). The hand-authored audit/ANALISE_BACKEND_SENIOR_2026-05-22.md stays tracked. https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
build:dev was running "node scripts/generate-health.mjs && vite build", but the script does not exist anywhere in git history reachable from this branch — so npm run build:dev failed immediately. No code reads the public/api/health.json the script was meant to emit, so removing the reference is safe. Also drops the orphan .gitignore entry that paired with the missing script. https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
tests/e2e/ contained 40+ test files plus committed runtime artifacts that were never executing: - 9 specs use @playwright/test but playwright.config.ts uses testDir:'./e2e' (not tests/e2e) — never picked up. - 31 are vitest files but vitest.config.ts explicitly excluded 'tests/e2e/**' to avoid a worker deadlock from accidentally loading the Playwright files alongside them — so these never ran either. - artifacts/ subtree was generated HTML/JSON snapshots checked in by past test runs. Nothing outside tests/e2e/ referenced anything inside it (only vitest's own exclude pattern + its explanatory comment). Baselines have zero entries for this path, so no baseline churn. Drops the now-unnecessary exclude entry from vitest.config.ts. https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
- scripts/generate-theme-report.ts — superseded duplicate of scripts/generate-theme-report.mjs (the .mjs is what e2e/theme-validation.spec.ts and package.json:test:theme-validation actually invoke). - scripts/test-external-db.ts — strict subset of scripts/verify-external.ts (same purpose, smaller assertion set). Both files were unreferenced by package.json, scripts, configs, CI, or docs. Other unreferenced dev utilities (CORS codemods, list-users) are intentionally kept as ad-hoc manual tools. https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
src/hooks/stock/index.ts contained only a single-line comment with no exports. Zero importers across src/ and tests/. Removing the dead barrel file keeps the directory clean (stockAlerts.ts and stockFetcher.ts import each other and from src/hooks/products/ directly, not via the barrel). https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
generateKitOgImage was only referenced by .lovable/memory feature notes pointing at a PublicKitViewPage that does not exist in this codebase. Verified zero imports (static or dynamic) anywhere in src/, tests/, e2e/, and supabase/. Safe to remove. https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
Zero importers (static or dynamic) anywhere in src/, tests/, e2e/, or supabase/. The active kit PDF export logic — if any — lives elsewhere; this file was dead. https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
The eslint baseline gate (.eslint-baseline.json, 2026-05-14) is unaware
of two lint errors introduced into main by later commits, so any new
push triggers them as "new":
- src/contexts/AuthContext.test.tsx:38 — @typescript-eslint/
consistent-type-imports flagged \`typeof import('@/services/authService')\`
inside a vi.mock importOriginal call. Hoisted the module type as a
type-only \`import type * as AuthServiceModule\` and used
\`typeof AuthServiceModule\`.
- src/tests/AdminLayout.test.tsx:58 — @typescript-eslint/no-explicit-any
flagged \`cb?: any\` inside a then() supabase-client mock. Replaced
with the concrete callback signature \`(value: { data: never[]; error: null }) => void\`.
Neither file was touched semantically; both were blocking pre-push only
because the baseline predates the upstream churn.
https://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
ccac70a to
df01f4c
Compare
Resumo
Faxina cirúrgica de débito técnico, rebaseada em
mainatual (substitui PR #53 que fechou por base stale). Apenas mudanças low-risk de alta confiança — sem mexer emsupabase/migrations,supabase/functions, ou em lógica de negócio.O que muda (9 commits)
AUDITORIA_REDEPLOY_PROMO_GIFTS_2026-05-13_15-32 (1).md(duplicata stale com sufixo " (1)" de download) esrc/test/setup.ts(não-referenciado; vitest usatests/setup.ts)audit/db-frontend-coverage.jsoneaudit/internal-schema.tsv(gitignore já dizia "não versionar"). Mantém oANALISE_BACKEND_SENIOR_2026-05-22.mdnode scripts/generate-health.mjs &&debuild:dev— script nunca existiu,npm run build:devfalhava na horatests/e2e/(40 arquivos + artifacts) — vitest excluía, playwright olhavae2e/, ninguém rodavascripts/generate-theme-report.ts(duplicata da.mjsque CI usa) escripts/test-external-db.ts(subset deverify-external.ts)src/hooks/stock/index.ts(só comentário, zero exports, zero importers)src/lib/kit-og-image.ts(zero imports estáticos OU dinâmicos verificados emsrc/,tests/,e2e/,supabase/)src/utils/kitPdfGenerator.ts(zero imports verificados)AuthContext.test.tsxeAdminLayout.test.tsxque estavam fora do.eslint-baseline.jsone bloqueavam pre-pushResultado
package.json+ 3 reformulações de mocks de teste)main@5684faf(sync atual em 2026-05-22)Nenhuma regressão de lint detectada(+ drift positivo de 1 erro eliminado)Lição da iteração anterior
PR #53 quebrou ao deletar
src/lib/fetch-print-areas.ts— meu grep estático perdeu 4 importações dinâmicas (await import('@/lib/fetch-print-areas')) em hooks de simulação. Desta vez verifiquei com grep amplo (fetch-print-areas|generateKitOgImage|kitPdfGenerator) emsrc/,tests/,e2e/,supabase/. Ofetch-print-areas.tscontinua intacto neste PR — apenaskit-og-imageekitPdfGenerator(que de fato têm zero referências) foram removidos.Test plan
main— sabemos quee2ee baseline TS gates falham em main também por débito pré-existente)npm run build:devdeve completar sem erro de "module not found"grep -rn "generate-health" .retorna 0git ls-files tests/e2e/retorna 0git ls-files audit/db-frontend-coverage.json audit/internal-schema.tsvretorna 0npx vitest run --testNamePattern="zzznever"apenas coleção) — confirma que nenhum import quebrouhttps://claude.ai/code/session_01NMu9Cm7yXR5agyBFxvLgP4
Generated by Claude Code
Summary by cubic
Removes 66 dead files (~19.7k LOC), unblocks
npm run build:dev, and fixes two lint drifts. No business logic or Supabase code touched.Bug Fixes
scripts/generate-health.mjsfrombuild:devand removed its.gitignoreentry to fix build failures.ESLinterrors insrc/contexts/AuthContext.test.tsxandsrc/tests/AdminLayout.test.tsxto pass the pre-push gate.Refactors
src/lib/kit-og-image.ts,src/utils/kitPdfGenerator.ts,src/hooks/stock/index.ts,src/test/setup.ts, and a duplicate audit.md.tests/e2e/tree and committed artifacts; pruned the now-unneededtests/e2e/**exclude fromvitest.config.ts(no@playwright/testpicked up byvitest).scripts/generate-theme-report.tsandscripts/test-external-db.ts.audit/db-frontend-coverage.jsonandaudit/internal-schema.tsvto.gitignoreand removed them from the repo.Written for commit df01f4c. Summary will update on new commits. Review in cubic