Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: improve lerna publish process #3082

Merged
merged 4 commits into from Nov 21, 2022
Merged

Conversation

erickzhao
Copy link
Member

@erickzhao erickzhao commented Nov 16, 2022

Motivation

We don't leverage our conventional commit usage to help automate versioning.

Changes

Wraps the lerna publish command into a new lerna:publish npm script with additional configuration to address the two issues above.

  • --conventional-commits: Auto-selects the package number for us.
  • --no-changelog: Seems like the changelog generated is per package, which we don't want. Let's keep doing this step manually.

Having this in a command within the repo helps in two ways:

  1. Less human error possible by forgetting a flag by accident.
  2. Lerna version matches our devDependencies rather than being a globally installed NPM package.

I also changed the root package.json version number to 0.0.0-development since Lerna doesn't update the root package.json number by default and our version number was stale. There's a workaround that involves adding the root folder as a package itself, but then you have to run each lerna command with --no-private which is annoying and not worth it IMO.

Testing

I tested this manually by running lerna version --no-push --no-git-tag-version --force-publish --conventional-commits --no-changelog, which is as close to a dry run as possible since Lerna does not yet support dry runs.

@erickzhao erickzhao requested review from georgexu99 and a team November 16, 2022 23:24
@erickzhao erickzhao marked this pull request as ready for review November 16, 2022 23:26
Copy link
Member

@VerteDinde VerteDinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks for fixing this!

package.json Outdated Show resolved Hide resolved
@erickzhao erickzhao merged commit 3c6e7eb into main Nov 21, 2022
@erickzhao erickzhao deleted the erick-lerna-publish-cmd branch November 21, 2022 23:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants