valaxy 0.26.6 → 0.26.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.
@@ -2,10 +2,12 @@
2
2
  import { runContentUpdated, useDecrypt, useFrontmatter } from 'valaxy'
3
3
  import { computed, defineComponent, h, ref } from 'vue'
4
4
 
5
- const props = defineProps<{
5
+ const props = withDefaults(defineProps<{
6
6
  encryptedContent: string
7
7
  hint?: string
8
- }>()
8
+ }>(), {
9
+ hint: '',
10
+ })
9
11
 
10
12
  const password = ref('')
11
13
  const decryptedContent = ref('')
@@ -1,4 +1,4 @@
1
- import type { MaybeRef } from '@vueuse/core'
1
+ import type { MaybeRef } from 'vue'
2
2
  import type { Post } from '../../types'
3
3
  import { computed, unref } from 'vue'
4
4
  import { useSiteStore } from '../stores'
@@ -1,5 +1,5 @@
1
1
  import type { UseFuseOptions } from '@vueuse/integrations/useFuse'
2
- import type { MaybeRefOrGetter } from '@vueuse/shared'
2
+ import type { MaybeRefOrGetter } from 'vue'
3
3
  import type { FuseListItem } from '../../../types'
4
4
  import { useFuse } from '@vueuse/integrations/useFuse'
5
5
  import { useSiteConfig } from 'valaxy'
package/client/index.d.ts CHANGED
@@ -5,6 +5,7 @@ import type { Post } from '../types'
5
5
  import './shims.d'
6
6
 
7
7
  export * from '../dist/types/index.mjs'
8
+ export * from './index'
8
9
 
9
10
  declare module '@docsearch/js' {
10
11
  function docsearch<T = any>(props: T): void
package/client/main.ts CHANGED
@@ -3,7 +3,7 @@ import { dataSymbol, initValaxyConfig, valaxyConfigSymbol } from 'valaxy'
3
3
  import { setupLayouts } from 'virtual:generated-layouts'
4
4
  import { ViteSSG } from 'vite-ssg'
5
5
 
6
- import { routes } from 'vue-router/auto-routes'
6
+ import { routes as autoRoutes } from 'vue-router/auto-routes'
7
7
  // import App from '/@valaxyjs/App.vue'
8
8
  import App from './App.vue'
9
9
 
@@ -20,13 +20,15 @@ import 'uno.css'
20
20
 
21
21
  const valaxyConfig = initValaxyConfig()
22
22
 
23
+ const routes = [...autoRoutes]
24
+
23
25
  const { redirectRoutes, useVueRouter } = valaxyConfig.value.runtimeConfig.redirects
24
26
  if (useVueRouter)
25
27
  routes.push(...redirectRoutes)
26
28
 
27
29
  // fix chinese path
28
30
  routes.forEach((i) => {
29
- i?.children?.forEach((j) => {
31
+ i?.children?.forEach((j: { path: string }) => {
30
32
  j.path = encodeURI(j.path)
31
33
  })
32
34
  })
@@ -34,8 +34,8 @@ export function formatDate(date?: string | number | Date, options: {
34
34
  */
35
35
  export function sortByDate(posts: Post[], desc = true) {
36
36
  return posts.sort((a, b) => {
37
- const aDate = +new Date(a.date || '')
38
- const bDate = +new Date(b.date || '')
37
+ const aDate = +new Date(a.updated || a.date || '')
38
+ const bDate = +new Date(b.updated || b.date || '')
39
39
  if (desc)
40
40
  return bDate - aDate
41
41
  else
@@ -1,7 +1,7 @@
1
1
  import 'node:process';
2
2
  import 'yargs';
3
3
  import 'yargs/helpers';
4
- export { c as cli, d as registerDevCommand, r as run, a as startValaxyDev } from '../../shared/valaxy.DjEY3xEv.mjs';
4
+ export { c as cli, d as registerDevCommand, r as run, a as startValaxyDev } from '../../shared/valaxy.CTxfxTHO.mjs';
5
5
  import 'node:path';
6
6
  import 'consola';
7
7
  import 'consola/utils';
@@ -1,4 +1,4 @@
1
- export { C as ALL_ROUTE, E as EXCERPT_SEPARATOR, G as GLOBAL_STATE, P as PATHNAME_PROTOCOL_RE, V as ViteValaxyPlugins, b as build, c as cli, N as createServer, L as createValaxyPlugin, D as customElements, j as defaultSiteConfig, w as defaultValaxyConfig, F as defaultViteConfig, h as defineAddon, y as defineConfig, k as defineSiteConfig, u as defineTheme, f as defineValaxyAddon, x as defineValaxyConfig, t as defineValaxyTheme, O as encryptContent, g as generateClientRedirects, Q as getGitTimestamp, e as getIndexHtml, M as getServerInfoText, R as isExternal, U as isInstalledGlobally, S as isPath, v as loadConfigFromFile, A as mergeValaxyConfig, m as mergeViteConfigs, p as postProcessForSSG, I as processValaxyOptions, d as registerDevCommand, i as resolveAddonsConfig, Y as resolveImportPath, W as resolveImportUrl, J as resolveOptions, n as resolveSiteConfig, l as resolveSiteConfigFromRoot, o as resolveThemeConfigFromRoot, K as resolveThemeValaxyConfig, q as resolveUserThemeConfig, B as resolveValaxyConfig, z as resolveValaxyConfigFromRoot, r as run, s as ssgBuild, a as startValaxyDev, X as toAtFS, T as transformObject, H as version } from '../shared/valaxy.DjEY3xEv.mjs';
1
+ export { C as ALL_ROUTE, E as EXCERPT_SEPARATOR, G as GLOBAL_STATE, P as PATHNAME_PROTOCOL_RE, V as ViteValaxyPlugins, b as build, c as cli, N as createServer, L as createValaxyPlugin, D as customElements, j as defaultSiteConfig, w as defaultValaxyConfig, F as defaultViteConfig, h as defineAddon, y as defineConfig, k as defineSiteConfig, u as defineTheme, f as defineValaxyAddon, x as defineValaxyConfig, t as defineValaxyTheme, O as encryptContent, g as generateClientRedirects, Q as getGitTimestamp, e as getIndexHtml, M as getServerInfoText, R as isExternal, U as isInstalledGlobally, S as isPath, v as loadConfigFromFile, A as mergeValaxyConfig, m as mergeViteConfigs, p as postProcessForSSG, I as processValaxyOptions, d as registerDevCommand, i as resolveAddonsConfig, Y as resolveImportPath, W as resolveImportUrl, J as resolveOptions, n as resolveSiteConfig, l as resolveSiteConfigFromRoot, o as resolveThemeConfigFromRoot, K as resolveThemeValaxyConfig, q as resolveUserThemeConfig, B as resolveValaxyConfig, z as resolveValaxyConfigFromRoot, r as run, s as ssgBuild, a as startValaxyDev, X as toAtFS, T as transformObject, H as version } from '../shared/valaxy.CTxfxTHO.mjs';
2
2
  import 'node:path';
3
3
  import 'fs-extra';
4
4
  import 'consola/utils';
@@ -471,6 +471,7 @@ function customRandom(alphabet, defaultSize, getRandom) {
471
471
  let mask = (2 << (31 - Math.clz32((alphabet.length - 1) | 1))) - 1;
472
472
  let step = Math.ceil((1.6 * mask * defaultSize) / alphabet.length);
473
473
  return (size = defaultSize) => {
474
+ if (!size) return ''
474
475
  let id = '';
475
476
  while (true) {
476
477
  let bytes = getRandom(step);
@@ -1567,7 +1568,7 @@ async function setupMarkdownPlugins(md, options, base = "/") {
1567
1568
  return md;
1568
1569
  }
1569
1570
 
1570
- const version = "0.26.6";
1571
+ const version = "0.26.7";
1571
1572
 
1572
1573
  const GLOBAL_STATE = {
1573
1574
  valaxyApp: void 0,
@@ -2793,7 +2794,7 @@ function createTransformEncrypt(options) {
2793
2794
  let getValaxyDecryptTemplate = function(options2) {
2794
2795
  return [
2795
2796
  "<ClientOnly>",
2796
- `<ValaxyDecrypt :encrypted-content="${options2.encryptedContent}" hint="${options2.hint}" />`,
2797
+ `<ValaxyDecrypt :encrypted-content="${options2.encryptedContent}" hint="${options2.hint || ""}" />`,
2797
2798
  "</ClientOnly>"
2798
2799
  ].join("");
2799
2800
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valaxy",
3
3
  "type": "module",
4
- "version": "0.26.6",
4
+ "version": "0.26.7",
5
5
  "description": "📄 Vite & Vue powered static blog generator.",
6
6
  "author": {
7
7
  "email": "me@yunyoujun.cn",
@@ -61,25 +61,25 @@
61
61
  },
62
62
  "dependencies": {
63
63
  "@antfu/install-pkg": "^1.1.0",
64
- "@antfu/utils": "^9.2.0",
64
+ "@antfu/utils": "^9.3.0",
65
65
  "@clack/prompts": "^0.11.0",
66
- "@iconify-json/ri": "^1.2.5",
67
- "@intlify/unplugin-vue-i18n": "^11.0.0",
68
- "@shikijs/transformers": "^3.12.2",
66
+ "@iconify-json/ri": "^1.2.6",
67
+ "@intlify/unplugin-vue-i18n": "^11.0.1",
68
+ "@shikijs/transformers": "^3.14.0",
69
69
  "@types/katex": "^0.16.7",
70
- "@unhead/addons": "^2.0.14",
71
- "@unhead/schema-org": "^2.0.14",
72
- "@unhead/vue": "^2.0.14",
70
+ "@unhead/addons": "^2.0.19",
71
+ "@unhead/schema-org": "^2.0.19",
72
+ "@unhead/vue": "^2.0.19",
73
73
  "@vitejs/plugin-vue": "^6.0.1",
74
74
  "@vue/devtools-api": "7.7.2",
75
- "@vueuse/core": "^13.9.0",
76
- "@vueuse/integrations": "^13.9.0",
75
+ "@vueuse/core": "^14.0.0",
76
+ "@vueuse/integrations": "^14.0.0",
77
77
  "beasties": "^0.3.5",
78
78
  "consola": "^3.4.2",
79
79
  "cross-spawn": "^7.0.6",
80
80
  "css-i18n": "^0.0.5",
81
81
  "dayjs": "^1.11.18",
82
- "debug": "^4.4.1",
82
+ "debug": "^4.4.3",
83
83
  "define-config-ts": "^0.1.3",
84
84
  "defu": "^6.1.4",
85
85
  "ejs": "^3.1.10",
@@ -87,16 +87,16 @@
87
87
  "fast-glob": "^3.3.3",
88
88
  "feed": "^5.1.0",
89
89
  "floating-vue": "^5.2.2",
90
- "fs-extra": "^11.3.1",
90
+ "fs-extra": "^11.3.2",
91
91
  "fuse.js": "^7.1.0",
92
92
  "gray-matter": "^4.0.3",
93
93
  "hookable": "^5.5.3",
94
94
  "html-to-text": "^9.0.5",
95
- "jiti": "^2.5.1",
95
+ "jiti": "^2.6.1",
96
96
  "js-base64": "^3.7.8",
97
97
  "js-yaml": "^4.1.0",
98
- "katex": "^0.16.22",
99
- "lru-cache": "^11.2.1",
98
+ "katex": "^0.16.25",
99
+ "lru-cache": "^11.2.2",
100
100
  "markdown-it": "^14.1.0",
101
101
  "markdown-it-anchor": "^9.2.0",
102
102
  "markdown-it-async": "^2.2.0",
@@ -105,42 +105,42 @@
105
105
  "markdown-it-emoji": "^3.0.0",
106
106
  "markdown-it-footnote": "^4.0.0",
107
107
  "markdown-it-image-figures": "^2.1.1",
108
- "markdown-it-table-of-contents": "^1.0.0",
108
+ "markdown-it-table-of-contents": "^1.1.0",
109
109
  "markdown-it-task-lists": "^2.1.1",
110
110
  "medium-zoom": "^1.1.0",
111
- "mermaid": "^11.11.0",
111
+ "mermaid": "^11.12.1",
112
112
  "mlly": "^1.8.0",
113
113
  "nprogress": "^0.2.0",
114
114
  "open": "10.1.0",
115
- "ora": "^8.2.0",
115
+ "ora": "^9.0.0",
116
116
  "pascalcase": "^2.0.0",
117
117
  "pathe": "^2.0.3",
118
118
  "pinia": "^3.0.3",
119
119
  "qrcode": "^1.5.4",
120
120
  "resolve-global": "^2.0.0",
121
- "sass": "^1.92.1",
122
- "shiki": "^3.12.2",
121
+ "sass": "^1.93.2",
122
+ "shiki": "^3.14.0",
123
123
  "star-markdown-css": "^0.5.3",
124
124
  "table": "^6.9.0",
125
- "unhead": "^2.0.14",
126
- "unocss": "^66.5.0",
125
+ "unhead": "^2.0.19",
126
+ "unocss": "^66.5.4",
127
127
  "unplugin-vue-components": "28.0.0",
128
- "unplugin-vue-markdown": "^29.1.0",
129
- "unplugin-vue-router": "^0.15.0",
128
+ "unplugin-vue-markdown": "^29.2.0",
129
+ "unplugin-vue-router": "^0.16.0",
130
130
  "vanilla-lazyload": "^19.1.3",
131
- "vite": "^7.1.4",
131
+ "vite": "^7.1.12",
132
132
  "vite-dev-rpc": "^1.1.0",
133
- "vite-plugin-vue-devtools": "^8.0.1",
133
+ "vite-plugin-vue-devtools": "^8.0.3",
134
134
  "vite-plugin-vue-layouts": "^0.11.0",
135
- "vite-ssg": "^28.1.0",
135
+ "vite-ssg": "^28.2.2",
136
136
  "vite-ssg-sitemap": "^0.10.0",
137
- "vitepress-plugin-group-icons": "^1.6.3",
138
- "vue": "^3.5.21",
137
+ "vitepress-plugin-group-icons": "^1.6.5",
138
+ "vue": "^3.5.22",
139
139
  "vue-i18n": "^11.1.12",
140
- "vue-router": "^4.5.1",
140
+ "vue-router": "^4.6.3",
141
141
  "yargs": "^18.0.0",
142
- "@valaxyjs/utils": "0.26.6",
143
- "@valaxyjs/devtools": "0.26.6"
142
+ "@valaxyjs/devtools": "0.26.7",
143
+ "@valaxyjs/utils": "0.26.7"
144
144
  },
145
145
  "devDependencies": {
146
146
  "@mdit-vue/plugin-component": "^3.0.2",
@@ -159,18 +159,15 @@
159
159
  "@types/markdown-it-footnote": "^3.0.4",
160
160
  "@types/nprogress": "^0.2.3",
161
161
  "@types/pascalcase": "^1.0.3",
162
- "@types/qrcode": "^1.5.5",
163
- "@types/yargs": "^17.0.33",
162
+ "@types/qrcode": "^1.5.6",
163
+ "@types/yargs": "^17.0.34",
164
164
  "cilicili": "^0.1.1",
165
165
  "diacritics": "^1.3.0",
166
166
  "gh-pages": "^6.3.0",
167
167
  "https-localhost": "^4.7.1",
168
- "rollup-plugin-visualizer": "^6.0.3",
168
+ "rollup-plugin-visualizer": "^6.0.5",
169
169
  "unbuild": "^3.6.1"
170
170
  },
171
- "resolutions": {
172
- "vite": "catalog:build"
173
- },
174
171
  "scripts": {
175
172
  "clean": "rimraf dist",
176
173
  "build": "unbuild",