/** * @license * Copyright Google LLC All Rights Reserved. * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://angular.io/license */ import {renderFile} from 'ejs'; import {join} from 'path'; import * as semver from 'semver'; import {getCommitsInRange} from '../../../commit-message/utils'; import {getConfig} from '../../../utils/config'; import {promptInput} from '../../../utils/console'; import {GitClient} from '../../../utils/git/index'; import {getReleaseConfig} from '../../config/index'; import {changelogPath} from '../constants'; import {RenderContext} from './context'; /** * Gets the default pattern for extracting release notes for the given version. * This pattern matches for the conventional-changelog Angular preset. */ export function getDefaultExtractReleaseNotesPattern(version: semver.SemVer): RegExp { const escapedVersion = version.format().replace('.', '\\.'); // TODO: Change this once we have a canonical changelog generation tool. Also update this // based on the conventional-changelog version. They removed anchors in more recent versions. return new RegExp(`(.*?)(?: