1+ // Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.
2+ // See LICENSE in the project root for license information.
3+
14import {
25 IChangeInfo ,
36 RushConfiguration ,
@@ -11,6 +14,10 @@ import ChangeFiles from './ChangeFiles';
1114import PrereleaseToken from './PrereleaseToken' ;
1215import ChangelogGenerator from './ChangelogGenerator' ;
1316
17+ /**
18+ * The class manages change files and controls how changes logged by change files
19+ * can be applied to package.json and change logs.
20+ */
1421export default class ChangeManager {
1522 private _prereleaseToken : PrereleaseToken ;
1623 private _orderedChanges : IChangeInfo [ ] ;
@@ -21,6 +28,12 @@ export default class ChangeManager {
2128 constructor ( private _rushConfiguration : RushConfiguration ) {
2229 }
2330
31+ /**
32+ * Load changes from change files
33+ * @param changesPath - location of change files
34+ * @param prereleaseToken - prerelease token
35+ * @param includeCommitDetails - whether commit details need to be included in changes
36+ */
2437 public load (
2538 changesPath : string ,
2639 prereleaseToken : PrereleaseToken = new PrereleaseToken ( ) ,
@@ -51,6 +64,11 @@ export default class ChangeManager {
5164 return this . _allPackages ;
5265 }
5366
67+ /**
68+ * Apply changes to package.json and change logs
69+ * @param shouldCommit - If the value is true, package.json and change logs will be updated.
70+ * If the value is false, package.json and change logs will not be updated. It will only do a dry-run.
71+ */
5472 public apply ( shouldCommit : boolean ) : void {
5573 if ( ! this . hasChanges ( ) ) {
5674 return ;
0 commit comments