Skip to content

Commit 618fd13

Browse files
authored
Add more properties to RepoOptions instead of just CliOptions (#1024)
1 parent 7447005 commit 618fd13

File tree

2 files changed

+51
-23
lines changed

2 files changed

+51
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "minor",
3+
"comment": "Add more properties to RepoOptions instead of just CliOptions",
4+
"packageName": "beachball",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

src/types/BeachballOptions.ts

+44-23
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,23 @@ export interface CliOptions
1111
RepoOptions,
1212
| 'access'
1313
| 'branch'
14+
| 'bump'
1415
| 'bumpDeps'
16+
| 'canaryName'
1517
| 'changehint'
1618
| 'changeDir'
19+
| 'commit'
1720
| 'concurrency'
1821
| 'depth'
1922
| 'disallowedChangeTypes'
23+
| 'disallowDeletedChangeFiles'
2024
| 'fetch'
25+
| 'fromRef'
2126
| 'gitTags'
27+
| 'gitTimeout'
28+
| 'keepChangeFiles'
2229
| 'message'
30+
| 'new'
2331
| 'path'
2432
| 'prereleasePrefix'
2533
| 'publish'
@@ -28,46 +36,27 @@ export interface CliOptions
2836
| 'retries'
2937
| 'scope'
3038
| 'tag'
39+
| 'timeout'
3140
> {
3241
all: boolean;
3342
authType: AuthType;
34-
bump: boolean;
35-
canaryName?: string | undefined;
3643
command: string;
37-
commit?: boolean;
3844
configPath?: string;
3945
dependentChangeType?: ChangeType;
40-
disallowDeletedChangeFiles?: boolean;
4146
/**
4247
* For sync: use the version from the registry even if it's older than local.
4348
*/
4449
forceVersions?: boolean;
45-
/**
46-
* Consider change files since this git ref (branch name, commit SHA, etc).
47-
*/
48-
fromRef?: string;
4950
help?: boolean;
50-
keepChangeFiles?: boolean;
51-
/**
52-
* For publish: If true, publish all newly added packages in addition to modified packages.
53-
* This is rarely needed since new packages *with change files* will always be published
54-
* regardless of this option.
55-
*
56-
* (This has limited use unless you pushed new packages directly to the main branch, or
57-
* your PR build doesn't run `beachball check`. Otherwise, `beachball check` will require
58-
* change files to be created for the new packages.)
59-
*/
60-
new: boolean;
6151
package?: string | string[];
62-
/** Timeout for npm operations (other than install, which is expected to take longer) */
63-
timeout?: number;
64-
/** Timeout for `git push` operations */
65-
gitTimeout?: number;
6652
token?: string;
6753
type?: ChangeType | null;
6854
verbose?: boolean;
6955
version?: boolean;
7056
yes: boolean;
57+
58+
// ONLY add new options here if they only make sense on the command line!
59+
// Most options should be defined in RepoOptions and added to the Pick<...> above.
7160
}
7261

7362
export interface RepoOptions {
@@ -85,11 +74,17 @@ export interface RepoOptions {
8574
* @default 'origin/master'
8675
*/
8776
branch: string;
77+
/**
78+
* Whether to bump versions during publish.
79+
* @default true
80+
*/
81+
bump: boolean;
8882
/**
8983
* Bump dependent packages during publish: e.g. if B is bumped, and A depends on B, also bump A.
9084
* @default true
9185
*/
9286
bumpDeps: boolean;
87+
canaryName?: string;
9388
/** Options for customizing change file prompt. */
9489
changeFilePrompt?: ChangeFilePromptOptions;
9590
/**
@@ -104,6 +99,12 @@ export interface RepoOptions {
10499
changeDir: string;
105100
/** Options for customizing changelog rendering */
106101
changelog?: ChangelogOptions;
102+
/**
103+
* If true, commit change files automatically after `beachball change`.
104+
* If false, only stage them.
105+
* @default true
106+
*/
107+
commit?: boolean;
107108
/**
108109
* Maximum concurrency.
109110
* As of writing, concurrency only applies for calling hooks and publishing to npm.
@@ -117,11 +118,16 @@ export interface RepoOptions {
117118
defaultNpmTag: string;
118119
/** What change types are disallowed */
119120
disallowedChangeTypes: ChangeType[] | null;
121+
disallowDeletedChangeFiles?: boolean;
120122
/**
121123
* Fetch from remote before doing diff comparisons
122124
* @default true
123125
*/
124126
fetch: boolean;
127+
/**
128+
* Consider change files since this git ref (branch name, commit SHA, etc).
129+
*/
130+
fromRef?: string;
125131
/**
126132
* Whether to generate changelog files.
127133
* - `true` (default) to generate both CHANGELOG.md and CHANGELOG.json
@@ -144,6 +150,7 @@ export interface RepoOptions {
144150
* Patterns are relative to the repo root and must use forward slashes.
145151
*/
146152
ignorePatterns?: string[];
153+
keepChangeFiles?: boolean;
147154
/** For the `change` command, change message. For the `publish` command, commit message. */
148155
message: string;
149156
/**
@@ -193,12 +200,26 @@ export interface RepoOptions {
193200
* @default 'latest'
194201
*/
195202
tag: string;
203+
/** Timeout for npm operations (other than install, which is expected to take longer) */
204+
timeout?: number;
205+
/** Timeout for `git push` operations */
206+
gitTimeout?: number;
196207
/** Transformations for change files */
197208
transform?: TransformOptions;
198209
/** Put multiple changes in a single changefile */
199210
groupChanges?: boolean;
200211
/** For shallow clones only: Depth of git history to consider when doing fetch */
201212
depth?: number;
213+
/**
214+
* For publish: If true, publish all newly added packages in addition to modified packages.
215+
* This is rarely needed since new packages *with change files* will always be published
216+
* regardless of this option.
217+
*
218+
* (This has limited use unless you pushed new packages directly to the main branch, or
219+
* your PR build doesn't run `beachball check`. Otherwise, `beachball check` will require
220+
* change files to be created for the new packages.)
221+
*/
222+
new: boolean;
202223
}
203224

204225
export interface PackageOptions {

0 commit comments

Comments
 (0)