@lovrabet/cli 1.1.13 → 1.1.14
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/README.md +1 -1
- 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/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-datasets.js +1 -1
- package/lib/api/format-dataset.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/api/pull.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -0
- package/lib/app-menu/create-menu.js +1 -0
- package/lib/app-menu/get-local-pages.js +1 -0
- package/lib/app-menu/get-online-menu-list.js +1 -0
- package/lib/app-menu/types.js +1 -0
- package/lib/app-menu/valid-url.js +1 -0
- 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/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 -0
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1c9fa3,_0x3121b4){const _0x43664a=a29_0x5a7a,_0x17173a=_0x1c9fa3();while(!![]){try{const _0x9c47b3=parseInt(_0x43664a(0x176))/0x1*(-parseInt(_0x43664a(0x16d))/0x2)+parseInt(_0x43664a(0x172))/0x3+parseInt(_0x43664a(0x151))/0x4+-parseInt(_0x43664a(0x15f))/0x5+parseInt(_0x43664a(0x157))/0x6*(parseInt(_0x43664a(0x16a))/0x7)+-parseInt(_0x43664a(0x158))/0x8*(-parseInt(_0x43664a(0x168))/0x9)+-parseInt(_0x43664a(0x140))/0xa;if(_0x9c47b3===_0x3121b4)break;else _0x17173a['push'](_0x17173a['shift']());}catch(_0x199e3a){_0x17173a['push'](_0x17173a['shift']());}}}(a29_0x5728,0x9abb8));import{jsx as a29_0x3cd3af,jsxs as a29_0x432fad,Fragment as a29_0xee5819}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';function a29_0x5728(){const _0x375b95=['login','\x20\x20使用\x20←→\x20选择,回车确认','*\x20是否要自动拉取\x20API\x20配置?','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','6GbmgSj','3832760tXsojd','rightArrow','\x20←\x20','leftArrow','login-process','env','*\x20应用AppCode\x20','4231710hHUzvL','green','backspace','includes','登录状态','length','登录失败','*\x20正在检查登录状态...','[可选]:\x20','9rjYmFV','项目名','4538793qjjgqx','app-code','yellow','3076IKhikJ','*\x20正在登录,请前往浏览器完成登录...','login-prompt','api-pull','*\x20是否要先登录以便拉取\x20API\x20配置?','1625376VXLjzE','return','label','项目名不合法','446zVlnKb','gray','online','trim','confirm-api-pull','\x20检查中...','\x20直接回车确认,或输入自定义名称','column','项目名长度不能超过\x2050\x20个字符','Yes','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','login-check','已登录','test','4998530XgFvbj','!\x20未检测到有效登录','slice','*\x20项目名:\x20','应用AppCode','map','project-name','value','应用AppCode不合法','*\x20创建新项目','creating','string','拉取API配置','未设置','cyan','√\x20检测到有效登录状态','my-app','3986564yruJDi'];a29_0x5728=function(){return _0x375b95;};return a29_0x5728();}import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';function a29_0x5a7a(_0x4a8c14,_0x473dbc){const _0x57281c=a29_0x5728();return a29_0x5a7a=function(_0x5a7a29,_0x26a44e){_0x5a7a29=_0x5a7a29-0x13b;let _0x3b625b=_0x57281c[_0x5a7a29];return _0x3b625b;},a29_0x5a7a(_0x4a8c14,_0x473dbc);}import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x5aad03){const _0x3178b7=a29_0x5a7a,{onCreate:_0x5516cc,env:_0x581836}=_0x5aad03,[_0x128845,_0x12dcbc]=useState(_0x3178b7(0x146)),[_0x4ffea3,_0x480177]=useState(''),[_0x1396fc,_0x25ced2]=useState(''),[_0x4b83a1,_0x1168a0]=useState(''),[_0x269f27,_0x10522e]=useState(''),[_0x4de89c,_0x1aad9e]=useState([]),[_0x1ec3d0,_0xf78dfd]=useState(null),[_0xde154e,_0x123989]=useState(![]),[_0x3fb1c3,_0x4312f8]=useState(![]),[_0x363750,_0x298045]=useState(![]),[_0x350b54,_0x296c75]=useState(0x0),[_0x2fe0a1,_0x4508b0]=useState(0x0),_0x155d5d=_0x3178b7(0x150),_0x3a1e8f=readConfig(),_0x172cb8=typeof _0x3a1e8f[_0x3178b7(0x15d)]===_0x3178b7(0x14b)?_0x3a1e8f[_0x3178b7(0x15d)]:undefined;function _0x34d0d1(_0xd70959){const _0x5272dd=_0x3178b7;if(_0xd70959[_0x5272dd(0x164)]>0x32)return{'valid':![],'message':_0x5272dd(0x17e)};const _0x60795=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0xd70959?.[_0x5272dd(0x179)]()&&!_0x60795['test'](_0xd70959))return{'valid':![],'message':'项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};return{'valid':!![]};}function _0x1630c9(_0x511793){const _0x4f6a0d=_0x3178b7;if(!_0x511793[_0x4f6a0d(0x179)]())return{'valid':!![]};if(_0x511793[_0x4f6a0d(0x164)]>0x64)return{'valid':![],'message':'应用AppCode长度不能超过\x20100\x20个字符'};const _0x3611d3=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x3611d3[_0x4f6a0d(0x13f)](_0x511793))return{'valid':![],'message':_0x4f6a0d(0x13c)};return{'valid':!![]};}async function _0x4e6816(){_0x123989(!![]);try{const _0x4243a4=await getIsSessionValid();return _0xf78dfd(_0x4243a4),_0x4243a4;}catch(_0x39c5b7){return _0xf78dfd(![]),![];}finally{_0x123989(![]);}}async function _0x42a974(){_0x4312f8(!![]);try{const _0x195666=await authServer({'silent':!![]});return _0xf78dfd(_0x195666),_0x195666;}catch(_0x252756){return _0xf78dfd(![]),![];}finally{_0x4312f8(![]);}}return useInput(async(_0x5d8495,_0x8f236f)=>{const _0x453c81=_0x3178b7;if(_0x8f236f[_0x453c81(0x15b)]||_0x8f236f[_0x453c81(0x159)]){if(_0x128845===_0x453c81(0x17a)){_0x296c75(_0x3000b2=>_0x3000b2===0x0?0x1:0x0);return;}if(_0x128845==='login-prompt'){_0x4508b0(_0x5eafba=>_0x5eafba===0x0?0x1:0x0);return;}}if(_0x8f236f[_0x453c81(0x173)]){if(_0x128845===_0x453c81(0x146)){const _0x34a8f9=_0x4b83a1['trim']()||_0x155d5d;if(_0x269f27)return;_0x480177(_0x34a8f9),_0x1aad9e([{'step':_0x453c81(0x146),'label':_0x453c81(0x169),'value':_0x34a8f9}]),_0x1168a0(''),_0x10522e(''),_0x12dcbc(_0x453c81(0x16b));return;}if(_0x128845===_0x453c81(0x16b)){if(_0x269f27)return;const _0x1db451=_0x4b83a1[_0x453c81(0x179)]();_0x25ced2(_0x1db451),_0x1aad9e(_0x24f34c=>[..._0x24f34c,{'step':_0x453c81(0x16b),'label':_0x453c81(0x144),'value':_0x1db451||_0x453c81(0x14d)}]),_0x1168a0(''),_0x10522e('');if(_0x1db451){_0x12dcbc(_0x453c81(0x13d));const _0x5bc648=await _0x4e6816();_0x5bc648?_0x12dcbc(_0x453c81(0x17a)):_0x12dcbc('login-prompt');}else{const _0x8656cb=_0x581836||_0x172cb8||_0x453c81(0x178);_0x5516cc({'projectName':_0x4ffea3,'appCode':undefined,'pullApi':![],'env':_0x8656cb}),_0x12dcbc(_0x453c81(0x14a));}return;}if(_0x128845===_0x453c81(0x17a)){const _0x1cb04a=_0x350b54===0x0;_0x298045(_0x1cb04a),_0x1aad9e(_0x30e3b4=>[..._0x30e3b4,{'step':_0x453c81(0x170),'label':_0x453c81(0x14c),'value':_0x1cb04a?'是':'否'}]);const _0x11ec1c=_0x581836||_0x172cb8||'online';_0x5516cc({'projectName':_0x4ffea3,'appCode':_0x1396fc,'pullApi':_0x1cb04a,'env':_0x11ec1c}),_0x12dcbc('creating');return;}if(_0x128845===_0x453c81(0x16f)){const _0x527935=_0x2fe0a1===0x0;if(_0x527935){_0x12dcbc(_0x453c81(0x15c));const _0x2785a6=await _0x42a974();if(_0x2785a6)_0x1aad9e(_0x45d97e=>[..._0x45d97e,{'step':_0x453c81(0x152),'label':_0x453c81(0x163),'value':_0x453c81(0x13e)}]),_0x12dcbc('confirm-api-pull');else{_0x1aad9e(_0x4f23f9=>[..._0x4f23f9,{'step':_0x453c81(0x152),'label':'登录状态','value':_0x453c81(0x165)}]);const _0x4237d5=_0x581836||_0x172cb8||_0x453c81(0x178);_0x5516cc({'projectName':_0x4ffea3,'appCode':_0x1396fc,'pullApi':![],'env':_0x4237d5}),_0x12dcbc(_0x453c81(0x14a));}}else{_0x1aad9e(_0x5ea420=>[..._0x5ea420,{'step':_0x453c81(0x152),'label':_0x453c81(0x163),'value':'跳过登录'}]);const _0x4c2a4a=_0x581836||_0x172cb8||_0x453c81(0x178);_0x5516cc({'projectName':_0x4ffea3,'appCode':_0x1396fc,'pullApi':![],'env':_0x4c2a4a}),_0x12dcbc(_0x453c81(0x14a));}return;}}if(_0x8f236f[_0x453c81(0x161)]||_0x8f236f['delete']){_0x1168a0(_0x38fd43=>{const _0x249e55=_0x453c81,_0x33ff9c=_0x38fd43[_0x249e55(0x142)](0x0,-0x1);if(_0x128845===_0x249e55(0x146)){const {valid:_0xcce1e4,message:_0x280321}=_0x34d0d1(_0x33ff9c);_0x10522e(_0xcce1e4?'':_0x280321||_0x249e55(0x175));}else{if(_0x128845===_0x249e55(0x16b)){const {valid:_0x4dcf81,message:_0x5e5af3}=_0x1630c9(_0x33ff9c);_0x10522e(_0x4dcf81?'':_0x5e5af3||_0x249e55(0x148));}}return _0x33ff9c;});return;}if([_0x453c81(0x14a),_0x453c81(0x13d),_0x453c81(0x15c)][_0x453c81(0x162)](_0x128845))return;if(_0x128845==='confirm-api-pull'||_0x128845===_0x453c81(0x16f))return;_0x1168a0(_0x15f267=>{const _0x3114a5=_0x453c81,_0x364255=_0x15f267+_0x5d8495;if(_0x128845===_0x3114a5(0x146)){const {valid:_0x276fa1,message:_0x7d09e7}=_0x34d0d1(_0x364255);_0x10522e(_0x276fa1?'':_0x7d09e7||_0x3114a5(0x175));}else{if(_0x128845===_0x3114a5(0x16b)){const {valid:_0x3116de,message:_0x35dc7f}=_0x1630c9(_0x364255);_0x10522e(_0x3116de?'':_0x35dc7f||_0x3114a5(0x148));}}return _0x364255;});}),a29_0x432fad(Box,{'flexDirection':_0x3178b7(0x17d),'marginTop':0x1,'children':[_0x4de89c['length']===0x0&&a29_0x3cd3af(Box,{'children':a29_0x3cd3af(Text,{'color':_0x3178b7(0x14e),'children':_0x3178b7(0x149)})}),_0x4de89c[_0x3178b7(0x145)](_0x30a8ef=>a29_0x432fad(Box,{'children':[a29_0x432fad(Text,{'color':'green','children':['√\x20',_0x30a8ef[_0x3178b7(0x174)],':\x20']}),a29_0x3cd3af(Text,{'color':_0x3178b7(0x14e),'children':_0x30a8ef[_0x3178b7(0x147)]})]},_0x30a8ef['step'])),_0x128845===_0x3178b7(0x146)&&a29_0x432fad(a29_0xee5819,{'children':[a29_0x432fad(Box,{'children':[a29_0x3cd3af(Text,{'children':_0x3178b7(0x143)}),_0x4b83a1?a29_0x3cd3af(Text,{'color':'green','children':_0x4b83a1}):a29_0x3cd3af(Text,{'color':_0x3178b7(0x177),'children':_0x155d5d}),_0x269f27&&a29_0x432fad(Text,{'color':'red','children':[_0x3178b7(0x15a),_0x269f27]})]}),!_0x269f27&&!_0x4b83a1&&a29_0x3cd3af(Box,{'children':a29_0x3cd3af(Text,{'color':_0x3178b7(0x177),'children':_0x3178b7(0x17c)})})]}),_0x128845===_0x3178b7(0x16b)&&a29_0x432fad(a29_0xee5819,{'children':[a29_0x432fad(Box,{'children':[a29_0x3cd3af(Text,{'children':_0x3178b7(0x15e)}),a29_0x3cd3af(Text,{'color':_0x3178b7(0x177),'children':_0x3178b7(0x167)}),a29_0x3cd3af(Text,{'color':_0x3178b7(0x160),'children':_0x4b83a1}),_0x269f27&&a29_0x432fad(Text,{'color':'red','children':['\x20←\x20',_0x269f27]})]}),!_0x269f27&&a29_0x3cd3af(Box,{'children':a29_0x432fad(Text,{'color':_0x3178b7(0x177),'children':['\x20',_0x3178b7(0x156)]})})]}),_0x128845===_0x3178b7(0x13d)&&a29_0x432fad(Box,{'children':[a29_0x3cd3af(Text,{'children':_0x3178b7(0x166)}),_0xde154e&&a29_0x3cd3af(Text,{'color':_0x3178b7(0x177),'children':_0x3178b7(0x17b)})]}),_0x128845===_0x3178b7(0x17a)&&a29_0x432fad(a29_0xee5819,{'children':[a29_0x3cd3af(Box,{'children':a29_0x3cd3af(Text,{'color':'green','children':_0x3178b7(0x14f)})}),a29_0x3cd3af(Box,{'marginTop':0x1,'children':a29_0x3cd3af(Text,{'children':_0x3178b7(0x154)})}),a29_0x432fad(Box,{'marginLeft':0x2,'children':[a29_0x432fad(Text,{'color':_0x350b54===0x0?_0x3178b7(0x160):_0x3178b7(0x177),'children':[_0x350b54===0x0?'▶\x20':'\x20\x20',_0x3178b7(0x13b)]}),a29_0x3cd3af(Text,{'children':'\x20'}),a29_0x432fad(Text,{'color':_0x350b54===0x1?_0x3178b7(0x160):_0x3178b7(0x177),'children':[_0x350b54===0x1?'▶\x20':'\x20\x20','No']})]}),a29_0x3cd3af(Box,{'children':a29_0x3cd3af(Text,{'color':_0x3178b7(0x177),'children':_0x3178b7(0x153)})}),a29_0x3cd3af(Box,{'children':a29_0x3cd3af(Text,{'color':_0x3178b7(0x16c),'children':'\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口'})})]}),_0x128845===_0x3178b7(0x16f)&&a29_0x432fad(a29_0xee5819,{'children':[a29_0x3cd3af(Box,{'children':a29_0x3cd3af(Text,{'color':_0x3178b7(0x16c),'children':_0x3178b7(0x141)})}),a29_0x3cd3af(Box,{'marginTop':0x1,'children':a29_0x3cd3af(Text,{'children':_0x3178b7(0x171)})}),a29_0x432fad(Box,{'marginLeft':0x2,'children':[a29_0x432fad(Text,{'color':_0x2fe0a1===0x0?'green':_0x3178b7(0x177),'children':[_0x2fe0a1===0x0?'▶\x20':'\x20\x20',_0x3178b7(0x13b)]}),a29_0x3cd3af(Text,{'children':'\x20'}),a29_0x432fad(Text,{'color':_0x2fe0a1===0x1?_0x3178b7(0x160):'gray','children':[_0x2fe0a1===0x1?'▶\x20':'\x20\x20','No']})]}),a29_0x3cd3af(Box,{'children':a29_0x3cd3af(Text,{'color':'gray','children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a29_0x3cd3af(Box,{'children':a29_0x3cd3af(Text,{'color':_0x3178b7(0x16c),'children':_0x3178b7(0x155)})})]}),_0x128845===_0x3178b7(0x15c)&&a29_0x432fad(Box,{'children':[a29_0x3cd3af(Text,{'children':_0x3178b7(0x16e)}),_0x3fb1c3&&a29_0x3cd3af(Text,{'color':_0x3178b7(0x177),'children':'\x20登录中...'})]})]});}
|
|
1
|
+
(function(_0x1368d4,_0x36b406){const _0x22b195=a35_0xeebd,_0x4edd08=_0x1368d4();while(!![]){try{const _0x1fb832=-parseInt(_0x22b195(0x1ed))/0x1*(-parseInt(_0x22b195(0x1c1))/0x2)+-parseInt(_0x22b195(0x1cc))/0x3*(-parseInt(_0x22b195(0x1d4))/0x4)+parseInt(_0x22b195(0x1cb))/0x5+parseInt(_0x22b195(0x1ce))/0x6+-parseInt(_0x22b195(0x1eb))/0x7*(parseInt(_0x22b195(0x1db))/0x8)+-parseInt(_0x22b195(0x1e3))/0x9*(parseInt(_0x22b195(0x1ef))/0xa)+-parseInt(_0x22b195(0x1fb))/0xb;if(_0x1fb832===_0x36b406)break;else _0x4edd08['push'](_0x4edd08['shift']());}catch(_0x44e37f){_0x4edd08['push'](_0x4edd08['shift']());}}}(a35_0x39ef,0xabdc1));import{jsx as a35_0x2db286,jsxs as a35_0x48567d,Fragment as a35_0x1939d9}from'react/jsx-runtime';function a35_0xeebd(_0x495310,_0x17899c){const _0x39ef80=a35_0x39ef();return a35_0xeebd=function(_0xeebd57,_0x27470d){_0xeebd57=_0xeebd57-0x1bf;let _0x36848d=_0x39ef80[_0xeebd57];return _0x36848d;},a35_0xeebd(_0x495310,_0x17899c);}import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';function a35_0x39ef(){const _0x595498=['cyan','跳过登录','264nEfYhh','backspace','!\x20未检测到有效登录','trim','\x20检查中...','登录状态','red','*\x20正在登录,请前往浏览器完成登录...','6962544UVuImJ','项目名长度不能超过\x2050\x20个字符','api-pull','login-check','*\x20创建新项目','Yes','column','gray','218134rtAzcE','*\x20是否要先登录以便拉取\x20API\x20配置?','23218ivcaEf','\x20←\x20','10FQbvUf','login-prompt','online','\x20登录中...','项目名不合法','project-name','*\x20是否要自动拉取\x20API\x20配置?','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','step','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','拉取API配置','项目名','662805xvNnof','my-app','return','green','map','slice','登录失败','62pJZKCU','\x20\x20使用\x20←→\x20选择,回车确认','login','√\x20检测到有效登录状态','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','creating','已登录','应用AppCode不合法','login-process','app-code','2127005HjbAZR','3taVXOb','yellow','7904868NADcvO','未设置','\x20直接回车确认,或输入自定义名称','length','delete','env','414068nALRpu','confirm-api-pull','*\x20应用AppCode\x20','label','*\x20正在检查登录状态...'];a35_0x39ef=function(){return _0x595498;};return a35_0x39ef();}import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x1a3ce2){const _0x3772a4=a35_0xeebd,{onCreate:_0x5c9861,env:_0x5d7364}=_0x1a3ce2,[_0x2b424c,_0x5d6f5e]=useState(_0x3772a4(0x1f4)),[_0x4771d6,_0x1e85df]=useState(''),[_0x199618,_0x8e00bb]=useState(''),[_0x1eac2d,_0x2dbb0c]=useState(''),[_0xd581c5,_0x49439a]=useState(''),[_0x1d3986,_0x46f634]=useState([]),[_0x4069ce,_0x68c886]=useState(null),[_0x5cde85,_0x4d08e9]=useState(![]),[_0x29b089,_0x149e51]=useState(![]),[_0x40c19c,_0x1683e1]=useState(![]),[_0x1e3d71,_0x1f6cfc]=useState(0x0),[_0xea4d7b,_0x302f58]=useState(0x0),_0x393bb7=_0x3772a4(0x1fc),_0x2ecfdb=readConfig(),_0x46fd61=typeof _0x2ecfdb[_0x3772a4(0x1d3)]==='string'?_0x2ecfdb[_0x3772a4(0x1d3)]:undefined;function _0x278845(_0x21335e){const _0x155136=_0x3772a4;if(_0x21335e[_0x155136(0x1d1)]>0x32)return{'valid':![],'message':_0x155136(0x1e4)};const _0x21dd0e=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x21335e?.[_0x155136(0x1de)]()&&!_0x21dd0e['test'](_0x21335e))return{'valid':![],'message':_0x155136(0x1f8)};return{'valid':!![]};}function _0xd83486(_0x1936cf){const _0x2eaf06=_0x3772a4;if(!_0x1936cf[_0x2eaf06(0x1de)]())return{'valid':!![]};if(_0x1936cf[_0x2eaf06(0x1d1)]>0x64)return{'valid':![],'message':'应用AppCode长度不能超过\x20100\x20个字符'};const _0x16fce9=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x16fce9['test'](_0x1936cf))return{'valid':![],'message':_0x2eaf06(0x1f6)};return{'valid':!![]};}async function _0x95f9e4(){_0x4d08e9(!![]);try{const _0x781534=await getIsSessionValid();return _0x68c886(_0x781534),_0x781534;}catch(_0x1ddacd){return _0x68c886(![]),![];}finally{_0x4d08e9(![]);}}async function _0x526248(){_0x149e51(!![]);try{const _0x2d60d3=await authServer({'silent':!![]});return _0x68c886(_0x2d60d3),_0x2d60d3;}catch(_0x443c88){return _0x68c886(![]),![];}finally{_0x149e51(![]);}}return useInput(async(_0x2b5ef7,_0x2ac254)=>{const _0x3fcbe8=_0x3772a4;if(_0x2ac254['leftArrow']||_0x2ac254['rightArrow']){if(_0x2b424c===_0x3fcbe8(0x1d5)){_0x1f6cfc(_0x279415=>_0x279415===0x0?0x1:0x0);return;}if(_0x2b424c===_0x3fcbe8(0x1f0)){_0x302f58(_0x272ef7=>_0x272ef7===0x0?0x1:0x0);return;}}if(_0x2ac254[_0x3fcbe8(0x1fd)]){if(_0x2b424c===_0x3fcbe8(0x1f4)){const _0x4773a2=_0x1eac2d[_0x3fcbe8(0x1de)]()||_0x393bb7;if(_0xd581c5)return;_0x1e85df(_0x4773a2),_0x46f634([{'step':_0x3fcbe8(0x1f4),'label':_0x3fcbe8(0x1fa),'value':_0x4773a2}]),_0x2dbb0c(''),_0x49439a(''),_0x5d6f5e(_0x3fcbe8(0x1ca));return;}if(_0x2b424c===_0x3fcbe8(0x1ca)){if(_0xd581c5)return;const _0x1493fb=_0x1eac2d[_0x3fcbe8(0x1de)]();_0x8e00bb(_0x1493fb),_0x46f634(_0x527181=>[..._0x527181,{'step':_0x3fcbe8(0x1ca),'label':'应用AppCode','value':_0x1493fb||_0x3fcbe8(0x1cf)}]),_0x2dbb0c(''),_0x49439a('');if(_0x1493fb){_0x5d6f5e(_0x3fcbe8(0x1e6));const _0x17a34c=await _0x95f9e4();_0x17a34c?_0x5d6f5e('confirm-api-pull'):_0x5d6f5e(_0x3fcbe8(0x1f0));}else{const _0x1415dc=_0x5d7364||_0x46fd61||_0x3fcbe8(0x1f1);_0x5c9861({'projectName':_0x4771d6,'appCode':undefined,'pullApi':![],'env':_0x1415dc}),_0x5d6f5e(_0x3fcbe8(0x1c6));}return;}if(_0x2b424c===_0x3fcbe8(0x1d5)){const _0x3d9bac=_0x1e3d71===0x0;_0x1683e1(_0x3d9bac),_0x46f634(_0x1f3272=>[..._0x1f3272,{'step':_0x3fcbe8(0x1e5),'label':_0x3fcbe8(0x1f9),'value':_0x3d9bac?'是':'否'}]);const _0x4676c7=_0x5d7364||_0x46fd61||_0x3fcbe8(0x1f1);_0x5c9861({'projectName':_0x4771d6,'appCode':_0x199618,'pullApi':_0x3d9bac,'env':_0x4676c7}),_0x5d6f5e(_0x3fcbe8(0x1c6));return;}if(_0x2b424c===_0x3fcbe8(0x1f0)){const _0x487a64=_0xea4d7b===0x0;if(_0x487a64){_0x5d6f5e('login-process');const _0x50cc96=await _0x526248();if(_0x50cc96)_0x46f634(_0x5a5f5c=>[..._0x5a5f5c,{'step':'login','label':_0x3fcbe8(0x1e0),'value':_0x3fcbe8(0x1c7)}]),_0x5d6f5e(_0x3fcbe8(0x1d5));else{_0x46f634(_0x457d00=>[..._0x457d00,{'step':_0x3fcbe8(0x1c3),'label':_0x3fcbe8(0x1e0),'value':_0x3fcbe8(0x1c0)}]);const _0x3135e5=_0x5d7364||_0x46fd61||_0x3fcbe8(0x1f1);_0x5c9861({'projectName':_0x4771d6,'appCode':_0x199618,'pullApi':![],'env':_0x3135e5}),_0x5d6f5e(_0x3fcbe8(0x1c6));}}else{_0x46f634(_0x1686e1=>[..._0x1686e1,{'step':_0x3fcbe8(0x1c3),'label':'登录状态','value':_0x3fcbe8(0x1da)}]);const _0x6df326=_0x5d7364||_0x46fd61||_0x3fcbe8(0x1f1);_0x5c9861({'projectName':_0x4771d6,'appCode':_0x199618,'pullApi':![],'env':_0x6df326}),_0x5d6f5e(_0x3fcbe8(0x1c6));}return;}}if(_0x2ac254[_0x3fcbe8(0x1dc)]||_0x2ac254[_0x3fcbe8(0x1d2)]){_0x2dbb0c(_0x1a6481=>{const _0x27dbbe=_0x3fcbe8,_0xd39d4c=_0x1a6481[_0x27dbbe(0x1bf)](0x0,-0x1);if(_0x2b424c==='project-name'){const {valid:_0x313b54,message:_0x5df402}=_0x278845(_0xd39d4c);_0x49439a(_0x313b54?'':_0x5df402||_0x27dbbe(0x1f3));}else{if(_0x2b424c===_0x27dbbe(0x1ca)){const {valid:_0x26fdcb,message:_0x181d5}=_0xd83486(_0xd39d4c);_0x49439a(_0x26fdcb?'':_0x181d5||_0x27dbbe(0x1c8));}}return _0xd39d4c;});return;}if([_0x3fcbe8(0x1c6),_0x3fcbe8(0x1e6),_0x3fcbe8(0x1c9)]['includes'](_0x2b424c))return;if(_0x2b424c==='confirm-api-pull'||_0x2b424c===_0x3fcbe8(0x1f0))return;_0x2dbb0c(_0x5236b0=>{const _0x17bc69=_0x3fcbe8,_0x555531=_0x5236b0+_0x2b5ef7;if(_0x2b424c===_0x17bc69(0x1f4)){const {valid:_0x28d3bf,message:_0x41ff05}=_0x278845(_0x555531);_0x49439a(_0x28d3bf?'':_0x41ff05||'项目名不合法');}else{if(_0x2b424c===_0x17bc69(0x1ca)){const {valid:_0x59bdc2,message:_0x2128a8}=_0xd83486(_0x555531);_0x49439a(_0x59bdc2?'':_0x2128a8||_0x17bc69(0x1c8));}}return _0x555531;});}),a35_0x48567d(Box,{'flexDirection':_0x3772a4(0x1e9),'marginTop':0x1,'children':[_0x1d3986[_0x3772a4(0x1d1)]===0x0&&a35_0x2db286(Box,{'children':a35_0x2db286(Text,{'color':_0x3772a4(0x1d9),'children':_0x3772a4(0x1e7)})}),_0x1d3986[_0x3772a4(0x1ff)](_0x14cdc5=>a35_0x48567d(Box,{'children':[a35_0x48567d(Text,{'color':_0x3772a4(0x1fe),'children':['√\x20',_0x14cdc5[_0x3772a4(0x1d7)],':\x20']}),a35_0x2db286(Text,{'color':'cyan','children':_0x14cdc5['value']})]},_0x14cdc5[_0x3772a4(0x1f7)])),_0x2b424c===_0x3772a4(0x1f4)&&a35_0x48567d(a35_0x1939d9,{'children':[a35_0x48567d(Box,{'children':[a35_0x2db286(Text,{'children':'*\x20项目名:\x20'}),_0x1eac2d?a35_0x2db286(Text,{'color':_0x3772a4(0x1fe),'children':_0x1eac2d}):a35_0x2db286(Text,{'color':_0x3772a4(0x1ea),'children':_0x393bb7}),_0xd581c5&&a35_0x48567d(Text,{'color':_0x3772a4(0x1e1),'children':[_0x3772a4(0x1ee),_0xd581c5]})]}),!_0xd581c5&&!_0x1eac2d&&a35_0x2db286(Box,{'children':a35_0x2db286(Text,{'color':_0x3772a4(0x1ea),'children':_0x3772a4(0x1d0)})})]}),_0x2b424c==='app-code'&&a35_0x48567d(a35_0x1939d9,{'children':[a35_0x48567d(Box,{'children':[a35_0x2db286(Text,{'children':_0x3772a4(0x1d6)}),a35_0x2db286(Text,{'color':_0x3772a4(0x1ea),'children':'[可选]:\x20'}),a35_0x2db286(Text,{'color':_0x3772a4(0x1fe),'children':_0x1eac2d}),_0xd581c5&&a35_0x48567d(Text,{'color':'red','children':['\x20←\x20',_0xd581c5]})]}),!_0xd581c5&&a35_0x2db286(Box,{'children':a35_0x48567d(Text,{'color':'gray','children':['\x20','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)']})})]}),_0x2b424c===_0x3772a4(0x1e6)&&a35_0x48567d(Box,{'children':[a35_0x2db286(Text,{'children':_0x3772a4(0x1d8)}),_0x5cde85&&a35_0x2db286(Text,{'color':_0x3772a4(0x1ea),'children':_0x3772a4(0x1df)})]}),_0x2b424c===_0x3772a4(0x1d5)&&a35_0x48567d(a35_0x1939d9,{'children':[a35_0x2db286(Box,{'children':a35_0x2db286(Text,{'color':_0x3772a4(0x1fe),'children':_0x3772a4(0x1c4)})}),a35_0x2db286(Box,{'marginTop':0x1,'children':a35_0x2db286(Text,{'children':_0x3772a4(0x1f5)})}),a35_0x48567d(Box,{'marginLeft':0x2,'children':[a35_0x48567d(Text,{'color':_0x1e3d71===0x0?'green':_0x3772a4(0x1ea),'children':[_0x1e3d71===0x0?'▶\x20':'\x20\x20','Yes']}),a35_0x2db286(Text,{'children':'\x20'}),a35_0x48567d(Text,{'color':_0x1e3d71===0x1?_0x3772a4(0x1fe):_0x3772a4(0x1ea),'children':[_0x1e3d71===0x1?'▶\x20':'\x20\x20','No']})]}),a35_0x2db286(Box,{'children':a35_0x2db286(Text,{'color':_0x3772a4(0x1ea),'children':_0x3772a4(0x1c2)})}),a35_0x2db286(Box,{'children':a35_0x2db286(Text,{'color':_0x3772a4(0x1cd),'children':'\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口'})})]}),_0x2b424c===_0x3772a4(0x1f0)&&a35_0x48567d(a35_0x1939d9,{'children':[a35_0x2db286(Box,{'children':a35_0x2db286(Text,{'color':_0x3772a4(0x1cd),'children':_0x3772a4(0x1dd)})}),a35_0x2db286(Box,{'marginTop':0x1,'children':a35_0x2db286(Text,{'children':_0x3772a4(0x1ec)})}),a35_0x48567d(Box,{'marginLeft':0x2,'children':[a35_0x48567d(Text,{'color':_0xea4d7b===0x0?'green':_0x3772a4(0x1ea),'children':[_0xea4d7b===0x0?'▶\x20':'\x20\x20',_0x3772a4(0x1e8)]}),a35_0x2db286(Text,{'children':'\x20'}),a35_0x48567d(Text,{'color':_0xea4d7b===0x1?'green':_0x3772a4(0x1ea),'children':[_0xea4d7b===0x1?'▶\x20':'\x20\x20','No']})]}),a35_0x2db286(Box,{'children':a35_0x2db286(Text,{'color':_0x3772a4(0x1ea),'children':_0x3772a4(0x1c2)})}),a35_0x2db286(Box,{'children':a35_0x2db286(Text,{'color':'yellow','children':_0x3772a4(0x1c5)})})]}),_0x2b424c==='login-process'&&a35_0x48567d(Box,{'children':[a35_0x2db286(Text,{'children':_0x3772a4(0x1e2)}),_0x29b089&&a35_0x2db286(Text,{'color':_0x3772a4(0x1ea),'children':_0x3772a4(0x1f2)})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a36_0x4dfc(){const _0x258426=['58399WFhzcD','65BNyvfJ','490JgFTqJ','replace','72200Tlqapt','21hrZPLC','390143obgpJw','12878jvOFtP','236328rIKpWx','3401046zTNwlV','3386358SKbbVG','75qQmFoR'];a36_0x4dfc=function(){return _0x258426;};return a36_0x4dfc();}function a36_0x40cb(_0x1621ba,_0x484304){const _0x4dfcf8=a36_0x4dfc();return a36_0x40cb=function(_0x40cb06,_0x2c676e){_0x40cb06=_0x40cb06-0x97;let _0xf0478d=_0x4dfcf8[_0x40cb06];return _0xf0478d;},a36_0x40cb(_0x1621ba,_0x484304);}(function(_0xcfb45c,_0x536fb9){const _0x54480c=a36_0x40cb,_0x225c9d=_0xcfb45c();while(!![]){try{const _0x348cb4=-parseInt(_0x54480c(0x97))/0x1+-parseInt(_0x54480c(0x98))/0x2*(parseInt(_0x54480c(0x9c))/0x3)+-parseInt(_0x54480c(0xa1))/0x4*(parseInt(_0x54480c(0x9e))/0x5)+parseInt(_0x54480c(0x9b))/0x6+-parseInt(_0x54480c(0xa2))/0x7*(parseInt(_0x54480c(0x99))/0x8)+parseInt(_0x54480c(0x9a))/0x9+-parseInt(_0x54480c(0x9f))/0xa*(-parseInt(_0x54480c(0x9d))/0xb);if(_0x348cb4===_0x536fb9)break;else _0x225c9d['push'](_0x225c9d['shift']());}catch(_0x24f276){_0x225c9d['push'](_0x225c9d['shift']());}}}(a36_0x4dfc,0x50165));export function formatElapsed(_0xcda916){const _0x1c5a41=a36_0x40cb,_0x57d429=Date['now']()-_0xcda916;if(_0x57d429<0x3e8)return _0x57d429+'ms';const _0x8b35b=(_0x57d429/0x3e8)['toFixed'](0x2),_0x1e1b02=_0x8b35b[_0x1c5a41(0xa0)](/\.?0+$/u,'');return _0x1e1b02+'s';}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function a31_0x1498(_0x24bea3,_0x1220fd){const _0x5700b8=a31_0x5700();return a31_0x1498=function(_0x149884,_0xf842fd){_0x149884=_0x149884-0x18a;let _0x9e5bb5=_0x5700b8[_0x149884];return _0x9e5bb5;},a31_0x1498(_0x24bea3,_0x1220fd);}function a31_0x5700(){const _0x542e99=['doTask','19580hEeTlK','*\x20正在拉取\x20API\x20配置...','8suWQaX','×\x20项目名过长,最多支持\x20100\x20个字符','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','√\x20配置文件已创建,应用AppCode:\x20','502545SEkvrk','×\x20项目名不能为空','配置应用AppCode:\x20','existsSync','×\x20项目创建失败:\x20','6370wkzkoH','API\x20配置拉取失败:\x20','warn','5467390JZTRow','\x20√\x20','6OQSvzA','API\x20配置拉取异常:\x20','repeat','🚀\x20接下来可以:','resolve','*\x20清理失败的项目目录:\x20','3456873kyXdOf','log','启动项目:\x20','online','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','package.json','\x20已存在,请使用其他项目名','version','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','appCode','cyan','未配置','*\x20正在为项目\x20','green','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','1.\x20','rmSync','pullApi','projectCode','dirname','projectName','gray','配置应用AppCode失败:\x20','698482PjgQML','4489064VQrMEE','项目创建完成:\x20','*\x20配置文件路径:\x20','utf8','join','🔗\x20应用AppCode:\x20','env','需手动拉取','parse','readFileSync','info','create','yellow','constants','\x20配置应用AppCode:\x20','\x20创建配置文件','开始创建项目:\x20','3.\x20','white','W_OK','\x20|\x20应用AppCode:\x20','cd\x20','accessSync','×\x20项目目录\x20','stringify','4wYeLEW','success','../..','message','621719GPVxUZ','url','test','error','📦\x20API配置:\x20','\x20&&\x20lovrabet\x20start','项目名称:\x20','lovrabet\x20config\x20set\x20appcode\x20[app-code]','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','string','length'];a31_0x5700=function(){return _0x542e99;};return a31_0x5700();}(function(_0x11de7b,_0x5b2db7){const _0x37dea3=a31_0x1498,_0x434b6f=_0x11de7b();while(!![]){try{const _0x4c99f7=-parseInt(_0x37dea3(0x1cd))/0x1+-parseInt(_0x37dea3(0x1a2))/0x2*(-parseInt(_0x37dea3(0x1a6))/0x3)+-parseInt(_0x37dea3(0x190))/0x4*(parseInt(_0x37dea3(0x1ae))/0x5)+-parseInt(_0x37dea3(0x1b0))/0x6*(parseInt(_0x37dea3(0x194))/0x7)+parseInt(_0x37dea3(0x1ce))/0x8+parseInt(_0x37dea3(0x1b6))/0x9+-parseInt(_0x37dea3(0x1ab))/0xa*(-parseInt(_0x37dea3(0x1a0))/0xb);if(_0x4c99f7===_0x5b2db7)break;else _0x434b6f['push'](_0x434b6f['shift']());}catch(_0x6e1395){_0x434b6f['push'](_0x434b6f['shift']());}}}(a31_0x5700,0xd4015));import{jsx as a31_0x56c6be,Fragment as a31_0x4ac6bb,jsxs as a31_0x29513c}from'react/jsx-runtime';import a31_0x399231 from'node:path';import a31_0x5143f8 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x256566){const _0x2d6b53=a31_0x1498,[_0x585007,_0x28a0ad]=useState(![]),[_0x3e5d7a,_0x4a2b9f]=useState(![]),[_0x52468c,_0x69c846]=useState(null),_0x30ee61=useCopyProjectTemplate(),_0x8fc0c4=useInstallDependencies(),_0x3c9dbf=useFormatCode(),_0x1ec0c6=async _0x382b83=>{const _0x47ecb7=a31_0x1498;if(!_0x382b83[_0x47ecb7(0x1ca)]||_0x382b83[_0x47ecb7(0x1ca)]['trim']()===''){console[_0x47ecb7(0x197)](_0x47ecb7(0x1a7));return;}const _0x2da61b=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x2da61b[_0x47ecb7(0x196)](_0x382b83[_0x47ecb7(0x1ca)])){console[_0x47ecb7(0x197)](_0x47ecb7(0x1be));return;}if(_0x382b83[_0x47ecb7(0x1ca)][_0x47ecb7(0x19e)]>0x64){console[_0x47ecb7(0x197)](_0x47ecb7(0x1a3));return;}const _0x444bad=a31_0x399231[_0x47ecb7(0x1b4)](process['cwd'](),_0x382b83[_0x47ecb7(0x1ca)]);if(a31_0x5143f8[_0x47ecb7(0x1a9)](_0x444bad)){console['error'](_0x47ecb7(0x18e)+_0x382b83[_0x47ecb7(0x1ca)]+_0x47ecb7(0x1bc));return;}try{const _0x1f8249=a31_0x399231[_0x47ecb7(0x1c9)](_0x444bad);a31_0x5143f8[_0x47ecb7(0x18d)](_0x1f8249,a31_0x5143f8[_0x47ecb7(0x1db)][_0x47ecb7(0x18a)]);}catch(_0x3adb49){console[_0x47ecb7(0x197)]('×\x20无法在当前目录创建项目,请检查目录权限');return;}_0x69c846(_0x382b83),_0x28a0ad(!![]),logger['setLogPath'](_0x444bad),logger[_0x47ecb7(0x1d8)]('create',_0x47ecb7(0x1de)+_0x382b83[_0x47ecb7(0x1ca)],{'projectDir':_0x444bad,'appCode':_0x382b83[_0x47ecb7(0x1bf)]});try{await _0x30ee61['doTask'](_0x382b83[_0x47ecb7(0x1ca)]),await _0x8fc0c4[_0x47ecb7(0x19f)](_0x382b83['projectName']),await _0x3c9dbf[_0x47ecb7(0x19f)](_0x382b83['projectName']),await _0x38b7d4(_0x382b83[_0x47ecb7(0x1ca)],_0x382b83['appCode']||'',_0x382b83['env']);if(_0x382b83[_0x47ecb7(0x1c7)]&&_0x382b83[_0x47ecb7(0x1bf)]){console[_0x47ecb7(0x1b7)](_0x47ecb7(0x1a1));try{const _0x4c0a4a=await pullApiSilent(_0x382b83[_0x47ecb7(0x1bf)],undefined,_0x444bad,_0x382b83[_0x47ecb7(0x1d4)]);_0x4c0a4a?(console[_0x47ecb7(0x1b7)]('√\x20API\x20配置拉取完成'),logger[_0x47ecb7(0x1d8)](_0x47ecb7(0x1d9),'API\x20配置拉取成功:\x20'+_0x382b83[_0x47ecb7(0x1bf)],{'projectDir':_0x444bad,'appCode':_0x382b83[_0x47ecb7(0x1bf)],'env':_0x382b83[_0x47ecb7(0x1d4)]})):(console[_0x47ecb7(0x1b7)](_0x47ecb7(0x19c)),logger[_0x47ecb7(0x1ad)](_0x47ecb7(0x1d9),_0x47ecb7(0x1ac)+_0x382b83[_0x47ecb7(0x1bf)],{'projectDir':_0x444bad,'appCode':_0x382b83['appCode'],'env':_0x382b83[_0x47ecb7(0x1d4)]}));}catch(_0x52b0cb){console[_0x47ecb7(0x1b7)](_0x47ecb7(0x1a4)),logger['warn'](_0x47ecb7(0x1d9),_0x47ecb7(0x1b1)+_0x382b83[_0x47ecb7(0x1bf)],{'projectDir':_0x444bad,'appCode':_0x382b83['appCode'],'env':_0x382b83[_0x47ecb7(0x1d4)],'error':_0x52b0cb instanceof Error?_0x52b0cb['message']:String(_0x52b0cb)});}}logger[_0x47ecb7(0x191)](_0x47ecb7(0x1d9),_0x47ecb7(0x1cf)+_0x382b83[_0x47ecb7(0x1ca)]),_0x4a2b9f(!![]),_0x28a0ad(![]);}catch(_0x420b6c){logger[_0x47ecb7(0x197)](_0x47ecb7(0x1d9),'项目创建失败:\x20'+_0x382b83[_0x47ecb7(0x1ca)],{'error':_0x420b6c instanceof Error?_0x420b6c[_0x47ecb7(0x193)]:String(_0x420b6c)});try{a31_0x5143f8[_0x47ecb7(0x1a9)](_0x444bad)&&(console[_0x47ecb7(0x1b7)](_0x47ecb7(0x1b5)+_0x444bad),a31_0x5143f8[_0x47ecb7(0x1c6)](_0x444bad,{'recursive':!![],'force':!![]}));}catch(_0x1b7a99){logger[_0x47ecb7(0x1ad)](_0x47ecb7(0x1d9),'清理项目目录失败:\x20'+_0x444bad,{'error':_0x1b7a99 instanceof Error?_0x1b7a99[_0x47ecb7(0x193)]:String(_0x1b7a99)});}_0x28a0ad(![]),console[_0x47ecb7(0x197)](_0x47ecb7(0x1aa)+(_0x420b6c instanceof Error?_0x420b6c[_0x47ecb7(0x193)]:String(_0x420b6c)));}},_0xaabaaf=async _0x3e0085=>{const _0x33a36e=a31_0x1498;await _0x1ec0c6({'projectName':_0x3e0085,'env':_0x256566[_0x33a36e(0x1d4)]});},_0x38b7d4=async(_0x25be1e,_0x3f1444,_0x13b574)=>{const _0x407d01=a31_0x1498,_0x5ed603=a31_0x399231['resolve'](process['cwd'](),_0x25be1e),_0xfd5dc3=a31_0x399231[_0x407d01(0x1d2)](_0x5ed603,'.lovrabetrc');try{_0x3f1444?console[_0x407d01(0x1b7)](_0x407d01(0x1c2)+_0x25be1e+_0x407d01(0x1dc)+_0x3f1444):console[_0x407d01(0x1b7)]('*\x20正在为项目\x20'+_0x25be1e+_0x407d01(0x1dd));console[_0x407d01(0x1b7)](_0x407d01(0x1d0)+_0xfd5dc3);const _0x4c9bb8=fileURLToPath(import.meta[_0x407d01(0x195)]),_0x289e6e=a31_0x399231['resolve'](a31_0x399231['dirname'](_0x4c9bb8),_0x407d01(0x192)),_0x30c4fc=a31_0x399231[_0x407d01(0x1d2)](_0x289e6e,_0x407d01(0x1bb));let _0x252dac='1.0.0';try{const _0x43179d=JSON[_0x407d01(0x1d6)](a31_0x5143f8[_0x407d01(0x1d7)](_0x30c4fc,_0x407d01(0x1d1)));_0x252dac=_0x43179d[_0x407d01(0x1bd)]||'1.0.0';}catch(_0x15276f){}const _0x19320b=readConfig(),_0x54afc8=typeof _0x19320b[_0x407d01(0x1d4)]===_0x407d01(0x19d)?_0x19320b[_0x407d01(0x1d4)]:undefined,{app:_0x3ee9d3,appcode:_0xc67eb9,..._0x1217a3}=_0x19320b,_0xd06701={..._0x1217a3,'appcode':_0x3f1444||'','env':_0x13b574||_0x54afc8||_0x407d01(0x1b9),'createdAt':new Date()['toLocaleString'](),'version':_0x252dac};a31_0x5143f8['writeFileSync'](_0xfd5dc3,JSON[_0x407d01(0x18f)](_0xd06701,null,0x2),'utf8'),_0x3f1444?console[_0x407d01(0x1b7)](_0x407d01(0x1a5)+_0x3f1444):console[_0x407d01(0x1b7)](_0x407d01(0x1ba)),logger[_0x407d01(0x1d8)](_0x407d01(0x1d9),_0x407d01(0x1a8)+_0x3f1444,{'projectName':_0x25be1e,'configFile':'.lovrabetrc'});}catch(_0x4713ca){logger[_0x407d01(0x197)](_0x407d01(0x1d9),_0x407d01(0x1cc)+_0x3f1444,{'projectName':_0x25be1e,'error':_0x4713ca instanceof Error?_0x4713ca[_0x407d01(0x193)]:String(_0x4713ca)});}};useEffect(()=>{const _0x35c5f6=a31_0x1498;_0x256566[_0x35c5f6(0x1c8)]&&_0xaabaaf(_0x256566[_0x35c5f6(0x1c8)]);},[_0x256566['projectCode']]);if(!_0x585007&&!_0x3e5d7a&&!_0x256566[_0x2d6b53(0x1c8)])return a31_0x56c6be(EnhancedGuidedCreate,{'onCreate':_0x1ec0c6,'env':_0x256566[_0x2d6b53(0x1d4)]});if(_0x585007)return a31_0x29513c(a31_0x4ac6bb,{'children':[a31_0x29513c(Box,{'marginTop':0x1,'children':[a31_0x56c6be(Box,{'width':'1'}),a31_0x56c6be(Text,{'color':_0x2d6b53(0x1c3),'children':'\x20√\x20'}),a31_0x56c6be(Text,{'children':_0x2d6b53(0x19a)}),a31_0x56c6be(Text,{'color':'green','children':_0x52468c?.[_0x2d6b53(0x1ca)]}),_0x52468c?.[_0x2d6b53(0x1bf)]&&a31_0x29513c(a31_0x4ac6bb,{'children':[a31_0x56c6be(Text,{'children':'\x20|\x20应用AppCode:\x20'}),a31_0x56c6be(Text,{'color':_0x2d6b53(0x1c0),'children':_0x52468c['appCode']})]})]}),a31_0x56c6be(TaskRunning,{..._0x30ee61}),a31_0x56c6be(TaskRunning,{..._0x8fc0c4}),a31_0x56c6be(TaskRunning,{..._0x3c9dbf})]});if(_0x3e5d7a)return a31_0x29513c(a31_0x4ac6bb,{'children':[a31_0x29513c(Box,{'marginTop':0x1,'children':[a31_0x56c6be(Box,{'width':'1'}),a31_0x56c6be(Text,{'color':'green','children':_0x2d6b53(0x1af)}),a31_0x56c6be(Text,{'children':'项目名称:\x20'}),a31_0x56c6be(Text,{'color':'green','children':_0x52468c?.[_0x2d6b53(0x1ca)]}),_0x52468c?.[_0x2d6b53(0x1bf)]&&a31_0x29513c(a31_0x4ac6bb,{'children':[a31_0x56c6be(Text,{'children':_0x2d6b53(0x18b)}),a31_0x56c6be(Text,{'color':_0x2d6b53(0x1c0),'children':_0x52468c[_0x2d6b53(0x1bf)]})]})]}),a31_0x56c6be(TaskFinished,{..._0x30ee61}),a31_0x56c6be(TaskFinished,{..._0x8fc0c4}),a31_0x56c6be(TaskFinished,{..._0x3c9dbf}),a31_0x56c6be(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a31_0x56c6be(Text,{'color':_0x2d6b53(0x1c3),'children':'─'[_0x2d6b53(0x1b2)](0x3c)})}),a31_0x56c6be(Box,{'children':a31_0x56c6be(Text,{'color':_0x2d6b53(0x1c3),'bold':!![],'children':'🎉\x20项目创建成功!'})}),a31_0x29513c(Box,{'marginTop':0x1,'flexDirection':'column','children':[a31_0x29513c(Box,{'children':[a31_0x56c6be(Text,{'color':'cyan','children':'📁\x20项目名称:\x20'}),a31_0x56c6be(Text,{'color':'white','bold':!![],'children':_0x52468c?.['projectName']})]}),_0x52468c?.[_0x2d6b53(0x1bf)]&&a31_0x29513c(Box,{'children':[a31_0x56c6be(Text,{'color':_0x2d6b53(0x1c0),'children':_0x2d6b53(0x1d3)}),a31_0x56c6be(Text,{'color':_0x2d6b53(0x1e0),'bold':!![],'children':_0x52468c[_0x2d6b53(0x1bf)]})]}),a31_0x29513c(Box,{'children':[a31_0x56c6be(Text,{'color':'cyan','children':_0x2d6b53(0x198)}),_0x52468c?.[_0x2d6b53(0x1c7)]?a31_0x56c6be(Text,{'color':_0x2d6b53(0x1c3),'bold':!![],'children':'已自动拉取\x20✓'}):_0x52468c?.['appCode']?a31_0x56c6be(Text,{'color':_0x2d6b53(0x1da),'bold':!![],'children':_0x2d6b53(0x1d5)}):a31_0x56c6be(Text,{'color':'gray','bold':!![],'children':_0x2d6b53(0x1c1)})]})]}),a31_0x56c6be(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a31_0x56c6be(Text,{'color':'cyan','bold':!![],'children':_0x2d6b53(0x1b3)})}),a31_0x29513c(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a31_0x29513c(Box,{'children':[a31_0x56c6be(Text,{'color':_0x2d6b53(0x1c3),'children':_0x2d6b53(0x1c5)}),a31_0x56c6be(Text,{'color':_0x2d6b53(0x1e0),'children':_0x2d6b53(0x1b8)}),a31_0x56c6be(Text,{'color':_0x2d6b53(0x1c0),'bold':!![],'children':_0x2d6b53(0x18c)+_0x52468c?.[_0x2d6b53(0x1ca)]+_0x2d6b53(0x199)})]}),_0x52468c?.[_0x2d6b53(0x1bf)]&&!_0x52468c?.[_0x2d6b53(0x1c7)]&&a31_0x29513c(Box,{'children':[a31_0x56c6be(Text,{'color':_0x2d6b53(0x1da),'children':'2.\x20'}),a31_0x56c6be(Text,{'color':_0x2d6b53(0x1e0),'children':'拉取API配置:\x20'}),a31_0x56c6be(Text,{'color':_0x2d6b53(0x1c0),'bold':!![],'children':'lovrabet\x20api\x20pull'})]}),!_0x52468c?.[_0x2d6b53(0x1bf)]&&a31_0x29513c(a31_0x4ac6bb,{'children':[a31_0x29513c(Box,{'children':[a31_0x56c6be(Text,{'color':'gray','children':'2.\x20'}),a31_0x56c6be(Text,{'color':'white','children':'配置AppCode:\x20'}),a31_0x56c6be(Text,{'color':_0x2d6b53(0x1c0),'bold':!![],'children':_0x2d6b53(0x19b)})]}),a31_0x29513c(Box,{'children':[a31_0x56c6be(Text,{'color':_0x2d6b53(0x1cb),'children':_0x2d6b53(0x1df)}),a31_0x56c6be(Text,{'color':_0x2d6b53(0x1e0),'children':'拉取API配置:\x20'}),a31_0x56c6be(Text,{'color':_0x2d6b53(0x1c0),'bold':!![],'children':_0x2d6b53(0x1c4)})]})]})]}),a31_0x56c6be(Box,{'marginTop':0x1,'children':a31_0x56c6be(Text,{'color':'green','children':'─'['repeat'](0x3c)})})]});return null;}
|
|
1
|
+
(function(_0xacceed,_0x129524){const _0x354325=a37_0x221a,_0x13efe3=_0xacceed();while(!![]){try{const _0x4b6ad6=-parseInt(_0x354325(0x1f8))/0x1+parseInt(_0x354325(0x1c6))/0x2+parseInt(_0x354325(0x1eb))/0x3+-parseInt(_0x354325(0x1ff))/0x4+-parseInt(_0x354325(0x1c9))/0x5*(-parseInt(_0x354325(0x1ce))/0x6)+-parseInt(_0x354325(0x1f1))/0x7+-parseInt(_0x354325(0x1bd))/0x8*(parseInt(_0x354325(0x20d))/0x9);if(_0x4b6ad6===_0x129524)break;else _0x13efe3['push'](_0x13efe3['shift']());}catch(_0x31ab4d){_0x13efe3['push'](_0x13efe3['shift']());}}}(a37_0x20df,0x5b2da));import{jsx as a37_0x1dff90,Fragment as a37_0x1a867f,jsxs as a37_0x25edd9}from'react/jsx-runtime';import a37_0x363484 from'node:path';import a37_0x5718aa from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';function a37_0x221a(_0x4b44c8,_0x1c4c3c){const _0x20dfd0=a37_0x20df();return a37_0x221a=function(_0x221a96,_0x177301){_0x221a96=_0x221a96-0x1b9;let _0x18715d=_0x20dfd0[_0x221a96];return _0x18715d;},a37_0x221a(_0x4b44c8,_0x1c4c3c);}function a37_0x20df(){const _0x4cc737=['需手动拉取','toLocaleString','252850rnqrYB','column','string','error','W_OK','78AttcOq','repeat','*\x20配置文件路径:\x20','√\x20配置文件已创建,应用AppCode:\x20','×\x20项目名过长,最多支持\x20100\x20个字符','\x20√\x20','warn','API\x20配置拉取失败:\x20','white','package.json','rmSync','\x20|\x20应用AppCode:\x20','🚀\x20接下来可以:','dirname','setLogPath','../..','appCode','API\x20配置拉取成功:\x20','×\x20无法在当前目录创建项目,请检查目录权限','🎉\x20项目创建成功!','配置应用AppCode失败:\x20','1.\x20','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','projectName','message','projectCode','env','lovrabet\x20api\x20pull','pullApi','1676172dqrjEn','writeFileSync','启动项目:\x20','项目名称:\x20','resolve','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','120379FTCMhk','info','未配置','开始创建项目:\x20','accessSync','*\x20清理失败的项目目录:\x20','拉取API配置:\x20','22333sqlajw','parse','*\x20正在为项目\x20','×\x20项目创建失败:\x20','log','join','\x20&&\x20lovrabet\x20start','1014216ANZbds','*\x20正在拉取\x20API\x20配置...','3.\x20','gray','📁\x20项目名称:\x20','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','create','success','清理项目目录失败:\x20','readFileSync','API\x20配置拉取异常:\x20','2.\x20','yellow','📦\x20API配置:\x20','1494tjCtSE','项目创建失败:\x20','length','doTask','lovrabet\x20config\x20set\x20appcode\x20[app-code]','1.0.0','\x20创建配置文件','已自动拉取\x20✓','cyan','30088arxuYD','existsSync','.lovrabetrc','cwd','\x20已存在,请使用其他项目名','green','cd\x20','utf8','项目创建完成:\x20','149484iYBaZC'];a37_0x20df=function(){return _0x4cc737;};return a37_0x20df();}import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x4ed417){const _0x470d65=a37_0x221a,[_0xfbf837,_0x493f82]=useState(![]),[_0x13a7bb,_0x32582d]=useState(![]),[_0x18d121,_0x412501]=useState(null),_0x1033b7=useCopyProjectTemplate(),_0x44a1fb=useInstallDependencies(),_0x3ebc60=useFormatCode(),_0x26fa19=async _0xfcf6fc=>{const _0x970aba=a37_0x221a;if(!_0xfcf6fc[_0x970aba(0x1e5)]||_0xfcf6fc[_0x970aba(0x1e5)]['trim']()===''){console[_0x970aba(0x1cc)]('×\x20项目名不能为空');return;}const _0xafce7d=/[<>:"|?*\x00-\x1f\x7f]/;if(_0xafce7d['test'](_0xfcf6fc[_0x970aba(0x1e5)])){console[_0x970aba(0x1cc)](_0x970aba(0x1e4));return;}if(_0xfcf6fc[_0x970aba(0x1e5)][_0x970aba(0x20f)]>0x64){console[_0x970aba(0x1cc)](_0x970aba(0x1d2));return;}const _0x451b35=a37_0x363484['resolve'](process[_0x970aba(0x1c0)](),_0xfcf6fc['projectName']);if(a37_0x5718aa[_0x970aba(0x1be)](_0x451b35)){console[_0x970aba(0x1cc)]('×\x20项目目录\x20'+_0xfcf6fc[_0x970aba(0x1e5)]+_0x970aba(0x1c1));return;}try{const _0x3d1462=a37_0x363484[_0x970aba(0x1db)](_0x451b35);a37_0x5718aa[_0x970aba(0x1f5)](_0x3d1462,a37_0x5718aa['constants'][_0x970aba(0x1cd)]);}catch(_0x550c6e){console['error'](_0x970aba(0x1e0));return;}_0x412501(_0xfcf6fc),_0x493f82(!![]),logger[_0x970aba(0x1dc)](_0x451b35),logger['info'](_0x970aba(0x205),_0x970aba(0x1f4)+_0xfcf6fc[_0x970aba(0x1e5)],{'projectDir':_0x451b35,'appCode':_0xfcf6fc[_0x970aba(0x1de)]});try{await _0x1033b7[_0x970aba(0x210)](_0xfcf6fc[_0x970aba(0x1e5)]),await _0x44a1fb[_0x970aba(0x210)](_0xfcf6fc[_0x970aba(0x1e5)]),await _0x3ebc60[_0x970aba(0x210)](_0xfcf6fc[_0x970aba(0x1e5)]),await _0x58287f(_0xfcf6fc[_0x970aba(0x1e5)],_0xfcf6fc[_0x970aba(0x1de)]||'',_0xfcf6fc[_0x970aba(0x1e8)]);if(_0xfcf6fc[_0x970aba(0x1ea)]&&_0xfcf6fc[_0x970aba(0x1de)]){console['log'](_0x970aba(0x200));try{const _0x45246f=await pullApiSilent(_0xfcf6fc[_0x970aba(0x1de)],undefined,_0x451b35,_0xfcf6fc[_0x970aba(0x1e8)]);_0x45246f?(console[_0x970aba(0x1fc)]('√\x20API\x20配置拉取完成'),logger[_0x970aba(0x1f2)](_0x970aba(0x205),_0x970aba(0x1df)+_0xfcf6fc[_0x970aba(0x1de)],{'projectDir':_0x451b35,'appCode':_0xfcf6fc['appCode'],'env':_0xfcf6fc[_0x970aba(0x1e8)]})):(console[_0x970aba(0x1fc)](_0x970aba(0x204)),logger[_0x970aba(0x1d4)](_0x970aba(0x205),_0x970aba(0x1d5)+_0xfcf6fc[_0x970aba(0x1de)],{'projectDir':_0x451b35,'appCode':_0xfcf6fc[_0x970aba(0x1de)],'env':_0xfcf6fc[_0x970aba(0x1e8)]}));}catch(_0xcb56c9){console[_0x970aba(0x1fc)]('!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x970aba(0x1d4)]('create',_0x970aba(0x209)+_0xfcf6fc[_0x970aba(0x1de)],{'projectDir':_0x451b35,'appCode':_0xfcf6fc[_0x970aba(0x1de)],'env':_0xfcf6fc[_0x970aba(0x1e8)],'error':_0xcb56c9 instanceof Error?_0xcb56c9[_0x970aba(0x1e6)]:String(_0xcb56c9)});}}logger[_0x970aba(0x206)](_0x970aba(0x205),_0x970aba(0x1c5)+_0xfcf6fc['projectName']),_0x32582d(!![]),_0x493f82(![]);}catch(_0x4fb58a){logger[_0x970aba(0x1cc)](_0x970aba(0x205),_0x970aba(0x20e)+_0xfcf6fc[_0x970aba(0x1e5)],{'error':_0x4fb58a instanceof Error?_0x4fb58a[_0x970aba(0x1e6)]:String(_0x4fb58a)});try{a37_0x5718aa[_0x970aba(0x1be)](_0x451b35)&&(console['log'](_0x970aba(0x1f6)+_0x451b35),a37_0x5718aa[_0x970aba(0x1d8)](_0x451b35,{'recursive':!![],'force':!![]}));}catch(_0x28d06d){logger[_0x970aba(0x1d4)](_0x970aba(0x205),_0x970aba(0x207)+_0x451b35,{'error':_0x28d06d instanceof Error?_0x28d06d['message']:String(_0x28d06d)});}_0x493f82(![]),console[_0x970aba(0x1cc)](_0x970aba(0x1fb)+(_0x4fb58a instanceof Error?_0x4fb58a[_0x970aba(0x1e6)]:String(_0x4fb58a)));}},_0x2b8178=async _0x51ccd2=>{await _0x26fa19({'projectName':_0x51ccd2,'env':_0x4ed417['env']});},_0x58287f=async(_0x1e4ffe,_0xa61769,_0x4b12f2)=>{const _0x4dbb71=a37_0x221a,_0x114285=a37_0x363484[_0x4dbb71(0x1ef)](process[_0x4dbb71(0x1c0)](),_0x1e4ffe),_0x1a853b=a37_0x363484[_0x4dbb71(0x1fd)](_0x114285,_0x4dbb71(0x1bf));try{_0xa61769?console[_0x4dbb71(0x1fc)](_0x4dbb71(0x1fa)+_0x1e4ffe+'\x20配置应用AppCode:\x20'+_0xa61769):console['log'](_0x4dbb71(0x1fa)+_0x1e4ffe+_0x4dbb71(0x1ba));console[_0x4dbb71(0x1fc)](_0x4dbb71(0x1d0)+_0x1a853b);const _0x119b97=fileURLToPath(import.meta['url']),_0x4549f7=a37_0x363484[_0x4dbb71(0x1ef)](a37_0x363484[_0x4dbb71(0x1db)](_0x119b97),_0x4dbb71(0x1dd)),_0xc3a5c2=a37_0x363484[_0x4dbb71(0x1fd)](_0x4549f7,_0x4dbb71(0x1d7));let _0x1b2b7e=_0x4dbb71(0x1b9);try{const _0x505794=JSON[_0x4dbb71(0x1f9)](a37_0x5718aa[_0x4dbb71(0x208)](_0xc3a5c2,_0x4dbb71(0x1c4)));_0x1b2b7e=_0x505794['version']||_0x4dbb71(0x1b9);}catch(_0x1e495c){}const _0x198fbc=readConfig(),_0x598d17=typeof _0x198fbc['env']===_0x4dbb71(0x1cb)?_0x198fbc[_0x4dbb71(0x1e8)]:undefined,{app:_0x3fa7c6,appcode:_0x46d272,..._0x1173cf}=_0x198fbc,_0x41021a={..._0x1173cf,'appcode':_0xa61769||'','env':_0x4b12f2||_0x598d17||'online','createdAt':new Date()[_0x4dbb71(0x1c8)](),'version':_0x1b2b7e};a37_0x5718aa[_0x4dbb71(0x1ec)](_0x1a853b,JSON['stringify'](_0x41021a,null,0x2),'utf8'),_0xa61769?console['log'](_0x4dbb71(0x1d1)+_0xa61769):console[_0x4dbb71(0x1fc)](_0x4dbb71(0x1f0)),logger[_0x4dbb71(0x1f2)](_0x4dbb71(0x205),'配置应用AppCode:\x20'+_0xa61769,{'projectName':_0x1e4ffe,'configFile':_0x4dbb71(0x1bf)});}catch(_0xb276ad){logger['error'](_0x4dbb71(0x205),_0x4dbb71(0x1e2)+_0xa61769,{'projectName':_0x1e4ffe,'error':_0xb276ad instanceof Error?_0xb276ad[_0x4dbb71(0x1e6)]:String(_0xb276ad)});}};useEffect(()=>{const _0x5a83d5=a37_0x221a;_0x4ed417[_0x5a83d5(0x1e7)]&&_0x2b8178(_0x4ed417[_0x5a83d5(0x1e7)]);},[_0x4ed417[_0x470d65(0x1e7)]]);if(!_0xfbf837&&!_0x13a7bb&&!_0x4ed417[_0x470d65(0x1e7)])return a37_0x1dff90(EnhancedGuidedCreate,{'onCreate':_0x26fa19,'env':_0x4ed417[_0x470d65(0x1e8)]});if(_0xfbf837)return a37_0x25edd9(a37_0x1a867f,{'children':[a37_0x25edd9(Box,{'marginTop':0x1,'children':[a37_0x1dff90(Box,{'width':'1'}),a37_0x1dff90(Text,{'color':_0x470d65(0x1c2),'children':_0x470d65(0x1d3)}),a37_0x1dff90(Text,{'children':_0x470d65(0x1ee)}),a37_0x1dff90(Text,{'color':_0x470d65(0x1c2),'children':_0x18d121?.[_0x470d65(0x1e5)]}),_0x18d121?.['appCode']&&a37_0x25edd9(a37_0x1a867f,{'children':[a37_0x1dff90(Text,{'children':_0x470d65(0x1d9)}),a37_0x1dff90(Text,{'color':_0x470d65(0x1bc),'children':_0x18d121[_0x470d65(0x1de)]})]})]}),a37_0x1dff90(TaskRunning,{..._0x1033b7}),a37_0x1dff90(TaskRunning,{..._0x44a1fb}),a37_0x1dff90(TaskRunning,{..._0x3ebc60})]});if(_0x13a7bb)return a37_0x25edd9(a37_0x1a867f,{'children':[a37_0x25edd9(Box,{'marginTop':0x1,'children':[a37_0x1dff90(Box,{'width':'1'}),a37_0x1dff90(Text,{'color':_0x470d65(0x1c2),'children':_0x470d65(0x1d3)}),a37_0x1dff90(Text,{'children':_0x470d65(0x1ee)}),a37_0x1dff90(Text,{'color':_0x470d65(0x1c2),'children':_0x18d121?.[_0x470d65(0x1e5)]}),_0x18d121?.[_0x470d65(0x1de)]&&a37_0x25edd9(a37_0x1a867f,{'children':[a37_0x1dff90(Text,{'children':_0x470d65(0x1d9)}),a37_0x1dff90(Text,{'color':_0x470d65(0x1bc),'children':_0x18d121[_0x470d65(0x1de)]})]})]}),a37_0x1dff90(TaskFinished,{..._0x1033b7}),a37_0x1dff90(TaskFinished,{..._0x44a1fb}),a37_0x1dff90(TaskFinished,{..._0x3ebc60}),a37_0x1dff90(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a37_0x1dff90(Text,{'color':'green','children':'─'[_0x470d65(0x1cf)](0x3c)})}),a37_0x1dff90(Box,{'children':a37_0x1dff90(Text,{'color':'green','bold':!![],'children':_0x470d65(0x1e1)})}),a37_0x25edd9(Box,{'marginTop':0x1,'flexDirection':_0x470d65(0x1ca),'children':[a37_0x25edd9(Box,{'children':[a37_0x1dff90(Text,{'color':_0x470d65(0x1bc),'children':_0x470d65(0x203)}),a37_0x1dff90(Text,{'color':_0x470d65(0x1d6),'bold':!![],'children':_0x18d121?.[_0x470d65(0x1e5)]})]}),_0x18d121?.['appCode']&&a37_0x25edd9(Box,{'children':[a37_0x1dff90(Text,{'color':_0x470d65(0x1bc),'children':'🔗\x20应用AppCode:\x20'}),a37_0x1dff90(Text,{'color':_0x470d65(0x1d6),'bold':!![],'children':_0x18d121[_0x470d65(0x1de)]})]}),a37_0x25edd9(Box,{'children':[a37_0x1dff90(Text,{'color':_0x470d65(0x1bc),'children':_0x470d65(0x20c)}),_0x18d121?.[_0x470d65(0x1ea)]?a37_0x1dff90(Text,{'color':_0x470d65(0x1c2),'bold':!![],'children':_0x470d65(0x1bb)}):_0x18d121?.[_0x470d65(0x1de)]?a37_0x1dff90(Text,{'color':_0x470d65(0x20b),'bold':!![],'children':_0x470d65(0x1c7)}):a37_0x1dff90(Text,{'color':'gray','bold':!![],'children':_0x470d65(0x1f3)})]})]}),a37_0x1dff90(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a37_0x1dff90(Text,{'color':'cyan','bold':!![],'children':_0x470d65(0x1da)})}),a37_0x25edd9(Box,{'marginLeft':0x2,'flexDirection':_0x470d65(0x1ca),'children':[a37_0x25edd9(Box,{'children':[a37_0x1dff90(Text,{'color':_0x470d65(0x1c2),'children':_0x470d65(0x1e3)}),a37_0x1dff90(Text,{'color':_0x470d65(0x1d6),'children':_0x470d65(0x1ed)}),a37_0x1dff90(Text,{'color':'cyan','bold':!![],'children':_0x470d65(0x1c3)+_0x18d121?.['projectName']+_0x470d65(0x1fe)})]}),_0x18d121?.['appCode']&&!_0x18d121?.[_0x470d65(0x1ea)]&&a37_0x25edd9(Box,{'children':[a37_0x1dff90(Text,{'color':_0x470d65(0x20b),'children':_0x470d65(0x20a)}),a37_0x1dff90(Text,{'color':_0x470d65(0x1d6),'children':_0x470d65(0x1f7)}),a37_0x1dff90(Text,{'color':'cyan','bold':!![],'children':_0x470d65(0x1e9)})]}),!_0x18d121?.['appCode']&&a37_0x25edd9(a37_0x1a867f,{'children':[a37_0x25edd9(Box,{'children':[a37_0x1dff90(Text,{'color':'gray','children':_0x470d65(0x20a)}),a37_0x1dff90(Text,{'color':_0x470d65(0x1d6),'children':'配置AppCode:\x20'}),a37_0x1dff90(Text,{'color':_0x470d65(0x1bc),'bold':!![],'children':_0x470d65(0x211)})]}),a37_0x25edd9(Box,{'children':[a37_0x1dff90(Text,{'color':_0x470d65(0x202),'children':_0x470d65(0x201)}),a37_0x1dff90(Text,{'color':_0x470d65(0x1d6),'children':_0x470d65(0x1f7)}),a37_0x1dff90(Text,{'color':_0x470d65(0x1bc),'bold':!![],'children':'lovrabet\x20api\x20pull\x20--appcode\x20[app-code]'})]})]})]}),a37_0x1dff90(Box,{'marginTop':0x1,'children':a37_0x1dff90(Text,{'color':_0x470d65(0x1c2),'children':'─'[_0x470d65(0x1cf)](0x3c)})})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x30d3d4,_0x4c7f98){var _0x4a8067=a38_0x59e6,_0x202ad8=_0x30d3d4();while(!![]){try{var _0xdc5577=parseInt(_0x4a8067(0xc8))/0x1*(parseInt(_0x4a8067(0xc1))/0x2)+parseInt(_0x4a8067(0xc7))/0x3*(-parseInt(_0x4a8067(0xbf))/0x4)+parseInt(_0x4a8067(0xbd))/0x5+-parseInt(_0x4a8067(0xc5))/0x6*(-parseInt(_0x4a8067(0xc0))/0x7)+-parseInt(_0x4a8067(0xbc))/0x8+parseInt(_0x4a8067(0xc2))/0x9+-parseInt(_0x4a8067(0xc3))/0xa;if(_0xdc5577===_0x4c7f98)break;else _0x202ad8['push'](_0x202ad8['shift']());}catch(_0x1440fe){_0x202ad8['push'](_0x202ad8['shift']());}}}(a38_0x3fea,0xba9e2));function a38_0x59e6(_0x1cd1d5,_0x4cb0ae){var _0x3feaa4=a38_0x3fea();return a38_0x59e6=function(_0x59e65b,_0x4b9720){_0x59e65b=_0x59e65b-0xbc;var _0x52cc6a=_0x3feaa4[_0x59e65b];return _0x52cc6a;},a38_0x59e6(_0x1cd1d5,_0x4cb0ae);}import{jsx as a38_0x3f924c,jsxs as a38_0x590bd6}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';function a38_0x3fea(){var _0x32f576=['3060752ufNeXZ','6610715XlSjqC','green','15208UAZEHO','56wjKDPi','141412QqJWix','7934661qghtmb','9260320cDxTQd','elapsed','273774vhpvun','\x20√\x20','447udXBYD','1erOsKH'];a38_0x3fea=function(){return _0x32f576;};return a38_0x3fea();}export function TaskFinished(_0x3280d4){var _0x2c2a68=a38_0x59e6;return a38_0x590bd6(Box,{'children':[a38_0x3f924c(Box,{'width':'1'}),a38_0x3f924c(Text,{'color':_0x2c2a68(0xbe),'children':_0x2c2a68(0xc6)}),a38_0x3f924c(Text,{'children':_0x3280d4['taskName']}),a38_0x3f924c(TaskTime,{'elapsed':_0x3280d4[_0x2c2a68(0xc4)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa28048,_0x1aae78){var _0x6cf91c=a39_0x1b8b,_0x5056d3=_0xa28048();while(!![]){try{var _0x27a93e=parseInt(_0x6cf91c(0x155))/0x1*(-parseInt(_0x6cf91c(0x149))/0x2)+-parseInt(_0x6cf91c(0x14a))/0x3*(parseInt(_0x6cf91c(0x148))/0x4)+parseInt(_0x6cf91c(0x153))/0x5*(parseInt(_0x6cf91c(0x152))/0x6)+parseInt(_0x6cf91c(0x151))/0x7+parseInt(_0x6cf91c(0x14b))/0x8+parseInt(_0x6cf91c(0x150))/0x9*(-parseInt(_0x6cf91c(0x14c))/0xa)+parseInt(_0x6cf91c(0x14e))/0xb;if(_0x27a93e===_0x1aae78)break;else _0x5056d3['push'](_0x5056d3['shift']());}catch(_0x8ef64c){_0x5056d3['push'](_0x5056d3['shift']());}}}(a39_0x148c,0xec8b4));import{jsx as a39_0x1ebc67,jsxs as a39_0x19d907}from'react/jsx-runtime';import{Text}from'ink';function a39_0x148c(){var _0x97e898=['2571480FRKzlw','4262510BrpaLO','24KqGpoW','810905VcWsIL','green','111898VfprsB','4bzVoCr','26HsQVxq','4454967BYHIHN','14825216srAffM','50ToIrKu','\x20√\x20','24489751LvZZIW','\x20\x20\x20'];a39_0x148c=function(){return _0x97e898;};return a39_0x148c();}import a39_0x218273 from'ink-spinner';function a39_0x1b8b(_0x594029,_0x3ce518){var _0x148ce3=a39_0x148c();return a39_0x1b8b=function(_0x1b8ba0,_0x1c5431){_0x1b8ba0=_0x1b8ba0-0x148;var _0x20e987=_0x148ce3[_0x1b8ba0];return _0x20e987;},a39_0x1b8b(_0x594029,_0x3ce518);}export function TaskLoading(_0x25dfc8){var _0x70b741=a39_0x1b8b;if(_0x25dfc8['finished'])return a39_0x1ebc67(Text,{'color':_0x70b741(0x154),'children':_0x70b741(0x14d)});if(_0x25dfc8['loading'])return a39_0x19d907(Text,{'color':_0x70b741(0x154),'children':['\x20',a39_0x1ebc67(a39_0x218273,{'type':'dots'}),'\x20']});return a39_0x1ebc67(Text,{'children':_0x70b741(0x14f)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3fead6,_0x22f8f6){var _0x511f7c=a40_0x6d1c,_0x1b5130=_0x3fead6();while(!![]){try{var _0x1db478=-parseInt(_0x511f7c(0xb4))/0x1+-parseInt(_0x511f7c(0xb6))/0x2*(-parseInt(_0x511f7c(0xb2))/0x3)+-parseInt(_0x511f7c(0xb0))/0x4+parseInt(_0x511f7c(0xb5))/0x5+parseInt(_0x511f7c(0xb7))/0x6+parseInt(_0x511f7c(0xb1))/0x7*(parseInt(_0x511f7c(0xb8))/0x8)+-parseInt(_0x511f7c(0xb3))/0x9;if(_0x1db478===_0x22f8f6)break;else _0x1b5130['push'](_0x1b5130['shift']());}catch(_0x355c0a){_0x1b5130['push'](_0x1b5130['shift']());}}}(a40_0x2509,0x1c086));import{jsx as a40_0x46cb07,jsxs as a40_0x2431be}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';function a40_0x6d1c(_0x2aa3ca,_0x44de77){var _0x250974=a40_0x2509();return a40_0x6d1c=function(_0x6d1cdb,_0x228ba2){_0x6d1cdb=_0x6d1cdb-0xaf;var _0x4a40a2=_0x250974[_0x6d1cdb];return _0x4a40a2;},a40_0x6d1c(_0x2aa3ca,_0x44de77);}import{TaskTime}from'./task-time.js';function a40_0x2509(){var _0x3714f8=['7840lsmOVl','13774hCyrnO','541908aeHHXO','3880DracxQ','taskName','elapsed','101024NRkMgu','1995HiibrE','3dmPjQs','270378RMBlrp','66878FLQaOx'];a40_0x2509=function(){return _0x3714f8;};return a40_0x2509();}export function TaskRunning(_0x54d944){var _0x1cee3d=a40_0x6d1c;return a40_0x2431be(Box,{'children':[a40_0x46cb07(Box,{'width':'1'}),a40_0x46cb07(TaskLoading,{..._0x54d944}),a40_0x46cb07(Text,{'children':_0x54d944[_0x1cee3d(0xb9)]}),a40_0x46cb07(TaskTime,{'elapsed':_0x54d944[_0x1cee3d(0xaf)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x528335,_0x2053a0){var _0x395b57=a41_0x48dd,_0x5d4eca=_0x528335();while(!![]){try{var _0xfb5b74=-parseInt(_0x395b57(0x1ec))/0x1+-parseInt(_0x395b57(0x1e3))/0x2*(-parseInt(_0x395b57(0x1e5))/0x3)+parseInt(_0x395b57(0x1e4))/0x4+-parseInt(_0x395b57(0x1eb))/0x5+-parseInt(_0x395b57(0x1ea))/0x6*(parseInt(_0x395b57(0x1e6))/0x7)+-parseInt(_0x395b57(0x1e7))/0x8+parseInt(_0x395b57(0x1ed))/0x9*(parseInt(_0x395b57(0x1e9))/0xa);if(_0xfb5b74===_0x2053a0)break;else _0x5d4eca['push'](_0x5d4eca['shift']());}catch(_0x4487c4){_0x5d4eca['push'](_0x5d4eca['shift']());}}}(a41_0x40d8,0xe7697));import{jsx as a41_0x3afcfb,Fragment as a41_0x3bc19,jsxs as a41_0x4e4dca}from'react/jsx-runtime';function a41_0x40d8(){var _0x6e8430=['116722FsiNxu','6303156JriYmr','75hXxhCa','857703aSCjCl','11937192SZYuGA','elapsed','18526370gSqFfJ','42Sqvfcm','6409310ptBDaY','307874sgVaLc','9mhAuhK','gray'];a41_0x40d8=function(){return _0x6e8430;};return a41_0x40d8();}function a41_0x48dd(_0x504dbb,_0x15b07c){var _0x40d881=a41_0x40d8();return a41_0x48dd=function(_0x48ddb1,_0x9f89a){_0x48ddb1=_0x48ddb1-0x1e3;var _0x16a282=_0x40d881[_0x48ddb1];return _0x16a282;},a41_0x48dd(_0x504dbb,_0x15b07c);}import{Text}from'ink';export function TaskTime(_0x5b7ca8){var _0x41fa45=a41_0x48dd;if(_0x5b7ca8[_0x41fa45(0x1e8)])return a41_0x4e4dca(a41_0x3bc19,{'children':[a41_0x3afcfb(Text,{'color':_0x41fa45(0x1ee),'children':'\x20['}),a41_0x3afcfb(Text,{'color':_0x41fa45(0x1ee),'bold':!![],'children':_0x5b7ca8[_0x41fa45(0x1e8)]}),a41_0x3afcfb(Text,{'color':_0x41fa45(0x1ee),'children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x28c872=a42_0x3d8a;(function(_0x2bf1d3,_0x110ef2){const _0x55a16c=a42_0x3d8a,_0x13597a=_0x2bf1d3();while(!![]){try{const _0x39afef=-parseInt(_0x55a16c(0x72))/0x1+parseInt(_0x55a16c(0x7f))/0x2*(parseInt(_0x55a16c(0x75))/0x3)+parseInt(_0x55a16c(0x6f))/0x4+-parseInt(_0x55a16c(0x76))/0x5+-parseInt(_0x55a16c(0x7d))/0x6*(-parseInt(_0x55a16c(0x78))/0x7)+parseInt(_0x55a16c(0x6d))/0x8+-parseInt(_0x55a16c(0x6e))/0x9;if(_0x39afef===_0x110ef2)break;else _0x13597a['push'](_0x13597a['shift']());}catch(_0x214ffc){_0x13597a['push'](_0x13597a['shift']());}}}(a42_0x3ee0,0xea9d8));import a42_0x54ed50 from'node:path';function a42_0x3ee0(){const _0x4fb16f=['472409TRIplP','../../templates/projects/sub-app-react-demo','url','66rghzsC','3659185IVxNcw','项目模板复制失败','7UVfXlM','now','success','message','info','10086078pGeEkD','copy','143320xEQvvB','dirname','1169992QaflHf','21422241eCcscs','4566788WQapcH','开始复制项目模板','cwd'];a42_0x3ee0=function(){return _0x4fb16f;};return a42_0x3ee0();}import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';function a42_0x3d8a(_0x4352eb,_0x13ab62){const _0x3ee0bb=a42_0x3ee0();return a42_0x3d8a=function(_0x3d8a85,_0x5905bd){_0x3d8a85=_0x3d8a85-0x6c;let _0x27ced5=_0x3ee0bb[_0x3d8a85];return _0x27ced5;},a42_0x3d8a(_0x4352eb,_0x13ab62);}import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a42_0x54ed50[a42_0x28c872(0x6c)](fileURLToPath(import.meta[a42_0x28c872(0x74)])),templateDir=a42_0x54ed50['resolve'](__dirname,a42_0x28c872(0x73));export function useCopyProjectTemplate(){const [_0x45e0d6,_0x16fffd]=useState(![]),[_0x3f9e22,_0xa0d5e5]=useState(![]),[_0x2a8172,_0x2ae239]=useState(''),_0x482080=useCallback(async _0x119562=>{const _0x3b9b67=a42_0x3d8a,_0x17aa63=Date[_0x3b9b67(0x79)](),_0x555fa4=a42_0x54ed50['resolve'](process[_0x3b9b67(0x71)](),_0x119562);_0x16fffd(!![]);try{logger[_0x3b9b67(0x7c)](_0x3b9b67(0x7e),_0x3b9b67(0x70),{'projectCode':_0x119562,'templateDir':templateDir}),await copyDirectory(templateDir,_0x555fa4);const _0x511828=Date[_0x3b9b67(0x79)]()-_0x17aa63;logger[_0x3b9b67(0x7a)]('copy','项目模板复制完成',_0x511828,{'projectCode':_0x119562});}catch(_0x47cb04){const _0x163cdc=Date[_0x3b9b67(0x79)]()-_0x17aa63;logger['error'](_0x3b9b67(0x7e),_0x3b9b67(0x77),{'projectCode':_0x119562,'error':_0x47cb04 instanceof Error?_0x47cb04[_0x3b9b67(0x7b)]:String(_0x47cb04),'duration':_0x163cdc});throw _0x47cb04;}finally{_0x16fffd(![]),_0xa0d5e5(!![]),_0x2ae239(formatElapsed(_0x17aa63));}},[]);return{'taskName':'复制项目文件','finished':_0x3f9e22,'loading':_0x45e0d6,'elapsed':_0x2a8172,'doTask':_0x482080};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a43_0xaa7c(){const _0x2b86bc=['success','4659464WhcLLv','info','237471totmYr','27KdoNJO','resolve','12645492PsUryU','格式化代码','6ElFDqg','now','802550pGmbTu','2415148xLzvyc','message','代码格式化完成','9933176ftEOWr','代码格式化失败','44iAxAHA','1GcJSFU','开始格式化代码','format','prettier','--write','3491270LcJTrt','7hPyUDs'];a43_0xaa7c=function(){return _0x2b86bc;};return a43_0xaa7c();}(function(_0x495923,_0x393940){const _0x30830a=a43_0x2eb3,_0x23618f=_0x495923();while(!![]){try{const _0xd15562=-parseInt(_0x30830a(0xc5))/0x1*(-parseInt(_0x30830a(0xbf))/0x2)+parseInt(_0x30830a(0xb7))/0x3*(parseInt(_0x30830a(0xc4))/0x4)+parseInt(_0x30830a(0xb2))/0x5*(-parseInt(_0x30830a(0xbc))/0x6)+parseInt(_0x30830a(0xb3))/0x7*(-parseInt(_0x30830a(0xb5))/0x8)+parseInt(_0x30830a(0xb8))/0x9*(parseInt(_0x30830a(0xbe))/0xa)+parseInt(_0x30830a(0xc2))/0xb+-parseInt(_0x30830a(0xba))/0xc;if(_0xd15562===_0x393940)break;else _0x23618f['push'](_0x23618f['shift']());}catch(_0x53e45b){_0x23618f['push'](_0x23618f['shift']());}}}(a43_0xaa7c,0xd8b34));import a43_0x216139 from'node:path';import{useCallback,useState}from'react';function a43_0x2eb3(_0x5b3ce3,_0x2b76c9){const _0xaa7c55=a43_0xaa7c();return a43_0x2eb3=function(_0x2eb346,_0x54788f){_0x2eb346=_0x2eb346-0xb1;let _0x4bc3f4=_0xaa7c55[_0x2eb346];return _0x4bc3f4;},a43_0x2eb3(_0x5b3ce3,_0x2b76c9);}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x3a5cc5=a43_0x2eb3,[_0x18147d,_0x3c9dab]=useState(![]),[_0x9af4c9,_0x4dc9b0]=useState(![]),[_0x41e23b,_0x6dcdac]=useState(''),_0x4c31fe=useCallback(async _0x4bdcfc=>{const _0x4980cb=a43_0x2eb3,_0x414862=Date['now'](),_0x32af32=a43_0x216139[_0x4980cb(0xb9)](process['cwd'](),_0x4bdcfc);_0x3c9dab(!![]);try{logger[_0x4980cb(0xb6)](_0x4980cb(0xc7),_0x4980cb(0xc6),{'projectCode':_0x4bdcfc}),await execa('npx',[_0x4980cb(0xc8),_0x4980cb(0xb1),'.'],{'cwd':_0x32af32});const _0xfc3c91=Date[_0x4980cb(0xbd)]()-_0x414862;logger[_0x4980cb(0xb4)](_0x4980cb(0xc7),_0x4980cb(0xc1),_0xfc3c91,{'projectCode':_0x4bdcfc});}catch(_0x249b43){const _0x4ceaa4=Date['now']()-_0x414862;logger['error'](_0x4980cb(0xc7),_0x4980cb(0xc3),{'projectCode':_0x4bdcfc,'error':_0x249b43 instanceof Error?_0x249b43[_0x4980cb(0xc0)]:String(_0x249b43),'duration':_0x4ceaa4});throw _0x249b43;}finally{_0x3c9dab(![]),_0x4dc9b0(!![]),_0x6dcdac(formatElapsed(_0x414862));}},[]);return{'taskName':_0x3a5cc5(0xbb),'finished':_0x9af4c9,'loading':_0x18147d,'elapsed':_0x41e23b,'doTask':_0x4c31fe};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c1972,_0x1ef235){const _0x4fca51=a44_0x3f5c,_0x2ef116=_0x2c1972();while(!![]){try{const _0x88501a=parseInt(_0x4fca51(0x93))/0x1+-parseInt(_0x4fca51(0xa4))/0x2*(-parseInt(_0x4fca51(0x92))/0x3)+parseInt(_0x4fca51(0x96))/0x4+parseInt(_0x4fca51(0xa2))/0x5+parseInt(_0x4fca51(0x9a))/0x6+parseInt(_0x4fca51(0x91))/0x7+-parseInt(_0x4fca51(0x94))/0x8;if(_0x88501a===_0x1ef235)break;else _0x2ef116['push'](_0x2ef116['shift']());}catch(_0x2567b4){_0x2ef116['push'](_0x2ef116['shift']());}}}(a44_0x34fd,0x2cc6c));import a44_0x420b1e from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';function a44_0x34fd(){const _0x10522f=['516530POsMjF','8814VZFbaC','90886ButItt','7947752oCCZoh','安装依赖','513616CNVLWl','error','now','success','2180460HvSvkW','依赖安装失败','message','install','resolve','--registry','info','开始安装依赖','1691135zRgbCo','https://registry.npmmirror.com','124bwDOtY'];a44_0x34fd=function(){return _0x10522f;};return a44_0x34fd();}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a44_0x3f5c(_0x8f59ad,_0x1d3814){const _0x34fd82=a44_0x34fd();return a44_0x3f5c=function(_0x3f5cae,_0x442e51){_0x3f5cae=_0x3f5cae-0x91;let _0x161268=_0x34fd82[_0x3f5cae];return _0x161268;},a44_0x3f5c(_0x8f59ad,_0x1d3814);}export function useInstallDependencies(){const _0x4fe784=a44_0x3f5c,[_0x5ac462,_0x274045]=useState(![]),[_0x1aec78,_0x303302]=useState(![]),[_0x454e86,_0x203a5d]=useState(''),_0x463fe6=useCallback(async _0x35a16d=>{const _0x45c751=a44_0x3f5c,_0x39a74d=Date['now'](),_0xf94821=a44_0x420b1e[_0x45c751(0x9e)](process['cwd'](),_0x35a16d);_0x274045(!![]),_0x303302(![]);const _0x188f11=async(_0x22016a,_0x427c68)=>{await execa(_0x22016a,_0x427c68,{'cwd':_0xf94821});};try{logger[_0x45c751(0xa0)](_0x45c751(0x9d),_0x45c751(0xa1),{'projectCode':_0x35a16d,'registry':_0x45c751(0xa3)}),await _0x188f11('npm',[_0x45c751(0x9d),_0x45c751(0x9f),_0x45c751(0xa3)]);const _0x58c98c=Date['now']()-_0x39a74d;logger[_0x45c751(0x99)]('install','依赖安装完成',_0x58c98c,{'projectCode':_0x35a16d});}catch(_0x4ded92){const _0x458b0b=Date[_0x45c751(0x98)]()-_0x39a74d;logger[_0x45c751(0x97)](_0x45c751(0x9d),_0x45c751(0x9b),{'projectCode':_0x35a16d,'error':_0x4ded92 instanceof Error?_0x4ded92[_0x45c751(0x9c)]:String(_0x4ded92),'duration':_0x458b0b});throw _0x4ded92;}finally{_0x274045(![]),_0x303302(!![]),_0x203a5d(formatElapsed(_0x39a74d));}},[]);return{'taskName':_0x4fe784(0x95),'finished':_0x1aec78,'loading':_0x5ac462,'elapsed':_0x454e86,'doTask':_0x463fe6};}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a45_0x3d85(_0x173048,_0x40753){var _0x2cb86e=a45_0x2cb8();return a45_0x3d85=function(_0x3d85cb,_0x216981){_0x3d85cb=_0x3d85cb-0x16a;var _0x47d673=_0x2cb86e[_0x3d85cb];return _0x47d673;},a45_0x3d85(_0x173048,_0x40753);}(function(_0x5023db,_0x289358){var _0x1ba985=a45_0x3d85,_0x1f9131=_0x5023db();while(!![]){try{var _0x46f128=parseInt(_0x1ba985(0x176))/0x1+parseInt(_0x1ba985(0x173))/0x2+parseInt(_0x1ba985(0x16b))/0x3*(-parseInt(_0x1ba985(0x16f))/0x4)+parseInt(_0x1ba985(0x16d))/0x5*(parseInt(_0x1ba985(0x174))/0x6)+parseInt(_0x1ba985(0x175))/0x7*(parseInt(_0x1ba985(0x177))/0x8)+parseInt(_0x1ba985(0x172))/0x9+-parseInt(_0x1ba985(0x171))/0xa*(parseInt(_0x1ba985(0x178))/0xb);if(_0x46f128===_0x289358)break;else _0x1f9131['push'](_0x1f9131['shift']());}catch(_0x4ca982){_0x1f9131['push'](_0x1f9131['shift']());}}}(a45_0x2cb8,0xb2b1b));import{jsx as a45_0x49106f,jsxs as a45_0x21df80}from'react/jsx-runtime';function a45_0x2cb8(){var _0x182096=['650JyskJq','7570998wvbsXI','2472418RPAUlj','24vlEdBv','1295lbpXXT','1083467YbGBwV','13744SoVvFF','599379zIxsFd','lovrabet\x20--help','6aXFNAN','column','1480720Mgliwt','green','779176CjfZST','!\x20请指定一个有效的命令。'];a45_0x2cb8=function(){return _0x182096;};return a45_0x2cb8();}import{Box,Text}from'ink';export function Help(){var _0x6c995d=a45_0x3d85;return a45_0x21df80(Box,{'flexDirection':_0x6c995d(0x16c),'marginTop':0x1,'marginBottom':0x1,'children':[a45_0x21df80(Box,{'children':[a45_0x49106f(Box,{'width':'1'}),a45_0x49106f(Text,{'children':_0x6c995d(0x170)})]}),a45_0x21df80(Box,{'marginTop':0x1,'children':[a45_0x49106f(Box,{'width':'1'}),a45_0x21df80(Text,{'children':['\x20\x20','使用']}),a45_0x21df80(Text,{'bold':!![],'color':_0x6c995d(0x16e),'children':['\x20',_0x6c995d(0x16a),'\x20']}),a45_0x49106f(Text,{'children':'查看可用命令。'})]})]});}
|
package/lib/init/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a46_0x363e(){const _0x205eed=['1.0.0','64300HcIdQR','exit','168991JMLAzL','error','length','AppCode:\x20','env','创建配置文件失败','正在初始化配置文件...','应用代码只能包含字母、数字、-\x20和\x20_','应用代码不能为空','1110991PdoMsp','ctrl','应用代码不合法','873966mjTlbr','string','red','cyan','当前目录已存在\x20.lovrabetrc\x20文件','toLocaleString','cwd','3336iSvmAQ','slice','\x20←\x20','delete','message','应用代码长度不能超过\x20100\x20个字符','green','version','url','4iUnlkv','utf8','1521950inBJNK','.lovrabetrc','trim','return','column','stringify','init','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','227772bZeYVY','gray','8433VaLmTJ'];a46_0x363e=function(){return _0x205eed;};return a46_0x363e();}(function(_0xdcceae,_0x4432a2){const _0x34aab7=a46_0x129f,_0x3cd447=_0xdcceae();while(!![]){try{const _0x1b8384=parseInt(_0x34aab7(0xcf))/0x1*(parseInt(_0x34aab7(0xeb))/0x2)+-parseInt(_0x34aab7(0xdb))/0x3+-parseInt(_0x34aab7(0xcd))/0x4+-parseInt(_0x34aab7(0xed))/0x5+-parseInt(_0x34aab7(0xc9))/0x6+parseInt(_0x34aab7(0xd8))/0x7+parseInt(_0x34aab7(0xe2))/0x8*(parseInt(_0x34aab7(0xcb))/0x9);if(_0x1b8384===_0x4432a2)break;else _0x3cd447['push'](_0x3cd447['shift']());}catch(_0x3d7ddc){_0x3cd447['push'](_0x3cd447['shift']());}}}(a46_0x363e,0x3a06b));import{jsxs as a46_0x16c9eb,jsx as a46_0x561638}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';function a46_0x129f(_0x4eb743,_0x57593f){const _0x363ee9=a46_0x363e();return a46_0x129f=function(_0x129f80,_0x146953){_0x129f80=_0x129f80-0xc8;let _0x2d696e=_0x363ee9[_0x129f80];return _0x2d696e;},a46_0x129f(_0x4eb743,_0x57593f);}import{readConfig}from'../utils/config.js';export function Init({appcode:_0x3c5e80,env:_0x4fa3aa}){const _0x42c349=a46_0x129f,[_0x4e20d0,_0x18318e]=useState(null),[_0x455192,_0x4b7d49]=useState(![]),[_0x5da2e6,_0x2a3e05]=useState(!_0x3c5e80),[_0xd6e0ea,_0x5236e2]=useState(''),[_0x51bf13,_0x2c1ccb]=useState(''),[_0x4ae9c4,_0xb7c280]=useState(_0x3c5e80||''),[_0x2dd853]=useState(_0x4fa3aa);function _0x2ea4b2(_0xca8439){const _0x31c1bd=a46_0x129f;if(_0xca8439[_0x31c1bd(0xd1)]===0x0)return{'valid':![],'message':''};if(_0xca8439['length']>0x64)return{'valid':![],'message':_0x31c1bd(0xe7)};const _0x579b06=/^[A-Za-z0-9_-]+$/;if(!_0x579b06['test'](_0xca8439))return{'valid':![],'message':_0x31c1bd(0xd6)};return{'valid':!![]};}useInput((_0x4f4c31,_0x46236d)=>{const _0x128bb0=a46_0x129f;if(!_0x5da2e6)return;if(_0x46236d[_0x128bb0(0xf0)]){if(_0x51bf13||!_0xd6e0ea[_0x128bb0(0xef)]()){_0x2c1ccb(_0x128bb0(0xd7));return;}const _0x446702=_0xd6e0ea['trim'](),{valid:_0x3035da,message:_0x45a0e4}=_0x2ea4b2(_0x446702);if(!_0x3035da){_0x2c1ccb(_0x45a0e4||_0x128bb0(0xda));return;}_0xb7c280(_0x446702),_0x2a3e05(![]);}else{if(_0x46236d['backspace']||_0x46236d[_0x128bb0(0xe5)])_0x5236e2(_0x3b7fb2=>{const _0x22927c=_0x128bb0,_0x5c9fd7=_0x3b7fb2[_0x22927c(0xe3)](0x0,-0x1);if(_0x5c9fd7['length']===0x0)_0x2c1ccb('');else{const {valid:_0x428029,message:_0xcf828d}=_0x2ea4b2(_0x5c9fd7);_0x2c1ccb(_0x428029?'':_0xcf828d||_0x22927c(0xda));}return _0x5c9fd7;});else _0x46236d[_0x128bb0(0xd9)]&&_0x4f4c31==='c'?process['exit'](0x0):_0x5236e2(_0x342d8e=>{const _0x1b9e52=_0x342d8e+_0x4f4c31,{valid:_0x2b5d07,message:_0x42e787}=_0x2ea4b2(_0x1b9e52);return _0x2c1ccb(_0x2b5d07?'':_0x42e787||'应用代码不合法'),_0x1b9e52;});}},{'isActive':_0x5da2e6}),useEffect(()=>{const _0x5ed1e2=a46_0x129f;if(!_0x4ae9c4||_0x5da2e6)return;const _0x1d7c87=resolve(process[_0x5ed1e2(0xe1)](),_0x5ed1e2(0xee));if(existsSync(_0x1d7c87)){_0x18318e(_0x5ed1e2(0xdf)),setTimeout(()=>process[_0x5ed1e2(0xce)](0x1),0x64);return;}try{const _0x1a6de4=fileURLToPath(import.meta[_0x5ed1e2(0xea)]),_0x28ac2d=resolve(dirname(_0x1a6de4),'../..'),_0x5626b5=join(_0x28ac2d,'package.json');let _0xe4155a=_0x5ed1e2(0xcc);try{const _0x486c9c=JSON['parse'](readFileSync(_0x5626b5,_0x5ed1e2(0xec)));_0xe4155a=_0x486c9c['version']||_0x5ed1e2(0xcc);}catch(_0x56ce14){}const _0x1ea48d=readConfig(),_0x4d798b=typeof _0x1ea48d[_0x5ed1e2(0xd3)]===_0x5ed1e2(0xdc)?_0x1ea48d[_0x5ed1e2(0xd3)]:undefined,{app:_0x571ddc,appcode:_0x1dab5f,..._0x403f7f}=_0x1ea48d,_0x32d35f={..._0x403f7f,'appcode':_0x4ae9c4,'env':_0x2dd853||_0x4d798b||'online','createdAt':new Date()[_0x5ed1e2(0xe0)](),'version':_0xe4155a};writeFileSync(_0x1d7c87,JSON[_0x5ed1e2(0xf2)](_0x32d35f,null,0x2),{'encoding':_0x5ed1e2(0xec),'mode':0x180}),logger['setLogPath'](process['cwd']()),logger['info'](_0x5ed1e2(0xf3),'初始化项目配置文件成功',{'appcode':_0x4ae9c4,'env':_0x32d35f['env'],'version':_0x32d35f[_0x5ed1e2(0xe9)],'configPath':_0x1d7c87}),_0x4b7d49(!![]),setTimeout(()=>process['exit'](0x0),0x64);}catch(_0xdd847e){logger[_0x5ed1e2(0xd0)](_0x5ed1e2(0xf3),_0x5ed1e2(0xd4),{'error':_0xdd847e instanceof Error?_0xdd847e[_0x5ed1e2(0xe6)]:String(_0xdd847e)}),_0x18318e('创建配置文件失败:\x20'+(_0xdd847e instanceof Error?_0xdd847e['message']:String(_0xdd847e))),setTimeout(()=>process[_0x5ed1e2(0xce)](0x1),0x64);}},[_0x4ae9c4,_0x5da2e6,_0x2dd853]);if(_0x4e20d0)return a46_0x561638(Box,{'flexDirection':_0x42c349(0xf1),'children':a46_0x16c9eb(Text,{'color':_0x42c349(0xdd),'children':['✗\x20',_0x4e20d0]})});if(_0x5da2e6)return a46_0x16c9eb(Box,{'flexDirection':_0x42c349(0xf1),'children':[a46_0x16c9eb(Box,{'children':[a46_0x561638(Text,{'color':_0x42c349(0xde),'children':'请输入应用代码\x20(AppCode):\x20'}),_0xd6e0ea?a46_0x561638(Text,{'color':_0x42c349(0xe8),'children':_0xd6e0ea}):a46_0x561638(Text,{'color':_0x42c349(0xca),'children':'_'}),_0x51bf13&&a46_0x16c9eb(Text,{'color':_0x42c349(0xdd),'children':[_0x42c349(0xe4),_0x51bf13]})]}),!_0x51bf13&&!_0xd6e0ea&&a46_0x561638(Box,{'children':a46_0x561638(Text,{'color':'gray','children':'应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_'})})]});if(_0x455192)return a46_0x16c9eb(Box,{'flexDirection':_0x42c349(0xf1),'children':[a46_0x561638(Text,{'color':_0x42c349(0xe8),'children':_0x42c349(0xc8)}),a46_0x16c9eb(Text,{'color':_0x42c349(0xde),'children':[_0x42c349(0xd2),_0x4ae9c4]}),a46_0x561638(Text,{'children':_0x42c349(0xf4)})]});return a46_0x561638(Box,{'children':a46_0x561638(Text,{'children':_0x42c349(0xd5)})});}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x25db14=a47_0x2979;(function(_0x21f823,_0x1d3df9){const _0x21ea23=a47_0x2979,_0x331d20=_0x21f823();while(!![]){try{const _0x95a500=-parseInt(_0x21ea23(0x16e))/0x1*(-parseInt(_0x21ea23(0x16b))/0x2)+-parseInt(_0x21ea23(0x16a))/0x3*(parseInt(_0x21ea23(0x162))/0x4)+parseInt(_0x21ea23(0x171))/0x5*(parseInt(_0x21ea23(0x172))/0x6)+parseInt(_0x21ea23(0x161))/0x7*(parseInt(_0x21ea23(0x169))/0x8)+parseInt(_0x21ea23(0x163))/0x9+-parseInt(_0x21ea23(0x167))/0xa*(-parseInt(_0x21ea23(0x166))/0xb)+parseInt(_0x21ea23(0x168))/0xc*(-parseInt(_0x21ea23(0x170))/0xd);if(_0x95a500===_0x1d3df9)break;else _0x331d20['push'](_0x331d20['shift']());}catch(_0x47270b){_0x331d20['push'](_0x331d20['shift']());}}}(a47_0xc03e,0xbd7ba));function a47_0x2979(_0x10b128,_0x372dcf){const _0xc03e6=a47_0xc03e();return a47_0x2979=function(_0x2979a3,_0x2c1f2a){_0x2979a3=_0x2979a3-0x15f;let _0x33af9d=_0xc03e6[_0x2979a3];return _0x33af9d;},a47_0x2979(_0x10b128,_0x372dcf);}function a47_0xc03e(){const _0x3e0ca7=['string','211979oDfHpL','utf8','27967849CPrjVK','435dDULrW','1602ygfPiL','.lovrabetrc','app','parse','1971235PrPllL','356TIsloK','7412904EyXvPV','appcode','trim','11uGUawB','4983290meAlwL','12lzPpLT','40zOQjCi','29853JLVuyh','10Igxlfp','cwd'];a47_0xc03e=function(){return _0x3e0ca7;};return a47_0xc03e();}import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a47_0x25db14(0x16c)](),a47_0x25db14(0x173));export const globalConfigPath=resolve(homedir(),a47_0x25db14(0x173));export function readConfig(){const _0x5c801f=a47_0x25db14;let _0xed7f69={};try{if(existsSync(globalConfigPath)){const _0x678ce5=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x678ce5&&(_0xed7f69=JSON['parse'](_0x678ce5));}}catch(_0x296175){}try{if(existsSync(projectConfigPath)){const _0x475961=readFileSync(projectConfigPath,{'encoding':_0x5c801f(0x16f)});if(_0x475961){const _0xf12f5d=JSON[_0x5c801f(0x160)](_0x475961);_0xed7f69={..._0xed7f69,..._0xf12f5d};}}}catch(_0x3fb3d0){}return _0xed7f69;}export function getConfigAppCode(){const _0x5276ef=a47_0x25db14;let _0x35822e={},_0x1884b5={};try{if(existsSync(globalConfigPath)){const _0xfcf415=readFileSync(globalConfigPath,{'encoding':'utf8'});_0xfcf415&&(_0x1884b5=JSON['parse'](_0xfcf415));}}catch(_0x4e32eb){}try{if(existsSync(projectConfigPath)){const _0xcbcc29=readFileSync(projectConfigPath,{'encoding':'utf8'});_0xcbcc29&&(_0x35822e=JSON[_0x5276ef(0x160)](_0xcbcc29));}}catch(_0x52380a){}let _0x20aa6c;if(_0x5276ef(0x164)in _0x35822e)_0x20aa6c=_0x35822e[_0x5276ef(0x164)];else{if(_0x5276ef(0x15f)in _0x35822e)_0x20aa6c=_0x35822e[_0x5276ef(0x15f)];else{if(_0x5276ef(0x164)in _0x1884b5)_0x20aa6c=_0x1884b5[_0x5276ef(0x164)];else'app'in _0x1884b5&&(_0x20aa6c=_0x1884b5['app']);}}if(typeof _0x20aa6c!==_0x5276ef(0x16d)||_0x20aa6c[_0x5276ef(0x165)]()==='')return undefined;return _0x20aa6c;}export function isInProject(){return existsSync(projectConfigPath);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38fc8c,_0xc43b){const _0x3b9f91=a48_0xedcd,_0x1c8944=_0x38fc8c();while(!![]){try{const _0xa4146c=parseInt(_0x3b9f91(0x129))/0x1*(-parseInt(_0x3b9f91(0x131))/0x2)+-parseInt(_0x3b9f91(0x12c))/0x3*(parseInt(_0x3b9f91(0x134))/0x4)+parseInt(_0x3b9f91(0x12a))/0x5*(parseInt(_0x3b9f91(0x130))/0x6)+-parseInt(_0x3b9f91(0x133))/0x7+-parseInt(_0x3b9f91(0x126))/0x8*(-parseInt(_0x3b9f91(0x127))/0x9)+parseInt(_0x3b9f91(0x135))/0xa+-parseInt(_0x3b9f91(0x128))/0xb;if(_0xa4146c===_0xc43b)break;else _0x1c8944['push'](_0x1c8944['shift']());}catch(_0x4f6e28){_0x1c8944['push'](_0x1c8944['shift']());}}}(a48_0x7cde,0xb6121));function a48_0x7cde(){const _0x1d2b06=['47525hWwHVE','name','9ZlkXaL','mkdirSync','readdirSync','复制目录时出错:','138BvbQZL','1284JAyVqy','join','4429495BgmcgN','372700odYcvI','9599970JRnVRn','copyFileSync','isDirectory','8IbluAZ','12998826HfEqeU','9561167kKhViM','149DMZMtb'];a48_0x7cde=function(){return _0x1d2b06;};return a48_0x7cde();}import a48_0xe7ff63 from'node:path';import a48_0x541794 from'node:fs';function a48_0xedcd(_0x4181c4,_0x3e3bdf){const _0x7cde47=a48_0x7cde();return a48_0xedcd=function(_0xedcd8d,_0x50ef68){_0xedcd8d=_0xedcd8d-0x125;let _0x23712f=_0x7cde47[_0xedcd8d];return _0x23712f;},a48_0xedcd(_0x4181c4,_0x3e3bdf);}export async function copyDirectory(_0x4eccf7,_0x2710b5){const _0x38144e=a48_0xedcd;try{const _0xb90b43=a48_0x541794[_0x38144e(0x12e)](_0x4eccf7,{'withFileTypes':!![]});a48_0x541794[_0x38144e(0x12d)](_0x2710b5,{'recursive':!![]});for(const _0x5e1bc3 of _0xb90b43){const _0x362973=a48_0xe7ff63[_0x38144e(0x132)](_0x4eccf7,_0x5e1bc3[_0x38144e(0x12b)]),_0x410417=a48_0xe7ff63[_0x38144e(0x132)](_0x2710b5,_0x5e1bc3['name']);_0x5e1bc3[_0x38144e(0x125)]()?await copyDirectory(_0x362973,_0x410417):a48_0x541794[_0x38144e(0x136)](_0x362973,_0x410417);}}catch(_0xc085a4){console['error'](_0x38144e(0x12f),_0xc085a4);}}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x45415e,_0x4bbfe6){const _0x412015=a49_0x18e9,_0x175c7f=_0x45415e();while(!![]){try{const _0x11bd8a=parseInt(_0x412015(0x127))/0x1*(-parseInt(_0x412015(0x125))/0x2)+-parseInt(_0x412015(0x142))/0x3+parseInt(_0x412015(0x13a))/0x4+parseInt(_0x412015(0x133))/0x5+parseInt(_0x412015(0x13e))/0x6*(parseInt(_0x412015(0x129))/0x7)+parseInt(_0x412015(0x131))/0x8*(-parseInt(_0x412015(0x141))/0x9)+parseInt(_0x412015(0x13c))/0xa;if(_0x11bd8a===_0x4bbfe6)break;else _0x175c7f['push'](_0x175c7f['shift']());}catch(_0x21fe35){_0x175c7f['push'](_0x175c7f['shift']());}}}(a49_0x16cd,0x49c14));export async function httpRequest(_0x4f1270,_0x342fed={}){const _0x12246a=a49_0x18e9,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x342fed;let _0x5ae12c=null;for(let _0x1fd577=0x0;_0x1fd577<=retries;_0x1fd577++){try{const _0x3e4e34=new AbortController(),_0x3ac2a9=setTimeout(()=>_0x3e4e34[_0x12246a(0x12e)](),timeout),_0x2ac4a4=await fetch(_0x4f1270,{'headers':headers,'signal':_0x3e4e34[_0x12246a(0x137)]});clearTimeout(_0x3ac2a9);let _0x3b26cb;const _0x37e0d5=_0x2ac4a4[_0x12246a(0x134)][_0x12246a(0x12d)](_0x12246a(0x12a));return _0x37e0d5?.[_0x12246a(0x12c)](_0x12246a(0x13f))?_0x3b26cb=await _0x2ac4a4[_0x12246a(0x140)]():_0x3b26cb=await _0x2ac4a4['text'](),{'ok':_0x2ac4a4['ok'],'status':_0x2ac4a4[_0x12246a(0x132)],'statusText':_0x2ac4a4['statusText'],'data':_0x3b26cb,'headers':_0x2ac4a4['headers'],'url':_0x2ac4a4[_0x12246a(0x12b)],'text':()=>_0x2ac4a4[_0x12246a(0x128)]()};}catch(_0x4b0669){_0x5ae12c=_0x4b0669 instanceof Error?_0x4b0669:new Error(String(_0x4b0669));if(_0x1fd577===retries)break;if(shouldRetry(_0x4b0669)){console[_0x12246a(0x13d)](_0x12246a(0x126)+retryDelay+'ms\x20后进行第\x20'+(_0x1fd577+0x1)+_0x12246a(0x136)),await sleep(retryDelay);continue;}else break;}}throw _0x5ae12c||new Error('Request\x20failed');}function a49_0x16cd(){const _0x1dd87d=['19wXDYDH','text','996555JaPDFy','content-type','url','includes','get','abort','AbortError','ENOTFOUND','16yLTgzm','status','391865HgDcDn','headers','TypeError','\x20次重试...','signal','name','message','1275144xJPFjN','ECONNRESET','5801980kZHQpA','log','18jMibUE','application/json','json','1844253XYtQiL','984408SJEmvs','38356FLTdPd','*\x20请求失败,'];a49_0x16cd=function(){return _0x1dd87d;};return a49_0x16cd();}function shouldRetry(_0x340330){const _0x39ca11=a49_0x18e9;if(_0x340330 instanceof Error){if(_0x340330[_0x39ca11(0x138)]===_0x39ca11(0x12f))return![];if(_0x340330[_0x39ca11(0x138)]===_0x39ca11(0x135)&&_0x340330[_0x39ca11(0x139)][_0x39ca11(0x12c)]('fetch'))return!![];if(_0x340330[_0x39ca11(0x139)][_0x39ca11(0x12c)](_0x39ca11(0x13b)))return!![];if(_0x340330['message'][_0x39ca11(0x12c)](_0x39ca11(0x130)))return![];}return![];}function sleep(_0x1e5f5d){return new Promise(_0x487714=>setTimeout(_0x487714,_0x1e5f5d));}function a49_0x18e9(_0x383ce7,_0x32f12d){const _0x16cdfe=a49_0x16cd();return a49_0x18e9=function(_0x18e949,_0x527dee){_0x18e949=_0x18e949-0x125;let _0x5b083d=_0x16cdfe[_0x18e949];return _0x5b083d;},a49_0x18e9(_0x383ce7,_0x32f12d);}export function validateUrl(_0x1ce66c){try{return new URL(_0x1ce66c),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x429dfb=a50_0x13ff;function a50_0x13ff(_0x3f276b,_0x3e862a){const _0x14210c=a50_0x1421();return a50_0x13ff=function(_0x13ffe2,_0x5afce4){_0x13ffe2=_0x13ffe2-0xf3;let _0x255e0c=_0x14210c[_0x13ffe2];return _0x255e0c;},a50_0x13ff(_0x3f276b,_0x3e862a);}(function(_0x3511df,_0x540ac4){const _0x1e47bf=a50_0x13ff,_0x269f9e=_0x3511df();while(!![]){try{const _0x18e90f=-parseInt(_0x1e47bf(0x10f))/0x1+parseInt(_0x1e47bf(0x119))/0x2+parseInt(_0x1e47bf(0x111))/0x3+-parseInt(_0x1e47bf(0x104))/0x4+-parseInt(_0x1e47bf(0x125))/0x5*(-parseInt(_0x1e47bf(0xfa))/0x6)+-parseInt(_0x1e47bf(0xf3))/0x7+-parseInt(_0x1e47bf(0x122))/0x8;if(_0x18e90f===_0x540ac4)break;else _0x269f9e['push'](_0x269f9e['shift']());}catch(_0x56eeb2){_0x269f9e['push'](_0x269f9e['shift']());}}}(a50_0x1421,0x807ee));import a50_0x559993 from'winston';import a50_0x127989 from'node:fs';import a50_0x1c527e from'node:path';class Logger{[a50_0x429dfb(0x121)];['logFilePath'];[a50_0x429dfb(0x11a)]='';constructor(){this['logFilePath']='';}[a50_0x429dfb(0x10d)](_0x3599b0){const _0x40fb8b=a50_0x429dfb;this[_0x40fb8b(0x11a)]=_0x3599b0;}[a50_0x429dfb(0x100)](){const _0x361423=a50_0x429dfb,_0x273bd7=a50_0x1c527e['dirname'](this['logFilePath']);!a50_0x127989[_0x361423(0xf6)](_0x273bd7)&&a50_0x127989[_0x361423(0x120)](_0x273bd7,{'recursive':!![]});const _0x11f908=a50_0x559993[_0x361423(0x109)][_0x361423(0x10b)](a50_0x559993[_0x361423(0x109)][_0x361423(0x10e)](),a50_0x559993[_0x361423(0x109)][_0x361423(0x112)]({'stack':!![]}),a50_0x559993[_0x361423(0x109)][_0x361423(0x108)](_0x3d507a=>{const _0x4605b6=_0x361423,_0x4f14cc={'timestamp':_0x3d507a[_0x4605b6(0x10e)]||new Date()[_0x4605b6(0x11f)](),'level':_0x3d507a['level']||_0x4605b6(0xf9),'command':_0x3d507a[_0x4605b6(0x129)]||_0x4605b6(0x10a),'rawCommand':_0x3d507a[_0x4605b6(0x12b)]||this[_0x4605b6(0x11a)]||undefined,'message':_0x3d507a[_0x4605b6(0x102)]||'','duration':_0x3d507a[_0x4605b6(0x11d)]||undefined,'details':_0x3d507a['details']||undefined};return JSON[_0x4605b6(0x107)](_0x4f14cc);}));this[_0x361423(0x121)]=a50_0x559993[_0x361423(0x12c)]({'level':_0x361423(0xf9),'format':_0x11f908,'transports':[new a50_0x559993['transports']['File']({'filename':this[_0x361423(0x118)],'level':_0x361423(0xf9)})],'silent':![]}),a50_0x559993[_0x361423(0x128)]({'success':_0x361423(0x126),'error':_0x361423(0xff),'warn':'yellow','info':_0x361423(0x123)});}[a50_0x429dfb(0xf7)](_0x1c6ee1){const _0x329492=a50_0x429dfb;this[_0x329492(0x118)]=a50_0x1c527e[_0x329492(0xf4)](_0x1c6ee1,_0x329492(0xfc)),this[_0x329492(0x121)]&&this[_0x329492(0x121)][_0x329492(0x11b)](),this[_0x329492(0x100)]();}[a50_0x429dfb(0xf9)](_0x4df54f,_0x45ce67,_0x48c571){const _0x1c19e4=a50_0x429dfb;if(!this[_0x1c19e4(0x118)]||!this['winstonLogger'])return;this[_0x1c19e4(0x121)][_0x1c19e4(0xf9)](_0x45ce67,{'command':_0x4df54f,'details':_0x48c571});}['success'](_0x535203,_0x19a843,_0x9a8999,_0x1f1175){const _0x103489=a50_0x429dfb;if(!this['logFilePath']||!this['winstonLogger'])return;this['winstonLogger'][_0x103489(0x11e)]('info',_0x19a843,{'level':_0x103489(0xf5),'command':_0x535203,'duration':_0x9a8999,'details':_0x1f1175});}[a50_0x429dfb(0x106)](_0x24d4a3,_0x167555,_0x36cd8c){const _0x3cc838=a50_0x429dfb;if(!this[_0x3cc838(0x118)]||!this['winstonLogger'])return;this[_0x3cc838(0x121)][_0x3cc838(0x106)](_0x167555,{'command':_0x24d4a3,'details':_0x36cd8c});}[a50_0x429dfb(0x116)](_0x4ad714,_0x5e139d,_0x777373){const _0x5efee5=a50_0x429dfb;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x5efee5(0x121)][_0x5efee5(0x116)](_0x5e139d,{'command':_0x4ad714,'details':_0x777373});}async['logTask'](_0xef08b5,_0x24e5d2,_0x410a57){const _0x436737=a50_0x429dfb,_0x3258bb=Date['now']();this[_0x436737(0xf9)](_0xef08b5,_0x436737(0x113)+_0x24e5d2);try{const _0x52c5bc=await _0x410a57(),_0x3b0e4e=Date[_0x436737(0x114)]()-_0x3258bb;return this['success'](_0xef08b5,_0x436737(0x110)+_0x24e5d2,_0x3b0e4e),_0x52c5bc;}catch(_0x3abeaa){const _0x1df757=Date[_0x436737(0x114)]()-_0x3258bb;this[_0x436737(0x106)](_0xef08b5,_0x436737(0x105)+_0x24e5d2,{'error':_0x3abeaa instanceof Error?_0x3abeaa[_0x436737(0x102)]:String(_0x3abeaa),'duration':_0x1df757});throw _0x3abeaa;}}[a50_0x429dfb(0xfb)](){const _0x352277=a50_0x429dfb;try{if(!a50_0x127989[_0x352277(0xf6)](this['logFilePath']))return[];const _0x350f55=a50_0x127989[_0x352277(0x11c)](this[_0x352277(0x118)],_0x352277(0x124));return _0x350f55[_0x352277(0x101)]('\x0a')[_0x352277(0xfd)](_0x1a0aba=>_0x1a0aba[_0x352277(0x103)]())[_0x352277(0x10c)](_0x1c4863=>JSON[_0x352277(0xfe)](_0x1c4863));}catch(_0x2d54f1){return console['warn'](_0x352277(0x127),_0x2d54f1),[];}}[a50_0x429dfb(0x12a)](){const _0x1313ce=a50_0x429dfb;try{a50_0x127989[_0x1313ce(0xf6)](this[_0x1313ce(0x118)])&&a50_0x127989[_0x1313ce(0xf8)](this[_0x1313ce(0x118)],'',_0x1313ce(0x124));}catch(_0x3637d5){console['warn'](_0x1313ce(0x117),_0x3637d5);}}[a50_0x429dfb(0x115)](){const _0x33eda3=a50_0x429dfb;return this[_0x33eda3(0x121)];}}function a50_0x1421(){const _0x3cbdd9=['1033264oiXYRR','失败:\x20','error','stringify','printf','format','unknown','combine','map','setRawCommand','timestamp','694675FCeOuI','完成:\x20','2412039IhaqLz','errors','开始执行:\x20','now','getWinstonInstance','warn','Failed\x20to\x20clear\x20logs:','logFilePath','1202990DoYxgR','currentRawCommand','clear','readFileSync','duration','log','toISOString','mkdirSync','winstonLogger','3368576gzJeWB','blue','utf8','1322270nAQLXC','green','Failed\x20to\x20read\x20logs:','addColors','command','clearLogs','rawCommand','createLogger','238245kVHwOL','join','success','existsSync','setLogPath','writeFileSync','info','12OnCJWE','readLogs','.lovrabet.log','filter','parse','red','initWinstonLogger','split','message','trim'];a50_0x1421=function(){return _0x3cbdd9;};return a50_0x1421();}export const logger=new Logger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a51_0x42c1(){const _0x2ad2d4=['933308qhgLyd','charAt','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','addRoute','promises','路由配置更新完成','src','toComponentName','开始更新路由配置','864408QFIWKb','3657980yEZJoD','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','238220xtNuoN','routerFilePath','previewChanges','router','path:\x20\x22','addImport','54aPcjIj','success','info','split','utf8','slice','join','message','528353iZPNKO','3qCvugX','readFile','map','match','now','error','includes','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','8274266xMBFKh','index.tsx','addPageRoute','路由文件不存在:\x20','index','indexOf','length','42TyprOn','446230sPFdcg','existsSync','路由配置更新失败','toUpperCase','lastIndexOf','\x20from\x20\x22../pages/','30Vwogft','未找到路由配置的\x20children\x20数组'];a51_0x42c1=function(){return _0x2ad2d4;};return a51_0x42c1();}const a51_0x4cbb8a=a51_0x17c9;function a51_0x17c9(_0x142d03,_0x380fb3){const _0x42c131=a51_0x42c1();return a51_0x17c9=function(_0x17c9ea,_0x32d531){_0x17c9ea=_0x17c9ea-0x127;let _0x46e0dc=_0x42c131[_0x17c9ea];return _0x46e0dc;},a51_0x17c9(_0x142d03,_0x380fb3);}(function(_0xc4609d,_0x148cdc){const _0x59f648=a51_0x17c9,_0x300154=_0xc4609d();while(!![]){try{const _0x3380a6=parseInt(_0x59f648(0x141))/0x1+parseInt(_0x59f648(0x149))/0x2*(-parseInt(_0x59f648(0x131))/0x3)+parseInt(_0x59f648(0x155))/0x4+-parseInt(_0x59f648(0x153))/0x5+-parseInt(_0x59f648(0x140))/0x6*(parseInt(_0x59f648(0x130))/0x7)+-parseInt(_0x59f648(0x152))/0x8*(parseInt(_0x59f648(0x128))/0x9)+-parseInt(_0x59f648(0x147))/0xa*(-parseInt(_0x59f648(0x139))/0xb);if(_0x3380a6===_0x148cdc)break;else _0x300154['push'](_0x300154['shift']());}catch(_0xc15ac6){_0x300154['push'](_0x300154['shift']());}}}(a51_0x42c1,0x5e9a6));import a51_0x40f89e from'node:fs';import a51_0x567867 from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a51_0x4cbb8a(0x156)];constructor(_0x414184){const _0x4688e2=a51_0x4cbb8a;this['routerFilePath']=a51_0x567867[_0x4688e2(0x12e)](_0x414184,_0x4688e2(0x14f),_0x4688e2(0x158),_0x4688e2(0x13a));}async[a51_0x4cbb8a(0x13b)](_0x4fbe2f,_0x4c614e){const _0x5d0e05=a51_0x4cbb8a;if(!a51_0x40f89e[_0x5d0e05(0x142)](this[_0x5d0e05(0x156)]))throw new Error(_0x5d0e05(0x13c)+this[_0x5d0e05(0x156)]);const _0x3ce4dd=Date['now']();logger[_0x5d0e05(0x12a)](_0x5d0e05(0x158),_0x5d0e05(0x151),{'pageName':_0x4fbe2f,'routePath':_0x4c614e,'file':this['routerFilePath']});try{const _0x559d05=await a51_0x40f89e[_0x5d0e05(0x14d)][_0x5d0e05(0x132)](this[_0x5d0e05(0x156)],_0x5d0e05(0x12c)),_0x1c32e9=this['toComponentName'](_0x4fbe2f),_0x4a6196=this[_0x5d0e05(0x127)](_0x559d05,_0x1c32e9,_0x4fbe2f),_0x411bfe=this[_0x5d0e05(0x14c)](_0x4a6196,_0x4c614e,_0x1c32e9);await a51_0x40f89e['promises']['writeFile'](this[_0x5d0e05(0x156)],_0x411bfe,_0x5d0e05(0x12c));const _0x571e06=Date[_0x5d0e05(0x135)]()-_0x3ce4dd;logger[_0x5d0e05(0x129)](_0x5d0e05(0x158),_0x5d0e05(0x14e),_0x571e06,{'pageName':_0x4fbe2f,'routePath':_0x4c614e,'componentName':_0x1c32e9});}catch(_0x246850){const _0x1ca00b=Date[_0x5d0e05(0x135)]()-_0x3ce4dd;logger[_0x5d0e05(0x136)](_0x5d0e05(0x158),_0x5d0e05(0x143),{'pageName':_0x4fbe2f,'routePath':_0x4c614e,'error':_0x246850 instanceof Error?_0x246850[_0x5d0e05(0x12f)]:String(_0x246850),'duration':_0x1ca00b});throw _0x246850;}}[a51_0x4cbb8a(0x150)](_0x49a35c){const _0x2dd37d=a51_0x4cbb8a;return _0x49a35c[_0x2dd37d(0x12b)]('-')[_0x2dd37d(0x133)](_0x3d4b03=>_0x3d4b03[_0x2dd37d(0x14a)](0x0)[_0x2dd37d(0x144)]()+_0x3d4b03['slice'](0x1)['toLowerCase']())[_0x2dd37d(0x12e)]('');}[a51_0x4cbb8a(0x127)](_0xb251c0,_0x577f05,_0x127eac){const _0x596647=a51_0x4cbb8a,_0x5f0041=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x1f3fbb=_0xb251c0[_0x596647(0x134)](_0x5f0041)||[],_0x63f500='import\x20'+_0x577f05+_0x596647(0x146)+_0x127eac+'\x22;';if(_0xb251c0[_0x596647(0x137)](_0x63f500))return _0xb251c0;if(_0x1f3fbb['length']>0x0){const _0x3b8dcf=_0x1f3fbb[_0x1f3fbb['length']-0x1];if(_0x3b8dcf){const _0x1be866=_0xb251c0['lastIndexOf'](_0x3b8dcf),_0x265bb8=_0x1be866+_0x3b8dcf['length'];return _0xb251c0[_0x596647(0x12d)](0x0,_0x265bb8)+_0x63f500+'\x0a'+_0xb251c0['slice'](_0x265bb8);}}const _0x1dcc35=_0xb251c0[_0x596647(0x134)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x1dcc35&&_0x1dcc35['index']!==undefined){const _0x142d9b=_0x1dcc35[_0x596647(0x13d)]+_0x1dcc35[0x0][_0x596647(0x13f)];return _0xb251c0['slice'](0x0,_0x142d9b)+_0x63f500+'\x0a'+_0xb251c0['slice'](_0x142d9b);}return _0xb251c0;}['addRoute'](_0x2645c8,_0x275bcd,_0x43adee){const _0xa977fb=a51_0x4cbb8a,_0x4860a4=_0xa977fb(0x154)+_0x275bcd+_0xa977fb(0x138)+_0x43adee+_0xa977fb(0x14b);if(_0x2645c8['includes'](_0xa977fb(0x159)+_0x275bcd+'\x22'))return _0x2645c8;const _0x26bd4b=/children:\s*\[([\s\S]*?)\]/,_0x969b2a=_0x2645c8['match'](_0x26bd4b);if(!_0x969b2a||_0x969b2a[_0xa977fb(0x13d)]===undefined)throw new Error(_0xa977fb(0x148));const _0x1cb093=_0x969b2a[0x1],_0x2fd149=_0x969b2a[_0xa977fb(0x13d)]+_0x969b2a[0x0][_0xa977fb(0x13e)]('[')+0x1,_0x45ccbc=_0x1cb093?.[_0xa977fb(0x134)](/\{[\s\S]*?\},/g)||[];if(_0x45ccbc[_0xa977fb(0x13f)]>0x0){const _0x30f3f4=_0x45ccbc[_0x45ccbc[_0xa977fb(0x13f)]-0x1];if(_0x30f3f4){const _0xce5730=_0x2645c8[_0xa977fb(0x145)](_0x30f3f4),_0x4ab105=_0xce5730+_0x30f3f4['length'];return _0x2645c8[_0xa977fb(0x12d)](0x0,_0x4ab105)+'\x0a'+_0x4860a4+_0x2645c8[_0xa977fb(0x12d)](_0x4ab105);}}return _0x2645c8['slice'](0x0,_0x2fd149)+'\x0a'+_0x4860a4+_0x2645c8[_0xa977fb(0x12d)](_0x2fd149);}async[a51_0x4cbb8a(0x157)](_0x251df5,_0x54e164){const _0x433104=a51_0x4cbb8a;if(!a51_0x40f89e['existsSync'](this[_0x433104(0x156)]))throw new Error('路由文件不存在:\x20'+this[_0x433104(0x156)]);const _0x622e4a=await a51_0x40f89e[_0x433104(0x14d)][_0x433104(0x132)](this[_0x433104(0x156)],_0x433104(0x12c)),_0x10e519=this[_0x433104(0x150)](_0x251df5);let _0x291440=this['addImport'](_0x622e4a,_0x10e519,_0x251df5);return _0x291440=this[_0x433104(0x14c)](_0x291440,_0x54e164,_0x10e519),_0x291440;}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export function sleep(_0x596be6){return new Promise(_0x4f5650=>setTimeout(_0x4f5650,_0x596be6));}
|