Skip to content

Commit 2fe06b2

Browse files
Added a progress callback option
1 parent 5163c3f commit 2fe06b2

3 files changed

Lines changed: 25 additions & 0 deletions

File tree

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { versionBump } from "./version-bump";
55
export { ReleaseType } from "./release-type";
66
export * from "./version-bump-options";
77
export * from "./version-bump-results";
8+
export * from "./version-bump-progress";
89

910
// Export `versionBump` as a named export and the default export
1011
export { versionBump };

src/version-bump-options.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { VersionBumpProgress } from "./version-bump-progress";
12

23
/**
34
* Options for the `versionBump()` function.
@@ -90,6 +91,11 @@ export interface VersionBumpOptions {
9091
* Defaults to `true`.
9192
*/
9293
interface?: boolean | InterfaceOptions;
94+
95+
/**
96+
* A callback that is provides information about the progress of the `versionBump()` function.
97+
*/
98+
progress?(progress: VersionBumpProgress): void;
9399
}
94100

95101
/**

src/version-bump-progress.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { VersionBumpResults } from "./version-bump-results";
2+
3+
/**
4+
* Progress events that indicate the progress of the `versionBump()` function.
5+
*/
6+
export const enum ProgressEvent {
7+
FileUpdated = "file updated",
8+
GitCommit = "git commit",
9+
GitTag = "git tag",
10+
GitPush = "git push",
11+
}
12+
13+
/**
14+
* Information about the progress of the `versionBump()` function.
15+
*/
16+
export interface VersionBumpProgress extends VersionBumpResults {
17+
event: ProgressEvent;
18+
}

0 commit comments

Comments
 (0)