ember-cli-app-version
Version:
Adds App version number to Ember Inspector Info Tab
60 lines (39 loc) • 2.05 kB
Markdown
[](https://github.com/ember-cli/ember-cli-app-version/actions?query=workflow%3ACI)
[](https://badge.fury.io/js/ember-cli-app-version)
[](https://emberobserver.com/addons/ember-cli-app-version)
Adds your Ember App's version to Info tab in Ember Inspector. The version is taken from your project's package.json
If you add build metadata to the version, this addon will automatically append SHA to the end of the version.
- Ember.js v3.28 or above
- Ember CLI v3.28 or above
- Node.js v18 or above
```
ember install ember-cli-app-version
```

This addon provides `{{app-version}}` helper that allows you to show your current app version in your app.
The addon has flags to display parts of the version:
- `{{app-version versionOnly=true}} // => 2.0.1`
- `{{app-version versionOnly=true showExtended=true}} // => 2.0.1-alpha.1`
- `{{app-version shaOnly=true}} // => <git SHA>`
Flags are `false` by default.
When running on Heroku the `.git` folder is not present, making it impossible to fetch the `git SHA`. A workaround for this is adding the below in your `config/environment.js`:
```js
// Heroku Git Hash support
if (process.env.SOURCE_VERSION) {
const pkg = require('../package.json');
const hash = process.env.SOURCE_VERSION.substr(0, 7);
ENV['ember-cli-app-version'] = {
version: `${pkg.version}+${hash}`,
};
}
```
See the [Contributing](CONTRIBUTING.md) guide for details.
This project is licensed under the [MIT License](LICENSE.md).