valaxy 0.0.8 → 0.1.1

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 (41) hide show
  1. package/bin/valaxy.js +1 -1
  2. package/dist/build-VGAF4K5S.js +1 -0
  3. package/dist/build-Y5F7AZ2V.mjs +1 -0
  4. package/dist/chunk-5KQ3UFYI.js +1 -0
  5. package/dist/{chunk-MWP3FN5Q.mjs → chunk-ESCOXVP6.mjs} +40 -40
  6. package/dist/chunk-JWA76JND.mjs +1 -0
  7. package/dist/chunk-WYCH73X6.js +83 -0
  8. package/dist/{node/cli.d.ts → cli.d.ts} +0 -0
  9. package/dist/cli.js +6 -0
  10. package/dist/cli.mjs +6 -0
  11. package/dist/index.d.ts +152 -299
  12. package/dist/index.js +1 -1
  13. package/dist/index.mjs +1 -1
  14. package/package.json +7 -3
  15. package/src/client/components/PostList.vue +2 -2
  16. package/src/client/components/ValaxyCopyright.vue +1 -1
  17. package/src/client/components/ValaxyFooter.vue +1 -1
  18. package/src/client/components/ValaxyPagination.vue +2 -3
  19. package/src/client/components/ValaxyRightSidebar.vue +2 -2
  20. package/src/client/modules/valaxy.ts +9 -5
  21. package/src/client/styles/common/markdown.scss +3 -0
  22. package/src/client/styles/global/reset.scss +1 -0
  23. package/src/client/styles/palette.scss +3 -2
  24. package/src/client/utils/time.ts +6 -0
  25. package/src/node/plugins/extendConfig.ts +3 -2
  26. package/src/node/plugins/preset.ts +3 -2
  27. package/src/node/vite.ts +3 -2
  28. package/tsup.config.ts +2 -1
  29. package/dist/build-RREYJOHF.mjs +0 -1
  30. package/dist/build-TIU2KH77.js +0 -1
  31. package/dist/chunk-44DGW27S.js +0 -1
  32. package/dist/chunk-CSMXFOVS.mjs +0 -1
  33. package/dist/chunk-EM2KSV5V.js +0 -83
  34. package/dist/chunk-HUI4MBPM.js +0 -1
  35. package/dist/chunk-RKUUEWDF.mjs +0 -1
  36. package/dist/config-d6527c8c.d.ts +0 -174
  37. package/dist/node/cli.js +0 -6
  38. package/dist/node/cli.mjs +0 -6
  39. package/dist/node/index.d.ts +0 -45
  40. package/dist/node/index.js +0 -1
  41. package/dist/node/index.mjs +0 -1
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkEM2KSV5Vjs = require('./chunk-EM2KSV5V.js');var _chunk44DGW27Sjs = require('./chunk-44DGW27S.js');_chunk44DGW27Sjs.f.call(void 0, );var _vite = require('vite');async function c(o,t={},i={}){return process.env.EDITOR=process.env.EDITOR||"code",await _vite.createServer.call(void 0, _vite.mergeConfig.call(void 0, t,_chunkEM2KSV5Vjs.f.call(void 0, o,i)))}exports.a = c;
@@ -1 +0,0 @@
1
- var p=Object.create;var i=Object.defineProperty,m=Object.defineProperties,c=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyDescriptors,u=Object.getOwnPropertyNames,s=Object.getOwnPropertySymbols,y=Object.getPrototypeOf,g=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var l=(e,n,t)=>n in e?i(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,x=(e,n)=>{for(var t in n||(n={}))g.call(n,t)&&l(e,t,n[t]);if(s)for(var t of s(n))b.call(n,t)&&l(e,t,n[t]);return e},k=(e,n)=>m(e,d(n));var w=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(n,t)=>(typeof require!="undefined"?require:n)[t]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});var h=(e,n)=>()=>(e&&(n=e(e=0)),n);var C=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports);var f=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let a of u(n))!g.call(e,a)&&a!==t&&i(e,a,{get:()=>n[a],enumerable:!(r=c(n,a))||r.enumerable});return e};var V=(e,n,t)=>(t=e!=null?p(y(e)):{},f(n||!e||!e.__esModule?i(t,"default",{value:e,enumerable:!0}):t,e));var o=h(()=>{});o();var j={url:"",lang:"en",title:"Valaxy Blog",subtitle:"Next Generation Static Blog Framework.",author:{avatar:"https://cdn.jsdelivr.net/gh/YunYouJun/yun/images/meme/yun-good-with-bg.jpg",name:"YunYouJun",status:{emoji:"\u{1F60A}",message:"All at sea."}},social:[],description:"A blog generated by Valaxy.",license:{enabled:!0,language:"",type:"by-nc-sa"},sponsor:{enable:!0,title:"\u6211\u5F88\u53EF\u7231\uFF0C\u8BF7\u7ED9\u6211\u94B1",methods:[{name:"\u652F\u4ED8\u5B9D",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/alipay-qrcode.jpg",color:"#00A3EE",icon:"i-ri-alipay-line"},{name:"QQ \u652F\u4ED8",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/qqpay-qrcode.png",color:"#12B7F5",icon:"i-ri-qq-line"},{name:"\u5FAE\u4FE1\u652F\u4ED8",url:"https://cdn.jsdelivr.net/gh/YunYouJun/cdn/img/donate/wechatpay-qrcode.jpg",color:"#2DC100",icon:"i-ri-wechat-pay-line"}]},search:{algolia:{enable:!1,appId:"",apiKey:"",indexName:"",chunkSize:5e3}},comment:{waline:{enable:!1,serverURL:""}},theme:"yun",themeConfig:{},unocss:{},markdown:{excerpt:"<!-- more -->"},markdownIt:{toc:{listType:"ol"},katex:{}}};o();o();export{x as a,k as b,w as c,C as d,V as e,o as f,j as g};
@@ -1,174 +0,0 @@
1
- import { PartialDeep } from 'type-fest';
2
- import { VitePluginConfig } from 'unocss/vite';
3
- import MarkdownIt from 'markdown-it';
4
- import Anchor from 'markdown-it-anchor';
5
- import { KatexOptions } from 'katex';
6
- import Markdown from 'vite-plugin-md';
7
-
8
- interface MarkdownOptions extends MarkdownIt.Options {
9
- config?: (md: MarkdownIt) => void;
10
- anchor?: {
11
- permalink?: Anchor.AnchorOptions['permalink'];
12
- };
13
- toc?: any;
14
- katex?: KatexOptions;
15
- }
16
-
17
- declare type ViteMdOptions = Parameters<typeof Markdown>[0];
18
-
19
- declare type ValaxyThemeConfig = Record<string, any>;
20
- interface SocialLink {
21
- /**
22
- * The title of your link
23
- */
24
- name: string;
25
- link: string;
26
- /**
27
- * 图标名称
28
- * https://icones.js.org/
29
- */
30
- icon: string;
31
- color: string;
32
- }
33
- interface ValaxyConfig<T = ValaxyThemeConfig> {
34
- /**
35
- * Default language
36
- * @description 默认语言
37
- * @default 'en'
38
- */
39
- lang: string;
40
- /**
41
- * You site url in web, required for ssg, do not add / in end
42
- * @description 站点的 URL,SSG 需要(譬如生成版权处文章永久链接),不要在末尾添加 /
43
- */
44
- url: string;
45
- /**
46
- * Site title
47
- * @description 站点标题
48
- */
49
- title: string;
50
- /**
51
- * 副标题
52
- */
53
- subtitle: string;
54
- /**
55
- * 站点描述
56
- */
57
- description: string;
58
- /**
59
- * The owner of this blog
60
- * @description 博客作者
61
- */
62
- author: {
63
- /**
64
- * Your name
65
- * @description 你的名字
66
- */
67
- name: string;
68
- avatar: string;
69
- /**
70
- * The status of you
71
- * @description 状态
72
- */
73
- status: {
74
- emoji: string;
75
- /**
76
- * show when hover emoji
77
- * @description 当鼠标悬浮在图标上时显示
78
- */
79
- message: string;
80
- };
81
- };
82
- /**
83
- * 社交链接
84
- */
85
- social: SocialLink[];
86
- /**
87
- * search
88
- */
89
- search: {
90
- algolia: {
91
- enable: boolean;
92
- appId: string;
93
- apiKey: string;
94
- indexName: string;
95
- chunkSize: number;
96
- };
97
- };
98
- /**
99
- * comment: waline/...
100
- */
101
- comment: {
102
- waline: {
103
- enable: boolean;
104
- serverURL: string;
105
- };
106
- };
107
- /**
108
- * The name of theme
109
- * @description 主题名称
110
- */
111
- theme: string;
112
- /**
113
- * The config of theme
114
- * @description 主题配置
115
- */
116
- themeConfig: T;
117
- /**
118
- * Unocss Config
119
- */
120
- unocss: VitePluginConfig;
121
- /**
122
- * The license of your posts
123
- * @description 文章所使用的协议,默认使用 Creative Commons
124
- * @default https://creativecommons.org/licenses/
125
- */
126
- license: {
127
- /**
128
- * Whether to show at the bottom of the article
129
- * @description 是否显示在文章底部
130
- * @default true
131
- */
132
- enabled: boolean;
133
- /**
134
- * Creative License Language, same with your config.lang
135
- * when lang === 'zh-CN', use 'zh'
136
- * @description 默认与站点语言相同
137
- * @default 'en'
138
- */
139
- language: string;
140
- /**
141
- * Type of license
142
- * @description 证书类型
143
- * @default 'by-nc-sa'
144
- */
145
- type: 'zero' | 'by-sa' | 'by-nd' | 'by-nc' | 'by-nc-sa' | 'by-nc-nd';
146
- };
147
- /**
148
- * donate for author
149
- * @description 打赏/赞助
150
- */
151
- sponsor: {
152
- enable: boolean;
153
- title: string;
154
- methods: {
155
- name: string;
156
- url: string;
157
- color: string;
158
- icon: string;
159
- }[];
160
- };
161
- /**
162
- * for markdown
163
- */
164
- markdown: ViteMdOptions;
165
- markdownIt: MarkdownOptions;
166
- }
167
- /**
168
- * Valaxy User Config
169
- * @description Valaxy 用户配置
170
- */
171
- declare type UserConfig<T = ValaxyThemeConfig> = PartialDeep<ValaxyConfig<T>>;
172
- declare const defaultValaxyConfig: ValaxyConfig;
173
-
174
- export { SocialLink as S, UserConfig as U, ValaxyConfig as V, ValaxyThemeConfig as a, defaultValaxyConfig as d };
package/dist/node/cli.js DELETED
@@ -1,6 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } } function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }var _chunkHUI4MBPMjs = require('../chunk-HUI4MBPM.js');var _chunkEM2KSV5Vjs = require('../chunk-EM2KSV5V.js');var _chunk44DGW27Sjs = require('../chunk-44DGW27S.js');var Q=_chunk44DGW27Sjs.d.call(void 0, (We,K)=>{_chunk44DGW27Sjs.f.call(void 0, );var v=1e3,b=v*60,w=b*60,h=w*24,Ce=h*7,ye=h*365.25;K.exports=function(e,o){o=o||{};var t=typeof e;if(t==="string"&&e.length>0)return he(e);if(t==="number"&&isFinite(e))return o.long?be(e):ve(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function he(e){if(e=String(e),!(e.length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!!o){var t=parseFloat(o[1]),r=(o[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*ye;case"weeks":case"week":case"w":return t*Ce;case"days":case"day":case"d":return t*h;case"hours":case"hour":case"hrs":case"hr":case"h":return t*w;case"minutes":case"minute":case"mins":case"min":case"m":return t*b;case"seconds":case"second":case"secs":case"sec":case"s":return t*v;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function ve(e){var o=Math.abs(e);return o>=h?Math.round(e/h)+"d":o>=w?Math.round(e/w)+"h":o>=b?Math.round(e/b)+"m":o>=v?Math.round(e/v)+"s":e+"ms"}function be(e){var o=Math.abs(e);return o>=h?j(e,o,h,"day"):o>=w?j(e,o,w,"hour"):o>=b?j(e,o,b,"minute"):o>=v?j(e,o,v,"second"):e+" ms"}function j(e,o,t,r){var s=o>=t*1.5;return Math.round(e/t)+" "+r+(s?"s":"")}});var q=_chunk44DGW27Sjs.d.call(void 0, (Ze,X)=>{_chunk44DGW27Sjs.f.call(void 0, );function we(e){t.debug=t,t.default=t,t.coerce=x,t.disable=c,t.enable=s,t.enabled=g,t.humanize=Q(),t.destroy=le,Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={};function o(n){let i=0;for(let l=0;l<n.length;l++)i=(i<<5)-i+n.charCodeAt(l),i|=0;return t.colors[Math.abs(i)%t.colors.length]}t.selectColor=o;function t(n){let i,l=null,O,Y;function C(...d){if(!C.enabled)return;let y=C,$=Number(new Date),ue=$-(i||$);y.diff=ue,y.prev=i,y.curr=$,i=$,d[0]=t.coerce(d[0]),typeof d[0]!="string"&&d.unshift("%O");let k=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(N,pe)=>{if(N==="%%")return"%";k++;let G=t.formatters[pe];if(typeof G=="function"){let fe=d[k];N=G.call(y,fe),d.splice(k,1),k--}return N}),t.formatArgs.call(y,d),(y.log||t.log).apply(y,d)}return C.namespace=n,C.useColors=t.useColors(),C.color=t.selectColor(n),C.extend=r,C.destroy=t.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(O!==t.namespaces&&(O=t.namespaces,Y=t.enabled(n)),Y),set:d=>{l=d}}),typeof t.init=="function"&&t.init(C),C}function r(n,i){let l=t(this.namespace+(typeof i>"u"?":":i)+n);return l.log=this.log,l}function s(n){t.save(n),t.namespaces=n,t.names=[],t.skips=[];let i,l=(typeof n=="string"?n:"").split(/[\s,]+/),O=l.length;for(i=0;i<O;i++)!l[i]||(n=l[i].replace(/\*/g,".*?"),n[0]==="-"?t.skips.push(new RegExp("^"+n.slice(1)+"$")):t.names.push(new RegExp("^"+n+"$")))}function c(){let n=[...t.names.map(m),...t.skips.map(m).map(i=>"-"+i)].join(",");return t.enable(""),n}function g(n){if(n[n.length-1]==="*")return!0;let i,l;for(i=0,l=t.skips.length;i<l;i++)if(t.skips[i].test(n))return!1;for(i=0,l=t.names.length;i<l;i++)if(t.names[i].test(n))return!0;return!1}function m(n){return n.toString().substring(2,n.toString().length-2).replace(/\.\*\?$/,"*")}function x(n){return n instanceof Error?n.stack||n.message:n}function le(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}X.exports=we});var ee=_chunk44DGW27Sjs.d.call(void 0, (f,S)=>{_chunk44DGW27Sjs.f.call(void 0, );f.formatArgs=xe;f.save=Oe;f.load=$e;f.useColors=Fe;f.storage=ke();f.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();f.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Fe(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function xe(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+S.exports.humanize(this.diff),!this.useColors)return;let o="color: "+this.color;e.splice(1,0,o,"color: inherit");let t=0,r=0;e[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(r=t))}),e.splice(r,0,o)}f.log=console.debug||console.log||(()=>{});function Oe(e){try{e?f.storage.setItem("debug",e):f.storage.removeItem("debug")}catch (e2){}}function $e(){let e;try{e=f.storage.getItem("debug")}catch (e3){}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function ke(){try{return localStorage}catch (e4){}}S.exports=q()(f);var{formatters:Re}=S.exports;Re.j=function(e){try{return JSON.stringify(e)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}}});var oe=_chunk44DGW27Sjs.d.call(void 0, (u,E)=>{_chunk44DGW27Sjs.f.call(void 0, );var je=_chunk44DGW27Sjs.c.call(void 0, "tty"),I=_chunk44DGW27Sjs.c.call(void 0, "util");u.init=Ne;u.log=Ae;u.formatArgs=Ie;u.save=Ve;u.load=De;u.useColors=Se;u.destroy=I.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");u.colors=[6,2,3,4,5,1];try{let e=_chunkEM2KSV5Vjs.a.call(void 0, );e&&(e.stderr||e).level>=2&&(u.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch (e5){}u.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,o)=>{let t=o.substring(6).toLowerCase().replace(/_([a-z])/g,(s,c)=>c.toUpperCase()),r=process.env[o];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),e[t]=r,e},{});function Se(){return"colors"in u.inspectOpts?Boolean(u.inspectOpts.colors):je.isatty(process.stderr.fd)}function Ie(e){let{namespace:o,useColors:t}=this;if(t){let r=this.color,s="\x1B[3"+(r<8?r:"8;5;"+r),c=` ${s};1m${o} \x1B[0m`;e[0]=c+e[0].split(`
2
- `).join(`
3
- `+c),e.push(s+"m+"+E.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Ee()+o+" "+e[0]}function Ee(){return u.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Ae(...e){return process.stderr.write(I.format(...e)+`
4
- `)}function Ve(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function De(){return process.env.DEBUG}function Ne(e){e.inspectOpts={};let o=Object.keys(u.inspectOpts);for(let t=0;t<o.length;t++)e.inspectOpts[o[t]]=u.inspectOpts[o[t]]}E.exports=q()(u);var{formatters:te}=E.exports;te.o=function(e){return this.inspectOpts.colors=this.useColors,I.inspect(e,this.inspectOpts).split(`
5
- `).map(o=>o.trim()).join(" ")};te.O=function(e){return this.inspectOpts.colors=this.useColors,I.inspect(e,this.inspectOpts)}});var re=_chunk44DGW27Sjs.d.call(void 0, (Ke,T)=>{_chunk44DGW27Sjs.f.call(void 0, );typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?T.exports=ee():T.exports=oe()});_chunk44DGW27Sjs.f.call(void 0, );var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);var _path = require('path'); var _path2 = _interopRequireDefault(_path);var _child_process = require('child_process');var _yargs = require('yargs'); var _yargs2 = _interopRequireDefault(_yargs);var _open = require('open'); var _open2 = _interopRequireDefault(_open);var _node = require('vite-ssg/node');var _consola = require('consola'); var _consola2 = _interopRequireDefault(_consola);var R="0.0.8";_chunk44DGW27Sjs.f.call(void 0, );var ne=_chunk44DGW27Sjs.e.call(void 0, re());var Be=(0,ne.default)("valaxy:options");function Me(e){return e.startsWith("/")||/^\.\.?[\/\\]/.test(e)}function qe(e,o){return e?Me(e)?_path.resolve.call(void 0, _path.dirname.call(void 0, o),e):_chunkEM2KSV5Vjs.c.call(void 0, `valaxy-theme-${e}/package.json`):""}async function U(e){let o=_path.resolve.call(void 0, _chunkEM2KSV5Vjs.c.call(void 0, "valaxy/package.json"),"src/client"),t=_path.resolve.call(void 0, e.userRoot||process.cwd()),{config:r,configFile:s,theme:c}=await _chunkEM2KSV5Vjs.e.call(void 0, e),g=qe(c,t),m={clientRoot:o,userRoot:t,themeRoot:g,theme:c,config:r,configFile:s||""};return Be(m),m}_chunk44DGW27Sjs.f.call(void 0, );var a=_chunk44DGW27Sjs.e.call(void 0, _chunkEM2KSV5Vjs.b.call(void 0, ));var _readline = require('readline'); var se = _interopRequireWildcard(_readline);var _os = require('os'); var _os2 = _interopRequireDefault(_os);var V;function _(e,o,t){console.log(),console.log(` ${a.default.bold("\u{1F30C} Valaxy")} ${a.default.blue(`v${R}`)}`),console.log(),console.log(`${a.default.dim(" \u{1FA90} theme ")} > ${e.theme?a.default.green(e.theme):a.default.gray("none")}`),console.log(` ${a.default.dim("\u{1F4C1}")} ${a.default.dim(_path2.default.resolve(e.userRoot))}`),o&&(console.log(),console.log(`${a.default.dim(" Preview ")} > ${a.default.cyan(`http://localhost:${a.default.bold(o)}/`)}`),t&&Object.values(_os2.default.networkInterfaces()).forEach(r=>(r||[]).filter(s=>s.family==="IPv4"&&!s.address.includes("127.0.0.1")).forEach(({address:s})=>{console.log(`${a.default.dim(" Network ")} > ${a.default.blue(`http://${s}:${a.default.bold(o)}/`)}`)})),console.log(),console.log(`${a.default.dim(" shortcuts ")} > ${a.default.underline("r")}${a.default.dim("estart | ")}${a.default.underline("o")}${a.default.dim("pen | ")}${a.default.underline("e")}${a.default.dim("dit")}`)),console.log()}async function D(e,o){V&&await V.close();try{let t=_chunkEM2KSV5Vjs.d.call(void 0, e.config).concat(e.config.unocss.safelist||[]);V=await _chunkHUI4MBPMjs.a.call(void 0, e,o,{onConfigReload(r,s){let c=!1;r.social.some((m,x)=>!t.includes(m.icon)&&m.icon!==s.social[x].icon)&&(_consola2.default.info("Find new icon, reload server..."),_consola2.default.info(`If you do not want to reload it, write icon name in ${a.default.green("config.unocss.safelist")}.`),_consola2.default.info('For example: ["i-ri-cloud-line"]'),console.log(),c=!0),c&&D(e,o)}}),await V.listen()}catch(t){_consola2.default.error(`failed to start server. error:
6
- `),console.error(t),process.exit(1)}}function ie(e){process.stdin.resume(),process.stdin.setEncoding("utf8"),se.emitKeypressEvents(process.stdin),process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.on("keypress",(o,t)=>{if(t.ctrl&&t.name==="c")process.exit();else{let[r]=e.filter(s=>s.name===o);if(r)try{r.action()}catch(s){console.error(`Failed to execute shortcut ${r.fullName}`,s)}}})}var J=_yargs2.default.scriptName("valaxy").usage("$0 [args]").version(R).showHelpOnFail(!1).alias("h","help").alias("v","version");J.command("* [root]","Start a local server for Valaxy",e=>ce(e).option("port",{alias:"p",type:"number",describe:"port"}).option("open",{alias:"o",default:!1,type:"boolean",describe:"open in browser"}).option("remote",{default:!0,type:"boolean",describe:"listen public host and enable remote control"}).option("log",{default:"warn",type:"string",choices:["error","warn","info","silent"],describe:"log level"}).strict().help(),async({root:e,port:o,open:t,remote:r,log:s})=>{_fs2.default.existsSync(_path2.default.resolve(e,"pages"))||process.exit(0);let c=o||4859,g=await U({userRoot:e}),m={server:{watch:{ignored:[`!${g.themeRoot}/**`,`${g.userRoot}/**.md`]},port:c,strictPort:!0,open:t,host:r?"0.0.0.0":"localhost"},logLevel:s};await D(g,m),_(g,c,r),ie([{name:"r",fullName:"restart",action(){D(g,m)}},{name:"o",fullName:"open",action(){_open2.default.call(void 0, `http://localhost:${c}`)}},{name:"e",fullName:"edit",action(){_child_process.exec.call(void 0, `code "${e}"`)}}])});J.command("build [root]","build your blog to static content",e=>ce(e).option("ssg",{alias:"s",type:"boolean",default:!1,describe:"static site generate"}).option("output",{alias:"o",type:"string",default:"dist",describe:"output dir"}).option("base",{type:"string",describe:"output base"}).strict().help(),async({ssg:e,root:o,base:t,output:r})=>{let s=await U({userRoot:o});if(_(s),e){_consola2.default.info("use vite-ssg to do ssg build...");try{await _node.build.call(void 0, {mode:"production"})}catch(c){_consola2.default.error("[vite-ssg] An internal error occurred."),console.log(c)}}else{let{build:c}=await Promise.resolve().then(()=>_chunk44DGW27Sjs.e.call(void 0, _chunk44DGW27Sjs.c.call(void 0, "../build-TIU2KH77.js")));_consola2.default.info("use vite do spa build..."),await c(s,{base:t,build:{emptyOutDir:!0,outDir:_path2.default.resolve(s.userRoot,r)}})}});function ce(e){return e.positional("root",{default:".",type:"string",describe:"root folder of your source files"})}function vt(){J.help().parse()}exports.run = vt;
package/dist/node/cli.mjs DELETED
@@ -1,6 +0,0 @@
1
- import{a as Z}from"../chunk-CSMXFOVS.mjs";import{a as de,b as me,c as M,d as H,e as W}from"../chunk-MWP3FN5Q.mjs";import{c as L,d as F,e as B,f as p}from"../chunk-RKUUEWDF.mjs";var Q=F((We,K)=>{p();var v=1e3,b=v*60,w=b*60,h=w*24,Ce=h*7,ye=h*365.25;K.exports=function(e,o){o=o||{};var t=typeof e;if(t==="string"&&e.length>0)return he(e);if(t==="number"&&isFinite(e))return o.long?be(e):ve(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function he(e){if(e=String(e),!(e.length>100)){var o=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!!o){var t=parseFloat(o[1]),r=(o[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return t*ye;case"weeks":case"week":case"w":return t*Ce;case"days":case"day":case"d":return t*h;case"hours":case"hour":case"hrs":case"hr":case"h":return t*w;case"minutes":case"minute":case"mins":case"min":case"m":return t*b;case"seconds":case"second":case"secs":case"sec":case"s":return t*v;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function ve(e){var o=Math.abs(e);return o>=h?Math.round(e/h)+"d":o>=w?Math.round(e/w)+"h":o>=b?Math.round(e/b)+"m":o>=v?Math.round(e/v)+"s":e+"ms"}function be(e){var o=Math.abs(e);return o>=h?j(e,o,h,"day"):o>=w?j(e,o,w,"hour"):o>=b?j(e,o,b,"minute"):o>=v?j(e,o,v,"second"):e+" ms"}function j(e,o,t,r){var s=o>=t*1.5;return Math.round(e/t)+" "+r+(s?"s":"")}});var q=F((Ze,X)=>{p();function we(e){t.debug=t,t.default=t,t.coerce=x,t.disable=c,t.enable=s,t.enabled=g,t.humanize=Q(),t.destroy=le,Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={};function o(n){let i=0;for(let l=0;l<n.length;l++)i=(i<<5)-i+n.charCodeAt(l),i|=0;return t.colors[Math.abs(i)%t.colors.length]}t.selectColor=o;function t(n){let i,l=null,O,Y;function C(...d){if(!C.enabled)return;let y=C,$=Number(new Date),ue=$-(i||$);y.diff=ue,y.prev=i,y.curr=$,i=$,d[0]=t.coerce(d[0]),typeof d[0]!="string"&&d.unshift("%O");let k=0;d[0]=d[0].replace(/%([a-zA-Z%])/g,(N,pe)=>{if(N==="%%")return"%";k++;let G=t.formatters[pe];if(typeof G=="function"){let fe=d[k];N=G.call(y,fe),d.splice(k,1),k--}return N}),t.formatArgs.call(y,d),(y.log||t.log).apply(y,d)}return C.namespace=n,C.useColors=t.useColors(),C.color=t.selectColor(n),C.extend=r,C.destroy=t.destroy,Object.defineProperty(C,"enabled",{enumerable:!0,configurable:!1,get:()=>l!==null?l:(O!==t.namespaces&&(O=t.namespaces,Y=t.enabled(n)),Y),set:d=>{l=d}}),typeof t.init=="function"&&t.init(C),C}function r(n,i){let l=t(this.namespace+(typeof i>"u"?":":i)+n);return l.log=this.log,l}function s(n){t.save(n),t.namespaces=n,t.names=[],t.skips=[];let i,l=(typeof n=="string"?n:"").split(/[\s,]+/),O=l.length;for(i=0;i<O;i++)!l[i]||(n=l[i].replace(/\*/g,".*?"),n[0]==="-"?t.skips.push(new RegExp("^"+n.slice(1)+"$")):t.names.push(new RegExp("^"+n+"$")))}function c(){let n=[...t.names.map(m),...t.skips.map(m).map(i=>"-"+i)].join(",");return t.enable(""),n}function g(n){if(n[n.length-1]==="*")return!0;let i,l;for(i=0,l=t.skips.length;i<l;i++)if(t.skips[i].test(n))return!1;for(i=0,l=t.names.length;i<l;i++)if(t.names[i].test(n))return!0;return!1}function m(n){return n.toString().substring(2,n.toString().length-2).replace(/\.\*\?$/,"*")}function x(n){return n instanceof Error?n.stack||n.message:n}function le(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return t.enable(t.load()),t}X.exports=we});var ee=F((f,S)=>{p();f.formatArgs=xe;f.save=Oe;f.load=$e;f.useColors=Fe;f.storage=ke();f.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();f.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Fe(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function xe(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+S.exports.humanize(this.diff),!this.useColors)return;let o="color: "+this.color;e.splice(1,0,o,"color: inherit");let t=0,r=0;e[0].replace(/%[a-zA-Z%]/g,s=>{s!=="%%"&&(t++,s==="%c"&&(r=t))}),e.splice(r,0,o)}f.log=console.debug||console.log||(()=>{});function Oe(e){try{e?f.storage.setItem("debug",e):f.storage.removeItem("debug")}catch{}}function $e(){let e;try{e=f.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function ke(){try{return localStorage}catch{}}S.exports=q()(f);var{formatters:Re}=S.exports;Re.j=function(e){try{return JSON.stringify(e)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}}});var oe=F((u,E)=>{p();var je=L("tty"),I=L("util");u.init=Ne;u.log=Ae;u.formatArgs=Ie;u.save=Ve;u.load=De;u.useColors=Se;u.destroy=I.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");u.colors=[6,2,3,4,5,1];try{let e=de();e&&(e.stderr||e).level>=2&&(u.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}u.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,o)=>{let t=o.substring(6).toLowerCase().replace(/_([a-z])/g,(s,c)=>c.toUpperCase()),r=process.env[o];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),e[t]=r,e},{});function Se(){return"colors"in u.inspectOpts?Boolean(u.inspectOpts.colors):je.isatty(process.stderr.fd)}function Ie(e){let{namespace:o,useColors:t}=this;if(t){let r=this.color,s="\x1B[3"+(r<8?r:"8;5;"+r),c=` ${s};1m${o} \x1B[0m`;e[0]=c+e[0].split(`
2
- `).join(`
3
- `+c),e.push(s+"m+"+E.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Ee()+o+" "+e[0]}function Ee(){return u.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Ae(...e){return process.stderr.write(I.format(...e)+`
4
- `)}function Ve(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function De(){return process.env.DEBUG}function Ne(e){e.inspectOpts={};let o=Object.keys(u.inspectOpts);for(let t=0;t<o.length;t++)e.inspectOpts[o[t]]=u.inspectOpts[o[t]]}E.exports=q()(u);var{formatters:te}=E.exports;te.o=function(e){return this.inspectOpts.colors=this.useColors,I.inspect(e,this.inspectOpts).split(`
5
- `).map(o=>o.trim()).join(" ")};te.O=function(e){return this.inspectOpts.colors=this.useColors,I.inspect(e,this.inspectOpts)}});var re=F((Ke,T)=>{p();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?T.exports=ee():T.exports=oe()});p();import Ue from"fs";import ae from"path";import{exec as _e}from"child_process";import ze from"yargs";import Je from"open";import{build as Ye}from"vite-ssg/node";import z from"consola";var R="0.0.8";p();var ne=B(re());import{dirname as Le,resolve as P}from"path";var Be=(0,ne.default)("valaxy:options");function Me(e){return e.startsWith("/")||/^\.\.?[\/\\]/.test(e)}function qe(e,o){return e?Me(e)?P(Le(o),e):M(`valaxy-theme-${e}/package.json`):""}async function U(e){let o=P(M("valaxy/package.json"),"src/client"),t=P(e.userRoot||process.cwd()),{config:r,configFile:s,theme:c}=await W(e),g=qe(c,t),m={clientRoot:o,userRoot:t,themeRoot:g,theme:c,config:r,configFile:s||""};return Be(m),m}p();var a=B(me());import*as se from"readline";import Te from"path";import Pe from"os";import A from"consola";var V;function _(e,o,t){console.log(),console.log(` ${a.default.bold("\u{1F30C} Valaxy")} ${a.default.blue(`v${R}`)}`),console.log(),console.log(`${a.default.dim(" \u{1FA90} theme ")} > ${e.theme?a.default.green(e.theme):a.default.gray("none")}`),console.log(` ${a.default.dim("\u{1F4C1}")} ${a.default.dim(Te.resolve(e.userRoot))}`),o&&(console.log(),console.log(`${a.default.dim(" Preview ")} > ${a.default.cyan(`http://localhost:${a.default.bold(o)}/`)}`),t&&Object.values(Pe.networkInterfaces()).forEach(r=>(r||[]).filter(s=>s.family==="IPv4"&&!s.address.includes("127.0.0.1")).forEach(({address:s})=>{console.log(`${a.default.dim(" Network ")} > ${a.default.blue(`http://${s}:${a.default.bold(o)}/`)}`)})),console.log(),console.log(`${a.default.dim(" shortcuts ")} > ${a.default.underline("r")}${a.default.dim("estart | ")}${a.default.underline("o")}${a.default.dim("pen | ")}${a.default.underline("e")}${a.default.dim("dit")}`)),console.log()}async function D(e,o){V&&await V.close();try{let t=H(e.config).concat(e.config.unocss.safelist||[]);V=await Z(e,o,{onConfigReload(r,s){let c=!1;r.social.some((m,x)=>!t.includes(m.icon)&&m.icon!==s.social[x].icon)&&(A.info("Find new icon, reload server..."),A.info(`If you do not want to reload it, write icon name in ${a.default.green("config.unocss.safelist")}.`),A.info('For example: ["i-ri-cloud-line"]'),console.log(),c=!0),c&&D(e,o)}}),await V.listen()}catch(t){A.error(`failed to start server. error:
6
- `),console.error(t),process.exit(1)}}function ie(e){process.stdin.resume(),process.stdin.setEncoding("utf8"),se.emitKeypressEvents(process.stdin),process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.on("keypress",(o,t)=>{if(t.ctrl&&t.name==="c")process.exit();else{let[r]=e.filter(s=>s.name===o);if(r)try{r.action()}catch(s){console.error(`Failed to execute shortcut ${r.fullName}`,s)}}})}var J=ze.scriptName("valaxy").usage("$0 [args]").version(R).showHelpOnFail(!1).alias("h","help").alias("v","version");J.command("* [root]","Start a local server for Valaxy",e=>ce(e).option("port",{alias:"p",type:"number",describe:"port"}).option("open",{alias:"o",default:!1,type:"boolean",describe:"open in browser"}).option("remote",{default:!0,type:"boolean",describe:"listen public host and enable remote control"}).option("log",{default:"warn",type:"string",choices:["error","warn","info","silent"],describe:"log level"}).strict().help(),async({root:e,port:o,open:t,remote:r,log:s})=>{Ue.existsSync(ae.resolve(e,"pages"))||process.exit(0);let c=o||4859,g=await U({userRoot:e}),m={server:{watch:{ignored:[`!${g.themeRoot}/**`,`${g.userRoot}/**.md`]},port:c,strictPort:!0,open:t,host:r?"0.0.0.0":"localhost"},logLevel:s};await D(g,m),_(g,c,r),ie([{name:"r",fullName:"restart",action(){D(g,m)}},{name:"o",fullName:"open",action(){Je(`http://localhost:${c}`)}},{name:"e",fullName:"edit",action(){_e(`code "${e}"`)}}])});J.command("build [root]","build your blog to static content",e=>ce(e).option("ssg",{alias:"s",type:"boolean",default:!1,describe:"static site generate"}).option("output",{alias:"o",type:"string",default:"dist",describe:"output dir"}).option("base",{type:"string",describe:"output base"}).strict().help(),async({ssg:e,root:o,base:t,output:r})=>{let s=await U({userRoot:o});if(_(s),e){z.info("use vite-ssg to do ssg build...");try{await Ye({mode:"production"})}catch(c){z.error("[vite-ssg] An internal error occurred."),console.log(c)}}else{let{build:c}=await Promise.resolve().then(()=>B(L("../build-RREYJOHF.mjs")));z.info("use vite do spa build..."),await c(s,{base:t,build:{emptyOutDir:!0,outDir:ae.resolve(s.userRoot,r)}})}});function ce(e){return e.positional("root",{default:".",type:"string",describe:"root folder of your source files"})}function vt(){J.help().parse()}export{vt as run};
@@ -1,45 +0,0 @@
1
- import * as vite from 'vite';
2
- import { InlineConfig } from 'vite';
3
- import { V as ValaxyConfig } from '../config-d6527c8c.js';
4
- import 'type-fest';
5
- import 'unocss/vite';
6
- import 'markdown-it';
7
- import 'markdown-it-anchor';
8
- import 'katex';
9
- import 'vite-plugin-md';
10
-
11
- interface ResolvedValaxyOptions {
12
- /**
13
- * Client root path
14
- * @default 'valaxy/src/client'
15
- */
16
- clientRoot: string;
17
- /**
18
- * User root path
19
- * @default process.cwd()
20
- */
21
- userRoot: string;
22
- /**
23
- * Theme root path
24
- */
25
- themeRoot: string;
26
- /**
27
- * Theme name
28
- */
29
- theme: string;
30
- /**
31
- * Valaxy Config
32
- */
33
- config: ValaxyConfig;
34
- /**
35
- * config file path
36
- */
37
- configFile: string;
38
- }
39
- interface ValaxyServerOptions {
40
- onConfigReload?: (newConfig: ValaxyConfig, config: ValaxyConfig) => void;
41
- }
42
-
43
- declare function createServer(options: ResolvedValaxyOptions, viteConfig?: InlineConfig, serverOptions?: ValaxyServerOptions): Promise<vite.ViteDevServer>;
44
-
45
- export { createServer };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkHUI4MBPMjs = require('../chunk-HUI4MBPM.js');require('../chunk-EM2KSV5V.js');var _chunk44DGW27Sjs = require('../chunk-44DGW27S.js');_chunk44DGW27Sjs.f.call(void 0, );exports.createServer = _chunkHUI4MBPMjs.a;
@@ -1 +0,0 @@
1
- import{a as r}from"../chunk-CSMXFOVS.mjs";import"../chunk-MWP3FN5Q.mjs";import{f as o}from"../chunk-RKUUEWDF.mjs";o();export{r as createServer};