Skip to content

Commit 9aa21dc

Browse files
authored
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.
1 parent 46779b3 commit 9aa21dc

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
@@ -72,13 +72,28 @@ export const releasePackages = [
7272

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

0 commit comments

Comments
 (0)