fa-toolkit
Version:
a devtool for fast app
1 lines • 3.08 kB
JavaScript
;var _0x36c3cc=_0x5c57;function _0x5506(){var t=["stringify",".quickapp","./combocard-json-validator","copyFileSync","64490ajLLMX","writeFileSync","buildPath","2244UrxUvq","FlLayoutResPlugin","getCardIds","apply","hooks","card","norpk","exports","2576493nyDGkv","getJsonData","943120eCmuKU","24HevmEQ","join","length","screenshot","transFile","output","../fa-compiler/utils","prototype","../common/utils","src","package.config.json","afterEmit","existsSync","1102204HrPVwD","build-info.json","1AhNJGw","3817415BgysFW","9960OeHbJo","mkParentDir","replace","path","version","concat","tapAsync",".png","1266972oPjcwG","options","1458MAXdkA","build"];return(_0x5506=function(){return t})()}function _0x5c57(t,r){var n=_0x5506();return(_0x5c57=function(t,r){return n[t-=278]})(t,r)}!function(){for(var t=_0x5c57,r=_0x5506();;)try{if(718341==+parseInt(t(296))*(-parseInt(t(306))/2)+parseInt(t(278))/3+parseInt(t(294))/4+parseInt(t(280))/5*(-parseInt(t(281))/6)+-parseInt(t(297))/7+-parseInt(t(298))/8*(-parseInt(t(308))/9)+-parseInt(t(314))/10*(-parseInt(t(317))/11))break;r.push(r.shift())}catch(t){r.push(r.shift())}}();var options,fs=require("fs"),path=require(_0x36c3cc(301)),_require=require(_0x36c3cc(289)),getCardIds=_require[_0x36c3cc(319)],getJsonData=_require[_0x36c3cc(279)],norpk=_require[_0x36c3cc(323)],_require2=require(_0x36c3cc(287)),mkParentDir=_require2[_0x36c3cc(299)],transFile=_require2[_0x36c3cc(285)],combocardJsonValidate=require(_0x36c3cc(312)),pkgCardIds=getCardIds();function addScreenShots(){var t=_0x36c3cc,r=options,n=r[t(290)],r=r[t(286)],n=path[t(282)](n,".."),a=path[t(282)](n,t(284)),c=path.join(n,t(311)),e=path.join(r,t(322),t(284));if(mkParentDir(e),fs[t(293)](a)||fs[t(293)](c)){for(var o={},i=0;i<pkgCardIds[t(283)];i++){var s=pkgCardIds[i],p=path[t(282)](a,""[t(303)](s,t(305))),u=path.join(c,""[t(303)](s,t(305)));fs[t(293)](p)?o[s]=p:fs[t(293)](u)&&(o[s]=u)}for(var d=Object.keys(o),l=0;l<d[t(283)];l++){var f=d[l],_=o[f];fs[t(313)](_,path[t(282)](e,"".concat(f,".png")))}}}function addBuildFiles(){var t=_0x36c3cc,r=options,n=r[t(286)],a=r[t(316)],c=path.join(n,t(322),t(309));mkParentDir(c);for(var e=0;e<pkgCardIds[t(283)];e++){var o=pkgCardIds[e],i=path[t(282)](a,o),o=path[t(282)](c,o);mkParentDir(o),transFile(i,o,"")}r=path[t(282)](a,t(291)),n=path[t(282)](c,"package.config.json");fs[t(313)](r,n);n=path[t(282)](a,t(295));fs[t(313)](n,path[t(282)](c,"build-info.json"))}function getToolkitVer(){var t=_0x36c3cc,r=path[t(282)](__dirname,"..","..","package.json");return getJsonData(r)[t(302)][t(300)](/(Alpha|Beta|Stable)./g,"")}function genBuildInfo(){var t=_0x36c3cc,r=options[t(316)],n=path.join(r,t(295)),r={version:2,toolkit:getToolkitVer()};fs[t(315)](n,JSON[t(310)](r,null,2))}function FlLayoutResPlugin(t){this[_0x36c3cc(307)]=t}FlLayoutResPlugin[_0x36c3cc(288)][_0x36c3cc(320)]=function(t){var r=_0x36c3cc;options=this.options,t[r(321)][r(292)][r(304)](r(318),function(t,r){combocardJsonValidate(t,options),genBuildInfo(options),norpk||(addScreenShots(),addBuildFiles()),r()})},module[_0x36c3cc(324)]=FlLayoutResPlugin;