Skip to content

Commit f3c0997

Browse files
committed
refactor: rename currentRelease -> parentRelease
1 parent 1f37e54 commit f3c0997

4 files changed

Lines changed: 18 additions & 18 deletions

File tree

lib/git.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default class Git extends CoreGit {
7676
200,
7777
new GitChangelog( res.data.changes, {
7878
"upstream": this.upstream,
79-
"parentRelease": res.data.parentRelease,
79+
"startRelease": res.data.parentRelease,
8080
"endRelease": null,
8181
commitTypes,
8282
} )
@@ -94,7 +94,7 @@ export default class Git extends CoreGit {
9494
200,
9595
new GitChangelog( res.data.changes, {
9696
"upstream": this.upstream,
97-
"parentRelease": res.data.startRelease,
97+
"startRelease": res.data.startRelease,
9898
"endRelease": res.data.endRelease,
9999
commitTypes,
100100
} )

lib/git/changelog.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ const TITLES = {
2222
export default class GitChangelog {
2323
#changes;
2424
#upstream;
25-
#parentRelease;
25+
#startRelease;
2626
#endRelease;
2727
#changesGroups;
2828
#notableChanges = 0;
2929
#report;
3030

31-
constructor ( changes, { upstream, parentRelease, endRelease, commitTypes } ) {
31+
constructor ( changes, { upstream, startRelease, endRelease, commitTypes } ) {
3232
this.#changes = changes;
3333
this.#upstream = upstream;
34-
this.#parentRelease = parentRelease;
34+
this.#startRelease = startRelease;
3535
this.#endRelease = endRelease;
3636

3737
this.#indexChanges( commitTypes || DEFAULT_COMMIT_TYPES );
@@ -47,8 +47,8 @@ export default class GitChangelog {
4747
}
4848

4949
// properties
50-
get parentRelease () {
51-
return this.#parentRelease;
50+
get startRelease () {
51+
return this.#startRelease;
5252
}
5353

5454
get endRelease () {
@@ -87,9 +87,9 @@ export default class GitChangelog {
8787
"changelog": this,
8888
endRelease,
8989
"changesGroups": this.#changesGroups,
90-
"compareUrl": !this.#parentRelease || !endRelease
90+
"compareUrl": !this.#startRelease || !endRelease
9191
? null
92-
: this.#upstream?.getCompareUrl( this.#parentRelease.versionString, endRelease.versionString ),
92+
: this.#upstream?.getCompareUrl( this.#startRelease.versionString, endRelease.versionString ),
9393
} );
9494

9595
changelog = changelog.trim();
@@ -181,10 +181,10 @@ export default class GitChangelog {
181181
}
182182

183183
createNextVersion ( preReleaseTag ) {
184-
const parentRelease = this.parentRelease || SemanticVersion.initialVersion;
184+
const startRelease = this.startRelease || SemanticVersion.initialVersion;
185185

186186
try {
187-
const nextVersion = parentRelease.increment( parentRelease.isInitialVersion
187+
const nextVersion = startRelease.increment( startRelease.isInitialVersion
188188
? "patch"
189189
: this.hasBreakingChanges
190190
? "major"
@@ -265,14 +265,14 @@ export default class GitChangelog {
265265
}
266266

267267
#createHeader ( endRelease ) {
268-
if ( this.#parentRelease && endRelease ) {
269-
return `**Changes between the releases: \`${ this.#parentRelease.versionString }\` (${ this.#parentRelease.changelogDate }) ... \`${ endRelease.versionString }\` (${ endRelease.changelogDate })**`;
268+
if ( this.#startRelease && endRelease ) {
269+
return `**Changes between the releases: \`${ this.#startRelease.versionString }\` (${ this.#startRelease.changelogDate }) ... \`${ endRelease.versionString }\` (${ endRelease.changelogDate })**`;
270270
}
271-
else if ( !this.#parentRelease && endRelease ) {
271+
else if ( !this.#startRelease && endRelease ) {
272272
return `**Changes for the release: \`${ endRelease.versionString }\` (${ endRelease.changelogDate })**`;
273273
}
274-
else if ( this.#parentRelease && !this.#endRelease ) {
275-
return `**Changes since the release: \`${ this.#parentRelease.versionString }\` (${ this.#parentRelease.changelogDate })**`;
274+
else if ( this.#startRelease && !this.#endRelease ) {
275+
return `**Changes since the release: \`${ this.#startRelease.versionString }\` (${ this.#startRelease.changelogDate })**`;
276276
}
277277
else {
278278
return "**Changes since the initial commit**";

lib/package/release.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ export default class Publish {
432432
if ( !res.ok ) return res;
433433

434434
this.#changelog = res.data;
435-
this.#parentRelease = this.#changelog.parentRelease;
435+
this.#parentRelease = this.#changelog.startRelease;
436436
}
437437

438438
return result( 200, this.#changelog );

resources/templates/changelog.md.ejs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ See the list of the breaking changes below for details.
2323
<%_ } -%>
2424
<%_ if ( compareUrl ) { -%>
2525
26-
Compare with the previous release: [<%- changelog.parentRelease.versionString %>](<%- compareUrl %>)
26+
Compare with the previous release: [<%- changelog.startRelease.versionString %>](<%- compareUrl %>)
2727
<%_ } -%>

0 commit comments

Comments
 (0)