@coveo/semantic-monorepo-tools
Advanced tools
Comparing version 0.0.2 to 0.1.0
export { default as getCommits } from "./git/getCommits"; | ||
export { default as getLastTag } from "./git/getLastGitTag"; | ||
export { default as getRemoteName } from "./git/getGitRemote"; | ||
export { default as gitPush } from "./git/doGitPush"; | ||
@@ -9,2 +10,5 @@ export { default as gitPushTags } from "./git/doGitPushTags"; | ||
export { default as npmPublish } from "./npm/doNpmPublish"; | ||
export { default as pnpmBumpVersion } from "./pnpm/doPnpmBumpVersion"; | ||
export { default as pnpmGetChangedPackages } from "./pnpm/getPnpmChangedPackages"; | ||
export { default as pnpmPublish } from "./pnpm/doPnpmPublishVersions"; | ||
export { default as writeChangelog } from "./changelog/doWriteChangelog"; | ||
@@ -11,0 +15,0 @@ export { default as generateChangelog } from "./changelog/getChangelog"; |
export { default as getCommits } from "./git/getCommits"; | ||
export { default as getLastTag } from "./git/getLastGitTag"; | ||
export { default as getRemoteName } from "./git/getGitRemote"; | ||
export { default as gitPush } from "./git/doGitPush"; | ||
@@ -9,2 +10,5 @@ export { default as gitPushTags } from "./git/doGitPushTags"; | ||
export { default as npmPublish } from "./npm/doNpmPublish"; | ||
export { default as pnpmBumpVersion } from "./pnpm/doPnpmBumpVersion"; | ||
export { default as pnpmGetChangedPackages } from "./pnpm/getPnpmChangedPackages"; | ||
export { default as pnpmPublish } from "./pnpm/doPnpmPublishVersions"; | ||
export { default as writeChangelog } from "./changelog/doWriteChangelog"; | ||
@@ -11,0 +15,0 @@ export { default as generateChangelog } from "./changelog/getChangelog"; |
@@ -1,4 +0,11 @@ | ||
import type { SemVer } from "semver"; | ||
export default function (version: SemVer, bumpInfo: { | ||
import type { ReleaseType, SemVer } from "semver"; | ||
declare type BumpInfoWithLevel = { | ||
level: 0 | 1 | 2; | ||
}): string; | ||
}; | ||
declare type BumpInfoWithType = { | ||
type: ReleaseType; | ||
preid?: string; | ||
}; | ||
declare function getNextVersion(version: SemVer, bumpInfo: BumpInfoWithLevel): string; | ||
declare function getNextVersion(version: SemVer, bumpInfo: BumpInfoWithType): string; | ||
export default getNextVersion; |
import semver from "semver"; | ||
const { inc } = semver; | ||
const VERSION = ["major", "minor", "patch"]; | ||
export default function (version, bumpInfo) { | ||
return inc(version.version, VERSION[bumpInfo.level]); | ||
const VERSION_LEVEL = ["major", "minor", "patch"]; | ||
function getNextVersion(version, bumpInfo) { | ||
if ("level" in bumpInfo) { | ||
return inc(version.version, VERSION_LEVEL[bumpInfo.level]); | ||
} | ||
else { | ||
return inc(version.version, bumpInfo.type, bumpInfo.preid); | ||
} | ||
} | ||
export default getNextVersion; |
{ | ||
"name": "@coveo/semantic-monorepo-tools", | ||
"version": "0.0.2", | ||
"version": "0.1.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
export { default as getCommits } from "./git/getCommits"; | ||
export { default as getLastTag } from "./git/getLastGitTag"; | ||
export { default as getRemoteName } from "./git/getGitRemote"; | ||
export { default as gitPush } from "./git/doGitPush"; | ||
@@ -9,2 +10,5 @@ export { default as gitPushTags } from "./git/doGitPushTags"; | ||
export { default as npmPublish } from "./npm/doNpmPublish"; | ||
export { default as pnpmBumpVersion } from "./pnpm/doPnpmBumpVersion"; | ||
export { default as pnpmGetChangedPackages } from "./pnpm/getPnpmChangedPackages"; | ||
export { default as pnpmPublish } from "./pnpm/doPnpmPublishVersions"; | ||
export { default as writeChangelog } from "./changelog/doWriteChangelog"; | ||
@@ -11,0 +15,0 @@ export { default as generateChangelog } from "./changelog/getChangelog"; |
@@ -5,6 +5,19 @@ import type { ReleaseType, SemVer } from "semver"; | ||
const VERSION: Array<ReleaseType> = ["major", "minor", "patch"]; | ||
const VERSION_LEVEL: Array<ReleaseType> = ["major", "minor", "patch"]; | ||
export default function (version: SemVer, bumpInfo: { level: 0 | 1 | 2 }) { | ||
return inc(version.version, VERSION[bumpInfo.level]); | ||
type BumpInfoWithLevel = { level: 0 | 1 | 2 }; | ||
type BumpInfoWithType = { type: ReleaseType; preid?: string }; | ||
type BumpInfo = BumpInfoWithLevel | BumpInfoWithType; | ||
function getNextVersion(version: SemVer, bumpInfo: BumpInfoWithLevel): string; | ||
function getNextVersion(version: SemVer, bumpInfo: BumpInfoWithType): string; | ||
function getNextVersion(version: SemVer, bumpInfo: BumpInfo) { | ||
if ("level" in bumpInfo) { | ||
return inc(version.version, VERSION_LEVEL[bumpInfo.level]); | ||
} else { | ||
return inc(version.version, bumpInfo.type, bumpInfo.preid); | ||
} | ||
} | ||
export default getNextVersion; |
@@ -9,5 +9,6 @@ { | ||
"sourceMap": false, | ||
"declaration": true, | ||
"declaration": true | ||
}, | ||
"include": ["src"], | ||
"exclude": ["node_modules"] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38377
74
631