UNPKG

6.82 kBTypeScriptView Raw
1import cosmiconfig from 'cosmiconfig';
2import { ApiOptions } from './auto-args';
3import { ILogger } from './utils/logger';
4export default class Config {
5 logger: ILogger;
6 constructor(logger: ILogger);
7 /**
8 * Load the .autorc from the file system, set up defaults, combine with CLI args
9 * load the extends property, load the plugins and start the git remote interface.
10 */
11 loadConfig(args: ApiOptions): Promise<{
12 labels: import("./release").ILabelDefinitionMap;
13 skipReleaseLabels: any;
14 githubApi?: string | undefined;
15 baseBranch?: string | undefined;
16 githubGraphqlApi?: string | undefined;
17 plugins?: string[] | undefined;
18 owner?: string | undefined;
19 repo?: string | undefined;
20 verbose?: boolean | undefined;
21 veryVerbose?: boolean | undefined;
22 onlyLabels?: boolean | undefined;
23 dryRun?: boolean | undefined;
24 } | {
25 labels: import("./release").ILabelDefinitionMap;
26 skipReleaseLabels: any;
27 githubApi?: string | undefined;
28 baseBranch?: string | undefined;
29 githubGraphqlApi?: string | undefined;
30 plugins?: string[] | undefined;
31 owner?: string | undefined;
32 repo?: string | undefined;
33 verbose?: boolean | undefined;
34 veryVerbose?: boolean | undefined;
35 dryRun?: boolean | undefined;
36 } | {
37 labels: import("./release").ILabelDefinitionMap;
38 skipReleaseLabels: any;
39 githubApi?: string | undefined;
40 baseBranch?: string | undefined;
41 githubGraphqlApi?: string | undefined;
42 plugins?: string[] | undefined;
43 owner?: string | undefined;
44 repo?: string | undefined;
45 verbose?: boolean | undefined;
46 veryVerbose?: boolean | undefined;
47 pr?: number | undefined;
48 } | {
49 labels: import("./release").ILabelDefinitionMap;
50 skipReleaseLabels: any;
51 githubApi?: string | undefined;
52 baseBranch?: string | undefined;
53 githubGraphqlApi?: string | undefined;
54 plugins?: string[] | undefined;
55 owner?: string | undefined;
56 repo?: string | undefined;
57 verbose?: boolean | undefined;
58 veryVerbose?: boolean | undefined;
59 pr?: number | undefined;
60 url?: string | undefined;
61 context?: string | undefined;
62 dryRun?: boolean | undefined;
63 } | {
64 labels: import("./release").ILabelDefinitionMap;
65 skipReleaseLabels: any;
66 githubApi?: string | undefined;
67 baseBranch?: string | undefined;
68 githubGraphqlApi?: string | undefined;
69 plugins?: string[] | undefined;
70 owner?: string | undefined;
71 repo?: string | undefined;
72 verbose?: boolean | undefined;
73 veryVerbose?: boolean | undefined;
74 sha?: string | undefined;
75 pr?: number | undefined;
76 url: string;
77 state: "pending" | "success" | "error" | "failure";
78 description: string;
79 context: string;
80 dryRun?: boolean | undefined;
81 } | {
82 labels: import("./release").ILabelDefinitionMap;
83 skipReleaseLabels: any;
84 githubApi?: string | undefined;
85 baseBranch?: string | undefined;
86 githubGraphqlApi?: string | undefined;
87 plugins?: string[] | undefined;
88 owner?: string | undefined;
89 repo?: string | undefined;
90 verbose?: boolean | undefined;
91 veryVerbose?: boolean | undefined;
92 onlyPublishWithReleaseLabel?: boolean | undefined;
93 } | {
94 labels: import("./release").ILabelDefinitionMap;
95 skipReleaseLabels: any;
96 githubApi?: string | undefined;
97 baseBranch?: string | undefined;
98 githubGraphqlApi?: string | undefined;
99 plugins?: string[] | undefined;
100 owner?: string | undefined;
101 repo?: string | undefined;
102 verbose?: boolean | undefined;
103 veryVerbose?: boolean | undefined;
104 noVersionPrefix?: boolean | undefined;
105 dryRun?: boolean | undefined;
106 from?: string | undefined;
107 to?: string | undefined;
108 message?: string | undefined;
109 name?: string | undefined;
110 email?: string | undefined;
111 } | {
112 labels: import("./release").ILabelDefinitionMap;
113 skipReleaseLabels: any;
114 githubApi?: string | undefined;
115 baseBranch?: string | undefined;
116 githubGraphqlApi?: string | undefined;
117 plugins?: string[] | undefined;
118 owner?: string | undefined;
119 repo?: string | undefined;
120 verbose?: boolean | undefined;
121 veryVerbose?: boolean | undefined;
122 noVersionPrefix?: boolean | undefined;
123 dryRun?: boolean | undefined;
124 useVersion?: string | undefined;
125 name?: string | undefined;
126 email?: string | undefined;
127 } | {
128 labels: import("./release").ILabelDefinitionMap;
129 skipReleaseLabels: any;
130 githubApi?: string | undefined;
131 baseBranch?: string | undefined;
132 githubGraphqlApi?: string | undefined;
133 plugins?: string[] | undefined;
134 owner?: string | undefined;
135 repo?: string | undefined;
136 verbose?: boolean | undefined;
137 veryVerbose?: boolean | undefined;
138 message?: string | undefined;
139 pr?: number | undefined;
140 context?: string | undefined;
141 dryRun?: boolean | undefined;
142 delete?: boolean | undefined;
143 } | {
144 labels: import("./release").ILabelDefinitionMap;
145 skipReleaseLabels: any;
146 githubApi?: string | undefined;
147 baseBranch?: string | undefined;
148 githubGraphqlApi?: string | undefined;
149 plugins?: string[] | undefined;
150 owner?: string | undefined;
151 repo?: string | undefined;
152 verbose?: boolean | undefined;
153 veryVerbose?: boolean | undefined;
154 dryRun?: boolean | undefined;
155 } | {
156 labels: import("./release").ILabelDefinitionMap;
157 skipReleaseLabels: any;
158 githubApi?: string | undefined;
159 baseBranch?: string | undefined;
160 githubGraphqlApi?: string | undefined;
161 plugins?: string[] | undefined;
162 owner?: string | undefined;
163 repo?: string | undefined;
164 verbose?: boolean | undefined;
165 veryVerbose?: boolean | undefined;
166 dryRun?: boolean | undefined;
167 pr?: number | undefined;
168 build?: number | undefined;
169 message?: string | undefined;
170 }>;
171 /**
172 * Loads a config from a path, package name, or special `auto-config` pattern
173 *
174 * ex: auto-config-MY_CONFIG
175 * ex: @MY_CONFIG/auto-config
176 *
177 * @param extend Path or name of config to find
178 */
179 loadExtendConfig(extend: string): Promise<cosmiconfig.Config | {
180 auto: cosmiconfig.Config;
181 }>;
182}