1.1.4 • Published 4 years ago

@progresso/npm-typescript-version-provider v1.1.4

Weekly downloads
6
License
GPL-3.0
Repository
github
Last release
4 years ago

npm-typescript-version-provider

Injects the version from packages.json as a property into a typescript class.

Installation

yarn install @progresso/npm-typescript-version-provider

Usage

Prepare a typescript class that contains a version line in this format:

public get version(): string { return '1.0.0'; }

Examle:

export class AppService {
  public get version(): string { return '1.0.0'; }
}

Add a script entry to your package.json file:

"inject-version": npm-typescript-version-provider <path-to-your-class-file> <incremental-options>"

Example:

"scripts": {
  ...
  "inject-version": "npm-typescript-version-provider /src/services/appService.ts increment"
  ...
}

This example extracts the version from the package.json file and increments the build number by either appending +0 to the version core or by incrementing the build number (see https://semver.org/ for more info on Semantic Versioning).

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

5 years ago