Repository navigation
fix(ci): gerar prisma client antes do typecheck - #27
Open
renanlocatizfernandes wants to merge 2 commits into
Open
renanlocatizfernandes wants to merge 2 commits into
renanlocatizfernandes wants to merge 2 commits into
Conversation
O tsc --noEmit da apps/api falhava na CI (TS7006 em server.ts:136) porque o client do Prisma nunca era gerado no pipeline — localmente existia só porque alguém rodou prisma db push. Com o postinstall, o npm ci da CI gera o client antes do typecheck.
Com o prisma client agora gerado na CI, o pipeline avançou até o step 'Start api + web' e expôs um segundo problema latente: o db:push rodava sem DATABASE_URL (P1012), pois a variável só era definida inline para o tsx do servidor.
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.
Problema
CI falhando desde 31/08 em todos os pushes:
apps/api/src/server.ts(136,21): error TS7006: Parameter 's' implicitly has an 'any' type.Causa raiz
O job de typecheck roda
tsc --noEmitsem o client do Prisma gerado. Não háprisma generateempostinstallnem no workflow — o client só existia na máquina de quem rodouprisma db pushlocalmente. Sem os tipos do@prisma/client, o retorno deprisma.save.findManyviraanye o parâmetrosdo.mapdispara TS7006.Correção
Adiciona
"postinstall": "prisma generate"emapps/api/package.json. Como o repo usa workspaces, onpm cida CI executa o postinstall do workspace e o client passa a existir antes do typecheck.Validação local
npm ci→ client gerado emnode_modules/.prisma/clientnpx tsc --noEmit -p apps/api/tsconfig.jsonOK (o passo que falhava)npx tsc --noEmit -p packages/engine/tsconfig.jsonOKnpx tsc --noEmit -p apps/web/tsconfig.jsonOKnpm testOK