standard-release / app

Language independent GitHub App for creating GitHub Releases, following the Conventional Commits and SemVer specifications
https://github.com/apps/standard-release
Apache License 2.0
13 stars 2 forks source link

Monorepo support #25

Open tunnckoCore opened 5 years ago

tunnckoCore commented 5 years ago

Currently, I'm not sure if it works, but basically it should be easy to support it, because we are based on git-semver-tags which understands Lerna tags.

tunnckoCore commented 5 years ago

Hm, actually we dont use it in the app. So we should make git-commits-since and/or git-semver-tags work without git, but with git log like string or array of commit message strings.

tunnckoCore commented 5 years ago

Use .listTags instead of getLatestRelease if pkg.workspaces and/or lerna.json is detected.

https://github.com/standard-release/app/blob/1a0f638f788bd76f7fd001a3e0718451eb89baca/src/index.js#L66-L73

ref: https://octokit.github.io/rest.js/#api-Repos-listTags

Use listTags, then .reduce over them to .getTag, so finally we'll have an array of tag objects which we should sort by tagger.date to be able to get the latest tag (no matter for which package it is), the important thing is that date, because than we'll pass it to .getCommits as { since: thatDate } option. After all that, we'll have all needed commits, and actually to the same thing which you'll do on the @tunnckocore/release-cli. Loop over all the commits, and for each of the packages inside each commit, call detectNextVersion. The final result, will be an array of Result objects which includes { increment, lastVersion, nextVersion, pkg, ... }

So for each item in that array, we'll call .createTag.

tunnckoCore commented 5 years ago

Needed changes in:

tunnckoCore commented 5 years ago

ref: Closing, based on https://github.com/conventional-commits/conventionalcommits.org/issues/118#issuecomment-464867324

Might not be needed. But out of curiosity, you can try to implement it as mentioned there - detect chore: release commits messages (or whatever regex is given on the config option) and get all the commits between those commits, which will then be passed to detect-next-version.

But in anyway, I don't think all this worth it and the time.

tunnckoCore commented 5 years ago

Also, latest comments on https://github.com/standard-release/cli/pull/3