Skip to content

Commit 23dbb46

Browse files
committed
Add some comments
1 parent 22ba0b6 commit 23dbb46

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
@@ -24,6 +24,10 @@ export async function promptForChange(options: BeachballOptions) {
2424
const packageInfos = getPackageInfos(cwd);
2525
const packageGroups = getPackageGroups(packageInfos, options.path, options.groups);
2626

27+
// Check recent commit messages for structured conventional
28+
// commits. If present, and --useConventionalCommits is set, fetch
29+
// change type and description from the first available commit
30+
// message.
2731
const fromConventionalCommits =
2832
(options.useConventionalCommits &&
2933
recentMessages.map(parseConventionalCommit).filter(<T>(obj: T | undefined): obj is T => !!obj)) ||
@@ -71,6 +75,7 @@ export async function promptForChange(options: BeachballOptions) {
7175
},
7276
};
7377

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

0 commit comments

Comments
 (0)