ideveloper-eu-org / ideveloper.github.io

Personal blog
0 stars 0 forks source link

Some notes about publishing monorepos with release-it #2

Open ideveloper-eu-org opened 4 months ago

ideveloper-eu-org commented 4 months ago

Release-it

this is release tools for front-end

For publish monorepos we need above plugins:

@release-it-plugins/workspaces @release-it/conventional-changelog

The configuration is as follows:

{
  "git": {
    "commitMessage": "chore: release ${version}" // This is to match commitlint
  },
  "npm": false, // Here is important
  "plugins": {
    "@release-it-plugins/workspaces": true,
    "@release-it/conventional-changelog": {
      "preset": {
        "name": "conventionalcommits",
        "type": [
          {
            "type": "feat",
            "section": "Features"
          },
          {
            "type": "fix",
            "section": "Bug Fixes"
          }
        ]
      },
      "infile": "CHANGELOG.md"
    }
  }
}

To publish we just run command pnpm release in root folder

ideveloper-eu-org commented 2 months ago
"dependencies": {
    "@zoomphant-utils/monitor": "workspace:^"
  },

If you need to correct the dependencies version, You need to change the workspace:^ to YOUR_CURRENT_VERSION without commit and then run command pnpm release