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

Support monorepos with multiple projects #7

Open
1 of 3 tasks
jcrqr opened this issue Oct 12, 2021 · 0 comments · Fixed by #8
Open
1 of 3 tasks

Support monorepos with multiple projects #7

jcrqr opened this issue Oct 12, 2021 · 0 comments · Fixed by #8
Assignees
Labels
enhancement New feature or request

Comments

@jcrqr
Copy link
Contributor

jcrqr commented Oct 12, 2021

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

@jcrqr jcrqr self-assigned this Oct 12, 2021
@jcrqr jcrqr added the enhancement New feature or request label Oct 12, 2021
@jcrqr jcrqr closed this as completed in #8 Oct 12, 2021
@jcrqr jcrqr reopened this Oct 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant