Skip to content

3 - Add BrDanfe::Helper.address ahead of NFC-e renderer removal - #280

Open
pnzrfst wants to merge 1 commit into
masterfrom
remove-nfce-pdf-renderer-from-br-danfe
Open

3 - Add BrDanfe::Helper.address ahead of NFC-e renderer removal#280
pnzrfst wants to merge 1 commit into
masterfrom
remove-nfce-pdf-renderer-from-br-danfe

Conversation

@pnzrfst

@pnzrfst pnzrfst commented Aug 10, 2026

Copy link
Copy Markdown

Contexto

Issue #279 pede a remoção do renderer Prawn de NFC-e (DanfeLib::Nfce + nfce_lib/), que ficou sem consumidor depois da unificação de NFC-e no ThermoPrinter (facil123 #23233, PRs #23279/#23319).

Só que ThermoPrinter::Print::Nfce::Header e ThermoPrinter::Print::Nfce::FiscalInfo (facil123) ainda chamam BrDanfe::DanfeLib::NfceLib::Helper.address diretamente — é o único ponto do universo NFC-e que sobrevive. Remover tudo de uma vez exigiria que o bump de versão no facil123 e a troca desses dois call sites acontecessem no mesmo instante que o release daqui, o que é frágil entre dois repositórios/PRs.

O que este PR faz

Aplica o expand de um expand/contract: adiciona BrDanfe::Helper.address (implementação idêntica à de NfceLib::Helper.address, copiada byte a byte) sem remover nada. NfceLib::Helper.address continua existindo e funcionando exatamente como antes.

  • lib/br_danfe/helper.rb — novo BrDanfe::Helper.address
  • spec/br_danfe/helper_spec.rb — spec correspondente
  • lib/br_danfe/version.rb — bump 2.1.02.2.0 (minor, não-breaking — só adiciona API pública)

O que NÃO muda

  • DanfeLib::Nfce, nfce_lib/*, Helper.nfe?, specs e fixtures de NFC-e — tudo intacto.
  • Nenhum call site do facil123 precisa mudar para este PR ser mergeado.

Depois deste release

Facil123 troca os dois call sites (header.rb, fiscal_info.rb) para BrDanfe::Helper.address e faz bump do gem para 2.2.0, sem urgência. Só depois disso — e depois de #23279/#23319 mergeados — um PR de contract remove o renderer Prawn de NFC-e inteiro (incluindo NfceLib::Helper, já redundante nesse ponto).

Testes

  • bundle exec rspec: 292 examples, 0 failures
  • bundle exec rubocop: sem ofensas

🤖 Generated with Claude Code

facil123's ThermoPrinter still calls BrDanfe::DanfeLib::NfceLib::Helper.address
directly, so the NFC-e Prawn renderer in this gem can't be deleted yet without
breaking that caller. This adds the same method as BrDanfe::Helper.address
(non-breaking, additive) so facil123 can migrate its two call sites on its own
schedule. Once that migration lands, a follow-up PR removes the now-unused
NFC-e renderer entirely, including the old NfceLib::Helper.

Ref #279

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pnzrfst pnzrfst linked an issue Aug 10, 2026 that may be closed by this pull request
@pnzrfst pnzrfst changed the title Add BrDanfe::Helper.address ahead of NFC-e renderer removal 4 - Add BrDanfe::Helper.address ahead of NFC-e renderer removal Aug 12, 2026
@pnzrfst pnzrfst changed the title 4 - Add BrDanfe::Helper.address ahead of NFC-e renderer removal 3 - Add BrDanfe::Helper.address ahead of NFC-e renderer removal Aug 12, 2026
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.

Remover código de PDF de NFC-e da gem (sem consumidor após #23233)

1 participant