https://github.com/ember-cli/ember-cli-app-version
Adds your app's version to Ember Inspector's Info tab
https://github.com/ember-cli/ember-cli-app-version
Last synced: 7 months ago
JSON representation
Adds your app's version to Ember Inspector's Info tab
- Host: GitHub
- URL: https://github.com/ember-cli/ember-cli-app-version
- Owner: ember-cli
- License: mit
- Created: 2014-11-04T19:27:36.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2024-06-10T17:28:49.000Z (over 1 year ago)
- Last Synced: 2025-06-19T15:02:14.629Z (7 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.56 MB
- Stars: 55
- Watchers: 10
- Forks: 46
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-cli-app-version
[](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#version.
If you add build metadata to the version, this addon will automatically append SHA to the end of the version.
## Compatibility
- Ember.js v3.28 or above
- Ember CLI v3.28 or above
- Node.js v18 or above
## Installation
```
ember install ember-cli-app-version
```
## Usage

## {{app-version}} helper
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}} // => `
Flags are `false` by default.
## Heroku
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}`,
};
}
```
## Contributing
See the [Contributing](CONTRIBUTING.md) guide for details.
## License
This project is licensed under the [MIT License](LICENSE.md).