3 - Add BrDanfe::Helper.address ahead of NFC-e renderer removal - #280
Open
pnzrfst wants to merge 1 commit into
Open
3 - Add BrDanfe::Helper.address ahead of NFC-e renderer removal#280pnzrfst wants to merge 1 commit into
pnzrfst wants to merge 1 commit into
Conversation
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>
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
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::HeadereThermoPrinter::Print::Nfce::FiscalInfo(facil123) ainda chamamBrDanfe::DanfeLib::NfceLib::Helper.addressdiretamente — é 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 à deNfceLib::Helper.address, copiada byte a byte) sem remover nada.NfceLib::Helper.addresscontinua existindo e funcionando exatamente como antes.lib/br_danfe/helper.rb— novoBrDanfe::Helper.addressspec/br_danfe/helper_spec.rb— spec correspondentelib/br_danfe/version.rb— bump2.1.0→2.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.Depois deste release
Facil123 troca os dois call sites (
header.rb,fiscal_info.rb) paraBrDanfe::Helper.addresse faz bump do gem para2.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 (incluindoNfceLib::Helper, já redundante nesse ponto).Testes
bundle exec rspec: 292 examples, 0 failuresbundle exec rubocop: sem ofensas🤖 Generated with Claude Code