@lovrabet/cli 1.2.1-beta.3 → 1.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +3 -3
- package/templates/projects/sub-app-react-demo/package.json +2 -2
- package/templates/projects/sub-app-react-demo/src/api/api.ts +42 -25
- package/templates/projects/sub-app-react-demo/src/api/client.ts +11 -10
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +72 -19
- package/templates/projects/sub-app-react-demo/package-lock.json +0 -4062
package/lib/cmd/logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a32_0x5a1e(){const _0x4e5dcb=['\x20\x20\x20时间:\x20','2168684TefiGe','zh-CN','setLogPath','25HxaqFP','clearLogs','duration','187689YEWRRf','*\x20日志已清空','1129530ecretp','*\x20Lovrabet\x20CLI\x20日志记录:\x0a','2111010ecszjf','error','12430864MBXVNj','timestamp','\x20\x20\x20详情:\x20','warn','\x20\x20\x20耗时:\x20','level','35694648WCgntJ','log','320157AxhrtU','length','forEach','cwd','message','36ytrksb'];a32_0x5a1e=function(){return _0x4e5dcb;};return a32_0x5a1e();}(function(_0x4d91d5,_0x14d8d2){const _0x3a7141=a32_0x10b6,_0x4f9009=_0x4d91d5();while(!![]){try{const _0x17c62c=parseInt(_0x3a7141(0x158))/0x1+parseInt(_0x3a7141(0x169))/0x2+parseInt(_0x3a7141(0x165))/0x3*(parseInt(_0x3a7141(0x15d))/0x4)+parseInt(_0x3a7141(0x162))/0x5*(parseInt(_0x3a7141(0x167))/0x6)+parseInt(_0x3a7141(0x15f))/0x7+parseInt(_0x3a7141(0x150))/0x8+-parseInt(_0x3a7141(0x156))/0x9;if(_0x17c62c===_0x14d8d2)break;else _0x4f9009['push'](_0x4f9009['shift']());}catch(_0xe7aa65){_0x4f9009['push'](_0x4f9009['shift']());}}}(a32_0x5a1e,0xbdd82));import{logger}from'../utils/logger.js';function a32_0x10b6(_0x135cef,_0x199082){_0x135cef=_0x135cef-0x150;const _0x5a1e09=a32_0x5a1e();let _0x10b62b=_0x5a1e09[_0x135cef];return _0x10b62b;}export function showLogs(){const _0xeb9f9b=a32_0x10b6;logger['setLogPath'](process[_0xeb9f9b(0x15b)]());const _0x4fd25d=logger['readLogs']();if(_0x4fd25d[_0xeb9f9b(0x159)]===0x0){console[_0xeb9f9b(0x157)]('*\x20暂无日志记录');return;}console[_0xeb9f9b(0x157)](_0xeb9f9b(0x168)),_0x4fd25d[_0xeb9f9b(0x15a)]((_0x3376de,_0x35ff69)=>{const _0x1e481c=_0xeb9f9b,_0x202538=new Date(_0x3376de[_0x1e481c(0x151)])['toLocaleString'](_0x1e481c(0x160)),_0x2049eb=_0x3376de[_0x1e481c(0x155)]==='success'?'√':_0x3376de['level']===_0x1e481c(0x16a)?'×':_0x3376de[_0x1e481c(0x155)]===_0x1e481c(0x153)?'!':'i';console[_0x1e481c(0x157)](_0x35ff69+0x1+'.\x20'+_0x2049eb+'\x20['+_0x3376de['command']+']\x20'+_0x3376de[_0x1e481c(0x15c)]),console[_0x1e481c(0x157)](_0x1e481c(0x15e)+_0x202538),_0x3376de[_0x1e481c(0x164)]&&console['log'](_0x1e481c(0x154)+_0x3376de[_0x1e481c(0x164)]+'ms'),_0x3376de['details']&&Object['keys'](_0x3376de['details'])[_0x1e481c(0x159)]>0x0&&console[_0x1e481c(0x157)](_0x1e481c(0x152)+JSON['stringify'](_0x3376de['details'],null,0x2)),console[_0x1e481c(0x157)]('');});}export function clearLogs(){const _0x155e82=a32_0x10b6;logger[_0x155e82(0x161)](process[_0x155e82(0x15b)]()),logger[_0x155e82(0x163)](),console[_0x155e82(0x157)](_0x155e82(0x166));}
|
package/lib/cmd/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a1a0f,_0x1f25c9){const _0x40b2a4=a33_0x4774,_0x1792d7=_0x2a1a0f();while(!![]){try{const _0x37c29b=parseInt(_0x40b2a4(0xb7))/0x1*(parseInt(_0x40b2a4(0xb5))/0x2)+-parseInt(_0x40b2a4(0xae))/0x3+parseInt(_0x40b2a4(0xb9))/0x4+parseInt(_0x40b2a4(0xbb))/0x5+-parseInt(_0x40b2a4(0xb6))/0x6*(parseInt(_0x40b2a4(0xb0))/0x7)+parseInt(_0x40b2a4(0xc0))/0x8+parseInt(_0x40b2a4(0xb3))/0x9;if(_0x37c29b===_0x1f25c9)break;else _0x1792d7['push'](_0x1792d7['shift']());}catch(_0x3676db){_0x1792d7['push'](_0x1792d7['shift']());}}}(a33_0x1d20,0x56120));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a33_0x4774(_0x58bac6,_0x4ea04a){_0x58bac6=_0x58bac6-0xa3;const _0x1d2010=a33_0x1d20();let _0x477499=_0x1d2010[_0x58bac6];return _0x477499;}function a33_0x1d20(){const _0x1dbe04=['data','1704055XWIvZv','trim','.bin','info','cwd','610432iPMgOM','preview','inherit','stderr','预览服务器启动失败','node_modules','启动预览服务器','预览服务器启动出错','now','close','pipe','vite\x20preview','2072055KSrDOx','toString','3504361aGPGip','env','vite','8868699YSgAso','success','62024goPSjk','6ddcpPA','3QMqffy','message','193160UBiZTV'];a33_0x1d20=function(){return _0x1dbe04;};return a33_0x1d20();}import{logger}from'../utils/logger.js';export function runPreview(){return new Promise((_0x5ae9ad,_0x3d1874)=>{const _0x204d5e=a33_0x4774,_0xd1d61=Date[_0x204d5e(0xaa)]();logger[_0x204d5e(0xbe)]('preview',_0x204d5e(0xa8),{'command':_0x204d5e(0xad)});let _0x49baa3='';const _0x4b82d5=spawn(_0x204d5e(0xb2),[_0x204d5e(0xa3)],{'stdio':[_0x204d5e(0xa4),_0x204d5e(0xa4),_0x204d5e(0xac)],'shell':!![],'env':{...process[_0x204d5e(0xb1)],'PATH':''+join(process[_0x204d5e(0xbf)](),_0x204d5e(0xa7),_0x204d5e(0xbd))+delimiter+process[_0x204d5e(0xb1)]['PATH']}});_0x4b82d5[_0x204d5e(0xa5)]?.['on'](_0x204d5e(0xba),_0x40f17a=>{const _0x5050af=_0x204d5e;_0x49baa3+=_0x40f17a[_0x5050af(0xaf)]();}),_0x4b82d5['on'](_0x204d5e(0xab),_0x154d1a=>{const _0x1d091c=_0x204d5e,_0x1f9bba=Date[_0x1d091c(0xaa)]()-_0xd1d61;if(_0x154d1a===0x0||_0x154d1a===null)logger[_0x1d091c(0xb4)](_0x1d091c(0xa3),'预览服务器启动成功',_0x1f9bba),_0x5ae9ad();else{const _0x5df6a9={'exitCode':_0x154d1a,'duration':_0x1f9bba,'command':_0x1d091c(0xad),'cwd':process[_0x1d091c(0xbf)]()};_0x49baa3[_0x1d091c(0xbc)]()&&(_0x5df6a9[_0x1d091c(0xa5)]=_0x49baa3[_0x1d091c(0xbc)]()),logger['error']('preview',_0x1d091c(0xa6),_0x5df6a9),_0x3d1874(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x154d1a));}}),_0x4b82d5['on']('error',_0x23bd51=>{const _0x2ffdde=_0x204d5e,_0x1801d6=Date[_0x2ffdde(0xaa)]()-_0xd1d61;logger['error']('preview',_0x2ffdde(0xa9),{'error':_0x23bd51[_0x2ffdde(0xb8)],'duration':_0x1801d6,'stderr':_0x49baa3[_0x2ffdde(0xbc)]()||undefined}),_0x3d1874(_0x23bd51);});});}
|
package/lib/cmd/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x8f4bb,_0x469af8){const _0x5aba15=a34_0x25f6,_0x51dd50=_0x8f4bb();while(!![]){try{const _0x356f28=parseInt(_0x5aba15(0x125))/0x1*(parseInt(_0x5aba15(0x11e))/0x2)+-parseInt(_0x5aba15(0x10e))/0x3+parseInt(_0x5aba15(0x124))/0x4+-parseInt(_0x5aba15(0x127))/0x5*(parseInt(_0x5aba15(0x118))/0x6)+parseInt(_0x5aba15(0x10b))/0x7+parseInt(_0x5aba15(0x11f))/0x8+parseInt(_0x5aba15(0x11c))/0x9;if(_0x356f28===_0x469af8)break;else _0x51dd50['push'](_0x51dd50['shift']());}catch(_0x3c3074){_0x51dd50['push'](_0x51dd50['shift']());}}}(a34_0x1516,0x2c6c0));function a34_0x25f6(_0x24cc47,_0x417813){_0x24cc47=_0x24cc47-0x104;const _0x151627=a34_0x1516();let _0x25f6f8=_0x151627[_0x24cc47];return _0x25f6f8;}function a34_0x1516(){const _0x29127f=['1031925tKkEVS','开发服务器启动出错','vite','node_modules','inherit','stderr','success','close','start','1074164leojGP','cwd','version','429273xaayKM','minVersion','error','SDK\x20版本低于推荐版本','data','.bin','env','trim','warn','vite\x20exited\x20with\x20code\x20','6dvoGwf','PATH','开发服务器启动成功','开发服务器启动失败','548811IWEuep','toString','51026EmfYuz','12448dmGZIx','now','message','pipe','write','853556RocQlo','4gqxkxv','启动开发服务器'];a34_0x1516=function(){return _0x29127f;};return a34_0x1516();}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';export function runStart(_0x5d921a){return new Promise((_0x11c930,_0x59822a)=>{const _0x146af9=a34_0x25f6,_0x4f12e7=Date[_0x146af9(0x120)](),_0xf14073=_0x5d921a||process[_0x146af9(0x10c)](),_0x2ff68d=checkSdkVersion(_0xf14073);_0x2ff68d['needsUpgrade']&&(printSdkUpgradeWarning(_0x2ff68d),logger[_0x146af9(0x116)](_0x146af9(0x10a),_0x146af9(0x111),{'currentVersion':_0x2ff68d[_0x146af9(0x10d)],'minVersion':_0x2ff68d[_0x146af9(0x10f)]}));logger['info'](_0x146af9(0x10a),_0x146af9(0x126),{'command':_0x146af9(0x104),'cwd':_0xf14073});let _0x865e28='';const _0x3b43ba=spawn(_0x146af9(0x104),{'stdio':[_0x146af9(0x106),'inherit',_0x146af9(0x122)],'shell':!![],'cwd':_0xf14073,'env':{...process['env'],'PATH':''+join(_0xf14073,_0x146af9(0x105),_0x146af9(0x113))+delimiter+process[_0x146af9(0x114)][_0x146af9(0x119)]}});_0x3b43ba[_0x146af9(0x107)]?.['on'](_0x146af9(0x112),_0x23288d=>{const _0x304730=_0x146af9,_0x2a4949=_0x23288d[_0x304730(0x11d)]();_0x865e28+=_0x2a4949,process[_0x304730(0x107)][_0x304730(0x123)](_0x2a4949);}),_0x3b43ba['on'](_0x146af9(0x109),_0x17967a=>{const _0x2d730b=_0x146af9,_0x24faa9=Date[_0x2d730b(0x120)]()-_0x4f12e7;if(_0x17967a===0x0||_0x17967a===null)logger[_0x2d730b(0x108)]('start',_0x2d730b(0x11a),_0x24faa9),_0x11c930();else{const _0x245d90={'exitCode':_0x17967a,'duration':_0x24faa9,'command':'vite','cwd':_0xf14073};_0x865e28['trim']()&&(_0x245d90[_0x2d730b(0x107)]=_0x865e28['trim']()),logger['error'](_0x2d730b(0x10a),_0x2d730b(0x11b),_0x245d90),_0x59822a(new Error(_0x2d730b(0x117)+_0x17967a));}}),_0x3b43ba['on'](_0x146af9(0x110),_0x405280=>{const _0x145da1=_0x146af9,_0x5cbb0c=Date[_0x145da1(0x120)]()-_0x4f12e7,_0x421104={'error':_0x405280[_0x145da1(0x121)],'duration':_0x5cbb0c,'command':_0x145da1(0x104),'cwd':_0xf14073};_0x865e28[_0x145da1(0x115)]()&&(_0x421104[_0x145da1(0x107)]=_0x865e28[_0x145da1(0x115)]()),logger[_0x145da1(0x110)](_0x145da1(0x10a),_0x145da1(0x128),_0x421104),_0x59822a(_0x405280);});});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a35_0x2bdb(_0x2b997b,_0x3b35eb){_0x2b997b=_0x2b997b-0xb8;const _0x1c47ce=a35_0x1c47();let _0x2bdb54=_0x1c47ce[_0x2b997b];return _0x2bdb54;}(function(_0x4176f9,_0x259eb3){const _0x3b0979=a35_0x2bdb,_0x2900ec=_0x4176f9();while(!![]){try{const _0x4a9c5d=parseInt(_0x3b0979(0xcc))/0x1*(-parseInt(_0x3b0979(0xbf))/0x2)+parseInt(_0x3b0979(0xd0))/0x3*(parseInt(_0x3b0979(0xc1))/0x4)+-parseInt(_0x3b0979(0xcd))/0x5+-parseInt(_0x3b0979(0xc4))/0x6*(-parseInt(_0x3b0979(0xc6))/0x7)+-parseInt(_0x3b0979(0xc3))/0x8+parseInt(_0x3b0979(0xba))/0x9*(parseInt(_0x3b0979(0xc0))/0xa)+parseInt(_0x3b0979(0xc9))/0xb*(parseInt(_0x3b0979(0xc2))/0xc);if(_0x4a9c5d===_0x259eb3)break;else _0x2900ec['push'](_0x2900ec['shift']());}catch(_0x5383b2){_0x2900ec['push'](_0x2900ec['shift']());}}}(a35_0x1c47,0x37586));import{jsxs as a35_0x56081a,jsx as a35_0x2a332c}from'react/jsx-runtime';import{Box,Text}from'ink';export function ConfigHelp(){const _0x2519fa=a35_0x2bdb,_0x3c7d0f=[{'command':_0x2519fa(0xb9),'description':'设置配置项'},{'command':_0x2519fa(0xd1),'description':_0x2519fa(0xc7)},{'command':_0x2519fa(0xd2),'description':_0x2519fa(0xbb)}],_0xe1402b=[{'command':_0x2519fa(0xca),'description':_0x2519fa(0xbc)},{'command':'lovrabet\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','description':_0x2519fa(0xbe)}];return a35_0x56081a(Box,{'flexDirection':_0x2519fa(0xbd),'marginTop':0x1,'marginBottom':0x1,'children':[a35_0x2a332c(Box,{'marginBottom':0x1,'children':a35_0x56081a(Text,{'color':_0x2519fa(0xcb),'children':['\x20!','\x20\x20',_0x2519fa(0xcf)]})}),_0x3c7d0f[_0x2519fa(0xc5)](_0x1398f7=>a35_0x56081a(Box,{'children':[a35_0x56081a(Text,{'children':[_0x2519fa(0xc8),_0x1398f7[_0x2519fa(0xd3)]]}),a35_0x2a332c(Text,{'color':_0x2519fa(0xcb),'children':_0x1398f7[_0x2519fa(0xce)]})]},_0x1398f7[_0x2519fa(0xd3)])),a35_0x2a332c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a35_0x2a332c(Text,{'color':_0x2519fa(0xcb),'children':_0x2519fa(0xb8)})}),_0xe1402b['map'](_0x4f49ce=>a35_0x56081a(Box,{'children':[a35_0x56081a(Text,{'children':[_0x2519fa(0xc8),_0x4f49ce[_0x2519fa(0xd3)]]}),a35_0x2a332c(Text,{'color':'gray','children':_0x4f49ce['description']})]},_0x4f49ce['command']))]});}function a35_0x1c47(){const _0x23f417=['99372FTKrLO','lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','command','\x20*\x20配置示例:','lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','579825LZpiYO','列出所有配置项','配置当前项目的\x20App\x20Code','column','设置环境\x20(online/daily)','109070vPANKm','70DlmBSC','16yjdXHN','64068yEwTMW','2866344xVpKdy','1740qirexB','map','1085aKuFdj','获取配置项','\x20\x20\x20\x20','869FzNCEV','lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','gray','5tXuBpO','962700DezDwI','description','无效的命令,可用命令如下:'];a35_0x1c47=function(){return _0x23f417;};return a35_0x1c47();}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ea12d,_0x20e735){const _0x4922a4=a36_0x26f8,_0x51c200=_0x3ea12d();while(!![]){try{const _0x2cf155=parseInt(_0x4922a4(0x197))/0x1*(parseInt(_0x4922a4(0x186))/0x2)+-parseInt(_0x4922a4(0x190))/0x3*(parseInt(_0x4922a4(0x18e))/0x4)+-parseInt(_0x4922a4(0x18f))/0x5+parseInt(_0x4922a4(0x188))/0x6*(parseInt(_0x4922a4(0x199))/0x7)+parseInt(_0x4922a4(0x17e))/0x8+parseInt(_0x4922a4(0x196))/0x9+-parseInt(_0x4922a4(0x17d))/0xa;if(_0x2cf155===_0x20e735)break;else _0x51c200['push'](_0x51c200['shift']());}catch(_0x439b3c){_0x51c200['push'](_0x51c200['shift']());}}}(a36_0x5f37,0x2f282));import{jsx as a36_0x1d942c,jsxs as a36_0x285424}from'react/jsx-runtime';import{existsSync,readFileSync,writeFileSync}from'node:fs';import a36_0x280ef1 from'node:fs';import a36_0x3a422f from'node:path';import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';import{readConfig,isInProject,projectConfigPath,globalConfigPath}from'../utils/config.js';function a36_0x5f37(){const _0x4f3b37=['2089480CylGNe','flags','includes','.tmp','保存配置失败','daily','parse','配置值无效或过长','718598xciKKQ','undefined','138324vnIYPw','环境配置已设置为:\x20','length','message','log','string','168ogjxbJ','821515tZPmJF','405YpYUHf','red','保存配置失败:\x20','dirname','list','未提供配置值','2087775ZyIwlO','1KSWOSe','env','35GcTEqk','unlinkSync','input','set','utf8','appcode','get','online','stringify','--help','app','6046020UJcVyK'];a36_0x5f37=function(){return _0x4f3b37;};return a36_0x5f37();}import{logger}from'../utils/logger.js';function a36_0x26f8(_0x1a92fd,_0x3e7db9){_0x1a92fd=_0x1a92fd-0x175;const _0x5f37c6=a36_0x5f37();let _0x26f86e=_0x5f37c6[_0x1a92fd];return _0x26f86e;}export function Config(_0x28e92d){const _0x3a6427=a36_0x26f8,{cli:_0x573afb}=_0x28e92d,_0x41a5a7=_0x573afb['input'][0x1],_0x190496=_0x573afb[_0x3a6427(0x19b)][0x2],_0x1d824c=[_0x3a6427(0x175),_0x3a6427(0x178)][_0x3a6427(0x180)](_0x41a5a7||''),_0x4ab5fd=_0x573afb['input'][_0x3a6427(0x18a)]>=0x3;if(_0x190496===_0x3a6427(0x17b)||_0x573afb[_0x3a6427(0x17f)]['help'])return a36_0x1d942c(ConfigHelp,{});const _0x1693ba=readConfig();if(_0x41a5a7==='set'){if(_0x190496){const _0x67a80a=_0x573afb[_0x3a6427(0x19b)][0x3];if(typeof _0x67a80a!==_0x3a6427(0x187)){if(_0x190496===_0x3a6427(0x198)&&![_0x3a6427(0x179),_0x3a6427(0x183)]['includes'](_0x67a80a))return a36_0x1d942c(Box,{'children':a36_0x1d942c(Text,{'color':_0x3a6427(0x191),'children':'环境配置值只能是\x20\x22online\x22\x20或\x20\x22daily\x22'})});const _0x435096=isInProject(),_0x324ec0=_0x435096?projectConfigPath:globalConfigPath;let _0x8737b8={};try{if(existsSync(_0x324ec0)){const _0x502113=readFileSync(_0x324ec0,{'encoding':_0x3a6427(0x176)});_0x502113&&(_0x8737b8=JSON[_0x3a6427(0x184)](_0x502113));}}catch(_0x17e0f2){}if(typeof _0x67a80a!==_0x3a6427(0x18d)||_0x67a80a['length']>0x1f4)return a36_0x1d942c(Box,{'children':a36_0x1d942c(Text,{'color':'red','children':_0x3a6427(0x185)})});let _0x1319ee=_0x190496;_0x190496===_0x3a6427(0x17c)&&(_0x1319ee=_0x3a6427(0x177),delete _0x8737b8[_0x3a6427(0x17c)]);_0x190496===_0x3a6427(0x177)&&delete _0x8737b8[_0x3a6427(0x17c)];_0x8737b8[_0x1319ee]=_0x67a80a;try{const _0x1ba1db=a36_0x3a422f[_0x3a6427(0x193)](_0x324ec0);!existsSync(_0x1ba1db)&&a36_0x280ef1['mkdirSync'](_0x1ba1db,{'recursive':!![]});const _0x1b95c0=_0x324ec0+_0x3a6427(0x181);writeFileSync(_0x1b95c0,JSON[_0x3a6427(0x17a)](_0x8737b8,null,0x2),{'encoding':_0x3a6427(0x176),'mode':0x180}),a36_0x280ef1['renameSync'](_0x1b95c0,_0x324ec0);if(_0x190496===_0x3a6427(0x198)){const _0x49950c=_0x435096?'项目':'全局';console[_0x3a6427(0x18c)]('✓\x20'+_0x49950c+_0x3a6427(0x189)+_0x67a80a);}}catch(_0x3eadfe){const _0x3b49aa=_0x324ec0+'.tmp';try{existsSync(_0x3b49aa)&&a36_0x280ef1[_0x3a6427(0x19a)](_0x3b49aa);}catch(_0x3a748e){}return logger['error']('config',_0x3a6427(0x182),{'error':_0x3eadfe instanceof Error?_0x3eadfe[_0x3a6427(0x18b)]:String(_0x3eadfe),'configKey':_0x190496,'configValue':_0x67a80a,'targetConfigPath':_0x324ec0}),a36_0x1d942c(Box,{'children':a36_0x285424(Text,{'color':_0x3a6427(0x191),'children':[_0x3a6427(0x192),_0x3eadfe instanceof Error?_0x3eadfe['message']:String(_0x3eadfe)]})});}return null;}return a36_0x1d942c(Box,{'children':a36_0x1d942c(Text,{'color':'red','children':_0x3a6427(0x195)})});}}if(_0x41a5a7===_0x3a6427(0x178)){if(_0x190496){let _0x55bbbe=_0x190496;return _0x190496==='app'&&(_0x55bbbe='appcode'),console[_0x3a6427(0x18c)](_0x1693ba[_0x55bbbe]||'undefined'),null;}return null;}if(_0x41a5a7===_0x3a6427(0x194))return console[_0x3a6427(0x18c)](JSON[_0x3a6427(0x17a)](_0x1693ba,null,0x2)),null;if(!_0x1d824c||!_0x4ab5fd)return a36_0x1d942c(ConfigHelp,{});return null;}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x22d55e=a37_0x5370;function a37_0x5370(_0x63b38f,_0x105b5b){_0x63b38f=_0x63b38f-0x10c;const _0x37a211=a37_0x37a2();let _0x537095=_0x37a211[_0x63b38f];return _0x537095;}(function(_0x22c668,_0x451442){const _0x12cd48=a37_0x5370,_0x541e69=_0x22c668();while(!![]){try{const _0x269b08=-parseInt(_0x12cd48(0x118))/0x1*(-parseInt(_0x12cd48(0x10e))/0x2)+parseInt(_0x12cd48(0x10f))/0x3+-parseInt(_0x12cd48(0x119))/0x4+parseInt(_0x12cd48(0x11a))/0x5*(parseInt(_0x12cd48(0x11b))/0x6)+-parseInt(_0x12cd48(0x115))/0x7*(parseInt(_0x12cd48(0x113))/0x8)+-parseInt(_0x12cd48(0x11c))/0x9*(parseInt(_0x12cd48(0x117))/0xa)+parseInt(_0x12cd48(0x112))/0xb*(parseInt(_0x12cd48(0x111))/0xc);if(_0x269b08===_0x451442)break;else _0x541e69['push'](_0x541e69['shift']());}catch(_0x2a7b07){_0x541e69['push'](_0x541e69['shift']());}}}(a37_0x37a2,0x619c7));function a37_0x37a2(){const _0x465eb2=['2yReHig','1376877QztaSc','online','12348xzOgVx','8371QCfhni','8yKyqbv','https://api.lovrabet.com','1724023ONqhse','https://user.lovrabet.com','20nKfQZv','409074gOmvxA','1585592QwZMJj','30DRoxPz','50610OdRPxH','2966445qtLGny','https://daily-api.lovrabet.com','https://user-daily.lovrabet.com'];a37_0x37a2=function(){return _0x465eb2;};return a37_0x37a2();}import{getEnv}from'./env.js';export const getUserDomain=()=>getEnv()==='online'?a37_0x22d55e(0x116):a37_0x22d55e(0x10d);export const getApiDomain=()=>getEnv()===a37_0x22d55e(0x110)?a37_0x22d55e(0x114):a37_0x22d55e(0x10c);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a38_0x24b6a5=a38_0xb1e2;(function(_0x4a92b8,_0x3f4f71){const _0x248429=a38_0xb1e2,_0x157d6c=_0x4a92b8();while(!![]){try{const _0x1f2b2c=-parseInt(_0x248429(0xf3))/0x1*(-parseInt(_0x248429(0xf0))/0x2)+parseInt(_0x248429(0xef))/0x3+-parseInt(_0x248429(0xf1))/0x4*(parseInt(_0x248429(0xed))/0x5)+-parseInt(_0x248429(0xeb))/0x6*(parseInt(_0x248429(0xec))/0x7)+parseInt(_0x248429(0xea))/0x8*(parseInt(_0x248429(0xe9))/0x9)+-parseInt(_0x248429(0xf2))/0xa*(-parseInt(_0x248429(0xf4))/0xb)+-parseInt(_0x248429(0xee))/0xc;if(_0x1f2b2c===_0x3f4f71)break;else _0x157d6c['push'](_0x157d6c['shift']());}catch(_0x47a3bd){_0x157d6c['push'](_0x157d6c['shift']());}}}(a38_0x340d,0xcf365));let env=process[a38_0x24b6a5(0xe8)][a38_0x24b6a5(0xe7)]||'online';export function getEnv(){return env;}function a38_0xb1e2(_0x5354e3,_0x2d58da){_0x5354e3=_0x5354e3-0xe7;const _0x340de6=a38_0x340d();let _0xb1e2f=_0x340de6[_0x5354e3];return _0xb1e2f;}function a38_0x340d(){const _0x98673c=['2SZYGkS','44363feZgWU','LOVRABET_ENV','env','9RDpIGv','6172520SRDyyi','2298690lzuJZm','28kVXwqy','1070mMnlIc','2783832rZOzeX','302076czObuY','1316334yrlyiu','20860CQIkVq','3820yulGAJ'];a38_0x340d=function(){return _0x98673c;};return a38_0x340d();}export function initEnv(_0x3c7f43){env=_0x3c7f43;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5266bf,_0x35250a){const _0x1dc515=a39_0x5902,_0x39decd=_0x5266bf();while(!![]){try{const _0x4d185e=-parseInt(_0x1dc515(0x1d9))/0x1*(-parseInt(_0x1dc515(0x1c8))/0x2)+-parseInt(_0x1dc515(0x1ea))/0x3+-parseInt(_0x1dc515(0x1fc))/0x4+-parseInt(_0x1dc515(0x1f4))/0x5+parseInt(_0x1dc515(0x1db))/0x6*(parseInt(_0x1dc515(0x1e4))/0x7)+parseInt(_0x1dc515(0x1d5))/0x8*(parseInt(_0x1dc515(0x1f9))/0x9)+parseInt(_0x1dc515(0x1c6))/0xa*(parseInt(_0x1dc515(0x1c4))/0xb);if(_0x4d185e===_0x35250a)break;else _0x39decd['push'](_0x39decd['shift']());}catch(_0x1bc179){_0x39decd['push'](_0x39decd['shift']());}}}(a39_0x35cb,0x3b1ea));import{jsx as a39_0x2e7943,jsxs as a39_0x2ec2f6,Fragment as a39_0x166faa}from'react/jsx-runtime';import{useState}from'react';function a39_0x35cb(){const _0x855331=['拉取API配置','\x20登录中...','11GFELUY','rightArrow','3645490cdpiCt','value','3796GPPLFV','test','column','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','trim','*\x20正在检查登录状态...','!\x20未检测到有效登录','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','*\x20创建新项目','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','cyan','*\x20项目名:\x20','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','8eyZEUT','red','登录状态','leftArrow','42AXvwQh','online','6ZyEMKW','项目名不合法','green','login','login-check','env','login-prompt','\x20←\x20','已登录','619815XmjcFu','confirm-api-pull','string','return','map','includes','704649nyukBl','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','\x20\x20使用\x20←→\x20选择,回车确认','label','yellow','creating','登录失败','project-name','[可选]:\x20','*\x20应用AppCode\x20','998855YAzFRl','\x20检查中...','Yes','backspace','gray','1569717sGRzzd','应用AppCode','项目名长度不能超过\x2050\x20个字符','121660rASCdH','未设置','slice','app-code','length'];a39_0x35cb=function(){return _0x855331;};return a39_0x35cb();}function a39_0x5902(_0x1e4f32,_0x305e56){_0x1e4f32=_0x1e4f32-0x1c4;const _0x35cb8d=a39_0x35cb();let _0x5902e3=_0x35cb8d[_0x1e4f32];return _0x5902e3;}import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x3a92f3){const _0x52c7e7=a39_0x5902,{onCreate:_0x798227,env:_0x31f566}=_0x3a92f3,[_0x2f0eca,_0x5117b4]=useState(_0x52c7e7(0x1f1)),[_0x5b279d,_0x38221e]=useState(''),[_0x41dd5d,_0x490120]=useState(''),[_0x1480a7,_0xf42a33]=useState(''),[_0x999d15,_0x16ca46]=useState(''),[_0x1b032d,_0x49cbb6]=useState([]),[_0x58a5d5,_0x535ec4]=useState(null),[_0x408059,_0x3ba60e]=useState(![]),[_0x3ba90e,_0x2fef6d]=useState(![]),[_0x3f0ef3,_0x5aeae6]=useState(![]),[_0x1776f7,_0x260da3]=useState(0x0),[_0x938d5c,_0x36f093]=useState(0x0),_0xe115eb='my-app',_0x4a8416=readConfig(),_0x320f3b=typeof _0x4a8416[_0x52c7e7(0x1e0)]===_0x52c7e7(0x1e6)?_0x4a8416[_0x52c7e7(0x1e0)]:undefined;function _0x314cba(_0x519f96){const _0x1296c0=_0x52c7e7;if(_0x519f96[_0x1296c0(0x200)]>0x32)return{'valid':![],'message':_0x1296c0(0x1fb)};const _0x1663f8=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x519f96?.[_0x1296c0(0x1cc)]()&&!_0x1663f8[_0x1296c0(0x1c9)](_0x519f96))return{'valid':![],'message':_0x1296c0(0x1d4)};return{'valid':!![]};}function _0x31172b(_0x4617d3){const _0x130f44=_0x52c7e7;if(!_0x4617d3[_0x130f44(0x1cc)]())return{'valid':!![]};if(_0x4617d3[_0x130f44(0x200)]>0x64)return{'valid':![],'message':'应用AppCode长度不能超过\x20100\x20个字符'};const _0xe6030d=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0xe6030d[_0x130f44(0x1c9)](_0x4617d3))return{'valid':![],'message':_0x130f44(0x1eb)};return{'valid':!![]};}async function _0x2e2723(){_0x3ba60e(!![]);try{const _0x3ed6d5=await getIsSessionValid();return _0x535ec4(_0x3ed6d5),_0x3ed6d5;}catch(_0xe68bd9){return _0x535ec4(![]),![];}finally{_0x3ba60e(![]);}}async function _0x5179db(){_0x2fef6d(!![]);try{const _0xd706ca=await authServer({'silent':!![]});return _0x535ec4(_0xd706ca),_0xd706ca;}catch(_0x1a87fb){return _0x535ec4(![]),![];}finally{_0x2fef6d(![]);}}return useInput(async(_0x160879,_0x162ea2)=>{const _0xa7933b=_0x52c7e7;if(_0x162ea2[_0xa7933b(0x1d8)]||_0x162ea2[_0xa7933b(0x1c5)]){if(_0x2f0eca===_0xa7933b(0x1e5)){_0x260da3(_0x548e83=>_0x548e83===0x0?0x1:0x0);return;}if(_0x2f0eca===_0xa7933b(0x1e1)){_0x36f093(_0x2ff3fb=>_0x2ff3fb===0x0?0x1:0x0);return;}}if(_0x162ea2[_0xa7933b(0x1e7)]){if(_0x2f0eca===_0xa7933b(0x1f1)){const _0x2450e9=_0x1480a7[_0xa7933b(0x1cc)]()||_0xe115eb;if(_0x999d15)return;_0x38221e(_0x2450e9),_0x49cbb6([{'step':_0xa7933b(0x1f1),'label':'项目名','value':_0x2450e9}]),_0xf42a33(''),_0x16ca46(''),_0x5117b4(_0xa7933b(0x1ff));return;}if(_0x2f0eca===_0xa7933b(0x1ff)){if(_0x999d15)return;const _0x3761da=_0x1480a7['trim']();_0x490120(_0x3761da),_0x49cbb6(_0x1a1267=>[..._0x1a1267,{'step':_0xa7933b(0x1ff),'label':_0xa7933b(0x1fa),'value':_0x3761da||_0xa7933b(0x1fd)}]),_0xf42a33(''),_0x16ca46('');if(_0x3761da){_0x5117b4(_0xa7933b(0x1df));const _0x6aa7e8=await _0x2e2723();_0x6aa7e8?_0x5117b4('confirm-api-pull'):_0x5117b4(_0xa7933b(0x1e1));}else{const _0xf5f5c=_0x31f566||_0x320f3b||_0xa7933b(0x1da);_0x798227({'projectName':_0x5b279d,'appCode':undefined,'pullApi':![],'env':_0xf5f5c}),_0x5117b4(_0xa7933b(0x1ef));}return;}if(_0x2f0eca===_0xa7933b(0x1e5)){const _0x1f8de4=_0x1776f7===0x0;_0x5aeae6(_0x1f8de4),_0x49cbb6(_0x5d52d8=>[..._0x5d52d8,{'step':'api-pull','label':_0xa7933b(0x201),'value':_0x1f8de4?'是':'否'}]);const _0x28ff9a=_0x31f566||_0x320f3b||_0xa7933b(0x1da);_0x798227({'projectName':_0x5b279d,'appCode':_0x41dd5d,'pullApi':_0x1f8de4,'env':_0x28ff9a}),_0x5117b4(_0xa7933b(0x1ef));return;}if(_0x2f0eca===_0xa7933b(0x1e1)){const _0x2f949e=_0x938d5c===0x0;if(_0x2f949e){_0x5117b4('login-process');const _0x5b5599=await _0x5179db();if(_0x5b5599)_0x49cbb6(_0x235b26=>[..._0x235b26,{'step':'login','label':_0xa7933b(0x1d7),'value':_0xa7933b(0x1e3)}]),_0x5117b4(_0xa7933b(0x1e5));else{_0x49cbb6(_0x7e102f=>[..._0x7e102f,{'step':_0xa7933b(0x1de),'label':'登录状态','value':_0xa7933b(0x1f0)}]);const _0x90b16b=_0x31f566||_0x320f3b||_0xa7933b(0x1da);_0x798227({'projectName':_0x5b279d,'appCode':_0x41dd5d,'pullApi':![],'env':_0x90b16b}),_0x5117b4('creating');}}else{_0x49cbb6(_0x22852a=>[..._0x22852a,{'step':_0xa7933b(0x1de),'label':'登录状态','value':'跳过登录'}]);const _0x333c07=_0x31f566||_0x320f3b||_0xa7933b(0x1da);_0x798227({'projectName':_0x5b279d,'appCode':_0x41dd5d,'pullApi':![],'env':_0x333c07}),_0x5117b4(_0xa7933b(0x1ef));}return;}}if(_0x162ea2[_0xa7933b(0x1f7)]||_0x162ea2['delete']){_0xf42a33(_0x35ae6a=>{const _0x26b328=_0xa7933b,_0x5e5a77=_0x35ae6a[_0x26b328(0x1fe)](0x0,-0x1);if(_0x2f0eca===_0x26b328(0x1f1)){const {valid:_0x467240,message:_0x302d8b}=_0x314cba(_0x5e5a77);_0x16ca46(_0x467240?'':_0x302d8b||_0x26b328(0x1dc));}else{if(_0x2f0eca===_0x26b328(0x1ff)){const {valid:_0x53390a,message:_0x974253}=_0x31172b(_0x5e5a77);_0x16ca46(_0x53390a?'':_0x974253||'应用AppCode不合法');}}return _0x5e5a77;});return;}if([_0xa7933b(0x1ef),_0xa7933b(0x1df),'login-process'][_0xa7933b(0x1e9)](_0x2f0eca))return;if(_0x2f0eca===_0xa7933b(0x1e5)||_0x2f0eca===_0xa7933b(0x1e1))return;_0xf42a33(_0x27a9f0=>{const _0x19fe21=_0xa7933b,_0x465335=_0x27a9f0+_0x160879;if(_0x2f0eca===_0x19fe21(0x1f1)){const {valid:_0x1cde2c,message:_0xa85ea2}=_0x314cba(_0x465335);_0x16ca46(_0x1cde2c?'':_0xa85ea2||_0x19fe21(0x1dc));}else{if(_0x2f0eca===_0x19fe21(0x1ff)){const {valid:_0x440370,message:_0x3de772}=_0x31172b(_0x465335);_0x16ca46(_0x440370?'':_0x3de772||'应用AppCode不合法');}}return _0x465335;});}),a39_0x2ec2f6(Box,{'flexDirection':_0x52c7e7(0x1ca),'marginTop':0x1,'children':[_0x1b032d[_0x52c7e7(0x200)]===0x0&&a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1d2),'children':_0x52c7e7(0x1d0)})}),_0x1b032d[_0x52c7e7(0x1e8)](_0x2eec24=>a39_0x2ec2f6(Box,{'children':[a39_0x2ec2f6(Text,{'color':_0x52c7e7(0x1dd),'children':['√\x20',_0x2eec24[_0x52c7e7(0x1ed)],':\x20']}),a39_0x2e7943(Text,{'color':_0x52c7e7(0x1d2),'children':_0x2eec24[_0x52c7e7(0x1c7)]})]},_0x2eec24['step'])),_0x2f0eca==='project-name'&&a39_0x2ec2f6(a39_0x166faa,{'children':[a39_0x2ec2f6(Box,{'children':[a39_0x2e7943(Text,{'children':_0x52c7e7(0x1d3)}),_0x1480a7?a39_0x2e7943(Text,{'color':'green','children':_0x1480a7}):a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':_0xe115eb}),_0x999d15&&a39_0x2ec2f6(Text,{'color':_0x52c7e7(0x1d6),'children':[_0x52c7e7(0x1e2),_0x999d15]})]}),!_0x999d15&&!_0x1480a7&&a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':'\x20直接回车确认,或输入自定义名称'})})]}),_0x2f0eca===_0x52c7e7(0x1ff)&&a39_0x2ec2f6(a39_0x166faa,{'children':[a39_0x2ec2f6(Box,{'children':[a39_0x2e7943(Text,{'children':_0x52c7e7(0x1f3)}),a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':_0x52c7e7(0x1f2)}),a39_0x2e7943(Text,{'color':_0x52c7e7(0x1dd),'children':_0x1480a7}),_0x999d15&&a39_0x2ec2f6(Text,{'color':_0x52c7e7(0x1d6),'children':[_0x52c7e7(0x1e2),_0x999d15]})]}),!_0x999d15&&a39_0x2e7943(Box,{'children':a39_0x2ec2f6(Text,{'color':_0x52c7e7(0x1f8),'children':['\x20',_0x52c7e7(0x1cb)]})})]}),_0x2f0eca===_0x52c7e7(0x1df)&&a39_0x2ec2f6(Box,{'children':[a39_0x2e7943(Text,{'children':_0x52c7e7(0x1cd)}),_0x408059&&a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':_0x52c7e7(0x1f5)})]}),_0x2f0eca==='confirm-api-pull'&&a39_0x2ec2f6(a39_0x166faa,{'children':[a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1dd),'children':'√\x20检测到有效登录状态'})}),a39_0x2e7943(Box,{'marginTop':0x1,'children':a39_0x2e7943(Text,{'children':'*\x20是否要自动拉取\x20API\x20配置?'})}),a39_0x2ec2f6(Box,{'marginLeft':0x2,'children':[a39_0x2ec2f6(Text,{'color':_0x1776f7===0x0?_0x52c7e7(0x1dd):_0x52c7e7(0x1f8),'children':[_0x1776f7===0x0?'▶\x20':'\x20\x20',_0x52c7e7(0x1f6)]}),a39_0x2e7943(Text,{'children':'\x20'}),a39_0x2ec2f6(Text,{'color':_0x1776f7===0x1?_0x52c7e7(0x1dd):_0x52c7e7(0x1f8),'children':[_0x1776f7===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':_0x52c7e7(0x1ec)})}),a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1ee),'children':_0x52c7e7(0x1d1)})})]}),_0x2f0eca===_0x52c7e7(0x1e1)&&a39_0x2ec2f6(a39_0x166faa,{'children':[a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1ee),'children':_0x52c7e7(0x1ce)})}),a39_0x2e7943(Box,{'marginTop':0x1,'children':a39_0x2e7943(Text,{'children':'*\x20是否要先登录以便拉取\x20API\x20配置?'})}),a39_0x2ec2f6(Box,{'marginLeft':0x2,'children':[a39_0x2ec2f6(Text,{'color':_0x938d5c===0x0?'green':'gray','children':[_0x938d5c===0x0?'▶\x20':'\x20\x20',_0x52c7e7(0x1f6)]}),a39_0x2e7943(Text,{'children':'\x20'}),a39_0x2ec2f6(Text,{'color':_0x938d5c===0x1?_0x52c7e7(0x1dd):_0x52c7e7(0x1f8),'children':[_0x938d5c===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':'yellow','children':_0x52c7e7(0x1cf)})})]}),_0x2f0eca==='login-process'&&a39_0x2ec2f6(Box,{'children':[a39_0x2e7943(Text,{'children':'*\x20正在登录,请前往浏览器完成登录...'}),_0x3ba90e&&a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':_0x52c7e7(0x202)})]})]});}
|
|
1
|
+
function a39_0x3c50(){const _0x912466=['*\x20项目名:\x20','619482IMOZew','!\x20未检测到有效登录','api-pull','login','return','yellow','[可选]:\x20','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','9ViKrvF','backspace','length','项目名长度不能超过\x2050\x20个字符','slice','map','login-check','项目名不合法','未设置','rightArrow','confirm-api-pull','*\x20是否要自动拉取\x20API\x20配置?','login-process','\x20登录中...','项目名','label','\x20\x20使用\x20←→\x20选择,回车确认','拉取API配置','green','登录状态','cyan','online','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','151451InOgRO','*\x20正在登录,请前往浏览器完成登录...','*\x20创建新项目','Yes','应用AppCode','login-prompt','gray','*\x20应用AppCode\x20','9708QlUoRQ','project-name','*\x20正在检查登录状态...','跳过登录','√\x20检测到有效登录状态','delete','604933EYMcxC','creating','\x20直接回车确认,或输入自定义名称','trim','应用AppCode不合法','leftArrow','my-app','7450920pVPlPb','env','column','585164tKGqQU','应用AppCode长度不能超过\x20100\x20个字符','36XjEbtn','test','775280uogfxs','app-code','\x20←\x20','*\x20是否要先登录以便拉取\x20API\x20配置?','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','已登录'];a39_0x3c50=function(){return _0x912466;};return a39_0x3c50();}function a39_0x4b29(_0x2f1900,_0x483dc7){_0x2f1900=_0x2f1900-0x196;const _0x3c5070=a39_0x3c50();let _0x4b2976=_0x3c5070[_0x2f1900];return _0x4b2976;}(function(_0x4ce934,_0x50d234){const _0x5a6c23=a39_0x4b29,_0x4160b5=_0x4ce934();while(!![]){try{const _0x2ebc28=-parseInt(_0x5a6c23(0x1d3))/0x1+-parseInt(_0x5a6c23(0x1ab))/0x2*(parseInt(_0x5a6c23(0x199))/0x3)+-parseInt(_0x5a6c23(0x1a9))/0x4+-parseInt(_0x5a6c23(0x1ad))/0x5+-parseInt(_0x5a6c23(0x1b4))/0x6+-parseInt(_0x5a6c23(0x19f))/0x7+-parseInt(_0x5a6c23(0x1a6))/0x8*(-parseInt(_0x5a6c23(0x1bc))/0x9);if(_0x2ebc28===_0x50d234)break;else _0x4160b5['push'](_0x4160b5['shift']());}catch(_0x1ec5e9){_0x4160b5['push'](_0x4160b5['shift']());}}}(a39_0x3c50,0x384fd));import{jsx as a39_0x5c448b,jsxs as a39_0x21ab56,Fragment as a39_0x2d01c9}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x351162){const _0x3a91b1=a39_0x4b29,{onCreate:_0x21b672,env:_0x185a93}=_0x351162,[_0x487bc9,_0x4257c4]=useState(_0x3a91b1(0x19a)),[_0x2907e5,_0x2020c4]=useState(''),[_0x1d8a6c,_0x8d2ddc]=useState(''),[_0x247c82,_0x319ad1]=useState(''),[_0x20ce46,_0x1f4e2e]=useState(''),[_0x3e5576,_0x5cf8d2]=useState([]),[_0x48b8b4,_0x1bb1a0]=useState(null),[_0x5d29f9,_0x4e0ab1]=useState(![]),[_0x1b7e9c,_0x2838c7]=useState(![]),[_0x150e18,_0x5c9594]=useState(![]),[_0x1a37f5,_0x5efb22]=useState(0x0),[_0x12f4d4,_0x4f396b]=useState(0x0),_0x2ca476=_0x3a91b1(0x1a5),_0x4dfda8=readConfig(),_0x5a16c1=typeof _0x4dfda8[_0x3a91b1(0x1a7)]==='string'?_0x4dfda8[_0x3a91b1(0x1a7)]:undefined;function _0x9559b1(_0xb54937){const _0x253ff5=_0x3a91b1;if(_0xb54937[_0x253ff5(0x1be)]>0x32)return{'valid':![],'message':_0x253ff5(0x1bf)};const _0x5797ac=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0xb54937?.[_0x253ff5(0x1a2)]()&&!_0x5797ac[_0x253ff5(0x1ac)](_0xb54937))return{'valid':![],'message':'项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};return{'valid':!![]};}function _0x204443(_0x3b1c26){const _0x29f942=_0x3a91b1;if(!_0x3b1c26[_0x29f942(0x1a2)]())return{'valid':!![]};if(_0x3b1c26['length']>0x64)return{'valid':![],'message':_0x29f942(0x1aa)};const _0x2b0227=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x2b0227['test'](_0x3b1c26))return{'valid':![],'message':'应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头'};return{'valid':!![]};}async function _0x2c3c06(){_0x4e0ab1(!![]);try{const _0x350080=await getIsSessionValid();return _0x1bb1a0(_0x350080),_0x350080;}catch(_0x15151a){return _0x1bb1a0(![]),![];}finally{_0x4e0ab1(![]);}}async function _0x5b3e13(){_0x2838c7(!![]);try{const _0x243b72=await authServer({'silent':!![]});return _0x1bb1a0(_0x243b72),_0x243b72;}catch(_0x12478f){return _0x1bb1a0(![]),![];}finally{_0x2838c7(![]);}}return useInput(async(_0x52a8b8,_0x2f3e3e)=>{const _0x330509=_0x3a91b1;if(_0x2f3e3e[_0x330509(0x1a4)]||_0x2f3e3e[_0x330509(0x1c5)]){if(_0x487bc9===_0x330509(0x1c6)){_0x5efb22(_0x104796=>_0x104796===0x0?0x1:0x0);return;}if(_0x487bc9===_0x330509(0x196)){_0x4f396b(_0x46fd4b=>_0x46fd4b===0x0?0x1:0x0);return;}}if(_0x2f3e3e[_0x330509(0x1b8)]){if(_0x487bc9==='project-name'){const _0x2586e3=_0x247c82['trim']()||_0x2ca476;if(_0x20ce46)return;_0x2020c4(_0x2586e3),_0x5cf8d2([{'step':_0x330509(0x19a),'label':_0x330509(0x1ca),'value':_0x2586e3}]),_0x319ad1(''),_0x1f4e2e(''),_0x4257c4('app-code');return;}if(_0x487bc9===_0x330509(0x1ae)){if(_0x20ce46)return;const _0x4a60a0=_0x247c82[_0x330509(0x1a2)]();_0x8d2ddc(_0x4a60a0),_0x5cf8d2(_0x5d3c5e=>[..._0x5d3c5e,{'step':_0x330509(0x1ae),'label':_0x330509(0x1d7),'value':_0x4a60a0||_0x330509(0x1c4)}]),_0x319ad1(''),_0x1f4e2e('');if(_0x4a60a0){_0x4257c4('login-check');const _0x4a76cb=await _0x2c3c06();_0x4a76cb?_0x4257c4(_0x330509(0x1c6)):_0x4257c4(_0x330509(0x196));}else{const _0x19b497=_0x185a93||_0x5a16c1||'online';_0x21b672({'projectName':_0x2907e5,'appCode':undefined,'pullApi':![],'env':_0x19b497}),_0x4257c4(_0x330509(0x1a0));}return;}if(_0x487bc9===_0x330509(0x1c6)){const _0x23319b=_0x1a37f5===0x0;_0x5c9594(_0x23319b),_0x5cf8d2(_0x1da41d=>[..._0x1da41d,{'step':_0x330509(0x1b6),'label':_0x330509(0x1cd),'value':_0x23319b?'是':'否'}]);const _0x5a5253=_0x185a93||_0x5a16c1||_0x330509(0x1d1);_0x21b672({'projectName':_0x2907e5,'appCode':_0x1d8a6c,'pullApi':_0x23319b,'env':_0x5a5253}),_0x4257c4(_0x330509(0x1a0));return;}if(_0x487bc9==='login-prompt'){const _0x525e1d=_0x12f4d4===0x0;if(_0x525e1d){_0x4257c4(_0x330509(0x1c8));const _0x4f26f1=await _0x5b3e13();if(_0x4f26f1)_0x5cf8d2(_0x48d7aa=>[..._0x48d7aa,{'step':_0x330509(0x1b7),'label':_0x330509(0x1cf),'value':_0x330509(0x1b2)}]),_0x4257c4(_0x330509(0x1c6));else{_0x5cf8d2(_0x4b3911=>[..._0x4b3911,{'step':_0x330509(0x1b7),'label':_0x330509(0x1cf),'value':'登录失败'}]);const _0x3b75c9=_0x185a93||_0x5a16c1||_0x330509(0x1d1);_0x21b672({'projectName':_0x2907e5,'appCode':_0x1d8a6c,'pullApi':![],'env':_0x3b75c9}),_0x4257c4(_0x330509(0x1a0));}}else{_0x5cf8d2(_0x3ebe2c=>[..._0x3ebe2c,{'step':_0x330509(0x1b7),'label':'登录状态','value':_0x330509(0x19c)}]);const _0x461dfe=_0x185a93||_0x5a16c1||_0x330509(0x1d1);_0x21b672({'projectName':_0x2907e5,'appCode':_0x1d8a6c,'pullApi':![],'env':_0x461dfe}),_0x4257c4(_0x330509(0x1a0));}return;}}if(_0x2f3e3e[_0x330509(0x1bd)]||_0x2f3e3e[_0x330509(0x19e)]){_0x319ad1(_0x16a9a4=>{const _0x11869f=_0x330509,_0x11ff95=_0x16a9a4[_0x11869f(0x1c0)](0x0,-0x1);if(_0x487bc9===_0x11869f(0x19a)){const {valid:_0x5c45f3,message:_0x46b628}=_0x9559b1(_0x11ff95);_0x1f4e2e(_0x5c45f3?'':_0x46b628||_0x11869f(0x1c3));}else{if(_0x487bc9===_0x11869f(0x1ae)){const {valid:_0x3f74ab,message:_0xe2b8e}=_0x204443(_0x11ff95);_0x1f4e2e(_0x3f74ab?'':_0xe2b8e||_0x11869f(0x1a3));}}return _0x11ff95;});return;}if([_0x330509(0x1a0),_0x330509(0x1c2),_0x330509(0x1c8)]['includes'](_0x487bc9))return;if(_0x487bc9==='confirm-api-pull'||_0x487bc9===_0x330509(0x196))return;_0x319ad1(_0x1b8105=>{const _0x596239=_0x330509,_0x878078=_0x1b8105+_0x52a8b8;if(_0x487bc9===_0x596239(0x19a)){const {valid:_0x5d3ab1,message:_0x52c7fd}=_0x9559b1(_0x878078);_0x1f4e2e(_0x5d3ab1?'':_0x52c7fd||_0x596239(0x1c3));}else{if(_0x487bc9===_0x596239(0x1ae)){const {valid:_0x4aa96d,message:_0x504869}=_0x204443(_0x878078);_0x1f4e2e(_0x4aa96d?'':_0x504869||_0x596239(0x1a3));}}return _0x878078;});}),a39_0x21ab56(Box,{'flexDirection':_0x3a91b1(0x1a8),'marginTop':0x1,'children':[_0x3e5576['length']===0x0&&a39_0x5c448b(Box,{'children':a39_0x5c448b(Text,{'color':_0x3a91b1(0x1d0),'children':_0x3a91b1(0x1d5)})}),_0x3e5576[_0x3a91b1(0x1c1)](_0xfbe590=>a39_0x21ab56(Box,{'children':[a39_0x21ab56(Text,{'color':_0x3a91b1(0x1ce),'children':['√\x20',_0xfbe590[_0x3a91b1(0x1cb)],':\x20']}),a39_0x5c448b(Text,{'color':_0x3a91b1(0x1d0),'children':_0xfbe590['value']})]},_0xfbe590['step'])),_0x487bc9===_0x3a91b1(0x19a)&&a39_0x21ab56(a39_0x2d01c9,{'children':[a39_0x21ab56(Box,{'children':[a39_0x5c448b(Text,{'children':_0x3a91b1(0x1b3)}),_0x247c82?a39_0x5c448b(Text,{'color':_0x3a91b1(0x1ce),'children':_0x247c82}):a39_0x5c448b(Text,{'color':_0x3a91b1(0x197),'children':_0x2ca476}),_0x20ce46&&a39_0x21ab56(Text,{'color':'red','children':[_0x3a91b1(0x1af),_0x20ce46]})]}),!_0x20ce46&&!_0x247c82&&a39_0x5c448b(Box,{'children':a39_0x5c448b(Text,{'color':_0x3a91b1(0x197),'children':_0x3a91b1(0x1a1)})})]}),_0x487bc9==='app-code'&&a39_0x21ab56(a39_0x2d01c9,{'children':[a39_0x21ab56(Box,{'children':[a39_0x5c448b(Text,{'children':_0x3a91b1(0x198)}),a39_0x5c448b(Text,{'color':_0x3a91b1(0x197),'children':_0x3a91b1(0x1ba)}),a39_0x5c448b(Text,{'color':_0x3a91b1(0x1ce),'children':_0x247c82}),_0x20ce46&&a39_0x21ab56(Text,{'color':'red','children':[_0x3a91b1(0x1af),_0x20ce46]})]}),!_0x20ce46&&a39_0x5c448b(Box,{'children':a39_0x21ab56(Text,{'color':'gray','children':['\x20',_0x3a91b1(0x1b1)]})})]}),_0x487bc9===_0x3a91b1(0x1c2)&&a39_0x21ab56(Box,{'children':[a39_0x5c448b(Text,{'children':_0x3a91b1(0x19b)}),_0x5d29f9&&a39_0x5c448b(Text,{'color':_0x3a91b1(0x197),'children':'\x20检查中...'})]}),_0x487bc9===_0x3a91b1(0x1c6)&&a39_0x21ab56(a39_0x2d01c9,{'children':[a39_0x5c448b(Box,{'children':a39_0x5c448b(Text,{'color':_0x3a91b1(0x1ce),'children':_0x3a91b1(0x19d)})}),a39_0x5c448b(Box,{'marginTop':0x1,'children':a39_0x5c448b(Text,{'children':_0x3a91b1(0x1c7)})}),a39_0x21ab56(Box,{'marginLeft':0x2,'children':[a39_0x21ab56(Text,{'color':_0x1a37f5===0x0?'green':_0x3a91b1(0x197),'children':[_0x1a37f5===0x0?'▶\x20':'\x20\x20',_0x3a91b1(0x1d6)]}),a39_0x5c448b(Text,{'children':'\x20'}),a39_0x21ab56(Text,{'color':_0x1a37f5===0x1?_0x3a91b1(0x1ce):_0x3a91b1(0x197),'children':[_0x1a37f5===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x5c448b(Box,{'children':a39_0x5c448b(Text,{'color':'gray','children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a39_0x5c448b(Box,{'children':a39_0x5c448b(Text,{'color':_0x3a91b1(0x1b9),'children':_0x3a91b1(0x1d2)})})]}),_0x487bc9===_0x3a91b1(0x196)&&a39_0x21ab56(a39_0x2d01c9,{'children':[a39_0x5c448b(Box,{'children':a39_0x5c448b(Text,{'color':_0x3a91b1(0x1b9),'children':_0x3a91b1(0x1b5)})}),a39_0x5c448b(Box,{'marginTop':0x1,'children':a39_0x5c448b(Text,{'children':_0x3a91b1(0x1b0)})}),a39_0x21ab56(Box,{'marginLeft':0x2,'children':[a39_0x21ab56(Text,{'color':_0x12f4d4===0x0?_0x3a91b1(0x1ce):'gray','children':[_0x12f4d4===0x0?'▶\x20':'\x20\x20','Yes']}),a39_0x5c448b(Text,{'children':'\x20'}),a39_0x21ab56(Text,{'color':_0x12f4d4===0x1?_0x3a91b1(0x1ce):_0x3a91b1(0x197),'children':[_0x12f4d4===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x5c448b(Box,{'children':a39_0x5c448b(Text,{'color':_0x3a91b1(0x197),'children':_0x3a91b1(0x1cc)})}),a39_0x5c448b(Box,{'children':a39_0x5c448b(Text,{'color':'yellow','children':_0x3a91b1(0x1bb)})})]}),_0x487bc9===_0x3a91b1(0x1c8)&&a39_0x21ab56(Box,{'children':[a39_0x5c448b(Text,{'children':_0x3a91b1(0x1d4)}),_0x1b7e9c&&a39_0x5c448b(Text,{'color':_0x3a91b1(0x197),'children':_0x3a91b1(0x1c9)})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2e38e2,_0x3efd92){const _0x233996=a40_0x3e0e,_0x504258=_0x2e38e2();while(!![]){try{const _0x370ec0=-parseInt(_0x233996(0x17c))/0x1+parseInt(_0x233996(0x180))/0x2+parseInt(_0x233996(0x17f))/0x3+-parseInt(_0x233996(0x178))/0x4+parseInt(_0x233996(0x17e))/0x5*(parseInt(_0x233996(0x17b))/0x6)+-parseInt(_0x233996(0x182))/0x7*(-parseInt(_0x233996(0x179))/0x8)+parseInt(_0x233996(0x17a))/0x9*(-parseInt(_0x233996(0x183))/0xa);if(_0x370ec0===_0x3efd92)break;else _0x504258['push'](_0x504258['shift']());}catch(_0x54ba5a){_0x504258['push'](_0x504258['shift']());}}}(a40_0x4b9a,0xdb53c));function a40_0x3e0e(_0x3f6617,_0x553ed6){_0x3f6617=_0x3f6617-0x178;const _0x4b9aac=a40_0x4b9a();let _0x3e0e8a=_0x4b9aac[_0x3f6617];return _0x3e0e8a;}function a40_0x4b9a(){const _0x2a9f26=['20uHzAPx','1066788gApnyF','379438fUQxvO','replace','21kXBdXc','19540YYPoQV','toFixed','2749336kVFAxF','4238632RhgGDn','6750NENHBV','2356590GLlwMA','654664acQtVb','now'];a40_0x4b9a=function(){return _0x2a9f26;};return a40_0x4b9a();}export function formatElapsed(_0x4f7823){const _0x14a16b=a40_0x3e0e,_0x486ff7=Date[_0x14a16b(0x17d)]()-_0x4f7823;if(_0x486ff7<0x3e8)return _0x486ff7+'ms';const _0x475052=(_0x486ff7/0x3e8)[_0x14a16b(0x184)](0x2),_0x39197=_0x475052[_0x14a16b(0x181)](/\.?0+$/u,'');return _0x39197+'s';}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5ab037,_0x3316c7){const _0x4477f9=a41_0x5857,_0x2fc739=_0x5ab037();while(!![]){try{const _0x212908=parseInt(_0x4477f9(0x180))/0x1*(-parseInt(_0x4477f9(0x1bc))/0x2)+parseInt(_0x4477f9(0x198))/0x3*(-parseInt(_0x4477f9(0x196))/0x4)+-parseInt(_0x4477f9(0x181))/0x5*(-parseInt(_0x4477f9(0x1ba))/0x6)+-parseInt(_0x4477f9(0x174))/0x7*(-parseInt(_0x4477f9(0x1c5))/0x8)+parseInt(_0x4477f9(0x1b6))/0x9*(parseInt(_0x4477f9(0x16d))/0xa)+-parseInt(_0x4477f9(0x1b8))/0xb+parseInt(_0x4477f9(0x16f))/0xc*(-parseInt(_0x4477f9(0x195))/0xd);if(_0x212908===_0x3316c7)break;else _0x2fc739['push'](_0x2fc739['shift']());}catch(_0x3b0f34){_0x2fc739['push'](_0x2fc739['shift']());}}}(a41_0x5a47,0x61df0));import{jsx as a41_0x5e2cd4,Fragment as a41_0x4d7a9c,jsxs as a41_0x4a67d7}from'react/jsx-runtime';import a41_0x5d9fea from'node:path';import a41_0x31105d from'node:fs';import{fileURLToPath}from'node:url';function a41_0x5857(_0x54a561,_0x2d624c){_0x54a561=_0x54a561-0x164;const _0x5a47c0=a41_0x5a47();let _0x585774=_0x5a47c0[_0x54a561];return _0x585774;}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(_0x3f2892){const _0x3aa6d8=a41_0x5857,[_0x328de8,_0x5c599b]=useState(![]),[_0x31cdeb,_0x4d2f81]=useState(![]),[_0xba93ff,_0x5025e3]=useState(null),_0x5d60a2=useCopyProjectTemplate(),_0x459e2b=useInstallDependencies(),_0xdc1691=useFormatCode(),_0x16dfd2=async _0x2984fe=>{const _0x1e5212=a41_0x5857;if(!_0x2984fe[_0x1e5212(0x17a)]||_0x2984fe['projectName'][_0x1e5212(0x1bb)]()===''){console['error'](_0x1e5212(0x18f));return;}const _0x1c88d1=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1c88d1[_0x1e5212(0x17b)](_0x2984fe[_0x1e5212(0x17a)])){console['error'](_0x1e5212(0x197));return;}if(_0x2984fe[_0x1e5212(0x17a)][_0x1e5212(0x1c8)]>0x64){console[_0x1e5212(0x1a5)]('×\x20项目名过长,最多支持\x20100\x20个字符');return;}const _0x26b402=a41_0x5d9fea[_0x1e5212(0x19a)](process['cwd'](),_0x2984fe['projectName']);if(a41_0x31105d[_0x1e5212(0x1b5)](_0x26b402)){console[_0x1e5212(0x1a5)](_0x1e5212(0x1a9)+_0x2984fe[_0x1e5212(0x17a)]+_0x1e5212(0x192));return;}try{const _0x27c648=a41_0x5d9fea[_0x1e5212(0x179)](_0x26b402);a41_0x31105d[_0x1e5212(0x185)](_0x27c648,a41_0x31105d[_0x1e5212(0x164)][_0x1e5212(0x1be)]);}catch(_0x5916df){console['error'](_0x1e5212(0x17c));return;}_0x5025e3(_0x2984fe),_0x5c599b(!![]),logger[_0x1e5212(0x190)](_0x26b402),logger[_0x1e5212(0x1ae)](_0x1e5212(0x189),'开始创建项目:\x20'+_0x2984fe[_0x1e5212(0x17a)],{'projectDir':_0x26b402,'appCode':_0x2984fe['appCode']});try{await _0x5d60a2[_0x1e5212(0x1b3)](_0x2984fe[_0x1e5212(0x17a)]),await _0x37981b(_0x2984fe[_0x1e5212(0x17a)]),await _0x459e2b[_0x1e5212(0x1b3)](_0x2984fe['projectName']),await _0xdc1691[_0x1e5212(0x1b3)](_0x2984fe[_0x1e5212(0x17a)]),await _0x2a43b7(_0x2984fe[_0x1e5212(0x17a)],_0x2984fe['appCode']||'',_0x2984fe['env']);if(_0x2984fe['pullApi']&&_0x2984fe[_0x1e5212(0x1a0)]){console['log'](_0x1e5212(0x17e));try{const _0x23ab2f=await pullApiSilent(_0x2984fe['appCode'],undefined,_0x26b402,_0x2984fe[_0x1e5212(0x1a1)]);_0x23ab2f?(console['log'](_0x1e5212(0x1a7)),logger['info'](_0x1e5212(0x189),_0x1e5212(0x17d)+_0x2984fe[_0x1e5212(0x1a0)],{'projectDir':_0x26b402,'appCode':_0x2984fe[_0x1e5212(0x1a0)],'env':_0x2984fe[_0x1e5212(0x1a1)]})):(console['log'](_0x1e5212(0x1a8)),logger[_0x1e5212(0x166)](_0x1e5212(0x189),_0x1e5212(0x1b2)+_0x2984fe[_0x1e5212(0x1a0)],{'projectDir':_0x26b402,'appCode':_0x2984fe['appCode'],'env':_0x2984fe[_0x1e5212(0x1a1)]}));}catch(_0x54c412){console[_0x1e5212(0x19d)]('!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x1e5212(0x166)]('create','API\x20配置拉取异常:\x20'+_0x2984fe[_0x1e5212(0x1a0)],{'projectDir':_0x26b402,'appCode':_0x2984fe[_0x1e5212(0x1a0)],'env':_0x2984fe[_0x1e5212(0x1a1)],'error':_0x54c412 instanceof Error?_0x54c412['message']:String(_0x54c412)});}}logger[_0x1e5212(0x18a)](_0x1e5212(0x189),'项目创建完成:\x20'+_0x2984fe[_0x1e5212(0x17a)]),_0x4d2f81(!![]),_0x5c599b(![]);}catch(_0x18ffd4){logger['error'](_0x1e5212(0x189),_0x1e5212(0x19c)+_0x2984fe['projectName'],{'error':_0x18ffd4 instanceof Error?_0x18ffd4[_0x1e5212(0x1b1)]:String(_0x18ffd4)});try{a41_0x31105d[_0x1e5212(0x1b5)](_0x26b402)&&(console['log'](_0x1e5212(0x18b)+_0x26b402),a41_0x31105d[_0x1e5212(0x18c)](_0x26b402,{'recursive':!![],'force':!![]}));}catch(_0x232da2){logger['warn']('create','清理项目目录失败:\x20'+_0x26b402,{'error':_0x232da2 instanceof Error?_0x232da2[_0x1e5212(0x1b1)]:String(_0x232da2)});}_0x5c599b(![]),console['error'](_0x1e5212(0x172)+(_0x18ffd4 instanceof Error?_0x18ffd4[_0x1e5212(0x1b1)]:String(_0x18ffd4)));}},_0xd73077=async _0x1a801f=>{const _0x3f41fc=a41_0x5857;await _0x16dfd2({'projectName':_0x1a801f,'env':_0x3f2892[_0x3f41fc(0x1a1)]});},_0x37981b=async _0x462ea6=>{const _0x502ff8=a41_0x5857,_0x34ea7a=a41_0x5d9fea[_0x502ff8(0x19a)](process[_0x502ff8(0x171)](),_0x462ea6),_0x32af4b=a41_0x5d9fea['join'](_0x34ea7a,'package.json');try{console['log'](_0x502ff8(0x170));const _0x4f82cf=fileURLToPath(import.meta.url),_0x153aea=a41_0x5d9fea['resolve'](a41_0x5d9fea[_0x502ff8(0x179)](_0x4f82cf),'../..'),_0x4542d3=a41_0x5d9fea['join'](_0x153aea,_0x502ff8(0x1ac));let _0x4ae39d=_0x502ff8(0x167);try{const _0x247f2b=JSON[_0x502ff8(0x1c4)](a41_0x31105d[_0x502ff8(0x1c2)](_0x4542d3,'utf8'));_0x4ae39d=_0x247f2b['version']||'1.0.0';}catch(_0x33f1b7){}const _0x50e59e=a41_0x31105d[_0x502ff8(0x1c2)](_0x32af4b,_0x502ff8(0x1c3)),_0x44d1ab=JSON[_0x502ff8(0x1c4)](_0x50e59e);_0x44d1ab[_0x502ff8(0x1aa)]=_0x462ea6,_0x44d1ab[_0x502ff8(0x169)]=_0x462ea6+_0x502ff8(0x18d)+_0x4ae39d,a41_0x31105d[_0x502ff8(0x1af)](_0x32af4b,JSON['stringify'](_0x44d1ab,null,0x2)+'\x0a',_0x502ff8(0x1c3)),console['log'](_0x502ff8(0x187)+_0x462ea6+_0x502ff8(0x1b7)+_0x44d1ab[_0x502ff8(0x169)]),logger[_0x502ff8(0x1ae)](_0x502ff8(0x189),_0x502ff8(0x1ad),{'projectName':_0x462ea6,'description':_0x44d1ab[_0x502ff8(0x169)],'cliVersion':_0x4ae39d,'packageJsonPath':_0x502ff8(0x1ac)});}catch(_0xd59806){logger[_0x502ff8(0x1a5)](_0x502ff8(0x189),'更新\x20package.json\x20失败:\x20'+_0x462ea6,{'projectName':_0x462ea6,'error':_0xd59806 instanceof Error?_0xd59806['message']:String(_0xd59806)});throw _0xd59806;}},_0x2a43b7=async(_0x2bb23e,_0x48c880,_0x52cd47)=>{const _0x13f4c1=a41_0x5857,_0x3dce57=a41_0x5d9fea[_0x13f4c1(0x19a)](process[_0x13f4c1(0x171)](),_0x2bb23e),_0x2e501b=a41_0x5d9fea[_0x13f4c1(0x19f)](_0x3dce57,'.lovrabetrc');try{_0x48c880?console[_0x13f4c1(0x19d)]('*\x20正在为项目\x20'+_0x2bb23e+_0x13f4c1(0x1a3)+_0x48c880):console[_0x13f4c1(0x19d)](_0x13f4c1(0x1a4)+_0x2bb23e+_0x13f4c1(0x186));console['log'](_0x13f4c1(0x184)+_0x2e501b);const _0x4a3510=fileURLToPath(import.meta.url),_0x2b1be2=a41_0x5d9fea[_0x13f4c1(0x19a)](a41_0x5d9fea['dirname'](_0x4a3510),_0x13f4c1(0x1ab)),_0x297f12=a41_0x5d9fea[_0x13f4c1(0x19f)](_0x2b1be2,'package.json');let _0x4c373f=_0x13f4c1(0x167);try{const _0x516c44=JSON[_0x13f4c1(0x1c4)](a41_0x31105d[_0x13f4c1(0x1c2)](_0x297f12,_0x13f4c1(0x1c3)));_0x4c373f=_0x516c44['version']||'1.0.0';}catch(_0x38ca3f){}const _0x50549d=readConfig(),_0x5981d9=typeof _0x50549d[_0x13f4c1(0x1a1)]==='string'?_0x50549d[_0x13f4c1(0x1a1)]:undefined,{app:_0x2330df,appcode:_0x497db3,..._0x313336}=_0x50549d,_0x3ff843={..._0x313336,'appcode':_0x48c880||'','env':_0x52cd47||_0x5981d9||'online','createdAt':new Date()['toLocaleString'](),'version':_0x4c373f};a41_0x31105d[_0x13f4c1(0x1af)](_0x2e501b,JSON[_0x13f4c1(0x1b9)](_0x3ff843,null,0x2),_0x13f4c1(0x1c3)),_0x48c880?console[_0x13f4c1(0x19d)](_0x13f4c1(0x1c1)+_0x48c880):console[_0x13f4c1(0x19d)]('√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置'),logger[_0x13f4c1(0x1ae)](_0x13f4c1(0x189),_0x13f4c1(0x173)+_0x48c880,{'projectName':_0x2bb23e,'configFile':_0x13f4c1(0x191)});}catch(_0x64c02d){logger['error']('create','配置应用AppCode失败:\x20'+_0x48c880,{'projectName':_0x2bb23e,'error':_0x64c02d instanceof Error?_0x64c02d[_0x13f4c1(0x1b1)]:String(_0x64c02d)});}};useEffect(()=>{const _0x33db0f=a41_0x5857;_0x3f2892[_0x33db0f(0x1b0)]&&_0xd73077(_0x3f2892['projectCode']);},[_0x3f2892[_0x3aa6d8(0x1b0)]]);if(!_0x328de8&&!_0x31cdeb&&!_0x3f2892[_0x3aa6d8(0x1b0)])return a41_0x5e2cd4(EnhancedGuidedCreate,{'onCreate':_0x16dfd2,'env':_0x3f2892[_0x3aa6d8(0x1a1)]});if(_0x328de8)return a41_0x4a67d7(a41_0x4d7a9c,{'children':[a41_0x4a67d7(Box,{'marginTop':0x1,'children':[a41_0x5e2cd4(Box,{'width':'1'}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'children':_0x3aa6d8(0x175)}),a41_0x5e2cd4(Text,{'children':_0x3aa6d8(0x1b4)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'children':_0xba93ff?.['projectName']}),_0xba93ff?.[_0x3aa6d8(0x1a0)]&&a41_0x4a67d7(a41_0x4d7a9c,{'children':[a41_0x5e2cd4(Text,{'children':_0x3aa6d8(0x18e)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'children':_0xba93ff[_0x3aa6d8(0x1a0)]})]})]}),a41_0x5e2cd4(TaskRunning,{..._0x5d60a2}),a41_0x5e2cd4(TaskRunning,{..._0x459e2b}),a41_0x5e2cd4(TaskRunning,{..._0xdc1691})]});if(_0x31cdeb)return a41_0x4a67d7(a41_0x4d7a9c,{'children':[a41_0x4a67d7(Box,{'marginTop':0x1,'children':[a41_0x5e2cd4(Box,{'width':'1'}),a41_0x5e2cd4(Text,{'color':'green','children':_0x3aa6d8(0x175)}),a41_0x5e2cd4(Text,{'children':'项目名称:\x20'}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'children':_0xba93ff?.['projectName']}),_0xba93ff?.[_0x3aa6d8(0x1a0)]&&a41_0x4a67d7(a41_0x4d7a9c,{'children':[a41_0x5e2cd4(Text,{'children':'\x20|\x20应用AppCode:\x20'}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'children':_0xba93ff['appCode']})]})]}),a41_0x5e2cd4(TaskFinished,{..._0x5d60a2}),a41_0x5e2cd4(TaskFinished,{..._0x459e2b}),a41_0x5e2cd4(TaskFinished,{..._0xdc1691}),a41_0x5e2cd4(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0x5e2cd4(Text,{'color':'green','children':'─'[_0x3aa6d8(0x1bf)](0x3c)})}),a41_0x5e2cd4(Box,{'children':a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'bold':!![],'children':_0x3aa6d8(0x16b)})}),a41_0x4a67d7(Box,{'marginTop':0x1,'flexDirection':'column','children':[a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'children':_0x3aa6d8(0x16c)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x168),'bold':!![],'children':_0xba93ff?.[_0x3aa6d8(0x17a)]})]}),_0xba93ff?.[_0x3aa6d8(0x1a0)]&&a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'children':_0x3aa6d8(0x19e)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x168),'bold':!![],'children':_0xba93ff[_0x3aa6d8(0x1a0)]})]}),a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'children':_0x3aa6d8(0x199)}),_0xba93ff?.[_0x3aa6d8(0x1a2)]?a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'bold':!![],'children':_0x3aa6d8(0x16a)}):_0xba93ff?.['appCode']?a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x182),'bold':!![],'children':_0x3aa6d8(0x1c0)}):a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x176),'bold':!![],'children':'未配置'})]})]}),a41_0x5e2cd4(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'bold':!![],'children':_0x3aa6d8(0x188)})}),a41_0x4a67d7(Box,{'marginLeft':0x2,'flexDirection':_0x3aa6d8(0x178),'children':[a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'children':_0x3aa6d8(0x17f)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x168),'children':_0x3aa6d8(0x194)}),a41_0x5e2cd4(Text,{'color':'cyan','bold':!![],'children':_0x3aa6d8(0x1c7)+_0xba93ff?.['projectName']+'\x20&&\x20lovrabet\x20start'})]}),_0xba93ff?.[_0x3aa6d8(0x1a0)]&&!_0xba93ff?.[_0x3aa6d8(0x1a2)]&&a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x182),'children':_0x3aa6d8(0x16e)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x168),'children':_0x3aa6d8(0x193)}),a41_0x5e2cd4(Text,{'color':'cyan','bold':!![],'children':_0x3aa6d8(0x1a6)})]}),!_0xba93ff?.[_0x3aa6d8(0x1a0)]&&a41_0x4a67d7(a41_0x4d7a9c,{'children':[a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x176),'children':_0x3aa6d8(0x16e)}),a41_0x5e2cd4(Text,{'color':'white','children':_0x3aa6d8(0x1bd)}),a41_0x5e2cd4(Text,{'color':'cyan','bold':!![],'children':_0x3aa6d8(0x183)})]}),a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x176),'children':_0x3aa6d8(0x19b)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x168),'children':_0x3aa6d8(0x193)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'bold':!![],'children':_0x3aa6d8(0x177)})]})]})]}),a41_0x5e2cd4(Box,{'marginTop':0x1,'children':a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'children':'─'[_0x3aa6d8(0x1bf)](0x3c)})})]});return null;}function a41_0x5a47(){const _0x40a80f=['项目名称:\x20','existsSync','27441YKYZoW',',\x20description=','5270672KocUCX','stringify','73836EdrGgj','trim','292106IDaaWC','配置AppCode:\x20','W_OK','repeat','需手动拉取','√\x20配置文件已创建,应用AppCode:\x20','readFileSync','utf8','parse','4514592wVFqOI','cyan','cd\x20','length','constants','green','warn','1.0.0','white','description','已自动拉取\x20✓','🎉\x20项目创建成功!','📁\x20项目名称:\x20','670GdFfki','2.\x20','1596tGnZHf','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','cwd','×\x20项目创建失败:\x20','配置应用AppCode:\x20','7wAOowb','\x20√\x20','gray','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','column','dirname','projectName','test','×\x20无法在当前目录创建项目,请检查目录权限','API\x20配置拉取成功:\x20','*\x20正在拉取\x20API\x20配置...','1.\x20','1yAwDBE','285NCyznL','yellow','lovrabet\x20config\x20set\x20appcode\x20[app-code]','*\x20配置文件路径:\x20','accessSync','\x20创建配置文件','√\x20package.json\x20已更新:\x20name=','🚀\x20接下来可以:','create','success','*\x20清理失败的项目目录:\x20','rmSync','\x20Generated\x20by\x20lovrabet\x20cli\x20','\x20|\x20应用AppCode:\x20','×\x20项目名不能为空','setLogPath','.lovrabetrc','\x20已存在,请使用其他项目名','拉取API配置:\x20','启动项目:\x20','36634fTgGIr','20qsFGMR','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','41502Szgcpk','📦\x20API配置:\x20','resolve','3.\x20','项目创建失败:\x20','log','🔗\x20应用AppCode:\x20','join','appCode','env','pullApi','\x20配置应用AppCode:\x20','*\x20正在为项目\x20','error','lovrabet\x20api\x20pull','√\x20API\x20配置拉取完成','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','×\x20项目目录\x20','name','../..','package.json','更新\x20package.json\x20name\x20和\x20description\x20字段','info','writeFileSync','projectCode','message','API\x20配置拉取失败:\x20','doTask'];a41_0x5a47=function(){return _0x40a80f;};return a41_0x5a47();}
|
|
1
|
+
(function(_0x87510d,_0x1ac1c6){const _0x42eafe=a41_0x2eb0,_0x1ea0fa=_0x87510d();while(!![]){try{const _0xf4b473=-parseInt(_0x42eafe(0x142))/0x1*(-parseInt(_0x42eafe(0x12d))/0x2)+parseInt(_0x42eafe(0x138))/0x3*(-parseInt(_0x42eafe(0x132))/0x4)+parseInt(_0x42eafe(0x14d))/0x5*(-parseInt(_0x42eafe(0x124))/0x6)+-parseInt(_0x42eafe(0x15f))/0x7+parseInt(_0x42eafe(0x175))/0x8+-parseInt(_0x42eafe(0x137))/0x9*(parseInt(_0x42eafe(0x133))/0xa)+-parseInt(_0x42eafe(0x169))/0xb*(-parseInt(_0x42eafe(0x13b))/0xc);if(_0xf4b473===_0x1ac1c6)break;else _0x1ea0fa['push'](_0x1ea0fa['shift']());}catch(_0x354c35){_0x1ea0fa['push'](_0x1ea0fa['shift']());}}}(a41_0x5036,0xe2f05));import{jsx as a41_0x1d9e59,Fragment as a41_0x32a5aa,jsxs as a41_0x1c8b3a}from'react/jsx-runtime';import a41_0x295675 from'node:path';import a41_0x5c289c from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';function a41_0x2eb0(_0x229a75,_0xcc872a){_0x229a75=_0x229a75-0x11c;const _0x503667=a41_0x5036();let _0x2eb0d8=_0x503667[_0x229a75];return _0x2eb0d8;}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';function a41_0x5036(){const _0x49a925=['更新\x20package.json\x20name\x20和\x20description\x20字段','cwd','log','length','*\x20正在为项目\x20','../..','清理项目目录失败:\x20','6927224KhCfAL','lovrabet\x20config\x20set\x20appcode\x20[app-code]','toLocaleString','已自动拉取\x20✓','utf8','*\x20正在拉取\x20API\x20配置...','accessSync','启动项目:\x20','green','lovrabet\x20api\x20pull','package.json','1.\x20','未配置','setLogPath','🎉\x20项目创建成功!','拉取API配置:\x20','6ViGOod','message','API\x20配置拉取失败:\x20','项目名称:\x20','🔗\x20应用AppCode:\x20','cyan',',\x20description=','version','\x20配置应用AppCode:\x20','38sLBucq','stringify','\x20|\x20应用AppCode:\x20','yellow','online','4ohIboX','10pZNFdK','*\x20配置文件路径:\x20','.lovrabetrc','constants','1739196CdsFDv','165831yXlWfd','配置应用AppCode失败:\x20','需手动拉取','60opHZSS','更新\x20package.json\x20失败:\x20','trim','gray','×\x20项目创建失败:\x20','dirname','parse','59489FqRGZt','resolve','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','2.\x20','rmSync','env','√\x20API\x20配置拉取完成','projectName','1.0.0','×\x20项目目录\x20','pullApi','7200145hDmFpu','projectCode','white','API\x20配置拉取异常:\x20','description','readFileSync','cd\x20','repeat','create','writeFileSync','test','√\x20配置文件已创建,应用AppCode:\x20','√\x20package.json\x20已更新:\x20name=','×\x20无法在当前目录创建项目,请检查目录权限','info','开始创建项目:\x20','配置应用AppCode:\x20','join','472976pjzRCZ','*\x20清理失败的项目目录:\x20','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','existsSync','doTask','appCode','API\x20配置拉取成功:\x20','warn','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','\x20Generated\x20by\x20lovrabet\x20cli\x20','1516823xSWLIi','\x20√\x20','column','string','error'];a41_0x5036=function(){return _0x49a925;};return a41_0x5036();}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(_0x537d0c){const _0x4e8e91=a41_0x2eb0,[_0x41f8a6,_0x2e8572]=useState(![]),[_0xfad347,_0x13110b]=useState(![]),[_0x11824c,_0x3869ad]=useState(null),_0x17ef51=useCopyProjectTemplate(),_0x3b732b=useInstallDependencies(),_0x4afcae=useFormatCode(),_0x1fb133=async _0xf0e5ae=>{const _0x55072a=a41_0x2eb0;if(!_0xf0e5ae['projectName']||_0xf0e5ae[_0x55072a(0x149)][_0x55072a(0x13d)]()===''){console[_0x55072a(0x16d)]('×\x20项目名不能为空');return;}const _0x55eee6=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x55eee6[_0x55072a(0x157)](_0xf0e5ae[_0x55072a(0x149)])){console[_0x55072a(0x16d)](_0x55072a(0x144));return;}if(_0xf0e5ae[_0x55072a(0x149)][_0x55072a(0x171)]>0x64){console[_0x55072a(0x16d)]('×\x20项目名过长,最多支持\x20100\x20个字符');return;}const _0x160723=a41_0x295675[_0x55072a(0x143)](process[_0x55072a(0x16f)](),_0xf0e5ae[_0x55072a(0x149)]);if(a41_0x5c289c[_0x55072a(0x162)](_0x160723)){console[_0x55072a(0x16d)](_0x55072a(0x14b)+_0xf0e5ae[_0x55072a(0x149)]+'\x20已存在,请使用其他项目名');return;}try{const _0x2ae4e2=a41_0x295675[_0x55072a(0x140)](_0x160723);a41_0x5c289c[_0x55072a(0x17b)](_0x2ae4e2,a41_0x5c289c[_0x55072a(0x136)]['W_OK']);}catch(_0x5a9cea){console[_0x55072a(0x16d)](_0x55072a(0x15a));return;}_0x3869ad(_0xf0e5ae),_0x2e8572(!![]),logger[_0x55072a(0x121)](_0x160723),logger[_0x55072a(0x15b)](_0x55072a(0x155),_0x55072a(0x15c)+_0xf0e5ae[_0x55072a(0x149)],{'projectDir':_0x160723,'appCode':_0xf0e5ae[_0x55072a(0x164)]});try{await _0x17ef51[_0x55072a(0x163)](_0xf0e5ae[_0x55072a(0x149)]),await _0xc1646f(_0xf0e5ae[_0x55072a(0x149)]),await _0x3b732b[_0x55072a(0x163)](_0xf0e5ae[_0x55072a(0x149)]),await _0x4afcae[_0x55072a(0x163)](_0xf0e5ae['projectName']),await _0x124866(_0xf0e5ae[_0x55072a(0x149)],_0xf0e5ae['appCode']||'',_0xf0e5ae[_0x55072a(0x147)]);if(_0xf0e5ae[_0x55072a(0x14c)]&&_0xf0e5ae[_0x55072a(0x164)]){console[_0x55072a(0x170)](_0x55072a(0x17a));try{const _0x514cd4=await pullApiSilent(_0xf0e5ae[_0x55072a(0x164)],undefined,_0x160723,_0xf0e5ae[_0x55072a(0x147)]);_0x514cd4?(console['log'](_0x55072a(0x148)),logger[_0x55072a(0x15b)](_0x55072a(0x155),_0x55072a(0x165)+_0xf0e5ae[_0x55072a(0x164)],{'projectDir':_0x160723,'appCode':_0xf0e5ae[_0x55072a(0x164)],'env':_0xf0e5ae[_0x55072a(0x147)]})):(console[_0x55072a(0x170)]('!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x55072a(0x166)](_0x55072a(0x155),_0x55072a(0x126)+_0xf0e5ae[_0x55072a(0x164)],{'projectDir':_0x160723,'appCode':_0xf0e5ae[_0x55072a(0x164)],'env':_0xf0e5ae[_0x55072a(0x147)]}));}catch(_0x2ed9e6){console[_0x55072a(0x170)](_0x55072a(0x161)),logger[_0x55072a(0x166)](_0x55072a(0x155),_0x55072a(0x150)+_0xf0e5ae['appCode'],{'projectDir':_0x160723,'appCode':_0xf0e5ae[_0x55072a(0x164)],'env':_0xf0e5ae['env'],'error':_0x2ed9e6 instanceof Error?_0x2ed9e6[_0x55072a(0x125)]:String(_0x2ed9e6)});}}logger['success'](_0x55072a(0x155),'项目创建完成:\x20'+_0xf0e5ae[_0x55072a(0x149)]),_0x13110b(!![]),_0x2e8572(![]);}catch(_0x18aa3b){logger[_0x55072a(0x16d)](_0x55072a(0x155),'项目创建失败:\x20'+_0xf0e5ae[_0x55072a(0x149)],{'error':_0x18aa3b instanceof Error?_0x18aa3b[_0x55072a(0x125)]:String(_0x18aa3b)});try{a41_0x5c289c[_0x55072a(0x162)](_0x160723)&&(console[_0x55072a(0x170)](_0x55072a(0x160)+_0x160723),a41_0x5c289c[_0x55072a(0x146)](_0x160723,{'recursive':!![],'force':!![]}));}catch(_0x1cf5fc){logger['warn'](_0x55072a(0x155),_0x55072a(0x174)+_0x160723,{'error':_0x1cf5fc instanceof Error?_0x1cf5fc['message']:String(_0x1cf5fc)});}_0x2e8572(![]),console[_0x55072a(0x16d)](_0x55072a(0x13f)+(_0x18aa3b instanceof Error?_0x18aa3b[_0x55072a(0x125)]:String(_0x18aa3b)));}},_0x5953cc=async _0x22871f=>{await _0x1fb133({'projectName':_0x22871f,'env':_0x537d0c['env']});},_0xc1646f=async _0x208962=>{const _0x22d221=a41_0x2eb0,_0x26b8a6=a41_0x295675[_0x22d221(0x143)](process[_0x22d221(0x16f)](),_0x208962),_0x281d4d=a41_0x295675['join'](_0x26b8a6,_0x22d221(0x11e));try{console[_0x22d221(0x170)](_0x22d221(0x167));const _0x1261b0=fileURLToPath(import.meta.url),_0x498519=a41_0x295675[_0x22d221(0x143)](a41_0x295675[_0x22d221(0x140)](_0x1261b0),_0x22d221(0x173)),_0x5e7d8e=a41_0x295675[_0x22d221(0x15e)](_0x498519,_0x22d221(0x11e));let _0xed9f67=_0x22d221(0x14a);try{const _0x232ebc=JSON[_0x22d221(0x141)](a41_0x5c289c[_0x22d221(0x152)](_0x5e7d8e,_0x22d221(0x179)));_0xed9f67=_0x232ebc[_0x22d221(0x12b)]||'1.0.0';}catch(_0x6b6e54){}const _0x2385cb=a41_0x5c289c[_0x22d221(0x152)](_0x281d4d,'utf8'),_0x5a7df8=JSON['parse'](_0x2385cb);_0x5a7df8['name']=_0x208962,_0x5a7df8[_0x22d221(0x151)]=_0x208962+_0x22d221(0x168)+_0xed9f67,a41_0x5c289c[_0x22d221(0x156)](_0x281d4d,JSON[_0x22d221(0x12e)](_0x5a7df8,null,0x2)+'\x0a',_0x22d221(0x179)),console[_0x22d221(0x170)](_0x22d221(0x159)+_0x208962+_0x22d221(0x12a)+_0x5a7df8[_0x22d221(0x151)]),logger[_0x22d221(0x15b)](_0x22d221(0x155),_0x22d221(0x16e),{'projectName':_0x208962,'description':_0x5a7df8['description'],'cliVersion':_0xed9f67,'packageJsonPath':'package.json'});}catch(_0x143a41){logger[_0x22d221(0x16d)](_0x22d221(0x155),_0x22d221(0x13c)+_0x208962,{'projectName':_0x208962,'error':_0x143a41 instanceof Error?_0x143a41[_0x22d221(0x125)]:String(_0x143a41)});throw _0x143a41;}},_0x124866=async(_0x3073fd,_0x2a1f2a,_0x28baf8)=>{const _0x1446c8=a41_0x2eb0,_0x412ed3=a41_0x295675['resolve'](process[_0x1446c8(0x16f)](),_0x3073fd),_0x5f0dc4=a41_0x295675[_0x1446c8(0x15e)](_0x412ed3,_0x1446c8(0x135));try{_0x2a1f2a?console['log']('*\x20正在为项目\x20'+_0x3073fd+_0x1446c8(0x12c)+_0x2a1f2a):console[_0x1446c8(0x170)](_0x1446c8(0x172)+_0x3073fd+'\x20创建配置文件');console[_0x1446c8(0x170)](_0x1446c8(0x134)+_0x5f0dc4);const _0x389076=fileURLToPath(import.meta.url),_0x4217f9=a41_0x295675[_0x1446c8(0x143)](a41_0x295675[_0x1446c8(0x140)](_0x389076),'../..'),_0x3729c7=a41_0x295675[_0x1446c8(0x15e)](_0x4217f9,_0x1446c8(0x11e));let _0xff18f9='1.0.0';try{const _0xb3e394=JSON[_0x1446c8(0x141)](a41_0x5c289c[_0x1446c8(0x152)](_0x3729c7,'utf8'));_0xff18f9=_0xb3e394[_0x1446c8(0x12b)]||_0x1446c8(0x14a);}catch(_0x346dad){}const _0x9a0916=readConfig(),_0x3f9426=typeof _0x9a0916[_0x1446c8(0x147)]===_0x1446c8(0x16c)?_0x9a0916[_0x1446c8(0x147)]:undefined,{app:_0x255cdd,appcode:_0x196dd0,..._0xed39d3}=_0x9a0916,_0x30dc45={..._0xed39d3,'appcode':_0x2a1f2a||'','env':_0x28baf8||_0x3f9426||_0x1446c8(0x131),'createdAt':new Date()[_0x1446c8(0x177)](),'version':_0xff18f9};a41_0x5c289c[_0x1446c8(0x156)](_0x5f0dc4,JSON[_0x1446c8(0x12e)](_0x30dc45,null,0x2),_0x1446c8(0x179)),_0x2a1f2a?console[_0x1446c8(0x170)](_0x1446c8(0x158)+_0x2a1f2a):console[_0x1446c8(0x170)]('√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置'),logger[_0x1446c8(0x15b)](_0x1446c8(0x155),_0x1446c8(0x15d)+_0x2a1f2a,{'projectName':_0x3073fd,'configFile':_0x1446c8(0x135)});}catch(_0x5e8406){logger[_0x1446c8(0x16d)]('create',_0x1446c8(0x139)+_0x2a1f2a,{'projectName':_0x3073fd,'error':_0x5e8406 instanceof Error?_0x5e8406[_0x1446c8(0x125)]:String(_0x5e8406)});}};useEffect(()=>{const _0x3d120b=a41_0x2eb0;_0x537d0c[_0x3d120b(0x14e)]&&_0x5953cc(_0x537d0c[_0x3d120b(0x14e)]);},[_0x537d0c[_0x4e8e91(0x14e)]]);if(!_0x41f8a6&&!_0xfad347&&!_0x537d0c[_0x4e8e91(0x14e)])return a41_0x1d9e59(EnhancedGuidedCreate,{'onCreate':_0x1fb133,'env':_0x537d0c['env']});if(_0x41f8a6)return a41_0x1c8b3a(a41_0x32a5aa,{'children':[a41_0x1c8b3a(Box,{'marginTop':0x1,'children':[a41_0x1d9e59(Box,{'width':'1'}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x11c),'children':_0x4e8e91(0x16a)}),a41_0x1d9e59(Text,{'children':_0x4e8e91(0x127)}),a41_0x1d9e59(Text,{'color':'green','children':_0x11824c?.['projectName']}),_0x11824c?.[_0x4e8e91(0x164)]&&a41_0x1c8b3a(a41_0x32a5aa,{'children':[a41_0x1d9e59(Text,{'children':'\x20|\x20应用AppCode:\x20'}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x129),'children':_0x11824c[_0x4e8e91(0x164)]})]})]}),a41_0x1d9e59(TaskRunning,{..._0x17ef51}),a41_0x1d9e59(TaskRunning,{..._0x3b732b}),a41_0x1d9e59(TaskRunning,{..._0x4afcae})]});if(_0xfad347)return a41_0x1c8b3a(a41_0x32a5aa,{'children':[a41_0x1c8b3a(Box,{'marginTop':0x1,'children':[a41_0x1d9e59(Box,{'width':'1'}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x11c),'children':_0x4e8e91(0x16a)}),a41_0x1d9e59(Text,{'children':_0x4e8e91(0x127)}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x11c),'children':_0x11824c?.[_0x4e8e91(0x149)]}),_0x11824c?.[_0x4e8e91(0x164)]&&a41_0x1c8b3a(a41_0x32a5aa,{'children':[a41_0x1d9e59(Text,{'children':_0x4e8e91(0x12f)}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x129),'children':_0x11824c[_0x4e8e91(0x164)]})]})]}),a41_0x1d9e59(TaskFinished,{..._0x17ef51}),a41_0x1d9e59(TaskFinished,{..._0x3b732b}),a41_0x1d9e59(TaskFinished,{..._0x4afcae}),a41_0x1d9e59(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0x1d9e59(Text,{'color':'green','children':'─'['repeat'](0x3c)})}),a41_0x1d9e59(Box,{'children':a41_0x1d9e59(Text,{'color':_0x4e8e91(0x11c),'bold':!![],'children':_0x4e8e91(0x122)})}),a41_0x1c8b3a(Box,{'marginTop':0x1,'flexDirection':_0x4e8e91(0x16b),'children':[a41_0x1c8b3a(Box,{'children':[a41_0x1d9e59(Text,{'color':'cyan','children':'📁\x20项目名称:\x20'}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x14f),'bold':!![],'children':_0x11824c?.[_0x4e8e91(0x149)]})]}),_0x11824c?.[_0x4e8e91(0x164)]&&a41_0x1c8b3a(Box,{'children':[a41_0x1d9e59(Text,{'color':_0x4e8e91(0x129),'children':_0x4e8e91(0x128)}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x14f),'bold':!![],'children':_0x11824c[_0x4e8e91(0x164)]})]}),a41_0x1c8b3a(Box,{'children':[a41_0x1d9e59(Text,{'color':_0x4e8e91(0x129),'children':'📦\x20API配置:\x20'}),_0x11824c?.[_0x4e8e91(0x14c)]?a41_0x1d9e59(Text,{'color':_0x4e8e91(0x11c),'bold':!![],'children':_0x4e8e91(0x178)}):_0x11824c?.[_0x4e8e91(0x164)]?a41_0x1d9e59(Text,{'color':_0x4e8e91(0x130),'bold':!![],'children':_0x4e8e91(0x13a)}):a41_0x1d9e59(Text,{'color':_0x4e8e91(0x13e),'bold':!![],'children':_0x4e8e91(0x120)})]})]}),a41_0x1d9e59(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0x1d9e59(Text,{'color':_0x4e8e91(0x129),'bold':!![],'children':'🚀\x20接下来可以:'})}),a41_0x1c8b3a(Box,{'marginLeft':0x2,'flexDirection':_0x4e8e91(0x16b),'children':[a41_0x1c8b3a(Box,{'children':[a41_0x1d9e59(Text,{'color':_0x4e8e91(0x11c),'children':_0x4e8e91(0x11f)}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x14f),'children':_0x4e8e91(0x17c)}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x129),'bold':!![],'children':_0x4e8e91(0x153)+_0x11824c?.[_0x4e8e91(0x149)]+'\x20&&\x20lovrabet\x20start'})]}),_0x11824c?.[_0x4e8e91(0x164)]&&!_0x11824c?.['pullApi']&&a41_0x1c8b3a(Box,{'children':[a41_0x1d9e59(Text,{'color':_0x4e8e91(0x130),'children':_0x4e8e91(0x145)}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x14f),'children':_0x4e8e91(0x123)}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x129),'bold':!![],'children':_0x4e8e91(0x11d)})]}),!_0x11824c?.[_0x4e8e91(0x164)]&&a41_0x1c8b3a(a41_0x32a5aa,{'children':[a41_0x1c8b3a(Box,{'children':[a41_0x1d9e59(Text,{'color':_0x4e8e91(0x13e),'children':_0x4e8e91(0x145)}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x14f),'children':'配置AppCode:\x20'}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x129),'bold':!![],'children':_0x4e8e91(0x176)})]}),a41_0x1c8b3a(Box,{'children':[a41_0x1d9e59(Text,{'color':'gray','children':'3.\x20'}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x14f),'children':_0x4e8e91(0x123)}),a41_0x1d9e59(Text,{'color':_0x4e8e91(0x129),'bold':!![],'children':'lovrabet\x20api\x20pull\x20--appcode\x20[app-code]'})]})]})]}),a41_0x1d9e59(Box,{'marginTop':0x1,'children':a41_0x1d9e59(Text,{'color':_0x4e8e91(0x11c),'children':'─'[_0x4e8e91(0x154)](0x3c)})})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x115d8f,_0x53b049){var _0x210fc4=a42_0x5413,_0x122c0c=_0x115d8f();while(!![]){try{var _0x538eb6=parseInt(_0x210fc4(0x193))/0x1*(parseInt(_0x210fc4(0x18e))/0x2)+parseInt(_0x210fc4(0x189))/0x3+parseInt(_0x210fc4(0x18b))/0x4*(parseInt(_0x210fc4(0x195))/0x5)+-parseInt(_0x210fc4(0x18f))/0x6*(-parseInt(_0x210fc4(0x18c))/0x7)+-parseInt(_0x210fc4(0x18a))/0x8+-parseInt(_0x210fc4(0x194))/0x9*(-parseInt(_0x210fc4(0x191))/0xa)+-parseInt(_0x210fc4(0x18d))/0xb;if(_0x538eb6===_0x53b049)break;else _0x122c0c['push'](_0x122c0c['shift']());}catch(_0xc58bc2){_0x122c0c['push'](_0x122c0c['shift']());}}}(a42_0x23f7,0x83579));import{jsx as a42_0x459593,jsxs as a42_0x3768db}from'react/jsx-runtime';import{Box,Text}from'ink';function a42_0x5413(_0x398537,_0x57ed4c){_0x398537=_0x398537-0x189;var _0x23f703=a42_0x23f7();var _0x5413a3=_0x23f703[_0x398537];return _0x5413a3;}function a42_0x23f7(){var _0x4d397a=['green','240220ckHLSr','1062bsolRK','7675JmAVZp','1703541lubgJq','1711920KtVgWA','716ZTIYLr','35VdFaSJ','18744616vfOYXM','8UatdXP','447162vupMNM','elapsed','23720ylyMVU'];a42_0x23f7=function(){return _0x4d397a;};return a42_0x23f7();}import{TaskTime}from'./task-time.js';export function TaskFinished(_0x4836f4){var _0x29771d=a42_0x5413;return a42_0x3768db(Box,{'children':[a42_0x459593(Box,{'width':'1'}),a42_0x459593(Text,{'color':_0x29771d(0x192),'children':'\x20√\x20'}),a42_0x459593(Text,{'children':_0x4836f4['taskName']}),a42_0x459593(TaskTime,{'elapsed':_0x4836f4[_0x29771d(0x190)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x25e37c,_0x2fd928){var _0xf800eb=a43_0xd5de,_0x2661a3=_0x25e37c();while(!![]){try{var _0x3abb09=-parseInt(_0xf800eb(0x77))/0x1+-parseInt(_0xf800eb(0x78))/0x2+parseInt(_0xf800eb(0x7e))/0x3+-parseInt(_0xf800eb(0x79))/0x4+parseInt(_0xf800eb(0x7b))/0x5+-parseInt(_0xf800eb(0x75))/0x6+parseInt(_0xf800eb(0x73))/0x7;if(_0x3abb09===_0x2fd928)break;else _0x2661a3['push'](_0x2661a3['shift']());}catch(_0x4e0082){_0x2661a3['push'](_0x2661a3['shift']());}}}(a43_0x2c2c,0x1dcb7));function a43_0x2c2c(){var _0x4205d1=['2051140znrKcb','finished','715794TLFsNs','\x20\x20\x20','98538WGyQuD','263882lQGchF','80036zSNppA','dots','334860IoAToR','green','loading','395502xJdbEl'];a43_0x2c2c=function(){return _0x4205d1;};return a43_0x2c2c();}import{jsx as a43_0x3ef0d8,jsxs as a43_0x515587}from'react/jsx-runtime';import{Text}from'ink';function a43_0xd5de(_0x15ef8b,_0x8a3fee){_0x15ef8b=_0x15ef8b-0x73;var _0x2c2c93=a43_0x2c2c();var _0xd5de1e=_0x2c2c93[_0x15ef8b];return _0xd5de1e;}import a43_0x310142 from'ink-spinner';export function TaskLoading(_0x1cab5a){var _0x5af9d9=a43_0xd5de;if(_0x1cab5a[_0x5af9d9(0x74)])return a43_0x3ef0d8(Text,{'color':_0x5af9d9(0x7c),'children':'\x20√\x20'});if(_0x1cab5a[_0x5af9d9(0x7d)])return a43_0x515587(Text,{'color':'green','children':['\x20',a43_0x3ef0d8(a43_0x310142,{'type':_0x5af9d9(0x7a)}),'\x20']});return a43_0x3ef0d8(Text,{'children':_0x5af9d9(0x76)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x41eb70,_0x35e5ba){var _0x3c74fe=a44_0x8a66,_0x5bf760=_0x41eb70();while(!![]){try{var _0x321e83=parseInt(_0x3c74fe(0xa7))/0x1*(parseInt(_0x3c74fe(0xa5))/0x2)+parseInt(_0x3c74fe(0xaf))/0x3*(-parseInt(_0x3c74fe(0xb0))/0x4)+-parseInt(_0x3c74fe(0xad))/0x5+parseInt(_0x3c74fe(0xae))/0x6*(parseInt(_0x3c74fe(0xa8))/0x7)+parseInt(_0x3c74fe(0xa9))/0x8+parseInt(_0x3c74fe(0xa4))/0x9*(parseInt(_0x3c74fe(0xac))/0xa)+-parseInt(_0x3c74fe(0xa6))/0xb;if(_0x321e83===_0x35e5ba)break;else _0x5bf760['push'](_0x5bf760['shift']());}catch(_0x135caa){_0x5bf760['push'](_0x5bf760['shift']());}}}(a44_0x5505,0x4c017));import{jsx as a44_0x400b30,jsxs as a44_0x2bf371}from'react/jsx-runtime';import{Box,Text}from'ink';function a44_0x8a66(_0x28b928,_0x483dd0){_0x28b928=_0x28b928-0xa4;var _0x550504=a44_0x5505();var _0x8a6665=_0x550504[_0x28b928];return _0x8a6665;}import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x10f825){var _0x5315a3=a44_0x8a66;return a44_0x2bf371(Box,{'children':[a44_0x400b30(Box,{'width':'1'}),a44_0x400b30(TaskLoading,{..._0x10f825}),a44_0x400b30(Text,{'children':_0x10f825[_0x5315a3(0xab)]}),a44_0x400b30(TaskTime,{'elapsed':_0x10f825[_0x5315a3(0xaa)]})]});}function a44_0x5505(){var _0x19d159=['519740KJYbYc','2772375SmpNag','1062QvPpzU','33oRrRbf','126876OckgnD','90xTaPzc','360214oDhkkI','5510186vyQTgP','3qCIKVU','13601UPmRbf','2493256fyiceK','elapsed','taskName'];a44_0x5505=function(){return _0x19d159;};return a44_0x5505();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x59fe26,_0x40b199){var _0x3af824=a45_0x9eb0,_0x2b9e0f=_0x59fe26();while(!![]){try{var _0x18491d=parseInt(_0x3af824(0xb3))/0x1+parseInt(_0x3af824(0xab))/0x2*(parseInt(_0x3af824(0xb2))/0x3)+-parseInt(_0x3af824(0xad))/0x4*(parseInt(_0x3af824(0xae))/0x5)+-parseInt(_0x3af824(0xa9))/0x6+-parseInt(_0x3af824(0xb4))/0x7*(parseInt(_0x3af824(0xaa))/0x8)+parseInt(_0x3af824(0xb1))/0x9+parseInt(_0x3af824(0xaf))/0xa;if(_0x18491d===_0x40b199)break;else _0x2b9e0f['push'](_0x2b9e0f['shift']());}catch(_0x4ad142){_0x2b9e0f['push'](_0x2b9e0f['shift']());}}}(a45_0x3a5e,0xb1192));import{jsx as a45_0x31bf0b,Fragment as a45_0x51d0e8,jsxs as a45_0x45229a}from'react/jsx-runtime';import{Text}from'ink';function a45_0x3a5e(){var _0x56b2a0=['8432ADwyrK','2044828WtWkzW','elapsed','380qGHCif','55095LybEgu','4741940ZmfEgz','gray','11120868JckupM','3tkPrva','185733BnVhHS','1939SccukN','5123016ARptgm'];a45_0x3a5e=function(){return _0x56b2a0;};return a45_0x3a5e();}function a45_0x9eb0(_0x43bc79,_0x5cb17e){_0x43bc79=_0x43bc79-0xa9;var _0x3a5e43=a45_0x3a5e();var _0x9eb003=_0x3a5e43[_0x43bc79];return _0x9eb003;}export function TaskTime(_0x367512){var _0x48a266=a45_0x9eb0;if(_0x367512[_0x48a266(0xac)])return a45_0x45229a(a45_0x51d0e8,{'children':[a45_0x31bf0b(Text,{'color':_0x48a266(0xb0),'children':'\x20['}),a45_0x31bf0b(Text,{'color':_0x48a266(0xb0),'bold':!![],'children':_0x367512[_0x48a266(0xac)]}),a45_0x31bf0b(Text,{'color':_0x48a266(0xb0),'children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0xb100e8=a46_0x45a2;(function(_0x2e1352,_0x5a562f){const _0x38cf61=a46_0x45a2,_0x252c9f=_0x2e1352();while(!![]){try{const _0x4097ea=parseInt(_0x38cf61(0xb1))/0x1*(-parseInt(_0x38cf61(0xb4))/0x2)+-parseInt(_0x38cf61(0xb6))/0x3+parseInt(_0x38cf61(0xc0))/0x4*(-parseInt(_0x38cf61(0xba))/0x5)+parseInt(_0x38cf61(0xb3))/0x6*(-parseInt(_0x38cf61(0xb0))/0x7)+parseInt(_0x38cf61(0xb9))/0x8+-parseInt(_0x38cf61(0xbe))/0x9*(-parseInt(_0x38cf61(0xbf))/0xa)+parseInt(_0x38cf61(0xaf))/0xb*(parseInt(_0x38cf61(0xb2))/0xc);if(_0x4097ea===_0x5a562f)break;else _0x252c9f['push'](_0x252c9f['shift']());}catch(_0x375a41){_0x252c9f['push'](_0x252c9f['shift']());}}}(a46_0x10a2,0x9a6da));import a46_0x1f3e6e from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a46_0x45a2(_0x4085d3,_0x12e8b2){_0x4085d3=_0x4085d3-0xae;const _0x10a2c9=a46_0x10a2();let _0x45a252=_0x10a2c9[_0x4085d3];return _0x45a252;}const __dirname=a46_0x1f3e6e['dirname'](fileURLToPath(import.meta.url)),templateDir=a46_0x1f3e6e[a46_0xb100e8(0xbc)](__dirname,a46_0xb100e8(0xbd));function a46_0x10a2(){const _0x16ab18=['472848JtKNAU','30aGCwMK','44786wFrGti','now','2894643mxwUea','info','copy','8040792GlhUFY','4130QKmuKf','cwd','resolve','../../templates/projects/sub-app-react-demo','4329171bvDTWz','10xOjihL','4300vclHfi','项目模板复制完成','error','开始复制项目模板','复制项目文件','781ynbsMl','1545950HePDxS','31HQUQQd'];a46_0x10a2=function(){return _0x16ab18;};return a46_0x10a2();}export function useCopyProjectTemplate(){const _0x716a79=a46_0xb100e8,[_0x4c1339,_0x1e4276]=useState(![]),[_0x2318a7,_0x5e794f]=useState(![]),[_0x268092,_0x5d30b9]=useState(''),_0x22bc5f=useCallback(async _0x1b298b=>{const _0x2bdbfa=a46_0x45a2,_0x2f26b5=Date[_0x2bdbfa(0xb5)](),_0x37037f=a46_0x1f3e6e[_0x2bdbfa(0xbc)](process[_0x2bdbfa(0xbb)](),_0x1b298b);_0x1e4276(!![]);try{logger[_0x2bdbfa(0xb7)](_0x2bdbfa(0xb8),_0x2bdbfa(0xc3),{'projectCode':_0x1b298b,'templateDir':templateDir}),await copyDirectory(templateDir,_0x37037f);const _0x8422c2=Date[_0x2bdbfa(0xb5)]()-_0x2f26b5;logger['success'](_0x2bdbfa(0xb8),_0x2bdbfa(0xc1),_0x8422c2,{'projectCode':_0x1b298b});}catch(_0x43b73e){const _0x103312=Date[_0x2bdbfa(0xb5)]()-_0x2f26b5;logger[_0x2bdbfa(0xc2)](_0x2bdbfa(0xb8),'项目模板复制失败',{'projectCode':_0x1b298b,'error':_0x43b73e instanceof Error?_0x43b73e['message']:String(_0x43b73e),'duration':_0x103312});throw _0x43b73e;}finally{_0x1e4276(![]),_0x5e794f(!![]),_0x5d30b9(formatElapsed(_0x2f26b5));}},[]);return{'taskName':_0x716a79(0xae),'finished':_0x2318a7,'loading':_0x4c1339,'elapsed':_0x268092,'doTask':_0x22bc5f};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x59ee40,_0x55b4c9){const _0x1f4cbe=a47_0x9aee,_0x2d8720=_0x59ee40();while(!![]){try{const _0x120317=-parseInt(_0x1f4cbe(0x1dc))/0x1+-parseInt(_0x1f4cbe(0x1e2))/0x2*(parseInt(_0x1f4cbe(0x1df))/0x3)+parseInt(_0x1f4cbe(0x1da))/0x4*(parseInt(_0x1f4cbe(0x1db))/0x5)+-parseInt(_0x1f4cbe(0x1d2))/0x6*(-parseInt(_0x1f4cbe(0x1d1))/0x7)+-parseInt(_0x1f4cbe(0x1d4))/0x8+parseInt(_0x1f4cbe(0x1dd))/0x9*(-parseInt(_0x1f4cbe(0x1d3))/0xa)+parseInt(_0x1f4cbe(0x1de))/0xb;if(_0x120317===_0x55b4c9)break;else _0x2d8720['push'](_0x2d8720['shift']());}catch(_0x315eb9){_0x2d8720['push'](_0x2d8720['shift']());}}}(a47_0x2d46,0x613e6));function a47_0x2d46(){const _0x2e50e0=['246nqdGzF','3152810dWpiMR','3468928aMdjar','--write','cwd','now','开始格式化代码','info','1800808vwGEfS','5akpEkC','691151VhfHMa','9mfgrjF','14893296XPGHKX','70383haHTIG','npx','error','58mFzGzS','format','prettier','resolve','代码格式化失败','代码格式化完成','122003UFUAjH'];a47_0x2d46=function(){return _0x2e50e0;};return a47_0x2d46();}import a47_0x4e3826 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a47_0x9aee(_0x221ac2,_0x53978d){_0x221ac2=_0x221ac2-0x1cc;const _0x2d46c7=a47_0x2d46();let _0x9aeec3=_0x2d46c7[_0x221ac2];return _0x9aeec3;}export function useFormatCode(){const [_0xf3481e,_0xe616bc]=useState(![]),[_0x5191af,_0x14f206]=useState(![]),[_0x29134f,_0x533b49]=useState(''),_0x5b1d53=useCallback(async _0x16e74a=>{const _0x464034=a47_0x9aee,_0x533dce=Date[_0x464034(0x1d7)](),_0x5a8bc3=a47_0x4e3826[_0x464034(0x1ce)](process[_0x464034(0x1d6)](),_0x16e74a);_0xe616bc(!![]);try{logger[_0x464034(0x1d9)](_0x464034(0x1cc),_0x464034(0x1d8),{'projectCode':_0x16e74a}),await execa(_0x464034(0x1e0),[_0x464034(0x1cd),_0x464034(0x1d5),'.'],{'cwd':_0x5a8bc3});const _0x3d6d1b=Date[_0x464034(0x1d7)]()-_0x533dce;logger['success'](_0x464034(0x1cc),_0x464034(0x1d0),_0x3d6d1b,{'projectCode':_0x16e74a});}catch(_0x546a24){const _0x424efd=Date[_0x464034(0x1d7)]()-_0x533dce;logger[_0x464034(0x1e1)](_0x464034(0x1cc),_0x464034(0x1cf),{'projectCode':_0x16e74a,'error':_0x546a24 instanceof Error?_0x546a24['message']:String(_0x546a24),'duration':_0x424efd});throw _0x546a24;}finally{_0xe616bc(![]),_0x14f206(!![]),_0x533b49(formatElapsed(_0x533dce));}},[]);return{'taskName':'格式化代码','finished':_0x5191af,'loading':_0xf3481e,'elapsed':_0x29134f,'doTask':_0x5b1d53};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x14c44e,_0x48b813){const _0x877424=a48_0xd91a,_0x1b217f=_0x14c44e();while(!![]){try{const _0x96600a=-parseInt(_0x877424(0x1ef))/0x1+parseInt(_0x877424(0x1f3))/0x2*(parseInt(_0x877424(0x1ec))/0x3)+-parseInt(_0x877424(0x1f6))/0x4*(parseInt(_0x877424(0x1e8))/0x5)+-parseInt(_0x877424(0x1ed))/0x6+parseInt(_0x877424(0x1ea))/0x7+parseInt(_0x877424(0x1e9))/0x8*(parseInt(_0x877424(0x1e6))/0x9)+-parseInt(_0x877424(0x1f4))/0xa*(-parseInt(_0x877424(0x1f7))/0xb);if(_0x96600a===_0x48b813)break;else _0x1b217f['push'](_0x1b217f['shift']());}catch(_0x531993){_0x1b217f['push'](_0x1b217f['shift']());}}}(a48_0x5534,0x9fe5e));import a48_0x428d3e from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x21980d=a48_0xd91a,[_0x79cc1,_0x57dec3]=useState(![]),[_0x553b12,_0x598b1b]=useState(![]),[_0x10a28c,_0x2edc23]=useState(''),_0x202f2a=useCallback(async _0x1229bd=>{const _0x4d02a4=a48_0xd91a,_0x3bb906=Date[_0x4d02a4(0x1e5)](),_0x241af5=a48_0x428d3e[_0x4d02a4(0x1eb)](process['cwd'](),_0x1229bd);_0x57dec3(!![]),_0x598b1b(![]);const _0x5b5b33=async(_0xc78dd4,_0x35e5d2)=>{await execa(_0xc78dd4,_0x35e5d2,{'cwd':_0x241af5});};try{logger[_0x4d02a4(0x1f2)](_0x4d02a4(0x1f0),'开始安装依赖',{'projectCode':_0x1229bd,'registry':_0x4d02a4(0x1e7)}),await _0x5b5b33('npm',[_0x4d02a4(0x1f0),_0x4d02a4(0x1f5),'https://registry.npmmirror.com']);const _0xe1e7e1=Date[_0x4d02a4(0x1e5)]()-_0x3bb906;logger['success'](_0x4d02a4(0x1f0),'依赖安装完成',_0xe1e7e1,{'projectCode':_0x1229bd});}catch(_0x111bd6){const _0x3b3daa=Date[_0x4d02a4(0x1e5)]()-_0x3bb906;logger['error']('install',_0x4d02a4(0x1ee),{'projectCode':_0x1229bd,'error':_0x111bd6 instanceof Error?_0x111bd6['message']:String(_0x111bd6),'duration':_0x3b3daa});throw _0x111bd6;}finally{_0x57dec3(![]),_0x598b1b(!![]),_0x2edc23(formatElapsed(_0x3bb906));}},[]);return{'taskName':_0x21980d(0x1f1),'finished':_0x553b12,'loading':_0x79cc1,'elapsed':_0x10a28c,'doTask':_0x202f2a};}function a48_0xd91a(_0x59125a,_0x12d92c){_0x59125a=_0x59125a-0x1e5;const _0x55344c=a48_0x5534();let _0xd91a48=_0x55344c[_0x59125a];return _0xd91a48;}function a48_0x5534(){const _0x458883=['94761ilVZpZ','https://registry.npmmirror.com','1275iUAzbL','272ewoKMH','5154877jyDITp','resolve','3ENWNvC','7221450DDsLzW','依赖安装失败','1227248OLEdqd','install','安装依赖','info','1409502zEInkY','10mEJIQh','--registry','14664veiZjl','24435917hrQIbC','now'];a48_0x5534=function(){return _0x458883;};return a48_0x5534();}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x585448,_0x4548ed){var _0x2a6271=a49_0x5a83,_0x2de0ab=_0x585448();while(!![]){try{var _0x3a0106=parseInt(_0x2a6271(0x194))/0x1*(-parseInt(_0x2a6271(0x197))/0x2)+-parseInt(_0x2a6271(0x18f))/0x3*(-parseInt(_0x2a6271(0x18e))/0x4)+parseInt(_0x2a6271(0x19a))/0x5*(-parseInt(_0x2a6271(0x18c))/0x6)+parseInt(_0x2a6271(0x18d))/0x7+parseInt(_0x2a6271(0x192))/0x8+parseInt(_0x2a6271(0x195))/0x9*(parseInt(_0x2a6271(0x196))/0xa)+-parseInt(_0x2a6271(0x191))/0xb*(-parseInt(_0x2a6271(0x190))/0xc);if(_0x3a0106===_0x4548ed)break;else _0x2de0ab['push'](_0x2de0ab['shift']());}catch(_0x3852e7){_0x2de0ab['push'](_0x2de0ab['shift']());}}}(a49_0x5426,0x9c958));import{jsx as a49_0x5e1dea,jsxs as a49_0x38f6fa}from'react/jsx-runtime';function a49_0x5426(){var _0x5591f8=['lovrabet\x20--help','6uWiAmg','1497069LZGunc','8PBurYW','1804569SiAoTR','685284rhHCWQ','11BXZIvY','2077016bEQhFm','green','2nKdnVe','4419kzRICb','8350uMckVe','504066AjQqfS','查看可用命令。','column','4990990cOyiTO'];a49_0x5426=function(){return _0x5591f8;};return a49_0x5426();}import{Box,Text}from'ink';function a49_0x5a83(_0x7afe7d,_0x4d7416){_0x7afe7d=_0x7afe7d-0x18b;var _0x542600=a49_0x5426();var _0x5a83b9=_0x542600[_0x7afe7d];return _0x5a83b9;}export function Help(){var _0x468d93=a49_0x5a83;return a49_0x38f6fa(Box,{'flexDirection':_0x468d93(0x199),'marginTop':0x1,'marginBottom':0x1,'children':[a49_0x38f6fa(Box,{'children':[a49_0x5e1dea(Box,{'width':'1'}),a49_0x5e1dea(Text,{'children':'!\x20请指定一个有效的命令。'})]}),a49_0x38f6fa(Box,{'marginTop':0x1,'children':[a49_0x5e1dea(Box,{'width':'1'}),a49_0x38f6fa(Text,{'children':['\x20\x20','使用']}),a49_0x38f6fa(Text,{'bold':!![],'color':_0x468d93(0x193),'children':['\x20',_0x468d93(0x18b),'\x20']}),a49_0x5e1dea(Text,{'children':_0x468d93(0x198)})]})]});}
|
package/lib/init/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5c9a07,_0x56fa91){const _0xc87679=a50_0x7b5f,_0x43e33b=_0x5c9a07();while(!![]){try{const _0x5c38c5=-parseInt(_0xc87679(0x1dd))/0x1*(-parseInt(_0xc87679(0x1f8))/0x2)+-parseInt(_0xc87679(0x1e3))/0x3*(-parseInt(_0xc87679(0x1ee))/0x4)+parseInt(_0xc87679(0x1ed))/0x5+-parseInt(_0xc87679(0x1fa))/0x6*(parseInt(_0xc87679(0x1db))/0x7)+parseInt(_0xc87679(0x1fb))/0x8*(-parseInt(_0xc87679(0x1f1))/0x9)+parseInt(_0xc87679(0x1df))/0xa*(parseInt(_0xc87679(0x1ec))/0xb)+-parseInt(_0xc87679(0x1d1))/0xc*(parseInt(_0xc87679(0x1c8))/0xd);if(_0x5c38c5===_0x56fa91)break;else _0x43e33b['push'](_0x43e33b['shift']());}catch(_0x4a255a){_0x43e33b['push'](_0x43e33b['shift']());}}}(a50_0x486c,0x3d07b));import{jsxs as a50_0x22e97c,jsx as a50_0x278143}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';function a50_0x486c(){const _0x20d112=['error','初始化项目配置文件成功','column','189cfJMnT','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','158kZgGGo','backspace','40JzdoiN','slice','setLogPath','red','880788eEBApd','stringify','应用代码不合法','请输入应用代码\x20(AppCode):\x20','trim','green','env','delete','1.0.0','987646UsmJQv','2185040ymqGMO','4jpXQFF','AppCode:\x20','cwd','152127ncZRzD','info','cyan','message','parse','version','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','1592LSikwL','应用代码只能包含字母、数字、-\x20和\x20_','31230yvjcHm','16dnkWwo','length','13sjDuUU','package.json','utf8','exit','../..','string','ctrl','当前目录已存在\x20.lovrabetrc\x20文件','创建配置文件失败:\x20','9494352TXtCeS','test','online','return','应用代码长度不能超过\x20100\x20个字符','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','toLocaleString'];a50_0x486c=function(){return _0x20d112;};return a50_0x486c();}import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';function a50_0x7b5f(_0x528159,_0x3b909a){_0x528159=_0x528159-0x1c7;const _0x486cb3=a50_0x486c();let _0x7b5ff8=_0x486cb3[_0x528159];return _0x7b5ff8;}import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';export function Init({appcode:_0x10523b,env:_0xb8665a}){const _0x2e86d0=a50_0x7b5f,[_0x338301,_0x64b9cc]=useState(null),[_0x5c1663,_0xb3849e]=useState(![]),[_0x187fc1,_0x3e5fc8]=useState(!_0x10523b),[_0x5c0a81,_0x59de4f]=useState(''),[_0x17e47d,_0x2469a5]=useState(''),[_0x25f684,_0x4c80cb]=useState(_0x10523b||''),[_0x4d8314]=useState(_0xb8665a);function _0x253392(_0x4a7edd){const _0x1c503c=a50_0x7b5f;if(_0x4a7edd[_0x1c503c(0x1c7)]===0x0)return{'valid':![],'message':''};if(_0x4a7edd[_0x1c503c(0x1c7)]>0x64)return{'valid':![],'message':_0x1c503c(0x1d5)};const _0x3a13e4=/^[A-Za-z0-9_-]+$/;if(!_0x3a13e4[_0x1c503c(0x1d2)](_0x4a7edd))return{'valid':![],'message':_0x1c503c(0x1f9)};return{'valid':!![]};}useInput((_0x1cf96c,_0x5d70a0)=>{const _0x4631aa=a50_0x7b5f;if(!_0x187fc1)return;if(_0x5d70a0[_0x4631aa(0x1d4)]){if(_0x17e47d||!_0x5c0a81[_0x4631aa(0x1e7)]()){_0x2469a5('应用代码不能为空');return;}const _0x4bf084=_0x5c0a81[_0x4631aa(0x1e7)](),{valid:_0x10acbb,message:_0x451c82}=_0x253392(_0x4bf084);if(!_0x10acbb){_0x2469a5(_0x451c82||'应用代码不合法');return;}_0x4c80cb(_0x4bf084),_0x3e5fc8(![]);}else{if(_0x5d70a0[_0x4631aa(0x1de)]||_0x5d70a0[_0x4631aa(0x1ea)])_0x59de4f(_0x9f7a7a=>{const _0x165f52=_0x4631aa,_0x12b1d4=_0x9f7a7a[_0x165f52(0x1e0)](0x0,-0x1);if(_0x12b1d4['length']===0x0)_0x2469a5('');else{const {valid:_0x28a5a4,message:_0x50a63f}=_0x253392(_0x12b1d4);_0x2469a5(_0x28a5a4?'':_0x50a63f||_0x165f52(0x1e5));}return _0x12b1d4;});else _0x5d70a0[_0x4631aa(0x1ce)]&&_0x1cf96c==='c'?process[_0x4631aa(0x1cb)](0x0):_0x59de4f(_0x25091f=>{const _0x4c2407=_0x25091f+_0x1cf96c,{valid:_0x3f6816,message:_0x410bee}=_0x253392(_0x4c2407);return _0x2469a5(_0x3f6816?'':_0x410bee||'应用代码不合法'),_0x4c2407;});}},{'isActive':_0x187fc1}),useEffect(()=>{const _0x5279d4=a50_0x7b5f;if(!_0x25f684||_0x187fc1)return;const _0x15b874=resolve(process[_0x5279d4(0x1f0)](),'.lovrabetrc');if(existsSync(_0x15b874)){_0x64b9cc(_0x5279d4(0x1cf)),setTimeout(()=>process[_0x5279d4(0x1cb)](0x1),0x64);return;}try{const _0x477d5a=fileURLToPath(import.meta.url),_0x586de9=resolve(dirname(_0x477d5a),_0x5279d4(0x1cc)),_0x1018e9=join(_0x586de9,_0x5279d4(0x1c9));let _0x6dc5f0=_0x5279d4(0x1eb);try{const _0x47e579=JSON[_0x5279d4(0x1f5)](readFileSync(_0x1018e9,_0x5279d4(0x1ca)));_0x6dc5f0=_0x47e579['version']||_0x5279d4(0x1eb);}catch(_0x418c0a){}const _0x24f5cf=readConfig(),_0x20e93f=typeof _0x24f5cf[_0x5279d4(0x1e9)]===_0x5279d4(0x1cd)?_0x24f5cf[_0x5279d4(0x1e9)]:undefined,{app:_0x35763a,appcode:_0x368a08,..._0x4e559b}=_0x24f5cf,_0x3c3bb9={..._0x4e559b,'appcode':_0x25f684,'env':_0x4d8314||_0x20e93f||_0x5279d4(0x1d3),'createdAt':new Date()[_0x5279d4(0x1d7)](),'version':_0x6dc5f0};writeFileSync(_0x15b874,JSON[_0x5279d4(0x1e4)](_0x3c3bb9,null,0x2),{'encoding':_0x5279d4(0x1ca),'mode':0x180}),logger[_0x5279d4(0x1e1)](process[_0x5279d4(0x1f0)]()),logger[_0x5279d4(0x1f2)]('init',_0x5279d4(0x1d9),{'appcode':_0x25f684,'env':_0x3c3bb9[_0x5279d4(0x1e9)],'version':_0x3c3bb9[_0x5279d4(0x1f6)],'configPath':_0x15b874}),_0xb3849e(!![]),setTimeout(()=>process[_0x5279d4(0x1cb)](0x0),0x64);}catch(_0x2fb2b7){logger[_0x5279d4(0x1d8)]('init','创建配置文件失败',{'error':_0x2fb2b7 instanceof Error?_0x2fb2b7['message']:String(_0x2fb2b7)}),_0x64b9cc(_0x5279d4(0x1d0)+(_0x2fb2b7 instanceof Error?_0x2fb2b7[_0x5279d4(0x1f4)]:String(_0x2fb2b7))),setTimeout(()=>process[_0x5279d4(0x1cb)](0x1),0x64);}},[_0x25f684,_0x187fc1,_0x4d8314]);if(_0x338301)return a50_0x278143(Box,{'flexDirection':_0x2e86d0(0x1da),'children':a50_0x22e97c(Text,{'color':'red','children':['✗\x20',_0x338301]})});if(_0x187fc1)return a50_0x22e97c(Box,{'flexDirection':_0x2e86d0(0x1da),'children':[a50_0x22e97c(Box,{'children':[a50_0x278143(Text,{'color':_0x2e86d0(0x1f3),'children':_0x2e86d0(0x1e6)}),_0x5c0a81?a50_0x278143(Text,{'color':_0x2e86d0(0x1e8),'children':_0x5c0a81}):a50_0x278143(Text,{'color':'gray','children':'_'}),_0x17e47d&&a50_0x22e97c(Text,{'color':_0x2e86d0(0x1e2),'children':['\x20←\x20',_0x17e47d]})]}),!_0x17e47d&&!_0x5c0a81&&a50_0x278143(Box,{'children':a50_0x278143(Text,{'color':'gray','children':_0x2e86d0(0x1d6)})})]});if(_0x5c1663)return a50_0x22e97c(Box,{'flexDirection':'column','children':[a50_0x278143(Text,{'color':'green','children':_0x2e86d0(0x1f7)}),a50_0x22e97c(Text,{'color':_0x2e86d0(0x1f3),'children':[_0x2e86d0(0x1ef),_0x25f684]}),a50_0x278143(Text,{'children':_0x2e86d0(0x1dc)})]});return a50_0x278143(Box,{'children':a50_0x278143(Text,{'children':'正在初始化配置文件...'})});}
|