Generates semantic release & prerelease version numbers and changelogs
npm install @skypilot/versioner
!stable build

!next build
!Codacy grade
!downloads

A collection of functions and classes for managing version numbers.
``console`
$ yarn add @skypilot/versioneror
$ npm install @skypilot/versioner
`typescript
import { bumpVersion, ChangeLevel } from '@skypilot/versioner';
bumpVersion(
version: string,
changeLevel: ChangeLevel,
channel?: string,
previousVersions?: string[]
)
`
#### TypeScript examples
`typescript
bumpVersion('1.0.1', ChangeLevel.patch)
// '1.0.2'
bumpVersion('1.0.1', ChangeLevel.minor)
// '1.1.0'
bumpVersion('1.0.1', ChangeLevel.major)
// '2.0.0'
bumpVersion('1.0.1', ChangeLevel.minor, 'alpha')
// '1.1.0-alpha.0'
bumpVersion('1.0.1', ChangeLevel.minor, 'alpha', ['1.1.0-alpha.1', '1.1.0-alpha.2'])
// '1.1.0-alpha.3'
`
`javascript
import { bumpVersion } from '@skypilot/versioner';
bumpVersion(
version, // string
changeLevel, // 'major' | 'minor' | 'patch' | 'fix'
channel, // [optional] string
previousVersions // [optional] string[]
)
`
#### ES6 examples
`javascript
bumpVersion('1.0.1', 'patch')
// '1.0.2'
bumpVersion('1.0.1', 'minor')
// '1.1.0'
bumpVersion('1.0.1', 'major')
// '2.0.0'
bumpVersion('1.0.1', 'minor', 'alpha')
// '1.1.0-alpha.0'
bumpVersion('1.0.1', 'minor', 'alpha', ['1.1.0-alpha.1', '1.1.0-alpha.2'])
// '1.1.0-alpha.3'
`
The library exposes the following exports:
- PrereleaseVersionReleaseVersion
-
- ChangeLevel
- parseChangeLevel(changeLevel: string): ChangeLevel`
TODO: Document class and function API.