From 4c1e229d6270c0128a930b1576725e54405fc64b Mon Sep 17 00:00:00 2001
From: Trent Larson
Date: Thu, 23 Nov 2023 11:56:54 -0700
Subject: [PATCH 1/2] compute commit hash with git-describe
---
package-lock.json | 31 +++++++++++++++++++++++++++----
package.json | 1 +
vue.config.js | 4 ++++
3 files changed, 32 insertions(+), 4 deletions(-)
diff --git a/package-lock.json b/package-lock.json
index 40000559b..7894c3549 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -33,6 +33,7 @@
"ethereum-cryptography": "^2.1.2",
"ethereumjs-util": "^7.1.5",
"ethr-did-resolver": "^8.1.2",
+ "git-describe": "^4.1.1",
"jdenticon": "^3.2.0",
"js-generate-password": "^0.1.9",
"localstorage-slim": "^2.5.0",
@@ -8894,8 +8895,7 @@
"node_modules/@types/semver": {
"version": "7.5.3",
"resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.3.tgz",
- "integrity": "sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw==",
- "dev": true
+ "integrity": "sha512-OxepLK9EuNEIPxWNME+C6WwbRAOOI2o2BaQEGzz5Lu2e4Z5eDnEo+/aVEDMIXywoJitJ7xWd641wrGLZdtwRyw=="
},
"node_modules/@types/send": {
"version": "0.17.2",
@@ -16272,6 +16272,30 @@
"node": ">=6"
}
},
+ "node_modules/git-describe": {
+ "version": "4.1.1",
+ "resolved": "https://registry.npmjs.org/git-describe/-/git-describe-4.1.1.tgz",
+ "integrity": "sha512-JC8ganO5kO80G8+XE98TDDjnMXQN3Estk3qdJuG2EGRF/l6zuMTMcN+8OSfQZ5FWpqIRLB015anWX4aSRgnxAQ==",
+ "dependencies": {
+ "@types/semver": "^7.3.8",
+ "lodash": "^4.17.21"
+ },
+ "engines": {
+ "node": ">=4.0.0"
+ },
+ "optionalDependencies": {
+ "semver": "^5.6.0"
+ }
+ },
+ "node_modules/git-describe/node_modules/semver": {
+ "version": "5.7.2",
+ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
+ "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
+ "optional": true,
+ "bin": {
+ "semver": "bin/semver"
+ }
+ },
"node_modules/glob": {
"version": "7.2.3",
"resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
@@ -19338,8 +19362,7 @@
"node_modules/lodash": {
"version": "4.17.21",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
- "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
- "devOptional": true
+ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
},
"node_modules/lodash.clonedeep": {
"version": "4.5.0",
diff --git a/package.json b/package.json
index 5e6765822..0ece1c548 100644
--- a/package.json
+++ b/package.json
@@ -33,6 +33,7 @@
"ethereum-cryptography": "^2.1.2",
"ethereumjs-util": "^7.1.5",
"ethr-did-resolver": "^8.1.2",
+ "git-describe": "^4.1.1",
"jdenticon": "^3.2.0",
"js-generate-password": "^0.1.9",
"localstorage-slim": "^2.5.0",
diff --git a/vue.config.js b/vue.config.js
index 364757e2e..946e889bd 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -1,4 +1,8 @@
const { defineConfig } = require("@vue/cli-service");
+const { gitDescribeSync } = require("git-describe");
+
+process.env.VUE_APP_GIT_HASH = gitDescribeSync().hash;
+
module.exports = defineConfig({
transpileDependencies: true,
configureWebpack: {
From 3c1654764c526c2aec488fd785266364754a3d26 Mon Sep 17 00:00:00 2001
From: Trent Larson
Date: Sun, 10 Dec 2023 09:20:03 -0700
Subject: [PATCH 2/2] add commit hash to help page
---
src/views/HelpView.vue | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/views/HelpView.vue b/src/views/HelpView.vue
index f16d1f593..5739bd841 100644
--- a/src/views/HelpView.vue
+++ b/src/views/HelpView.vue
@@ -214,9 +214,7 @@
What app version is this?
-
- {{ package.version }}
-
+ {{ package.version }} ({{ commitHash }})
For any other questions, including removing your data:
@@ -246,6 +244,7 @@ export default class Help extends Vue {
$notify!: (notification: Notification, timeout?: number) => void;
package = Package;
+ commitHash = process.env.VUE_APP_GIT_HASH;
showOnboardInfo() {
this.$notify(