From 3a626cb4b1c2ca1e4bdcc8e265263e52571bd045 Mon Sep 17 00:00:00 2001 From: Hyan Mandian <5044101+hyanmandian@users.noreply.github.com> Date: Fri, 9 Oct 2026 00:35:19 -0300 Subject: [PATCH] docs: move the v1 to v2 migration guide into the guides The docs site lists the files of docs/guides/ as the library's guides, so the migration guide shows up there next to the others. `order: 1` puts it after them. Links to it (sidebars, the noscript fallback) point at the new path. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RaUEDkvXY8rVWTJG2GKfhu --- docs/_sidebar.md | 2 +- docs/{ => guides}/migration-v1-to-v2.md | 5 +++-- docs/index.html | 2 +- docs/pt-br/_sidebar.md | 2 +- docs/pt-br/{ => guides}/migration-v1-to-v2.md | 1 + 5 files changed, 7 insertions(+), 5 deletions(-) rename docs/{ => guides}/migration-v1-to-v2.md (98%) rename docs/pt-br/{ => guides}/migration-v1-to-v2.md (99%) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index c3411f02e..0b8026ed2 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -5,4 +5,4 @@ * [Address from a CEP](guides/address-form.md) * [State and city](guides/state-city.md) * [Schema libraries](guides/schema.md) -* [Migration v1 to v2](migration-v1-to-v2.md) +* [Migration v1 to v2](guides/migration-v1-to-v2.md) diff --git a/docs/migration-v1-to-v2.md b/docs/guides/migration-v1-to-v2.md similarity index 98% rename from docs/migration-v1-to-v2.md rename to docs/guides/migration-v1-to-v2.md index ac82ab166..b6f47d2a8 100644 --- a/docs/migration-v1-to-v2.md +++ b/docs/guides/migration-v1-to-v2.md @@ -2,6 +2,7 @@ title: "Migration Guide: v1 to v2" 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." keywords: ["migration", "v1", "v2", "deprecated", "renamed exports", "upgrade"] +order: 1 --- 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: ## What changed - **Names are camelCase.** See [Renamed functions](#renamed-functions). -- **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). +- **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). - **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). - **`getAddressInfoByCep`** accepts a `providers` option, pads a numeric CEP, and throws typed errors: `GetAddressInfoByCepValidationError`, `GetAddressInfoByCepNotFoundError` and `GetAddressInfoByCepServiceError`. Calls without options work as in v1. - **`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. - **`isValidIe`** takes one object since 2.4.0, `isValidIe({ value, stateCode })`. The positional form is deprecated. -- **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). +- **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). - **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). ## Renamed functions diff --git a/docs/index.html b/docs/index.html index 97faf885d..696687f19 100644 --- a/docs/index.html +++ b/docs/index.html @@ -98,7 +98,7 @@

This site renders its Markdown in the browser and needs JavaScript. The same pages are available as plain Markdown: getting started, utilities, - migration from v1 to v2 and the + migration from v1 to v2 and the Portuguese version, or in one file at llms-full.txt.

diff --git a/docs/pt-br/_sidebar.md b/docs/pt-br/_sidebar.md index 8e22ee7cd..190a96614 100644 --- a/docs/pt-br/_sidebar.md +++ b/docs/pt-br/_sidebar.md @@ -5,4 +5,4 @@ * [Endereço pelo CEP](pt-br/guides/address-form.md) * [Estado e cidade](pt-br/guides/state-city.md) * [Bibliotecas de schema](pt-br/guides/schema.md) -* [Migração v1 para v2](pt-br/migration-v1-to-v2.md) +* [Migração v1 para v2](pt-br/guides/migration-v1-to-v2.md) diff --git a/docs/pt-br/migration-v1-to-v2.md b/docs/pt-br/guides/migration-v1-to-v2.md similarity index 99% rename from docs/pt-br/migration-v1-to-v2.md rename to docs/pt-br/guides/migration-v1-to-v2.md index 558d958e5..15822f5b7 100644 --- a/docs/pt-br/migration-v1-to-v2.md +++ b/docs/pt-br/guides/migration-v1-to-v2.md @@ -2,6 +2,7 @@ title: "Guia de migração: v1 para v2" 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." keywords: ["migração", "v1", "v2", "descontinuado", "exports renomeados", "atualização"] +order: 1 --- Este guia mostra como migrar um projeto do Brazilian Utils v1.x para a v2.