-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathBeachballOptions.ts
More file actions
162 lines (149 loc) · 5.17 KB
/
BeachballOptions.ts
File metadata and controls
162 lines (149 loc) · 5.17 KB
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
import { AuthType } from './Auth';
import { ChangeInfo, ChangeInfoMultiple, ChangeType } from './ChangeInfo';
import { ChangeFilePromptOptions } from './ChangeFilePrompt';
import { ChangelogOptions } from './ChangelogOptions';
export type BeachballOptions = CliOptions & RepoOptions & PackageOptions;
export interface CliOptions
extends Pick<
RepoOptions,
| 'access'
| 'branch'
| 'bumpDeps'
| 'changehint'
| 'disallowedChangeTypes'
| 'fetch'
| 'gitTags'
| 'message'
| 'path'
| 'prereleasePrefix'
| 'publish'
| 'push'
| 'registry'
| 'retries'
| 'scope'
| 'tag'
| 'depth'
> {
all: boolean;
authType: AuthType;
bump: boolean;
canaryName?: string | undefined;
command: string;
commit?: boolean;
configPath?: string;
dependentChangeType: ChangeType | null;
disallowDeletedChangeFiles?: boolean;
forceVersions?: boolean;
fromRef?: string;
help?: boolean;
keepChangeFiles?: boolean;
new: boolean;
package: string | string[];
timeout?: number;
token: string;
type?: ChangeType | null;
useConventionalCommits: boolean;
verbose?: boolean;
version?: boolean;
yes: boolean;
}
export interface RepoOptions {
/** access level for npm publish */
access: 'public' | 'restricted';
/** The target branch */
branch: string;
/** Bump dependent packages during publish (bump A if A depends on B) */
bumpDeps: boolean;
changeFilePrompt?: ChangeFilePromptOptions;
/** Prerelease prefix for packages that are specified to receive a prerelease bump */
/** Hint message for when change files are not detected but required */
changehint: string;
changelog?: ChangelogOptions;
/** The default dist-tag used for npm publish */
defaultNpmTag: string;
/** What change types are disallowed */
disallowedChangeTypes: ChangeType[] | null;
/** Fetch from remote before doing diff comparisons (default true) */
fetch: boolean;
/** Whether to generate changelog files */
generateChangelog: boolean;
groups?: VersionGroupOptions[];
/** Whether to create git tags for published packages (default true) */
gitTags: boolean;
/** Custom pre/post publish actions */
hooks?: HooksOptions;
ignorePatterns?: string[];
message: string;
/** The directory to run beachball in (default `process.cwd()`) */
path: string;
prereleasePrefix?: string | null;
/** Ignore changes in these files (minimatch patterns; negations not supported) */
/** Whether to publish to the npm registry (default true) */
publish: boolean;
/** Whether to push to the remote git branch when publishing (default true) */
push: boolean;
/** Target npm registry for publishing */
registry: string;
/** number of retries for a package publish before failing */
retries: number;
/** Filters paths that beachball uses to find packages */
scope?: string[] | null;
/** npm dist-tag when publishing (default 'latest') */
tag: string;
/** Transformations for change files */
transform?: TransformOptions;
/** Put multiple changes in a single changefile */
groupChanges?: boolean;
/** Depth of git history to consider when doing fetch */
depth?: number;
}
export interface PackageOptions {
gitTags: boolean;
disallowedChangeTypes: ChangeType[] | null;
tag: string | null;
defaultNpmTag: string;
changeFilePrompt?: ChangeFilePromptOptions;
}
export interface VersionGroupOptions {
/** minimatch pattern (or array of minimatch) to detect which packages should be included in this group */
include: string | string[];
/** minimatch pattern (or array of minimatch) to detect which packages should be excluded in this group */
exclude?: string | string[];
disallowedChangeTypes: ChangeType[] | null;
/** name of the version group */
name: string;
}
export interface HooksOptions {
/**
* Runs for each package after version bumps have been processed and committed to git, but before the actual
* publish command.
*
* This allows for file modifications which will be reflected in the published package but not be reflected in the
* repository.
*/
prepublish?: (packagePath: string, name: string, version: string) => void | Promise<void>;
/**
* Runs for each package after the publish command.
* Any file changes made in this step will **not** be committed automatically.
*/
postpublish?: (packagePath: string, name: string, version: string) => void | Promise<void>;
/**
* Runs for each package, before writing changelog and package.json updates
* to the filesystem. May be called multiple times during publish.
*/
prebump?: (packagePath: string, name: string, version: string) => void | Promise<void>;
/**
* Runs for each package, after writing changelog and package.json updates
* to the filesystem. May be called multiple times during publish.
*/
postbump?: (packagePath: string, name: string, version: string) => void | Promise<void>;
}
export interface TransformOptions {
/**
* Runs for each of the filtered change files.
*
* This allows for adding or editing information to the change files
* without having to modify anything on the disk.
*/
changeFiles?: (changeInfo: ChangeInfo | ChangeInfoMultiple, changeFilePath: string) => ChangeInfo;
}