-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
54 lines (47 loc) · 1.27 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import type { Context as SRConfig, GlobalConfig } from 'semantic-release';
import type { TravisEnv } from 'env-ci';
import type {
ChangelogConfig,
GenerateReleaseNotesConfig,
GitConfig,
CommitAnalyzerConfig,
} from './plugins';
type BranchArg = string | Branch;
export type Branch = { name: string; main?: boolean; prerelease?: boolean };
export type Context = SRConfig & {
cwd: string;
envCi: TravisEnv;
options: { repositoryUrl: string };
branch: Branch;
branches: Branch[];
logger: SRConfig['logger'] & { info: SRConfig['logger']['log'] };
};
export type PrepareChangelogFn = (
content: string | null,
config: Config,
context: Context,
) => string;
export type Config = Partial<GlobalConfig> &
Partial<ChangelogConfig> &
Partial<GenerateReleaseNotesConfig> &
Partial<GitConfig> &
Partial<CommitAnalyzerConfig> &
Partial<{
pattern: string | RegExp;
baseBranch: string;
headBranch: string;
releaseBranches: BranchArg[];
prepareChangelog: PrepareChangelogFn | string;
requireDryRun: boolean;
}>;
export type Meta = {
verified?: boolean;
changelogFile?: string;
initHead?: string;
baseBranch?: string;
headBranch?: string;
dummyBranch?: string;
branch?: Branch;
branches?: Branch[];
defaultBranches?: BranchArg[];
};