Skip to content

chore(faxina): rebased cleanup of dead files + lint drift (replaces #53)#92

Closed
adm01-debug wants to merge 9 commits into
mainfrom
claude/faxina-rebased-2026-05-22
Closed

chore(faxina): rebased cleanup of dead files + lint drift (replaces #53)#92
adm01-debug wants to merge 9 commits into
mainfrom
claude/faxina-rebased-2026-05-22

Conversation

@adm01-debug
Copy link
Copy Markdown
Owner

@adm01-debug adm01-debug commented May 22, 2026

Resumo

Faxina cirúrgica de débito técnico, rebaseada em main atual (substitui PR #53 que fechou por base stale). Apenas mudanças low-risk de alta confiança — sem mexer em supabase/migrations, supabase/functions, ou em lógica de negócio.

O que muda (9 commits)

# Categoria O quê
1 Arquivos órfãos Apaga AUDITORIA_REDEPLOY_PROMO_GIFTS_2026-05-13_15-32 (1).md (duplicata stale com sufixo " (1)" de download) e src/test/setup.ts (não-referenciado; vitest usa tests/setup.ts)
2 gitignore Untrack audit/db-frontend-coverage.json e audit/internal-schema.tsv (gitignore já dizia "não versionar"). Mantém o ANALISE_BACKEND_SENIOR_2026-05-22.md
3 Build quebrado Remove node scripts/generate-health.mjs && de build:dev — script nunca existiu, npm run build:dev falhava na hora
4 tests/e2e órfão Apaga tests/e2e/ (40 arquivos + artifacts) — vitest excluía, playwright olhava e2e/, ninguém rodava
5 Scripts superseded Remove scripts/generate-theme-report.ts (duplicata da .mjs que CI usa) e scripts/test-external-db.ts (subset de verify-external.ts)
6 Barrel vazio Remove src/hooks/stock/index.ts (só comentário, zero exports, zero importers)
7 Módulo órfão Remove src/lib/kit-og-image.ts (zero imports estáticos OU dinâmicos verificados em src/, tests/, e2e/, supabase/)
8 Utilitário órfão Remove src/utils/kitPdfGenerator.ts (zero imports verificados)
9 Lint drift Conserta 2 lint hits pré-existentes em AuthContext.test.tsx e AdminLayout.test.tsx que estavam fora do .eslint-baseline.json e bloqueavam pre-push

Resultado

  • 66 arquivos, ~19.7k linhas removidas, 4 inserções (1 fix de package.json + 3 reformulações de mocks de teste)
  • Branch baseada em main@5684faf (sync atual em 2026-05-22)
  • ESLint baseline gate: ✅ 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) em src/, tests/, e2e/, supabase/. O fetch-print-areas.ts continua intacto neste PR — apenas kit-og-image e kitPdfGenerator (que de fato têm zero referências) foram removidos.

Test plan

  • CI verde (ou pelo menos paridade com main — sabemos que e2e e baseline TS gates falham em main também por débito pré-existente)
  • npm run build:dev deve completar sem erro de "module not found"
  • grep -rn "generate-health" . retorna 0
  • git ls-files tests/e2e/ retorna 0
  • git ls-files audit/db-frontend-coverage.json audit/internal-schema.tsv retorna 0
  • Smoke vitest local (npx vitest run --testNamePattern="zzznever" apenas coleção) — confirma que nenhum import quebrou

https://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

    • Dropped missing scripts/generate-health.mjs from build:dev and removed its .gitignore entry to fix build failures.
    • Fixed ESLint errors in src/contexts/AuthContext.test.tsx and src/tests/AdminLayout.test.tsx to pass the pre-push gate.
  • Refactors

    • Deleted orphan modules and docs: src/lib/kit-og-image.ts, src/utils/kitPdfGenerator.ts, src/hooks/stock/index.ts, src/test/setup.ts, and a duplicate audit .md.
    • Removed unused tests/e2e/ tree and committed artifacts; pruned the now-unneeded tests/e2e/** exclude from vitest.config.ts (no @playwright/test picked up by vitest).
    • Dropped superseded scripts: scripts/generate-theme-report.ts and scripts/test-external-db.ts.
    • Untracked local audit outputs; added audit/db-frontend-coverage.json and audit/internal-schema.tsv to .gitignore and removed them from the repo.

Written for commit df01f4c. Summary will update on new commits. Review in cubic

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

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

Project Deployment Actions Updated (UTC)
we-dream-big Ready Ready Preview, Comment May 22, 2026 9:55am

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: b969ed4c-e03a-4fe3-85be-2191e13f30e4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/faxina-rebased-2026-05-22

Comment @coderabbitai help to get the list of available commands and usage tips.

@supabase
Copy link
Copy Markdown

supabase Bot commented May 22, 2026

This pull request has been ignored for the connected project doufsxqlfjyuvxuezpln because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

claude added 9 commits May 22, 2026 09:53
- 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
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.

2 participants