@lovrabet/cli 1.1.7 → 1.1.9
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/LICENSE +45 -0
- package/README.md +85 -4
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/format-dataset.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/api/pull.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +2 -2
- package/templates/projects/sub-app-react-demo/package-lock.json +4 -4
- package/templates/projects/sub-app-react-demo/package.json +1 -1
package/lib/auth/auth-server.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a11_0xefd9c8=a11_0x11da;(function(_0xc0595f,_0x285de1){const _0x2416f3=a11_0x11da,_0x401340=_0xc0595f();while(!![]){try{const _0x3fc8c0=parseInt(_0x2416f3(0x130))/0x1+parseInt(_0x2416f3(0x11c))/0x2+parseInt(_0x2416f3(0x109))/0x3+-parseInt(_0x2416f3(0x12f))/0x4*(parseInt(_0x2416f3(0x10f))/0x5)+parseInt(_0x2416f3(0x124))/0x6*(parseInt(_0x2416f3(0x12d))/0x7)+-parseInt(_0x2416f3(0x12a))/0x8*(parseInt(_0x2416f3(0x113))/0x9)+parseInt(_0x2416f3(0x10d))/0xa*(-parseInt(_0x2416f3(0x108))/0xb);if(_0x3fc8c0===_0x285de1)break;else _0x401340['push'](_0x401340['shift']());}catch(_0x4bc584){_0x401340['push'](_0x401340['shift']());}}}(a11_0x336f,0x5835e));function a11_0x336f(){const _0x8dc609=['then','✅\x20浏览器已自动打开,请在浏览器中完成登录','object','main','close','user','Auth\x20server\x20error:','216000fAylkn','end','text/html;\x20charset=utf-8','127.0.0.1','listen','🔐\x20正在启动登录服务...','💡\x20如果浏览器没有自动打开,请手动复制上面的登录地址到浏览器中打开','writeHead','519744SeNJKa','darwin','platform','log','https://dev.lovrabet.com:','address','528qNaids','error','win32','56VKUxTd','⚠️\x20\x20无法自动打开浏览器','32SVZQkG','708308lsGSka','headers','catch','📍\x20登录地址:','start\x20\x22\x22\x20\x22','🔗\x20请手动复制登录地址到浏览器:','3798421NFhqJH','1281894IzZlzw','silent','xdg-open\x20\x22','https://g.yuntooai.com/cert/lovrabet-dev.json','20nuRgSk','createServer','357515ycNTST','session','<!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>','/sign-in?redirect=','42633ehVtTR','json'];a11_0x336f=function(){return _0x8dc609;};return a11_0x336f();}import{writeFileSync}from'node:fs';function a11_0x11da(_0x58db24,_0x29e815){const _0x336f9f=a11_0x336f();return a11_0x11da=function(_0x11da81,_0x370710){_0x11da81=_0x11da81-0x104;let _0x4d3831=_0x336f9f[_0x11da81];return _0x4d3831;},a11_0x11da(_0x58db24,_0x29e815);}import a11_0x2f81b8 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(_0x2eeeba){const _0x2e2ee1=a11_0x11da,_0x16890d=_0x2eeeba?.[_0x2e2ee1(0x10a)]||![];if(await getIsSessionValid())return!![];const _0x2d448c=await(await fetch(_0x2e2ee1(0x10c)))[_0x2e2ee1(0x114)]();return new Promise(async(_0x37668f,_0x49be59)=>{const _0x4bebf4=_0x2e2ee1;let _0xd1f350=0x0;const _0x4da91e=a11_0x2f81b8[_0x4bebf4(0x10e)](_0x2d448c,async(_0x469832,_0x20a387)=>{const _0x137631=_0x4bebf4,_0x4684f0=getUserDomain(),_0x395179=_0x469832[_0x137631(0x131)]['cookie']||'',_0x52f465=await fetch(_0x4684f0+'/api/auth/get-session',{'headers':{'cookie':_0x395179}})['then'](_0x104182=>_0x104182[_0x137631(0x114)]()),_0x573fb6=_0x52f465&&_0x52f465[_0x137631(0x110)]&&_0x52f465[_0x137631(0x11a)];if(_0x573fb6){writeFileSync(cookieFile,_0x395179,'utf-8'),_0x37668f(!![]);const _0x4141cd=_0x137631(0x111);_0x20a387[_0x137631(0x123)](0xc8,{'Content-Type':_0x137631(0x11e)}),_0x20a387['end'](_0x4141cd),_0x4da91e[_0x137631(0x119)]();}else{const _0x2fb2e6=''+encodeURIComponent(_0x137631(0x128)+_0xd1f350);_0x20a387[_0x137631(0x123)](0x12e,{'location':_0x4684f0+_0x137631(0x112)+_0x2fb2e6}),_0x20a387[_0x137631(0x11d)]();return;}});_0x4da91e[_0x4bebf4(0x120)](0x0,_0x4bebf4(0x11f),()=>{const _0x5aa5f9=_0x4bebf4,_0x54ee87=_0x4da91e[_0x5aa5f9(0x129)]();_0xd1f350=typeof _0x54ee87===_0x5aa5f9(0x117)&&_0x54ee87?_0x54ee87['port']:Number(_0x54ee87);const _0x4ab59d=_0x5aa5f9(0x128)+_0xd1f350;!_0x16890d&&(console[_0x5aa5f9(0x127)](_0x5aa5f9(0x121)),console[_0x5aa5f9(0x127)](_0x5aa5f9(0x105),_0x4ab59d),console[_0x5aa5f9(0x127)]('🌐\x20正在尝试自动打开浏览器...'),console[_0x5aa5f9(0x127)](''),console[_0x5aa5f9(0x127)](_0x5aa5f9(0x122)),console[_0x5aa5f9(0x127)]('')),openInBrowser(_0x4ab59d)[_0x5aa5f9(0x115)](_0x210dfe=>{const _0x49437f=_0x5aa5f9;!_0x16890d&&(_0x210dfe?console['log'](_0x49437f(0x116)):(console[_0x49437f(0x127)]('⚠️\x20\x20无法自动打开浏览器'),console[_0x49437f(0x127)](_0x49437f(0x107),_0x4ab59d)),console[_0x49437f(0x127)](''));})[_0x5aa5f9(0x104)](()=>{const _0x170d1b=_0x5aa5f9;!_0x16890d&&(console['log'](_0x170d1b(0x12e)),console[_0x170d1b(0x127)](_0x170d1b(0x107),_0x4ab59d),console[_0x170d1b(0x127)](''));});}),_0x4da91e['on'](_0x4bebf4(0x12b),_0xf9a4d5=>{const _0x4e4ef3=_0x4bebf4;!_0x16890d&&console[_0x4e4ef3(0x12b)](_0x4e4ef3(0x11b),_0xf9a4d5),_0x49be59(_0xf9a4d5);});});}function openInBrowser(_0x177d5f){return new Promise(_0x539325=>{const _0xc7e635=a11_0x11da,_0x59126e=process[_0xc7e635(0x126)];let _0x580f96;if(_0x59126e===_0xc7e635(0x12c))_0x580f96=_0xc7e635(0x106)+_0x177d5f+'\x22';else _0x59126e===_0xc7e635(0x125)?_0x580f96='open\x20\x22'+_0x177d5f+'\x22':_0x580f96=_0xc7e635(0x10b)+_0x177d5f+'\x22';exec(_0x580f96,_0x289d4d=>{_0x289d4d?_0x539325(![]):_0x539325(!![]);});});}if(import.meta[a11_0xefd9c8(0x118)]){const isAuth=await authServer();console[a11_0xefd9c8(0x127)]('isAuth',isAuth);}
|
package/lib/auth/constant.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a12_0x2e71ee=a12_0x2f5e;(function(_0x3d6b06,_0x173c92){const _0x1c38f1=a12_0x2f5e,_0x27d5ec=_0x3d6b06();while(!![]){try{const _0x20fe0c=-parseInt(_0x1c38f1(0x1cd))/0x1+parseInt(_0x1c38f1(0x1d2))/0x2*(parseInt(_0x1c38f1(0x1d3))/0x3)+parseInt(_0x1c38f1(0x1d5))/0x4*(parseInt(_0x1c38f1(0x1d6))/0x5)+parseInt(_0x1c38f1(0x1d0))/0x6*(parseInt(_0x1c38f1(0x1ce))/0x7)+parseInt(_0x1c38f1(0x1d4))/0x8+-parseInt(_0x1c38f1(0x1d1))/0x9+-parseInt(_0x1c38f1(0x1cf))/0xa*(parseInt(_0x1c38f1(0x1d7))/0xb);if(_0x20fe0c===_0x173c92)break;else _0x27d5ec['push'](_0x27d5ec['shift']());}catch(_0x5435a5){_0x27d5ec['push'](_0x27d5ec['shift']());}}}(a12_0x3714,0x1c37c));import{mkdirSync}from'node:fs';import{homedir}from'node:os';export const configDir=homedir()+'/.lovrabet';export const cookieFile=configDir+a12_0x2e71ee(0x1d8);function a12_0x3714(){const _0x55bea5=['4AqvfRI','741745CttQMb','219956EBLQVq','/cookie','13868XnVEMi','78337HdXePQ','100xVakEn','30nmMMCS','816102kejcAC','12nJMmdX','80892NqwAJE','431984lkmXMj'];a12_0x3714=function(){return _0x55bea5;};return a12_0x3714();}function a12_0x2f5e(_0x2b3e5e,_0xcc4cc7){const _0x3714a3=a12_0x3714();return a12_0x2f5e=function(_0x2f5eb7,_0x4d0e92){_0x2f5eb7=_0x2f5eb7-0x1cd;let _0x511869=_0x3714a3[_0x2f5eb7];return _0x511869;},a12_0x2f5e(_0x2b3e5e,_0xcc4cc7);}mkdirSync(configDir,{'recursive':!![]});
|
package/lib/auth/get-cookie.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3746c4,_0x4e8191){var _0x5cdffd=a13_0x48f0,_0x545f15=_0x3746c4();while(!![]){try{var _0x38629a=parseInt(_0x5cdffd(0xc8))/0x1+-parseInt(_0x5cdffd(0xc2))/0x2*(parseInt(_0x5cdffd(0xc1))/0x3)+-parseInt(_0x5cdffd(0xc4))/0x4+-parseInt(_0x5cdffd(0xc3))/0x5+-parseInt(_0x5cdffd(0xc0))/0x6+-parseInt(_0x5cdffd(0xc5))/0x7*(-parseInt(_0x5cdffd(0xc7))/0x8)+parseInt(_0x5cdffd(0xca))/0x9*(parseInt(_0x5cdffd(0xc6))/0xa);if(_0x38629a===_0x4e8191)break;else _0x545f15['push'](_0x545f15['shift']());}catch(_0x1443b3){_0x545f15['push'](_0x545f15['shift']());}}}(a13_0x32c1,0x25aab));function a13_0x48f0(_0xaa112f,_0x328ac4){var _0x32c18a=a13_0x32c1();return a13_0x48f0=function(_0x48f085,_0x3222ad){_0x48f085=_0x48f085-0xc0;var _0x844851=_0x32c18a[_0x48f085];return _0x844851;},a13_0x48f0(_0xaa112f,_0x328ac4);}import{readFileSync}from'node:fs';import{cookieFile}from'./constant.js';function a13_0x32c1(){var _0x275450=['11694uShcoD','98sveUtw','927425gsIvnU','1035892qYGkSr','56567VYSpcx','10uwLJMb','8oCQXyM','215373QWUPMX','utf-8','5861556dXQkjL','509970HmVYds'];a13_0x32c1=function(){return _0x275450;};return a13_0x32c1();}export function getCookie(){var _0x8b5362=a13_0x48f0;try{return readFileSync(cookieFile,_0x8b5362(0xc9));}catch{}return'';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a14_0x33cd(){const _0x31fbdd=['then','/api/auth/get-session','1226tLZXqY','user','476RaRKiK','json','session','1761910zZpLiR','167hDFwMI','7378656KJYrxg','11fUFjnk','utf-8','16FPlURJ','999198gvispJ','1145dkfHmd','36ivBnPJ','213479HxdlIg','762150zpcjcw'];a14_0x33cd=function(){return _0x31fbdd;};return a14_0x33cd();}(function(_0x1f951d,_0x2ca05c){const _0x1dfdff=a14_0x4ff8,_0x5c6d37=_0x1f951d();while(!![]){try{const _0x4a6d91=-parseInt(_0x1dfdff(0xd1))/0x1*(-parseInt(_0x1dfdff(0xcb))/0x2)+-parseInt(_0x1dfdff(0xc8))/0x3+parseInt(_0x1dfdff(0xcd))/0x4*(-parseInt(_0x1dfdff(0xc5))/0x5)+-parseInt(_0x1dfdff(0xc6))/0x6*(-parseInt(_0x1dfdff(0xc7))/0x7)+parseInt(_0x1dfdff(0xd5))/0x8*(-parseInt(_0x1dfdff(0xc4))/0x9)+parseInt(_0x1dfdff(0xd0))/0xa*(-parseInt(_0x1dfdff(0xd3))/0xb)+parseInt(_0x1dfdff(0xd2))/0xc;if(_0x4a6d91===_0x2ca05c)break;else _0x5c6d37['push'](_0x5c6d37['shift']());}catch(_0x294834){_0x5c6d37['push'](_0x5c6d37['shift']());}}}(a14_0x33cd,0x35e21));import{existsSync,readFileSync}from'node:fs';import{getUserDomain}from'../constant/domain.js';function a14_0x4ff8(_0x2e3933,_0x58cdc6){const _0x33cd04=a14_0x33cd();return a14_0x4ff8=function(_0x4ff8fc,_0x4315b5){_0x4ff8fc=_0x4ff8fc-0xc4;let _0x45dfb4=_0x33cd04[_0x4ff8fc];return _0x45dfb4;},a14_0x4ff8(_0x2e3933,_0x58cdc6);}import{cookieFile}from'./constant.js';export async function getIsSessionValid(){const _0x243bec=a14_0x4ff8;try{if(!existsSync(cookieFile))return![];const _0xd0bcc0=readFileSync(cookieFile,_0x243bec(0xd4)),_0x560e72=await fetch(getUserDomain()+_0x243bec(0xca),{'headers':{'cookie':_0xd0bcc0}})[_0x243bec(0xc9)](_0x17e754=>_0x17e754[_0x243bec(0xce)]());return _0x560e72&&_0x560e72[_0x243bec(0xcf)]&&_0x560e72[_0x243bec(0xcc)];}catch{}return![];}
|
package/lib/auth/logout.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1bf359,_0x454f02){var _0x3eb964=a15_0x2b3b,_0x43ead6=_0x1bf359();while(!![]){try{var _0x51e230=parseInt(_0x3eb964(0x8f))/0x1+parseInt(_0x3eb964(0x93))/0x2+parseInt(_0x3eb964(0x89))/0x3+parseInt(_0x3eb964(0x94))/0x4+-parseInt(_0x3eb964(0x8d))/0x5*(parseInt(_0x3eb964(0x91))/0x6)+parseInt(_0x3eb964(0x8a))/0x7*(-parseInt(_0x3eb964(0x90))/0x8)+parseInt(_0x3eb964(0x8e))/0x9*(-parseInt(_0x3eb964(0x92))/0xa);if(_0x51e230===_0x454f02)break;else _0x43ead6['push'](_0x43ead6['shift']());}catch(_0x310d2d){_0x43ead6['push'](_0x43ead6['shift']());}}}(a15_0xb0ec,0x92833));import{unlinkSync,existsSync}from'node:fs';import{cookieFile}from'./constant.js';export function logout(){var _0x5cce91=a15_0x2b3b;existsSync(cookieFile)?(unlinkSync(cookieFile),console[_0x5cce91(0x8b)](_0x5cce91(0x8c))):console[_0x5cce91(0x8b)]('!\x20当前未登录');}function a15_0x2b3b(_0x1a6f32,_0x2ff6ea){var _0xb0ec89=a15_0xb0ec();return a15_0x2b3b=function(_0x2b3ba1,_0x301ea3){_0x2b3ba1=_0x2b3ba1-0x89;var _0x2af99d=_0xb0ec89[_0x2b3ba1];return _0x2af99d;},a15_0x2b3b(_0x1a6f32,_0x2ff6ea);}function a15_0xb0ec(){var _0x3cda3f=['log','✓\x20已退出登录','5894465wJVVFv','18klFKuK','701551isDKhQ','50672CNIuxu','6Pvefwy','1985450QVMStO','1817822ILfYun','512664lniMej','1559436PsRUib','91QIshEj'];a15_0xb0ec=function(){return _0x3cda3f;};return a15_0xb0ec();}
|
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
const
|
|
2
|
+
const a16_0x5456f1=a16_0x4236;(function(_0x546a24,_0x4d1e2f){const _0x82cf60=a16_0x4236,_0x199f40=_0x546a24();while(!![]){try{const _0x2a9972=parseInt(_0x82cf60(0xa6))/0x1*(parseInt(_0x82cf60(0xa2))/0x2)+-parseInt(_0x82cf60(0xac))/0x3*(-parseInt(_0x82cf60(0xb9))/0x4)+parseInt(_0x82cf60(0xae))/0x5*(-parseInt(_0x82cf60(0xa5))/0x6)+-parseInt(_0x82cf60(0x9e))/0x7*(-parseInt(_0x82cf60(0xbd))/0x8)+parseInt(_0x82cf60(0xaf))/0x9*(parseInt(_0x82cf60(0xbe))/0xa)+parseInt(_0x82cf60(0xb2))/0xb+parseInt(_0x82cf60(0xb0))/0xc*(-parseInt(_0x82cf60(0x9d))/0xd);if(_0x2a9972===_0x4d1e2f)break;else _0x199f40['push'](_0x199f40['shift']());}catch(_0x2b071d){_0x199f40['push'](_0x199f40['shift']());}}}(a16_0x3981,0x202bd));import{jsx as a16_0x120b84}from'react/jsx-runtime';import a16_0x56e1f9 from'meow';import{render}from'ink';import{CreateApp}from'./create-app/main.js';import{AddPage}from'./add-page/main.js';import{runStart}from'./cmd/start.js';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';function a16_0x3981(){const _0x4586b6=['501VlyrVL','setLogPath','1087195jzzchS','9noFmla','12DpmXMm','page','250239yUhVDP','logs','input','string','all','trim','config','5812TVJytF','cwd','boolean','start','277584mbHWqF','879640oWQOJp','error','1234246YVaAdP','14ilXNYl','auth','add','api','42788bQLLix','preview','env','6uOhnrQ','1UQsljv','logout','watch','flags','build','exit'];a16_0x3981=function(){return _0x4586b6;};return a16_0x3981();}import{Help}from'./help.js';function a16_0x4236(_0x30e727,_0x1c20cf){const _0x39816a=a16_0x3981();return a16_0x4236=function(_0x42369c,_0x222fd1){_0x42369c=_0x42369c-0x9d;let _0x40b318=_0x39816a[_0x42369c];return _0x40b318;},a16_0x4236(_0x30e727,_0x1c20cf);}import{logger}from'./utils/logger.js';import{showLogs,clearLogs}from'./cmd/logs.js';const cli=a16_0x56e1f9('\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\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',{'importMeta':import.meta,'flags':{'name':{'type':a16_0x5456f1(0xb5)},'clear':{'type':'boolean'},'env':{'type':a16_0x5456f1(0xb5)},'watch':{'type':a16_0x5456f1(0xbb)},'help':{'type':'boolean'},'appcode':{'type':a16_0x5456f1(0xb5)},'output':{'type':a16_0x5456f1(0xb5)}}});await run();async function run(){const _0x4343a1=a16_0x5456f1,_0x38bca4=cli[_0x4343a1(0xb4)][0x0];switch(_0x38bca4){case'create':{const _0x5ad1cc=cli[_0x4343a1(0xb4)][0x1]?.[_0x4343a1(0xb7)](),_0x24f470=cli['flags'][_0x4343a1(0xa4)];render(a16_0x120b84(CreateApp,{'projectCode':_0x5ad1cc,'env':_0x24f470}));break;}case _0x4343a1(0xa0):{cli[_0x4343a1(0xb4)][0x1]===_0x4343a1(0xb1)&&(logger[_0x4343a1(0xad)](process['cwd']()),render(a16_0x120b84(AddPage,{})));break;}case _0x4343a1(0xbc):{try{logger[_0x4343a1(0xad)](process[_0x4343a1(0xba)]()),await runStart();}catch(_0x45c3be){console['error'](_0x45c3be),process[_0x4343a1(0xab)](0x1);}break;}case _0x4343a1(0xaa):{try{logger[_0x4343a1(0xad)](process[_0x4343a1(0xba)]()),await runBuild();}catch(_0x23d71e){console[_0x4343a1(0xbf)](_0x23d71e),process['exit'](0x1);}break;}case _0x4343a1(0xa3):{const _0x36ddf5=cli[_0x4343a1(0xa9)][_0x4343a1(0xa8)];logger[_0x4343a1(0xad)](process[_0x4343a1(0xba)]());if(_0x36ddf5)try{await Promise[_0x4343a1(0xb6)]([runBuildWatch(),runPreview()]);}catch(_0x4215c3){console[_0x4343a1(0xbf)](_0x4215c3),process[_0x4343a1(0xab)](0x1);}else try{await runPreview();}catch(_0x37e011){console[_0x4343a1(0xbf)](_0x37e011),process[_0x4343a1(0xab)](0x1);}break;}case _0x4343a1(0xb8):{render(a16_0x120b84(Config,{'cli':cli}));break;}case _0x4343a1(0xa1):{await apiCli(cli);break;}case _0x4343a1(0x9f):{render(a16_0x120b84(AuthServer,{}));break;}case _0x4343a1(0xa7):{logout();break;}case _0x4343a1(0xb3):{cli[_0x4343a1(0xa9)]['clear']?clearLogs():showLogs();break;}default:render(a16_0x120b84(Help,{}));break;}}
|
package/lib/cmd/build-watch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a17_0x7b02(_0x53864e,_0x73c613){const _0x476386=a17_0x4763();return a17_0x7b02=function(_0x7b022e,_0x3dfec3){_0x7b022e=_0x7b022e-0x1c4;let _0xe8f1bd=_0x476386[_0x7b022e];return _0xe8f1bd;},a17_0x7b02(_0x53864e,_0x73c613);}(function(_0x3c3743,_0x1bc56c){const _0x1cbf8d=a17_0x7b02,_0x5a6089=_0x3c3743();while(!![]){try{const _0x863cc0=parseInt(_0x1cbf8d(0x1c9))/0x1+parseInt(_0x1cbf8d(0x1ca))/0x2*(-parseInt(_0x1cbf8d(0x1ce))/0x3)+parseInt(_0x1cbf8d(0x1d3))/0x4+-parseInt(_0x1cbf8d(0x1d4))/0x5+-parseInt(_0x1cbf8d(0x1cb))/0x6*(-parseInt(_0x1cbf8d(0x1d6))/0x7)+parseInt(_0x1cbf8d(0x1c7))/0x8*(-parseInt(_0x1cbf8d(0x1cd))/0x9)+-parseInt(_0x1cbf8d(0x1d5))/0xa*(-parseInt(_0x1cbf8d(0x1cf))/0xb);if(_0x863cc0===_0x1bc56c)break;else _0x5a6089['push'](_0x5a6089['shift']());}catch(_0x2d7b43){_0x5a6089['push'](_0x5a6089['shift']());}}}(a17_0x4763,0xbf35f));import{spawn}from'node:child_process';function a17_0x4763(){const _0x42080c=['294330qhsgvc','--watch','15894JpwzCn','6cpodcv','14375735PNDmHp','error','node_modules','PATH','1038684FmpEqc','1063600gZoBCA','10KyGtUJ','140dZmEwd','.bin','cwd','npm\x20run\x20build\x20exited\x20with\x20code\x20','close','5472nGnJVK','build','736745RTHipO','1080538bttfTQ'];a17_0x4763=function(){return _0x42080c;};return a17_0x4763();}import{delimiter,join}from'node:path';export function runBuildWatch(){return new Promise((_0x159938,_0x49e8e7)=>{const _0x3f5f20=a17_0x7b02,_0x1065d9=spawn('vite',[_0x3f5f20(0x1c8),_0x3f5f20(0x1cc)],{'stdio':'inherit','shell':!![],'env':{...process['env'],'PATH':''+join(process[_0x3f5f20(0x1c4)](),_0x3f5f20(0x1d1),_0x3f5f20(0x1d7))+delimiter+process['env'][_0x3f5f20(0x1d2)]}});_0x1065d9['on'](_0x3f5f20(0x1c6),_0x5d9925=>{const _0x1fdaa6=_0x3f5f20;if(_0x5d9925===0x0||_0x5d9925===null)_0x159938();else _0x49e8e7(new Error(_0x1fdaa6(0x1c5)+_0x5d9925));}),_0x1065d9['on'](_0x3f5f20(0x1d0),_0x49e8e7);});}
|
package/lib/cmd/build.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x199ff7,_0x49115b){const _0x1d2c57=a18_0x5a48,_0x4ea1d1=_0x199ff7();while(!![]){try{const _0x2baac1=parseInt(_0x1d2c57(0x193))/0x1+-parseInt(_0x1d2c57(0x1ab))/0x2*(-parseInt(_0x1d2c57(0x19b))/0x3)+-parseInt(_0x1d2c57(0x197))/0x4+-parseInt(_0x1d2c57(0x1a7))/0x5+-parseInt(_0x1d2c57(0x1a1))/0x6*(-parseInt(_0x1d2c57(0x18f))/0x7)+parseInt(_0x1d2c57(0x19d))/0x8*(-parseInt(_0x1d2c57(0x192))/0x9)+parseInt(_0x1d2c57(0x1a2))/0xa*(-parseInt(_0x1d2c57(0x19a))/0xb);if(_0x2baac1===_0x49115b)break;else _0x4ea1d1['push'](_0x4ea1d1['shift']());}catch(_0x299b03){_0x4ea1d1['push'](_0x4ea1d1['shift']());}}}(a18_0x4e3b,0x88679));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runBuild(){return new Promise((_0x577198,_0x25a721)=>{const _0x402cdb=a18_0x5a48,_0x64e2f3=Date[_0x402cdb(0x1a5)]();logger[_0x402cdb(0x1a3)](_0x402cdb(0x1a9),_0x402cdb(0x1ac),{'command':_0x402cdb(0x199)});let _0x336a8b='';const _0x5adabd=spawn(_0x402cdb(0x1a0),[_0x402cdb(0x1aa),_0x402cdb(0x1a9)],{'stdio':[_0x402cdb(0x190),'inherit','pipe'],'shell':!![],'env':{...process['env'],'PATH':''+join(process[_0x402cdb(0x1a6)](),_0x402cdb(0x191),_0x402cdb(0x1ae))+delimiter+process['env'][_0x402cdb(0x19e)]}});_0x5adabd[_0x402cdb(0x1a4)]?.['on']('data',_0x358256=>{const _0x5e5528=_0x402cdb;_0x336a8b+=_0x358256[_0x5e5528(0x195)]();}),_0x5adabd['on'](_0x402cdb(0x1a8),_0x2fb30f=>{const _0x21a9d8=_0x402cdb,_0xb0f38a=Date['now']()-_0x64e2f3;if(_0x2fb30f===0x0||_0x2fb30f===null)logger['success'](_0x21a9d8(0x1a9),_0x21a9d8(0x198),_0xb0f38a),_0x577198();else{const _0x697afa={'exitCode':_0x2fb30f,'duration':_0xb0f38a,'command':_0x21a9d8(0x199),'cwd':process[_0x21a9d8(0x1a6)]()};_0x336a8b['trim']()&&(_0x697afa[_0x21a9d8(0x1a4)]=_0x336a8b[_0x21a9d8(0x19f)]()),logger[_0x21a9d8(0x1ad)](_0x21a9d8(0x1a9),_0x21a9d8(0x196),_0x697afa),_0x25a721(new Error(_0x21a9d8(0x194)+_0x2fb30f));}}),_0x5adabd['on'](_0x402cdb(0x1ad),_0x8bdefb=>{const _0x15a875=_0x402cdb,_0xbdbc2e=Date[_0x15a875(0x1a5)]()-_0x64e2f3;logger['error'](_0x15a875(0x1a9),'项目构建出错',{'error':_0x8bdefb[_0x15a875(0x19c)],'duration':_0xbdbc2e,'stderr':_0x336a8b[_0x15a875(0x19f)]()||undefined}),_0x25a721(_0x8bdefb);});});}function a18_0x5a48(_0x1dca9c,_0x55ebec){const _0x4e3b2c=a18_0x4e3b();return a18_0x5a48=function(_0x5a48c1,_0x4ae2bf){_0x5a48c1=_0x5a48c1-0x18f;let _0x2367c6=_0x4e3b2c[_0x5a48c1];return _0x2367c6;},a18_0x5a48(_0x1dca9c,_0x55ebec);}function a18_0x4e3b(){const _0x24ad8c=['开始构建项目','error','.bin','7IMWwCt','inherit','node_modules','43371mGoaqB','776194pZahwF','npm\x20run\x20build\x20exited\x20with\x20code\x20','toString','项目构建失败','868100VSWufu','项目构建成功','npm\x20run\x20build','881298bxTzks','136167iweqjE','message','328pLvKKD','PATH','trim','npm','3462882hDVRbz','50FJnWvt','info','stderr','now','cwd','4436070rNtxyT','close','build','run','40tkfrIy'];a18_0x4e3b=function(){return _0x24ad8c;};return a18_0x4e3b();}
|
package/lib/cmd/logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2ae7d3,_0x3a87df){const _0x478a53=a19_0x65cf,_0x5ef21d=_0x2ae7d3();while(!![]){try{const _0x7b35b9=parseInt(_0x478a53(0x1b2))/0x1+parseInt(_0x478a53(0x1b8))/0x2+parseInt(_0x478a53(0x1c2))/0x3*(parseInt(_0x478a53(0x1bf))/0x4)+parseInt(_0x478a53(0x1ba))/0x5*(-parseInt(_0x478a53(0x1c0))/0x6)+parseInt(_0x478a53(0x1b7))/0x7+-parseInt(_0x478a53(0x1ab))/0x8+-parseInt(_0x478a53(0x1c4))/0x9;if(_0x7b35b9===_0x3a87df)break;else _0x5ef21d['push'](_0x5ef21d['shift']());}catch(_0x4b968e){_0x5ef21d['push'](_0x5ef21d['shift']());}}}(a19_0x4014,0x4e762));import{logger}from'../utils/logger.js';function a19_0x4014(){const _0x582212=['558208uxMYSG','\x20\x20\x20详情:\x20','toLocaleString','*\x20Lovrabet\x20CLI\x20日志记录:\x0a','message','command','keys','257630GKmwUA','clearLogs','duration','\x20\x20\x20耗时:\x20','timestamp','2026465wIGlXb','116080TEbIbb','success','676305TreXRV','*\x20日志已清空','details','zh-CN','log','1237844BIUWoh','6nIHNNW','cwd','6kbjKjm','length','6279048pGzvto','level','setLogPath','forEach'];a19_0x4014=function(){return _0x582212;};return a19_0x4014();}export function showLogs(){const _0x48bc0f=a19_0x65cf;logger[_0x48bc0f(0x1c6)](process[_0x48bc0f(0x1c1)]());const _0x2a45a0=logger['readLogs']();if(_0x2a45a0[_0x48bc0f(0x1c3)]===0x0){console[_0x48bc0f(0x1be)]('*\x20暂无日志记录');return;}console['log'](_0x48bc0f(0x1ae)),_0x2a45a0[_0x48bc0f(0x1aa)]((_0x111927,_0x455688)=>{const _0x10d94d=_0x48bc0f,_0x54159b=new Date(_0x111927[_0x10d94d(0x1b6)])[_0x10d94d(0x1ad)](_0x10d94d(0x1bd)),_0x1ba593=_0x111927[_0x10d94d(0x1c5)]===_0x10d94d(0x1b9)?'√':_0x111927[_0x10d94d(0x1c5)]==='error'?'×':_0x111927[_0x10d94d(0x1c5)]==='warn'?'!':'i';console[_0x10d94d(0x1be)](_0x455688+0x1+'.\x20'+_0x1ba593+'\x20['+_0x111927[_0x10d94d(0x1b0)]+']\x20'+_0x111927[_0x10d94d(0x1af)]),console['log']('\x20\x20\x20时间:\x20'+_0x54159b),_0x111927[_0x10d94d(0x1b4)]&&console[_0x10d94d(0x1be)](_0x10d94d(0x1b5)+_0x111927[_0x10d94d(0x1b4)]+'ms'),_0x111927[_0x10d94d(0x1bc)]&&Object[_0x10d94d(0x1b1)](_0x111927[_0x10d94d(0x1bc)])['length']>0x0&&console[_0x10d94d(0x1be)](_0x10d94d(0x1ac)+JSON['stringify'](_0x111927['details'],null,0x2)),console[_0x10d94d(0x1be)]('');});}function a19_0x65cf(_0x1a4c3c,_0x1a22eb){const _0x401425=a19_0x4014();return a19_0x65cf=function(_0x65cf3c,_0x58bd16){_0x65cf3c=_0x65cf3c-0x1aa;let _0x2713fa=_0x401425[_0x65cf3c];return _0x2713fa;},a19_0x65cf(_0x1a4c3c,_0x1a22eb);}export function clearLogs(){const _0x1770c3=a19_0x65cf;logger[_0x1770c3(0x1c6)](process[_0x1770c3(0x1c1)]()),logger[_0x1770c3(0x1b3)](),console[_0x1770c3(0x1be)](_0x1770c3(0x1bb));}
|
package/lib/cmd/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x551595,_0x24fbba){const _0x2ad893=a20_0x4c1d,_0x35db07=_0x551595();while(!![]){try{const _0x4ecc04=parseInt(_0x2ad893(0x6b))/0x1+parseInt(_0x2ad893(0x6a))/0x2+parseInt(_0x2ad893(0x70))/0x3+parseInt(_0x2ad893(0x6d))/0x4*(-parseInt(_0x2ad893(0x71))/0x5)+parseInt(_0x2ad893(0x7d))/0x6+parseInt(_0x2ad893(0x67))/0x7+-parseInt(_0x2ad893(0x79))/0x8;if(_0x4ecc04===_0x24fbba)break;else _0x35db07['push'](_0x35db07['shift']());}catch(_0x30968d){_0x35db07['push'](_0x35db07['shift']());}}}(a20_0x3009,0x24e5f));function a20_0x4c1d(_0x23c622,_0x214ae3){const _0x300929=a20_0x3009();return a20_0x4c1d=function(_0x4c1d70,_0x2d03d8){_0x4c1d70=_0x4c1d70-0x66;let _0x123727=_0x300929[_0x4c1d70];return _0x123727;},a20_0x4c1d(_0x23c622,_0x214ae3);}import{delimiter,join}from'node:path';function a20_0x3009(){const _0x110edd=['17881ZRnnQQ','error','6284JzuplO','success','inherit','620781XPNtXk','710wPsfZn','PATH','vite\x20preview','.bin','vite\x20preview\x20exited\x20with\x20code\x20','toString','trim','预览服务器启动成功','2325816qMvHtS','pipe','env','预览服务器启动失败','919230OqpdCq','now','preview','node_modules','close','cwd','stderr','535703JrRxiZ','vite','info','420804MfGVeN'];a20_0x3009=function(){return _0x110edd;};return a20_0x3009();}import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runPreview(){return new Promise((_0x1a3dfa,_0x450eef)=>{const _0xca3261=a20_0x4c1d,_0x333aad=Date[_0xca3261(0x7e)]();logger[_0xca3261(0x69)]('preview','启动预览服务器',{'command':_0xca3261(0x73)});let _0x4b85d5='';const _0x80bc21=spawn(_0xca3261(0x68),[_0xca3261(0x7f)],{'stdio':[_0xca3261(0x6f),_0xca3261(0x6f),_0xca3261(0x7a)],'shell':!![],'env':{...process[_0xca3261(0x7b)],'PATH':''+join(process[_0xca3261(0x82)](),_0xca3261(0x80),_0xca3261(0x74))+delimiter+process['env'][_0xca3261(0x72)]}});_0x80bc21[_0xca3261(0x66)]?.['on']('data',_0x13c90c=>{const _0x35d4b1=_0xca3261;_0x4b85d5+=_0x13c90c[_0x35d4b1(0x76)]();}),_0x80bc21['on'](_0xca3261(0x81),_0x14b273=>{const _0x18635b=_0xca3261,_0x2f8916=Date[_0x18635b(0x7e)]()-_0x333aad;if(_0x14b273===0x0||_0x14b273===null)logger[_0x18635b(0x6e)](_0x18635b(0x7f),_0x18635b(0x78),_0x2f8916),_0x1a3dfa();else{const _0x5ba80e={'exitCode':_0x14b273,'duration':_0x2f8916,'command':_0x18635b(0x73),'cwd':process[_0x18635b(0x82)]()};_0x4b85d5[_0x18635b(0x77)]()&&(_0x5ba80e[_0x18635b(0x66)]=_0x4b85d5[_0x18635b(0x77)]()),logger['error']('preview',_0x18635b(0x7c),_0x5ba80e),_0x450eef(new Error(_0x18635b(0x75)+_0x14b273));}}),_0x80bc21['on'](_0xca3261(0x6c),_0x47046c=>{const _0x1bc4bf=_0xca3261,_0x4b3779=Date[_0x1bc4bf(0x7e)]()-_0x333aad;logger[_0x1bc4bf(0x6c)](_0x1bc4bf(0x7f),'预览服务器启动出错',{'error':_0x47046c['message'],'duration':_0x4b3779,'stderr':_0x4b85d5[_0x1bc4bf(0x77)]()||undefined}),_0x450eef(_0x47046c);});});}
|
package/lib/cmd/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x42206e,_0x431fb8){const _0xe0ec5b=a21_0xa155,_0x47a1e3=_0x42206e();while(!![]){try{const _0x358e0e=-parseInt(_0xe0ec5b(0x178))/0x1+-parseInt(_0xe0ec5b(0x16b))/0x2*(parseInt(_0xe0ec5b(0x175))/0x3)+parseInt(_0xe0ec5b(0x16a))/0x4+parseInt(_0xe0ec5b(0x165))/0x5+-parseInt(_0xe0ec5b(0x16f))/0x6*(-parseInt(_0xe0ec5b(0x179))/0x7)+parseInt(_0xe0ec5b(0x173))/0x8*(parseInt(_0xe0ec5b(0x17b))/0x9)+-parseInt(_0xe0ec5b(0x166))/0xa;if(_0x358e0e===_0x431fb8)break;else _0x47a1e3['push'](_0x47a1e3['shift']());}catch(_0x49464e){_0x47a1e3['push'](_0x47a1e3['shift']());}}}(a21_0x237d,0xa9da2));import{delimiter,join}from'node:path';function a21_0xa155(_0x217062,_0x312a4f){const _0x237d1b=a21_0x237d();return a21_0xa155=function(_0xa155e3,_0x1420e8){_0xa155e3=_0xa155e3-0x164;let _0x89213d=_0x237d1b[_0xa155e3];return _0x89213d;},a21_0xa155(_0x217062,_0x312a4f);}function a21_0x237d(){const _0x54a9d0=['.bin','5566140Nkbuxe','15135250yjurSh','data','PATH','开发服务器启动失败','5090896rIVuFr','2098724sSGZIW','toString','启动开发服务器','message','6AkOXnA','info','start','trim','5927624zJepUV','vite','3HZWEcG','pipe','close','296703kFpnyD','2998793DXNTMa','error','9PayDby','env','stderr','now'];a21_0x237d=function(){return _0x54a9d0;};return a21_0x237d();}import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runStart(_0x25db90){return new Promise((_0x213b27,_0x26d1cb)=>{const _0x4b4109=a21_0xa155,_0x197430=Date[_0x4b4109(0x17e)](),_0x453708=_0x25db90||process['cwd']();logger[_0x4b4109(0x170)]('start',_0x4b4109(0x16d),{'command':_0x4b4109(0x174),'cwd':_0x453708});let _0x219af7='';const _0x30974b=spawn(_0x4b4109(0x174),{'stdio':['inherit','inherit',_0x4b4109(0x176)],'shell':!![],'cwd':_0x453708,'env':{...process[_0x4b4109(0x17c)],'PATH':''+join(_0x453708,'node_modules',_0x4b4109(0x164))+delimiter+process['env'][_0x4b4109(0x168)]}});_0x30974b[_0x4b4109(0x17d)]?.['on'](_0x4b4109(0x167),_0x33bf03=>{const _0x5d28eb=_0x4b4109,_0xfcd0d5=_0x33bf03[_0x5d28eb(0x16c)]();_0x219af7+=_0xfcd0d5,process['stderr']['write'](_0xfcd0d5);}),_0x30974b['on'](_0x4b4109(0x177),_0x275f45=>{const _0x4c859a=_0x4b4109,_0x22fd33=Date['now']()-_0x197430;if(_0x275f45===0x0||_0x275f45===null)logger['success'](_0x4c859a(0x171),'开发服务器启动成功',_0x22fd33),_0x213b27();else{const _0x48e70b={'exitCode':_0x275f45,'duration':_0x22fd33,'command':'vite','cwd':_0x453708};_0x219af7[_0x4c859a(0x172)]()&&(_0x48e70b[_0x4c859a(0x17d)]=_0x219af7[_0x4c859a(0x172)]()),logger[_0x4c859a(0x17a)](_0x4c859a(0x171),_0x4c859a(0x169),_0x48e70b),_0x26d1cb(new Error('vite\x20exited\x20with\x20code\x20'+_0x275f45));}}),_0x30974b['on'](_0x4b4109(0x17a),_0x1aa50f=>{const _0x9059b9=_0x4b4109,_0x43d892=Date[_0x9059b9(0x17e)]()-_0x197430,_0x17e8d5={'error':_0x1aa50f[_0x9059b9(0x16e)],'duration':_0x43d892,'command':_0x9059b9(0x174),'cwd':_0x453708};_0x219af7[_0x9059b9(0x172)]()&&(_0x17e8d5['stderr']=_0x219af7[_0x9059b9(0x172)]()),logger[_0x9059b9(0x17a)]('start','开发服务器启动出错',_0x17e8d5),_0x26d1cb(_0x1aa50f);});});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x311ca4,_0x87d3d1){const _0x539ce1=a22_0x339d,_0x23dbfa=_0x311ca4();while(!![]){try{const _0x12a965=parseInt(_0x539ce1(0x1df))/0x1*(-parseInt(_0x539ce1(0x1d8))/0x2)+-parseInt(_0x539ce1(0x1dd))/0x3*(-parseInt(_0x539ce1(0x1de))/0x4)+parseInt(_0x539ce1(0x1d9))/0x5*(parseInt(_0x539ce1(0x1ee))/0x6)+-parseInt(_0x539ce1(0x1e6))/0x7*(-parseInt(_0x539ce1(0x1d6))/0x8)+-parseInt(_0x539ce1(0x1e7))/0x9*(-parseInt(_0x539ce1(0x1f3))/0xa)+-parseInt(_0x539ce1(0x1f1))/0xb*(-parseInt(_0x539ce1(0x1e9))/0xc)+-parseInt(_0x539ce1(0x1f2))/0xd;if(_0x12a965===_0x87d3d1)break;else _0x23dbfa['push'](_0x23dbfa['shift']());}catch(_0x21cda0){_0x23dbfa['push'](_0x23dbfa['shift']());}}}(a22_0x3864,0x4b782));function a22_0x3864(){const _0x53c709=['9SCtAwN','设置环境\x20(online/daily)','19392TPxKXi','获取配置项','map','\x20\x20\x20\x20','lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','6djCUks','无效的命令,可用命令如下:','gray','2288Rgzlnd','10929191PqekTM','2246610hASxHP','22864OOzdEY','\x20*\x20配置示例:','34650ORrfPM','2461820bWtBNC','column','description','设置配置项','9SLTbIp','241972YIFsdm','27CrqcXc','列出所有配置项','lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','command','lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','lovrabet\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','938zTfeMx'];a22_0x3864=function(){return _0x53c709;};return a22_0x3864();}function a22_0x339d(_0x1b8450,_0x5b87c3){const _0x386405=a22_0x3864();return a22_0x339d=function(_0x339d94,_0x17d476){_0x339d94=_0x339d94-0x1d6;let _0x4c2a69=_0x386405[_0x339d94];return _0x4c2a69;},a22_0x339d(_0x1b8450,_0x5b87c3);}import{jsxs as a22_0x4c9265,jsx as a22_0x35e9de}from'react/jsx-runtime';import{Box,Text}from'ink';export function ConfigHelp(){const _0xedd40d=a22_0x339d,_0x443a85=[{'command':_0xedd40d(0x1ed),'description':_0xedd40d(0x1dc)},{'command':_0xedd40d(0x1e3),'description':_0xedd40d(0x1ea)},{'command':_0xedd40d(0x1e1),'description':_0xedd40d(0x1e0)}],_0x3272eb=[{'command':_0xedd40d(0x1e5),'description':'配置当前项目的\x20App\x20Code'},{'command':_0xedd40d(0x1e4),'description':_0xedd40d(0x1e8)}];return a22_0x4c9265(Box,{'flexDirection':_0xedd40d(0x1da),'marginTop':0x1,'marginBottom':0x1,'children':[a22_0x35e9de(Box,{'marginBottom':0x1,'children':a22_0x4c9265(Text,{'color':_0xedd40d(0x1f0),'children':['\x20!','\x20\x20',_0xedd40d(0x1ef)]})}),_0x443a85[_0xedd40d(0x1eb)](_0x275930=>a22_0x4c9265(Box,{'children':[a22_0x4c9265(Text,{'children':[_0xedd40d(0x1ec),_0x275930[_0xedd40d(0x1e2)]]}),a22_0x35e9de(Text,{'color':_0xedd40d(0x1f0),'children':_0x275930[_0xedd40d(0x1db)]})]},_0x275930['command'])),a22_0x35e9de(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a22_0x35e9de(Text,{'color':_0xedd40d(0x1f0),'children':_0xedd40d(0x1d7)})}),_0x3272eb[_0xedd40d(0x1eb)](_0x4f0d44=>a22_0x4c9265(Box,{'children':[a22_0x4c9265(Text,{'children':[_0xedd40d(0x1ec),_0x4f0d44[_0xedd40d(0x1e2)]]}),a22_0x35e9de(Text,{'color':_0xedd40d(0x1f0),'children':_0x4f0d44[_0xedd40d(0x1db)]})]},_0x4f0d44[_0xedd40d(0x1e2)]))]});}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x13fb5d,_0x3b1ff3){const _0x4cf980=a23_0x36b3,_0x581c77=_0x13fb5d();while(!![]){try{const _0x23caef=-parseInt(_0x4cf980(0x96))/0x1*(parseInt(_0x4cf980(0x74))/0x2)+-parseInt(_0x4cf980(0x8e))/0x3*(parseInt(_0x4cf980(0x93))/0x4)+parseInt(_0x4cf980(0x85))/0x5*(parseInt(_0x4cf980(0x8b))/0x6)+-parseInt(_0x4cf980(0x7f))/0x7*(parseInt(_0x4cf980(0x73))/0x8)+-parseInt(_0x4cf980(0x78))/0x9+-parseInt(_0x4cf980(0x92))/0xa*(-parseInt(_0x4cf980(0x81))/0xb)+parseInt(_0x4cf980(0x82))/0xc;if(_0x23caef===_0x3b1ff3)break;else _0x581c77['push'](_0x581c77['shift']());}catch(_0x91e700){_0x581c77['push'](_0x581c77['shift']());}}}(a23_0x12ef,0xd64d1));import{jsx as a23_0x521142,jsxs as a23_0x50959e}from'react/jsx-runtime';import{existsSync,readFileSync,writeFileSync}from'node:fs';import a23_0x493f1a from'node:fs';function a23_0x36b3(_0x1dd1e0,_0x36eea4){const _0x12efc4=a23_0x12ef();return a23_0x36b3=function(_0x36b3af,_0x32290d){_0x36b3af=_0x36b3af-0x6e;let _0x2d318c=_0x12efc4[_0x36b3af];return _0x2d318c;},a23_0x36b3(_0x1dd1e0,_0x36eea4);}import a23_0xd6cc7 from'node:path';import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';import{readConfig,isInProject,projectConfigPath,globalConfigPath}from'../utils/config.js';import{logger}from'../utils/logger.js';export function Config(_0x4582b3){const _0x2f9b67=a23_0x36b3,{cli:_0x15a0e1}=_0x4582b3,_0x409845=_0x15a0e1[_0x2f9b67(0x7c)][0x1],_0x582ed0=_0x15a0e1[_0x2f9b67(0x7c)][0x2],_0x17dcad=[_0x2f9b67(0x77),_0x2f9b67(0x80)][_0x2f9b67(0x7a)](_0x409845||''),_0x4b5124=_0x15a0e1[_0x2f9b67(0x7c)][_0x2f9b67(0x84)]>=0x3;if(_0x582ed0===_0x2f9b67(0x7b)||_0x15a0e1[_0x2f9b67(0x76)][_0x2f9b67(0x83)])return a23_0x521142(ConfigHelp,{});const _0x1dba7d=readConfig();if(_0x409845==='set'){if(_0x582ed0){const _0x29815a=_0x15a0e1[_0x2f9b67(0x7c)][0x3];if(typeof _0x29815a!=='undefined'){if(_0x582ed0===_0x2f9b67(0x8c)&&![_0x2f9b67(0x89),_0x2f9b67(0x7d)]['includes'](_0x29815a))return a23_0x521142(Box,{'children':a23_0x521142(Text,{'color':_0x2f9b67(0x86),'children':_0x2f9b67(0x7e)})});const _0x348c9b=isInProject(),_0xfb8913=_0x348c9b?projectConfigPath:globalConfigPath;let _0x4552cd={};try{if(existsSync(_0xfb8913)){const _0x1be119=readFileSync(_0xfb8913,{'encoding':_0x2f9b67(0x6f)});_0x1be119&&(_0x4552cd=JSON[_0x2f9b67(0x70)](_0x1be119));}}catch(_0x52feef){}if(typeof _0x29815a!==_0x2f9b67(0x90)||_0x29815a[_0x2f9b67(0x84)]>0x1f4)return a23_0x521142(Box,{'children':a23_0x521142(Text,{'color':_0x2f9b67(0x86),'children':'配置值无效或过长'})});_0x4552cd[_0x582ed0]=_0x29815a;try{const _0xbc2fb7=a23_0xd6cc7[_0x2f9b67(0x91)](_0xfb8913);!existsSync(_0xbc2fb7)&&a23_0x493f1a['mkdirSync'](_0xbc2fb7,{'recursive':!![]});const _0x6b179c=_0xfb8913+_0x2f9b67(0x75);writeFileSync(_0x6b179c,JSON[_0x2f9b67(0x71)](_0x4552cd,null,0x2),{'encoding':'utf8','mode':0x180}),a23_0x493f1a[_0x2f9b67(0x8d)](_0x6b179c,_0xfb8913);if(_0x582ed0===_0x2f9b67(0x8c)){const _0xfa2a87=_0x348c9b?'项目':'全局';console[_0x2f9b67(0x95)]('✓\x20'+_0xfa2a87+'环境配置已设置为:\x20'+_0x29815a);}}catch(_0x16ff2b){const _0x8ff18c=_0xfb8913+_0x2f9b67(0x75);try{existsSync(_0x8ff18c)&&a23_0x493f1a['unlinkSync'](_0x8ff18c);}catch(_0x45f850){}return logger[_0x2f9b67(0x8f)](_0x2f9b67(0x88),_0x2f9b67(0x8a),{'error':_0x16ff2b instanceof Error?_0x16ff2b[_0x2f9b67(0x79)]:String(_0x16ff2b),'configKey':_0x582ed0,'configValue':_0x29815a,'targetConfigPath':_0xfb8913}),a23_0x521142(Box,{'children':a23_0x50959e(Text,{'color':'red','children':[_0x2f9b67(0x94),_0x16ff2b instanceof Error?_0x16ff2b[_0x2f9b67(0x79)]:String(_0x16ff2b)]})});}return null;}return a23_0x521142(Box,{'children':a23_0x521142(Text,{'color':'red','children':_0x2f9b67(0x72)})});}}if(_0x409845===_0x2f9b67(0x80)){if(_0x582ed0)return console['log'](_0x1dba7d[_0x582ed0]||_0x2f9b67(0x87)),null;return null;}if(_0x409845===_0x2f9b67(0x6e))return console[_0x2f9b67(0x95)](JSON[_0x2f9b67(0x71)](_0x1dba7d,null,0x2)),null;if(!_0x17dcad||!_0x4b5124)return a23_0x521142(ConfigHelp,{});return null;}function a23_0x12ef(){const _0x294f81=['14967729MwDiWk','message','includes','--help','input','daily','环境配置值只能是\x20\x22online\x22\x20或\x20\x22daily\x22','8491EBapnT','get','55kZAlKG','47063688XhXSYy','help','length','195GbiRPa','red','undefined','config','online','保存配置失败','137586DxUtgZ','env','renameSync','5475ltVWbw','error','string','dirname','1749010dMeouH','1868vIFvhd','保存配置失败:\x20','log','1qqLhpO','list','utf8','parse','stringify','未提供配置值','7472PYhAVl','2329426qHvwPj','.tmp','flags','set'];a23_0x12ef=function(){return _0x294f81;};return a23_0x12ef();}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a24_0x3bc7(){const _0x261eaa=['https://daily-api.lovrabet.com','568410ebZOzC','8379848lGHaIv','1337ZItZsz','online','643605uzAtvD','29691MaFnjJ','1405294AVViek','https://user-daily.lovrabet.com','https://api.lovrabet.com','33138dtLiAS','6290PdsoUc','https://user.lovrabet.com','237232QKwHyI','18RmeaFh'];a24_0x3bc7=function(){return _0x261eaa;};return a24_0x3bc7();}function a24_0x4fb8(_0x1ed9b8,_0x4a2481){const _0x3bc74f=a24_0x3bc7();return a24_0x4fb8=function(_0x4fb874,_0x1abf0f){_0x4fb874=_0x4fb874-0x170;let _0x4dbc33=_0x3bc74f[_0x4fb874];return _0x4dbc33;},a24_0x4fb8(_0x1ed9b8,_0x4a2481);}const a24_0x2ad4bf=a24_0x4fb8;(function(_0x1d90f3,_0xcce9aa){const _0x27e6fe=a24_0x4fb8,_0x461624=_0x1d90f3();while(!![]){try{const _0x500e07=-parseInt(_0x27e6fe(0x175))/0x1+-parseInt(_0x27e6fe(0x17b))/0x2+-parseInt(_0x27e6fe(0x173))/0x3*(parseInt(_0x27e6fe(0x172))/0x4)+parseInt(_0x27e6fe(0x179))/0x5+parseInt(_0x27e6fe(0x17e))/0x6*(-parseInt(_0x27e6fe(0x177))/0x7)+parseInt(_0x27e6fe(0x176))/0x8+-parseInt(_0x27e6fe(0x17a))/0x9*(-parseInt(_0x27e6fe(0x170))/0xa);if(_0x500e07===_0xcce9aa)break;else _0x461624['push'](_0x461624['shift']());}catch(_0x4b52cb){_0x461624['push'](_0x461624['shift']());}}}(a24_0x3bc7,0x8b083));import{getEnv}from'./env.js';export const getUserDomain=()=>getEnv()===a24_0x2ad4bf(0x178)?a24_0x2ad4bf(0x171):a24_0x2ad4bf(0x17c);export const getApiDomain=()=>getEnv()===a24_0x2ad4bf(0x178)?a24_0x2ad4bf(0x17d):a24_0x2ad4bf(0x174);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x52af27,_0x1fdc2a){const _0x32ae6e=a25_0xfe10,_0xb09562=_0x52af27();while(!![]){try{const _0x56bb25=-parseInt(_0x32ae6e(0xcb))/0x1*(-parseInt(_0x32ae6e(0xc2))/0x2)+parseInt(_0x32ae6e(0xc9))/0x3+parseInt(_0x32ae6e(0xc6))/0x4*(parseInt(_0x32ae6e(0xc0))/0x5)+parseInt(_0x32ae6e(0xc3))/0x6*(-parseInt(_0x32ae6e(0xc4))/0x7)+-parseInt(_0x32ae6e(0xc1))/0x8*(-parseInt(_0x32ae6e(0xbf))/0x9)+parseInt(_0x32ae6e(0xca))/0xa*(parseInt(_0x32ae6e(0xc8))/0xb)+parseInt(_0x32ae6e(0xc5))/0xc*(-parseInt(_0x32ae6e(0xc7))/0xd);if(_0x56bb25===_0x1fdc2a)break;else _0xb09562['push'](_0xb09562['shift']());}catch(_0x1ebbf0){_0xb09562['push'](_0xb09562['shift']());}}}(a25_0x4b51,0x2ff99));function a25_0x4b51(){const _0x2961f4=['236529TnvHEa','335zeHFQD','96PHKCde','142854uYhZul','698376lAAiWx','14Dqkhlp','3848472PthHak','11504BRpYWE','26pvShZv','1393645jGhBCt','1093569ukdICh','10yoFWoN','1qGgKYo'];a25_0x4b51=function(){return _0x2961f4;};return a25_0x4b51();}function a25_0xfe10(_0x218858,_0x16c528){const _0x4b5162=a25_0x4b51();return a25_0xfe10=function(_0xfe10ee,_0x1bfe1c){_0xfe10ee=_0xfe10ee-0xbf;let _0x5d7e04=_0x4b5162[_0xfe10ee];return _0x5d7e04;},a25_0xfe10(_0x218858,_0x16c528);}let env=process['env']['LOVRABET_ENV']||'online';export function getEnv(){return env;}export function initEnv(_0x14e4e5){env=_0x14e4e5;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4de978,_0x165ba2){const _0x416910=a26_0x348b,_0x22a54c=_0x4de978();while(!![]){try{const _0x3c4b45=parseInt(_0x416910(0x17a))/0x1+-parseInt(_0x416910(0x163))/0x2*(-parseInt(_0x416910(0x182))/0x3)+parseInt(_0x416910(0x18b))/0x4+-parseInt(_0x416910(0x173))/0x5*(parseInt(_0x416910(0x16f))/0x6)+-parseInt(_0x416910(0x185))/0x7*(parseInt(_0x416910(0x179))/0x8)+parseInt(_0x416910(0x190))/0x9+parseInt(_0x416910(0x177))/0xa*(-parseInt(_0x416910(0x162))/0xb);if(_0x3c4b45===_0x165ba2)break;else _0x22a54c['push'](_0x22a54c['shift']());}catch(_0x1fa46c){_0x22a54c['push'](_0x22a54c['shift']());}}}(a26_0x5c2f,0xcbea6));function a26_0x348b(_0x28cb43,_0x4ee18e){const _0x5c2fb8=a26_0x5c2f();return a26_0x348b=function(_0x348b7a,_0x57e0ed){_0x348b7a=_0x348b7a-0x155;let _0x5388d0=_0x5c2fb8[_0x348b7a];return _0x5388d0;},a26_0x348b(_0x28cb43,_0x4ee18e);}import{jsx as a26_0x4dae19,jsxs as a26_0x19a134,Fragment as a26_0x1b2232}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';function a26_0x5c2f(){const _0x39ecf9=['10398mWrkOz','green','step','7NlaJGn','gray','slice','my-app','应用AppCode长度不能超过\x20100\x20个字符','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','5955672yJNfCi','拉取API配置','env','trim','online','4653000hoESII','map','login-prompt','includes','\x20直接回车确认,或输入自定义名称','项目名','*\x20是否要自动拉取\x20API\x20配置?','length','red','*\x20应用AppCode\x20','√\x20检测到有效登录状态','delete','\x20检查中...','column','已登录','string','11zMouML','674vFNjgF','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','return','project-name','*\x20项目名:\x20','cyan','test','yellow','登录失败','项目名不合法','login-check','*\x20正在登录,请前往浏览器完成登录...','3276444AqLAie','\x20←\x20','应用AppCode不合法','登录状态','15PeOidi','confirm-api-pull','login','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','6220190ccpyrC','Yes','7267992bjLVGv','830018RRTCuh','项目名长度不能超过\x2050\x20个字符','跳过登录','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','app-code','login-process','creating','[可选]:\x20'];a26_0x5c2f=function(){return _0x39ecf9;};return a26_0x5c2f();}import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x2326b7){const _0x3f0079=a26_0x348b,{onCreate:_0x4e2911,env:_0x47eec1}=_0x2326b7,[_0x5c2da3,_0xebd162]=useState(_0x3f0079(0x166)),[_0x415a34,_0x4dd996]=useState(''),[_0x5d7fe2,_0xca261e]=useState(''),[_0x546bf3,_0x1715cc]=useState(''),[_0x43d2ef,_0x39967a]=useState(''),[_0x514110,_0x4c8b51]=useState([]),[_0x2c3333,_0x5461c3]=useState(null),[_0x2dd430,_0x427b50]=useState(![]),[_0x3b3fd4,_0xba43bf]=useState(![]),[_0x440e78,_0xf5e336]=useState(![]),[_0x14c953,_0x27234a]=useState(0x0),[_0x27f081,_0x89ef31]=useState(0x0),_0x38bb85=_0x3f0079(0x188),_0x49476d=readConfig(),_0x16c71a=typeof _0x49476d[_0x3f0079(0x18d)]===_0x3f0079(0x161)?_0x49476d[_0x3f0079(0x18d)]:undefined;function _0x3cf8c3(_0x14f7d0){const _0x5ebf66=_0x3f0079;if(_0x14f7d0[_0x5ebf66(0x159)]>0x32)return{'valid':![],'message':_0x5ebf66(0x17b)};const _0x191a49=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x14f7d0?.[_0x5ebf66(0x18e)]()&&!_0x191a49[_0x5ebf66(0x169)](_0x14f7d0))return{'valid':![],'message':'项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_'};return{'valid':!![]};}function _0x158bf7(_0x35aea9){const _0x53a724=_0x3f0079;if(!_0x35aea9[_0x53a724(0x18e)]())return{'valid':!![]};if(_0x35aea9[_0x53a724(0x159)]>0x64)return{'valid':![],'message':_0x53a724(0x189)};const _0x25157c=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x25157c[_0x53a724(0x169)](_0x35aea9))return{'valid':![],'message':_0x53a724(0x164)};return{'valid':!![]};}async function _0x13b4ab(){_0x427b50(!![]);try{const _0x514c1b=await getIsSessionValid();return _0x5461c3(_0x514c1b),_0x514c1b;}catch(_0x5176db){return _0x5461c3(![]),![];}finally{_0x427b50(![]);}}async function _0x1550bc(){_0xba43bf(!![]);try{const _0x3450fd=await authServer({'silent':!![]});return _0x5461c3(_0x3450fd),_0x3450fd;}catch(_0x550fef){return _0x5461c3(![]),![];}finally{_0xba43bf(![]);}}return useInput(async(_0x2e5919,_0x5df050)=>{const _0x57672d=_0x3f0079;if(_0x5df050['leftArrow']||_0x5df050['rightArrow']){if(_0x5c2da3==='confirm-api-pull'){_0x27234a(_0x1fb97e=>_0x1fb97e===0x0?0x1:0x0);return;}if(_0x5c2da3==='login-prompt'){_0x89ef31(_0x28bdb6=>_0x28bdb6===0x0?0x1:0x0);return;}}if(_0x5df050[_0x57672d(0x165)]){if(_0x5c2da3===_0x57672d(0x166)){const _0x598534=_0x546bf3[_0x57672d(0x18e)]()||_0x38bb85;if(_0x43d2ef)return;_0x4dd996(_0x598534),_0x4c8b51([{'step':_0x57672d(0x166),'label':_0x57672d(0x157),'value':_0x598534}]),_0x1715cc(''),_0x39967a(''),_0xebd162(_0x57672d(0x17e));return;}if(_0x5c2da3===_0x57672d(0x17e)){if(_0x43d2ef)return;const _0x5b75ea=_0x546bf3[_0x57672d(0x18e)]();_0xca261e(_0x5b75ea),_0x4c8b51(_0x15995a=>[..._0x15995a,{'step':_0x57672d(0x17e),'label':'应用AppCode','value':_0x5b75ea||'未设置'}]),_0x1715cc(''),_0x39967a('');if(_0x5b75ea){_0xebd162(_0x57672d(0x16d));const _0x518852=await _0x13b4ab();_0x518852?_0xebd162(_0x57672d(0x174)):_0xebd162(_0x57672d(0x192));}else{const _0x1ff342=_0x47eec1||_0x16c71a||'online';_0x4e2911({'projectName':_0x415a34,'appCode':undefined,'pullApi':![],'env':_0x1ff342}),_0xebd162(_0x57672d(0x180));}return;}if(_0x5c2da3===_0x57672d(0x174)){const _0x3a32e9=_0x14c953===0x0;_0xf5e336(_0x3a32e9),_0x4c8b51(_0x240c8d=>[..._0x240c8d,{'step':'api-pull','label':_0x57672d(0x18c),'value':_0x3a32e9?'是':'否'}]);const _0x4c1a97=_0x47eec1||_0x16c71a||_0x57672d(0x18f);_0x4e2911({'projectName':_0x415a34,'appCode':_0x5d7fe2,'pullApi':_0x3a32e9,'env':_0x4c1a97}),_0xebd162('creating');return;}if(_0x5c2da3===_0x57672d(0x192)){const _0x59b747=_0x27f081===0x0;if(_0x59b747){_0xebd162(_0x57672d(0x17f));const _0xf15c3e=await _0x1550bc();if(_0xf15c3e)_0x4c8b51(_0x466c02=>[..._0x466c02,{'step':'login','label':_0x57672d(0x172),'value':_0x57672d(0x160)}]),_0xebd162('confirm-api-pull');else{_0x4c8b51(_0x3b9d97=>[..._0x3b9d97,{'step':_0x57672d(0x175),'label':_0x57672d(0x172),'value':_0x57672d(0x16b)}]);const _0x3d3bbe=_0x47eec1||_0x16c71a||_0x57672d(0x18f);_0x4e2911({'projectName':_0x415a34,'appCode':_0x5d7fe2,'pullApi':![],'env':_0x3d3bbe}),_0xebd162(_0x57672d(0x180));}}else{_0x4c8b51(_0x1daf1c=>[..._0x1daf1c,{'step':'login','label':'登录状态','value':_0x57672d(0x17c)}]);const _0x42c727=_0x47eec1||_0x16c71a||_0x57672d(0x18f);_0x4e2911({'projectName':_0x415a34,'appCode':_0x5d7fe2,'pullApi':![],'env':_0x42c727}),_0xebd162(_0x57672d(0x180));}return;}}if(_0x5df050['backspace']||_0x5df050[_0x57672d(0x15d)]){_0x1715cc(_0x49203b=>{const _0x392181=_0x57672d,_0x4ab571=_0x49203b[_0x392181(0x187)](0x0,-0x1);if(_0x5c2da3===_0x392181(0x166)){const {valid:_0x3b5fee,message:_0x35009e}=_0x3cf8c3(_0x4ab571);_0x39967a(_0x3b5fee?'':_0x35009e||_0x392181(0x16c));}else{if(_0x5c2da3===_0x392181(0x17e)){const {valid:_0x5b433e,message:_0x2e86a5}=_0x158bf7(_0x4ab571);_0x39967a(_0x5b433e?'':_0x2e86a5||'应用AppCode不合法');}}return _0x4ab571;});return;}if([_0x57672d(0x180),_0x57672d(0x16d),_0x57672d(0x17f)][_0x57672d(0x155)](_0x5c2da3))return;if(_0x5c2da3===_0x57672d(0x174)||_0x5c2da3==='login-prompt')return;_0x1715cc(_0x19963f=>{const _0x20c9ce=_0x57672d,_0x25c09f=_0x19963f+_0x2e5919;if(_0x5c2da3===_0x20c9ce(0x166)){const {valid:_0xddc22a,message:_0x348ab3}=_0x3cf8c3(_0x25c09f);_0x39967a(_0xddc22a?'':_0x348ab3||_0x20c9ce(0x16c));}else{if(_0x5c2da3===_0x20c9ce(0x17e)){const {valid:_0x1c3570,message:_0x424f37}=_0x158bf7(_0x25c09f);_0x39967a(_0x1c3570?'':_0x424f37||_0x20c9ce(0x171));}}return _0x25c09f;});}),a26_0x19a134(Box,{'flexDirection':_0x3f0079(0x15f),'marginTop':0x1,'children':[_0x514110[_0x3f0079(0x159)]===0x0&&a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':_0x3f0079(0x168),'children':'*\x20创建新项目'})}),_0x514110[_0x3f0079(0x191)](_0x12ee9a=>a26_0x19a134(Box,{'children':[a26_0x19a134(Text,{'color':_0x3f0079(0x183),'children':['√\x20',_0x12ee9a['label'],':\x20']}),a26_0x4dae19(Text,{'color':_0x3f0079(0x168),'children':_0x12ee9a['value']})]},_0x12ee9a[_0x3f0079(0x184)])),_0x5c2da3===_0x3f0079(0x166)&&a26_0x19a134(a26_0x1b2232,{'children':[a26_0x19a134(Box,{'children':[a26_0x4dae19(Text,{'children':_0x3f0079(0x167)}),_0x546bf3?a26_0x4dae19(Text,{'color':_0x3f0079(0x183),'children':_0x546bf3}):a26_0x4dae19(Text,{'color':'gray','children':_0x38bb85}),_0x43d2ef&&a26_0x19a134(Text,{'color':_0x3f0079(0x15a),'children':[_0x3f0079(0x170),_0x43d2ef]})]}),!_0x43d2ef&&!_0x546bf3&&a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':_0x3f0079(0x186),'children':_0x3f0079(0x156)})})]}),_0x5c2da3==='app-code'&&a26_0x19a134(a26_0x1b2232,{'children':[a26_0x19a134(Box,{'children':[a26_0x4dae19(Text,{'children':_0x3f0079(0x15b)}),a26_0x4dae19(Text,{'color':_0x3f0079(0x186),'children':_0x3f0079(0x181)}),a26_0x4dae19(Text,{'color':_0x3f0079(0x183),'children':_0x546bf3}),_0x43d2ef&&a26_0x19a134(Text,{'color':'red','children':[_0x3f0079(0x170),_0x43d2ef]})]}),!_0x43d2ef&&a26_0x4dae19(Box,{'children':a26_0x19a134(Text,{'color':_0x3f0079(0x186),'children':['\x20',_0x3f0079(0x17d)]})})]}),_0x5c2da3===_0x3f0079(0x16d)&&a26_0x19a134(Box,{'children':[a26_0x4dae19(Text,{'children':'*\x20正在检查登录状态...'}),_0x2dd430&&a26_0x4dae19(Text,{'color':_0x3f0079(0x186),'children':_0x3f0079(0x15e)})]}),_0x5c2da3===_0x3f0079(0x174)&&a26_0x19a134(a26_0x1b2232,{'children':[a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':_0x3f0079(0x183),'children':_0x3f0079(0x15c)})}),a26_0x4dae19(Box,{'marginTop':0x1,'children':a26_0x4dae19(Text,{'children':_0x3f0079(0x158)})}),a26_0x19a134(Box,{'marginLeft':0x2,'children':[a26_0x19a134(Text,{'color':_0x14c953===0x0?'green':_0x3f0079(0x186),'children':[_0x14c953===0x0?'▶\x20':'\x20\x20',_0x3f0079(0x178)]}),a26_0x4dae19(Text,{'children':'\x20'}),a26_0x19a134(Text,{'color':_0x14c953===0x1?_0x3f0079(0x183):_0x3f0079(0x186),'children':[_0x14c953===0x1?'▶\x20':'\x20\x20','No']})]}),a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':'gray','children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':_0x3f0079(0x16a),'children':_0x3f0079(0x18a)})})]}),_0x5c2da3===_0x3f0079(0x192)&&a26_0x19a134(a26_0x1b2232,{'children':[a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':'yellow','children':'!\x20未检测到有效登录'})}),a26_0x4dae19(Box,{'marginTop':0x1,'children':a26_0x4dae19(Text,{'children':'*\x20是否要先登录以便拉取\x20API\x20配置?'})}),a26_0x19a134(Box,{'marginLeft':0x2,'children':[a26_0x19a134(Text,{'color':_0x27f081===0x0?_0x3f0079(0x183):'gray','children':[_0x27f081===0x0?'▶\x20':'\x20\x20','Yes']}),a26_0x4dae19(Text,{'children':'\x20'}),a26_0x19a134(Text,{'color':_0x27f081===0x1?'green':'gray','children':[_0x27f081===0x1?'▶\x20':'\x20\x20','No']})]}),a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':_0x3f0079(0x186),'children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a26_0x4dae19(Box,{'children':a26_0x4dae19(Text,{'color':_0x3f0079(0x16a),'children':_0x3f0079(0x176)})})]}),_0x5c2da3===_0x3f0079(0x17f)&&a26_0x19a134(Box,{'children':[a26_0x4dae19(Text,{'children':_0x3f0079(0x16e)}),_0x3b3fd4&&a26_0x4dae19(Text,{'color':_0x3f0079(0x186),'children':'\x20登录中...'})]})]});}
|
|
1
|
+
(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 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a27_0x1cad(){const _0x9a8c30=['13878nHFVEg','22977053mXuIFj','174830pwePGV','62104mCfhNw','12158HesEFU','123IrXvZm','replace','5849020vedhtY','now','2023nKVmQc','315buTqOF','31112ZdPQtY','149iqsTxK','toFixed'];a27_0x1cad=function(){return _0x9a8c30;};return a27_0x1cad();}function a27_0x5ee2(_0x4d2129,_0x414d43){const _0x1cad0b=a27_0x1cad();return a27_0x5ee2=function(_0x5ee210,_0x52437f){_0x5ee210=_0x5ee210-0x176;let _0x10625a=_0x1cad0b[_0x5ee210];return _0x10625a;},a27_0x5ee2(_0x4d2129,_0x414d43);}(function(_0x41ff15,_0x468d5b){const _0x5d812d=a27_0x5ee2,_0x2dd39d=_0x41ff15();while(!![]){try{const _0x4e5864=-parseInt(_0x5d812d(0x17c))/0x1*(parseInt(_0x5d812d(0x182))/0x2)+parseInt(_0x5d812d(0x183))/0x3*(parseInt(_0x5d812d(0x17b))/0x4)+-parseInt(_0x5d812d(0x177))/0x5+parseInt(_0x5d812d(0x17e))/0x6*(parseInt(_0x5d812d(0x179))/0x7)+-parseInt(_0x5d812d(0x181))/0x8*(parseInt(_0x5d812d(0x17a))/0x9)+parseInt(_0x5d812d(0x180))/0xa+parseInt(_0x5d812d(0x17f))/0xb;if(_0x4e5864===_0x468d5b)break;else _0x2dd39d['push'](_0x2dd39d['shift']());}catch(_0x246c0e){_0x2dd39d['push'](_0x2dd39d['shift']());}}}(a27_0x1cad,0xb638d));export function formatElapsed(_0x3c818d){const _0x39140d=a27_0x5ee2,_0x447765=Date[_0x39140d(0x178)]()-_0x3c818d;if(_0x447765<0x3e8)return _0x447765+'ms';const _0x2bcc81=(_0x447765/0x3e8)[_0x39140d(0x17d)](0x2),_0x53f480=_0x2bcc81[_0x39140d(0x176)](/\.?0+$/u,'');return _0x53f480+'s';}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xae6694,_0x4c6d1e){const _0x48d906=a28_0x47dd,_0x558224=_0xae6694();while(!![]){try{const _0x3b5448=-parseInt(_0x48d906(0xcd))/0x1*(parseInt(_0x48d906(0xd4))/0x2)+-parseInt(_0x48d906(0x95))/0x3+parseInt(_0x48d906(0xb8))/0x4*(-parseInt(_0x48d906(0x98))/0x5)+-parseInt(_0x48d906(0xe4))/0x6+-parseInt(_0x48d906(0x8a))/0x7*(-parseInt(_0x48d906(0xa1))/0x8)+parseInt(_0x48d906(0xb0))/0x9+parseInt(_0x48d906(0xcb))/0xa;if(_0x3b5448===_0x4c6d1e)break;else _0x558224['push'](_0x558224['shift']());}catch(_0x46efdf){_0x558224['push'](_0x558224['shift']());}}}(a28_0x20ee,0x6d377));import{jsx as a28_0x29bf3f,Fragment as a28_0x2f4ba1,jsxs as a28_0x5724bd}from'react/jsx-runtime';import a28_0x21384f from'node:path';import a28_0x16d927 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';function a28_0x47dd(_0x43b211,_0x2572c0){const _0x20eee4=a28_0x20ee();return a28_0x47dd=function(_0x47dda6,_0x29c947){_0x47dda6=_0x47dda6-0x8a;let _0x2d43e9=_0x20eee4[_0x47dda6];return _0x2d43e9;},a28_0x47dd(_0x43b211,_0x2572c0);}import{readConfig}from'../utils/config.js';function a28_0x20ee(){const _0x4c892d=['cd\x20','743403UcUWRS','stringify','lovrabet\x20api\x20pull','175085vdhdaI','accessSync','resolve','white','2.\x20','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20app\x20<app-code>\x27\x20配置','清理项目目录失败:\x20','*\x20正在为项目\x20','📁\x20项目名称:\x20','24MtMfdd','×\x20项目创建失败:\x20','×\x20无法在当前目录创建项目,请检查目录权限','appCode','\x20&&\x20lovrabet\x20start','需手动拉取','version','\x20|\x20应用AppCode:\x20','项目创建完成:\x20','writeFileSync','.lovrabetrc','项目创建失败:\x20','\x20√\x20','../..','×\x20项目目录\x20','2351502zevWeZ','length','yellow','gray','constants','readFileSync','rmSync','*\x20正在拉取\x20API\x20配置...','68DoeDSH','配置应用AppCode:\x20','message','🎉\x20项目创建成功!','cyan','\x20已存在,请使用其他项目名','error','utf8','3.\x20','green','trim','📦\x20API配置:\x20','package.json','配置应用AppCode失败:\x20','column','API\x20配置拉取失败:\x20','success','项目名称:\x20','pullApi','9973170OMtIXj','lovrabet\x20config\x20set\x20app\x20[app-code]','4554LZITTP','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','开始创建项目:\x20','log','repeat','配置AppCode:\x20','API\x20配置拉取异常:\x20','236boELbc','cwd','info','projectCode','dirname','warn','join','url','existsSync','projectName','1.\x20','\x20创建配置文件','env','toLocaleString','test','🔗\x20应用AppCode:\x20','160140nDQnpe','拉取API配置:\x20','parse','1390452dWWXKC','string','1.0.0','create','doTask','×\x20项目名不能为空','setLogPath','*\x20清理失败的项目目录:\x20','*\x20配置文件路径:\x20','√\x20API\x20配置拉取完成'];a28_0x20ee=function(){return _0x4c892d;};return a28_0x20ee();}import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x31756d){const _0x3e294a=a28_0x47dd,[_0x2e6429,_0x37c7c2]=useState(![]),[_0x21807e,_0x5380f2]=useState(![]),[_0xa7b15d,_0x517e67]=useState(null),_0x2890c1=useCopyProjectTemplate(),_0x90a6e=useInstallDependencies(),_0x27989f=useFormatCode(),_0x22ea64=async _0x4d282f=>{const _0x50022a=a28_0x47dd;if(!_0x4d282f['projectName']||_0x4d282f['projectName'][_0x50022a(0xc2)]()===''){console['error'](_0x50022a(0x8f));return;}const _0x1953d1=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1953d1[_0x50022a(0xe2)](_0x4d282f[_0x50022a(0xdd)])){console['error']('×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符');return;}if(_0x4d282f[_0x50022a(0xdd)][_0x50022a(0xb1)]>0x64){console[_0x50022a(0xbe)]('×\x20项目名过长,最多支持\x20100\x20个字符');return;}const _0x39423c=a28_0x21384f['resolve'](process['cwd'](),_0x4d282f[_0x50022a(0xdd)]);if(a28_0x16d927[_0x50022a(0xdc)](_0x39423c)){console[_0x50022a(0xbe)](_0x50022a(0xaf)+_0x4d282f[_0x50022a(0xdd)]+_0x50022a(0xbd));return;}try{const _0x5b888e=a28_0x21384f[_0x50022a(0xd8)](_0x39423c);a28_0x16d927[_0x50022a(0x99)](_0x5b888e,a28_0x16d927[_0x50022a(0xb4)]['W_OK']);}catch(_0x279d77){console['error'](_0x50022a(0xa3));return;}_0x517e67(_0x4d282f),_0x37c7c2(!![]),logger[_0x50022a(0x90)](_0x39423c),logger[_0x50022a(0xd6)](_0x50022a(0x8d),_0x50022a(0xcf)+_0x4d282f[_0x50022a(0xdd)],{'projectDir':_0x39423c,'appCode':_0x4d282f[_0x50022a(0xa4)]});try{await _0x2890c1[_0x50022a(0x8e)](_0x4d282f[_0x50022a(0xdd)]),await _0x90a6e[_0x50022a(0x8e)](_0x4d282f[_0x50022a(0xdd)]),await _0x27989f['doTask'](_0x4d282f['projectName']),await _0x3a33a7(_0x4d282f[_0x50022a(0xdd)],_0x4d282f[_0x50022a(0xa4)]||'',_0x4d282f['env']);if(_0x4d282f[_0x50022a(0xca)]&&_0x4d282f['appCode']){console[_0x50022a(0xd0)](_0x50022a(0xb7));try{const _0x8fff23=await pullApiSilent(_0x4d282f['appCode'],undefined,_0x39423c,_0x4d282f[_0x50022a(0xe0)]);_0x8fff23?(console[_0x50022a(0xd0)](_0x50022a(0x93)),logger[_0x50022a(0xd6)](_0x50022a(0x8d),'API\x20配置拉取成功:\x20'+_0x4d282f[_0x50022a(0xa4)],{'projectDir':_0x39423c,'appCode':_0x4d282f['appCode'],'env':_0x4d282f['env']})):(console[_0x50022a(0xd0)]('!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x50022a(0xd9)](_0x50022a(0x8d),_0x50022a(0xc7)+_0x4d282f[_0x50022a(0xa4)],{'projectDir':_0x39423c,'appCode':_0x4d282f['appCode'],'env':_0x4d282f['env']}));}catch(_0x38fcbe){console[_0x50022a(0xd0)](_0x50022a(0xce)),logger[_0x50022a(0xd9)](_0x50022a(0x8d),_0x50022a(0xd3)+_0x4d282f[_0x50022a(0xa4)],{'projectDir':_0x39423c,'appCode':_0x4d282f['appCode'],'env':_0x4d282f[_0x50022a(0xe0)],'error':_0x38fcbe instanceof Error?_0x38fcbe['message']:String(_0x38fcbe)});}}logger[_0x50022a(0xc8)](_0x50022a(0x8d),_0x50022a(0xa9)+_0x4d282f[_0x50022a(0xdd)]),_0x5380f2(!![]),_0x37c7c2(![]);}catch(_0x2fd397){logger[_0x50022a(0xbe)](_0x50022a(0x8d),_0x50022a(0xac)+_0x4d282f[_0x50022a(0xdd)],{'error':_0x2fd397 instanceof Error?_0x2fd397[_0x50022a(0xba)]:String(_0x2fd397)});try{a28_0x16d927[_0x50022a(0xdc)](_0x39423c)&&(console[_0x50022a(0xd0)](_0x50022a(0x91)+_0x39423c),a28_0x16d927[_0x50022a(0xb6)](_0x39423c,{'recursive':!![],'force':!![]}));}catch(_0x1597c2){logger[_0x50022a(0xd9)](_0x50022a(0x8d),_0x50022a(0x9e)+_0x39423c,{'error':_0x1597c2 instanceof Error?_0x1597c2[_0x50022a(0xba)]:String(_0x1597c2)});}_0x37c7c2(![]),console[_0x50022a(0xbe)](_0x50022a(0xa2)+(_0x2fd397 instanceof Error?_0x2fd397[_0x50022a(0xba)]:String(_0x2fd397)));}},_0x2e0767=async _0x274ae9=>{const _0x2e1e77=a28_0x47dd;await _0x22ea64({'projectName':_0x274ae9,'env':_0x31756d[_0x2e1e77(0xe0)]});},_0x3a33a7=async(_0x4e46bd,_0x170142,_0x57b047)=>{const _0x4a6668=a28_0x47dd,_0x5df1ff=a28_0x21384f['resolve'](process[_0x4a6668(0xd5)](),_0x4e46bd),_0x126842=a28_0x21384f['join'](_0x5df1ff,_0x4a6668(0xab));try{_0x170142?console['log'](_0x4a6668(0x9f)+_0x4e46bd+'\x20配置应用AppCode:\x20'+_0x170142):console[_0x4a6668(0xd0)](_0x4a6668(0x9f)+_0x4e46bd+_0x4a6668(0xdf));console[_0x4a6668(0xd0)](_0x4a6668(0x92)+_0x126842);const _0x2a599c=fileURLToPath(import.meta[_0x4a6668(0xdb)]),_0x54c6d0=a28_0x21384f[_0x4a6668(0x9a)](a28_0x21384f[_0x4a6668(0xd8)](_0x2a599c),_0x4a6668(0xae)),_0x391872=a28_0x21384f[_0x4a6668(0xda)](_0x54c6d0,_0x4a6668(0xc4));let _0x2cbbce=_0x4a6668(0x8c);try{const _0x3fa74f=JSON[_0x4a6668(0xe6)](a28_0x16d927[_0x4a6668(0xb5)](_0x391872,_0x4a6668(0xbf)));_0x2cbbce=_0x3fa74f[_0x4a6668(0xa7)]||_0x4a6668(0x8c);}catch(_0x1e41ce){}const _0x3fc99f=readConfig(),_0x675a7a=typeof _0x3fc99f[_0x4a6668(0xe0)]===_0x4a6668(0x8b)?_0x3fc99f[_0x4a6668(0xe0)]:undefined,_0x117c11={..._0x3fc99f,'app':_0x170142||'','env':_0x57b047||_0x675a7a||'online','createdAt':new Date()[_0x4a6668(0xe1)](),'version':_0x2cbbce};a28_0x16d927[_0x4a6668(0xaa)](_0x126842,JSON[_0x4a6668(0x96)](_0x117c11,null,0x2),_0x4a6668(0xbf)),_0x170142?console[_0x4a6668(0xd0)]('√\x20配置文件已创建,应用AppCode:\x20'+_0x170142):console[_0x4a6668(0xd0)](_0x4a6668(0x9d)),logger['info'](_0x4a6668(0x8d),_0x4a6668(0xb9)+_0x170142,{'projectName':_0x4e46bd,'configFile':'.lovrabetrc'});}catch(_0x4b77bd){logger[_0x4a6668(0xbe)]('create',_0x4a6668(0xc5)+_0x170142,{'projectName':_0x4e46bd,'error':_0x4b77bd instanceof Error?_0x4b77bd[_0x4a6668(0xba)]:String(_0x4b77bd)});}};useEffect(()=>{_0x31756d['projectCode']&&_0x2e0767(_0x31756d['projectCode']);},[_0x31756d[_0x3e294a(0xd7)]]);if(!_0x2e6429&&!_0x21807e&&!_0x31756d[_0x3e294a(0xd7)])return a28_0x29bf3f(EnhancedGuidedCreate,{'onCreate':_0x22ea64,'env':_0x31756d[_0x3e294a(0xe0)]});if(_0x2e6429)return a28_0x5724bd(a28_0x2f4ba1,{'children':[a28_0x5724bd(Box,{'marginTop':0x1,'children':[a28_0x29bf3f(Box,{'width':'1'}),a28_0x29bf3f(Text,{'color':'green','children':_0x3e294a(0xad)}),a28_0x29bf3f(Text,{'children':'项目名称:\x20'}),a28_0x29bf3f(Text,{'color':'green','children':_0xa7b15d?.[_0x3e294a(0xdd)]}),_0xa7b15d?.['appCode']&&a28_0x5724bd(a28_0x2f4ba1,{'children':[a28_0x29bf3f(Text,{'children':_0x3e294a(0xa8)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'children':_0xa7b15d[_0x3e294a(0xa4)]})]})]}),a28_0x29bf3f(TaskRunning,{..._0x2890c1}),a28_0x29bf3f(TaskRunning,{..._0x90a6e}),a28_0x29bf3f(TaskRunning,{..._0x27989f})]});if(_0x21807e)return a28_0x5724bd(a28_0x2f4ba1,{'children':[a28_0x5724bd(Box,{'marginTop':0x1,'children':[a28_0x29bf3f(Box,{'width':'1'}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xc1),'children':_0x3e294a(0xad)}),a28_0x29bf3f(Text,{'children':_0x3e294a(0xc9)}),a28_0x29bf3f(Text,{'color':'green','children':_0xa7b15d?.[_0x3e294a(0xdd)]}),_0xa7b15d?.[_0x3e294a(0xa4)]&&a28_0x5724bd(a28_0x2f4ba1,{'children':[a28_0x29bf3f(Text,{'children':_0x3e294a(0xa8)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'children':_0xa7b15d[_0x3e294a(0xa4)]})]})]}),a28_0x29bf3f(TaskFinished,{..._0x2890c1}),a28_0x29bf3f(TaskFinished,{..._0x90a6e}),a28_0x29bf3f(TaskFinished,{..._0x27989f}),a28_0x29bf3f(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a28_0x29bf3f(Text,{'color':_0x3e294a(0xc1),'children':'─'[_0x3e294a(0xd1)](0x3c)})}),a28_0x29bf3f(Box,{'children':a28_0x29bf3f(Text,{'color':'green','bold':!![],'children':_0x3e294a(0xbb)})}),a28_0x5724bd(Box,{'marginTop':0x1,'flexDirection':'column','children':[a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'children':_0x3e294a(0xa0)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0x9b),'bold':!![],'children':_0xa7b15d?.[_0x3e294a(0xdd)]})]}),_0xa7b15d?.[_0x3e294a(0xa4)]&&a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'children':_0x3e294a(0xe3)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0x9b),'bold':!![],'children':_0xa7b15d[_0x3e294a(0xa4)]})]}),a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'children':_0x3e294a(0xc3)}),_0xa7b15d?.['pullApi']?a28_0x29bf3f(Text,{'color':_0x3e294a(0xc1),'bold':!![],'children':'已自动拉取\x20✓'}):_0xa7b15d?.['appCode']?a28_0x29bf3f(Text,{'color':_0x3e294a(0xb2),'bold':!![],'children':_0x3e294a(0xa6)}):a28_0x29bf3f(Text,{'color':_0x3e294a(0xb3),'bold':!![],'children':'未配置'})]})]}),a28_0x29bf3f(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'bold':!![],'children':'🚀\x20接下来可以:'})}),a28_0x5724bd(Box,{'marginLeft':0x2,'flexDirection':_0x3e294a(0xc6),'children':[a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':_0x3e294a(0xc1),'children':_0x3e294a(0xde)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0x9b),'children':'启动项目:\x20'}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'bold':!![],'children':_0x3e294a(0x94)+_0xa7b15d?.[_0x3e294a(0xdd)]+_0x3e294a(0xa5)})]}),_0xa7b15d?.[_0x3e294a(0xa4)]&&!_0xa7b15d?.['pullApi']&&a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':_0x3e294a(0xb2),'children':_0x3e294a(0x9c)}),a28_0x29bf3f(Text,{'color':'white','children':'拉取API配置:\x20'}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'bold':!![],'children':_0x3e294a(0x97)})]}),!_0xa7b15d?.['appCode']&&a28_0x5724bd(a28_0x2f4ba1,{'children':[a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':_0x3e294a(0xb3),'children':'2.\x20'}),a28_0x29bf3f(Text,{'color':_0x3e294a(0x9b),'children':_0x3e294a(0xd2)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'bold':!![],'children':_0x3e294a(0xcc)})]}),a28_0x5724bd(Box,{'children':[a28_0x29bf3f(Text,{'color':'gray','children':_0x3e294a(0xc0)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0x9b),'children':_0x3e294a(0xe5)}),a28_0x29bf3f(Text,{'color':_0x3e294a(0xbc),'bold':!![],'children':'lovrabet\x20api\x20pull\x20[app-code]'})]})]})]}),a28_0x29bf3f(Box,{'marginTop':0x1,'children':a28_0x29bf3f(Text,{'color':'green','children':'─'[_0x3e294a(0xd1)](0x3c)})})]});return null;}
|
|
1
|
+
(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 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a29_0x54a2(){var _0x19bb6b=['5307848zdWEiA','930OlhzEd','2734501IXfQty','green','7549WrGnim','240CVmYAY','\x20√\x20','50iTYggu','32823kMKMlI','4zXsvdH','elapsed','8348697DWoiqh','taskName','2456634zzStLq','679135ygFMJt'];a29_0x54a2=function(){return _0x19bb6b;};return a29_0x54a2();}function a29_0x50c3(_0x447372,_0x4071ae){var _0x54a207=a29_0x54a2();return a29_0x50c3=function(_0x50c304,_0x5637d8){_0x50c304=_0x50c304-0x8d;var _0x1b5d79=_0x54a207[_0x50c304];return _0x1b5d79;},a29_0x50c3(_0x447372,_0x4071ae);}(function(_0x1f86d2,_0x4a0609){var _0x2a9926=a29_0x50c3,_0x25d28a=_0x1f86d2();while(!![]){try{var _0x1fa5e7=parseInt(_0x2a9926(0x8e))/0x1*(-parseInt(_0x2a9926(0x8f))/0x2)+-parseInt(_0x2a9926(0x97))/0x3*(-parseInt(_0x2a9926(0x93))/0x4)+-parseInt(_0x2a9926(0x98))/0x5+parseInt(_0x2a9926(0x9a))/0x6*(-parseInt(_0x2a9926(0x92))/0x7)+-parseInt(_0x2a9926(0x99))/0x8+parseInt(_0x2a9926(0x95))/0x9+-parseInt(_0x2a9926(0x91))/0xa*(-parseInt(_0x2a9926(0x9b))/0xb);if(_0x1fa5e7===_0x4a0609)break;else _0x25d28a['push'](_0x25d28a['shift']());}catch(_0x2e60f5){_0x25d28a['push'](_0x25d28a['shift']());}}}(a29_0x54a2,0x881ab));import{jsx as a29_0x38ed74,jsxs as a29_0x1a3986}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';export function TaskFinished(_0x458cbb){var _0xe84ff0=a29_0x50c3;return a29_0x1a3986(Box,{'children':[a29_0x38ed74(Box,{'width':'1'}),a29_0x38ed74(Text,{'color':_0xe84ff0(0x8d),'children':_0xe84ff0(0x90)}),a29_0x38ed74(Text,{'children':_0x458cbb[_0xe84ff0(0x96)]}),a29_0x38ed74(TaskTime,{'elapsed':_0x458cbb[_0xe84ff0(0x94)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x19a307,_0x55a8dc){var _0x222e06=a30_0x3700,_0x590c3d=_0x19a307();while(!![]){try{var _0xece98=-parseInt(_0x222e06(0x72))/0x1+-parseInt(_0x222e06(0x75))/0x2+-parseInt(_0x222e06(0x6f))/0x3*(-parseInt(_0x222e06(0x70))/0x4)+-parseInt(_0x222e06(0x6e))/0x5+parseInt(_0x222e06(0x6a))/0x6*(-parseInt(_0x222e06(0x6c))/0x7)+parseInt(_0x222e06(0x74))/0x8+parseInt(_0x222e06(0x6d))/0x9;if(_0xece98===_0x55a8dc)break;else _0x590c3d['push'](_0x590c3d['shift']());}catch(_0xc1dd5b){_0x590c3d['push'](_0x590c3d['shift']());}}}(a30_0x5bf5,0xa3766));import{jsx as a30_0x1efb8a,jsxs as a30_0x5dc3d7}from'react/jsx-runtime';function a30_0x5bf5(){var _0x5e1781=['1294988Etewog','green','5633742ghxhxR','loading','7ZpoIGN','23009112buWjKK','4486420KtkNcw','1231869OgbkZm','8fOvege','finished','875245dyaEeJ','dots','5205664IovFrC'];a30_0x5bf5=function(){return _0x5e1781;};return a30_0x5bf5();}function a30_0x3700(_0x20dbdb,_0x10b751){var _0x5bf546=a30_0x5bf5();return a30_0x3700=function(_0x3700e9,_0x2882a8){_0x3700e9=_0x3700e9-0x6a;var _0x43d842=_0x5bf546[_0x3700e9];return _0x43d842;},a30_0x3700(_0x20dbdb,_0x10b751);}import{Text}from'ink';import a30_0x574e11 from'ink-spinner';export function TaskLoading(_0xa8e08b){var _0x27d871=a30_0x3700;if(_0xa8e08b[_0x27d871(0x71)])return a30_0x1efb8a(Text,{'color':_0x27d871(0x76),'children':'\x20√\x20'});if(_0xa8e08b[_0x27d871(0x6b)])return a30_0x5dc3d7(Text,{'color':_0x27d871(0x76),'children':['\x20',a30_0x1efb8a(a30_0x574e11,{'type':_0x27d871(0x73)}),'\x20']});return a30_0x1efb8a(Text,{'children':'\x20\x20\x20'});}
|