Skip to content

[2.4.0 stack 6/7] Public API: root exports, types, 100% coverage and type-aware lint gates - #512

Open
hyanmandian wants to merge 2 commits into
stack/05-new-utilsfrom
stack/06-public-api
Open

[2.4.0 stack 6/7] Public API: root exports, types, 100% coverage and type-aware lint gates#512
hyanmandian wants to merge 2 commits into
stack/05-new-utilsfrom
stack/06-public-api

Conversation

@hyanmandian

@hyanmandian hyanmandian commented Sep 9, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Part 6 of 7 of the 2.4.0 release stack (main <- stack/01-tooling <- ... <- stack/07-docs). The package-root exports (src/index.ts, 124 exports plus 10 deprecated aliases kept for compatibility), the public type re-exports and the Bun/Deno test runtime shim refresh. Closes with the commit that turns on type-aware lint with type checking and the 100% coverage thresholds, now that the whole tree meets them.

Commits in this part (2)

  • ab66bf8 feat: export public types from the package root
  • c6d1290 ci(test): enforce 100% coverage and type-aware lint

How to review and merge

Stack

@hyanmandian
hyanmandian added this pull request to stack #514 September 9, 2026 17:56
@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 11c6c820-24e4-4b44-aee4-a90f9ff66a18

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 48c7f41a-7411-4110-ae0b-6582a36a3e37

📥 Commits

Reviewing files that changed from the base of the PR and between 3db81d2 and 53c80ee.

📒 Files selected for processing (3)
  • src/index.test.ts
  • src/index.ts
  • vite.config.ts

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The barrel export now exposes additional helpers and public types. API tests verify the complete runtime and type surface, duplicate-free exports, and non-throwing behavior for invalid inputs. Lint type checking and 100% coverage thresholds are enabled.

Changes

Public API expansion

Layer / File(s) Summary
Expanded barrel exports
src/index.ts
The package exports new business-day, conversion, formatting, generation, lookup, validation, and parsing helpers. It also re-exports their public types and options. Deprecated aliases now use single-line JSDoc comments.
Public API contract validation
src/index.test.ts, vite.config.ts
Tests compare the exact runtime export list, check documented type exports and duplicates, and call non-network functions with invalid inputs. Lint type checking and 100% coverage thresholds are enabled.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 53c80

The package-root API is expanded with matching runtime and type-surface checks, while linting and coverage validation are strengthened. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: package-root exports and public types, 100% coverage enforcement, and type-aware linting gates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch stack/06-public-api

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Tree-shaking report

Fails when a pre-existing export grows more than 20% and more than 256 B, or when importing every export that already existed on the base grows more than 5%. New exports never count as a regression.

Pre-existing exports: 202519 B to 202769 B (+0.1%, gzip 67071 B). Full import on head: 628408 B (gzip 162544 B).

name base head delta bytes delta % gzip head
formatCNPJ 521 671 +150 +28.8% 447
formatCnpj 521 671 +150 +28.8% 447
isValidIE 6189 6337 +148 +2.4% 2101
isValidIe 6189 6337 +148 +2.4% 2101
formatBoleto 544 690 +146 +26.8% 435
formatCEP 374 520 +146 +39.0% 374
formatCPF 417 563 +146 +35.0% 400
formatCep 374 520 +146 +39.0% 374
formatCnh 377 523 +146 +38.7% 374
formatCpf 417 563 +146 +35.0% 400
formatLegalNature 355 501 +146 +41.1% 365
formatPhone 1833 1979 +146 +8.0% 1020
formatPis 379 525 +146 +38.5% 377
formatProcessoJuridico 390 536 +146 +37.4% 379
formatVoterId 435 581 +146 +33.6% 398
generatePhone 681 827 +146 +21.4% 514
getAddressInfoByCep 3229 3375 +146 +4.5% 1413
getCepInfoByAddress 3791 3937 +146 +3.9% 1445
isValidBankAccount 5996 6142 +146 +2.4% 2286
parseBoleto 157 303 +146 +93.0% 255
parseCep 109 255 +146 +133.9% 222
parseCnh 110 256 +146 +132.7% 223
parseCnpj 214 360 +146 +68.2% 272
parseCpf 110 256 +146 +132.7% 223
parseLegalNature 109 255 +146 +133.9% 222
parsePhone 281 427 +146 +52.0% 321
parsePis 110 256 +146 +132.7% 223
parseProcessoJuridico 110 256 +146 +132.7% 223
parseVoterId 204 350 +146 +71.6% 281
GetAddressInfoByCepError 112 254 +142 +126.8% 229
GetAddressInfoByCepNotFoundError 205 347 +142 +69.3% 247
GetAddressInfoByCepServiceError 204 346 +142 +69.6% 244
GetAddressInfoByCepValidationError 203 345 +142 +70.0% 249
GetCepInfoByAddressError 112 254 +142 +126.8% 229
GetCepInfoByAddressNotFoundError 205 347 +142 +69.3% 247
GetCepInfoByAddressValidationError 203 345 +142 +70.0% 249
capitalize 622 764 +142 +22.8% 491
formatCurrency 1005 1147 +142 +14.1% 692
formatLicensePlate 628 770 +142 +22.6% 456
formatPassport 142 284 +142 +100.0% 243
generateBoleto 1219 1361 +142 +11.6% 759
generateCNPJ 1021 1163 +142 +13.9% 659
generateCPF 807 949 +142 +17.6% 610
generateCep 130 272 +142 +109.2% 236
generateCnh 567 709 +142 +25.0% 441
generateCnpj 1021 1163 +142 +13.9% 659
generateCpf 807 949 +142 +17.6% 610
generateLegalNature 5030 5172 +142 +2.8% 1706
generateLicensePlate 231 373 +142 +61.5% 302
generatePassport 226 368 +142 +62.8% 287
generatePis 346 488 +142 +41.0% 364
generateProcessoJuridico 528 670 +142 +26.9% 453
generateVoterId 830 972 +142 +17.1% 630
getBoletoInfo 2338 2480 +142 +6.1% 1297
getCities 157095 157237 +142 +0.1% 50570
getLegalNatures 5055 5197 +142 +2.8% 1723
getMunicipality 157629 157771 +142 +0.1% 50944
getStates 2203 2345 +142 +6.4% 639
isValidBoleto 1600 1742 +142 +8.9% 948
isValidCEP 130 272 +142 +109.2% 237
isValidCNPJ 1191 1333 +142 +11.9% 681
isValidCPF 617 759 +142 +23.0% 441
isValidCep 130 272 +142 +109.2% 237
isValidCnh 619 761 +142 +22.9% 465
isValidCnpj 1191 1333 +142 +11.9% 681
isValidCpf 617 759 +142 +23.0% 441
isValidEmail 157 299 +142 +90.4% 243
isValidLandlinePhone 686 828 +142 +20.7% 548
isValidLegalNature 5077 5219 +142 +2.8% 1744
isValidMobilePhone 736 878 +142 +19.3% 578
isValidPIS 677 819 +142 +21.0% 513
isValidPassport 165 307 +142 +86.1% 259
isValidPis 677 819 +142 +21.0% 513
isValidProcessoJuridico 404 546 +142 +35.1% 387
isValidRenavam 396 538 +142 +35.9% 391
isValidVoterId 797 939 +142 +17.8% 545
parseCurrency 653 795 +142 +21.7% 516
parsePassport 142 284 +142 +100.0% 245
getFormatLicensePlate 327 465 +138 +42.2% 334
getHolidays 4504 4642 +138 +3.1% 1960
isHoliday 4825 4963 +138 +2.9% 2076
isValidLicensePlate 348 486 +138 +39.7% 344
parseLicensePlate 142 280 +138 +97.2% 242
isValidPhone 1788 1922 +134 +7.5% 935

New exports

  • addBusinessDays: 5539 B (gzip 2304 B)
  • convertCurrencyToWords: 2247 B (gzip 1176 B)
  • convertDateToWords: 2717 B (gzip 1397 B)
  • convertLicensePlateToMercosul: 655 B (gzip 429 B)
  • convertNumberToWords: 1893 B (gzip 985 B)
  • differenceInBusinessDays: 5585 B (gzip 2317 B)
  • formatCaepf: 545 B (gzip 391 B)
  • formatCei: 542 B (gzip 389 B)
  • formatCertidao: 559 B (gzip 384 B)
  • formatCnae: 520 B (gzip 377 B)
  • formatCno: 542 B (gzip 389 B)
  • formatCns: 529 B (gzip 376 B)
  • formatIban: 374 B (gzip 302 B)
  • formatNcm: 514 B (gzip 372 B)
  • formatNfeKey: 554 B (gzip 373 B)
  • generatePixPayload: 6012 B (gzip 2510 B)
  • getAreaCodeInfo: 3140 B (gzip 1016 B)
  • getAreaCodesByState: 892 B (gzip 519 B)
  • getBankByCode: 28453 B (gzip 7628 B)
  • getBankByIspb: 28457 B (gzip 7629 B)
  • getBanks: 28234 B (gzip 7466 B)
  • getCbo: 112310 B (gzip 28291 B)
  • getCfop: 56242 B (gzip 5586 B)
  • getCnae: 95585 B (gzip 21345 B)
  • getLegalNature: 5277 B (gzip 1776 B)
  • getMunicipalities: 159483 B (gzip 51084 B)
  • getMunicipalityByCode: 159557 B (gzip 51134 B)
  • getStateByIbgeCode: 2502 B (gzip 729 B)
  • getStateCodeByName: 2574 B (gzip 767 B)
  • getStateNameByCode: 2461 B (gzip 707 B)
  • getTimezoneByState: 879 B (gzip 438 B)
  • isBusinessDay: 5008 B (gzip 2125 B)
  • isValidCaepf: 857 B (gzip 534 B)
  • isValidCbo: 112238 B (gzip 28228 B)
  • isValidCei: 795 B (gzip 522 B)
  • isValidCertidao: 889 B (gzip 558 B)
  • isValidCfop: 56209 B (gzip 5557 B)
  • isValidCnae: 95206 B (gzip 20974 B)
  • isValidCno: 799 B (gzip 521 B)
  • isValidCns: 754 B (gzip 494 B)
  • isValidCreditCard: 514 B (gzip 366 B)
  • isValidCsosn: 354 B (gzip 280 B)
  • isValidCst: 904 B (gzip 522 B)
  • isValidIban: 541 B (gzip 411 B)
  • isValidNcm: 115986 B (gzip 24398 B)
  • isValidNfeKey: 1073 B (gzip 732 B)
  • isValidPixKey: 4504 B (gzip 1820 B)
  • isValidPixPayload: 1788 B (gzip 956 B)
  • isValidRegistroProfissional: 2905 B (gzip 935 B)
  • isValidServicePhone: 845 B (gzip 472 B)
  • isValidVin: 887 B (gzip 601 B)
  • parseCertidao: 1186 B (gzip 702 B)
  • parseIban: 780 B (gzip 538 B)
  • parseNfeKey: 1447 B (gzip 886 B)
  • parsePixKey: 4399 B (gzip 1789 B)
  • parsePixPayload: 1771 B (gzip 945 B)
  • removeAccents: 258 B (gzip 232 B)

@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a3a56a5) to head (c6d1290).

Additional details and impacted files
@@                   Coverage Diff                   @@
##           stack/05-new-utils      #512      +/-   ##
=======================================================
+ Coverage               98.74%   100.00%   +1.25%     
=======================================================
  Files                     151       151              
  Lines                    2154      2154              
  Branches                  658       658              
=======================================================
+ Hits                     2127      2154      +27     
+ Misses                      3         0       -3     
+ Partials                   24         0      -24     
Flag Coverage Δ
node 100.00% <ø> (+1.25%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hyanmandian hyanmandian changed the title [2.4.0 stack 6/7] Public API: root exports, types and runtime shims [2.4.0 stack 6/7] Public API: root exports, types, 100% coverage and type-aware lint gates Sep 9, 2026
Export State, StateCode, StateName, AddressInfo, CepProvider, BoletoInfo,
GetBoletoInfoOptions, GenerateBoletoOptions, GenerateLicensePlateFormat, Holiday,
HolidayType, PhoneMask, PhoneVersion, PhoneType, ParseCurrencyOptions,
ParseCnpjOptions, IsValidCnpjOptions and every new util'"'"'s public types.
Turn on oxlint's type-aware rules with type checking and require 100% statement,
branch, function and line coverage now that every source file meets both.
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.

1 participant