Skip to content

Commit

Permalink
#306 show ClientApp version in footer
Browse files Browse the repository at this point in the history
  • Loading branch information
kentico-ericd committed Nov 16, 2023
1 parent 1689beb commit afb2cb2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion KenticoInspector.WebApplication/ClientApp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ClientApp",
"version": "0.1.0",
"version": "4.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
Expand Down
2 changes: 1 addition & 1 deletion KenticoInspector.WebApplication/ClientApp/src/app.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<span class="mr-2">Source on Github</span>
<v-icon>mdi-github-box</v-icon>
</v-btn>
<div>Version 4.0.0</div>
<div>{{ $store.getters.appVersion }}</div>
</v-footer>
</v-app>
</template>
Expand Down
8 changes: 8 additions & 0 deletions KenticoInspector.WebApplication/ClientApp/src/store/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,13 @@ export default new Vuex.Store({
instances,
reports
},
state: {
packageVersion: process.env.PACKAGE_VERSION || '0'
},
getters: {
appVersion: (state) => {
return state.packageVersion
}
},
strict: debug
})
15 changes: 14 additions & 1 deletion KenticoInspector.WebApplication/ClientApp/vue.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
const fs = require('fs')
const webpack = require('webpack')
const packageJson = fs.readFileSync('./package.json')
const version = JSON.parse(packageJson).version || 0
module.exports = {
lintOnSave: undefined
configureWebpack: {
plugins: [
new webpack.DefinePlugin({
'process.env': {
PACKAGE_VERSION: '"' + version + '"'
}
})
]
},
lintOnSave: undefined
}

0 comments on commit afb2cb2

Please sign in to comment.