@lovrabet/cli 1.2.5-beta.3 → 1.2.5-beta.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/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/ai-setup/AISetupUI.js +1 -1
- package/lib/ai-setup/config.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/skills/SkillInstallUI.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x7a12c7=a61_0x2e51;(function(_0x2af4ba,_0x43d4ea){const _0x4a30c5=a61_0x2e51,_0x3174d1=_0x2af4ba();while(!![]){try{const _0x40ee17=-parseInt(_0x4a30c5(0x1b9))/0x1*(-parseInt(_0x4a30c5(0x1b2))/0x2)+-parseInt(_0x4a30c5(0x1bc))/0x3+-parseInt(_0x4a30c5(0x1b4))/0x4+-parseInt(_0x4a30c5(0x1bb))/0x5+-parseInt(_0x4a30c5(0x1bd))/0x6+parseInt(_0x4a30c5(0x1b5))/0x7+parseInt(_0x4a30c5(0x1b8))/0x8*(parseInt(_0x4a30c5(0x1b3))/0x9);if(_0x40ee17===_0x43d4ea)break;else _0x3174d1['push'](_0x3174d1['shift']());}catch(_0x4e3e55){_0x3174d1['push'](_0x3174d1['shift']());}}}(a61_0x58d3,0xf1a37));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';function a61_0x58d3(){const _0x5ee5d9=['6444318leVbMU','.lovrabetrc','string','app','parse','2734598ibOoov','5823AQorcw','2378624HprDEi','8709610xCKmhX','appcode','cwd','37272OqwctK','1cFdQQe','utf8','9622570aRuBuE','3128784tkfGvE'];a61_0x58d3=function(){return _0x5ee5d9;};return a61_0x58d3();}import{homedir}from'node:os';export const projectConfigPath=resolve(process[a61_0x7a12c7(0x1b7)](),a61_0x7a12c7(0x1be));function a61_0x2e51(_0x5ac97c,_0x5f5b97){_0x5ac97c=_0x5ac97c-0x1b0;const _0x58d3f8=a61_0x58d3();let _0x2e516a=_0x58d3f8[_0x5ac97c];return _0x2e516a;}export const globalConfigPath=resolve(homedir(),a61_0x7a12c7(0x1be));export function readConfig(_0x491fb5){const _0xdb14e7=a61_0x7a12c7;let _0x384546={};try{if(existsSync(globalConfigPath)){const _0x4e704e=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x4e704e&&(_0x384546=JSON[_0xdb14e7(0x1b1)](_0x4e704e));}}catch(_0x499309){}try{const _0x5c78f6=_0x491fb5?resolve(_0x491fb5,_0xdb14e7(0x1be)):projectConfigPath;if(existsSync(_0x5c78f6)){const _0x2ba46a=readFileSync(_0x5c78f6,{'encoding':_0xdb14e7(0x1ba)});if(_0x2ba46a){const _0x105492=JSON[_0xdb14e7(0x1b1)](_0x2ba46a);_0x384546={..._0x384546,..._0x105492};}}}catch(_0x31b689){}return _0x384546;}export function getConfigAppCode(){const _0x2722c0=a61_0x7a12c7;let _0x1d5843={},_0x2ca804={};try{if(existsSync(globalConfigPath)){const _0x459f66=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x459f66&&(_0x2ca804=JSON[_0x2722c0(0x1b1)](_0x459f66));}}catch(_0x3d89f0){}try{if(existsSync(projectConfigPath)){const _0x2af9ba=readFileSync(projectConfigPath,{'encoding':_0x2722c0(0x1ba)});_0x2af9ba&&(_0x1d5843=JSON[_0x2722c0(0x1b1)](_0x2af9ba));}}catch(_0x4a2865){}let _0x309b46;if(_0x2722c0(0x1b6)in _0x1d5843)_0x309b46=_0x1d5843[_0x2722c0(0x1b6)];else{if(_0x2722c0(0x1b0)in _0x1d5843)_0x309b46=_0x1d5843['app'];else{if(_0x2722c0(0x1b6)in _0x2ca804)_0x309b46=_0x2ca804['appcode'];else _0x2722c0(0x1b0)in _0x2ca804&&(_0x309b46=_0x2ca804[_0x2722c0(0x1b0)]);}}if(typeof _0x309b46!==_0x2722c0(0x1bf)||_0x309b46['trim']()==='')return undefined;return _0x309b46;}export function isInProject(){return existsSync(projectConfigPath);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x56a667,_0x1117ed){const _0x16dcbb=a62_0x1993,_0x1da45e=_0x56a667();while(!![]){try{const _0x3f2770=-parseInt(_0x16dcbb(0x11e))/0x1+-parseInt(_0x16dcbb(0x11a))/0x2+parseInt(_0x16dcbb(0x11d))/0x3*(-parseInt(_0x16dcbb(0x117))/0x4)+parseInt(_0x16dcbb(0x121))/0x5+parseInt(_0x16dcbb(0x122))/0x6+parseInt(_0x16dcbb(0x11c))/0x7*(parseInt(_0x16dcbb(0x115))/0x8)+-parseInt(_0x16dcbb(0x123))/0x9*(-parseInt(_0x16dcbb(0x124))/0xa);if(_0x3f2770===_0x1117ed)break;else _0x1da45e['push'](_0x1da45e['shift']());}catch(_0x5e3267){_0x1da45e['push'](_0x1da45e['shift']());}}}(a62_0x3b2b,0x7d184));import a62_0x19276e from'node:path';function a62_0x1993(_0x12a6d6,_0x2414d4){_0x12a6d6=_0x12a6d6-0x115;const _0x3b2b63=a62_0x3b2b();let _0x199340=_0x3b2b63[_0x12a6d6];return _0x199340;}import a62_0x31bd14 from'node:fs';export async function copyDirectory(_0x3ff81e,_0x4b3397){const _0x45bda7=a62_0x1993;try{const _0x932c5e=a62_0x31bd14[_0x45bda7(0x11b)](_0x3ff81e,{'withFileTypes':!![]});a62_0x31bd14[_0x45bda7(0x120)](_0x4b3397,{'recursive':!![]});for(const _0x5e20ad of _0x932c5e){const _0x15ef22=a62_0x19276e[_0x45bda7(0x118)](_0x3ff81e,_0x5e20ad[_0x45bda7(0x116)]),_0x3f691c=a62_0x19276e[_0x45bda7(0x118)](_0x4b3397,_0x5e20ad[_0x45bda7(0x116)]);_0x5e20ad[_0x45bda7(0x119)]()?await copyDirectory(_0x15ef22,_0x3f691c):a62_0x31bd14['copyFileSync'](_0x15ef22,_0x3f691c);}}catch(_0x542031){console[_0x45bda7(0x11f)]('复制目录时出错:',_0x542031);}}function a62_0x3b2b(){const _0x326f40=['4104636bvVrqp','7596ijDfhF','1490kzSwvX','2733712cDDmTc','name','1108SgfSyT','join','isDirectory','1686318cHSZKj','readdirSync','7sVbmyT','654eyihaP','246246eQtzFM','error','mkdirSync','2553015BuaDAn'];a62_0x3b2b=function(){return _0x326f40;};return a62_0x3b2b();}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x47b436,_0x222f32){const _0xcdc024=a63_0x3f9c,_0x30bc8e=_0x47b436();while(!![]){try{const _0x5468dc=parseInt(_0xcdc024(0xb5))/0x1+parseInt(_0xcdc024(0xba))/0x2*(parseInt(_0xcdc024(0xbd))/0x3)+parseInt(_0xcdc024(0xa5))/0x4+-parseInt(_0xcdc024(0xa3))/0x5+-parseInt(_0xcdc024(0xb1))/0x6+parseInt(_0xcdc024(0xab))/0x7+parseInt(_0xcdc024(0xa6))/0x8*(parseInt(_0xcdc024(0xae))/0x9);if(_0x5468dc===_0x222f32)break;else _0x30bc8e['push'](_0x30bc8e['shift']());}catch(_0x2165dd){_0x30bc8e['push'](_0x30bc8e['shift']());}}}(a63_0x2d18,0x3f04e));function a63_0x3f9c(_0x5df391,_0x1e1cac){_0x5df391=_0x5df391-0xa2;const _0x2d1874=a63_0x2d18();let _0x3f9c77=_0x2d1874[_0x5df391];return _0x3f9c77;}export async function httpRequest(_0x1b37e5,_0x284af0={}){const _0x55d194=a63_0x3f9c,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x284af0;let _0x406121=null;for(let _0x22722c=0x0;_0x22722c<=retries;_0x22722c++){try{const _0x356035=new AbortController(),_0x15093d=setTimeout(()=>_0x356035[_0x55d194(0xb8)](),timeout),_0x2e13e5=await fetch(_0x1b37e5,{'headers':headers,'signal':_0x356035[_0x55d194(0xac)]});clearTimeout(_0x15093d);let _0x4af9f7;const _0x4e199d=_0x2e13e5['headers'][_0x55d194(0xaa)]('content-type');return _0x4e199d?.[_0x55d194(0xb0)](_0x55d194(0xa9))?_0x4af9f7=await _0x2e13e5[_0x55d194(0xbe)]():_0x4af9f7=await _0x2e13e5[_0x55d194(0xbb)](),{'ok':_0x2e13e5['ok'],'status':_0x2e13e5[_0x55d194(0xbf)],'statusText':_0x2e13e5['statusText'],'data':_0x4af9f7,'headers':_0x2e13e5[_0x55d194(0xa4)],'url':_0x2e13e5[_0x55d194(0xb4)],'text':()=>_0x2e13e5[_0x55d194(0xbb)]()};}catch(_0x19e197){_0x406121=_0x19e197 instanceof Error?_0x19e197:new Error(String(_0x19e197));if(_0x22722c===retries)break;if(shouldRetry(_0x19e197)){console[_0x55d194(0xaf)](_0x55d194(0xb3)+retryDelay+_0x55d194(0xb9)+(_0x22722c+0x1)+_0x55d194(0xad)),await sleep(retryDelay);continue;}else break;}}throw _0x406121||new Error(_0x55d194(0xb6));}function shouldRetry(_0x569c29){const _0x3f3689=a63_0x3f9c;if(_0x569c29 instanceof Error){if(_0x569c29['name']===_0x3f3689(0xb7))return![];if(_0x569c29[_0x3f3689(0xa7)]===_0x3f3689(0xa8)&&_0x569c29[_0x3f3689(0xbc)][_0x3f3689(0xb0)](_0x3f3689(0xb2)))return!![];if(_0x569c29[_0x3f3689(0xbc)][_0x3f3689(0xb0)]('ECONNRESET'))return!![];if(_0x569c29[_0x3f3689(0xbc)][_0x3f3689(0xb0)](_0x3f3689(0xa2)))return![];}return![];}function sleep(_0x469ab0){return new Promise(_0x13d336=>setTimeout(_0x13d336,_0x469ab0));}function a63_0x2d18(){const _0x2daeaf=['abort','ms\x20后进行第\x20','2DXOrst','text','message','288696WwLUmC','json','status','ENOTFOUND','1736305JWEZyB','headers','752964HjHtdV','11768IjyIyf','name','TypeError','application/json','get','2253195RRLkue','signal','\x20次重试...','477tLpOKJ','log','includes','631392itRocr','fetch','*\x20请求失败,','url','26298QIiUVI','Request\x20failed','AbortError'];a63_0x2d18=function(){return _0x2daeaf;};return a63_0x2d18();}export function validateUrl(_0x55b7ef){try{return new URL(_0x55b7ef),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a64_0x2ad189=a64_0x3c56;(function(_0x4b1f41,_0x4c65a1){const _0x2ed2a0=a64_0x3c56,_0x780006=_0x4b1f41();while(!![]){try{const _0x93b9fc=-parseInt(_0x2ed2a0(0x12b))/0x1*(parseInt(_0x2ed2a0(0x13a))/0x2)+-parseInt(_0x2ed2a0(0x141))/0x3+-parseInt(_0x2ed2a0(0x12d))/0x4+-parseInt(_0x2ed2a0(0x133))/0x5+-parseInt(_0x2ed2a0(0x151))/0x6*(parseInt(_0x2ed2a0(0x152))/0x7)+-parseInt(_0x2ed2a0(0x13b))/0x8+-parseInt(_0x2ed2a0(0x134))/0x9*(-parseInt(_0x2ed2a0(0x13e))/0xa);if(_0x93b9fc===_0x4c65a1)break;else _0x780006['push'](_0x780006['shift']());}catch(_0x488933){_0x780006['push'](_0x780006['shift']());}}}(a64_0x41ed,0x82766));import a64_0xf53339 from'winston';function a64_0x41ed(){const _0x26e658=['4191940WpdmyG','12141OndDXF','logTask','rawCommand','command','existsSync','stringify','1120qTNgvX','6575216eaBIya','error','parse','33730nOoWgW','clearLogs','timestamp','2105718xqUBFp','success','red','开始执行:\x20','now','join','失败:\x20','File','initWinstonLogger','clear','mkdirSync','writeFileSync','setLogPath','transports','toISOString','currentRawCommand','251730WIIgMm','133qhjKGl','duration','green','logFilePath','message','createLogger','getWinstonInstance','readLogs','winstonLogger','utf8','format','info','filter','combine','.lovrabet.log','level','yellow','577oSKMXJ','log','2133368CvTLOG','warn','errors','dirname','details','trim'];a64_0x41ed=function(){return _0x26e658;};return a64_0x41ed();}import a64_0x2d6527 from'node:fs';import a64_0x272e2e from'node:path';function a64_0x3c56(_0x318cce,_0xc3ead4){_0x318cce=_0x318cce-0x123;const _0x41edfc=a64_0x41ed();let _0x3c56f1=_0x41edfc[_0x318cce];return _0x3c56f1;}class Logger{[a64_0x2ad189(0x15a)];[a64_0x2ad189(0x155)];[a64_0x2ad189(0x150)]='';constructor(){const _0x5e9e23=a64_0x2ad189;this[_0x5e9e23(0x155)]='';}['setRawCommand'](_0x38b45b){const _0x52dde9=a64_0x2ad189;this[_0x52dde9(0x150)]=_0x38b45b;}[a64_0x2ad189(0x149)](){const _0x3d1093=a64_0x2ad189,_0x24f429=a64_0x272e2e[_0x3d1093(0x130)](this[_0x3d1093(0x155)]);!a64_0x2d6527[_0x3d1093(0x138)](_0x24f429)&&a64_0x2d6527[_0x3d1093(0x14b)](_0x24f429,{'recursive':!![]});const _0x52edb8=a64_0xf53339[_0x3d1093(0x124)][_0x3d1093(0x127)](a64_0xf53339[_0x3d1093(0x124)][_0x3d1093(0x140)](),a64_0xf53339[_0x3d1093(0x124)][_0x3d1093(0x12f)]({'stack':!![]}),a64_0xf53339[_0x3d1093(0x124)]['printf'](_0x31109c=>{const _0x240d65=_0x3d1093,_0x3564a7={'timestamp':_0x31109c[_0x240d65(0x140)]||new Date()[_0x240d65(0x14f)](),'level':_0x31109c[_0x240d65(0x129)]||'info','command':_0x31109c[_0x240d65(0x137)]||'unknown','rawCommand':_0x31109c[_0x240d65(0x136)]||this['currentRawCommand']||undefined,'message':_0x31109c[_0x240d65(0x156)]||'','duration':_0x31109c[_0x240d65(0x153)]||undefined,'details':_0x31109c[_0x240d65(0x131)]||undefined};return JSON[_0x240d65(0x139)](_0x3564a7);}));this[_0x3d1093(0x15a)]=a64_0xf53339[_0x3d1093(0x157)]({'level':_0x3d1093(0x125),'format':_0x52edb8,'transports':[new a64_0xf53339[(_0x3d1093(0x14e))][(_0x3d1093(0x148))]({'filename':this[_0x3d1093(0x155)],'level':'info'})],'silent':![]}),a64_0xf53339['addColors']({'success':_0x3d1093(0x154),'error':_0x3d1093(0x143),'warn':_0x3d1093(0x12a),'info':'blue'});}[a64_0x2ad189(0x14d)](_0x43383d){const _0x2ff6a2=a64_0x2ad189;this['logFilePath']=a64_0x272e2e[_0x2ff6a2(0x146)](_0x43383d,_0x2ff6a2(0x128)),this['winstonLogger']&&this[_0x2ff6a2(0x15a)][_0x2ff6a2(0x14a)](),this[_0x2ff6a2(0x149)]();}[a64_0x2ad189(0x125)](_0xea115,_0x489eaf,_0xb441f7){const _0x567752=a64_0x2ad189;if(!this[_0x567752(0x155)]||!this[_0x567752(0x15a)])return;this[_0x567752(0x15a)][_0x567752(0x125)](_0x489eaf,{'command':_0xea115,'details':_0xb441f7});}[a64_0x2ad189(0x142)](_0x474d72,_0x36c3f9,_0x59ac51,_0x1707f5){const _0x578d7c=a64_0x2ad189;if(!this[_0x578d7c(0x155)]||!this[_0x578d7c(0x15a)])return;this[_0x578d7c(0x15a)][_0x578d7c(0x12c)](_0x578d7c(0x125),_0x36c3f9,{'level':_0x578d7c(0x142),'command':_0x474d72,'duration':_0x59ac51,'details':_0x1707f5});}[a64_0x2ad189(0x13c)](_0x20e0d1,_0x1e0497,_0x645b9e){const _0x445586=a64_0x2ad189;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x445586(0x15a)][_0x445586(0x13c)](_0x1e0497,{'command':_0x20e0d1,'details':_0x645b9e});}[a64_0x2ad189(0x12e)](_0xec9b2e,_0x5f684b,_0x508cb0){const _0x59b7c7=a64_0x2ad189;if(!this[_0x59b7c7(0x155)]||!this[_0x59b7c7(0x15a)])return;this[_0x59b7c7(0x15a)][_0x59b7c7(0x12e)](_0x5f684b,{'command':_0xec9b2e,'details':_0x508cb0});}async[a64_0x2ad189(0x135)](_0x43e7d2,_0x5c5b53,_0x239c9b){const _0x37eac1=a64_0x2ad189,_0x474d9c=Date['now']();this[_0x37eac1(0x125)](_0x43e7d2,_0x37eac1(0x144)+_0x5c5b53);try{const _0x2c7801=await _0x239c9b(),_0x9b60a2=Date[_0x37eac1(0x145)]()-_0x474d9c;return this[_0x37eac1(0x142)](_0x43e7d2,'完成:\x20'+_0x5c5b53,_0x9b60a2),_0x2c7801;}catch(_0x4b0d28){const _0x5cc4ce=Date[_0x37eac1(0x145)]()-_0x474d9c;this['error'](_0x43e7d2,_0x37eac1(0x147)+_0x5c5b53,{'error':_0x4b0d28 instanceof Error?_0x4b0d28[_0x37eac1(0x156)]:String(_0x4b0d28),'duration':_0x5cc4ce});throw _0x4b0d28;}}[a64_0x2ad189(0x159)](){const _0x55c621=a64_0x2ad189;try{if(!a64_0x2d6527[_0x55c621(0x138)](this['logFilePath']))return[];const _0x1c1d05=a64_0x2d6527['readFileSync'](this[_0x55c621(0x155)],_0x55c621(0x123));return _0x1c1d05['split']('\x0a')[_0x55c621(0x126)](_0x5bd0ff=>_0x5bd0ff[_0x55c621(0x132)]())['map'](_0x59ab42=>JSON[_0x55c621(0x13d)](_0x59ab42));}catch(_0x174029){return console[_0x55c621(0x12e)]('Failed\x20to\x20read\x20logs:',_0x174029),[];}}[a64_0x2ad189(0x13f)](){const _0x17593d=a64_0x2ad189;try{a64_0x2d6527[_0x17593d(0x138)](this[_0x17593d(0x155)])&&a64_0x2d6527[_0x17593d(0x14c)](this['logFilePath'],'',_0x17593d(0x123));}catch(_0x360385){console[_0x17593d(0x12e)]('Failed\x20to\x20clear\x20logs:',_0x360385);}}[a64_0x2ad189(0x158)](){return this['winstonLogger'];}}export const logger=new Logger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a65_0x93e6af=a65_0x12b5;(function(_0x8f007c,_0x382385){const _0x2768ec=a65_0x12b5,_0x2803ca=_0x8f007c();while(!![]){try{const _0x338b2d=parseInt(_0x2768ec(0xd5))/0x1*(-parseInt(_0x2768ec(0xd8))/0x2)+-parseInt(_0x2768ec(0xf9))/0x3*(-parseInt(_0x2768ec(0xf5))/0x4)+-parseInt(_0x2768ec(0xd7))/0x5+-parseInt(_0x2768ec(0xf2))/0x6*(parseInt(_0x2768ec(0xd6))/0x7)+-parseInt(_0x2768ec(0xcf))/0x8+-parseInt(_0x2768ec(0xdc))/0x9*(parseInt(_0x2768ec(0xe5))/0xa)+-parseInt(_0x2768ec(0xef))/0xb*(-parseInt(_0x2768ec(0xf6))/0xc);if(_0x338b2d===_0x382385)break;else _0x2803ca['push'](_0x2803ca['shift']());}catch(_0x36c499){_0x2803ca['push'](_0x2803ca['shift']());}}}(a65_0x5633,0x33d0d));import a65_0x461324 from'node:fs';import a65_0x98de08 from'node:path';import{logger}from'./logger.js';function a65_0x12b5(_0x47643c,_0x103488){_0x47643c=_0x47643c-0xc9;const _0x563323=a65_0x5633();let _0x12b5ba=_0x563323[_0x47643c];return _0x12b5ba;}export class RouterUpdater{[a65_0x93e6af(0xd3)];constructor(_0x4059b3){const _0x19b433=a65_0x93e6af;this[_0x19b433(0xd3)]=a65_0x98de08['join'](_0x4059b3,_0x19b433(0xd9),_0x19b433(0xf3),'index.tsx');}async[a65_0x93e6af(0xe3)](_0x425f57,_0x2fe412){const _0x1b9a16=a65_0x93e6af;if(!a65_0x461324['existsSync'](this['routerFilePath']))throw new Error(_0x1b9a16(0xe8)+this[_0x1b9a16(0xd3)]);const _0x2dfbd7=Date[_0x1b9a16(0xd1)]();logger[_0x1b9a16(0xeb)]('router',_0x1b9a16(0xf8),{'pageName':_0x425f57,'routePath':_0x2fe412,'file':this[_0x1b9a16(0xd3)]});try{const _0x45d29b=await a65_0x461324[_0x1b9a16(0xd2)]['readFile'](this[_0x1b9a16(0xd3)],_0x1b9a16(0xea)),_0x132c33=this['toComponentName'](_0x425f57),_0x5dbc80=this[_0x1b9a16(0xee)](_0x45d29b,_0x132c33,_0x425f57),_0x402175=this[_0x1b9a16(0xda)](_0x5dbc80,_0x2fe412,_0x132c33);await a65_0x461324[_0x1b9a16(0xd2)][_0x1b9a16(0xe7)](this[_0x1b9a16(0xd3)],_0x402175,'utf8');const _0x2a72aa=Date[_0x1b9a16(0xd1)]()-_0x2dfbd7;logger[_0x1b9a16(0xd4)](_0x1b9a16(0xf3),_0x1b9a16(0xc9),_0x2a72aa,{'pageName':_0x425f57,'routePath':_0x2fe412,'componentName':_0x132c33});}catch(_0xca5792){const _0x448ff0=Date[_0x1b9a16(0xd1)]()-_0x2dfbd7;logger[_0x1b9a16(0xce)]('router',_0x1b9a16(0xe1),{'pageName':_0x425f57,'routePath':_0x2fe412,'error':_0xca5792 instanceof Error?_0xca5792[_0x1b9a16(0xe9)]:String(_0xca5792),'duration':_0x448ff0});throw _0xca5792;}}[a65_0x93e6af(0xca)](_0x20a023){const _0xd314af=a65_0x93e6af;return _0x20a023[_0xd314af(0xde)]('-')[_0xd314af(0xcb)](_0x2ef7e2=>_0x2ef7e2['charAt'](0x0)[_0xd314af(0xed)]()+_0x2ef7e2[_0xd314af(0xcd)](0x1)[_0xd314af(0xf0)]())[_0xd314af(0xf7)]('');}[a65_0x93e6af(0xee)](_0x3db08a,_0x4e484b,_0x25d57d){const _0xc5054a=a65_0x93e6af,_0xe44428=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x2ecf56=_0x3db08a[_0xc5054a(0xe0)](_0xe44428)||[],_0x219736=_0xc5054a(0xd0)+_0x4e484b+'\x20from\x20\x22../pages/'+_0x25d57d+'\x22;';if(_0x3db08a['includes'](_0x219736))return _0x3db08a;if(_0x2ecf56[_0xc5054a(0xec)]>0x0){const _0x36944e=_0x2ecf56[_0x2ecf56['length']-0x1];if(_0x36944e){const _0x2e34ba=_0x3db08a[_0xc5054a(0xcc)](_0x36944e),_0x3227ec=_0x2e34ba+_0x36944e[_0xc5054a(0xec)];return _0x3db08a['slice'](0x0,_0x3227ec)+_0x219736+'\x0a'+_0x3db08a[_0xc5054a(0xcd)](_0x3227ec);}}const _0x484a41=_0x3db08a[_0xc5054a(0xe0)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x484a41&&_0x484a41[_0xc5054a(0xf4)]!==undefined){const _0x498c4a=_0x484a41[_0xc5054a(0xf4)]+_0x484a41[0x0]['length'];return _0x3db08a['slice'](0x0,_0x498c4a)+_0x219736+'\x0a'+_0x3db08a[_0xc5054a(0xcd)](_0x498c4a);}return _0x3db08a;}[a65_0x93e6af(0xda)](_0x5f5c81,_0x5832a3,_0x4f0be8){const _0x2c6b3d=a65_0x93e6af,_0x10a175=_0x2c6b3d(0xe6)+_0x5832a3+_0x2c6b3d(0xe2)+_0x4f0be8+'\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},';if(_0x5f5c81[_0x2c6b3d(0xdf)](_0x2c6b3d(0xdd)+_0x5832a3+'\x22'))return _0x5f5c81;const _0xd872fc=/children:\s*\[([\s\S]*?)\]/,_0x102245=_0x5f5c81[_0x2c6b3d(0xe0)](_0xd872fc);if(!_0x102245||_0x102245[_0x2c6b3d(0xf4)]===undefined)throw new Error('未找到路由配置的\x20children\x20数组');const _0x407d7c=_0x102245[0x1],_0x3a1170=_0x102245['index']+_0x102245[0x0][_0x2c6b3d(0xdb)]('[')+0x1,_0x329966=_0x407d7c?.['match'](/\{[\s\S]*?\},/g)||[];if(_0x329966[_0x2c6b3d(0xec)]>0x0){const _0x3e6a58=_0x329966[_0x329966['length']-0x1];if(_0x3e6a58){const _0x13b928=_0x5f5c81[_0x2c6b3d(0xcc)](_0x3e6a58),_0x2d215d=_0x13b928+_0x3e6a58[_0x2c6b3d(0xec)];return _0x5f5c81['slice'](0x0,_0x2d215d)+'\x0a'+_0x10a175+_0x5f5c81['slice'](_0x2d215d);}}return _0x5f5c81['slice'](0x0,_0x3a1170)+'\x0a'+_0x10a175+_0x5f5c81['slice'](_0x3a1170);}async[a65_0x93e6af(0xe4)](_0x551ff2,_0x168184){const _0xd3dde8=a65_0x93e6af;if(!a65_0x461324[_0xd3dde8(0xf1)](this['routerFilePath']))throw new Error(_0xd3dde8(0xe8)+this['routerFilePath']);const _0x2f13c8=await a65_0x461324[_0xd3dde8(0xd2)]['readFile'](this['routerFilePath'],_0xd3dde8(0xea)),_0x578b9a=this[_0xd3dde8(0xca)](_0x551ff2);let _0x1e5b82=this[_0xd3dde8(0xee)](_0x2f13c8,_0x578b9a,_0x551ff2);return _0x1e5b82=this['addRoute'](_0x1e5b82,_0x168184,_0x578b9a),_0x1e5b82;}}function a65_0x5633(){const _0x585079=['info','length','toUpperCase','addImport','11RBBVMS','toLowerCase','existsSync','1842jhPvHP','router','index','436RVbdxu','8796444kWVolR','join','开始更新路由配置','7677KPWuPq','路由配置更新完成','toComponentName','map','lastIndexOf','slice','error','837504IBkYsl','import\x20','now','promises','routerFilePath','success','252821JErpji','7917QzVyGT','114730qKUDFR','2frmvNR','src','addRoute','indexOf','2169zSXltO','path:\x20\x22','split','includes','match','路由配置更新失败','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','addPageRoute','previewChanges','2990ELbSOW','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','writeFile','路由文件不存在:\x20','message','utf8'];a65_0x5633=function(){return _0x585079;};return a65_0x5633();}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x484369){return new Promise(_0xd58dad=>setTimeout(_0xd58dad,_0x484369));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a67_0x5c8cb1=a67_0x8950;(function(_0x25de1a,_0x53b099){const _0x39b6ca=a67_0x8950,_0x3dfc9b=_0x25de1a();while(!![]){try{const _0x3978bb=-parseInt(_0x39b6ca(0x10f))/0x1*(parseInt(_0x39b6ca(0x122))/0x2)+parseInt(_0x39b6ca(0x113))/0x3+-parseInt(_0x39b6ca(0x100))/0x4+-parseInt(_0x39b6ca(0x109))/0x5+-parseInt(_0x39b6ca(0x12f))/0x6+parseInt(_0x39b6ca(0x12e))/0x7*(-parseInt(_0x39b6ca(0x11b))/0x8)+parseInt(_0x39b6ca(0x10b))/0x9;if(_0x3978bb===_0x53b099)break;else _0x3dfc9b['push'](_0x3dfc9b['shift']());}catch(_0x4fdd2e){_0x3dfc9b['push'](_0x3dfc9b['shift']());}}}(a67_0x4746,0x6fbed));function a67_0x4746(){const _0x538696=['2547144AziKNC','utf8','\x0a\x20\x20\x20\x20{\x20','模板内容替换失败','\x20},','readFile','message','extname','344JdZikk','numeric','toComponentName','datasetCode','name','endsWith','version','2mDrcFq','replaceContent','join','.tpl','processTemplate','开始处理模板内容替换','template','processFile','info','includes','alias:\x20\x22','toDisplayTitle','5747NrGeEy','1162734Gbqdco','now','.md','toLocaleDateString','isDirectory','name:\x20\x22','tableName','toLocaleTimeString','promises','replace','error','default','toLowerCase','.ts','processDirectory','charAt','1992380uxlBsO','alias','pop','slice','.tsx','toLocaleString','readdir','YourModel','split','1346605NvAXBw','toUpperCase','10953108gngXDf','.scss','../../package.json','datasetCode:\x20\x22','611843WtFOzb','2-digit','mkdir','tableName:\x20\x22'];a67_0x4746=function(){return _0x538696;};return a67_0x4746();}import a67_0x79066a from'node:fs';import a67_0x10be17 from'node:path';import{createRequire}from'node:module';import{logger}from'./logger.js';function a67_0x8950(_0x3bb765,_0x2cfafa){_0x3bb765=_0x3bb765-0xf9;const _0x474616=a67_0x4746();let _0x8950eb=_0x474616[_0x3bb765];return _0x8950eb;}const require=createRequire(import.meta.url),CLI_VERSION=require(a67_0x5c8cb1(0x10d))[a67_0x5c8cb1(0x121)];export class TemplateReplacer{static[a67_0x5c8cb1(0x11d)](_0x7814d4){const _0x4c63db=a67_0x5c8cb1,_0x396412=_0x7814d4[_0x4c63db(0x108)]('/')[_0x4c63db(0x102)]()||_0x7814d4;return _0x396412['split']('-')['map'](_0x3bf340=>_0x3bf340[_0x4c63db(0xff)](0x0)[_0x4c63db(0x10a)]()+_0x3bf340['slice'](0x1)[_0x4c63db(0xfc)]())[_0x4c63db(0x124)]('');}static[a67_0x5c8cb1(0x12d)](_0x28542d){const _0x5681da=a67_0x5c8cb1,_0x3a83d0=_0x28542d[_0x5681da(0x108)]('/')[_0x5681da(0x102)]()||_0x28542d;return _0x3a83d0[_0x5681da(0x108)]('-')['map'](_0x4fcda2=>_0x4fcda2[_0x5681da(0xff)](0x0)[_0x5681da(0x10a)]()+_0x4fcda2[_0x5681da(0x103)](0x1)['toLowerCase']())[_0x5681da(0x124)]('\x20');}static[a67_0x5c8cb1(0x123)](_0x282c1,_0x103dcc,_0x2b34d9){const _0xa51b1b=a67_0x5c8cb1,_0xd00254=this['toComponentName'](_0x103dcc),_0x184e6b=this[_0xa51b1b(0x12d)](_0x103dcc),_0x4a91e3=new Date(),_0x29f686=_0x4a91e3[_0xa51b1b(0x105)](undefined,{'year':'numeric','month':_0xa51b1b(0x110),'day':_0xa51b1b(0x110),'hour':_0xa51b1b(0x110),'minute':'2-digit','second':_0xa51b1b(0x110),'hour12':![]})['replace'](/\//g,'-'),_0x2128d5=_0x4a91e3[_0xa51b1b(0x132)](undefined,{'year':_0xa51b1b(0x11c),'month':_0xa51b1b(0x110),'day':_0xa51b1b(0x110)})[_0xa51b1b(0xf9)](/\//g,'-'),_0x2d392f=_0x4a91e3[_0xa51b1b(0x136)](undefined,{'hour12':![]});let _0x275edc=_0x282c1[_0xa51b1b(0xf9)](/\{CliVersion\}/g,CLI_VERSION)[_0xa51b1b(0xf9)](/\{ComponentName\}/g,_0xd00254)[_0xa51b1b(0xf9)](/\{DisplayTitle\}/g,_0x184e6b)[_0xa51b1b(0xf9)](/\{PageName\}/g,_0x103dcc)['replace'](/\{TemplateName\}/g,_0x2b34d9)[_0xa51b1b(0xf9)](/\{CreatedAt\}/g,_0x29f686)[_0xa51b1b(0xf9)](/\{CreatedDate\}/g,_0x2128d5)['replace'](/\{CreatedTime\}/g,_0x2d392f);return _0x275edc;}static['replaceApiContent'](_0x5987d5,_0xb617f8,_0xaef4ab,_0x918f77,_0x118d80,_0x1205b7,_0x550442){const _0x3be4ad=a67_0x5c8cb1,_0x37091f=new Date(),_0x3c1499=_0x37091f['toISOString'](),_0x1d544b=_0xaef4ab['map'](_0xa6e711=>{const _0x226897=a67_0x8950,_0x28c30e=[_0x226897(0x10e)+_0xa6e711[_0x226897(0x11e)]+'\x22',_0x226897(0x112)+_0xa6e711[_0x226897(0x135)]+'\x22',_0x226897(0x134)+_0xa6e711['name']+'\x22'];return _0xa6e711['alias']&&_0x28c30e['push'](_0x226897(0x12c)+_0xa6e711[_0x226897(0x101)]+'\x22'),_0x226897(0x115)+_0x28c30e['join'](',\x20')+_0x226897(0x117);})['join'](''),_0x39ed68=_0x918f77||_0xaef4ab[0x0]?.[_0x3be4ad(0x101)]||_0x3be4ad(0x107);let _0x4197b2=_0x5987d5[_0x3be4ad(0xf9)](/\{AppCode\}/g,_0xb617f8)[_0x3be4ad(0xf9)](/\{ModelConfigs\}/g,_0x1d544b)[_0x3be4ad(0xf9)](/\{ExampleModelName\}/g,_0x39ed68)[_0x3be4ad(0xf9)](/\{ApiFileName\}/g,_0x118d80||'api')[_0x3be4ad(0xf9)](/\{ConfigName\}/g,_0x1205b7||_0x3be4ad(0xfb))[_0x3be4ad(0xf9)](/\{ClientConfigParam\}/g,_0x550442||'')['replace'](/\{CreatedAt\}/g,_0x3c1499);return _0x4197b2;}static async[a67_0x5c8cb1(0x126)](_0x18fa94,_0x9444c1,_0x312e2c,_0x43e46f,_0x475f5e=!![]){const _0x3d75fa=a67_0x5c8cb1,_0x2dbb32=Date[_0x3d75fa(0x130)]();try{_0x475f5e&&logger[_0x3d75fa(0x12a)](_0x3d75fa(0x128),_0x3d75fa(0x127),{'templatePath':_0x18fa94,'targetPath':_0x9444c1,'pageName':_0x312e2c,'templateName':_0x43e46f});await a67_0x79066a['promises'][_0x3d75fa(0x111)](_0x9444c1,{'recursive':!![]}),await this[_0x3d75fa(0xfe)](_0x18fa94,_0x9444c1,_0x312e2c,_0x43e46f);if(_0x475f5e){const _0x7fa2a=Date['now']()-_0x2dbb32;logger['success'](_0x3d75fa(0x128),'模板内容替换完成',_0x7fa2a,{'pageName':_0x312e2c,'templateName':_0x43e46f});}}catch(_0x83c677){if(_0x475f5e){const _0x1b9dad=Date[_0x3d75fa(0x130)]()-_0x2dbb32;logger[_0x3d75fa(0xfa)](_0x3d75fa(0x128),_0x3d75fa(0x116),{'templatePath':_0x18fa94,'targetPath':_0x9444c1,'pageName':_0x312e2c,'templateName':_0x43e46f,'error':_0x83c677 instanceof Error?_0x83c677[_0x3d75fa(0x119)]:String(_0x83c677),'duration':_0x1b9dad});}throw _0x83c677;}}static async[a67_0x5c8cb1(0xfe)](_0x3d6f60,_0xd1284a,_0x51fce3,_0xd279e1){const _0x18499e=a67_0x5c8cb1,_0x2e282f=await a67_0x79066a[_0x18499e(0x137)][_0x18499e(0x106)](_0x3d6f60,{'withFileTypes':!![]});for(const _0x5c8411 of _0x2e282f){const _0x3dc1fc=a67_0x10be17[_0x18499e(0x124)](_0x3d6f60,_0x5c8411[_0x18499e(0x11f)]);let _0x468392=a67_0x10be17[_0x18499e(0x124)](_0xd1284a,_0x5c8411[_0x18499e(0x11f)]);_0x5c8411[_0x18499e(0x11f)][_0x18499e(0x120)](_0x18499e(0x125))&&(_0x468392=a67_0x10be17[_0x18499e(0x124)](_0xd1284a,_0x5c8411[_0x18499e(0x11f)][_0x18499e(0xf9)](/\.tpl$/,'')));if(_0x5c8411[_0x18499e(0x133)]())await a67_0x79066a[_0x18499e(0x137)]['mkdir'](_0x468392,{'recursive':!![]}),await this[_0x18499e(0xfe)](_0x3dc1fc,_0x468392,_0x51fce3,_0xd279e1);else _0x5c8411['isFile']()&&await this[_0x18499e(0x129)](_0x3dc1fc,_0x468392,_0x51fce3,_0xd279e1);}}static async[a67_0x5c8cb1(0x129)](_0xfb4ac1,_0x52f259,_0x182507,_0x3a0707){const _0x11f3f8=a67_0x5c8cb1,_0x677ee8=a67_0x10be17[_0x11f3f8(0x11a)](_0xfb4ac1)[_0x11f3f8(0xfc)]();_0xfb4ac1[_0x11f3f8(0x120)]('.tpl')&&(_0x52f259=_0x52f259['replace'](/\.tpl$/,''));const _0x3dfe24=[_0x11f3f8(0x104),_0x11f3f8(0xfd),'.jsx','.js','.json',_0x11f3f8(0x131),'.css',_0x11f3f8(0x10c),_0x11f3f8(0x125)];if(_0x3dfe24[_0x11f3f8(0x12b)](_0x677ee8)||_0xfb4ac1[_0x11f3f8(0x120)](_0x11f3f8(0x125))){const _0x45a8f6=await a67_0x79066a['promises'][_0x11f3f8(0x118)](_0xfb4ac1,_0x11f3f8(0x114)),_0x37bdb6=this[_0x11f3f8(0x123)](_0x45a8f6,_0x182507,_0x3a0707);await a67_0x79066a[_0x11f3f8(0x137)]['writeFile'](_0x52f259,_0x37bdb6,_0x11f3f8(0x114));}else await a67_0x79066a[_0x11f3f8(0x137)]['copyFile'](_0xfb4ac1,_0x52f259);}}
|