@lovrabet/cli 1.1.6 → 1.1.7
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-pull-ui.js +1 -1
- package/lib/api/format-dataset.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/api/pull.js +1 -1
- package/lib/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/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/template-replacer.js +1 -1
- package/package.json +1 -1
package/lib/cmd/build-watch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a17_0x2154(){const _0x1fa6c3=['npm\x20run\x20build\x20exited\x20with\x20code\x20','2640491lKfzrs','build','--watch','2010363oaSwmg','24427304VEltdW','close','2197280vvsmBv','node_modules','error','7434145LYLVIm','3216744UMuMhe','4IWhFDJ','206496TSGcsy','cwd','env','.bin'];a17_0x2154=function(){return _0x1fa6c3;};return a17_0x2154();}function a17_0x3f2a(_0x27f5f3,_0x53d3c7){const _0x215409=a17_0x2154();return a17_0x3f2a=function(_0x3f2a07,_0x321723){_0x3f2a07=_0x3f2a07-0x194;let _0x5d44f5=_0x215409[_0x3f2a07];return _0x5d44f5;},a17_0x3f2a(_0x27f5f3,_0x53d3c7);}(function(_0x55946e,_0x158aa8){const _0x2a018f=a17_0x3f2a,_0x5cb3ee=_0x55946e();while(!![]){try{const _0x272f2e=-parseInt(_0x2a018f(0x19f))/0x1+parseInt(_0x2a018f(0x199))/0x2+-parseInt(_0x2a018f(0x196))/0x3+-parseInt(_0x2a018f(0x19e))/0x4*(parseInt(_0x2a018f(0x19c))/0x5)+-parseInt(_0x2a018f(0x19d))/0x6+-parseInt(_0x2a018f(0x1a4))/0x7+parseInt(_0x2a018f(0x197))/0x8;if(_0x272f2e===_0x158aa8)break;else _0x5cb3ee['push'](_0x5cb3ee['shift']());}catch(_0x16963c){_0x5cb3ee['push'](_0x5cb3ee['shift']());}}}(a17_0x2154,0xd5b06));import{spawn}from'node:child_process';import{delimiter,join}from'node:path';export function runBuildWatch(){return new Promise((_0x2f1df2,_0x29a97a)=>{const _0x4ddafc=a17_0x3f2a,_0x2377d5=spawn('vite',[_0x4ddafc(0x194),_0x4ddafc(0x195)],{'stdio':'inherit','shell':!![],'env':{...process[_0x4ddafc(0x1a1)],'PATH':''+join(process[_0x4ddafc(0x1a0)](),_0x4ddafc(0x19a),_0x4ddafc(0x1a2))+delimiter+process[_0x4ddafc(0x1a1)]['PATH']}});_0x2377d5['on'](_0x4ddafc(0x198),_0x618bf4=>{const _0x13dbfa=_0x4ddafc;if(_0x618bf4===0x0||_0x618bf4===null)_0x2f1df2();else _0x29a97a(new Error(_0x13dbfa(0x1a3)+_0x618bf4));}),_0x2377d5['on'](_0x4ddafc(0x19b),_0x29a97a);});}
|
package/lib/cmd/build.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a18_0x2325(_0x4e8ede,_0x5843bf){const _0x20b485=a18_0x20b4();return a18_0x2325=function(_0x232548,_0x511c71){_0x232548=_0x232548-0x152;let _0x2813a4=_0x20b485[_0x232548];return _0x2813a4;},a18_0x2325(_0x4e8ede,_0x5843bf);}(function(_0x5b7ff0,_0x183feb){const _0x128ede=a18_0x2325,_0x4cb81a=_0x5b7ff0();while(!![]){try{const _0x200d28=-parseInt(_0x128ede(0x164))/0x1+parseInt(_0x128ede(0x16b))/0x2+parseInt(_0x128ede(0x155))/0x3+parseInt(_0x128ede(0x163))/0x4+-parseInt(_0x128ede(0x165))/0x5*(parseInt(_0x128ede(0x154))/0x6)+-parseInt(_0x128ede(0x162))/0x7+parseInt(_0x128ede(0x15b))/0x8*(parseInt(_0x128ede(0x166))/0x9);if(_0x200d28===_0x183feb)break;else _0x4cb81a['push'](_0x4cb81a['shift']());}catch(_0x21ecee){_0x4cb81a['push'](_0x4cb81a['shift']());}}}(a18_0x20b4,0xec26e));import{delimiter,join}from'node:path';function a18_0x20b4(){const _0x3f0ef2=['26516264DnhnsR','run','env','npm\x20run\x20build','pipe','项目构建出错','now','4696475xxiyxs','2105692CiuktY','1911919MChqhC','15mkwlEW','9WjtQMY','cwd','stderr','npm','PATH','1313038MbvgvH','error','info','node_modules','开始构建项目','trim','项目构建成功','npm\x20run\x20build\x20exited\x20with\x20code\x20','2380662sngWGV','728934bnWUXI','data','build','inherit','success','.bin'];a18_0x20b4=function(){return _0x3f0ef2;};return a18_0x20b4();}import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runBuild(){return new Promise((_0x15ba3b,_0x4009fb)=>{const _0x2c78c4=a18_0x2325,_0x37f85d=Date[_0x2c78c4(0x161)]();logger[_0x2c78c4(0x16d)]('build',_0x2c78c4(0x16f),{'command':_0x2c78c4(0x15e)});let _0xa0bf1a='';const _0x4d23b8=spawn(_0x2c78c4(0x169),[_0x2c78c4(0x15c),_0x2c78c4(0x157)],{'stdio':[_0x2c78c4(0x158),_0x2c78c4(0x158),_0x2c78c4(0x15f)],'shell':!![],'env':{...process[_0x2c78c4(0x15d)],'PATH':''+join(process['cwd'](),_0x2c78c4(0x16e),_0x2c78c4(0x15a))+delimiter+process[_0x2c78c4(0x15d)][_0x2c78c4(0x16a)]}});_0x4d23b8[_0x2c78c4(0x168)]?.['on'](_0x2c78c4(0x156),_0x30f3db=>{_0xa0bf1a+=_0x30f3db['toString']();}),_0x4d23b8['on']('close',_0x5b3882=>{const _0x4792de=_0x2c78c4,_0x2b2717=Date[_0x4792de(0x161)]()-_0x37f85d;if(_0x5b3882===0x0||_0x5b3882===null)logger[_0x4792de(0x159)](_0x4792de(0x157),_0x4792de(0x152),_0x2b2717),_0x15ba3b();else{const _0x26143e={'exitCode':_0x5b3882,'duration':_0x2b2717,'command':_0x4792de(0x15e),'cwd':process[_0x4792de(0x167)]()};_0xa0bf1a[_0x4792de(0x170)]()&&(_0x26143e[_0x4792de(0x168)]=_0xa0bf1a[_0x4792de(0x170)]()),logger['error'](_0x4792de(0x157),'项目构建失败',_0x26143e),_0x4009fb(new Error(_0x4792de(0x153)+_0x5b3882));}}),_0x4d23b8['on'](_0x2c78c4(0x16c),_0x17fc6d=>{const _0x23a35e=_0x2c78c4,_0x4d6577=Date['now']()-_0x37f85d;logger[_0x23a35e(0x16c)](_0x23a35e(0x157),_0x23a35e(0x160),{'error':_0x17fc6d['message'],'duration':_0x4d6577,'stderr':_0xa0bf1a[_0x23a35e(0x170)]()||undefined}),_0x4009fb(_0x17fc6d);});});}
|
package/lib/cmd/logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a19_0x3da8(){const _0x54fb17=['2HvxVCt','1148682etaqXe','success','190860RVGfuM','toLocaleString','2807656OeXGIE','*\x20Lovrabet\x20CLI\x20日志记录:\x0a','cwd','256626qXkKWL','length','\x20\x20\x20时间:\x20','202948srkIQJ','1915256GcCkPl','details','setLogPath','level','keys','zh-CN','\x20\x20\x20耗时:\x20','command','duration','clearLogs','stringify','timestamp','109272pbmCMc','log','*\x20暂无日志记录','*\x20日志已清空','warn'];a19_0x3da8=function(){return _0x54fb17;};return a19_0x3da8();}function a19_0x92b6(_0x5db783,_0x538903){const _0x3da8e0=a19_0x3da8();return a19_0x92b6=function(_0x92b633,_0x2d9aa1){_0x92b633=_0x92b633-0xf3;let _0x49f4c5=_0x3da8e0[_0x92b633];return _0x49f4c5;},a19_0x92b6(_0x5db783,_0x538903);}(function(_0x244705,_0x3eaaec){const _0x61dd4b=a19_0x92b6,_0x263f16=_0x244705();while(!![]){try{const _0x4749f2=-parseInt(_0x61dd4b(0x104))/0x1+parseInt(_0x61dd4b(0x109))/0x2*(-parseInt(_0x61dd4b(0xf4))/0x3)+parseInt(_0x61dd4b(0xf7))/0x4+parseInt(_0x61dd4b(0x10c))/0x5+parseInt(_0x61dd4b(0x10a))/0x6+-parseInt(_0x61dd4b(0xf8))/0x7+parseInt(_0x61dd4b(0x10e))/0x8;if(_0x4749f2===_0x3eaaec)break;else _0x263f16['push'](_0x263f16['shift']());}catch(_0x5a5c33){_0x263f16['push'](_0x263f16['shift']());}}}(a19_0x3da8,0x27c4b));import{logger}from'../utils/logger.js';export function showLogs(){const _0x35c137=a19_0x92b6;logger[_0x35c137(0xfa)](process[_0x35c137(0xf3)]());const _0x5c870c=logger['readLogs']();if(_0x5c870c[_0x35c137(0xf5)]===0x0){console[_0x35c137(0x105)](_0x35c137(0x106));return;}console['log'](_0x35c137(0x10f)),_0x5c870c['forEach']((_0x587fdd,_0x3c0403)=>{const _0x5a3cc4=_0x35c137,_0x33ed67=new Date(_0x587fdd[_0x5a3cc4(0x103)])[_0x5a3cc4(0x10d)](_0x5a3cc4(0xfd)),_0x71baf6=_0x587fdd[_0x5a3cc4(0xfb)]===_0x5a3cc4(0x10b)?'√':_0x587fdd['level']==='error'?'×':_0x587fdd[_0x5a3cc4(0xfb)]===_0x5a3cc4(0x108)?'!':'i';console[_0x5a3cc4(0x105)](_0x3c0403+0x1+'.\x20'+_0x71baf6+'\x20['+_0x587fdd[_0x5a3cc4(0xff)]+']\x20'+_0x587fdd['message']),console[_0x5a3cc4(0x105)](_0x5a3cc4(0xf6)+_0x33ed67),_0x587fdd[_0x5a3cc4(0x100)]&&console[_0x5a3cc4(0x105)](_0x5a3cc4(0xfe)+_0x587fdd[_0x5a3cc4(0x100)]+'ms'),_0x587fdd['details']&&Object[_0x5a3cc4(0xfc)](_0x587fdd[_0x5a3cc4(0xf9)])[_0x5a3cc4(0xf5)]>0x0&&console['log']('\x20\x20\x20详情:\x20'+JSON[_0x5a3cc4(0x102)](_0x587fdd['details'],null,0x2)),console[_0x5a3cc4(0x105)]('');});}export function clearLogs(){const _0x8efa4c=a19_0x92b6;logger[_0x8efa4c(0xfa)](process['cwd']()),logger[_0x8efa4c(0x101)](),console[_0x8efa4c(0x105)](_0x8efa4c(0x107));}
|
package/lib/cmd/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a20_0x35bf(_0x11c861,_0x17244f){const _0x488d9d=a20_0x488d();return a20_0x35bf=function(_0x35bf5c,_0x32e0bd){_0x35bf5c=_0x35bf5c-0x6d;let _0x58eac0=_0x488d9d[_0x35bf5c];return _0x58eac0;},a20_0x35bf(_0x11c861,_0x17244f);}(function(_0x345758,_0x458def){const _0x3991bd=a20_0x35bf,_0x2c60ab=_0x345758();while(!![]){try{const _0x2520fb=parseInt(_0x3991bd(0x77))/0x1+-parseInt(_0x3991bd(0x76))/0x2+-parseInt(_0x3991bd(0x73))/0x3+-parseInt(_0x3991bd(0x88))/0x4*(-parseInt(_0x3991bd(0x7e))/0x5)+-parseInt(_0x3991bd(0x74))/0x6*(-parseInt(_0x3991bd(0x75))/0x7)+parseInt(_0x3991bd(0x6f))/0x8*(-parseInt(_0x3991bd(0x6e))/0x9)+parseInt(_0x3991bd(0x80))/0xa*(parseInt(_0x3991bd(0x7f))/0xb);if(_0x2520fb===_0x458def)break;else _0x2c60ab['push'](_0x2c60ab['shift']());}catch(_0x241eed){_0x2c60ab['push'](_0x2c60ab['shift']());}}}(a20_0x488d,0x507fb));function a20_0x488d(){const _0x2120ee=['461717GhMypI','预览服务器启动出错','env','PATH','pipe','启动预览服务器','data','770PySCQk','435644PqpGlA','20yaOqQp','trim','toString','预览服务器启动成功','预览服务器启动失败','now','vite\x20preview','vite','3676dILtgJ','.bin','preview','stderr','13302MZnUew','664DcylEA','node_modules','success','error','52854GQjEBz','88614XYbccY','42eqNKGx','602100RZQXTK'];a20_0x488d=function(){return _0x2120ee;};return a20_0x488d();}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runPreview(){return new Promise((_0x4e997b,_0x2b36ab)=>{const _0x4579a4=a20_0x35bf,_0x2170e3=Date[_0x4579a4(0x85)]();logger['info']('preview',_0x4579a4(0x7c),{'command':_0x4579a4(0x86)});let _0x17d040='';const _0x613e2f=spawn(_0x4579a4(0x87),[_0x4579a4(0x8a)],{'stdio':['inherit','inherit',_0x4579a4(0x7b)],'shell':!![],'env':{...process[_0x4579a4(0x79)],'PATH':''+join(process['cwd'](),_0x4579a4(0x70),_0x4579a4(0x89))+delimiter+process[_0x4579a4(0x79)][_0x4579a4(0x7a)]}});_0x613e2f[_0x4579a4(0x6d)]?.['on'](_0x4579a4(0x7d),_0x3e9a06=>{const _0x4cfdd5=_0x4579a4;_0x17d040+=_0x3e9a06[_0x4cfdd5(0x82)]();}),_0x613e2f['on']('close',_0x303fce=>{const _0x5f465f=_0x4579a4,_0x4437e7=Date[_0x5f465f(0x85)]()-_0x2170e3;if(_0x303fce===0x0||_0x303fce===null)logger[_0x5f465f(0x71)](_0x5f465f(0x8a),_0x5f465f(0x83),_0x4437e7),_0x4e997b();else{const _0x32d6ed={'exitCode':_0x303fce,'duration':_0x4437e7,'command':'vite\x20preview','cwd':process['cwd']()};_0x17d040['trim']()&&(_0x32d6ed[_0x5f465f(0x6d)]=_0x17d040[_0x5f465f(0x81)]()),logger[_0x5f465f(0x72)](_0x5f465f(0x8a),_0x5f465f(0x84),_0x32d6ed),_0x2b36ab(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x303fce));}}),_0x613e2f['on']('error',_0x5bf850=>{const _0x59981d=_0x4579a4,_0xdb43b=Date[_0x59981d(0x85)]()-_0x2170e3;logger[_0x59981d(0x72)](_0x59981d(0x8a),_0x59981d(0x78),{'error':_0x5bf850['message'],'duration':_0xdb43b,'stderr':_0x17d040[_0x59981d(0x81)]()||undefined}),_0x2b36ab(_0x5bf850);});});}
|
package/lib/cmd/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x445ac9,_0x136a84){const _0x3e5561=a21_0x52dd,_0x3ca2f8=_0x445ac9();while(!![]){try{const _0x530d10=-parseInt(_0x3e5561(0xa0))/0x1+parseInt(_0x3e5561(0xb0))/0x2*(-parseInt(_0x3e5561(0xaf))/0x3)+-parseInt(_0x3e5561(0xa7))/0x4*(parseInt(_0x3e5561(0xa9))/0x5)+-parseInt(_0x3e5561(0xa1))/0x6+-parseInt(_0x3e5561(0xb3))/0x7+parseInt(_0x3e5561(0xb4))/0x8*(-parseInt(_0x3e5561(0xb8))/0x9)+parseInt(_0x3e5561(0xb9))/0xa;if(_0x530d10===_0x136a84)break;else _0x3ca2f8['push'](_0x3ca2f8['shift']());}catch(_0x326df9){_0x3ca2f8['push'](_0x3ca2f8['shift']());}}}(a21_0xca96,0xc47a3));function a21_0xca96(){const _0x1f4f86=['cwd','35tRCCNC','.bin','error','pipe','trim','start','5673TuqkIT','782ThMDPJ','now','inherit','6795943kkRRvQ','256bvKrDh','vite','env','write','148752nzmSWe','59433410WZGKLV','启动开发服务器','开发服务器启动失败','success','toString','971014gaznYo','5793858xbYnjj','stderr','message','close','info','开发服务器启动出错','550164STmZfm'];a21_0xca96=function(){return _0x1f4f86;};return a21_0xca96();}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a21_0x52dd(_0x14486e,_0x52391e){const _0xca96d6=a21_0xca96();return a21_0x52dd=function(_0x52dda2,_0x3df9a4){_0x52dda2=_0x52dda2-0x9c;let _0x3b058f=_0xca96d6[_0x52dda2];return _0x3b058f;},a21_0x52dd(_0x14486e,_0x52391e);}import{logger}from'../utils/logger.js';export function runStart(_0x260671){return new Promise((_0x1ce575,_0x161b0e)=>{const _0x3f2cb5=a21_0x52dd,_0x239e73=Date[_0x3f2cb5(0xb1)](),_0x4a704c=_0x260671||process[_0x3f2cb5(0xa8)]();logger[_0x3f2cb5(0xa5)](_0x3f2cb5(0xae),_0x3f2cb5(0x9c),{'command':_0x3f2cb5(0xb5),'cwd':_0x4a704c});let _0x582b4b='';const _0x3a281d=spawn(_0x3f2cb5(0xb5),{'stdio':[_0x3f2cb5(0xb2),_0x3f2cb5(0xb2),_0x3f2cb5(0xac)],'shell':!![],'cwd':_0x4a704c,'env':{...process[_0x3f2cb5(0xb6)],'PATH':''+join(_0x4a704c,'node_modules',_0x3f2cb5(0xaa))+delimiter+process['env']['PATH']}});_0x3a281d['stderr']?.['on']('data',_0x697e11=>{const _0x1b1d74=_0x3f2cb5,_0x2c87b9=_0x697e11[_0x1b1d74(0x9f)]();_0x582b4b+=_0x2c87b9,process[_0x1b1d74(0xa2)][_0x1b1d74(0xb7)](_0x2c87b9);}),_0x3a281d['on'](_0x3f2cb5(0xa4),_0x2dae27=>{const _0x3409e1=_0x3f2cb5,_0x4d5e30=Date[_0x3409e1(0xb1)]()-_0x239e73;if(_0x2dae27===0x0||_0x2dae27===null)logger[_0x3409e1(0x9e)](_0x3409e1(0xae),'开发服务器启动成功',_0x4d5e30),_0x1ce575();else{const _0x150225={'exitCode':_0x2dae27,'duration':_0x4d5e30,'command':_0x3409e1(0xb5),'cwd':_0x4a704c};_0x582b4b[_0x3409e1(0xad)]()&&(_0x150225['stderr']=_0x582b4b[_0x3409e1(0xad)]()),logger[_0x3409e1(0xab)](_0x3409e1(0xae),_0x3409e1(0x9d),_0x150225),_0x161b0e(new Error('vite\x20exited\x20with\x20code\x20'+_0x2dae27));}}),_0x3a281d['on'](_0x3f2cb5(0xab),_0x1b69a6=>{const _0x2aedba=_0x3f2cb5,_0x334ac9=Date[_0x2aedba(0xb1)]()-_0x239e73,_0x2d17fa={'error':_0x1b69a6[_0x2aedba(0xa3)],'duration':_0x334ac9,'command':'vite','cwd':_0x4a704c};_0x582b4b['trim']()&&(_0x2d17fa[_0x2aedba(0xa2)]=_0x582b4b[_0x2aedba(0xad)]()),logger[_0x2aedba(0xab)](_0x2aedba(0xae),_0x2aedba(0xa6),_0x2d17fa),_0x161b0e(_0x1b69a6);});});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a22_0x5ee5(_0x2418bf,_0x180ef3){const _0x4aecac=a22_0x4aec();return a22_0x5ee5=function(_0x5ee563,_0x489977){_0x5ee563=_0x5ee563-0xa6;let _0xfc86ce=_0x4aecac[_0x5ee563];return _0xfc86ce;},a22_0x5ee5(_0x2418bf,_0x180ef3);}(function(_0x330c43,_0x5c89ec){const _0x39e238=a22_0x5ee5,_0x527de6=_0x330c43();while(!![]){try{const _0x4fa750=parseInt(_0x39e238(0xb0))/0x1+parseInt(_0x39e238(0xa9))/0x2+parseInt(_0x39e238(0xba))/0x3+-parseInt(_0x39e238(0xa6))/0x4+-parseInt(_0x39e238(0xb4))/0x5*(-parseInt(_0x39e238(0xbb))/0x6)+parseInt(_0x39e238(0xb5))/0x7*(-parseInt(_0x39e238(0xa7))/0x8)+-parseInt(_0x39e238(0xbc))/0x9;if(_0x4fa750===_0x5c89ec)break;else _0x527de6['push'](_0x527de6['shift']());}catch(_0x3fb472){_0x527de6['push'](_0x527de6['shift']());}}}(a22_0x4aec,0xef6d1));import{jsxs as a22_0x250925,jsx as a22_0x25ed75}from'react/jsx-runtime';import{Box,Text}from'ink';export function ConfigHelp(){const _0x1d2330=a22_0x5ee5,_0x41bf51=[{'command':'lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','description':_0x1d2330(0xb2)},{'command':_0x1d2330(0xaf),'description':'获取配置项'},{'command':_0x1d2330(0xac),'description':_0x1d2330(0xab)}],_0x3c0e93=[{'command':_0x1d2330(0xb3),'description':'配置当前项目的\x20App\x20Code'},{'command':_0x1d2330(0xae),'description':'设置环境\x20(online/daily)'}];return a22_0x250925(Box,{'flexDirection':_0x1d2330(0xa8),'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x25ed75(Box,{'marginBottom':0x1,'children':a22_0x250925(Text,{'color':'gray','children':['\x20!','\x20\x20',_0x1d2330(0xad)]})}),_0x41bf51[_0x1d2330(0xb1)](_0x3f6fa0=>a22_0x250925(Box,{'children':[a22_0x250925(Text,{'children':[_0x1d2330(0xb7),_0x3f6fa0[_0x1d2330(0xb6)]]}),a22_0x25ed75(Text,{'color':_0x1d2330(0xb8),'children':_0x3f6fa0[_0x1d2330(0xb9)]})]},_0x3f6fa0[_0x1d2330(0xb6)])),a22_0x25ed75(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a22_0x25ed75(Text,{'color':'gray','children':_0x1d2330(0xaa)})}),_0x3c0e93['map'](_0x120c71=>a22_0x250925(Box,{'children':[a22_0x250925(Text,{'children':[_0x1d2330(0xb7),_0x120c71[_0x1d2330(0xb6)]]}),a22_0x25ed75(Text,{'color':_0x1d2330(0xb8),'children':_0x120c71[_0x1d2330(0xb9)]})]},_0x120c71[_0x1d2330(0xb6)]))]});}function a22_0x4aec(){const _0x3a49cb=['command','\x20\x20\x20\x20','gray','description','4197810UATPfc','2101338ppgqCT','8146728dzhMXD','5182752TeeIID','1645544pafqNL','column','674394gIbAeV','\x20*\x20配置示例:','列出所有配置项','lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','无效的命令,可用命令如下:','lovrabet\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','1361735pSWnEF','map','设置配置项','lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','10UsuiVN','21BdfeAs'];a22_0x4aec=function(){return _0x3a49cb;};return a22_0x4aec();}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x584583,_0x555a39){const _0x546054=a23_0x3002,_0x50877b=_0x584583();while(!![]){try{const _0x51cdb5=parseInt(_0x546054(0xf5))/0x1+parseInt(_0x546054(0xf7))/0x2+parseInt(_0x546054(0xee))/0x3+parseInt(_0x546054(0xe5))/0x4+-parseInt(_0x546054(0xf3))/0x5*(-parseInt(_0x546054(0x102))/0x6)+parseInt(_0x546054(0x104))/0x7*(-parseInt(_0x546054(0xe2))/0x8)+-parseInt(_0x546054(0xfc))/0x9*(parseInt(_0x546054(0x103))/0xa);if(_0x51cdb5===_0x555a39)break;else _0x50877b['push'](_0x50877b['shift']());}catch(_0x39a158){_0x50877b['push'](_0x50877b['shift']());}}}(a23_0xca6f,0xeaacd));function a23_0xca6f(){const _0x383be9=['includes','mkdirSync','set','42WGeWnA','2180UtEYJA','91YQfpVQ','renameSync','flags','stringify','error','978504okhPbJ','red','undefined','7245416iBnbAn','parse','dirname','help','list','保存配置失败:\x20','string','log','配置值无效或过长','4173225KUbWlN','--help','utf8','get','.tmp','46275KCsVER','message','757728HRrDhc','unlinkSync','2820120veWicP','online','环境配置值只能是\x20\x22online\x22\x20或\x20\x22daily\x22','保存配置失败','env','119052eDWmNc','input','环境配置已设置为:\x20'];a23_0xca6f=function(){return _0x383be9;};return a23_0xca6f();}import{jsx as a23_0x4944d4,jsxs as a23_0x4382b3}from'react/jsx-runtime';import{existsSync,readFileSync,writeFileSync}from'node:fs';import a23_0x21bca3 from'node:fs';import a23_0x2fb033 from'node:path';import{ConfigHelp}from'./config-help.js';function a23_0x3002(_0x51f31b,_0x13a449){const _0xca6f7a=a23_0xca6f();return a23_0x3002=function(_0x3002b6,_0x5bc1a1){_0x3002b6=_0x3002b6-0xe0;let _0xbb55d=_0xca6f7a[_0x3002b6];return _0xbb55d;},a23_0x3002(_0x51f31b,_0x13a449);}import{Box,Text}from'ink';import{readConfig,isInProject,projectConfigPath,globalConfigPath}from'../utils/config.js';import{logger}from'../utils/logger.js';export function Config(_0x37c10b){const _0x5467e1=a23_0x3002,{cli:_0x4c977e}=_0x37c10b,_0xc21742=_0x4c977e[_0x5467e1(0xfd)][0x1],_0xe9bf75=_0x4c977e[_0x5467e1(0xfd)][0x2],_0x6e9483=[_0x5467e1(0x101),_0x5467e1(0xf1)][_0x5467e1(0xff)](_0xc21742||''),_0x358fb0=_0x4c977e[_0x5467e1(0xfd)]['length']>=0x3;if(_0xe9bf75===_0x5467e1(0xef)||_0x4c977e[_0x5467e1(0x106)][_0x5467e1(0xe8)])return a23_0x4944d4(ConfigHelp,{});const _0x3d6354=readConfig();if(_0xc21742==='set'){if(_0xe9bf75){const _0xc752c0=_0x4c977e[_0x5467e1(0xfd)][0x3];if(typeof _0xc752c0!==_0x5467e1(0xe4)){if(_0xe9bf75===_0x5467e1(0xfb)&&![_0x5467e1(0xf8),'daily'][_0x5467e1(0xff)](_0xc752c0))return a23_0x4944d4(Box,{'children':a23_0x4944d4(Text,{'color':_0x5467e1(0xe3),'children':_0x5467e1(0xf9)})});const _0xb3e943=isInProject(),_0x546f66=_0xb3e943?projectConfigPath:globalConfigPath;let _0x4f3039={};try{if(existsSync(_0x546f66)){const _0x483b64=readFileSync(_0x546f66,{'encoding':_0x5467e1(0xf0)});_0x483b64&&(_0x4f3039=JSON[_0x5467e1(0xe6)](_0x483b64));}}catch(_0x43b023){}if(typeof _0xc752c0!==_0x5467e1(0xeb)||_0xc752c0['length']>0x1f4)return a23_0x4944d4(Box,{'children':a23_0x4944d4(Text,{'color':_0x5467e1(0xe3),'children':_0x5467e1(0xed)})});_0x4f3039[_0xe9bf75]=_0xc752c0;try{const _0x13c73d=a23_0x2fb033[_0x5467e1(0xe7)](_0x546f66);!existsSync(_0x13c73d)&&a23_0x21bca3[_0x5467e1(0x100)](_0x13c73d,{'recursive':!![]});const _0x54471e=_0x546f66+'.tmp';writeFileSync(_0x54471e,JSON[_0x5467e1(0xe0)](_0x4f3039,null,0x2),{'encoding':_0x5467e1(0xf0),'mode':0x180}),a23_0x21bca3[_0x5467e1(0x105)](_0x54471e,_0x546f66);if(_0xe9bf75==='env'){const _0x1e9e8c=_0xb3e943?'项目':'全局';console[_0x5467e1(0xec)]('✓\x20'+_0x1e9e8c+_0x5467e1(0xfe)+_0xc752c0);}}catch(_0x2f6a9f){const _0x49efe9=_0x546f66+_0x5467e1(0xf2);try{existsSync(_0x49efe9)&&a23_0x21bca3[_0x5467e1(0xf6)](_0x49efe9);}catch(_0x3ff738){}return logger[_0x5467e1(0xe1)]('config',_0x5467e1(0xfa),{'error':_0x2f6a9f instanceof Error?_0x2f6a9f[_0x5467e1(0xf4)]:String(_0x2f6a9f),'configKey':_0xe9bf75,'configValue':_0xc752c0,'targetConfigPath':_0x546f66}),a23_0x4944d4(Box,{'children':a23_0x4382b3(Text,{'color':_0x5467e1(0xe3),'children':[_0x5467e1(0xea),_0x2f6a9f instanceof Error?_0x2f6a9f[_0x5467e1(0xf4)]:String(_0x2f6a9f)]})});}return null;}return a23_0x4944d4(Box,{'children':a23_0x4944d4(Text,{'color':_0x5467e1(0xe3),'children':'未提供配置值'})});}}if(_0xc21742===_0x5467e1(0xf1)){if(_0xe9bf75)return console[_0x5467e1(0xec)](_0x3d6354[_0xe9bf75]||'undefined'),null;return null;}if(_0xc21742===_0x5467e1(0xe9))return console['log'](JSON[_0x5467e1(0xe0)](_0x3d6354,null,0x2)),null;if(!_0x6e9483||!_0x358fb0)return a23_0x4944d4(ConfigHelp,{});return null;}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a24_0x4919b0=a24_0x5cfb;function a24_0x5cfb(_0x5e0274,_0x1839c1){const _0x397d7c=a24_0x397d();return a24_0x5cfb=function(_0x5cfbbb,_0x2aebbe){_0x5cfbbb=_0x5cfbbb-0xf9;let _0x4e264f=_0x397d7c[_0x5cfbbb];return _0x4e264f;},a24_0x5cfb(_0x5e0274,_0x1839c1);}(function(_0x2d35b0,_0x1def35){const _0x526364=a24_0x5cfb,_0x5bc820=_0x2d35b0();while(!![]){try{const _0xfe2930=parseInt(_0x526364(0xfd))/0x1*(-parseInt(_0x526364(0x103))/0x2)+parseInt(_0x526364(0x105))/0x3+parseInt(_0x526364(0xf9))/0x4*(parseInt(_0x526364(0x100))/0x5)+-parseInt(_0x526364(0x106))/0x6+-parseInt(_0x526364(0xff))/0x7+-parseInt(_0x526364(0x101))/0x8*(-parseInt(_0x526364(0x104))/0x9)+parseInt(_0x526364(0xfa))/0xa;if(_0xfe2930===_0x1def35)break;else _0x5bc820['push'](_0x5bc820['shift']());}catch(_0x474c09){_0x5bc820['push'](_0x5bc820['shift']());}}}(a24_0x397d,0xc2dec));import{getEnv}from'./env.js';export const getUserDomain=()=>getEnv()===a24_0x4919b0(0x102)?'https://user.lovrabet.com':a24_0x4919b0(0xfb);export const getApiDomain=()=>getEnv()==='online'?a24_0x4919b0(0xfc):a24_0x4919b0(0xfe);function a24_0x397d(){const _0x2b184d=['https://user-daily.lovrabet.com','https://api.lovrabet.com','15955JetwGw','https://daily-api.lovrabet.com','7438935pekdog','30uMqupq','16MArFar','online','182RltLit','5339619GERASP','1697676XqUVmY','471210CAVFTl','279900ZCanZO','12190090TrIaNb'];a24_0x397d=function(){return _0x2b184d;};return a24_0x397d();}
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a25_0x46a653=a25_0x53fb;(function(_0x550bbb,_0x3392bb){const _0x3a50ee=a25_0x53fb,_0x235e2b=_0x550bbb();while(!![]){try{const _0x3763f9=-parseInt(_0x3a50ee(0x19e))/0x1*(parseInt(_0x3a50ee(0x19f))/0x2)+-parseInt(_0x3a50ee(0x19c))/0x3+parseInt(_0x3a50ee(0x19b))/0x4+parseInt(_0x3a50ee(0x198))/0x5+parseInt(_0x3a50ee(0x1a0))/0x6+-parseInt(_0x3a50ee(0x197))/0x7+parseInt(_0x3a50ee(0x19d))/0x8;if(_0x3763f9===_0x3392bb)break;else _0x235e2b['push'](_0x235e2b['shift']());}catch(_0x5016c3){_0x235e2b['push'](_0x235e2b['shift']());}}}(a25_0x32b5,0x36873));let env=process[a25_0x46a653(0x19a)][a25_0x46a653(0x1a1)]||a25_0x46a653(0x199);function a25_0x53fb(_0x2c55ca,_0x4dfc69){const _0x32b5fb=a25_0x32b5();return a25_0x53fb=function(_0x53fb09,_0x3b9461){_0x53fb09=_0x53fb09-0x197;let _0x1ddee3=_0x32b5fb[_0x53fb09];return _0x1ddee3;},a25_0x53fb(_0x2c55ca,_0x4dfc69);}function a25_0x32b5(){const _0x308b9c=['LOVRABET_ENV','1473927MLFokx','938900RaEvaJ','online','env','607228QSVRPm','947934pQEDpy','2715552ryFEHv','156022LEbJdJ','4BooyHX','2297394hCopcN'];a25_0x32b5=function(){return _0x308b9c;};return a25_0x32b5();}export function getEnv(){return env;}export function initEnv(_0x2fc9ab){env=_0x2fc9ab;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xe14ba3,_0x59c893){const _0x4eb8d2=a26_0x29ed,_0x548fec=_0xe14ba3();while(!![]){try{const _0x4b0f9f=-parseInt(_0x4eb8d2(0x1cc))/0x1+parseInt(_0x4eb8d2(0x1c1))/0x2+parseInt(_0x4eb8d2(0x1f6))/0x3*(-parseInt(_0x4eb8d2(0x1d7))/0x4)+-parseInt(_0x4eb8d2(0x1e1))/0x5+parseInt(_0x4eb8d2(0x1e8))/0x6+-parseInt(_0x4eb8d2(0x1e7))/0x7+parseInt(_0x4eb8d2(0x1de))/0x8;if(_0x4b0f9f===_0x59c893)break;else _0x548fec['push'](_0x548fec['shift']());}catch(_0x3b8ba4){_0x548fec['push'](_0x548fec['shift']());}}}(a26_0x5994,0xbd36d));import{jsx as a26_0x1494de,jsxs as a26_0x291ab5,Fragment as a26_0x17ec5b}from'react/jsx-runtime';function a26_0x5994(){const _0xae9884=['6769335IhXqUs','string','cyan','includes','登录状态','未设置','8746808EFlXWn','7870758uRwOsi','confirm-api-pull','red','delete','leftArrow','slice','跳过登录','column','\x20检查中...','应用AppCode长度不能超过\x20100\x20个字符','rightArrow','\x20登录中...','项目名长度不能超过\x2050\x20个字符','\x20\x20使用\x20←→\x20选择,回车确认','489Guufxu','login-prompt','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','test','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','online','*\x20创建新项目','2601310oPSvhX','length','登录失败','backspace','value','login','gray','项目名不合法','应用AppCode不合法','!\x20未检测到有效登录','env','399025hNrkuB','app-code','trim','*\x20应用AppCode\x20','map','green','my-app','yellow','project-name','creating','api-pull','30868BMwfuR','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','login-check','[可选]:\x20','应用AppCode','*\x20项目名:\x20','return','19383040xXIgWe','\x20←\x20','拉取API配置'];a26_0x5994=function(){return _0xae9884;};return a26_0x5994();}import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';function a26_0x29ed(_0xc233c4,_0x3652f2){const _0x5994dd=a26_0x5994();return a26_0x29ed=function(_0x29ed19,_0x52ccb0){_0x29ed19=_0x29ed19-0x1c0;let _0x222cbb=_0x5994dd[_0x29ed19];return _0x222cbb;},a26_0x29ed(_0xc233c4,_0x3652f2);}export function EnhancedGuidedCreate(_0x4c8fd4){const _0x650310=a26_0x29ed,{onCreate:_0x3930f9,env:_0xb365a4}=_0x4c8fd4,[_0x554aee,_0x50a646]=useState(_0x650310(0x1d4)),[_0x45325e,_0x627597]=useState(''),[_0x203b4c,_0x4010a4]=useState(''),[_0x2db068,_0x514417]=useState(''),[_0x143a6a,_0x56a27c]=useState(''),[_0x3a478e,_0x4cdcaa]=useState([]),[_0x1c7a9e,_0x584cc5]=useState(null),[_0x30f09f,_0x3f60f5]=useState(![]),[_0x507d20,_0x5a6d32]=useState(![]),[_0x4c6b7d,_0x486dde]=useState(![]),[_0x112c88,_0x37a811]=useState(0x0),[_0x6831c9,_0x4b2985]=useState(0x0),_0x48cf70=_0x650310(0x1d2),_0x311ecc=readConfig(),_0x1b5ed5=typeof _0x311ecc[_0x650310(0x1cb)]===_0x650310(0x1e2)?_0x311ecc['env']:undefined;function _0x412871(_0x26e6e5){const _0x264787=_0x650310;if(_0x26e6e5[_0x264787(0x1c2)]>0x32)return{'valid':![],'message':_0x264787(0x1f4)};const _0x50ce1c=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x26e6e5?.[_0x264787(0x1ce)]()&&!_0x50ce1c[_0x264787(0x1f9)](_0x26e6e5))return{'valid':![],'message':_0x264787(0x1d8)};return{'valid':!![]};}function _0x427d65(_0x57e25b){const _0xe9d25f=_0x650310;if(!_0x57e25b[_0xe9d25f(0x1ce)]())return{'valid':!![]};if(_0x57e25b[_0xe9d25f(0x1c2)]>0x64)return{'valid':![],'message':_0xe9d25f(0x1f1)};const _0x4b8990=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x4b8990['test'](_0x57e25b))return{'valid':![],'message':'应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头'};return{'valid':!![]};}async function _0x32433a(){_0x3f60f5(!![]);try{const _0x376f18=await getIsSessionValid();return _0x584cc5(_0x376f18),_0x376f18;}catch(_0xb49d83){return _0x584cc5(![]),![];}finally{_0x3f60f5(![]);}}async function _0x489617(){_0x5a6d32(!![]);try{const _0x5b45e1=await authServer({'silent':!![]});return _0x584cc5(_0x5b45e1),_0x5b45e1;}catch(_0x353f20){return _0x584cc5(![]),![];}finally{_0x5a6d32(![]);}}return useInput(async(_0x4a5948,_0x3ba847)=>{const _0x352346=_0x650310;if(_0x3ba847[_0x352346(0x1ec)]||_0x3ba847[_0x352346(0x1f2)]){if(_0x554aee==='confirm-api-pull'){_0x37a811(_0xa94684=>_0xa94684===0x0?0x1:0x0);return;}if(_0x554aee===_0x352346(0x1f7)){_0x4b2985(_0x210392=>_0x210392===0x0?0x1:0x0);return;}}if(_0x3ba847[_0x352346(0x1dd)]){if(_0x554aee===_0x352346(0x1d4)){const _0x42312c=_0x2db068[_0x352346(0x1ce)]()||_0x48cf70;if(_0x143a6a)return;_0x627597(_0x42312c),_0x4cdcaa([{'step':_0x352346(0x1d4),'label':'项目名','value':_0x42312c}]),_0x514417(''),_0x56a27c(''),_0x50a646(_0x352346(0x1cd));return;}if(_0x554aee===_0x352346(0x1cd)){if(_0x143a6a)return;const _0x45fd7d=_0x2db068[_0x352346(0x1ce)]();_0x4010a4(_0x45fd7d),_0x4cdcaa(_0x2aee3e=>[..._0x2aee3e,{'step':'app-code','label':_0x352346(0x1db),'value':_0x45fd7d||_0x352346(0x1e6)}]),_0x514417(''),_0x56a27c('');if(_0x45fd7d){_0x50a646(_0x352346(0x1d9));const _0x3d45e6=await _0x32433a();_0x3d45e6?_0x50a646(_0x352346(0x1e9)):_0x50a646(_0x352346(0x1f7));}else{const _0x4d475f=_0xb365a4||_0x1b5ed5||'online';_0x3930f9({'projectName':_0x45325e,'appCode':undefined,'pullApi':![],'env':_0x4d475f}),_0x50a646(_0x352346(0x1d5));}return;}if(_0x554aee==='confirm-api-pull'){const _0x23bef9=_0x112c88===0x0;_0x486dde(_0x23bef9),_0x4cdcaa(_0xa17cd7=>[..._0xa17cd7,{'step':_0x352346(0x1d6),'label':_0x352346(0x1e0),'value':_0x23bef9?'是':'否'}]);const _0x108e97=_0xb365a4||_0x1b5ed5||_0x352346(0x1fb);_0x3930f9({'projectName':_0x45325e,'appCode':_0x203b4c,'pullApi':_0x23bef9,'env':_0x108e97}),_0x50a646(_0x352346(0x1d5));return;}if(_0x554aee===_0x352346(0x1f7)){const _0x1c957f=_0x6831c9===0x0;if(_0x1c957f){_0x50a646('login-process');const _0x34d7f0=await _0x489617();if(_0x34d7f0)_0x4cdcaa(_0x1e5e94=>[..._0x1e5e94,{'step':_0x352346(0x1c6),'label':'登录状态','value':'已登录'}]),_0x50a646(_0x352346(0x1e9));else{_0x4cdcaa(_0x1aaddb=>[..._0x1aaddb,{'step':_0x352346(0x1c6),'label':_0x352346(0x1e5),'value':_0x352346(0x1c3)}]);const _0x10e1fb=_0xb365a4||_0x1b5ed5||_0x352346(0x1fb);_0x3930f9({'projectName':_0x45325e,'appCode':_0x203b4c,'pullApi':![],'env':_0x10e1fb}),_0x50a646('creating');}}else{_0x4cdcaa(_0x14f99e=>[..._0x14f99e,{'step':'login','label':'登录状态','value':_0x352346(0x1ee)}]);const _0x2db585=_0xb365a4||_0x1b5ed5||_0x352346(0x1fb);_0x3930f9({'projectName':_0x45325e,'appCode':_0x203b4c,'pullApi':![],'env':_0x2db585}),_0x50a646(_0x352346(0x1d5));}return;}}if(_0x3ba847[_0x352346(0x1c4)]||_0x3ba847[_0x352346(0x1eb)]){_0x514417(_0x3e118a=>{const _0x241e64=_0x352346,_0x16c684=_0x3e118a[_0x241e64(0x1ed)](0x0,-0x1);if(_0x554aee==='project-name'){const {valid:_0xfd1ce,message:_0x148d02}=_0x412871(_0x16c684);_0x56a27c(_0xfd1ce?'':_0x148d02||_0x241e64(0x1c8));}else{if(_0x554aee===_0x241e64(0x1cd)){const {valid:_0x150920,message:_0x451541}=_0x427d65(_0x16c684);_0x56a27c(_0x150920?'':_0x451541||_0x241e64(0x1c9));}}return _0x16c684;});return;}if([_0x352346(0x1d5),'login-check','login-process'][_0x352346(0x1e4)](_0x554aee))return;if(_0x554aee===_0x352346(0x1e9)||_0x554aee===_0x352346(0x1f7))return;_0x514417(_0x12a5ab=>{const _0x3a01af=_0x352346,_0x223866=_0x12a5ab+_0x4a5948;if(_0x554aee===_0x3a01af(0x1d4)){const {valid:_0x4d2344,message:_0x5216bf}=_0x412871(_0x223866);_0x56a27c(_0x4d2344?'':_0x5216bf||_0x3a01af(0x1c8));}else{if(_0x554aee==='app-code'){const {valid:_0x37ad7b,message:_0x46b80e}=_0x427d65(_0x223866);_0x56a27c(_0x37ad7b?'':_0x46b80e||_0x3a01af(0x1c9));}}return _0x223866;});}),a26_0x291ab5(Box,{'flexDirection':_0x650310(0x1ef),'marginTop':0x1,'children':[_0x3a478e['length']===0x0&&a26_0x1494de(Box,{'children':a26_0x1494de(Text,{'color':_0x650310(0x1e3),'children':_0x650310(0x1c0)})}),_0x3a478e[_0x650310(0x1d0)](_0x54a4b4=>a26_0x291ab5(Box,{'children':[a26_0x291ab5(Text,{'color':_0x650310(0x1d1),'children':['√\x20',_0x54a4b4['label'],':\x20']}),a26_0x1494de(Text,{'color':_0x650310(0x1e3),'children':_0x54a4b4[_0x650310(0x1c5)]})]},_0x54a4b4['step'])),_0x554aee==='project-name'&&a26_0x291ab5(a26_0x17ec5b,{'children':[a26_0x291ab5(Box,{'children':[a26_0x1494de(Text,{'children':_0x650310(0x1dc)}),_0x2db068?a26_0x1494de(Text,{'color':_0x650310(0x1d1),'children':_0x2db068}):a26_0x1494de(Text,{'color':'gray','children':_0x48cf70}),_0x143a6a&&a26_0x291ab5(Text,{'color':'red','children':[_0x650310(0x1df),_0x143a6a]})]}),!_0x143a6a&&!_0x2db068&&a26_0x1494de(Box,{'children':a26_0x1494de(Text,{'color':_0x650310(0x1c7),'children':'\x20直接回车确认,或输入自定义名称'})})]}),_0x554aee===_0x650310(0x1cd)&&a26_0x291ab5(a26_0x17ec5b,{'children':[a26_0x291ab5(Box,{'children':[a26_0x1494de(Text,{'children':_0x650310(0x1cf)}),a26_0x1494de(Text,{'color':_0x650310(0x1c7),'children':_0x650310(0x1da)}),a26_0x1494de(Text,{'color':'green','children':_0x2db068}),_0x143a6a&&a26_0x291ab5(Text,{'color':_0x650310(0x1ea),'children':['\x20←\x20',_0x143a6a]})]}),!_0x143a6a&&a26_0x1494de(Box,{'children':a26_0x291ab5(Text,{'color':_0x650310(0x1c7),'children':['\x20','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)']})})]}),_0x554aee===_0x650310(0x1d9)&&a26_0x291ab5(Box,{'children':[a26_0x1494de(Text,{'children':'*\x20正在检查登录状态...'}),_0x30f09f&&a26_0x1494de(Text,{'color':'gray','children':_0x650310(0x1f0)})]}),_0x554aee===_0x650310(0x1e9)&&a26_0x291ab5(a26_0x17ec5b,{'children':[a26_0x1494de(Box,{'children':a26_0x1494de(Text,{'color':_0x650310(0x1d1),'children':'√\x20检测到有效登录状态'})}),a26_0x1494de(Box,{'marginTop':0x1,'children':a26_0x1494de(Text,{'children':'*\x20是否要自动拉取\x20API\x20配置?'})}),a26_0x291ab5(Box,{'marginLeft':0x2,'children':[a26_0x291ab5(Text,{'color':_0x112c88===0x0?_0x650310(0x1d1):'gray','children':[_0x112c88===0x0?'▶\x20':'\x20\x20','Yes']}),a26_0x1494de(Text,{'children':'\x20'}),a26_0x291ab5(Text,{'color':_0x112c88===0x1?_0x650310(0x1d1):'gray','children':[_0x112c88===0x1?'▶\x20':'\x20\x20','No']})]}),a26_0x1494de(Box,{'children':a26_0x1494de(Text,{'color':_0x650310(0x1c7),'children':_0x650310(0x1f5)})}),a26_0x1494de(Box,{'children':a26_0x1494de(Text,{'color':_0x650310(0x1d3),'children':_0x650310(0x1f8)})})]}),_0x554aee===_0x650310(0x1f7)&&a26_0x291ab5(a26_0x17ec5b,{'children':[a26_0x1494de(Box,{'children':a26_0x1494de(Text,{'color':_0x650310(0x1d3),'children':_0x650310(0x1ca)})}),a26_0x1494de(Box,{'marginTop':0x1,'children':a26_0x1494de(Text,{'children':'*\x20是否要先登录以便拉取\x20API\x20配置?'})}),a26_0x291ab5(Box,{'marginLeft':0x2,'children':[a26_0x291ab5(Text,{'color':_0x6831c9===0x0?'green':_0x650310(0x1c7),'children':[_0x6831c9===0x0?'▶\x20':'\x20\x20','Yes']}),a26_0x1494de(Text,{'children':'\x20'}),a26_0x291ab5(Text,{'color':_0x6831c9===0x1?_0x650310(0x1d1):_0x650310(0x1c7),'children':[_0x6831c9===0x1?'▶\x20':'\x20\x20','No']})]}),a26_0x1494de(Box,{'children':a26_0x1494de(Text,{'color':_0x650310(0x1c7),'children':_0x650310(0x1f5)})}),a26_0x1494de(Box,{'children':a26_0x1494de(Text,{'color':_0x650310(0x1d3),'children':_0x650310(0x1fa)})})]}),_0x554aee==='login-process'&&a26_0x291ab5(Box,{'children':[a26_0x1494de(Text,{'children':'*\x20正在登录,请前往浏览器完成登录...'}),_0x507d20&&a26_0x1494de(Text,{'color':_0x650310(0x1c7),'children':_0x650310(0x1f3)})]})]});}
|
|
1
|
+
(function(_0x4de978,_0x165ba2){const _0x416910=a26_0x348b,_0x22a54c=_0x4de978();while(!![]){try{const _0x3c4b45=parseInt(_0x416910(0x17a))/0x1+-parseInt(_0x416910(0x163))/0x2*(-parseInt(_0x416910(0x182))/0x3)+parseInt(_0x416910(0x18b))/0x4+-parseInt(_0x416910(0x173))/0x5*(parseInt(_0x416910(0x16f))/0x6)+-parseInt(_0x416910(0x185))/0x7*(parseInt(_0x416910(0x179))/0x8)+parseInt(_0x416910(0x190))/0x9+parseInt(_0x416910(0x177))/0xa*(-parseInt(_0x416910(0x162))/0xb);if(_0x3c4b45===_0x165ba2)break;else _0x22a54c['push'](_0x22a54c['shift']());}catch(_0x1fa46c){_0x22a54c['push'](_0x22a54c['shift']());}}}(a26_0x5c2f,0xcbea6));function a26_0x348b(_0x28cb43,_0x4ee18e){const _0x5c2fb8=a26_0x5c2f();return a26_0x348b=function(_0x348b7a,_0x57e0ed){_0x348b7a=_0x348b7a-0x155;let _0x5388d0=_0x5c2fb8[_0x348b7a];return _0x5388d0;},a26_0x348b(_0x28cb43,_0x4ee18e);}import{jsx as a26_0x4dae19,jsxs as a26_0x19a134,Fragment as a26_0x1b2232}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';function a26_0x5c2f(){const _0x39ecf9=['10398mWrkOz','green','step','7NlaJGn','gray','slice','my-app','应用AppCode长度不能超过\x20100\x20个字符','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','5955672yJNfCi','拉取API配置','env','trim','online','4653000hoESII','map','login-prompt','includes','\x20直接回车确认,或输入自定义名称','项目名','*\x20是否要自动拉取\x20API\x20配置?','length','red','*\x20应用AppCode\x20','√\x20检测到有效登录状态','delete','\x20检查中...','column','已登录','string','11zMouML','674vFNjgF','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','return','project-name','*\x20项目名:\x20','cyan','test','yellow','登录失败','项目名不合法','login-check','*\x20正在登录,请前往浏览器完成登录...','3276444AqLAie','\x20←\x20','应用AppCode不合法','登录状态','15PeOidi','confirm-api-pull','login','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','6220190ccpyrC','Yes','7267992bjLVGv','830018RRTCuh','项目名长度不能超过\x2050\x20个字符','跳过登录','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','app-code','login-process','creating','[可选]:\x20'];a26_0x5c2f=function(){return _0x39ecf9;};return a26_0x5c2f();}import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x2326b7){const _0x3f0079=a26_0x348b,{onCreate:_0x4e2911,env:_0x47eec1}=_0x2326b7,[_0x5c2da3,_0xebd162]=useState(_0x3f0079(0x166)),[_0x415a34,_0x4dd996]=useState(''),[_0x5d7fe2,_0xca261e]=useState(''),[_0x546bf3,_0x1715cc]=useState(''),[_0x43d2ef,_0x39967a]=useState(''),[_0x514110,_0x4c8b51]=useState([]),[_0x2c3333,_0x5461c3]=useState(null),[_0x2dd430,_0x427b50]=useState(![]),[_0x3b3fd4,_0xba43bf]=useState(![]),[_0x440e78,_0xf5e336]=useState(![]),[_0x14c953,_0x27234a]=useState(0x0),[_0x27f081,_0x89ef31]=useState(0x0),_0x38bb85=_0x3f0079(0x188),_0x49476d=readConfig(),_0x16c71a=typeof _0x49476d[_0x3f0079(0x18d)]===_0x3f0079(0x161)?_0x49476d[_0x3f0079(0x18d)]:undefined;function _0x3cf8c3(_0x14f7d0){const _0x5ebf66=_0x3f0079;if(_0x14f7d0[_0x5ebf66(0x159)]>0x32)return{'valid':![],'message':_0x5ebf66(0x17b)};const _0x191a49=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x14f7d0?.[_0x5ebf66(0x18e)]()&&!_0x191a49[_0x5ebf66(0x169)](_0x14f7d0))return{'valid':![],'message':'项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};return{'valid':!![]};}function _0x158bf7(_0x35aea9){const _0x53a724=_0x3f0079;if(!_0x35aea9[_0x53a724(0x18e)]())return{'valid':!![]};if(_0x35aea9[_0x53a724(0x159)]>0x64)return{'valid':![],'message':_0x53a724(0x189)};const _0x25157c=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x25157c[_0x53a724(0x169)](_0x35aea9))return{'valid':![],'message':_0x53a724(0x164)};return{'valid':!![]};}async function _0x13b4ab(){_0x427b50(!![]);try{const _0x514c1b=await getIsSessionValid();return _0x5461c3(_0x514c1b),_0x514c1b;}catch(_0x5176db){return _0x5461c3(![]),![];}finally{_0x427b50(![]);}}async function _0x1550bc(){_0xba43bf(!![]);try{const _0x3450fd=await authServer({'silent':!![]});return _0x5461c3(_0x3450fd),_0x3450fd;}catch(_0x550fef){return _0x5461c3(![]),![];}finally{_0xba43bf(![]);}}return useInput(async(_0x2e5919,_0x5df050)=>{const _0x57672d=_0x3f0079;if(_0x5df050['leftArrow']||_0x5df050['rightArrow']){if(_0x5c2da3==='confirm-api-pull'){_0x27234a(_0x1fb97e=>_0x1fb97e===0x0?0x1:0x0);return;}if(_0x5c2da3==='login-prompt'){_0x89ef31(_0x28bdb6=>_0x28bdb6===0x0?0x1:0x0);return;}}if(_0x5df050[_0x57672d(0x165)]){if(_0x5c2da3===_0x57672d(0x166)){const _0x598534=_0x546bf3[_0x57672d(0x18e)]()||_0x38bb85;if(_0x43d2ef)return;_0x4dd996(_0x598534),_0x4c8b51([{'step':_0x57672d(0x166),'label':_0x57672d(0x157),'value':_0x598534}]),_0x1715cc(''),_0x39967a(''),_0xebd162(_0x57672d(0x17e));return;}if(_0x5c2da3===_0x57672d(0x17e)){if(_0x43d2ef)return;const _0x5b75ea=_0x546bf3[_0x57672d(0x18e)]();_0xca261e(_0x5b75ea),_0x4c8b51(_0x15995a=>[..._0x15995a,{'step':_0x57672d(0x17e),'label':'应用AppCode','value':_0x5b75ea||'未设置'}]),_0x1715cc(''),_0x39967a('');if(_0x5b75ea){_0xebd162(_0x57672d(0x16d));const _0x518852=await _0x13b4ab();_0x518852?_0xebd162(_0x57672d(0x174)):_0xebd162(_0x57672d(0x192));}else{const _0x1ff342=_0x47eec1||_0x16c71a||'online';_0x4e2911({'projectName':_0x415a34,'appCode':undefined,'pullApi':![],'env':_0x1ff342}),_0xebd162(_0x57672d(0x180));}return;}if(_0x5c2da3===_0x57672d(0x174)){const _0x3a32e9=_0x14c953===0x0;_0xf5e336(_0x3a32e9),_0x4c8b51(_0x240c8d=>[..._0x240c8d,{'step':'api-pull','label':_0x57672d(0x18c),'value':_0x3a32e9?'是':'否'}]);const _0x4c1a97=_0x47eec1||_0x16c71a||_0x57672d(0x18f);_0x4e2911({'projectName':_0x415a34,'appCode':_0x5d7fe2,'pullApi':_0x3a32e9,'env':_0x4c1a97}),_0xebd162('creating');return;}if(_0x5c2da3===_0x57672d(0x192)){const _0x59b747=_0x27f081===0x0;if(_0x59b747){_0xebd162(_0x57672d(0x17f));const _0xf15c3e=await _0x1550bc();if(_0xf15c3e)_0x4c8b51(_0x466c02=>[..._0x466c02,{'step':'login','label':_0x57672d(0x172),'value':_0x57672d(0x160)}]),_0xebd162('confirm-api-pull');else{_0x4c8b51(_0x3b9d97=>[..._0x3b9d97,{'step':_0x57672d(0x175),'label':_0x57672d(0x172),'value':_0x57672d(0x16b)}]);const _0x3d3bbe=_0x47eec1||_0x16c71a||_0x57672d(0x18f);_0x4e2911({'projectName':_0x415a34,'appCode':_0x5d7fe2,'pullApi':![],'env':_0x3d3bbe}),_0xebd162(_0x57672d(0x180));}}else{_0x4c8b51(_0x1daf1c=>[..._0x1daf1c,{'step':'login','label':'登录状态','value':_0x57672d(0x17c)}]);const _0x42c727=_0x47eec1||_0x16c71a||_0x57672d(0x18f);_0x4e2911({'projectName':_0x415a34,'appCode':_0x5d7fe2,'pullApi':![],'env':_0x42c727}),_0xebd162(_0x57672d(0x180));}return;}}if(_0x5df050['backspace']||_0x5df050[_0x57672d(0x15d)]){_0x1715cc(_0x49203b=>{const _0x392181=_0x57672d,_0x4ab571=_0x49203b[_0x392181(0x187)](0x0,-0x1);if(_0x5c2da3===_0x392181(0x166)){const {valid:_0x3b5fee,message:_0x35009e}=_0x3cf8c3(_0x4ab571);_0x39967a(_0x3b5fee?'':_0x35009e||_0x392181(0x16c));}else{if(_0x5c2da3===_0x392181(0x17e)){const {valid:_0x5b433e,message:_0x2e86a5}=_0x158bf7(_0x4ab571);_0x39967a(_0x5b433e?'':_0x2e86a5||'应用AppCode不合法');}}return _0x4ab571;});return;}if([_0x57672d(0x180),_0x57672d(0x16d),_0x57672d(0x17f)][_0x57672d(0x155)](_0x5c2da3))return;if(_0x5c2da3===_0x57672d(0x174)||_0x5c2da3==='login-prompt')return;_0x1715cc(_0x19963f=>{const _0x20c9ce=_0x57672d,_0x25c09f=_0x19963f+_0x2e5919;if(_0x5c2da3===_0x20c9ce(0x166)){const {valid:_0xddc22a,message:_0x348ab3}=_0x3cf8c3(_0x25c09f);_0x39967a(_0xddc22a?'':_0x348ab3||_0x20c9ce(0x16c));}else{if(_0x5c2da3===_0x20c9ce(0x17e)){const {valid:_0x1c3570,message:_0x424f37}=_0x158bf7(_0x25c09f);_0x39967a(_0x1c3570?'':_0x424f37||_0x20c9ce(0x171));}}return _0x25c09f;});}),a26_0x19a134(Box,{'flexDirection':_0x3f0079(0x15f),'marginTop':0x1,'children':[_0x514110[_0x3f0079(0x159)]===0x0&&a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':_0x3f0079(0x168),'children':'*\x20创建新项目'})}),_0x514110[_0x3f0079(0x191)](_0x12ee9a=>a26_0x19a134(Box,{'children':[a26_0x19a134(Text,{'color':_0x3f0079(0x183),'children':['√\x20',_0x12ee9a['label'],':\x20']}),a26_0x4dae19(Text,{'color':_0x3f0079(0x168),'children':_0x12ee9a['value']})]},_0x12ee9a[_0x3f0079(0x184)])),_0x5c2da3===_0x3f0079(0x166)&&a26_0x19a134(a26_0x1b2232,{'children':[a26_0x19a134(Box,{'children':[a26_0x4dae19(Text,{'children':_0x3f0079(0x167)}),_0x546bf3?a26_0x4dae19(Text,{'color':_0x3f0079(0x183),'children':_0x546bf3}):a26_0x4dae19(Text,{'color':'gray','children':_0x38bb85}),_0x43d2ef&&a26_0x19a134(Text,{'color':_0x3f0079(0x15a),'children':[_0x3f0079(0x170),_0x43d2ef]})]}),!_0x43d2ef&&!_0x546bf3&&a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':_0x3f0079(0x186),'children':_0x3f0079(0x156)})})]}),_0x5c2da3==='app-code'&&a26_0x19a134(a26_0x1b2232,{'children':[a26_0x19a134(Box,{'children':[a26_0x4dae19(Text,{'children':_0x3f0079(0x15b)}),a26_0x4dae19(Text,{'color':_0x3f0079(0x186),'children':_0x3f0079(0x181)}),a26_0x4dae19(Text,{'color':_0x3f0079(0x183),'children':_0x546bf3}),_0x43d2ef&&a26_0x19a134(Text,{'color':'red','children':[_0x3f0079(0x170),_0x43d2ef]})]}),!_0x43d2ef&&a26_0x4dae19(Box,{'children':a26_0x19a134(Text,{'color':_0x3f0079(0x186),'children':['\x20',_0x3f0079(0x17d)]})})]}),_0x5c2da3===_0x3f0079(0x16d)&&a26_0x19a134(Box,{'children':[a26_0x4dae19(Text,{'children':'*\x20正在检查登录状态...'}),_0x2dd430&&a26_0x4dae19(Text,{'color':_0x3f0079(0x186),'children':_0x3f0079(0x15e)})]}),_0x5c2da3===_0x3f0079(0x174)&&a26_0x19a134(a26_0x1b2232,{'children':[a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':_0x3f0079(0x183),'children':_0x3f0079(0x15c)})}),a26_0x4dae19(Box,{'marginTop':0x1,'children':a26_0x4dae19(Text,{'children':_0x3f0079(0x158)})}),a26_0x19a134(Box,{'marginLeft':0x2,'children':[a26_0x19a134(Text,{'color':_0x14c953===0x0?'green':_0x3f0079(0x186),'children':[_0x14c953===0x0?'▶\x20':'\x20\x20',_0x3f0079(0x178)]}),a26_0x4dae19(Text,{'children':'\x20'}),a26_0x19a134(Text,{'color':_0x14c953===0x1?_0x3f0079(0x183):_0x3f0079(0x186),'children':[_0x14c953===0x1?'▶\x20':'\x20\x20','No']})]}),a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':'gray','children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':_0x3f0079(0x16a),'children':_0x3f0079(0x18a)})})]}),_0x5c2da3===_0x3f0079(0x192)&&a26_0x19a134(a26_0x1b2232,{'children':[a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':'yellow','children':'!\x20未检测到有效登录'})}),a26_0x4dae19(Box,{'marginTop':0x1,'children':a26_0x4dae19(Text,{'children':'*\x20是否要先登录以便拉取\x20API\x20配置?'})}),a26_0x19a134(Box,{'marginLeft':0x2,'children':[a26_0x19a134(Text,{'color':_0x27f081===0x0?_0x3f0079(0x183):'gray','children':[_0x27f081===0x0?'▶\x20':'\x20\x20','Yes']}),a26_0x4dae19(Text,{'children':'\x20'}),a26_0x19a134(Text,{'color':_0x27f081===0x1?'green':'gray','children':[_0x27f081===0x1?'▶\x20':'\x20\x20','No']})]}),a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':_0x3f0079(0x186),'children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':_0x3f0079(0x16a),'children':_0x3f0079(0x176)})})]}),_0x5c2da3===_0x3f0079(0x17f)&&a26_0x19a134(Box,{'children':[a26_0x4dae19(Text,{'children':_0x3f0079(0x16e)}),_0x3b3fd4&&a26_0x4dae19(Text,{'color':_0x3f0079(0x186),'children':'\x20登录中...'})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a27_0x514e(_0xb9259b,_0x393ad4){const _0x594c9a=a27_0x594c();return a27_0x514e=function(_0x514ecd,_0x21af52){_0x514ecd=_0x514ecd-0x1c0;let _0x1be809=_0x594c9a[_0x514ecd];return _0x1be809;},a27_0x514e(_0xb9259b,_0x393ad4);}(function(_0x5228b8,_0x4783e0){const _0x4597d1=a27_0x514e,_0x4f7a49=_0x5228b8();while(!![]){try{const _0x474fe7=-parseInt(_0x4597d1(0x1c9))/0x1*(-parseInt(_0x4597d1(0x1ca))/0x2)+parseInt(_0x4597d1(0x1c1))/0x3+-parseInt(_0x4597d1(0x1cb))/0x4+parseInt(_0x4597d1(0x1c2))/0x5*(-parseInt(_0x4597d1(0x1c7))/0x6)+parseInt(_0x4597d1(0x1c0))/0x7*(-parseInt(_0x4597d1(0x1c3))/0x8)+-parseInt(_0x4597d1(0x1c6))/0x9+parseInt(_0x4597d1(0x1c4))/0xa;if(_0x474fe7===_0x4783e0)break;else _0x4f7a49['push'](_0x4f7a49['shift']());}catch(_0x49c09c){_0x4f7a49['push'](_0x4f7a49['shift']());}}}(a27_0x594c,0xa97bd));export function formatElapsed(_0x4cfe1d){const _0x4b6140=a27_0x514e,_0x505558=Date[_0x4b6140(0x1c5)]()-_0x4cfe1d;if(_0x505558<0x3e8)return _0x505558+'ms';const _0x3cb69b=(_0x505558/0x3e8)['toFixed'](0x2),_0x83cbf9=_0x3cb69b[_0x4b6140(0x1c8)](/\.?0+$/u,'');return _0x83cbf9+'s';}function a27_0x594c(){const _0x14b2d6=['21745020eicXkb','now','12469914WpHhjJ','18TqvAXr','replace','265shCFwN','4710monQsG','2753216iSrIKt','21dWEmCU','3721977beDGSi','24715ykdeLM','3350272ZxzhXQ'];a27_0x594c=function(){return _0x14b2d6;};return a27_0x594c();}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x18a09f,_0x138b03){const _0x396f36=a28_0x21c4,_0x5a9c80=_0x18a09f();while(!![]){try{const _0x2a4652=parseInt(_0x396f36(0x90))/0x1+-parseInt(_0x396f36(0x75))/0x2+-parseInt(_0x396f36(0xa1))/0x3+-parseInt(_0x396f36(0xb2))/0x4*(-parseInt(_0x396f36(0x82))/0x5)+-parseInt(_0x396f36(0xa6))/0x6+-parseInt(_0x396f36(0x93))/0x7+parseInt(_0x396f36(0xa7))/0x8;if(_0x2a4652===_0x138b03)break;else _0x5a9c80['push'](_0x5a9c80['shift']());}catch(_0x108e4f){_0x5a9c80['push'](_0x5a9c80['shift']());}}}(a28_0x4a99,0x2e77b));import{jsx as a28_0x47872c,Fragment as a28_0x4fe1a0,jsxs as a28_0x9ffb09}from'react/jsx-runtime';import a28_0x9f6324 from'node:path';import a28_0x3a6387 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 a28_0x4a99(){const _0x10091f=['63996nNPaAY','.lovrabetrc','🎉\x20项目创建成功!','配置应用AppCode失败:\x20','cd\x20','1417692JqSSqB','3535288zyNJHS','1.\x20','projectName','green','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20app\x20<app-code>\x27\x20配置','message','拉取API配置:\x20','readFileSync','package.json','constants','3.\x20','216kypCzR','API\x20配置拉取成功:\x20','doTask','create','API\x20配置拉取异常:\x20','lovrabet\x20api\x20pull','setLogPath','error','version','\x20创建配置文件','项目创建失败:\x20','📁\x20项目名称:\x20','×\x20无法在当前目录创建项目,请检查目录权限','*\x20配置文件路径:\x20','url','writeFileSync','toLocaleString','×\x20项目名过长,最多支持\x20100\x20个字符','√\x20API\x20配置拉取完成','1.0.0','×\x20项目目录\x20','\x20&&\x20lovrabet\x20start','启动项目:\x20','existsSync','projectCode','未配置','accessSync','rmSync','yellow','233720fhrYdH','\x20|\x20应用AppCode:\x20','开始创建项目:\x20','*\x20正在拉取\x20API\x20配置...','清理项目目录失败:\x20','dirname','repeat','cyan','×\x20项目创建失败:\x20','🔗\x20应用AppCode:\x20','gray','cwd','success','26610VQcFwV','\x20√\x20','W_OK','需手动拉取','\x20配置应用AppCode:\x20','\x20已存在,请使用其他项目名','length','online','API\x20配置拉取失败:\x20','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','2.\x20','join','column','utf8','83348DOKDHc','test','*\x20正在为项目\x20','1734894nzNQRo','lovrabet\x20api\x20pull\x20[app-code]','appCode','*\x20清理失败的项目目录:\x20','warn','√\x20配置文件已创建,应用AppCode:\x20','white','配置AppCode:\x20','string','info','parse','env','pullApi','log'];a28_0x4a99=function(){return _0x10091f;};return a28_0x4a99();}function a28_0x21c4(_0x42f2c3,_0x318d16){const _0x4a99c3=a28_0x4a99();return a28_0x21c4=function(_0x21c432,_0x49903e){_0x21c432=_0x21c432-0x6c;let _0x525f6f=_0x4a99c3[_0x21c432];return _0x525f6f;},a28_0x21c4(_0x42f2c3,_0x318d16);}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(_0x486710){const _0x8e4100=a28_0x21c4,[_0x33fc20,_0xc6481d]=useState(![]),[_0x58ac26,_0x5d6114]=useState(![]),[_0x198441,_0x4b2e40]=useState(null),_0x4abc39=useCopyProjectTemplate(),_0x3d15bc=useInstallDependencies(),_0x411c1d=useFormatCode(),_0x21b5c8=async _0xf8a6a5=>{const _0x186327=a28_0x21c4;if(!_0xf8a6a5[_0x186327(0xa9)]||_0xf8a6a5[_0x186327(0xa9)]['trim']()===''){console[_0x186327(0xb9)]('×\x20项目名不能为空');return;}const _0x3005fa=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x3005fa[_0x186327(0x91)](_0xf8a6a5[_0x186327(0xa9)])){console[_0x186327(0xb9)]('×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符');return;}if(_0xf8a6a5['projectName'][_0x186327(0x88)]>0x64){console[_0x186327(0xb9)](_0x186327(0xc3));return;}const _0x4cea24=a28_0x9f6324['resolve'](process[_0x186327(0x80)](),_0xf8a6a5[_0x186327(0xa9)]);if(a28_0x3a6387[_0x186327(0x6f)](_0x4cea24)){console[_0x186327(0xb9)](_0x186327(0x6c)+_0xf8a6a5[_0x186327(0xa9)]+_0x186327(0x87));return;}try{const _0x1a6bd5=a28_0x9f6324[_0x186327(0x7a)](_0x4cea24);a28_0x3a6387[_0x186327(0x72)](_0x1a6bd5,a28_0x3a6387[_0x186327(0xb0)][_0x186327(0x84)]);}catch(_0x10a728){console[_0x186327(0xb9)](_0x186327(0xbe));return;}_0x4b2e40(_0xf8a6a5),_0xc6481d(!![]),logger[_0x186327(0xb8)](_0x4cea24),logger[_0x186327(0x9c)](_0x186327(0xb5),_0x186327(0x77)+_0xf8a6a5[_0x186327(0xa9)],{'projectDir':_0x4cea24,'appCode':_0xf8a6a5[_0x186327(0x95)]});try{await _0x4abc39[_0x186327(0xb4)](_0xf8a6a5[_0x186327(0xa9)]),await _0x3d15bc[_0x186327(0xb4)](_0xf8a6a5[_0x186327(0xa9)]),await _0x411c1d[_0x186327(0xb4)](_0xf8a6a5[_0x186327(0xa9)]),await _0x2eabb9(_0xf8a6a5[_0x186327(0xa9)],_0xf8a6a5[_0x186327(0x95)]||'',_0xf8a6a5[_0x186327(0x9e)]);if(_0xf8a6a5[_0x186327(0x9f)]&&_0xf8a6a5[_0x186327(0x95)]){console[_0x186327(0xa0)](_0x186327(0x78));try{const _0x5206c2=await pullApiSilent(_0xf8a6a5['appCode'],undefined,_0x4cea24,_0xf8a6a5[_0x186327(0x9e)]);_0x5206c2?(console['log'](_0x186327(0xc4)),logger[_0x186327(0x9c)]('create',_0x186327(0xb3)+_0xf8a6a5[_0x186327(0x95)],{'projectDir':_0x4cea24,'appCode':_0xf8a6a5[_0x186327(0x95)],'env':_0xf8a6a5[_0x186327(0x9e)]})):(console[_0x186327(0xa0)]('!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x186327(0x97)](_0x186327(0xb5),_0x186327(0x8a)+_0xf8a6a5[_0x186327(0x95)],{'projectDir':_0x4cea24,'appCode':_0xf8a6a5['appCode'],'env':_0xf8a6a5[_0x186327(0x9e)]}));}catch(_0x3a65ab){console['log'](_0x186327(0x8b)),logger[_0x186327(0x97)](_0x186327(0xb5),_0x186327(0xb6)+_0xf8a6a5[_0x186327(0x95)],{'projectDir':_0x4cea24,'appCode':_0xf8a6a5[_0x186327(0x95)],'env':_0xf8a6a5[_0x186327(0x9e)],'error':_0x3a65ab instanceof Error?_0x3a65ab['message']:String(_0x3a65ab)});}}logger[_0x186327(0x81)]('create','项目创建完成:\x20'+_0xf8a6a5[_0x186327(0xa9)]),_0x5d6114(!![]),_0xc6481d(![]);}catch(_0x635e1f){logger['error'](_0x186327(0xb5),_0x186327(0xbc)+_0xf8a6a5[_0x186327(0xa9)],{'error':_0x635e1f instanceof Error?_0x635e1f[_0x186327(0xac)]:String(_0x635e1f)});try{a28_0x3a6387['existsSync'](_0x4cea24)&&(console[_0x186327(0xa0)](_0x186327(0x96)+_0x4cea24),a28_0x3a6387[_0x186327(0x73)](_0x4cea24,{'recursive':!![],'force':!![]}));}catch(_0x4e5791){logger[_0x186327(0x97)]('create',_0x186327(0x79)+_0x4cea24,{'error':_0x4e5791 instanceof Error?_0x4e5791[_0x186327(0xac)]:String(_0x4e5791)});}_0xc6481d(![]),console[_0x186327(0xb9)](_0x186327(0x7d)+(_0x635e1f instanceof Error?_0x635e1f[_0x186327(0xac)]:String(_0x635e1f)));}},_0x19f8db=async _0x2edb15=>{const _0x1a7364=a28_0x21c4;await _0x21b5c8({'projectName':_0x2edb15,'env':_0x486710[_0x1a7364(0x9e)]});},_0x2eabb9=async(_0x4ba032,_0x44bb0f,_0x34255f)=>{const _0x5e914d=a28_0x21c4,_0x34afe1=a28_0x9f6324['resolve'](process[_0x5e914d(0x80)](),_0x4ba032),_0x203ace=a28_0x9f6324[_0x5e914d(0x8d)](_0x34afe1,_0x5e914d(0xa2));try{_0x44bb0f?console['log'](_0x5e914d(0x92)+_0x4ba032+_0x5e914d(0x86)+_0x44bb0f):console[_0x5e914d(0xa0)]('*\x20正在为项目\x20'+_0x4ba032+_0x5e914d(0xbb));console['log'](_0x5e914d(0xbf)+_0x203ace);const _0xfbcdb1=fileURLToPath(import.meta[_0x5e914d(0xc0)]),_0x3dad91=a28_0x9f6324['resolve'](a28_0x9f6324[_0x5e914d(0x7a)](_0xfbcdb1),'../..'),_0x3fe76a=a28_0x9f6324[_0x5e914d(0x8d)](_0x3dad91,_0x5e914d(0xaf));let _0x20cfdc=_0x5e914d(0xc5);try{const _0x45dd41=JSON[_0x5e914d(0x9d)](a28_0x3a6387[_0x5e914d(0xae)](_0x3fe76a,_0x5e914d(0x8f)));_0x20cfdc=_0x45dd41[_0x5e914d(0xba)]||_0x5e914d(0xc5);}catch(_0x24d7e9){}const _0x472cec=readConfig(),_0x3e57a2=typeof _0x472cec[_0x5e914d(0x9e)]===_0x5e914d(0x9b)?_0x472cec[_0x5e914d(0x9e)]:undefined,_0x558dd4={..._0x472cec,'app':_0x44bb0f||'','env':_0x34255f||_0x3e57a2||_0x5e914d(0x89),'createdAt':new Date()[_0x5e914d(0xc2)](),'version':_0x20cfdc};a28_0x3a6387[_0x5e914d(0xc1)](_0x203ace,JSON['stringify'](_0x558dd4,null,0x2),'utf8'),_0x44bb0f?console[_0x5e914d(0xa0)](_0x5e914d(0x98)+_0x44bb0f):console[_0x5e914d(0xa0)](_0x5e914d(0xab)),logger[_0x5e914d(0x9c)]('create','配置应用AppCode:\x20'+_0x44bb0f,{'projectName':_0x4ba032,'configFile':_0x5e914d(0xa2)});}catch(_0x3e857d){logger[_0x5e914d(0xb9)](_0x5e914d(0xb5),_0x5e914d(0xa4)+_0x44bb0f,{'projectName':_0x4ba032,'error':_0x3e857d instanceof Error?_0x3e857d[_0x5e914d(0xac)]:String(_0x3e857d)});}};useEffect(()=>{const _0x25766f=a28_0x21c4;_0x486710[_0x25766f(0x70)]&&_0x19f8db(_0x486710[_0x25766f(0x70)]);},[_0x486710[_0x8e4100(0x70)]]);if(!_0x33fc20&&!_0x58ac26&&!_0x486710[_0x8e4100(0x70)])return a28_0x47872c(EnhancedGuidedCreate,{'onCreate':_0x21b5c8,'env':_0x486710[_0x8e4100(0x9e)]});if(_0x33fc20)return a28_0x9ffb09(a28_0x4fe1a0,{'children':[a28_0x9ffb09(Box,{'marginTop':0x1,'children':[a28_0x47872c(Box,{'width':'1'}),a28_0x47872c(Text,{'color':_0x8e4100(0xaa),'children':_0x8e4100(0x83)}),a28_0x47872c(Text,{'children':'项目名称:\x20'}),a28_0x47872c(Text,{'color':'green','children':_0x198441?.[_0x8e4100(0xa9)]}),_0x198441?.[_0x8e4100(0x95)]&&a28_0x9ffb09(a28_0x4fe1a0,{'children':[a28_0x47872c(Text,{'children':_0x8e4100(0x76)}),a28_0x47872c(Text,{'color':_0x8e4100(0x7c),'children':_0x198441[_0x8e4100(0x95)]})]})]}),a28_0x47872c(TaskRunning,{..._0x4abc39}),a28_0x47872c(TaskRunning,{..._0x3d15bc}),a28_0x47872c(TaskRunning,{..._0x411c1d})]});if(_0x58ac26)return a28_0x9ffb09(a28_0x4fe1a0,{'children':[a28_0x9ffb09(Box,{'marginTop':0x1,'children':[a28_0x47872c(Box,{'width':'1'}),a28_0x47872c(Text,{'color':_0x8e4100(0xaa),'children':_0x8e4100(0x83)}),a28_0x47872c(Text,{'children':'项目名称:\x20'}),a28_0x47872c(Text,{'color':'green','children':_0x198441?.[_0x8e4100(0xa9)]}),_0x198441?.[_0x8e4100(0x95)]&&a28_0x9ffb09(a28_0x4fe1a0,{'children':[a28_0x47872c(Text,{'children':'\x20|\x20应用AppCode:\x20'}),a28_0x47872c(Text,{'color':'cyan','children':_0x198441[_0x8e4100(0x95)]})]})]}),a28_0x47872c(TaskFinished,{..._0x4abc39}),a28_0x47872c(TaskFinished,{..._0x3d15bc}),a28_0x47872c(TaskFinished,{..._0x411c1d}),a28_0x47872c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a28_0x47872c(Text,{'color':_0x8e4100(0xaa),'children':'─'[_0x8e4100(0x7b)](0x3c)})}),a28_0x47872c(Box,{'children':a28_0x47872c(Text,{'color':'green','bold':!![],'children':_0x8e4100(0xa3)})}),a28_0x9ffb09(Box,{'marginTop':0x1,'flexDirection':_0x8e4100(0x8e),'children':[a28_0x9ffb09(Box,{'children':[a28_0x47872c(Text,{'color':_0x8e4100(0x7c),'children':_0x8e4100(0xbd)}),a28_0x47872c(Text,{'color':'white','bold':!![],'children':_0x198441?.[_0x8e4100(0xa9)]})]}),_0x198441?.[_0x8e4100(0x95)]&&a28_0x9ffb09(Box,{'children':[a28_0x47872c(Text,{'color':_0x8e4100(0x7c),'children':_0x8e4100(0x7e)}),a28_0x47872c(Text,{'color':_0x8e4100(0x99),'bold':!![],'children':_0x198441['appCode']})]}),a28_0x9ffb09(Box,{'children':[a28_0x47872c(Text,{'color':_0x8e4100(0x7c),'children':'📦\x20API配置:\x20'}),_0x198441?.[_0x8e4100(0x9f)]?a28_0x47872c(Text,{'color':'green','bold':!![],'children':'已自动拉取\x20✓'}):_0x198441?.[_0x8e4100(0x95)]?a28_0x47872c(Text,{'color':'yellow','bold':!![],'children':_0x8e4100(0x85)}):a28_0x47872c(Text,{'color':'gray','bold':!![],'children':_0x8e4100(0x71)})]})]}),a28_0x47872c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a28_0x47872c(Text,{'color':_0x8e4100(0x7c),'bold':!![],'children':'🚀\x20接下来可以:'})}),a28_0x9ffb09(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a28_0x9ffb09(Box,{'children':[a28_0x47872c(Text,{'color':_0x8e4100(0xaa),'children':_0x8e4100(0xa8)}),a28_0x47872c(Text,{'color':_0x8e4100(0x99),'children':_0x8e4100(0x6e)}),a28_0x47872c(Text,{'color':_0x8e4100(0x7c),'bold':!![],'children':_0x8e4100(0xa5)+_0x198441?.[_0x8e4100(0xa9)]+_0x8e4100(0x6d)})]}),_0x198441?.[_0x8e4100(0x95)]&&!_0x198441?.['pullApi']&&a28_0x9ffb09(Box,{'children':[a28_0x47872c(Text,{'color':_0x8e4100(0x74),'children':_0x8e4100(0x8c)}),a28_0x47872c(Text,{'color':_0x8e4100(0x99),'children':_0x8e4100(0xad)}),a28_0x47872c(Text,{'color':_0x8e4100(0x7c),'bold':!![],'children':_0x8e4100(0xb7)})]}),!_0x198441?.[_0x8e4100(0x95)]&&a28_0x9ffb09(a28_0x4fe1a0,{'children':[a28_0x9ffb09(Box,{'children':[a28_0x47872c(Text,{'color':_0x8e4100(0x7f),'children':_0x8e4100(0x8c)}),a28_0x47872c(Text,{'color':'white','children':_0x8e4100(0x9a)}),a28_0x47872c(Text,{'color':_0x8e4100(0x7c),'bold':!![],'children':'lovrabet\x20config\x20set\x20app\x20[app-code]'})]}),a28_0x9ffb09(Box,{'children':[a28_0x47872c(Text,{'color':'gray','children':_0x8e4100(0xb1)}),a28_0x47872c(Text,{'color':'white','children':'拉取API配置:\x20'}),a28_0x47872c(Text,{'color':_0x8e4100(0x7c),'bold':!![],'children':_0x8e4100(0x94)})]})]})]}),a28_0x47872c(Box,{'marginTop':0x1,'children':a28_0x47872c(Text,{'color':_0x8e4100(0xaa),'children':'─'[_0x8e4100(0x7b)](0x3c)})})]});return null;}
|
|
1
|
+
(function(_0xae6694,_0x4c6d1e){const _0x48d906=a28_0x47dd,_0x558224=_0xae6694();while(!![]){try{const _0x3b5448=-parseInt(_0x48d906(0xcd))/0x1*(parseInt(_0x48d906(0xd4))/0x2)+-parseInt(_0x48d906(0x95))/0x3+parseInt(_0x48d906(0xb8))/0x4*(-parseInt(_0x48d906(0x98))/0x5)+-parseInt(_0x48d906(0xe4))/0x6+-parseInt(_0x48d906(0x8a))/0x7*(-parseInt(_0x48d906(0xa1))/0x8)+parseInt(_0x48d906(0xb0))/0x9+parseInt(_0x48d906(0xcb))/0xa;if(_0x3b5448===_0x4c6d1e)break;else _0x558224['push'](_0x558224['shift']());}catch(_0x46efdf){_0x558224['push'](_0x558224['shift']());}}}(a28_0x20ee,0x6d377));import{jsx as a28_0x29bf3f,Fragment as a28_0x2f4ba1,jsxs as a28_0x5724bd}from'react/jsx-runtime';import a28_0x21384f from'node:path';import a28_0x16d927 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';function a28_0x47dd(_0x43b211,_0x2572c0){const _0x20eee4=a28_0x20ee();return a28_0x47dd=function(_0x47dda6,_0x29c947){_0x47dda6=_0x47dda6-0x8a;let _0x2d43e9=_0x20eee4[_0x47dda6];return _0x2d43e9;},a28_0x47dd(_0x43b211,_0x2572c0);}import{readConfig}from'../utils/config.js';function a28_0x20ee(){const _0x4c892d=['cd\x20','743403UcUWRS','stringify','lovrabet\x20api\x20pull','175085vdhdaI','accessSync','resolve','white','2.\x20','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20app\x20<app-code>\x27\x20配置','清理项目目录失败:\x20','*\x20正在为项目\x20','📁\x20项目名称:\x20','24MtMfdd','×\x20项目创建失败:\x20','×\x20无法在当前目录创建项目,请检查目录权限','appCode','\x20&&\x20lovrabet\x20start','需手动拉取','version','\x20|\x20应用AppCode:\x20','项目创建完成:\x20','writeFileSync','.lovrabetrc','项目创建失败:\x20','\x20√\x20','../..','×\x20项目目录\x20','2351502zevWeZ','length','yellow','gray','constants','readFileSync','rmSync','*\x20正在拉取\x20API\x20配置...','68DoeDSH','配置应用AppCode:\x20','message','🎉\x20项目创建成功!','cyan','\x20已存在,请使用其他项目名','error','utf8','3.\x20','green','trim','📦\x20API配置:\x20','package.json','配置应用AppCode失败:\x20','column','API\x20配置拉取失败:\x20','success','项目名称:\x20','pullApi','9973170OMtIXj','lovrabet\x20config\x20set\x20app\x20[app-code]','4554LZITTP','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','开始创建项目:\x20','log','repeat','配置AppCode:\x20','API\x20配置拉取异常:\x20','236boELbc','cwd','info','projectCode','dirname','warn','join','url','existsSync','projectName','1.\x20','\x20创建配置文件','env','toLocaleString','test','🔗\x20应用AppCode:\x20','160140nDQnpe','拉取API配置:\x20','parse','1390452dWWXKC','string','1.0.0','create','doTask','×\x20项目名不能为空','setLogPath','*\x20清理失败的项目目录:\x20','*\x20配置文件路径:\x20','√\x20API\x20配置拉取完成'];a28_0x20ee=function(){return _0x4c892d;};return a28_0x20ee();}import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x31756d){const _0x3e294a=a28_0x47dd,[_0x2e6429,_0x37c7c2]=useState(![]),[_0x21807e,_0x5380f2]=useState(![]),[_0xa7b15d,_0x517e67]=useState(null),_0x2890c1=useCopyProjectTemplate(),_0x90a6e=useInstallDependencies(),_0x27989f=useFormatCode(),_0x22ea64=async _0x4d282f=>{const _0x50022a=a28_0x47dd;if(!_0x4d282f['projectName']||_0x4d282f['projectName'][_0x50022a(0xc2)]()===''){console['error'](_0x50022a(0x8f));return;}const _0x1953d1=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1953d1[_0x50022a(0xe2)](_0x4d282f[_0x50022a(0xdd)])){console['error']('×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符');return;}if(_0x4d282f[_0x50022a(0xdd)][_0x50022a(0xb1)]>0x64){console[_0x50022a(0xbe)]('×\x20项目名过长,最多支持\x20100\x20个字符');return;}const _0x39423c=a28_0x21384f['resolve'](process['cwd'](),_0x4d282f[_0x50022a(0xdd)]);if(a28_0x16d927[_0x50022a(0xdc)](_0x39423c)){console[_0x50022a(0xbe)](_0x50022a(0xaf)+_0x4d282f[_0x50022a(0xdd)]+_0x50022a(0xbd));return;}try{const _0x5b888e=a28_0x21384f[_0x50022a(0xd8)](_0x39423c);a28_0x16d927[_0x50022a(0x99)](_0x5b888e,a28_0x16d927[_0x50022a(0xb4)]['W_OK']);}catch(_0x279d77){console['error'](_0x50022a(0xa3));return;}_0x517e67(_0x4d282f),_0x37c7c2(!![]),logger[_0x50022a(0x90)](_0x39423c),logger[_0x50022a(0xd6)](_0x50022a(0x8d),_0x50022a(0xcf)+_0x4d282f[_0x50022a(0xdd)],{'projectDir':_0x39423c,'appCode':_0x4d282f[_0x50022a(0xa4)]});try{await _0x2890c1[_0x50022a(0x8e)](_0x4d282f[_0x50022a(0xdd)]),await _0x90a6e[_0x50022a(0x8e)](_0x4d282f[_0x50022a(0xdd)]),await _0x27989f['doTask'](_0x4d282f['projectName']),await _0x3a33a7(_0x4d282f[_0x50022a(0xdd)],_0x4d282f[_0x50022a(0xa4)]||'',_0x4d282f['env']);if(_0x4d282f[_0x50022a(0xca)]&&_0x4d282f['appCode']){console[_0x50022a(0xd0)](_0x50022a(0xb7));try{const _0x8fff23=await pullApiSilent(_0x4d282f['appCode'],undefined,_0x39423c,_0x4d282f[_0x50022a(0xe0)]);_0x8fff23?(console[_0x50022a(0xd0)](_0x50022a(0x93)),logger[_0x50022a(0xd6)](_0x50022a(0x8d),'API\x20配置拉取成功:\x20'+_0x4d282f[_0x50022a(0xa4)],{'projectDir':_0x39423c,'appCode':_0x4d282f['appCode'],'env':_0x4d282f['env']})):(console[_0x50022a(0xd0)]('!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x50022a(0xd9)](_0x50022a(0x8d),_0x50022a(0xc7)+_0x4d282f[_0x50022a(0xa4)],{'projectDir':_0x39423c,'appCode':_0x4d282f['appCode'],'env':_0x4d282f['env']}));}catch(_0x38fcbe){console[_0x50022a(0xd0)](_0x50022a(0xce)),logger[_0x50022a(0xd9)](_0x50022a(0x8d),_0x50022a(0xd3)+_0x4d282f[_0x50022a(0xa4)],{'projectDir':_0x39423c,'appCode':_0x4d282f['appCode'],'env':_0x4d282f[_0x50022a(0xe0)],'error':_0x38fcbe instanceof Error?_0x38fcbe['message']:String(_0x38fcbe)});}}logger[_0x50022a(0xc8)](_0x50022a(0x8d),_0x50022a(0xa9)+_0x4d282f[_0x50022a(0xdd)]),_0x5380f2(!![]),_0x37c7c2(![]);}catch(_0x2fd397){logger[_0x50022a(0xbe)](_0x50022a(0x8d),_0x50022a(0xac)+_0x4d282f[_0x50022a(0xdd)],{'error':_0x2fd397 instanceof Error?_0x2fd397[_0x50022a(0xba)]:String(_0x2fd397)});try{a28_0x16d927[_0x50022a(0xdc)](_0x39423c)&&(console[_0x50022a(0xd0)](_0x50022a(0x91)+_0x39423c),a28_0x16d927[_0x50022a(0xb6)](_0x39423c,{'recursive':!![],'force':!![]}));}catch(_0x1597c2){logger[_0x50022a(0xd9)](_0x50022a(0x8d),_0x50022a(0x9e)+_0x39423c,{'error':_0x1597c2 instanceof Error?_0x1597c2[_0x50022a(0xba)]:String(_0x1597c2)});}_0x37c7c2(![]),console[_0x50022a(0xbe)](_0x50022a(0xa2)+(_0x2fd397 instanceof Error?_0x2fd397[_0x50022a(0xba)]:String(_0x2fd397)));}},_0x2e0767=async _0x274ae9=>{const _0x2e1e77=a28_0x47dd;await _0x22ea64({'projectName':_0x274ae9,'env':_0x31756d[_0x2e1e77(0xe0)]});},_0x3a33a7=async(_0x4e46bd,_0x170142,_0x57b047)=>{const _0x4a6668=a28_0x47dd,_0x5df1ff=a28_0x21384f['resolve'](process[_0x4a6668(0xd5)](),_0x4e46bd),_0x126842=a28_0x21384f['join'](_0x5df1ff,_0x4a6668(0xab));try{_0x170142?console['log'](_0x4a6668(0x9f)+_0x4e46bd+'\x20配置应用AppCode:\x20'+_0x170142):console[_0x4a6668(0xd0)](_0x4a6668(0x9f)+_0x4e46bd+_0x4a6668(0xdf));console[_0x4a6668(0xd0)](_0x4a6668(0x92)+_0x126842);const _0x2a599c=fileURLToPath(import.meta[_0x4a6668(0xdb)]),_0x54c6d0=a28_0x21384f[_0x4a6668(0x9a)](a28_0x21384f[_0x4a6668(0xd8)](_0x2a599c),_0x4a6668(0xae)),_0x391872=a28_0x21384f[_0x4a6668(0xda)](_0x54c6d0,_0x4a6668(0xc4));let _0x2cbbce=_0x4a6668(0x8c);try{const _0x3fa74f=JSON[_0x4a6668(0xe6)](a28_0x16d927[_0x4a6668(0xb5)](_0x391872,_0x4a6668(0xbf)));_0x2cbbce=_0x3fa74f[_0x4a6668(0xa7)]||_0x4a6668(0x8c);}catch(_0x1e41ce){}const _0x3fc99f=readConfig(),_0x675a7a=typeof _0x3fc99f[_0x4a6668(0xe0)]===_0x4a6668(0x8b)?_0x3fc99f[_0x4a6668(0xe0)]:undefined,_0x117c11={..._0x3fc99f,'app':_0x170142||'','env':_0x57b047||_0x675a7a||'online','createdAt':new Date()[_0x4a6668(0xe1)](),'version':_0x2cbbce};a28_0x16d927[_0x4a6668(0xaa)](_0x126842,JSON[_0x4a6668(0x96)](_0x117c11,null,0x2),_0x4a6668(0xbf)),_0x170142?console[_0x4a6668(0xd0)]('√\x20配置文件已创建,应用AppCode:\x20'+_0x170142):console[_0x4a6668(0xd0)](_0x4a6668(0x9d)),logger['info'](_0x4a6668(0x8d),_0x4a6668(0xb9)+_0x170142,{'projectName':_0x4e46bd,'configFile':'.lovrabetrc'});}catch(_0x4b77bd){logger[_0x4a6668(0xbe)]('create',_0x4a6668(0xc5)+_0x170142,{'projectName':_0x4e46bd,'error':_0x4b77bd instanceof Error?_0x4b77bd[_0x4a6668(0xba)]:String(_0x4b77bd)});}};useEffect(()=>{_0x31756d['projectCode']&&_0x2e0767(_0x31756d['projectCode']);},[_0x31756d[_0x3e294a(0xd7)]]);if(!_0x2e6429&&!_0x21807e&&!_0x31756d[_0x3e294a(0xd7)])return a28_0x29bf3f(EnhancedGuidedCreate,{'onCreate':_0x22ea64,'env':_0x31756d[_0x3e294a(0xe0)]});if(_0x2e6429)return a28_0x5724bd(a28_0x2f4ba1,{'children':[a28_0x5724bd(Box,{'marginTop':0x1,'children':[a28_0x29bf3f(Box,{'width':'1'}),a28_0x29bf3f(Text,{'color':'green','children':_0x3e294a(0xad)}),a28_0x29bf3f(Text,{'children':'项目名称:\x20'}),a28_0x29bf3f(Text,{'color':'green','children':_0xa7b15d?.[_0x3e294a(0xdd)]}),_0xa7b15d?.['appCode']&&a28_0x5724bd(a28_0x2f4ba1,{'children':[a28_0x29bf3f(Text,{'children':_0x3e294a(0xa8)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'children':_0xa7b15d[_0x3e294a(0xa4)]})]})]}),a28_0x29bf3f(TaskRunning,{..._0x2890c1}),a28_0x29bf3f(TaskRunning,{..._0x90a6e}),a28_0x29bf3f(TaskRunning,{..._0x27989f})]});if(_0x21807e)return a28_0x5724bd(a28_0x2f4ba1,{'children':[a28_0x5724bd(Box,{'marginTop':0x1,'children':[a28_0x29bf3f(Box,{'width':'1'}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xc1),'children':_0x3e294a(0xad)}),a28_0x29bf3f(Text,{'children':_0x3e294a(0xc9)}),a28_0x29bf3f(Text,{'color':'green','children':_0xa7b15d?.[_0x3e294a(0xdd)]}),_0xa7b15d?.[_0x3e294a(0xa4)]&&a28_0x5724bd(a28_0x2f4ba1,{'children':[a28_0x29bf3f(Text,{'children':_0x3e294a(0xa8)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'children':_0xa7b15d[_0x3e294a(0xa4)]})]})]}),a28_0x29bf3f(TaskFinished,{..._0x2890c1}),a28_0x29bf3f(TaskFinished,{..._0x90a6e}),a28_0x29bf3f(TaskFinished,{..._0x27989f}),a28_0x29bf3f(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a28_0x29bf3f(Text,{'color':_0x3e294a(0xc1),'children':'─'[_0x3e294a(0xd1)](0x3c)})}),a28_0x29bf3f(Box,{'children':a28_0x29bf3f(Text,{'color':'green','bold':!![],'children':_0x3e294a(0xbb)})}),a28_0x5724bd(Box,{'marginTop':0x1,'flexDirection':'column','children':[a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'children':_0x3e294a(0xa0)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0x9b),'bold':!![],'children':_0xa7b15d?.[_0x3e294a(0xdd)]})]}),_0xa7b15d?.[_0x3e294a(0xa4)]&&a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'children':_0x3e294a(0xe3)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0x9b),'bold':!![],'children':_0xa7b15d[_0x3e294a(0xa4)]})]}),a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'children':_0x3e294a(0xc3)}),_0xa7b15d?.['pullApi']?a28_0x29bf3f(Text,{'color':_0x3e294a(0xc1),'bold':!![],'children':'已自动拉取\x20✓'}):_0xa7b15d?.['appCode']?a28_0x29bf3f(Text,{'color':_0x3e294a(0xb2),'bold':!![],'children':_0x3e294a(0xa6)}):a28_0x29bf3f(Text,{'color':_0x3e294a(0xb3),'bold':!![],'children':'未配置'})]})]}),a28_0x29bf3f(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'bold':!![],'children':'🚀\x20接下来可以:'})}),a28_0x5724bd(Box,{'marginLeft':0x2,'flexDirection':_0x3e294a(0xc6),'children':[a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':_0x3e294a(0xc1),'children':_0x3e294a(0xde)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0x9b),'children':'启动项目:\x20'}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'bold':!![],'children':_0x3e294a(0x94)+_0xa7b15d?.[_0x3e294a(0xdd)]+_0x3e294a(0xa5)})]}),_0xa7b15d?.[_0x3e294a(0xa4)]&&!_0xa7b15d?.['pullApi']&&a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':_0x3e294a(0xb2),'children':_0x3e294a(0x9c)}),a28_0x29bf3f(Text,{'color':'white','children':'拉取API配置:\x20'}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'bold':!![],'children':_0x3e294a(0x97)})]}),!_0xa7b15d?.['appCode']&&a28_0x5724bd(a28_0x2f4ba1,{'children':[a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':_0x3e294a(0xb3),'children':'2.\x20'}),a28_0x29bf3f(Text,{'color':_0x3e294a(0x9b),'children':_0x3e294a(0xd2)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'bold':!![],'children':_0x3e294a(0xcc)})]}),a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':'gray','children':_0x3e294a(0xc0)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0x9b),'children':_0x3e294a(0xe5)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'bold':!![],'children':'lovrabet\x20api\x20pull\x20[app-code]'})]})]})]}),a28_0x29bf3f(Box,{'marginTop':0x1,'children':a28_0x29bf3f(Text,{'color':'green','children':'─'[_0x3e294a(0xd1)](0x3c)})})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a29_0x4333(_0x3c961e,_0x1a54ea){var _0x32bcaf=a29_0x32bc();return a29_0x4333=function(_0x4333ff,_0x1c714a){_0x4333ff=_0x4333ff-0xc0;var _0x507a85=_0x32bcaf[_0x4333ff];return _0x507a85;},a29_0x4333(_0x3c961e,_0x1a54ea);}(function(_0x34646e,_0x1b6d91){var _0x494e71=a29_0x4333,_0x4fe920=_0x34646e();while(!![]){try{var _0x14ae55=parseInt(_0x494e71(0xcd))/0x1*(-parseInt(_0x494e71(0xc9))/0x2)+parseInt(_0x494e71(0xca))/0x3*(-parseInt(_0x494e71(0xc0))/0x4)+-parseInt(_0x494e71(0xcb))/0x5+parseInt(_0x494e71(0xc4))/0x6+-parseInt(_0x494e71(0xc6))/0x7*(parseInt(_0x494e71(0xc8))/0x8)+-parseInt(_0x494e71(0xc3))/0x9+parseInt(_0x494e71(0xcc))/0xa;if(_0x14ae55===_0x1b6d91)break;else _0x4fe920['push'](_0x4fe920['shift']());}catch(_0x5c17e1){_0x4fe920['push'](_0x4fe920['shift']());}}}(a29_0x32bc,0x30db8));import{jsx as a29_0x3dfc42,jsxs as a29_0x1fa5a4}from'react/jsx-runtime';import{Box,Text}from'ink';function a29_0x32bc(){var _0x3746d4=['taskName','35LBfslo','\x20√\x20','579560dCVSkT','142586deCZds','155742JjXqGI','423075SpQgJd','9896710UJDFAQ','1MkLbAN','4edtxwr','green','elapsed','2158326iMamSN','121860fTktKl'];a29_0x32bc=function(){return _0x3746d4;};return a29_0x32bc();}import{TaskTime}from'./task-time.js';export function TaskFinished(_0x4e7b5a){var _0x10ef03=a29_0x4333;return a29_0x1fa5a4(Box,{'children':[a29_0x3dfc42(Box,{'width':'1'}),a29_0x3dfc42(Text,{'color':_0x10ef03(0xc1),'children':_0x10ef03(0xc7)}),a29_0x3dfc42(Text,{'children':_0x4e7b5a[_0x10ef03(0xc5)]}),a29_0x3dfc42(TaskTime,{'elapsed':_0x4e7b5a[_0x10ef03(0xc2)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a30_0x346c(){var _0x2e11b1=['6lxuHFq','loading','1336255JFUKqG','212526JOqUIs','376zBuPWE','8XtWEUq','9ITszZo','1050395kImkWG','2630230pmFLaQ','\x20\x20\x20','146573kAeOgh','4016749iVyNHs','green','2373588GrfaZX','finished','\x20√\x20'];a30_0x346c=function(){return _0x2e11b1;};return a30_0x346c();}(function(_0x2acfeb,_0x513c38){var _0x37141c=a30_0x4d12,_0x2e6b34=_0x2acfeb();while(!![]){try{var _0x177232=parseInt(_0x37141c(0x8f))/0x1+parseInt(_0x37141c(0x8a))/0x2+-parseInt(_0x37141c(0x90))/0x3*(-parseInt(_0x37141c(0x92))/0x4)+-parseInt(_0x37141c(0x94))/0x5*(parseInt(_0x37141c(0x8d))/0x6)+-parseInt(_0x37141c(0x87))/0x7*(parseInt(_0x37141c(0x91))/0x8)+-parseInt(_0x37141c(0x93))/0x9*(parseInt(_0x37141c(0x95))/0xa)+-parseInt(_0x37141c(0x88))/0xb;if(_0x177232===_0x513c38)break;else _0x2e6b34['push'](_0x2e6b34['shift']());}catch(_0x44e2e0){_0x2e6b34['push'](_0x2e6b34['shift']());}}}(a30_0x346c,0xcda63));function a30_0x4d12(_0x354405,_0x3aaaca){var _0x346cce=a30_0x346c();return a30_0x4d12=function(_0x4d1200,_0x3a9e51){_0x4d1200=_0x4d1200-0x86;var _0x5401df=_0x346cce[_0x4d1200];return _0x5401df;},a30_0x4d12(_0x354405,_0x3aaaca);}import{jsx as a30_0x347b7b,jsxs as a30_0x24662e}from'react/jsx-runtime';import{Text}from'ink';import a30_0x3cb39a from'ink-spinner';export function TaskLoading(_0x2d1643){var _0x521d77=a30_0x4d12;if(_0x2d1643[_0x521d77(0x8b)])return a30_0x347b7b(Text,{'color':'green','children':_0x521d77(0x8c)});if(_0x2d1643[_0x521d77(0x8e)])return a30_0x24662e(Text,{'color':_0x521d77(0x89),'children':['\x20',a30_0x347b7b(a30_0x3cb39a,{'type':'dots'}),'\x20']});return a30_0x347b7b(Text,{'children':_0x521d77(0x86)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a5eb6,_0x7555ea){var _0x5bf89f=a31_0x52e7,_0x9daaa3=_0x2a5eb6();while(!![]){try{var _0x32dd13=-parseInt(_0x5bf89f(0x151))/0x1*(-parseInt(_0x5bf89f(0x14c))/0x2)+parseInt(_0x5bf89f(0x14d))/0x3+parseInt(_0x5bf89f(0x14b))/0x4*(-parseInt(_0x5bf89f(0x154))/0x5)+parseInt(_0x5bf89f(0x150))/0x6+parseInt(_0x5bf89f(0x14e))/0x7+-parseInt(_0x5bf89f(0x153))/0x8+-parseInt(_0x5bf89f(0x155))/0x9;if(_0x32dd13===_0x7555ea)break;else _0x9daaa3['push'](_0x9daaa3['shift']());}catch(_0x25c6f7){_0x9daaa3['push'](_0x9daaa3['shift']());}}}(a31_0x212c,0xd34eb));import{jsx as a31_0x187886,jsxs as a31_0xbaa2b}from'react/jsx-runtime';function a31_0x52e7(_0x269360,_0x3219e8){var _0x212c49=a31_0x212c();return a31_0x52e7=function(_0x52e727,_0x1413de){_0x52e727=_0x52e727-0x14b;var _0x39cbb1=_0x212c49[_0x52e727];return _0x39cbb1;},a31_0x52e7(_0x269360,_0x3219e8);}import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x1b81ca){var _0x590755=a31_0x52e7;return a31_0xbaa2b(Box,{'children':[a31_0x187886(Box,{'width':'1'}),a31_0x187886(TaskLoading,{..._0x1b81ca}),a31_0x187886(Text,{'children':_0x1b81ca[_0x590755(0x14f)]}),a31_0x187886(TaskTime,{'elapsed':_0x1b81ca[_0x590755(0x152)]})]});}function a31_0x212c(){var _0x3d909e=['10TVSShF','441216czeyRZ','1319844UEGjqC','1466IWZSJb','1741545GWxRBV','11083282vmVUlY','taskName','1176756hUCdeT','205MOePga','elapsed','7486168gCgmjp'];a31_0x212c=function(){return _0x3d909e;};return a31_0x212c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xe1514c,_0x32d9f1){var _0x4b8bfa=a32_0x31fc,_0x36fdd7=_0xe1514c();while(!![]){try{var _0x980746=-parseInt(_0x4b8bfa(0x1f8))/0x1+-parseInt(_0x4b8bfa(0x1f7))/0x2+parseInt(_0x4b8bfa(0x1f4))/0x3*(-parseInt(_0x4b8bfa(0x1f2))/0x4)+parseInt(_0x4b8bfa(0x1fb))/0x5*(-parseInt(_0x4b8bfa(0x1f6))/0x6)+-parseInt(_0x4b8bfa(0x1fc))/0x7*(parseInt(_0x4b8bfa(0x1f3))/0x8)+-parseInt(_0x4b8bfa(0x1f5))/0x9+parseInt(_0x4b8bfa(0x1fa))/0xa*(parseInt(_0x4b8bfa(0x1f9))/0xb);if(_0x980746===_0x32d9f1)break;else _0x36fdd7['push'](_0x36fdd7['shift']());}catch(_0x154c2e){_0x36fdd7['push'](_0x36fdd7['shift']());}}}(a32_0x15a4,0x43706));import{jsx as a32_0x348f09,Fragment as a32_0x4afdfb,jsxs as a32_0x3973c2}from'react/jsx-runtime';import{Text}from'ink';function a32_0x31fc(_0x43f63f,_0x540b96){var _0x15a498=a32_0x15a4();return a32_0x31fc=function(_0x31fcf5,_0x4afe21){_0x31fcf5=_0x31fcf5-0x1f2;var _0x419fb6=_0x15a498[_0x31fcf5];return _0x419fb6;},a32_0x31fc(_0x43f63f,_0x540b96);}export function TaskTime(_0x4b5a30){var _0x107660=a32_0x31fc;if(_0x4b5a30[_0x107660(0x1fd)])return a32_0x3973c2(a32_0x4afdfb,{'children':[a32_0x348f09(Text,{'color':_0x107660(0x1fe),'children':'\x20['}),a32_0x348f09(Text,{'color':_0x107660(0x1fe),'bold':!![],'children':_0x4b5a30[_0x107660(0x1fd)]}),a32_0x348f09(Text,{'color':_0x107660(0x1fe),'children':']'})]});return null;}function a32_0x15a4(){var _0x47e478=['2086845MUYaRb','7NeoDwS','elapsed','gray','67372TlOwCv','4174216ffSWxO','69GUshQh','1499814bYeSEO','6FDlRYf','526716Lytbxs','245566PnWIhH','2211ldvpnK','113350NtNAuN'];a32_0x15a4=function(){return _0x47e478;};return a32_0x15a4();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x3f2270=a33_0x1319;(function(_0x14926e,_0x236927){const _0x969b2=a33_0x1319,_0x4dbf9c=_0x14926e();while(!![]){try{const _0x34680e=-parseInt(_0x969b2(0xa1))/0x1*(-parseInt(_0x969b2(0x8f))/0x2)+parseInt(_0x969b2(0x9d))/0x3*(parseInt(_0x969b2(0x92))/0x4)+-parseInt(_0x969b2(0x9b))/0x5*(parseInt(_0x969b2(0x8e))/0x6)+parseInt(_0x969b2(0x8b))/0x7+parseInt(_0x969b2(0x9e))/0x8+parseInt(_0x969b2(0x9a))/0x9+parseInt(_0x969b2(0x99))/0xa*(-parseInt(_0x969b2(0x9f))/0xb);if(_0x34680e===_0x236927)break;else _0x4dbf9c['push'](_0x4dbf9c['shift']());}catch(_0x3abed1){_0x4dbf9c['push'](_0x4dbf9c['shift']());}}}(a33_0x329f,0x91c6b));import a33_0x44e3c0 from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';function a33_0x329f(){const _0xfa2b3d=['message','../../templates/projects/sub-app-react-demo','resolve','url','success','info','27579090xuxBCQ','8578062MUsiGX','95LNZRNh','now','1026738bZBnFd','4276968ljhBTP','11ctigqO','项目模板复制完成','40697OElAqR','cwd','5712091FBnzEA','复制项目文件','开始复制项目模板','133626vzkTPf','22wudhKN','copy','dirname','12zBiFtv'];a33_0x329f=function(){return _0xfa2b3d;};return a33_0x329f();}import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a33_0x1319(_0x250216,_0x12931e){const _0x329f9b=a33_0x329f();return a33_0x1319=function(_0x13196a,_0x3f7c97){_0x13196a=_0x13196a-0x8a;let _0xa611d7=_0x329f9b[_0x13196a];return _0xa611d7;},a33_0x1319(_0x250216,_0x12931e);}const __dirname=a33_0x44e3c0[a33_0x3f2270(0x91)](fileURLToPath(import.meta[a33_0x3f2270(0x96)])),templateDir=a33_0x44e3c0['resolve'](__dirname,a33_0x3f2270(0x94));export function useCopyProjectTemplate(){const _0x37cd8=a33_0x3f2270,[_0x59b327,_0x5e474c]=useState(![]),[_0x1f61fa,_0xf848cd]=useState(![]),[_0x25e978,_0x217721]=useState(''),_0x4b69b9=useCallback(async _0x162141=>{const _0x21bb91=a33_0x1319,_0x18b795=Date[_0x21bb91(0x9c)](),_0x3d2b12=a33_0x44e3c0[_0x21bb91(0x95)](process[_0x21bb91(0x8a)](),_0x162141);_0x5e474c(!![]);try{logger[_0x21bb91(0x98)](_0x21bb91(0x90),_0x21bb91(0x8d),{'projectCode':_0x162141,'templateDir':templateDir}),await copyDirectory(templateDir,_0x3d2b12);const _0x4d0c40=Date['now']()-_0x18b795;logger[_0x21bb91(0x97)](_0x21bb91(0x90),_0x21bb91(0xa0),_0x4d0c40,{'projectCode':_0x162141});}catch(_0xa996b6){const _0x15b2a7=Date[_0x21bb91(0x9c)]()-_0x18b795;logger['error'](_0x21bb91(0x90),'项目模板复制失败',{'projectCode':_0x162141,'error':_0xa996b6 instanceof Error?_0xa996b6[_0x21bb91(0x93)]:String(_0xa996b6),'duration':_0x15b2a7});throw _0xa996b6;}finally{_0x5e474c(![]),_0xf848cd(!![]),_0x217721(formatElapsed(_0x18b795));}},[]);return{'taskName':_0x37cd8(0x8c),'finished':_0x1f61fa,'loading':_0x59b327,'elapsed':_0x25e978,'doTask':_0x4b69b9};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xaafd61,_0x439fa0){const _0x2957fe=a34_0x26ca,_0x13cbab=_0xaafd61();while(!![]){try{const _0x8b9e49=-parseInt(_0x2957fe(0x11e))/0x1*(-parseInt(_0x2957fe(0x119))/0x2)+-parseInt(_0x2957fe(0x121))/0x3+-parseInt(_0x2957fe(0x11a))/0x4+parseInt(_0x2957fe(0x122))/0x5+parseInt(_0x2957fe(0x11b))/0x6*(parseInt(_0x2957fe(0x11c))/0x7)+parseInt(_0x2957fe(0x11d))/0x8+-parseInt(_0x2957fe(0x123))/0x9;if(_0x8b9e49===_0x439fa0)break;else _0x13cbab['push'](_0x13cbab['shift']());}catch(_0x2ea46d){_0x13cbab['push'](_0x13cbab['shift']());}}}(a34_0x372d,0x3db97));import a34_0x58a617 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 useFormatCode(){const [_0x5ae192,_0x5c0293]=useState(![]),[_0x13c02a,_0x1ab86c]=useState(![]),[_0x1ed07a,_0x35dd13]=useState(''),_0x45904c=useCallback(async _0xf35a5=>{const _0x4b645a=a34_0x26ca,_0x42b06b=Date[_0x4b645a(0x115)](),_0x2e8e3d=a34_0x58a617[_0x4b645a(0x127)](process[_0x4b645a(0x120)](),_0xf35a5);_0x5c0293(!![]);try{logger[_0x4b645a(0x125)]('format',_0x4b645a(0x118),{'projectCode':_0xf35a5}),await execa(_0x4b645a(0x116),['prettier','--write','.'],{'cwd':_0x2e8e3d});const _0x215e18=Date[_0x4b645a(0x115)]()-_0x42b06b;logger[_0x4b645a(0x117)](_0x4b645a(0x124),_0x4b645a(0x126),_0x215e18,{'projectCode':_0xf35a5});}catch(_0x338492){const _0xb49e4e=Date[_0x4b645a(0x115)]()-_0x42b06b;logger['error']('format','代码格式化失败',{'projectCode':_0xf35a5,'error':_0x338492 instanceof Error?_0x338492[_0x4b645a(0x11f)]:String(_0x338492),'duration':_0xb49e4e});throw _0x338492;}finally{_0x5c0293(![]),_0x1ab86c(!![]),_0x35dd13(formatElapsed(_0x42b06b));}},[]);return{'taskName':'格式化代码','finished':_0x13c02a,'loading':_0x5ae192,'elapsed':_0x1ed07a,'doTask':_0x45904c};}function a34_0x26ca(_0x482dca,_0x1514e4){const _0x372d06=a34_0x372d();return a34_0x26ca=function(_0x26ca70,_0x444f19){_0x26ca70=_0x26ca70-0x115;let _0x1056cd=_0x372d06[_0x26ca70];return _0x1056cd;},a34_0x26ca(_0x482dca,_0x1514e4);}function a34_0x372d(){const _0x5d9005=['309050yGKUEp','543872EbmdKr','5RQuXbv','message','cwd','1335144Ukdosx','2180875qsDXAz','2188332JqHzQC','format','info','代码格式化完成','resolve','now','npx','success','开始格式化代码','69994gqNEan','718500CVhvqo','60yyIlKa'];a34_0x372d=function(){return _0x5d9005;};return a34_0x372d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4fd5ee,_0x54ae24){const _0x233c07=a35_0x3e00,_0x24161d=_0x4fd5ee();while(!![]){try{const _0x3a6330=-parseInt(_0x233c07(0x134))/0x1+-parseInt(_0x233c07(0x141))/0x2+-parseInt(_0x233c07(0x140))/0x3+-parseInt(_0x233c07(0x139))/0x4+-parseInt(_0x233c07(0x144))/0x5*(-parseInt(_0x233c07(0x13c))/0x6)+-parseInt(_0x233c07(0x143))/0x7+parseInt(_0x233c07(0x137))/0x8;if(_0x3a6330===_0x54ae24)break;else _0x24161d['push'](_0x24161d['shift']());}catch(_0x27cfba){_0x24161d['push'](_0x24161d['shift']());}}}(a35_0xdbe1,0x720a1));function a35_0xdbe1(){const _0x177dbd=['now','resolve','https://registry.npmmirror.com','install','563336MsblNX','message','开始安装依赖','21268968bvGJdN','success','1513280scPRAv','cwd','error','2603400byceAg','--registry','安装依赖','info','460473eJDoxG','1562582OnzCca','依赖安装完成','5242846odRvWd','5bgUaKS','依赖安装失败'];a35_0xdbe1=function(){return _0x177dbd;};return a35_0xdbe1();}import a35_0xa0a2a6 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 a35_0x3e00(_0x35a809,_0x1b6fec){const _0xdbe181=a35_0xdbe1();return a35_0x3e00=function(_0x3e00fc,_0x1d0383){_0x3e00fc=_0x3e00fc-0x133;let _0x40cf81=_0xdbe181[_0x3e00fc];return _0x40cf81;},a35_0x3e00(_0x35a809,_0x1b6fec);}export function useInstallDependencies(){const _0x456433=a35_0x3e00,[_0x5a4345,_0x14dfe5]=useState(![]),[_0x5a449b,_0x25ad85]=useState(![]),[_0x35a13a,_0x474d02]=useState(''),_0x32a235=useCallback(async _0x9545c2=>{const _0x532c9a=a35_0x3e00,_0x1ebcd5=Date['now'](),_0x3e6be0=a35_0xa0a2a6[_0x532c9a(0x147)](process[_0x532c9a(0x13a)](),_0x9545c2);_0x14dfe5(!![]),_0x25ad85(![]);const _0x43b37e=async(_0x3e2a7a,_0x35f2f3)=>{await execa(_0x3e2a7a,_0x35f2f3,{'cwd':_0x3e6be0});};try{logger[_0x532c9a(0x13f)]('install',_0x532c9a(0x136),{'projectCode':_0x9545c2,'registry':'https://registry.npmmirror.com'}),await _0x43b37e('npm',[_0x532c9a(0x133),_0x532c9a(0x13d),_0x532c9a(0x148)]);const _0x1cfb98=Date[_0x532c9a(0x146)]()-_0x1ebcd5;logger[_0x532c9a(0x138)](_0x532c9a(0x133),_0x532c9a(0x142),_0x1cfb98,{'projectCode':_0x9545c2});}catch(_0x22824f){const _0x19d1d8=Date[_0x532c9a(0x146)]()-_0x1ebcd5;logger[_0x532c9a(0x13b)](_0x532c9a(0x133),_0x532c9a(0x145),{'projectCode':_0x9545c2,'error':_0x22824f instanceof Error?_0x22824f[_0x532c9a(0x135)]:String(_0x22824f),'duration':_0x19d1d8});throw _0x22824f;}finally{_0x14dfe5(![]),_0x25ad85(!![]),_0x474d02(formatElapsed(_0x1ebcd5));}},[]);return{'taskName':_0x456433(0x13e),'finished':_0x5a449b,'loading':_0x5a4345,'elapsed':_0x35a13a,'doTask':_0x32a235};}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x69bf6f,_0x41594f){var _0x1fe011=a36_0x45a2,_0x34761e=_0x69bf6f();while(!![]){try{var _0x58061a=-parseInt(_0x1fe011(0x1b7))/0x1+-parseInt(_0x1fe011(0x1be))/0x2*(parseInt(_0x1fe011(0x1bb))/0x3)+parseInt(_0x1fe011(0x1c0))/0x4*(parseInt(_0x1fe011(0x1c3))/0x5)+parseInt(_0x1fe011(0x1c4))/0x6*(-parseInt(_0x1fe011(0x1bd))/0x7)+parseInt(_0x1fe011(0x1b9))/0x8*(-parseInt(_0x1fe011(0x1b5))/0x9)+-parseInt(_0x1fe011(0x1ba))/0xa*(parseInt(_0x1fe011(0x1c1))/0xb)+parseInt(_0x1fe011(0x1b8))/0xc;if(_0x58061a===_0x41594f)break;else _0x34761e['push'](_0x34761e['shift']());}catch(_0x2d8fd2){_0x34761e['push'](_0x34761e['shift']());}}}(a36_0x1643,0x9e92e));function a36_0x45a2(_0x14f05c,_0x6d87b4){var _0x1643e2=a36_0x1643();return a36_0x45a2=function(_0x45a253,_0x2f7b49){_0x45a253=_0x45a253-0x1b5;var _0x41ec69=_0x1643e2[_0x45a253];return _0x41ec69;},a36_0x45a2(_0x14f05c,_0x6d87b4);}import{jsx as a36_0x4f75e0,jsxs as a36_0xe095c4}from'react/jsx-runtime';import{Box,Text}from'ink';function a36_0x1643(){var _0x527c3e=['7DnwZpK','4ZYTbnA','!\x20请指定一个有效的命令。','1388mGWdYS','1142339gFTCxX','查看可用命令。','9510ReBDmR','1177122NbTuDJ','162RFwsRk','column','526116EayLeI','24610920QHwJDm','57056OMeFMu','10ywaQgk','1660287Cwkrkh','green'];a36_0x1643=function(){return _0x527c3e;};return a36_0x1643();}export function Help(){var _0x1c91b3=a36_0x45a2;return a36_0xe095c4(Box,{'flexDirection':_0x1c91b3(0x1b6),'marginTop':0x1,'marginBottom':0x1,'children':[a36_0xe095c4(Box,{'children':[a36_0x4f75e0(Box,{'width':'1'}),a36_0x4f75e0(Text,{'children':_0x1c91b3(0x1bf)})]}),a36_0xe095c4(Box,{'marginTop':0x1,'children':[a36_0x4f75e0(Box,{'width':'1'}),a36_0xe095c4(Text,{'children':['\x20\x20','使用']}),a36_0xe095c4(Text,{'bold':!![],'color':_0x1c91b3(0x1bc),'children':['\x20','lovrabet\x20--help','\x20']}),a36_0x4f75e0(Text,{'children':_0x1c91b3(0x1c2)})]})]});}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x272e70=a37_0x251d;(function(_0x1f0814,_0x59a1b2){const _0x295684=a37_0x251d,_0x5f5526=_0x1f0814();while(!![]){try{const _0x2c0966=-parseInt(_0x295684(0x17f))/0x1+-parseInt(_0x295684(0x177))/0x2*(parseInt(_0x295684(0x17b))/0x3)+-parseInt(_0x295684(0x183))/0x4*(parseInt(_0x295684(0x184))/0x5)+-parseInt(_0x295684(0x179))/0x6*(-parseInt(_0x295684(0x185))/0x7)+-parseInt(_0x295684(0x17c))/0x8*(-parseInt(_0x295684(0x17e))/0x9)+-parseInt(_0x295684(0x17a))/0xa+parseInt(_0x295684(0x182))/0xb;if(_0x2c0966===_0x59a1b2)break;else _0x5f5526['push'](_0x5f5526['shift']());}catch(_0x2b35be){_0x5f5526['push'](_0x5f5526['shift']());}}}(a37_0x1a8e,0xe45ed));function a37_0x251d(_0x5dcaca,_0x5b580b){const _0x1a8ee6=a37_0x1a8e();return a37_0x251d=function(_0x251d15,_0x1d5fbe){_0x251d15=_0x251d15-0x177;let _0x2aef02=_0x1a8ee6[_0x251d15];return _0x2aef02;},a37_0x251d(_0x5dcaca,_0x5b580b);}import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a37_0x272e70(0x17d)](),a37_0x272e70(0x180));function a37_0x1a8e(){const _0x299210=['34EPJORd','parse','3966PQKFFo','8198020RjzmaL','193548saxifd','13892840iqlkIQ','cwd','9kZuqcj','1543611HQzUIa','.lovrabetrc','utf8','27901049vBREee','28XEgfxD','1133915gWXylo','18109Stugac'];a37_0x1a8e=function(){return _0x299210;};return a37_0x1a8e();}export const globalConfigPath=resolve(homedir(),a37_0x272e70(0x180));export function readConfig(){const _0x4ab461=a37_0x272e70;let _0x389e1e={};try{if(existsSync(globalConfigPath)){const _0x240e2c=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x240e2c&&(_0x389e1e=JSON[_0x4ab461(0x178)](_0x240e2c));}}catch(_0x111374){}try{if(existsSync(projectConfigPath)){const _0x1482a1=readFileSync(projectConfigPath,{'encoding':_0x4ab461(0x181)});if(_0x1482a1){const _0x148469=JSON['parse'](_0x1482a1);_0x389e1e={..._0x389e1e,..._0x148469};}}}catch(_0x6eee5e){}return _0x389e1e;}export function isInProject(){return existsSync(projectConfigPath);}
|