forked from intuit/auto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
auto-args.ts
170 lines (148 loc) · 4.21 KB
/
auto-args.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import {
AuthorInformation,
RepoInformation,
GithubInformation,
LogOptions,
ReleaseCalculationOptions,
AutoRc,
} from "./types";
export type ICreateLabelsOptions = DryRunOption;
export interface ILabelOptions {
/** PR to get the labels for */
pr?: number;
/** Label to check for */
exists?: string;
}
export interface IPRCheckOptions extends DryRunOption {
/** PR to check the label for */
pr?: number;
/** URL to attach to the checkmark */
url?: string;
/** The context the check should be attached to */
context?: string;
}
export interface IPRStatusOptions extends DryRunOption {
/** The commit to attach a check to */
sha?: string;
/** The pr to attach a check to */
pr?: number;
/** URL to attach to the checkmark */
url: string;
/** The state to set the checkmark to */
state: "pending" | "success" | "error" | "failure";
/** The description to attach to the checkmark */
description: string;
/** The context the check should be attached to */
context: string;
}
export type IVersionOptions = ReleaseCalculationOptions & {
/** Commit to start calculating the version from */
from?: string;
};
export interface QuietOption {
/** Print **only** the result of the command */
quiet?: boolean;
}
type NoVersionPrefix = Pick<AutoRc, "noVersionPrefix">;
export interface DryRunOption {
/** Do not actually do anything */
dryRun?: boolean;
}
export interface NoGitCommit {
/** Do not commit the changes */
noGitCommit?: boolean;
}
interface ChangelogTitle {
/** Override the title use in the addition to the CHANGELOG.md. */
title?: string;
}
type BaseBranch = Pick<GithubInformation, "baseBranch">;
export type IChangelogOptions = BaseBranch &
ChangelogTitle &
NonNullable<AutoRc["changelog"]> &
QuietOption &
DryRunOption &
NoVersionPrefix &
NoGitCommit &
Partial<AuthorInformation> & {
/** Commit to start calculating the changelog from */
from?: string;
/** Commit to start calculating the changelog to */
to?: string;
/** Do not make any changes to changelog file */
noChanges?: boolean;
/** Override the version to release */
useVersion?: string;
};
export type IReleaseOptions = BaseBranch &
NonNullable<AutoRc["release"]> &
DryRunOption &
NoVersionPrefix &
Partial<AuthorInformation> &
Partial<RepoInformation> & {
/** Commit to start calculating the release from */
from?: string;
/** Commit to calculate the release to */
to?: string;
/** Override the version to release */
useVersion?: string;
};
export type ICommentOptions = DryRunOption &
NonNullable<AutoRc["comment"]> & {
/** The message to use when commenting */
message?: string;
/** THe PR to comment on */
pr?: number;
/** The context the message should be attached to. Use to post multiple comments to a PR */
context?: string;
};
export type IPRBodyOptions = Omit<ICommentOptions, "edit" | "delete">;
export type ILatestOptions = BaseBranch &
DryRunOption &
NonNullable<AutoRc["latest"]> &
NoVersionPrefix &
ChangelogTitle &
QuietOption &
ReleaseCalculationOptions &
Partial<AuthorInformation> &
Partial<RepoInformation> & {
/** Commit to start calculating the release from */
from?: string;
/** Override the version to release */
useVersion?: string;
};
export type IShipItOptions = ILatestOptions & NonNullable<AutoRc["shipit"]>;
export type ICanaryOptions = QuietOption &
NonNullable<AutoRc["canary"]> &
DryRunOption & {
/** THe PR to attach the canary to */
pr?: number;
/** The build to attach the canary to */
build?: number;
};
export type INextOptions = QuietOption &
NonNullable<AutoRc["next"]> &
DryRunOption;
export interface IInfoOptions {
/** List some of the available plugins */
listPlugins?: boolean;
}
export type GlobalOptions = Pick<AutoRc, "plugins"> &
Partial<GithubInformation & RepoInformation> &
LogOptions;
export type ApiOptions = GlobalOptions &
(
| ILatestOptions
| IInfoOptions
| ICreateLabelsOptions
| ILabelOptions
| IPRCheckOptions
| IPRStatusOptions
| ICommentOptions
| IChangelogOptions
| IPRBodyOptions
| IReleaseOptions
| IVersionOptions
| ICanaryOptions
| IShipItOptions
);