Collection of handy online tools for developers, with great UX.
TypeScript converterdeveloper-productivitydeveloper-toolsfrontendjavascriptproductivitytooltoolstypescriptvuejswebsite
feat: added commit short sha
Corentin Thomasset668625c6dab6
diff --git a/env.d.ts b/env.d.tsindex 53d05202..18bdc8fe 100644--- a/env.d.ts+++ b/env.d.ts@@ -2,13 +2,13 @@/// <reference types="vite-svg-loader" />interface ImportMetaEnv {- VITE_PLAUSIBLE_API_HOST: string;- VITE_PLAUSIBLE_DOMAIN: string;- PACKAGE_VERSION: string;- PROD: boolean;- }-- interface ImportMeta {- readonly env: ImportMetaEnv;- }-\ No newline at end of file+ VITE_PLAUSIBLE_API_HOST: string;+ VITE_PLAUSIBLE_DOMAIN: string;+ PACKAGE_VERSION: string;+ GIT_SHORT_SHA: string;+ PROD: boolean;+}++interface ImportMeta {+ readonly env: ImportMetaEnv;+}diff --git a/src/layouts/base.layout.vue b/src/layouts/base.layout.vueindex 41700a49..28571a5e 100644--- a/src/layouts/base.layout.vue+++ b/src/layouts/base.layout.vue@@ -16,6 +16,7 @@ const activeKey = ref(null)const route = useRoute()const styleStore = useStyleStore()const version = import.meta.env.PACKAGE_VERSION;+const commitSha = import.meta.env.GIT_SHORT_SHA;const makeLabel = (text: string, to: string) => () => h(RouterLink, { to }, { default: () => text })const makeIcon = (icon: Component) => () => h(NIcon, null, { default: () => h(icon) })@@ -75,8 +76,8 @@ const m = toolsByCategory.map(category => ({<div class="footer"><div>- IT-Tools-+ IT-Tools+<n-buttontexttag="a"@@ -88,6 +89,21 @@ const m = toolsByCategory.map(category => ({>v{{ version }}</n-button>++ <template v-if="commitSha && commitSha.length > 0">+ -+ <n-button+ text+ tag="a"+ target="_blank"+ rel="noopener"+ type="primary"+ depth="3"+ :href="`https://github.com/CorentinTh/it-tools/tree/v${commitSha}`"+ >+ {{ commitSha }}+ </n-button>+ </template></div><div>© {{ new Date().getFullYear() }}@@ -123,7 +139,7 @@ const m = toolsByCategory.map(category => ({size="25":component="Menu2"/>- </n-button>+ </n-button></template>Toggle menu</n-tooltip>@@ -173,7 +189,7 @@ const m = toolsByCategory.map(category => ({Sponsor</n-button></template>- ❤ Support IT Tools developement !+ ❤ Support IT Tools developement !</n-tooltip><navbar-buttons v-if="!styleStore.isSmallScreen" />diff --git a/vite.config.ts b/vite.config.tsindex c2c4d8d3..f3c9f6e8 100644--- a/vite.config.ts+++ b/vite.config.ts@@ -61,5 +61,6 @@ export default defineConfig({},define: {'import.meta.env.PACKAGE_VERSION': JSON.stringify(process.env.npm_package_version),+ 'import.meta.env.GIT_SHORT_SHA': JSON.stringify((process?.env?.VITE_VERCEL_GIT_COMMIT_SHA ?? '').slice(0, 7)),},});