first working version

This commit is contained in:
2017-08-17 16:15:47 +02:00
parent b955948380
commit ea6fc17f21
15 changed files with 628 additions and 11 deletions

35
ts/index.ts Normal file
View File

@@ -0,0 +1,35 @@
import * as plugins from './smartversion.plugins'
import { SemVer } from 'semver'
export class SmartVersion {
semver: SemVer
update = {
patch: () => {
this.semver.patch = this.semver.patch + 1
},
minor: () => {
this.semver.minor = this.semver.minor + 1
},
major: () => {
this.semver.major = this.semver.major + 1
}
}
constructor (semVerStringArg: string) {
this.semver = new plugins.semver.SemVer(semVerStringArg)
}
get major () {
return this.semver.major
}
get minor () {
return this.semver.minor
}
get patch () {
return this.semver.patch
}
}

View File

@@ -0,0 +1,6 @@
import 'typings-global'
import * as semver from 'semver'
export {
semver
}