Skip to content

Commit 4df9738

Browse files
devversionmmalerba
authored andcommitted
build: group commits by package name in changelog (#23460)
Currently the new release tooling groups changes in the changelog based on their commit scope. This is the default behavior that works well for FW and the CLI repo. For the components repository, we also include secondary entry-point information in commit messages. This currently results in many unnecessary groups, while ideally we'd want to group based on the package name in the scope. This commit implements that. (cherry picked from commit 9aa21dc)
1 parent 51e0ffb commit 4df9738

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

.ng-dev/release.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,28 @@ export const releasePackages = [
7171

7272
/** Configuration for the `ng-dev release` command. */
7373
export const release: ReleaseConfig = {
74-
releaseNotes: {useReleaseTitle: true, groupOrder: releasePackages},
74+
releaseNotes: {
75+
useReleaseTitle: true,
76+
groupOrder: releasePackages,
77+
categorizeCommit: commit => {
78+
const [packageName, entryPointName] = commit.scope.split('/');
79+
const entryPointPrefix = entryPointName ? `**${entryPointName}:** ` : '';
80+
81+
// In the `angular/components` repository, commit messages may include entry-point
82+
// information in the scope. We expect commits to be grouped based on their package
83+
// name. Commits are then described with their subject and optional entry-point name.
84+
return {
85+
groupName: packageName,
86+
description: `${entryPointPrefix}${commit.subject}`,
87+
};
88+
},
89+
},
7590
publishRegistry: 'https://wombat-dressing-room.appspot.com',
7691
npmPackages: releasePackages.map(pkg => `@angular/${pkg}`),
7792
buildPackages: async () => {
7893
// The `performNpmReleaseBuild` function is loaded at runtime as loading of the
7994
// script results in an invocation of Bazel for any `yarn ng-dev` command.
8095
const {performNpmReleaseBuild} = await import('../scripts/build-packages-dist');
8196
return performNpmReleaseBuild();
82-
}
97+
},
8398
};

0 commit comments

Comments
 (0)