Remove a biblioteca cross-fetch
e muda a set-cookie-parser
para devDependencies
#1715
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.
Com o PR #1708, fiquei curioso se já poderíamos remover completamente a
cross-fetch
e usar apenas ofetch
nativo. Na busca por código que usava o padrão dessa biblioteca, que só deveria estar presente nos testes, acabei descobrindo a funçãoparseSetCookies
no modelauthentication
.Mudanças realizadas
Como, de fato, a função só era chamada nos testes, movi ela para
/tests/orchestrator
, e isso abriu a possibilidade de tornar aset-cookie-parser
uma dependência apenas de desenvolvimento. E isso foi feito no commit 2941d89.Obs.: Hoje o
/tests/orchestrator
contém funções que talvez ficassem melhor em uma/tests/utils
, mas, para não iniciar essa refatoração nesse PR, optei por deixar aparseSetCookies()
também noorchestrator
.Após isso, o commit 4bb2ba2 remove completamente a
cross-fetch
e faz as adequações necessárias.Obs. 2: Com o
fetch
nativo, apenas o métodoPATCH
não funcionou com letras minúsculas (method: 'patch'
), mas como não havia padrão nos testes, resolvi alterar para maiúsculo também onde tinhaget
oupost
.Tipo de mudança
Checklist: