@@ -92,6 +92,10 @@ type UpdateOptions = {
92
92
projectRootDirectory ? : string ;
93
93
tagPrefix: string ;
94
94
formatter: Formatter ;
95
+ /**
96
+ * The package rename properties, used in case of package is renamed
97
+ */
98
+ packageRename ? : PackageRename ;
95
99
} ;
96
100
97
101
/**
@@ -105,6 +109,8 @@ type UpdateOptions = {
105
109
* @param options.projectRootDirectory - The root project directory.
106
110
* @param options.tagPrefix - The prefix used in tags before the version number.
107
111
* @param options.formatter - A custom Markdown formatter to use.
112
+ * @param options.packageRename - The package rename properties.
113
+ * An optional, which is required only in case of package renamed.
108
114
*/
109
115
async function update ( {
110
116
changelogPath,
@@ -114,6 +120,7 @@ async function update({
114
120
projectRootDirectory,
115
121
tagPrefix,
116
122
formatter,
123
+ packageRename,
117
124
} : UpdateOptions ) {
118
125
const changelogContent = await readChangelog ( changelogPath ) ;
119
126
@@ -125,6 +132,7 @@ async function update({
125
132
projectRootDirectory,
126
133
tagPrefixes : [ tagPrefix ] ,
127
134
formatter,
135
+ packageRename,
128
136
} ) ;
129
137
130
138
if ( newChangelogContent ) {
@@ -465,6 +473,13 @@ async function main() {
465
473
} ;
466
474
467
475
if ( command === 'update' ) {
476
+ let packageRename : PackageRename | undefined ;
477
+ if ( versionBeforePackageRename && tagPrefixBeforePackageRename ) {
478
+ packageRename = {
479
+ versionBeforeRename : versionBeforePackageRename ,
480
+ tagPrefixBeforeRename : tagPrefixBeforePackageRename ,
481
+ } ;
482
+ }
468
483
await update ( {
469
484
changelogPath,
470
485
currentVersion,
@@ -473,6 +488,7 @@ async function main() {
473
488
projectRootDirectory,
474
489
tagPrefix,
475
490
formatter,
491
+ packageRename,
476
492
} ) ;
477
493
} else if ( command === 'validate' ) {
478
494
let packageRename : PackageRename | undefined ;
0 commit comments