Skip to content

Commit

Permalink
chore(npm): renames package to @saithodev/ts-appversion
Browse files Browse the repository at this point in the history
  • Loading branch information
saitho committed Jan 12, 2020
1 parent cccdcd5 commit 675117a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
21 changes: 12 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,38 @@
# NgAppVersion
# TS-AppVersion

[![Build Status](https://travis-ci.com/saitho/ng-appversion.svg?branch=master)](https://travis-ci.com/saitho/ng-appversion)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=saitho_ng-appversion&metric=alert_status)](https://sonarcloud.io/dashboard?id=saitho_ng-appversion)
[![npm version](https://img.shields.io/npm/v/ng-appversion.svg)](https://www.npmjs.com/package/ng-appversion)
[![npm license](https://img.shields.io/npm/l/ng-appversion.svg)](https://www.npmjs.com/package/ng-appversion)
[![npm version](https://img.shields.io/npm/v/@saithodev/ts-appversion.svg)](https://www.npmjs.com/package/@saithodev/ts-appversion)
[![npm license](https://img.shields.io/npm/l/@saithodev/ts-appversion.svg)](https://www.npmjs.com/package/@saithodev/ts-appversion)
[![Known Vulnerabilities](https://snyk.io/test/github/saitho/ng-appversion/badge.svg?targetFile=package.json)](https://snyk.io/test/github/saitho/ng-appversion?targetFile=package.json)
[![Dependency Status](https://david-dm.org/saitho/ng-appversion/status.svg)](https://david-dm.org/saitho/ng-appversion)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)

This package extracts version information from your package.json and Git (if configured) and saves it into a TypeScript file.
You can then access that TypeScript file from your Angular application and display the version in your Angular app.
You can then access that TypeScript file from your application and display the version in your app.

**The examples below illustrate the usage of this package for the Angular framework.
However it should work similarly for any other JavaScript framework that is using TypeScript.**

## Getting started

The package comes with a script that has to be run before the building.
The package comes with a script that has to be run before your application is built.
You might want to use *prestart* and *prebuild* inside your package.json for that:

```
{
scripts: [
"prestart": "node ./node_modules/ng-appversion/index.js",
"prestart": "node ./node_modules/@saithodev/ts-appversion/index.js",
"start": "ng serve",
"prebuild": "node ./node_modules/ng-appversion/index.js",
"prebuild": "node ./node_modules/@saithodev/ts-appversion/index.js",
"build": "ng build",
]
}
```

With that setup the file is updated when `npm start` and `npm run-script build` are run.
*Note:* You won't be able to run `ng build` anymore as the script will not be executed. Use `npm run-script build` instead.
With that setup the file is updated when `npm start` and `npm build` are run.
*Note:* You won't be able to run `ng build` anymore as the script will not be executed. Use `npm build` instead.

## Command arguments

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ng-appversion",
"name": "@saithodev/ts-appversion",
"version": "1.3.0",
"description": "Reads the version from your packages.json and saves it in a .ts file you can include within your Angular application.",
"description": "Reads the version from your packages.json and saves it in a .ts file you can include into your application.",
"main": "index.js",
"scripts": {
"start": "node index.js",
Expand All @@ -13,6 +13,7 @@
},
"keywords": [
"angular",
"typescript",
"version"
],
"author": "Mario Lubenka",
Expand Down

0 comments on commit 675117a

Please sign in to comment.