Skip to content

Commit bc2816b

Browse files
authored
Merge pull request #626 from brazilian-utils/hyan/migration-guide
docs: move the v1 to v2 migration guide into the guides
2 parents 7a217e0 + 9bc5981 commit bc2816b

5 files changed

Lines changed: 7 additions & 5 deletions

File tree

‎docs/_sidebar.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
* [Address from a CEP](guides/address-form.md)
66
* [State and city](guides/state-city.md)
77
* [Schema libraries](guides/schema.md)
8-
* [Migration v1 to v2](migration-v1-to-v2.md)
8+
* [Migration v1 to v2](guides/migration-v1-to-v2.md)
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: "Migration Guide: v1 to v2"
33
description: "How to move a project from Brazilian Utils v1.x to v2: the renamed exports, the deprecated aliases that still work and a checklist to follow."
44
keywords: ["migration", "v1", "v2", "deprecated", "renamed exports", "upgrade"]
5+
order: 1
56
---
67

78
This guide covers moving a project from Brazilian Utils v1.x to v2.
@@ -22,12 +23,12 @@ Four v1 helpers were internal and have no alias. Replace them before upgrading:
2223
## What changed
2324

2425
- **Names are camelCase.** See [Renamed functions](#renamed-functions).
25-
- **Tree-shaking works down to the function**, and every util is also its own subpath (`@brazilian-utils/brazilian-utils/is-valid-cpf`), so the heavy ones can be lazy-loaded. See [Bundle size](getting-started.md#bundle-size).
26+
- **Tree-shaking works down to the function**, and every util is also its own subpath (`@brazilian-utils/brazilian-utils/is-valid-cpf`), so the heavy ones can be lazy-loaded. See [Bundle size](../getting-started.md#bundle-size).
2627
- **Alphanumeric CNPJ.** `isValidCnpj` and `generateCnpj` accept the new alphanumeric format with `{ version: 2 }`. Numeric (version 1) stays the default. See [`generateCnpj` and the version](#generatecnpj-and-the-version).
2728
- **`getAddressInfoByCep`** accepts a `providers` option, pads a numeric CEP, and throws typed errors: `GetAddressInfoByCepValidationError`, `GetAddressInfoByCepNotFoundError` and `GetAddressInfoByCepServiceError`. Calls without options work as in v1.
2829
- **`getCities`** returns the list sorted alphabetically. Since 2.4.0 it is deprecated: `getMunicipalities('SP')` returns the same municipalities with their IBGE codes, and `getMunicipalityByCode('3550308')` looks one up offline.
2930
- **`isValidIe`** takes one object since 2.4.0, `isValidIe({ value, stateCode })`. The positional form is deprecated.
30-
- **Many new utilities** since v2: holidays and business days, Pix, NF-e keys, boleto parsing, phone formatting, bank accounts and lookups, classification codes (CBO, CNAE, NCM, CFOP), municipalities offline, numbers in words and more. They are all in the [utilities reference](utilities.md).
31+
- **Many new utilities** since v2: holidays and business days, Pix, NF-e keys, boleto parsing, phone formatting, bank accounts and lookups, classification codes (CBO, CNAE, NCM, CFOP), municipalities offline, numbers in words and more. They are all in the [utilities reference](../utilities.md).
3132
- **Tooling** moved to Vite+ and Vitest, with browser tests in CI. This only matters if you contribute; see [CONTRIBUTING.md](https://github.com/brazilian-utils/javascript/blob/main/CONTRIBUTING.md).
3233

3334
## Renamed functions

‎docs/index.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
<p>
9999
This site renders its Markdown in the browser and needs JavaScript. The same pages are available as
100100
plain Markdown: <a href="/getting-started.md">getting started</a>, <a href="/utilities.md">utilities</a>,
101-
<a href="/migration-v1-to-v2.md">migration from v1 to v2</a> and the
101+
<a href="/guides/migration-v1-to-v2.md">migration from v1 to v2</a> and the
102102
<a href="/pt-br/getting-started.md">Portuguese version</a>, or in one file at <a href="/llms-full.txt">llms-full.txt</a>.
103103
</p>
104104
</noscript>

‎docs/pt-br/_sidebar.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
* [Endereço pelo CEP](pt-br/guides/address-form.md)
66
* [Estado e cidade](pt-br/guides/state-city.md)
77
* [Bibliotecas de schema](pt-br/guides/schema.md)
8-
* [Migração v1 para v2](pt-br/migration-v1-to-v2.md)
8+
* [Migração v1 para v2](pt-br/guides/migration-v1-to-v2.md)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
title: "Guia de migração: v1 para v2"
33
description: "Como migrar um projeto do Brazilian Utils v1.x para a v2: os exports renomeados, os aliases descontinuados que ainda funcionam e um checklist para seguir."
44
keywords: ["migração", "v1", "v2", "descontinuado", "exports renomeados", "atualização"]
5+
order: 1
56
---
67

78
Este guia mostra como migrar um projeto do Brazilian Utils v1.x para a v2.

0 commit comments

Comments
 (0)