-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Tracker
- feat: support monorepos #8
- Only consider version updates from commits done inside the directory specified by
--project#9 - Make the default value for
--projectthe user's working directory #10
Description
Support repositories with multiple projects (aka monorepos).
A --project (aliased -p) global option should be introduced that allows maintainers of monorepos to specify which project they want to query/bump versions for.
If we're inside a sub-directory on the Git repository, that sub-directory is used as the default value for --project.
Version increments are detected based on commits that affect at least one file/directory inside the --project directory.
Tags for versions in monorepos are prefixed with the name of the project. For example, if we have a project inside /workflows/release the tag that should be created is workflows/release/[VERSION]
Example
For a repository with the following structure:
| workflows/
|-- release/
|-- build/
where each directory inside workflows is a project and, for demonstration purposes, imagining each is currently on version 0.0.1 and each have a commit fix: demo commit that modifies a file those directories:
$ git semver next -p workflows/release
0.0.2$ git semver bump -p workflows/release
0.0.2 # creates tag workflows/release/0.0.2$ git semver latest -p workflows/release
0.0.2$ git semver latest -p workflows/build
0.0.1Omitting the --project or -p option
The user should also be able to omit the --project option if she/he's already inside a sub-directory:
$ cd workflows/build
$ git semver latest
0.0.1
$ git commit -am "fix: demo"
$ git semver bump
0.0.2 # creates tag workflows/build/0.0.2
cc @jsmvaldivia