valaxy 0.20.5 → 0.20.7

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 (67) hide show
  1. package/client/components/ValaxyApp.vue +10 -11
  2. package/client/components/ValaxyDecrypt.vue +9 -7
  3. package/client/components/ValaxyGalleryDecrypt.vue +1 -0
  4. package/client/components/ValaxyLogo.vue +5 -1
  5. package/client/components/ValaxyMd.vue +3 -3
  6. package/client/components/builtin/ValaxyMermaid.vue +40 -41
  7. package/client/composables/app/useValaxyHead.ts +13 -6
  8. package/client/composables/categories.ts +1 -1
  9. package/client/composables/codeGroups.ts +1 -1
  10. package/client/composables/collections.ts +1 -1
  11. package/client/composables/common.ts +3 -3
  12. package/client/composables/features/collapse-code.ts +1 -1
  13. package/client/composables/features/copy-code.ts +1 -0
  14. package/client/composables/features/index.ts +1 -1
  15. package/client/composables/helper/useInvisibleElement.ts +1 -1
  16. package/client/composables/index.ts +10 -10
  17. package/client/composables/locale.ts +4 -3
  18. package/client/composables/outline/anchor.ts +9 -8
  19. package/client/composables/outline/headers.ts +3 -3
  20. package/client/composables/outline/index.ts +1 -1
  21. package/client/composables/post/index.ts +3 -3
  22. package/client/composables/search/useFuseSearch.ts +4 -4
  23. package/client/composables/tags.ts +1 -1
  24. package/client/composables/widgets/aplayer.ts +1 -1
  25. package/client/config.ts +8 -8
  26. package/client/index.ts +5 -5
  27. package/client/main.ts +15 -15
  28. package/client/modules/devtools.ts +1 -1
  29. package/client/modules/floating-vue.ts +3 -3
  30. package/client/modules/mermaid.ts +3 -3
  31. package/client/modules/nprogress.ts +1 -1
  32. package/client/modules/pinia.ts +1 -1
  33. package/client/modules/schemaOrg.ts +1 -1
  34. package/client/modules/valaxy.ts +6 -6
  35. package/client/setup/main.ts +7 -7
  36. package/client/setup/mermaid.ts +1 -1
  37. package/client/setups.ts +2 -2
  38. package/client/stores/app.ts +1 -1
  39. package/client/stores/site.ts +2 -2
  40. package/client/styles/common/markdown.scss +4 -4
  41. package/client/styles/index.scss +0 -1
  42. package/client/types/index.ts +1 -1
  43. package/client/utils/index.ts +3 -3
  44. package/client/utils/time.ts +3 -4
  45. package/dist/chunk-JOSLTXIR.cjs +161 -0
  46. package/dist/chunk-LB5BBIUM.mjs +162 -0
  47. package/dist/node/cli/index.cjs +1 -1
  48. package/dist/node/cli/index.mjs +1 -1
  49. package/dist/node/index.cjs +1 -1
  50. package/dist/node/index.d.cts +86 -86
  51. package/dist/node/index.d.ts +86 -86
  52. package/dist/node/index.mjs +1 -1
  53. package/dist/types/index.cjs +1 -1
  54. package/dist/types/index.d.cts +3 -3
  55. package/dist/types/index.d.ts +3 -3
  56. package/dist/types/index.mjs +1 -1
  57. package/package.json +23 -23
  58. package/shims.d.ts +2 -2
  59. package/types/config.ts +1 -1
  60. package/types/index.ts +3 -3
  61. package/client/styles/common/scrollbar.scss +0 -30
  62. package/dist/chunk-5CL433IL.mjs +0 -162
  63. package/dist/chunk-VDCJKFCV.cjs +0 -161
  64. package/dist/{chunk-6GE64PZD.cjs → chunk-BJ22GQI6.cjs} +0 -0
  65. package/dist/{chunk-WE2LNW3F.mjs → chunk-XKANGEKW.mjs} +0 -0
  66. package/dist/{config-DfXD9Gt_.d.cts → config-Dxu7i2Zs.d.cts} +1 -1
  67. package/dist/{config-DfXD9Gt_.d.ts → config-Dxu7i2Zs.d.ts} +1 -1
@@ -1,24 +1,23 @@
1
1
  <script setup lang="ts">
2
- // TODO: add docs to override ValaxyApp
3
- import { computed } from 'vue'
4
- // import { useHead, useSeoMeta } from '@unhead/vue'
2
+ import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
5
3
  import { useSeoMeta } from '@unhead/vue'
6
4
 
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
-
5
+ // TODO: add docs to override ValaxyApp
6
+ import { computed } from 'vue'
12
7
  import { useI18n } from 'vue-i18n'
13
- import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
8
+
9
+ import { useFrontmatter, useValaxyHead } from '../composables'
10
+ import { useTimezone } from '../composables/global'
14
11
 
15
12
  // https://github.com/vueuse/head
16
13
  // you can use this to manipulate the document head in any components,
17
14
  // they will be rendered correctly in the html results with vite-ssg
18
15
  import { useSiteConfig } from '../config'
19
- import { useFrontmatter, useValaxyHead } from '../composables'
20
- import { useTimezone } from '../composables/global'
21
16
  import ValaxyAddons from './ValaxyAddons.vue'
17
+ // @ts-expect-error virtual module
18
+ import ValaxyThemeApp from '/@valaxyjs/ThemeAppVue'
19
+ // @ts-expect-error virtual module
20
+ import ValaxyUserApp from '/@valaxyjs/UserAppVue'
22
21
 
23
22
  // <link rel="apple-touch-icon" href="/pwa-192x192.png">
24
23
  // <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#00aba9">
@@ -1,9 +1,10 @@
1
1
  <script lang="ts" setup>
2
2
  import { runContentUpdated, useDecrypt, useFrontmatter } from 'valaxy'
3
- import { defineComponent, h, onMounted, ref } from 'vue'
3
+ import { computed, defineComponent, h, ref } from 'vue'
4
4
 
5
5
  const props = defineProps<{
6
6
  encryptedContent: string
7
+ hint?: string
7
8
  }>()
8
9
 
9
10
  const password = ref('')
@@ -26,6 +27,7 @@ async function decryptContent() {
26
27
  }
27
28
  catch (e) {
28
29
  hasError.value = true
30
+ console.error(e)
29
31
  }
30
32
  }
31
33
 
@@ -57,11 +59,7 @@ const ValaxyDeprecatedContent = defineComponent({
57
59
  },
58
60
  })
59
61
 
60
- const hasWarning = ref(false)
61
- onMounted(() => {
62
- if (location.protocol !== 'https:')
63
- hasWarning.value = true
64
- })
62
+ const hasWarning = computed(() => location.protocol !== 'https:')
65
63
  </script>
66
64
 
67
65
  <template>
@@ -82,13 +80,17 @@ onMounted(() => {
82
80
  @keyup.enter="decryptContent"
83
81
  >
84
82
  <div
83
+ class="text-gray/70 hover:text-gray transition"
85
84
  cursor-pointer
86
85
  absolute text-2xl
87
86
  i-ri-arrow-right-circle-line right-3
88
- text-gray hover:text-black
89
87
  @click="decryptContent"
90
88
  />
91
89
 
90
+ <div v-if="hint" class="-top-6" absolute text-xs op="50">
91
+ <div v-html="hint" />
92
+ </div>
93
+
92
94
  <div v-if="hasWarning" class="-bottom-6" absolute text-xs op="50">
93
95
  <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API" target="_blank">
94
96
  <span>Web Crypto API</span>
@@ -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
 
@@ -5,7 +5,11 @@ import valaxyLogoPng from '../assets/images/valaxy-logo.png'
5
5
  <template>
6
6
  <div class="valaxy-logo-container" relative inline-flex justify="center" items="center">
7
7
  <div class="absolute bg-img" />
8
- <img class="fly-animation" w="50" aspect="420/386" m="auto" :src="valaxyLogoPng" alt="Valaxy Logo" z="1">
8
+ <img
9
+ class="fly-animation h-50"
10
+ aspect="420/386" m="auto"
11
+ :src="valaxyLogoPng" alt="Valaxy Logo" z="1"
12
+ >
9
13
  </div>
10
14
  </template>
11
15
 
@@ -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,20 +1,22 @@
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()
11
11
 
12
12
  const fm = useFrontmatter()
13
13
  const siteConfig = useSiteConfig()
14
- const title = computed(() => fm.value[`title_${locale.value}`] || fm.value.title)
14
+ const title = computed<string>(() => fm.value[`title_${locale.value}`] || fm.value.title)
15
15
  useHead({
16
16
  title,
17
- titleTemplate: computed(() => fm.value.titleTemplate || ((title: string) => title ? `${title} - ${siteConfig.value.title}` : siteConfig.value.title)),
17
+ titleTemplate: (title) => {
18
+ return fm.value.titleTemplate || (title ? `${title} - ${siteConfig.value.title}` : siteConfig.value.title)
19
+ },
18
20
  link: [
19
21
  {
20
22
  rel: 'icon',
@@ -23,7 +25,12 @@ export function useValaxyHead() {
23
25
  },
24
26
  ],
25
27
  meta: [
26
- { name: 'description', content: computed(() => siteConfig.value.description) },
28
+ computed(() => {
29
+ return {
30
+ name: 'description',
31
+ content: fm.value.description || siteConfig.value.description,
32
+ }
33
+ }),
27
34
  {
28
35
  name: 'generator',
29
36
  content: `Valaxy ${pkg.version}`,
@@ -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
 
@@ -47,6 +47,10 @@ export function useActiveAnchor(
47
47
  window.removeEventListener('scroll', onScroll)
48
48
  })
49
49
 
50
+ /**
51
+ * 长目录自动滚动
52
+ * @TODO add e2e test
53
+ */
50
54
  const checkActiveLinkInViewport = () => {
51
55
  const activeLink = prevActiveLink
52
56
  if (!activeLink) {
@@ -54,15 +58,12 @@ export function useActiveAnchor(
54
58
  return
55
59
  }
56
60
 
57
- const top = activeLink.getBoundingClientRect().top
58
- const bottom = activeLink.getBoundingClientRect().bottom
59
-
60
61
  const parentEl = document.querySelector('.yun-aside') as HTMLElement
61
62
  if (parentEl) {
62
- if (top < parentEl.scrollTop)
63
- parentEl.scrollTo({ top: 0, behavior: 'smooth' })
64
- if (bottom > parentEl.offsetHeight + parentEl.scrollTop)
65
- parentEl.scrollTo({ top: bottom + 40, behavior: 'smooth' })
63
+ // 超出
64
+ const top = activeLink.offsetTop + topOffset + 60
65
+ if (top < parentEl.scrollTop || (top > parentEl.offsetHeight + parentEl.scrollTop))
66
+ parentEl.scrollTo({ top, behavior: 'smooth' })
66
67
  }
67
68
  }
68
69
 
@@ -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/