@lovrabet/cli 1.1.18 → 1.1.19
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/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/templates/projects/sub-app-react-demo/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a33_0x1b85(){const _0x5e3189=['5kuLRxw','18253279tJpIFv','2866NikBts','6596406hnFBWu','49PjJCYQ','3282520cvUPRf','5393936SfkyyH','621BDSFDA','586008CsgqsC','889962odNNUb','10EkRsVU','replace','now'];a33_0x1b85=function(){return _0x5e3189;};return a33_0x1b85();}(function(_0x615f66,_0x404807){const _0x287d40=a33_0x529f,_0x2293cf=_0x615f66();while(!![]){try{const _0x3a8baf=parseInt(_0x287d40(0x77))/0x1*(-parseInt(_0x287d40(0x72))/0x2)+-parseInt(_0x287d40(0x78))/0x3+-parseInt(_0x287d40(0x75))/0x4*(-parseInt(_0x287d40(0x70))/0x5)+-parseInt(_0x287d40(0x6c))/0x6*(-parseInt(_0x287d40(0x74))/0x7)+parseInt(_0x287d40(0x76))/0x8+parseInt(_0x287d40(0x73))/0x9+-parseInt(_0x287d40(0x6d))/0xa*(parseInt(_0x287d40(0x71))/0xb);if(_0x3a8baf===_0x404807)break;else _0x2293cf['push'](_0x2293cf['shift']());}catch(_0xb80fde){_0x2293cf['push'](_0x2293cf['shift']());}}}(a33_0x1b85,0x7f505));function a33_0x529f(_0x2de8e5,_0x49d773){const _0x1b851a=a33_0x1b85();return a33_0x529f=function(_0x529f17,_0x74ea57){_0x529f17=_0x529f17-0x6c;let _0x15b75e=_0x1b851a[_0x529f17];return _0x15b75e;},a33_0x529f(_0x2de8e5,_0x49d773);}export function formatElapsed(_0x466d2f){const _0x73bbdb=a33_0x529f,_0x53fcf4=Date[_0x73bbdb(0x6f)]()-_0x466d2f;if(_0x53fcf4<0x3e8)return _0x53fcf4+'ms';const _0x3f0712=(_0x53fcf4/0x3e8)['toFixed'](0x2),_0x288372=_0x3f0712[_0x73bbdb(0x6e)](/\.?0+$/u,'');return _0x288372+'s';}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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
|
+
(function(_0x577542,_0x3ff17d){const _0x5b9b86=a34_0x7f3b,_0x37db88=_0x577542();while(!![]){try{const _0x3b6d28=-parseInt(_0x5b9b86(0xe7))/0x1+-parseInt(_0x5b9b86(0xa1))/0x2*(-parseInt(_0x5b9b86(0xf6))/0x3)+parseInt(_0x5b9b86(0xce))/0x4*(-parseInt(_0x5b9b86(0xc1))/0x5)+parseInt(_0x5b9b86(0xd0))/0x6*(-parseInt(_0x5b9b86(0xf9))/0x7)+-parseInt(_0x5b9b86(0xa0))/0x8*(parseInt(_0x5b9b86(0xf3))/0x9)+parseInt(_0x5b9b86(0xd9))/0xa+parseInt(_0x5b9b86(0xe3))/0xb*(parseInt(_0x5b9b86(0xcb))/0xc);if(_0x3b6d28===_0x3ff17d)break;else _0x37db88['push'](_0x37db88['shift']());}catch(_0x472968){_0x37db88['push'](_0x37db88['shift']());}}}(a34_0x2ad5,0x7684e));import{jsx as a34_0x3af43b,Fragment as a34_0x1415bf,jsxs as a34_0x353fec}from'react/jsx-runtime';import a34_0x460c1a from'node:path';import a34_0x57e573 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';function a34_0x2ad5(){const _0x3d7b74=['repeat','需手动拉取','开始创建项目:\x20','📦\x20API配置:\x20','19288786JxRlmN','启动项目:\x20','cyan','existsSync','440425KiHNLZ','success','API\x20配置拉取异常:\x20','\x20|\x20应用AppCode:\x20','\x20已存在,请使用其他项目名','column','string','url','gray','parse','../..','已自动拉取\x20✓','5529735NCyTko','projectName','length','27MKBCkI','appCode','W_OK','502033TEyelB','warn','*\x20正在拉取\x20API\x20配置...','accessSync',',\x20description=','更新\x20package.json\x20name\x20和\x20description\x20字段','toLocaleString','cwd','8gsaokk','11206qMivKR','√\x20API\x20配置拉取完成','doTask','*\x20正在为项目\x20','join','projectCode','constants','resolve','cd\x20','更新\x20package.json\x20失败:\x20','test','writeFileSync','green','stringify','info','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','description','setLogPath','create','error','name','log','清理项目目录失败:\x20','\x20√\x20','package.json','2.\x20','readFileSync','yellow','rmSync','lovrabet\x20api\x20pull','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','项目名称:\x20','2418245exYARi','拉取API配置:\x20','env','message','1.0.0','dirname','lovrabet\x20config\x20set\x20appcode\x20[app-code]','配置AppCode:\x20','version','\x20&&\x20lovrabet\x20start','12CbRmMT','🚀\x20接下来可以:','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','4fDgvHZ','🎉\x20项目创建成功!','60iiSRtj','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','📁\x20项目名称:\x20','utf8','🔗\x20应用AppCode:\x20','online','.lovrabetrc','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','API\x20配置拉取成功:\x20','9371800ElbJCr','×\x20项目名不能为空','*\x20清理失败的项目目录:\x20','未配置','white','pullApi'];a34_0x2ad5=function(){return _0x3d7b74;};return a34_0x2ad5();}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';function a34_0x7f3b(_0x14abd3,_0x2da3e7){const _0x2ad5ec=a34_0x2ad5();return a34_0x7f3b=function(_0x7f3b63,_0x303ac4){_0x7f3b63=_0x7f3b63-0x9d;let _0x1723c1=_0x2ad5ec[_0x7f3b63];return _0x1723c1;},a34_0x7f3b(_0x14abd3,_0x2da3e7);}import{logger}from'../utils/logger.js';export function CreateApp(_0x3c88ca){const _0x4fdcc4=a34_0x7f3b,[_0x4b5d37,_0x59f22a]=useState(![]),[_0x226938,_0x3cb0e8]=useState(![]),[_0x41ec6f,_0x4151bc]=useState(null),_0x1c538a=useCopyProjectTemplate(),_0xc31736=useInstallDependencies(),_0x400786=useFormatCode(),_0x25c4e9=async _0x451505=>{const _0x1d7c6f=a34_0x7f3b;if(!_0x451505['projectName']||_0x451505[_0x1d7c6f(0xf4)]['trim']()===''){console[_0x1d7c6f(0xb4)](_0x1d7c6f(0xda));return;}const _0x4569f7=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x4569f7[_0x1d7c6f(0xab)](_0x451505[_0x1d7c6f(0xf4)])){console[_0x1d7c6f(0xb4)](_0x1d7c6f(0xd1));return;}if(_0x451505[_0x1d7c6f(0xf4)][_0x1d7c6f(0xf5)]>0x64){console[_0x1d7c6f(0xb4)]('×\x20项目名过长,最多支持\x20100\x20个字符');return;}const _0x35c080=a34_0x460c1a[_0x1d7c6f(0xa8)](process[_0x1d7c6f(0x9f)](),_0x451505[_0x1d7c6f(0xf4)]);if(a34_0x57e573[_0x1d7c6f(0xe6)](_0x35c080)){console[_0x1d7c6f(0xb4)]('×\x20项目目录\x20'+_0x451505[_0x1d7c6f(0xf4)]+_0x1d7c6f(0xeb));return;}try{const _0x517203=a34_0x460c1a[_0x1d7c6f(0xc6)](_0x35c080);a34_0x57e573[_0x1d7c6f(0xfc)](_0x517203,a34_0x57e573[_0x1d7c6f(0xa7)][_0x1d7c6f(0xf8)]);}catch(_0x3e581e){console[_0x1d7c6f(0xb4)]('×\x20无法在当前目录创建项目,请检查目录权限');return;}_0x4151bc(_0x451505),_0x59f22a(!![]),logger[_0x1d7c6f(0xb2)](_0x35c080),logger['info'](_0x1d7c6f(0xb3),_0x1d7c6f(0xe1)+_0x451505[_0x1d7c6f(0xf4)],{'projectDir':_0x35c080,'appCode':_0x451505['appCode']});try{await _0x1c538a[_0x1d7c6f(0xa3)](_0x451505[_0x1d7c6f(0xf4)]),await _0x2932c2(_0x451505[_0x1d7c6f(0xf4)]),await _0xc31736['doTask'](_0x451505[_0x1d7c6f(0xf4)]),await _0x400786['doTask'](_0x451505['projectName']),await _0xa19770(_0x451505[_0x1d7c6f(0xf4)],_0x451505[_0x1d7c6f(0xf7)]||'',_0x451505['env']);if(_0x451505[_0x1d7c6f(0xde)]&&_0x451505['appCode']){console[_0x1d7c6f(0xb6)](_0x1d7c6f(0xfb));try{const _0x5a61d8=await pullApiSilent(_0x451505[_0x1d7c6f(0xf7)],undefined,_0x35c080,_0x451505[_0x1d7c6f(0xc3)]);_0x5a61d8?(console['log'](_0x1d7c6f(0xa2)),logger['info'](_0x1d7c6f(0xb3),_0x1d7c6f(0xd8)+_0x451505[_0x1d7c6f(0xf7)],{'projectDir':_0x35c080,'appCode':_0x451505[_0x1d7c6f(0xf7)],'env':_0x451505['env']})):(console[_0x1d7c6f(0xb6)](_0x1d7c6f(0xcd)),logger[_0x1d7c6f(0xfa)](_0x1d7c6f(0xb3),'API\x20配置拉取失败:\x20'+_0x451505[_0x1d7c6f(0xf7)],{'projectDir':_0x35c080,'appCode':_0x451505[_0x1d7c6f(0xf7)],'env':_0x451505[_0x1d7c6f(0xc3)]}));}catch(_0x574e8e){console['log']('!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x1d7c6f(0xfa)]('create',_0x1d7c6f(0xe9)+_0x451505[_0x1d7c6f(0xf7)],{'projectDir':_0x35c080,'appCode':_0x451505[_0x1d7c6f(0xf7)],'env':_0x451505[_0x1d7c6f(0xc3)],'error':_0x574e8e instanceof Error?_0x574e8e[_0x1d7c6f(0xc4)]:String(_0x574e8e)});}}logger[_0x1d7c6f(0xe8)](_0x1d7c6f(0xb3),'项目创建完成:\x20'+_0x451505['projectName']),_0x3cb0e8(!![]),_0x59f22a(![]);}catch(_0x21e896){logger[_0x1d7c6f(0xb4)]('create','项目创建失败:\x20'+_0x451505[_0x1d7c6f(0xf4)],{'error':_0x21e896 instanceof Error?_0x21e896['message']:String(_0x21e896)});try{a34_0x57e573[_0x1d7c6f(0xe6)](_0x35c080)&&(console[_0x1d7c6f(0xb6)](_0x1d7c6f(0xdb)+_0x35c080),a34_0x57e573[_0x1d7c6f(0xbd)](_0x35c080,{'recursive':!![],'force':!![]}));}catch(_0x4675d5){logger['warn'](_0x1d7c6f(0xb3),_0x1d7c6f(0xb7)+_0x35c080,{'error':_0x4675d5 instanceof Error?_0x4675d5[_0x1d7c6f(0xc4)]:String(_0x4675d5)});}_0x59f22a(![]),console['error']('×\x20项目创建失败:\x20'+(_0x21e896 instanceof Error?_0x21e896[_0x1d7c6f(0xc4)]:String(_0x21e896)));}},_0x2ea92a=async _0x2e8f68=>{const _0x4da1f9=a34_0x7f3b;await _0x25c4e9({'projectName':_0x2e8f68,'env':_0x3c88ca[_0x4da1f9(0xc3)]});},_0x2932c2=async _0x4ba11c=>{const _0x20d438=a34_0x7f3b,_0x5ccfc5=a34_0x460c1a[_0x20d438(0xa8)](process[_0x20d438(0x9f)](),_0x4ba11c),_0x2094c8=a34_0x460c1a[_0x20d438(0xa5)](_0x5ccfc5,_0x20d438(0xb9));try{console[_0x20d438(0xb6)](_0x20d438(0xb0));const _0x71957d=fileURLToPath(import.meta[_0x20d438(0xee)]),_0x25e141=a34_0x460c1a['resolve'](a34_0x460c1a[_0x20d438(0xc6)](_0x71957d),_0x20d438(0xf1)),_0x37df53=a34_0x460c1a['join'](_0x25e141,_0x20d438(0xb9));let _0x4011a7=_0x20d438(0xc5);try{const _0x213099=JSON[_0x20d438(0xf0)](a34_0x57e573[_0x20d438(0xbb)](_0x37df53,_0x20d438(0xd3)));_0x4011a7=_0x213099[_0x20d438(0xc9)]||_0x20d438(0xc5);}catch(_0x508c49){}const _0x2c0d5a=a34_0x57e573['readFileSync'](_0x2094c8,_0x20d438(0xd3)),_0x2bc6b2=JSON[_0x20d438(0xf0)](_0x2c0d5a);_0x2bc6b2[_0x20d438(0xb5)]=_0x4ba11c,_0x2bc6b2[_0x20d438(0xb1)]=_0x4ba11c+'\x20Generated\x20by\x20lovrabet\x20cli\x20'+_0x4011a7,a34_0x57e573[_0x20d438(0xac)](_0x2094c8,JSON['stringify'](_0x2bc6b2,null,0x2)+'\x0a',_0x20d438(0xd3)),console['log']('√\x20package.json\x20已更新:\x20name='+_0x4ba11c+_0x20d438(0xfd)+_0x2bc6b2[_0x20d438(0xb1)]),logger[_0x20d438(0xaf)](_0x20d438(0xb3),_0x20d438(0x9d),{'projectName':_0x4ba11c,'description':_0x2bc6b2[_0x20d438(0xb1)],'cliVersion':_0x4011a7,'packageJsonPath':_0x20d438(0xb9)});}catch(_0x2b8e0a){logger[_0x20d438(0xb4)]('create',_0x20d438(0xaa)+_0x4ba11c,{'projectName':_0x4ba11c,'error':_0x2b8e0a instanceof Error?_0x2b8e0a[_0x20d438(0xc4)]:String(_0x2b8e0a)});throw _0x2b8e0a;}},_0xa19770=async(_0x4af5a1,_0x45c4e7,_0x4ca359)=>{const _0x4d2444=a34_0x7f3b,_0x4a2e22=a34_0x460c1a[_0x4d2444(0xa8)](process[_0x4d2444(0x9f)](),_0x4af5a1),_0x39a8b8=a34_0x460c1a['join'](_0x4a2e22,_0x4d2444(0xd6));try{_0x45c4e7?console[_0x4d2444(0xb6)](_0x4d2444(0xa4)+_0x4af5a1+'\x20配置应用AppCode:\x20'+_0x45c4e7):console[_0x4d2444(0xb6)](_0x4d2444(0xa4)+_0x4af5a1+'\x20创建配置文件');console[_0x4d2444(0xb6)]('*\x20配置文件路径:\x20'+_0x39a8b8);const _0x237aa2=fileURLToPath(import.meta['url']),_0x5deea9=a34_0x460c1a[_0x4d2444(0xa8)](a34_0x460c1a['dirname'](_0x237aa2),_0x4d2444(0xf1)),_0x33b81e=a34_0x460c1a['join'](_0x5deea9,'package.json');let _0x2c8d85=_0x4d2444(0xc5);try{const _0x3f2ead=JSON['parse'](a34_0x57e573[_0x4d2444(0xbb)](_0x33b81e,_0x4d2444(0xd3)));_0x2c8d85=_0x3f2ead[_0x4d2444(0xc9)]||_0x4d2444(0xc5);}catch(_0x5f4759){}const _0x251678=readConfig(),_0x2697bc=typeof _0x251678[_0x4d2444(0xc3)]===_0x4d2444(0xed)?_0x251678['env']:undefined,{app:_0x4c2ca5,appcode:_0x387684,..._0x57c79b}=_0x251678,_0x3c54ae={..._0x57c79b,'appcode':_0x45c4e7||'','env':_0x4ca359||_0x2697bc||_0x4d2444(0xd5),'createdAt':new Date()[_0x4d2444(0x9e)](),'version':_0x2c8d85};a34_0x57e573[_0x4d2444(0xac)](_0x39a8b8,JSON[_0x4d2444(0xae)](_0x3c54ae,null,0x2),_0x4d2444(0xd3)),_0x45c4e7?console[_0x4d2444(0xb6)]('√\x20配置文件已创建,应用AppCode:\x20'+_0x45c4e7):console[_0x4d2444(0xb6)](_0x4d2444(0xd7)),logger[_0x4d2444(0xaf)](_0x4d2444(0xb3),'配置应用AppCode:\x20'+_0x45c4e7,{'projectName':_0x4af5a1,'configFile':'.lovrabetrc'});}catch(_0x484de7){logger['error'](_0x4d2444(0xb3),'配置应用AppCode失败:\x20'+_0x45c4e7,{'projectName':_0x4af5a1,'error':_0x484de7 instanceof Error?_0x484de7[_0x4d2444(0xc4)]:String(_0x484de7)});}};useEffect(()=>{const _0x471dac=a34_0x7f3b;_0x3c88ca[_0x471dac(0xa6)]&&_0x2ea92a(_0x3c88ca[_0x471dac(0xa6)]);},[_0x3c88ca['projectCode']]);if(!_0x4b5d37&&!_0x226938&&!_0x3c88ca['projectCode'])return a34_0x3af43b(EnhancedGuidedCreate,{'onCreate':_0x25c4e9,'env':_0x3c88ca[_0x4fdcc4(0xc3)]});if(_0x4b5d37)return a34_0x353fec(a34_0x1415bf,{'children':[a34_0x353fec(Box,{'marginTop':0x1,'children':[a34_0x3af43b(Box,{'width':'1'}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xad),'children':'\x20√\x20'}),a34_0x3af43b(Text,{'children':_0x4fdcc4(0xc0)}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xad),'children':_0x41ec6f?.['projectName']}),_0x41ec6f?.['appCode']&&a34_0x353fec(a34_0x1415bf,{'children':[a34_0x3af43b(Text,{'children':_0x4fdcc4(0xea)}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xe5),'children':_0x41ec6f[_0x4fdcc4(0xf7)]})]})]}),a34_0x3af43b(TaskRunning,{..._0x1c538a}),a34_0x3af43b(TaskRunning,{..._0xc31736}),a34_0x3af43b(TaskRunning,{..._0x400786})]});if(_0x226938)return a34_0x353fec(a34_0x1415bf,{'children':[a34_0x353fec(Box,{'marginTop':0x1,'children':[a34_0x3af43b(Box,{'width':'1'}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xad),'children':_0x4fdcc4(0xb8)}),a34_0x3af43b(Text,{'children':'项目名称:\x20'}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xad),'children':_0x41ec6f?.['projectName']}),_0x41ec6f?.[_0x4fdcc4(0xf7)]&&a34_0x353fec(a34_0x1415bf,{'children':[a34_0x3af43b(Text,{'children':'\x20|\x20应用AppCode:\x20'}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xe5),'children':_0x41ec6f[_0x4fdcc4(0xf7)]})]})]}),a34_0x3af43b(TaskFinished,{..._0x1c538a}),a34_0x3af43b(TaskFinished,{..._0xc31736}),a34_0x3af43b(TaskFinished,{..._0x400786}),a34_0x3af43b(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x3af43b(Text,{'color':_0x4fdcc4(0xad),'children':'─'[_0x4fdcc4(0xdf)](0x3c)})}),a34_0x3af43b(Box,{'children':a34_0x3af43b(Text,{'color':_0x4fdcc4(0xad),'bold':!![],'children':_0x4fdcc4(0xcf)})}),a34_0x353fec(Box,{'marginTop':0x1,'flexDirection':_0x4fdcc4(0xec),'children':[a34_0x353fec(Box,{'children':[a34_0x3af43b(Text,{'color':_0x4fdcc4(0xe5),'children':_0x4fdcc4(0xd2)}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xdd),'bold':!![],'children':_0x41ec6f?.[_0x4fdcc4(0xf4)]})]}),_0x41ec6f?.['appCode']&&a34_0x353fec(Box,{'children':[a34_0x3af43b(Text,{'color':'cyan','children':_0x4fdcc4(0xd4)}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xdd),'bold':!![],'children':_0x41ec6f[_0x4fdcc4(0xf7)]})]}),a34_0x353fec(Box,{'children':[a34_0x3af43b(Text,{'color':_0x4fdcc4(0xe5),'children':_0x4fdcc4(0xe2)}),_0x41ec6f?.[_0x4fdcc4(0xde)]?a34_0x3af43b(Text,{'color':_0x4fdcc4(0xad),'bold':!![],'children':_0x4fdcc4(0xf2)}):_0x41ec6f?.[_0x4fdcc4(0xf7)]?a34_0x3af43b(Text,{'color':_0x4fdcc4(0xbc),'bold':!![],'children':_0x4fdcc4(0xe0)}):a34_0x3af43b(Text,{'color':_0x4fdcc4(0xef),'bold':!![],'children':_0x4fdcc4(0xdc)})]})]}),a34_0x3af43b(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x3af43b(Text,{'color':_0x4fdcc4(0xe5),'bold':!![],'children':_0x4fdcc4(0xcc)})}),a34_0x353fec(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a34_0x353fec(Box,{'children':[a34_0x3af43b(Text,{'color':'green','children':'1.\x20'}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xdd),'children':_0x4fdcc4(0xe4)}),a34_0x3af43b(Text,{'color':'cyan','bold':!![],'children':_0x4fdcc4(0xa9)+_0x41ec6f?.[_0x4fdcc4(0xf4)]+_0x4fdcc4(0xca)})]}),_0x41ec6f?.[_0x4fdcc4(0xf7)]&&!_0x41ec6f?.[_0x4fdcc4(0xde)]&&a34_0x353fec(Box,{'children':[a34_0x3af43b(Text,{'color':_0x4fdcc4(0xbc),'children':_0x4fdcc4(0xba)}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xdd),'children':'拉取API配置:\x20'}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xe5),'bold':!![],'children':_0x4fdcc4(0xbe)})]}),!_0x41ec6f?.['appCode']&&a34_0x353fec(a34_0x1415bf,{'children':[a34_0x353fec(Box,{'children':[a34_0x3af43b(Text,{'color':'gray','children':'2.\x20'}),a34_0x3af43b(Text,{'color':'white','children':_0x4fdcc4(0xc8)}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xe5),'bold':!![],'children':_0x4fdcc4(0xc7)})]}),a34_0x353fec(Box,{'children':[a34_0x3af43b(Text,{'color':_0x4fdcc4(0xef),'children':'3.\x20'}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xdd),'children':_0x4fdcc4(0xc2)}),a34_0x3af43b(Text,{'color':_0x4fdcc4(0xe5),'bold':!![],'children':_0x4fdcc4(0xbf)})]})]})]}),a34_0x3af43b(Box,{'marginTop':0x1,'children':a34_0x3af43b(Text,{'color':'green','children':'─'[_0x4fdcc4(0xdf)](0x3c)})})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x579230,_0x3f2efb){var _0x4fff2a=a35_0x5b08,_0x3c5670=_0x579230();while(!![]){try{var _0x2da435=parseInt(_0x4fff2a(0x113))/0x1*(parseInt(_0x4fff2a(0x116))/0x2)+parseInt(_0x4fff2a(0x118))/0x3+-parseInt(_0x4fff2a(0x10d))/0x4*(-parseInt(_0x4fff2a(0x11a))/0x5)+parseInt(_0x4fff2a(0x10f))/0x6+-parseInt(_0x4fff2a(0x114))/0x7*(-parseInt(_0x4fff2a(0x11b))/0x8)+parseInt(_0x4fff2a(0x119))/0x9*(parseInt(_0x4fff2a(0x110))/0xa)+parseInt(_0x4fff2a(0x10e))/0xb*(-parseInt(_0x4fff2a(0x117))/0xc);if(_0x2da435===_0x3f2efb)break;else _0x3c5670['push'](_0x3c5670['shift']());}catch(_0x404612){_0x3c5670['push'](_0x3c5670['shift']());}}}(a35_0x2c83,0x91278));function a35_0x5b08(_0x7f6850,_0x414a12){var _0x2c838d=a35_0x2c83();return a35_0x5b08=function(_0x5b0858,_0x573947){_0x5b0858=_0x5b0858-0x10d;var _0x42c5c3=_0x2c838d[_0x5b0858];return _0x42c5c3;},a35_0x5b08(_0x7f6850,_0x414a12);}import{jsx as a35_0x37d386,jsxs as a35_0x49f1dd}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';function a35_0x2c83(){var _0x26ea05=['99KGdwAe','3124704OiOFHO','390JaSOwj','taskName','\x20√\x20','73vRlwZq','287ZdxgGh','elapsed','30792JTrLNP','4908444iTJiSC','1606884XpUjeV','84006qXYRkj','108665hScHoL','125832WbCNOC','200LHFSRO'];a35_0x2c83=function(){return _0x26ea05;};return a35_0x2c83();}export function TaskFinished(_0x564363){var _0x1268d1=a35_0x5b08;return a35_0x49f1dd(Box,{'children':[a35_0x37d386(Box,{'width':'1'}),a35_0x37d386(Text,{'color':'green','children':_0x1268d1(0x112)}),a35_0x37d386(Text,{'children':_0x564363[_0x1268d1(0x111)]}),a35_0x37d386(TaskTime,{'elapsed':_0x564363[_0x1268d1(0x115)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x29d523,_0xc4efce){var _0x46dd16=a36_0x1de3,_0x5d225d=_0x29d523();while(!![]){try{var _0xe2d6cb=-parseInt(_0x46dd16(0x17e))/0x1*(-parseInt(_0x46dd16(0x179))/0x2)+parseInt(_0x46dd16(0x17b))/0x3*(-parseInt(_0x46dd16(0x16f))/0x4)+parseInt(_0x46dd16(0x17a))/0x5*(-parseInt(_0x46dd16(0x172))/0x6)+-parseInt(_0x46dd16(0x171))/0x7*(-parseInt(_0x46dd16(0x178))/0x8)+-parseInt(_0x46dd16(0x175))/0x9*(parseInt(_0x46dd16(0x16e))/0xa)+parseInt(_0x46dd16(0x17d))/0xb*(-parseInt(_0x46dd16(0x17c))/0xc)+parseInt(_0x46dd16(0x176))/0xd;if(_0xe2d6cb===_0xc4efce)break;else _0x5d225d['push'](_0x5d225d['shift']());}catch(_0xa1f18f){_0x5d225d['push'](_0x5d225d['shift']());}}}(a36_0x36c1,0xda255));import{jsx as a36_0x2ec583,jsxs as a36_0x39c3fa}from'react/jsx-runtime';import{Text}from'ink';function a36_0x36c1(){var _0x26c9b5=['209598DNdJfp','green','finished','24813xYMNmK','43189016dwekWx','\x20√\x20','1419896nRrBXO','2ACwiTk','55FtCmxR','3756BPVZgT','17761116wvxrkC','11tyWaen','59761zCeYdR','2190EdbUdZ','632lUVocr','dots','7IxlUQS'];a36_0x36c1=function(){return _0x26c9b5;};return a36_0x36c1();}import a36_0x623451 from'ink-spinner';function a36_0x1de3(_0x239950,_0x19c4c0){var _0x36c15e=a36_0x36c1();return a36_0x1de3=function(_0x1de312,_0x46f527){_0x1de312=_0x1de312-0x16e;var _0x4c47f5=_0x36c15e[_0x1de312];return _0x4c47f5;},a36_0x1de3(_0x239950,_0x19c4c0);}export function TaskLoading(_0x18d280){var _0x1f5522=a36_0x1de3;if(_0x18d280[_0x1f5522(0x174)])return a36_0x2ec583(Text,{'color':_0x1f5522(0x173),'children':_0x1f5522(0x177)});if(_0x18d280['loading'])return a36_0x39c3fa(Text,{'color':'green','children':['\x20',a36_0x2ec583(a36_0x623451,{'type':_0x1f5522(0x170)}),'\x20']});return a36_0x2ec583(Text,{'children':'\x20\x20\x20'});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5c45fe,_0x427e90){var _0x282461=a37_0x5d21,_0x334c5e=_0x5c45fe();while(!![]){try{var _0x36e10b=parseInt(_0x282461(0x182))/0x1+-parseInt(_0x282461(0x181))/0x2*(-parseInt(_0x282461(0x186))/0x3)+-parseInt(_0x282461(0x180))/0x4+parseInt(_0x282461(0x17f))/0x5*(parseInt(_0x282461(0x185))/0x6)+-parseInt(_0x282461(0x17c))/0x7*(-parseInt(_0x282461(0x183))/0x8)+-parseInt(_0x282461(0x184))/0x9*(parseInt(_0x282461(0x17d))/0xa)+-parseInt(_0x282461(0x17e))/0xb*(parseInt(_0x282461(0x17b))/0xc);if(_0x36e10b===_0x427e90)break;else _0x334c5e['push'](_0x334c5e['shift']());}catch(_0x252b46){_0x334c5e['push'](_0x334c5e['shift']());}}}(a37_0xc08c,0x1bf4d));import{jsx as a37_0x47a945,jsxs as a37_0x38ef94}from'react/jsx-runtime';import{Box,Text}from'ink';function a37_0x5d21(_0x162194,_0x3c11af){var _0xc08cdc=a37_0xc08c();return a37_0x5d21=function(_0x5d2196,_0x38492e){_0x5d2196=_0x5d2196-0x17a;var _0x47feb1=_0xc08cdc[_0x5d2196];return _0x47feb1;},a37_0x5d21(_0x162194,_0x3c11af);}import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';function a37_0xc08c(){var _0xf6b047=['70578cmUipL','1219408qkXWKx','300177WeUVVB','37710UCdHGs','87537uFHunb','elapsed','80688DyKVDg','7FTwPXV','30IBnDnT','11JwUZmG','75QRsTdl','500664JcpXjF','2uHUWBr'];a37_0xc08c=function(){return _0xf6b047;};return a37_0xc08c();}export function TaskRunning(_0x5e4a73){var _0x305a3a=a37_0x5d21;return a37_0x38ef94(Box,{'children':[a37_0x47a945(Box,{'width':'1'}),a37_0x47a945(TaskLoading,{..._0x5e4a73}),a37_0x47a945(Text,{'children':_0x5e4a73['taskName']}),a37_0x47a945(TaskTime,{'elapsed':_0x5e4a73[_0x305a3a(0x17a)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4132d2,_0x2e16fa){var _0x2c163e=a38_0x3a03,_0x5a67e9=_0x4132d2();while(!![]){try{var _0x23bcb0=parseInt(_0x2c163e(0xf8))/0x1+-parseInt(_0x2c163e(0xfa))/0x2+-parseInt(_0x2c163e(0xf7))/0x3+parseInt(_0x2c163e(0xf4))/0x4*(parseInt(_0x2c163e(0xf6))/0x5)+-parseInt(_0x2c163e(0xfd))/0x6*(parseInt(_0x2c163e(0xfb))/0x7)+parseInt(_0x2c163e(0xf5))/0x8+parseInt(_0x2c163e(0xf3))/0x9;if(_0x23bcb0===_0x2e16fa)break;else _0x5a67e9['push'](_0x5a67e9['shift']());}catch(_0x3087b7){_0x5a67e9['push'](_0x5a67e9['shift']());}}}(a38_0x28b0,0xad461));import{jsx as a38_0x1d951b,Fragment as a38_0x3d2a5d,jsxs as a38_0x2d3835}from'react/jsx-runtime';import{Text}from'ink';export function TaskTime(_0xceced5){var _0x455bcc=a38_0x3a03;if(_0xceced5['elapsed'])return a38_0x2d3835(a38_0x3d2a5d,{'children':[a38_0x1d951b(Text,{'color':_0x455bcc(0xf9),'children':'\x20['}),a38_0x1d951b(Text,{'color':_0x455bcc(0xf9),'bold':!![],'children':_0xceced5[_0x455bcc(0xfc)]}),a38_0x1d951b(Text,{'color':_0x455bcc(0xf9),'children':']'})]});return null;}function a38_0x3a03(_0x48ee06,_0x4a78f0){var _0x28b03a=a38_0x28b0();return a38_0x3a03=function(_0x3a03c4,_0x588796){_0x3a03c4=_0x3a03c4-0xf3;var _0x475cc4=_0x28b03a[_0x3a03c4];return _0x475cc4;},a38_0x3a03(_0x48ee06,_0x4a78f0);}function a38_0x28b0(){var _0x146a9b=['gray','1764504DYRfWq','1302LQuYKt','elapsed','21678zjymWQ','9791622zloyNw','1956lDVFGA','7815448LoomXB','13745dJwSrO','4227768oOOKTA','264105qSinvI'];a38_0x28b0=function(){return _0x146a9b;};return a38_0x28b0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x4865f7=a39_0x4070;(function(_0x2eae9c,_0x4e887d){const _0x3ae79f=a39_0x4070,_0x28f228=_0x2eae9c();while(!![]){try{const _0x557223=parseInt(_0x3ae79f(0xdc))/0x1+-parseInt(_0x3ae79f(0xee))/0x2*(parseInt(_0x3ae79f(0xe7))/0x3)+parseInt(_0x3ae79f(0xdf))/0x4*(parseInt(_0x3ae79f(0xeb))/0x5)+-parseInt(_0x3ae79f(0xda))/0x6+-parseInt(_0x3ae79f(0xe9))/0x7*(parseInt(_0x3ae79f(0xdd))/0x8)+-parseInt(_0x3ae79f(0xf0))/0x9*(parseInt(_0x3ae79f(0xf1))/0xa)+parseInt(_0x3ae79f(0xe6))/0xb*(parseInt(_0x3ae79f(0xf2))/0xc);if(_0x557223===_0x4e887d)break;else _0x28f228['push'](_0x28f228['shift']());}catch(_0x277a71){_0x28f228['push'](_0x28f228['shift']());}}}(a39_0x17b0,0x537d2));import a39_0x475fb1 from'node:path';import{fileURLToPath}from'node:url';function a39_0x17b0(){const _0x178d5f=['595314SPVqEG','resolve','583233hvPLfr','message','5TBTQPv','info','copy','4jBKyPk','url','497079hxuxfH','40gjCNtu','15704268hXqzwP','2920686RDlqJa','now','315455RoSPMd','48jHxYEM','error','1289284qQBrds','cwd','../../templates/projects/sub-app-react-demo','success','dirname','项目模板复制失败','开始复制项目模板','11ZFfQfR'];a39_0x17b0=function(){return _0x178d5f;};return a39_0x17b0();}function a39_0x4070(_0x36252c,_0x4bf394){const _0x17b098=a39_0x17b0();return a39_0x4070=function(_0x407046,_0xe95a7e){_0x407046=_0x407046-0xda;let _0x37be3c=_0x17b098[_0x407046];return _0x37be3c;},a39_0x4070(_0x36252c,_0x4bf394);}import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a39_0x475fb1[a39_0x4865f7(0xe3)](fileURLToPath(import.meta[a39_0x4865f7(0xef)])),templateDir=a39_0x475fb1['resolve'](__dirname,a39_0x4865f7(0xe1));export function useCopyProjectTemplate(){const [_0x834943,_0x1ca68f]=useState(![]),[_0x4b5b03,_0x1249d7]=useState(![]),[_0x422d96,_0x5d0a8a]=useState(''),_0x4bfc12=useCallback(async _0x36ddb6=>{const _0x48ddcc=a39_0x4070,_0x5206e2=Date[_0x48ddcc(0xdb)](),_0x1c23b5=a39_0x475fb1[_0x48ddcc(0xe8)](process[_0x48ddcc(0xe0)](),_0x36ddb6);_0x1ca68f(!![]);try{logger[_0x48ddcc(0xec)](_0x48ddcc(0xed),_0x48ddcc(0xe5),{'projectCode':_0x36ddb6,'templateDir':templateDir}),await copyDirectory(templateDir,_0x1c23b5);const _0x3853a2=Date[_0x48ddcc(0xdb)]()-_0x5206e2;logger[_0x48ddcc(0xe2)](_0x48ddcc(0xed),'项目模板复制完成',_0x3853a2,{'projectCode':_0x36ddb6});}catch(_0x3b6096){const _0x2b2f88=Date['now']()-_0x5206e2;logger[_0x48ddcc(0xde)](_0x48ddcc(0xed),_0x48ddcc(0xe4),{'projectCode':_0x36ddb6,'error':_0x3b6096 instanceof Error?_0x3b6096[_0x48ddcc(0xea)]:String(_0x3b6096),'duration':_0x2b2f88});throw _0x3b6096;}finally{_0x1ca68f(![]),_0x1249d7(!![]),_0x5d0a8a(formatElapsed(_0x5206e2));}},[]);return{'taskName':'复制项目文件','finished':_0x4b5b03,'loading':_0x834943,'elapsed':_0x422d96,'doTask':_0x4bfc12};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4cb3e5,_0x27d7db){const _0x481a26=a40_0x3383,_0x323c78=_0x4cb3e5();while(!![]){try{const _0x26060b=-parseInt(_0x481a26(0xa8))/0x1+-parseInt(_0x481a26(0xa5))/0x2+parseInt(_0x481a26(0xa6))/0x3+parseInt(_0x481a26(0xab))/0x4+parseInt(_0x481a26(0xa0))/0x5*(-parseInt(_0x481a26(0xac))/0x6)+parseInt(_0x481a26(0xaa))/0x7+parseInt(_0x481a26(0x9f))/0x8*(-parseInt(_0x481a26(0xa7))/0x9);if(_0x26060b===_0x27d7db)break;else _0x323c78['push'](_0x323c78['shift']());}catch(_0x32650d){_0x323c78['push'](_0x323c78['shift']());}}}(a40_0x1368,0x3ae07));import a40_0x1a2243 from'node:path';import{useCallback,useState}from'react';function a40_0x3383(_0x232be6,_0x4b397f){const _0x1368f3=a40_0x1368();return a40_0x3383=function(_0x33836d,_0x31f232){_0x33836d=_0x33836d-0x9b;let _0x4db702=_0x1368f3[_0x33836d];return _0x4db702;},a40_0x3383(_0x232be6,_0x4b397f);}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x27a513=a40_0x3383,[_0x3e55d6,_0x243100]=useState(![]),[_0x5169a8,_0x43cb76]=useState(![]),[_0x5dd9c7,_0x5e312b]=useState(''),_0x51a838=useCallback(async _0x57e185=>{const _0x5650af=a40_0x3383,_0x484fc2=Date['now'](),_0x3b0688=a40_0x1a2243[_0x5650af(0xa4)](process[_0x5650af(0x9e)](),_0x57e185);_0x243100(!![]);try{logger[_0x5650af(0x9d)]('format','开始格式化代码',{'projectCode':_0x57e185}),await execa('npx',[_0x5650af(0x9c),_0x5650af(0xae),'.'],{'cwd':_0x3b0688});const _0x536c2b=Date[_0x5650af(0x9b)]()-_0x484fc2;logger['success'](_0x5650af(0xa3),_0x5650af(0xa2),_0x536c2b,{'projectCode':_0x57e185});}catch(_0x1220b7){const _0x1dd82e=Date['now']()-_0x484fc2;logger[_0x5650af(0xad)](_0x5650af(0xa3),_0x5650af(0xa9),{'projectCode':_0x57e185,'error':_0x1220b7 instanceof Error?_0x1220b7['message']:String(_0x1220b7),'duration':_0x1dd82e});throw _0x1220b7;}finally{_0x243100(![]),_0x43cb76(!![]),_0x5e312b(formatElapsed(_0x484fc2));}},[]);return{'taskName':_0x27a513(0xa1),'finished':_0x5169a8,'loading':_0x3e55d6,'elapsed':_0x5dd9c7,'doTask':_0x51a838};}function a40_0x1368(){const _0x3eae01=['--write','now','prettier','info','cwd','32552wtlkYr','1860660VMvHNL','格式化代码','代码格式化完成','format','resolve','769676KYmzJC','1004739tSGour','18jYJdlO','73967SsWorF','代码格式化失败','1902684cSGtBT','1894036DSdSYZ','6TzjoPy','error'];a40_0x1368=function(){return _0x3eae01;};return a40_0x1368();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2de24b,_0x5133aa){const _0xf8a3a3=a41_0xab26,_0x149a6e=_0x2de24b();while(!![]){try{const _0x1d591a=parseInt(_0xf8a3a3(0x119))/0x1+-parseInt(_0xf8a3a3(0x116))/0x2+-parseInt(_0xf8a3a3(0x118))/0x3+parseInt(_0xf8a3a3(0x11b))/0x4+-parseInt(_0xf8a3a3(0x11f))/0x5*(-parseInt(_0xf8a3a3(0x122))/0x6)+parseInt(_0xf8a3a3(0x111))/0x7+parseInt(_0xf8a3a3(0x110))/0x8*(-parseInt(_0xf8a3a3(0x114))/0x9);if(_0x1d591a===_0x5133aa)break;else _0x149a6e['push'](_0x149a6e['shift']());}catch(_0xec0c11){_0x149a6e['push'](_0x149a6e['shift']());}}}(a41_0x396e,0x1cbeb));function a41_0xab26(_0x313b3d,_0x3b6c90){const _0x396e82=a41_0x396e();return a41_0xab26=function(_0xab2689,_0x417498){_0xab2689=_0xab2689-0x110;let _0xd002f4=_0x396e82[_0xab2689];return _0xd002f4;},a41_0xab26(_0x313b3d,_0x3b6c90);}import a41_0x306347 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 _0x5adf30=a41_0xab26,[_0x5d1adf,_0x1dc904]=useState(![]),[_0x51c417,_0x2b3a2c]=useState(![]),[_0x3b6ba5,_0x13e8a7]=useState(''),_0x117d76=useCallback(async _0x5cfa40=>{const _0x1b9b6b=a41_0xab26,_0x5941c6=Date[_0x1b9b6b(0x125)](),_0x364801=a41_0x306347['resolve'](process[_0x1b9b6b(0x120)](),_0x5cfa40);_0x1dc904(!![]),_0x2b3a2c(![]);const _0x173bd0=async(_0x21d3be,_0x517894)=>{await execa(_0x21d3be,_0x517894,{'cwd':_0x364801});};try{logger[_0x1b9b6b(0x11c)](_0x1b9b6b(0x115),_0x1b9b6b(0x113),{'projectCode':_0x5cfa40,'registry':_0x1b9b6b(0x123)}),await _0x173bd0(_0x1b9b6b(0x117),[_0x1b9b6b(0x115),_0x1b9b6b(0x124),_0x1b9b6b(0x123)]);const _0x10dc05=Date['now']()-_0x5941c6;logger[_0x1b9b6b(0x11d)](_0x1b9b6b(0x115),_0x1b9b6b(0x121),_0x10dc05,{'projectCode':_0x5cfa40});}catch(_0x111b54){const _0x469927=Date[_0x1b9b6b(0x125)]()-_0x5941c6;logger[_0x1b9b6b(0x112)](_0x1b9b6b(0x115),_0x1b9b6b(0x11e),{'projectCode':_0x5cfa40,'error':_0x111b54 instanceof Error?_0x111b54['message']:String(_0x111b54),'duration':_0x469927});throw _0x111b54;}finally{_0x1dc904(![]),_0x2b3a2c(!![]),_0x13e8a7(formatElapsed(_0x5941c6));}},[]);return{'taskName':_0x5adf30(0x11a),'finished':_0x51c417,'loading':_0x5d1adf,'elapsed':_0x3b6ba5,'doTask':_0x117d76};}function a41_0x396e(){const _0x240c28=['45zgbUjL','install','164734WZifCG','npm','291150GFgKoa','73625NNkWOj','安装依赖','718972SmIVNI','info','success','依赖安装失败','1975mHjAXV','cwd','依赖安装完成','834dRJTdU','https://registry.npmmirror.com','--registry','now','101008uixoMS','364091kdngsa','error','开始安装依赖'];a41_0x396e=function(){return _0x240c28;};return a41_0x396e();}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a42_0x40c8(_0x2b4baa,_0x3d6f68){var _0x1b52b6=a42_0x1b52();return a42_0x40c8=function(_0x40c801,_0xecd96f){_0x40c801=_0x40c801-0x171;var _0x320984=_0x1b52b6[_0x40c801];return _0x320984;},a42_0x40c8(_0x2b4baa,_0x3d6f68);}(function(_0x4bfa59,_0x5d299e){var _0x4d38af=a42_0x40c8,_0x38e088=_0x4bfa59();while(!![]){try{var _0x9a5794=parseInt(_0x4d38af(0x17c))/0x1+parseInt(_0x4d38af(0x174))/0x2+parseInt(_0x4d38af(0x177))/0x3+parseInt(_0x4d38af(0x178))/0x4+-parseInt(_0x4d38af(0x172))/0x5+parseInt(_0x4d38af(0x176))/0x6+-parseInt(_0x4d38af(0x17a))/0x7;if(_0x9a5794===_0x5d299e)break;else _0x38e088['push'](_0x38e088['shift']());}catch(_0x1febff){_0x38e088['push'](_0x38e088['shift']());}}}(a42_0x1b52,0x8b74c));function a42_0x1b52(){var _0x16b01d=['green','5355065kXTnUY','查看可用命令。','1066458wJzoMm','column','3110952YYNMwP','2739504ovyfzG','727232CKLAtI','!\x20请指定一个有效的命令。','4447443SGhpzz','lovrabet\x20--help','130877dxFhBJ'];a42_0x1b52=function(){return _0x16b01d;};return a42_0x1b52();}import{jsx as a42_0x3bae8a,jsxs as a42_0x443089}from'react/jsx-runtime';import{Box,Text}from'ink';export function Help(){var _0x56e44f=a42_0x40c8;return a42_0x443089(Box,{'flexDirection':_0x56e44f(0x175),'marginTop':0x1,'marginBottom':0x1,'children':[a42_0x443089(Box,{'children':[a42_0x3bae8a(Box,{'width':'1'}),a42_0x3bae8a(Text,{'children':_0x56e44f(0x179)})]}),a42_0x443089(Box,{'marginTop':0x1,'children':[a42_0x3bae8a(Box,{'width':'1'}),a42_0x443089(Text,{'children':['\x20\x20','使用']}),a42_0x443089(Text,{'bold':!![],'color':_0x56e44f(0x171),'children':['\x20',_0x56e44f(0x17b),'\x20']}),a42_0x3bae8a(Text,{'children':_0x56e44f(0x173)})]})]});}
|
package/lib/init/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x35be8b,_0x5622a6){const _0x5278d4=a43_0x30d2,_0x31e141=_0x35be8b();while(!![]){try{const _0x38d006=-parseInt(_0x5278d4(0x16b))/0x1*(parseInt(_0x5278d4(0x152))/0x2)+parseInt(_0x5278d4(0x14c))/0x3+parseInt(_0x5278d4(0x142))/0x4+parseInt(_0x5278d4(0x164))/0x5*(-parseInt(_0x5278d4(0x169))/0x6)+parseInt(_0x5278d4(0x16e))/0x7*(parseInt(_0x5278d4(0x158))/0x8)+-parseInt(_0x5278d4(0x13d))/0x9*(parseInt(_0x5278d4(0x165))/0xa)+parseInt(_0x5278d4(0x159))/0xb*(-parseInt(_0x5278d4(0x161))/0xc);if(_0x38d006===_0x5622a6)break;else _0x31e141['push'](_0x31e141['shift']());}catch(_0x3b9c03){_0x31e141['push'](_0x31e141['shift']());}}}(a43_0x342c,0x886b1));import{jsxs as a43_0x266edb,jsx as a43_0x44db9d}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';function a43_0x30d2(_0x127a84,_0xeb4193){const _0x342cb1=a43_0x342c();return a43_0x30d2=function(_0x30d2d5,_0x160624){_0x30d2d5=_0x30d2d5-0x13c;let _0x439b48=_0x342cb1[_0x30d2d5];return _0x439b48;},a43_0x30d2(_0x127a84,_0xeb4193);}export function Init({appcode:_0x2e1fc7,env:_0x5d0d87}){const _0x1840dd=a43_0x30d2,[_0x2c2aa9,_0x6bbad4]=useState(null),[_0x5c3ea4,_0xf959a]=useState(![]),[_0xaabb6f,_0xf4eaba]=useState(!_0x2e1fc7),[_0x90816,_0x42513d]=useState(''),[_0x2d6400,_0x2d7f14]=useState(''),[_0x4e968d,_0x58f6da]=useState(_0x2e1fc7||''),[_0xebb86c]=useState(_0x5d0d87);function _0x29f885(_0x238e33){const _0x1af6b9=a43_0x30d2;if(_0x238e33[_0x1af6b9(0x150)]===0x0)return{'valid':![],'message':''};if(_0x238e33[_0x1af6b9(0x150)]>0x64)return{'valid':![],'message':_0x1af6b9(0x13f)};const _0x426095=/^[A-Za-z0-9_-]+$/;if(!_0x426095[_0x1af6b9(0x14d)](_0x238e33))return{'valid':![],'message':_0x1af6b9(0x14f)};return{'valid':!![]};}useInput((_0x3b6806,_0x59dc96)=>{const _0x93e8ab=a43_0x30d2;if(!_0xaabb6f)return;if(_0x59dc96[_0x93e8ab(0x16c)]){if(_0x2d6400||!_0x90816[_0x93e8ab(0x173)]()){_0x2d7f14(_0x93e8ab(0x162));return;}const _0x41008b=_0x90816[_0x93e8ab(0x173)](),{valid:_0x49c8c6,message:_0x5d30a2}=_0x29f885(_0x41008b);if(!_0x49c8c6){_0x2d7f14(_0x5d30a2||_0x93e8ab(0x151));return;}_0x58f6da(_0x41008b),_0xf4eaba(![]);}else{if(_0x59dc96[_0x93e8ab(0x171)]||_0x59dc96[_0x93e8ab(0x154)])_0x42513d(_0x281f80=>{const _0x249911=_0x93e8ab,_0x590442=_0x281f80[_0x249911(0x15c)](0x0,-0x1);if(_0x590442[_0x249911(0x150)]===0x0)_0x2d7f14('');else{const {valid:_0x589aca,message:_0x239418}=_0x29f885(_0x590442);_0x2d7f14(_0x589aca?'':_0x239418||'应用代码不合法');}return _0x590442;});else _0x59dc96[_0x93e8ab(0x147)]&&_0x3b6806==='c'?process[_0x93e8ab(0x14e)](0x0):_0x42513d(_0x462e0b=>{const _0x5487e6=_0x93e8ab,_0x269187=_0x462e0b+_0x3b6806,{valid:_0x5950f5,message:_0x36d97b}=_0x29f885(_0x269187);return _0x2d7f14(_0x5950f5?'':_0x36d97b||_0x5487e6(0x151)),_0x269187;});}},{'isActive':_0xaabb6f}),useEffect(()=>{const _0x26c1d8=a43_0x30d2;if(!_0x4e968d||_0xaabb6f)return;const _0xe43bcd=resolve(process[_0x26c1d8(0x13e)](),_0x26c1d8(0x144));if(existsSync(_0xe43bcd)){_0x6bbad4(_0x26c1d8(0x15d)),setTimeout(()=>process[_0x26c1d8(0x14e)](0x1),0x64);return;}try{const _0x31d320=fileURLToPath(import.meta['url']),_0xc8c126=resolve(dirname(_0x31d320),_0x26c1d8(0x155)),_0x1859e3=join(_0xc8c126,_0x26c1d8(0x146));let _0x2760cb=_0x26c1d8(0x15a);try{const _0x4cb9ae=JSON[_0x26c1d8(0x15e)](readFileSync(_0x1859e3,_0x26c1d8(0x16d)));_0x2760cb=_0x4cb9ae[_0x26c1d8(0x140)]||_0x26c1d8(0x15a);}catch(_0x2ab24d){}const _0x538d8b=readConfig(),_0x87f4f0=typeof _0x538d8b[_0x26c1d8(0x167)]===_0x26c1d8(0x15f)?_0x538d8b[_0x26c1d8(0x167)]:undefined,{app:_0x53c2d5,appcode:_0x278a4e,..._0x5cbd30}=_0x538d8b,_0x57ee6c={..._0x5cbd30,'appcode':_0x4e968d,'env':_0xebb86c||_0x87f4f0||_0x26c1d8(0x16f),'createdAt':new Date()[_0x26c1d8(0x153)](),'version':_0x2760cb};writeFileSync(_0xe43bcd,JSON['stringify'](_0x57ee6c,null,0x2),{'encoding':_0x26c1d8(0x16d),'mode':0x180}),logger[_0x26c1d8(0x170)](process[_0x26c1d8(0x13e)]()),logger[_0x26c1d8(0x14b)](_0x26c1d8(0x143),'初始化项目配置文件成功',{'appcode':_0x4e968d,'env':_0x57ee6c[_0x26c1d8(0x167)],'version':_0x57ee6c[_0x26c1d8(0x140)],'configPath':_0xe43bcd}),_0xf959a(!![]),setTimeout(()=>process[_0x26c1d8(0x14e)](0x0),0x64);}catch(_0x3b0379){logger[_0x26c1d8(0x157)](_0x26c1d8(0x143),_0x26c1d8(0x172),{'error':_0x3b0379 instanceof Error?_0x3b0379[_0x26c1d8(0x141)]:String(_0x3b0379)}),_0x6bbad4(_0x26c1d8(0x156)+(_0x3b0379 instanceof Error?_0x3b0379[_0x26c1d8(0x141)]:String(_0x3b0379))),setTimeout(()=>process[_0x26c1d8(0x14e)](0x1),0x64);}},[_0x4e968d,_0xaabb6f,_0xebb86c]);if(_0x2c2aa9)return a43_0x44db9d(Box,{'flexDirection':_0x1840dd(0x149),'children':a43_0x266edb(Text,{'color':_0x1840dd(0x166),'children':['✗\x20',_0x2c2aa9]})});if(_0xaabb6f)return a43_0x266edb(Box,{'flexDirection':_0x1840dd(0x149),'children':[a43_0x266edb(Box,{'children':[a43_0x44db9d(Text,{'color':_0x1840dd(0x168),'children':_0x1840dd(0x14a)}),_0x90816?a43_0x44db9d(Text,{'color':'green','children':_0x90816}):a43_0x44db9d(Text,{'color':_0x1840dd(0x13c),'children':'_'}),_0x2d6400&&a43_0x266edb(Text,{'color':_0x1840dd(0x166),'children':[_0x1840dd(0x145),_0x2d6400]})]}),!_0x2d6400&&!_0x90816&&a43_0x44db9d(Box,{'children':a43_0x44db9d(Text,{'color':'gray','children':_0x1840dd(0x15b)})})]});if(_0x5c3ea4)return a43_0x266edb(Box,{'flexDirection':_0x1840dd(0x149),'children':[a43_0x44db9d(Text,{'color':_0x1840dd(0x160),'children':_0x1840dd(0x16a)}),a43_0x266edb(Text,{'color':'cyan','children':[_0x1840dd(0x148),_0x4e968d]}),a43_0x44db9d(Text,{'children':'现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了'})]});return a43_0x44db9d(Box,{'children':a43_0x44db9d(Text,{'children':_0x1840dd(0x163)})});}function a43_0x342c(){const _0x457ad9=['68845IAEYmz','online','setLogPath','backspace','创建配置文件失败','trim','gray','11862qUTVcN','cwd','应用代码长度不能超过\x20100\x20个字符','version','message','3639552qllXeY','init','.lovrabetrc','\x20←\x20','package.json','ctrl','AppCode:\x20','column','请输入应用代码\x20(AppCode):\x20','info','3025710ttyxNX','test','exit','应用代码只能包含字母、数字、-\x20和\x20_','length','应用代码不合法','18smOKNm','toLocaleString','delete','../..','创建配置文件失败:\x20','error','24BIHQOW','11axtENB','1.0.0','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','slice','当前目录已存在\x20.lovrabetrc\x20文件','parse','string','green','1564104idQowY','应用代码不能为空','正在初始化配置文件...','35DeGHkF','540DEpCGI','red','env','cyan','781206GDxoxk','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','30697dkemjf','return','utf8'];a43_0x342c=function(){return _0x457ad9;};return a43_0x342c();}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x561caa=a44_0x160a;function a44_0x500f(){const _0x466ef1=['.lovrabetrc','appcode','12280954aNodcU','2643048WrCXZa','app','17868550YwaPMa','1866XBPPML','5193Jddomy','437072tYFyNX','65272ZZXQwF','3678OCdMdB','trim','250UHNJfN','utf8','18872tmypQA','parse','cwd'];a44_0x500f=function(){return _0x466ef1;};return a44_0x500f();}(function(_0x557d17,_0x491cad){const _0x33ba4b=a44_0x160a,_0x16d3ef=_0x557d17();while(!![]){try{const _0x173212=-parseInt(_0x33ba4b(0x115))/0x1+-parseInt(_0x33ba4b(0x117))/0x2*(parseInt(_0x33ba4b(0x113))/0x3)+parseInt(_0x33ba4b(0x116))/0x4*(parseInt(_0x33ba4b(0x119))/0x5)+-parseInt(_0x33ba4b(0x110))/0x6+parseInt(_0x33ba4b(0x10f))/0x7+-parseInt(_0x33ba4b(0x11b))/0x8*(parseInt(_0x33ba4b(0x114))/0x9)+parseInt(_0x33ba4b(0x112))/0xa;if(_0x173212===_0x491cad)break;else _0x16d3ef['push'](_0x16d3ef['shift']());}catch(_0x26bf6c){_0x16d3ef['push'](_0x16d3ef['shift']());}}}(a44_0x500f,0xedf04));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a44_0x561caa(0x11d)](),a44_0x561caa(0x10d));function a44_0x160a(_0x1fd061,_0x3588a8){const _0x500f70=a44_0x500f();return a44_0x160a=function(_0x160abf,_0x1dbe05){_0x160abf=_0x160abf-0x10d;let _0x1a6567=_0x500f70[_0x160abf];return _0x1a6567;},a44_0x160a(_0x1fd061,_0x3588a8);}export const globalConfigPath=resolve(homedir(),a44_0x561caa(0x10d));export function readConfig(){const _0x275b5e=a44_0x561caa;let _0x370ca1={};try{if(existsSync(globalConfigPath)){const _0x3f5d3b=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x3f5d3b&&(_0x370ca1=JSON[_0x275b5e(0x11c)](_0x3f5d3b));}}catch(_0x5d627b){}try{if(existsSync(projectConfigPath)){const _0x2dbc69=readFileSync(projectConfigPath,{'encoding':_0x275b5e(0x11a)});if(_0x2dbc69){const _0x9c1c69=JSON[_0x275b5e(0x11c)](_0x2dbc69);_0x370ca1={..._0x370ca1,..._0x9c1c69};}}}catch(_0x21003b){}return _0x370ca1;}export function getConfigAppCode(){const _0x6e0d27=a44_0x561caa;let _0x1245a2={},_0x570c2d={};try{if(existsSync(globalConfigPath)){const _0x753f3f=readFileSync(globalConfigPath,{'encoding':_0x6e0d27(0x11a)});_0x753f3f&&(_0x570c2d=JSON[_0x6e0d27(0x11c)](_0x753f3f));}}catch(_0x56fb72){}try{if(existsSync(projectConfigPath)){const _0xd4d896=readFileSync(projectConfigPath,{'encoding':_0x6e0d27(0x11a)});_0xd4d896&&(_0x1245a2=JSON[_0x6e0d27(0x11c)](_0xd4d896));}}catch(_0x3e7f34){}let _0x2a688b;if(_0x6e0d27(0x10e)in _0x1245a2)_0x2a688b=_0x1245a2['appcode'];else{if(_0x6e0d27(0x111)in _0x1245a2)_0x2a688b=_0x1245a2[_0x6e0d27(0x111)];else{if('appcode'in _0x570c2d)_0x2a688b=_0x570c2d[_0x6e0d27(0x10e)];else'app'in _0x570c2d&&(_0x2a688b=_0x570c2d[_0x6e0d27(0x111)]);}}if(typeof _0x2a688b!=='string'||_0x2a688b[_0x6e0d27(0x118)]()==='')return undefined;return _0x2a688b;}export function isInProject(){return existsSync(projectConfigPath);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38fa8a,_0x28a1d3){const _0x1ae2cf=a45_0x547b,_0x2e773c=_0x38fa8a();while(!![]){try{const _0x40acd3=-parseInt(_0x1ae2cf(0x107))/0x1+-parseInt(_0x1ae2cf(0xfd))/0x2+-parseInt(_0x1ae2cf(0x103))/0x3+parseInt(_0x1ae2cf(0xf9))/0x4*(parseInt(_0x1ae2cf(0xfa))/0x5)+-parseInt(_0x1ae2cf(0xfc))/0x6*(parseInt(_0x1ae2cf(0x102))/0x7)+-parseInt(_0x1ae2cf(0xfe))/0x8*(parseInt(_0x1ae2cf(0xf8))/0x9)+parseInt(_0x1ae2cf(0x105))/0xa;if(_0x40acd3===_0x28a1d3)break;else _0x2e773c['push'](_0x2e773c['shift']());}catch(_0x131966){_0x2e773c['push'](_0x2e773c['shift']());}}}(a45_0x4d8f,0x4df99));function a45_0x547b(_0x56f21e,_0x351e46){const _0x4d8f39=a45_0x4d8f();return a45_0x547b=function(_0x547bb4,_0x5a7efe){_0x547bb4=_0x547bb4-0xf8;let _0x452cf9=_0x4d8f39[_0x547bb4];return _0x452cf9;},a45_0x547b(_0x56f21e,_0x351e46);}import a45_0x357659 from'node:path';function a45_0x4d8f(){const _0x127ed3=['error','join','mkdirSync','142751ZbtZlD','703212CLXTAm','readdirSync','17411020EuuRTf','name','189595dyyDrF','110052ZMCYWu','733364kiXBzE','5KgvqfB','复制目录时出错:','120cqKjZy','983910gypnJs','184igNrzC'];a45_0x4d8f=function(){return _0x127ed3;};return a45_0x4d8f();}import a45_0x513bd6 from'node:fs';export async function copyDirectory(_0x332249,_0x3e489a){const _0x2b9b2c=a45_0x547b;try{const _0x4d0943=a45_0x513bd6[_0x2b9b2c(0x104)](_0x332249,{'withFileTypes':!![]});a45_0x513bd6[_0x2b9b2c(0x101)](_0x3e489a,{'recursive':!![]});for(const _0x5afc5f of _0x4d0943){const _0x146a02=a45_0x357659[_0x2b9b2c(0x100)](_0x332249,_0x5afc5f[_0x2b9b2c(0x106)]),_0x4456d9=a45_0x357659[_0x2b9b2c(0x100)](_0x3e489a,_0x5afc5f[_0x2b9b2c(0x106)]);_0x5afc5f['isDirectory']()?await copyDirectory(_0x146a02,_0x4456d9):a45_0x513bd6['copyFileSync'](_0x146a02,_0x4456d9);}}catch(_0x164955){console[_0x2b9b2c(0xff)](_0x2b9b2c(0xfb),_0x164955);}}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2e5478,_0x22210f){const _0x28a787=a46_0x509c,_0xc583f9=_0x2e5478();while(!![]){try{const _0x5f4224=parseInt(_0x28a787(0x201))/0x1*(-parseInt(_0x28a787(0x1f6))/0x2)+-parseInt(_0x28a787(0x200))/0x3*(-parseInt(_0x28a787(0x204))/0x4)+-parseInt(_0x28a787(0x20b))/0x5*(-parseInt(_0x28a787(0x206))/0x6)+parseInt(_0x28a787(0x1f2))/0x7*(parseInt(_0x28a787(0x20c))/0x8)+parseInt(_0x28a787(0x1f9))/0x9+parseInt(_0x28a787(0x20e))/0xa*(parseInt(_0x28a787(0x20d))/0xb)+-parseInt(_0x28a787(0x1f4))/0xc;if(_0x5f4224===_0x22210f)break;else _0xc583f9['push'](_0xc583f9['shift']());}catch(_0x37e6d5){_0xc583f9['push'](_0xc583f9['shift']());}}}(a46_0x30e3,0x20bc1));export async function httpRequest(_0x5b3bef,_0x30669b={}){const _0xad6c5=a46_0x509c,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x30669b;let _0x15e8f5=null;for(let _0x3a86b3=0x0;_0x3a86b3<=retries;_0x3a86b3++){try{const _0x21ebd7=new AbortController(),_0x325d54=setTimeout(()=>_0x21ebd7[_0xad6c5(0x1f8)](),timeout),_0x5e12a1=await fetch(_0x5b3bef,{'headers':headers,'signal':_0x21ebd7[_0xad6c5(0x1fa)]});clearTimeout(_0x325d54);let _0x2b0228;const _0x2457cf=_0x5e12a1['headers'][_0xad6c5(0x1fc)]('content-type');return _0x2457cf?.['includes'](_0xad6c5(0x1f3))?_0x2b0228=await _0x5e12a1[_0xad6c5(0x203)]():_0x2b0228=await _0x5e12a1['text'](),{'ok':_0x5e12a1['ok'],'status':_0x5e12a1[_0xad6c5(0x1ff)],'statusText':_0x5e12a1[_0xad6c5(0x20a)],'data':_0x2b0228,'headers':_0x5e12a1[_0xad6c5(0x209)],'url':_0x5e12a1['url'],'text':()=>_0x5e12a1[_0xad6c5(0x207)]()};}catch(_0x57bf15){_0x15e8f5=_0x57bf15 instanceof Error?_0x57bf15:new Error(String(_0x57bf15));if(_0x3a86b3===retries)break;if(shouldRetry(_0x57bf15)){console['log'](_0xad6c5(0x1fe)+retryDelay+_0xad6c5(0x20f)+(_0x3a86b3+0x1)+_0xad6c5(0x1fd)),await sleep(retryDelay);continue;}else break;}}throw _0x15e8f5||new Error('Request\x20failed');}function shouldRetry(_0x57c8a2){const _0x4ec3ce=a46_0x509c;if(_0x57c8a2 instanceof Error){if(_0x57c8a2[_0x4ec3ce(0x202)]===_0x4ec3ce(0x1f5))return![];if(_0x57c8a2[_0x4ec3ce(0x202)]===_0x4ec3ce(0x1fb)&&_0x57c8a2[_0x4ec3ce(0x205)]['includes']('fetch'))return!![];if(_0x57c8a2[_0x4ec3ce(0x205)][_0x4ec3ce(0x208)]('ECONNRESET'))return!![];if(_0x57c8a2[_0x4ec3ce(0x205)][_0x4ec3ce(0x208)](_0x4ec3ce(0x1f7)))return![];}return![];}function a46_0x509c(_0xdad98,_0x31b658){const _0x30e304=a46_0x30e3();return a46_0x509c=function(_0x509c0f,_0x36f76b){_0x509c0f=_0x509c0f-0x1f2;let _0x3ec401=_0x30e304[_0x509c0f];return _0x3ec401;},a46_0x509c(_0xdad98,_0x31b658);}function sleep(_0x4f6140){return new Promise(_0x4c5603=>setTimeout(_0x4c5603,_0x4f6140));}function a46_0x30e3(){const _0x2b57b5=['ms\x20后进行第\x20','471373OyonEJ','application/json','4716984AXCQeZ','AbortError','2QWlKrV','ENOTFOUND','abort','2264139PyGZLZ','signal','TypeError','get','\x20次重试...','*\x20请求失败,','status','51EmIHyF','91781ewSdwP','name','json','652bPrPOZ','message','965088Poolcv','text','includes','headers','statusText','5rwEprx','16GxosiN','54274MECmNY','140BZduxU'];a46_0x30e3=function(){return _0x2b57b5;};return a46_0x30e3();}export function validateUrl(_0x3cff62){try{return new URL(_0x3cff62),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x496202=a47_0x237d;(function(_0x10ce0b,_0x5d5200){const _0xabdc2a=a47_0x237d,_0x4d00b8=_0x10ce0b();while(!![]){try{const _0x53d3ae=-parseInt(_0xabdc2a(0x93))/0x1+-parseInt(_0xabdc2a(0x95))/0x2+parseInt(_0xabdc2a(0x7c))/0x3+-parseInt(_0xabdc2a(0x8a))/0x4*(-parseInt(_0xabdc2a(0x8b))/0x5)+parseInt(_0xabdc2a(0x96))/0x6+-parseInt(_0xabdc2a(0x73))/0x7*(parseInt(_0xabdc2a(0x6c))/0x8)+parseInt(_0xabdc2a(0x81))/0x9;if(_0x53d3ae===_0x5d5200)break;else _0x4d00b8['push'](_0x4d00b8['shift']());}catch(_0x488452){_0x4d00b8['push'](_0x4d00b8['shift']());}}}(a47_0x5250,0x5527c));import a47_0x44c7f3 from'winston';function a47_0x237d(_0x18114c,_0x37bea1){const _0x52501a=a47_0x5250();return a47_0x237d=function(_0x237d44,_0x3671ca){_0x237d44=_0x237d44-0x65;let _0x2dadab=_0x52501a[_0x237d44];return _0x2dadab;},a47_0x237d(_0x18114c,_0x37bea1);}import a47_0x240a49 from'node:fs';import a47_0x5ac68c from'node:path';class Logger{[a47_0x496202(0x83)];[a47_0x496202(0x74)];[a47_0x496202(0x79)]='';constructor(){const _0x2612b5=a47_0x496202;this[_0x2612b5(0x74)]='';}[a47_0x496202(0x6b)](_0x11063e){this['currentRawCommand']=_0x11063e;}['initWinstonLogger'](){const _0x48c5fc=a47_0x496202,_0x26a07c=a47_0x5ac68c[_0x48c5fc(0x68)](this[_0x48c5fc(0x74)]);!a47_0x240a49[_0x48c5fc(0x7d)](_0x26a07c)&&a47_0x240a49[_0x48c5fc(0x67)](_0x26a07c,{'recursive':!![]});const _0x1897a8=a47_0x44c7f3[_0x48c5fc(0x7e)][_0x48c5fc(0x98)](a47_0x44c7f3[_0x48c5fc(0x7e)][_0x48c5fc(0x7a)](),a47_0x44c7f3[_0x48c5fc(0x7e)][_0x48c5fc(0x80)]({'stack':!![]}),a47_0x44c7f3['format'][_0x48c5fc(0x86)](_0x40b60a=>{const _0x239637=_0x48c5fc,_0x3c181e={'timestamp':_0x40b60a['timestamp']||new Date()[_0x239637(0x6a)](),'level':_0x40b60a[_0x239637(0x8e)]||'info','command':_0x40b60a[_0x239637(0x99)]||_0x239637(0x82),'rawCommand':_0x40b60a[_0x239637(0x70)]||this[_0x239637(0x79)]||undefined,'message':_0x40b60a['message']||'','duration':_0x40b60a[_0x239637(0x71)]||undefined,'details':_0x40b60a[_0x239637(0x65)]||undefined};return JSON[_0x239637(0x66)](_0x3c181e);}));this[_0x48c5fc(0x83)]=a47_0x44c7f3[_0x48c5fc(0x87)]({'level':_0x48c5fc(0x75),'format':_0x1897a8,'transports':[new a47_0x44c7f3[(_0x48c5fc(0x92))]['File']({'filename':this[_0x48c5fc(0x74)],'level':'info'})],'silent':![]}),a47_0x44c7f3['addColors']({'success':'green','error':_0x48c5fc(0x6f),'warn':_0x48c5fc(0x84),'info':_0x48c5fc(0x76)});}[a47_0x496202(0x85)](_0x1c763f){const _0x5acc77=a47_0x496202;this[_0x5acc77(0x74)]=a47_0x5ac68c[_0x5acc77(0x97)](_0x1c763f,_0x5acc77(0x94)),this['winstonLogger']&&this[_0x5acc77(0x83)][_0x5acc77(0x90)](),this[_0x5acc77(0x8d)]();}[a47_0x496202(0x75)](_0x3e8320,_0x13b1ec,_0x38dc8e){const _0x1d4738=a47_0x496202;if(!this[_0x1d4738(0x74)]||!this['winstonLogger'])return;this[_0x1d4738(0x83)][_0x1d4738(0x75)](_0x13b1ec,{'command':_0x3e8320,'details':_0x38dc8e});}['success'](_0x5916bf,_0x5b3b58,_0x573c0c,_0x6ff11e){const _0x544fd6=a47_0x496202;if(!this[_0x544fd6(0x74)]||!this['winstonLogger'])return;this[_0x544fd6(0x83)]['log'](_0x544fd6(0x75),_0x5b3b58,{'level':_0x544fd6(0x8c),'command':_0x5916bf,'duration':_0x573c0c,'details':_0x6ff11e});}[a47_0x496202(0x9a)](_0x57919b,_0x6db6b9,_0x3d6a2b){const _0x1e7bb2=a47_0x496202;if(!this[_0x1e7bb2(0x74)]||!this[_0x1e7bb2(0x83)])return;this[_0x1e7bb2(0x83)][_0x1e7bb2(0x9a)](_0x6db6b9,{'command':_0x57919b,'details':_0x3d6a2b});}[a47_0x496202(0x7f)](_0x51c2ac,_0x364a46,_0x11b5c8){const _0x1c874c=a47_0x496202;if(!this[_0x1c874c(0x74)]||!this[_0x1c874c(0x83)])return;this['winstonLogger'][_0x1c874c(0x7f)](_0x364a46,{'command':_0x51c2ac,'details':_0x11b5c8});}async['logTask'](_0x22ecd4,_0x273b21,_0x20c641){const _0x1e873c=a47_0x496202,_0x3bbe64=Date[_0x1e873c(0x8f)]();this[_0x1e873c(0x75)](_0x22ecd4,'开始执行:\x20'+_0x273b21);try{const _0x447cfb=await _0x20c641(),_0xf8e2ff=Date[_0x1e873c(0x8f)]()-_0x3bbe64;return this['success'](_0x22ecd4,'完成:\x20'+_0x273b21,_0xf8e2ff),_0x447cfb;}catch(_0x2d29ee){const _0x50f772=Date['now']()-_0x3bbe64;this['error'](_0x22ecd4,_0x1e873c(0x91)+_0x273b21,{'error':_0x2d29ee instanceof Error?_0x2d29ee['message']:String(_0x2d29ee),'duration':_0x50f772});throw _0x2d29ee;}}[a47_0x496202(0x88)](){const _0x59538c=a47_0x496202;try{if(!a47_0x240a49[_0x59538c(0x7d)](this[_0x59538c(0x74)]))return[];const _0x34d84b=a47_0x240a49['readFileSync'](this[_0x59538c(0x74)],'utf8');return _0x34d84b[_0x59538c(0x78)]('\x0a')[_0x59538c(0x6e)](_0x2da79b=>_0x2da79b[_0x59538c(0x69)]())[_0x59538c(0x72)](_0x176a31=>JSON[_0x59538c(0x89)](_0x176a31));}catch(_0x5bc505){return console['warn'](_0x59538c(0x6d),_0x5bc505),[];}}['clearLogs'](){const _0xec520f=a47_0x496202;try{a47_0x240a49[_0xec520f(0x7d)](this[_0xec520f(0x74)])&&a47_0x240a49['writeFileSync'](this[_0xec520f(0x74)],'','utf8');}catch(_0x376a24){console['warn'](_0xec520f(0x77),_0x376a24);}}[a47_0x496202(0x7b)](){const _0x42adc7=a47_0x496202;return this[_0x42adc7(0x83)];}}function a47_0x5250(){const _0x1d7b4e=['timestamp','getWinstonInstance','1203117JLhSrX','existsSync','format','warn','errors','6049323lqdPnX','unknown','winstonLogger','yellow','setLogPath','printf','createLogger','readLogs','parse','245764HJZWPm','5XqnTBk','success','initWinstonLogger','level','now','clear','失败:\x20','transports','491044LuoTPw','.lovrabet.log','1137800Lnnoee','2803704UsZgAu','join','combine','command','error','details','stringify','mkdirSync','dirname','trim','toISOString','setRawCommand','140488eMYiYp','Failed\x20to\x20read\x20logs:','filter','red','rawCommand','duration','map','77tFrXVK','logFilePath','info','blue','Failed\x20to\x20clear\x20logs:','split','currentRawCommand'];a47_0x5250=function(){return _0x1d7b4e;};return a47_0x5250();}export const logger=new Logger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x38e8b9=a48_0x7df6;(function(_0x73f4fc,_0x213ceb){const _0x3f5f32=a48_0x7df6,_0x30160e=_0x73f4fc();while(!![]){try{const _0xb42b56=-parseInt(_0x3f5f32(0x1eb))/0x1+-parseInt(_0x3f5f32(0x1e5))/0x2+-parseInt(_0x3f5f32(0x1dc))/0x3+parseInt(_0x3f5f32(0x1e3))/0x4+-parseInt(_0x3f5f32(0x1f2))/0x5+parseInt(_0x3f5f32(0x1e8))/0x6+-parseInt(_0x3f5f32(0x1f1))/0x7*(-parseInt(_0x3f5f32(0x1e0))/0x8);if(_0xb42b56===_0x213ceb)break;else _0x30160e['push'](_0x30160e['shift']());}catch(_0x56c535){_0x30160e['push'](_0x30160e['shift']());}}}(a48_0x1d92,0x5654c));function a48_0x7df6(_0x215ecf,_0x1354fc){const _0x1d921e=a48_0x1d92();return a48_0x7df6=function(_0x7df63f,_0x49adaa){_0x7df63f=_0x7df63f-0x1d5;let _0x4057fa=_0x1d921e[_0x7df63f];return _0x4057fa;},a48_0x7df6(_0x215ecf,_0x1354fc);}import a48_0x15ddc1 from'node:fs';function a48_0x1d92(){const _0x10c934=['path:\x20\x22','441541FUPGbG','slice','indexOf','开始更新路由配置','now','includes','5753006QijoEd','2943760aTCEOO','未找到路由配置的\x20children\x20数组','length','join','promises','addRoute','writeFile','addPageRoute','readFile','existsSync','previewChanges','map','路由文件不存在:\x20','router','toComponentName','utf8','info','toUpperCase','路由配置更新失败','match','split','addImport','291201uJelhG','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','lastIndexOf','routerFilePath','8HWdVDu','success','\x20from\x20\x22../pages/','1330016YBUTft','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','245412yNwHxD','index','error','2695896JZUqMB','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},'];a48_0x1d92=function(){return _0x10c934;};return a48_0x1d92();}import a48_0x6dbbea from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a48_0x38e8b9(0x1df)];constructor(_0x4889d5){const _0x1ccdf7=a48_0x38e8b9;this[_0x1ccdf7(0x1df)]=a48_0x6dbbea['join'](_0x4889d5,'src','router','index.tsx');}async[a48_0x38e8b9(0x1f9)](_0x42fc83,_0x115217){const _0x58be14=a48_0x38e8b9;if(!a48_0x15ddc1[_0x58be14(0x1fb)](this[_0x58be14(0x1df)]))throw new Error(_0x58be14(0x1fe)+this[_0x58be14(0x1df)]);const _0x31a298=Date[_0x58be14(0x1ef)]();logger[_0x58be14(0x1d6)](_0x58be14(0x1ff),_0x58be14(0x1ee),{'pageName':_0x42fc83,'routePath':_0x115217,'file':this[_0x58be14(0x1df)]});try{const _0x1c4402=await a48_0x15ddc1['promises']['readFile'](this['routerFilePath'],_0x58be14(0x1d5)),_0x262003=this['toComponentName'](_0x42fc83),_0x4aaeb2=this[_0x58be14(0x1db)](_0x1c4402,_0x262003,_0x42fc83),_0x11fe0d=this[_0x58be14(0x1f7)](_0x4aaeb2,_0x115217,_0x262003);await a48_0x15ddc1[_0x58be14(0x1f6)][_0x58be14(0x1f8)](this[_0x58be14(0x1df)],_0x11fe0d,_0x58be14(0x1d5));const _0x1214bd=Date['now']()-_0x31a298;logger[_0x58be14(0x1e1)](_0x58be14(0x1ff),'路由配置更新完成',_0x1214bd,{'pageName':_0x42fc83,'routePath':_0x115217,'componentName':_0x262003});}catch(_0x3d380e){const _0x5d89d4=Date[_0x58be14(0x1ef)]()-_0x31a298;logger[_0x58be14(0x1e7)](_0x58be14(0x1ff),_0x58be14(0x1d8),{'pageName':_0x42fc83,'routePath':_0x115217,'error':_0x3d380e instanceof Error?_0x3d380e['message']:String(_0x3d380e),'duration':_0x5d89d4});throw _0x3d380e;}}[a48_0x38e8b9(0x200)](_0x20cb52){const _0x13a819=a48_0x38e8b9;return _0x20cb52[_0x13a819(0x1da)]('-')[_0x13a819(0x1fd)](_0x282415=>_0x282415['charAt'](0x0)[_0x13a819(0x1d7)]()+_0x282415[_0x13a819(0x1ec)](0x1)['toLowerCase']())[_0x13a819(0x1f5)]('');}[a48_0x38e8b9(0x1db)](_0x2beefe,_0x430a27,_0x19c521){const _0x1fa320=a48_0x38e8b9,_0x53b711=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x24d4f8=_0x2beefe[_0x1fa320(0x1d9)](_0x53b711)||[],_0x4198a9='import\x20'+_0x430a27+_0x1fa320(0x1e2)+_0x19c521+'\x22;';if(_0x2beefe[_0x1fa320(0x1f0)](_0x4198a9))return _0x2beefe;if(_0x24d4f8['length']>0x0){const _0x2929be=_0x24d4f8[_0x24d4f8[_0x1fa320(0x1f4)]-0x1];if(_0x2929be){const _0x253269=_0x2beefe['lastIndexOf'](_0x2929be),_0x2af885=_0x253269+_0x2929be['length'];return _0x2beefe[_0x1fa320(0x1ec)](0x0,_0x2af885)+_0x4198a9+'\x0a'+_0x2beefe[_0x1fa320(0x1ec)](_0x2af885);}}const _0x11dd66=_0x2beefe[_0x1fa320(0x1d9)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x11dd66&&_0x11dd66['index']!==undefined){const _0x26925c=_0x11dd66['index']+_0x11dd66[0x0]['length'];return _0x2beefe[_0x1fa320(0x1ec)](0x0,_0x26925c)+_0x4198a9+'\x0a'+_0x2beefe[_0x1fa320(0x1ec)](_0x26925c);}return _0x2beefe;}[a48_0x38e8b9(0x1f7)](_0x2112fb,_0x204a82,_0x38d039){const _0x2934ca=a48_0x38e8b9,_0x438a63=_0x2934ca(0x1dd)+_0x204a82+_0x2934ca(0x1e4)+_0x38d039+_0x2934ca(0x1e9);if(_0x2112fb['includes'](_0x2934ca(0x1ea)+_0x204a82+'\x22'))return _0x2112fb;const _0x3e19f1=/children:\s*\[([\s\S]*?)\]/,_0x38c7ce=_0x2112fb[_0x2934ca(0x1d9)](_0x3e19f1);if(!_0x38c7ce||_0x38c7ce['index']===undefined)throw new Error(_0x2934ca(0x1f3));const _0x3b05a3=_0x38c7ce[0x1],_0x493d6f=_0x38c7ce[_0x2934ca(0x1e6)]+_0x38c7ce[0x0][_0x2934ca(0x1ed)]('[')+0x1,_0x5edd0b=_0x3b05a3?.['match'](/\{[\s\S]*?\},/g)||[];if(_0x5edd0b[_0x2934ca(0x1f4)]>0x0){const _0x34a302=_0x5edd0b[_0x5edd0b[_0x2934ca(0x1f4)]-0x1];if(_0x34a302){const _0x5c155d=_0x2112fb[_0x2934ca(0x1de)](_0x34a302),_0x3dd1e5=_0x5c155d+_0x34a302['length'];return _0x2112fb['slice'](0x0,_0x3dd1e5)+'\x0a'+_0x438a63+_0x2112fb[_0x2934ca(0x1ec)](_0x3dd1e5);}}return _0x2112fb['slice'](0x0,_0x493d6f)+'\x0a'+_0x438a63+_0x2112fb[_0x2934ca(0x1ec)](_0x493d6f);}async[a48_0x38e8b9(0x1fc)](_0x449221,_0x200cf8){const _0x205b5b=a48_0x38e8b9;if(!a48_0x15ddc1[_0x205b5b(0x1fb)](this['routerFilePath']))throw new Error(_0x205b5b(0x1fe)+this[_0x205b5b(0x1df)]);const _0x26b5f0=await a48_0x15ddc1['promises'][_0x205b5b(0x1fa)](this[_0x205b5b(0x1df)],_0x205b5b(0x1d5)),_0x3a30bb=this[_0x205b5b(0x200)](_0x449221);let _0x1a50fd=this[_0x205b5b(0x1db)](_0x26b5f0,_0x3a30bb,_0x449221);return _0x1a50fd=this[_0x205b5b(0x1f7)](_0x1a50fd,_0x200cf8,_0x3a30bb),_0x1a50fd;}}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x335329){return new Promise(_0x3f7a59=>setTimeout(_0x3f7a59,_0x335329));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x136ed8=a50_0x4cde;(function(_0x2fe203,_0x4839ee){const _0x1b3e48=a50_0x4cde,_0x2d1653=_0x2fe203();while(!![]){try{const _0x255f5c=parseInt(_0x1b3e48(0x9f))/0x1+parseInt(_0x1b3e48(0xbb))/0x2*(parseInt(_0x1b3e48(0x99))/0x3)+-parseInt(_0x1b3e48(0x98))/0x4*(parseInt(_0x1b3e48(0xae))/0x5)+-parseInt(_0x1b3e48(0xc4))/0x6*(parseInt(_0x1b3e48(0xa1))/0x7)+parseInt(_0x1b3e48(0xbe))/0x8+-parseInt(_0x1b3e48(0xc2))/0x9+parseInt(_0x1b3e48(0xd0))/0xa*(-parseInt(_0x1b3e48(0x95))/0xb);if(_0x255f5c===_0x4839ee)break;else _0x2d1653['push'](_0x2d1653['shift']());}catch(_0x550254){_0x2d1653['push'](_0x2d1653['shift']());}}}(a50_0x17c7,0x6fc71));import a50_0x2ab93d from'node:fs';import a50_0x367be6 from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static['toComponentName'](_0x2d5f6f){const _0xd4fa76=a50_0x4cde,_0x16ab41=_0x2d5f6f[_0xd4fa76(0xa3)]('/')[_0xd4fa76(0xcc)]()||_0x2d5f6f;return _0x16ab41[_0xd4fa76(0xa3)]('-')[_0xd4fa76(0x9a)](_0x1e89d5=>_0x1e89d5[_0xd4fa76(0xa5)](0x0)[_0xd4fa76(0xbf)]()+_0x1e89d5[_0xd4fa76(0xba)](0x1)[_0xd4fa76(0xab)]())[_0xd4fa76(0xa9)]('');}static[a50_0x136ed8(0xc9)](_0x24b740){const _0x1be72b=a50_0x136ed8,_0x4ccec5=_0x24b740[_0x1be72b(0xa3)]('/')[_0x1be72b(0xcc)]()||_0x24b740;return _0x4ccec5[_0x1be72b(0xa3)]('-')[_0x1be72b(0x9a)](_0xa40243=>_0xa40243[_0x1be72b(0xa5)](0x0)[_0x1be72b(0xbf)]()+_0xa40243[_0x1be72b(0xba)](0x1)[_0x1be72b(0xab)]())[_0x1be72b(0xa9)]('\x20');}static[a50_0x136ed8(0xce)](_0x360bfd,_0x1c6194,_0x2c041f){const _0x56c116=a50_0x136ed8,_0x12b866=this[_0x56c116(0xa7)](_0x1c6194),_0x4709af=this[_0x56c116(0xc9)](_0x1c6194),_0x34261e=new Date(),_0x3d8f55=_0x34261e['toLocaleString'](undefined,{'year':_0x56c116(0xa6),'month':_0x56c116(0xc3),'day':_0x56c116(0xc3),'hour':_0x56c116(0xc3),'minute':_0x56c116(0xc3),'second':_0x56c116(0xc3),'hour12':![]})[_0x56c116(0x94)](/\//g,'-'),_0x5a312f=_0x34261e[_0x56c116(0xca)](undefined,{'year':_0x56c116(0xa6),'month':'2-digit','day':_0x56c116(0xc3)})[_0x56c116(0x94)](/\//g,'-'),_0x287432=_0x34261e[_0x56c116(0xb1)](undefined,{'hour12':![]});let _0x3c356c=_0x360bfd[_0x56c116(0x94)](/\{ComponentName\}/g,_0x12b866)[_0x56c116(0x94)](/\{DisplayTitle\}/g,_0x4709af)['replace'](/\{PageName\}/g,_0x1c6194)[_0x56c116(0x94)](/\{TemplateName\}/g,_0x2c041f)[_0x56c116(0x94)](/\{CreatedAt\}/g,_0x3d8f55)[_0x56c116(0x94)](/\{CreatedDate\}/g,_0x5a312f)[_0x56c116(0x94)](/\{CreatedTime\}/g,_0x287432);return _0x3c356c;}static[a50_0x136ed8(0xb9)](_0x538ccf,_0x19c837,_0x5986f4,_0x4942a1,_0x13b29b,_0x405584,_0x4334f5){const _0x144ae6=a50_0x136ed8,_0x32008d=new Date(),_0x16cb80=_0x32008d[_0x144ae6(0xb3)](),_0x5c8e9a=JSON[_0x144ae6(0xa4)](_0x5986f4,null,0x2)['split']('\x0a')[_0x144ae6(0xba)](0x1,-0x1)[_0x144ae6(0x9a)](_0x3d55fe=>_0x3d55fe[_0x144ae6(0x94)](/^ /,'\x20\x20\x20\x20'))[_0x144ae6(0xa9)]('\x0a'),_0x222551=_0x4942a1||Object[_0x144ae6(0xcb)](_0x5986f4)[0x0]||_0x144ae6(0xad);let _0xaba89=_0x538ccf['replace'](/\{AppCode\}/g,_0x19c837)[_0x144ae6(0x94)](/\{ModelConfigs\}/g,_0x5c8e9a)['replace'](/\{ExampleModelName\}/g,_0x222551)[_0x144ae6(0x94)](/\{ApiFileName\}/g,_0x13b29b||_0x144ae6(0x97))[_0x144ae6(0x94)](/\{ConfigName\}/g,_0x405584||_0x144ae6(0xa8))[_0x144ae6(0x94)](/\{ClientConfigParam\}/g,_0x4334f5||'')[_0x144ae6(0x94)](/\{CreatedAt\}/g,_0x16cb80);return _0xaba89;}static async[a50_0x136ed8(0xaf)](_0x491a05,_0x5cba7c,_0x5db330,_0x2be783,_0x3d13a1=!![]){const _0x762f67=a50_0x136ed8,_0x33a995=Date['now']();try{_0x3d13a1&&logger['info'](_0x762f67(0xb4),_0x762f67(0xcd),{'templatePath':_0x491a05,'targetPath':_0x5cba7c,'pageName':_0x5db330,'templateName':_0x2be783});await a50_0x2ab93d['promises'][_0x762f67(0xb8)](_0x5cba7c,{'recursive':!![]}),await this['processDirectory'](_0x491a05,_0x5cba7c,_0x5db330,_0x2be783);if(_0x3d13a1){const _0x12587a=Date['now']()-_0x33a995;logger[_0x762f67(0xac)](_0x762f67(0xb4),_0x762f67(0xc6),_0x12587a,{'pageName':_0x5db330,'templateName':_0x2be783});}}catch(_0x4f6da1){if(_0x3d13a1){const _0x354375=Date['now']()-_0x33a995;logger[_0x762f67(0x9c)](_0x762f67(0xb4),_0x762f67(0xa2),{'templatePath':_0x491a05,'targetPath':_0x5cba7c,'pageName':_0x5db330,'templateName':_0x2be783,'error':_0x4f6da1 instanceof Error?_0x4f6da1[_0x762f67(0xc1)]:String(_0x4f6da1),'duration':_0x354375});}throw _0x4f6da1;}}static async[a50_0x136ed8(0xbc)](_0x3aee0a,_0xc6e126,_0x16d379,_0x392fb0){const _0xe99ed3=a50_0x136ed8,_0x7edf9a=await a50_0x2ab93d[_0xe99ed3(0xc0)][_0xe99ed3(0xc8)](_0x3aee0a,{'withFileTypes':!![]});for(const _0x141a99 of _0x7edf9a){const _0x5be2e0=a50_0x367be6['join'](_0x3aee0a,_0x141a99[_0xe99ed3(0xb7)]);let _0x567ece=a50_0x367be6[_0xe99ed3(0xa9)](_0xc6e126,_0x141a99[_0xe99ed3(0xb7)]);_0x141a99[_0xe99ed3(0xb7)][_0xe99ed3(0x9d)](_0xe99ed3(0xb6))&&(_0x567ece=a50_0x367be6[_0xe99ed3(0xa9)](_0xc6e126,_0x141a99[_0xe99ed3(0xb7)][_0xe99ed3(0x94)](/\.tpl$/,'')));if(_0x141a99[_0xe99ed3(0xa0)]())await a50_0x2ab93d[_0xe99ed3(0xc0)][_0xe99ed3(0xb8)](_0x567ece,{'recursive':!![]}),await this[_0xe99ed3(0xbc)](_0x5be2e0,_0x567ece,_0x16d379,_0x392fb0);else _0x141a99[_0xe99ed3(0xbd)]()&&await this[_0xe99ed3(0x9b)](_0x5be2e0,_0x567ece,_0x16d379,_0x392fb0);}}static async[a50_0x136ed8(0x9b)](_0x7a7812,_0x12e9e3,_0x45de27,_0x4b61dd){const _0x5a61e1=a50_0x136ed8,_0x172952=a50_0x367be6[_0x5a61e1(0xaa)](_0x7a7812)['toLowerCase']();_0x7a7812[_0x5a61e1(0x9d)](_0x5a61e1(0xb6))&&(_0x12e9e3=_0x12e9e3[_0x5a61e1(0x94)](/\.tpl$/,''));const _0x337886=[_0x5a61e1(0xb0),_0x5a61e1(0xc5),'.jsx',_0x5a61e1(0xb2),_0x5a61e1(0xb5),_0x5a61e1(0xc7),'.css',_0x5a61e1(0x9e),'.tpl'];if(_0x337886[_0x5a61e1(0x96)](_0x172952)||_0x7a7812[_0x5a61e1(0x9d)](_0x5a61e1(0xb6))){const _0x3d8622=await a50_0x2ab93d[_0x5a61e1(0xc0)]['readFile'](_0x7a7812,_0x5a61e1(0xcf)),_0x271f15=this[_0x5a61e1(0xce)](_0x3d8622,_0x45de27,_0x4b61dd);await a50_0x2ab93d[_0x5a61e1(0xc0)]['writeFile'](_0x12e9e3,_0x271f15,_0x5a61e1(0xcf));}else await a50_0x2ab93d[_0x5a61e1(0xc0)]['copyFile'](_0x7a7812,_0x12e9e3);}}function a50_0x4cde(_0x5d20ad,_0x48cfa7){const _0x17c7ef=a50_0x17c7();return a50_0x4cde=function(_0x4cde60,_0x4920ec){_0x4cde60=_0x4cde60-0x94;let _0x5be43f=_0x17c7ef[_0x4cde60];return _0x5be43f;},a50_0x4cde(_0x5d20ad,_0x48cfa7);}function a50_0x17c7(){const _0x335caa=['charAt','numeric','toComponentName','default','join','extname','toLowerCase','success','YourModel','65635YFovly','processTemplate','.tsx','toLocaleTimeString','.js','toISOString','template','.json','.tpl','name','mkdir','replaceApiContent','slice','585266GiSBpl','processDirectory','isFile','6307168sUFYnb','toUpperCase','promises','message','489519ILHBic','2-digit','486CYohzf','.ts','模板内容替换完成','.md','readdir','toDisplayTitle','toLocaleDateString','keys','pop','开始处理模板内容替换','replaceContent','utf8','3870450xPGuRU','replace','11dRVirl','includes','api','112eUbRQz','9xmfphb','map','processFile','error','endsWith','.scss','289119iURNRg','isDirectory','59507AToXCF','模板内容替换失败','split','stringify'];a50_0x17c7=function(){return _0x335caa;};return a50_0x17c7();}
|