# @wiredviews/angular-version-builder

> Version Files builder for Angular build facade

Latest version **0.2.2** (published 2019-06-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install @wiredviews/angular-version-builder
pnpm add @wiredviews/angular-version-builder
yarn add @wiredviews/angular-version-builder
bun add @wiredviews/angular-version-builder
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2019-06-13 |
| First published | 2018-10-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sean G. Wright |
| Maintainers | eyev, seangwright, velebak |
| Keywords | angular, devkit, typescript, angular-cli |

## Links

- npm: https://www.npmjs.com/package/@wiredviews/angular-version-builder
- Repository: https://github.com/wiredviews/angular-version-builder
- Homepage: https://github.com/wiredviews/angular-version-builder#readme
- Issues: https://github.com/wiredviews/angular-version-builder/issues
- npm.io page: https://npm.io/package/@wiredviews/angular-version-builder

## Dependencies (1)

- [pjson](https://npm.io/package/pjson.md) 1.0.9

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.2.2 (latest) — 2019-06-13
- 0.2.1 — 2019-06-13
- 0.2.0 — 2019-06-13
- 0.1.1 — 2018-10-31
- 0.1.0 — 2018-10-31

## README

# Version Files

Version Files builder for Angular build facade.

## Description

Keeping user-agent clients up to date with the latest Angular application code can be difficult due to caching and the nature of single-page apps.

The most common approach is polling on the client side to determine if there are any updates available.

This package generates a `version.ts` file and a `version.json` file source from the version in your `package.json`.

The `version.ts` file is an ES Module and should be imported into your code base. This way the application knows its current version.

The `version.json` file should be deployed with the application assets to the server to indicate which version of the application is currently deployed.

The developer can then poll against the `version.json` file on the server and compare its version to the version exposed by the `version.ts` in the application. If they differ then the application knows an update is available and can prompt the user or reload the app.

## Usage

1. In the root of your Angular application:

   ```bash
   npm i -D @wiredviews/angular-version-builder
   ```

2. In your _angular.json_ add the following to _architect_ section of the relevant project:

   ```bash
   "version-files": {
     "builder": "@wiredviews/angular-version-builder:files",
     "options": {
        "tsOutputPath": "environments/version.ts",
        "jsonOutputPath": "version.json"
     }
   },
   ```

3. Run: `ng run [relevant-project]:version-files`
   Where _[relevant-project]_ is the project to which you've added the target

## Options

- `tsOutputPath` - path to the typescript module containing your application version which you can import into your application to be deployed with it
- `jsonOutputPath` - path to the json file that contains the your application version that is deployed on the server

## Credits

Inspiration from [https://medium.com/dailyjs/angular-cli-6-under-the-hood-builders-demystified-f0690ebcf01](https://medium.com/dailyjs/angular-cli-6-under-the-hood-builders-demystified-f0690ebcf01)

---
_Source: https://npm.io/package/@wiredviews/angular-version-builder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
