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

feat: inferring the semver version according to Conventional Commit #71

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

northword
Copy link

@northword northword commented Jan 23, 2025

Description

  • Inferring the semver version according to Conventional Commit
  • Refactor the printCommits section to use the new parseCommits code
  • Raise ts target to esnext since regular expression capture named groups are only used in es2018 and above

PixPin_2025-01-23_17-41-59

Linked Issues

closes: #69

Additional context

1. Publishing parseCommit as a separate package?

Now that bumpp, unjs/changelogen, and changelogithub all handle git log messages, I was wondering if it would be possible to release this part of parseCommit as a separate npm package?

Even though the conventional-commits-parser package already exists, it's too big, contains a cli program, has an unacceptable install size of 400kb, and its maintenance seems to be inactive.

Or maybe bumpp could just depend on unjs/changelogen and use its exported parseCommits, like changelogithub does?

2. Default release type

Now, I still have next as the default option for promptNewVersion, do we need to change it to semver or somehow make it default to semver (I thought someone might like that)?

最后,小年快乐!

@antfu
Copy link
Member

antfu commented Jan 23, 2025

Now that bumpp, unjs/changelogen, and changelogithub all handle git log messages, I was wondering if it would be possible to release this part of parseCommit as a separate npm package?

Yeah, I agree that. Are you interested in maintaining one you own so we can depends on it?

src/get-new-version.ts Outdated Show resolved Hide resolved
@northword
Copy link
Author

Yeah, I agree that. Are you interested in maintaining one you own so we can depends on it?

Yeah, of course.

I will do this and update in this PR, so this PR I will turn into draft for now.

@northword northword marked this pull request as draft January 23, 2025 13:06
@northword
Copy link
Author

The code has been updated to use the tiny-conventional-commits-parser package, and semver has been changed to conventional.

In addition, set the type in package.json to module (so eslint.config.js has been changed to esm syntax), and fix a lint issue introduced in #70.

@northword northword marked this pull request as ready for review January 24, 2025 07:24
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.

Inferring the next version number according to Conventional Commit
2 participants