-
Notifications
You must be signed in to change notification settings - Fork 800
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: fallback to tags if no meta-information file found #275
Conversation
BREAKING CHANGE: if no package.json, bower.json, etc., is found, we now fallback to git tags
const semver = require('semver') | ||
const formatCommitMessage = require('./lib/format-commit-message') | ||
const cli = require('./command') | ||
const standardVersion = require('./index') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines seem unrelated to this particular change. Could they be pulled out into a separate pull request that refactors the code base into modern ES6+?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
point taken re: not making more changes than necessary while adding a feature, at the same time since I pulled in a new dependency I usually tend to switch var
to const
for the surrounding imports (my feeling being it's better to eliminate this potential vector for bugs, rather than introduce a new vector).
I created a follow up ticket, to go through the codebase more thoroughly -- this feels like a great task for first time contributors:
index.js
Outdated
if (!pkg && args.gitTagFallback) { | ||
return latestSemverTag() | ||
} else if (!pkg) { | ||
return Promise.reject(new Error('no package file found')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of returning a rejected promise, could you just throw the error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I have to leave a comment here, though my change comments are posted elsewhere above.
Nice! This should have been the default behaviour in conventional-changelog too... |
I'm working on some mad science with GitHub Actions, as part of this I'm working on making standard-version less tied to JavaScript.
This pull request makes it so that version will now be based on the git-history, if no supported meta-information file is found (package.json, composer.json, etc).
I've also updated the language slightly in the README to tie things less to npm.
BREAKING CHANGE: if no package.json, bower.json, etc., is found, we now fallback to git tags
CC: @TilmannBach