tiny-conventional-commits-parser
Version:
A tiny conventional commits parser
38 lines (33 loc) • 1.22 kB
TypeScript
interface GitCommitAuthor {
name: string;
email: string;
}
interface RawGitCommit {
message: string;
body: string;
shortHash: string;
author: GitCommitAuthor;
data: string;
}
interface Reference {
type: 'issue' | 'pull-request';
value: string;
}
interface GitCommit extends Omit<RawGitCommit, 'author'> {
isConventional: boolean;
description: string;
type: string;
scope: string;
references: Reference[];
authors: GitCommitAuthor[];
isBreaking: boolean;
}
declare function getLastGitTag(): string | undefined;
declare function getCurrentGitTag(): string | undefined;
declare function getGitLog(from: string | undefined, to?: string, path?: string): string[];
declare function parseRawCommit(commit: string): RawGitCommit;
declare function parseCommit(rawCommit: RawGitCommit): GitCommit;
declare function getCommits(from?: string, to?: string, path?: string): GitCommit[];
declare function getRecentCommits(from?: string, to?: string, path?: string): GitCommit[];
export { getCommits, getCurrentGitTag, getGitLog, getLastGitTag, getRecentCommits, parseCommit, parseRawCommit };
export type { GitCommit, GitCommitAuthor, RawGitCommit, Reference };