valaxy 0.2.1 → 0.2.4
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.
- package/dist/{chunk-FH6NMGNX.mjs → chunk-HSIBOGUA.mjs} +35 -35
- package/dist/{chunk-U4ZDCBEC.mjs → chunk-JARRR63D.mjs} +1 -1
- package/dist/{chunk-TSLYS2VY.js → chunk-RUZ4KMBM.js} +1 -1
- package/dist/{chunk-B2JVVNA4.js → chunk-XMNH5QY2.js} +35 -35
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/node/cli.js +8 -8
- package/dist/node/cli.mjs +2 -2
- package/dist/node/index.js +1 -1
- package/dist/node/index.mjs +1 -1
- package/package.json +1 -1
- package/src/client/App.vue +5 -2
- package/src/client/components/PostCard.vue +1 -1
- package/src/client/composables/comments/twikoo.ts +3 -5
- package/src/client/styles/common/custom-blocks.scss +2 -2
- package/src/node/plugins/index.ts +2 -2
- package/src/types/config.ts +1 -1
- package/dist/config-24b4f209.d.ts +0 -188
- package/dist/index.d.ts +0 -390
- package/dist/node/cli.d.ts +0 -3
- package/dist/node/index.d.ts +0 -46
package/dist/node/cli.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ol,b as ul,c as al,d as Hi,e as qr,f as Bi,g as ji,h as $r,i as Gi}from"../chunk-
|
|
1
|
+
import{a as ol,b as ul,c as al,d as Hi,e as qr,f as Bi,g as ji,h as $r,i as Gi}from"../chunk-HSIBOGUA.mjs";import{a as I,b as z,c as k,d as _,e as Ge,f as c}from"../chunk-JARRR63D.mjs";var Wi=_((ng,Ui)=>{c();var ze=1e3,et=ze*60,tt=et*60,Ue=tt*24,ll=Ue*7,fl=Ue*365.25;Ui.exports=function(e,t){t=t||{};var r=typeof e;if(r==="string"&&e.length>0)return pl(e);if(r==="number"&&isFinite(e))return t.long?dl(e):hl(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function pl(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\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(!!t){var r=parseFloat(t[1]),n=(t[2]||"ms").toLowerCase();switch(n){case"years":case"year":case"yrs":case"yr":case"y":return r*fl;case"weeks":case"week":case"w":return r*ll;case"days":case"day":case"d":return r*Ue;case"hours":case"hour":case"hrs":case"hr":case"h":return r*tt;case"minutes":case"minute":case"mins":case"min":case"m":return r*et;case"seconds":case"second":case"secs":case"sec":case"s":return r*ze;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r;default:return}}}}function hl(e){var t=Math.abs(e);return t>=Ue?Math.round(e/Ue)+"d":t>=tt?Math.round(e/tt)+"h":t>=et?Math.round(e/et)+"m":t>=ze?Math.round(e/ze)+"s":e+"ms"}function dl(e){var t=Math.abs(e);return t>=Ue?qt(e,t,Ue,"day"):t>=tt?qt(e,t,tt,"hour"):t>=et?qt(e,t,et,"minute"):t>=ze?qt(e,t,ze,"second"):e+" ms"}function qt(e,t,r,n){var i=t>=r*1.5;return Math.round(e/r)+" "+n+(i?"s":"")}});var Nr=_((ig,Vi)=>{c();function yl(e){r.debug=r,r.default=r,r.coerce=l,r.disable=s,r.enable=i,r.enabled=o,r.humanize=Wi(),r.destroy=g,Object.keys(e).forEach(a=>{r[a]=e[a]}),r.names=[],r.skips=[],r.formatters={};function t(a){let p=0;for(let f=0;f<a.length;f++)p=(p<<5)-p+a.charCodeAt(f),p|=0;return r.colors[Math.abs(p)%r.colors.length]}r.selectColor=t;function r(a){let p,f=null,v,m;function S(...E){if(!S.enabled)return;let R=S,O=Number(new Date),L=O-(p||O);R.diff=L,R.prev=p,R.curr=O,p=O,E[0]=r.coerce(E[0]),typeof E[0]!="string"&&E.unshift("%O");let K=0;E[0]=E[0].replace(/%([a-zA-Z%])/g,(j,D)=>{if(j==="%%")return"%";K++;let A=r.formatters[D];if(typeof A=="function"){let C=E[K];j=A.call(R,C),E.splice(K,1),K--}return j}),r.formatArgs.call(R,E),(R.log||r.log).apply(R,E)}return S.namespace=a,S.useColors=r.useColors(),S.color=r.selectColor(a),S.extend=n,S.destroy=r.destroy,Object.defineProperty(S,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(v!==r.namespaces&&(v=r.namespaces,m=r.enabled(a)),m),set:E=>{f=E}}),typeof r.init=="function"&&r.init(S),S}function n(a,p){let f=r(this.namespace+(typeof p>"u"?":":p)+a);return f.log=this.log,f}function i(a){r.save(a),r.namespaces=a,r.names=[],r.skips=[];let p,f=(typeof a=="string"?a:"").split(/[\s,]+/),v=f.length;for(p=0;p<v;p++)!f[p]||(a=f[p].replace(/\*/g,".*?"),a[0]==="-"?r.skips.push(new RegExp("^"+a.slice(1)+"$")):r.names.push(new RegExp("^"+a+"$")))}function s(){let a=[...r.names.map(u),...r.skips.map(u).map(p=>"-"+p)].join(",");return r.enable(""),a}function o(a){if(a[a.length-1]==="*")return!0;let p,f;for(p=0,f=r.skips.length;p<f;p++)if(r.skips[p].test(a))return!1;for(p=0,f=r.names.length;p<f;p++)if(r.names[p].test(a))return!0;return!1}function u(a){return a.toString().substring(2,a.toString().length-2).replace(/\.\*\?$/,"*")}function l(a){return a instanceof Error?a.stack||a.message:a}function g(){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 r.enable(r.load()),r}Vi.exports=yl});var Ki=_((he,$t)=>{c();he.formatArgs=gl;he.save=_l;he.load=Sl;he.useColors=ml;he.storage=vl();he.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`."))}})();he.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 ml(){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 gl(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+$t.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let r=0,n=0;e[0].replace(/%[a-zA-Z%]/g,i=>{i!=="%%"&&(r++,i==="%c"&&(n=r))}),e.splice(n,0,t)}he.log=console.debug||console.log||(()=>{});function _l(e){try{e?he.storage.setItem("debug",e):he.storage.removeItem("debug")}catch{}}function Sl(){let e;try{e=he.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function vl(){try{return localStorage}catch{}}$t.exports=Nr()(he);var{formatters:El}=$t.exports;El.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Qi=_((te,It)=>{c();var wl=k("tty"),Nt=k("util");te.init=Pl;te.log=Al;te.formatArgs=Rl;te.save=bl;te.load=Ol;te.useColors=Cl;te.destroy=Nt.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");te.colors=[6,2,3,4,5,1];try{let e=al();e&&(e.stderr||e).level>=2&&(te.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{}te.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let r=t.substring(6).toLowerCase().replace(/_([a-z])/g,(i,s)=>s.toUpperCase()),n=process.env[t];return/^(yes|on|true|enabled)$/i.test(n)?n=!0:/^(no|off|false|disabled)$/i.test(n)?n=!1:n==="null"?n=null:n=Number(n),e[r]=n,e},{});function Cl(){return"colors"in te.inspectOpts?Boolean(te.inspectOpts.colors):wl.isatty(process.stderr.fd)}function Rl(e){let{namespace:t,useColors:r}=this;if(r){let n=this.color,i="\x1B[3"+(n<8?n:"8;5;"+n),s=` ${i};1m${t} \x1B[0m`;e[0]=s+e[0].split(`
|
|
2
2
|
`).join(`
|
|
3
3
|
`+s),e.push(i+"m+"+It.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=xl()+t+" "+e[0]}function xl(){return te.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Al(...e){return process.stderr.write(Nt.format(...e)+`
|
|
4
4
|
`)}function bl(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function Ol(){return process.env.DEBUG}function Pl(e){e.inspectOpts={};let t=Object.keys(te.inspectOpts);for(let r=0;r<t.length;r++)e.inspectOpts[t[r]]=te.inspectOpts[t[r]]}It.exports=Nr()(te);var{formatters:Yi}=It.exports;Yi.o=function(e){return this.inspectOpts.colors=this.useColors,Nt.inspect(e,this.inspectOpts).split(`
|
|
@@ -9,7 +9,7 @@ GFS4: `),console.error(e)});Q[re]||(Ju=global[re]||[],zu(Q,Ju),Q.close=function(
|
|
|
9
9
|
see https://github.com/jprichardson/node-fs-extra/issues/269`),wt.checkPaths(e,t,"copy",r,(i,s)=>{if(i)return n(i);let{srcStat:o,destStat:u}=s;wt.checkParentPaths(e,o,t,"copy",l=>l?n(l):r.filter?ma(da,u,e,t,r,n):da(u,e,t,r,n))})}function da(e,t,r,n,i){let s=Et.dirname(r);cy(s,(o,u)=>{if(o)return i(o);if(u)return vr(e,t,r,n,i);ay(s,l=>l?i(l):vr(e,t,r,n,i))})}function ma(e,t,r,n,i,s){Promise.resolve(i.filter(r,n)).then(o=>o?e(t,r,n,i,s):s(),o=>s(o))}function py(e,t,r,n,i){return n.filter?ma(vr,e,t,r,n,i):vr(e,t,r,n,i)}function vr(e,t,r,n,i){(n.dereference?fe.stat:fe.lstat)(t,(o,u)=>o?i(o):u.isDirectory()?Sy(u,e,t,r,n,i):u.isFile()||u.isCharacterDevice()||u.isBlockDevice()?hy(u,e,t,r,n,i):u.isSymbolicLink()?wy(e,t,r,n,i):u.isSocket()?i(new Error(`Cannot copy a socket file: ${t}`)):u.isFIFO()?i(new Error(`Cannot copy a FIFO pipe: ${t}`)):i(new Error(`Unknown file: ${t}`)))}function hy(e,t,r,n,i,s){return t?dy(e,r,n,i,s):ga(e,r,n,i,s)}function dy(e,t,r,n,i){if(n.overwrite)fe.unlink(r,s=>s?i(s):ga(e,t,r,n,i));else return n.errorOnExist?i(new Error(`'${r}' already exists`)):i()}function ga(e,t,r,n,i){fe.copyFile(t,r,s=>s?i(s):n.preserveTimestamps?yy(e.mode,t,r,i):Er(r,e.mode,i))}function yy(e,t,r,n){return my(e)?gy(r,e,i=>i?n(i):ya(e,t,r,n)):ya(e,t,r,n)}function my(e){return(e&128)===0}function gy(e,t,r){return Er(e,t|128,r)}function ya(e,t,r,n){_y(t,r,i=>i?n(i):Er(r,e,n))}function Er(e,t,r){return fe.chmod(e,t,r)}function _y(e,t,r){fe.stat(e,(n,i)=>n?r(n):ly(t,i.atime,i.mtime,r))}function Sy(e,t,r,n,i,s){return t?_a(r,n,i,s):vy(e.mode,r,n,i,s)}function vy(e,t,r,n,i){fe.mkdir(r,s=>{if(s)return i(s);_a(t,r,n,o=>o?i(o):Er(r,e,i))})}function _a(e,t,r,n){fe.readdir(e,(i,s)=>i?n(i):Sa(s,e,t,r,n))}function Sa(e,t,r,n,i){let s=e.pop();return s?Ey(e,s,t,r,n,i):i()}function Ey(e,t,r,n,i,s){let o=Et.join(r,t),u=Et.join(n,t);wt.checkPaths(o,u,"copy",i,(l,g)=>{if(l)return s(l);let{destStat:a}=g;py(a,o,u,i,p=>p?s(p):Sa(e,r,n,i,s))})}function wy(e,t,r,n,i){fe.readlink(t,(s,o)=>{if(s)return i(s);if(n.dereference&&(o=Et.resolve(process.cwd(),o)),e)fe.readlink(r,(u,l)=>u?u.code==="EINVAL"||u.code==="UNKNOWN"?fe.symlink(o,r,i):i(u):(n.dereference&&(l=Et.resolve(process.cwd(),l)),wt.isSrcSubdir(o,l)?i(new Error(`Cannot copy '${o}' to a subdirectory of itself, '${l}'.`)):e.isDirectory()&&wt.isSrcSubdir(l,o)?i(new Error(`Cannot overwrite '${l}' with '${o}'.`)):Cy(o,r,i)));else return fe.symlink(o,r,i)})}function Cy(e,t,r){fe.unlink(t,n=>n?r(n):fe.symlink(e,t,r))}va.exports=fy});var Aa=_((eS,xa)=>{"use strict";c();var se=ue(),Ct=k("path"),Ry=ve().mkdirsSync,xy=Ti().utimesMillisSync,Rt=Ze();function Ay(e,t,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;
|
|
10
10
|
|
|
11
11
|
see https://github.com/jprichardson/node-fs-extra/issues/269`);let{srcStat:n,destStat:i}=Rt.checkPathsSync(e,t,"copy",r);return Rt.checkParentPathsSync(e,n,t,"copy"),by(i,e,t,r)}function by(e,t,r,n){if(n.filter&&!n.filter(t,r))return;let i=Ct.dirname(r);return se.existsSync(i)||Ry(i),wa(e,t,r,n)}function Oy(e,t,r,n){if(!(n.filter&&!n.filter(t,r)))return wa(e,t,r,n)}function wa(e,t,r,n){let s=(n.dereference?se.statSync:se.lstatSync)(t);if(s.isDirectory())return qy(s,e,t,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return Py(s,e,t,r,n);if(s.isSymbolicLink())return Iy(e,t,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${t}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${t}`):new Error(`Unknown file: ${t}`)}function Py(e,t,r,n,i){return t?ky(e,r,n,i):Ca(e,r,n,i)}function ky(e,t,r,n){if(n.overwrite)return se.unlinkSync(r),Ca(e,t,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function Ca(e,t,r,n){return se.copyFileSync(t,r),n.preserveTimestamps&&Ty(e.mode,t,r),Li(r,e.mode)}function Ty(e,t,r){return Fy(e)&&Ly(r,e),Dy(t,r)}function Fy(e){return(e&128)===0}function Ly(e,t){return Li(e,t|128)}function Li(e,t){return se.chmodSync(e,t)}function Dy(e,t){let r=se.statSync(e);return xy(t,r.atime,r.mtime)}function qy(e,t,r,n,i){return t?Ra(r,n,i):$y(e.mode,r,n,i)}function $y(e,t,r,n){return se.mkdirSync(r),Ra(t,r,n),Li(r,e)}function Ra(e,t,r){se.readdirSync(e).forEach(n=>Ny(n,e,t,r))}function Ny(e,t,r,n){let i=Ct.join(t,e),s=Ct.join(r,e),{destStat:o}=Rt.checkPathsSync(i,s,"copy",n);return Oy(o,i,s,n)}function Iy(e,t,r,n){let i=se.readlinkSync(t);if(n.dereference&&(i=Ct.resolve(process.cwd(),i)),e){let s;try{s=se.readlinkSync(r)}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return se.symlinkSync(i,r);throw o}if(n.dereference&&(s=Ct.resolve(process.cwd(),s)),Rt.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(se.statSync(r).isDirectory()&&Rt.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return My(i,r)}else return se.symlinkSync(i,r)}function My(e,t){return se.unlinkSync(t),se.symlinkSync(e,t)}xa.exports=Ay});var wr=_((tS,ba)=>{"use strict";c();var Hy=le().fromCallback;ba.exports={copy:Hy(Ea()),copySync:Aa()}});var $a=_((rS,qa)=>{"use strict";c();var Oa=ue(),Fa=k("path"),U=k("assert"),xt=process.platform==="win32";function La(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(r=>{e[r]=e[r]||Oa[r],r=r+"Sync",e[r]=e[r]||Oa[r]}),e.maxBusyTries=e.maxBusyTries||3}function Di(e,t,r){let n=0;typeof t=="function"&&(r=t,t={}),U(e,"rimraf: missing path"),U.strictEqual(typeof e,"string","rimraf: path should be a string"),U.strictEqual(typeof r,"function","rimraf: callback function required"),U(t,"rimraf: invalid options argument provided"),U.strictEqual(typeof t,"object","rimraf: options should be object"),La(t),Pa(e,t,function i(s){if(s){if((s.code==="EBUSY"||s.code==="ENOTEMPTY"||s.code==="EPERM")&&n<t.maxBusyTries){n++;let o=n*100;return setTimeout(()=>Pa(e,t,i),o)}s.code==="ENOENT"&&(s=null)}r(s)})}function Pa(e,t,r){U(e),U(t),U(typeof r=="function"),t.lstat(e,(n,i)=>{if(n&&n.code==="ENOENT")return r(null);if(n&&n.code==="EPERM"&&xt)return ka(e,t,n,r);if(i&&i.isDirectory())return Cr(e,t,n,r);t.unlink(e,s=>{if(s){if(s.code==="ENOENT")return r(null);if(s.code==="EPERM")return xt?ka(e,t,s,r):Cr(e,t,s,r);if(s.code==="EISDIR")return Cr(e,t,s,r)}return r(s)})})}function ka(e,t,r,n){U(e),U(t),U(typeof n=="function"),t.chmod(e,438,i=>{i?n(i.code==="ENOENT"?null:r):t.stat(e,(s,o)=>{s?n(s.code==="ENOENT"?null:r):o.isDirectory()?Cr(e,t,r,n):t.unlink(e,n)})})}function Ta(e,t,r){let n;U(e),U(t);try{t.chmodSync(e,438)}catch(i){if(i.code==="ENOENT")return;throw r}try{n=t.statSync(e)}catch(i){if(i.code==="ENOENT")return;throw r}n.isDirectory()?Rr(e,t,r):t.unlinkSync(e)}function Cr(e,t,r,n){U(e),U(t),U(typeof n=="function"),t.rmdir(e,i=>{i&&(i.code==="ENOTEMPTY"||i.code==="EEXIST"||i.code==="EPERM")?By(e,t,n):i&&i.code==="ENOTDIR"?n(r):n(i)})}function By(e,t,r){U(e),U(t),U(typeof r=="function"),t.readdir(e,(n,i)=>{if(n)return r(n);let s=i.length,o;if(s===0)return t.rmdir(e,r);i.forEach(u=>{Di(Fa.join(e,u),t,l=>{if(!o){if(l)return r(o=l);--s===0&&t.rmdir(e,r)}})})})}function Da(e,t){let r;t=t||{},La(t),U(e,"rimraf: missing path"),U.strictEqual(typeof e,"string","rimraf: path should be a string"),U(t,"rimraf: missing options"),U.strictEqual(typeof t,"object","rimraf: options should be object");try{r=t.lstatSync(e)}catch(n){if(n.code==="ENOENT")return;n.code==="EPERM"&&xt&&Ta(e,t,n)}try{r&&r.isDirectory()?Rr(e,t,null):t.unlinkSync(e)}catch(n){if(n.code==="ENOENT")return;if(n.code==="EPERM")return xt?Ta(e,t,n):Rr(e,t,n);if(n.code!=="EISDIR")throw n;Rr(e,t,n)}}function Rr(e,t,r){U(e),U(t);try{t.rmdirSync(e)}catch(n){if(n.code==="ENOTDIR")throw r;if(n.code==="ENOTEMPTY"||n.code==="EEXIST"||n.code==="EPERM")jy(e,t);else if(n.code!=="ENOENT")throw n}}function jy(e,t){if(U(e),U(t),t.readdirSync(e).forEach(r=>Da(Fa.join(e,r),t)),xt){let r=Date.now();do try{return t.rmdirSync(e,t)}catch{}while(Date.now()-r<500)}else return t.rmdirSync(e,t)}qa.exports=Di;Di.sync=Da});var At=_((nS,Ia)=>{"use strict";c();var xr=ue(),Gy=le().fromCallback,Na=$a();function Uy(e,t){if(xr.rm)return xr.rm(e,{recursive:!0,force:!0},t);Na(e,t)}function Wy(e){if(xr.rmSync)return xr.rmSync(e,{recursive:!0,force:!0});Na.sync(e)}Ia.exports={remove:Gy(Uy),removeSync:Wy}});var Va=_((iS,Wa)=>{"use strict";c();var Vy=le().fromPromise,Ba=Je(),ja=k("path"),Ga=ve(),Ua=At(),Ma=Vy(async function(t){let r;try{r=await Ba.readdir(t)}catch{return Ga.mkdirs(t)}return Promise.all(r.map(n=>Ua.remove(ja.join(t,n))))});function Ha(e){let t;try{t=Ba.readdirSync(e)}catch{return Ga.mkdirsSync(e)}t.forEach(r=>{r=ja.join(e,r),Ua.removeSync(r)})}Wa.exports={emptyDirSync:Ha,emptydirSync:Ha,emptyDir:Ma,emptydir:Ma}});var Xa=_((sS,Qa)=>{"use strict";c();var Ky=le().fromCallback,Ka=k("path"),Me=ue(),Ya=ve();function Yy(e,t){function r(){Me.writeFile(e,"",n=>{if(n)return t(n);t()})}Me.stat(e,(n,i)=>{if(!n&&i.isFile())return t();let s=Ka.dirname(e);Me.stat(s,(o,u)=>{if(o)return o.code==="ENOENT"?Ya.mkdirs(s,l=>{if(l)return t(l);r()}):t(o);u.isDirectory()?r():Me.readdir(s,l=>{if(l)return t(l)})})})}function Qy(e){let t;try{t=Me.statSync(e)}catch{}if(t&&t.isFile())return;let r=Ka.dirname(e);try{Me.statSync(r).isDirectory()||Me.readdirSync(r)}catch(n){if(n&&n.code==="ENOENT")Ya.mkdirsSync(r);else throw n}Me.writeFileSync(e,"")}Qa.exports={createFile:Ky(Yy),createFileSync:Qy}});var tc=_((oS,ec)=>{"use strict";c();var Xy=le().fromCallback,Ja=k("path"),He=ue(),Za=ve(),Jy=Ie().pathExists,{areIdentical:za}=Ze();function Zy(e,t,r){function n(i,s){He.link(i,s,o=>{if(o)return r(o);r(null)})}He.lstat(t,(i,s)=>{He.lstat(e,(o,u)=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),r(o);if(s&&za(u,s))return r(null);let l=Ja.dirname(t);Jy(l,(g,a)=>{if(g)return r(g);if(a)return n(e,t);Za.mkdirs(l,p=>{if(p)return r(p);n(e,t)})})})})}function zy(e,t){let r;try{r=He.lstatSync(t)}catch{}try{let s=He.lstatSync(e);if(r&&za(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=Ja.dirname(t);return He.existsSync(n)||Za.mkdirsSync(n),He.linkSync(e,t)}ec.exports={createLink:Xy(Zy),createLinkSync:zy}});var nc=_((uS,rc)=>{"use strict";c();var Be=k("path"),bt=ue(),em=Ie().pathExists;function tm(e,t,r){if(Be.isAbsolute(e))return bt.lstat(e,n=>n?(n.message=n.message.replace("lstat","ensureSymlink"),r(n)):r(null,{toCwd:e,toDst:e}));{let n=Be.dirname(t),i=Be.join(n,e);return em(i,(s,o)=>s?r(s):o?r(null,{toCwd:i,toDst:e}):bt.lstat(e,u=>u?(u.message=u.message.replace("lstat","ensureSymlink"),r(u)):r(null,{toCwd:e,toDst:Be.relative(n,e)})))}}function rm(e,t){let r;if(Be.isAbsolute(e)){if(r=bt.existsSync(e),!r)throw new Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}else{let n=Be.dirname(t),i=Be.join(n,e);if(r=bt.existsSync(i),r)return{toCwd:i,toDst:e};if(r=bt.existsSync(e),!r)throw new Error("relative srcpath does not exist");return{toCwd:e,toDst:Be.relative(n,e)}}}rc.exports={symlinkPaths:tm,symlinkPathsSync:rm}});var oc=_((aS,sc)=>{"use strict";c();var ic=ue();function nm(e,t,r){if(r=typeof t=="function"?t:r,t=typeof t=="function"?!1:t,t)return r(null,t);ic.lstat(e,(n,i)=>{if(n)return r(null,"file");t=i&&i.isDirectory()?"dir":"file",r(null,t)})}function im(e,t){let r;if(t)return t;try{r=ic.lstatSync(e)}catch{return"file"}return r&&r.isDirectory()?"dir":"file"}sc.exports={symlinkType:nm,symlinkTypeSync:im}});var dc=_((cS,hc)=>{"use strict";c();var sm=le().fromCallback,ac=k("path"),Ee=Je(),cc=ve(),om=cc.mkdirs,um=cc.mkdirsSync,lc=nc(),am=lc.symlinkPaths,cm=lc.symlinkPathsSync,fc=oc(),lm=fc.symlinkType,fm=fc.symlinkTypeSync,pm=Ie().pathExists,{areIdentical:pc}=Ze();function hm(e,t,r,n){n=typeof r=="function"?r:n,r=typeof r=="function"?!1:r,Ee.lstat(t,(i,s)=>{!i&&s.isSymbolicLink()?Promise.all([Ee.stat(e),Ee.stat(t)]).then(([o,u])=>{if(pc(o,u))return n(null);uc(e,t,r,n)}):uc(e,t,r,n)})}function uc(e,t,r,n){am(e,t,(i,s)=>{if(i)return n(i);e=s.toDst,lm(s.toCwd,r,(o,u)=>{if(o)return n(o);let l=ac.dirname(t);pm(l,(g,a)=>{if(g)return n(g);if(a)return Ee.symlink(e,t,u,n);om(l,p=>{if(p)return n(p);Ee.symlink(e,t,u,n)})})})})}function dm(e,t,r){let n;try{n=Ee.lstatSync(t)}catch{}if(n&&n.isSymbolicLink()){let u=Ee.statSync(e),l=Ee.statSync(t);if(pc(u,l))return}let i=cm(e,t);e=i.toDst,r=fm(i.toCwd,r);let s=ac.dirname(t);return Ee.existsSync(s)||um(s),Ee.symlinkSync(e,t,r)}hc.exports={createSymlink:sm(hm),createSymlinkSync:dm}});var wc=_((lS,Ec)=>{"use strict";c();var{createFile:yc,createFileSync:mc}=Xa(),{createLink:gc,createLinkSync:_c}=tc(),{createSymlink:Sc,createSymlinkSync:vc}=dc();Ec.exports={createFile:yc,createFileSync:mc,ensureFile:yc,ensureFileSync:mc,createLink:gc,createLinkSync:_c,ensureLink:gc,ensureLinkSync:_c,createSymlink:Sc,createSymlinkSync:vc,ensureSymlink:Sc,ensureSymlinkSync:vc}});var Ar=_((fS,Cc)=>{c();function ym(e,{EOL:t=`
|
|
12
|
-
`,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let s=r?t:"";return JSON.stringify(e,n,i).replace(/\n/g,t)+s}function mm(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}Cc.exports={stringify:ym,stripBom:mm}});var bc=_((pS,Ac)=>{c();var yt;try{yt=ue()}catch{yt=k("fs")}var br=le(),{stringify:Rc,stripBom:xc}=Ar();async function gm(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||yt,n="throws"in t?t.throws:!0,i=await br.fromCallback(r.readFile)(e,t);i=xc(i);let s;try{s=JSON.parse(i,t?t.reviver:null)}catch(o){if(n)throw o.message=`${e}: ${o.message}`,o;return null}return s}var _m=br.fromPromise(gm);function Sm(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||yt,n="throws"in t?t.throws:!0;try{let i=r.readFileSync(e,t);return i=xc(i),JSON.parse(i,t.reviver)}catch(i){if(n)throw i.message=`${e}: ${i.message}`,i;return null}}async function vm(e,t,r={}){let n=r.fs||yt,i=Rc(t,r);await br.fromCallback(n.writeFile)(e,i,r)}var Em=br.fromPromise(vm);function wm(e,t,r={}){let n=r.fs||yt,i=Rc(t,r);return n.writeFileSync(e,i,r)}var Cm={readFile:_m,readFileSync:Sm,writeFile:Em,writeFileSync:wm};Ac.exports=Cm});var Pc=_((hS,Oc)=>{"use strict";c();var Or=bc();Oc.exports={readJson:Or.readFile,readJsonSync:Or.readFileSync,writeJson:Or.writeFile,writeJsonSync:Or.writeFileSync}});var Pr=_((dS,Fc)=>{"use strict";c();var Rm=le().fromCallback,Ot=ue(),kc=k("path"),Tc=ve(),xm=Ie().pathExists;function Am(e,t,r,n){typeof r=="function"&&(n=r,r="utf8");let i=kc.dirname(e);xm(i,(s,o)=>{if(s)return n(s);if(o)return Ot.writeFile(e,t,r,n);Tc.mkdirs(i,u=>{if(u)return n(u);Ot.writeFile(e,t,r,n)})})}function bm(e,...t){let r=kc.dirname(e);if(Ot.existsSync(r))return Ot.writeFileSync(e,...t);Tc.mkdirsSync(r),Ot.writeFileSync(e,...t)}Fc.exports={outputFile:Rm(Am),outputFileSync:bm}});var Dc=_((yS,Lc)=>{"use strict";c();var{stringify:Om}=Ar(),{outputFile:Pm}=Pr();async function km(e,t,r={}){let n=Om(t,r);await Pm(e,n,r)}Lc.exports=km});var $c=_((mS,qc)=>{"use strict";c();var{stringify:Tm}=Ar(),{outputFileSync:Fm}=Pr();function Lm(e,t,r){let n=Tm(t,r);Fm(e,n,r)}qc.exports=Lm});var Ic=_((gS,Nc)=>{"use strict";c();var Dm=le().fromPromise,ae=Pc();ae.outputJson=Dm(Dc());ae.outputJsonSync=$c();ae.outputJSON=ae.outputJson;ae.outputJSONSync=ae.outputJsonSync;ae.writeJSON=ae.writeJson;ae.writeJSONSync=ae.writeJsonSync;ae.readJSON=ae.readJson;ae.readJSONSync=ae.readJsonSync;Nc.exports=ae});var Gc=_((_S,jc)=>{"use strict";c();var qm=ue(),$i=k("path"),$m=wr().copy,Bc=At().remove,Nm=ve().mkdirp,Im=Ie().pathExists,Mc=Ze();function Mm(e,t,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;Mc.checkPaths(e,t,"move",r,(s,o)=>{if(s)return n(s);let{srcStat:u,isChangingCase:l=!1}=o;Mc.checkParentPaths(e,u,t,"move",g=>{if(g)return n(g);if(Hm(t))return Hc(e,t,i,l,n);Nm($i.dirname(t),a=>a?n(a):Hc(e,t,i,l,n))})})}function Hm(e){let t=$i.dirname(e);return $i.parse(t).root===t}function Hc(e,t,r,n,i){if(n)return qi(e,t,r,i);if(r)return Bc(t,s=>s?i(s):qi(e,t,r,i));Im(t,(s,o)=>s?i(s):o?i(new Error("dest already exists.")):qi(e,t,r,i))}function qi(e,t,r,n){qm.rename(e,t,i=>i?i.code!=="EXDEV"?n(i):Bm(e,t,r,n):n())}function Bm(e,t,r,n){$m(e,t,{overwrite:r,errorOnExist:!0},s=>s?n(s):Bc(e,n))}jc.exports=Mm});var Yc=_((SS,Kc)=>{"use strict";c();var Wc=ue(),Ii=k("path"),jm=wr().copySync,Vc=At().removeSync,Gm=ve().mkdirpSync,Uc=Ze();function Um(e,t,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:s=!1}=Uc.checkPathsSync(e,t,"move",r);return Uc.checkParentPathsSync(e,i,t,"move"),Wm(t)||Gm(Ii.dirname(t)),Vm(e,t,n,s)}function Wm(e){let t=Ii.dirname(e);return Ii.parse(t).root===t}function Vm(e,t,r,n){if(n)return Ni(e,t,r);if(r)return Vc(t),Ni(e,t,r);if(Wc.existsSync(t))throw new Error("dest already exists.");return Ni(e,t,r)}function Ni(e,t,r){try{Wc.renameSync(e,t)}catch(n){if(n.code!=="EXDEV")throw n;return Km(e,t,r)}}function Km(e,t,r){return jm(e,t,{overwrite:r,errorOnExist:!0}),Vc(e)}Kc.exports=Um});var Xc=_((vS,Qc)=>{"use strict";c();var Ym=le().fromCallback;Qc.exports={move:Ym(Gc()),moveSync:Yc()}});var Zc=_((ES,Jc)=>{"use strict";c();Jc.exports=I(I(I(I(I(I(I(I(I(I({},Je()),wr()),Va()),wc()),Ic()),ve()),Xc()),Pr()),Ie()),At())});c();import Zm from"fs";import nl from"path";import{exec as zm}from"child_process";import eg from"yargs";import tg from"open";import Fr from"consola";var Dt="0.2.
|
|
12
|
+
`,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let s=r?t:"";return JSON.stringify(e,n,i).replace(/\n/g,t)+s}function mm(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e.replace(/^\uFEFF/,"")}Cc.exports={stringify:ym,stripBom:mm}});var bc=_((pS,Ac)=>{c();var yt;try{yt=ue()}catch{yt=k("fs")}var br=le(),{stringify:Rc,stripBom:xc}=Ar();async function gm(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||yt,n="throws"in t?t.throws:!0,i=await br.fromCallback(r.readFile)(e,t);i=xc(i);let s;try{s=JSON.parse(i,t?t.reviver:null)}catch(o){if(n)throw o.message=`${e}: ${o.message}`,o;return null}return s}var _m=br.fromPromise(gm);function Sm(e,t={}){typeof t=="string"&&(t={encoding:t});let r=t.fs||yt,n="throws"in t?t.throws:!0;try{let i=r.readFileSync(e,t);return i=xc(i),JSON.parse(i,t.reviver)}catch(i){if(n)throw i.message=`${e}: ${i.message}`,i;return null}}async function vm(e,t,r={}){let n=r.fs||yt,i=Rc(t,r);await br.fromCallback(n.writeFile)(e,i,r)}var Em=br.fromPromise(vm);function wm(e,t,r={}){let n=r.fs||yt,i=Rc(t,r);return n.writeFileSync(e,i,r)}var Cm={readFile:_m,readFileSync:Sm,writeFile:Em,writeFileSync:wm};Ac.exports=Cm});var Pc=_((hS,Oc)=>{"use strict";c();var Or=bc();Oc.exports={readJson:Or.readFile,readJsonSync:Or.readFileSync,writeJson:Or.writeFile,writeJsonSync:Or.writeFileSync}});var Pr=_((dS,Fc)=>{"use strict";c();var Rm=le().fromCallback,Ot=ue(),kc=k("path"),Tc=ve(),xm=Ie().pathExists;function Am(e,t,r,n){typeof r=="function"&&(n=r,r="utf8");let i=kc.dirname(e);xm(i,(s,o)=>{if(s)return n(s);if(o)return Ot.writeFile(e,t,r,n);Tc.mkdirs(i,u=>{if(u)return n(u);Ot.writeFile(e,t,r,n)})})}function bm(e,...t){let r=kc.dirname(e);if(Ot.existsSync(r))return Ot.writeFileSync(e,...t);Tc.mkdirsSync(r),Ot.writeFileSync(e,...t)}Fc.exports={outputFile:Rm(Am),outputFileSync:bm}});var Dc=_((yS,Lc)=>{"use strict";c();var{stringify:Om}=Ar(),{outputFile:Pm}=Pr();async function km(e,t,r={}){let n=Om(t,r);await Pm(e,n,r)}Lc.exports=km});var $c=_((mS,qc)=>{"use strict";c();var{stringify:Tm}=Ar(),{outputFileSync:Fm}=Pr();function Lm(e,t,r){let n=Tm(t,r);Fm(e,n,r)}qc.exports=Lm});var Ic=_((gS,Nc)=>{"use strict";c();var Dm=le().fromPromise,ae=Pc();ae.outputJson=Dm(Dc());ae.outputJsonSync=$c();ae.outputJSON=ae.outputJson;ae.outputJSONSync=ae.outputJsonSync;ae.writeJSON=ae.writeJson;ae.writeJSONSync=ae.writeJsonSync;ae.readJSON=ae.readJson;ae.readJSONSync=ae.readJsonSync;Nc.exports=ae});var Gc=_((_S,jc)=>{"use strict";c();var qm=ue(),$i=k("path"),$m=wr().copy,Bc=At().remove,Nm=ve().mkdirp,Im=Ie().pathExists,Mc=Ze();function Mm(e,t,r,n){typeof r=="function"&&(n=r,r={});let i=r.overwrite||r.clobber||!1;Mc.checkPaths(e,t,"move",r,(s,o)=>{if(s)return n(s);let{srcStat:u,isChangingCase:l=!1}=o;Mc.checkParentPaths(e,u,t,"move",g=>{if(g)return n(g);if(Hm(t))return Hc(e,t,i,l,n);Nm($i.dirname(t),a=>a?n(a):Hc(e,t,i,l,n))})})}function Hm(e){let t=$i.dirname(e);return $i.parse(t).root===t}function Hc(e,t,r,n,i){if(n)return qi(e,t,r,i);if(r)return Bc(t,s=>s?i(s):qi(e,t,r,i));Im(t,(s,o)=>s?i(s):o?i(new Error("dest already exists.")):qi(e,t,r,i))}function qi(e,t,r,n){qm.rename(e,t,i=>i?i.code!=="EXDEV"?n(i):Bm(e,t,r,n):n())}function Bm(e,t,r,n){$m(e,t,{overwrite:r,errorOnExist:!0},s=>s?n(s):Bc(e,n))}jc.exports=Mm});var Yc=_((SS,Kc)=>{"use strict";c();var Wc=ue(),Ii=k("path"),jm=wr().copySync,Vc=At().removeSync,Gm=ve().mkdirpSync,Uc=Ze();function Um(e,t,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:s=!1}=Uc.checkPathsSync(e,t,"move",r);return Uc.checkParentPathsSync(e,i,t,"move"),Wm(t)||Gm(Ii.dirname(t)),Vm(e,t,n,s)}function Wm(e){let t=Ii.dirname(e);return Ii.parse(t).root===t}function Vm(e,t,r,n){if(n)return Ni(e,t,r);if(r)return Vc(t),Ni(e,t,r);if(Wc.existsSync(t))throw new Error("dest already exists.");return Ni(e,t,r)}function Ni(e,t,r){try{Wc.renameSync(e,t)}catch(n){if(n.code!=="EXDEV")throw n;return Km(e,t,r)}}function Km(e,t,r){return jm(e,t,{overwrite:r,errorOnExist:!0}),Vc(e)}Kc.exports=Um});var Xc=_((vS,Qc)=>{"use strict";c();var Ym=le().fromCallback;Qc.exports={move:Ym(Gc()),moveSync:Yc()}});var Zc=_((ES,Jc)=>{"use strict";c();Jc.exports=I(I(I(I(I(I(I(I(I(I({},Je()),wr()),Va()),wc()),Ic()),ve()),Xc()),Pr()),Ie()),At())});c();import Zm from"fs";import nl from"path";import{exec as zm}from"child_process";import eg from"yargs";import tg from"open";import Fr from"consola";var Dt="0.2.4";c();var Ji=Ge(Xi());import{dirname as kl,resolve as Mr}from"path";var Tl=(0,Ji.default)("valaxy:options");function Fl(e){return e.startsWith("/")||/^\.\.?[\/\\]/.test(e)}function Ll(e,t){return e?Fl(e)?Mr(kl(t),e):qr(`valaxy-theme-${e}/package.json`):""}async function Mt(e,t="dev"){let r=Mr(qr("valaxy/package.json"),"src/client"),n=Mr(e.userRoot||process.cwd()),{config:i,configFile:s,theme:o}=await ji(e),u=Ll(o,n),l={mode:t,clientRoot:r,userRoot:n,themeRoot:u,theme:o,config:i,configFile:s||""};return Tl(l),l}c();var X=Ge(Hi());import*as Zi from"readline";import Dl from"path";import ql from"os";import Ht from"consola";var Bt;function Hr(e,t,r){console.log(),console.log(` ${X.default.bold("\u{1F30C} Valaxy")} ${X.default.blue(`v${Dt}`)}`),console.log(),console.log(`${X.default.dim(" \u{1FA90} theme ")} > ${e.theme?X.default.green(e.theme):X.default.gray("none")}`),console.log(` ${X.default.dim("\u{1F4C1}")} ${X.default.dim(Dl.resolve(e.userRoot))}`),t&&(console.log(),console.log(`${X.default.dim(" Preview ")} > ${X.default.cyan(`http://localhost:${X.default.bold(t)}/`)}`),r&&Object.values(ql.networkInterfaces()).forEach(n=>(n||[]).filter(i=>i.family==="IPv4"&&!i.address.includes("127.0.0.1")).forEach(({address:i})=>{console.log(`${X.default.dim(" Network ")} > ${X.default.blue(`http://${i}:${X.default.bold(t)}/`)}`)})),console.log(),console.log(`${X.default.dim(" shortcuts ")} > ${X.default.underline("r")}${X.default.dim("estart | ")}${X.default.underline("o")}${X.default.dim("pen | ")}${X.default.underline("e")}${X.default.dim("dit")}`)),console.log()}async function jt(e,t){Bt&&await Bt.close();try{let r=Bi(e.config).concat(e.config.unocss.safelist||[]);Bt=await Gi(e,t,{onConfigReload(n,i){let s=!1;n.social.some((u,l)=>!r.includes(u.icon)&&u.icon!==i.social[l].icon)&&(Ht.info("Find new icon, reload server..."),Ht.info(`If you do not want to reload it, write icon name in ${X.default.green("config.unocss.safelist")}.`),Ht.info('For example: ["i-ri-cloud-line"]'),console.log(),s=!0),s&&jt(e,t)}}),await Bt.listen()}catch(r){Ht.error(`failed to start server. error:
|
|
13
13
|
`),console.error(r),process.exit(1)}}function zi(e){process.stdin.resume(),process.stdin.setEncoding("utf8"),Zi.emitKeypressEvents(process.stdin),process.stdin.isTTY&&process.stdin.setRawMode(!0),process.stdin.on("keypress",(t,r)=>{if(r.ctrl&&r.name==="c")process.exit();else{let[n]=e.filter(i=>i.name===t);if(n)try{n.action()}catch(i){console.error(`Failed to execute shortcut ${n.fullName}`,i)}}})}c();import{mergeConfig as es,build as $l}from"vite";import{build as Nl}from"vite-ssg/node";import Il from"vite-ssg-sitemap";async function ts(e,t={}){let r=es(await $r(e),t);await $l(r)}async function rs(e,t={}){let r=es(await $r(e),t);r.ssgOptions={script:"async",formatting:"minify",onFinished(){Il()}},await Nl({},r)}c();var kr=Ge(Hi()),zc=Ge(Gu()),Tr=Ge(Zc()),el=Ge(ul()),tl=Ge(ol());import{dirname as Qm}from"path";import{Feed as Xm}from"feed";import Pt from"consola";var Jm=(0,tl.default)({html:!0,breaks:!0,linkify:!0});async function rl(e){let{config:t}=e;if(!t.url){Pt.error('You must set "config.url" to generate rss.');return}let r=t.url.endsWith("/")?t.url:`${t.url}/`,n=t.url.endsWith("/")?t.url.slice(0,-1):t.url,i={name:e.config.author.name,email:e.config.author.email,link:e.config.author.link};Pt.info(`RSS Site Url: ${kr.default.cyan(r)}`);let s=t.license.type==="zero"?"1.0":"4.0",o={title:t.title,description:t.description,id:r||"valaxy",link:r,copyright:`CC ${t.license.type.toUpperCase()} ${s} ${new Date().getFullYear()} \xA9 ${t.author.name}`,feedLinks:{json:`${r}feed.json`,atom:`${r}feed.atom`,rss:`${r}feed.xml`}},u=await(0,zc.default)(`${e.userRoot}/pages/posts/**/*.md`),l=[];u.forEach(f=>{var O;let v=Tr.default.readFileSync(f,"utf-8"),{data:m,content:S,excerpt:E}=(0,el.default)(v);if(!m.date)return Pt.warn(`Do you forget to write date for ${kr.default.dim(f)}`),!1;if(m.draft)return Pt.warn(`Ignore draft post: ${kr.default.dim(f)}`),!1;let R=Jm.render(E||S).replace('src="/',`src="${n}/`);(O=m.image)!=null&&O.startsWith("/")&&(m.image=n+m.image),l.push(z(I({title:""},m),{id:(m.id||"").toString(),date:new Date(m.date),published:new Date(m.updated||m.date),content:R,author:[i],link:n+f.replace(`${e.userRoot}/pages`,"").replace(/\.md$/,"")}))}),l.sort((f,v)=>+new Date(v.published||v.date)-+new Date(f.published||f.date)),o.author=i,o.image=t.author.avatar.startsWith("http")?t.author.avatar:`${n}${t.author.avatar}`,o.favicon=`${n}/${t.feed.favicon}`;let g=new Xm(o);l.forEach(f=>g.addItem(f)),await Tr.default.ensureDir(Qm(`./dist/${t.feed.name}`));let a="./dist";["xml","atom","json"].forEach(f=>{let v="",m=`${a}/${t.feed.name||"feed"}.${f}`;f==="xml"?v=g.rss2():f==="atom"?(t.feed.name||(m=`${a}/atom.xml`),v=g.atom1()):f==="json"&&(v=g.json1()),Tr.default.writeFileSync(m,v,"utf-8"),Pt.info(`${f}: ${m}`)})}var Lr=eg.scriptName("valaxy").usage("$0 [args]").version(Dt).showHelpOnFail(!1).alias("h","help").alias("v","version");Lr.command("* [root]","Start a local server for Valaxy",e=>Mi(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:t,open:r,remote:n,log:i})=>{Zm.existsSync(nl.resolve(e,"pages"))||process.exit(0);let s=t||4859,o=await Mt({userRoot:e}),u={server:{watch:{ignored:[`!${o.themeRoot}/**`,`${o.userRoot}/**.md`]},port:s,strictPort:!0,open:r,host:n?"0.0.0.0":"localhost"},logLevel:i};await jt(o,u),Hr(o,s,n),zi([{name:"r",fullName:"restart",action(){jt(o,u)}},{name:"o",fullName:"open",action(){tg(`http://localhost:${s}`)}},{name:"e",fullName:"edit",action(){zm(`code "${e}"`)}}])});Lr.command("build [root]","build your blog to static content",e=>Mi(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",default:"/",describe:"output base"}).strict().help(),async({ssg:e,root:t,base:r,output:n})=>{let i=await Mt({userRoot:t},"build");Hr(i);let s={base:r,build:{emptyOutDir:!0,outDir:nl.resolve(i.userRoot,n)}};if(e){Fr.info("use vite-ssg to do ssg build...");try{await rs(i,s)}catch(o){Fr.error("[vite-ssg] An internal error occurred."),console.log(o)}}else Fr.info("use vite do spa build..."),await ts(i,s)});Lr.command("rss [root]","generate rss feed",e=>Mi(e).strict().help(),async({root:e})=>{Fr.info("Generate RSS ...");let t=await Mt({userRoot:e},"build");await rl(t)});function Mi(e){return e.positional("root",{default:".",type:"string",describe:"root folder of your source files"})}function NS(){Lr.help().parse()}export{NS as run};
|
|
14
14
|
/*!
|
|
15
15
|
* fill-range <https://github.com/jonschlinkert/fill-range>
|
package/dist/node/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkXMNH5QY2js = require('../chunk-XMNH5QY2.js');var _chunkRUZ4KMBMjs = require('../chunk-RUZ4KMBM.js');_chunkRUZ4KMBMjs.f.call(void 0, );exports.createServer = _chunkXMNH5QY2js.i;
|
package/dist/node/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as r}from"../chunk-
|
|
1
|
+
import{i as r}from"../chunk-HSIBOGUA.mjs";import{f as o}from"../chunk-JARRR63D.mjs";o();export{r as createServer};
|
package/package.json
CHANGED
package/src/client/App.vue
CHANGED
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
// you can use this to manipulate the document head in any components,
|
|
4
4
|
// they will be rendered correctly in the html results with vite-ssg
|
|
5
5
|
import { useHead } from '@vueuse/head'
|
|
6
|
+
import { useConfig } from './config'
|
|
7
|
+
|
|
8
|
+
const config = useConfig()
|
|
6
9
|
useHead({
|
|
7
|
-
title:
|
|
10
|
+
title: config.value.title,
|
|
8
11
|
meta: [
|
|
9
|
-
{ name: 'description', content:
|
|
12
|
+
{ name: 'description', content: config.value.description },
|
|
10
13
|
],
|
|
11
14
|
})
|
|
12
15
|
</script>
|
|
@@ -13,7 +13,7 @@ const { icon, styles } = usePostProperty(props.post.type)
|
|
|
13
13
|
</script>
|
|
14
14
|
|
|
15
15
|
<template>
|
|
16
|
-
<YunCard m="
|
|
16
|
+
<YunCard m="y-4 auto" class="post-card" :style="styles">
|
|
17
17
|
<AppLink
|
|
18
18
|
class="post-title-link"
|
|
19
19
|
:to="post.path || ''"
|
|
@@ -10,8 +10,8 @@ export function useTwikoo(options: {} = {}) {
|
|
|
10
10
|
let twikoo: any
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* init
|
|
14
|
-
* @param options
|
|
13
|
+
* init twikoo
|
|
14
|
+
* @param options twikoo options
|
|
15
15
|
* @returns
|
|
16
16
|
*/
|
|
17
17
|
function initTwikoo(options: {} = {}) {
|
|
@@ -29,9 +29,7 @@ export function useTwikoo(options: {} = {}) {
|
|
|
29
29
|
|
|
30
30
|
// 直接使用 CDN
|
|
31
31
|
useScriptTag('//cdn.jsdelivr.net/npm/twikoo@1.5.1/dist/twikoo.all.min.js', () => {
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
33
|
twikoo = initTwikoo(options)
|
|
33
34
|
})
|
|
34
|
-
|
|
35
|
-
// eslint-disable-next-line no-console
|
|
36
|
-
console.log(twikoo)
|
|
37
35
|
}
|
|
@@ -42,9 +42,9 @@ function generateLocales(roots: string[]) {
|
|
|
42
42
|
roots.forEach((root, i) => {
|
|
43
43
|
languages.forEach((lang) => {
|
|
44
44
|
const langYml = `${root}/locales/${lang}.yml`
|
|
45
|
-
if (fs.existsSync(langYml)) {
|
|
45
|
+
if (fs.existsSync(langYml) && fs.readFileSync(langYml, 'utf-8')) {
|
|
46
46
|
const varName = lang.replace('-', '') + i
|
|
47
|
-
imports.push(`import ${varName} from "${langYml}"`)
|
|
47
|
+
imports.push(`import ${varName} from "${toAtFS(langYml)}"`)
|
|
48
48
|
imports.push(`Object.assign(messages['${lang}'], ${varName})`)
|
|
49
49
|
}
|
|
50
50
|
})
|
package/src/types/config.ts
CHANGED
|
@@ -187,6 +187,7 @@ export const defaultValaxyConfig: ValaxyConfig = {
|
|
|
187
187
|
url: '',
|
|
188
188
|
lang: 'en',
|
|
189
189
|
title: 'Valaxy Blog',
|
|
190
|
+
description: 'A blog generated by Valaxy.',
|
|
190
191
|
subtitle: 'Next Generation Static Blog Framework.',
|
|
191
192
|
author: {
|
|
192
193
|
avatar: 'https://cdn.jsdelivr.net/gh/YunYouJun/yun/images/meme/yun-good-with-bg.jpg',
|
|
@@ -203,7 +204,6 @@ export const defaultValaxyConfig: ValaxyConfig = {
|
|
|
203
204
|
favicon: 'favicon.png',
|
|
204
205
|
},
|
|
205
206
|
social: [],
|
|
206
|
-
description: 'A blog generated by Valaxy.',
|
|
207
207
|
|
|
208
208
|
license: {
|
|
209
209
|
enabled: true,
|
|
@@ -1,188 +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 & rss
|
|
42
|
-
* @description 站点的 URL,SSG & RSS 需要(譬如生成版权处文章永久链接)
|
|
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
|
-
email: string;
|
|
69
|
-
link: string;
|
|
70
|
-
avatar: string;
|
|
71
|
-
/**
|
|
72
|
-
* The status of you
|
|
73
|
-
* @description 状态
|
|
74
|
-
*/
|
|
75
|
-
status: {
|
|
76
|
-
emoji: string;
|
|
77
|
-
/**
|
|
78
|
-
* show when hover emoji
|
|
79
|
-
* @description 当鼠标悬浮在图标上时显示
|
|
80
|
-
*/
|
|
81
|
-
message: string;
|
|
82
|
-
};
|
|
83
|
-
};
|
|
84
|
-
feed: {
|
|
85
|
-
/**
|
|
86
|
-
* name: feed -> feed.xml / feed.atom / feed.json
|
|
87
|
-
* @default '' -> feed.xml / atom.xml / feed.json
|
|
88
|
-
*/
|
|
89
|
-
name: string;
|
|
90
|
-
favicon: string;
|
|
91
|
-
};
|
|
92
|
-
/**
|
|
93
|
-
* 社交链接
|
|
94
|
-
*/
|
|
95
|
-
social: SocialLink[];
|
|
96
|
-
/**
|
|
97
|
-
* search
|
|
98
|
-
*/
|
|
99
|
-
search: {
|
|
100
|
-
algolia: {
|
|
101
|
-
enable: boolean;
|
|
102
|
-
appId: string;
|
|
103
|
-
apiKey: string;
|
|
104
|
-
indexName: string;
|
|
105
|
-
chunkSize: number;
|
|
106
|
-
};
|
|
107
|
-
};
|
|
108
|
-
/**
|
|
109
|
-
* comment: waline/...
|
|
110
|
-
*/
|
|
111
|
-
comment: {
|
|
112
|
-
waline: {
|
|
113
|
-
enable: boolean;
|
|
114
|
-
serverURL: string;
|
|
115
|
-
};
|
|
116
|
-
twikoo: {
|
|
117
|
-
enable: boolean;
|
|
118
|
-
envId: string;
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
/**
|
|
122
|
-
* The name of theme
|
|
123
|
-
* @description 主题名称
|
|
124
|
-
*/
|
|
125
|
-
theme: string;
|
|
126
|
-
/**
|
|
127
|
-
* The config of theme
|
|
128
|
-
* @description 主题配置
|
|
129
|
-
*/
|
|
130
|
-
themeConfig: T;
|
|
131
|
-
/**
|
|
132
|
-
* Unocss Config
|
|
133
|
-
*/
|
|
134
|
-
unocss: VitePluginConfig;
|
|
135
|
-
/**
|
|
136
|
-
* The license of your posts
|
|
137
|
-
* @description 文章所使用的协议,默认使用 Creative Commons
|
|
138
|
-
* @default https://creativecommons.org/licenses/
|
|
139
|
-
*/
|
|
140
|
-
license: {
|
|
141
|
-
/**
|
|
142
|
-
* Whether to show at the bottom of the article
|
|
143
|
-
* @description 是否显示在文章底部
|
|
144
|
-
* @default true
|
|
145
|
-
*/
|
|
146
|
-
enabled: boolean;
|
|
147
|
-
/**
|
|
148
|
-
* Creative License Language, same with your config.lang
|
|
149
|
-
* when lang === 'zh-CN', use 'zh'
|
|
150
|
-
* @description 默认与站点语言相同
|
|
151
|
-
* @default 'en'
|
|
152
|
-
*/
|
|
153
|
-
language: string;
|
|
154
|
-
/**
|
|
155
|
-
* Type of license
|
|
156
|
-
* @description 证书类型
|
|
157
|
-
* @default 'by-nc-sa'
|
|
158
|
-
*/
|
|
159
|
-
type: 'zero' | 'by-sa' | 'by-nd' | 'by-nc' | 'by-nc-sa' | 'by-nc-nd';
|
|
160
|
-
};
|
|
161
|
-
/**
|
|
162
|
-
* donate for author
|
|
163
|
-
* @description 打赏/赞助
|
|
164
|
-
*/
|
|
165
|
-
sponsor: {
|
|
166
|
-
enable: boolean;
|
|
167
|
-
title: string;
|
|
168
|
-
methods: {
|
|
169
|
-
name: string;
|
|
170
|
-
url: string;
|
|
171
|
-
color: string;
|
|
172
|
-
icon: string;
|
|
173
|
-
}[];
|
|
174
|
-
};
|
|
175
|
-
/**
|
|
176
|
-
* for markdown
|
|
177
|
-
*/
|
|
178
|
-
markdown: ViteMdOptions;
|
|
179
|
-
markdownIt: MarkdownOptions;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Valaxy User Config
|
|
183
|
-
* @description Valaxy 用户配置
|
|
184
|
-
*/
|
|
185
|
-
declare type UserConfig<T = ValaxyThemeConfig> = PartialDeep<ValaxyConfig<T>>;
|
|
186
|
-
declare const defaultValaxyConfig: ValaxyConfig;
|
|
187
|
-
|
|
188
|
-
export { SocialLink as S, UserConfig as U, ValaxyConfig as V, ValaxyThemeConfig as a, defaultValaxyConfig as d };
|