Having the `scripts` dir re-use all packages from the top-level was getting quite unwieldy. Created new `tools` directory that is part of the workspace. Packages are exported with the `@tools` package namespace.
17 lines
460 B
TypeScript
17 lines
460 B
TypeScript
import type { ChangelogConfig } from 'changelogen'
|
|
|
|
import { determineSemverChange, getGitDiff, loadChangelogConfig, parseCommits } from 'changelogen'
|
|
|
|
export async function getLatestCommits(
|
|
fromVersion: string,
|
|
toVersion: string,
|
|
config?: ChangelogConfig,
|
|
) {
|
|
if (!config) {
|
|
config = await loadChangelogConfig(process.cwd(), {
|
|
repo: 'payloadcms/payload',
|
|
})
|
|
}
|
|
return parseCommits(await getGitDiff(fromVersion, toVersion), config)
|
|
}
|