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: fallback to tags if no meta-information file found #275

Merged
merged 2 commits into from
Nov 4, 2018

Conversation

bcoe
Copy link
Member

@bcoe bcoe commented Nov 1, 2018

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

BREAKING CHANGE: if no package.json, bower.json, etc., is found, we now fallback to git tags
@bcoe bcoe requested review from nexdrew, Tapppi and hutson November 1, 2018 21:56
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling be66b35 on default-behavior into fee872f on master.

@coveralls
Copy link

coveralls commented Nov 1, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 2ebe564 on default-behavior into fee872f on master.

const semver = require('semver')
const formatCommitMessage = require('./lib/format-commit-message')
const cli = require('./command')
const standardVersion = require('./index')
Copy link
Contributor

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+?

Copy link
Member Author

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:

#276

index.js Outdated
if (!pkg && args.gitTagFallback) {
return latestSemverTag()
} else if (!pkg) {
return Promise.reject(new Error('no package file found'))
Copy link
Contributor

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?

Copy link
Contributor

@hutson hutson left a 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.

@stevemao
Copy link
Member

stevemao commented Nov 4, 2018

Nice! This should have been the default behaviour in conventional-changelog too...

@bcoe bcoe merged commit 844cde6 into master Nov 4, 2018
@bcoe bcoe deleted the default-behavior branch November 4, 2018 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

4 participants