JSPM

  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q32862F
  • License ISC

Generates semantic release & prerelease version numbers and changelogs

Package Exports

  • @skypilot/versioner

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@skypilot/versioner) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@skypilot/versioner

A collection of functions and classes for managing version numbers.

Installation

Yarn:

yarn add @skypilot/versioner

NPM:

npm install @skypilot/versioner

Basic usage

TypeScript

import { bumpVersion, ChangeLevel } from '@skypilot/versioner';

bumpVersion(version: string, changeLevel: ChangeLevel, channel?: string, previousVersions?: string[])

TypeScript examples

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'

ES6

import { bumpVersion } from '@skypilot/versioner';

bumpVersion(version: string, changeLevel: 'major' | 'minor' | 'patch' | 'fix', channel?: string, previousVersions?: string[])

ES6 examples

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'

Advance usage

The following classes are available:

  • PrereleaseVersion
  • ReleaseVersion

TODO: Document class API.