Skip to content

Commit

Permalink
Add more properties to RepoOptions instead of just CliOptions (#1024)
Browse files Browse the repository at this point in the history
  • Loading branch information
ecraig12345 authored Nov 26, 2024
1 parent 7447005 commit 618fd13
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 23 deletions.
7 changes: 7 additions & 0 deletions change/beachball-b77b0445-c306-4b28-989e-474c4719a890.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "Add more properties to RepoOptions instead of just CliOptions",
"packageName": "beachball",
"email": "[email protected]",
"dependentChangeType": "patch"
}
67 changes: 44 additions & 23 deletions src/types/BeachballOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,23 @@ export interface CliOptions
RepoOptions,
| 'access'
| 'branch'
| 'bump'
| 'bumpDeps'
| 'canaryName'
| 'changehint'
| 'changeDir'
| 'commit'
| 'concurrency'
| 'depth'
| 'disallowedChangeTypes'
| 'disallowDeletedChangeFiles'
| 'fetch'
| 'fromRef'
| 'gitTags'
| 'gitTimeout'
| 'keepChangeFiles'
| 'message'
| 'new'
| 'path'
| 'prereleasePrefix'
| 'publish'
Expand All @@ -28,46 +36,27 @@ export interface CliOptions
| 'retries'
| 'scope'
| 'tag'
| 'timeout'
> {
all: boolean;
authType: AuthType;
bump: boolean;
canaryName?: string | undefined;
command: string;
commit?: boolean;
configPath?: string;
dependentChangeType?: ChangeType;
disallowDeletedChangeFiles?: boolean;
/**
* For sync: use the version from the registry even if it's older than local.
*/
forceVersions?: boolean;
/**
* Consider change files since this git ref (branch name, commit SHA, etc).
*/
fromRef?: string;
help?: boolean;
keepChangeFiles?: boolean;
/**
* For publish: If true, publish all newly added packages in addition to modified packages.
* This is rarely needed since new packages *with change files* will always be published
* regardless of this option.
*
* (This has limited use unless you pushed new packages directly to the main branch, or
* your PR build doesn't run `beachball check`. Otherwise, `beachball check` will require
* change files to be created for the new packages.)
*/
new: boolean;
package?: string | string[];
/** Timeout for npm operations (other than install, which is expected to take longer) */
timeout?: number;
/** Timeout for `git push` operations */
gitTimeout?: number;
token?: string;
type?: ChangeType | null;
verbose?: boolean;
version?: boolean;
yes: boolean;

// ONLY add new options here if they only make sense on the command line!
// Most options should be defined in RepoOptions and added to the Pick<...> above.
}

export interface RepoOptions {
Expand All @@ -85,11 +74,17 @@ export interface RepoOptions {
* @default 'origin/master'
*/
branch: string;
/**
* Whether to bump versions during publish.
* @default true
*/
bump: boolean;
/**
* Bump dependent packages during publish: e.g. if B is bumped, and A depends on B, also bump A.
* @default true
*/
bumpDeps: boolean;
canaryName?: string;
/** Options for customizing change file prompt. */
changeFilePrompt?: ChangeFilePromptOptions;
/**
Expand All @@ -104,6 +99,12 @@ export interface RepoOptions {
changeDir: string;
/** Options for customizing changelog rendering */
changelog?: ChangelogOptions;
/**
* If true, commit change files automatically after `beachball change`.
* If false, only stage them.
* @default true
*/
commit?: boolean;
/**
* Maximum concurrency.
* As of writing, concurrency only applies for calling hooks and publishing to npm.
Expand All @@ -117,11 +118,16 @@ export interface RepoOptions {
defaultNpmTag: string;
/** What change types are disallowed */
disallowedChangeTypes: ChangeType[] | null;
disallowDeletedChangeFiles?: boolean;
/**
* Fetch from remote before doing diff comparisons
* @default true
*/
fetch: boolean;
/**
* Consider change files since this git ref (branch name, commit SHA, etc).
*/
fromRef?: string;
/**
* Whether to generate changelog files.
* - `true` (default) to generate both CHANGELOG.md and CHANGELOG.json
Expand All @@ -144,6 +150,7 @@ export interface RepoOptions {
* Patterns are relative to the repo root and must use forward slashes.
*/
ignorePatterns?: string[];
keepChangeFiles?: boolean;
/** For the `change` command, change message. For the `publish` command, commit message. */
message: string;
/**
Expand Down Expand Up @@ -193,12 +200,26 @@ export interface RepoOptions {
* @default 'latest'
*/
tag: string;
/** Timeout for npm operations (other than install, which is expected to take longer) */
timeout?: number;
/** Timeout for `git push` operations */
gitTimeout?: number;
/** Transformations for change files */
transform?: TransformOptions;
/** Put multiple changes in a single changefile */
groupChanges?: boolean;
/** For shallow clones only: Depth of git history to consider when doing fetch */
depth?: number;
/**
* For publish: If true, publish all newly added packages in addition to modified packages.
* This is rarely needed since new packages *with change files* will always be published
* regardless of this option.
*
* (This has limited use unless you pushed new packages directly to the main branch, or
* your PR build doesn't run `beachball check`. Otherwise, `beachball check` will require
* change files to be created for the new packages.)
*/
new: boolean;
}

export interface PackageOptions {
Expand Down

0 comments on commit 618fd13

Please sign in to comment.