Skip to content

Commit 5261efb

Browse files
committed
Add some comments
1 parent da9760f commit 5261efb

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/changefile/promptForChange.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export async function promptForChange(options: BeachballOptions): Promise<Change
2828

2929
const packageGroups = getPackageGroups(packageInfos, options.path, options.groups);
3030

31+
// Check recent commit messages for structured conventional
32+
// commits. If present, and --useConventionalCommits is set, fetch
33+
// change type and description from the first available commit
34+
// message.
3135
const fromConventionalCommits =
3236
(options.useConventionalCommits &&
3337
recentMessages.map(parseConventionalCommit).filter(<T>(obj: T | undefined): obj is T => !!obj)) ||
@@ -75,6 +79,7 @@ export async function promptForChange(options: BeachballOptions): Promise<Change
7579
},
7680
};
7781

82+
// Only include structured commit messages that map to an allowed change type.
7883
const allowedConventionalCommit = fromConventionalCommits.find((c) => !disallowedChangeTypes?.includes(c.type));
7984
const showChangeTypePrompt = !options.type && !allowedConventionalCommit && changeTypePrompt.choices!.length > 1;
8085

0 commit comments

Comments
 (0)