UNPKG

3.28 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.loadedAutoRc = exports.autoRc = void 0;
4const tslib_1 = require("tslib");
5const t = tslib_1.__importStar(require("io-ts"));
6const release_1 = require("./release");
7const author = t.partial({
8 /** The name of the author to make commits with */
9 name: t.string,
10 /** The email of the author to make commits with */
11 email: t.string,
12});
13const githubInformation = t.partial({
14 /** The github api to interact with */
15 githubApi: t.string,
16 /** The github graphql api to interact with */
17 githubGraphqlApi: t.string,
18 /** The branch that is used as the base. defaults to master */
19 baseBranch: t.string,
20});
21const repoInformation = t.partial({
22 /** The repo of to publish, might be set in package manager file. */
23 repo: t.string,
24 /** The owner of the repo to publish, might be set in package manager file. */
25 owner: t.string,
26});
27const releaseCalculationOptions = t.partial({
28 /** Instead of publishing every PR only publish when "release" label is present */
29 onlyPublishWithReleaseLabel: t.boolean,
30});
31const logOptions = t.partial({
32 /** Show more logs */
33 verbose: t.union([t.boolean, t.tuple([t.boolean, t.boolean])]),
34});
35const globalOptions = t.partial({
36 /** Another auto configuration to extend */
37 extends: t.string,
38 /** Labels that power auto */
39 labels: t.array(release_1.labelDefinition),
40 /** Branches to create pre-releases from */
41 prereleaseBranches: t.array(t.string),
42 /** Configured auto plugins */
43 plugins: t.array(t.union([t.string, t.tuple([t.string, t.any])])),
44 /** Whether to prefix the version with a "v" */
45 noVersionPrefix: t.boolean,
46 /**
47 * Manage old version branches.
48 * Can be a true or a custom version branch prefix.
49 *
50 * @default 'version-'
51 */
52 versionBranches: t.union([t.boolean, t.string]),
53 /** Options to pass to "auto comment" */
54 comment: t.partial({
55 delete: t.boolean,
56 edit: t.boolean,
57 }),
58 /** Options to pass to "auto changelog" */
59 changelog: t.partial({
60 message: t.string,
61 }),
62 /** Options to pass to "auto release" */
63 release: t.partial({
64 prerelease: t.boolean,
65 }),
66 /** Options to pass to "auto shipit" */
67 shipit: t.partial({
68 onlyGraduateWithReleaseLabel: t.boolean,
69 }),
70 /** Options to pass to "auto canary" */
71 canary: t.partial({
72 force: t.boolean,
73 message: t.union([t.literal(false), t.string]),
74 }),
75 /** Options to pass to "auto next" */
76 next: t.partial({
77 message: t.string,
78 }),
79});
80exports.autoRc = t.intersection([
81 globalOptions,
82 t.intersection([
83 repoInformation,
84 githubInformation,
85 author,
86 releaseCalculationOptions,
87 logOptions,
88 ]),
89]);
90exports.loadedAutoRc = t.intersection([
91 exports.autoRc,
92 t.type({
93 /** Labels that power auto */
94 labels: t.array(release_1.labelDefinition),
95 /** Branches to create pre-releases from */
96 prereleaseBranches: t.array(t.string),
97 /** The branch that is used as the base. defaults to master */
98 baseBranch: t.string,
99 }),
100]);
101//# sourceMappingURL=types.js.map
\No newline at end of file