Skip to content

Commit 8365a72

Browse files
authored
Merge pull request #255 from OpenGeoscience/frontend-version
Use `package.json` instead of Git to get frontend version
2 parents 9008f77 + 494e13f commit 8365a72

File tree

4 files changed

+27
-92
lines changed

4 files changed

+27
-92
lines changed

web/package-lock.json

Lines changed: 24 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
"core-js": "^3.8.3",
1919
"dayjs": "^1.11.13",
2020
"django-s3-file-field": "^1.1.0",
21-
"git-describe": "^4.1.1",
2221
"html2canvas": "^1.4.1",
2322
"json-editor-vue": "^0.18.1",
2423
"lodash": "^4.17.21",

web/src/components/sidebars/SideBars.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const projectStore = useProjectStore();
1919
2020
2121
const version = import.meta.env.VITE_APP_VERSION;
22-
const hash = import.meta.env.VITE_APP_HASH;
2322
const copied: Ref<string | undefined> = ref();
2423
2524
const themeManager = useTheme();
@@ -75,11 +74,6 @@ watch(darkMode, () => {
7574
:color="copied === version ? 'success' : 'primary'" @click="copyToClipboard(version)" />
7675
Version: {{ version }}
7776
</v-card-subtitle>
78-
<v-card-subtitle>
79-
<v-icon :icon="copied === hash ? 'mdi-check' : 'mdi-content-copy'"
80-
:color="copied === hash ? 'success' : 'primary'" @click="copyToClipboard(hash)" />
81-
Hash: {{ hash }}
82-
</v-card-subtitle>
8377
</v-card>
8478
</v-menu>
8579
</v-toolbar-title>

web/vite.config.mts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ import { nodePolyfills } from 'vite-plugin-node-polyfills'
55
import Vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
66

77
// Utilities
8-
import gitDescribe from 'git-describe';
98
import { defineConfig } from 'vite'
109
import { fileURLToPath, URL } from 'node:url'
1110

11+
import packageJson from './package.json'
1212

13-
const describe = gitDescribe.gitDescribeSync();
14-
process.env.VITE_APP_VERSION = describe.dirty ? describe.raw : (describe.tag || undefined);
15-
process.env.VITE_APP_HASH = describe.hash;
13+
14+
process.env.VITE_APP_VERSION = packageJson.version;
1615

1716
// https://vitejs.dev/config/
1817
export default defineConfig({

0 commit comments

Comments
 (0)