Tracker
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.1
Omitting 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
Tracker
--project#9--projectthe user's working directory #10Description
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
--projectdirectory.Tags for versions in monorepos are prefixed with the name of the project. For example, if we have a project inside
/workflows/releasethe tag that should be created isworkflows/release/[VERSION]Example
For a repository with the following structure:
where each directory inside
workflowsis a project and, for demonstration purposes, imagining each is currently on version0.0.1and each have a commitfix: demo committhat modifies a file those directories:$ git semver bump -p workflows/release 0.0.2 # creates tag workflows/release/0.0.2Omitting the
--projector-poptionThe user should also be able to omit the
--projectoption if she/he's already inside a sub-directory:cc @jsmvaldivia