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