fix(build): restore Vercel production build — validator + TS + ESLint + test regressions#565
fix(build): restore Vercel production build — validator + TS + ESLint + test regressions#565adm01-debug wants to merge 4 commits into
Conversation
…en pattern The script was written when client.ts used envMatchesCanonical but was never updated when main switched to the FORBIDDEN_REFS / envPointsToForbidden pattern. Update checks 2 and 3 to accept either enforcement pattern. https://claude.ai/code/session_0125oiydTY8BPgg4bbwY9otU
…le.info, no-explicit-any Fixes 25 new lint problems across 14 file:rule pairs introduced by feature commits on main (OptimizedImage, EnhancedProductCard, NoveltyBadge, BadgeVisibilityStore, SecurityAudit). No logic changes. https://claude.ai/code/session_01JjQ4rSnq71cTyYTVTExfjw
- ComparisonHighlights.tsx: restore missing useComparisonHighlight and highlightClasses exports (were gutted, still imported by CompareTableView) - Header.tsx: remove duplicate Tag import (TS2300) - CommemorativeDateFilter.tsx: remove compact prop from CommemorativeDateItem JSX (Omit<Props,"compact"> doesn't accept it) - useNovelties.ts: capture topSupplierId in const to bypass TS5.4 never-narrowing in let+forEach pattern (TS2339) - useBadgeVisibilityStore.ts: add Json import, fix profile.preferences spread with runtime object check + double-assert cast (TS2698→TS2322→fixed) TS gate: 62 atual = 62 baseline. ESLint: 64 atual < 107 baseline. https://claude.ai/code/session_01JjQ4rSnq71cTyYTVTExfjw
…t spy OptimizedImage.test.tsx asserts console.info is called when debug=true. The ESLint lint pass changed these to console.warn, breaking that test. The no-console rule is severity 'warn' (not error), so these calls only produce ESLint warnings — they do not count toward the error baseline. Reverted to console.info with eslint-disable-next-line suppressors.
|
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. |
…#565) - scripts/validate-supabase-config.mjs: accept FORBIDDEN_REFS + envPointsToForbidden pattern - src/components/compare/ComparisonHighlights.tsx: restore exports (TS2305 fix) - src/components/layout/Header.tsx: remove duplicate Tag import (TS2300) - src/components/filters/CommemorativeDateFilter.tsx: remove compact prop (TS2322) - src/hooks/products/useNovelties.ts: fix let narrowing TS 5.4 (TS2339) - src/stores/useBadgeVisibilityStore.ts: fix Json spread (TS2698) - src/utils/security-audit.ts: console.info → console.warn - src/components/ui/OptimizedImage.tsx: eslint-disable no-console + test fix - Various: remove unused imports (Sparkles, Clock, TrendingUp, UrgencyType, AlertTriangle) Closes PR #565
Problema
Desde que o PR #541 foi mergeado, o build de produção do Vercel está quebrado. O script
scripts/validate-supabase-config.mjstesta padrões antigos (envMatchesCanonical) que foram substituídos noclient.tsrefatorado (FORBIDDEN_REFS/envPointsToForbidden). O gate pré-build falha e impede o deploy.Correções incluídas
Commit 1 — Correção principal (restaura build Vercel)
scripts/validate-supabase-config.mjs: Atualiza as verificações 2 e 3 para aceitar tanto o padrão antigo quanto o novo:hasFallbackLogic: aceita.includes("doufsxqlfjyuvxuezpln")OUFORBIDDEN_REFSOUenvPointsToForbiddenhasCorrectAssignment: aceitaenvMatchesCanonical ? ...OUenvPointsToForbidden || !envUrl ? ...Commit 2 — Regressões ESLint
src/utils/security-audit.ts:console.info→console.warn(semântica correta para auditoria)src/stores/__tests__/useBadgeVisibilityStore.test.ts: tipo de resolve mock corrigidosrc/tests/ProductFetch.test.ts: supressão@typescript-eslint/no-explicit-anycorretaCommit 3 — Regressões TypeScript (8 erros TS)
ComparisonHighlights.tsx: Restaura exportsuseComparisonHighlightehighlightClasses(TS2305 — imports emCompareTableView.tsxfalhavam)Header.tsx: Remove import duplicado deTag(TS2300)CommemorativeDateFilter.tsx: Removecompact={compact}de componenteOmit<Props, 'compact'>(TS2322)useNovelties.ts: Corrige narrowing TS 5.4 em variávelletatribuída em callback (TS2339) viaconst sid = topSupplierId as stringuseBadgeVisibilityStore.ts: Corrige TS2698 (spread emJson) com narrowing de runtime + castas unknown as JsonCommit 4 — Regressão de teste
OptimizedImage.tsx: Reverteconsole.warn→console.infocom supressores// eslint-disable-next-line no-console. A regrano-consoleé'warn'(não conta como erro no baseline). A mudança paraconsole.warnquebrou o testeOptimizedImage > emits console.info only when debug is true.Validação (Node 20 — idêntico ao CI)
Generated by Claude Code
Summary by cubic
Restores the Vercel production build by updating the Supabase config validator to accept the new enforcement pattern, and fixes TypeScript/ESLint/test regressions so CI is green again.
scripts/validate-supabase-config.mjsto accept both the oldenvMatchesCanonicaland the newFORBIDDEN_REFS/envPointsToForbiddenpatterns, including the SUPABASE_URL assignment check.ComparisonHighlights.tsx, removed a duplicate import and prop mismatch, tightened narrowings inuseNovelties.ts, and fixed SupabaseJsonupdate payloads inuseBadgeVisibilityStore.ts.security-audit.ts, removed unused imports, and applied targetedno-explicit-anysuppressions in tests.OptimizedImagelogs toconsole.infowith inline suppressors to satisfy existing assertions.Written for commit dcd0656. Summary will update on new commits.