-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
2,687 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Changelog | ||
|
||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
|
||
## [4.1.0](https://github.com/tvdstaaij/node-git-describe/compare/v4.0.4...v4.1.0) (2021-08-16) | ||
|
||
|
||
### Features | ||
|
||
* Add `long` option to match behaviour of git describe --long (Fixes [#15](https://github.com/tvdstaaij/node-git-describe/issues/15)) ([0469061](https://github.com/tvdstaaij/node-git-describe/commit/046906171c9db8585577bdc1cd827edd69363ca7)) | ||
* Add typescript types ([9638b74](https://github.com/tvdstaaij/node-git-describe/commit/9638b7447a9e346f7e8ac678d8bbe2770ea65abd)) | ||
|
||
|
||
### Fixes and Improvements | ||
|
||
* Throw the correct error message when gitDescribeSync is invoked without git in the $PATH (Fixes [#17](https://github.com/tvdstaaij/node-git-describe/issues/17)) ([2d1df12](https://github.com/tvdstaaij/node-git-describe/commit/2d1df12e15751ba079dd3a4b623ecbe10df0db91)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Contributing | ||
|
||
Contributions are welcome! | ||
|
||
Release notes and the version number for the next | ||
release are generated from the commit history. | ||
Here are some guidelines on formatting your commits to make sure that the | ||
release notes will be correct after your change is accepted. | ||
|
||
Ignoring these guidelines is fine, but it means that your change may be squash-merged so that the changelog contains the right contents. | ||
|
||
Release notes and version bumping are managed by `standard-version`. This uses the | ||
[Conventional Commit](https://www.conventionalcommits.org/en/v1.0.0/) specification to decide what will appear in the changelog. | ||
|
||
## Commits | ||
|
||
In general the format is `<type>(<scope>): <message>`. The `scope` and the `message` can be anything. | ||
The `type` can also be anything, but if it is `fix` or `feat` then it will appear in the release notes: | ||
|
||
- `feat(options):` or `feat:` messages appear under "New Features", and trigger minor version bumps. | ||
- `fix(some other scope):` or `fix:` messages appear under "Fixes and improvements", and trigger patch version bumps. | ||
|
||
These communicate changes that users may want to know about. Not all changes that could be considered "fixes" | ||
are changes that users would want to see in the changelog. | ||
If you have a fix that shouldn't be in the changelog, some example types include `docs`, `chore`, `test`, `refactor`, `build` etc. | ||
|
||
If your commit message introduces a breaking change, please indicate that it is a breaking change with `!` | ||
after the type and scope. For example, the following commit message indicates a breaking change: | ||
|
||
``` | ||
fix(something)!: The signature for the something method has changed | ||
``` | ||
|
||
You can also include a footer in the commit that | ||
starts with the text `BREAKING CHANGE:`. This is useful if you need to provide | ||
more context. Markdown formatting is available in the footer section. | ||
|
||
Breaking changes trigger major version bumps and always appear in the release notes, even if they are not `feat` or `fix`. | ||
|
||
For more information, please see the | ||
[Conventional Commit Specification](https://www.conventionalcommits.org/en/v1.0.0/) | ||
|
||
## Cutting a release | ||
|
||
To modify the changelog, bump the version, and create the appropriate git tag, run: | ||
|
||
``` | ||
npm run release | ||
``` | ||
|
||
If you just want to confirm what the release notes and version will be, you can do a dry run with: | ||
|
||
``` | ||
npm run release -- --dry-run | ||
``` | ||
|
||
If you need to do a prerelease version (say with a suffix of `-alpha`), you can do: | ||
|
||
``` | ||
npm run release -- --prerelease alpha | ||
``` | ||
|
||
For more information see the [standard-version documentation](https://github.com/conventional-changelog/standard-version#readme) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { SemVer } from "semver"; | ||
|
||
export type GitInfo = { | ||
dirty: boolean; | ||
raw: string; | ||
hash: string; | ||
distance: null | number; | ||
tag: null | string; | ||
semver: null | SemVer; | ||
suffix: string; | ||
semverString: null | string; | ||
toString: () => string; | ||
}; | ||
export type GitDescribeOptions = { | ||
dirtyMark?: string; | ||
dirtySemver?: boolean; | ||
long?: boolean; | ||
longSemver?: boolean; | ||
requireAnnotated?: boolean; | ||
match?: string; | ||
customArguments?: Array<string>; | ||
}; | ||
|
||
export type Callback = (err: Error, gitInfo: GitInfo) => void; | ||
|
||
export declare function gitDescribe(directory: string): Promise<GitInfo>; | ||
export declare function gitDescribe( | ||
options: GitDescribeOptions | ||
): Promise<GitInfo>; | ||
export declare function gitDescribe( | ||
directory: string, | ||
options: GitDescribeOptions | ||
): Promise<GitInfo>; | ||
|
||
export declare function gitDescribe(callback: Callback): void; | ||
export declare function gitDescribe( | ||
options: GitDescribeOptions, | ||
callback: Callback | ||
): void; | ||
export declare function gitDescribe( | ||
directory: string, | ||
callback: Callback | ||
): void; | ||
export declare function gitDescribe( | ||
directory: string, | ||
options: GitDescribeOptions, | ||
callback: Callback | ||
): void; | ||
|
||
export declare function gitDescribeSync(): GitInfo; | ||
export declare function gitDescribeSync(directory: string): GitInfo; | ||
export declare function gitDescribeSync(options: GitDescribeOptions): GitInfo; | ||
export declare function gitDescribeSync( | ||
directory: string, | ||
options: GitDescribeOptions | ||
): GitInfo; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.