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

<figure><img src="https://1213438767-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4DXEoZIzUdpt18CW2qTD%2Fuploads%2FzXjtfpnPjXaN7gAZDm9L%2Fexilewatch.webp?alt=media&#x26;token=74fc8000-b114-47be-bc13-cda9b75cd22f" alt="" width="256"><figcaption><p>exile.watch logo</p></figcaption></figure>

*This page is part of* [#the-toolkit-i-needed-to-make-it-all-happen](https://engineering.exile.watch/march-2024/lerna-the-hidden-powerhouse-of-exile.watch/..#the-toolkit-i-needed-to-make-it-all-happen "mention") *list - 4/7*

***

[Lerna](https://lerna.js.org/) simplifies life with its [all-in-one versioning and publishing capabilities](https://lerna.js.org/docs/features/version-and-publish), perfect for streamlining our release process.

***

Initially, our `lerna.json` looked something like this:

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

Given that [exile.watch](https://exile.watch/) is [open source](https://engineering.exile.watch/march-2024/to-open-source-or-to-not-open-source), it was crucial to implement certain standards.&#x20;

A key requirement was enforcing commit linting. More on commit message guidelines at exile.watch [here](https://docs.exile.watch/development/commit-message-guidelines).

Moreover, with [GitHub serving as our NPM registry](https://engineering.exile.watch/march-2024/lerna-the-hidden-powerhouse-of-exile.watch/3.-module-registry-a-place-where-packages-get-to-chill), 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:

```jsonp
// 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.*


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://engineering.exile.watch/march-2024/lerna-the-hidden-powerhouse-of-exile.watch/4.-versioning-publishing-and-configuring-lerna.json-for-commit-conventions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
