4. Versioning, Publishing, and Configuring lerna.json for Commit Conventions

2 min read

exile.watch logo

This page is part of The toolkit I needed to make it all happen list - 4/7


Lerna simplifies life with its all-in-one versioning and publishing capabilities, perfect for streamlining our release process.


Initially, our lerna.json looked something like this:

// Initial lerna.json setup
{
  "$schema": "node_modules/lerna/schemas/lerna-schema.json",
  "version": "independent",
  "packages": [
    "packages/*"
  ]
}

Given that exile.watch is open source, it was crucial to implement certain standards.

A key requirement was enforcing commit linting. More on commit message guidelines at exile.watch here.

Moreover, with GitHub serving as our NPM registry, it was essential for Lerna to recognize this setup. Thus, I enhanced our lerna.json to adhere to commit conventions and integrate with the GitHub NPM registry, as shown below:

// Enhanced lerna.json for commit conventions and GitHub NPM registry integration
{
  "$schema": "node_modules/lerna/schemas/lerna-schema.json",
  "version": "independent",
  "command": {
    "version": {
      "conventionalCommits": true,
      "createRelease": "github",
      "message": "chore(release): publish [skip ci]",
      "commitHooks": false
    }
  },
  "packages": [
    "packages/*"
  ]
}

This tailored setup ensures our project adheres to best practices in version management and commit hygiene, all while leveraging GitHub’s infrastructure for package distribution.


Having set up versioning and publishing with Lerna, let’s dive into automating these processes with the Lerna CLI to streamline our workflow.

Last updated

Was this helpful?