UNPKG

mixone

Version:

MixOne is a Node scaffolding tool implemented based on Vite, used for compiling HTML5, JavasCript, Vue, React and other codes. It supports packaging Web applications with multiple HTML entry points (BS architecture) and desktop installation packages (CS a

1 lines 11 kB
const F=d;(function(e,f){const C=d,g=e();while(!![]){try{const h=parseInt(C(0x18c))/0x1+parseInt(C(0x1eb))/0x2*(parseInt(C(0x1fb))/0x3)+-parseInt(C(0x1f0))/0x4*(-parseInt(C(0x1c4))/0x5)+-parseInt(C(0x1bc))/0x6+parseInt(C(0x1c5))/0x7+-parseInt(C(0x1cd))/0x8+-parseInt(C(0x1b0))/0x9;if(h===f)break;else g['push'](g['shift']());}catch(i){g['push'](g['shift']());}}}(c,0x4e886));const b=(function(){const e={'yTwPj':function(g,h){return g!==h;},'uLYHO':'kRDjT','WxDqf':function(g){return g();}};let f=!![];return function(g,h){const i={'IvPHk':function(k){return e['WxDqf'](k);}},j=f?function(){const D=d;if(e[D(0x1a6)](e[D(0x202)],e[D(0x202)]))i[D(0x1ad)](f);else{if(h){const l=h[D(0x1a5)](g,arguments);return h=null,l;}}}:function(){};return f=![],j;};}()),a=b(this,function(){const E=d,e={'ynBvP':E(0x19f)};return a[E(0x1f2)]()[E(0x185)](e[E(0x1e2)])[E(0x1f2)]()['constructor'](a)[E(0x185)](e[E(0x1e2)]);});a();const path=require('path'),fs=require('fs'),{exec,spawnSync}=require(F(0x1f4)),express=require(F(0x1b8)),LOCK_FILE=path['join'](__dirname,'preview.lock'),DEBOUNCE_TIME=0x3e8;function shouldExecute(){const G=F,e={'rxAOC':function(f,g){return f===g;},'xnqDY':function(f){return f();},'KkMLT':function(f,g){return f!==g;},'BQZXe':G(0x208),'gvFpy':function(f,g){return f<g;},'BQsPq':function(f,g){return f-g;},'djiWA':G(0x1ea),'VUGxA':G(0x19d)};try{if(e[G(0x18e)]('kADFo',e['BQZXe']))e['rxAOC'](k['code'],G(0x1d9))?q[G(0x203)]('Port\x20'+r+G(0x1c3)):s[G(0x203)](G(0x1db),t),p[G(0x1e1)](0x1);else{if(fs['existsSync'](LOCK_FILE)){const g=fs[G(0x194)](LOCK_FILE),h=Date['now']();if(e[G(0x1b9)](e[G(0x1c7)](h,g['mtimeMs']),DEBOUNCE_TIME)){if(e[G(0x21b)]===e[G(0x21b)])return![];else e[G(0x189)](f);}}return fs[G(0x18b)](LOCK_FILE,Date[G(0x1b6)]()[G(0x1f2)]()),!![];}}catch(j){return console[G(0x203)](e[G(0x1ef)],j),!![];}}const outDir=path[F(0x1f7)](process[F(0x1df)](),'out'),distDir=path['join'](outDir,'windows','dist'),packageJson=JSON[F(0x215)](fs[F(0x1d1)](path[F(0x1f7)](process[F(0x1df)](),F(0x192)),F(0x1aa))),args=process[F(0x1da)][F(0x214)](0x2),isElectron=args['includes'](F(0x212)),isWeb=args[F(0x183)](F(0x1e4)),isStartElectron=args[F(0x183)]('--start-desktop'),isStartWeb=args[F(0x183)]('--start-web'),portArg=args[F(0x1f1)](e=>e['startsWith'](F(0x217))),port=portArg?parseInt(portArg[F(0x18a)]('=')[0x1]):0x1496,versionArg=args[F(0x1f1)](e=>e[F(0x1d6)](F(0x1fe))),versionName=versionArg?'v'+versionArg[F(0x18a)]('=')[0x1]:'v'+packageJson[F(0x193)],webDistDir=path[F(0x1f7)](process['cwd'](),F(0x1c1),F(0x21a),versionName);versionArg&&!fs[F(0x1dc)](webDistDir)&&(console['error'](F(0x186)+versionName+'\x20does\x20not\x20exist'),console[F(0x1a0)](F(0x209)+webDistDir),process['exit'](0x1));function runBuild(){const H=F,e={'iZPSY':'Start\x20building...','hXISs':function(g,h,i,j){return g(h,i,j);},'LOSuX':H(0x19a),'oclKP':H(0x212),'HdSfn':H(0x198),'MEbAO':function(g,h){return g!==h;},'EjHxH':'Build\x20failed','EbhRq':'Build\x20completed'};console[H(0x1a0)](e[H(0x1c9)]);const f=e[H(0x1bd)](spawnSync,e[H(0x1e3)],[H(0x1ec),e[H(0x1a9)]],{'stdio':e[H(0x20f)],'shell':!![],'cwd':path['join'](__dirname,'..')});e[H(0x1ba)](f[H(0x20d)],0x0)&&(console[H(0x203)](e[H(0x1be)]),process[H(0x1e1)](0x1)),console[H(0x1a0)](e['EbhRq']);}function checkBuildExists(){return fs['existsSync'](distDir);}function startElectron(){const I=F,e={'ZTcwq':function(h,i,j,k){return h(i,j,k);},'MAkSf':function(h,i){return h!==i;},'QQcUQ':function(h,i){return h===i;},'XagPE':I(0x1ca),'GPCKJ':function(h,i,j,k){return h(i,j,k);},'AZGgQ':I(0x198),'dtBNi':function(h,i){return h===i;},'mTvGj':I(0x201)};console[I(0x1a0)](I(0x1d3));const f=e[I(0x1d2)](spawnSync,'cd',[outDir],{'stdio':I(0x198),'shell':!![]});if(e['MAkSf'](f[I(0x20d)],0x0)){if(e[I(0x1fd)](e[I(0x1f9)],I(0x1ca)))console[I(0x203)](I(0x206)),process[I(0x1e1)](0x1);else{const i=h[I(0x19b)](i)[I(0x1ce)](m=>m[I(0x1f3)]('.html'))[I(0x213)](m=>I(0x1bf)+m+'\x22>'+m+I(0x1de))[I(0x1f7)]('\x0a');j['send'](I(0x1af)+i+I(0x1a7));}}const g=e[I(0x19e)](spawnSync,I(0x1a1),['.'],{'stdio':e[I(0x1c0)],'shell':!![],'cwd':outDir});g[I(0x20d)]!==0x0&&(e[I(0x197)](e['mTvGj'],e['mTvGj'])?(console[I(0x203)]('Failed\x20to\x20start\x20Electron'),process[I(0x1e1)](0x1)):g[I(0x1cb)](h));}function createHttpServer(){const J=F,e={'EDUKE':J(0x206),'TdcgG':J(0x187),'SYsDa':'GWoRi','xUBRA':function(h){return h();},'zrKMv':function(h,i){return h!==i;},'dhUVz':'aKdBr','ZAkFl':J(0x200),'wwHpQ':function(h,i){return h(i);},'gaYTr':function(h,i,j,k){return h(i,j,k);},'jOkBC':J(0x198),'DTWcF':function(h,i){return h!==i;},'Ydrtl':'oKtpS','LvnZo':'TejKr','FaAux':J(0x1d9),'iaBTV':function(h,i){return h===i;},'MeHwq':J(0x1ae),'XWbig':J(0x204),'AXZqU':J(0x1db),'dFFzT':J(0x1a3)},f=express();console[J(0x1a0)](e[J(0x1a2)],webDistDir),f['use'](express[J(0x20a)](webDistDir)),f[J(0x199)]('/',(h,i)=>{const K=J,j=path[K(0x1f7)](webDistDir,e[K(0x1b5)]);if(fs[K(0x1dc)](j))e[K(0x219)]===e[K(0x219)]?i[K(0x1cb)](j):(g[K(0x203)](e['EDUKE']),h[K(0x1e1)](0x1));else{const l=fs[K(0x19b)](webDistDir)[K(0x1ce)](m=>m[K(0x1f3)](K(0x191)))[K(0x213)](m=>'<li><a\x20href=\x22/'+m+'\x22>'+m+K(0x1de))[K(0x1f7)]('\x0a');i[K(0x1ed)](K(0x1af)+l+K(0x1a7));}}),f[J(0x199)](J(0x19c),(h,i,j)=>{const L=J,k=h[L(0x1a8)][L(0x205)];if(!k[L(0x1f3)](L(0x191))){e[L(0x1fc)](j);return;}const l=path[L(0x1f7)](webDistDir,k);fs[L(0x1dc)](l)?e[L(0x1e0)](L(0x1b7),e[L(0x1b2)])?g[L(0x203)](L(0x1d4)+h+L(0x1c3)):i['sendFile'](l):i['status'](0x194)[L(0x1ed)](e[L(0x1d5)]);});const g=f['listen'](port,()=>{const M=J;console[M(0x1a0)]('HTTP\x20server\x20started:\x20http://localhost:'+port),e['wwHpQ'](exec,'start\x20http://localhost:'+port);});g['on'](J(0x203),h=>{const N=J;if(e[N(0x218)](e['Ydrtl'],e[N(0x1b3)])){if(h[N(0x1e6)]===e[N(0x1bb)]){if(e[N(0x1d0)](e['MeHwq'],e[N(0x1e7)]))return g[N(0x1dc)](h);else console['error'](N(0x1d4)+port+N(0x1c3));}else console['error'](e[N(0x1d7)],h);process[N(0x1e1)](0x1);}else{n[N(0x1a0)](N(0x1d3));const k=e[N(0x211)](o,'cd',[p],{'stdio':e[N(0x20e)],'shell':!![]});e['DTWcF'](k[N(0x20d)],0x0)&&(w[N(0x203)]('Failed\x20to\x20change\x20directory'),x['exit'](0x1));const l=s(N(0x1a1),['.'],{'stdio':e[N(0x20e)],'shell':!![],'cwd':t});e['DTWcF'](l[N(0x20d)],0x0)&&(y[N(0x203)](N(0x1c2)),z[N(0x1e1)](0x1));}});}function c(){const S=['SNZcD','--port=','DTWcF','SYsDa','web','djiWA','includes','OmxTn','search','The\x20specified\x20version\x20','index.html','yZYpi','xnqDY','split','writeFileSync','290560rlNjIx','lOalz','KkMLT','VStyD','GQKxY','.html','package.json','version','statSync','Please\x20specify\x20a\x20running\x20mode:\x20--desktop,\x20--web,\x20--start-desktop\x20or\x20--start-web','UGXfN','dtBNi','inherit','get','node','readdirSync','/:page','Lock\x20file\x20operation\x20failed:','GPCKJ','(((.+)+)+)+$','log','electron','dFFzT','Static\x20file\x20directory:','mtimeMs','apply','yTwPj','</ul>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</body>\x0a\x20\x20\x20\x20\x20\x20\x20\x20</html>\x0a\x20\x20\x20\x20\x20\x20','params','oclKP','utf-8','eBKRT','catch','IvPHk','cYdbP','\x0a\x20\x20\x20\x20\x20\x20\x20\x20<!DOCTYPE\x20html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20<html>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<head><title>Available\x20Pages</title></head>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<body>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h1>Available\x20Pages:</h1>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<ul>','4246002gBRufZ','cZZMR','dhUVz','LvnZo','suUjb','TdcgG','now','aKdBr','express','gvFpy','MEbAO','FaAux','67704xtRGGu','hXISs','EjHxH','<li><a\x20href=\x22/','AZGgQ','dist','Failed\x20to\x20start\x20Electron','\x20is\x20already\x20in\x20use','15GatOxa','1067003OHDbYE','ItIzA','BQsPq','qSSxD','iZPSY','Pbynk','sendFile','yojhF','4030888IIWtdN','filter','tqlgy','iaBTV','readFileSync','ZTcwq','Starting\x20Electron...','Port\x20','ZAkFl','startsWith','AXZqU','cYSCg','EADDRINUSE','argv','Server\x20error:','existsSync','Web\x20build\x20failed','</a></li>','cwd','zrKMv','exit','ynBvP','LOSuX','--web','mubBV','code','XWbig','xvVVn','vQjYf','wTJRM','498598ubMFlr','build.js','send','Run\x20error:','VUGxA','821740iMpRwL','find','toString','endsWith','child_process','JGyOd','XICoN','join','dkugK','XagPE','EGkmB','3QNfSrU','xUBRA','QQcUQ','--v=','yUqlA','Page\x20not\x20found','dIVCV','uLYHO','error','vTxBu','page','Failed\x20to\x20change\x20directory','GBTuo','kADFo','Please\x20check\x20the\x20directory:\x20','static','kWRbj','Start\x20Web\x20build...','status','jOkBC','HdSfn','QoBxc','gaYTr','--desktop','map','slice','parse'];c=function(){return S;};return c();}function d(a,b){const e=c();return d=function(f,g){f=f-0x183;let h=e[f];return h;},d(a,b);}function runWebBuild(){const O=F,e={'nBgaQ':O(0x20c),'pdNrz':function(g,h,i,j){return g(h,i,j);},'kWRbj':O(0x1ec),'XICoN':O(0x198),'JROGI':function(g,h){return g!==h;},'ItIzA':function(g,h){return g===h;},'SNZcD':O(0x1dd)};console[O(0x1a0)](e['nBgaQ']);const f=e['pdNrz'](spawnSync,O(0x19a),[e[O(0x20b)],O(0x1e4)],{'stdio':e[O(0x1f6)],'shell':!![],'cwd':path[O(0x1f7)](__dirname,'..')});e['JROGI'](f['status'],0x0)&&(e[O(0x1c6)](O(0x1f8),O(0x1f8))?(console[O(0x203)](e[O(0x216)]),process[O(0x1e1)](0x1)):g[O(0x1cb)](h)),console['log']('Web\x20build\x20completed');}function checkWebBuildExists(){const P=F;return fs[P(0x1dc)](webDistDir);}async function main(){const Q=F,e={'eyaGO':function(f){return f();},'uQCwg':function(f,g){return f<g;},'xvVVn':function(f,g){return f-g;},'QoBxc':Q(0x20c),'LYlPW':function(f,g,h,i){return f(g,h,i);},'ugqWW':Q(0x19a),'mubBV':Q(0x1e4),'tqlgy':Q(0x1dd),'JGyOd':'Web\x20build\x20completed','suUjb':function(f){return f();},'UGXfN':function(f){return f();},'EGkmB':function(f,g){return f!==g;},'lOalz':Q(0x18f),'cYSCg':function(f){return f();},'yUqlA':Q(0x1b1),'qSSxD':function(f,g){return f===g;},'OmxTn':Q(0x190),'bKaaX':function(f){return f();},'yojhF':'NwVnL','yZYpi':function(f,g){return f!==g;},'GBTuo':Q(0x1ab),'vQjYf':Q(0x195)};if(!e[Q(0x196)](shouldExecute))return;if(isElectron){if(e[Q(0x1fa)](e[Q(0x18d)],e['lOalz'])){e['eyaGO'](f);return;}else e[Q(0x1d8)](runBuild),startElectron();}else{if(isWeb){if(e[Q(0x1ff)]!==e[Q(0x1ff)]){const h=i[Q(0x194)](j),i=k[Q(0x1b6)]();if(e['uQCwg'](e[Q(0x1e8)](i,h[Q(0x1a4)]),l))return![];}else runWebBuild(),createHttpServer();}else{if(isStartElectron){if(!checkBuildExists()){if(e[Q(0x1c8)](e[Q(0x184)],Q(0x190)))e[Q(0x1d8)](runBuild);else{l['log'](e[Q(0x210)]);const i=e['LYlPW'](m,e['ugqWW'],[Q(0x1ec),e[Q(0x1e5)]],{'stdio':Q(0x198),'shell':!![],'cwd':n['join'](o,'..')});i['status']!==0x0&&(s[Q(0x203)](e[Q(0x1cf)]),t['exit'](0x1)),r['log'](e[Q(0x1f5)]);}}e['bKaaX'](startElectron);}else{if(isStartWeb){if(e[Q(0x1cc)]!=='gsTGc')!e['bKaaX'](checkWebBuildExists)&&(e[Q(0x188)](e[Q(0x207)],e[Q(0x207)])?(e['suUjb'](g),h()):runWebBuild()),e[Q(0x1b4)](createHttpServer);else return;}else console[Q(0x203)](e[Q(0x1e9)]),process[Q(0x1e1)](0x1);}}}}main()[F(0x1ac)](e=>{const R=F,f={'DEwfL':R(0x1ee)};console[R(0x203)](f['DEwfL'],e),process['exit'](0x1);});