Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@legislato/legislato-conventions

joaofaveri1.3kMIT0.1.11TypeScript support: included

This package facilitates the configuration of commit conventions and changelog for Next.js and Express projects

conventional commits, changelog, husky, commitlint, commitizen, release-it, automation, git workflow, developer tools, npm package, git-cz, lint-staged

readme

Legislato Conventions

This NPM package automates the configuration of Conventional Commits and Changelogs for projects within Legislato, ensuring a consistent and efficient Git workflow across all repositories.

Purpose

The main purpose of this package is to streamline the setup of essential tools for commit and release management, such as Husky, Commitlint, Commitizen, and Release-it. With a single command, you can configure your Legislato projects to adhere to standardized commit conventions and automatically generate changelogs.

Installation

To use legislato-conventions, you have two options: using npx (recommended) or installing the package globally or locally.

npx allows you to execute the package without installing it directly into your project's node_modules. This is the recommended approach for most users.

  1. Open your terminal in the root directory of your project.
  2. Run the following command:

    npx @legislato/legislato-conventions

    npx will download the package (if not already cached) and execute it.

Installing the Package (Optional)

If you prefer to install the package, you can do so globally or locally.

Global Installation

Installing the package globally allows you to run it from any directory.

  1. Open your terminal.
  2. Run the following command:

    npm install -g @legislato/legislato-conventions
  3. After installation, you can run the package from any directory:

    legislato-conventions

Local Installation

Installing the package locally adds it to your project's node_modules and package.json.

  1. Open your terminal in the root directory of your project.
  2. Run the following command:

    npm install --save-dev @legislato/legislato-conventions
  3. After installation, you can run the package using npx or by adding a script to your package.json:

    "scripts": {
      "legislato-conventions": "legislato-conventions"
    }

    Then, you can run the package using:

    npm run legislato-conventions

[!TIP] Note: Using npx is generally recommended as it keeps your project's dependencies clean and ensures you are always using the latest version of the package.

Usage

After installation, the package will perform the following actions:

  1. Install the necessary dependencies (Husky, Commitlint, Commitizen, Release-it, etc.).
  2. Copy the configuration files to your project.
  3. Modify the package.json file to add the required scripts and configurations.

Next Steps

After configuration, follow these steps:

  1. Create a .env file in your project root.
  2. Add the following line to the .env file:

    GITHUB_TOKEN=your_github_personal_access_token

    (Replace your_github_personal_access_token with your actual GitHub personal access token).

  3. This will allow release-it to automate releases on GitHub.

Scripts Added to package.json

The package will add the following scripts to your package.json:

  • "prepare": "husky": Installs Husky to configure Git hooks.
  • "release": "npm run build && dotenv release-it -- --verbose": Automates the release process with release-it.
  • 'release:only-version': 'dotenv release-it -- --verbose --only-version': Automates the release process with release-it. This use a prompt only to determine the version, and automate the rest
  • "release:no-npm": "dotenv release-it -- --no-npm.publish": Automates the release process without publishing to NPM.
  • "release:changelog": "dotenv release-it -- --changelog": Print the changelog without releasing anything.
  • "release:version": "dotenv release-it -- --release-version": Print the next version without releasing anything.

Updating Release Scripts

The release scripts in your package.json are configured to run release-it by default. If you want to run lint, test, or build scripts before running release-it, you can update the scripts as needed.

For example, if you have lint, test, and build scripts in your package.json, you can update the release script as follows:

"scripts": {
  "prepare": "husky",
  "lint": "eslint . --ext .js,.ts",
  "test": "jest",
  "build": "tsc",
  "release": "npm run lint && npm run test && npm run build && dotenv release-it -- --verbose",
  "release:no-npm": "npm run lint && npm run test && dotenv release-it -- --no-npm.publish",
  "release:changelog": "npm run lint && npm run test && npm run build && dotenv release-it -- --changelog",
  "release:version": "npm run lint && npm run test && npm run build && dotenv release-it -- --release-version"
}

This will run the lint, test, and build scripts before running release-it. Adjust the scripts according to your project's needs.

Configuration Added to package.json

The package will add the following configuration to your package.json:

"config": {
  "commitizen": {
    "path": "./node_modules/git-cz"
  }
}

Roadmap

Here are the planned enhancements and future directions for the legislato-conventions package:

1. Unit Testing

  • Implement comprehensive unit tests to ensure the reliability and stability of the package.
  • Utilize Jest for testing to cover all functionalities, including edge cases and error handling.

2. Package Manager Support

  • Extend support to include other popular package managers such as Yarn and pnpm.
  • Modify installation scripts to detect and adapt to the user's preferred package manager.

3. ESLint Configuration

  • Integrate ESLint configuration to enforce coding standards and best practices.
  • Provide a default ESLint setup that aligns with Legislato's coding guidelines.

4. Interactive Configuration

  • Develop an interactive CLI mode to allow users to customize configurations during installation.
  • Enable users to select which tools to install and configure based on their project's needs.

5. Enhanced Documentation

  • Create detailed documentation that covers all aspects of the package, including usage examples and troubleshooting guides.
  • Publish documentation on a dedicated website or platform for easy access and updates.

6. Support for Monorepos

  • Extend support for monorepo setups, allowing for consistent configuration across multiple projects within a single repository.
  • Investigate tools like Lerna or Nx to manage monorepo configurations effectively.

These enhancements aim to make legislato-conventions a more robust, versatile, and user-friendly tool for Legislato's development workflow. Contributions and suggestions from the community are highly welcomed to help shape the future of this package.

Contributing

Contributions are welcome! Feel free to open issues and pull requests.

License

This package is distributed under the MIT license.

changelog

:tada: Changelog

All notable changes to this project will be documented in this file. This project follows the Conventional Commits specification and adheres to Semantic Versioning. This file is automatically generated using release-it and conventional-changelog plugin.

:notebook:Release Notes 0.1.11

[!TIP] Huge thanks to our contributors! @joaofaveri

:sparkles: Features

  • core: ✨ novo script para only-version (2840710)

:lady_beetle: Bug Fixes

  • core: 🐞 evita a duplicidade do lintstagedrc com nextjs (e806df4)

:notebook:Release Notes 0.1.10

[!TIP] Huge thanks to our contributors! @joaofaveri

:sparkles: Features

  • npm: ✨ criação de script para only-version (ed10ff6)
  • npm: ✨ script para only-version and no-test (6f4aab7)

:lady_beetle: Bug Fixes

  • core: 🐞 ajustar o lintstagedrc para commonJs (fdac970)

:notebook:Release Notes 0.1.9

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • core: 🐞 alterar lintstagedrc para cjs (30aedb8)

:notebook:Release Notes 0.1.8

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • core: 🐞 adapta o lintstaged ao Next.js (8ad3d8f)

:notebook:Release Notes 0.1.7

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • core: 🐞 incluir try/catch para capturar erro ao copiar (3d17284)

:notebook:Release Notes 0.1.6

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • core: 🐞 corrige travamento ao copiar arquivos (449942e)

:notebook:Release Notes 0.1.5

[!TIP] Huge thanks to our contributors! @joaofaveri

:sparkles: Features

  • core: ✨ executa o husky antes de encerrar o script (4186b50)

:lady_beetle: Bug Fixes

  • core: 🐞 script travando ao copiar configs files (0c9f5fe)

:notebook:Release Notes 0.1.4

[!TIP] Huge thanks to our contributors! @joaofaveri

:sparkles: Features

  • core: ✨ mostrar prompt ao usuário para sobrescrever file (6ac38e1)

:lady_beetle: Bug Fixes

  • core: 🐞 copia configs se o dir existir e estiver vazio (0307acf)

:notebook:Release Notes 0.1.3

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • core: 🐞 spinner em installDependencies não encerrava (4b5658d)

:art: Visual Changes

  • core: 🎨 alterar cor da mensagem Next Steps (ab1bdc1)

:notebook:Release Notes 0.1.2

[!TIP] Huge thanks to our contributors! @joaofaveri

:blue_book: Documentation

  • core: 📘 instruções de instalação e uso do npx (ebdbac6)

:notebook:Release Notes 0.1.1

[!TIP] Huge thanks to our contributors! @joaofaveri

:sparkles: Features

  • core: ✨ alerta o usuário sobre personalização dos scripts (281acb3)
  • core: ✨ melhoria dos logs para o usuário (4b3f870)
  • core: ✨ utilizar cores nas saídas do console (6fb29cc)

:notebook:Release Notes 0.1.0

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • core: 🐞 inclusão das dependencias do projeto (d692638)

:notebook:Release Notes 0.0.6

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • npm: 🐞 correção das exclusão de arquivos de configuração (8f8bc2e)

:notebook:Release Notes 0.0.5

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • npm: 🐞 correção das exclusão de arquivos de configuração (11c4946)

:notebook:Release Notes 0.0.4

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • npm: 🐞 evita exclusão de arquivos config pelo npmignore (e224e2d)

:notebook:Release Notes 0.0.3

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • core: 🐞 inclusão do bin (dfa7e28)

:notebook:Release Notes 0.0.2

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • release: 🐞 usar últimos commits caso não haja tag (6e203ba)

:notebook:Release Notes 0.0.1

[!TIP] Huge thanks to our contributors! @joaofaveri

:blue_book: Documentation

  • core: 📘 inclusão do novo script release:no-test (7e83968)

:notebook:Release Notes 1.1.0

[!TIP] Huge thanks to our contributors! @joaofaveri

:sparkles: Features

  • lint: ✨ executar lint pre-commit para todos os arquivos (1cf664d)
  • lint: ✨ ignorar a pasta coverage durante o lint (7859b2a)
  • lint: ✨ inclusão do script para lint com eslint (7780de7)

:adhesive_bandage: Other changes

  • lint: ♻️ fix realizado pelo eslint (f28aeb9)

:blue_book: Documentation

  • core: 📘 melhorias no README (ea01dea)

:notebook:Release Notes 1.0.1

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • core: 🐞 incluir a pasta coverage no .npmignore (a7b96f9)

:blue_book: Documentation

  • docs: 📘 correção do link para clonagem do repositório (b6042c9)
  • docs: 📘 remove a seção Project Structure (ddbfd73)

:notebook:Release Notes 1.0.0

[!TIP] Huge thanks to our contributors! @joaofaveri

:sparkles: Features

  • docs: ✨ melhora o README do repositório (89b2bd4)

:notebook:Release Notes 0.6.1

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • core: 🐞 incluir o config release-it no typescript (c3ab90d)

:notebook:Release Notes 0.6.0

[!TIP] Huge thanks to our contributors! @joaofaveri

:sparkles: Features

  • release: ✨ ignorar a versão recomendada e mostrar prompt (909e66b)
  • test: ✨ implementa testes da função (a9e9824)
  • test: ✨ incluir o jest para testes (34af443)

:lady_beetle: Bug Fixes

  • core: 🐞 excluir dist do tsconfig (d7745cb)
  • release: 🐞 erro ao ler o login do colaborador (5a6e136)
  • release: 🐞 remove aspas simples ou duplas do email (430820a)
  • release: 🐞 remove console.log para debug (01b1671)
  • release: 🐞 remove unix para garantir compatibilidade (c7237da)
  • release: 🐞 separa os comandos do git para compatibilidade (da482ff)

:adhesive_bandage: Other changes

  • all: ♻️ refazer as funções para implementar testes (123d90f)
  • core: ♻️ incluir todos os arquivos da raiz no ts (c87d591)
  • core: 🛠️ remover babel e utilizar ts-jest (772372a)
  • core: 🛠️ usando babel e typescript com o jest (9d8100d)
  • core: 🛠️ usar babel e configurar a ferramenta (ee8e5fd)
  • npm: ♻️ incluir o tipo de repositório (0c00373)
  • npm: ♻️ ordenar arquivos no .npmignore (82c23cd)
  • npm: ♻️ realizar build antes de fazer o release (8e3c2e7)
  • test: 🛠️ incluir tipos do jest e plugin eslint (7b023ee)

:notebook:Release Notes 0.5.1

[!TIP] Huge thanks to our contributors! @joaofaveri

:lady_beetle: Bug Fixes

  • release: 🐞 corrige url do repositório (56a0679)

:notebook:Release Notes 0.5.0

[!TIP] Huge thanks to our contributors! @joaofaveri

:sparkles: Features

  • release: ✨ contributors com releaseNotes object (e0c34c3)
  • release: ✨ gerar colaboradores do release (5c6a067)
  • release: ✨ mostra os colaboradores na nota do header (bd87b6b)
  • release: ✨ relacionar colaboradores (8395793)
  • release: ✨ relacionar colaboradores do release (49d3322)

:lady_beetle: Bug Fixes

  • release: 🐞 ajustar para função única (aee8c69)
  • release: 🐞 corrige nome do arquivo chamado com execSync (cc61111)
  • release: 🐞 remover dados personalizados do footer (5afb55a)
  • release: 🐞 remover erros com colaboradores (412600c)
  • release: 🐞 remover releaseNotes (58e69dd)
  • release: 🐞 retornar colaboradores em string (f792a7d)

:adhesive_bandage: Other changes

  • release: ♻️ incluir agradecimento aos colaboradores (808a078)
  • release: ♻️ mover templates para pasta própria (7f1514d)
  • release: ♻️ tentativa com variável de ambiente (01667ef)
  • release: ♻️ testar busca por colaboradores (71a18a0)
  • release: ♻️ verificar retorno do fetch (a813a4b)
  • release: 🩹 adiciona debug para teste (c4164f5)
  • release: 🩹 incluir colaboradores via finalizeContext (c07ed89)
  • release: 🩹 inclusão de arquivo no npmigmore (97fb1f5)
  • release: 🩹 tentativa utilizando o execSync (468438e)

:zap: Performance Improvements

  • release: ⏪ retira as alterações como env vars (73d6ea3)

:notebook:Release Notes 0.4.0

[!NOTE] See below all the important changes made to this project

:sparkles: Features

  • release: ✨ cria template para o footer do changelog (6b2a67d)
  • release: ✨ criação dos templates customizados (c9e39f0)
  • release: ✨ nova tentativa de personalizar o footer (e906961)
  • release: ✨ template main com base no modelo padrão (2746ac7)

:lady_beetle: Bug Fixes

  • release: 🐞 links para os templates customizados (1df7acc)
  • release: 🐞 ordem dos dados na mensagem de release (a326858)
  • release: 🐞 remove o parâmetro verboso do release-it (d59c272)
  • release: 🐞 remover footer personalizado (8aa9deb)

:adhesive_bandage: Other changes

  • release: ♻️ ajuste no context (daa4355)
  • release: ♻️ ajustes em main e commit (bd682b8)
  • release: ♻️ ajustes no template commit (e1942ea)
  • release: ♻️ footer e header personalizados (e000d33)
  • release: ♻️ incluir notas no header (4099f0e)
  • release: ♻️ incluir quebra de linha entre commits (e764e75)
  • release: ♻️ inclusão de espaços (ebecc89)
  • release: ♻️ inclusão do changelog.config no npmignore (24a5e55)
  • release: ♻️ inclusão do header do commit (f372de5)
  • release: ♻️ melhorar visual das release notes (3160919)
  • release: ♻️ renomear extensões de arquivo (a5054a0)
  • release: ♻️ template para commits (1014965)
  • release: ♻️ uso de templates customizados (ccf3905)
  • release: 🩹 adiciona novos scripts para release-it (cc1711a)
  • release: 🩹 ajustes no template do header (8111405)
  • release: 🩹 incluir footer no changelog (4be6097)
  • release: 🩹 revisão de configurações do release-it (74f91e6)

Legislato Soluções Legislativas

:notebook:Release Notes

:small_red_triangle_down: See below all the important changes made to this project:

:lady_beetle: Bug Fixes

  • release: 🐞 simplificar as release notes (2e28757)

:notebook:Release Notes

:calendar: Released in 2025-03-01

:triangular_ruler: Compare changes with Previous Release

:name_badge: Problems? View Issues or create a new issue to track ideas, feedback, tasks, or bugs

:busts_in_silhouette: Contributors

:clap: This release was made possible by our amazing contributors:

Contributors list is empty


:small_red_triangle_down: See below all the important changes made to this project:

:lady_beetle: Bug Fixes

  • release: 🐞 substituir links incorretos para o github (6801d56)

:notebook:Release Notes

:calendar: Released in 2025-03-01

:link: View full 0.3.4 release

:triangular_ruler: Comparing changes with Previous Release

:name_badge: Problems? View Issues or create a new issue to track ideas, feedback, tasks, or bugs

:clap: This release was made possible by our amazing contributors:

Contributors list is empty

:small_red_triangle_down: See below all the important changes made to this project:

:lady_beetle: Bug Fixes

  • release: 🐞 links incorretos no header (a6d0c5c)

:notebook:Release Notes

View full 0.3.3 release

Released in 2025-03-01

Comparing changes with Previous Release

View Issues

:clap: This release was made possible by our amazing contributors:

${exec('git log --format='%an <%ae>' $(git describe --tags --abbrev=0)..HEAD | sort | uniq')}

See below all the important changes made to this project:

:lady_beetle: Bug Fixes

  • release: 🐞 ajusta variáveis no header (d925bda)

:notebook:Release Notes

0.3.2 - 2025-03-01

See below all the important changes made to this project:

:lady_beetle: Bug Fixes

  • release: 🐞 prompt solicitará apenas a versão (8b95589)
  • release: 🐞 remover context não atilizado (b6b5208)

:notebook:Release Notes

{{version}} - {{date}}

See below all the important changes made to this project:

:lady_beetle: Bug Fixes

  • release: 🐞 corrigir as variáveis no context (6278556)

:notebook:Release Notes

${version} - ${new Date().toISOString().split('T')[0]}

This file keeps track of all the important changes made to this project

:sparkles: Features

  • lint: ✨ altera o adapter do commitzen (9a97039)
  • release: ✨ incluir header e footer no release note (982179d)

:lady_beetle: Bug Fixes

  • corrigir posição dos parâmtros do script release-it (94bb22b)
  • lint: remoção do @commitlint/config-pnpm-scopes para evitar conflitos (eeaafe8)

:adhesive_bandage: Other changes

  • lint: ♻️ adequar configs do commitlint (48c1518)
  • lint: ♻️ converter release-it config para typescript (5d3d0e0)
  • lint: ♻️ ordenar types e scopes no cz (a3a1416)
  • lint: inquirer é uma peer dependence do @commitlint/cz-commitlint (a4785d4)
  • lint: remover o cz-emoji-conventional, que não será mais utilizado (c207e2e)
  • release: ♻️ agrupar commits no changelog (9cafc8f)
  • release: ♻️ mudar o título do changelog (76b6d88)

0.2.0 (2025-02-27)

:sparkles: Features

  • lint: inclusão de arquivos json no eslint (5bc5339)
  • lint: inclusão de ícones na configuração do commitlint (6d9e804)

:lady_beetle: Bug Fixes

  • lint: inclusão do parserPreset (01d5e81)
  • lint: remover o conventionalcommits override e instalar a versão indicada (5350a76)

0.1.0 (2025-02-27)

:sparkles: Features

  • incluir o scope-enum nas regras do commitlint (6a593e6)
  • lint: inclusão do adpater oficial do commitlint, sem emojis (fee3649)
  • release: incluir comentários do release ao fechar um issue ou PR (7bf2927)

:lady_beetle: Bug Fixes

  • release: correção da URL do semver (590ffc9)
  • release: importante recomendação de override do release-it (b101db9)
  • release: remove hooks por conflito no windows. Manter apenas o param -n nos commits (76ad59a)

:recycle: Code Changes (Refactors)

  • release: substituir emojis por código e melhorar textos (9846a55)

0.0.8 (2025-02-27)

  • ♻️ refactor(release): remoção de comandos para console.log (feafe75)

0.0.7 (2025-02-27)

  • 🐛 fix(release): ajuste da mensagem de commit e do script do release-it (862d9b6)
  • 🐛 fix(release): correção dos parâmetros de commit do release (703e7a3)
  • 🐛 fix(release): corrigir os parâmetros do commit de release (493f46e)
  • 🐛 fix(release): evita a validação com commitizen se o commit for para release (6fffd66)
  • 🐛 fix(release): exibir os parâmetros do commit para debug (5a057fa)
  • 🐛 fix(release): mostrar arquivo inteiro de mensagem e checar existência de string de release (5b632cd)
  • 🐛 fix(release): visualizar mensagem de commit para ajustes no prepare-commit-msg (a1db326)
  • 🧹 chore(release): new release - v0.0.6 (d508908)
  • teste (be53e5b)

0.0.6 (2025-02-27)

  • 🐛 fix(release): ajuste da mensagem de commit e do script do release-it (862d9b6)

0.0.5 (2025-02-27)

  • 🐛 fix(release): correção dos argumentos para o git commit (e941176)
  • 🐛 fix(release): correção dos argumentos passados para o git (bd3cda2)
  • 🐛 fix(release): desabilitar hooks durante o commit do release e reabilitar em seguida (a71975e)

0.0.4 (2025-02-27)

0.0.3 (2025-02-27)

  • 🏗️ build(npm): criação de um script para rodar o release-it em modo dry (97477f7)
  • 🏗️ build(npm): remoção de plugin do commitlint não utilizado (10cec16)
  • 🐛 fix(npm): reinstalação do @commitlint/config-conventional que é obrigatório (68cc148)

0.0.2 (2025-02-27)

  • 🐛 fix(lint): ajustar hooks para commitlint e instalar novas regras (1b20eeb)
  • 🐛 fix(lint): correção nas configurações do release-it (a497a84)
  • 🐛 fix(lint): inclusão de argumento no git commit do release-it (91be074)
  • 🐛 fix(release): novo release, porém com erro no envio para o github (c5757f9)
  • first commit (6a9c012)

0.0.1 (2025-02-27)

  • 🐛 fix(lint): ajustar hooks para commitlint e instalar novas regras (1b20eeb)
  • first commit (6a9c012)