valaxy 0.26.9 → 0.26.10

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.
@@ -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.B5JLGXpW.mjs';
4
+ export { c as cli, d as registerDevCommand, r as run, a as startValaxyDev } from '../../shared/valaxy.Cwk84srC.mjs';
5
5
  import 'node:os';
6
6
  import 'node:path';
7
7
  import 'consola';
@@ -13,7 +13,7 @@ import { EditableTreeNode } from 'unplugin-vue-router';
13
13
  import Router from 'unplugin-vue-router/vite';
14
14
  import Layouts from 'vite-plugin-vue-layouts';
15
15
  import { Options as Options$1 } from 'vitepress-plugin-group-icons';
16
- import { D as DefaultTheme, R as RuntimeConfig, a as RedirectItem, V as ValaxyConfig, P as PartialDeep, b as ValaxyAddon, S as SiteConfig, U as UserSiteConfig } from '../shared/valaxy.DJquM_xq.mjs';
16
+ import { D as DefaultTheme, R as RuntimeConfig, a as RedirectItem, V as ValaxyConfig, P as PartialDeep, b as ValaxyAddon, S as SiteConfig, U as UserSiteConfig } from '../shared/valaxy.gqLhCu14.mjs';
17
17
  import { MarkdownEnv } from 'unplugin-vue-markdown/types';
18
18
  import { KatexOptions } from 'katex';
19
19
  import MarkdownIt from 'markdown-it';
@@ -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.B5JLGXpW.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.Cwk84srC.mjs';
2
2
  import 'node:path';
3
3
  import 'fs-extra';
4
4
  import 'consola/utils';
@@ -437,6 +437,51 @@ async function getAlias(options) {
437
437
  return alias;
438
438
  }
439
439
 
440
+ const LOCAL_SEARCH_INDEX_ID = "@localSearchIndex";
441
+ const LOCAL_SEARCH_INDEX_REQUEST_PATH = `/${LOCAL_SEARCH_INDEX_ID}`;
442
+ async function localSearchPlugin(options) {
443
+ const siteConfig = options.config.siteConfig;
444
+ if (siteConfig.search?.provider !== "local") {
445
+ return {
446
+ name: "valaxy:local-search",
447
+ resolveId(id) {
448
+ if (id.startsWith(LOCAL_SEARCH_INDEX_ID)) {
449
+ return LOCAL_SEARCH_INDEX_REQUEST_PATH;
450
+ }
451
+ },
452
+ load(id) {
453
+ if (id.startsWith(LOCAL_SEARCH_INDEX_REQUEST_PATH)) {
454
+ return `export default '{}'`;
455
+ }
456
+ }
457
+ };
458
+ }
459
+ return {
460
+ name: "valaxy:local-search",
461
+ config: () => {
462
+ return {
463
+ optimizeDeps: {
464
+ include: [
465
+ "valaxy > @vueuse/integrations/useFocusTrap",
466
+ "valaxy > mark.js/src/vanilla.js",
467
+ "valaxy > minisearch"
468
+ ]
469
+ }
470
+ // async configureServer(_server) {
471
+ // server = _server
472
+ // await scanForBuild()
473
+ // onIndexUpdated()
474
+ // },
475
+ // resolveId(id) {
476
+ // if (id.startsWith(LOCAL_SEARCH_INDEX_ID)) {
477
+ // return `/${id}`
478
+ // }
479
+ // },
480
+ };
481
+ }
482
+ };
483
+ }
484
+
440
485
  const logger = consola.create({});
441
486
  const valaxyPrefix = colors.magenta("[valaxy]");
442
487
  const vLogger = {
@@ -1554,7 +1599,7 @@ async function setupMarkdownPlugins(md, options, base = "/") {
1554
1599
  return md;
1555
1600
  }
1556
1601
 
1557
- const version = "0.26.9";
1602
+ const version = "0.26.10";
1558
1603
 
1559
1604
  const GLOBAL_STATE = {
1560
1605
  valaxyApp: void 0,
@@ -1995,7 +2040,7 @@ const defaultSiteConfig = {
1995
2040
  },
1996
2041
  search: {
1997
2042
  enable: false,
1998
- type: "fuse"
2043
+ provider: "fuse"
1999
2044
  },
2000
2045
  fuse: {
2001
2046
  dataPath: "valaxy-fuse-list.json",
@@ -3472,7 +3517,9 @@ async function ViteValaxyPlugins(valaxyApp, serverOptions = {}) {
3472
3517
  fullInstall: true,
3473
3518
  include: roots.map((root) => `${root}/locales/**`)
3474
3519
  }),
3475
- createFixPlugins()
3520
+ createFixPlugins(),
3521
+ // localSearch
3522
+ await localSearchPlugin(options)
3476
3523
  ];
3477
3524
  if (valaxyConfig.visualizer) {
3478
3525
  try {
@@ -4077,7 +4124,7 @@ async function execBuild({ ssg, root, output, log }) {
4077
4124
  const valaxyApp = createValaxyNode(options);
4078
4125
  await callHookWithLog("options:resolved", valaxyApp);
4079
4126
  const modules = [];
4080
- if (options.config.siteConfig.search.type === "fuse")
4127
+ if (options.config.siteConfig.search.provider === "fuse")
4081
4128
  modules.push(fuseModule);
4082
4129
  if (options.config.modules.rss.enable)
4083
4130
  modules.push(rssModule);
@@ -569,20 +569,25 @@ interface SiteConfig {
569
569
  * @zh 是否启用
570
570
  */
571
571
  enable: boolean;
572
+ /**
573
+ * @deprecated will be deprecated, use search.provider instead
574
+ */
575
+ type?: SiteConfig['search']['provider'];
572
576
  /**
573
577
  * Search Type
574
578
  * - algolia: Algolia Search
575
579
  * - engine: Engine Search, like Google/Baidu
576
580
  * - fuse: Local Search by fuse.js
581
+ * - local(todo): Local Search by MiniSearch
577
582
  */
578
- type: 'algolia' | 'engine' | 'fuse';
583
+ provider: 'algolia' | 'engine' | 'fuse' | 'local';
579
584
  };
580
585
  /**
581
586
  *
582
587
  * fuse search
583
588
  * @see https://fusejs.io/
584
589
  * @description 本地搜索
585
- * Please set search.type to 'fuse'
590
+ * Please set search.provider to 'fuse'
586
591
  */
587
592
  fuse: {
588
593
  /**
@@ -1,5 +1,5 @@
1
- import { c as PostFrontMatter, d as PageFrontMatter } from '../shared/valaxy.DJquM_xq.mjs';
2
- export { A as Album, B as BaseFrontMatter, D as DefaultTheme, E as ExcerptType, F as FuseListItem, P as PartialDeep, i as Photo, g as Pkg, a as RedirectItem, f as RedirectRule, R as RuntimeConfig, S as SiteConfig, e as SocialLink, U as UserSiteConfig, h as UserValaxyConfig, b as ValaxyAddon, V as ValaxyConfig } from '../shared/valaxy.DJquM_xq.mjs';
1
+ import { c as PostFrontMatter, d as PageFrontMatter } from '../shared/valaxy.gqLhCu14.mjs';
2
+ export { A as Album, B as BaseFrontMatter, D as DefaultTheme, E as ExcerptType, F as FuseListItem, P as PartialDeep, i as Photo, g as Pkg, a as RedirectItem, f as RedirectRule, R as RuntimeConfig, S as SiteConfig, e as SocialLink, U as UserSiteConfig, h as UserValaxyConfig, b as ValaxyAddon, V as ValaxyConfig } from '../shared/valaxy.gqLhCu14.mjs';
3
3
  import { Header } from '@valaxyjs/utils';
4
4
  import '@vueuse/integrations/useFuse';
5
5
  import 'medium-zoom';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valaxy",
3
3
  "type": "module",
4
- "version": "0.26.9",
4
+ "version": "0.26.10",
5
5
  "description": "📄 Vite & Vue powered static blog generator.",
6
6
  "author": {
7
7
  "email": "me@yunyoujun.cn",
@@ -135,12 +135,12 @@
135
135
  "vite-ssg": "^28.2.2",
136
136
  "vite-ssg-sitemap": "^0.10.0",
137
137
  "vitepress-plugin-group-icons": "^1.6.5",
138
- "vue": "^3.5.23",
138
+ "vue": "3.5.22",
139
139
  "vue-i18n": "^11.1.12",
140
140
  "vue-router": "^4.6.3",
141
141
  "yargs": "^18.0.0",
142
- "@valaxyjs/devtools": "0.26.9",
143
- "@valaxyjs/utils": "0.26.9"
142
+ "@valaxyjs/devtools": "0.26.10",
143
+ "@valaxyjs/utils": "0.26.10"
144
144
  },
145
145
  "devDependencies": {
146
146
  "@mdit-vue/plugin-component": "^3.0.2",
@@ -165,6 +165,7 @@
165
165
  "diacritics": "^1.3.0",
166
166
  "gh-pages": "^6.3.0",
167
167
  "https-localhost": "^4.7.1",
168
+ "p-map": "^7.0.3",
168
169
  "rollup-plugin-visualizer": "^6.0.5",
169
170
  "unbuild": "^3.6.1"
170
171
  },
package/types/config.ts CHANGED
@@ -171,13 +171,18 @@ export interface SiteConfig {
171
171
  * @zh 是否启用
172
172
  */
173
173
  enable: boolean
174
+ /**
175
+ * @deprecated will be deprecated, use search.provider instead
176
+ */
177
+ type?: SiteConfig['search']['provider']
174
178
  /**
175
179
  * Search Type
176
180
  * - algolia: Algolia Search
177
181
  * - engine: Engine Search, like Google/Baidu
178
182
  * - fuse: Local Search by fuse.js
183
+ * - local(todo): Local Search by MiniSearch
179
184
  */
180
- type: 'algolia' | 'engine' | 'fuse'
185
+ provider: 'algolia' | 'engine' | 'fuse' | 'local'
181
186
  }
182
187
 
183
188
  /**
@@ -185,7 +190,7 @@ export interface SiteConfig {
185
190
  * fuse search
186
191
  * @see https://fusejs.io/
187
192
  * @description 本地搜索
188
- * Please set search.type to 'fuse'
193
+ * Please set search.provider to 'fuse'
189
194
  */
190
195
  fuse: {
191
196
  /**