@metamask/auto-changelog
Advanced tools
Comparing version 3.4.3 to 3.4.4
@@ -85,4 +85,6 @@ #!/usr/bin/env node | ||
* @param options.formatter - A custom Markdown formatter to use. | ||
* @param options.packageRename - The package rename properties. | ||
* An optional, which is required only in case of package renamed. | ||
*/ | ||
async function update({ changelogPath, currentVersion, isReleaseCandidate, repoUrl, projectRootDirectory, tagPrefix, formatter, }) { | ||
async function update({ changelogPath, currentVersion, isReleaseCandidate, repoUrl, projectRootDirectory, tagPrefix, formatter, packageRename, }) { | ||
const changelogContent = await readChangelog(changelogPath); | ||
@@ -97,2 +99,3 @@ const newChangelogContent = await (0, update_changelog_1.updateChangelog)({ | ||
formatter, | ||
packageRename, | ||
}); | ||
@@ -351,2 +354,9 @@ if (newChangelogContent) { | ||
if (command === 'update') { | ||
let packageRename; | ||
if (versionBeforePackageRename && tagPrefixBeforePackageRename) { | ||
packageRename = { | ||
versionBeforeRename: versionBeforePackageRename, | ||
tagPrefixBeforeRename: tagPrefixBeforePackageRename, | ||
}; | ||
} | ||
await update({ | ||
@@ -360,2 +370,3 @@ changelogPath, | ||
formatter, | ||
packageRename, | ||
}); | ||
@@ -362,0 +373,0 @@ } |
import { Formatter } from './changelog'; | ||
import { Version } from './constants'; | ||
import { PackageRename } from './shared-types'; | ||
export declare type UpdateChangelogOptions = { | ||
@@ -11,2 +12,6 @@ changelogContent: string; | ||
formatter?: Formatter; | ||
/** | ||
* The package rename properties, used in case of package is renamed | ||
*/ | ||
packageRename?: PackageRename; | ||
}; | ||
@@ -33,4 +38,6 @@ /** | ||
* @param options.formatter - A custom Markdown formatter to use. | ||
* @param options.packageRename - The package rename properties. | ||
* An optional, which is required only in case of package renamed. | ||
* @returns The updated changelog text. | ||
*/ | ||
export declare function updateChangelog({ changelogContent, currentVersion, repoUrl, isReleaseCandidate, projectRootDirectory, tagPrefixes, formatter, }: UpdateChangelogOptions): Promise<string | undefined>; | ||
export declare function updateChangelog({ changelogContent, currentVersion, repoUrl, isReleaseCandidate, projectRootDirectory, tagPrefixes, formatter, packageRename, }: UpdateChangelogOptions): Promise<string | undefined>; |
@@ -158,5 +158,7 @@ "use strict"; | ||
* @param options.formatter - A custom Markdown formatter to use. | ||
* @param options.packageRename - The package rename properties. | ||
* An optional, which is required only in case of package renamed. | ||
* @returns The updated changelog text. | ||
*/ | ||
async function updateChangelog({ changelogContent, currentVersion, repoUrl, isReleaseCandidate, projectRootDirectory, tagPrefixes = ['v'], formatter = undefined, }) { | ||
async function updateChangelog({ changelogContent, currentVersion, repoUrl, isReleaseCandidate, projectRootDirectory, tagPrefixes = ['v'], formatter = undefined, packageRename, }) { | ||
const changelog = (0, parse_changelog_1.parseChangelog)({ | ||
@@ -167,2 +169,3 @@ changelogContent, | ||
formatter, | ||
packageRename, | ||
}); | ||
@@ -169,0 +172,0 @@ // Ensure we have all tags on remote |
{ | ||
"name": "@metamask/auto-changelog", | ||
"version": "3.4.3", | ||
"version": "3.4.4", | ||
"description": "Utilities for validating and updating \"Keep a Changelog\" formatted changelogs", | ||
@@ -5,0 +5,0 @@ "publishConfig": { |
@@ -35,2 +35,14 @@ # @metamask/auto-changelog | ||
#### Update the changelog for a renamed package | ||
This option is designed to be used for packages that live in a monorepo. | ||
For instance, if your package is called `polling-controller` and was renamed to `@metamask/polling-controller` at version 0.2.3, and thus the Git tags followed suit: | ||
`yarn run auto-changelog update --tag-prefix-before-package-rename "polling-controller@" --version-before-package-name 0.2.3 --tag-prefix "@metamask/polling-controller@"` | ||
or | ||
`npm run auto-changelog update --tag-prefix-before-package-rename "polling-controller@" --version-before-package-name 0.2.3 --tag-prefix "@metamask/polling-controller@"` | ||
### Validate | ||
@@ -37,0 +49,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
205772
2000
190