@lovrabet/cli 1.1.9 → 1.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -0
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/api/api-doc-ui.js +1 -0
- package/lib/api/api-doc.js +1 -0
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-datasets.js +1 -0
- 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/templates/pages/sdk-fetch/index.tsx.tpl +41 -52
- package/templates/projects/sub-app-react-demo/package-lock.json +5 -4
- package/templates/projects/sub-app-react-demo/package.json +1 -1
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +42 -28
package/lib/auth/auth-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a14_0x38f54c=a14_0x2e8e;function a14_0x2e8e(_0x28e83a,_0x2c39ac){const _0x18410b=a14_0x1841();return a14_0x2e8e=function(_0x2e8e51,_0x4d4a77){_0x2e8e51=_0x2e8e51-0x157;let _0x410ffe=_0x18410b[_0x2e8e51];return _0x410ffe;},a14_0x2e8e(_0x28e83a,_0x2c39ac);}(function(_0xabfaf9,_0x10cdef){const _0x2c7e0d=a14_0x2e8e,_0x4f09f6=_0xabfaf9();while(!![]){try{const _0x16eb24=parseInt(_0x2c7e0d(0x16b))/0x1+-parseInt(_0x2c7e0d(0x170))/0x2*(parseInt(_0x2c7e0d(0x16a))/0x3)+parseInt(_0x2c7e0d(0x16d))/0x4*(-parseInt(_0x2c7e0d(0x16c))/0x5)+-parseInt(_0x2c7e0d(0x16f))/0x6*(-parseInt(_0x2c7e0d(0x168))/0x7)+parseInt(_0x2c7e0d(0x174))/0x8+-parseInt(_0x2c7e0d(0x158))/0x9+parseInt(_0x2c7e0d(0x159))/0xa;if(_0x16eb24===_0x10cdef)break;else _0x4f09f6['push'](_0x4f09f6['shift']());}catch(_0x30544b){_0x4f09f6['push'](_0x4f09f6['shift']());}}}(a14_0x1841,0x4dafc));function a14_0x1841(){const _0x51b103=['1479070AiTvVn','open\x20\x22','🔗\x20请手动复制登录地址到浏览器:','main','https://g.yuntooai.com/cert/lovrabet-dev.json','error','createServer','isAuth','log','end','Auth\x20server\x20error:','json','win32','/sign-in?redirect=','listen','21qTrTcn','session','618TdAAPO','344682qPgIOA','1820rZGujj','4756bfOfIf','platform','786990SPfZkw','4068gmJDaa','address','⚠️\x20\x20无法自动打开浏览器','127.0.0.1','4006576fInGsj','xdg-open\x20\x22','start\x20\x22\x22\x20\x22','headers','user','https://dev.lovrabet.com:','then','🌐\x20正在尝试自动打开浏览器...','writeHead','✅\x20浏览器已自动打开,请在浏览器中完成登录','utf-8','catch','port','darwin','text/html;\x20charset=utf-8','🔐\x20正在启动登录服务...','<!doctype\x20html>\x0a<html>\x0a<head><meta\x20charset=\x22utf-8\x22><title>登录成功</title></head>\x0a<body>\x0a\x20\x20<div>登录成功,请返回命令行继续操作。当前窗口将在\x20<span\x20id=\x22t\x22>5</span>\x20秒内关闭。</div>\x0a\x20\x20<div\x20id=\x22manualMsg\x22\x20style=\x22display:none;margin-top:10px;color:#d00;\x22>无法自动关闭窗口,请手动关闭此标签页或窗口。</div>\x0a\x20\x20<script>\x0a\x20\x20(function(){\x0a\x20\x20\x20\x20var\x20t\x20=\x205;\x0a\x20\x20\x20\x20var\x20el\x20=\x20document.getElementById(\x27t\x27);\x0a\x20\x20\x20\x20var\x20manual\x20=\x20document.getElementById(\x27manualMsg\x27);\x0a\x20\x20\x20\x20var\x20id\x20=\x20setInterval(function(){\x0a\x20\x20\x20\x20\x20\x20t--;\x0a\x20\x20\x20\x20\x20\x20if\x20(t\x20<=\x200)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20clearInterval(id);\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20\x270\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x20window.close();\x20}\x20catch(e)\x20{}\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20如果自动关闭无效,显示文本提示让用户手动关闭\x0a\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(function(){\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!window.closed)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20manual.style.display\x20=\x20\x27block\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20},\x20300);\x0a\x20\x20\x20\x20\x20\x20}\x20else\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20el.textContent\x20=\x20String(t);\x0a\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20},\x201000);\x0a\x20\x20})();\x0a\x20\x20</script>\x0a</body>\x0a</html>','1952118ximkOa'];a14_0x1841=function(){return _0x51b103;};return a14_0x1841();}import{writeFileSync}from'node:fs';import a14_0x3dd402 from'node:https';import{getUserDomain}from'../constant/domain.js';import{exec}from'node:child_process';import{getIsSessionValid}from'./is-session-valid.js';import{cookieFile}from'./constant.js';export async function authServer(_0x1c7410){const _0x30b5d0=a14_0x2e8e,_0x478cf0=_0x1c7410?.['silent']||![];if(await getIsSessionValid())return!![];const _0x19399e=await(await fetch(_0x30b5d0(0x15d)))[_0x30b5d0(0x164)]();return new Promise(async(_0x5a6c01,_0x2e48d8)=>{const _0x3a4992=_0x30b5d0;let _0x5ad752=0x0;const _0x351b2a=a14_0x3dd402[_0x3a4992(0x15f)](_0x19399e,async(_0x23c2f2,_0x1aa950)=>{const _0x1f14f1=_0x3a4992,_0x208022=getUserDomain(),_0xa96ac9=_0x23c2f2[_0x1f14f1(0x177)]['cookie']||'',_0x5afd9d=await fetch(_0x208022+'/api/auth/get-session',{'headers':{'cookie':_0xa96ac9}})[_0x1f14f1(0x17a)](_0x23a799=>_0x23a799['json']()),_0x46b6fe=_0x5afd9d&&_0x5afd9d[_0x1f14f1(0x169)]&&_0x5afd9d[_0x1f14f1(0x178)];if(_0x46b6fe){writeFileSync(cookieFile,_0xa96ac9,_0x1f14f1(0x17e)),_0x5a6c01(!![]);const _0x24154c=_0x1f14f1(0x157);_0x1aa950[_0x1f14f1(0x17c)](0xc8,{'Content-Type':_0x1f14f1(0x182)}),_0x1aa950[_0x1f14f1(0x162)](_0x24154c),_0x351b2a['close']();}else{const _0x1a6c2f=''+encodeURIComponent(_0x1f14f1(0x179)+_0x5ad752);_0x1aa950['writeHead'](0x12e,{'location':_0x208022+_0x1f14f1(0x166)+_0x1a6c2f}),_0x1aa950[_0x1f14f1(0x162)]();return;}});_0x351b2a[_0x3a4992(0x167)](0x0,_0x3a4992(0x173),()=>{const _0x499416=_0x3a4992,_0x2c7a1f=_0x351b2a[_0x499416(0x171)]();_0x5ad752=typeof _0x2c7a1f==='object'&&_0x2c7a1f?_0x2c7a1f[_0x499416(0x180)]:Number(_0x2c7a1f);const _0x172299='https://dev.lovrabet.com:'+_0x5ad752;!_0x478cf0&&(console[_0x499416(0x161)](_0x499416(0x183)),console[_0x499416(0x161)]('📍\x20登录地址:',_0x172299),console[_0x499416(0x161)](_0x499416(0x17b)),console['log'](''),console['log']('💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开'),console[_0x499416(0x161)]('')),openInBrowser(_0x172299)[_0x499416(0x17a)](_0x5eae29=>{const _0x2de794=_0x499416;!_0x478cf0&&(_0x5eae29?console[_0x2de794(0x161)](_0x2de794(0x17d)):(console['log'](_0x2de794(0x172)),console[_0x2de794(0x161)](_0x2de794(0x15b),_0x172299)),console[_0x2de794(0x161)](''));})[_0x499416(0x17f)](()=>{const _0x2b5f7c=_0x499416;!_0x478cf0&&(console['log'](_0x2b5f7c(0x172)),console['log'](_0x2b5f7c(0x15b),_0x172299),console[_0x2b5f7c(0x161)](''));});}),_0x351b2a['on']('error',_0x5f3381=>{const _0x180558=_0x3a4992;!_0x478cf0&&console[_0x180558(0x15e)](_0x180558(0x163),_0x5f3381),_0x2e48d8(_0x5f3381);});});}function openInBrowser(_0x2dbb27){return new Promise(_0x5edb36=>{const _0x325f54=a14_0x2e8e,_0x156d98=process[_0x325f54(0x16e)];let _0x4d6e1c;if(_0x156d98===_0x325f54(0x165))_0x4d6e1c=_0x325f54(0x176)+_0x2dbb27+'\x22';else _0x156d98===_0x325f54(0x181)?_0x4d6e1c=_0x325f54(0x15a)+_0x2dbb27+'\x22':_0x4d6e1c=_0x325f54(0x175)+_0x2dbb27+'\x22';exec(_0x4d6e1c,_0x2fe820=>{_0x2fe820?_0x5edb36(![]):_0x5edb36(!![]);});});}if(import.meta[a14_0x38f54c(0x15c)]){const isAuth=await authServer();console['log'](a14_0x38f54c(0x160),isAuth);}
|
package/lib/auth/constant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a15_0x495b05=a15_0x5a79;(function(_0xdc926f,_0x3993ca){const _0x33401f=a15_0x5a79,_0x5c1807=_0xdc926f();while(!![]){try{const _0x1ad7ae=-parseInt(_0x33401f(0xdf))/0x1*(parseInt(_0x33401f(0xd9))/0x2)+-parseInt(_0x33401f(0xe1))/0x3*(parseInt(_0x33401f(0xde))/0x4)+parseInt(_0x33401f(0xd8))/0x5*(-parseInt(_0x33401f(0xd5))/0x6)+-parseInt(_0x33401f(0xda))/0x7*(-parseInt(_0x33401f(0xdc))/0x8)+-parseInt(_0x33401f(0xd6))/0x9+parseInt(_0x33401f(0xdd))/0xa+parseInt(_0x33401f(0xe0))/0xb*(parseInt(_0x33401f(0xd7))/0xc);if(_0x1ad7ae===_0x3993ca)break;else _0x5c1807['push'](_0x5c1807['shift']());}catch(_0x2be47f){_0x5c1807['push'](_0x5c1807['shift']());}}}(a15_0x4b18,0x44e0b));import{mkdirSync}from'node:fs';import{homedir}from'node:os';function a15_0x5a79(_0x246140,_0x52c338){const _0x4b18e9=a15_0x4b18();return a15_0x5a79=function(_0x5a790,_0x3851db){_0x5a790=_0x5a790-0xd5;let _0x3a9475=_0x4b18e9[_0x5a790];return _0x3a9475;},a15_0x5a79(_0x246140,_0x52c338);}function a15_0x4b18(){const _0x39bcb5=['1fRXaXV','9804729dEpyse','1977MnciwH','278946XrKRTG','4154706zqnemh','12sCQaSg','35ipmmYw','753226uFzceH','42HNDXuM','/cookie','746536Yfqlpe','3879890CcHNPO','2388Ugbqvu'];a15_0x4b18=function(){return _0x39bcb5;};return a15_0x4b18();}export const configDir=homedir()+'/.lovrabet';export const cookieFile=configDir+a15_0x495b05(0xdb);mkdirSync(configDir,{'recursive':!![]});
|
package/lib/auth/get-cookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x46caa6,_0x4e522a){var _0x177f1a=a16_0x1fa0,_0x4fe004=_0x46caa6();while(!![]){try{var _0x4ea3a9=-parseInt(_0x177f1a(0x18d))/0x1+-parseInt(_0x177f1a(0x18b))/0x2+-parseInt(_0x177f1a(0x189))/0x3*(-parseInt(_0x177f1a(0x18f))/0x4)+parseInt(_0x177f1a(0x190))/0x5*(-parseInt(_0x177f1a(0x18a))/0x6)+-parseInt(_0x177f1a(0x187))/0x7+parseInt(_0x177f1a(0x18c))/0x8+parseInt(_0x177f1a(0x18e))/0x9;if(_0x4ea3a9===_0x4e522a)break;else _0x4fe004['push'](_0x4fe004['shift']());}catch(_0x1c9639){_0x4fe004['push'](_0x4fe004['shift']());}}}(a16_0x93f7,0x6174e));import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';function a16_0x93f7(){var _0x91bbee=['3269399ukCpfy','utf-8','136833UeqwiI','3926568aEKkcX','1461102HMuptf','2856312eMvHqr','391050MsDITi','16462071gnUSFp','40EGPRIy','5WlInJv'];a16_0x93f7=function(){return _0x91bbee;};return a16_0x93f7();}function a16_0x1fa0(_0x288cd3,_0x5620e8){var _0x93f702=a16_0x93f7();return a16_0x1fa0=function(_0x1fa079,_0x27056d){_0x1fa079=_0x1fa079-0x187;var _0x43e8e3=_0x93f702[_0x1fa079];return _0x43e8e3;},a16_0x1fa0(_0x288cd3,_0x5620e8);}export function getCookie(){var _0x371492=a16_0x1fa0;try{return readFileSync(cookieFile,_0x371492(0x188));}catch{}return'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5e1487,_0x2c8b5a){const _0x3cfbe8=a17_0x3545,_0x2b2bea=_0x5e1487();while(!![]){try{const _0x25ed31=parseInt(_0x3cfbe8(0x156))/0x1+-parseInt(_0x3cfbe8(0x14f))/0x2+-parseInt(_0x3cfbe8(0x155))/0x3*(-parseInt(_0x3cfbe8(0x157))/0x4)+parseInt(_0x3cfbe8(0x154))/0x5+-parseInt(_0x3cfbe8(0x152))/0x6*(parseInt(_0x3cfbe8(0x150))/0x7)+parseInt(_0x3cfbe8(0x14a))/0x8*(parseInt(_0x3cfbe8(0x153))/0x9)+parseInt(_0x3cfbe8(0x14c))/0xa*(-parseInt(_0x3cfbe8(0x151))/0xb);if(_0x25ed31===_0x2c8b5a)break;else _0x2b2bea['push'](_0x2b2bea['shift']());}catch(_0xa834ef){_0x2b2bea['push'](_0x2b2bea['shift']());}}}(a17_0x121e,0x3a1aa));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x1c01ae=a17_0x3545;try{if(!existsSync(cookieFile))return![];const _0x53696b=readFileSync(cookieFile,'utf-8'),_0x4191ef=await fetch(getUserDomain()+_0x1c01ae(0x14d),{'headers':{'cookie':_0x53696b}})['then'](_0x2504ff=>_0x2504ff[_0x1c01ae(0x14b)]());return _0x4191ef&&_0x4191ef[_0x1c01ae(0x149)]&&_0x4191ef[_0x1c01ae(0x14e)];}catch{}return![];}function a17_0x3545(_0x246def,_0x33c34c){const _0x121ecf=a17_0x121e();return a17_0x3545=function(_0x354524,_0xb9bf1a){_0x354524=_0x354524-0x149;let _0x2c594f=_0x121ecf[_0x354524];return _0x2c594f;},a17_0x3545(_0x246def,_0x33c34c);}function a17_0x121e(){const _0x2c9266=['710TbtgZC','/api/auth/get-session','user','879768jmbDXS','30422eCgnJN','10516ztMwyv','12HQCRui','27981xLNoCb','958515JGhOyJ','309KxMcoC','166293EcwyIP','14068bexkCR','session','88nmdloG','json'];a17_0x121e=function(){return _0x2c9266;};return a17_0x121e();}
|
package/lib/auth/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x531395,_0x16b057){var _0xca0cd8=a18_0x2960,_0x40aa50=_0x531395();while(!![]){try{var _0x3168e1=-parseInt(_0xca0cd8(0x6f))/0x1+-parseInt(_0xca0cd8(0x70))/0x2*(parseInt(_0xca0cd8(0x6a))/0x3)+parseInt(_0xca0cd8(0x6b))/0x4+-parseInt(_0xca0cd8(0x6e))/0x5*(parseInt(_0xca0cd8(0x6c))/0x6)+parseInt(_0xca0cd8(0x67))/0x7+-parseInt(_0xca0cd8(0x66))/0x8*(parseInt(_0xca0cd8(0x6d))/0x9)+parseInt(_0xca0cd8(0x68))/0xa;if(_0x3168e1===_0x16b057)break;else _0x40aa50['push'](_0x40aa50['shift']());}catch(_0x541dc3){_0x40aa50['push'](_0x40aa50['shift']());}}}(a18_0x3336,0x9cd98));import{unlinkSync,existsSync}from'node:fs';function a18_0x2960(_0x548077,_0x21c465){var _0x33369d=a18_0x3336();return a18_0x2960=function(_0x2960f7,_0x164fb2){_0x2960f7=_0x2960f7-0x66;var _0x5b4de9=_0x33369d[_0x2960f7];return _0x5b4de9;},a18_0x2960(_0x548077,_0x21c465);}import{cookieFile}from'./constant.js';function a18_0x3336(){var _0xe6d29d=['229205DLStsa','1177458TLaJVh','3562UFXfFa','395352CqxcQj','950439SQXTiR','23191890TfzPDQ','!\x20当前未登录','759OGuqbg','2874888YgFjHK','60PJgUIe','81YBZPsz'];a18_0x3336=function(){return _0xe6d29d;};return a18_0x3336();}export function logout(){var _0x435f05=a18_0x2960;existsSync(cookieFile)?(unlinkSync(cookieFile),console['log']('✓\x20已退出登录')):console['log'](_0x435f05(0x69));}
|
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a19_0x5671af=a19_0x3093;(function(_0x5b4c7b,_0x542769){const _0x1651f9=a19_0x3093,_0x240e79=_0x5b4c7b();while(!![]){try{const _0x5d6ab4=parseInt(_0x1651f9(0x92))/0x1*(parseInt(_0x1651f9(0xa6))/0x2)+parseInt(_0x1651f9(0xa7))/0x3*(parseInt(_0x1651f9(0x95))/0x4)+-parseInt(_0x1651f9(0x8d))/0x5*(parseInt(_0x1651f9(0xa9))/0x6)+-parseInt(_0x1651f9(0xb4))/0x7+-parseInt(_0x1651f9(0xa8))/0x8+-parseInt(_0x1651f9(0x9e))/0x9+parseInt(_0x1651f9(0xb0))/0xa*(parseInt(_0x1651f9(0xa0))/0xb);if(_0x5d6ab4===_0x542769)break;else _0x240e79['push'](_0x240e79['shift']());}catch(_0x12097e){_0x240e79['push'](_0x240e79['shift']());}}}(a19_0xc268,0x7a0d7));import{jsx as a19_0x26230e}from'react/jsx-runtime';import a19_0x37c5a4 from'meow';import{render}from'ink';import{CreateApp}from'./create-app/main.js';import{AddPage}from'./add-page/main.js';function a19_0xc268(){const _0x38d966=['668694ZDmzYV','slice','cwd','boolean','create','start','auth','10SVIWLw','argv','input','api','2451351pQczou','error','page','all','15TnkNwQ','info','lovrabet\x20','\x20(监听模式)','trim','30697aFoLfR','preview','执行添加页面命令','4exwCEL','flags','watch','env','join','string','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20create\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建项目并指定环境\x0a\x09\x20\x20$\x20lovrabet\x20add\x20page\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20添加一个页面\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--[options]\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20api\x20doc\x20--[options]\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','setLogPath','config','7110756uxXvnM','执行构建命令','5773350IWPgqW','build','setRawCommand','add-page','exit','执行启动命令','46cCyVEt','2467419JlVuMJ','630424jYwfTR'];a19_0xc268=function(){return _0x38d966;};return a19_0xc268();}import{runStart}from'./cmd/start.js';function a19_0x3093(_0x5e295f,_0x3c94da){const _0xc268da=a19_0xc268();return a19_0x3093=function(_0x309376,_0x5790bd){_0x309376=_0x309376-0x8c;let _0x3e901d=_0xc268da[_0x309376];return _0x3e901d;},a19_0x3093(_0x5e295f,_0x3c94da);}import{runBuild}from'./cmd/build.js';import{runPreview}from'./cmd/preview.js';import{runBuildWatch}from'./cmd/build-watch.js';import{Config}from'./config/main.js';import{apiCli}from'./api/main.js';import{AuthServer}from'./auth/auth-server-ui.js';import{logout}from'./auth/logout.js';import{Help}from'./help.js';import{logger}from'./utils/logger.js';import{showLogs,clearLogs}from'./cmd/logs.js';const cli=a19_0x37c5a4(a19_0x5671af(0x9b),{'importMeta':import.meta,'flags':{'name':{'type':a19_0x5671af(0x9a)},'clear':{'type':a19_0x5671af(0xac)},'env':{'type':a19_0x5671af(0x9a)},'watch':{'type':a19_0x5671af(0xac)},'help':{'type':'boolean'},'appcode':{'type':'string'},'output':{'type':a19_0x5671af(0x9a)}}});await run();async function run(){const _0x2f5a5f=a19_0x5671af,_0x292b18=cli[_0x2f5a5f(0xb2)][0x0],_0x217e15=(_0x2f5a5f(0x8f)+process[_0x2f5a5f(0xb1)][_0x2f5a5f(0xaa)](0x2)[_0x2f5a5f(0x99)]('\x20'))[_0x2f5a5f(0x91)]();logger[_0x2f5a5f(0xa2)](_0x217e15);switch(_0x292b18){case _0x2f5a5f(0xad):{const _0x577597=cli['input'][0x1]?.['trim'](),_0x372153=cli['flags'][_0x2f5a5f(0x98)];render(a19_0x26230e(CreateApp,{'projectCode':_0x577597,'env':_0x372153}));break;}case'add':{cli[_0x2f5a5f(0xb2)][0x1]===_0x2f5a5f(0xb6)&&(logger[_0x2f5a5f(0x9c)](process[_0x2f5a5f(0xab)]()),logger[_0x2f5a5f(0x8e)](_0x2f5a5f(0xa3),_0x2f5a5f(0x94)),render(a19_0x26230e(AddPage,{})));break;}case _0x2f5a5f(0xae):{try{logger[_0x2f5a5f(0x9c)](process[_0x2f5a5f(0xab)]()),logger[_0x2f5a5f(0x8e)](_0x2f5a5f(0xae),_0x2f5a5f(0xa5)),await runStart();}catch(_0xab8a2a){console[_0x2f5a5f(0xb5)](_0xab8a2a),process[_0x2f5a5f(0xa4)](0x1);}break;}case _0x2f5a5f(0xa1):{try{logger[_0x2f5a5f(0x9c)](process[_0x2f5a5f(0xab)]()),logger[_0x2f5a5f(0x8e)](_0x2f5a5f(0xa1),_0x2f5a5f(0x9f)),await runBuild();}catch(_0x3b7ad8){console[_0x2f5a5f(0xb5)](_0x3b7ad8),process['exit'](0x1);}break;}case'preview':{const _0x21711a=cli[_0x2f5a5f(0x96)][_0x2f5a5f(0x97)];logger[_0x2f5a5f(0x9c)](process['cwd']()),logger[_0x2f5a5f(0x8e)](_0x2f5a5f(0x93),'执行预览命令'+(_0x21711a?_0x2f5a5f(0x90):''));if(_0x21711a)try{await Promise[_0x2f5a5f(0x8c)]([runBuildWatch(),runPreview()]);}catch(_0xa64e42){console[_0x2f5a5f(0xb5)](_0xa64e42),process[_0x2f5a5f(0xa4)](0x1);}else try{await runPreview();}catch(_0x4a79cd){console[_0x2f5a5f(0xb5)](_0x4a79cd),process[_0x2f5a5f(0xa4)](0x1);}break;}case _0x2f5a5f(0x9d):{render(a19_0x26230e(Config,{'cli':cli}));break;}case _0x2f5a5f(0xb3):{await apiCli(cli);break;}case _0x2f5a5f(0xaf):{render(a19_0x26230e(AuthServer,{}));break;}case'logout':{logout();break;}case'logs':{cli['flags']['clear']?clearLogs():showLogs();break;}default:render(a19_0x26230e(Help,{}));break;}}
|
package/lib/cmd/build-watch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x155c15,_0x7ee60e){const _0x1bf653=a20_0x180c,_0x4b6f6f=_0x155c15();while(!![]){try{const _0x1cf91f=parseInt(_0x1bf653(0x111))/0x1*(parseInt(_0x1bf653(0x11a))/0x2)+parseInt(_0x1bf653(0x11c))/0x3*(-parseInt(_0x1bf653(0x119))/0x4)+-parseInt(_0x1bf653(0x114))/0x5+parseInt(_0x1bf653(0x115))/0x6+-parseInt(_0x1bf653(0x110))/0x7+-parseInt(_0x1bf653(0x10d))/0x8+parseInt(_0x1bf653(0x112))/0x9;if(_0x1cf91f===_0x7ee60e)break;else _0x4b6f6f['push'](_0x4b6f6f['shift']());}catch(_0xaec2af){_0x4b6f6f['push'](_0x4b6f6f['shift']());}}}(a20_0x5e32,0xa6c1e));import{spawn}from'node:child_process';function a20_0x180c(_0x25cbe7,_0x971e86){const _0x5e3241=a20_0x5e32();return a20_0x180c=function(_0x180c97,_0xb929cc){_0x180c97=_0x180c97-0x10a;let _0x2077b5=_0x5e3241[_0x180c97];return _0x2077b5;},a20_0x180c(_0x25cbe7,_0x971e86);}import{delimiter,join}from'node:path';function a20_0x5e32(){const _0x2f4c40=['4713003xTmHlB','close','201975XLjIhm','7462122FcDAoZ','env','error','inherit','12bYVALw','2301550xJsxYv','node_modules','832467DOXtTE','cwd','vite','--watch','8964952tmjpGM','PATH','npm\x20run\x20build\x20exited\x20with\x20code\x20','1691270BsrXNq','1gvpdbx'];a20_0x5e32=function(){return _0x2f4c40;};return a20_0x5e32();}export function runBuildWatch(){return new Promise((_0x586284,_0x35b5aa)=>{const _0x261fde=a20_0x180c,_0x36cd4c=spawn(_0x261fde(0x10b),['build',_0x261fde(0x10c)],{'stdio':_0x261fde(0x118),'shell':!![],'env':{...process[_0x261fde(0x116)],'PATH':''+join(process[_0x261fde(0x10a)](),_0x261fde(0x11b),'.bin')+delimiter+process[_0x261fde(0x116)][_0x261fde(0x10e)]}});_0x36cd4c['on'](_0x261fde(0x113),_0x464f4f=>{const _0xb62b5d=_0x261fde;if(_0x464f4f===0x0||_0x464f4f===null)_0x586284();else _0x35b5aa(new Error(_0xb62b5d(0x10f)+_0x464f4f));}),_0x36cd4c['on'](_0x261fde(0x117),_0x35b5aa);});}
|
package/lib/cmd/build.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5c5444,_0x168cdc){const _0x1e0b31=a21_0x1e40,_0x2c09c0=_0x5c5444();while(!![]){try{const _0x42d9d3=parseInt(_0x1e0b31(0x126))/0x1+parseInt(_0x1e0b31(0x12d))/0x2+parseInt(_0x1e0b31(0x134))/0x3*(-parseInt(_0x1e0b31(0x131))/0x4)+-parseInt(_0x1e0b31(0x12c))/0x5+parseInt(_0x1e0b31(0x13c))/0x6*(parseInt(_0x1e0b31(0x147))/0x7)+-parseInt(_0x1e0b31(0x12a))/0x8+parseInt(_0x1e0b31(0x137))/0x9*(parseInt(_0x1e0b31(0x12f))/0xa);if(_0x42d9d3===_0x168cdc)break;else _0x2c09c0['push'](_0x2c09c0['shift']());}catch(_0x587aed){_0x2c09c0['push'](_0x2c09c0['shift']());}}}(a21_0x3c49,0xcf823));function a21_0x1e40(_0x4db6a5,_0x49fae7){const _0x3c49e0=a21_0x3c49();return a21_0x1e40=function(_0x1e40eb,_0x5912fc){_0x1e40eb=_0x1e40eb-0x126;let _0x5c7d34=_0x3c49e0[_0x1e40eb];return _0x5c7d34;},a21_0x1e40(_0x4db6a5,_0x49fae7);}import{delimiter,join}from'node:path';function a21_0x3c49(){const _0xd70ad6=['close','PATH','toString','30fzNhpY','pipe','npm\x20run\x20build','项目构建出错','开始构建项目','项目构建失败','success','cwd','env','项目构建成功','trim','1642879TauAay','183693zMiyaQ','stderr','node_modules','build','10707616ObfKaC','.bin','1184245EpswSQ','277732XlIquz','inherit','471530gIzohN','npm\x20run\x20build\x20exited\x20with\x20code\x20','68FIXUhq','npm','error','19086XNDCKF','message','now','198VnOLzD','info'];a21_0x3c49=function(){return _0xd70ad6;};return a21_0x3c49();}import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runBuild(){return new Promise((_0x1ea736,_0x219b32)=>{const _0x5a4e72=a21_0x1e40,_0x25b23e=Date[_0x5a4e72(0x136)]();logger[_0x5a4e72(0x138)]('build',_0x5a4e72(0x140),{'command':_0x5a4e72(0x13e)});let _0x173f3d='';const _0x16c575=spawn(_0x5a4e72(0x132),['run','build'],{'stdio':['inherit',_0x5a4e72(0x12e),_0x5a4e72(0x13d)],'shell':!![],'env':{...process[_0x5a4e72(0x144)],'PATH':''+join(process[_0x5a4e72(0x143)](),_0x5a4e72(0x128),_0x5a4e72(0x12b))+delimiter+process['env'][_0x5a4e72(0x13a)]}});_0x16c575[_0x5a4e72(0x127)]?.['on']('data',_0x3ecdac=>{const _0x3836ce=_0x5a4e72;_0x173f3d+=_0x3ecdac[_0x3836ce(0x13b)]();}),_0x16c575['on'](_0x5a4e72(0x139),_0x448678=>{const _0x8f41c7=_0x5a4e72,_0x373595=Date[_0x8f41c7(0x136)]()-_0x25b23e;if(_0x448678===0x0||_0x448678===null)logger[_0x8f41c7(0x142)](_0x8f41c7(0x129),_0x8f41c7(0x145),_0x373595),_0x1ea736();else{const _0xff9dda={'exitCode':_0x448678,'duration':_0x373595,'command':_0x8f41c7(0x13e),'cwd':process['cwd']()};_0x173f3d['trim']()&&(_0xff9dda[_0x8f41c7(0x127)]=_0x173f3d[_0x8f41c7(0x146)]()),logger[_0x8f41c7(0x133)]('build',_0x8f41c7(0x141),_0xff9dda),_0x219b32(new Error(_0x8f41c7(0x130)+_0x448678));}}),_0x16c575['on'](_0x5a4e72(0x133),_0x201014=>{const _0x5a2f7c=_0x5a4e72,_0x122c2=Date[_0x5a2f7c(0x136)]()-_0x25b23e;logger[_0x5a2f7c(0x133)](_0x5a2f7c(0x129),_0x5a2f7c(0x13f),{'error':_0x201014[_0x5a2f7c(0x135)],'duration':_0x122c2,'stderr':_0x173f3d[_0x5a2f7c(0x146)]()||undefined}),_0x219b32(_0x201014);});});}
|
package/lib/cmd/logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a22_0x98e3(){const _0x3c29d0=['timestamp','580088OHQYFZ','keys','cwd','command','7RlsYkT','*\x20日志已清空','583905eJgVpp','295MyvJJx','error','7780TwEBmP','success','72uGeZfJ','warn','zh-CN','setLogPath','\x20\x20\x20时间:\x20','stringify','9eVMLlw','level','toLocaleString','\x20\x20\x20耗时:\x20','103302xByFSG','log','clearLogs','*\x20Lovrabet\x20CLI\x20日志记录:\x0a','6725896HWECEY','duration','873070SlwWlS','\x20\x20\x20详情:\x20','length','forEach','1303324ONcWvv','message'];a22_0x98e3=function(){return _0x3c29d0;};return a22_0x98e3();}(function(_0x5e7a9f,_0x131955){const _0x5502c5=a22_0x34f3,_0x4d573b=_0x5e7a9f();while(!![]){try{const _0x34f994=-parseInt(_0x5502c5(0x1fa))/0x1+-parseInt(_0x5502c5(0x1f4))/0x2*(-parseInt(_0x5502c5(0x205))/0x3)+parseInt(_0x5502c5(0x1f1))/0x4+-parseInt(_0x5502c5(0x1fb))/0x5*(parseInt(_0x5502c5(0x1e7))/0x6)+-parseInt(_0x5502c5(0x1f8))/0x7*(-parseInt(_0x5502c5(0x1eb))/0x8)+-parseInt(_0x5502c5(0x1ff))/0x9*(-parseInt(_0x5502c5(0x1fd))/0xa)+parseInt(_0x5502c5(0x1ed))/0xb;if(_0x34f994===_0x131955)break;else _0x4d573b['push'](_0x4d573b['shift']());}catch(_0x5da7e4){_0x4d573b['push'](_0x4d573b['shift']());}}}(a22_0x98e3,0x7f95a));import{logger}from'../utils/logger.js';function a22_0x34f3(_0x4234ed,_0x315358){const _0x98e340=a22_0x98e3();return a22_0x34f3=function(_0x34f3dc,_0x146b56){_0x34f3dc=_0x34f3dc-0x1e6;let _0x58835e=_0x98e340[_0x34f3dc];return _0x58835e;},a22_0x34f3(_0x4234ed,_0x315358);}export function showLogs(){const _0x3e11e4=a22_0x34f3;logger['setLogPath'](process[_0x3e11e4(0x1f6)]());const _0x1655f2=logger['readLogs']();if(_0x1655f2[_0x3e11e4(0x1ef)]===0x0){console[_0x3e11e4(0x1e8)]('*\x20暂无日志记录');return;}console[_0x3e11e4(0x1e8)](_0x3e11e4(0x1ea)),_0x1655f2[_0x3e11e4(0x1f0)]((_0x8792c,_0x4c25b4)=>{const _0x128062=_0x3e11e4,_0x4a1322=new Date(_0x8792c[_0x128062(0x1f3)])[_0x128062(0x207)](_0x128062(0x201)),_0x57157f=_0x8792c[_0x128062(0x206)]===_0x128062(0x1fe)?'√':_0x8792c[_0x128062(0x206)]===_0x128062(0x1fc)?'×':_0x8792c[_0x128062(0x206)]===_0x128062(0x200)?'!':'i';console[_0x128062(0x1e8)](_0x4c25b4+0x1+'.\x20'+_0x57157f+'\x20['+_0x8792c[_0x128062(0x1f7)]+']\x20'+_0x8792c[_0x128062(0x1f2)]),console[_0x128062(0x1e8)](_0x128062(0x203)+_0x4a1322),_0x8792c[_0x128062(0x1ec)]&&console[_0x128062(0x1e8)](_0x128062(0x1e6)+_0x8792c['duration']+'ms'),_0x8792c['details']&&Object[_0x128062(0x1f5)](_0x8792c['details'])[_0x128062(0x1ef)]>0x0&&console['log'](_0x128062(0x1ee)+JSON[_0x128062(0x204)](_0x8792c['details'],null,0x2)),console[_0x128062(0x1e8)]('');});}export function clearLogs(){const _0x585cc3=a22_0x34f3;logger[_0x585cc3(0x202)](process[_0x585cc3(0x1f6)]()),logger[_0x585cc3(0x1e9)](),console['log'](_0x585cc3(0x1f9));}
|
package/lib/cmd/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a23_0x2da9(){const _0x2236b3=['env','649650nzvKXN','预览服务器启动失败','2ZZcTAG','启动预览服务器','1505NTQMcv','5587410EQVpdB','trim','299885iOabpJ','now','message','预览服务器启动出错','inherit','预览服务器启动成功','preview','close','1900052CTvqpc','success','PATH','error','vite','stderr','.bin','2981376XvPXvQ','info','toString','18366mrNqLC','cwd','16bKMJmn','data','13385gWVBvr','pipe','256PfXlHr'];a23_0x2da9=function(){return _0x2236b3;};return a23_0x2da9();}(function(_0x3d2a29,_0x3a1661){const _0x296dd4=a23_0x7b8e,_0x12daa0=_0x3d2a29();while(!![]){try{const _0x4fb0d7=-parseInt(_0x296dd4(0x162))/0x1+-parseInt(_0x296dd4(0x17e))/0x2*(-parseInt(_0x296dd4(0x17c))/0x3)+-parseInt(_0x296dd4(0x17a))/0x4*(parseInt(_0x296dd4(0x178))/0x5)+-parseInt(_0x296dd4(0x174))/0x6*(-parseInt(_0x296dd4(0x180))/0x7)+parseInt(_0x296dd4(0x176))/0x8*(parseInt(_0x296dd4(0x171))/0x9)+-parseInt(_0x296dd4(0x181))/0xa+-parseInt(_0x296dd4(0x16a))/0xb;if(_0x4fb0d7===_0x3a1661)break;else _0x12daa0['push'](_0x12daa0['shift']());}catch(_0x287159){_0x12daa0['push'](_0x12daa0['shift']());}}}(a23_0x2da9,0x51aab));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a23_0x7b8e(_0x31730a,_0x4585fe){const _0x2da90b=a23_0x2da9();return a23_0x7b8e=function(_0x7b8e1c,_0x542342){_0x7b8e1c=_0x7b8e1c-0x161;let _0xa3b3b1=_0x2da90b[_0x7b8e1c];return _0xa3b3b1;},a23_0x7b8e(_0x31730a,_0x4585fe);}import{logger}from'../utils/logger.js';export function runPreview(){return new Promise((_0x3541b5,_0x15b176)=>{const _0x248108=a23_0x7b8e,_0x545f5e=Date[_0x248108(0x163)]();logger[_0x248108(0x172)](_0x248108(0x168),_0x248108(0x17f),{'command':'vite\x20preview'});let _0x2c3c58='';const _0x1f0ca1=spawn(_0x248108(0x16e),[_0x248108(0x168)],{'stdio':[_0x248108(0x166),_0x248108(0x166),_0x248108(0x179)],'shell':!![],'env':{...process[_0x248108(0x17b)],'PATH':''+join(process['cwd'](),'node_modules',_0x248108(0x170))+delimiter+process[_0x248108(0x17b)][_0x248108(0x16c)]}});_0x1f0ca1[_0x248108(0x16f)]?.['on'](_0x248108(0x177),_0x594421=>{const _0x544f05=_0x248108;_0x2c3c58+=_0x594421[_0x544f05(0x173)]();}),_0x1f0ca1['on'](_0x248108(0x169),_0x29634a=>{const _0x42998a=_0x248108,_0x4d04d5=Date[_0x42998a(0x163)]()-_0x545f5e;if(_0x29634a===0x0||_0x29634a===null)logger[_0x42998a(0x16b)](_0x42998a(0x168),_0x42998a(0x167),_0x4d04d5),_0x3541b5();else{const _0xd65693={'exitCode':_0x29634a,'duration':_0x4d04d5,'command':'vite\x20preview','cwd':process[_0x42998a(0x175)]()};_0x2c3c58[_0x42998a(0x161)]()&&(_0xd65693[_0x42998a(0x16f)]=_0x2c3c58['trim']()),logger['error'](_0x42998a(0x168),_0x42998a(0x17d),_0xd65693),_0x15b176(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x29634a));}}),_0x1f0ca1['on'](_0x248108(0x16d),_0x5401c0=>{const _0x2ff184=_0x248108,_0x18a590=Date[_0x2ff184(0x163)]()-_0x545f5e;logger[_0x2ff184(0x16d)](_0x2ff184(0x168),_0x2ff184(0x165),{'error':_0x5401c0[_0x2ff184(0x164)],'duration':_0x18a590,'stderr':_0x2c3c58[_0x2ff184(0x161)]()||undefined}),_0x15b176(_0x5401c0);});});}
|
package/lib/cmd/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a24_0x4d1e(){const _0x150a74=['close','开发服务器启动失败','trim','stderr','7390ywbwOu','开发服务器启动成功','node_modules','1730720EhBLWz','启动开发服务器','error','cwd','开发服务器启动出错','84kkQnVW','1466730kLPQQo','581585mwscHX','2808QvKegt','178020uqpaeS','448222FaVsGh','inherit','start','12548QURXBN','now','message','success','info','6AdnRqG','vite','env','PATH','.bin','pipe'];a24_0x4d1e=function(){return _0x150a74;};return a24_0x4d1e();}(function(_0x4fb6a2,_0x52c144){const _0x38e9eb=a24_0x4cdb,_0x153d26=_0x4fb6a2();while(!![]){try{const _0x470fda=parseInt(_0x38e9eb(0x15d))/0x1+-parseInt(_0x38e9eb(0x160))/0x2+parseInt(_0x38e9eb(0x149))/0x3*(parseInt(_0x38e9eb(0x163))/0x4)+parseInt(_0x38e9eb(0x15c))/0x5+parseInt(_0x38e9eb(0x15f))/0x6*(-parseInt(_0x38e9eb(0x15b))/0x7)+-parseInt(_0x38e9eb(0x156))/0x8+-parseInt(_0x38e9eb(0x15e))/0x9*(-parseInt(_0x38e9eb(0x153))/0xa);if(_0x470fda===_0x52c144)break;else _0x153d26['push'](_0x153d26['shift']());}catch(_0x4c6294){_0x153d26['push'](_0x153d26['shift']());}}}(a24_0x4d1e,0x4cf92));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';function a24_0x4cdb(_0x54e87d,_0x45128a){const _0x4d1ed4=a24_0x4d1e();return a24_0x4cdb=function(_0x4cdb4c,_0x6eda91){_0x4cdb4c=_0x4cdb4c-0x147;let _0x192290=_0x4d1ed4[_0x4cdb4c];return _0x192290;},a24_0x4cdb(_0x54e87d,_0x45128a);}export function runStart(_0x4a71f0){return new Promise((_0x5fdcf,_0x3decea)=>{const _0x4e4d12=a24_0x4cdb,_0x379376=Date[_0x4e4d12(0x164)](),_0xfeb0a8=_0x4a71f0||process[_0x4e4d12(0x159)]();logger[_0x4e4d12(0x148)]('start',_0x4e4d12(0x157),{'command':_0x4e4d12(0x14a),'cwd':_0xfeb0a8});let _0x78424a='';const _0x5d29f3=spawn(_0x4e4d12(0x14a),{'stdio':[_0x4e4d12(0x161),_0x4e4d12(0x161),_0x4e4d12(0x14e)],'shell':!![],'cwd':_0xfeb0a8,'env':{...process['env'],'PATH':''+join(_0xfeb0a8,_0x4e4d12(0x155),_0x4e4d12(0x14d))+delimiter+process[_0x4e4d12(0x14b)][_0x4e4d12(0x14c)]}});_0x5d29f3[_0x4e4d12(0x152)]?.['on']('data',_0x3782d9=>{const _0x3b370d=_0x4e4d12,_0x12cfb5=_0x3782d9['toString']();_0x78424a+=_0x12cfb5,process[_0x3b370d(0x152)]['write'](_0x12cfb5);}),_0x5d29f3['on'](_0x4e4d12(0x14f),_0x16da10=>{const _0x200f4d=_0x4e4d12,_0x2a8499=Date['now']()-_0x379376;if(_0x16da10===0x0||_0x16da10===null)logger[_0x200f4d(0x147)]('start',_0x200f4d(0x154),_0x2a8499),_0x5fdcf();else{const _0x2ed1ff={'exitCode':_0x16da10,'duration':_0x2a8499,'command':_0x200f4d(0x14a),'cwd':_0xfeb0a8};_0x78424a['trim']()&&(_0x2ed1ff[_0x200f4d(0x152)]=_0x78424a[_0x200f4d(0x151)]()),logger[_0x200f4d(0x158)](_0x200f4d(0x162),_0x200f4d(0x150),_0x2ed1ff),_0x3decea(new Error('vite\x20exited\x20with\x20code\x20'+_0x16da10));}}),_0x5d29f3['on'](_0x4e4d12(0x158),_0x51abd9=>{const _0x3daf86=_0x4e4d12,_0x35eb2e=Date['now']()-_0x379376,_0x3aa9e7={'error':_0x51abd9[_0x3daf86(0x165)],'duration':_0x35eb2e,'command':_0x3daf86(0x14a),'cwd':_0xfeb0a8};_0x78424a[_0x3daf86(0x151)]()&&(_0x3aa9e7['stderr']=_0x78424a[_0x3daf86(0x151)]()),logger[_0x3daf86(0x158)](_0x3daf86(0x162),_0x3daf86(0x15a),_0x3aa9e7),_0x3decea(_0x51abd9);});});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a25_0x5b8b(){const _0x21b75e=['gray','配置当前项目的\x20App\x20Code','4059306vxsbYG','lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','12574480yuaTFz','无效的命令,可用命令如下:','lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','\x20\x20\x20\x20','5392051IGhhtl','lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','6HECynl','97124APYAeM','85984VOCOyb','lovrabet\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','column','25AmRIec','218875OrGJYa','获取配置项','lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','command','513BGRXXP','1318320awiDdc','map','\x20*\x20配置示例:'];a25_0x5b8b=function(){return _0x21b75e;};return a25_0x5b8b();}(function(_0x3f85bf,_0x1288d6){const _0x2d892b=a25_0x587a,_0x2f39e6=_0x3f85bf();while(!![]){try{const _0x19a48e=parseInt(_0x2d892b(0x1b5))/0x1*(parseInt(_0x2d892b(0x1af))/0x2)+parseInt(_0x2d892b(0x1ba))/0x3+-parseInt(_0x2d892b(0x1b0))/0x4*(-parseInt(_0x2d892b(0x1b4))/0x5)+-parseInt(_0x2d892b(0x1a7))/0x6+-parseInt(_0x2d892b(0x1ad))/0x7+-parseInt(_0x2d892b(0x1b1))/0x8*(parseInt(_0x2d892b(0x1b9))/0x9)+parseInt(_0x2d892b(0x1a9))/0xa;if(_0x19a48e===_0x1288d6)break;else _0x2f39e6['push'](_0x2f39e6['shift']());}catch(_0x2d056e){_0x2f39e6['push'](_0x2f39e6['shift']());}}}(a25_0x5b8b,0x656ce));import{jsxs as a25_0x48cd99,jsx as a25_0x1a1e7f}from'react/jsx-runtime';function a25_0x587a(_0x410130,_0x208510){const _0x5b8bbc=a25_0x5b8b();return a25_0x587a=function(_0x587add,_0x1080db){_0x587add=_0x587add-0x1a5;let _0x1a2976=_0x5b8bbc[_0x587add];return _0x1a2976;},a25_0x587a(_0x410130,_0x208510);}import{Box,Text}from'ink';export function ConfigHelp(){const _0xe39bc2=a25_0x587a,_0x235c01=[{'command':_0xe39bc2(0x1ab),'description':'设置配置项'},{'command':_0xe39bc2(0x1b7),'description':_0xe39bc2(0x1b6)},{'command':_0xe39bc2(0x1a8),'description':'列出所有配置项'}],_0x5ad806=[{'command':_0xe39bc2(0x1ae),'description':_0xe39bc2(0x1a6)},{'command':_0xe39bc2(0x1b2),'description':'设置环境\x20(online/daily)'}];return a25_0x48cd99(Box,{'flexDirection':_0xe39bc2(0x1b3),'marginTop':0x1,'marginBottom':0x1,'children':[a25_0x1a1e7f(Box,{'marginBottom':0x1,'children':a25_0x48cd99(Text,{'color':_0xe39bc2(0x1a5),'children':['\x20!','\x20\x20',_0xe39bc2(0x1aa)]})}),_0x235c01[_0xe39bc2(0x1bb)](_0x3dc05e=>a25_0x48cd99(Box,{'children':[a25_0x48cd99(Text,{'children':[_0xe39bc2(0x1ac),_0x3dc05e[_0xe39bc2(0x1b8)]]}),a25_0x1a1e7f(Text,{'color':_0xe39bc2(0x1a5),'children':_0x3dc05e['description']})]},_0x3dc05e[_0xe39bc2(0x1b8)])),a25_0x1a1e7f(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a25_0x1a1e7f(Text,{'color':_0xe39bc2(0x1a5),'children':_0xe39bc2(0x1bc)})}),_0x5ad806['map'](_0x21cc3a=>a25_0x48cd99(Box,{'children':[a25_0x48cd99(Text,{'children':[_0xe39bc2(0x1ac),_0x21cc3a['command']]}),a25_0x1a1e7f(Text,{'color':_0xe39bc2(0x1a5),'children':_0x21cc3a['description']})]},_0x21cc3a[_0xe39bc2(0x1b8)]))]});}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x24381e,_0x11df3){const _0x590237=a26_0x17be,_0x3efcee=_0x24381e();while(!![]){try{const _0x167c27=parseInt(_0x590237(0x152))/0x1*(parseInt(_0x590237(0x163))/0x2)+parseInt(_0x590237(0x160))/0x3*(parseInt(_0x590237(0x174))/0x4)+-parseInt(_0x590237(0x156))/0x5*(parseInt(_0x590237(0x157))/0x6)+-parseInt(_0x590237(0x170))/0x7+parseInt(_0x590237(0x161))/0x8+parseInt(_0x590237(0x176))/0x9+parseInt(_0x590237(0x171))/0xa*(-parseInt(_0x590237(0x162))/0xb);if(_0x167c27===_0x11df3)break;else _0x3efcee['push'](_0x3efcee['shift']());}catch(_0x169369){_0x3efcee['push'](_0x3efcee['shift']());}}}(a26_0x2759,0xcc24e));import{jsx as a26_0x2f7453,jsxs as a26_0x208da6}from'react/jsx-runtime';import{existsSync,readFileSync,writeFileSync}from'node:fs';import a26_0x36a17c from'node:fs';import a26_0x21a282 from'node:path';function a26_0x17be(_0x22934c,_0x44d254){const _0x27597d=a26_0x2759();return a26_0x17be=function(_0x17beeb,_0x47f33d){_0x17beeb=_0x17beeb-0x152;let _0x4a03e1=_0x27597d[_0x17beeb];return _0x4a03e1;},a26_0x17be(_0x22934c,_0x44d254);}import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';function a26_0x2759(){const _0x54b6fb=['undefined','appcode','get','--help','help','online','1300243DLKCQU','2740fzcGQu','message','flags','3098684HLvqpW','red','4827087fFnUCz','unlinkSync','env','769221gqZAkc','stringify','parse','length','15XEAseX','1491564akNqSF','daily','includes','input','环境配置已设置为:\x20','utf8','set','config','dirname','6DywvPK','2959448ruiCQM','58498oQUunR','2wfvNgV','保存配置失败:\x20','配置值无效或过长','error','log','string','app'];a26_0x2759=function(){return _0x54b6fb;};return a26_0x2759();}import{readConfig,isInProject,projectConfigPath,globalConfigPath}from'../utils/config.js';import{logger}from'../utils/logger.js';export function Config(_0x33ebea){const _0x17b981=a26_0x17be,{cli:_0x5af058}=_0x33ebea,_0x46d21e=_0x5af058[_0x17b981(0x15a)][0x1],_0x1b8fc7=_0x5af058[_0x17b981(0x15a)][0x2],_0x3c5582=[_0x17b981(0x15d),_0x17b981(0x16c)][_0x17b981(0x159)](_0x46d21e||''),_0x2a7869=_0x5af058[_0x17b981(0x15a)]['length']>=0x3;if(_0x1b8fc7===_0x17b981(0x16d)||_0x5af058[_0x17b981(0x173)][_0x17b981(0x16e)])return a26_0x2f7453(ConfigHelp,{});const _0x449183=readConfig();if(_0x46d21e===_0x17b981(0x15d)){if(_0x1b8fc7){const _0x24bb6b=_0x5af058['input'][0x3];if(typeof _0x24bb6b!==_0x17b981(0x16a)){if(_0x1b8fc7==='env'&&![_0x17b981(0x16f),_0x17b981(0x158)]['includes'](_0x24bb6b))return a26_0x2f7453(Box,{'children':a26_0x2f7453(Text,{'color':_0x17b981(0x175),'children':'环境配置值只能是\x20\x22online\x22\x20或\x20\x22daily\x22'})});const _0x5e3eec=isInProject(),_0x4afbc9=_0x5e3eec?projectConfigPath:globalConfigPath;let _0x2ac32b={};try{if(existsSync(_0x4afbc9)){const _0x48f8e9=readFileSync(_0x4afbc9,{'encoding':_0x17b981(0x15c)});_0x48f8e9&&(_0x2ac32b=JSON[_0x17b981(0x154)](_0x48f8e9));}}catch(_0x3f3629){}if(typeof _0x24bb6b!==_0x17b981(0x168)||_0x24bb6b[_0x17b981(0x155)]>0x1f4)return a26_0x2f7453(Box,{'children':a26_0x2f7453(Text,{'color':_0x17b981(0x175),'children':_0x17b981(0x165)})});let _0x4fb383=_0x1b8fc7;_0x1b8fc7==='app'&&(_0x4fb383=_0x17b981(0x16b),delete _0x2ac32b[_0x17b981(0x169)]);_0x1b8fc7==='appcode'&&delete _0x2ac32b['app'];_0x2ac32b[_0x4fb383]=_0x24bb6b;try{const _0x1b2d41=a26_0x21a282[_0x17b981(0x15f)](_0x4afbc9);!existsSync(_0x1b2d41)&&a26_0x36a17c['mkdirSync'](_0x1b2d41,{'recursive':!![]});const _0xb7b635=_0x4afbc9+'.tmp';writeFileSync(_0xb7b635,JSON[_0x17b981(0x153)](_0x2ac32b,null,0x2),{'encoding':_0x17b981(0x15c),'mode':0x180}),a26_0x36a17c['renameSync'](_0xb7b635,_0x4afbc9);if(_0x1b8fc7===_0x17b981(0x178)){const _0x220fd9=_0x5e3eec?'项目':'全局';console[_0x17b981(0x167)]('✓\x20'+_0x220fd9+_0x17b981(0x15b)+_0x24bb6b);}}catch(_0x53bc8d){const _0x168904=_0x4afbc9+'.tmp';try{existsSync(_0x168904)&&a26_0x36a17c[_0x17b981(0x177)](_0x168904);}catch(_0x2d109c){}return logger[_0x17b981(0x166)](_0x17b981(0x15e),'保存配置失败',{'error':_0x53bc8d instanceof Error?_0x53bc8d['message']:String(_0x53bc8d),'configKey':_0x1b8fc7,'configValue':_0x24bb6b,'targetConfigPath':_0x4afbc9}),a26_0x2f7453(Box,{'children':a26_0x208da6(Text,{'color':'red','children':[_0x17b981(0x164),_0x53bc8d instanceof Error?_0x53bc8d[_0x17b981(0x172)]:String(_0x53bc8d)]})});}return null;}return a26_0x2f7453(Box,{'children':a26_0x2f7453(Text,{'color':_0x17b981(0x175),'children':'未提供配置值'})});}}if(_0x46d21e===_0x17b981(0x16c)){if(_0x1b8fc7){let _0x4980cf=_0x1b8fc7;return _0x1b8fc7===_0x17b981(0x169)&&(_0x4980cf=_0x17b981(0x16b)),console['log'](_0x449183[_0x4980cf]||_0x17b981(0x16a)),null;}return null;}if(_0x46d21e==='list')return console[_0x17b981(0x167)](JSON[_0x17b981(0x153)](_0x449183,null,0x2)),null;if(!_0x3c5582||!_0x2a7869)return a26_0x2f7453(ConfigHelp,{});return null;}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a27_0x43eb1e=a27_0x3a23;(function(_0x3b9854,_0x407865){const _0x25a0b2=a27_0x3a23,_0x2e8ab8=_0x3b9854();while(!![]){try{const _0x398d3f=-parseInt(_0x25a0b2(0x174))/0x1+-parseInt(_0x25a0b2(0x172))/0x2+-parseInt(_0x25a0b2(0x168))/0x3*(-parseInt(_0x25a0b2(0x169))/0x4)+parseInt(_0x25a0b2(0x175))/0x5+parseInt(_0x25a0b2(0x16b))/0x6*(-parseInt(_0x25a0b2(0x16f))/0x7)+-parseInt(_0x25a0b2(0x16a))/0x8+-parseInt(_0x25a0b2(0x16d))/0x9*(-parseInt(_0x25a0b2(0x171))/0xa);if(_0x398d3f===_0x407865)break;else _0x2e8ab8['push'](_0x2e8ab8['shift']());}catch(_0x383edd){_0x2e8ab8['push'](_0x2e8ab8['shift']());}}}(a27_0x537a,0xf1149));import{getEnv}from'./env.js';function a27_0x3a23(_0x584cc0,_0x48a1fb){const _0x537a43=a27_0x537a();return a27_0x3a23=function(_0x3a2333,_0x5e3eed){_0x3a2333=_0x3a2333-0x168;let _0x7deca3=_0x537a43[_0x3a2333];return _0x7deca3;},a27_0x3a23(_0x584cc0,_0x48a1fb);}function a27_0x537a(){const _0x15ba7b=['7411420weWtXY','3329786ZeqwJc','online','31152VKBicH','8474610bOKYhn','https://user-daily.lovrabet.com','2365179fDIUlY','4fYeJjr','12898472pevywH','24JtNdfj','https://api.lovrabet.com','36xVeTGz','https://daily-api.lovrabet.com','2016112KoqMIM','https://user.lovrabet.com'];a27_0x537a=function(){return _0x15ba7b;};return a27_0x537a();}export const getUserDomain=()=>getEnv()===a27_0x43eb1e(0x173)?a27_0x43eb1e(0x170):a27_0x43eb1e(0x176);export const getApiDomain=()=>getEnv()===a27_0x43eb1e(0x173)?a27_0x43eb1e(0x16c):a27_0x43eb1e(0x16e);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a28_0x71a844=a28_0x1a48;(function(_0x99187e,_0x158f0c){const _0x51fb0e=a28_0x1a48,_0x1e231c=_0x99187e();while(!![]){try{const _0x430765=-parseInt(_0x51fb0e(0xb6))/0x1*(parseInt(_0x51fb0e(0xbc))/0x2)+-parseInt(_0x51fb0e(0xb8))/0x3+-parseInt(_0x51fb0e(0xb9))/0x4+-parseInt(_0x51fb0e(0xb7))/0x5*(parseInt(_0x51fb0e(0xb4))/0x6)+parseInt(_0x51fb0e(0xbb))/0x7+-parseInt(_0x51fb0e(0xbe))/0x8+parseInt(_0x51fb0e(0xbd))/0x9*(parseInt(_0x51fb0e(0xba))/0xa);if(_0x430765===_0x158f0c)break;else _0x1e231c['push'](_0x1e231c['shift']());}catch(_0x4f9573){_0x1e231c['push'](_0x1e231c['shift']());}}}(a28_0x4984,0xe3c5c));function a28_0x1a48(_0x312185,_0x1bcac3){const _0x498478=a28_0x4984();return a28_0x1a48=function(_0x1a4811,_0x88e5dc){_0x1a4811=_0x1a4811-0xb4;let _0x2ce1a8=_0x498478[_0x1a4811];return _0x2ce1a8;},a28_0x1a48(_0x312185,_0x1bcac3);}function a28_0x4984(){const _0x465d7f=['5211xpFBuP','6752800XKdIzv','6Axvkqw','env','8056mdCVhg','933845bUmIph','5397459ggmTrw','383636LxvNxn','65390JGmMBu','735210prQPjb','8sbXzeY'];a28_0x4984=function(){return _0x465d7f;};return a28_0x4984();}let env=process[a28_0x71a844(0xb5)]['LOVRABET_ENV']||'online';export function getEnv(){return env;}export function initEnv(_0x186067){env=_0x186067;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x321672,_0x4c5cb9){const _0x511aed=a26_0x4013,_0x4f4240=_0x321672();while(!![]){try{const _0x109916=parseInt(_0x511aed(0x195))/0x1+-parseInt(_0x511aed(0x174))/0x2+-parseInt(_0x511aed(0x191))/0x3+parseInt(_0x511aed(0x17d))/0x4+-parseInt(_0x511aed(0x197))/0x5*(-parseInt(_0x511aed(0x19a))/0x6)+-parseInt(_0x511aed(0x190))/0x7*(parseInt(_0x511aed(0x18c))/0x8)+-parseInt(_0x511aed(0x172))/0x9;if(_0x109916===_0x4c5cb9)break;else _0x4f4240['push'](_0x4f4240['shift']());}catch(_0x4b35ab){_0x4f4240['push'](_0x4f4240['shift']());}}}(a26_0x1fd9,0x72c3c));import{jsx as a26_0x5b9635,jsxs as a26_0x996b1c,Fragment as a26_0x17c1e6}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';function a26_0x1fd9(){const _0x51e6b5=['length','未设置','*\x20正在检查登录状态...','\x20检查中...','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','Yes','项目名','跳过登录','confirm-api-pull','*\x20创建新项目','cyan','env','应用AppCode','step','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','creating','项目名不合法','api-pull','*\x20应用AppCode\x20','test','6206229RGJXVB','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','1001374pyIGeD','*\x20是否要自动拉取\x20API\x20配置?','\x20\x20使用\x20←→\x20选择,回车确认','[可选]:\x20','rightArrow','\x20登录中...','\x20←\x20','yellow','*\x20正在登录,请前往浏览器完成登录...','3505980HypXJa','\x20直接回车确认,或输入自定义名称','project-name','includes','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','login-process','return','map','登录状态','online','value','green','*\x20是否要先登录以便拉取\x20API\x20配置?','登录失败','login-prompt','9584uOdOPM','login-check','red','string','763HLnFqg','427233kmroZC','√\x20检测到有效登录状态','!\x20未检测到有效登录','应用AppCode不合法','532935JrVNfd','项目名长度不能超过\x2050\x20个字符','5NPksYm','gray','backspace','3143442ZRDsfd','app-code','label','trim','应用AppCode长度不能超过\x20100\x20个字符','leftArrow','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)'];a26_0x1fd9=function(){return _0x51e6b5;};return a26_0x1fd9();}function a26_0x4013(_0x18a6b7,_0x5255d6){const _0x1fd9f7=a26_0x1fd9();return a26_0x4013=function(_0x4013cf,_0x59a10d){_0x4013cf=_0x4013cf-0x15a;let _0x5e15ad=_0x1fd9f7[_0x4013cf];return _0x5e15ad;},a26_0x4013(_0x18a6b7,_0x5255d6);}export function EnhancedGuidedCreate(_0x4921bb){const _0x203355=a26_0x4013,{onCreate:_0x73d39,env:_0x9d1d0f}=_0x4921bb,[_0xbd384b,_0x170107]=useState(_0x203355(0x17f)),[_0x3030f6,_0x594fd2]=useState(''),[_0x30d756,_0x8b109]=useState(''),[_0x4f0547,_0x8d5d56]=useState(''),[_0x422f74,_0x372651]=useState(''),[_0x2944d1,_0x525946]=useState([]),[_0x5eaa81,_0x3eca5c]=useState(null),[_0x53af95,_0x5d2d5e]=useState(![]),[_0x549674,_0x1e5edd]=useState(![]),[_0x44602d,_0x56d109]=useState(![]),[_0x2b22f0,_0x7b4a22]=useState(0x0),[_0x276efe,_0x1c68ed]=useState(0x0),_0x32c60f='my-app',_0x266a0a=readConfig(),_0x3c7a62=typeof _0x266a0a[_0x203355(0x169)]===_0x203355(0x18f)?_0x266a0a[_0x203355(0x169)]:undefined;function _0x379d3e(_0x340f7c){const _0x2d28d8=_0x203355;if(_0x340f7c['length']>0x32)return{'valid':![],'message':_0x2d28d8(0x196)};const _0x53c40b=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x340f7c?.[_0x2d28d8(0x15a)]()&&!_0x53c40b[_0x2d28d8(0x171)](_0x340f7c))return{'valid':![],'message':_0x2d28d8(0x162)};return{'valid':!![]};}function _0xb5f1d8(_0x139963){const _0x3900bf=_0x203355;if(!_0x139963[_0x3900bf(0x15a)]())return{'valid':!![]};if(_0x139963[_0x3900bf(0x15e)]>0x64)return{'valid':![],'message':_0x3900bf(0x15b)};const _0x3ff517=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x3ff517[_0x3900bf(0x171)](_0x139963))return{'valid':![],'message':_0x3900bf(0x173)};return{'valid':!![]};}async function _0x66b210(){_0x5d2d5e(!![]);try{const _0x220d53=await getIsSessionValid();return _0x3eca5c(_0x220d53),_0x220d53;}catch(_0x1f2f4f){return _0x3eca5c(![]),![];}finally{_0x5d2d5e(![]);}}async function _0x39c9f7(){_0x1e5edd(!![]);try{const _0x5c8e54=await authServer({'silent':!![]});return _0x3eca5c(_0x5c8e54),_0x5c8e54;}catch(_0x4b6831){return _0x3eca5c(![]),![];}finally{_0x1e5edd(![]);}}return useInput(async(_0x114945,_0x125a8f)=>{const _0x29ec7a=_0x203355;if(_0x125a8f[_0x29ec7a(0x15c)]||_0x125a8f[_0x29ec7a(0x178)]){if(_0xbd384b===_0x29ec7a(0x166)){_0x7b4a22(_0x37cb07=>_0x37cb07===0x0?0x1:0x0);return;}if(_0xbd384b===_0x29ec7a(0x18b)){_0x1c68ed(_0x57659c=>_0x57659c===0x0?0x1:0x0);return;}}if(_0x125a8f[_0x29ec7a(0x183)]){if(_0xbd384b===_0x29ec7a(0x17f)){const _0x2d4b4c=_0x4f0547[_0x29ec7a(0x15a)]()||_0x32c60f;if(_0x422f74)return;_0x594fd2(_0x2d4b4c),_0x525946([{'step':_0x29ec7a(0x17f),'label':_0x29ec7a(0x164),'value':_0x2d4b4c}]),_0x8d5d56(''),_0x372651(''),_0x170107(_0x29ec7a(0x19b));return;}if(_0xbd384b===_0x29ec7a(0x19b)){if(_0x422f74)return;const _0x4a2089=_0x4f0547[_0x29ec7a(0x15a)]();_0x8b109(_0x4a2089),_0x525946(_0x4cda4b=>[..._0x4cda4b,{'step':_0x29ec7a(0x19b),'label':_0x29ec7a(0x16a),'value':_0x4a2089||_0x29ec7a(0x15f)}]),_0x8d5d56(''),_0x372651('');if(_0x4a2089){_0x170107(_0x29ec7a(0x18d));const _0x214a72=await _0x66b210();_0x214a72?_0x170107('confirm-api-pull'):_0x170107(_0x29ec7a(0x18b));}else{const _0x383fa5=_0x9d1d0f||_0x3c7a62||'online';_0x73d39({'projectName':_0x3030f6,'appCode':undefined,'pullApi':![],'env':_0x383fa5}),_0x170107('creating');}return;}if(_0xbd384b===_0x29ec7a(0x166)){const _0x331543=_0x2b22f0===0x0;_0x56d109(_0x331543),_0x525946(_0x13707c=>[..._0x13707c,{'step':_0x29ec7a(0x16f),'label':'拉取API配置','value':_0x331543?'是':'否'}]);const _0xd3934a=_0x9d1d0f||_0x3c7a62||_0x29ec7a(0x186);_0x73d39({'projectName':_0x3030f6,'appCode':_0x30d756,'pullApi':_0x331543,'env':_0xd3934a}),_0x170107(_0x29ec7a(0x16d));return;}if(_0xbd384b===_0x29ec7a(0x18b)){const _0x549825=_0x276efe===0x0;if(_0x549825){_0x170107('login-process');const _0x5ab44c=await _0x39c9f7();if(_0x5ab44c)_0x525946(_0x2e3ab2=>[..._0x2e3ab2,{'step':'login','label':_0x29ec7a(0x185),'value':'已登录'}]),_0x170107(_0x29ec7a(0x166));else{_0x525946(_0x37d9da=>[..._0x37d9da,{'step':'login','label':'登录状态','value':_0x29ec7a(0x18a)}]);const _0x805c56=_0x9d1d0f||_0x3c7a62||'online';_0x73d39({'projectName':_0x3030f6,'appCode':_0x30d756,'pullApi':![],'env':_0x805c56}),_0x170107(_0x29ec7a(0x16d));}}else{_0x525946(_0xb8f3c5=>[..._0xb8f3c5,{'step':'login','label':_0x29ec7a(0x185),'value':_0x29ec7a(0x165)}]);const _0x4451c7=_0x9d1d0f||_0x3c7a62||'online';_0x73d39({'projectName':_0x3030f6,'appCode':_0x30d756,'pullApi':![],'env':_0x4451c7}),_0x170107('creating');}return;}}if(_0x125a8f[_0x29ec7a(0x199)]||_0x125a8f['delete']){_0x8d5d56(_0xac370a=>{const _0x3c8cc1=_0x29ec7a,_0x511e8a=_0xac370a['slice'](0x0,-0x1);if(_0xbd384b===_0x3c8cc1(0x17f)){const {valid:_0x162ba,message:_0x3e9a08}=_0x379d3e(_0x511e8a);_0x372651(_0x162ba?'':_0x3e9a08||_0x3c8cc1(0x16e));}else{if(_0xbd384b===_0x3c8cc1(0x19b)){const {valid:_0x5dcb90,message:_0xc39dfa}=_0xb5f1d8(_0x511e8a);_0x372651(_0x5dcb90?'':_0xc39dfa||_0x3c8cc1(0x194));}}return _0x511e8a;});return;}if([_0x29ec7a(0x16d),_0x29ec7a(0x18d),'login-process'][_0x29ec7a(0x180)](_0xbd384b))return;if(_0xbd384b===_0x29ec7a(0x166)||_0xbd384b===_0x29ec7a(0x18b))return;_0x8d5d56(_0x2fc3a1=>{const _0x28e67f=_0x29ec7a,_0x5a2bec=_0x2fc3a1+_0x114945;if(_0xbd384b===_0x28e67f(0x17f)){const {valid:_0x44179e,message:_0x19297e}=_0x379d3e(_0x5a2bec);_0x372651(_0x44179e?'':_0x19297e||_0x28e67f(0x16e));}else{if(_0xbd384b===_0x28e67f(0x19b)){const {valid:_0x419a34,message:_0x28b97b}=_0xb5f1d8(_0x5a2bec);_0x372651(_0x419a34?'':_0x28b97b||_0x28e67f(0x194));}}return _0x5a2bec;});}),a26_0x996b1c(Box,{'flexDirection':'column','marginTop':0x1,'children':[_0x2944d1['length']===0x0&&a26_0x5b9635(Box,{'children':a26_0x5b9635(Text,{'color':'cyan','children':_0x203355(0x167)})}),_0x2944d1[_0x203355(0x184)](_0xf0ede=>a26_0x996b1c(Box,{'children':[a26_0x996b1c(Text,{'color':_0x203355(0x188),'children':['√\x20',_0xf0ede[_0x203355(0x19c)],':\x20']}),a26_0x5b9635(Text,{'color':_0x203355(0x168),'children':_0xf0ede[_0x203355(0x187)]})]},_0xf0ede[_0x203355(0x16b)])),_0xbd384b===_0x203355(0x17f)&&a26_0x996b1c(a26_0x17c1e6,{'children':[a26_0x996b1c(Box,{'children':[a26_0x5b9635(Text,{'children':'*\x20项目名:\x20'}),_0x4f0547?a26_0x5b9635(Text,{'color':'green','children':_0x4f0547}):a26_0x5b9635(Text,{'color':_0x203355(0x198),'children':_0x32c60f}),_0x422f74&&a26_0x996b1c(Text,{'color':_0x203355(0x18e),'children':['\x20←\x20',_0x422f74]})]}),!_0x422f74&&!_0x4f0547&&a26_0x5b9635(Box,{'children':a26_0x5b9635(Text,{'color':_0x203355(0x198),'children':_0x203355(0x17e)})})]}),_0xbd384b==='app-code'&&a26_0x996b1c(a26_0x17c1e6,{'children':[a26_0x996b1c(Box,{'children':[a26_0x5b9635(Text,{'children':_0x203355(0x170)}),a26_0x5b9635(Text,{'color':_0x203355(0x198),'children':_0x203355(0x177)}),a26_0x5b9635(Text,{'color':_0x203355(0x188),'children':_0x4f0547}),_0x422f74&&a26_0x996b1c(Text,{'color':_0x203355(0x18e),'children':[_0x203355(0x17a),_0x422f74]})]}),!_0x422f74&&a26_0x5b9635(Box,{'children':a26_0x996b1c(Text,{'color':_0x203355(0x198),'children':['\x20',_0x203355(0x15d)]})})]}),_0xbd384b==='login-check'&&a26_0x996b1c(Box,{'children':[a26_0x5b9635(Text,{'children':_0x203355(0x160)}),_0x53af95&&a26_0x5b9635(Text,{'color':_0x203355(0x198),'children':_0x203355(0x161)})]}),_0xbd384b===_0x203355(0x166)&&a26_0x996b1c(a26_0x17c1e6,{'children':[a26_0x5b9635(Box,{'children':a26_0x5b9635(Text,{'color':_0x203355(0x188),'children':_0x203355(0x192)})}),a26_0x5b9635(Box,{'marginTop':0x1,'children':a26_0x5b9635(Text,{'children':_0x203355(0x175)})}),a26_0x996b1c(Box,{'marginLeft':0x2,'children':[a26_0x996b1c(Text,{'color':_0x2b22f0===0x0?_0x203355(0x188):'gray','children':[_0x2b22f0===0x0?'▶\x20':'\x20\x20',_0x203355(0x163)]}),a26_0x5b9635(Text,{'children':'\x20'}),a26_0x996b1c(Text,{'color':_0x2b22f0===0x1?_0x203355(0x188):_0x203355(0x198),'children':[_0x2b22f0===0x1?'▶\x20':'\x20\x20','No']})]}),a26_0x5b9635(Box,{'children':a26_0x5b9635(Text,{'color':'gray','children':_0x203355(0x176)})}),a26_0x5b9635(Box,{'children':a26_0x5b9635(Text,{'color':_0x203355(0x17b),'children':_0x203355(0x181)})})]}),_0xbd384b===_0x203355(0x18b)&&a26_0x996b1c(a26_0x17c1e6,{'children':[a26_0x5b9635(Box,{'children':a26_0x5b9635(Text,{'color':'yellow','children':_0x203355(0x193)})}),a26_0x5b9635(Box,{'marginTop':0x1,'children':a26_0x5b9635(Text,{'children':_0x203355(0x189)})}),a26_0x996b1c(Box,{'marginLeft':0x2,'children':[a26_0x996b1c(Text,{'color':_0x276efe===0x0?_0x203355(0x188):_0x203355(0x198),'children':[_0x276efe===0x0?'▶\x20':'\x20\x20',_0x203355(0x163)]}),a26_0x5b9635(Text,{'children':'\x20'}),a26_0x996b1c(Text,{'color':_0x276efe===0x1?_0x203355(0x188):_0x203355(0x198),'children':[_0x276efe===0x1?'▶\x20':'\x20\x20','No']})]}),a26_0x5b9635(Box,{'children':a26_0x5b9635(Text,{'color':'gray','children':_0x203355(0x176)})}),a26_0x5b9635(Box,{'children':a26_0x5b9635(Text,{'color':_0x203355(0x17b),'children':_0x203355(0x16c)})})]}),_0xbd384b===_0x203355(0x182)&&a26_0x996b1c(Box,{'children':[a26_0x5b9635(Text,{'children':_0x203355(0x17c)}),_0x549674&&a26_0x5b9635(Text,{'color':_0x203355(0x198),'children':_0x203355(0x179)})]})]});}
|
|
1
|
+
(function(_0x1846e5,_0x6d7e5f){const _0x30f93f=a29_0x2bc2,_0x23b942=_0x1846e5();while(!![]){try{const _0x300629=-parseInt(_0x30f93f(0x107))/0x1+-parseInt(_0x30f93f(0x112))/0x2*(-parseInt(_0x30f93f(0xf9))/0x3)+-parseInt(_0x30f93f(0xd3))/0x4*(-parseInt(_0x30f93f(0x105))/0x5)+-parseInt(_0x30f93f(0xeb))/0x6*(-parseInt(_0x30f93f(0x102))/0x7)+parseInt(_0x30f93f(0xd6))/0x8*(-parseInt(_0x30f93f(0xf2))/0x9)+-parseInt(_0x30f93f(0x10d))/0xa+-parseInt(_0x30f93f(0x114))/0xb*(parseInt(_0x30f93f(0xf7))/0xc);if(_0x300629===_0x6d7e5f)break;else _0x23b942['push'](_0x23b942['shift']());}catch(_0x36d6a4){_0x23b942['push'](_0x23b942['shift']());}}}(a29_0x1cb4,0x1d4d6));import{jsx as a29_0x33bf87,jsxs as a29_0x554154,Fragment as a29_0x34183c}from'react/jsx-runtime';function a29_0x2bc2(_0x54db9e,_0x3a306e){const _0x1cb461=a29_0x1cb4();return a29_0x2bc2=function(_0x2bc296,_0x37590f){_0x2bc296=_0x2bc296-0xd3;let _0x134b62=_0x1cb461[_0x2bc296];return _0x134b62;},a29_0x2bc2(_0x54db9e,_0x3a306e);}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';function a29_0x1cb4(){const _0x4efce8=['login-prompt','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','yellow','27VSSlqd','map','delete','value','project-name','456kMyIhE','green','7602qonjlm','\x20直接回车确认,或输入自定义名称','*\x20创建新项目','\x20\x20使用\x20←→\x20选择,回车确认','应用AppCode','api-pull','login-check','*\x20正在检查登录状态...','includes','7EBCBYZ','creating','Yes','40TkFiVY','app-code','18159vwRLze','login','online','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','*\x20正在登录,请前往浏览器完成登录...','confirm-api-pull','1129700lrASAr','return','拉取API配置','应用AppCode长度不能超过\x20100\x20个字符','*\x20是否要自动拉取\x20API\x20配置?','124fZROmO','leftArrow','12364NjoLil','87572kKZFkK','\x20登录中...','login-process','511312vikUzJ','env','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','*\x20应用AppCode\x20','[可选]:\x20','my-app','label','cyan','\x20←\x20','登录状态','应用AppCode不合法','step','!\x20未检测到有效登录','项目名','项目名不合法','slice','red','trim','rightArrow','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','跳过登录','920118cJALxI','length','gray','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'];a29_0x1cb4=function(){return _0x4efce8;};return a29_0x1cb4();}import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x47c2f1){const _0x508e95=a29_0x2bc2,{onCreate:_0x12651f,env:_0x540f60}=_0x47c2f1,[_0x3e7ff6,_0x487c2a]=useState(_0x508e95(0xf6)),[_0x5d1425,_0x50210d]=useState(''),[_0x1fb80b,_0x641874]=useState(''),[_0x34315f,_0x152175]=useState(''),[_0x46c952,_0x63a98a]=useState(''),[_0x43982b,_0x431a24]=useState([]),[_0x506d1b,_0x2e4787]=useState(null),[_0x1f511c,_0x272000]=useState(![]),[_0x1e5b65,_0x2e28ee]=useState(![]),[_0x100c05,_0x177703]=useState(![]),[_0x32a6bf,_0x8eaed2]=useState(0x0),[_0x52cc96,_0x53b4b0]=useState(0x0),_0x27f21d=_0x508e95(0xdb),_0xe2e8f9=readConfig(),_0x17507a=typeof _0xe2e8f9[_0x508e95(0xd7)]==='string'?_0xe2e8f9[_0x508e95(0xd7)]:undefined;function _0x14f708(_0x4d76cd){const _0x3fde93=_0x508e95;if(_0x4d76cd[_0x3fde93(0xec)]>0x32)return{'valid':![],'message':'项目名长度不能超过\x2050\x20个字符'};const _0x15a202=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x4d76cd?.[_0x3fde93(0xe7)]()&&!_0x15a202['test'](_0x4d76cd))return{'valid':![],'message':_0x3fde93(0xee)};return{'valid':!![]};}function _0x55cbe2(_0x16e357){const _0x1f8568=_0x508e95;if(!_0x16e357['trim']())return{'valid':!![]};if(_0x16e357[_0x1f8568(0xec)]>0x64)return{'valid':![],'message':_0x1f8568(0x110)};const _0x3ceeaf=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x3ceeaf['test'](_0x16e357))return{'valid':![],'message':_0x1f8568(0xd8)};return{'valid':!![]};}async function _0x1e71af(){_0x272000(!![]);try{const _0x2bb9e6=await getIsSessionValid();return _0x2e4787(_0x2bb9e6),_0x2bb9e6;}catch(_0xe3b009){return _0x2e4787(![]),![];}finally{_0x272000(![]);}}async function _0x2ae90d(){_0x2e28ee(!![]);try{const _0x2edc26=await authServer({'silent':!![]});return _0x2e4787(_0x2edc26),_0x2edc26;}catch(_0x8c245){return _0x2e4787(![]),![];}finally{_0x2e28ee(![]);}}return useInput(async(_0x53280c,_0x1f9205)=>{const _0x9189b5=_0x508e95;if(_0x1f9205[_0x9189b5(0x113)]||_0x1f9205[_0x9189b5(0xe8)]){if(_0x3e7ff6==='confirm-api-pull'){_0x8eaed2(_0x1a5c4c=>_0x1a5c4c===0x0?0x1:0x0);return;}if(_0x3e7ff6===_0x9189b5(0xef)){_0x53b4b0(_0x379d91=>_0x379d91===0x0?0x1:0x0);return;}}if(_0x1f9205[_0x9189b5(0x10e)]){if(_0x3e7ff6===_0x9189b5(0xf6)){const _0x7a827a=_0x34315f[_0x9189b5(0xe7)]()||_0x27f21d;if(_0x46c952)return;_0x50210d(_0x7a827a),_0x431a24([{'step':_0x9189b5(0xf6),'label':_0x9189b5(0xe3),'value':_0x7a827a}]),_0x152175(''),_0x63a98a(''),_0x487c2a(_0x9189b5(0x106));return;}if(_0x3e7ff6===_0x9189b5(0x106)){if(_0x46c952)return;const _0x4127f9=_0x34315f[_0x9189b5(0xe7)]();_0x641874(_0x4127f9),_0x431a24(_0x17042e=>[..._0x17042e,{'step':_0x9189b5(0x106),'label':_0x9189b5(0xfd),'value':_0x4127f9||'未设置'}]),_0x152175(''),_0x63a98a('');if(_0x4127f9){_0x487c2a(_0x9189b5(0xff));const _0x5e2f6a=await _0x1e71af();_0x5e2f6a?_0x487c2a('confirm-api-pull'):_0x487c2a('login-prompt');}else{const _0x60d5cd=_0x540f60||_0x17507a||'online';_0x12651f({'projectName':_0x5d1425,'appCode':undefined,'pullApi':![],'env':_0x60d5cd}),_0x487c2a(_0x9189b5(0x103));}return;}if(_0x3e7ff6===_0x9189b5(0x10c)){const _0x3626a1=_0x32a6bf===0x0;_0x177703(_0x3626a1),_0x431a24(_0x3de522=>[..._0x3de522,{'step':_0x9189b5(0xfe),'label':_0x9189b5(0x10f),'value':_0x3626a1?'是':'否'}]);const _0x19695e=_0x540f60||_0x17507a||_0x9189b5(0x109);_0x12651f({'projectName':_0x5d1425,'appCode':_0x1fb80b,'pullApi':_0x3626a1,'env':_0x19695e}),_0x487c2a('creating');return;}if(_0x3e7ff6==='login-prompt'){const _0x1c21c0=_0x52cc96===0x0;if(_0x1c21c0){_0x487c2a(_0x9189b5(0xd5));const _0x1c93cf=await _0x2ae90d();if(_0x1c93cf)_0x431a24(_0x153a49=>[..._0x153a49,{'step':_0x9189b5(0x108),'label':_0x9189b5(0xdf),'value':'已登录'}]),_0x487c2a(_0x9189b5(0x10c));else{_0x431a24(_0x2f9039=>[..._0x2f9039,{'step':_0x9189b5(0x108),'label':_0x9189b5(0xdf),'value':'登录失败'}]);const _0x414f27=_0x540f60||_0x17507a||_0x9189b5(0x109);_0x12651f({'projectName':_0x5d1425,'appCode':_0x1fb80b,'pullApi':![],'env':_0x414f27}),_0x487c2a(_0x9189b5(0x103));}}else{_0x431a24(_0x130dba=>[..._0x130dba,{'step':_0x9189b5(0x108),'label':_0x9189b5(0xdf),'value':_0x9189b5(0xea)}]);const _0x535df3=_0x540f60||_0x17507a||_0x9189b5(0x109);_0x12651f({'projectName':_0x5d1425,'appCode':_0x1fb80b,'pullApi':![],'env':_0x535df3}),_0x487c2a(_0x9189b5(0x103));}return;}}if(_0x1f9205['backspace']||_0x1f9205[_0x9189b5(0xf4)]){_0x152175(_0x335380=>{const _0xe9bfe7=_0x9189b5,_0x2336fb=_0x335380[_0xe9bfe7(0xe5)](0x0,-0x1);if(_0x3e7ff6===_0xe9bfe7(0xf6)){const {valid:_0x58ffe0,message:_0x2690b4}=_0x14f708(_0x2336fb);_0x63a98a(_0x58ffe0?'':_0x2690b4||'项目名不合法');}else{if(_0x3e7ff6===_0xe9bfe7(0x106)){const {valid:_0x3069bf,message:_0x1b8c0e}=_0x55cbe2(_0x2336fb);_0x63a98a(_0x3069bf?'':_0x1b8c0e||_0xe9bfe7(0xe0));}}return _0x2336fb;});return;}if([_0x9189b5(0x103),_0x9189b5(0xff),'login-process'][_0x9189b5(0x101)](_0x3e7ff6))return;if(_0x3e7ff6===_0x9189b5(0x10c)||_0x3e7ff6===_0x9189b5(0xef))return;_0x152175(_0x334ede=>{const _0x1c6242=_0x9189b5,_0x15285e=_0x334ede+_0x53280c;if(_0x3e7ff6===_0x1c6242(0xf6)){const {valid:_0x2243ac,message:_0x138d70}=_0x14f708(_0x15285e);_0x63a98a(_0x2243ac?'':_0x138d70||_0x1c6242(0xe4));}else{if(_0x3e7ff6===_0x1c6242(0x106)){const {valid:_0x1cec2c,message:_0x4b65a3}=_0x55cbe2(_0x15285e);_0x63a98a(_0x1cec2c?'':_0x4b65a3||_0x1c6242(0xe0));}}return _0x15285e;});}),a29_0x554154(Box,{'flexDirection':'column','marginTop':0x1,'children':[_0x43982b[_0x508e95(0xec)]===0x0&&a29_0x33bf87(Box,{'children':a29_0x33bf87(Text,{'color':_0x508e95(0xdd),'children':_0x508e95(0xfb)})}),_0x43982b[_0x508e95(0xf3)](_0x1ab34d=>a29_0x554154(Box,{'children':[a29_0x554154(Text,{'color':_0x508e95(0xf8),'children':['√\x20',_0x1ab34d[_0x508e95(0xdc)],':\x20']}),a29_0x33bf87(Text,{'color':'cyan','children':_0x1ab34d[_0x508e95(0xf5)]})]},_0x1ab34d[_0x508e95(0xe1)])),_0x3e7ff6===_0x508e95(0xf6)&&a29_0x554154(a29_0x34183c,{'children':[a29_0x554154(Box,{'children':[a29_0x33bf87(Text,{'children':'*\x20项目名:\x20'}),_0x34315f?a29_0x33bf87(Text,{'color':'green','children':_0x34315f}):a29_0x33bf87(Text,{'color':_0x508e95(0xed),'children':_0x27f21d}),_0x46c952&&a29_0x554154(Text,{'color':_0x508e95(0xe6),'children':[_0x508e95(0xde),_0x46c952]})]}),!_0x46c952&&!_0x34315f&&a29_0x33bf87(Box,{'children':a29_0x33bf87(Text,{'color':_0x508e95(0xed),'children':_0x508e95(0xfa)})})]}),_0x3e7ff6===_0x508e95(0x106)&&a29_0x554154(a29_0x34183c,{'children':[a29_0x554154(Box,{'children':[a29_0x33bf87(Text,{'children':_0x508e95(0xd9)}),a29_0x33bf87(Text,{'color':_0x508e95(0xed),'children':_0x508e95(0xda)}),a29_0x33bf87(Text,{'color':_0x508e95(0xf8),'children':_0x34315f}),_0x46c952&&a29_0x554154(Text,{'color':'red','children':[_0x508e95(0xde),_0x46c952]})]}),!_0x46c952&&a29_0x33bf87(Box,{'children':a29_0x554154(Text,{'color':_0x508e95(0xed),'children':['\x20',_0x508e95(0xe9)]})})]}),_0x3e7ff6==='login-check'&&a29_0x554154(Box,{'children':[a29_0x33bf87(Text,{'children':_0x508e95(0x100)}),_0x1f511c&&a29_0x33bf87(Text,{'color':'gray','children':'\x20检查中...'})]}),_0x3e7ff6===_0x508e95(0x10c)&&a29_0x554154(a29_0x34183c,{'children':[a29_0x33bf87(Box,{'children':a29_0x33bf87(Text,{'color':'green','children':'√\x20检测到有效登录状态'})}),a29_0x33bf87(Box,{'marginTop':0x1,'children':a29_0x33bf87(Text,{'children':_0x508e95(0x111)})}),a29_0x554154(Box,{'marginLeft':0x2,'children':[a29_0x554154(Text,{'color':_0x32a6bf===0x0?_0x508e95(0xf8):_0x508e95(0xed),'children':[_0x32a6bf===0x0?'▶\x20':'\x20\x20',_0x508e95(0x104)]}),a29_0x33bf87(Text,{'children':'\x20'}),a29_0x554154(Text,{'color':_0x32a6bf===0x1?_0x508e95(0xf8):'gray','children':[_0x32a6bf===0x1?'▶\x20':'\x20\x20','No']})]}),a29_0x33bf87(Box,{'children':a29_0x33bf87(Text,{'color':_0x508e95(0xed),'children':_0x508e95(0xfc)})}),a29_0x33bf87(Box,{'children':a29_0x33bf87(Text,{'color':_0x508e95(0xf1),'children':_0x508e95(0x10a)})})]}),_0x3e7ff6===_0x508e95(0xef)&&a29_0x554154(a29_0x34183c,{'children':[a29_0x33bf87(Box,{'children':a29_0x33bf87(Text,{'color':_0x508e95(0xf1),'children':_0x508e95(0xe2)})}),a29_0x33bf87(Box,{'marginTop':0x1,'children':a29_0x33bf87(Text,{'children':'*\x20是否要先登录以便拉取\x20API\x20配置?'})}),a29_0x554154(Box,{'marginLeft':0x2,'children':[a29_0x554154(Text,{'color':_0x52cc96===0x0?'green':_0x508e95(0xed),'children':[_0x52cc96===0x0?'▶\x20':'\x20\x20','Yes']}),a29_0x33bf87(Text,{'children':'\x20'}),a29_0x554154(Text,{'color':_0x52cc96===0x1?_0x508e95(0xf8):_0x508e95(0xed),'children':[_0x52cc96===0x1?'▶\x20':'\x20\x20','No']})]}),a29_0x33bf87(Box,{'children':a29_0x33bf87(Text,{'color':_0x508e95(0xed),'children':_0x508e95(0xfc)})}),a29_0x33bf87(Box,{'children':a29_0x33bf87(Text,{'color':_0x508e95(0xf1),'children':_0x508e95(0xf0)})})]}),_0x3e7ff6===_0x508e95(0xd5)&&a29_0x554154(Box,{'children':[a29_0x33bf87(Text,{'children':_0x508e95(0x10b)}),_0x1e5b65&&a29_0x33bf87(Text,{'color':_0x508e95(0xed),'children':_0x508e95(0xd4)})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a30_0x4169(_0x356e46,_0x528b10){const _0x47d09c=a30_0x47d0();return a30_0x4169=function(_0x4169fd,_0x24c7ed){_0x4169fd=_0x4169fd-0xd6;let _0x5c43c4=_0x47d09c[_0x4169fd];return _0x5c43c4;},a30_0x4169(_0x356e46,_0x528b10);}(function(_0x1cdec0,_0x137908){const _0x35692f=a30_0x4169,_0x3c0f72=_0x1cdec0();while(!![]){try{const _0x12e4d6=-parseInt(_0x35692f(0xd8))/0x1*(-parseInt(_0x35692f(0xda))/0x2)+-parseInt(_0x35692f(0xdf))/0x3*(-parseInt(_0x35692f(0xe0))/0x4)+-parseInt(_0x35692f(0xd6))/0x5+parseInt(_0x35692f(0xdd))/0x6+-parseInt(_0x35692f(0xe1))/0x7+-parseInt(_0x35692f(0xdb))/0x8+-parseInt(_0x35692f(0xd7))/0x9*(-parseInt(_0x35692f(0xdc))/0xa);if(_0x12e4d6===_0x137908)break;else _0x3c0f72['push'](_0x3c0f72['shift']());}catch(_0x5d9e9d){_0x3c0f72['push'](_0x3c0f72['shift']());}}}(a30_0x47d0,0x6349c));export function formatElapsed(_0x40a3c8){const _0x4907c7=a30_0x4169,_0x3866a4=Date['now']()-_0x40a3c8;if(_0x3866a4<0x3e8)return _0x3866a4+'ms';const _0x23b456=(_0x3866a4/0x3e8)[_0x4907c7(0xd9)](0x2),_0x51942e=_0x23b456[_0x4907c7(0xde)](/\.?0+$/u,'');return _0x51942e+'s';}function a30_0x47d0(){const _0xc0c517=['42DKvvPO','404744wqnhaM','9770ntOInG','4787988mvdEsy','replace','117939jYURer','12zMsGzv','5628735kKRTZL','926985hfNxvr','3852sgYscA','5366FoZVfc','toFixed'];a30_0x47d0=function(){return _0xc0c517;};return a30_0x47d0();}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xac6c20,_0x32e368){const _0x51d88b=a28_0x2ca5,_0x18036b=_0xac6c20();while(!![]){try{const _0x72c661=-parseInt(_0x51d88b(0xd2))/0x1*(-parseInt(_0x51d88b(0x10b))/0x2)+parseInt(_0x51d88b(0xe3))/0x3+-parseInt(_0x51d88b(0x100))/0x4*(parseInt(_0x51d88b(0xd3))/0x5)+parseInt(_0x51d88b(0x106))/0x6*(parseInt(_0x51d88b(0x10d))/0x7)+parseInt(_0x51d88b(0xda))/0x8+parseInt(_0x51d88b(0xe6))/0x9*(-parseInt(_0x51d88b(0xdb))/0xa)+-parseInt(_0x51d88b(0xe0))/0xb;if(_0x72c661===_0x32e368)break;else _0x18036b['push'](_0x18036b['shift']());}catch(_0x5ac2ee){_0x18036b['push'](_0x18036b['shift']());}}}(a28_0x198a,0x46320));import{jsx as a28_0x7caf05,Fragment as a28_0x23e781,jsxs as a28_0x586d84}from'react/jsx-runtime';import a28_0x972927 from'node:path';import a28_0x438b3f from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';function a28_0x2ca5(_0x580fe8,_0x1dc27b){const _0x198abd=a28_0x198a();return a28_0x2ca5=function(_0x2ca55f,_0x3ae685){_0x2ca55f=_0x2ca55f-0xc9;let _0x83980e=_0x198abd[_0x2ca55f];return _0x83980e;},a28_0x2ca5(_0x580fe8,_0x1dc27b);}import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';function a28_0x198a(){const _0x397946=['\x20√\x20','string','配置AppCode:\x20','online','×\x20项目名不能为空','🔗\x20应用AppCode:\x20','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20app\x20<app-code>\x27\x20配置','√\x20配置文件已创建,应用AppCode:\x20','1NVhvuR','15commzh','\x20已存在,请使用其他项目名','cwd','create','API\x20配置拉取异常:\x20','项目创建失败:\x20','*\x20正在为项目\x20','3460312SEHVuT','811740xZMCda','yellow','配置应用AppCode失败:\x20','trim','constants','5022886ySgECB','writeFileSync','启动项目:\x20','878244xoFvXe','stringify','🎉\x20项目创建成功!','18DlMyva','projectCode','readFileSync','项目创建完成:\x20','\x20|\x20应用AppCode:\x20','parse','log','已自动拉取\x20✓','green','dirname','repeat','.lovrabetrc','join','lovrabet\x20config\x20set\x20app\x20[app-code]','doTask','utf8','resolve','projectName','*\x20配置文件路径:\x20','API\x20配置拉取成功:\x20','×\x20项目目录\x20','setLogPath','🚀\x20接下来可以:','2.\x20','info','warn','329036niZKqU','配置应用AppCode:\x20','lovrabet\x20api\x20pull','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','env','66ezKhbN','appCode','1.0.0','gray','error','32530ArinRU','column','262003DwZFNi','\x20配置应用AppCode:\x20','1.\x20','*\x20清理失败的项目目录:\x20','white','version','test','package.json','\x20创建配置文件','×\x20项目名过长,最多支持\x20100\x20个字符','url','API\x20配置拉取失败:\x20','拉取API配置:\x20','3.\x20','×\x20无法在当前目录创建项目,请检查目录权限','未配置','message','pullApi','📁\x20项目名称:\x20','success','toLocaleString','项目名称:\x20','*\x20正在拉取\x20API\x20配置...','cyan','rmSync','existsSync','📦\x20API配置:\x20'];a28_0x198a=function(){return _0x397946;};return a28_0x198a();}import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x816185){const _0x4727f9=a28_0x2ca5,[_0x54ff8f,_0x393b2c]=useState(![]),[_0x2db1da,_0x5de6a6]=useState(![]),[_0x846f7,_0x3653d0]=useState(null),_0x358d1c=useCopyProjectTemplate(),_0x1e7feb=useInstallDependencies(),_0x19c31e=useFormatCode(),_0x31dc34=async _0x462dbe=>{const _0x5f049a=a28_0x2ca5;if(!_0x462dbe[_0x5f049a(0xf7)]||_0x462dbe[_0x5f049a(0xf7)][_0x5f049a(0xde)]()===''){console[_0x5f049a(0x10a)](_0x5f049a(0xce));return;}const _0x5159f1=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x5159f1[_0x5f049a(0x113)](_0x462dbe['projectName'])){console['error'](_0x5f049a(0x104));return;}if(_0x462dbe[_0x5f049a(0xf7)]['length']>0x64){console['error'](_0x5f049a(0x116));return;}const _0xc9218c=a28_0x972927[_0x5f049a(0xf6)](process['cwd'](),_0x462dbe[_0x5f049a(0xf7)]);if(a28_0x438b3f[_0x5f049a(0x126)](_0xc9218c)){console[_0x5f049a(0x10a)](_0x5f049a(0xfa)+_0x462dbe['projectName']+_0x5f049a(0xd4));return;}try{const _0xada8ca=a28_0x972927['dirname'](_0xc9218c);a28_0x438b3f['accessSync'](_0xada8ca,a28_0x438b3f[_0x5f049a(0xdf)]['W_OK']);}catch(_0x56d018){console[_0x5f049a(0x10a)](_0x5f049a(0x11b));return;}_0x3653d0(_0x462dbe),_0x393b2c(!![]),logger[_0x5f049a(0xfb)](_0xc9218c),logger[_0x5f049a(0xfe)](_0x5f049a(0xd6),'开始创建项目:\x20'+_0x462dbe[_0x5f049a(0xf7)],{'projectDir':_0xc9218c,'appCode':_0x462dbe[_0x5f049a(0x107)]});try{await _0x358d1c[_0x5f049a(0xf4)](_0x462dbe[_0x5f049a(0xf7)]),await _0x1e7feb[_0x5f049a(0xf4)](_0x462dbe['projectName']),await _0x19c31e['doTask'](_0x462dbe[_0x5f049a(0xf7)]),await _0x26d741(_0x462dbe[_0x5f049a(0xf7)],_0x462dbe[_0x5f049a(0x107)]||'',_0x462dbe['env']);if(_0x462dbe[_0x5f049a(0x11e)]&&_0x462dbe[_0x5f049a(0x107)]){console[_0x5f049a(0xec)](_0x5f049a(0x123));try{const _0x42adb7=await pullApiSilent(_0x462dbe['appCode'],undefined,_0xc9218c,_0x462dbe[_0x5f049a(0x105)]);_0x42adb7?(console[_0x5f049a(0xec)]('√\x20API\x20配置拉取完成'),logger['info']('create',_0x5f049a(0xf9)+_0x462dbe[_0x5f049a(0x107)],{'projectDir':_0xc9218c,'appCode':_0x462dbe[_0x5f049a(0x107)],'env':_0x462dbe[_0x5f049a(0x105)]})):(console[_0x5f049a(0xec)]('!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger['warn']('create',_0x5f049a(0x118)+_0x462dbe[_0x5f049a(0x107)],{'projectDir':_0xc9218c,'appCode':_0x462dbe[_0x5f049a(0x107)],'env':_0x462dbe[_0x5f049a(0x105)]}));}catch(_0x55ef3b){console[_0x5f049a(0xec)](_0x5f049a(0x103)),logger[_0x5f049a(0xff)](_0x5f049a(0xd6),_0x5f049a(0xd7)+_0x462dbe[_0x5f049a(0x107)],{'projectDir':_0xc9218c,'appCode':_0x462dbe[_0x5f049a(0x107)],'env':_0x462dbe[_0x5f049a(0x105)],'error':_0x55ef3b instanceof Error?_0x55ef3b[_0x5f049a(0x11d)]:String(_0x55ef3b)});}}logger[_0x5f049a(0x120)](_0x5f049a(0xd6),_0x5f049a(0xe9)+_0x462dbe['projectName']),_0x5de6a6(!![]),_0x393b2c(![]);}catch(_0x2351e9){logger[_0x5f049a(0x10a)]('create',_0x5f049a(0xd8)+_0x462dbe[_0x5f049a(0xf7)],{'error':_0x2351e9 instanceof Error?_0x2351e9[_0x5f049a(0x11d)]:String(_0x2351e9)});try{a28_0x438b3f['existsSync'](_0xc9218c)&&(console[_0x5f049a(0xec)](_0x5f049a(0x110)+_0xc9218c),a28_0x438b3f[_0x5f049a(0x125)](_0xc9218c,{'recursive':!![],'force':!![]}));}catch(_0x8b6006){logger[_0x5f049a(0xff)]('create','清理项目目录失败:\x20'+_0xc9218c,{'error':_0x8b6006 instanceof Error?_0x8b6006['message']:String(_0x8b6006)});}_0x393b2c(![]),console['error']('×\x20项目创建失败:\x20'+(_0x2351e9 instanceof Error?_0x2351e9['message']:String(_0x2351e9)));}},_0x10d94e=async _0x1fa17a=>{const _0xa61c40=a28_0x2ca5;await _0x31dc34({'projectName':_0x1fa17a,'env':_0x816185[_0xa61c40(0x105)]});},_0x26d741=async(_0x2d8ed1,_0x5ba7f4,_0x409734)=>{const _0x12f0c0=a28_0x2ca5,_0xcdf012=a28_0x972927[_0x12f0c0(0xf6)](process[_0x12f0c0(0xd5)](),_0x2d8ed1),_0x3fed19=a28_0x972927[_0x12f0c0(0xf2)](_0xcdf012,_0x12f0c0(0xf1));try{_0x5ba7f4?console[_0x12f0c0(0xec)](_0x12f0c0(0xd9)+_0x2d8ed1+_0x12f0c0(0x10e)+_0x5ba7f4):console['log'](_0x12f0c0(0xd9)+_0x2d8ed1+_0x12f0c0(0x115));console[_0x12f0c0(0xec)](_0x12f0c0(0xf8)+_0x3fed19);const _0x577adb=fileURLToPath(import.meta[_0x12f0c0(0x117)]),_0x37f757=a28_0x972927[_0x12f0c0(0xf6)](a28_0x972927[_0x12f0c0(0xef)](_0x577adb),'../..'),_0x48cfbc=a28_0x972927[_0x12f0c0(0xf2)](_0x37f757,_0x12f0c0(0x114));let _0x136249=_0x12f0c0(0x108);try{const _0x123b7f=JSON[_0x12f0c0(0xeb)](a28_0x438b3f[_0x12f0c0(0xe8)](_0x48cfbc,_0x12f0c0(0xf5)));_0x136249=_0x123b7f[_0x12f0c0(0x112)]||_0x12f0c0(0x108);}catch(_0x343471){}const _0x238990=readConfig(),_0x2ab63b=typeof _0x238990[_0x12f0c0(0x105)]===_0x12f0c0(0xcb)?_0x238990[_0x12f0c0(0x105)]:undefined,_0x5eec83={..._0x238990,'app':_0x5ba7f4||'','env':_0x409734||_0x2ab63b||_0x12f0c0(0xcd),'createdAt':new Date()[_0x12f0c0(0x121)](),'version':_0x136249};a28_0x438b3f[_0x12f0c0(0xe1)](_0x3fed19,JSON[_0x12f0c0(0xe4)](_0x5eec83,null,0x2),_0x12f0c0(0xf5)),_0x5ba7f4?console[_0x12f0c0(0xec)](_0x12f0c0(0xd1)+_0x5ba7f4):console['log'](_0x12f0c0(0xd0)),logger[_0x12f0c0(0xfe)](_0x12f0c0(0xd6),_0x12f0c0(0x101)+_0x5ba7f4,{'projectName':_0x2d8ed1,'configFile':'.lovrabetrc'});}catch(_0xf9f080){logger[_0x12f0c0(0x10a)](_0x12f0c0(0xd6),_0x12f0c0(0xdd)+_0x5ba7f4,{'projectName':_0x2d8ed1,'error':_0xf9f080 instanceof Error?_0xf9f080[_0x12f0c0(0x11d)]:String(_0xf9f080)});}};useEffect(()=>{const _0x1eb929=a28_0x2ca5;_0x816185[_0x1eb929(0xe7)]&&_0x10d94e(_0x816185[_0x1eb929(0xe7)]);},[_0x816185[_0x4727f9(0xe7)]]);if(!_0x54ff8f&&!_0x2db1da&&!_0x816185[_0x4727f9(0xe7)])return a28_0x7caf05(EnhancedGuidedCreate,{'onCreate':_0x31dc34,'env':_0x816185[_0x4727f9(0x105)]});if(_0x54ff8f)return a28_0x586d84(a28_0x23e781,{'children':[a28_0x586d84(Box,{'marginTop':0x1,'children':[a28_0x7caf05(Box,{'width':'1'}),a28_0x7caf05(Text,{'color':_0x4727f9(0xee),'children':_0x4727f9(0xca)}),a28_0x7caf05(Text,{'children':'项目名称:\x20'}),a28_0x7caf05(Text,{'color':_0x4727f9(0xee),'children':_0x846f7?.[_0x4727f9(0xf7)]}),_0x846f7?.[_0x4727f9(0x107)]&&a28_0x586d84(a28_0x23e781,{'children':[a28_0x7caf05(Text,{'children':_0x4727f9(0xea)}),a28_0x7caf05(Text,{'color':'cyan','children':_0x846f7[_0x4727f9(0x107)]})]})]}),a28_0x7caf05(TaskRunning,{..._0x358d1c}),a28_0x7caf05(TaskRunning,{..._0x1e7feb}),a28_0x7caf05(TaskRunning,{..._0x19c31e})]});if(_0x2db1da)return a28_0x586d84(a28_0x23e781,{'children':[a28_0x586d84(Box,{'marginTop':0x1,'children':[a28_0x7caf05(Box,{'width':'1'}),a28_0x7caf05(Text,{'color':_0x4727f9(0xee),'children':_0x4727f9(0xca)}),a28_0x7caf05(Text,{'children':_0x4727f9(0x122)}),a28_0x7caf05(Text,{'color':_0x4727f9(0xee),'children':_0x846f7?.[_0x4727f9(0xf7)]}),_0x846f7?.['appCode']&&a28_0x586d84(a28_0x23e781,{'children':[a28_0x7caf05(Text,{'children':_0x4727f9(0xea)}),a28_0x7caf05(Text,{'color':'cyan','children':_0x846f7[_0x4727f9(0x107)]})]})]}),a28_0x7caf05(TaskFinished,{..._0x358d1c}),a28_0x7caf05(TaskFinished,{..._0x1e7feb}),a28_0x7caf05(TaskFinished,{..._0x19c31e}),a28_0x7caf05(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a28_0x7caf05(Text,{'color':'green','children':'─'[_0x4727f9(0xf0)](0x3c)})}),a28_0x7caf05(Box,{'children':a28_0x7caf05(Text,{'color':_0x4727f9(0xee),'bold':!![],'children':_0x4727f9(0xe5)})}),a28_0x586d84(Box,{'marginTop':0x1,'flexDirection':_0x4727f9(0x10c),'children':[a28_0x586d84(Box,{'children':[a28_0x7caf05(Text,{'color':_0x4727f9(0x124),'children':_0x4727f9(0x11f)}),a28_0x7caf05(Text,{'color':_0x4727f9(0x111),'bold':!![],'children':_0x846f7?.[_0x4727f9(0xf7)]})]}),_0x846f7?.[_0x4727f9(0x107)]&&a28_0x586d84(Box,{'children':[a28_0x7caf05(Text,{'color':'cyan','children':_0x4727f9(0xcf)}),a28_0x7caf05(Text,{'color':_0x4727f9(0x111),'bold':!![],'children':_0x846f7['appCode']})]}),a28_0x586d84(Box,{'children':[a28_0x7caf05(Text,{'color':_0x4727f9(0x124),'children':_0x4727f9(0xc9)}),_0x846f7?.['pullApi']?a28_0x7caf05(Text,{'color':'green','bold':!![],'children':_0x4727f9(0xed)}):_0x846f7?.[_0x4727f9(0x107)]?a28_0x7caf05(Text,{'color':_0x4727f9(0xdc),'bold':!![],'children':'需手动拉取'}):a28_0x7caf05(Text,{'color':'gray','bold':!![],'children':_0x4727f9(0x11c)})]})]}),a28_0x7caf05(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a28_0x7caf05(Text,{'color':'cyan','bold':!![],'children':_0x4727f9(0xfc)})}),a28_0x586d84(Box,{'marginLeft':0x2,'flexDirection':_0x4727f9(0x10c),'children':[a28_0x586d84(Box,{'children':[a28_0x7caf05(Text,{'color':'green','children':_0x4727f9(0x10f)}),a28_0x7caf05(Text,{'color':'white','children':_0x4727f9(0xe2)}),a28_0x7caf05(Text,{'color':'cyan','bold':!![],'children':'cd\x20'+_0x846f7?.[_0x4727f9(0xf7)]+'\x20&&\x20lovrabet\x20start'})]}),_0x846f7?.[_0x4727f9(0x107)]&&!_0x846f7?.[_0x4727f9(0x11e)]&&a28_0x586d84(Box,{'children':[a28_0x7caf05(Text,{'color':_0x4727f9(0xdc),'children':_0x4727f9(0xfd)}),a28_0x7caf05(Text,{'color':_0x4727f9(0x111),'children':_0x4727f9(0x119)}),a28_0x7caf05(Text,{'color':_0x4727f9(0x124),'bold':!![],'children':_0x4727f9(0x102)})]}),!_0x846f7?.[_0x4727f9(0x107)]&&a28_0x586d84(a28_0x23e781,{'children':[a28_0x586d84(Box,{'children':[a28_0x7caf05(Text,{'color':_0x4727f9(0x109),'children':_0x4727f9(0xfd)}),a28_0x7caf05(Text,{'color':_0x4727f9(0x111),'children':_0x4727f9(0xcc)}),a28_0x7caf05(Text,{'color':_0x4727f9(0x124),'bold':!![],'children':_0x4727f9(0xf3)})]}),a28_0x586d84(Box,{'children':[a28_0x7caf05(Text,{'color':_0x4727f9(0x109),'children':_0x4727f9(0x11a)}),a28_0x7caf05(Text,{'color':_0x4727f9(0x111),'children':_0x4727f9(0x119)}),a28_0x7caf05(Text,{'color':_0x4727f9(0x124),'bold':!![],'children':'lovrabet\x20api\x20pull\x20[app-code]'})]})]})]}),a28_0x7caf05(Box,{'marginTop':0x1,'children':a28_0x7caf05(Text,{'color':'green','children':'─'[_0x4727f9(0xf0)](0x3c)})})]});return null;}
|
|
1
|
+
(function(_0x39d620,_0xa67858){const _0x488463=a31_0x1051,_0x30564d=_0x39d620();while(!![]){try{const _0x505081=parseInt(_0x488463(0x120))/0x1+parseInt(_0x488463(0x126))/0x2+parseInt(_0x488463(0x10f))/0x3+parseInt(_0x488463(0x151))/0x4*(-parseInt(_0x488463(0x144))/0x5)+-parseInt(_0x488463(0x161))/0x6+parseInt(_0x488463(0x130))/0x7*(parseInt(_0x488463(0x124))/0x8)+parseInt(_0x488463(0x137))/0x9*(-parseInt(_0x488463(0x127))/0xa);if(_0x505081===_0xa67858)break;else _0x30564d['push'](_0x30564d['shift']());}catch(_0x5e2532){_0x30564d['push'](_0x30564d['shift']());}}}(a31_0x1bf7,0x95ba1));import{jsx as a31_0x262045,Fragment as a31_0x1a2da8,jsxs as a31_0x294845}from'react/jsx-runtime';import a31_0x44e2c2 from'node:path';import a31_0x3e14fe from'node:fs';function a31_0x1bf7(){const _0x565698=['setLogPath','清理项目目录失败:\x20','stringify','1107309QTBqiX','writeFileSync','parse','W_OK','8nXhGBs','√\x20API\x20配置拉取完成','1786882ZubAEE','33910JXUmDA','appCode','×\x20无法在当前目录创建项目,请检查目录权限','1.0.0','\x20√\x20','√\x20配置文件已创建,应用AppCode:\x20','📦\x20API配置:\x20','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','\x20|\x20应用AppCode:\x20','8043749yoDMJT','🔗\x20应用AppCode:\x20','white','readFileSync','\x20已存在,请使用其他项目名','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','×\x20项目名不能为空','4383ObkhEb','\x20创建配置文件','green','doTask','🎉\x20项目创建成功!','cyan','cd\x20','配置AppCode:\x20','.lovrabetrc','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','配置应用AppCode失败:\x20','API\x20配置拉取失败:\x20','gray','5269215jiQPYP','toLocaleString','package.json','API\x20配置拉取异常:\x20','*\x20正在拉取\x20API\x20配置...','string','column','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','项目名称:\x20','未配置','*\x20配置文件路径:\x20','🚀\x20接下来可以:','📁\x20项目名称:\x20','4AHcdZp','resolve','utf8','message','trim','2.\x20','pullApi','projectName','existsSync','repeat','\x20配置应用AppCode:\x20','\x20&&\x20lovrabet\x20start','error','join','拉取API配置:\x20','rmSync','4002078rYKGcm','yellow','projectCode','length','*\x20正在为项目\x20','启动项目:\x20','2507091KUAZwH','warn','log','项目创建完成:\x20','create','dirname','version','url','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','×\x20项目创建失败:\x20','×\x20项目名过长,最多支持\x20100\x20个字符','env','constants','info'];a31_0x1bf7=function(){return _0x565698;};return a31_0x1bf7();}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 a31_0x1051(_0x2181ea,_0x817120){const _0x1bf7b2=a31_0x1bf7();return a31_0x1051=function(_0x1051bc,_0x18fd6d){_0x1051bc=_0x1051bc-0x10d;let _0x50f102=_0x1bf7b2[_0x1051bc];return _0x50f102;},a31_0x1051(_0x2181ea,_0x817120);}import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0xc02973){const _0x460f6f=a31_0x1051,[_0x4eb940,_0x3977ff]=useState(![]),[_0x4e8693,_0x3ddec1]=useState(![]),[_0x4e23c6,_0x4b82bb]=useState(null),_0x38c248=useCopyProjectTemplate(),_0x441e70=useInstallDependencies(),_0x568410=useFormatCode(),_0x13390f=async _0x4ad68e=>{const _0x208c36=a31_0x1051;if(!_0x4ad68e[_0x208c36(0x158)]||_0x4ad68e['projectName'][_0x208c36(0x155)]()===''){console[_0x208c36(0x15d)](_0x208c36(0x136));return;}const _0x20263b=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x20263b['test'](_0x4ad68e[_0x208c36(0x158)])){console[_0x208c36(0x15d)](_0x208c36(0x140));return;}if(_0x4ad68e[_0x208c36(0x158)][_0x208c36(0x164)]>0x64){console[_0x208c36(0x15d)](_0x208c36(0x119));return;}const _0x3ed7e5=a31_0x44e2c2[_0x208c36(0x152)](process['cwd'](),_0x4ad68e[_0x208c36(0x158)]);if(a31_0x3e14fe[_0x208c36(0x159)](_0x3ed7e5)){console[_0x208c36(0x15d)]('×\x20项目目录\x20'+_0x4ad68e[_0x208c36(0x158)]+_0x208c36(0x134));return;}try{const _0x272694=a31_0x44e2c2[_0x208c36(0x114)](_0x3ed7e5);a31_0x3e14fe['accessSync'](_0x272694,a31_0x3e14fe[_0x208c36(0x11b)][_0x208c36(0x123)]);}catch(_0x29cd5f){console[_0x208c36(0x15d)](_0x208c36(0x129));return;}_0x4b82bb(_0x4ad68e),_0x3977ff(!![]),logger[_0x208c36(0x11d)](_0x3ed7e5),logger[_0x208c36(0x11c)](_0x208c36(0x113),'开始创建项目:\x20'+_0x4ad68e['projectName'],{'projectDir':_0x3ed7e5,'appCode':_0x4ad68e[_0x208c36(0x128)]});try{await _0x38c248[_0x208c36(0x13a)](_0x4ad68e[_0x208c36(0x158)]),await _0x441e70[_0x208c36(0x13a)](_0x4ad68e[_0x208c36(0x158)]),await _0x568410['doTask'](_0x4ad68e[_0x208c36(0x158)]),await _0x721bc3(_0x4ad68e[_0x208c36(0x158)],_0x4ad68e[_0x208c36(0x128)]||'',_0x4ad68e[_0x208c36(0x11a)]);if(_0x4ad68e[_0x208c36(0x157)]&&_0x4ad68e[_0x208c36(0x128)]){console[_0x208c36(0x111)](_0x208c36(0x148));try{const _0x461d84=await pullApiSilent(_0x4ad68e['appCode'],undefined,_0x3ed7e5,_0x4ad68e['env']);_0x461d84?(console[_0x208c36(0x111)](_0x208c36(0x125)),logger['info']('create','API\x20配置拉取成功:\x20'+_0x4ad68e['appCode'],{'projectDir':_0x3ed7e5,'appCode':_0x4ad68e['appCode'],'env':_0x4ad68e[_0x208c36(0x11a)]})):(console[_0x208c36(0x111)](_0x208c36(0x117)),logger[_0x208c36(0x110)]('create',_0x208c36(0x142)+_0x4ad68e[_0x208c36(0x128)],{'projectDir':_0x3ed7e5,'appCode':_0x4ad68e[_0x208c36(0x128)],'env':_0x4ad68e[_0x208c36(0x11a)]}));}catch(_0x1986bf){console['log'](_0x208c36(0x14b)),logger[_0x208c36(0x110)]('create',_0x208c36(0x147)+_0x4ad68e[_0x208c36(0x128)],{'projectDir':_0x3ed7e5,'appCode':_0x4ad68e[_0x208c36(0x128)],'env':_0x4ad68e['env'],'error':_0x1986bf instanceof Error?_0x1986bf['message']:String(_0x1986bf)});}}logger['success'](_0x208c36(0x113),_0x208c36(0x112)+_0x4ad68e[_0x208c36(0x158)]),_0x3ddec1(!![]),_0x3977ff(![]);}catch(_0x519594){logger[_0x208c36(0x15d)](_0x208c36(0x113),'项目创建失败:\x20'+_0x4ad68e[_0x208c36(0x158)],{'error':_0x519594 instanceof Error?_0x519594[_0x208c36(0x154)]:String(_0x519594)});try{a31_0x3e14fe[_0x208c36(0x159)](_0x3ed7e5)&&(console[_0x208c36(0x111)]('*\x20清理失败的项目目录:\x20'+_0x3ed7e5),a31_0x3e14fe[_0x208c36(0x160)](_0x3ed7e5,{'recursive':!![],'force':!![]}));}catch(_0x62f29a){logger[_0x208c36(0x110)](_0x208c36(0x113),_0x208c36(0x11e)+_0x3ed7e5,{'error':_0x62f29a instanceof Error?_0x62f29a[_0x208c36(0x154)]:String(_0x62f29a)});}_0x3977ff(![]),console[_0x208c36(0x15d)](_0x208c36(0x118)+(_0x519594 instanceof Error?_0x519594[_0x208c36(0x154)]:String(_0x519594)));}},_0x1d012e=async _0x19dc1a=>{const _0x44b7d6=a31_0x1051;await _0x13390f({'projectName':_0x19dc1a,'env':_0xc02973[_0x44b7d6(0x11a)]});},_0x721bc3=async(_0x52cfb2,_0x42d8c8,_0x53992b)=>{const _0x255d87=a31_0x1051,_0x4059ab=a31_0x44e2c2[_0x255d87(0x152)](process['cwd'](),_0x52cfb2),_0x4155b9=a31_0x44e2c2['join'](_0x4059ab,_0x255d87(0x13f));try{_0x42d8c8?console['log'](_0x255d87(0x10d)+_0x52cfb2+_0x255d87(0x15b)+_0x42d8c8):console[_0x255d87(0x111)](_0x255d87(0x10d)+_0x52cfb2+_0x255d87(0x138));console['log'](_0x255d87(0x14e)+_0x4155b9);const _0x3867d5=fileURLToPath(import.meta[_0x255d87(0x116)]),_0x73b4bc=a31_0x44e2c2[_0x255d87(0x152)](a31_0x44e2c2[_0x255d87(0x114)](_0x3867d5),'../..'),_0x4a7ece=a31_0x44e2c2[_0x255d87(0x15e)](_0x73b4bc,_0x255d87(0x146));let _0x2560a4='1.0.0';try{const _0x267626=JSON[_0x255d87(0x122)](a31_0x3e14fe[_0x255d87(0x133)](_0x4a7ece,_0x255d87(0x153)));_0x2560a4=_0x267626[_0x255d87(0x115)]||_0x255d87(0x12a);}catch(_0x1b8642){}const _0x1b0a48=readConfig(),_0x3922e5=typeof _0x1b0a48[_0x255d87(0x11a)]===_0x255d87(0x149)?_0x1b0a48[_0x255d87(0x11a)]:undefined,{app:_0x11e5fa,appcode:_0x512b26,..._0x58ee5c}=_0x1b0a48,_0x34eedd={..._0x58ee5c,'appcode':_0x42d8c8||'','env':_0x53992b||_0x3922e5||'online','createdAt':new Date()[_0x255d87(0x145)](),'version':_0x2560a4};a31_0x3e14fe[_0x255d87(0x121)](_0x4155b9,JSON[_0x255d87(0x11f)](_0x34eedd,null,0x2),_0x255d87(0x153)),_0x42d8c8?console[_0x255d87(0x111)](_0x255d87(0x12c)+_0x42d8c8):console[_0x255d87(0x111)](_0x255d87(0x12e)),logger[_0x255d87(0x11c)]('create','配置应用AppCode:\x20'+_0x42d8c8,{'projectName':_0x52cfb2,'configFile':_0x255d87(0x13f)});}catch(_0x40ff1c){logger[_0x255d87(0x15d)](_0x255d87(0x113),_0x255d87(0x141)+_0x42d8c8,{'projectName':_0x52cfb2,'error':_0x40ff1c instanceof Error?_0x40ff1c['message']:String(_0x40ff1c)});}};useEffect(()=>{const _0x12d21f=a31_0x1051;_0xc02973['projectCode']&&_0x1d012e(_0xc02973[_0x12d21f(0x163)]);},[_0xc02973[_0x460f6f(0x163)]]);if(!_0x4eb940&&!_0x4e8693&&!_0xc02973['projectCode'])return a31_0x262045(EnhancedGuidedCreate,{'onCreate':_0x13390f,'env':_0xc02973[_0x460f6f(0x11a)]});if(_0x4eb940)return a31_0x294845(a31_0x1a2da8,{'children':[a31_0x294845(Box,{'marginTop':0x1,'children':[a31_0x262045(Box,{'width':'1'}),a31_0x262045(Text,{'color':_0x460f6f(0x139),'children':_0x460f6f(0x12b)}),a31_0x262045(Text,{'children':_0x460f6f(0x14c)}),a31_0x262045(Text,{'color':'green','children':_0x4e23c6?.['projectName']}),_0x4e23c6?.[_0x460f6f(0x128)]&&a31_0x294845(a31_0x1a2da8,{'children':[a31_0x262045(Text,{'children':_0x460f6f(0x12f)}),a31_0x262045(Text,{'color':_0x460f6f(0x13c),'children':_0x4e23c6[_0x460f6f(0x128)]})]})]}),a31_0x262045(TaskRunning,{..._0x38c248}),a31_0x262045(TaskRunning,{..._0x441e70}),a31_0x262045(TaskRunning,{..._0x568410})]});if(_0x4e8693)return a31_0x294845(a31_0x1a2da8,{'children':[a31_0x294845(Box,{'marginTop':0x1,'children':[a31_0x262045(Box,{'width':'1'}),a31_0x262045(Text,{'color':_0x460f6f(0x139),'children':_0x460f6f(0x12b)}),a31_0x262045(Text,{'children':'项目名称:\x20'}),a31_0x262045(Text,{'color':_0x460f6f(0x139),'children':_0x4e23c6?.[_0x460f6f(0x158)]}),_0x4e23c6?.[_0x460f6f(0x128)]&&a31_0x294845(a31_0x1a2da8,{'children':[a31_0x262045(Text,{'children':_0x460f6f(0x12f)}),a31_0x262045(Text,{'color':'cyan','children':_0x4e23c6[_0x460f6f(0x128)]})]})]}),a31_0x262045(TaskFinished,{..._0x38c248}),a31_0x262045(TaskFinished,{..._0x441e70}),a31_0x262045(TaskFinished,{..._0x568410}),a31_0x262045(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a31_0x262045(Text,{'color':_0x460f6f(0x139),'children':'─'[_0x460f6f(0x15a)](0x3c)})}),a31_0x262045(Box,{'children':a31_0x262045(Text,{'color':_0x460f6f(0x139),'bold':!![],'children':_0x460f6f(0x13b)})}),a31_0x294845(Box,{'marginTop':0x1,'flexDirection':_0x460f6f(0x14a),'children':[a31_0x294845(Box,{'children':[a31_0x262045(Text,{'color':'cyan','children':_0x460f6f(0x150)}),a31_0x262045(Text,{'color':_0x460f6f(0x132),'bold':!![],'children':_0x4e23c6?.['projectName']})]}),_0x4e23c6?.['appCode']&&a31_0x294845(Box,{'children':[a31_0x262045(Text,{'color':_0x460f6f(0x13c),'children':_0x460f6f(0x131)}),a31_0x262045(Text,{'color':_0x460f6f(0x132),'bold':!![],'children':_0x4e23c6['appCode']})]}),a31_0x294845(Box,{'children':[a31_0x262045(Text,{'color':'cyan','children':_0x460f6f(0x12d)}),_0x4e23c6?.[_0x460f6f(0x157)]?a31_0x262045(Text,{'color':_0x460f6f(0x139),'bold':!![],'children':'已自动拉取\x20✓'}):_0x4e23c6?.[_0x460f6f(0x128)]?a31_0x262045(Text,{'color':'yellow','bold':!![],'children':'需手动拉取'}):a31_0x262045(Text,{'color':_0x460f6f(0x143),'bold':!![],'children':_0x460f6f(0x14d)})]})]}),a31_0x262045(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a31_0x262045(Text,{'color':_0x460f6f(0x13c),'bold':!![],'children':_0x460f6f(0x14f)})}),a31_0x294845(Box,{'marginLeft':0x2,'flexDirection':_0x460f6f(0x14a),'children':[a31_0x294845(Box,{'children':[a31_0x262045(Text,{'color':'green','children':'1.\x20'}),a31_0x262045(Text,{'color':_0x460f6f(0x132),'children':_0x460f6f(0x10e)}),a31_0x262045(Text,{'color':_0x460f6f(0x13c),'bold':!![],'children':_0x460f6f(0x13d)+_0x4e23c6?.['projectName']+_0x460f6f(0x15c)})]}),_0x4e23c6?.[_0x460f6f(0x128)]&&!_0x4e23c6?.['pullApi']&&a31_0x294845(Box,{'children':[a31_0x262045(Text,{'color':_0x460f6f(0x162),'children':'2.\x20'}),a31_0x262045(Text,{'color':_0x460f6f(0x132),'children':_0x460f6f(0x15f)}),a31_0x262045(Text,{'color':_0x460f6f(0x13c),'bold':!![],'children':'lovrabet\x20api\x20pull'})]}),!_0x4e23c6?.[_0x460f6f(0x128)]&&a31_0x294845(a31_0x1a2da8,{'children':[a31_0x294845(Box,{'children':[a31_0x262045(Text,{'color':_0x460f6f(0x143),'children':_0x460f6f(0x156)}),a31_0x262045(Text,{'color':_0x460f6f(0x132),'children':_0x460f6f(0x13e)}),a31_0x262045(Text,{'color':'cyan','bold':!![],'children':'lovrabet\x20config\x20set\x20appcode\x20[app-code]'})]}),a31_0x294845(Box,{'children':[a31_0x262045(Text,{'color':_0x460f6f(0x143),'children':'3.\x20'}),a31_0x262045(Text,{'color':_0x460f6f(0x132),'children':'拉取API配置:\x20'}),a31_0x262045(Text,{'color':_0x460f6f(0x13c),'bold':!![],'children':_0x460f6f(0x135)})]})]})]}),a31_0x262045(Box,{'marginTop':0x1,'children':a31_0x262045(Text,{'color':_0x460f6f(0x139),'children':'─'[_0x460f6f(0x15a)](0x3c)})})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x7b760c,_0x472566){var _0x1f18d6=a32_0x338f,_0x3be975=_0x7b760c();while(!![]){try{var _0x45784a=parseInt(_0x1f18d6(0x1ef))/0x1*(-parseInt(_0x1f18d6(0x1ea))/0x2)+parseInt(_0x1f18d6(0x1ed))/0x3*(-parseInt(_0x1f18d6(0x1f0))/0x4)+-parseInt(_0x1f18d6(0x1e8))/0x5*(parseInt(_0x1f18d6(0x1f1))/0x6)+-parseInt(_0x1f18d6(0x1e9))/0x7+-parseInt(_0x1f18d6(0x1eb))/0x8*(-parseInt(_0x1f18d6(0x1e6))/0x9)+parseInt(_0x1f18d6(0x1ee))/0xa*(parseInt(_0x1f18d6(0x1e5))/0xb)+parseInt(_0x1f18d6(0x1ec))/0xc;if(_0x45784a===_0x472566)break;else _0x3be975['push'](_0x3be975['shift']());}catch(_0x362af3){_0x3be975['push'](_0x3be975['shift']());}}}(a32_0x158e,0x8d37d));function a32_0x338f(_0x503638,_0xa05f69){var _0x158e9a=a32_0x158e();return a32_0x338f=function(_0x338f9b,_0x2c4cc0){_0x338f9b=_0x338f9b-0x1e5;var _0x223733=_0x158e9a[_0x338f9b];return _0x223733;},a32_0x338f(_0x503638,_0xa05f69);}import{jsx as a32_0x5c1d55,jsxs as a32_0x50c558}from'react/jsx-runtime';function a32_0x158e(){var _0x4ff3c7=['66kyjDHa','264zYtxkL','297WBDDiW','\x20√\x20','154885IZmbyO','6373500ktqzFY','201746ztwyED','97136HJbTUZ','16053036ZLvhoq','51ulprVS','334550WZeTzk','1ihaOFs','143720VOTgMG'];a32_0x158e=function(){return _0x4ff3c7;};return a32_0x158e();}import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';export function TaskFinished(_0x347e41){var _0x220da8=a32_0x338f;return a32_0x50c558(Box,{'children':[a32_0x5c1d55(Box,{'width':'1'}),a32_0x5c1d55(Text,{'color':'green','children':_0x220da8(0x1e7)}),a32_0x5c1d55(Text,{'children':_0x347e41['taskName']}),a32_0x5c1d55(TaskTime,{'elapsed':_0x347e41['elapsed']})]});}
|