Skip to content

Commit

Permalink
more docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ecraig12345 committed Jul 11, 2023
1 parent 4691e8b commit 515b5a5
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 4 deletions.
32 changes: 29 additions & 3 deletions docs/cli/change.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,43 @@ $ beachball change

### Options

Some [general options](./options) including `--branch` also apply for this command.
Some [general options](./options) including `--branch` and `--scope` also apply for this command.

| Option | Alias | Default | Description |
| ------------- | ----- | -------------------- | --------------------------------------------------------------------------------- |
| `--all` | | false | Generate change files for all packages |
| `--message` | `-m` | (interactive prompt) | Description for all change files |
| `--no-commit` | | false | Stage the change file rather than committing |
| `--no-commit` | | false | Stage the change files rather than committing |
| `--package` | | (changed packages) | Generate change files for these packages (option can be specified multiple times) |
| `--type` | | (interactive prompt) | Type for all the change files (must be valid for each package) |

### Walkthrough
### Examples

Basic interactive prompt (see [walkthrough](#prompt-walkthrough) for details):

```
beachball change
```

Skip the interactive prompt by specifying a message and type for all changed packages:

```
beachball change --type patch --message 'some message'
```

Generate change file for specific package(s), regardless of changes, and even if a change file already exists for the package in this branch. Each package must be specified with a separate `--package` option. (You can also use the `--message` and `--type` options here.)

```
beachball change --package foo --package bar
```

Generate change files for all packages, regardless of changes. This would most often be used for build config updates which only touch a shared config file, but actually impact the output of all packages.

```
beachball change --all --type patch --message 'update build output settings'
```

### Prompt walkthrough

If you have changes that are not committed yet (i.e. `git status` reports changes), then `beachball change` will warn you about these:

Expand Down
4 changes: 3 additions & 1 deletion src/validation/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export function validate(

const packageInfos = getPackageInfos(options.path);

if (typeof options.package === 'string' && !packageInfos[options.package]) {
if (options.all && options.package) {
logValidationError('Cannot specify both "all" and "package" options');
} else if (typeof options.package === 'string' && !packageInfos[options.package]) {
logValidationError(`package "${options.package}" was not found`);
} else {
const invalidPackages = Array.isArray(options.package)
Expand Down

0 comments on commit 515b5a5

Please sign in to comment.