valaxy 0.0.7 → 0.1.0

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 (47) hide show
  1. package/bin/valaxy.js +1 -1
  2. package/dist/build-CLF7GOPQ.mjs +1 -0
  3. package/dist/build-F47TGGER.js +1 -0
  4. package/dist/chunk-5S6S3FLN.mjs +83 -0
  5. package/dist/chunk-JORQSKHF.mjs +1 -0
  6. package/dist/chunk-TOMJSB6R.js +83 -0
  7. package/dist/chunk-VJNIZVTJ.js +1 -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/{config-d6527c8c.d.ts → index.d.ts} +37 -8
  12. package/dist/index.js +1 -0
  13. package/dist/index.mjs +1 -0
  14. package/package.json +9 -5
  15. package/src/client/components/ValaxyCopyright.vue +1 -1
  16. package/src/client/composables/category.ts +2 -2
  17. package/src/client/composables/common.ts +3 -2
  18. package/src/client/composables/post.ts +2 -2
  19. package/src/client/composables/tag.ts +2 -1
  20. package/src/{core → client}/config.ts +1 -1
  21. package/src/client/index.ts +4 -0
  22. package/src/client/modules/valaxy.ts +1 -1
  23. package/src/client/utils/index.ts +2 -0
  24. package/src/client/utils/time.ts +7 -1
  25. package/src/index.ts +1 -1
  26. package/src/node/plugins/extendConfig.ts +20 -3
  27. package/src/node/plugins/preset.ts +10 -1
  28. package/src/node/vite.ts +4 -34
  29. package/tsup.config.ts +8 -4
  30. package/dist/build-OOT6HK6S.js +0 -1
  31. package/dist/build-SG32QSQ3.mjs +0 -1
  32. package/dist/chunk-7JDYOPID.js +0 -1
  33. package/dist/chunk-JJEBEWGI.mjs +0 -1
  34. package/dist/chunk-L3EDI35I.js +0 -1
  35. package/dist/chunk-L5SNNWFJ.js +0 -78
  36. package/dist/chunk-MVJUGWXR.mjs +0 -1
  37. package/dist/chunk-QI435Q25.mjs +0 -78
  38. package/dist/node/cli.js +0 -6
  39. package/dist/node/cli.mjs +0 -6
  40. package/dist/node/index.d.ts +0 -45
  41. package/dist/node/index.js +0 -1
  42. package/dist/node/index.mjs +0 -1
  43. package/dist/types/index.d.ts +0 -110
  44. package/dist/types/index.js +0 -1
  45. package/dist/types/index.mjs +0 -1
  46. package/src/core/index.ts +0 -5
  47. package/src/core/utils.ts +0 -1
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 _chunk7JDYOPIDjs = require('../chunk-7JDYOPID.js');var _chunkL5SNNWFJjs = require('../chunk-L5SNNWFJ.js');var _chunkL3EDI35Ijs = require('../chunk-L3EDI35I.js');var re=_chunkL3EDI35Ijs.c.call(void 0, (st,oe)=>{_chunkL3EDI35Ijs.e.call(void 0, );var x=1e3,O=x*60,R=O*60,F=R*24,Oe=F*7,Re=F*365.25;oe.exports=function(e,o){o=o||{};var t=typeof e;if(t==="string"&&e.length>0)return Ee(e);if(t==="number"&&isFinite(e))return o.long?$e(e):Ie(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ee(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*Re;case"weeks":case"week":case"w":return t*Oe;case"days":case"day":case"d":return t*F;case"hours":case"hour":case"hrs":case"hr":case"h":return t*R;case"minutes":case"minute":case"mins":case"min":case"m":return t*O;case"seconds":case"second":case"secs":case"sec":case"s":return t*x;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Ie(e){var o=Math.abs(e);return o>=F?Math.round(e/F)+"d":o>=R?Math.round(e/R)+"h":o>=O?Math.round(e/O)+"m":o>=x?Math.round(e/x)+"s":e+"ms"}function $e(e){var o=Math.abs(e);return o>=F?T(e,o,F,"day"):o>=R?T(e,o,R,"hour"):o>=O?T(e,o,O,"minute"):o>=x?T(e,o,x,"second"):e+" ms"}function T(e,o,t,r){var s=o>=t*1.5;return Math.round(e/t)+" "+r+(s?"s":"")}});var P=_chunkL3EDI35Ijs.c.call(void 0, (it,ne)=>{_chunkL3EDI35Ijs.e.call(void 0, );function ke(e){t.debug=t,t.default=t,t.coerce=I,t.disable=c,t.enable=s,t.enabled=h,t.humanize=re(),t.destroy=ve,Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={};function o(n){let i=0;for(let u=0;u<n.length;u++)i=(i<<5)-i+n.charCodeAt(u),i|=0;return t.colors[Math.abs(i)%t.colors.length]}t.selectColor=o;function t(n){let i,u=null,$,K;function y(...m){if(!y.enabled)return;let b=y,k=Number(new Date),be=k-(i||k);b.diff=be,b.prev=i,b.curr=k,i=k,m[0]=t.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let A=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(D,we)=>{if(D==="%%")return"%";A++;let Z=t.formatters[we];if(typeof Z=="function"){let Fe=m[A];D=Z.call(b,Fe),m.splice(A,1),A--}return D}),t.formatArgs.call(b,m),(b.log||t.log).apply(b,m)}return y.namespace=n,y.useColors=t.useColors(),y.color=t.selectColor(n),y.extend=r,y.destroy=t.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>u!==null?u:($!==t.namespaces&&($=t.namespaces,K=t.enabled(n)),K),set:m=>{u=m}}),typeof t.init=="function"&&t.init(y),y}function r(n,i){let u=t(this.namespace+(typeof i>"u"?":":i)+n);return u.log=this.log,u}function s(n){t.save(n),t.namespaces=n,t.names=[],t.skips=[];let i,u=(typeof n=="string"?n:"").split(/[\s,]+/),$=u.length;for(i=0;i<$;i++)!u[i]||(n=u[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(C),...t.skips.map(C).map(i=>"-"+i)].join(",");return t.enable(""),n}function h(n){if(n[n.length-1]==="*")return!0;let i,u;for(i=0,u=t.skips.length;i<u;i++)if(t.skips[i].test(n))return!1;for(i=0,u=t.names.length;i<u;i++)if(t.names[i].test(n))return!0;return!1}function C(n){return n.toString().substring(2,n.toString().length-2).replace(/\.\*\?$/,"*")}function I(n){return n instanceof Error?n.stack||n.message:n}function ve(){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}ne.exports=ke});var se=_chunkL3EDI35Ijs.c.call(void 0, (d,j)=>{_chunkL3EDI35Ijs.e.call(void 0, );d.formatArgs=Se;d.save=Te;d.load=je;d.useColors=Ae;d.storage=Me();d.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`."))}})();d.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 Ae(){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 Se(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+j.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)}d.log=console.debug||console.log||(()=>{});function Te(e){try{e?d.storage.setItem("debug",e):d.storage.removeItem("debug")}catch (e2){}}function je(){let e;try{e=d.storage.getItem("debug")}catch (e3){}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Me(){try{return localStorage}catch (e4){}}j.exports=P()(d);var{formatters:Le}=j.exports;Le.j=function(e){try{return JSON.stringify(e)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}}});var ae=_chunkL3EDI35Ijs.c.call(void 0, (at,ie)=>{"use strict";_chunkL3EDI35Ijs.e.call(void 0, );ie.exports=(e,o=process.argv)=>{let t=e.startsWith("-")?"":e.length===1?"-":"--",r=o.indexOf(t+e),s=o.indexOf("--");return r!==-1&&(s===-1||r<s)}});var ue=_chunkL3EDI35Ijs.c.call(void 0, (ct,le)=>{"use strict";_chunkL3EDI35Ijs.e.call(void 0, );var Ve=_chunkL3EDI35Ijs.b.call(void 0, "os"),ce=_chunkL3EDI35Ijs.b.call(void 0, "tty"),g=ae(),{env:p}=process,v;g("no-color")||g("no-colors")||g("color=false")||g("color=never")?v=0:(g("color")||g("colors")||g("color=true")||g("color=always"))&&(v=1);"FORCE_COLOR"in p&&(p.FORCE_COLOR==="true"?v=1:p.FORCE_COLOR==="false"?v=0:v=p.FORCE_COLOR.length===0?1:Math.min(parseInt(p.FORCE_COLOR,10),3));function q(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function U(e,o){if(v===0)return 0;if(g("color=16m")||g("color=full")||g("color=truecolor"))return 3;if(g("color=256"))return 2;if(e&&!o&&v===void 0)return 0;let t=v||0;if(p.TERM==="dumb")return t;if(process.platform==="win32"){let r=Ve.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in p)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in p)||p.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in p)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(p.TEAMCITY_VERSION)?1:0;if(p.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in p){let r=parseInt((p.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(p.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(p.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(p.TERM)||"COLORTERM"in p?1:t}function _e(e){let o=U(e,e&&e.isTTY);return q(o)}le.exports={supportsColor:_e,stdout:q(U(!0,ce.isatty(1))),stderr:q(U(!0,ce.isatty(2)))}});var fe=_chunkL3EDI35Ijs.c.call(void 0, (f,L)=>{_chunkL3EDI35Ijs.e.call(void 0, );var Ne=_chunkL3EDI35Ijs.b.call(void 0, "tty"),M=_chunkL3EDI35Ijs.b.call(void 0, "util");f.init=Ye;f.log=qe;f.formatArgs=Be;f.save=Ue;f.load=Ge;f.useColors=De;f.destroy=M.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");f.colors=[6,2,3,4,5,1];try{let e=ue();e&&(e.stderr||e).level>=2&&(f.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){}f.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 De(){return"colors"in f.inspectOpts?Boolean(f.inspectOpts.colors):Ne.isatty(process.stderr.fd)}function Be(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+"+L.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Pe()+o+" "+e[0]}function Pe(){return f.inspectOpts.hideDate?"":new Date().toISOString()+" "}function qe(...e){return process.stderr.write(M.format(...e)+`
4
- `)}function Ue(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function Ge(){return process.env.DEBUG}function Ye(e){e.inspectOpts={};let o=Object.keys(f.inspectOpts);for(let t=0;t<o.length;t++)e.inspectOpts[o[t]]=f.inspectOpts[o[t]]}L.exports=P()(f);var{formatters:pe}=L.exports;pe.o=function(e){return this.inspectOpts.colors=this.useColors,M.inspect(e,this.inspectOpts).split(`
5
- `).map(o=>o.trim()).join(" ")};pe.O=function(e){return this.inspectOpts.colors=this.useColors,M.inspect(e,this.inspectOpts)}});var de=_chunkL3EDI35Ijs.c.call(void 0, (lt,G)=>{_chunkL3EDI35Ijs.e.call(void 0, );typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?G.exports=se():G.exports=fe()});_chunkL3EDI35Ijs.e.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 S="0.0.7";_chunkL3EDI35Ijs.e.call(void 0, );var me=_chunkL3EDI35Ijs.d.call(void 0, de());var Je=(0,me.default)("valaxy:options");function He(e){return e.startsWith("/")||/^\.\.?[\/\\]/.test(e)}function We(e,o){return e?He(e)?_path.resolve.call(void 0, _path.dirname.call(void 0, o),e):_chunkL5SNNWFJjs.a.call(void 0, `valaxy-theme-${e}/package.json`):""}async function z(e){let o=_path.resolve.call(void 0, _chunkL5SNNWFJjs.a.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 _chunkL5SNNWFJjs.c.call(void 0, e),h=We(c,t),C={clientRoot:o,userRoot:t,themeRoot:h,theme:c,config:r,configFile:s||""};return Je(C),C}_chunkL3EDI35Ijs.e.call(void 0, );var _readline = require('readline'); var ge = _interopRequireWildcard(_readline);var _os = require('os'); var _os2 = _interopRequireDefault(_os);var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);var _;function J(e,o,t){console.log(),console.log(` ${_chalk2.default.bold("\u{1F30C} Valaxy")} ${_chalk2.default.blue(`v${S}`)}`),console.log(),console.log(`${_chalk2.default.dim(" \u{1FA90} theme ")} > ${e.theme?_chalk2.default.green(e.theme):_chalk2.default.gray("none")}`),console.log(` ${_chalk2.default.dim("\u{1F4C1}")} ${_chalk2.default.dim(_path2.default.resolve(e.userRoot))}`),o&&(console.log(),console.log(`${_chalk2.default.dim(" Preview ")} > ${_chalk2.default.cyan(`http://localhost:${_chalk2.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(`${_chalk2.default.dim(" Network ")} > ${_chalk2.default.blue(`http://${s}:${_chalk2.default.bold(o)}/`)}`)})),console.log(),console.log(`${_chalk2.default.dim(" shortcuts ")} > ${_chalk2.default.underline("r")}${_chalk2.default.dim("estart | ")}${_chalk2.default.underline("o")}${_chalk2.default.dim("pen | ")}${_chalk2.default.underline("e")}${_chalk2.default.dim("dit")}`)),console.log()}async function N(e,o){_&&await _.close();try{let t=_chunkL5SNNWFJjs.b.call(void 0, e.config).concat(e.config.unocss.safelist||[]);_=await _chunk7JDYOPIDjs.a.call(void 0, e,o,{onConfigReload(r,s){let c=!1;r.social.some((C,I)=>!t.includes(C.icon)&&C.icon!==s.social[I].icon)&&(_consola2.default.info("Find new icon, reload server..."),_consola2.default.info(`If you do not want to reload it, write icon name in ${_chalk2.default.green("config.unocss.safelist")}.`),_consola2.default.info('For example: ["i-ri-cloud-line"]'),console.log(),c=!0),c&&N(e,o)}}),await _.listen()}catch(t){_consola2.default.error(`failed to start server. error:
6
- `),console.error(t),process.exit(1)}}function Ce(e){process.stdin.resume(),process.stdin.setEncoding("utf8"),ge.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 W=_yargs2.default.scriptName("valaxy").usage("$0 [args]").version(S).showHelpOnFail(!1).alias("h","help").alias("v","version");W.command("* [root]","Start a local server for Valaxy",e=>ye(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,h=await z({userRoot:e}),C={server:{watch:{ignored:[`!${h.themeRoot}/**`,`${h.userRoot}/**.md`]},port:c,strictPort:!0,open:t,host:r?"0.0.0.0":"localhost"},logLevel:s};await N(h,C),J(h,c,r),Ce([{name:"r",fullName:"restart",action(){N(h,C)}},{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}"`)}}])});W.command("build [root]","build your blog to static content",e=>ye(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 z({userRoot:o});if(J(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(()=>_chunkL3EDI35Ijs.d.call(void 0, _chunkL3EDI35Ijs.b.call(void 0, "../build-OOT6HK6S.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 ye(e){return e.positional("root",{default:".",type:"string",describe:"root folder of your source files"})}function Tt(){W.help().parse()}exports.run = Tt;
package/dist/node/cli.mjs DELETED
@@ -1,6 +0,0 @@
1
- import{a as te}from"../chunk-JJEBEWGI.mjs";import{a as B,b as X,c as ee}from"../chunk-QI435Q25.mjs";import{b as E,c as w,d as Q,e as l}from"../chunk-MVJUGWXR.mjs";var re=w((st,oe)=>{l();var x=1e3,O=x*60,R=O*60,F=R*24,Oe=F*7,Re=F*365.25;oe.exports=function(e,o){o=o||{};var t=typeof e;if(t==="string"&&e.length>0)return Ee(e);if(t==="number"&&isFinite(e))return o.long?$e(e):Ie(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Ee(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*Re;case"weeks":case"week":case"w":return t*Oe;case"days":case"day":case"d":return t*F;case"hours":case"hour":case"hrs":case"hr":case"h":return t*R;case"minutes":case"minute":case"mins":case"min":case"m":return t*O;case"seconds":case"second":case"secs":case"sec":case"s":return t*x;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return t;default:return}}}}function Ie(e){var o=Math.abs(e);return o>=F?Math.round(e/F)+"d":o>=R?Math.round(e/R)+"h":o>=O?Math.round(e/O)+"m":o>=x?Math.round(e/x)+"s":e+"ms"}function $e(e){var o=Math.abs(e);return o>=F?T(e,o,F,"day"):o>=R?T(e,o,R,"hour"):o>=O?T(e,o,O,"minute"):o>=x?T(e,o,x,"second"):e+" ms"}function T(e,o,t,r){var s=o>=t*1.5;return Math.round(e/t)+" "+r+(s?"s":"")}});var P=w((it,ne)=>{l();function ke(e){t.debug=t,t.default=t,t.coerce=I,t.disable=c,t.enable=s,t.enabled=h,t.humanize=re(),t.destroy=ve,Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={};function o(n){let i=0;for(let u=0;u<n.length;u++)i=(i<<5)-i+n.charCodeAt(u),i|=0;return t.colors[Math.abs(i)%t.colors.length]}t.selectColor=o;function t(n){let i,u=null,$,K;function y(...m){if(!y.enabled)return;let b=y,k=Number(new Date),be=k-(i||k);b.diff=be,b.prev=i,b.curr=k,i=k,m[0]=t.coerce(m[0]),typeof m[0]!="string"&&m.unshift("%O");let A=0;m[0]=m[0].replace(/%([a-zA-Z%])/g,(D,we)=>{if(D==="%%")return"%";A++;let Z=t.formatters[we];if(typeof Z=="function"){let Fe=m[A];D=Z.call(b,Fe),m.splice(A,1),A--}return D}),t.formatArgs.call(b,m),(b.log||t.log).apply(b,m)}return y.namespace=n,y.useColors=t.useColors(),y.color=t.selectColor(n),y.extend=r,y.destroy=t.destroy,Object.defineProperty(y,"enabled",{enumerable:!0,configurable:!1,get:()=>u!==null?u:($!==t.namespaces&&($=t.namespaces,K=t.enabled(n)),K),set:m=>{u=m}}),typeof t.init=="function"&&t.init(y),y}function r(n,i){let u=t(this.namespace+(typeof i>"u"?":":i)+n);return u.log=this.log,u}function s(n){t.save(n),t.namespaces=n,t.names=[],t.skips=[];let i,u=(typeof n=="string"?n:"").split(/[\s,]+/),$=u.length;for(i=0;i<$;i++)!u[i]||(n=u[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(C),...t.skips.map(C).map(i=>"-"+i)].join(",");return t.enable(""),n}function h(n){if(n[n.length-1]==="*")return!0;let i,u;for(i=0,u=t.skips.length;i<u;i++)if(t.skips[i].test(n))return!1;for(i=0,u=t.names.length;i<u;i++)if(t.names[i].test(n))return!0;return!1}function C(n){return n.toString().substring(2,n.toString().length-2).replace(/\.\*\?$/,"*")}function I(n){return n instanceof Error?n.stack||n.message:n}function ve(){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}ne.exports=ke});var se=w((d,j)=>{l();d.formatArgs=Se;d.save=Te;d.load=je;d.useColors=Ae;d.storage=Me();d.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`."))}})();d.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 Ae(){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 Se(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+j.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)}d.log=console.debug||console.log||(()=>{});function Te(e){try{e?d.storage.setItem("debug",e):d.storage.removeItem("debug")}catch{}}function je(){let e;try{e=d.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Me(){try{return localStorage}catch{}}j.exports=P()(d);var{formatters:Le}=j.exports;Le.j=function(e){try{return JSON.stringify(e)}catch(o){return"[UnexpectedJSONParseError]: "+o.message}}});var ae=w((at,ie)=>{"use strict";l();ie.exports=(e,o=process.argv)=>{let t=e.startsWith("-")?"":e.length===1?"-":"--",r=o.indexOf(t+e),s=o.indexOf("--");return r!==-1&&(s===-1||r<s)}});var ue=w((ct,le)=>{"use strict";l();var Ve=E("os"),ce=E("tty"),g=ae(),{env:p}=process,v;g("no-color")||g("no-colors")||g("color=false")||g("color=never")?v=0:(g("color")||g("colors")||g("color=true")||g("color=always"))&&(v=1);"FORCE_COLOR"in p&&(p.FORCE_COLOR==="true"?v=1:p.FORCE_COLOR==="false"?v=0:v=p.FORCE_COLOR.length===0?1:Math.min(parseInt(p.FORCE_COLOR,10),3));function q(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function U(e,o){if(v===0)return 0;if(g("color=16m")||g("color=full")||g("color=truecolor"))return 3;if(g("color=256"))return 2;if(e&&!o&&v===void 0)return 0;let t=v||0;if(p.TERM==="dumb")return t;if(process.platform==="win32"){let r=Ve.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in p)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in p)||p.CI_NAME==="codeship"?1:t;if("TEAMCITY_VERSION"in p)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(p.TEAMCITY_VERSION)?1:0;if(p.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in p){let r=parseInt((p.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(p.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(p.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(p.TERM)||"COLORTERM"in p?1:t}function _e(e){let o=U(e,e&&e.isTTY);return q(o)}le.exports={supportsColor:_e,stdout:q(U(!0,ce.isatty(1))),stderr:q(U(!0,ce.isatty(2)))}});var fe=w((f,L)=>{l();var Ne=E("tty"),M=E("util");f.init=Ye;f.log=qe;f.formatArgs=Be;f.save=Ue;f.load=Ge;f.useColors=De;f.destroy=M.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");f.colors=[6,2,3,4,5,1];try{let e=ue();e&&(e.stderr||e).level>=2&&(f.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{}f.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 De(){return"colors"in f.inspectOpts?Boolean(f.inspectOpts.colors):Ne.isatty(process.stderr.fd)}function Be(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+"+L.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Pe()+o+" "+e[0]}function Pe(){return f.inspectOpts.hideDate?"":new Date().toISOString()+" "}function qe(...e){return process.stderr.write(M.format(...e)+`
4
- `)}function Ue(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function Ge(){return process.env.DEBUG}function Ye(e){e.inspectOpts={};let o=Object.keys(f.inspectOpts);for(let t=0;t<o.length;t++)e.inspectOpts[o[t]]=f.inspectOpts[o[t]]}L.exports=P()(f);var{formatters:pe}=L.exports;pe.o=function(e){return this.inspectOpts.colors=this.useColors,M.inspect(e,this.inspectOpts).split(`
5
- `).map(o=>o.trim()).join(" ")};pe.O=function(e){return this.inspectOpts.colors=this.useColors,M.inspect(e,this.inspectOpts)}});var de=w((lt,G)=>{l();typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?G.exports=se():G.exports=fe()});l();import Qe from"fs";import he from"path";import{exec as Xe}from"child_process";import et from"yargs";import tt from"open";import{build as ot}from"vite-ssg/node";import H from"consola";var S="0.0.7";l();var me=Q(de());import{dirname as ze,resolve as Y}from"path";var Je=(0,me.default)("valaxy:options");function He(e){return e.startsWith("/")||/^\.\.?[\/\\]/.test(e)}function We(e,o){return e?He(e)?Y(ze(o),e):B(`valaxy-theme-${e}/package.json`):""}async function z(e){let o=Y(B("valaxy/package.json"),"src/client"),t=Y(e.userRoot||process.cwd()),{config:r,configFile:s,theme:c}=await ee(e),h=We(c,t),C={clientRoot:o,userRoot:t,themeRoot:h,theme:c,config:r,configFile:s||""};return Je(C),C}l();import*as ge from"readline";import Ke from"path";import Ze from"os";import a from"chalk";import V from"consola";var _;function J(e,o,t){console.log(),console.log(` ${a.bold("\u{1F30C} Valaxy")} ${a.blue(`v${S}`)}`),console.log(),console.log(`${a.dim(" \u{1FA90} theme ")} > ${e.theme?a.green(e.theme):a.gray("none")}`),console.log(` ${a.dim("\u{1F4C1}")} ${a.dim(Ke.resolve(e.userRoot))}`),o&&(console.log(),console.log(`${a.dim(" Preview ")} > ${a.cyan(`http://localhost:${a.bold(o)}/`)}`),t&&Object.values(Ze.networkInterfaces()).forEach(r=>(r||[]).filter(s=>s.family==="IPv4"&&!s.address.includes("127.0.0.1")).forEach(({address:s})=>{console.log(`${a.dim(" Network ")} > ${a.blue(`http://${s}:${a.bold(o)}/`)}`)})),console.log(),console.log(`${a.dim(" shortcuts ")} > ${a.underline("r")}${a.dim("estart | ")}${a.underline("o")}${a.dim("pen | ")}${a.underline("e")}${a.dim("dit")}`)),console.log()}async function N(e,o){_&&await _.close();try{let t=X(e.config).concat(e.config.unocss.safelist||[]);_=await te(e,o,{onConfigReload(r,s){let c=!1;r.social.some((C,I)=>!t.includes(C.icon)&&C.icon!==s.social[I].icon)&&(V.info("Find new icon, reload server..."),V.info(`If you do not want to reload it, write icon name in ${a.green("config.unocss.safelist")}.`),V.info('For example: ["i-ri-cloud-line"]'),console.log(),c=!0),c&&N(e,o)}}),await _.listen()}catch(t){V.error(`failed to start server. error:
6
- `),console.error(t),process.exit(1)}}function Ce(e){process.stdin.resume(),process.stdin.setEncoding("utf8"),ge.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 W=et.scriptName("valaxy").usage("$0 [args]").version(S).showHelpOnFail(!1).alias("h","help").alias("v","version");W.command("* [root]","Start a local server for Valaxy",e=>ye(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})=>{Qe.existsSync(he.resolve(e,"pages"))||process.exit(0);let c=o||4859,h=await z({userRoot:e}),C={server:{watch:{ignored:[`!${h.themeRoot}/**`,`${h.userRoot}/**.md`]},port:c,strictPort:!0,open:t,host:r?"0.0.0.0":"localhost"},logLevel:s};await N(h,C),J(h,c,r),Ce([{name:"r",fullName:"restart",action(){N(h,C)}},{name:"o",fullName:"open",action(){tt(`http://localhost:${c}`)}},{name:"e",fullName:"edit",action(){Xe(`code "${e}"`)}}])});W.command("build [root]","build your blog to static content",e=>ye(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 z({userRoot:o});if(J(s),e){H.info("use vite-ssg to do ssg build...");try{await ot({mode:"production"})}catch(c){H.error("[vite-ssg] An internal error occurred."),console.log(c)}}else{let{build:c}=await Promise.resolve().then(()=>Q(E("../build-SG32QSQ3.mjs")));H.info("use vite do spa build..."),await c(s,{base:t,build:{emptyOutDir:!0,outDir:he.resolve(s.userRoot,r)}})}});function ye(e){return e.positional("root",{default:".",type:"string",describe:"root folder of your source files"})}function Tt(){W.help().parse()}export{Tt 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 _chunk7JDYOPIDjs = require('../chunk-7JDYOPID.js');require('../chunk-L5SNNWFJ.js');var _chunkL3EDI35Ijs = require('../chunk-L3EDI35I.js');_chunkL3EDI35Ijs.e.call(void 0, );exports.createServer = _chunk7JDYOPIDjs.a;
@@ -1 +0,0 @@
1
- import{a as r}from"../chunk-JJEBEWGI.mjs";import"../chunk-QI435Q25.mjs";import{e as o}from"../chunk-MVJUGWXR.mjs";o();export{r as createServer};
@@ -1,110 +0,0 @@
1
- export { S as SocialLink, U as UserConfig, V as ValaxyConfig, a as ValaxyThemeConfig, d as defaultValaxyConfig } from '../config-d6527c8c.js';
2
- import 'type-fest';
3
- import 'unocss/vite';
4
- import 'markdown-it';
5
- import 'markdown-it-anchor';
6
- import 'katex';
7
- import 'vite-plugin-md';
8
-
9
- interface Post {
10
- /**
11
- * Path of post
12
- * route.path
13
- * @description 路径
14
- */
15
- path?: string;
16
- /**
17
- * Title
18
- * @description 文章标题
19
- */
20
- title?: string;
21
- date?: string | number | Date;
22
- /**
23
- * Updated Time
24
- */
25
- updated?: string | number | Date;
26
- lang?: string;
27
- /**
28
- * TODO
29
- * Read Time
30
- * @description 阅读时长
31
- */
32
- duration?: string;
33
- /**
34
- * post card type, can be bilibili/yuque/...
35
- */
36
- type?: string;
37
- /**
38
- * override url, and jump directly
39
- */
40
- url?: string;
41
- /**
42
- * @description 摘要
43
- */
44
- excerpt?: string;
45
- /**
46
- * Display sponsor info
47
- * @description 是否开启赞助
48
- */
49
- sponsor?: boolean;
50
- /**
51
- * Copyright
52
- * @description 是否显示文章底部版权信息
53
- */
54
- copyright?: boolean;
55
- /**
56
- * Category
57
- * @description 分类,若为数组,则按顺序代表多层文件夹
58
- */
59
- categories?: string | string[];
60
- /**
61
- * Tags
62
- * @description 标签,可以有多个
63
- */
64
- tags?: string[];
65
- /**
66
- * display prev next
67
- * @description 是否显示前一篇、后一篇导航
68
- */
69
- nav?: boolean;
70
- /**
71
- * icon before title
72
- */
73
- icon?: string;
74
- /**
75
- * title color
76
- */
77
- color?: string;
78
- /**
79
- * display comment
80
- */
81
- comment?: boolean;
82
- /**
83
- * post is end
84
- * @description 是否完结,将在末尾添加衬线字体 Q.E.D.
85
- */
86
- end?: boolean;
87
- /**
88
- * use aplayer
89
- */
90
- aplayer?: boolean;
91
- /**
92
- * use katex
93
- */
94
- katex?: boolean;
95
- /**
96
- * use codepen
97
- */
98
- codepen?: boolean;
99
- /**
100
- * 置顶
101
- */
102
- top?: number;
103
- /**
104
- * display toc
105
- * @description 是否显示目录
106
- */
107
- toc?: boolean;
108
- }
109
-
110
- export { Post };
@@ -1 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkL3EDI35Ijs = require('../chunk-L3EDI35I.js');exports.defaultValaxyConfig = _chunkL3EDI35Ijs.f;
@@ -1 +0,0 @@
1
- import{f as a}from"../chunk-MVJUGWXR.mjs";export{a as defaultValaxyConfig};
package/src/core/index.ts DELETED
@@ -1,5 +0,0 @@
1
- export * from '../client/composables'
2
- export * from '../client/utils'
3
-
4
- export * from './config'
5
- export * from './utils'
package/src/core/utils.ts DELETED
@@ -1 +0,0 @@
1
- export const isDev = import.meta.env.DEV === true