standard-version
standard-version copied to clipboard
feat: detect if a release is necessary
This PR tries to address the issue described in #192 in a way that is a non BREAKING CHANGE, the approach here is:
- Expose a new command option that enables this behavior
--detect-release
- Get a list of commit since the latest git tag, via
git-log-parser
- Check if there is any commit type worthy of a release(ex:
feat
), this is done by taking advantage of the configuration files(ex:.versionrc
), if no commit worthy is found we skip the release stage.
You can test this by doing a commit and then running the release
command
ex:
...
git commit -m "docs: update README"
yarn release --detect-release
Demo
https://user-images.githubusercontent.com/13886400/115864982-9713af80-a42f-11eb-8f8c-c373129a5db4.mov
Notes
Relevant links: https://github.com/bendrucker/git-log-parser https://github.com/sindresorhus/get-stream
Afterthought:
As mentioned in the issue thread this behavior could eventually become a default, and a --force
option could be added to give users the ability to always create a new release commit
Closes #192
Hey guys 👋
I came across issue #192, and I tried to follow some ideas/suggestions in the thread.
This is somewhat a proof of concept, and also an opportunity for me to explore the codebase 😅 .
I'm ok with this being replaced/closed in favor of --force
options as mentioned in the issue.
Feedback is appreciated Thanks! 🙏
Codecov Report
Merging #750 (4383381) into master (3d341c2) will decrease coverage by
0.23%
. The diff coverage is93.75%
.
@@ Coverage Diff @@
## master #750 +/- ##
==========================================
- Coverage 97.75% 97.51% -0.24%
==========================================
Files 24 25 +1
Lines 1067 1129 +62
==========================================
+ Hits 1043 1101 +58
- Misses 24 28 +4
Impacted Files | Coverage Δ | |
---|---|---|
command.js | 84.61% <ø> (ø) |
|
defaults.js | 100.00% <ø> (ø) |
|
lib/lifecycles/bump.js | 94.50% <82.60%> (-4.05%) |
:arrow_down: |
lib/checkpoint.js | 100.00% <100.00%> (ø) |
|
test/bump.spec.js | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 3d341c2...4383381. Read the comment docs.
Would be really good to merge this PR as it fixes significant flaw.
Hey there, just wondering if there is much left in this PR? Is there help needed getting this across the line?
Thanks @nelsonfncosta for having a go at this 🙇 Would be really a nice option to have!
Is there anything else missing for this to be included? Is the problem mentioned on this comment the current blocker?