Skip to content

Commit

Permalink
feat(conventional-commits): Add JSDoc types to named exports
Browse files Browse the repository at this point in the history
  • Loading branch information
evocateur committed Dec 10, 2020
1 parent 89c64b4 commit 81a591c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions core/conventional-commits/index.js
Expand Up @@ -5,3 +5,13 @@ const { updateChangelog } = require("./lib/update-changelog");

exports.recommendVersion = recommendVersion;
exports.updateChangelog = updateChangelog;

/** @typedef {'fixed' | 'independent'} VersioningStrategy */
/** @typedef {'fixed' | 'independent' | 'root'} ChangelogType */
/** @typedef {string | { name: string; [key: string]: unknown }} ChangelogPresetConfig */
/**
* @typedef {object} BaseChangelogOptions
* @property {ChangelogPresetConfig} [changelogPreset]
* @property {string} [rootPath] of project
* @property {string} [tagPrefix] defaults to "v"
*/
2 changes: 1 addition & 1 deletion core/conventional-commits/lib/get-changelog-config.js
Expand Up @@ -35,7 +35,7 @@ function resolveConfigPromise(presetPackageName, presetConfig) {
}

/**
* @param {string|{ name: string; [key: string]: unknown }} [changelogPreset]
* @param {import("..").ChangelogPresetConfig} [changelogPreset]
* @param {string} [rootPath]
*/
function getChangelogConfig(changelogPreset = "conventional-changelog-angular", rootPath) {
Expand Down
5 changes: 5 additions & 0 deletions core/conventional-commits/lib/recommend-version.js
Expand Up @@ -7,6 +7,11 @@ const { getChangelogConfig } = require("./get-changelog-config");

module.exports.recommendVersion = recommendVersion;

/**
* @param {import("@lerna/package").Package} pkg
* @param {import("..").VersioningStrategy} type
* @param {import("..").BaseChangelogOptions & { prereleaseId?: string }} commandOptions
*/
function recommendVersion(pkg, type, { changelogPreset, rootPath, tagPrefix, prereleaseId }) {
log.silly(type, "for %s at %s", pkg.name, pkg.location);

Expand Down
5 changes: 5 additions & 0 deletions core/conventional-commits/lib/update-changelog.js
Expand Up @@ -11,6 +11,11 @@ const { readExistingChangelog } = require("./read-existing-changelog");

module.exports.updateChangelog = updateChangelog;

/**
* @param {import("@lerna/package").Package} pkg
* @param {import("..").ChangelogType} type
* @param {import("..").BaseChangelogOptions & { version?: string }} commandOptions
*/
function updateChangelog(pkg, type, { changelogPreset, rootPath, tagPrefix = "v", version }) {
log.silly(type, "for %s at %s", pkg.name, pkg.location);

Expand Down

0 comments on commit 81a591c

Please sign in to comment.