diff --git a/nuxt.config.ts b/nuxt.config.ts index 8c49dac74..1208ccd7d 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -1,4 +1,8 @@ -import { createResolver } from '@nuxt/kit' +import { createResolver, logger } from '@nuxt/kit' +import { $fetch } from 'ofetch' +import { version } from './package.json' + +logger.success(`Using Docus v${version}`) const { resolve } = createResolver(import.meta.url) @@ -20,7 +24,16 @@ export default defineNuxtConfig({ '@nuxtjs/color-mode', '@nuxt/content', '@vueuse/nuxt', - resolve('./app/module') + resolve('./app/module'), + (_, nuxt) => { + if (nuxt.options.dev) { + $fetch('https://ungh.unjs.io/repos/nuxt-themes/docus/releases/latest').then(({ release }) => { + if (release.tag !== `v${version}`) { + logger.warn(`A new version of Docus (${release.tag}) is available: https://github.com/nuxt-themes/docus/releases/tag/${release.tag}`) + } + }).catch((_) => {}) + } + } ], css: [