Publish CLI
This CLI is meant to normalize commits and version releases. It uses the Angular commit convention.
Install
npm install --global @surveyplanet/publish
Example
Change directory into any Git repository and run the following:
publish
Or, if you don't want to be prompted use the options flags
publish --branch main --version patch
If you are not in the git project directory you can provide a path
publish path/to/git/project
Options
-m, --message Commit message. If not provided you will be prompted for one.
-b, --branch Repository branch. If not provided you will be prompted for one.
-v, --version Semantic version level. If not provided you will be prompted for one.
(<semver> | patch | minor | major | prerelease | prepatch | preminor | premajor )
-v, --verbose Verbose output.
-h, --help Show help.
Example
$ publish
? Select a semver string (latest: 1.0.0): (Use arrow keys)
patch -> 1.0.1
minor -> 1.1.0
major -> 2.0.0
prerelease -> 1.0.1-0
prepatch -> 1.0.1-0
❯ preminor -> 1.1.0-0
premajor -> 2.0.0-0
? Specify a prerelease identifier:
alpha
beta
❯ release candidate
none
? The current branch is staging. Is this the branch you'd like to push to? Yes
? Enter a commit message header (required):
- A succinct description of the change
- Use imperative, present tense: "change" not "changed" or "changes"
- No punctuation
create contact page
? Enter a commit message body (optional)
- Includes motivation for the change and contrasts with previous behavior.
- Just as in <subject> use imperative, present tense: "change" not "changed" nor "changes".
Create a contact page that includes a contact form and contact information. Include Google Maps API with office location.
? Enter an issue number this commit resolves (optional)
- One issue at a time.
- Press "enter" or "return" to skip.
234
feat: Create contact page
Create a contact page that includes a contact from and contact information. Include Google Maps API with office location.
Closes #234
? Is the commit message correct? Yes
✔︎ Success: version v1.1.0-rc.0