Skip to content

Commit 7d11cc1

Browse files
committed
feat(git-version): add information globally
To make information about the currently deployed version easily available.
1 parent 68aa6ec commit 7d11cc1

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

frontend/.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@
6565
"feature-flags",
6666
"format.ts",
6767
"git",
68-
"git-blame-ignore",
68+
"git-blame-ignore",
69+
"git-version",
6970
"healthz",
7071
"i18n",
7172
"logger",
@@ -82,7 +83,7 @@
8283
"useStripeProvider",
8384
"useWindowSize",
8485
"variables.scss",
85-
"vscode"
86+
"vscode"
8687
],
8788
"editor.codeActionsOnSave": {
8889
"source.fixAll.eslint": "always"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
declare global {
2+
interface Window {
3+
gitVersion: string,
4+
}
5+
}
6+
7+
export default defineNuxtPlugin({
8+
hooks: {
9+
'app:mounted'() {
10+
window.gitVersion = useRuntimeConfig().public.gitVersion
11+
},
12+
},
13+
name: 'git-version',
14+
setup() {
15+
const { gitVersion } = useRuntimeConfig().public
16+
useHead({
17+
htmlAttrs: {
18+
'data-git-version': gitVersion,
19+
},
20+
})
21+
},
22+
})

0 commit comments

Comments
 (0)