Versioning

Versioning

In mono-repos, it is common to have multiple versions of the same package. For example, you might have a @wayofdev/components package that is used by both @wayofdev/web and @wayofdev/mobile. In this case, you might want to have a different version of @wayofdev/components for @wayofdev/web and @wayofdev/mobile. This is where the package.json version field comes in. The version field is used to specify the version of the package. The version is a string that must follow the semver (opens in a new tab) format. For example, 1.0.0 is a valid version, but 1.0 is not.

For versioning automation we use changesets (opens in a new tab). It is a tool that helps you manage your versions and changelogs with a focus on multi-package repositories. It is designed to work well with a continuous integration system and can be used with any workflow you like. It is also designed to work with any package manager, but in mono-repos we are using pnpm (opens in a new tab).

A Detailed Explanation of Changesets (opens in a new tab) 🔗

🛠️ Setup and Usage

→ Install changesets bot

To connect changesets-bot to your repository, you need to install it as GitHub app — https://github.com/apps/changeset-bot (opens in a new tab)

→ Use changesets CLI to generate changesets

through docker

$ make cs

→ Commit changesets with your latest changes

Generated changesets are stored in .changeset directory. You can commit them with your latest changes.

$ git add .
$ git commit -am 'feat: add new feature'

More info with images: https://github.com/apps/changeset-bot (opens in a new tab)