@ckeditor/ckeditor5-dev-release-tools 44.0.0-alpha.4 → 44.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/lib/tasks/cleanuppackages.js +22 -22
  2. package/lib/tasks/commitandtag.js +4 -4
  3. package/lib/tasks/creategithubrelease.js +11 -11
  4. package/lib/tasks/generatechangelogformonorepository.js +54 -54
  5. package/lib/tasks/generatechangelogforsinglepackage.js +11 -11
  6. package/lib/tasks/preparerepository.js +19 -19
  7. package/lib/tasks/publishpackages.js +10 -10
  8. package/lib/tasks/push.js +4 -4
  9. package/lib/tasks/reassignnpmtags.js +8 -8
  10. package/lib/tasks/updatedependencies.js +14 -14
  11. package/lib/tasks/updateversions.js +18 -18
  12. package/lib/tasks/verifypackagespublishedcorrectly.js +4 -4
  13. package/lib/utils/assertfilestopublish.js +6 -6
  14. package/lib/utils/assertnpmauthorization.js +1 -1
  15. package/lib/utils/assertnpmtag.js +4 -4
  16. package/lib/utils/assertpackages.js +4 -4
  17. package/lib/utils/checkversionavailability.js +2 -2
  18. package/lib/utils/configurereleaseoptions.js +1 -1
  19. package/lib/utils/confirmincludingpackage.js +1 -1
  20. package/lib/utils/confirmnpmtag.js +3 -3
  21. package/lib/utils/displaycommits.js +4 -4
  22. package/lib/utils/executeinparallel.js +20 -19
  23. package/lib/utils/generatechangelog.js +23 -23
  24. package/lib/utils/getchangedfilesforcommit.js +2 -2
  25. package/lib/utils/getchangelog.js +2 -2
  26. package/lib/utils/getchangesforversion.js +3 -3
  27. package/lib/utils/getcommits.js +7 -6
  28. package/lib/utils/getformatteddate.js +1 -1
  29. package/lib/utils/getnewversiontype.js +1 -1
  30. package/lib/utils/getnpmtagfromversion.js +2 -2
  31. package/lib/utils/getpackagejson.js +2 -2
  32. package/lib/utils/getpackagespaths.js +9 -9
  33. package/lib/utils/getwriteroptions.js +1 -1
  34. package/lib/utils/isversionpublishablefortag.js +4 -4
  35. package/lib/utils/parallelworker.js +2 -2
  36. package/lib/utils/providenewversionformonorepository.js +6 -6
  37. package/lib/utils/providetoken.js +1 -1
  38. package/lib/utils/provideversion.js +12 -12
  39. package/lib/utils/publishpackageonnpmcallback.js +3 -3
  40. package/lib/utils/savechangelog.js +2 -2
  41. package/lib/utils/transformcommitfactory.js +27 -27
  42. package/lib/utils/transformcommitutils.js +13 -13
  43. package/lib/utils/truncatechangelog.js +2 -2
  44. package/lib/utils/validaterepositorytorelease.js +6 -6
  45. package/lib/utils/versions.js +14 -14
  46. package/package.json +2 -2
@@ -19,12 +19,12 @@ import { glob } from 'glob';
19
19
  * - file pointed by the `types` field from `package.json`
20
20
  * - Removes unnecessary fields from the `package.json` file.
21
21
  *
22
- * @param {Object} options
23
- * @param {String} options.packagesDirectory Relative path to a location of packages to be cleaned up.
24
- * @param {Array.<String>|PackageJsonFieldsToRemoveCallback} [options.packageJsonFieldsToRemove] Fields to remove from `package.json`.
22
+ * @param {object} options
23
+ * @param {string} options.packagesDirectory Relative path to a location of packages to be cleaned up.
24
+ * @param {Array.<string>|PackageJsonFieldsToRemoveCallback} [options.packageJsonFieldsToRemove] Fields to remove from `package.json`.
25
25
  * If not set, a predefined list is used. If the callback is used, the first argument is the list with defaults.
26
- * @param {Boolean} [options.preservePostInstallHook] Whether to preserve the postinstall hook in `package.json`.
27
- * @param {String} [options.cwd] Current working directory from which all paths will be resolved.
26
+ * @param {boolean} [options.preservePostInstallHook] Whether to preserve the postinstall hook in `package.json`.
27
+ * @param {string} [options.cwd] Current working directory from which all paths will be resolved.
28
28
  * @returns {Promise}
29
29
  */
30
30
  export default async function cleanUpPackages( options ) {
@@ -50,12 +50,12 @@ export default async function cleanUpPackages( options ) {
50
50
  /**
51
51
  * Prepares the configuration options for the script.
52
52
  *
53
- * @param {Object} options
54
- * @param {String} options.packagesDirectory
55
- * @param {Array.<String>|PackageJsonFieldsToRemoveCallback} [options.packageJsonFieldsToRemove=DefaultFieldsToRemove]
56
- * @param {Boolean} [options.preservePostInstallHook]
57
- * @param {String} [options.cwd=process.cwd()]
58
- * @returns {Object}
53
+ * @param {object} options
54
+ * @param {string} options.packagesDirectory
55
+ * @param {Array.<string>|PackageJsonFieldsToRemoveCallback} [options.packageJsonFieldsToRemove=DefaultFieldsToRemove]
56
+ * @param {boolean} [options.preservePostInstallHook]
57
+ * @param {string} [options.cwd=process.cwd()]
58
+ * @returns {object}
59
59
  */
60
60
  function parseOptions( options ) {
61
61
  const defaultPackageJsonFieldsToRemove = [ 'devDependencies', 'depcheckIgnore', 'scripts', 'private' ];
@@ -79,8 +79,8 @@ function parseOptions( options ) {
79
79
  /**
80
80
  * Removes unnecessary files and directories from the package directory.
81
81
  *
82
- * @param {Object} packageJson
83
- * @param {String} packagePath
82
+ * @param {object} packageJson
83
+ * @param {string} packagePath
84
84
  * @returns {Promise}
85
85
  */
86
86
  async function cleanUpPackageDirectory( packageJson, packagePath ) {
@@ -129,8 +129,8 @@ async function cleanUpPackageDirectory( packageJson, packagePath ) {
129
129
  /**
130
130
  * Creates an array of patterns to ignore for the `glob` calls.
131
131
  *
132
- * @param {Object} packageJson
133
- * @returns {Array.<String>}
132
+ * @param {object} packageJson
133
+ * @returns {Array.<string>}
134
134
  */
135
135
  function getIgnoredFilePatterns( packageJson ) {
136
136
  // The patterns supported by `package.json` in the `files` field do not correspond 1:1 to the patterns expected by the `glob`.
@@ -155,9 +155,9 @@ function getIgnoredFilePatterns( packageJson ) {
155
155
  /**
156
156
  * Removes unnecessary fields from the `package.json`.
157
157
  *
158
- * @param {Object} packageJson
159
- * @param {Array.<String>} packageJsonFieldsToRemove
160
- * @param {Boolean} preservePostInstallHook
158
+ * @param {object} packageJson
159
+ * @param {Array.<string>} packageJsonFieldsToRemove
160
+ * @param {boolean} preservePostInstallHook
161
161
  */
162
162
  function cleanUpPackageJson( packageJson, packageJsonFieldsToRemove, preservePostInstallHook ) {
163
163
  for ( const key of Object.keys( packageJson ) ) {
@@ -176,9 +176,9 @@ function cleanUpPackageJson( packageJson, packageJsonFieldsToRemove, preservePos
176
176
  /**
177
177
  * Sort function that defines the order of the paths. It sorts paths from the most nested ones first.
178
178
  *
179
- * @param {String} firstPath
180
- * @param {String} secondPath
181
- * @returns {Number}
179
+ * @param {string} firstPath
180
+ * @param {string} secondPath
181
+ * @returns {number}
182
182
  */
183
183
  function sortPathsFromDeepestFirst( firstPath, secondPath ) {
184
184
  const firstPathSegments = firstPath.split( '/' ).length;
@@ -194,5 +194,5 @@ function sortPathsFromDeepestFirst( firstPath, secondPath ) {
194
194
  /**
195
195
  * @callback PackageJsonFieldsToRemoveCallback
196
196
  * @param {DefaultFieldsToRemove} defaults
197
- * @returns {Array.<String>}
197
+ * @returns {Array.<string>}
198
198
  */
@@ -13,10 +13,10 @@ const { toUnix } = upath;
13
13
  /**
14
14
  * Creates a commit and a tag for specified version.
15
15
  *
16
- * @param {Object} options
17
- * @param {String} options.version The commit will contain this param in its message and the tag will have a `v` prefix.
18
- * @param {Array.<String>} options.files Array of glob patterns for files to be added to the release commit.
19
- * @param {String} [options.cwd=process.cwd()] Current working directory from which all paths will be resolved.
16
+ * @param {object} options
17
+ * @param {string} options.version The commit will contain this param in its message and the tag will have a `v` prefix.
18
+ * @param {Array.<string>} options.files Array of glob patterns for files to be added to the release commit.
19
+ * @param {string} [options.cwd=process.cwd()] Current working directory from which all paths will be resolved.
20
20
  * @returns {Promise}
21
21
  */
22
22
  export default async function commitAndTag( { version, files, cwd = process.cwd() } ) {
@@ -12,12 +12,12 @@ const { getRepositoryUrl } = transformCommitUtils;
12
12
  /**
13
13
  * Create a GitHub release.
14
14
  *
15
- * @param {Object} options
16
- * @param {String} options.token Token used to authenticate with GitHub.
17
- * @param {String} options.version Name of tag connected with the release.
18
- * @param {String} options.description Description of the release.
19
- * @param {String} [options.cwd=process.cwd()] Current working directory from which all paths will be resolved.
20
- * @returns {Promise.<String>}
15
+ * @param {object} options
16
+ * @param {string} options.token Token used to authenticate with GitHub.
17
+ * @param {string} options.version Name of tag connected with the release.
18
+ * @param {string} options.description Description of the release.
19
+ * @param {string} [options.cwd=process.cwd()] Current working directory from which all paths will be resolved.
20
+ * @returns {Promise.<string>}
21
21
  */
22
22
  export default async function createGithubRelease( options ) {
23
23
  const {
@@ -51,8 +51,8 @@ export default async function createGithubRelease( options ) {
51
51
  /**
52
52
  * Returns an npm tag based on the specified release version.
53
53
  *
54
- * @param {String} version
55
- * @returns {String}
54
+ * @param {string} version
55
+ * @returns {string}
56
56
  */
57
57
  function getVersionTag( version ) {
58
58
  const [ versionTag ] = semver.prerelease( version ) || [ 'latest' ];
@@ -64,9 +64,9 @@ function getVersionTag( version ) {
64
64
  * Resolves a promise containing a flag if the GitHub contains the release page for given version.
65
65
  *
66
66
  * @param {Octokit} github
67
- * @param {String} repositoryOwner
68
- * @param {String} repositoryName
69
- * @param {String} version
67
+ * @param {string} repositoryOwner
68
+ * @param {string} repositoryName
69
+ * @param {string} version
70
70
  * @returns {Promise.<boolean>}
71
71
  */
72
72
  async function shouldCreateRelease( github, repositoryOwner, repositoryName, version ) {
@@ -35,37 +35,37 @@ const noteInfo = `[ℹ️](${ VERSIONING_POLICY_URL }#major-and-minor-breaking-c
35
35
  *
36
36
  * The typed version will be the same for all packages. See: https://github.com/ckeditor/ckeditor5/issues/7323.
37
37
  *
38
- * @param {Object} options
38
+ * @param {object} options
39
39
  *
40
- * @param {String} options.cwd Current working directory (packages) from which all paths will be resolved.
40
+ * @param {string} options.cwd Current working directory (packages) from which all paths will be resolved.
41
41
  *
42
- * @param {String} options.packages Where to look for packages.
42
+ * @param {string} options.packages Where to look for packages.
43
43
  *
44
- * @param {Function} options.transformScope A function that returns a URL to a package from a scope of a commit.
44
+ * @param {function} options.transformScope A function that returns a URL to a package from a scope of a commit.
45
45
  *
46
- * @param {String} [options.scope] Package names have to match to specified glob pattern in order to be processed.
46
+ * @param {string} [options.scope] Package names have to match to specified glob pattern in order to be processed.
47
47
  *
48
- * @param {Array.<String>} [options.skipPackages=[]] Name of packages which won't be touched.
48
+ * @param {Array.<string>} [options.skipPackages=[]] Name of packages which won't be touched.
49
49
  *
50
- * @param {Boolean} [options.skipLinks=false] If set on true, links to release or commits will be omitted.
50
+ * @param {boolean} [options.skipLinks=false] If set on true, links to release or commits will be omitted.
51
51
  *
52
- * @param {String} [options.from] A commit or tag name that will be the first param of the range of commits to collect.
52
+ * @param {string} [options.from] A commit or tag name that will be the first param of the range of commits to collect.
53
53
  *
54
- * @param {String} [options.releaseBranch='master'] A name of the branch that should be used for releasing packages.
54
+ * @param {string} [options.releaseBranch='master'] A name of the branch that should be used for releasing packages.
55
55
  *
56
- * @param {String} [options.mainBranch='master'] A name of the main branch in the repository.
56
+ * @param {string} [options.mainBranch='master'] A name of the main branch in the repository.
57
57
  *
58
58
  * @param {Array.<ExternalRepository>} [options.externalRepositories=[]] An array of object with additional repositories
59
59
  * that the function takes into consideration while gathering commits. It assumes that those directories are also mono repositories.
60
60
  *
61
- * @param {Boolean} [options.skipFileSave=false] Whether to resolve the changes instead of saving it to a file.
61
+ * @param {boolean} [options.skipFileSave=false] Whether to resolve the changes instead of saving it to a file.
62
62
  *
63
- * @param {String|null} [options.nextVersion=null] Next version to use. If not provided, a user needs to provide via CLI.
63
+ * @param {string|null} [options.nextVersion=null] Next version to use. If not provided, a user needs to provide via CLI.
64
64
  *
65
65
  * @param {FormatDateCallback} [options.formatDate] A callback allowing defining a custom format of the date inserted into the changelog.
66
66
  * If not specified, the default date matches the `YYYY-MM-DD` pattern.
67
67
  *
68
- * @returns {Promise.<undefined|String>}
68
+ * @returns {Promise.<undefined|string>}
69
69
  */
70
70
  export default async function generateChangelogForMonoRepository( options ) {
71
71
  const log = logger();
@@ -161,11 +161,11 @@ export default async function generateChangelogForMonoRepository( options ) {
161
161
  /**
162
162
  * Returns collections with packages found in the `options.cwd` directory and the external repositories.
163
163
  *
164
- * @param {Object} options
165
- * @param {String} options.cwd Current working directory (packages) from which all paths will be resolved.
166
- * @param {String} options.packages Where to look for packages.
167
- * @param {String} options.scope Package names have to match to specified glob pattern in order to be processed.
168
- * @param {Array.<String>} options.skipPackages Name of packages which won't be touched.
164
+ * @param {object} options
165
+ * @param {string} options.cwd Current working directory (packages) from which all paths will be resolved.
166
+ * @param {string} options.packages Where to look for packages.
167
+ * @param {string} options.scope Package names have to match to specified glob pattern in order to be processed.
168
+ * @param {Array.<string>} options.skipPackages Name of packages which won't be touched.
169
169
  * @param {Array.<ExternalRepository>} options.externalRepositories An array of object with additional repositories
170
170
  * that the function takes into consideration while gathering packages.
171
171
  * @returns {PathsCollection}
@@ -210,10 +210,10 @@ export default async function generateChangelogForMonoRepository( options ) {
210
210
  /**
211
211
  * Returns a promise that resolves an array of commits since the last tag specified as `options.from`.
212
212
  *
213
- * @param {Object} options
214
- * @param {String} options.cwd Current working directory (packages) from which all paths will be resolved.
215
- * @param {String} options.from A commit or tag name that will be the first param of the range of commits to collect.
216
- * @param {String} options.releaseBranch A name of the branch that should be used for releasing packages.
213
+ * @param {object} options
214
+ * @param {string} options.cwd Current working directory (packages) from which all paths will be resolved.
215
+ * @param {string} options.from A commit or tag name that will be the first param of the range of commits to collect.
216
+ * @param {string} options.releaseBranch A name of the branch that should be used for releasing packages.
217
217
  * @param {Array.<ExternalRepository>} options.externalRepositories An array of object with additional repositories
218
218
  * that the function takes into consideration while gathering commits.
219
219
  * @returns {Promise.<Array.<Commit>>}
@@ -378,7 +378,7 @@ export default async function generateChangelogForMonoRepository( options ) {
378
378
  * Finds commits that touched the package under `packagePath` directory.
379
379
  *
380
380
  * @param {Array.<Commit>} commits
381
- * @param {String} packagePath
381
+ * @param {string} packagePath
382
382
  * @returns {Array.<Commit>}
383
383
  */
384
384
  function filterCommitsByPath( commits, packagePath ) {
@@ -400,7 +400,7 @@ export default async function generateChangelogForMonoRepository( options ) {
400
400
  /**
401
401
  * Generates a list of changes based on the commits in the main repository.
402
402
  *
403
- * @returns {Promise.<String>}
403
+ * @returns {Promise.<string>}
404
404
  */
405
405
  function generateChangelogFromCommits() {
406
406
  logProcess( 'Generating the changelog...' );
@@ -516,7 +516,7 @@ export default async function generateChangelogForMonoRepository( options ) {
516
516
  /**
517
517
  * Prepares a summary that describes what has changed in all dependencies.
518
518
  *
519
- * @returns {String}
519
+ * @returns {string}
520
520
  */
521
521
  function generateSummaryOfChangesInPackages() {
522
522
  const dependencies = new Map();
@@ -597,8 +597,8 @@ export default async function generateChangelogForMonoRepository( options ) {
597
597
  }
598
598
 
599
599
  /**
600
- * @param {Map.<String, Version>} dependencies
601
- * @returns {Map.<String, Version>}
600
+ * @param {Map.<string, Version>} dependencies
601
+ * @returns {Map.<string, Version>}
602
602
  */
603
603
  function getNewPackages( dependencies ) {
604
604
  const packages = new Map();
@@ -616,9 +616,9 @@ export default async function generateChangelogForMonoRepository( options ) {
616
616
  /**
617
617
  * Returns packages where scope of changes described in the commits' notes match to packages' names.
618
618
  *
619
- * @param {Map.<String, Version>} dependencies
620
- * @param {String} noteTitle
621
- * @returns {Map.<String, Version>}
619
+ * @param {Map.<string, Version>} dependencies
620
+ * @param {string} noteTitle
621
+ * @returns {Map.<string, Version>}
622
622
  */
623
623
  function getPackagesMatchedToScopesFromNotes( dependencies, noteTitle ) {
624
624
  const packages = new Map();
@@ -649,8 +649,8 @@ export default async function generateChangelogForMonoRepository( options ) {
649
649
  /**
650
650
  * Returns packages that contain new features.
651
651
  *
652
- * @param {Map.<String, Version>} dependencies
653
- * @returns {Map.<String, Version>}
652
+ * @param {Map.<string, Version>} dependencies
653
+ * @returns {Map.<string, Version>}
654
654
  */
655
655
  function getPackagesWithNewFeatures( dependencies ) {
656
656
  const packages = new Map();
@@ -672,10 +672,10 @@ export default async function generateChangelogForMonoRepository( options ) {
672
672
  /**
673
673
  * Returns a formatted entry (string) for the changelog.
674
674
  *
675
- * @param {String} packageName
676
- * @param {String} nextVersion
677
- * @param {String} currentVersion
678
- * @returns {String}
675
+ * @param {string} packageName
676
+ * @param {string} nextVersion
677
+ * @param {string} currentVersion
678
+ * @returns {string}
679
679
  */
680
680
  function formatChangelogEntry( packageName, nextVersion, currentVersion = null ) {
681
681
  const npmUrl = `https://www.npmjs.com/package/${ packageName }/v/${ nextVersion }`;
@@ -690,7 +690,7 @@ export default async function generateChangelogForMonoRepository( options ) {
690
690
  /**
691
691
  * Returns a function that is being used when sorting commits.
692
692
  *
693
- * @param {String} scopeField A name of the field that saves the commit's scope.
693
+ * @param {string} scopeField A name of the field that saves the commit's scope.
694
694
  * @returns {Function}
695
695
  */
696
696
  function sortFunctionFactory( scopeField ) {
@@ -714,11 +714,11 @@ export default async function generateChangelogForMonoRepository( options ) {
714
714
  }
715
715
 
716
716
  /**
717
- * @param {String} message
718
- * @param {Object} [options={}]
719
- * @param {Number} [options.indentLevel=0]
720
- * @param {Boolean} [options.startWithNewLine=false] Whether to append a new line before the message.
721
- * @param {Boolean} [options.isWarning=false] Whether to use `warning` method instead of `log`.
717
+ * @param {string} message
718
+ * @param {object} [options={}]
719
+ * @param {number} [options.indentLevel=0]
720
+ * @param {boolean} [options.startWithNewLine=false] Whether to append a new line before the message.
721
+ * @param {boolean} [options.isWarning=false] Whether to use `warning` method instead of `log`.
722
722
  */
723
723
  function logInfo( message, options = {} ) {
724
724
  const indentLevel = options.indentLevel || 0;
@@ -730,30 +730,30 @@ export default async function generateChangelogForMonoRepository( options ) {
730
730
  }
731
731
 
732
732
  /**
733
- * @typedef {Object} Version
733
+ * @typedef {object} Version
734
734
  *
735
- * @param {Boolean} current The current version defined in the `package.json` file.
735
+ * @param {boolean} current The current version defined in the `package.json` file.
736
736
  *
737
- * @param {Boolean} next The next version defined during generating the changelog file.
737
+ * @param {boolean} next The next version defined during generating the changelog file.
738
738
  */
739
739
 
740
740
  /**
741
- * @typedef {Object} ExternalRepository
741
+ * @typedef {object} ExternalRepository
742
742
  *
743
- * @param {String} cwd An absolute path to the repository.
743
+ * @param {string} cwd An absolute path to the repository.
744
744
  *
745
- * @param {String} packages Subdirectory in a given `cwd` that should searched for packages. E.g. `'packages'`.
745
+ * @param {string} packages Subdirectory in a given `cwd` that should searched for packages. E.g. `'packages'`.
746
746
  *
747
- * @param {String} [scope] Glob pattern for package names to be processed.
747
+ * @param {string} [scope] Glob pattern for package names to be processed.
748
748
  *
749
- * @param {Array.<String>} [skipPackages] Name of packages which won't be touched.
749
+ * @param {Array.<string>} [skipPackages] Name of packages which won't be touched.
750
750
  *
751
- * @param {Boolean} [skipLinks] If set on `true`, a URL to commit (hash) will be omitted.
751
+ * @param {boolean} [skipLinks] If set on `true`, a URL to commit (hash) will be omitted.
752
752
  *
753
- * @param {String} [from] A commit or tag name that will be the first param of the range of commits to collect. If not specified,
753
+ * @param {string} [from] A commit or tag name that will be the first param of the range of commits to collect. If not specified,
754
754
  * the option will inherit its value from the function's `options` object.
755
755
  *
756
- * @param {String} [releaseBranch] A name of the branch that should be used for releasing packages. If not specified, the branch
756
+ * @param {string} [releaseBranch] A name of the branch that should be used for releasing packages. If not specified, the branch
757
757
  * used for the main repository will be used.
758
758
  */
759
759
 
@@ -762,5 +762,5 @@ export default async function generateChangelogForMonoRepository( options ) {
762
762
  *
763
763
  * @param {Date} now The current date.
764
764
  *
765
- * @returns {String} The formatted date inserted into the changelog.
765
+ * @returns {string} The formatted date inserted into the changelog.
766
766
  */
@@ -28,15 +28,15 @@ const SKIP_GENERATE_CHANGELOG = 'Typed "skip" as a new version. Aborting.';
28
28
  *
29
29
  * If the package does not have any commit, the user has to confirm whether the changelog should be generated.
30
30
  *
31
- * @param {Object} [options={}] Additional options.
31
+ * @param {object} [options={}] Additional options.
32
32
  *
33
- * @param {Boolean} [options.skipLinks=false] If set on true, links to release or commits will be omitted.
33
+ * @param {boolean} [options.skipLinks=false] If set on true, links to release or commits will be omitted.
34
34
  *
35
- * @param {String} [options.from] A commit or tag name that will be the first param of the range of commits to collect.
35
+ * @param {string} [options.from] A commit or tag name that will be the first param of the range of commits to collect.
36
36
  *
37
- * @param {String} [options.releaseBranch='master'] A name of the branch that should be used for releasing packages.
37
+ * @param {string} [options.releaseBranch='master'] A name of the branch that should be used for releasing packages.
38
38
  *
39
- * @param {String} [options.mainBranch='master'] A name of the main branch in the repository.
39
+ * @param {string} [options.mainBranch='master'] A name of the main branch in the repository.
40
40
  *
41
41
  * @param {FormatDateCallback} [options.formatDate] A callback allowing defining a custom format of the date inserted into the changelog.
42
42
  * If not specified, the default date matches the `YYYY-MM-DD` pattern.
@@ -186,11 +186,11 @@ export default async function generateChangelogForSinglePackage( options = {} )
186
186
  }
187
187
 
188
188
  /**
189
- * @param {String} message
190
- * @param {Object} [options={}]
191
- * @param {Number} [options.indentLevel=0]
192
- * @param {Boolean} [options.startWithNewLine=false] Whether to append a new line before the message.
193
- * @param {Boolean} [options.isWarning=false] Whether to use `warning` method instead of `log`.
189
+ * @param {string} message
190
+ * @param {object} [options={}]
191
+ * @param {number} [options.indentLevel=0]
192
+ * @param {boolean} [options.startWithNewLine=false] Whether to append a new line before the message.
193
+ * @param {boolean} [options.isWarning=false] Whether to use `warning` method instead of `log`.
194
194
  */
195
195
  function logInfo( message, options = {} ) {
196
196
  const indentLevel = options.indentLevel || 0;
@@ -206,5 +206,5 @@ export default async function generateChangelogForSinglePackage( options = {} )
206
206
  *
207
207
  * @param {Date} now The current date.
208
208
  *
209
- * @returns {String} The formatted date inserted into the changelog.
209
+ * @returns {string} The formatted date inserted into the changelog.
210
210
  */
@@ -10,12 +10,12 @@ import upath from 'upath';
10
10
  /**
11
11
  * The goal is to prepare the release directory containing the packages we want to publish.
12
12
  *
13
- * @param {Object} options
14
- * @param {String} options.outputDirectory Relative path to the destination directory where packages will be stored.
15
- * @param {String} [options.cwd] Root of the repository to prepare. `process.cwd()` by default.
16
- * @param {String} [options.packagesDirectory] Relative path to a location of packages.
13
+ * @param {object} options
14
+ * @param {string} options.outputDirectory Relative path to the destination directory where packages will be stored.
15
+ * @param {string} [options.cwd] Root of the repository to prepare. `process.cwd()` by default.
16
+ * @param {string} [options.packagesDirectory] Relative path to a location of packages.
17
17
  * If specified, all of the found packages will be copied.
18
- * @param {Array.<String>} [options.packagesToCopy] List of packages that should be processed.
18
+ * @param {Array.<string>} [options.packagesToCopy] List of packages that should be processed.
19
19
  * If not specified, all packages found in `packagesDirectory` are considered.
20
20
  * @param {RootPackageJson} [options.rootPackageJson] Object containing values to use in the created the `package.json` file.
21
21
  * If not specified, the root package will not be created.
@@ -71,9 +71,9 @@ export default async function prepareRepository( options ) {
71
71
  }
72
72
 
73
73
  /**
74
- * @param {Object} packageJson
75
- * @param {String} [packageJson.name]
76
- * @param {Array.<String>} [packageJson.files]
74
+ * @param {object} packageJson
75
+ * @param {string} [packageJson.name]
76
+ * @param {Array.<string>} [packageJson.files]
77
77
  */
78
78
  function validateRootPackage( packageJson ) {
79
79
  if ( !packageJson.name ) {
@@ -86,10 +86,10 @@ function validateRootPackage( packageJson ) {
86
86
  }
87
87
 
88
88
  /**
89
- * @param {Object} options
90
- * @param {String} options.cwd
89
+ * @param {object} options
90
+ * @param {string} options.cwd
91
91
  * @param {RootPackageJson} options.rootPackageJson
92
- * @param {String} options.outputDirectoryPath
92
+ * @param {string} options.outputDirectoryPath
93
93
  * @returns {Promise}
94
94
  */
95
95
  async function processRootPackage( { cwd, rootPackageJson, outputDirectoryPath } ) {
@@ -110,11 +110,11 @@ async function processRootPackage( { cwd, rootPackageJson, outputDirectoryPath }
110
110
  }
111
111
 
112
112
  /**
113
- * @param {Object} options
114
- * @param {String} options.cwd
115
- * @param {String} options.packagesDirectory
116
- * @param {String} options.outputDirectoryPath
117
- * @param {Array.<String>} [options.packagesToCopy]
113
+ * @param {object} options
114
+ * @param {string} options.cwd
115
+ * @param {string} options.packagesDirectory
116
+ * @param {string} options.outputDirectoryPath
117
+ * @param {Array.<string>} [options.packagesToCopy]
118
118
  * @returns {Promise}
119
119
  */
120
120
  async function processMonorepoPackages( { cwd, packagesDirectory, packagesToCopy, outputDirectoryPath } ) {
@@ -141,9 +141,9 @@ async function processMonorepoPackages( { cwd, packagesDirectory, packagesToCopy
141
141
  }
142
142
 
143
143
  /**
144
- * @typedef {Object} RootPackageJson
144
+ * @typedef {object} RootPackageJson
145
145
  *
146
- * @param {String} options.rootPackageJson.name Name of the package. Required value.
146
+ * @param {string} options.rootPackageJson.name Name of the package. Required value.
147
147
  *
148
- * @param {Array.<String>} options.rootPackageJson.files Array containing a list of files or directories to copy. Required value.
148
+ * @param {Array.<string>} options.rootPackageJson.files Array containing a list of files or directories to copy. Required value.
149
149
  */
@@ -24,24 +24,24 @@ import publishPackageOnNpmCallback from '../utils/publishpackageonnpmcallback.js
24
24
  * When the validation for each package passes, packages are published on npm. Optional callback is called for confirmation whether to
25
25
  * continue.
26
26
  *
27
- * @param {Object} options
28
- * @param {String} options.packagesDirectory Relative path to a location of packages to release.
29
- * @param {String} options.npmOwner The account name on npm, which should be used to publish the packages.
27
+ * @param {object} options
28
+ * @param {string} options.packagesDirectory Relative path to a location of packages to release.
29
+ * @param {string} options.npmOwner The account name on npm, which should be used to publish the packages.
30
30
  * @param {ListrTaskObject} options.listrTask An instance of `ListrTask`.
31
31
  * @param {AbortSignal|null} [options.signal=null] Signal to abort the asynchronous process.
32
- * @param {String} [options.npmTag='staging'] The npm distribution tag.
33
- * @param {Object.<String, Array.<String>>|null} [options.optionalEntries=null] Specifies which entries from the `files` field in the
32
+ * @param {string} [options.npmTag='staging'] The npm distribution tag.
33
+ * @param {Object.<string, Array.<string>>|null} [options.optionalEntries=null] Specifies which entries from the `files` field in the
34
34
  * `package.json` are optional. The key is a package name, and its value is an array of optional entries from the `files` field, for which
35
35
  * it is allowed not to match any file. The `options.optionalEntries` object may also contain the `default` key, which is used for all
36
36
  * packages that do not have own definition.
37
- * @param {String} [options.confirmationCallback=null] An callback whose response decides to continue the publishing packages. Synchronous
37
+ * @param {string} [options.confirmationCallback=null] An callback whose response decides to continue the publishing packages. Synchronous
38
38
  * and asynchronous callbacks are supported.
39
- * @param {Boolean} [options.requireEntryPoint=false] Whether to verify if packages to publish define an entry point. In other words,
39
+ * @param {boolean} [options.requireEntryPoint=false] Whether to verify if packages to publish define an entry point. In other words,
40
40
  * whether their `package.json` define the `main` field.
41
- * @param {Array.<String>} [options.optionalEntryPointPackages=[]] If the entry point validator is enabled (`requireEntryPoint=true`),
41
+ * @param {Array.<string>} [options.optionalEntryPointPackages=[]] If the entry point validator is enabled (`requireEntryPoint=true`),
42
42
  * this array contains a list of packages that will not be checked. In other words, they do not have to define the entry point.
43
- * @param {String} [options.cwd=process.cwd()] Current working directory from which all paths will be resolved.
44
- * @param {Number} [options.concurrency=4] Number of CPUs that will execute the task.
43
+ * @param {string} [options.cwd=process.cwd()] Current working directory from which all paths will be resolved.
44
+ * @param {number} [options.concurrency=4] Number of CPUs that will execute the task.
45
45
  * @returns {Promise}
46
46
  */
47
47
  export default async function publishPackages( options ) {
package/lib/tasks/push.js CHANGED
@@ -9,10 +9,10 @@ import shellEscape from 'shell-escape';
9
9
  /**
10
10
  * Push the local changes to a remote server.
11
11
  *
12
- * @param {Object} options
13
- * @param {String} options.releaseBranch A name of the branch that should be used for releasing packages.
14
- * @param {String} options.version Name of tag connected with the release.
15
- * @param {String} [options.cwd] Root of the repository to prepare. `process.cwd()` by default.
12
+ * @param {object} options
13
+ * @param {string} options.releaseBranch A name of the branch that should be used for releasing packages.
14
+ * @param {string} options.version Name of tag connected with the release.
15
+ * @param {string} [options.cwd] Root of the repository to prepare. `process.cwd()` by default.
16
16
  * @returns {Promise}
17
17
  */
18
18
  export default async function push( options ) {
@@ -19,10 +19,10 @@ const execPromise = util.promisify( exec );
19
19
  * Used to switch the tags from `staging` to `latest` for specified array of packages.
20
20
  * Each operation will be retried up to 3 times in case of failure.
21
21
  *
22
- * @param {Object} options
23
- * @param {String} options.npmOwner User that is authorized to release packages.
24
- * @param {String} options.version Specifies the version of packages to reassign the tags for.
25
- * @param {Array.<String>} options.packages Array of packages' names to reassign tags for.
22
+ * @param {object} options
23
+ * @param {string} options.npmOwner User that is authorized to release packages.
24
+ * @param {string} options.version Specifies the version of packages to reassign the tags for.
25
+ * @param {Array.<string>} options.packages Array of packages' names to reassign tags for.
26
26
  * @returns {Promise}
27
27
  */
28
28
  export default async function reassignNpmTags( { npmOwner, version, packages } ) {
@@ -79,16 +79,16 @@ export default async function reassignNpmTags( { npmOwner, version, packages } )
79
79
  }
80
80
 
81
81
  /**
82
- * @param {String} message
83
- * @returns {String}
82
+ * @param {string} message
83
+ * @returns {string}
84
84
  */
85
85
  function trimErrorMessage( message ) {
86
86
  return message.replace( /npm ERR!.*\n/g, '' ).trim();
87
87
  }
88
88
 
89
89
  /**
90
- * @param {Function} callback
91
- * @param {Number} times
90
+ * @param {function} callback
91
+ * @param {number} times
92
92
  * @returns {RetryCallback}
93
93
  */
94
94
  function retry( callback, times = 3 ) {