valaxy 0.20.5 → 0.20.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/client/components/ValaxyApp.vue +10 -10
  2. package/client/components/ValaxyDecrypt.vue +1 -0
  3. package/client/components/ValaxyGalleryDecrypt.vue +1 -0
  4. package/client/components/ValaxyMd.vue +3 -3
  5. package/client/components/builtin/ValaxyMermaid.vue +40 -41
  6. package/client/composables/app/useValaxyHead.ts +3 -3
  7. package/client/composables/categories.ts +1 -1
  8. package/client/composables/codeGroups.ts +1 -1
  9. package/client/composables/collections.ts +1 -1
  10. package/client/composables/common.ts +3 -3
  11. package/client/composables/features/collapse-code.ts +1 -1
  12. package/client/composables/features/copy-code.ts +1 -0
  13. package/client/composables/features/index.ts +1 -1
  14. package/client/composables/helper/useInvisibleElement.ts +1 -1
  15. package/client/composables/index.ts +10 -10
  16. package/client/composables/locale.ts +4 -3
  17. package/client/composables/outline/anchor.ts +1 -1
  18. package/client/composables/outline/headers.ts +3 -3
  19. package/client/composables/outline/index.ts +1 -1
  20. package/client/composables/post/index.ts +3 -3
  21. package/client/composables/search/useFuseSearch.ts +4 -4
  22. package/client/composables/tags.ts +1 -1
  23. package/client/composables/widgets/aplayer.ts +1 -1
  24. package/client/config.ts +8 -8
  25. package/client/index.ts +5 -5
  26. package/client/main.ts +15 -15
  27. package/client/modules/devtools.ts +1 -1
  28. package/client/modules/floating-vue.ts +3 -3
  29. package/client/modules/mermaid.ts +3 -3
  30. package/client/modules/nprogress.ts +1 -1
  31. package/client/modules/pinia.ts +1 -1
  32. package/client/modules/schemaOrg.ts +1 -1
  33. package/client/modules/valaxy.ts +6 -6
  34. package/client/setup/main.ts +7 -7
  35. package/client/setup/mermaid.ts +1 -1
  36. package/client/setups.ts +1 -1
  37. package/client/stores/app.ts +1 -1
  38. package/client/stores/site.ts +2 -2
  39. package/client/types/index.ts +1 -1
  40. package/client/utils/index.ts +3 -3
  41. package/client/utils/time.ts +3 -4
  42. package/dist/chunk-BQRH2D76.mjs +162 -0
  43. package/dist/chunk-F3UFLKIV.cjs +161 -0
  44. package/dist/node/cli/index.cjs +1 -1
  45. package/dist/node/cli/index.mjs +1 -1
  46. package/dist/node/index.cjs +1 -1
  47. package/dist/node/index.d.cts +86 -86
  48. package/dist/node/index.d.ts +86 -86
  49. package/dist/node/index.mjs +1 -1
  50. package/dist/types/index.d.cts +3 -3
  51. package/dist/types/index.d.ts +3 -3
  52. package/package.json +11 -11
  53. package/shims.d.ts +2 -2
  54. package/types/config.ts +1 -1
  55. package/types/index.ts +3 -3
  56. package/dist/chunk-5CL433IL.mjs +0 -162
  57. package/dist/chunk-VDCJKFCV.cjs +0 -161
  58. package/dist/{config-DfXD9Gt_.d.cts → config-Dxu7i2Zs.d.cts} +1 -1
  59. package/dist/{config-DfXD9Gt_.d.ts → config-Dxu7i2Zs.d.ts} +1 -1
@@ -1,24 +1,24 @@
1
1
  <script setup lang="ts">
2
- // TODO: add docs to override ValaxyApp
3
- import { computed } from 'vue'
2
+ import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
4
3
  // import { useHead, useSeoMeta } from '@unhead/vue'
5
4
  import { useSeoMeta } from '@unhead/vue'
6
5
 
7
- // @ts-expect-error virtual module
8
- import ValaxyUserApp from '/@valaxyjs/UserAppVue'
9
- // @ts-expect-error virtual module
10
- import ValaxyThemeApp from '/@valaxyjs/ThemeAppVue'
11
-
6
+ // TODO: add docs to override ValaxyApp
7
+ import { computed } from 'vue'
12
8
  import { useI18n } from 'vue-i18n'
13
- import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
9
+
10
+ import { useFrontmatter, useValaxyHead } from '../composables'
11
+ import { useTimezone } from '../composables/global'
14
12
 
15
13
  // https://github.com/vueuse/head
16
14
  // you can use this to manipulate the document head in any components,
17
15
  // they will be rendered correctly in the html results with vite-ssg
18
16
  import { useSiteConfig } from '../config'
19
- import { useFrontmatter, useValaxyHead } from '../composables'
20
- import { useTimezone } from '../composables/global'
21
17
  import ValaxyAddons from './ValaxyAddons.vue'
18
+ // @ts-expect-error virtual module
19
+ import ValaxyThemeApp from '/@valaxyjs/ThemeAppVue'
20
+ // @ts-expect-error virtual module
21
+ import ValaxyUserApp from '/@valaxyjs/UserAppVue'
22
22
 
23
23
  // <link rel="apple-touch-icon" href="/pwa-192x192.png">
24
24
  // <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#00aba9">
@@ -26,6 +26,7 @@ async function decryptContent() {
26
26
  }
27
27
  catch (e) {
28
28
  hasError.value = true
29
+ console.error(e)
29
30
  }
30
31
  }
31
32
 
@@ -22,6 +22,7 @@ async function decryptContent() {
22
22
  }
23
23
  catch (e) {
24
24
  hasError.value = true
25
+ console.error(e)
25
26
  }
26
27
  }
27
28
 
@@ -1,10 +1,10 @@
1
1
  <script lang="ts" setup>
2
+ import type { Post } from 'valaxy'
3
+ import { onContentUpdated, runContentUpdated, useAplayer, useCodePen, useCollapseCode, useCopyCode, useMediumZoom, wrapTable } from 'valaxy'
2
4
  import { onMounted, onUpdated, ref } from 'vue'
3
5
  import { useI18n } from 'vue-i18n'
4
- import { onContentUpdated, runContentUpdated, useAplayer, useCodePen, useCollapseCode, useCopyCode, useMediumZoom, wrapTable } from 'valaxy'
5
- import type { Post } from 'valaxy'
6
- import { useVanillaLazyLoad } from '../composables/features/vanilla-lazyload'
7
6
  import { useCodeGroups } from '../composables/codeGroups'
7
+ import { useVanillaLazyLoad } from '../composables/features/vanilla-lazyload'
8
8
 
9
9
  const props = defineProps<{
10
10
  frontmatter: Post
@@ -13,10 +13,10 @@ pie
13
13
  -->
14
14
 
15
15
  <script setup lang="ts">
16
- import { getCurrentInstance, ref, watch, watchEffect } from 'vue'
17
-
18
16
  import { isClient } from '@vueuse/core'
17
+
19
18
  import { useAppStore } from 'valaxy'
19
+ import { getCurrentInstance, ref, watch, watchEffect } from 'vue'
20
20
  import { renderMermaid } from '../../modules/mermaid'
21
21
  import ShadowRoot from '../internals/ShadowRoot.vue'
22
22
 
@@ -34,51 +34,50 @@ const appStore = useAppStore()
34
34
 
35
35
  if (isClient) {
36
36
  // dynamic import to reduce initial bundle size
37
- import('mermaid').then(m => m.default)
38
- .then((mermaid) => {
39
- mermaid.startOnLoad = false
40
- mermaid.initialize({ startOnLoad: false })
37
+ import('mermaid').then(m => m.default).then((mermaid) => {
38
+ mermaid.startOnLoad = false
39
+ mermaid.initialize({ startOnLoad: false })
41
40
 
42
- watchEffect(async (onCleanup) => {
43
- let disposed = false
44
- onCleanup(() => {
45
- disposed = true
46
- })
47
- const svg = await renderMermaid(
48
- mermaid,
49
- props.code || '',
50
- {
51
- theme: props.theme || (appStore.isDark ? 'dark' : undefined),
52
- ...vm!.attrs,
53
- },
54
- )
55
- if (!disposed)
56
- html.value = svg
41
+ watchEffect(async (onCleanup) => {
42
+ let disposed = false
43
+ onCleanup(() => {
44
+ disposed = true
57
45
  })
46
+ const svg = await renderMermaid(
47
+ mermaid,
48
+ props.code || '',
49
+ {
50
+ theme: props.theme || (appStore.isDark ? 'dark' : undefined),
51
+ ...vm!.attrs,
52
+ },
53
+ )
54
+ if (!disposed)
55
+ html.value = svg
56
+ })
58
57
 
59
- const actualHeight = ref<number>()
58
+ const actualHeight = ref<number>()
60
59
 
61
- watch(html, () => {
62
- actualHeight.value = undefined
63
- })
60
+ watch(html, () => {
61
+ actualHeight.value = undefined
62
+ })
64
63
 
65
- watchEffect(() => {
66
- const svgEl = el.value?.children?.[0] as SVGElement | undefined
67
- if (svgEl && svgEl.hasAttribute('viewBox') && actualHeight.value == null) {
68
- const v = Number.parseFloat(svgEl.getAttribute('viewBox')?.split(' ')[3] || '')
69
- actualHeight.value = Number.isNaN(v) ? undefined : v
70
- }
71
- }, { flush: 'post' })
64
+ watchEffect(() => {
65
+ const svgEl = el.value?.children?.[0] as SVGElement | undefined
66
+ if (svgEl && svgEl.hasAttribute('viewBox') && actualHeight.value == null) {
67
+ const v = Number.parseFloat(svgEl.getAttribute('viewBox')?.split(' ')[3] || '')
68
+ actualHeight.value = Number.isNaN(v) ? undefined : v
69
+ }
70
+ }, { flush: 'post' })
72
71
 
73
- watchEffect(() => {
74
- const svgEl = el.value?.children?.[0] as SVGElement | undefined
75
- if (svgEl != null && props.scale != null && actualHeight.value != null) {
76
- svgEl.setAttribute('height', `${actualHeight.value * props.scale}`)
77
- svgEl.removeAttribute('width')
78
- svgEl.removeAttribute('style')
79
- }
80
- }, { flush: 'post' })
81
- })
72
+ watchEffect(() => {
73
+ const svgEl = el.value?.children?.[0] as SVGElement | undefined
74
+ if (svgEl != null && props.scale != null && actualHeight.value != null) {
75
+ svgEl.setAttribute('height', `${actualHeight.value * props.scale}`)
76
+ svgEl.removeAttribute('width')
77
+ svgEl.removeAttribute('style')
78
+ }
79
+ }, { flush: 'post' })
80
+ })
82
81
  }
83
82
  </script>
84
83
 
@@ -1,10 +1,10 @@
1
- import { computed } from 'vue'
2
- import pkg from 'valaxy/package.json'
3
1
  import { useHead } from '@unhead/vue'
2
+ import pkg from 'valaxy/package.json'
3
+ import { computed } from 'vue'
4
4
  import { useI18n } from 'vue-i18n'
5
5
 
6
- import { useSiteConfig } from '../../config'
7
6
  import { useFrontmatter } from '../../composables'
7
+ import { useSiteConfig } from '../../config'
8
8
 
9
9
  export function useValaxyHead() {
10
10
  const { locale } = useI18n()
@@ -1,6 +1,6 @@
1
1
  import type { MaybeRef } from '@vueuse/core'
2
- import { computed, unref } from 'vue'
3
2
  import type { Post } from '../../types'
3
+ import { computed, unref } from 'vue'
4
4
  import { useSiteStore } from '../stores'
5
5
 
6
6
  /**
@@ -1,5 +1,5 @@
1
- import { onContentUpdated } from 'valaxy'
2
1
  import { isClient } from '@vueuse/core'
2
+ import { onContentUpdated } from 'valaxy'
3
3
 
4
4
  export function useCodeGroups() {
5
5
  if (import.meta.env.DEV) {
@@ -1,5 +1,5 @@
1
- import { ref } from 'vue'
2
1
  import type { CollectionConfig } from '../define'
2
+ import { ref } from 'vue'
3
3
 
4
4
  /**
5
5
  * Composable for Collections
@@ -1,8 +1,8 @@
1
- import { useRoute } from 'vue-router'
2
- import { computed, inject } from 'vue'
1
+ import type { PageData, PostFrontMatter } from 'valaxy/types'
3
2
  import { isClient } from '@vueuse/core'
3
+ import { computed, inject } from 'vue'
4
4
 
5
- import type { PageData, PostFrontMatter } from 'valaxy/types'
5
+ import { useRoute } from 'vue-router'
6
6
  import { useSiteConfig } from '../config'
7
7
 
8
8
  /**
@@ -1,6 +1,6 @@
1
1
  import { isClient } from '@vueuse/core'
2
- import { onMounted } from 'vue'
3
2
  import { useFrontmatter, useSiteConfig } from 'valaxy'
3
+ import { onMounted } from 'vue'
4
4
 
5
5
  export function useCollapseCode() {
6
6
  const config = useSiteConfig()
@@ -12,6 +12,7 @@ export function useCopyCode() {
12
12
  if (!parent || !sibling)
13
13
  return
14
14
 
15
+ // eslint-disable-next-line regexp/no-unused-capturing-group
15
16
  const isShell = /language-(shellscript|shell|bash|sh|zsh)/.test(
16
17
  parent.className,
17
18
  )
@@ -1,3 +1,3 @@
1
+ export * from './collapse-code'
1
2
  export * from './copy-code'
2
3
  export * from './medium-zoom'
3
- export * from './collapse-code'
@@ -1,5 +1,5 @@
1
- import { useElementBounding, useIntersectionObserver } from '@vueuse/core'
2
1
  import type { Ref } from 'vue'
2
+ import { useElementBounding, useIntersectionObserver } from '@vueuse/core'
3
3
  import { ref } from 'vue'
4
4
 
5
5
  /**
@@ -1,25 +1,25 @@
1
+ // app
2
+ export * from './app'
3
+ // utils
4
+ export * from './back'
1
5
  // for classify
2
6
  export * from './categories'
3
- export * from './post'
4
- export * from './tags'
5
7
  export * from './collections'
6
8
 
7
9
  // common
8
10
  export * from './common'
11
+ export * from './dark'
12
+ export * from './decrypt'
9
13
  export * from './features'
10
14
  export * from './helper'
11
- export * from './dark'
12
15
  export * from './layout'
13
- export * from './widgets'
14
16
  export * from './locale'
15
17
 
16
- export * from './sidebar'
17
18
  export * from './outline'
19
+ export * from './post'
18
20
 
19
- // utils
20
- export * from './back'
21
- export * from './decrypt'
22
21
  export * from './search'
22
+ export * from './sidebar'
23
+ export * from './tags'
23
24
 
24
- // app
25
- export * from './app'
25
+ export * from './widgets'
@@ -1,8 +1,9 @@
1
1
  import { isClient, useStorage } from '@vueuse/core'
2
- import { useI18n } from 'vue-i18n'
3
- import { setDefaultOptions } from 'date-fns/setDefaultOptions'
4
- import { zhCN } from 'date-fns/locale/zh-CN'
2
+ import { setDefaultOptions } from 'date-fns'
3
+ // not optimize deps all locales
5
4
  import { enUS } from 'date-fns/locale/en-US'
5
+ import { zhCN } from 'date-fns/locale/zh-CN'
6
+ import { useI18n } from 'vue-i18n'
6
7
 
7
8
  export function useLocale() {
8
9
  const { availableLocales, locale } = useI18n()
@@ -1,6 +1,6 @@
1
1
  import type { Ref } from 'vue'
2
- import { onMounted, onUnmounted, onUpdated } from 'vue'
3
2
  import { resolvedHeaders } from '@valaxyjs/utils'
3
+ import { onMounted, onUnmounted, onUpdated } from 'vue'
4
4
  import { throttleAndDebounce } from '../../utils'
5
5
  import { useAside } from '../aside'
6
6
 
@@ -1,9 +1,9 @@
1
- import { computed, shallowRef } from 'vue'
2
- import type { DefaultTheme } from 'valaxy/types'
3
1
  import type { MenuItem } from '@valaxyjs/utils'
2
+ import type { DefaultTheme } from 'valaxy/types'
4
3
  import { getHeaders } from '@valaxyjs/utils'
5
- import { onContentUpdated } from '../../utils'
4
+ import { computed, shallowRef } from 'vue'
6
5
  import { useFrontmatter, useThemeConfig } from '../..'
6
+ import { onContentUpdated } from '../../utils'
7
7
 
8
8
  /**
9
9
  * export headers & handleClick to generate outline
@@ -1,4 +1,4 @@
1
1
  // ref vitepress theme-default/composables/outline.ts
2
2
 
3
- export * from './headers'
4
3
  export * from './anchor'
4
+ export * from './headers'
@@ -1,12 +1,12 @@
1
+ import type { Post } from 'valaxy'
1
2
  import type { ComputedRef } from 'vue'
2
3
  import { computed } from 'vue'
3
4
  import { useI18n } from 'vue-i18n'
4
- import type { Post } from 'valaxy'
5
- import { sortByDate } from '../../utils'
6
5
  import { useRouterStore } from '../../stores'
6
+ import { sortByDate } from '../../utils'
7
7
 
8
- export * from './usePrevNext'
9
8
  export * from './usePagination'
9
+ export * from './usePrevNext'
10
10
 
11
11
  export function usePostTitle(post: ComputedRef<Post>) {
12
12
  const { locale } = useI18n()
@@ -1,9 +1,9 @@
1
- import { computed, shallowRef } from 'vue'
2
- import { useSiteConfig } from 'valaxy'
3
- import type { MaybeRefOrGetter } from '@vueuse/shared'
4
1
  import type { UseFuseOptions } from '@vueuse/integrations/useFuse'
5
- import { useFuse } from '@vueuse/integrations/useFuse'
2
+ import type { MaybeRefOrGetter } from '@vueuse/shared'
6
3
  import type { FuseListItem } from 'valaxy/types'
4
+ import { useFuse } from '@vueuse/integrations/useFuse'
5
+ import { useSiteConfig } from 'valaxy'
6
+ import { computed, shallowRef } from 'vue'
7
7
 
8
8
  export function useFuseSearch<T extends FuseListItem = FuseListItem>(
9
9
  search: MaybeRefOrGetter<string>,
@@ -1,5 +1,5 @@
1
- import { computed } from 'vue'
2
1
  import type { Post } from '../../types'
2
+ import { computed } from 'vue'
3
3
  import { useSiteStore } from '../stores'
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { useScriptTag } from '@vueuse/core'
2
1
  import { useHead } from '@unhead/vue'
2
+ import { useScriptTag } from '@vueuse/core'
3
3
  import { computed } from 'vue'
4
4
  import { useSiteConfig } from '../..'
5
5
 
package/client/config.ts CHANGED
@@ -1,17 +1,17 @@
1
- // @ts-expect-error virtual module @valaxyjs/config
2
- import valaxyConfig from '/@valaxyjs/config'
3
-
4
- // @ts-expect-error virtual module @valaxyjs/context
5
- import valaxyContext from '/@valaxyjs/context'
6
- import type { ComputedRef, InjectionKey } from 'vue'
7
- import { computed, inject, readonly, shallowRef } from 'vue'
8
-
9
1
  // import type { RouteMeta } from 'vue-router'
10
2
  // fix build caused by pnpm
11
3
  // This is likely not portable. A type annotation is necessary.
12
4
  // https://github.com/microsoft/TypeScript/issues/42873
13
5
  import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
14
6
 
7
+ import type { ComputedRef, InjectionKey } from 'vue'
8
+ import { computed, inject, readonly, shallowRef } from 'vue'
9
+ // @ts-expect-error virtual module @valaxyjs/config
10
+ import valaxyConfig from '/@valaxyjs/config'
11
+
12
+ // @ts-expect-error virtual module @valaxyjs/context
13
+ import valaxyContext from '/@valaxyjs/context'
14
+
15
15
  /**
16
16
  * parse valaxy config
17
17
  * @param data
package/client/index.ts CHANGED
@@ -1,17 +1,17 @@
1
1
  export * from './addons'
2
+ export * from './composables'
3
+
2
4
  export * from './config'
3
5
 
4
6
  // extend define
5
7
  export * from './define'
8
+ export * from './setups'
6
9
 
7
- export * from './composables'
8
10
  export * from './stores'
9
11
 
10
- export * from './utils'
11
-
12
- export * from './setups'
13
-
14
12
  export * from './types'
15
13
 
14
+ export * from './utils'
15
+
16
16
  // child packages
17
17
  export * from '@valaxyjs/utils'
package/client/main.ts CHANGED
@@ -1,3 +1,16 @@
1
+ import type { ViteSSGContext } from 'vite-ssg'
2
+ import { initValaxyConfig, valaxyConfigSymbol } from 'valaxy'
3
+ import { setupLayouts } from 'virtual:generated-layouts'
4
+ import { ViteSSG } from 'vite-ssg'
5
+ import { routes } from 'vue-router/auto-routes'
6
+
7
+ // import App from '/@valaxyjs/App.vue'
8
+ import App from './App.vue'
9
+ import AppLink from './components/AppLink.vue'
10
+
11
+ import setupMain from './setup/main'
12
+ import { setupValaxyDevTools } from './utils/dev'
13
+
1
14
  // reset styles, load css before app
2
15
  // import '@unocss/reset/tailwind.css'
3
16
  // https://unocss.dev/guide/style-reset#tailwind-compat
@@ -5,26 +18,13 @@
5
18
  import '@unocss/reset/tailwind-compat.css'
6
19
  // css
7
20
  import './styles/css/css-vars.css'
21
+
8
22
  import './styles/css/main.css'
23
+
9
24
  // generate user styles
10
25
  import '/@valaxyjs/styles'
11
26
  import 'uno.css'
12
27
 
13
- import type { ViteSSGContext } from 'vite-ssg'
14
- import { ViteSSG } from 'vite-ssg'
15
-
16
- import { routes } from 'vue-router/auto-routes'
17
- import { setupLayouts } from 'virtual:generated-layouts'
18
-
19
- import { initValaxyConfig, valaxyConfigSymbol } from 'valaxy'
20
- import AppLink from './components/AppLink.vue'
21
-
22
- // import App from '/@valaxyjs/App.vue'
23
- import App from './App.vue'
24
-
25
- import setupMain from './setup/main'
26
- import { setupValaxyDevTools } from './utils/dev'
27
-
28
28
  const valaxyConfig = initValaxyConfig()
29
29
 
30
30
  /**
@@ -1,7 +1,7 @@
1
1
  import type { UserModule } from '../types'
2
2
 
3
- import valaxyLogo from '../assets/images/valaxy-logo.png'
4
3
  import pkg from '../../package.json'
4
+ import valaxyLogo from '../assets/images/valaxy-logo.png'
5
5
 
6
6
  // import {addCustomCommand, addCustomTab } from '@vue/devtools-api'
7
7
 
@@ -1,9 +1,9 @@
1
- import FloatingVue from 'floating-vue'
1
+ import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
2
2
  import type { ViteSSGContext } from 'vite-ssg'
3
3
 
4
- import 'floating-vue/dist/style.css'
5
- import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
6
4
  import type { ComputedRef } from 'vue'
5
+ import FloatingVue from 'floating-vue'
6
+ import 'floating-vue/dist/style.css'
7
7
 
8
8
  export async function install({ app }: ViteSSGContext, config: ComputedRef<ValaxyConfig<DefaultTheme.Config>>) {
9
9
  // @see https://floating-vue.starpad.dev/guide/config#default-values
@@ -1,7 +1,7 @@
1
- import { customAlphabet } from 'nanoid'
2
- import { decode } from 'js-base64'
3
- import { clearUndefined } from '@antfu/utils'
4
1
  import type { Mermaid } from 'mermaid'
2
+ import { clearUndefined } from '@antfu/utils'
3
+ import { decode } from 'js-base64'
4
+ import { customAlphabet } from 'nanoid'
5
5
  import setupMermaid from '../setup/mermaid'
6
6
 
7
7
  const nanoid = customAlphabet('abcedfghicklmn', 10)
@@ -1,5 +1,5 @@
1
- import NProgress from 'nprogress'
2
1
  import type { UserModule } from '../types'
2
+ import NProgress from 'nprogress'
3
3
 
4
4
  export const install: UserModule = ({ isClient, router }) => {
5
5
  if (isClient) {
@@ -1,5 +1,5 @@
1
- import { createPinia } from 'pinia'
2
1
  import type { UserModule } from '../types'
2
+ import { createPinia } from 'pinia'
3
3
 
4
4
  // Setup Pinia
5
5
  // https://pinia.esm.dev/
@@ -1,5 +1,5 @@
1
- import { initValaxyConfig } from 'valaxy'
2
1
  import type { UserModule } from '../types'
2
+ import { initValaxyConfig } from 'valaxy'
3
3
 
4
4
  // https://unhead-schema-org.harlanzw.com/
5
5
  export const install: UserModule = async ({ head, isClient, router }) => {
@@ -1,4 +1,4 @@
1
- import { createI18n } from 'vue-i18n'
1
+ import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
2
2
 
3
3
  /*
4
4
  * All i18n resources specified in the plugin `include` option can be loaded
@@ -8,14 +8,14 @@ import { createI18n } from 'vue-i18n'
8
8
  */
9
9
  // import messages from '@intlify/unplugin-vue-i18n/messages'
10
10
 
11
- import { useStorage } from '@vueuse/core'
11
+ import type { ViteSSGContext } from 'vite-ssg'
12
12
 
13
- import type { Router } from 'vue-router'
14
- import { ensureSuffix } from '@antfu/utils'
15
13
  import type { ComputedRef } from 'vue'
16
- import type { ViteSSGContext } from 'vite-ssg'
17
- import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
14
+ import type { Router } from 'vue-router'
18
15
  import type { PageDataPayload } from '../../types'
16
+ import { ensureSuffix } from '@antfu/utils'
17
+ import { useStorage } from '@vueuse/core'
18
+ import { createI18n } from 'vue-i18n'
19
19
 
20
20
  // @ts-expect-error virtual
21
21
  import valaxyMessages from '/@valaxyjs/locales'
@@ -1,19 +1,19 @@
1
- /* __imports__ */
2
- import type { ViteSSGContext } from 'vite-ssg'
3
- import type { ComputedRef } from 'vue'
4
-
5
1
  // import type { RouteMeta } from 'vue-router'
6
2
  // fix build caused by pnpm
7
3
  // This is likely not portable. A type annotation is necessary.
8
4
  // https://github.com/microsoft/TypeScript/issues/42873
9
5
  import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
6
+ /* __imports__ */
7
+ import type { ViteSSGContext } from 'vite-ssg'
8
+
9
+ import type { ComputedRef } from 'vue'
10
10
 
11
11
  import consola from 'consola'
12
- import { install as installValaxy } from '../modules/valaxy'
13
- import { install as installPinia } from '../modules/pinia'
12
+ import { install as installFloatingVue } from '../modules/floating-vue'
14
13
  import { install as installNprogress } from '../modules/nprogress'
14
+ import { install as installPinia } from '../modules/pinia'
15
15
  import { install as installSchema } from '../modules/schemaOrg'
16
- import { install as installFloatingVue } from '../modules/floating-vue'
16
+ import { install as installValaxy } from '../modules/valaxy'
17
17
 
18
18
  export default function setupMain(ctx: ViteSSGContext, config: ComputedRef<ValaxyConfig<DefaultTheme.Config>>) {
19
19
  // @ts-expect-error inject in runtime
@@ -1,7 +1,7 @@
1
1
  /* __imports__ */
2
2
 
3
- import { defineMermaidSetup } from 'valaxy'
4
3
  import type { MermaidOptions } from '../types'
4
+ import { defineMermaidSetup } from 'valaxy'
5
5
 
6
6
  /**
7
7
  * @en
package/client/setups.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { ViteSSGContext } from 'vite-ssg'
2
1
  import type { Awaitable } from '@antfu/utils'
2
+ import type { ViteSSGContext } from 'vite-ssg'
3
3
  import type { MermaidOptions } from './types'
4
4
 
5
5
  /**
@@ -1,6 +1,6 @@
1
1
  import { acceptHMRUpdate, defineStore } from 'pinia'
2
- import { computed, ref } from 'vue'
3
2
  import { useMobile, useSiteConfig, useThemeConfig, useValaxyDark } from 'valaxy'
3
+ import { computed, ref } from 'vue'
4
4
 
5
5
  /**
6
6
  * Global store for users
@@ -1,7 +1,7 @@
1
- import { computed, ref } from 'vue'
1
+ import type { PageDataPayload } from '../../types'
2
2
  import { acceptHMRUpdate, defineStore } from 'pinia'
3
+ import { computed, ref } from 'vue'
3
4
  import { usePostList, useRouterStore } from '..'
4
- import type { PageDataPayload } from '../../types'
5
5
  import { setWindowValaxyProp } from '../utils/dev'
6
6
 
7
7
  /**
@@ -1,5 +1,5 @@
1
- import type { ViteSSGContext } from 'vite-ssg'
2
1
  import type mermaid from 'mermaid'
2
+ import type { ViteSSGContext } from 'vite-ssg'
3
3
 
4
4
  export type UserModule = (ctx: ViteSSGContext) => void
5
5