name: beachball-change-file description: How to create a Beachball change file. ONLY use this skill when the user asks to generate change files or before creating a PR.
Every pull request must include a Beachball change file under /change. Change files include the list of changed packages in a branch, with the description and semver change type for each package. After the PR is checked in and a release is run, the change files are used to determine version bumps and update changelogs.
Beachball normally uses a CLI with an interactive prompt to create change files, but they can also be created manually using the standardized JSON format detailed below.
Creating a change file manually
- Get the list of files with unstaged/untracked changes:
git ls-files -mandgit ls-files -o --exclude-standard. (Do not check the the diff contents.) - If there are any files from step 1, ask the user whether they would like to stage all files (
git add .) or continue without staging. If they choose to stage, rungit add .before proceeding. - Run
yarn beachball check --verboseto get the list of changed packages and files detected bybeachball(this excludes certain files such as tests).- The list of changed packages is under "Found changes in the following packages"
- The list of changed files is under "changed files in current branch". Ignore any files with
~~strikethrough formatting. - DO NOT use
git diffto get the list of changed files, since this doesn't respect beachball'signorePatternssetting
- Create a single change file under
change/change-<random guid>.jsonwith achangesentry for each package. See below for the change file format. - Currently, Beachball only detects change files that have been committed, so the new change file will need to be committed before verification. Ask the user if they'd like to commit the change file and other staged changes. If yes,
git addthe change file, commit all staged changes with an informative message, then re-runbeachball checkto verify.
Change file format
Each change file is located under change/change-<random guid>.json. It has the following format, with a changes entry for each changed package:
{
"changes": [
{
"packageName": "",
"type": "",
"dependentChangeType": "",
"comment": "",
"email": ""
}
]
}
Each package's entry has the following values:
packageName: The name of the changed package, e.g.just-tasktype: The semantic versioning change type for the package:<patch|minor|major|none>. Determine this based on the diff content of changed files in that package:- "patch": Bug fixes or other changes that don't impact exported API signatures.
- "minor": New exported APIs, non-breaking signature changes to exported APIs, or more significant changes to internal logic.
- "major": Breaking changes to exported APIs (removals or breaking signature changes), critical dependency updates, or behavior changes that might be breaking for the consumer. You MUST confirm with the user before choosing "major".
- "none": None of the changes will impact consumers of the package (e.g. the changes are only to non-exported test-specific files or documentation). If you're not certain, prefer "patch".
- If not certain about the change type, ask the user to choose one of the options above based on the diff content.
dependentChangeType: Change type for packages that depend on this package. Iftypeis "none", this should be "none". Otherwise, this should be "patch".comment: A concise description of the changes made to the package. This will go in the changelog, so it should focus on user-facing changes rather than implementation details. This field accepts markdown formatting.email: User's email fromgit config user.email, or "email not defined" if not available.