@lovrabet/cli 1.1.16 → 1.1.18
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 -0
- 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/valid-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/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
- package/lib/api/fetch-datasets.js +0 -1
- package/lib/api/format-dataset.js +0 -1
- package/lib/api/pull.js +0 -1
- package/lib/api/types.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a33_0x229a(_0x565b12,_0x26680c){const _0xa9626a=a33_0xa962();return a33_0x229a=function(_0x229a32,_0x2fc194){_0x229a32=_0x229a32-0x120;let _0x243b45=_0xa9626a[_0x229a32];return _0x243b45;},a33_0x229a(_0x565b12,_0x26680c);}(function(_0x2da5b0,_0x5f0d77){const _0x352ff4=a33_0x229a,_0x426362=_0x2da5b0();while(!![]){try{const _0x3b2cfd=-parseInt(_0x352ff4(0x129))/0x1+-parseInt(_0x352ff4(0x126))/0x2*(parseInt(_0x352ff4(0x124))/0x3)+parseInt(_0x352ff4(0x123))/0x4*(-parseInt(_0x352ff4(0x120))/0x5)+parseInt(_0x352ff4(0x12a))/0x6+parseInt(_0x352ff4(0x121))/0x7+parseInt(_0x352ff4(0x12b))/0x8*(parseInt(_0x352ff4(0x127))/0x9)+parseInt(_0x352ff4(0x122))/0xa;if(_0x3b2cfd===_0x5f0d77)break;else _0x426362['push'](_0x426362['shift']());}catch(_0x10f8b4){_0x426362['push'](_0x426362['shift']());}}}(a33_0xa962,0xd5b5f));export function formatElapsed(_0x1ddcc6){const _0x54b7c2=a33_0x229a,_0x36f7be=Date[_0x54b7c2(0x125)]()-_0x1ddcc6;if(_0x36f7be<0x3e8)return _0x36f7be+'ms';const _0x23afb8=(_0x36f7be/0x3e8)[_0x54b7c2(0x128)](0x2),_0x2dacc1=_0x23afb8['replace'](/\.?0+$/u,'');return _0x2dacc1+'s';}function a33_0xa962(){const _0x15f770=['6092708TrUZeG','3fHWSuS','now','293270JyrwGV','576HqDYxE','toFixed','1671561dVikFt','5499036bsfLMc','216992DqggoK','5rGootz','4586757ZXMxjx','9090390eoQpki'];a33_0xa962=function(){return _0x15f770;};return a33_0xa962();}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x105227,_0xf0d73a){const _0x259226=a37_0x2529,_0x21f0f2=_0x105227();while(!![]){try{const _0x59a25e=parseInt(_0x259226(0xe2))/0x1*(-parseInt(_0x259226(0xcd))/0x2)+parseInt(_0x259226(0xab))/0x3+-parseInt(_0x259226(0xdf))/0x4+parseInt(_0x259226(0xba))/0x5*(-parseInt(_0x259226(0xc5))/0x6)+parseInt(_0x259226(0x8e))/0x7*(-parseInt(_0x259226(0xd4))/0x8)+-parseInt(_0x259226(0x93))/0x9*(parseInt(_0x259226(0xb3))/0xa)+parseInt(_0x259226(0xa8))/0xb;if(_0x59a25e===_0xf0d73a)break;else _0x21f0f2['push'](_0x21f0f2['shift']());}catch(_0xf76ed1){_0x21f0f2['push'](_0x21f0f2['shift']());}}}(a37_0x1183,0x2f00d));import{jsx as a37_0x50d33a,Fragment as a37_0x3fa600,jsxs as a37_0x2f01a1}from'react/jsx-runtime';import a37_0x38879e from'node:path';import a37_0x3c9ba1 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';function a37_0x2529(_0x33210b,_0x462e2b){const _0x1183e2=a37_0x1183();return a37_0x2529=function(_0x252956,_0x3f984a){_0x252956=_0x252956-0x86;let _0x51caed=_0x1183e2[_0x252956];return _0x51caed;},a37_0x2529(_0x33210b,_0x462e2b);}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';function a37_0x1183(){const _0x33a62d=['cd\x20','🎉\x20项目创建成功!','accessSync','gray','5595GStHFq','\x20√\x20','env','API\x20配置拉取异常:\x20','white','green','cyan','×\x20项目名过长,最多支持\x20100\x20个字符','2.\x20','repeat','项目创建失败:\x20','18PRERiC','projectName','info','×\x20项目名不能为空','setLogPath','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','warn','×\x20无法在当前目录创建项目,请检查目录权限','8RqNGmE','trim','existsSync','W_OK','启动项目:\x20','message','📦\x20API配置:\x20','24wTrPPe','test','项目名称:\x20','开始创建项目:\x20','1.\x20','rmSync','utf8','1.0.0','log','url','join','503624hYGDAN','拉取API配置:\x20','.lovrabetrc','101AzfhcJ','*\x20清理失败的项目目录:\x20','📁\x20项目名称:\x20','error','API\x20配置拉取成功:\x20','doTask','配置AppCode:\x20','resolve','×\x20项目目录\x20','18935mGmOnT','🚀\x20接下来可以:','配置应用AppCode失败:\x20','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','cwd','522cWCFlb','√\x20API\x20配置拉取完成','*\x20正在为项目\x20','package.json','\x20创建配置文件','online','×\x20项目创建失败:\x20','appCode','\x20|\x20应用AppCode:\x20','column','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','constants','create','\x20&&\x20lovrabet\x20start','√\x20配置文件已创建,应用AppCode:\x20','readFileSync','pullApi','\x20已存在,请使用其他项目名','../..','配置应用AppCode:\x20','toLocaleString','2444178GlUvne','writeFileSync','项目创建完成:\x20','1089057JQsinn','yellow','lovrabet\x20config\x20set\x20appcode\x20[app-code]','projectCode','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','stringify','dirname','3.\x20','43950iQaioJ','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','string'];a37_0x1183=function(){return _0x33a62d;};return a37_0x1183();}export function CreateApp(_0x451c2e){const _0x2b7514=a37_0x2529,[_0x2239e4,_0x171dff]=useState(![]),[_0x19193b,_0x3cb7ef]=useState(![]),[_0x33e0aa,_0x2a9f5e]=useState(null),_0x161021=useCopyProjectTemplate(),_0x43a433=useInstallDependencies(),_0xa4b0b1=useFormatCode(),_0x386964=async _0x37ab93=>{const _0x4e5585=a37_0x2529;if(!_0x37ab93[_0x4e5585(0xc6)]||_0x37ab93[_0x4e5585(0xc6)][_0x4e5585(0xce)]()===''){console[_0x4e5585(0x88)](_0x4e5585(0xc8));return;}const _0x85036a=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x85036a[_0x4e5585(0xd5)](_0x37ab93['projectName'])){console[_0x4e5585(0x88)](_0x4e5585(0x91));return;}if(_0x37ab93[_0x4e5585(0xc6)]['length']>0x64){console[_0x4e5585(0x88)](_0x4e5585(0xc1));return;}const _0x3e30e7=a37_0x38879e[_0x4e5585(0x8c)](process[_0x4e5585(0x92)](),_0x37ab93[_0x4e5585(0xc6)]);if(a37_0x3c9ba1[_0x4e5585(0xcf)](_0x3e30e7)){console[_0x4e5585(0x88)](_0x4e5585(0x8d)+_0x37ab93['projectName']+_0x4e5585(0xa4));return;}try{const _0x15a667=a37_0x38879e[_0x4e5585(0xb1)](_0x3e30e7);a37_0x3c9ba1[_0x4e5585(0xb8)](_0x15a667,a37_0x3c9ba1[_0x4e5585(0x9e)][_0x4e5585(0xd0)]);}catch(_0x597066){console[_0x4e5585(0x88)](_0x4e5585(0xcc));return;}_0x2a9f5e(_0x37ab93),_0x171dff(!![]),logger[_0x4e5585(0xc9)](_0x3e30e7),logger[_0x4e5585(0xc7)](_0x4e5585(0x9f),_0x4e5585(0xd7)+_0x37ab93[_0x4e5585(0xc6)],{'projectDir':_0x3e30e7,'appCode':_0x37ab93['appCode']});try{await _0x161021[_0x4e5585(0x8a)](_0x37ab93['projectName']),await _0x43a433[_0x4e5585(0x8a)](_0x37ab93[_0x4e5585(0xc6)]),await _0xa4b0b1[_0x4e5585(0x8a)](_0x37ab93[_0x4e5585(0xc6)]),await _0x40fe4f(_0x37ab93[_0x4e5585(0xc6)],_0x37ab93[_0x4e5585(0x9a)]||'',_0x37ab93[_0x4e5585(0xbc)]);if(_0x37ab93['pullApi']&&_0x37ab93[_0x4e5585(0x9a)]){console[_0x4e5585(0xdc)]('*\x20正在拉取\x20API\x20配置...');try{const _0x3d6b1a=await pullApiSilent(_0x37ab93[_0x4e5585(0x9a)],undefined,_0x3e30e7,_0x37ab93[_0x4e5585(0xbc)]);_0x3d6b1a?(console['log'](_0x4e5585(0x94)),logger[_0x4e5585(0xc7)](_0x4e5585(0x9f),_0x4e5585(0x89)+_0x37ab93[_0x4e5585(0x9a)],{'projectDir':_0x3e30e7,'appCode':_0x37ab93['appCode'],'env':_0x37ab93['env']})):(console['log'](_0x4e5585(0xb4)),logger[_0x4e5585(0xcb)](_0x4e5585(0x9f),'API\x20配置拉取失败:\x20'+_0x37ab93['appCode'],{'projectDir':_0x3e30e7,'appCode':_0x37ab93['appCode'],'env':_0x37ab93['env']}));}catch(_0x3f642c){console['log'](_0x4e5585(0xaf)),logger['warn'](_0x4e5585(0x9f),_0x4e5585(0xbd)+_0x37ab93[_0x4e5585(0x9a)],{'projectDir':_0x3e30e7,'appCode':_0x37ab93[_0x4e5585(0x9a)],'env':_0x37ab93['env'],'error':_0x3f642c instanceof Error?_0x3f642c['message']:String(_0x3f642c)});}}logger['success'](_0x4e5585(0x9f),_0x4e5585(0xaa)+_0x37ab93[_0x4e5585(0xc6)]),_0x3cb7ef(!![]),_0x171dff(![]);}catch(_0x454e84){logger[_0x4e5585(0x88)](_0x4e5585(0x9f),_0x4e5585(0xc4)+_0x37ab93['projectName'],{'error':_0x454e84 instanceof Error?_0x454e84[_0x4e5585(0xd2)]:String(_0x454e84)});try{a37_0x3c9ba1[_0x4e5585(0xcf)](_0x3e30e7)&&(console[_0x4e5585(0xdc)](_0x4e5585(0x86)+_0x3e30e7),a37_0x3c9ba1[_0x4e5585(0xd9)](_0x3e30e7,{'recursive':!![],'force':!![]}));}catch(_0x42aa43){logger[_0x4e5585(0xcb)]('create','清理项目目录失败:\x20'+_0x3e30e7,{'error':_0x42aa43 instanceof Error?_0x42aa43[_0x4e5585(0xd2)]:String(_0x42aa43)});}_0x171dff(![]),console[_0x4e5585(0x88)](_0x4e5585(0x99)+(_0x454e84 instanceof Error?_0x454e84[_0x4e5585(0xd2)]:String(_0x454e84)));}},_0xd1fa38=async _0x157755=>{const _0x30df4f=a37_0x2529;await _0x386964({'projectName':_0x157755,'env':_0x451c2e[_0x30df4f(0xbc)]});},_0x40fe4f=async(_0x433030,_0x51a189,_0x5f574d)=>{const _0x56c263=a37_0x2529,_0x2534ed=a37_0x38879e['resolve'](process[_0x56c263(0x92)](),_0x433030),_0x335d94=a37_0x38879e[_0x56c263(0xde)](_0x2534ed,_0x56c263(0xe1));try{_0x51a189?console['log'](_0x56c263(0x95)+_0x433030+'\x20配置应用AppCode:\x20'+_0x51a189):console[_0x56c263(0xdc)](_0x56c263(0x95)+_0x433030+_0x56c263(0x97));console[_0x56c263(0xdc)]('*\x20配置文件路径:\x20'+_0x335d94);const _0x286f78=fileURLToPath(import.meta[_0x56c263(0xdd)]),_0x41051e=a37_0x38879e[_0x56c263(0x8c)](a37_0x38879e[_0x56c263(0xb1)](_0x286f78),_0x56c263(0xa5)),_0x20ba4e=a37_0x38879e[_0x56c263(0xde)](_0x41051e,_0x56c263(0x96));let _0x4ebfbd=_0x56c263(0xdb);try{const _0xcbbd53=JSON['parse'](a37_0x3c9ba1[_0x56c263(0xa2)](_0x20ba4e,_0x56c263(0xda)));_0x4ebfbd=_0xcbbd53['version']||_0x56c263(0xdb);}catch(_0x2df813){}const _0x56a450=readConfig(),_0x35086d=typeof _0x56a450[_0x56c263(0xbc)]===_0x56c263(0xb5)?_0x56a450[_0x56c263(0xbc)]:undefined,{app:_0x51485c,appcode:_0x4ef928,..._0x4081b5}=_0x56a450,_0x4ea95e={..._0x4081b5,'appcode':_0x51a189||'','env':_0x5f574d||_0x35086d||_0x56c263(0x98),'createdAt':new Date()[_0x56c263(0xa7)](),'version':_0x4ebfbd};a37_0x3c9ba1[_0x56c263(0xa9)](_0x335d94,JSON[_0x56c263(0xb0)](_0x4ea95e,null,0x2),_0x56c263(0xda)),_0x51a189?console['log'](_0x56c263(0xa1)+_0x51a189):console[_0x56c263(0xdc)](_0x56c263(0x9d)),logger[_0x56c263(0xc7)](_0x56c263(0x9f),_0x56c263(0xa6)+_0x51a189,{'projectName':_0x433030,'configFile':_0x56c263(0xe1)});}catch(_0x1e37dd){logger[_0x56c263(0x88)](_0x56c263(0x9f),_0x56c263(0x90)+_0x51a189,{'projectName':_0x433030,'error':_0x1e37dd instanceof Error?_0x1e37dd[_0x56c263(0xd2)]:String(_0x1e37dd)});}};useEffect(()=>{const _0x14dde3=a37_0x2529;_0x451c2e[_0x14dde3(0xae)]&&_0xd1fa38(_0x451c2e[_0x14dde3(0xae)]);},[_0x451c2e[_0x2b7514(0xae)]]);if(!_0x2239e4&&!_0x19193b&&!_0x451c2e[_0x2b7514(0xae)])return a37_0x50d33a(EnhancedGuidedCreate,{'onCreate':_0x386964,'env':_0x451c2e['env']});if(_0x2239e4)return a37_0x2f01a1(a37_0x3fa600,{'children':[a37_0x2f01a1(Box,{'marginTop':0x1,'children':[a37_0x50d33a(Box,{'width':'1'}),a37_0x50d33a(Text,{'color':'green','children':_0x2b7514(0xbb)}),a37_0x50d33a(Text,{'children':_0x2b7514(0xd6)}),a37_0x50d33a(Text,{'color':_0x2b7514(0xbf),'children':_0x33e0aa?.['projectName']}),_0x33e0aa?.[_0x2b7514(0x9a)]&&a37_0x2f01a1(a37_0x3fa600,{'children':[a37_0x50d33a(Text,{'children':_0x2b7514(0x9b)}),a37_0x50d33a(Text,{'color':_0x2b7514(0xc0),'children':_0x33e0aa[_0x2b7514(0x9a)]})]})]}),a37_0x50d33a(TaskRunning,{..._0x161021}),a37_0x50d33a(TaskRunning,{..._0x43a433}),a37_0x50d33a(TaskRunning,{..._0xa4b0b1})]});if(_0x19193b)return a37_0x2f01a1(a37_0x3fa600,{'children':[a37_0x2f01a1(Box,{'marginTop':0x1,'children':[a37_0x50d33a(Box,{'width':'1'}),a37_0x50d33a(Text,{'color':_0x2b7514(0xbf),'children':_0x2b7514(0xbb)}),a37_0x50d33a(Text,{'children':'项目名称:\x20'}),a37_0x50d33a(Text,{'color':_0x2b7514(0xbf),'children':_0x33e0aa?.['projectName']}),_0x33e0aa?.['appCode']&&a37_0x2f01a1(a37_0x3fa600,{'children':[a37_0x50d33a(Text,{'children':'\x20|\x20应用AppCode:\x20'}),a37_0x50d33a(Text,{'color':_0x2b7514(0xc0),'children':_0x33e0aa[_0x2b7514(0x9a)]})]})]}),a37_0x50d33a(TaskFinished,{..._0x161021}),a37_0x50d33a(TaskFinished,{..._0x43a433}),a37_0x50d33a(TaskFinished,{..._0xa4b0b1}),a37_0x50d33a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a37_0x50d33a(Text,{'color':_0x2b7514(0xbf),'children':'─'['repeat'](0x3c)})}),a37_0x50d33a(Box,{'children':a37_0x50d33a(Text,{'color':_0x2b7514(0xbf),'bold':!![],'children':_0x2b7514(0xb7)})}),a37_0x2f01a1(Box,{'marginTop':0x1,'flexDirection':_0x2b7514(0x9c),'children':[a37_0x2f01a1(Box,{'children':[a37_0x50d33a(Text,{'color':_0x2b7514(0xc0),'children':_0x2b7514(0x87)}),a37_0x50d33a(Text,{'color':'white','bold':!![],'children':_0x33e0aa?.[_0x2b7514(0xc6)]})]}),_0x33e0aa?.[_0x2b7514(0x9a)]&&a37_0x2f01a1(Box,{'children':[a37_0x50d33a(Text,{'color':_0x2b7514(0xc0),'children':'🔗\x20应用AppCode:\x20'}),a37_0x50d33a(Text,{'color':_0x2b7514(0xbe),'bold':!![],'children':_0x33e0aa[_0x2b7514(0x9a)]})]}),a37_0x2f01a1(Box,{'children':[a37_0x50d33a(Text,{'color':_0x2b7514(0xc0),'children':_0x2b7514(0xd3)}),_0x33e0aa?.[_0x2b7514(0xa3)]?a37_0x50d33a(Text,{'color':_0x2b7514(0xbf),'bold':!![],'children':'已自动拉取\x20✓'}):_0x33e0aa?.[_0x2b7514(0x9a)]?a37_0x50d33a(Text,{'color':_0x2b7514(0xac),'bold':!![],'children':'需手动拉取'}):a37_0x50d33a(Text,{'color':_0x2b7514(0xb9),'bold':!![],'children':'未配置'})]})]}),a37_0x50d33a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a37_0x50d33a(Text,{'color':'cyan','bold':!![],'children':_0x2b7514(0x8f)})}),a37_0x2f01a1(Box,{'marginLeft':0x2,'flexDirection':_0x2b7514(0x9c),'children':[a37_0x2f01a1(Box,{'children':[a37_0x50d33a(Text,{'color':_0x2b7514(0xbf),'children':_0x2b7514(0xd8)}),a37_0x50d33a(Text,{'color':_0x2b7514(0xbe),'children':_0x2b7514(0xd1)}),a37_0x50d33a(Text,{'color':_0x2b7514(0xc0),'bold':!![],'children':_0x2b7514(0xb6)+_0x33e0aa?.[_0x2b7514(0xc6)]+_0x2b7514(0xa0)})]}),_0x33e0aa?.[_0x2b7514(0x9a)]&&!_0x33e0aa?.['pullApi']&&a37_0x2f01a1(Box,{'children':[a37_0x50d33a(Text,{'color':_0x2b7514(0xac),'children':_0x2b7514(0xc2)}),a37_0x50d33a(Text,{'color':_0x2b7514(0xbe),'children':'拉取API配置:\x20'}),a37_0x50d33a(Text,{'color':_0x2b7514(0xc0),'bold':!![],'children':'lovrabet\x20api\x20pull'})]}),!_0x33e0aa?.[_0x2b7514(0x9a)]&&a37_0x2f01a1(a37_0x3fa600,{'children':[a37_0x2f01a1(Box,{'children':[a37_0x50d33a(Text,{'color':_0x2b7514(0xb9),'children':_0x2b7514(0xc2)}),a37_0x50d33a(Text,{'color':_0x2b7514(0xbe),'children':_0x2b7514(0x8b)}),a37_0x50d33a(Text,{'color':_0x2b7514(0xc0),'bold':!![],'children':_0x2b7514(0xad)})]}),a37_0x2f01a1(Box,{'children':[a37_0x50d33a(Text,{'color':_0x2b7514(0xb9),'children':_0x2b7514(0xb2)}),a37_0x50d33a(Text,{'color':_0x2b7514(0xbe),'children':_0x2b7514(0xe0)}),a37_0x50d33a(Text,{'color':'cyan','bold':!![],'children':_0x2b7514(0xca)})]})]})]}),a37_0x50d33a(Box,{'marginTop':0x1,'children':a37_0x50d33a(Text,{'color':_0x2b7514(0xbf),'children':'─'[_0x2b7514(0xc3)](0x3c)})})]});return null;}
|
|
1
|
+
(function(_0x15fae1,_0x3f66d4){const _0x58693e=a34_0x115f,_0x36fffc=_0x15fae1();while(!![]){try{const _0x14bc74=parseInt(_0x58693e(0x226))/0x1*(parseInt(_0x58693e(0x219))/0x2)+-parseInt(_0x58693e(0x200))/0x3+parseInt(_0x58693e(0x208))/0x4+-parseInt(_0x58693e(0x1e3))/0x5+-parseInt(_0x58693e(0x1d4))/0x6*(parseInt(_0x58693e(0x1d5))/0x7)+parseInt(_0x58693e(0x21d))/0x8+parseInt(_0x58693e(0x1f6))/0x9;if(_0x14bc74===_0x3f66d4)break;else _0x36fffc['push'](_0x36fffc['shift']());}catch(_0x2d69ac){_0x36fffc['push'](_0x36fffc['shift']());}}}(a34_0x5c37,0x4691c));import{jsx as a34_0x2ee855,Fragment as a34_0x3b0b86,jsxs as a34_0x2cbdf5}from'react/jsx-runtime';import a34_0x336958 from'node:path';import a34_0x4d2939 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';function a34_0x5c37(){const _0x4c38cb=['lovrabet\x20api\x20pull','white','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','×\x20无法在当前目录创建项目,请检查目录权限','online','×\x20项目创建失败:\x20','×\x20项目目录\x20','cd\x20','\x20&&\x20lovrabet\x20start','env','warn','🚀\x20接下来可以:','3829977abMMyp','开始创建项目:\x20','existsSync','📁\x20项目名称:\x20','resolve','启动项目:\x20','gray','../..','\x20|\x20应用AppCode:\x20','1.\x20','545601JPMCaW','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','未配置','项目创建失败:\x20','stringify','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','已自动拉取\x20✓','3.\x20','2143080HfIcoy','success','×\x20项目名过长,最多支持\x20100\x20个字符','pullApi','cyan','version','green','🎉\x20项目创建成功!','doTask','√\x20API\x20配置拉取完成','trim','清理项目目录失败:\x20','API\x20配置拉取失败:\x20','📦\x20API配置:\x20','*\x20正在拉取\x20API\x20配置...','projectCode','log','10dSHoAy','配置AppCode:\x20','repeat','配置应用AppCode失败:\x20','1642312Jhcfxa','yellow','url','string','rmSync','info','test','appCode','API\x20配置拉取成功:\x20','48940QVZUpr','message','*\x20正在为项目\x20','\x20√\x20','constants','16158AoskiV','966TjSbwM','1.0.0','拉取API配置:\x20','utf8','×\x20项目名不能为空','create','\x20配置应用AppCode:\x20','API\x20配置拉取异常:\x20','\x20已存在,请使用其他项目名','join','项目名称:\x20','parse','cwd','projectName','2843795LFFhuU','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','error','setLogPath','column','2.\x20','*\x20配置文件路径:\x20'];a34_0x5c37=function(){return _0x4c38cb;};return a34_0x5c37();}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';function a34_0x115f(_0x2f5f75,_0x268802){const _0x5c37cb=a34_0x5c37();return a34_0x115f=function(_0x115f9f,_0x2e21df){_0x115f9f=_0x115f9f-0x1d0;let _0x3f625b=_0x5c37cb[_0x115f9f];return _0x3f625b;},a34_0x115f(_0x2f5f75,_0x268802);}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(_0x126ba0){const _0x34ae26=a34_0x115f,[_0x3cd3be,_0x2d757f]=useState(![]),[_0x3e819d,_0x3278c1]=useState(![]),[_0xb2037a,_0x253f92]=useState(null),_0x3c7416=useCopyProjectTemplate(),_0x3f7b76=useInstallDependencies(),_0x2d652a=useFormatCode(),_0x53f342=async _0x294b92=>{const _0x1c4233=a34_0x115f;if(!_0x294b92[_0x1c4233(0x1e2)]||_0x294b92['projectName'][_0x1c4233(0x212)]()===''){console['error'](_0x1c4233(0x1d9));return;}const _0x1bf33a=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1bf33a[_0x1c4233(0x223)](_0x294b92[_0x1c4233(0x1e2)])){console[_0x1c4233(0x1e5)](_0x1c4233(0x1e4));return;}if(_0x294b92[_0x1c4233(0x1e2)]['length']>0x64){console[_0x1c4233(0x1e5)](_0x1c4233(0x20a));return;}const _0x5a0eb9=a34_0x336958[_0x1c4233(0x1fa)](process[_0x1c4233(0x1e1)](),_0x294b92[_0x1c4233(0x1e2)]);if(a34_0x4d2939[_0x1c4233(0x1f8)](_0x5a0eb9)){console[_0x1c4233(0x1e5)](_0x1c4233(0x1f0)+_0x294b92['projectName']+_0x1c4233(0x1dd));return;}try{const _0x38a18c=a34_0x336958['dirname'](_0x5a0eb9);a34_0x4d2939['accessSync'](_0x38a18c,a34_0x4d2939[_0x1c4233(0x1d3)]['W_OK']);}catch(_0x48a62f){console[_0x1c4233(0x1e5)](_0x1c4233(0x1ed));return;}_0x253f92(_0x294b92),_0x2d757f(!![]),logger[_0x1c4233(0x1e6)](_0x5a0eb9),logger[_0x1c4233(0x222)]('create',_0x1c4233(0x1f7)+_0x294b92[_0x1c4233(0x1e2)],{'projectDir':_0x5a0eb9,'appCode':_0x294b92['appCode']});try{await _0x3c7416[_0x1c4233(0x210)](_0x294b92[_0x1c4233(0x1e2)]),await _0x3f7b76[_0x1c4233(0x210)](_0x294b92[_0x1c4233(0x1e2)]),await _0x2d652a[_0x1c4233(0x210)](_0x294b92['projectName']),await _0x3cecb9(_0x294b92[_0x1c4233(0x1e2)],_0x294b92[_0x1c4233(0x224)]||'',_0x294b92[_0x1c4233(0x1f3)]);if(_0x294b92[_0x1c4233(0x20b)]&&_0x294b92[_0x1c4233(0x224)]){console[_0x1c4233(0x218)](_0x1c4233(0x216));try{const _0x1136f4=await pullApiSilent(_0x294b92[_0x1c4233(0x224)],undefined,_0x5a0eb9,_0x294b92['env']);_0x1136f4?(console['log'](_0x1c4233(0x211)),logger[_0x1c4233(0x222)]('create',_0x1c4233(0x225)+_0x294b92['appCode'],{'projectDir':_0x5a0eb9,'appCode':_0x294b92[_0x1c4233(0x224)],'env':_0x294b92[_0x1c4233(0x1f3)]})):(console[_0x1c4233(0x218)](_0x1c4233(0x201)),logger['warn'](_0x1c4233(0x1da),_0x1c4233(0x214)+_0x294b92['appCode'],{'projectDir':_0x5a0eb9,'appCode':_0x294b92[_0x1c4233(0x224)],'env':_0x294b92[_0x1c4233(0x1f3)]}));}catch(_0x53cd74){console[_0x1c4233(0x218)]('!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x1c4233(0x1f4)](_0x1c4233(0x1da),_0x1c4233(0x1dc)+_0x294b92[_0x1c4233(0x224)],{'projectDir':_0x5a0eb9,'appCode':_0x294b92[_0x1c4233(0x224)],'env':_0x294b92[_0x1c4233(0x1f3)],'error':_0x53cd74 instanceof Error?_0x53cd74[_0x1c4233(0x1d0)]:String(_0x53cd74)});}}logger[_0x1c4233(0x209)](_0x1c4233(0x1da),'项目创建完成:\x20'+_0x294b92['projectName']),_0x3278c1(!![]),_0x2d757f(![]);}catch(_0x512825){logger['error']('create',_0x1c4233(0x203)+_0x294b92[_0x1c4233(0x1e2)],{'error':_0x512825 instanceof Error?_0x512825[_0x1c4233(0x1d0)]:String(_0x512825)});try{a34_0x4d2939[_0x1c4233(0x1f8)](_0x5a0eb9)&&(console[_0x1c4233(0x218)]('*\x20清理失败的项目目录:\x20'+_0x5a0eb9),a34_0x4d2939[_0x1c4233(0x221)](_0x5a0eb9,{'recursive':!![],'force':!![]}));}catch(_0x2be429){logger['warn'](_0x1c4233(0x1da),_0x1c4233(0x213)+_0x5a0eb9,{'error':_0x2be429 instanceof Error?_0x2be429[_0x1c4233(0x1d0)]:String(_0x2be429)});}_0x2d757f(![]),console[_0x1c4233(0x1e5)](_0x1c4233(0x1ef)+(_0x512825 instanceof Error?_0x512825['message']:String(_0x512825)));}},_0x3ad63f=async _0x2f3c57=>{const _0x43a32a=a34_0x115f;await _0x53f342({'projectName':_0x2f3c57,'env':_0x126ba0[_0x43a32a(0x1f3)]});},_0x3cecb9=async(_0x224747,_0x88e62a,_0x4e4bb3)=>{const _0x4d3047=a34_0x115f,_0x126259=a34_0x336958[_0x4d3047(0x1fa)](process[_0x4d3047(0x1e1)](),_0x224747),_0x5e9464=a34_0x336958[_0x4d3047(0x1de)](_0x126259,'.lovrabetrc');try{_0x88e62a?console['log'](_0x4d3047(0x1d1)+_0x224747+_0x4d3047(0x1db)+_0x88e62a):console[_0x4d3047(0x218)]('*\x20正在为项目\x20'+_0x224747+'\x20创建配置文件');console['log'](_0x4d3047(0x1e9)+_0x5e9464);const _0x591ce8=fileURLToPath(import.meta[_0x4d3047(0x21f)]),_0x3085ef=a34_0x336958[_0x4d3047(0x1fa)](a34_0x336958['dirname'](_0x591ce8),_0x4d3047(0x1fd)),_0x2daa9c=a34_0x336958[_0x4d3047(0x1de)](_0x3085ef,'package.json');let _0x567405='1.0.0';try{const _0x10ba70=JSON[_0x4d3047(0x1e0)](a34_0x4d2939['readFileSync'](_0x2daa9c,_0x4d3047(0x1d8)));_0x567405=_0x10ba70[_0x4d3047(0x20d)]||_0x4d3047(0x1d6);}catch(_0x400d30){}const _0x5a0752=readConfig(),_0x201750=typeof _0x5a0752['env']===_0x4d3047(0x220)?_0x5a0752[_0x4d3047(0x1f3)]:undefined,{app:_0x2035ea,appcode:_0x5e4bca,..._0x4705b1}=_0x5a0752,_0x523d34={..._0x4705b1,'appcode':_0x88e62a||'','env':_0x4e4bb3||_0x201750||_0x4d3047(0x1ee),'createdAt':new Date()['toLocaleString'](),'version':_0x567405};a34_0x4d2939['writeFileSync'](_0x5e9464,JSON[_0x4d3047(0x204)](_0x523d34,null,0x2),_0x4d3047(0x1d8)),_0x88e62a?console[_0x4d3047(0x218)]('√\x20配置文件已创建,应用AppCode:\x20'+_0x88e62a):console[_0x4d3047(0x218)](_0x4d3047(0x1ec)),logger['info'](_0x4d3047(0x1da),'配置应用AppCode:\x20'+_0x88e62a,{'projectName':_0x224747,'configFile':'.lovrabetrc'});}catch(_0x155ca4){logger[_0x4d3047(0x1e5)](_0x4d3047(0x1da),_0x4d3047(0x21c)+_0x88e62a,{'projectName':_0x224747,'error':_0x155ca4 instanceof Error?_0x155ca4[_0x4d3047(0x1d0)]:String(_0x155ca4)});}};useEffect(()=>{const _0x154df4=a34_0x115f;_0x126ba0[_0x154df4(0x217)]&&_0x3ad63f(_0x126ba0['projectCode']);},[_0x126ba0['projectCode']]);if(!_0x3cd3be&&!_0x3e819d&&!_0x126ba0['projectCode'])return a34_0x2ee855(EnhancedGuidedCreate,{'onCreate':_0x53f342,'env':_0x126ba0['env']});if(_0x3cd3be)return a34_0x2cbdf5(a34_0x3b0b86,{'children':[a34_0x2cbdf5(Box,{'marginTop':0x1,'children':[a34_0x2ee855(Box,{'width':'1'}),a34_0x2ee855(Text,{'color':_0x34ae26(0x20e),'children':_0x34ae26(0x1d2)}),a34_0x2ee855(Text,{'children':_0x34ae26(0x1df)}),a34_0x2ee855(Text,{'color':'green','children':_0xb2037a?.[_0x34ae26(0x1e2)]}),_0xb2037a?.['appCode']&&a34_0x2cbdf5(a34_0x3b0b86,{'children':[a34_0x2ee855(Text,{'children':_0x34ae26(0x1fe)}),a34_0x2ee855(Text,{'color':_0x34ae26(0x20c),'children':_0xb2037a[_0x34ae26(0x224)]})]})]}),a34_0x2ee855(TaskRunning,{..._0x3c7416}),a34_0x2ee855(TaskRunning,{..._0x3f7b76}),a34_0x2ee855(TaskRunning,{..._0x2d652a})]});if(_0x3e819d)return a34_0x2cbdf5(a34_0x3b0b86,{'children':[a34_0x2cbdf5(Box,{'marginTop':0x1,'children':[a34_0x2ee855(Box,{'width':'1'}),a34_0x2ee855(Text,{'color':_0x34ae26(0x20e),'children':_0x34ae26(0x1d2)}),a34_0x2ee855(Text,{'children':'项目名称:\x20'}),a34_0x2ee855(Text,{'color':'green','children':_0xb2037a?.[_0x34ae26(0x1e2)]}),_0xb2037a?.['appCode']&&a34_0x2cbdf5(a34_0x3b0b86,{'children':[a34_0x2ee855(Text,{'children':_0x34ae26(0x1fe)}),a34_0x2ee855(Text,{'color':_0x34ae26(0x20c),'children':_0xb2037a['appCode']})]})]}),a34_0x2ee855(TaskFinished,{..._0x3c7416}),a34_0x2ee855(TaskFinished,{..._0x3f7b76}),a34_0x2ee855(TaskFinished,{..._0x2d652a}),a34_0x2ee855(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x2ee855(Text,{'color':_0x34ae26(0x20e),'children':'─'[_0x34ae26(0x21b)](0x3c)})}),a34_0x2ee855(Box,{'children':a34_0x2ee855(Text,{'color':_0x34ae26(0x20e),'bold':!![],'children':_0x34ae26(0x20f)})}),a34_0x2cbdf5(Box,{'marginTop':0x1,'flexDirection':_0x34ae26(0x1e7),'children':[a34_0x2cbdf5(Box,{'children':[a34_0x2ee855(Text,{'color':_0x34ae26(0x20c),'children':_0x34ae26(0x1f9)}),a34_0x2ee855(Text,{'color':_0x34ae26(0x1eb),'bold':!![],'children':_0xb2037a?.[_0x34ae26(0x1e2)]})]}),_0xb2037a?.[_0x34ae26(0x224)]&&a34_0x2cbdf5(Box,{'children':[a34_0x2ee855(Text,{'color':'cyan','children':'🔗\x20应用AppCode:\x20'}),a34_0x2ee855(Text,{'color':_0x34ae26(0x1eb),'bold':!![],'children':_0xb2037a[_0x34ae26(0x224)]})]}),a34_0x2cbdf5(Box,{'children':[a34_0x2ee855(Text,{'color':_0x34ae26(0x20c),'children':_0x34ae26(0x215)}),_0xb2037a?.['pullApi']?a34_0x2ee855(Text,{'color':_0x34ae26(0x20e),'bold':!![],'children':_0x34ae26(0x206)}):_0xb2037a?.[_0x34ae26(0x224)]?a34_0x2ee855(Text,{'color':_0x34ae26(0x21e),'bold':!![],'children':'需手动拉取'}):a34_0x2ee855(Text,{'color':_0x34ae26(0x1fc),'bold':!![],'children':_0x34ae26(0x202)})]})]}),a34_0x2ee855(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x2ee855(Text,{'color':'cyan','bold':!![],'children':_0x34ae26(0x1f5)})}),a34_0x2cbdf5(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a34_0x2cbdf5(Box,{'children':[a34_0x2ee855(Text,{'color':'green','children':_0x34ae26(0x1ff)}),a34_0x2ee855(Text,{'color':'white','children':_0x34ae26(0x1fb)}),a34_0x2ee855(Text,{'color':_0x34ae26(0x20c),'bold':!![],'children':_0x34ae26(0x1f1)+_0xb2037a?.['projectName']+_0x34ae26(0x1f2)})]}),_0xb2037a?.[_0x34ae26(0x224)]&&!_0xb2037a?.[_0x34ae26(0x20b)]&&a34_0x2cbdf5(Box,{'children':[a34_0x2ee855(Text,{'color':_0x34ae26(0x21e),'children':'2.\x20'}),a34_0x2ee855(Text,{'color':_0x34ae26(0x1eb),'children':'拉取API配置:\x20'}),a34_0x2ee855(Text,{'color':_0x34ae26(0x20c),'bold':!![],'children':_0x34ae26(0x1ea)})]}),!_0xb2037a?.[_0x34ae26(0x224)]&&a34_0x2cbdf5(a34_0x3b0b86,{'children':[a34_0x2cbdf5(Box,{'children':[a34_0x2ee855(Text,{'color':'gray','children':_0x34ae26(0x1e8)}),a34_0x2ee855(Text,{'color':_0x34ae26(0x1eb),'children':_0x34ae26(0x21a)}),a34_0x2ee855(Text,{'color':'cyan','bold':!![],'children':'lovrabet\x20config\x20set\x20appcode\x20[app-code]'})]}),a34_0x2cbdf5(Box,{'children':[a34_0x2ee855(Text,{'color':_0x34ae26(0x1fc),'children':_0x34ae26(0x207)}),a34_0x2ee855(Text,{'color':'white','children':_0x34ae26(0x1d7)}),a34_0x2ee855(Text,{'color':_0x34ae26(0x20c),'bold':!![],'children':_0x34ae26(0x205)})]})]})]}),a34_0x2ee855(Box,{'marginTop':0x1,'children':a34_0x2ee855(Text,{'color':_0x34ae26(0x20e),'children':'─'[_0x34ae26(0x21b)](0x3c)})})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a35_0x123e(_0x5206b4,_0x5b3004){var _0x1168e2=a35_0x1168();return a35_0x123e=function(_0x123e9b,_0x17d4ee){_0x123e9b=_0x123e9b-0x6e;var _0x2ed372=_0x1168e2[_0x123e9b];return _0x2ed372;},a35_0x123e(_0x5206b4,_0x5b3004);}(function(_0x21a5b5,_0x5edfd4){var _0x57825d=a35_0x123e,_0x561e3e=_0x21a5b5();while(!![]){try{var _0x32afd1=-parseInt(_0x57825d(0x74))/0x1*(-parseInt(_0x57825d(0x70))/0x2)+parseInt(_0x57825d(0x7a))/0x3+-parseInt(_0x57825d(0x6e))/0x4+parseInt(_0x57825d(0x71))/0x5*(-parseInt(_0x57825d(0x78))/0x6)+-parseInt(_0x57825d(0x6f))/0x7+parseInt(_0x57825d(0x73))/0x8*(parseInt(_0x57825d(0x77))/0x9)+parseInt(_0x57825d(0x75))/0xa*(-parseInt(_0x57825d(0x72))/0xb);if(_0x32afd1===_0x5edfd4)break;else _0x561e3e['push'](_0x561e3e['shift']());}catch(_0x4bd743){_0x561e3e['push'](_0x561e3e['shift']());}}}(a35_0x1168,0x997ed));import{jsx as a35_0x9c996b,jsxs as a35_0x42aeca}from'react/jsx-runtime';import{Box,Text}from'ink';function a35_0x1168(){var _0x58a3d7=['2713623hlMzeM','1806876yAzFRC','5326461SHERgy','319184eTJOcn','36335GyJEsN','868087cngstW','3444088Aipjim','7qKnaZq','50rvCMIL','green','18WwicZG','534tjzbEZ','elapsed'];a35_0x1168=function(){return _0x58a3d7;};return a35_0x1168();}import{TaskTime}from'./task-time.js';export function TaskFinished(_0xa7947c){var _0x29310e=a35_0x123e;return a35_0x42aeca(Box,{'children':[a35_0x9c996b(Box,{'width':'1'}),a35_0x9c996b(Text,{'color':_0x29310e(0x76),'children':'\x20√\x20'}),a35_0x9c996b(Text,{'children':_0xa7947c['taskName']}),a35_0x9c996b(TaskTime,{'elapsed':_0xa7947c[_0x29310e(0x79)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x269e95,_0x2a0862){var _0x279e87=a36_0x9947,_0x3626a5=_0x269e95();while(!![]){try{var _0x1825dc=parseInt(_0x279e87(0x151))/0x1*(-parseInt(_0x279e87(0x158))/0x2)+parseInt(_0x279e87(0x150))/0x3*(-parseInt(_0x279e87(0x15b))/0x4)+-parseInt(_0x279e87(0x157))/0x5*(parseInt(_0x279e87(0x152))/0x6)+parseInt(_0x279e87(0x14f))/0x7*(-parseInt(_0x279e87(0x14b))/0x8)+-parseInt(_0x279e87(0x14d))/0x9*(parseInt(_0x279e87(0x154))/0xa)+-parseInt(_0x279e87(0x14e))/0xb*(parseInt(_0x279e87(0x156))/0xc)+parseInt(_0x279e87(0x155))/0xd;if(_0x1825dc===_0x2a0862)break;else _0x3626a5['push'](_0x3626a5['shift']());}catch(_0x5bf4eb){_0x3626a5['push'](_0x3626a5['shift']());}}}(a36_0x497e,0xaab59));import{jsx as a36_0x210571,jsxs as a36_0x5b43ab}from'react/jsx-runtime';import{Text}from'ink';import a36_0x1288e0 from'ink-spinner';function a36_0x9947(_0x44c251,_0xfb8541){var _0x497ee7=a36_0x497e();return a36_0x9947=function(_0x99477b,_0x4b5a32){_0x99477b=_0x99477b-0x14b;var _0x104de5=_0x497ee7[_0x99477b];return _0x104de5;},a36_0x9947(_0x44c251,_0xfb8541);}export function TaskLoading(_0x10f7d0){var _0x175d68=a36_0x9947;if(_0x10f7d0['finished'])return a36_0x210571(Text,{'color':_0x175d68(0x153),'children':_0x175d68(0x159)});if(_0x10f7d0[_0x175d68(0x15a)])return a36_0x5b43ab(Text,{'color':_0x175d68(0x153),'children':['\x20',a36_0x210571(a36_0x1288e0,{'type':'dots'}),'\x20']});return a36_0x210571(Text,{'children':_0x175d68(0x14c)});}function a36_0x497e(){var _0x58e25c=['\x20\x20\x20','9RAPlIx','32593KySlZB','7kJQubL','1080267vjPeyX','3506duelQS','2583318MjaLGU','green','11834510HvOpSi','78060281QLXnJq','4644mSaOHC','10YoQDZr','258dPSMDc','\x20√\x20','loading','4DnxawX','10414488ZsJKAA'];a36_0x497e=function(){return _0x58e25c;};return a36_0x497e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a37_0x119c(_0x4ab995,_0x3a5b0c){var _0x3b216c=a37_0x3b21();return a37_0x119c=function(_0x119c66,_0x2da705){_0x119c66=_0x119c66-0x13c;var _0x5b618b=_0x3b216c[_0x119c66];return _0x5b618b;},a37_0x119c(_0x4ab995,_0x3a5b0c);}(function(_0x17e5cd,_0x1e66c5){var _0x49bb73=a37_0x119c,_0x315f89=_0x17e5cd();while(!![]){try{var _0x416e7a=parseInt(_0x49bb73(0x145))/0x1+-parseInt(_0x49bb73(0x13c))/0x2+parseInt(_0x49bb73(0x13f))/0x3*(parseInt(_0x49bb73(0x147))/0x4)+parseInt(_0x49bb73(0x13e))/0x5+parseInt(_0x49bb73(0x144))/0x6*(-parseInt(_0x49bb73(0x13d))/0x7)+parseInt(_0x49bb73(0x146))/0x8*(parseInt(_0x49bb73(0x142))/0x9)+-parseInt(_0x49bb73(0x143))/0xa;if(_0x416e7a===_0x1e66c5)break;else _0x315f89['push'](_0x315f89['shift']());}catch(_0x38e9a4){_0x315f89['push'](_0x315f89['shift']());}}}(a37_0x3b21,0xc65be));import{jsx as a37_0x443632,jsxs as a37_0x1e14a4}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';function a37_0x3b21(){var _0x207dc3=['1424CLkvcV','668JtgTsi','1905078nsPJKS','3896179FTufpt','708935hfpcQl','23133gzrfYM','elapsed','taskName','63171kKHSNz','5428590dcPNiC','6meXcJA','185567dayBnt'];a37_0x3b21=function(){return _0x207dc3;};return a37_0x3b21();}export function TaskRunning(_0x54a6a2){var _0x44696e=a37_0x119c;return a37_0x1e14a4(Box,{'children':[a37_0x443632(Box,{'width':'1'}),a37_0x443632(TaskLoading,{..._0x54a6a2}),a37_0x443632(Text,{'children':_0x54a6a2[_0x44696e(0x141)]}),a37_0x443632(TaskTime,{'elapsed':_0x54a6a2[_0x44696e(0x140)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a38_0x532d(_0xbb52,_0x5095d1){var _0x21ca55=a38_0x21ca();return a38_0x532d=function(_0x532dec,_0x560b){_0x532dec=_0x532dec-0xdd;var _0x223a56=_0x21ca55[_0x532dec];return _0x223a56;},a38_0x532d(_0xbb52,_0x5095d1);}(function(_0x5ca064,_0x2555b6){var _0x2ad836=a38_0x532d,_0x2fb148=_0x5ca064();while(!![]){try{var _0x2dd4a6=parseInt(_0x2ad836(0xe0))/0x1+-parseInt(_0x2ad836(0xe7))/0x2+-parseInt(_0x2ad836(0xe3))/0x3*(parseInt(_0x2ad836(0xe5))/0x4)+-parseInt(_0x2ad836(0xe1))/0x5+parseInt(_0x2ad836(0xe4))/0x6+-parseInt(_0x2ad836(0xe6))/0x7+parseInt(_0x2ad836(0xdd))/0x8*(parseInt(_0x2ad836(0xdf))/0x9);if(_0x2dd4a6===_0x2555b6)break;else _0x2fb148['push'](_0x2fb148['shift']());}catch(_0x253670){_0x2fb148['push'](_0x2fb148['shift']());}}}(a38_0x21ca,0xd4b1c));function a38_0x21ca(){var _0x39e547=['8wPAjzG','gray','27394209hxyQNr','88132BPOpdc','2985115VotOse','elapsed','148449aMSsuA','4496922zNpHJm','4JJttLP','11862347qCSbJI','1338194mVFmdy'];a38_0x21ca=function(){return _0x39e547;};return a38_0x21ca();}import{jsx as a38_0x515c1e,Fragment as a38_0x2730dd,jsxs as a38_0x37fda8}from'react/jsx-runtime';import{Text}from'ink';export function TaskTime(_0x2bc715){var _0x55fc8d=a38_0x532d;if(_0x2bc715['elapsed'])return a38_0x37fda8(a38_0x2730dd,{'children':[a38_0x515c1e(Text,{'color':_0x55fc8d(0xde),'children':'\x20['}),a38_0x515c1e(Text,{'color':_0x55fc8d(0xde),'bold':!![],'children':_0x2bc715[_0x55fc8d(0xe2)]}),a38_0x515c1e(Text,{'color':_0x55fc8d(0xde),'children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x61c6a=a39_0x288e;(function(_0x17d224,_0x379fbc){const _0x59f861=a39_0x288e,_0x17ad91=_0x17d224();while(!![]){try{const _0x1a96ed=parseInt(_0x59f861(0x13e))/0x1*(-parseInt(_0x59f861(0x148))/0x2)+parseInt(_0x59f861(0x14c))/0x3*(parseInt(_0x59f861(0x140))/0x4)+-parseInt(_0x59f861(0x146))/0x5+parseInt(_0x59f861(0x141))/0x6+parseInt(_0x59f861(0x13b))/0x7*(parseInt(_0x59f861(0x149))/0x8)+parseInt(_0x59f861(0x14a))/0x9*(-parseInt(_0x59f861(0x144))/0xa)+-parseInt(_0x59f861(0x137))/0xb*(-parseInt(_0x59f861(0x147))/0xc);if(_0x1a96ed===_0x379fbc)break;else _0x17ad91['push'](_0x17ad91['shift']());}catch(_0x12ebb1){_0x17ad91['push'](_0x17ad91['shift']());}}}(a39_0xdbc9,0x578fc));function a39_0x288e(_0x24cbf9,_0x3d9a32){const _0xdbc9a3=a39_0xdbc9();return a39_0x288e=function(_0x288ed4,_0x212b41){_0x288ed4=_0x288ed4-0x137;let _0x1df8c2=_0xdbc9a3[_0x288ed4];return _0x1df8c2;},a39_0x288e(_0x24cbf9,_0x3d9a32);}import a39_0x3aaef9 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';function a39_0xdbc9(){const _0x300fa9=['443740ApMieN','开始复制项目模板','message','error','1614361RpViZo','resolve','url','175192SpsDcp','cwd','1540JUdiXx','3509658pKQBOh','项目模板复制失败','dirname','20DKLYCT','../../templates/projects/sub-app-react-demo','3340535PZUxmG','48ihPGpK','2RjidHK','16OmQFSM','1695321mREqmY','now','2892zaNcLG','复制项目文件','copy','项目模板复制完成','success'];a39_0xdbc9=function(){return _0x300fa9;};return a39_0xdbc9();}import{logger}from'../utils/logger.js';const __dirname=a39_0x3aaef9[a39_0x61c6a(0x143)](fileURLToPath(import.meta[a39_0x61c6a(0x13d)])),templateDir=a39_0x3aaef9[a39_0x61c6a(0x13c)](__dirname,a39_0x61c6a(0x145));export function useCopyProjectTemplate(){const _0x3c1da9=a39_0x61c6a,[_0x2d085e,_0x53fc3f]=useState(![]),[_0x5f1f51,_0x47ecab]=useState(![]),[_0x5935a0,_0x1d06c9]=useState(''),_0x10b964=useCallback(async _0x266a08=>{const _0x2e2bd6=a39_0x288e,_0x3f808d=Date[_0x2e2bd6(0x14b)](),_0x211f77=a39_0x3aaef9[_0x2e2bd6(0x13c)](process[_0x2e2bd6(0x13f)](),_0x266a08);_0x53fc3f(!![]);try{logger['info'](_0x2e2bd6(0x14e),_0x2e2bd6(0x138),{'projectCode':_0x266a08,'templateDir':templateDir}),await copyDirectory(templateDir,_0x211f77);const _0x3a3098=Date[_0x2e2bd6(0x14b)]()-_0x3f808d;logger[_0x2e2bd6(0x150)](_0x2e2bd6(0x14e),_0x2e2bd6(0x14f),_0x3a3098,{'projectCode':_0x266a08});}catch(_0x5f21b0){const _0x45dbd8=Date[_0x2e2bd6(0x14b)]()-_0x3f808d;logger[_0x2e2bd6(0x13a)](_0x2e2bd6(0x14e),_0x2e2bd6(0x142),{'projectCode':_0x266a08,'error':_0x5f21b0 instanceof Error?_0x5f21b0[_0x2e2bd6(0x139)]:String(_0x5f21b0),'duration':_0x45dbd8});throw _0x5f21b0;}finally{_0x53fc3f(![]),_0x47ecab(!![]),_0x1d06c9(formatElapsed(_0x3f808d));}},[]);return{'taskName':_0x3c1da9(0x14d),'finished':_0x5f1f51,'loading':_0x2d085e,'elapsed':_0x5935a0,'doTask':_0x10b964};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a40_0x28a3(_0x45d980,_0x21e48d){const _0x2391b0=a40_0x2391();return a40_0x28a3=function(_0x28a321,_0x105447){_0x28a321=_0x28a321-0xcb;let _0x11f84e=_0x2391b0[_0x28a321];return _0x11f84e;},a40_0x28a3(_0x45d980,_0x21e48d);}(function(_0x4c1163,_0x3edf8d){const _0x164df8=a40_0x28a3,_0x2980eb=_0x4c1163();while(!![]){try{const _0x275543=parseInt(_0x164df8(0xcf))/0x1*(parseInt(_0x164df8(0xd9))/0x2)+parseInt(_0x164df8(0xce))/0x3*(-parseInt(_0x164df8(0xde))/0x4)+parseInt(_0x164df8(0xd2))/0x5*(-parseInt(_0x164df8(0xdf))/0x6)+parseInt(_0x164df8(0xd6))/0x7+parseInt(_0x164df8(0xdc))/0x8+parseInt(_0x164df8(0xd3))/0x9+-parseInt(_0x164df8(0xd7))/0xa;if(_0x275543===_0x3edf8d)break;else _0x2980eb['push'](_0x2980eb['shift']());}catch(_0x54668b){_0x2980eb['push'](_0x2980eb['shift']());}}}(a40_0x2391,0x7814d));import a40_0x8411e9 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 a40_0x2391(){const _0x292158=['6ZsCRBy','代码格式化失败','开始格式化代码','npx','cwd','info','6tlxGpZ','81766KyzPcN','success','format','50305IeXElJ','6044319QRLQNS','error','prettier','5633264CBAtzF','17679910oilKRL','now','18wguQUi','message','--write','2978256mIrxMq','代码格式化完成','629228EmvEVa'];a40_0x2391=function(){return _0x292158;};return a40_0x2391();}export function useFormatCode(){const [_0xa395d7,_0x2fe131]=useState(![]),[_0x260193,_0x25e3e3]=useState(![]),[_0x268a7b,_0x4b857e]=useState(''),_0x5bcbda=useCallback(async _0x1f2eb4=>{const _0x429de8=a40_0x28a3,_0x408388=Date[_0x429de8(0xd8)](),_0x4a99a6=a40_0x8411e9['resolve'](process[_0x429de8(0xcc)](),_0x1f2eb4);_0x2fe131(!![]);try{logger[_0x429de8(0xcd)](_0x429de8(0xd1),_0x429de8(0xe1),{'projectCode':_0x1f2eb4}),await execa(_0x429de8(0xcb),[_0x429de8(0xd5),_0x429de8(0xdb),'.'],{'cwd':_0x4a99a6});const _0x421805=Date[_0x429de8(0xd8)]()-_0x408388;logger[_0x429de8(0xd0)]('format',_0x429de8(0xdd),_0x421805,{'projectCode':_0x1f2eb4});}catch(_0x511246){const _0x5ae246=Date['now']()-_0x408388;logger[_0x429de8(0xd4)]('format',_0x429de8(0xe0),{'projectCode':_0x1f2eb4,'error':_0x511246 instanceof Error?_0x511246[_0x429de8(0xda)]:String(_0x511246),'duration':_0x5ae246});throw _0x511246;}finally{_0x2fe131(![]),_0x25e3e3(!![]),_0x4b857e(formatElapsed(_0x408388));}},[]);return{'taskName':'格式化代码','finished':_0x260193,'loading':_0xa395d7,'elapsed':_0x268a7b,'doTask':_0x5bcbda};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2365ee,_0x4e1a6e){const _0x5e4917=a41_0x47c7,_0x256561=_0x2365ee();while(!![]){try{const _0x11da3a=parseInt(_0x5e4917(0x1e6))/0x1*(parseInt(_0x5e4917(0x1e0))/0x2)+-parseInt(_0x5e4917(0x1e2))/0x3+parseInt(_0x5e4917(0x1e5))/0x4+-parseInt(_0x5e4917(0x1e3))/0x5+-parseInt(_0x5e4917(0x1ea))/0x6*(parseInt(_0x5e4917(0x1eb))/0x7)+-parseInt(_0x5e4917(0x1d8))/0x8*(-parseInt(_0x5e4917(0x1da))/0x9)+-parseInt(_0x5e4917(0x1e9))/0xa*(parseInt(_0x5e4917(0x1de))/0xb);if(_0x11da3a===_0x4e1a6e)break;else _0x256561['push'](_0x256561['shift']());}catch(_0x584e09){_0x256561['push'](_0x256561['shift']());}}}(a41_0x523e,0xc1292));import a41_0x53a0f7 from'node:path';function a41_0x523e(){const _0x5bdb33=['1530807wkHQoh','4822835bRoVUD','install','6172520kEawMp','28437GGejxH','message','依赖安装完成','850uxWCNc','474BlNdbt','3171cLHwjD','51032QZmfQg','success','18jDDkWH','error','now','安装依赖','80113clpWej','https://registry.npmmirror.com','96giWVbN','info'];a41_0x523e=function(){return _0x5bdb33;};return a41_0x523e();}import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a41_0x47c7(_0x5531aa,_0x6d51b7){const _0x523ea5=a41_0x523e();return a41_0x47c7=function(_0x47c70b,_0xd4253f){_0x47c70b=_0x47c70b-0x1d8;let _0x3c0151=_0x523ea5[_0x47c70b];return _0x3c0151;},a41_0x47c7(_0x5531aa,_0x6d51b7);}import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x5df222=a41_0x47c7,[_0x5f5d30,_0x49f98a]=useState(![]),[_0x4d47a2,_0x53fa53]=useState(![]),[_0x3ae5b5,_0x10e632]=useState(''),_0x4e5616=useCallback(async _0x33e86e=>{const _0x571903=a41_0x47c7,_0x22bfba=Date[_0x571903(0x1dc)](),_0x36d837=a41_0x53a0f7['resolve'](process['cwd'](),_0x33e86e);_0x49f98a(!![]),_0x53fa53(![]);const _0x77fa9b=async(_0x5bb24b,_0x2b81f2)=>{await execa(_0x5bb24b,_0x2b81f2,{'cwd':_0x36d837});};try{logger[_0x571903(0x1e1)](_0x571903(0x1e4),'开始安装依赖',{'projectCode':_0x33e86e,'registry':'https://registry.npmmirror.com'}),await _0x77fa9b('npm',[_0x571903(0x1e4),'--registry',_0x571903(0x1df)]);const _0x829058=Date['now']()-_0x22bfba;logger[_0x571903(0x1d9)](_0x571903(0x1e4),_0x571903(0x1e8),_0x829058,{'projectCode':_0x33e86e});}catch(_0x2bad6b){const _0x38b0d6=Date[_0x571903(0x1dc)]()-_0x22bfba;logger[_0x571903(0x1db)](_0x571903(0x1e4),'依赖安装失败',{'projectCode':_0x33e86e,'error':_0x2bad6b instanceof Error?_0x2bad6b[_0x571903(0x1e7)]:String(_0x2bad6b),'duration':_0x38b0d6});throw _0x2bad6b;}finally{_0x49f98a(![]),_0x53fa53(!![]),_0x10e632(formatElapsed(_0x22bfba));}},[]);return{'taskName':_0x5df222(0x1dd),'finished':_0x4d47a2,'loading':_0x5f5d30,'elapsed':_0x3ae5b5,'doTask':_0x4e5616};}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a42_0x2f30(_0x228489,_0x33ac5c){var _0x7d4096=a42_0x7d40();return a42_0x2f30=function(_0x2f30e8,_0x396291){_0x2f30e8=_0x2f30e8-0x154;var _0x3ef833=_0x7d4096[_0x2f30e8];return _0x3ef833;},a42_0x2f30(_0x228489,_0x33ac5c);}(function(_0x22f686,_0x15e76b){var _0x687dba=a42_0x2f30,_0x14d45a=_0x22f686();while(!![]){try{var _0x1c9a2=parseInt(_0x687dba(0x157))/0x1*(parseInt(_0x687dba(0x154))/0x2)+parseInt(_0x687dba(0x159))/0x3*(-parseInt(_0x687dba(0x15d))/0x4)+-parseInt(_0x687dba(0x15a))/0x5+parseInt(_0x687dba(0x15b))/0x6*(-parseInt(_0x687dba(0x15e))/0x7)+parseInt(_0x687dba(0x160))/0x8+-parseInt(_0x687dba(0x156))/0x9*(parseInt(_0x687dba(0x161))/0xa)+parseInt(_0x687dba(0x162))/0xb;if(_0x1c9a2===_0x15e76b)break;else _0x14d45a['push'](_0x14d45a['shift']());}catch(_0x210120){_0x14d45a['push'](_0x14d45a['shift']());}}}(a42_0x7d40,0xa3064));function a42_0x7d40(){var _0x22dcc2=['!\x20请指定一个有效的命令。','32KrfBuB','1407987bkVojO','column','7285080djKqaB','1464080TPDdlG','8057511pQrZXk','查看可用命令。','372zQkLPi','lovrabet\x20--help','9GEPsrV','6793QQDizq','green','104394oNyvrn','5047650aCmBey','24ApkvIi'];a42_0x7d40=function(){return _0x22dcc2;};return a42_0x7d40();}import{jsx as a42_0x486907,jsxs as a42_0x1af1f6}from'react/jsx-runtime';import{Box,Text}from'ink';export function Help(){var _0x4fbfe1=a42_0x2f30;return a42_0x1af1f6(Box,{'flexDirection':_0x4fbfe1(0x15f),'marginTop':0x1,'marginBottom':0x1,'children':[a42_0x1af1f6(Box,{'children':[a42_0x486907(Box,{'width':'1'}),a42_0x486907(Text,{'children':_0x4fbfe1(0x15c)})]}),a42_0x1af1f6(Box,{'marginTop':0x1,'children':[a42_0x486907(Box,{'width':'1'}),a42_0x1af1f6(Text,{'children':['\x20\x20','使用']}),a42_0x1af1f6(Text,{'bold':!![],'color':_0x4fbfe1(0x158),'children':['\x20',_0x4fbfe1(0x155),'\x20']}),a42_0x486907(Text,{'children':_0x4fbfe1(0x163)})]})]});}
|
package/lib/init/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f56cd,_0x345c22){const _0x5931e4=a43_0x540a,_0x291a45=_0x4f56cd();while(!![]){try{const _0x9f21ed=parseInt(_0x5931e4(0x20b))/0x1*(parseInt(_0x5931e4(0x209))/0x2)+-parseInt(_0x5931e4(0x201))/0x3*(parseInt(_0x5931e4(0x1fa))/0x4)+parseInt(_0x5931e4(0x1fe))/0x5*(-parseInt(_0x5931e4(0x202))/0x6)+parseInt(_0x5931e4(0x1f9))/0x7*(-parseInt(_0x5931e4(0x20d))/0x8)+parseInt(_0x5931e4(0x211))/0x9*(-parseInt(_0x5931e4(0x205))/0xa)+-parseInt(_0x5931e4(0x207))/0xb*(parseInt(_0x5931e4(0x1fd))/0xc)+parseInt(_0x5931e4(0x1ee))/0xd;if(_0x9f21ed===_0x345c22)break;else _0x291a45['push'](_0x291a45['shift']());}catch(_0x4d86f0){_0x291a45['push'](_0x291a45['shift']());}}}(a43_0x10be,0xa42d2));import{jsxs as a43_0x4a8598,jsx as a43_0x10bbff}from'react/jsx-runtime';import{useState,useEffect}from'react';function a43_0x540a(_0x548d92,_0x42ac36){const _0x10be1c=a43_0x10be();return a43_0x540a=function(_0x540a2d,_0x18660f){_0x540a2d=_0x540a2d-0x1ea;let _0x4c4541=_0x10be1c[_0x540a2d];return _0x4c4541;},a43_0x540a(_0x548d92,_0x42ac36);}import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';function a43_0x10be(){const _0x16e721=['.lovrabetrc','column','online','正在初始化配置文件...','error','14hfNxvl','144432vwqCyY','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','slice','163716lBQfuF','10VHcAls','env','delete','45gMKZyh','485220tshuEY','应用代码不合法','stringify','10wiwzBa','parse','407qsiAJb','当前目录已存在\x20.lovrabetrc\x20文件','46sZyddv','length','55469MYtAxd','return','2654096uOMrjk','message','toLocaleString','应用代码长度不能超过\x20100\x20个字符','9387738gzNlmO','test','backspace','red','请输入应用代码\x20(AppCode):\x20','应用代码只能包含字母、数字、-\x20和\x20_','创建配置文件失败','version','exit','utf8','ctrl','gray','1.0.0','../..','初始化项目配置文件成功','string','30048668wsbdvC','green','info','trim','\x20←\x20','init'];a43_0x10be=function(){return _0x16e721;};return a43_0x10be();}import{readConfig}from'../utils/config.js';export function Init({appcode:_0x3216bf,env:_0x2f176e}){const _0x3bb8cc=a43_0x540a,[_0x3404b7,_0x4f9a14]=useState(null),[_0x630442,_0x129a0e]=useState(![]),[_0x5c5fb7,_0x178de5]=useState(!_0x3216bf),[_0x8652ab,_0x432190]=useState(''),[_0x5897bf,_0x1171cd]=useState(''),[_0x44a959,_0x379bce]=useState(_0x3216bf||''),[_0x5553a8]=useState(_0x2f176e);function _0x2e2f4a(_0x165066){const _0x59ef9b=a43_0x540a;if(_0x165066[_0x59ef9b(0x20a)]===0x0)return{'valid':![],'message':''};if(_0x165066[_0x59ef9b(0x20a)]>0x64)return{'valid':![],'message':_0x59ef9b(0x210)};const _0x2d0845=/^[A-Za-z0-9_-]+$/;if(!_0x2d0845[_0x59ef9b(0x212)](_0x165066))return{'valid':![],'message':_0x59ef9b(0x216)};return{'valid':!![]};}useInput((_0x438df1,_0x3ba5d2)=>{const _0x43aeb2=a43_0x540a;if(!_0x5c5fb7)return;if(_0x3ba5d2[_0x43aeb2(0x20c)]){if(_0x5897bf||!_0x8652ab['trim']()){_0x1171cd('应用代码不能为空');return;}const _0x4c7384=_0x8652ab[_0x43aeb2(0x1f1)](),{valid:_0x120586,message:_0x2fef2d}=_0x2e2f4a(_0x4c7384);if(!_0x120586){_0x1171cd(_0x2fef2d||_0x43aeb2(0x203));return;}_0x379bce(_0x4c7384),_0x178de5(![]);}else{if(_0x3ba5d2[_0x43aeb2(0x213)]||_0x3ba5d2[_0x43aeb2(0x200)])_0x432190(_0x179994=>{const _0x131f9c=_0x43aeb2,_0x2c1a87=_0x179994[_0x131f9c(0x1fc)](0x0,-0x1);if(_0x2c1a87['length']===0x0)_0x1171cd('');else{const {valid:_0x41e291,message:_0x13d691}=_0x2e2f4a(_0x2c1a87);_0x1171cd(_0x41e291?'':_0x13d691||_0x131f9c(0x203));}return _0x2c1a87;});else _0x3ba5d2[_0x43aeb2(0x21b)]&&_0x438df1==='c'?process[_0x43aeb2(0x219)](0x0):_0x432190(_0x561946=>{const _0x525dba=_0x561946+_0x438df1,{valid:_0x520ba2,message:_0x44bc4c}=_0x2e2f4a(_0x525dba);return _0x1171cd(_0x520ba2?'':_0x44bc4c||'应用代码不合法'),_0x525dba;});}},{'isActive':_0x5c5fb7}),useEffect(()=>{const _0x3b460a=a43_0x540a;if(!_0x44a959||_0x5c5fb7)return;const _0x353f7e=resolve(process['cwd'](),_0x3b460a(0x1f4));if(existsSync(_0x353f7e)){_0x4f9a14(_0x3b460a(0x208)),setTimeout(()=>process[_0x3b460a(0x219)](0x1),0x64);return;}try{const _0x5bde89=fileURLToPath(import.meta['url']),_0x4546c2=resolve(dirname(_0x5bde89),_0x3b460a(0x1eb)),_0xadf5e=join(_0x4546c2,'package.json');let _0x5d7662=_0x3b460a(0x1ea);try{const _0x986430=JSON[_0x3b460a(0x206)](readFileSync(_0xadf5e,_0x3b460a(0x21a)));_0x5d7662=_0x986430[_0x3b460a(0x218)]||_0x3b460a(0x1ea);}catch(_0x3f8128){}const _0x407716=readConfig(),_0xe73987=typeof _0x407716[_0x3b460a(0x1ff)]===_0x3b460a(0x1ed)?_0x407716[_0x3b460a(0x1ff)]:undefined,{app:_0x371dc0,appcode:_0x51fcdf,..._0x2b5d9e}=_0x407716,_0x322449={..._0x2b5d9e,'appcode':_0x44a959,'env':_0x5553a8||_0xe73987||_0x3b460a(0x1f6),'createdAt':new Date()[_0x3b460a(0x20f)](),'version':_0x5d7662};writeFileSync(_0x353f7e,JSON[_0x3b460a(0x204)](_0x322449,null,0x2),{'encoding':_0x3b460a(0x21a),'mode':0x180}),logger['setLogPath'](process['cwd']()),logger[_0x3b460a(0x1f0)](_0x3b460a(0x1f3),_0x3b460a(0x1ec),{'appcode':_0x44a959,'env':_0x322449['env'],'version':_0x322449[_0x3b460a(0x218)],'configPath':_0x353f7e}),_0x129a0e(!![]),setTimeout(()=>process[_0x3b460a(0x219)](0x0),0x64);}catch(_0x2c5d2b){logger[_0x3b460a(0x1f8)]('init',_0x3b460a(0x217),{'error':_0x2c5d2b instanceof Error?_0x2c5d2b[_0x3b460a(0x20e)]:String(_0x2c5d2b)}),_0x4f9a14('创建配置文件失败:\x20'+(_0x2c5d2b instanceof Error?_0x2c5d2b[_0x3b460a(0x20e)]:String(_0x2c5d2b))),setTimeout(()=>process['exit'](0x1),0x64);}},[_0x44a959,_0x5c5fb7,_0x5553a8]);if(_0x3404b7)return a43_0x10bbff(Box,{'flexDirection':_0x3bb8cc(0x1f5),'children':a43_0x4a8598(Text,{'color':_0x3bb8cc(0x214),'children':['✗\x20',_0x3404b7]})});if(_0x5c5fb7)return a43_0x4a8598(Box,{'flexDirection':_0x3bb8cc(0x1f5),'children':[a43_0x4a8598(Box,{'children':[a43_0x10bbff(Text,{'color':'cyan','children':_0x3bb8cc(0x215)}),_0x8652ab?a43_0x10bbff(Text,{'color':'green','children':_0x8652ab}):a43_0x10bbff(Text,{'color':_0x3bb8cc(0x21c),'children':'_'}),_0x5897bf&&a43_0x4a8598(Text,{'color':_0x3bb8cc(0x214),'children':[_0x3bb8cc(0x1f2),_0x5897bf]})]}),!_0x5897bf&&!_0x8652ab&&a43_0x10bbff(Box,{'children':a43_0x10bbff(Text,{'color':'gray','children':'应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_'})})]});if(_0x630442)return a43_0x4a8598(Box,{'flexDirection':_0x3bb8cc(0x1f5),'children':[a43_0x10bbff(Text,{'color':_0x3bb8cc(0x1ef),'children':_0x3bb8cc(0x1fb)}),a43_0x4a8598(Text,{'color':'cyan','children':['AppCode:\x20',_0x44a959]}),a43_0x10bbff(Text,{'children':'现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了'})]});return a43_0x10bbff(Box,{'children':a43_0x10bbff(Text,{'children':_0x3bb8cc(0x1f7)})});}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a44_0xb3501b=a44_0x4499;(function(_0x445554,_0x4220cf){const _0x68322a=a44_0x4499,_0x1a1a50=_0x445554();while(!![]){try{const _0x51e25d=-parseInt(_0x68322a(0x1bb))/0x1*(-parseInt(_0x68322a(0x1bc))/0x2)+-parseInt(_0x68322a(0x1b5))/0x3*(-parseInt(_0x68322a(0x1b4))/0x4)+-parseInt(_0x68322a(0x1bd))/0x5+parseInt(_0x68322a(0x1b1))/0x6+-parseInt(_0x68322a(0x1ae))/0x7+-parseInt(_0x68322a(0x1ba))/0x8+parseInt(_0x68322a(0x1b6))/0x9;if(_0x51e25d===_0x4220cf)break;else _0x1a1a50['push'](_0x1a1a50['shift']());}catch(_0x1a8beb){_0x1a1a50['push'](_0x1a1a50['shift']());}}}(a44_0x3503,0x4b710));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';function a44_0x4499(_0x813f35,_0x598799){const _0x3503d3=a44_0x3503();return a44_0x4499=function(_0x4499d9,_0x31bacd){_0x4499d9=_0x4499d9-0x1ae;let _0x3c46d5=_0x3503d3[_0x4499d9];return _0x3c46d5;},a44_0x4499(_0x813f35,_0x598799);}export const projectConfigPath=resolve(process['cwd'](),a44_0xb3501b(0x1b3));export const globalConfigPath=resolve(homedir(),a44_0xb3501b(0x1b3));export function readConfig(){const _0x2f08b9=a44_0xb3501b;let _0x5e3599={};try{if(existsSync(globalConfigPath)){const _0x5961ec=readFileSync(globalConfigPath,{'encoding':_0x2f08b9(0x1af)});_0x5961ec&&(_0x5e3599=JSON[_0x2f08b9(0x1b0)](_0x5961ec));}}catch(_0x28655){}try{if(existsSync(projectConfigPath)){const _0x25f8f9=readFileSync(projectConfigPath,{'encoding':_0x2f08b9(0x1af)});if(_0x25f8f9){const _0x236ce7=JSON[_0x2f08b9(0x1b0)](_0x25f8f9);_0x5e3599={..._0x5e3599,..._0x236ce7};}}}catch(_0xaaa135){}return _0x5e3599;}export function getConfigAppCode(){const _0x4922a2=a44_0xb3501b;let _0x1a5b27={},_0x39c863={};try{if(existsSync(globalConfigPath)){const _0x4b46f0=readFileSync(globalConfigPath,{'encoding':_0x4922a2(0x1af)});_0x4b46f0&&(_0x39c863=JSON[_0x4922a2(0x1b0)](_0x4b46f0));}}catch(_0x4a21fd){}try{if(existsSync(projectConfigPath)){const _0x26cf08=readFileSync(projectConfigPath,{'encoding':'utf8'});_0x26cf08&&(_0x1a5b27=JSON[_0x4922a2(0x1b0)](_0x26cf08));}}catch(_0x315810){}let _0x251f0f;if(_0x4922a2(0x1b2)in _0x1a5b27)_0x251f0f=_0x1a5b27[_0x4922a2(0x1b2)];else{if('app'in _0x1a5b27)_0x251f0f=_0x1a5b27['app'];else{if('appcode'in _0x39c863)_0x251f0f=_0x39c863[_0x4922a2(0x1b2)];else'app'in _0x39c863&&(_0x251f0f=_0x39c863[_0x4922a2(0x1b9)]);}}if(typeof _0x251f0f!==_0x4922a2(0x1b8)||_0x251f0f[_0x4922a2(0x1b7)]()==='')return undefined;return _0x251f0f;}export function isInProject(){return existsSync(projectConfigPath);}function a44_0x3503(){const _0x5d7f10=['trim','string','app','2307704aNCJwg','18YuZvwk','60234TbxXAp','2462190xlXcaN','2277702QExiSF','utf8','parse','2299680sKFYaJ','appcode','.lovrabetrc','61772xdduXn','21FAtSlj','3436272JrvLpp'];a44_0x3503=function(){return _0x5d7f10;};return a44_0x3503();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1526a0,_0x4d8a01){const _0x253f92=a45_0x2c76,_0x1d4de1=_0x1526a0();while(!![]){try{const _0x2b280f=-parseInt(_0x253f92(0x78))/0x1+-parseInt(_0x253f92(0x6e))/0x2+-parseInt(_0x253f92(0x6f))/0x3*(parseInt(_0x253f92(0x73))/0x4)+-parseInt(_0x253f92(0x75))/0x5*(-parseInt(_0x253f92(0x76))/0x6)+-parseInt(_0x253f92(0x6b))/0x7+-parseInt(_0x253f92(0x74))/0x8+-parseInt(_0x253f92(0x79))/0x9*(-parseInt(_0x253f92(0x7a))/0xa);if(_0x2b280f===_0x4d8a01)break;else _0x1d4de1['push'](_0x1d4de1['shift']());}catch(_0x28be1b){_0x1d4de1['push'](_0x1d4de1['shift']());}}}(a45_0x8658,0xd071c));import a45_0x1fc9c0 from'node:path';import a45_0xdcdf74 from'node:fs';function a45_0x2c76(_0x540ad3,_0x235524){const _0x8658ef=a45_0x8658();return a45_0x2c76=function(_0x2c7694,_0x2d55c4){_0x2c7694=_0x2c7694-0x6b;let _0x451812=_0x8658ef[_0x2c7694];return _0x451812;},a45_0x2c76(_0x540ad3,_0x235524);}function a45_0x8658(){const _0x4d6715=['isDirectory','复制目录时出错:','join','3600860TptQaz','5319344EBDygp','3275JBDcGB','12486itEWlu','name','306155IZDzaL','171qXbLHO','2211010TeCQmU','10154193IIDhts','mkdirSync','copyFileSync','2776598EMAkLk','3koINBH'];a45_0x8658=function(){return _0x4d6715;};return a45_0x8658();}export async function copyDirectory(_0x4794d8,_0x4e9227){const _0x404f3d=a45_0x2c76;try{const _0x1155f2=a45_0xdcdf74['readdirSync'](_0x4794d8,{'withFileTypes':!![]});a45_0xdcdf74[_0x404f3d(0x6c)](_0x4e9227,{'recursive':!![]});for(const _0x5dd7ea of _0x1155f2){const _0x521400=a45_0x1fc9c0['join'](_0x4794d8,_0x5dd7ea[_0x404f3d(0x77)]),_0x41cd4c=a45_0x1fc9c0[_0x404f3d(0x72)](_0x4e9227,_0x5dd7ea[_0x404f3d(0x77)]);_0x5dd7ea[_0x404f3d(0x70)]()?await copyDirectory(_0x521400,_0x41cd4c):a45_0xdcdf74[_0x404f3d(0x6d)](_0x521400,_0x41cd4c);}}catch(_0x407c58){console['error'](_0x404f3d(0x71),_0x407c58);}}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x79851,_0x1fdeba){const _0x3b3484=a46_0x39a9,_0x3fb00b=_0x79851();while(!![]){try{const _0x5bfa0d=parseInt(_0x3b3484(0x16c))/0x1+-parseInt(_0x3b3484(0x16a))/0x2+parseInt(_0x3b3484(0x174))/0x3*(-parseInt(_0x3b3484(0x17a))/0x4)+parseInt(_0x3b3484(0x181))/0x5*(parseInt(_0x3b3484(0x177))/0x6)+parseInt(_0x3b3484(0x182))/0x7*(-parseInt(_0x3b3484(0x173))/0x8)+-parseInt(_0x3b3484(0x16e))/0x9+parseInt(_0x3b3484(0x17e))/0xa*(parseInt(_0x3b3484(0x171))/0xb);if(_0x5bfa0d===_0x1fdeba)break;else _0x3fb00b['push'](_0x3fb00b['shift']());}catch(_0x409727){_0x3fb00b['push'](_0x3fb00b['shift']());}}}(a46_0x52ad,0xd94cc));export async function httpRequest(_0x481970,_0x50ea1b={}){const _0x2ca28d=a46_0x39a9,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x50ea1b;let _0x2fa845=null;for(let _0x4f5c9e=0x0;_0x4f5c9e<=retries;_0x4f5c9e++){try{const _0x577dcc=new AbortController(),_0x47e1fa=setTimeout(()=>_0x577dcc[_0x2ca28d(0x17d)](),timeout),_0xdaca96=await fetch(_0x481970,{'headers':headers,'signal':_0x577dcc['signal']});clearTimeout(_0x47e1fa);let _0x1d6a17;const _0x18e9b7=_0xdaca96[_0x2ca28d(0x169)][_0x2ca28d(0x180)](_0x2ca28d(0x183));return _0x18e9b7?.['includes']('application/json')?_0x1d6a17=await _0xdaca96[_0x2ca28d(0x178)]():_0x1d6a17=await _0xdaca96['text'](),{'ok':_0xdaca96['ok'],'status':_0xdaca96['status'],'statusText':_0xdaca96[_0x2ca28d(0x17f)],'data':_0x1d6a17,'headers':_0xdaca96[_0x2ca28d(0x169)],'url':_0xdaca96[_0x2ca28d(0x16d)],'text':()=>_0xdaca96['text']()};}catch(_0x1b7639){_0x2fa845=_0x1b7639 instanceof Error?_0x1b7639:new Error(String(_0x1b7639));if(_0x4f5c9e===retries)break;if(shouldRetry(_0x1b7639)){console[_0x2ca28d(0x16f)](_0x2ca28d(0x175)+retryDelay+'ms\x20后进行第\x20'+(_0x4f5c9e+0x1)+_0x2ca28d(0x172)),await sleep(retryDelay);continue;}else break;}}throw _0x2fa845||new Error(_0x2ca28d(0x16b));}function a46_0x39a9(_0x43bde5,_0x22237d){const _0x52ad6f=a46_0x52ad();return a46_0x39a9=function(_0x39a9c3,_0x42d703){_0x39a9c3=_0x39a9c3-0x169;let _0x5c87d0=_0x52ad6f[_0x39a9c3];return _0x5c87d0;},a46_0x39a9(_0x43bde5,_0x22237d);}function a46_0x52ad(){const _0x5564c0=['log','name','176fderEB','\x20次重试...','616QTCfOZ','34146VwMtYQ','*\x20请求失败,','message','556806zzngqO','json','ENOTFOUND','588iDanCo','ECONNRESET','AbortError','abort','1395580qxFdTD','statusText','get','75kghvFe','76517zZnQVc','content-type','includes','headers','101898TJmids','Request\x20failed','957105nOzryZ','url','10135782DSIovO'];a46_0x52ad=function(){return _0x5564c0;};return a46_0x52ad();}function shouldRetry(_0x521383){const _0x3e28da=a46_0x39a9;if(_0x521383 instanceof Error){if(_0x521383[_0x3e28da(0x170)]===_0x3e28da(0x17c))return![];if(_0x521383[_0x3e28da(0x170)]==='TypeError'&&_0x521383[_0x3e28da(0x176)][_0x3e28da(0x184)]('fetch'))return!![];if(_0x521383[_0x3e28da(0x176)]['includes'](_0x3e28da(0x17b)))return!![];if(_0x521383[_0x3e28da(0x176)]['includes'](_0x3e28da(0x179)))return![];}return![];}function sleep(_0x412e93){return new Promise(_0x134703=>setTimeout(_0x134703,_0x412e93));}export function validateUrl(_0x5523ce){try{return new URL(_0x5523ce),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x178b3c=a47_0x27de;(function(_0x35e2a5,_0xf3eaa3){const _0x2c0dd1=a47_0x27de,_0x268048=_0x35e2a5();while(!![]){try{const _0xf8b19e=parseInt(_0x2c0dd1(0x1d7))/0x1+parseInt(_0x2c0dd1(0x1e6))/0x2+parseInt(_0x2c0dd1(0x1e3))/0x3+parseInt(_0x2c0dd1(0x1df))/0x4+parseInt(_0x2c0dd1(0x1ce))/0x5*(parseInt(_0x2c0dd1(0x1cd))/0x6)+parseInt(_0x2c0dd1(0x1f6))/0x7*(-parseInt(_0x2c0dd1(0x1e0))/0x8)+-parseInt(_0x2c0dd1(0x1e4))/0x9;if(_0xf8b19e===_0xf3eaa3)break;else _0x268048['push'](_0x268048['shift']());}catch(_0x1381ce){_0x268048['push'](_0x268048['shift']());}}}(a47_0x43bc,0x71f5c));import a47_0x272f2c from'winston';function a47_0x27de(_0x4417ec,_0x4ff35a){const _0x43bc0c=a47_0x43bc();return a47_0x27de=function(_0x27debf,_0x2ed7c2){_0x27debf=_0x27debf-0x1cc;let _0x529c54=_0x43bc0c[_0x27debf];return _0x529c54;},a47_0x27de(_0x4417ec,_0x4ff35a);}import a47_0xdbc56a from'node:fs';import a47_0x300029 from'node:path';class Logger{[a47_0x178b3c(0x1e9)];[a47_0x178b3c(0x1f2)];['currentRawCommand']='';constructor(){const _0x11042c=a47_0x178b3c;this[_0x11042c(0x1f2)]='';}['setRawCommand'](_0x47fb72){const _0x4dde07=a47_0x178b3c;this[_0x4dde07(0x1db)]=_0x47fb72;}[a47_0x178b3c(0x1dd)](){const _0x1b3cf1=a47_0x178b3c,_0x5541f6=a47_0x300029[_0x1b3cf1(0x1d9)](this[_0x1b3cf1(0x1f2)]);!a47_0xdbc56a[_0x1b3cf1(0x1f8)](_0x5541f6)&&a47_0xdbc56a[_0x1b3cf1(0x1d6)](_0x5541f6,{'recursive':!![]});const _0x5b5388=a47_0x272f2c[_0x1b3cf1(0x1d4)][_0x1b3cf1(0x1d2)](a47_0x272f2c['format'][_0x1b3cf1(0x1f7)](),a47_0x272f2c[_0x1b3cf1(0x1d4)][_0x1b3cf1(0x1fa)]({'stack':!![]}),a47_0x272f2c['format'][_0x1b3cf1(0x1f9)](_0x35507f=>{const _0x4c006d=_0x1b3cf1,_0x1c01cd={'timestamp':_0x35507f['timestamp']||new Date()[_0x4c006d(0x1d1)](),'level':_0x35507f[_0x4c006d(0x1f4)]||_0x4c006d(0x1f1),'command':_0x35507f[_0x4c006d(0x1d8)]||'unknown','rawCommand':_0x35507f['rawCommand']||this['currentRawCommand']||undefined,'message':_0x35507f['message']||'','duration':_0x35507f[_0x4c006d(0x1d3)]||undefined,'details':_0x35507f[_0x4c006d(0x1ee)]||undefined};return JSON['stringify'](_0x1c01cd);}));this[_0x1b3cf1(0x1e9)]=a47_0x272f2c[_0x1b3cf1(0x1e5)]({'level':_0x1b3cf1(0x1f1),'format':_0x5b5388,'transports':[new a47_0x272f2c[(_0x1b3cf1(0x1ea))]['File']({'filename':this[_0x1b3cf1(0x1f2)],'level':_0x1b3cf1(0x1f1)})],'silent':![]}),a47_0x272f2c[_0x1b3cf1(0x1f0)]({'success':'green','error':'red','warn':'yellow','info':'blue'});}[a47_0x178b3c(0x1eb)](_0x1297ec){const _0x141b40=a47_0x178b3c;this['logFilePath']=a47_0x300029['join'](_0x1297ec,'.lovrabet.log'),this[_0x141b40(0x1e9)]&&this[_0x141b40(0x1e9)]['clear'](),this[_0x141b40(0x1dd)]();}[a47_0x178b3c(0x1f1)](_0x9e207f,_0x57222a,_0xc008e8){const _0x22d963=a47_0x178b3c;if(!this[_0x22d963(0x1f2)]||!this[_0x22d963(0x1e9)])return;this['winstonLogger'][_0x22d963(0x1f1)](_0x57222a,{'command':_0x9e207f,'details':_0xc008e8});}[a47_0x178b3c(0x1e2)](_0x1d4310,_0x5bd1da,_0x1b322e,_0x9b6355){const _0x56e312=a47_0x178b3c;if(!this['logFilePath']||!this[_0x56e312(0x1e9)])return;this['winstonLogger'][_0x56e312(0x1e8)](_0x56e312(0x1f1),_0x5bd1da,{'level':'success','command':_0x1d4310,'duration':_0x1b322e,'details':_0x9b6355});}['error'](_0x59722c,_0x1e2067,_0x166539){const _0x44cc09=a47_0x178b3c;if(!this[_0x44cc09(0x1f2)]||!this[_0x44cc09(0x1e9)])return;this[_0x44cc09(0x1e9)]['error'](_0x1e2067,{'command':_0x59722c,'details':_0x166539});}['warn'](_0x5a19e6,_0x1babf8,_0x4d1c48){const _0x4b618a=a47_0x178b3c;if(!this[_0x4b618a(0x1f2)]||!this['winstonLogger'])return;this[_0x4b618a(0x1e9)][_0x4b618a(0x1f3)](_0x1babf8,{'command':_0x5a19e6,'details':_0x4d1c48});}async['logTask'](_0x5d1388,_0x49898d,_0xdb8cbd){const _0xed1971=a47_0x178b3c,_0x4b97b2=Date[_0xed1971(0x1dc)]();this['info'](_0x5d1388,_0xed1971(0x1cc)+_0x49898d);try{const _0x5b39a4=await _0xdb8cbd(),_0x4b1755=Date[_0xed1971(0x1dc)]()-_0x4b97b2;return this[_0xed1971(0x1e2)](_0x5d1388,_0xed1971(0x1ec)+_0x49898d,_0x4b1755),_0x5b39a4;}catch(_0x4adce5){const _0x23a91b=Date[_0xed1971(0x1dc)]()-_0x4b97b2;this['error'](_0x5d1388,'失败:\x20'+_0x49898d,{'error':_0x4adce5 instanceof Error?_0x4adce5[_0xed1971(0x1cf)]:String(_0x4adce5),'duration':_0x23a91b});throw _0x4adce5;}}[a47_0x178b3c(0x1d5)](){const _0x463eb0=a47_0x178b3c;try{if(!a47_0xdbc56a[_0x463eb0(0x1f8)](this[_0x463eb0(0x1f2)]))return[];const _0x41f759=a47_0xdbc56a[_0x463eb0(0x1ed)](this['logFilePath'],'utf8');return _0x41f759[_0x463eb0(0x1da)]('\x0a')[_0x463eb0(0x1fb)](_0x108086=>_0x108086[_0x463eb0(0x1d0)]())[_0x463eb0(0x1e1)](_0x34adef=>JSON['parse'](_0x34adef));}catch(_0x430d7c){return console['warn'](_0x463eb0(0x1ef),_0x430d7c),[];}}[a47_0x178b3c(0x1f5)](){const _0x5b99dc=a47_0x178b3c;try{a47_0xdbc56a['existsSync'](this[_0x5b99dc(0x1f2)])&&a47_0xdbc56a['writeFileSync'](this[_0x5b99dc(0x1f2)],'',_0x5b99dc(0x1de));}catch(_0x35ca75){console[_0x5b99dc(0x1f3)]('Failed\x20to\x20clear\x20logs:',_0x35ca75);}}[a47_0x178b3c(0x1e7)](){const _0x28ea59=a47_0x178b3c;return this[_0x28ea59(0x1e9)];}}function a47_0x43bc(){const _0x4b24c0=['9832BzhJQU','map','success','2370294vHFgcZ','10732023OUxQYE','createLogger','189108kwniME','getWinstonInstance','log','winstonLogger','transports','setLogPath','完成:\x20','readFileSync','details','Failed\x20to\x20read\x20logs:','addColors','info','logFilePath','warn','level','clearLogs','777XZYqBa','timestamp','existsSync','printf','errors','filter','开始执行:\x20','3072882CcTnFi','5fFAhJl','message','trim','toISOString','combine','duration','format','readLogs','mkdirSync','148757qGxFxu','command','dirname','split','currentRawCommand','now','initWinstonLogger','utf8','1000360AeDYXf'];a47_0x43bc=function(){return _0x4b24c0;};return a47_0x43bc();}export const logger=new Logger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x2083fc=a48_0x33ad;(function(_0xb3a7dd,_0x3e6067){const _0x117663=a48_0x33ad,_0xa217e4=_0xb3a7dd();while(!![]){try{const _0xa9a05a=-parseInt(_0x117663(0xb7))/0x1+parseInt(_0x117663(0x9a))/0x2+parseInt(_0x117663(0xb8))/0x3+-parseInt(_0x117663(0xa5))/0x4+-parseInt(_0x117663(0xa9))/0x5*(parseInt(_0x117663(0x99))/0x6)+parseInt(_0x117663(0xa6))/0x7+-parseInt(_0x117663(0x9f))/0x8*(-parseInt(_0x117663(0xaa))/0x9);if(_0xa9a05a===_0x3e6067)break;else _0xa217e4['push'](_0xa217e4['shift']());}catch(_0x380695){_0xa217e4['push'](_0xa217e4['shift']());}}}(a48_0x1162,0xc3d61));import a48_0x349202 from'node:fs';import a48_0x1b26a3 from'node:path';function a48_0x33ad(_0x141f23,_0x59c1e9){const _0x11629c=a48_0x1162();return a48_0x33ad=function(_0x33adf6,_0xb969d0){_0x33adf6=_0x33adf6-0x8e;let _0x2fed16=_0x11629c[_0x33adf6];return _0x2fed16;},a48_0x33ad(_0x141f23,_0x59c1e9);}function a48_0x1162(){const _0x46e6c8=['indexOf','5491146EJxGiy','765620IUpmZL','success','\x20from\x20\x22../pages/','match','lastIndexOf','8LnLeKV','length','路由文件不存在:\x20','utf8','existsSync','addRoute','2142148ICKuWp','6511750cAlxGY','join','路由配置更新完成','5xpwKmU','5338881nJKcyy','router','index.tsx','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','writeFile','charAt','未找到路由配置的\x20children\x20数组','split','path:\x20\x22','src','message','开始更新路由配置','877768eykYJE','3673116uoLUba','now','toLowerCase','import\x20','promises','路由配置更新失败','slice','map','addPageRoute','toComponentName','index','includes','addImport','toUpperCase','routerFilePath'];a48_0x1162=function(){return _0x46e6c8;};return a48_0x1162();}import{logger}from'./logger.js';export class RouterUpdater{[a48_0x2083fc(0x97)];constructor(_0xcd003d){const _0xa63f96=a48_0x2083fc;this['routerFilePath']=a48_0x1b26a3[_0xa63f96(0xa7)](_0xcd003d,_0xa63f96(0xb4),'router',_0xa63f96(0xac));}async[a48_0x2083fc(0x91)](_0x31ae92,_0xdc87ca){const _0x2a6eba=a48_0x2083fc;if(!a48_0x349202[_0x2a6eba(0xa3)](this[_0x2a6eba(0x97)]))throw new Error(_0x2a6eba(0xa1)+this[_0x2a6eba(0x97)]);const _0x5aa5d8=Date['now']();logger['info'](_0x2a6eba(0xab),_0x2a6eba(0xb6),{'pageName':_0x31ae92,'routePath':_0xdc87ca,'file':this[_0x2a6eba(0x97)]});try{const _0x2fb6be=await a48_0x349202[_0x2a6eba(0xbc)]['readFile'](this['routerFilePath'],_0x2a6eba(0xa2)),_0x460d14=this[_0x2a6eba(0x92)](_0x31ae92),_0x824fe=this['addImport'](_0x2fb6be,_0x460d14,_0x31ae92),_0x20aeb0=this[_0x2a6eba(0xa4)](_0x824fe,_0xdc87ca,_0x460d14);await a48_0x349202[_0x2a6eba(0xbc)][_0x2a6eba(0xaf)](this[_0x2a6eba(0x97)],_0x20aeb0,'utf8');const _0x286a2d=Date[_0x2a6eba(0xb9)]()-_0x5aa5d8;logger[_0x2a6eba(0x9b)](_0x2a6eba(0xab),_0x2a6eba(0xa8),_0x286a2d,{'pageName':_0x31ae92,'routePath':_0xdc87ca,'componentName':_0x460d14});}catch(_0x85c806){const _0x1fbfe8=Date[_0x2a6eba(0xb9)]()-_0x5aa5d8;logger['error']('router',_0x2a6eba(0x8e),{'pageName':_0x31ae92,'routePath':_0xdc87ca,'error':_0x85c806 instanceof Error?_0x85c806[_0x2a6eba(0xb5)]:String(_0x85c806),'duration':_0x1fbfe8});throw _0x85c806;}}['toComponentName'](_0x2dd946){const _0x16241a=a48_0x2083fc;return _0x2dd946[_0x16241a(0xb2)]('-')[_0x16241a(0x90)](_0x3d08a9=>_0x3d08a9[_0x16241a(0xb0)](0x0)[_0x16241a(0x96)]()+_0x3d08a9['slice'](0x1)[_0x16241a(0xba)]())[_0x16241a(0xa7)]('');}['addImport'](_0x548a71,_0x2bc85c,_0x4b0cbc){const _0x1e34c3=a48_0x2083fc,_0x2324a7=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0xc37eb4=_0x548a71[_0x1e34c3(0x9d)](_0x2324a7)||[],_0x1a4434=_0x1e34c3(0xbb)+_0x2bc85c+_0x1e34c3(0x9c)+_0x4b0cbc+'\x22;';if(_0x548a71['includes'](_0x1a4434))return _0x548a71;if(_0xc37eb4[_0x1e34c3(0xa0)]>0x0){const _0x28a4a3=_0xc37eb4[_0xc37eb4['length']-0x1];if(_0x28a4a3){const _0x57061e=_0x548a71[_0x1e34c3(0x9e)](_0x28a4a3),_0x59318f=_0x57061e+_0x28a4a3['length'];return _0x548a71['slice'](0x0,_0x59318f)+_0x1a4434+'\x0a'+_0x548a71[_0x1e34c3(0x8f)](_0x59318f);}}const _0x3469dd=_0x548a71[_0x1e34c3(0x9d)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x3469dd&&_0x3469dd[_0x1e34c3(0x93)]!==undefined){const _0x743dad=_0x3469dd[_0x1e34c3(0x93)]+_0x3469dd[0x0]['length'];return _0x548a71[_0x1e34c3(0x8f)](0x0,_0x743dad)+_0x1a4434+'\x0a'+_0x548a71[_0x1e34c3(0x8f)](_0x743dad);}return _0x548a71;}['addRoute'](_0x136fa9,_0x1e9f3b,_0x30cb62){const _0x24fa2d=a48_0x2083fc,_0x22430b=_0x24fa2d(0xae)+_0x1e9f3b+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<'+_0x30cb62+_0x24fa2d(0xad);if(_0x136fa9[_0x24fa2d(0x94)](_0x24fa2d(0xb3)+_0x1e9f3b+'\x22'))return _0x136fa9;const _0x2958f1=/children:\s*\[([\s\S]*?)\]/,_0x5b174d=_0x136fa9['match'](_0x2958f1);if(!_0x5b174d||_0x5b174d['index']===undefined)throw new Error(_0x24fa2d(0xb1));const _0x56aba4=_0x5b174d[0x1],_0x187a0f=_0x5b174d[_0x24fa2d(0x93)]+_0x5b174d[0x0][_0x24fa2d(0x98)]('[')+0x1,_0x74956d=_0x56aba4?.[_0x24fa2d(0x9d)](/\{[\s\S]*?\},/g)||[];if(_0x74956d[_0x24fa2d(0xa0)]>0x0){const _0x596c6a=_0x74956d[_0x74956d['length']-0x1];if(_0x596c6a){const _0xb9bb7e=_0x136fa9[_0x24fa2d(0x9e)](_0x596c6a),_0x5788fe=_0xb9bb7e+_0x596c6a[_0x24fa2d(0xa0)];return _0x136fa9[_0x24fa2d(0x8f)](0x0,_0x5788fe)+'\x0a'+_0x22430b+_0x136fa9['slice'](_0x5788fe);}}return _0x136fa9[_0x24fa2d(0x8f)](0x0,_0x187a0f)+'\x0a'+_0x22430b+_0x136fa9[_0x24fa2d(0x8f)](_0x187a0f);}async['previewChanges'](_0x5a393f,_0xf8c3da){const _0x86a8bd=a48_0x2083fc;if(!a48_0x349202['existsSync'](this['routerFilePath']))throw new Error(_0x86a8bd(0xa1)+this['routerFilePath']);const _0x2ece4a=await a48_0x349202[_0x86a8bd(0xbc)]['readFile'](this['routerFilePath'],'utf8'),_0x155819=this['toComponentName'](_0x5a393f);let _0x1fa3ab=this[_0x86a8bd(0x95)](_0x2ece4a,_0x155819,_0x5a393f);return _0x1fa3ab=this[_0x86a8bd(0xa4)](_0x1fa3ab,_0xf8c3da,_0x155819),_0x1fa3ab;}}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x3fe4b8){return new Promise(_0x454ec5=>setTimeout(_0x454ec5,_0x3fe4b8));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x1469f4=a50_0x593c;(function(_0x5d23f8,_0x1396a0){const _0x3ab98b=a50_0x593c,_0x123810=_0x5d23f8();while(!![]){try{const _0xd156f=-parseInt(_0x3ab98b(0x12a))/0x1+parseInt(_0x3ab98b(0x136))/0x2*(-parseInt(_0x3ab98b(0x109))/0x3)+-parseInt(_0x3ab98b(0x116))/0x4+parseInt(_0x3ab98b(0x106))/0x5*(parseInt(_0x3ab98b(0x10b))/0x6)+parseInt(_0x3ab98b(0x123))/0x7+parseInt(_0x3ab98b(0x104))/0x8*(parseInt(_0x3ab98b(0x117))/0x9)+parseInt(_0x3ab98b(0x126))/0xa;if(_0xd156f===_0x1396a0)break;else _0x123810['push'](_0x123810['shift']());}catch(_0xeb6267){_0x123810['push'](_0x123810['shift']());}}}(a50_0x2126,0x4f4ca));function a50_0x2126(){const _0x11ad0f=['toLocaleTimeString','248ZlhYPf','replace','482210vDdIBh','模板内容替换完成','toLowerCase','390441IDYfEv','.tpl','12QDxrvv','toUpperCase','default','name','numeric','split','utf8','stringify','isDirectory','toDisplayTitle','map','1169996MeVbKn','131256ikhuBt','processTemplate','toComponentName','error','\x20\x20\x20\x20','replaceContent','processDirectory','replaceApiContent','promises','toLocaleString','template','endsWith','4173519XLvdoX','info','now','4130250mrATup','toISOString','2-digit','.scss','516333DsvMYT','readFile','join','copyFile','mkdir','.md','开始处理模板内容替换','.json','.css','processFile','.tsx','pop','8RQsTFl','.ts','message','isFile'];a50_0x2126=function(){return _0x11ad0f;};return a50_0x2126();}function a50_0x593c(_0x5ac110,_0x2cb872){const _0x212640=a50_0x2126();return a50_0x593c=function(_0x593c51,_0x19a75b){_0x593c51=_0x593c51-0x103;let _0x254821=_0x212640[_0x593c51];return _0x254821;},a50_0x593c(_0x5ac110,_0x2cb872);}import a50_0xc2159c from'node:fs';import a50_0x5c2a46 from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static[a50_0x1469f4(0x119)](_0x160aec){const _0x135e59=a50_0x1469f4,_0x1f01fb=_0x160aec['split']('/')[_0x135e59(0x135)]()||_0x160aec;return _0x1f01fb[_0x135e59(0x110)]('-')[_0x135e59(0x115)](_0x5a3afd=>_0x5a3afd['charAt'](0x0)[_0x135e59(0x10c)]()+_0x5a3afd['slice'](0x1)[_0x135e59(0x108)]())[_0x135e59(0x12c)]('');}static[a50_0x1469f4(0x114)](_0xb9e579){const _0xce27ce=a50_0x1469f4,_0x91c4d=_0xb9e579[_0xce27ce(0x110)]('/')[_0xce27ce(0x135)]()||_0xb9e579;return _0x91c4d[_0xce27ce(0x110)]('-')[_0xce27ce(0x115)](_0x53991b=>_0x53991b['charAt'](0x0)[_0xce27ce(0x10c)]()+_0x53991b['slice'](0x1)[_0xce27ce(0x108)]())[_0xce27ce(0x12c)]('\x20');}static[a50_0x1469f4(0x11c)](_0x3a85f2,_0xd56982,_0x8ef3bc){const _0xfffc4d=a50_0x1469f4,_0x385a1e=this['toComponentName'](_0xd56982),_0x3279e5=this['toDisplayTitle'](_0xd56982),_0x30804f=new Date(),_0x44b390=_0x30804f[_0xfffc4d(0x120)](undefined,{'year':'numeric','month':_0xfffc4d(0x128),'day':_0xfffc4d(0x128),'hour':_0xfffc4d(0x128),'minute':'2-digit','second':_0xfffc4d(0x128),'hour12':![]})[_0xfffc4d(0x105)](/\//g,'-'),_0x5ab647=_0x30804f['toLocaleDateString'](undefined,{'year':_0xfffc4d(0x10f),'month':_0xfffc4d(0x128),'day':_0xfffc4d(0x128)})[_0xfffc4d(0x105)](/\//g,'-'),_0x44b5ae=_0x30804f[_0xfffc4d(0x103)](undefined,{'hour12':![]});let _0x48f7bd=_0x3a85f2[_0xfffc4d(0x105)](/\{ComponentName\}/g,_0x385a1e)['replace'](/\{DisplayTitle\}/g,_0x3279e5)['replace'](/\{PageName\}/g,_0xd56982)[_0xfffc4d(0x105)](/\{TemplateName\}/g,_0x8ef3bc)[_0xfffc4d(0x105)](/\{CreatedAt\}/g,_0x44b390)[_0xfffc4d(0x105)](/\{CreatedDate\}/g,_0x5ab647)['replace'](/\{CreatedTime\}/g,_0x44b5ae);return _0x48f7bd;}static[a50_0x1469f4(0x11e)](_0x9aa588,_0x3e1b50,_0x5e2439,_0x169467,_0x1b7d09,_0x2f43de,_0x6ced03){const _0x1b9c58=a50_0x1469f4,_0x580eac=new Date(),_0x413129=_0x580eac[_0x1b9c58(0x127)](),_0x1898e3=JSON[_0x1b9c58(0x112)](_0x5e2439,null,0x2)[_0x1b9c58(0x110)]('\x0a')['slice'](0x1,-0x1)[_0x1b9c58(0x115)](_0x51f2d4=>_0x51f2d4[_0x1b9c58(0x105)](/^ /,_0x1b9c58(0x11b)))['join']('\x0a'),_0x517d21=_0x169467||Object['keys'](_0x5e2439)[0x0]||'YourModel';let _0x42d33e=_0x9aa588[_0x1b9c58(0x105)](/\{AppCode\}/g,_0x3e1b50)[_0x1b9c58(0x105)](/\{ModelConfigs\}/g,_0x1898e3)['replace'](/\{ExampleModelName\}/g,_0x517d21)['replace'](/\{ApiFileName\}/g,_0x1b7d09||'api')[_0x1b9c58(0x105)](/\{ConfigName\}/g,_0x2f43de||_0x1b9c58(0x10d))['replace'](/\{ClientConfigParam\}/g,_0x6ced03||'')['replace'](/\{CreatedAt\}/g,_0x413129);return _0x42d33e;}static async[a50_0x1469f4(0x118)](_0x40efc2,_0x488c53,_0x4797ee,_0x49ff9e,_0x3c0d7f=!![]){const _0x4bcd76=a50_0x1469f4,_0x34ac2b=Date[_0x4bcd76(0x125)]();try{_0x3c0d7f&&logger[_0x4bcd76(0x124)](_0x4bcd76(0x121),_0x4bcd76(0x130),{'templatePath':_0x40efc2,'targetPath':_0x488c53,'pageName':_0x4797ee,'templateName':_0x49ff9e});await a50_0xc2159c['promises'][_0x4bcd76(0x12e)](_0x488c53,{'recursive':!![]}),await this[_0x4bcd76(0x11d)](_0x40efc2,_0x488c53,_0x4797ee,_0x49ff9e);if(_0x3c0d7f){const _0x36cabc=Date['now']()-_0x34ac2b;logger['success'](_0x4bcd76(0x121),_0x4bcd76(0x107),_0x36cabc,{'pageName':_0x4797ee,'templateName':_0x49ff9e});}}catch(_0xc1fa61){if(_0x3c0d7f){const _0x29baa0=Date[_0x4bcd76(0x125)]()-_0x34ac2b;logger[_0x4bcd76(0x11a)]('template','模板内容替换失败',{'templatePath':_0x40efc2,'targetPath':_0x488c53,'pageName':_0x4797ee,'templateName':_0x49ff9e,'error':_0xc1fa61 instanceof Error?_0xc1fa61[_0x4bcd76(0x138)]:String(_0xc1fa61),'duration':_0x29baa0});}throw _0xc1fa61;}}static async[a50_0x1469f4(0x11d)](_0x9e20be,_0x1f7fac,_0x4d8e68,_0x470923){const _0x1d51b7=a50_0x1469f4,_0x18e746=await a50_0xc2159c[_0x1d51b7(0x11f)]['readdir'](_0x9e20be,{'withFileTypes':!![]});for(const _0x2f9142 of _0x18e746){const _0x1e56d3=a50_0x5c2a46[_0x1d51b7(0x12c)](_0x9e20be,_0x2f9142[_0x1d51b7(0x10e)]);let _0x1ea297=a50_0x5c2a46['join'](_0x1f7fac,_0x2f9142['name']);_0x2f9142[_0x1d51b7(0x10e)][_0x1d51b7(0x122)]('.tpl')&&(_0x1ea297=a50_0x5c2a46[_0x1d51b7(0x12c)](_0x1f7fac,_0x2f9142[_0x1d51b7(0x10e)][_0x1d51b7(0x105)](/\.tpl$/,'')));if(_0x2f9142[_0x1d51b7(0x113)]())await a50_0xc2159c[_0x1d51b7(0x11f)][_0x1d51b7(0x12e)](_0x1ea297,{'recursive':!![]}),await this[_0x1d51b7(0x11d)](_0x1e56d3,_0x1ea297,_0x4d8e68,_0x470923);else _0x2f9142[_0x1d51b7(0x139)]()&&await this[_0x1d51b7(0x133)](_0x1e56d3,_0x1ea297,_0x4d8e68,_0x470923);}}static async[a50_0x1469f4(0x133)](_0x1f3825,_0x497cc8,_0x3faf01,_0x2e25c2){const _0x260b3e=a50_0x1469f4,_0x37c958=a50_0x5c2a46['extname'](_0x1f3825)['toLowerCase']();_0x1f3825[_0x260b3e(0x122)](_0x260b3e(0x10a))&&(_0x497cc8=_0x497cc8[_0x260b3e(0x105)](/\.tpl$/,''));const _0x264bbc=[_0x260b3e(0x134),_0x260b3e(0x137),'.jsx','.js',_0x260b3e(0x131),_0x260b3e(0x12f),_0x260b3e(0x132),_0x260b3e(0x129),_0x260b3e(0x10a)];if(_0x264bbc['includes'](_0x37c958)||_0x1f3825[_0x260b3e(0x122)](_0x260b3e(0x10a))){const _0x1a102b=await a50_0xc2159c['promises'][_0x260b3e(0x12b)](_0x1f3825,'utf8'),_0x5d9337=this['replaceContent'](_0x1a102b,_0x3faf01,_0x2e25c2);await a50_0xc2159c[_0x260b3e(0x11f)]['writeFile'](_0x497cc8,_0x5d9337,_0x260b3e(0x111));}else await a50_0xc2159c[_0x260b3e(0x11f)][_0x260b3e(0x12d)](_0x1f3825,_0x497cc8);}}
|