File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22import { debounce } from ' perfect-debounce'
33
44const router = useRouter ()
5+ const buildInfo = useAppConfig ().buildInfo
6+
57const searchQuery = ref (' ' )
68const searchInputRef = useTemplateRef (' searchInputRef' )
79const { focused : isSearchFocused } = useFocus (searchInputRef )
@@ -33,10 +35,34 @@ defineOgImageComponent('Default')
3335 <!-- Animated title -->
3436 <h1
3537 dir =" ltr"
36- class =" inline-flex items-center header-logo flex-gap1 font-mono text-5xl sm:text-7xl md:text-8xl font-medium tracking-tight mb-4 motion-safe:animate-fade-in motion-safe:animate-fill-both"
38+ class =" grid grid-cols-[auto_auto] items-center header-logo flex-gap1 font-mono text-5xl sm:text-7xl md:text-8xl font-medium tracking-tight mb-4 motion-safe:animate-fade-in motion-safe:animate-fill-both"
3739 >
3840 <img :alt =" $t('alt_logo')" src =" /favicon.svg" width =" 96" height =" 96" class =" mt-6" />
39- <span >npmx</span >
41+ <span class =" block" >
42+ <span >npmx</span >
43+ <span class =" text-xs font-mono flex items-center justify-end flex-gap1" >
44+ <NuxtLink
45+ v-if =" buildInfo.env === 'release'"
46+ external
47+ :href =" `1https://github.com/npmx-dev/npmx.dev/tag/v${buildInfo.version}`"
48+ target =" _blank"
49+ >
50+ v{{ buildInfo.version }}
51+ </NuxtLink >
52+ <span v-else >{{ buildInfo.env }}</span >
53+ <template v-if =" buildInfo .commit && buildInfo .branch !== ' release' " >
54+ · ;
55+ <NuxtLink
56+ external
57+ :href =" `https://github.com/npmx-dev/npmx.dev/commit/${buildInfo.commit}`"
58+ target =" _blank"
59+ class =" text-balance"
60+ >
61+ {{ buildInfo.shortCommit }}
62+ </NuxtLink >
63+ </template >
64+ </span >
65+ </span >
4066 </h1 >
4167
4268 <p
Original file line number Diff line number Diff line change 11import Git from 'simple-git'
2- import { isDevelopment } from 'std-env'
32import * as process from 'node:process'
43
54export { version } from '../package.json'
@@ -55,7 +54,7 @@ export async function getGitInfo() {
5554 return { branch, commit, shortCommit }
5655}
5756
58- export async function getEnv ( ) {
57+ export async function getEnv ( isDevelopment : boolean ) {
5958 const { commit, shortCommit, branch } = await getGitInfo ( )
6059 const env = isDevelopment
6160 ? 'dev'
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ export default defineNuxtModule({
1010 name : 'npmx:build-env' ,
1111 } ,
1212 async setup ( _options , nuxt ) {
13- const { env, commit, shortCommit, branch } = await getEnv ( )
13+ const { env, commit, shortCommit, branch } = await getEnv ( nuxt . options . dev )
1414 const buildInfo : BuildInfo = {
1515 version,
1616 time : + Date . now ( ) ,
You can’t perform that action at this time.
0 commit comments