fa-toolkit
Version:
a devtool for fast app
1 lines • 14.7 kB
JavaScript
"use strict";var _0x550c00=_0x2b2e;function _typeof(t){var r=_0x2b2e;return(_typeof="function"==typeof Symbol&&r(278)==typeof Symbol[r(196)]?function(t){return typeof t}:function(t){var e=r;return t&&e(313)==typeof Symbol&&t.constructor===Symbol&&t!==Symbol[e(209)]?e(278):typeof t})(t)}function _regeneratorRuntime(){var l=_0x2b2e;_regeneratorRuntime=function(){return u};var u={},t=Object[l(209)],c=t.hasOwnProperty,p=Object[l(306)]||function(t,e,r){t[e]=r[l(303)]},e=l(313)==typeof Symbol?Symbol:{},o=e[l(196)]||l(188),r=e.asyncIterator||l(283),n=e[l(191)]||l(210);function i(t,e,r){return Object[l(306)](t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{i({},"")}catch(t){i=function(t,e,r){return t[e]=r}}function s(t,e,r,n){var o,a,u,s,c,i=l,e=e&&e[i(209)]instanceof v?e:v,e=Object[i(284)](e[i(209)]),n=new P(n||[]);return p(e,i(206),{value:(o=t,a=r,u=n,c=(s=l)(224),function(t,e){var r=s;if(r(201)===c)throw new Error(r(249));if(r(287)===c){if(r(240)===t)throw e;return w()}for(u[r(305)]=t,u.arg=e;;){var n=u[r(315)];if(n){var i=function t(e,r){var n=l,i=r[n(305)],o=e.iterator[i];if(void 0===o)return r[n(315)]=null,n(240)===i&&e[n(196)][n(200)]&&(r[n(305)]=n(200),r.arg=void 0,t(e,r),n(240)===r.method)||n(200)!==i&&(r[n(305)]=n(240),r[n(293)]=new TypeError(n(213)+i+n(310))),h;o=f(o,e[n(196)],r[n(293)]);if("throw"===o[n(282)])return r[n(305)]="throw",r.arg=o[n(293)],r[n(315)]=null,h;var o=o[n(293)];return o?o[n(176)]?(r[e[n(225)]]=o[n(303)],r[n(194)]=e[n(227)],n(200)!==r[n(305)]&&(r[n(305)]=n(194),r.arg=void 0),r[n(315)]=null,h):o:(r[n(305)]="throw",r[n(293)]=new TypeError(n(198)),r[n(315)]=null,h)}(n,u);if(i){if(i===h)continue;return i}}if(r(194)===u[r(305)])u.sent=u._sent=u.arg;else if("throw"===u[r(305)]){if(r(224)===c)throw c=r(287),u[r(293)];u[r(214)](u[r(293)])}else r(200)===u[r(305)]&&u[r(244)]("return",u[r(293)]);c=r(201);i=f(o,a,u);if(r(252)===i.type){if(c=u[r(176)]?"completed":"suspendedYield",i[r(293)]===h)continue;return{value:i[r(293)],done:u[r(176)]}}r(240)===i[r(282)]&&(c=r(287),u.method=r(240),u[r(293)]=i.arg)}})}),e}function f(t,e,r){var n=l;try{return{type:n(252),arg:t[n(258)](e,r)}}catch(t){return{type:n(240),arg:t}}}u.wrap=s;var h={};function v(){}function a(){}function g(){}var _={};i(_,o,function(){return this});e=Object[l(250)],e=e&&e(e(j([])));e&&e!==t&&c[l(258)](e,o)&&(_=e);var d=g[l(209)]=v[l(209)]=Object[l(284)](_);function y(t){var e=l;[e(194),e(240),e(200)][e(309)](function(e){i(t,e,function(t){return this[_0x2b2e(206)](e,t)})})}function m(u,s){var e;p(this,"_invoke",{value:function(r,n){function t(){return new s(function(t,e){!function e(t,r,n,i){var o=_0x2b2e,t=f(u[t],u,r);if(o(240)!==t[o(282)]){var a=t.arg,r=a[o(303)];return r&&o(199)==_typeof(r)&&c[o(258)](r,o(220))?s[o(183)](r[o(220)])[o(177)](function(t){e(o(194),t,n,i)},function(t){e(o(240),t,n,i)}):s[o(183)](r)[o(177)](function(t){a[o(303)]=t,n(a)},function(t){return e(o(240),t,n,i)})}i(t.arg)}(r,n,t,e)})}return e=e?e[_0x2b2e(177)](t,t):t()}})}function b(t){var e=l,r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r[e(189)]=t[2],r[e(222)]=t[3]),this[e(180)][e(286)](r)}function x(t){var e=l,r=t[e(260)]||{};r[e(282)]="normal",delete r[e(293)],t[e(260)]=r}function P(t){var e=l;this[e(180)]=[{tryLoc:e(207)}],t.forEach(b,this),this[e(273)](!0)}function j(r){var n=l;if(r){var t=r[o];if(t)return t[n(258)](r);if(n(313)==typeof r[n(194)])return r;if(!isNaN(r[n(267)])){var i=-1,t=function t(){for(var e=n;++i<r[e(267)];)if(c[e(258)](r,i))return t[e(303)]=r[i],t[e(176)]=!1,t;return t[e(303)]=void 0,t[e(176)]=!0,t};return t[n(194)]=t}}return{next:w}}function w(){return{value:void 0,done:!0}}return a.prototype=g,p(d,l(296),{value:g,configurable:!0}),p(g,"constructor",{value:a,configurable:!0}),a[l(202)]=i(g,n,l(276)),u[l(238)]=function(t){var e=l,t="function"==typeof t&&t[e(296)];return!!t&&(t===a||e(276)===(t.displayName||t[e(235)]))},u[l(195)]=function(t){var e=l;return Object[e(203)]?Object[e(203)](t,g):(t[e(193)]=g,i(t,n,"GeneratorFunction")),t.prototype=Object[e(284)](d),t},u[l(271)]=function(t){return{__await:t}},y(m.prototype),i(m.prototype,r,function(){return this}),u[l(274)]=m,u[l(268)]=function(t,e,r,n,i){var o=l;void 0===i&&(i=Promise);var a=new m(s(t,e,r,n),i);return u.isGeneratorFunction(e)?a:a.next()[o(177)](function(t){var e=o;return t[e(176)]?t[e(303)]:a.next()})},y(d),i(d,n,l(221)),i(d,o,function(){return this}),i(d,l(320),function(){return"[object Generator]"}),u.keys=function(t){var e,n=l,i=Object(t),o=[];for(e in i)o[n(286)](e);return o.reverse(),function t(){for(var e=n;o.length;){var r=o[e(301)]();if(r in i)return t.value=r,t.done=!1,t}return t[e(176)]=!0,t}},u[l(312)]=j,P[l(209)]={constructor:P,reset:function(t){var e=l;if(this[e(277)]=0,this[e(194)]=0,this[e(297)]=this._sent=void 0,this[e(176)]=!1,this.delegate=null,this.method=e(194),this[e(293)]=void 0,this.tryEntries.forEach(x),!t)for(var r in this)"t"===r[e(232)](0)&&c[e(258)](this,r)&&!isNaN(+r.slice(1))&&(this[r]=void 0)},stop:function(){var t=l;this[t(176)]=!0;var e=this[t(180)][0][t(260)];if(t(240)===e[t(282)])throw e[t(293)];return this[t(184)]},dispatchException:function(n){var i=l;if(this[i(176)])throw n;var o=this;function t(t,e){var r=i;return a[r(282)]=r(240),a[r(293)]=n,o[r(194)]=t,e&&(o[r(305)]=r(194),o[r(293)]=void 0),!!e}for(var e=this.tryEntries[i(267)]-1;0<=e;--e){var r=this.tryEntries[e],a=r[i(260)];if(i(207)===r.tryLoc)return t(i(181));if(r.tryLoc<=this[i(277)]){var u=c[i(258)](r,"catchLoc"),s=c[i(258)](r,i(189));if(u&&s){if(this[i(277)]<r.catchLoc)return t(r[i(294)],!0);if(this[i(277)]<r[i(189)])return t(r[i(189)])}else if(u){if(this[i(277)]<r[i(294)])return t(r[i(294)],!0)}else{if(!s)throw new Error(i(279));if(this[i(277)]<r[i(189)])return t(r[i(189)])}}}},abrupt:function(t,e){for(var r=l,n=this[r(180)][r(267)]-1;0<=n;--n){var i=this[r(180)][n];if(i.tryLoc<=this[r(277)]&&c[r(258)](i,"finallyLoc")&&this.prev<i[r(189)]){var o=i;break}}var a=(o=o&&(r(290)===t||r(300)===t)&&o[r(205)]<=e&&e<=o.finallyLoc?null:o)?o[r(260)]:{};return a[r(282)]=t,a.arg=e,o?(this[r(305)]=r(194),this.next=o.finallyLoc,h):this[r(264)](a)},complete:function(t,e){var r=l;if(r(240)===t[r(282)])throw t[r(293)];return r(290)===t[r(282)]||r(300)===t[r(282)]?this[r(194)]=t.arg:"return"===t[r(282)]?(this.rval=this[r(293)]=t.arg,this[r(305)]=r(200),this[r(194)]="end"):r(252)===t[r(282)]&&e&&(this[r(194)]=e),h},finish:function(t){for(var e=l,r=this[e(180)][e(267)]-1;0<=r;--r){var n=this[e(180)][r];if(n.finallyLoc===t)return this.complete(n[e(260)],n[e(222)]),x(n),h}},catch:function(t){for(var e=l,r=this.tryEntries[e(267)]-1;0<=r;--r){var n=this.tryEntries[r];if(n[e(205)]===t){var i,o=n.completion;return e(240)===o.type&&(i=o[e(293)],x(n)),i}}throw new Error(e(243))},delegateYield:function(t,e,r){return this[l(315)]={iterator:j(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},u}function asyncGeneratorStep(t,e,r,n,i,o,a){var u=_0x2b2e;try{var s=t[o](a),c=s[u(303)]}catch(t){return void r(t)}s[u(176)]?e(c):Promise[u(183)](c)[u(177)](n,i)}function _asyncToGenerator(s){return function(){var t=this,u=arguments;return new Promise(function(e,r){var n=_0x2b2e,i=s[n(256)](t,u);function o(t){asyncGeneratorStep(i,e,r,o,a,"next",t)}function a(t){asyncGeneratorStep(i,e,r,o,a,n(240),t)}o(void 0)})}}!function(){for(var t=_0x2b2e,e=_0x2a51();;)try{if(892120==-parseInt(t(223))+-parseInt(t(323))/2+parseInt(t(292))/3+-parseInt(t(248))/4*(parseInt(t(261))/5)+-parseInt(t(187))/6*(parseInt(t(321))/7)+parseInt(t(322))/8+parseInt(t(174))/9*(parseInt(t(208))/10))break;e.push(e.shift())}catch(t){e.push(e.shift())}}();var fs=require("fs"),path=require(_0x550c00(266)),ZipPlugin=require(_0x550c00(269)),ScriptPlugin=require(_0x550c00(311)),FlLayoutResPlugin=require(_0x550c00(247)),ResourcePlugin=require(_0x550c00(216)),_require=require("./common/utils"),clearResource=_require[_0x550c00(295)],norpk=_require.norpk,IS_PRD=_require[_0x550c00(182)],projectPath=_require[_0x550c00(307)],signFlag=_require[_0x550c00(257)],getFlexibleCardManifestPath=_require[_0x550c00(265)],getFlexibleCfg=_require[_0x550c00(211)],isComboCard=_require[_0x550c00(298)],getPrivateKeyStr=_require[_0x550c00(218)],isPrivatePkg=_require.isPrivatePkg,utils=require("./fa-compiler/utils"),webpack=require("webpack"),LoggerPlugin=require(_0x550c00(246)),resolve=function(){var t=_0x550c00;return path[t(237)][t(256)](path,arguments)};process[_0x550c00(212)]=!0,global[_0x550c00(318)]=[];var rootDir=resolve(projectPath,_0x550c00(217)),signPath=resolve(projectPath,_0x550c00(285)),zipPath=resolve(projectPath,_0x550c00(179)),buildPath=resolve(projectPath,"build");function generatePlugins(t){return[new FlLayoutResPlugin({src:rootDir,output:zipPath,buildPath:buildPath}),new ResourcePlugin({src:rootDir,build:buildPath,manifest:t}),new webpack.LoaderOptionsPlugin({options:{srcPath:rootDir}}),new LoggerPlugin,new ScriptPlugin]}function generateModules(){var t=_0x550c00;return{rules:[{test:/\.js$/,use:[{loader:utils[t(319)](t(239)),options:{presets:utils.getBabelPresets(),plugins:[utils.loadBabelModule(t(190)),utils[t(319)](t(255)),utils[t(319)](t(236))],comments:!1}},{loader:path.resolve(__dirname,t(192))}]},{test:/\.(ux)(\?[^?]+)?$/,use:[{loader:path.resolve(__dirname,t(242))}]}]}}function generateResolves(){var t=_0x550c00,e=[path[t(237)](__dirname,"..",t(259)),path[t(237)](__dirname,"..","..","..",t(259)),t(259)];return isPrivatePkg()&&e[t(263)](1,1,path[t(237)](__dirname,"..","..","..","..",t(259))),{modules:e}}function checkEntryJson(e){var r=_0x550c00;try{JSON[r(234)](fs.readFileSync(e,r(204)))}catch(t){throw r(228)[r(280)](e)}}function getEntry(t){var p=_0x550c00,f={};return t[p(219)](function(t){var e=p,r=JSON[e(234)](fs[e(262)](t,e(204))),n=r.entry,i=r.type,o=r[e(253)],a=void 0===o?"":o,u=r[e(178)],s=void 0===u?"":u,c=r[e(245)],o=isComboCard(i),u=path[e(302)](t),i=path[e(237)]("build",path[e(317)](u)),t=path[e(237)](u,""[e(280)](n,".")[e(280)](o?e(316):"ux"));if(!fs[e(231)](t))throw"ERROR: Can not resolve file: ".concat(t);o?(c&&(f[path[e(237)](i,c)]={import:path.join(u,"".concat(c,".js")),library:{name:e(314),type:e(251)}}),_uselessAssets[e(286)]("".concat(path.join(i,n),e(291))),_uselessAssets[e(286)]("".concat(path.join(i,e(197)))),f[path[e(237)](i,"manifest")]=path[e(237)](u,"manifest.json"),checkEntryJson(t)):(l=path[e(237)](i,"".concat(n,"_script")),f[l]=path[e(237)](u,"".concat(n,e(308))),f=genI18nEntry(f,r,i,u));var l="".concat(t,e(186));r[e(175)]<1005?(f[path[e(237)](i,n)]=t,f["".concat(path[e(237)](i,n),e(288))]=l):f[path[e(237)](i,n)]=l,f=genDataJsonEntry(f,o?s:a,i,u)}),f}function genDataJsonEntry(t,e,r,n){var i=_0x550c00;return e&&Object[i(209)][i(320)][i(258)](e)===i(289)&&(t[r=path[i(237)](r,e)]?(t[""[i(280)](r,i(299))]=path[i(237)](n,""[i(280)](e,".json")),_uselessAssets.push("".concat(r,i(304)))):(t[r]=path[i(237)](n,""[i(280)](e,i(254))),_uselessAssets[i(286)](""[i(280)](r,i(291))))),t}function genI18nEntry(t,e,i,o){var a=_0x550c00,e=e[a(241)];if(utils.isEmptyObject(e)||utils[a(272)](e[a(230)]))return t;var u=e.support;return Object[a(281)](u)[a(229)](function(t,e){var r=a,n=path.join(o,u[e]);return fs[r(231)](n)&&(e=path[r(185)](u[e])[r(233)](/\.js$/g,""),t[e=path.join(i,e)]=n,_uselessAssets[r(286)]("".concat(e,".js"))),t},t)}function getWebpackCfg(t){return _getWebpackCfg[_0x550c00(256)](this,arguments)}function _0x2b2e(t,e){var r=_0x2a51();return(_0x2b2e=function(t,e){return r[t-=174]})(t,e)}function _0x2a51(){var t=["type","@@asyncIterator","create","sign","push","completed","_1005","[object String]","break",".js","1891413vNvuwl","arg","catchLoc","clearResource","constructor","sent","isComboCard","_json","continue","pop","dirname","value","_json.js","method","defineProperty","PROJECT_PATH",".ux?isScript=true","forEach","' method","./quickcard-compiler/script-plugin","values","function","__fl_module_exports__","delegate","json","basename","_uselessAssets","loadBabelModule","toString","7wjSPqK","9706184enMMhH","3241442xVRGTy","1251GjRIkr","minPlatformVersion","done","then","data","dist","tryEntries","end","IS_PRD","resolve","rval","normalize","?jsVm=true","2886546RhBkKy","@@iterator","finallyLoc","@babel/plugin-transform-modules-commonjs","toStringTag","quickcard-compiler/module-loader.js","__proto__","next","mark","iterator","manifest.js","iterator result is not an object","object","return","executing","displayName","setPrototypeOf","utf-8","tryLoc","_invoke","root","201750PTdSPo","prototype","@@toStringTag","getFlexibleCfg","noDeprecation","The iterator does not provide a '","dispatchException","none","./fa-compiler/resource-plugin","src","getPrivateKeyStr","map","__await","Generator","afterLoc","1003006iEfAZc","suspendedStart","resultName","exports","nextLoc","ERROR: The file format is incorrect: ","reduce","support","existsSync","charAt","replace","parse","name","@babel/plugin-proposal-object-rest-spread","join","isGeneratorFunction","babel-loader","throw","language","quickcard-compiler/loader.js","illegal catch attempt","abrupt","script","./common/logger-plugin","./quickcard-compiler/fllayout-res-plugin","2604524RwOizk","Generator is already running","getPrototypeOf","var","normal","testData",".json","@babel/plugin-proposal-class-properties","apply","signFlag","call","node_modules","completion","5VDTgNw","readFileSync","splice","complete","getFlexibleCardManifestPath","path","length","async","./quickcard-compiler/fa-zip-plugin","production","awrap","isEmptyObject","reset","AsyncIterator","stop","GeneratorFunction","prev","symbol","try statement without catch or finally","concat","keys"];return(_0x2a51=function(){return t})()}function _getWebpackCfg(){var t=_0x550c00;return(_getWebpackCfg=_asyncToGenerator(_regeneratorRuntime()[t(195)](function t(r){var n,i,o,a,u;return _regeneratorRuntime().wrap(function(t){for(var e=_0x2b2e;;)switch(t[e(277)]=t[e(194)]){case 0:return n={},t[e(194)]=3,clearResource([zipPath,buildPath]);case 3:if(i=getPrivateKeyStr(r),o=getEntry(getFlexibleCardManifestPath()),a=getFlexibleCfg().projectName||"dist",utils.isEmptyObject(o))throw"ERROR: The project structure is invalid.";t.next=8;break;case 8:return u={mode:e(270),devtool:!1,entry:o,output:{path:path[e(237)](projectPath),filename:"[name].js"},module:generateModules(),plugins:generatePlugins(n),node:{global:!1},stats:e(215),resolve:generateResolves(),optimization:{noEmitOnErrors:!1,minimize:!0}},norpk||u.plugins.push(new ZipPlugin({name:a,sourceRoot:rootDir,signRoot:signPath,output:zipPath,buildPath:buildPath,sign:signFlag,privateKeyStr:i,IS_PRD:IS_PRD})),t[e(244)](e(200),u);case 11:case e(181):return t[e(275)]()}},t)}))).apply(this,arguments)}module[_0x550c00(226)]=getWebpackCfg;