githublogen 0.2.2 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts DELETED
@@ -1,144 +0,0 @@
1
- type SemverBumpType = 'major' | 'premajor' | 'minor' | 'preminor' | 'patch' | 'prepatch' | 'prerelease';
2
- type RepoProvider = 'github' | 'gitlab' | 'bitbucket';
3
- type RepoConfig = {
4
- domain?: string;
5
- repo?: string;
6
- provider?: RepoProvider;
7
- token?: string;
8
- };
9
- interface ChangelogConfig {
10
- cwd: string;
11
- types: Record<string, {
12
- title: string;
13
- semver?: SemverBumpType;
14
- }>;
15
- scopeMap: Record<string, string>;
16
- repo: RepoConfig;
17
- tokens: Partial<Record<RepoProvider, string>>;
18
- from: string;
19
- to: string;
20
- newVersion?: string;
21
- output: string | boolean;
22
- gitMainBranch: string;
23
- }
24
- interface GitCommitAuthor {
25
- name: string;
26
- email: string;
27
- }
28
- interface RawGitCommit {
29
- message: string;
30
- body: string;
31
- shortHash: string;
32
- author: GitCommitAuthor;
33
- }
34
- interface Reference {
35
- type: 'hash' | 'issue' | 'pull-request';
36
- value: string;
37
- }
38
- interface GithubOptions {
39
- repo: string;
40
- token: string;
41
- }
42
- interface GithubRelease {
43
- id?: string;
44
- tag_name: string;
45
- name?: string;
46
- body?: string;
47
- draft?: boolean;
48
- prerelease?: boolean;
49
- }
50
- interface GitCommit extends RawGitCommit {
51
- description: string;
52
- type: string;
53
- scope: string;
54
- references: Reference[];
55
- authors: GitCommitAuthor[];
56
- isBreaking: boolean;
57
- }
58
- interface AuthorInfo {
59
- commits: string[];
60
- login?: string;
61
- email: string;
62
- name: string;
63
- }
64
- interface Commit extends GitCommit {
65
- resolvedAuthors?: AuthorInfo[];
66
- }
67
- interface ChangelogOptions extends ChangelogConfig {
68
- /**
69
- * Dry run. Skip releasing to GitHub.
70
- */
71
- dry?: boolean;
72
- /**
73
- * Whether to include contributors in release notes.
74
- *
75
- * @default true
76
- */
77
- contributors?: boolean;
78
- /**
79
- * Name of the release
80
- */
81
- name?: string;
82
- /**
83
- * Mark the release as a draft
84
- */
85
- draft?: boolean;
86
- /**
87
- * Mark the release as prerelease
88
- */
89
- prerelease?: boolean;
90
- /**
91
- * Custom titles
92
- */
93
- titles?: {
94
- breakingChanges?: string;
95
- };
96
- /**
97
- * Capitalize commit messages
98
- * @default true
99
- */
100
- capitalize?: boolean;
101
- /**
102
- * Nest commit messages under their scopes
103
- * @default true
104
- */
105
- group?: boolean | 'multiple';
106
- /**
107
- * Use emojis in section titles
108
- * @default true
109
- */
110
- emoji?: boolean;
111
- }
112
- type ResolvedChangelogOptions = Required<ChangelogOptions>;
113
-
114
- declare function sendRelease(options: ChangelogOptions, content: string): Promise<void>;
115
- declare function resolveAuthorInfo(options: ChangelogOptions, info: AuthorInfo): Promise<AuthorInfo>;
116
- declare function resolveAuthors(commits: Commit[], options: ChangelogOptions): Promise<AuthorInfo[]>;
117
- declare function hasTagOnGitHub(tag: string, options: ChangelogOptions): Promise<boolean>;
118
-
119
- declare function getGitHubRepo(): Promise<string>;
120
- declare function getGitMainBranchName(): Promise<string>;
121
- declare function getCurrentGitBranch(): Promise<string>;
122
- declare function isRepoShallow(): Promise<boolean>;
123
- declare function getLastGitTag(delta?: number): Promise<string>;
124
- declare function isRefGitTag(to: string): Promise<boolean>;
125
- declare function getFirstGitCommit(): Promise<string>;
126
- declare function isPrerelease(version: string): boolean;
127
- declare function getGitDiff(from: string | undefined, to?: string): Promise<RawGitCommit[]>;
128
- declare function getGitRemoteURL(cwd: string, remote?: string): Promise<string>;
129
- declare function getGitPushUrl(config: RepoConfig, token?: string): string | null;
130
-
131
- declare function generateMarkdown(commits: Commit[], options: ResolvedChangelogOptions): string;
132
-
133
- declare function generate(cwd: string, options: ChangelogOptions): Promise<{
134
- config: Required<ChangelogOptions>;
135
- md: string;
136
- commits: GitCommit[];
137
- }>;
138
-
139
- declare function resolveConfig(cwd: string, options: ChangelogOptions): Promise<Required<ChangelogOptions>>;
140
-
141
- declare function parseGitCommit(commit: RawGitCommit, config: ChangelogConfig): GitCommit | null;
142
- declare function parseCommits(commits: RawGitCommit[], config: ChangelogConfig): GitCommit[];
143
-
144
- export { AuthorInfo, ChangelogConfig, ChangelogOptions, Commit, GitCommit, GitCommitAuthor, GithubOptions, GithubRelease, RawGitCommit, Reference, RepoConfig, RepoProvider, ResolvedChangelogOptions, SemverBumpType, generate, generateMarkdown, getCurrentGitBranch, getFirstGitCommit, getGitDiff, getGitHubRepo, getGitMainBranchName, getGitPushUrl, getGitRemoteURL, getLastGitTag, hasTagOnGitHub, isPrerelease, isRefGitTag, isRepoShallow, parseCommits, parseGitCommit, resolveAuthorInfo, resolveAuthors, resolveConfig, sendRelease };