fix(build): restaura dist/main.js excluindo scripts/ do nest build - #163
Merged
Merged
Conversation
O script scripts/backfill-criador-id.ts na raiz do projeto entrou na compilacao do nest build e alterou o rootDir inferido pelo tsc de src/ para a raiz, movendo a saida para dist/src/main.js. Isso quebrou o deploy: o ms.dockerfile faz COPY dist ./ e o PM2 roda /var/www/main.js, que deixou de existir (Script not found: /var/www/main.js em homol). Excluir scripts/ do build devolve o rootDir para src/ e o main volta para dist/main.js. O backfill continua rodando via ts-node, nao precisa do dist. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Contexto
Em homol o PM2 passou a falhar ao subir o ms-simulado:
Causa raiz
O
ms.dockerfilefazCOPY dist ./para/var/wwwe o PM2 roda/var/www/main.js— ou seja, o build precisa gerardist/main.js.O commit
f3f81b2(PR #160) adicionouscripts/backfill-criador-id.tsna raiz do projeto. Como otsconfig.build.jsonnão excluíascripts/, esse arquivo entrou na compilação e mudou orootDirinferido pelo tsc desrc/para a raiz do projeto. A saída passou a serdist/src/main.js+dist/scripts/…, então após oCOPY dist ./o arquivo virou/var/www/src/main.jse/var/www/main.jsdeixou de existir.Começou a quebrar no deploy de homol após o merge do PR #160 (
5244377).Correção
Adiciona
scriptsaoexcludedotsconfig.build.json. OrootDirvolta a sersrc/e o build volta a gerardist/main.js. O backfill continua rodando viats-node scripts/backfill-criador-id.ts(não precisa ir para odist).Test plan
yarn buildgeradist/main.jsna raiz dodist/(verificado localmente)Script not found: /var/www/main.js🤖 Generated with Claude Code