1 | import { AsyncSeriesBailHook, AsyncSeriesWaterfallHook } from 'tapable';
|
2 | import { ICommitAuthor, IExtendedCommit } from './log-parse';
|
3 | import { ILabelDefinition } from './release';
|
4 | import { ILogger } from './utils/logger';
|
5 | export interface IGenerateReleaseNotesOptions {
|
6 |
|
7 | owner: string;
|
8 |
|
9 | repo: string;
|
10 |
|
11 | baseUrl: string;
|
12 |
|
13 | labels: ILabelDefinition[];
|
14 |
|
15 | baseBranch: string;
|
16 | }
|
17 | export interface IChangelogHooks {
|
18 |
|
19 | renderChangelogLine: AsyncSeriesWaterfallHook<[[IExtendedCommit, string]]>;
|
20 |
|
21 | renderChangelogTitle: AsyncSeriesBailHook<[string, {
|
22 | [label: string]: string;
|
23 | }], string | void>;
|
24 |
|
25 | renderChangelogAuthor: AsyncSeriesBailHook<[ICommitAuthor, IExtendedCommit, IGenerateReleaseNotesOptions], string | void>;
|
26 |
|
27 | renderChangelogAuthorLine: AsyncSeriesBailHook<[ICommitAuthor, string], string | void>;
|
28 | |
29 |
|
30 |
|
31 |
|
32 |
|
33 | addToBody: AsyncSeriesWaterfallHook<[string[], IExtendedCommit[]]>;
|
34 |
|
35 | omitReleaseNotes: AsyncSeriesBailHook<[IExtendedCommit], boolean | void>;
|
36 | }
|
37 |
|
38 |
|
39 |
|
40 |
|
41 | export default class Changelog {
|
42 |
|
43 | readonly hooks: IChangelogHooks;
|
44 |
|
45 | readonly options: IGenerateReleaseNotesOptions;
|
46 |
|
47 | private authors?;
|
48 |
|
49 | private readonly logger;
|
50 |
|
51 | constructor(logger: ILogger, options: IGenerateReleaseNotesOptions);
|
52 | /** Load the default configuration */
|
53 | loadDefaultHooks(): void;
|
54 | /** Generate the release notes for a group of commits */
|
55 | generateReleaseNotes(commits: IExtendedCommit[]): Promise<string>;
|
56 | /** Create a link to a user for use in the changelog */
|
57 | createUserLink(author: ICommitAuthor, commit: IExtendedCommit): string | undefined;
|
58 | /** Split commits into changelogTitle sections. */
|
59 | private splitCommits;
|
60 | /** Get the default label for a label key */
|
61 | private getFirstLabelNameFromLabelKey;
|
62 | /** Create a list of users */
|
63 | private createUserLinkList;
|
64 | /** Transform a commit into a line in the changelog */
|
65 | private generateCommitNote;
|
66 | /** Get all the authors in the provided commits */
|
67 | private getAllAuthors;
|
68 | /** Create a section in the changelog to showcase contributing authors */
|
69 | private createAuthorSection;
|
70 | /** Create a section in the changelog to with all of the changelog notes organized by change type */
|
71 | private createLabelSection;
|
72 | /** Gather extra release notes to display at the top of the changelog */
|
73 | private createReleaseNotesSection;
|
74 | }
|
75 | //# sourceMappingURL=changelog.d.ts.map |
\ | No newline at end of file |