@lovrabet/cli 1.1.26-beta.8 → 1.1.26-beta.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/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-cdn-version/app-menu-sync-cdn-version-ui.js +1 -1
- package/lib/app-menu-cdn-version/cdn-url-compare-table.js +1 -1
- package/lib/app-menu-cdn-version/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
package/lib/cmd/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a32_0x1c21(_0x5660ec,_0xdd1887){const _0x467a18=a32_0x467a();return a32_0x1c21=function(_0x1c2131,_0x35bd07){_0x1c2131=_0x1c2131-0x127;let _0x93c8ac=_0x467a18[_0x1c2131];return _0x93c8ac;},a32_0x1c21(_0x5660ec,_0xdd1887);}(function(_0x3ba6b2,_0x1edd51){const _0x4955e3=a32_0x1c21,_0x4fdf2d=_0x3ba6b2();while(!![]){try{const _0x132bdc=-parseInt(_0x4955e3(0x13e))/0x1*(-parseInt(_0x4955e3(0x12f))/0x2)+parseInt(_0x4955e3(0x138))/0x3+parseInt(_0x4955e3(0x127))/0x4+parseInt(_0x4955e3(0x136))/0x5*(-parseInt(_0x4955e3(0x128))/0x6)+parseInt(_0x4955e3(0x143))/0x7*(-parseInt(_0x4955e3(0x130))/0x8)+parseInt(_0x4955e3(0x144))/0x9+parseInt(_0x4955e3(0x13c))/0xa;if(_0x132bdc===_0x1edd51)break;else _0x4fdf2d['push'](_0x4fdf2d['shift']());}catch(_0x52c85c){_0x4fdf2d['push'](_0x4fdf2d['shift']());}}}(a32_0x467a,0xc89fd));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a32_0x467a(){const _0x3bc418=['vite\x20preview','.bin','stderr','1633933yqOoFO','3262500vkUCEV','preview','3003324UJxOsE','4836GiNZWI','node_modules','success','close','PATH','now','info','38PcpTBd','56AwGBGt','env','message','inherit','toString','error','805PmHJid','vite','2610705vtFCXX','预览服务器启动出错','pipe','cwd','3079220RgwwGo','trim','15472IiBUMx','预览服务器启动失败'];a32_0x467a=function(){return _0x3bc418;};return a32_0x467a();}import{logger}from'../utils/logger.js';export function runPreview(){return new Promise((_0x33d7b3,_0x1d35cb)=>{const _0x367af1=a32_0x1c21,_0x1ccebe=Date['now']();logger[_0x367af1(0x12e)](_0x367af1(0x145),'启动预览服务器',{'command':'vite\x20preview'});let _0x43c26f='';const _0x3181fe=spawn(_0x367af1(0x137),[_0x367af1(0x145)],{'stdio':[_0x367af1(0x133),_0x367af1(0x133),_0x367af1(0x13a)],'shell':!![],'env':{...process['env'],'PATH':''+join(process[_0x367af1(0x13b)](),_0x367af1(0x129),_0x367af1(0x141))+delimiter+process[_0x367af1(0x131)][_0x367af1(0x12c)]}});_0x3181fe[_0x367af1(0x142)]?.['on']('data',_0x5553c6=>{const _0x28e8f5=_0x367af1;_0x43c26f+=_0x5553c6[_0x28e8f5(0x134)]();}),_0x3181fe['on'](_0x367af1(0x12b),_0x461b0b=>{const _0x42f807=_0x367af1,_0x1aca06=Date[_0x42f807(0x12d)]()-_0x1ccebe;if(_0x461b0b===0x0||_0x461b0b===null)logger[_0x42f807(0x12a)](_0x42f807(0x145),'预览服务器启动成功',_0x1aca06),_0x33d7b3();else{const _0x47a633={'exitCode':_0x461b0b,'duration':_0x1aca06,'command':_0x42f807(0x140),'cwd':process[_0x42f807(0x13b)]()};_0x43c26f[_0x42f807(0x13d)]()&&(_0x47a633[_0x42f807(0x142)]=_0x43c26f['trim']()),logger['error'](_0x42f807(0x145),_0x42f807(0x13f),_0x47a633),_0x1d35cb(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x461b0b));}}),_0x3181fe['on'](_0x367af1(0x135),_0x4d7d01=>{const _0x5b9b35=_0x367af1,_0x4eacb1=Date['now']()-_0x1ccebe;logger[_0x5b9b35(0x135)](_0x5b9b35(0x145),_0x5b9b35(0x139),{'error':_0x4d7d01[_0x5b9b35(0x132)],'duration':_0x4eacb1,'stderr':_0x43c26f[_0x5b9b35(0x13d)]()||undefined}),_0x1d35cb(_0x4d7d01);});});}
|
package/lib/cmd/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x358889,_0x48836c){const _0x294176=a33_0x1bbe,_0x344725=_0x358889();while(!![]){try{const _0x5f08fe=parseInt(_0x294176(0xb5))/0x1+-parseInt(_0x294176(0xb1))/0x2*(parseInt(_0x294176(0xc6))/0x3)+-parseInt(_0x294176(0xcd))/0x4*(-parseInt(_0x294176(0xc4))/0x5)+-parseInt(_0x294176(0xc0))/0x6*(parseInt(_0x294176(0xcb))/0x7)+parseInt(_0x294176(0xbe))/0x8*(parseInt(_0x294176(0xce))/0x9)+parseInt(_0x294176(0xb6))/0xa+parseInt(_0x294176(0xb3))/0xb;if(_0x5f08fe===_0x48836c)break;else _0x344725['push'](_0x344725['shift']());}catch(_0x274a53){_0x344725['push'](_0x344725['shift']());}}}(a33_0x2b53,0xe0d57));function a33_0x1bbe(_0x14257d,_0x42abac){const _0x2b5301=a33_0x2b53();return a33_0x1bbe=function(_0x1bbea6,_0x9696d6){_0x1bbea6=_0x1bbea6-0xae;let _0x4f0b8b=_0x2b5301[_0x1bbea6];return _0x4f0b8b;},a33_0x1bbe(_0x14257d,_0x42abac);}function a33_0x2b53(){const _0x15a287=['data','now','info','close','8GHWZVb','pipe','10812036CGKrIV','cwd','trim','inherit','539160hetyfi','stderr','4978245cFRRVj','node_modules','message','开发服务器启动成功','vite','7FLojnp','env','48bdiQPS','11026413XqNOcs','toString','.bin','write','start','2LDepYV','启动开发服务器','2770240OSddiz','PATH','717343imYiMB','8940160cKXqDp','vite\x20exited\x20with\x20code\x20','开发服务器启动失败','error'];a33_0x2b53=function(){return _0x15a287;};return a33_0x2b53();}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runStart(_0x2b33d9){return new Promise((_0x1c4ba2,_0x28630c)=>{const _0x4684b3=a33_0x1bbe,_0x496db2=Date['now'](),_0x1900ad=_0x2b33d9||process[_0x4684b3(0xc1)]();logger[_0x4684b3(0xbc)]('start',_0x4684b3(0xb2),{'command':_0x4684b3(0xca),'cwd':_0x1900ad});let _0x1bdf20='';const _0x2f730f=spawn('vite',{'stdio':[_0x4684b3(0xc3),'inherit',_0x4684b3(0xbf)],'shell':!![],'cwd':_0x1900ad,'env':{...process[_0x4684b3(0xcc)],'PATH':''+join(_0x1900ad,_0x4684b3(0xc7),_0x4684b3(0xae))+delimiter+process[_0x4684b3(0xcc)][_0x4684b3(0xb4)]}});_0x2f730f[_0x4684b3(0xc5)]?.['on'](_0x4684b3(0xba),_0x518d5b=>{const _0xac9dd1=_0x4684b3,_0x35da87=_0x518d5b[_0xac9dd1(0xcf)]();_0x1bdf20+=_0x35da87,process[_0xac9dd1(0xc5)][_0xac9dd1(0xaf)](_0x35da87);}),_0x2f730f['on'](_0x4684b3(0xbd),_0x4575b7=>{const _0x495eb7=_0x4684b3,_0x1ec8bf=Date[_0x495eb7(0xbb)]()-_0x496db2;if(_0x4575b7===0x0||_0x4575b7===null)logger['success'](_0x495eb7(0xb0),_0x495eb7(0xc9),_0x1ec8bf),_0x1c4ba2();else{const _0x4e89c0={'exitCode':_0x4575b7,'duration':_0x1ec8bf,'command':_0x495eb7(0xca),'cwd':_0x1900ad};_0x1bdf20[_0x495eb7(0xc2)]()&&(_0x4e89c0[_0x495eb7(0xc5)]=_0x1bdf20[_0x495eb7(0xc2)]()),logger['error'](_0x495eb7(0xb0),_0x495eb7(0xb8),_0x4e89c0),_0x28630c(new Error(_0x495eb7(0xb7)+_0x4575b7));}}),_0x2f730f['on'](_0x4684b3(0xb9),_0x16919e=>{const _0x781649=_0x4684b3,_0x578085=Date[_0x781649(0xbb)]()-_0x496db2,_0x4a9eca={'error':_0x16919e[_0x781649(0xc8)],'duration':_0x578085,'command':_0x781649(0xca),'cwd':_0x1900ad};_0x1bdf20['trim']()&&(_0x4a9eca[_0x781649(0xc5)]=_0x1bdf20[_0x781649(0xc2)]()),logger[_0x781649(0xb9)](_0x781649(0xb0),'开发服务器启动出错',_0x4a9eca),_0x28630c(_0x16919e);});});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4ed6a9,_0x18846f){const _0x3f918d=a34_0x10de,_0x95ca17=_0x4ed6a9();while(!![]){try{const _0xfb7ef6=-parseInt(_0x3f918d(0x131))/0x1+parseInt(_0x3f918d(0x12e))/0x2*(parseInt(_0x3f918d(0x134))/0x3)+-parseInt(_0x3f918d(0x13d))/0x4+-parseInt(_0x3f918d(0x139))/0x5*(-parseInt(_0x3f918d(0x13c))/0x6)+parseInt(_0x3f918d(0x138))/0x7*(parseInt(_0x3f918d(0x141))/0x8)+-parseInt(_0x3f918d(0x12a))/0x9*(parseInt(_0x3f918d(0x13a))/0xa)+parseInt(_0x3f918d(0x12b))/0xb;if(_0xfb7ef6===_0x18846f)break;else _0x95ca17['push'](_0x95ca17['shift']());}catch(_0x27455a){_0x95ca17['push'](_0x95ca17['shift']());}}}(a34_0x15ae,0x6b533));function a34_0x10de(_0x2f11d8,_0x536088){const _0x15ae75=a34_0x15ae();return a34_0x10de=function(_0x10de14,_0x774983){_0x10de14=_0x10de14-0x12a;let _0x1f8770=_0x15ae75[_0x10de14];return _0x1f8770;},a34_0x10de(_0x2f11d8,_0x536088);}function a34_0x15ae(){const _0x43a1e3=['4456302bruDkF','2601468HdsnDC','gray','无效的命令,可用命令如下:','lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','3056VSUkQy','command','lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','获取配置项','419751BJHNtg','8027910yVnLuR','设置配置项','column','116PXDPhT','\x20\x20\x20\x20','列出所有配置项','339201WYsrDr','map','配置当前项目的\x20App\x20Code','14874rWwKca','lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','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','5901GMhcrK','5fUifSo','140byoJRO','description'];a34_0x15ae=function(){return _0x43a1e3;};return a34_0x15ae();}import{jsxs as a34_0x4bcd7c,jsx as a34_0x201823}from'react/jsx-runtime';import{Box,Text}from'ink';export function ConfigHelp(){const _0x59133d=a34_0x10de,_0x3e73db=[{'command':_0x59133d(0x135),'description':_0x59133d(0x12c)},{'command':_0x59133d(0x136),'description':_0x59133d(0x144)},{'command':_0x59133d(0x143),'description':_0x59133d(0x130)}],_0x1f2e64=[{'command':_0x59133d(0x140),'description':_0x59133d(0x133)},{'command':_0x59133d(0x137),'description':'设置环境\x20(online/daily)'}];return a34_0x4bcd7c(Box,{'flexDirection':_0x59133d(0x12d),'marginTop':0x1,'marginBottom':0x1,'children':[a34_0x201823(Box,{'marginBottom':0x1,'children':a34_0x4bcd7c(Text,{'color':_0x59133d(0x13e),'children':['\x20!','\x20\x20',_0x59133d(0x13f)]})}),_0x3e73db['map'](_0x2a6019=>a34_0x4bcd7c(Box,{'children':[a34_0x4bcd7c(Text,{'children':[_0x59133d(0x12f),_0x2a6019[_0x59133d(0x142)]]}),a34_0x201823(Text,{'color':'gray','children':_0x2a6019['description']})]},_0x2a6019[_0x59133d(0x142)])),a34_0x201823(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x201823(Text,{'color':_0x59133d(0x13e),'children':'\x20*\x20配置示例:'})}),_0x1f2e64[_0x59133d(0x132)](_0x4bcf87=>a34_0x4bcd7c(Box,{'children':[a34_0x4bcd7c(Text,{'children':['\x20\x20\x20\x20',_0x4bcf87[_0x59133d(0x142)]]}),a34_0x201823(Text,{'color':_0x59133d(0x13e),'children':_0x4bcf87[_0x59133d(0x13b)]})]},_0x4bcf87['command']))]});}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4acb1f,_0x538b5f){const _0x2d5ce9=a35_0x4ef9,_0x11d9c8=_0x4acb1f();while(!![]){try{const _0x3d62cb=parseInt(_0x2d5ce9(0x101))/0x1+parseInt(_0x2d5ce9(0x10d))/0x2*(parseInt(_0x2d5ce9(0x100))/0x3)+parseInt(_0x2d5ce9(0x10b))/0x4+parseInt(_0x2d5ce9(0x102))/0x5+parseInt(_0x2d5ce9(0x119))/0x6+-parseInt(_0x2d5ce9(0x113))/0x7*(parseInt(_0x2d5ce9(0x107))/0x8)+-parseInt(_0x2d5ce9(0x10e))/0x9;if(_0x3d62cb===_0x538b5f)break;else _0x11d9c8['push'](_0x11d9c8['shift']());}catch(_0x1bba0a){_0x11d9c8['push'](_0x11d9c8['shift']());}}}(a35_0x8f2c,0x83202));import{jsx as a35_0x1d821d,jsxs as a35_0x527bb4}from'react/jsx-runtime';import{existsSync,readFileSync,writeFileSync}from'node:fs';function a35_0x8f2c(){const _0x220a3e=['red','utf8','app','error','3063VFRASu','593028IJAKeV','5096240LvvVYB','message','log','input','get','1032QADych','includes','help','未提供配置值','3873716GtPkuW','env','932qyhivp','20617560JvtZcQ','环境配置值只能是\x20\x22online\x22\x20或\x20\x22daily\x22','parse','unlinkSync','环境配置已设置为:\x20','38066FTcBpG','length','undefined','保存配置失败:\x20','配置值无效或过长','set','2837646EsIeQN','appcode','online','renameSync','dirname'];a35_0x8f2c=function(){return _0x220a3e;};return a35_0x8f2c();}import a35_0x578934 from'node:fs';import a35_0x1917e8 from'node:path';function a35_0x4ef9(_0x5717f2,_0x213fc6){const _0x8f2ca6=a35_0x8f2c();return a35_0x4ef9=function(_0x4ef964,_0x221d6d){_0x4ef964=_0x4ef964-0xfd;let _0x1a86fe=_0x8f2ca6[_0x4ef964];return _0x1a86fe;},a35_0x4ef9(_0x5717f2,_0x213fc6);}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(_0x272337){const _0x4b21f5=a35_0x4ef9,{cli:_0x2c8494}=_0x272337,_0x37d7be=_0x2c8494[_0x4b21f5(0x105)][0x1],_0x1f3b09=_0x2c8494[_0x4b21f5(0x105)][0x2],_0x4fab33=[_0x4b21f5(0x118),_0x4b21f5(0x106)][_0x4b21f5(0x108)](_0x37d7be||''),_0x2e2f62=_0x2c8494[_0x4b21f5(0x105)][_0x4b21f5(0x114)]>=0x3;if(_0x1f3b09==='--help'||_0x2c8494['flags'][_0x4b21f5(0x109)])return a35_0x1d821d(ConfigHelp,{});const _0x10708c=readConfig();if(_0x37d7be===_0x4b21f5(0x118)){if(_0x1f3b09){const _0x5a0b50=_0x2c8494['input'][0x3];if(typeof _0x5a0b50!=='undefined'){if(_0x1f3b09==='env'&&![_0x4b21f5(0x11b),'daily'][_0x4b21f5(0x108)](_0x5a0b50))return a35_0x1d821d(Box,{'children':a35_0x1d821d(Text,{'color':_0x4b21f5(0x11e),'children':_0x4b21f5(0x10f)})});const _0x225fd4=isInProject(),_0x43b3fd=_0x225fd4?projectConfigPath:globalConfigPath;let _0x57ec69={};try{if(existsSync(_0x43b3fd)){const _0x165ab9=readFileSync(_0x43b3fd,{'encoding':_0x4b21f5(0xfd)});_0x165ab9&&(_0x57ec69=JSON[_0x4b21f5(0x110)](_0x165ab9));}}catch(_0x279990){}if(typeof _0x5a0b50!=='string'||_0x5a0b50[_0x4b21f5(0x114)]>0x1f4)return a35_0x1d821d(Box,{'children':a35_0x1d821d(Text,{'color':_0x4b21f5(0x11e),'children':_0x4b21f5(0x117)})});let _0x3871d1=_0x1f3b09;_0x1f3b09===_0x4b21f5(0xfe)&&(_0x3871d1=_0x4b21f5(0x11a),delete _0x57ec69[_0x4b21f5(0xfe)]);_0x1f3b09===_0x4b21f5(0x11a)&&delete _0x57ec69[_0x4b21f5(0xfe)];_0x57ec69[_0x3871d1]=_0x5a0b50;try{const _0x1964ab=a35_0x1917e8[_0x4b21f5(0x11d)](_0x43b3fd);!existsSync(_0x1964ab)&&a35_0x578934['mkdirSync'](_0x1964ab,{'recursive':!![]});const _0x3da0e9=_0x43b3fd+'.tmp';writeFileSync(_0x3da0e9,JSON['stringify'](_0x57ec69,null,0x2),{'encoding':'utf8','mode':0x180}),a35_0x578934[_0x4b21f5(0x11c)](_0x3da0e9,_0x43b3fd);if(_0x1f3b09===_0x4b21f5(0x10c)){const _0x2facdd=_0x225fd4?'项目':'全局';console[_0x4b21f5(0x104)]('✓\x20'+_0x2facdd+_0x4b21f5(0x112)+_0x5a0b50);}}catch(_0x3d0a54){const _0x4afb7f=_0x43b3fd+'.tmp';try{existsSync(_0x4afb7f)&&a35_0x578934[_0x4b21f5(0x111)](_0x4afb7f);}catch(_0x598006){}return logger[_0x4b21f5(0xff)]('config','保存配置失败',{'error':_0x3d0a54 instanceof Error?_0x3d0a54[_0x4b21f5(0x103)]:String(_0x3d0a54),'configKey':_0x1f3b09,'configValue':_0x5a0b50,'targetConfigPath':_0x43b3fd}),a35_0x1d821d(Box,{'children':a35_0x527bb4(Text,{'color':_0x4b21f5(0x11e),'children':[_0x4b21f5(0x116),_0x3d0a54 instanceof Error?_0x3d0a54[_0x4b21f5(0x103)]:String(_0x3d0a54)]})});}return null;}return a35_0x1d821d(Box,{'children':a35_0x1d821d(Text,{'color':'red','children':_0x4b21f5(0x10a)})});}}if(_0x37d7be===_0x4b21f5(0x106)){if(_0x1f3b09){let _0x42de4e=_0x1f3b09;return _0x1f3b09===_0x4b21f5(0xfe)&&(_0x42de4e='appcode'),console[_0x4b21f5(0x104)](_0x10708c[_0x42de4e]||_0x4b21f5(0x115)),null;}return null;}if(_0x37d7be==='list')return console[_0x4b21f5(0x104)](JSON['stringify'](_0x10708c,null,0x2)),null;if(!_0x4fab33||!_0x2e2f62)return a35_0x1d821d(ConfigHelp,{});return null;}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a36_0x4784(_0x1acc9b,_0x4288f4){const _0x410653=a36_0x4106();return a36_0x4784=function(_0x47840d,_0x5ad935){_0x47840d=_0x47840d-0xb6;let _0x9234a7=_0x410653[_0x47840d];return _0x9234a7;},a36_0x4784(_0x1acc9b,_0x4288f4);}const a36_0x5927d5=a36_0x4784;function a36_0x4106(){const _0xb67948=['https://user.lovrabet.com','1590015dkoeuX','738515NBQSEK','1909596ypDulw','https://daily-api.lovrabet.com','4082742nxHqMV','21OFZrQX','online','1364986JtcjhE','8702008yTXsCs','https://user-daily.lovrabet.com','6YyQKRu','2054692vgiIop'];a36_0x4106=function(){return _0xb67948;};return a36_0x4106();}(function(_0x3f567a,_0x4ecbdc){const _0x18eb35=a36_0x4784,_0xbf4067=_0x3f567a();while(!![]){try{const _0x421a68=-parseInt(_0x18eb35(0xb8))/0x1+parseInt(_0x18eb35(0xbf))/0x2+parseInt(_0x18eb35(0xc2))/0x3*(parseInt(_0x18eb35(0xb6))/0x4)+parseInt(_0x18eb35(0xb9))/0x5+parseInt(_0x18eb35(0xba))/0x6*(-parseInt(_0x18eb35(0xbd))/0x7)+parseInt(_0x18eb35(0xc0))/0x8+parseInt(_0x18eb35(0xbc))/0x9;if(_0x421a68===_0x4ecbdc)break;else _0xbf4067['push'](_0xbf4067['shift']());}catch(_0x27501f){_0xbf4067['push'](_0xbf4067['shift']());}}}(a36_0x4106,0xd0866));import{getEnv}from'./env.js';export const getUserDomain=()=>getEnv()===a36_0x5927d5(0xbe)?a36_0x5927d5(0xb7):a36_0x5927d5(0xc1);export const getApiDomain=()=>getEnv()===a36_0x5927d5(0xbe)?'https://api.lovrabet.com':a36_0x5927d5(0xbb);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a37_0x25d0(){const _0x1f600f=['291RFElUU','LOVRABET_ENV','10748568NEopOT','5712gMCTvW','7924fJTddD','12273580mUfpyD','18284QdyloH','9WBrmnP','3517162foAwMi','3894790tokEbW','27442GpRIgA','180FXRSDv','env','online','10GIarum'];a37_0x25d0=function(){return _0x1f600f;};return a37_0x25d0();}const a37_0x3befd4=a37_0x4fd8;(function(_0x2fd3c6,_0x42a286){const _0x423191=a37_0x4fd8,_0x3133b4=_0x2fd3c6();while(!![]){try{const _0x3d2b63=parseInt(_0x423191(0x11d))/0x1*(-parseInt(_0x423191(0x121))/0x2)+-parseInt(_0x423191(0x122))/0x3*(-parseInt(_0x423191(0x119))/0x4)+-parseInt(_0x423191(0x11c))/0x5+parseInt(_0x423191(0x116))/0x6*(-parseInt(_0x423191(0x117))/0x7)+-parseInt(_0x423191(0x124))/0x8*(parseInt(_0x423191(0x11a))/0x9)+-parseInt(_0x423191(0x118))/0xa+-parseInt(_0x423191(0x11b))/0xb*(-parseInt(_0x423191(0x11e))/0xc);if(_0x3d2b63===_0x42a286)break;else _0x3133b4['push'](_0x3133b4['shift']());}catch(_0x37a83e){_0x3133b4['push'](_0x3133b4['shift']());}}}(a37_0x25d0,0xa4bc4));function a37_0x4fd8(_0x1e283a,_0x3585ed){const _0x25d0cd=a37_0x25d0();return a37_0x4fd8=function(_0x4fd87f,_0x492387){_0x4fd87f=_0x4fd87f-0x116;let _0x42ae0a=_0x25d0cd[_0x4fd87f];return _0x42ae0a;},a37_0x4fd8(_0x1e283a,_0x3585ed);}let env=process[a37_0x3befd4(0x11f)][a37_0x3befd4(0x123)]||a37_0x3befd4(0x120);export function getEnv(){return env;}export function initEnv(_0xbeff7e){env=_0xbeff7e;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5af969,_0x2ad281){const _0x134089=a38_0x2f13,_0x163133=_0x5af969();while(!![]){try{const _0x2076ff=parseInt(_0x134089(0x77))/0x1+-parseInt(_0x134089(0x93))/0x2*(-parseInt(_0x134089(0x96))/0x3)+-parseInt(_0x134089(0xb4))/0x4*(parseInt(_0x134089(0x9f))/0x5)+-parseInt(_0x134089(0x99))/0x6*(-parseInt(_0x134089(0x9e))/0x7)+parseInt(_0x134089(0x95))/0x8+parseInt(_0x134089(0x9d))/0x9+-parseInt(_0x134089(0xb1))/0xa*(parseInt(_0x134089(0xa5))/0xb);if(_0x2076ff===_0x2ad281)break;else _0x163133['push'](_0x163133['shift']());}catch(_0x387ef3){_0x163133['push'](_0x163133['shift']());}}}(a38_0x4213,0xa4203));import{jsx as a38_0xeb10be,jsxs as a38_0x220895,Fragment as a38_0x17a304}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 a38_0x2f13(_0x22f305,_0x25ce94){const _0x4213d2=a38_0x4213();return a38_0x2f13=function(_0x2f1353,_0x4ba19c){_0x2f1353=_0x2f1353-0x77;let _0x490b12=_0x4213d2[_0x2f1353];return _0x490b12;},a38_0x2f13(_0x22f305,_0x25ce94);}export function EnhancedGuidedCreate(_0x348036){const _0x20e787=a38_0x2f13,{onCreate:_0x1e418d,env:_0x28f42f}=_0x348036,[_0xd9daf,_0x5e0757]=useState(_0x20e787(0x90)),[_0x2b72e5,_0xbfb1b6]=useState(''),[_0x27e6a3,_0x343eeb]=useState(''),[_0x2980cd,_0x4d7989]=useState(''),[_0x7a1c1e,_0x551e03]=useState(''),[_0xd1772b,_0x8d58c0]=useState([]),[_0x20eef6,_0x40c854]=useState(null),[_0x1ab71d,_0x1d71ab]=useState(![]),[_0x244d1d,_0x45942f]=useState(![]),[_0x17d07c,_0x1c88e2]=useState(![]),[_0x59139a,_0x5d3c74]=useState(0x0),[_0x57b872,_0x26efb4]=useState(0x0),_0x31a2c3='my-app',_0x3207bc=readConfig(),_0x131d3e=typeof _0x3207bc['env']===_0x20e787(0xab)?_0x3207bc[_0x20e787(0x8b)]:undefined;function _0x426ce6(_0x243867){const _0x82d14f=_0x20e787;if(_0x243867[_0x82d14f(0x89)]>0x32)return{'valid':![],'message':_0x82d14f(0xad)};const _0x4f62c5=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x243867?.[_0x82d14f(0xb6)]()&&!_0x4f62c5[_0x82d14f(0xa1)](_0x243867))return{'valid':![],'message':_0x82d14f(0x92)};return{'valid':!![]};}function _0x599030(_0x36f95c){const _0x30de98=_0x20e787;if(!_0x36f95c['trim']())return{'valid':!![]};if(_0x36f95c[_0x30de98(0x89)]>0x64)return{'valid':![],'message':'应用AppCode长度不能超过\x20100\x20个字符'};const _0x1dc477=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x1dc477[_0x30de98(0xa1)](_0x36f95c))return{'valid':![],'message':_0x30de98(0x85)};return{'valid':!![]};}async function _0x29f897(){_0x1d71ab(!![]);try{const _0x40f62c=await getIsSessionValid();return _0x40c854(_0x40f62c),_0x40f62c;}catch(_0x515823){return _0x40c854(![]),![];}finally{_0x1d71ab(![]);}}async function _0x231d19(){_0x45942f(!![]);try{const _0x513ff2=await authServer({'silent':!![]});return _0x40c854(_0x513ff2),_0x513ff2;}catch(_0x3596dc){return _0x40c854(![]),![];}finally{_0x45942f(![]);}}return useInput(async(_0x458735,_0x3684b5)=>{const _0x34662a=_0x20e787;if(_0x3684b5[_0x34662a(0x81)]||_0x3684b5['rightArrow']){if(_0xd9daf===_0x34662a(0xac)){_0x5d3c74(_0x442f72=>_0x442f72===0x0?0x1:0x0);return;}if(_0xd9daf===_0x34662a(0xa0)){_0x26efb4(_0x4b1545=>_0x4b1545===0x0?0x1:0x0);return;}}if(_0x3684b5['return']){if(_0xd9daf==='project-name'){const _0x1fd8bf=_0x2980cd[_0x34662a(0xb6)]()||_0x31a2c3;if(_0x7a1c1e)return;_0xbfb1b6(_0x1fd8bf),_0x8d58c0([{'step':_0x34662a(0x90),'label':_0x34662a(0x98),'value':_0x1fd8bf}]),_0x4d7989(''),_0x551e03(''),_0x5e0757(_0x34662a(0x80));return;}if(_0xd9daf===_0x34662a(0x80)){if(_0x7a1c1e)return;const _0x308b30=_0x2980cd[_0x34662a(0xb6)]();_0x343eeb(_0x308b30),_0x8d58c0(_0x476264=>[..._0x476264,{'step':_0x34662a(0x80),'label':_0x34662a(0x7d),'value':_0x308b30||_0x34662a(0x7f)}]),_0x4d7989(''),_0x551e03('');if(_0x308b30){_0x5e0757(_0x34662a(0x8d));const _0x2d49fe=await _0x29f897();_0x2d49fe?_0x5e0757('confirm-api-pull'):_0x5e0757(_0x34662a(0xa0));}else{const _0x5e014d=_0x28f42f||_0x131d3e||_0x34662a(0x86);_0x1e418d({'projectName':_0x2b72e5,'appCode':undefined,'pullApi':![],'env':_0x5e014d}),_0x5e0757(_0x34662a(0xb7));}return;}if(_0xd9daf==='confirm-api-pull'){const _0x5dd81d=_0x59139a===0x0;_0x1c88e2(_0x5dd81d),_0x8d58c0(_0x39b557=>[..._0x39b557,{'step':_0x34662a(0xa7),'label':_0x34662a(0xb3),'value':_0x5dd81d?'是':'否'}]);const _0x3e33eb=_0x28f42f||_0x131d3e||_0x34662a(0x86);_0x1e418d({'projectName':_0x2b72e5,'appCode':_0x27e6a3,'pullApi':_0x5dd81d,'env':_0x3e33eb}),_0x5e0757(_0x34662a(0xb7));return;}if(_0xd9daf===_0x34662a(0xa0)){const _0xba76bb=_0x57b872===0x0;if(_0xba76bb){_0x5e0757('login-process');const _0x4e30bc=await _0x231d19();if(_0x4e30bc)_0x8d58c0(_0x4ec68a=>[..._0x4ec68a,{'step':_0x34662a(0x83),'label':'登录状态','value':_0x34662a(0x7a)}]),_0x5e0757('confirm-api-pull');else{_0x8d58c0(_0x5754df=>[..._0x5754df,{'step':_0x34662a(0x83),'label':_0x34662a(0xa4),'value':_0x34662a(0xa6)}]);const _0x44421e=_0x28f42f||_0x131d3e||_0x34662a(0x86);_0x1e418d({'projectName':_0x2b72e5,'appCode':_0x27e6a3,'pullApi':![],'env':_0x44421e}),_0x5e0757(_0x34662a(0xb7));}}else{_0x8d58c0(_0xb6a6de=>[..._0xb6a6de,{'step':_0x34662a(0x83),'label':_0x34662a(0xa4),'value':_0x34662a(0xaa)}]);const _0x539746=_0x28f42f||_0x131d3e||'online';_0x1e418d({'projectName':_0x2b72e5,'appCode':_0x27e6a3,'pullApi':![],'env':_0x539746}),_0x5e0757('creating');}return;}}if(_0x3684b5[_0x34662a(0x8a)]||_0x3684b5[_0x34662a(0x79)]){_0x4d7989(_0x3f4d06=>{const _0x1cb512=_0x34662a,_0x59b579=_0x3f4d06[_0x1cb512(0xae)](0x0,-0x1);if(_0xd9daf===_0x1cb512(0x90)){const {valid:_0x3e098c,message:_0x494eee}=_0x426ce6(_0x59b579);_0x551e03(_0x3e098c?'':_0x494eee||_0x1cb512(0xa2));}else{if(_0xd9daf===_0x1cb512(0x80)){const {valid:_0x1641f9,message:_0x41f34d}=_0x599030(_0x59b579);_0x551e03(_0x1641f9?'':_0x41f34d||_0x1cb512(0x8e));}}return _0x59b579;});return;}if(['creating','login-check',_0x34662a(0x8f)]['includes'](_0xd9daf))return;if(_0xd9daf===_0x34662a(0xac)||_0xd9daf===_0x34662a(0xa0))return;_0x4d7989(_0x55d2da=>{const _0x47b445=_0x34662a,_0x4086bc=_0x55d2da+_0x458735;if(_0xd9daf===_0x47b445(0x90)){const {valid:_0x391a5f,message:_0x493409}=_0x426ce6(_0x4086bc);_0x551e03(_0x391a5f?'':_0x493409||_0x47b445(0xa2));}else{if(_0xd9daf===_0x47b445(0x80)){const {valid:_0x12947c,message:_0x436567}=_0x599030(_0x4086bc);_0x551e03(_0x12947c?'':_0x436567||_0x47b445(0x8e));}}return _0x4086bc;});}),a38_0x220895(Box,{'flexDirection':_0x20e787(0xb8),'marginTop':0x1,'children':[_0xd1772b['length']===0x0&&a38_0xeb10be(Box,{'children':a38_0xeb10be(Text,{'color':'cyan','children':_0x20e787(0x7e)})}),_0xd1772b[_0x20e787(0xb0)](_0x502dab=>a38_0x220895(Box,{'children':[a38_0x220895(Text,{'color':_0x20e787(0x82),'children':['√\x20',_0x502dab[_0x20e787(0x88)],':\x20']}),a38_0xeb10be(Text,{'color':'cyan','children':_0x502dab[_0x20e787(0x78)]})]},_0x502dab['step'])),_0xd9daf==='project-name'&&a38_0x220895(a38_0x17a304,{'children':[a38_0x220895(Box,{'children':[a38_0xeb10be(Text,{'children':_0x20e787(0x97)}),_0x2980cd?a38_0xeb10be(Text,{'color':_0x20e787(0x82),'children':_0x2980cd}):a38_0xeb10be(Text,{'color':_0x20e787(0x8c),'children':_0x31a2c3}),_0x7a1c1e&&a38_0x220895(Text,{'color':_0x20e787(0xa9),'children':[_0x20e787(0x94),_0x7a1c1e]})]}),!_0x7a1c1e&&!_0x2980cd&&a38_0xeb10be(Box,{'children':a38_0xeb10be(Text,{'color':'gray','children':_0x20e787(0xaf)})})]}),_0xd9daf===_0x20e787(0x80)&&a38_0x220895(a38_0x17a304,{'children':[a38_0x220895(Box,{'children':[a38_0xeb10be(Text,{'children':_0x20e787(0xa3)}),a38_0xeb10be(Text,{'color':_0x20e787(0x8c),'children':'[可选]:\x20'}),a38_0xeb10be(Text,{'color':'green','children':_0x2980cd}),_0x7a1c1e&&a38_0x220895(Text,{'color':_0x20e787(0xa9),'children':['\x20←\x20',_0x7a1c1e]})]}),!_0x7a1c1e&&a38_0xeb10be(Box,{'children':a38_0x220895(Text,{'color':_0x20e787(0x8c),'children':['\x20',_0x20e787(0x9a)]})})]}),_0xd9daf===_0x20e787(0x8d)&&a38_0x220895(Box,{'children':[a38_0xeb10be(Text,{'children':_0x20e787(0x91)}),_0x1ab71d&&a38_0xeb10be(Text,{'color':_0x20e787(0x8c),'children':_0x20e787(0x87)})]}),_0xd9daf===_0x20e787(0xac)&&a38_0x220895(a38_0x17a304,{'children':[a38_0xeb10be(Box,{'children':a38_0xeb10be(Text,{'color':_0x20e787(0x82),'children':'√\x20检测到有效登录状态'})}),a38_0xeb10be(Box,{'marginTop':0x1,'children':a38_0xeb10be(Text,{'children':_0x20e787(0x9b)})}),a38_0x220895(Box,{'marginLeft':0x2,'children':[a38_0x220895(Text,{'color':_0x59139a===0x0?_0x20e787(0x82):_0x20e787(0x8c),'children':[_0x59139a===0x0?'▶\x20':'\x20\x20',_0x20e787(0xa8)]}),a38_0xeb10be(Text,{'children':'\x20'}),a38_0x220895(Text,{'color':_0x59139a===0x1?_0x20e787(0x82):_0x20e787(0x8c),'children':[_0x59139a===0x1?'▶\x20':'\x20\x20','No']})]}),a38_0xeb10be(Box,{'children':a38_0xeb10be(Text,{'color':_0x20e787(0x8c),'children':_0x20e787(0xb9)})}),a38_0xeb10be(Box,{'children':a38_0xeb10be(Text,{'color':_0x20e787(0x9c),'children':_0x20e787(0xb2)})})]}),_0xd9daf==='login-prompt'&&a38_0x220895(a38_0x17a304,{'children':[a38_0xeb10be(Box,{'children':a38_0xeb10be(Text,{'color':'yellow','children':_0x20e787(0x7c)})}),a38_0xeb10be(Box,{'marginTop':0x1,'children':a38_0xeb10be(Text,{'children':_0x20e787(0x7b)})}),a38_0x220895(Box,{'marginLeft':0x2,'children':[a38_0x220895(Text,{'color':_0x57b872===0x0?'green':'gray','children':[_0x57b872===0x0?'▶\x20':'\x20\x20',_0x20e787(0xa8)]}),a38_0xeb10be(Text,{'children':'\x20'}),a38_0x220895(Text,{'color':_0x57b872===0x1?'green':'gray','children':[_0x57b872===0x1?'▶\x20':'\x20\x20','No']})]}),a38_0xeb10be(Box,{'children':a38_0xeb10be(Text,{'color':_0x20e787(0x8c),'children':_0x20e787(0xb9)})}),a38_0xeb10be(Box,{'children':a38_0xeb10be(Text,{'color':_0x20e787(0x9c),'children':_0x20e787(0xb5)})})]}),_0xd9daf==='login-process'&&a38_0x220895(Box,{'children':[a38_0xeb10be(Text,{'children':_0x20e787(0x84)}),_0x244d1d&&a38_0xeb10be(Text,{'color':'gray','children':'\x20登录中...'})]})]});}function a38_0x4213(){const _0xc2896e=['181108iIfvxd','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','trim','creating','column','\x20\x20使用\x20←→\x20选择,回车确认','1323503NuIDTn','value','delete','已登录','*\x20是否要先登录以便拉取\x20API\x20配置?','!\x20未检测到有效登录','应用AppCode','*\x20创建新项目','未设置','app-code','leftArrow','green','login','*\x20正在登录,请前往浏览器完成登录...','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','online','\x20检查中...','label','length','backspace','env','gray','login-check','应用AppCode不合法','login-process','project-name','*\x20正在检查登录状态...','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','417986SgaKyW','\x20←\x20','2251128cTCmIP','3ZBuxot','*\x20项目名:\x20','项目名','203688bcScfQ','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','*\x20是否要自动拉取\x20API\x20配置?','yellow','9758844nNfrrV','154QPVkvB','110INuOsQ','login-prompt','test','项目名不合法','*\x20应用AppCode\x20','登录状态','3623961LsySOX','登录失败','api-pull','Yes','red','跳过登录','string','confirm-api-pull','项目名长度不能超过\x2050\x20个字符','slice','\x20直接回车确认,或输入自定义名称','map','60IERFjC','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','拉取API配置'];a38_0x4213=function(){return _0xc2896e;};return a38_0x4213();}
|
|
1
|
+
(function(_0x592ba4,_0x3b5be8){const _0x236c1d=a38_0x2d5f,_0x16e115=_0x592ba4();while(!![]){try{const _0x29c9f8=parseInt(_0x236c1d(0x220))/0x1+-parseInt(_0x236c1d(0x216))/0x2+-parseInt(_0x236c1d(0x20a))/0x3*(-parseInt(_0x236c1d(0x219))/0x4)+-parseInt(_0x236c1d(0x205))/0x5*(-parseInt(_0x236c1d(0x1ef))/0x6)+parseInt(_0x236c1d(0x212))/0x7+-parseInt(_0x236c1d(0x21e))/0x8*(-parseInt(_0x236c1d(0x21d))/0x9)+-parseInt(_0x236c1d(0x207))/0xa;if(_0x29c9f8===_0x3b5be8)break;else _0x16e115['push'](_0x16e115['shift']());}catch(_0x4f942f){_0x16e115['push'](_0x16e115['shift']());}}}(a38_0x3877,0xba242));import{jsx as a38_0x481c44,jsxs as a38_0x48d3fc,Fragment as a38_0x528de6}from'react/jsx-runtime';function a38_0x2d5f(_0x5c038b,_0x128c8a){const _0x3877d3=a38_0x3877();return a38_0x2d5f=function(_0x2d5f09,_0x28c98f){_0x2d5f09=_0x2d5f09-0x1eb;let _0x451eb7=_0x3877d3[_0x2d5f09];return _0x451eb7;},a38_0x2d5f(_0x5c038b,_0x128c8a);}import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';function a38_0x3877(){const _0x4be034=['login-prompt','\x20\x20使用\x20←→\x20选择,回车确认','step','拉取API配置','login-check','yellow','应用AppCode不合法','*\x20正在检查登录状态...','gray','!\x20未检测到有效登录','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','18ySRaqJ','项目名','*\x20应用AppCode\x20','*\x20是否要先登录以便拉取\x20API\x20配置?','跳过登录','trim','未设置','*\x20创建新项目','\x20登录中...','Yes','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','cyan','delete','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','已登录','test','slice','env','label','online','*\x20是否要自动拉取\x20API\x20配置?','\x20←\x20','342620fjftdS','*\x20项目名:\x20','11892090qAJOlQ','creating','length','2457423pQRvWJ','green','\x20检查中...','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','project-name','√\x20检测到有效登录状态','includes','confirm-api-pull','3174192rEgVIu','login','\x20直接回车确认,或输入自定义名称','rightArrow','2410306xnUbHQ','应用AppCode长度不能超过\x20100\x20个字符','value','4uAymtE','login-process','column','app-code','169002xsTZXi','296RrFydi','red','983841VCSAja','my-app','登录状态'];a38_0x3877=function(){return _0x4be034;};return a38_0x3877();}import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x1a441c){const _0x4d301c=a38_0x2d5f,{onCreate:_0x2cc701,env:_0xe8c040}=_0x1a441c,[_0x248c9f,_0x4be61b]=useState(_0x4d301c(0x20e)),[_0x499143,_0x4854e4]=useState(''),[_0x549052,_0x547c4a]=useState(''),[_0x2b8f7b,_0x1e2b54]=useState(''),[_0x2e00fd,_0x3629c1]=useState(''),[_0x1a6183,_0x337606]=useState([]),[_0x246fb1,_0xbb3eb0]=useState(null),[_0x190cc5,_0x4feb6a]=useState(![]),[_0x2a399a,_0x2b5e89]=useState(![]),[_0x3a0747,_0x3d4bcc]=useState(![]),[_0x19a39f,_0x1b4c40]=useState(0x0),[_0x2c9911,_0x55b708]=useState(0x0),_0x25e444=_0x4d301c(0x221),_0x5451aa=readConfig(),_0x308490=typeof _0x5451aa[_0x4d301c(0x200)]==='string'?_0x5451aa[_0x4d301c(0x200)]:undefined;function _0xf57268(_0x1cfa0f){const _0x367cb7=_0x4d301c;if(_0x1cfa0f[_0x367cb7(0x209)]>0x32)return{'valid':![],'message':'项目名长度不能超过\x2050\x20个字符'};const _0x57c59e=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x1cfa0f?.[_0x367cb7(0x1f4)]()&&!_0x57c59e[_0x367cb7(0x1fe)](_0x1cfa0f))return{'valid':![],'message':_0x367cb7(0x1fc)};return{'valid':!![]};}function _0x5440c0(_0x515903){const _0x306879=_0x4d301c;if(!_0x515903[_0x306879(0x1f4)]())return{'valid':!![]};if(_0x515903['length']>0x64)return{'valid':![],'message':_0x306879(0x217)};const _0x26eb0b=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x26eb0b[_0x306879(0x1fe)](_0x515903))return{'valid':![],'message':_0x306879(0x20d)};return{'valid':!![]};}async function _0x2da39e(){_0x4feb6a(!![]);try{const _0x4a6ee4=await getIsSessionValid();return _0xbb3eb0(_0x4a6ee4),_0x4a6ee4;}catch(_0x491799){return _0xbb3eb0(![]),![];}finally{_0x4feb6a(![]);}}async function _0x1ae4aa(){_0x2b5e89(!![]);try{const _0x147ec0=await authServer({'silent':!![]});return _0xbb3eb0(_0x147ec0),_0x147ec0;}catch(_0x1cbbaa){return _0xbb3eb0(![]),![];}finally{_0x2b5e89(![]);}}return useInput(async(_0xe63fb,_0x2b777b)=>{const _0x3092d0=_0x4d301c;if(_0x2b777b['leftArrow']||_0x2b777b[_0x3092d0(0x215)]){if(_0x248c9f===_0x3092d0(0x211)){_0x1b4c40(_0xd370a4=>_0xd370a4===0x0?0x1:0x0);return;}if(_0x248c9f===_0x3092d0(0x223)){_0x55b708(_0x2ff4f8=>_0x2ff4f8===0x0?0x1:0x0);return;}}if(_0x2b777b['return']){if(_0x248c9f==='project-name'){const _0x5dfe14=_0x2b8f7b[_0x3092d0(0x1f4)]()||_0x25e444;if(_0x2e00fd)return;_0x4854e4(_0x5dfe14),_0x337606([{'step':_0x3092d0(0x20e),'label':_0x3092d0(0x1f0),'value':_0x5dfe14}]),_0x1e2b54(''),_0x3629c1(''),_0x4be61b(_0x3092d0(0x21c));return;}if(_0x248c9f===_0x3092d0(0x21c)){if(_0x2e00fd)return;const _0x3de3dc=_0x2b8f7b[_0x3092d0(0x1f4)]();_0x547c4a(_0x3de3dc),_0x337606(_0x407146=>[..._0x407146,{'step':_0x3092d0(0x21c),'label':'应用AppCode','value':_0x3de3dc||_0x3092d0(0x1f5)}]),_0x1e2b54(''),_0x3629c1('');if(_0x3de3dc){_0x4be61b('login-check');const _0x3bff24=await _0x2da39e();_0x3bff24?_0x4be61b(_0x3092d0(0x211)):_0x4be61b('login-prompt');}else{const _0x1b54c5=_0xe8c040||_0x308490||_0x3092d0(0x202);_0x2cc701({'projectName':_0x499143,'appCode':undefined,'pullApi':![],'env':_0x1b54c5}),_0x4be61b(_0x3092d0(0x208));}return;}if(_0x248c9f==='confirm-api-pull'){const _0x464d70=_0x19a39f===0x0;_0x3d4bcc(_0x464d70),_0x337606(_0x22b0c9=>[..._0x22b0c9,{'step':'api-pull','label':_0x3092d0(0x226),'value':_0x464d70?'是':'否'}]);const _0x46a3c9=_0xe8c040||_0x308490||_0x3092d0(0x202);_0x2cc701({'projectName':_0x499143,'appCode':_0x549052,'pullApi':_0x464d70,'env':_0x46a3c9}),_0x4be61b(_0x3092d0(0x208));return;}if(_0x248c9f===_0x3092d0(0x223)){const _0x2efccf=_0x2c9911===0x0;if(_0x2efccf){_0x4be61b(_0x3092d0(0x21a));const _0x400b35=await _0x1ae4aa();if(_0x400b35)_0x337606(_0x496a6c=>[..._0x496a6c,{'step':'login','label':_0x3092d0(0x222),'value':_0x3092d0(0x1fd)}]),_0x4be61b(_0x3092d0(0x211));else{_0x337606(_0x3ac731=>[..._0x3ac731,{'step':'login','label':_0x3092d0(0x222),'value':'登录失败'}]);const _0x157626=_0xe8c040||_0x308490||_0x3092d0(0x202);_0x2cc701({'projectName':_0x499143,'appCode':_0x549052,'pullApi':![],'env':_0x157626}),_0x4be61b(_0x3092d0(0x208));}}else{_0x337606(_0x55f9e8=>[..._0x55f9e8,{'step':_0x3092d0(0x213),'label':_0x3092d0(0x222),'value':_0x3092d0(0x1f3)}]);const _0x5c5946=_0xe8c040||_0x308490||_0x3092d0(0x202);_0x2cc701({'projectName':_0x499143,'appCode':_0x549052,'pullApi':![],'env':_0x5c5946}),_0x4be61b(_0x3092d0(0x208));}return;}}if(_0x2b777b['backspace']||_0x2b777b[_0x3092d0(0x1fb)]){_0x1e2b54(_0x491382=>{const _0x3d393a=_0x3092d0,_0x145154=_0x491382[_0x3d393a(0x1ff)](0x0,-0x1);if(_0x248c9f==='project-name'){const {valid:_0x73936f,message:_0x58a262}=_0xf57268(_0x145154);_0x3629c1(_0x73936f?'':_0x58a262||'项目名不合法');}else{if(_0x248c9f==='app-code'){const {valid:_0x3dfabd,message:_0x4bcde2}=_0x5440c0(_0x145154);_0x3629c1(_0x3dfabd?'':_0x4bcde2||'应用AppCode不合法');}}return _0x145154;});return;}if([_0x3092d0(0x208),_0x3092d0(0x227),_0x3092d0(0x21a)][_0x3092d0(0x210)](_0x248c9f))return;if(_0x248c9f==='confirm-api-pull'||_0x248c9f==='login-prompt')return;_0x1e2b54(_0xe6f9a3=>{const _0x12fe28=_0x3092d0,_0x14873e=_0xe6f9a3+_0xe63fb;if(_0x248c9f===_0x12fe28(0x20e)){const {valid:_0xd15533,message:_0x291b55}=_0xf57268(_0x14873e);_0x3629c1(_0xd15533?'':_0x291b55||'项目名不合法');}else{if(_0x248c9f===_0x12fe28(0x21c)){const {valid:_0x16eea2,message:_0x3a4d60}=_0x5440c0(_0x14873e);_0x3629c1(_0x16eea2?'':_0x3a4d60||_0x12fe28(0x229));}}return _0x14873e;});}),a38_0x48d3fc(Box,{'flexDirection':_0x4d301c(0x21b),'marginTop':0x1,'children':[_0x1a6183[_0x4d301c(0x209)]===0x0&&a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':_0x4d301c(0x1fa),'children':_0x4d301c(0x1f6)})}),_0x1a6183['map'](_0x301a64=>a38_0x48d3fc(Box,{'children':[a38_0x48d3fc(Text,{'color':_0x4d301c(0x20b),'children':['√\x20',_0x301a64[_0x4d301c(0x201)],':\x20']}),a38_0x481c44(Text,{'color':'cyan','children':_0x301a64[_0x4d301c(0x218)]})]},_0x301a64[_0x4d301c(0x225)])),_0x248c9f===_0x4d301c(0x20e)&&a38_0x48d3fc(a38_0x528de6,{'children':[a38_0x48d3fc(Box,{'children':[a38_0x481c44(Text,{'children':_0x4d301c(0x206)}),_0x2b8f7b?a38_0x481c44(Text,{'color':_0x4d301c(0x20b),'children':_0x2b8f7b}):a38_0x481c44(Text,{'color':_0x4d301c(0x1ec),'children':_0x25e444}),_0x2e00fd&&a38_0x48d3fc(Text,{'color':_0x4d301c(0x21f),'children':[_0x4d301c(0x204),_0x2e00fd]})]}),!_0x2e00fd&&!_0x2b8f7b&&a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':_0x4d301c(0x1ec),'children':_0x4d301c(0x214)})})]}),_0x248c9f===_0x4d301c(0x21c)&&a38_0x48d3fc(a38_0x528de6,{'children':[a38_0x48d3fc(Box,{'children':[a38_0x481c44(Text,{'children':_0x4d301c(0x1f1)}),a38_0x481c44(Text,{'color':_0x4d301c(0x1ec),'children':'[可选]:\x20'}),a38_0x481c44(Text,{'color':'green','children':_0x2b8f7b}),_0x2e00fd&&a38_0x48d3fc(Text,{'color':_0x4d301c(0x21f),'children':['\x20←\x20',_0x2e00fd]})]}),!_0x2e00fd&&a38_0x481c44(Box,{'children':a38_0x48d3fc(Text,{'color':'gray','children':['\x20',_0x4d301c(0x1f9)]})})]}),_0x248c9f==='login-check'&&a38_0x48d3fc(Box,{'children':[a38_0x481c44(Text,{'children':_0x4d301c(0x1eb)}),_0x190cc5&&a38_0x481c44(Text,{'color':'gray','children':_0x4d301c(0x20c)})]}),_0x248c9f==='confirm-api-pull'&&a38_0x48d3fc(a38_0x528de6,{'children':[a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':_0x4d301c(0x20b),'children':_0x4d301c(0x20f)})}),a38_0x481c44(Box,{'marginTop':0x1,'children':a38_0x481c44(Text,{'children':_0x4d301c(0x203)})}),a38_0x48d3fc(Box,{'marginLeft':0x2,'children':[a38_0x48d3fc(Text,{'color':_0x19a39f===0x0?'green':_0x4d301c(0x1ec),'children':[_0x19a39f===0x0?'▶\x20':'\x20\x20','Yes']}),a38_0x481c44(Text,{'children':'\x20'}),a38_0x48d3fc(Text,{'color':_0x19a39f===0x1?_0x4d301c(0x20b):_0x4d301c(0x1ec),'children':[_0x19a39f===0x1?'▶\x20':'\x20\x20','No']})]}),a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':'gray','children':_0x4d301c(0x224)})}),a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':_0x4d301c(0x228),'children':'\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口'})})]}),_0x248c9f===_0x4d301c(0x223)&&a38_0x48d3fc(a38_0x528de6,{'children':[a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':_0x4d301c(0x228),'children':_0x4d301c(0x1ed)})}),a38_0x481c44(Box,{'marginTop':0x1,'children':a38_0x481c44(Text,{'children':_0x4d301c(0x1f2)})}),a38_0x48d3fc(Box,{'marginLeft':0x2,'children':[a38_0x48d3fc(Text,{'color':_0x2c9911===0x0?_0x4d301c(0x20b):_0x4d301c(0x1ec),'children':[_0x2c9911===0x0?'▶\x20':'\x20\x20',_0x4d301c(0x1f8)]}),a38_0x481c44(Text,{'children':'\x20'}),a38_0x48d3fc(Text,{'color':_0x2c9911===0x1?'green':_0x4d301c(0x1ec),'children':[_0x2c9911===0x1?'▶\x20':'\x20\x20','No']})]}),a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':'gray','children':_0x4d301c(0x224)})}),a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':_0x4d301c(0x228),'children':_0x4d301c(0x1ee)})})]}),_0x248c9f===_0x4d301c(0x21a)&&a38_0x48d3fc(Box,{'children':[a38_0x481c44(Text,{'children':'*\x20正在登录,请前往浏览器完成登录...'}),_0x2a399a&&a38_0x481c44(Text,{'color':_0x4d301c(0x1ec),'children':_0x4d301c(0x1f7)})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a39_0x1604(_0x492898,_0x1d4c8e){const _0x245b76=a39_0x245b();return a39_0x1604=function(_0x1604a0,_0x348fce){_0x1604a0=_0x1604a0-0x1b1;let _0x4a1328=_0x245b76[_0x1604a0];return _0x4a1328;},a39_0x1604(_0x492898,_0x1d4c8e);}(function(_0x1b0276,_0x452e51){const _0x12de68=a39_0x1604,_0x248c9b=_0x1b0276();while(!![]){try{const _0x45f53b=parseInt(_0x12de68(0x1b3))/0x1+parseInt(_0x12de68(0x1b9))/0x2*(-parseInt(_0x12de68(0x1b1))/0x3)+-parseInt(_0x12de68(0x1b6))/0x4*(-parseInt(_0x12de68(0x1b7))/0x5)+-parseInt(_0x12de68(0x1b2))/0x6+-parseInt(_0x12de68(0x1bc))/0x7+parseInt(_0x12de68(0x1bb))/0x8*(parseInt(_0x12de68(0x1b4))/0x9)+parseInt(_0x12de68(0x1ba))/0xa;if(_0x45f53b===_0x452e51)break;else _0x248c9b['push'](_0x248c9b['shift']());}catch(_0x2c7f76){_0x248c9b['push'](_0x248c9b['shift']());}}}(a39_0x245b,0x2cfb5));function a39_0x245b(){const _0x8c28e0=['231026lEHHEF','9uVVail','replace','817348uFJlSw','5fuvXYH','toFixed','30VNgTOt','5411870FxtcjJ','389152rxiGtC','1499274nyGhYu','63219OlaUiw','1864032IuhdfS'];a39_0x245b=function(){return _0x8c28e0;};return a39_0x245b();}export function formatElapsed(_0x280780){const _0x1f319e=a39_0x1604,_0xb75bee=Date['now']()-_0x280780;if(_0xb75bee<0x3e8)return _0xb75bee+'ms';const _0xb393bd=(_0xb75bee/0x3e8)[_0x1f319e(0x1b8)](0x2),_0x657b6e=_0xb393bd[_0x1f319e(0x1b5)](/\.?0+$/u,'');return _0x657b6e+'s';}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3917bb,_0x4671bf){const _0x49684c=a40_0x54c1,_0x321e14=_0x3917bb();while(!![]){try{const _0x2833aa=parseInt(_0x49684c(0x103))/0x1+-parseInt(_0x49684c(0x11f))/0x2+-parseInt(_0x49684c(0x12d))/0x3+parseInt(_0x49684c(0x106))/0x4*(-parseInt(_0x49684c(0x124))/0x5)+parseInt(_0x49684c(0xe9))/0x6*(-parseInt(_0x49684c(0x135))/0x7)+-parseInt(_0x49684c(0x107))/0x8+parseInt(_0x49684c(0x12b))/0x9;if(_0x2833aa===_0x4671bf)break;else _0x321e14['push'](_0x321e14['shift']());}catch(_0x4aefae){_0x321e14['push'](_0x321e14['shift']());}}}(a40_0x368b,0x60f9b));import{jsx as a40_0x55bcbb,Fragment as a40_0x297e11,jsxs as a40_0x4ce7ca}from'react/jsx-runtime';import a40_0x42ac69 from'node:path';import a40_0x106d13 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';function a40_0x54c1(_0x208028,_0x55ed0a){const _0x368b34=a40_0x368b();return a40_0x54c1=function(_0x54c1a0,_0x402ceb){_0x54c1a0=_0x54c1a0-0xd7;let _0x3cca19=_0x368b34[_0x54c1a0];return _0x3cca19;},a40_0x54c1(_0x208028,_0x55ed0a);}import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';function a40_0x368b(){const _0x1885d7=['1109536AbkpKm','\x20配置应用AppCode:\x20','utf8','更新\x20package.json\x20name\x20和\x20description\x20字段','*\x20正在拉取\x20API\x20配置...','815hHOjBA','error','stringify','W_OK','API\x20配置拉取异常:\x20','清理项目目录失败:\x20','../..','25943994qbgRqH','column','664236vJasSJ','projectCode','×\x20项目名过长,最多支持\x20100\x20个字符','\x20√\x20','🎉\x20项目创建成功!','setLogPath','1.\x20','version','321741ZFGPzH','×\x20无法在当前目录创建项目,请检查目录权限','📁\x20项目名称:\x20','\x20|\x20应用AppCode:\x20','warn','📦\x20API配置:\x20','success','🚀\x20接下来可以:','\x20创建配置文件','cyan','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','cwd','resolve','trim','已自动拉取\x20✓','API\x20配置拉取成功:\x20','3.\x20','join','API\x20配置拉取失败:\x20','项目创建失败:\x20','message','description','需手动拉取','gray','accessSync','66mmxqsL','create','package.json','parse','×\x20项目目录\x20','2.\x20',',\x20description=','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','repeat','green','*\x20正在为项目\x20','项目创建完成:\x20','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','√\x20配置文件已创建,应用AppCode:\x20','√\x20API\x20配置拉取完成','dirname','env','\x20&&\x20lovrabet\x20start','string','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','配置应用AppCode:\x20','name','test','log','writeFileSync','.lovrabetrc','102804geObqK','info','项目名称:\x20','13444yMltML','6069144ZmOOkV','appCode','toLocaleString','existsSync','projectName','online','*\x20配置文件路径:\x20','\x20Generated\x20by\x20lovrabet\x20cli\x20','url','readFileSync','white','开始创建项目:\x20','doTask','rmSync','length','lovrabet\x20api\x20pull','配置AppCode:\x20','配置应用AppCode失败:\x20','🔗\x20应用AppCode:\x20','pullApi','1.0.0','*\x20清理失败的项目目录:\x20','×\x20项目创建失败:\x20','拉取API配置:\x20'];a40_0x368b=function(){return _0x1885d7;};return a40_0x368b();}import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x2857b3){const _0x589360=a40_0x54c1,[_0x22a3fa,_0x1b40c9]=useState(![]),[_0x563a9e,_0x3eba3c]=useState(![]),[_0x2b8943,_0x1ed3ab]=useState(null),_0x27479b=useCopyProjectTemplate(),_0x234172=useInstallDependencies(),_0x5c9950=useFormatCode(),_0x14555a=async _0x8c96f4=>{const _0x17685b=a40_0x54c1;if(!_0x8c96f4[_0x17685b(0x10b)]||_0x8c96f4['projectName'][_0x17685b(0xdd)]()===''){console['error']('×\x20项目名不能为空');return;}const _0x12ae7d=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x12ae7d[_0x17685b(0xff)](_0x8c96f4['projectName'])){console[_0x17685b(0x125)]('×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符');return;}if(_0x8c96f4[_0x17685b(0x10b)][_0x17685b(0x115)]>0x64){console[_0x17685b(0x125)](_0x17685b(0x12f));return;}const _0x25d85b=a40_0x42ac69[_0x17685b(0xdc)](process['cwd'](),_0x8c96f4['projectName']);if(a40_0x106d13['existsSync'](_0x25d85b)){console[_0x17685b(0x125)](_0x17685b(0xed)+_0x8c96f4[_0x17685b(0x10b)]+'\x20已存在,请使用其他项目名');return;}try{const _0x222ede=a40_0x42ac69[_0x17685b(0xf8)](_0x25d85b);a40_0x106d13[_0x17685b(0xe8)](_0x222ede,a40_0x106d13['constants'][_0x17685b(0x127)]);}catch(_0x5db849){console[_0x17685b(0x125)](_0x17685b(0x136));return;}_0x1ed3ab(_0x8c96f4),_0x1b40c9(!![]),logger[_0x17685b(0x132)](_0x25d85b),logger['info'](_0x17685b(0xea),_0x17685b(0x112)+_0x8c96f4[_0x17685b(0x10b)],{'projectDir':_0x25d85b,'appCode':_0x8c96f4[_0x17685b(0x108)]});try{await _0x27479b[_0x17685b(0x113)](_0x8c96f4['projectName']),await _0x9c8841(_0x8c96f4[_0x17685b(0x10b)]),await _0x234172[_0x17685b(0x113)](_0x8c96f4[_0x17685b(0x10b)]),await _0x5c9950[_0x17685b(0x113)](_0x8c96f4[_0x17685b(0x10b)]),await _0x5ba009(_0x8c96f4[_0x17685b(0x10b)],_0x8c96f4[_0x17685b(0x108)]||'',_0x8c96f4['env']);if(_0x8c96f4[_0x17685b(0x11a)]&&_0x8c96f4[_0x17685b(0x108)]){console[_0x17685b(0x100)](_0x17685b(0x123));try{const _0x1da9c0=await pullApiSilent(_0x8c96f4[_0x17685b(0x108)],undefined,_0x25d85b,_0x8c96f4[_0x17685b(0xf9)]);_0x1da9c0?(console[_0x17685b(0x100)](_0x17685b(0xf7)),logger['info'](_0x17685b(0xea),_0x17685b(0xdf)+_0x8c96f4[_0x17685b(0x108)],{'projectDir':_0x25d85b,'appCode':_0x8c96f4[_0x17685b(0x108)],'env':_0x8c96f4[_0x17685b(0xf9)]})):(console[_0x17685b(0x100)]('!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x17685b(0x139)](_0x17685b(0xea),_0x17685b(0xe2)+_0x8c96f4['appCode'],{'projectDir':_0x25d85b,'appCode':_0x8c96f4[_0x17685b(0x108)],'env':_0x8c96f4[_0x17685b(0xf9)]}));}catch(_0x572a6e){console['log'](_0x17685b(0xfc)),logger[_0x17685b(0x139)](_0x17685b(0xea),_0x17685b(0x128)+_0x8c96f4['appCode'],{'projectDir':_0x25d85b,'appCode':_0x8c96f4[_0x17685b(0x108)],'env':_0x8c96f4[_0x17685b(0xf9)],'error':_0x572a6e instanceof Error?_0x572a6e[_0x17685b(0xe4)]:String(_0x572a6e)});}}logger[_0x17685b(0x13b)](_0x17685b(0xea),_0x17685b(0xf4)+_0x8c96f4['projectName']),_0x3eba3c(!![]),_0x1b40c9(![]);}catch(_0xbcf793){logger[_0x17685b(0x125)](_0x17685b(0xea),_0x17685b(0xe3)+_0x8c96f4[_0x17685b(0x10b)],{'error':_0xbcf793 instanceof Error?_0xbcf793['message']:String(_0xbcf793)});try{a40_0x106d13[_0x17685b(0x10a)](_0x25d85b)&&(console[_0x17685b(0x100)](_0x17685b(0x11c)+_0x25d85b),a40_0x106d13[_0x17685b(0x114)](_0x25d85b,{'recursive':!![],'force':!![]}));}catch(_0x50686b){logger[_0x17685b(0x139)](_0x17685b(0xea),_0x17685b(0x129)+_0x25d85b,{'error':_0x50686b instanceof Error?_0x50686b[_0x17685b(0xe4)]:String(_0x50686b)});}_0x1b40c9(![]),console['error'](_0x17685b(0x11d)+(_0xbcf793 instanceof Error?_0xbcf793[_0x17685b(0xe4)]:String(_0xbcf793)));}},_0x666286=async _0x4a880c=>{const _0x4a23ed=a40_0x54c1;await _0x14555a({'projectName':_0x4a880c,'env':_0x2857b3[_0x4a23ed(0xf9)]});},_0x9c8841=async _0x42a005=>{const _0x47aaf7=a40_0x54c1,_0x2394a4=a40_0x42ac69[_0x47aaf7(0xdc)](process[_0x47aaf7(0xdb)](),_0x42a005),_0x23dd27=a40_0x42ac69['join'](_0x2394a4,'package.json');try{console[_0x47aaf7(0x100)](_0x47aaf7(0xda));const _0x3e2396=fileURLToPath(import.meta['url']),_0x1d6fc8=a40_0x42ac69[_0x47aaf7(0xdc)](a40_0x42ac69[_0x47aaf7(0xf8)](_0x3e2396),'../..'),_0xd48775=a40_0x42ac69[_0x47aaf7(0xe1)](_0x1d6fc8,_0x47aaf7(0xeb));let _0x301722=_0x47aaf7(0x11b);try{const _0x58c773=JSON['parse'](a40_0x106d13['readFileSync'](_0xd48775,'utf8'));_0x301722=_0x58c773[_0x47aaf7(0x134)]||_0x47aaf7(0x11b);}catch(_0x221614){}const _0x2067b5=a40_0x106d13[_0x47aaf7(0x110)](_0x23dd27,_0x47aaf7(0x121)),_0x1b2caf=JSON[_0x47aaf7(0xec)](_0x2067b5);_0x1b2caf[_0x47aaf7(0xfe)]=_0x42a005,_0x1b2caf['description']=_0x42a005+_0x47aaf7(0x10e)+_0x301722,a40_0x106d13[_0x47aaf7(0x101)](_0x23dd27,JSON[_0x47aaf7(0x126)](_0x1b2caf,null,0x2)+'\x0a',_0x47aaf7(0x121)),console[_0x47aaf7(0x100)]('√\x20package.json\x20已更新:\x20name='+_0x42a005+_0x47aaf7(0xef)+_0x1b2caf['description']),logger[_0x47aaf7(0x104)](_0x47aaf7(0xea),_0x47aaf7(0x122),{'projectName':_0x42a005,'description':_0x1b2caf[_0x47aaf7(0xe5)],'cliVersion':_0x301722,'packageJsonPath':_0x47aaf7(0xeb)});}catch(_0x15224c){logger['error'](_0x47aaf7(0xea),'更新\x20package.json\x20失败:\x20'+_0x42a005,{'projectName':_0x42a005,'error':_0x15224c instanceof Error?_0x15224c[_0x47aaf7(0xe4)]:String(_0x15224c)});throw _0x15224c;}},_0x5ba009=async(_0x4ca4a7,_0x218270,_0x195d72)=>{const _0x2078ab=a40_0x54c1,_0x2e8e5a=a40_0x42ac69['resolve'](process[_0x2078ab(0xdb)](),_0x4ca4a7),_0x10b1ca=a40_0x42ac69[_0x2078ab(0xe1)](_0x2e8e5a,_0x2078ab(0x102));try{_0x218270?console[_0x2078ab(0x100)](_0x2078ab(0xf3)+_0x4ca4a7+_0x2078ab(0x120)+_0x218270):console['log'](_0x2078ab(0xf3)+_0x4ca4a7+_0x2078ab(0xd8));console[_0x2078ab(0x100)](_0x2078ab(0x10d)+_0x10b1ca);const _0x387aea=fileURLToPath(import.meta[_0x2078ab(0x10f)]),_0x4d20cc=a40_0x42ac69['resolve'](a40_0x42ac69['dirname'](_0x387aea),_0x2078ab(0x12a)),_0xcb6232=a40_0x42ac69[_0x2078ab(0xe1)](_0x4d20cc,'package.json');let _0x419780=_0x2078ab(0x11b);try{const _0x2fb2f9=JSON[_0x2078ab(0xec)](a40_0x106d13['readFileSync'](_0xcb6232,_0x2078ab(0x121)));_0x419780=_0x2fb2f9[_0x2078ab(0x134)]||_0x2078ab(0x11b);}catch(_0x320286){}const _0x9bfcd2=readConfig(),_0x779c84=typeof _0x9bfcd2[_0x2078ab(0xf9)]===_0x2078ab(0xfb)?_0x9bfcd2[_0x2078ab(0xf9)]:undefined,{app:_0x1c62a5,appcode:_0x16a719,..._0x64462}=_0x9bfcd2,_0x44e412={..._0x64462,'appcode':_0x218270||'','env':_0x195d72||_0x779c84||_0x2078ab(0x10c),'createdAt':new Date()[_0x2078ab(0x109)](),'version':_0x419780};a40_0x106d13['writeFileSync'](_0x10b1ca,JSON[_0x2078ab(0x126)](_0x44e412,null,0x2),_0x2078ab(0x121)),_0x218270?console[_0x2078ab(0x100)](_0x2078ab(0xf6)+_0x218270):console[_0x2078ab(0x100)](_0x2078ab(0xf0)),logger[_0x2078ab(0x104)]('create',_0x2078ab(0xfd)+_0x218270,{'projectName':_0x4ca4a7,'configFile':_0x2078ab(0x102)});}catch(_0x8e82d6){logger[_0x2078ab(0x125)]('create',_0x2078ab(0x118)+_0x218270,{'projectName':_0x4ca4a7,'error':_0x8e82d6 instanceof Error?_0x8e82d6['message']:String(_0x8e82d6)});}};useEffect(()=>{const _0x36c746=a40_0x54c1;_0x2857b3[_0x36c746(0x12e)]&&_0x666286(_0x2857b3[_0x36c746(0x12e)]);},[_0x2857b3[_0x589360(0x12e)]]);if(!_0x22a3fa&&!_0x563a9e&&!_0x2857b3[_0x589360(0x12e)])return a40_0x55bcbb(EnhancedGuidedCreate,{'onCreate':_0x14555a,'env':_0x2857b3['env']});if(_0x22a3fa)return a40_0x4ce7ca(a40_0x297e11,{'children':[a40_0x4ce7ca(Box,{'marginTop':0x1,'children':[a40_0x55bcbb(Box,{'width':'1'}),a40_0x55bcbb(Text,{'color':'green','children':_0x589360(0x130)}),a40_0x55bcbb(Text,{'children':_0x589360(0x105)}),a40_0x55bcbb(Text,{'color':'green','children':_0x2b8943?.[_0x589360(0x10b)]}),_0x2b8943?.[_0x589360(0x108)]&&a40_0x4ce7ca(a40_0x297e11,{'children':[a40_0x55bcbb(Text,{'children':_0x589360(0x138)}),a40_0x55bcbb(Text,{'color':_0x589360(0xd9),'children':_0x2b8943[_0x589360(0x108)]})]})]}),a40_0x55bcbb(TaskRunning,{..._0x27479b}),a40_0x55bcbb(TaskRunning,{..._0x234172}),a40_0x55bcbb(TaskRunning,{..._0x5c9950})]});if(_0x563a9e)return a40_0x4ce7ca(a40_0x297e11,{'children':[a40_0x4ce7ca(Box,{'marginTop':0x1,'children':[a40_0x55bcbb(Box,{'width':'1'}),a40_0x55bcbb(Text,{'color':_0x589360(0xf2),'children':_0x589360(0x130)}),a40_0x55bcbb(Text,{'children':_0x589360(0x105)}),a40_0x55bcbb(Text,{'color':_0x589360(0xf2),'children':_0x2b8943?.[_0x589360(0x10b)]}),_0x2b8943?.[_0x589360(0x108)]&&a40_0x4ce7ca(a40_0x297e11,{'children':[a40_0x55bcbb(Text,{'children':_0x589360(0x138)}),a40_0x55bcbb(Text,{'color':_0x589360(0xd9),'children':_0x2b8943[_0x589360(0x108)]})]})]}),a40_0x55bcbb(TaskFinished,{..._0x27479b}),a40_0x55bcbb(TaskFinished,{..._0x234172}),a40_0x55bcbb(TaskFinished,{..._0x5c9950}),a40_0x55bcbb(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a40_0x55bcbb(Text,{'color':_0x589360(0xf2),'children':'─'[_0x589360(0xf1)](0x3c)})}),a40_0x55bcbb(Box,{'children':a40_0x55bcbb(Text,{'color':_0x589360(0xf2),'bold':!![],'children':_0x589360(0x131)})}),a40_0x4ce7ca(Box,{'marginTop':0x1,'flexDirection':'column','children':[a40_0x4ce7ca(Box,{'children':[a40_0x55bcbb(Text,{'color':'cyan','children':_0x589360(0x137)}),a40_0x55bcbb(Text,{'color':_0x589360(0x111),'bold':!![],'children':_0x2b8943?.[_0x589360(0x10b)]})]}),_0x2b8943?.[_0x589360(0x108)]&&a40_0x4ce7ca(Box,{'children':[a40_0x55bcbb(Text,{'color':'cyan','children':_0x589360(0x119)}),a40_0x55bcbb(Text,{'color':'white','bold':!![],'children':_0x2b8943[_0x589360(0x108)]})]}),a40_0x4ce7ca(Box,{'children':[a40_0x55bcbb(Text,{'color':'cyan','children':_0x589360(0x13a)}),_0x2b8943?.[_0x589360(0x11a)]?a40_0x55bcbb(Text,{'color':_0x589360(0xf2),'bold':!![],'children':_0x589360(0xde)}):_0x2b8943?.[_0x589360(0x108)]?a40_0x55bcbb(Text,{'color':'yellow','bold':!![],'children':_0x589360(0xe6)}):a40_0x55bcbb(Text,{'color':'gray','bold':!![],'children':'未配置'})]})]}),a40_0x55bcbb(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a40_0x55bcbb(Text,{'color':'cyan','bold':!![],'children':_0x589360(0xd7)})}),a40_0x4ce7ca(Box,{'marginLeft':0x2,'flexDirection':_0x589360(0x12c),'children':[a40_0x4ce7ca(Box,{'children':[a40_0x55bcbb(Text,{'color':_0x589360(0xf2),'children':_0x589360(0x133)}),a40_0x55bcbb(Text,{'color':_0x589360(0x111),'children':'启动项目:\x20'}),a40_0x55bcbb(Text,{'color':'cyan','bold':!![],'children':'cd\x20'+_0x2b8943?.[_0x589360(0x10b)]+_0x589360(0xfa)})]}),_0x2b8943?.[_0x589360(0x108)]&&!_0x2b8943?.[_0x589360(0x11a)]&&a40_0x4ce7ca(Box,{'children':[a40_0x55bcbb(Text,{'color':'yellow','children':_0x589360(0xee)}),a40_0x55bcbb(Text,{'color':'white','children':_0x589360(0x11e)}),a40_0x55bcbb(Text,{'color':_0x589360(0xd9),'bold':!![],'children':_0x589360(0x116)})]}),!_0x2b8943?.[_0x589360(0x108)]&&a40_0x4ce7ca(a40_0x297e11,{'children':[a40_0x4ce7ca(Box,{'children':[a40_0x55bcbb(Text,{'color':_0x589360(0xe7),'children':'2.\x20'}),a40_0x55bcbb(Text,{'color':_0x589360(0x111),'children':_0x589360(0x117)}),a40_0x55bcbb(Text,{'color':_0x589360(0xd9),'bold':!![],'children':'lovrabet\x20config\x20set\x20appcode\x20[app-code]'})]}),a40_0x4ce7ca(Box,{'children':[a40_0x55bcbb(Text,{'color':'gray','children':_0x589360(0xe0)}),a40_0x55bcbb(Text,{'color':_0x589360(0x111),'children':'拉取API配置:\x20'}),a40_0x55bcbb(Text,{'color':'cyan','bold':!![],'children':_0x589360(0xf5)})]})]})]}),a40_0x55bcbb(Box,{'marginTop':0x1,'children':a40_0x55bcbb(Text,{'color':_0x589360(0xf2),'children':'─'['repeat'](0x3c)})})]});return null;}
|
|
1
|
+
(function(_0xc2f7f4,_0x1098c1){const _0x4c7685=a40_0x54a3,_0x4c4dff=_0xc2f7f4();while(!![]){try{const _0x37ee55=parseInt(_0x4c7685(0x137))/0x1+-parseInt(_0x4c7685(0x14e))/0x2*(parseInt(_0x4c7685(0x181))/0x3)+-parseInt(_0x4c7685(0x184))/0x4*(-parseInt(_0x4c7685(0x140))/0x5)+-parseInt(_0x4c7685(0x188))/0x6*(-parseInt(_0x4c7685(0x13e))/0x7)+parseInt(_0x4c7685(0x157))/0x8*(parseInt(_0x4c7685(0x191))/0x9)+-parseInt(_0x4c7685(0x189))/0xa*(-parseInt(_0x4c7685(0x148))/0xb)+-parseInt(_0x4c7685(0x158))/0xc;if(_0x37ee55===_0x1098c1)break;else _0x4c4dff['push'](_0x4c4dff['shift']());}catch(_0x3c86c8){_0x4c4dff['push'](_0x4c4dff['shift']());}}}(a40_0x524b,0xad8b8));import{jsx as a40_0x145927,Fragment as a40_0x5d06ee,jsxs as a40_0x4ff03b}from'react/jsx-runtime';import a40_0x171467 from'node:path';import a40_0x4ee4e7 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';function a40_0x54a3(_0xf08abf,_0x2a4bbf){const _0x524b36=a40_0x524b();return a40_0x54a3=function(_0x54a38f,_0x20d13b){_0x54a38f=_0x54a38f-0x131;let _0x28df01=_0x524b36[_0x54a38f];return _0x28df01;},a40_0x54a3(_0xf08abf,_0x2a4bbf);}function a40_0x524b(){const _0x5b4a8e=['1.0.0','env','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','gray','\x20Generated\x20by\x20lovrabet\x20cli\x20','1247067AfmgQj','√\x20package.json\x20已更新:\x20name=','resolve','message','*\x20正在拉取\x20API\x20配置...','success','warn','3850364KHlpqY','doTask','1015tEdZPq','🎉\x20项目创建成功!','rmSync','package.json','projectName','test','accessSync','API\x20配置拉取失败:\x20','423335Fitcgs','length','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','项目创建失败:\x20','url','已自动拉取\x20✓','4XNKTLL','../..','🚀\x20接下来可以:','setLogPath','log','更新\x20package.json\x20失败:\x20','readFileSync','parse','拉取API配置:\x20','163336dhGhux','30835008SFAjPL','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','description','toLocaleString','W_OK','*\x20清理失败的项目目录:\x20','writeFileSync','配置应用AppCode:\x20','启动项目:\x20','white','dirname','*\x20正在为项目\x20','\x20&&\x20lovrabet\x20start','green','string','version','1.\x20','\x20|\x20应用AppCode:\x20','name','API\x20配置拉取异常:\x20','cyan','online','error','constants','未配置','yellow','appCode','info','📁\x20项目名称:\x20','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','API\x20配置拉取成功:\x20','.lovrabetrc','projectCode','×\x20项目名过长,最多支持\x20100\x20个字符','×\x20项目目录\x20','trim','清理项目目录失败:\x20','更新\x20package.json\x20name\x20和\x20description\x20字段','×\x20无法在当前目录创建项目,请检查目录权限','项目创建完成:\x20','utf8','1078689FgXrXZ','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','2.\x20','26044LApcDx','cwd','repeat','×\x20项目创建失败:\x20','12MiFyZI','70KOnArb','\x20√\x20','\x20已存在,请使用其他项目名','\x20创建配置文件','create','🔗\x20应用AppCode:\x20','需手动拉取','项目名称:\x20','27kxURRE','pullApi','column','existsSync','配置应用AppCode失败:\x20','join'];a40_0x524b=function(){return _0x5b4a8e;};return a40_0x524b();}import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x1d97b2){const _0xfbac6c=a40_0x54a3,[_0x565baf,_0x3887b7]=useState(![]),[_0x4a0469,_0x38b77f]=useState(![]),[_0x4056c1,_0x3b6138]=useState(null),_0xaab65c=useCopyProjectTemplate(),_0x5e6f35=useInstallDependencies(),_0x2a16b9=useFormatCode(),_0x441f78=async _0x2bd15f=>{const _0x5d2cb7=a40_0x54a3;if(!_0x2bd15f['projectName']||_0x2bd15f[_0x5d2cb7(0x144)][_0x5d2cb7(0x17b)]()===''){console['error']('×\x20项目名不能为空');return;}const _0x28278e=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x28278e[_0x5d2cb7(0x145)](_0x2bd15f[_0x5d2cb7(0x144)])){console[_0x5d2cb7(0x16e)](_0x5d2cb7(0x14a));return;}if(_0x2bd15f[_0x5d2cb7(0x144)][_0x5d2cb7(0x149)]>0x64){console[_0x5d2cb7(0x16e)](_0x5d2cb7(0x179));return;}const _0x4eb246=a40_0x171467['resolve'](process[_0x5d2cb7(0x185)](),_0x2bd15f[_0x5d2cb7(0x144)]);if(a40_0x4ee4e7[_0x5d2cb7(0x194)](_0x4eb246)){console[_0x5d2cb7(0x16e)](_0x5d2cb7(0x17a)+_0x2bd15f[_0x5d2cb7(0x144)]+_0x5d2cb7(0x18b));return;}try{const _0x133453=a40_0x171467['dirname'](_0x4eb246);a40_0x4ee4e7[_0x5d2cb7(0x146)](_0x133453,a40_0x4ee4e7[_0x5d2cb7(0x16f)][_0x5d2cb7(0x15c)]);}catch(_0x21efd8){console['error'](_0x5d2cb7(0x17e));return;}_0x3b6138(_0x2bd15f),_0x3887b7(!![]),logger[_0x5d2cb7(0x151)](_0x4eb246),logger[_0x5d2cb7(0x173)]('create','开始创建项目:\x20'+_0x2bd15f[_0x5d2cb7(0x144)],{'projectDir':_0x4eb246,'appCode':_0x2bd15f[_0x5d2cb7(0x172)]});try{await _0xaab65c[_0x5d2cb7(0x13f)](_0x2bd15f[_0x5d2cb7(0x144)]),await _0x5e7111(_0x2bd15f[_0x5d2cb7(0x144)]),await _0x5e6f35['doTask'](_0x2bd15f[_0x5d2cb7(0x144)]),await _0x2a16b9[_0x5d2cb7(0x13f)](_0x2bd15f[_0x5d2cb7(0x144)]),await _0x48528d(_0x2bd15f['projectName'],_0x2bd15f[_0x5d2cb7(0x172)]||'',_0x2bd15f['env']);if(_0x2bd15f[_0x5d2cb7(0x192)]&&_0x2bd15f[_0x5d2cb7(0x172)]){console['log'](_0x5d2cb7(0x13b));try{const _0x247516=await pullApiSilent(_0x2bd15f[_0x5d2cb7(0x172)],undefined,_0x4eb246,_0x2bd15f[_0x5d2cb7(0x133)]);_0x247516?(console[_0x5d2cb7(0x152)]('√\x20API\x20配置拉取完成'),logger[_0x5d2cb7(0x173)](_0x5d2cb7(0x18d),_0x5d2cb7(0x176)+_0x2bd15f[_0x5d2cb7(0x172)],{'projectDir':_0x4eb246,'appCode':_0x2bd15f['appCode'],'env':_0x2bd15f[_0x5d2cb7(0x133)]})):(console[_0x5d2cb7(0x152)]('!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x5d2cb7(0x13d)](_0x5d2cb7(0x18d),_0x5d2cb7(0x147)+_0x2bd15f['appCode'],{'projectDir':_0x4eb246,'appCode':_0x2bd15f[_0x5d2cb7(0x172)],'env':_0x2bd15f[_0x5d2cb7(0x133)]}));}catch(_0x254bc0){console[_0x5d2cb7(0x152)](_0x5d2cb7(0x182)),logger[_0x5d2cb7(0x13d)](_0x5d2cb7(0x18d),_0x5d2cb7(0x16b)+_0x2bd15f['appCode'],{'projectDir':_0x4eb246,'appCode':_0x2bd15f[_0x5d2cb7(0x172)],'env':_0x2bd15f['env'],'error':_0x254bc0 instanceof Error?_0x254bc0[_0x5d2cb7(0x13a)]:String(_0x254bc0)});}}logger[_0x5d2cb7(0x13c)]('create',_0x5d2cb7(0x17f)+_0x2bd15f[_0x5d2cb7(0x144)]),_0x38b77f(!![]),_0x3887b7(![]);}catch(_0x1e0d06){logger[_0x5d2cb7(0x16e)](_0x5d2cb7(0x18d),_0x5d2cb7(0x14b)+_0x2bd15f[_0x5d2cb7(0x144)],{'error':_0x1e0d06 instanceof Error?_0x1e0d06[_0x5d2cb7(0x13a)]:String(_0x1e0d06)});try{a40_0x4ee4e7['existsSync'](_0x4eb246)&&(console['log'](_0x5d2cb7(0x15d)+_0x4eb246),a40_0x4ee4e7[_0x5d2cb7(0x142)](_0x4eb246,{'recursive':!![],'force':!![]}));}catch(_0x40d09e){logger[_0x5d2cb7(0x13d)]('create',_0x5d2cb7(0x17c)+_0x4eb246,{'error':_0x40d09e instanceof Error?_0x40d09e[_0x5d2cb7(0x13a)]:String(_0x40d09e)});}_0x3887b7(![]),console[_0x5d2cb7(0x16e)](_0x5d2cb7(0x187)+(_0x1e0d06 instanceof Error?_0x1e0d06[_0x5d2cb7(0x13a)]:String(_0x1e0d06)));}},_0x4fea42=async _0x11b7e9=>{const _0x4c16e4=a40_0x54a3;await _0x441f78({'projectName':_0x11b7e9,'env':_0x1d97b2[_0x4c16e4(0x133)]});},_0x5e7111=async _0x288cd4=>{const _0x3c85a1=a40_0x54a3,_0x5d2981=a40_0x171467[_0x3c85a1(0x139)](process[_0x3c85a1(0x185)](),_0x288cd4),_0x3bd69a=a40_0x171467['join'](_0x5d2981,'package.json');try{console[_0x3c85a1(0x152)](_0x3c85a1(0x175));const _0x487f8c=fileURLToPath(import.meta['url']),_0x5a1714=a40_0x171467[_0x3c85a1(0x139)](a40_0x171467[_0x3c85a1(0x162)](_0x487f8c),_0x3c85a1(0x14f)),_0x20fece=a40_0x171467[_0x3c85a1(0x131)](_0x5a1714,'package.json');let _0x1ff976='1.0.0';try{const _0x1f90e5=JSON['parse'](a40_0x4ee4e7[_0x3c85a1(0x154)](_0x20fece,'utf8'));_0x1ff976=_0x1f90e5[_0x3c85a1(0x167)]||'1.0.0';}catch(_0xac2413){}const _0x4379c8=a40_0x4ee4e7[_0x3c85a1(0x154)](_0x3bd69a,'utf8'),_0x4a389c=JSON['parse'](_0x4379c8);_0x4a389c[_0x3c85a1(0x16a)]=_0x288cd4,_0x4a389c[_0x3c85a1(0x15a)]=_0x288cd4+_0x3c85a1(0x136)+_0x1ff976,a40_0x4ee4e7['writeFileSync'](_0x3bd69a,JSON['stringify'](_0x4a389c,null,0x2)+'\x0a',_0x3c85a1(0x180)),console[_0x3c85a1(0x152)](_0x3c85a1(0x138)+_0x288cd4+',\x20description='+_0x4a389c[_0x3c85a1(0x15a)]),logger[_0x3c85a1(0x173)](_0x3c85a1(0x18d),_0x3c85a1(0x17d),{'projectName':_0x288cd4,'description':_0x4a389c['description'],'cliVersion':_0x1ff976,'packageJsonPath':_0x3c85a1(0x143)});}catch(_0x4d9a41){logger[_0x3c85a1(0x16e)](_0x3c85a1(0x18d),_0x3c85a1(0x153)+_0x288cd4,{'projectName':_0x288cd4,'error':_0x4d9a41 instanceof Error?_0x4d9a41[_0x3c85a1(0x13a)]:String(_0x4d9a41)});throw _0x4d9a41;}},_0x48528d=async(_0x307bdf,_0x32ff54,_0x544014)=>{const _0x3ac47e=a40_0x54a3,_0x8b13fd=a40_0x171467[_0x3ac47e(0x139)](process['cwd'](),_0x307bdf),_0x190846=a40_0x171467[_0x3ac47e(0x131)](_0x8b13fd,_0x3ac47e(0x177));try{_0x32ff54?console[_0x3ac47e(0x152)](_0x3ac47e(0x163)+_0x307bdf+'\x20配置应用AppCode:\x20'+_0x32ff54):console['log'](_0x3ac47e(0x163)+_0x307bdf+_0x3ac47e(0x18c));console[_0x3ac47e(0x152)]('*\x20配置文件路径:\x20'+_0x190846);const _0x53021b=fileURLToPath(import.meta[_0x3ac47e(0x14c)]),_0x32c9fb=a40_0x171467['resolve'](a40_0x171467[_0x3ac47e(0x162)](_0x53021b),'../..'),_0x4fab5d=a40_0x171467[_0x3ac47e(0x131)](_0x32c9fb,'package.json');let _0x350135=_0x3ac47e(0x132);try{const _0x34db4b=JSON[_0x3ac47e(0x155)](a40_0x4ee4e7[_0x3ac47e(0x154)](_0x4fab5d,_0x3ac47e(0x180)));_0x350135=_0x34db4b[_0x3ac47e(0x167)]||_0x3ac47e(0x132);}catch(_0xebd454){}const _0x24d0cf=readConfig(),_0xef94f9=typeof _0x24d0cf[_0x3ac47e(0x133)]===_0x3ac47e(0x166)?_0x24d0cf['env']:undefined,{app:_0x2abe5f,appcode:_0x24219a,..._0x5d1f00}=_0x24d0cf,_0x6a0f37={..._0x5d1f00,'appcode':_0x32ff54||'','env':_0x544014||_0xef94f9||_0x3ac47e(0x16d),'createdAt':new Date()[_0x3ac47e(0x15b)](),'version':_0x350135};a40_0x4ee4e7[_0x3ac47e(0x15e)](_0x190846,JSON['stringify'](_0x6a0f37,null,0x2),_0x3ac47e(0x180)),_0x32ff54?console['log']('√\x20配置文件已创建,应用AppCode:\x20'+_0x32ff54):console[_0x3ac47e(0x152)](_0x3ac47e(0x159)),logger[_0x3ac47e(0x173)](_0x3ac47e(0x18d),_0x3ac47e(0x15f)+_0x32ff54,{'projectName':_0x307bdf,'configFile':_0x3ac47e(0x177)});}catch(_0x4a56ba){logger[_0x3ac47e(0x16e)]('create',_0x3ac47e(0x195)+_0x32ff54,{'projectName':_0x307bdf,'error':_0x4a56ba instanceof Error?_0x4a56ba['message']:String(_0x4a56ba)});}};useEffect(()=>{const _0x189c84=a40_0x54a3;_0x1d97b2[_0x189c84(0x178)]&&_0x4fea42(_0x1d97b2[_0x189c84(0x178)]);},[_0x1d97b2[_0xfbac6c(0x178)]]);if(!_0x565baf&&!_0x4a0469&&!_0x1d97b2[_0xfbac6c(0x178)])return a40_0x145927(EnhancedGuidedCreate,{'onCreate':_0x441f78,'env':_0x1d97b2[_0xfbac6c(0x133)]});if(_0x565baf)return a40_0x4ff03b(a40_0x5d06ee,{'children':[a40_0x4ff03b(Box,{'marginTop':0x1,'children':[a40_0x145927(Box,{'width':'1'}),a40_0x145927(Text,{'color':'green','children':_0xfbac6c(0x18a)}),a40_0x145927(Text,{'children':'项目名称:\x20'}),a40_0x145927(Text,{'color':_0xfbac6c(0x165),'children':_0x4056c1?.[_0xfbac6c(0x144)]}),_0x4056c1?.[_0xfbac6c(0x172)]&&a40_0x4ff03b(a40_0x5d06ee,{'children':[a40_0x145927(Text,{'children':_0xfbac6c(0x169)}),a40_0x145927(Text,{'color':'cyan','children':_0x4056c1[_0xfbac6c(0x172)]})]})]}),a40_0x145927(TaskRunning,{..._0xaab65c}),a40_0x145927(TaskRunning,{..._0x5e6f35}),a40_0x145927(TaskRunning,{..._0x2a16b9})]});if(_0x4a0469)return a40_0x4ff03b(a40_0x5d06ee,{'children':[a40_0x4ff03b(Box,{'marginTop':0x1,'children':[a40_0x145927(Box,{'width':'1'}),a40_0x145927(Text,{'color':_0xfbac6c(0x165),'children':_0xfbac6c(0x18a)}),a40_0x145927(Text,{'children':_0xfbac6c(0x190)}),a40_0x145927(Text,{'color':'green','children':_0x4056c1?.[_0xfbac6c(0x144)]}),_0x4056c1?.[_0xfbac6c(0x172)]&&a40_0x4ff03b(a40_0x5d06ee,{'children':[a40_0x145927(Text,{'children':'\x20|\x20应用AppCode:\x20'}),a40_0x145927(Text,{'color':'cyan','children':_0x4056c1[_0xfbac6c(0x172)]})]})]}),a40_0x145927(TaskFinished,{..._0xaab65c}),a40_0x145927(TaskFinished,{..._0x5e6f35}),a40_0x145927(TaskFinished,{..._0x2a16b9}),a40_0x145927(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a40_0x145927(Text,{'color':_0xfbac6c(0x165),'children':'─'[_0xfbac6c(0x186)](0x3c)})}),a40_0x145927(Box,{'children':a40_0x145927(Text,{'color':'green','bold':!![],'children':_0xfbac6c(0x141)})}),a40_0x4ff03b(Box,{'marginTop':0x1,'flexDirection':_0xfbac6c(0x193),'children':[a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':_0xfbac6c(0x16c),'children':_0xfbac6c(0x174)}),a40_0x145927(Text,{'color':_0xfbac6c(0x161),'bold':!![],'children':_0x4056c1?.[_0xfbac6c(0x144)]})]}),_0x4056c1?.[_0xfbac6c(0x172)]&&a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':_0xfbac6c(0x16c),'children':_0xfbac6c(0x18e)}),a40_0x145927(Text,{'color':_0xfbac6c(0x161),'bold':!![],'children':_0x4056c1['appCode']})]}),a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':_0xfbac6c(0x16c),'children':'📦\x20API配置:\x20'}),_0x4056c1?.['pullApi']?a40_0x145927(Text,{'color':_0xfbac6c(0x165),'bold':!![],'children':_0xfbac6c(0x14d)}):_0x4056c1?.[_0xfbac6c(0x172)]?a40_0x145927(Text,{'color':_0xfbac6c(0x171),'bold':!![],'children':_0xfbac6c(0x18f)}):a40_0x145927(Text,{'color':_0xfbac6c(0x135),'bold':!![],'children':_0xfbac6c(0x170)})]})]}),a40_0x145927(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a40_0x145927(Text,{'color':_0xfbac6c(0x16c),'bold':!![],'children':_0xfbac6c(0x150)})}),a40_0x4ff03b(Box,{'marginLeft':0x2,'flexDirection':_0xfbac6c(0x193),'children':[a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':'green','children':_0xfbac6c(0x168)}),a40_0x145927(Text,{'color':_0xfbac6c(0x161),'children':_0xfbac6c(0x160)}),a40_0x145927(Text,{'color':'cyan','bold':!![],'children':'cd\x20'+_0x4056c1?.[_0xfbac6c(0x144)]+_0xfbac6c(0x164)})]}),_0x4056c1?.[_0xfbac6c(0x172)]&&!_0x4056c1?.[_0xfbac6c(0x192)]&&a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':'yellow','children':_0xfbac6c(0x183)}),a40_0x145927(Text,{'color':_0xfbac6c(0x161),'children':'拉取API配置:\x20'}),a40_0x145927(Text,{'color':_0xfbac6c(0x16c),'bold':!![],'children':'lovrabet\x20api\x20pull'})]}),!_0x4056c1?.[_0xfbac6c(0x172)]&&a40_0x4ff03b(a40_0x5d06ee,{'children':[a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':_0xfbac6c(0x135),'children':_0xfbac6c(0x183)}),a40_0x145927(Text,{'color':_0xfbac6c(0x161),'children':'配置AppCode:\x20'}),a40_0x145927(Text,{'color':_0xfbac6c(0x16c),'bold':!![],'children':'lovrabet\x20config\x20set\x20appcode\x20[app-code]'})]}),a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':_0xfbac6c(0x135),'children':'3.\x20'}),a40_0x145927(Text,{'color':_0xfbac6c(0x161),'children':_0xfbac6c(0x156)}),a40_0x145927(Text,{'color':'cyan','bold':!![],'children':_0xfbac6c(0x134)})]})]})]}),a40_0x145927(Box,{'marginTop':0x1,'children':a40_0x145927(Text,{'color':'green','children':'─'[_0xfbac6c(0x186)](0x3c)})})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a41_0x378e(){var _0x459e45=['4771568dFFCru','63620fHiJHj','63tlGBlN','7379645cXuDrC','4701927cjTEkM','84PhiNNM','elapsed','491368MpXlaY','39874abaLRU','22BNOcyE','\x20√\x20','660rEXIxP','33306TCYDof'];a41_0x378e=function(){return _0x459e45;};return a41_0x378e();}(function(_0x52eba4,_0x327173){var _0xfbf33=a41_0x4f89,_0x14ee37=_0x52eba4();while(!![]){try{var _0x36df20=parseInt(_0xfbf33(0x67))/0x1*(parseInt(_0xfbf33(0x73))/0x2)+-parseInt(_0xfbf33(0x6f))/0x3+parseInt(_0xfbf33(0x6b))/0x4+parseInt(_0xfbf33(0x6e))/0x5+parseInt(_0xfbf33(0x6a))/0x6*(parseInt(_0xfbf33(0x70))/0x7)+parseInt(_0xfbf33(0x72))/0x8*(-parseInt(_0xfbf33(0x6d))/0x9)+parseInt(_0xfbf33(0x6c))/0xa*(-parseInt(_0xfbf33(0x69))/0xb);if(_0x36df20===_0x327173)break;else _0x14ee37['push'](_0x14ee37['shift']());}catch(_0x779ea0){_0x14ee37['push'](_0x14ee37['shift']());}}}(a41_0x378e,0xc21bf));import{jsx as a41_0x2d3536,jsxs as a41_0x19318a}from'react/jsx-runtime';import{Box,Text}from'ink';function a41_0x4f89(_0x434ea0,_0x390f5e){var _0x378e16=a41_0x378e();return a41_0x4f89=function(_0x4f89ba,_0x1ab42e){_0x4f89ba=_0x4f89ba-0x67;var _0x478e80=_0x378e16[_0x4f89ba];return _0x478e80;},a41_0x4f89(_0x434ea0,_0x390f5e);}import{TaskTime}from'./task-time.js';export function TaskFinished(_0x49cc03){var _0x5b8dc5=a41_0x4f89;return a41_0x19318a(Box,{'children':[a41_0x2d3536(Box,{'width':'1'}),a41_0x2d3536(Text,{'color':'green','children':_0x5b8dc5(0x68)}),a41_0x2d3536(Text,{'children':_0x49cc03['taskName']}),a41_0x2d3536(TaskTime,{'elapsed':_0x49cc03[_0x5b8dc5(0x71)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x47b4d8,_0x20de70){var _0x5e7990=a42_0x5efe,_0x51d3cd=_0x47b4d8();while(!![]){try{var _0x22b493=-parseInt(_0x5e7990(0x1bb))/0x1*(parseInt(_0x5e7990(0x1af))/0x2)+parseInt(_0x5e7990(0x1b7))/0x3*(parseInt(_0x5e7990(0x1b2))/0x4)+-parseInt(_0x5e7990(0x1ae))/0x5+parseInt(_0x5e7990(0x1b8))/0x6*(parseInt(_0x5e7990(0x1b1))/0x7)+parseInt(_0x5e7990(0x1b4))/0x8+parseInt(_0x5e7990(0x1b9))/0x9+parseInt(_0x5e7990(0x1ba))/0xa*(-parseInt(_0x5e7990(0x1b6))/0xb);if(_0x22b493===_0x20de70)break;else _0x51d3cd['push'](_0x51d3cd['shift']());}catch(_0x17742a){_0x51d3cd['push'](_0x51d3cd['shift']());}}}(a42_0x93aa,0xd0290));function a42_0x93aa(){var _0x4c5204=['48llKzoi','11307834lltDCx','10AaPkTf','1457upPKiH','loading','\x20\x20\x20','7091460nHmVzC','1774VeNpBv','\x20√\x20','961926sdzHjF','8rWDOaS','finished','10809072WzRFIb','dots','8427837DiFwNo','933807ymwfWK'];a42_0x93aa=function(){return _0x4c5204;};return a42_0x93aa();}function a42_0x5efe(_0x25d065,_0x341a9c){var _0x93aa70=a42_0x93aa();return a42_0x5efe=function(_0x5efec6,_0x311ef9){_0x5efec6=_0x5efec6-0x1ac;var _0x17304f=_0x93aa70[_0x5efec6];return _0x17304f;},a42_0x5efe(_0x25d065,_0x341a9c);}import{jsx as a42_0xf98c74,jsxs as a42_0x314a25}from'react/jsx-runtime';import{Text}from'ink';import a42_0x572084 from'ink-spinner';export function TaskLoading(_0x1131a4){var _0x550396=a42_0x5efe;if(_0x1131a4[_0x550396(0x1b3)])return a42_0xf98c74(Text,{'color':'green','children':_0x550396(0x1b0)});if(_0x1131a4[_0x550396(0x1ac)])return a42_0x314a25(Text,{'color':'green','children':['\x20',a42_0xf98c74(a42_0x572084,{'type':_0x550396(0x1b5)}),'\x20']});return a42_0xf98c74(Text,{'children':_0x550396(0x1ad)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3a4ca4,_0x28ac0e){var _0x2e2475=a43_0x5cad,_0x35aaf6=_0x3a4ca4();while(!![]){try{var _0x4ddfc5=-parseInt(_0x2e2475(0x1c0))/0x1*(-parseInt(_0x2e2475(0x1c9))/0x2)+parseInt(_0x2e2475(0x1c8))/0x3+parseInt(_0x2e2475(0x1c7))/0x4+-parseInt(_0x2e2475(0x1c1))/0x5+-parseInt(_0x2e2475(0x1c5))/0x6*(parseInt(_0x2e2475(0x1c3))/0x7)+-parseInt(_0x2e2475(0x1bf))/0x8+parseInt(_0x2e2475(0x1c2))/0x9*(parseInt(_0x2e2475(0x1c6))/0xa);if(_0x4ddfc5===_0x28ac0e)break;else _0x35aaf6['push'](_0x35aaf6['shift']());}catch(_0xa613e4){_0x35aaf6['push'](_0x35aaf6['shift']());}}}(a43_0x5c07,0xa7fd9));import{jsx as a43_0x4bd517,jsxs as a43_0x14fa6c}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x3a9f5b){var _0x3a3852=a43_0x5cad;return a43_0x14fa6c(Box,{'children':[a43_0x4bd517(Box,{'width':'1'}),a43_0x4bd517(TaskLoading,{..._0x3a9f5b}),a43_0x4bd517(Text,{'children':_0x3a9f5b['taskName']}),a43_0x4bd517(TaskTime,{'elapsed':_0x3a9f5b[_0x3a3852(0x1c4)]})]});}function a43_0x5cad(_0x500515,_0x18d4ec){var _0x5c070d=a43_0x5c07();return a43_0x5cad=function(_0x5cad50,_0x1a4735){_0x5cad50=_0x5cad50-0x1bf;var _0x3f6e51=_0x5c070d[_0x5cad50];return _0x3f6e51;},a43_0x5cad(_0x500515,_0x18d4ec);}function a43_0x5c07(){var _0x250663=['116478jISSil','847zRzPJf','elapsed','9222sXYLgE','340EzsUEU','564384yPCPBr','1969080JYmZyr','26010HVIHiV','9539376BbqDZn','66ixeEvI','146630EmVGcY'];a43_0x5c07=function(){return _0x250663;};return a43_0x5c07();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a44_0x28d7(){var _0x564c86=['188PiweWC','elapsed','22751597vnemwn','48nlikwt','611578waiSfA','gray','1785889aOTHjk','5830830djqXID','4489191CIWHUO','2urjCBU','4585935JNsfSz','103245hHOZRD','10ebnwcW'];a44_0x28d7=function(){return _0x564c86;};return a44_0x28d7();}(function(_0xea0bcb,_0x19c134){var _0x45a256=a44_0x2a9e,_0x49ff86=_0xea0bcb();while(!![]){try{var _0x14d420=-parseInt(_0x45a256(0x85))/0x1+-parseInt(_0x45a256(0x7d))/0x2*(parseInt(_0x45a256(0x7e))/0x3)+-parseInt(_0x45a256(0x81))/0x4*(-parseInt(_0x45a256(0x7f))/0x5)+-parseInt(_0x45a256(0x7b))/0x6+parseInt(_0x45a256(0x7a))/0x7*(parseInt(_0x45a256(0x84))/0x8)+-parseInt(_0x45a256(0x7c))/0x9*(parseInt(_0x45a256(0x80))/0xa)+parseInt(_0x45a256(0x83))/0xb;if(_0x14d420===_0x19c134)break;else _0x49ff86['push'](_0x49ff86['shift']());}catch(_0x4c21a1){_0x49ff86['push'](_0x49ff86['shift']());}}}(a44_0x28d7,0xea12d));import{jsx as a44_0x39084c,Fragment as a44_0x5749c0,jsxs as a44_0x472fcd}from'react/jsx-runtime';function a44_0x2a9e(_0x1a023e,_0x3a1cdb){var _0x28d779=a44_0x28d7();return a44_0x2a9e=function(_0x2a9edc,_0x17393d){_0x2a9edc=_0x2a9edc-0x7a;var _0x1af5b2=_0x28d779[_0x2a9edc];return _0x1af5b2;},a44_0x2a9e(_0x1a023e,_0x3a1cdb);}import{Text}from'ink';export function TaskTime(_0x2b3b52){var _0x2ff877=a44_0x2a9e;if(_0x2b3b52[_0x2ff877(0x82)])return a44_0x472fcd(a44_0x5749c0,{'children':[a44_0x39084c(Text,{'color':_0x2ff877(0x86),'children':'\x20['}),a44_0x39084c(Text,{'color':_0x2ff877(0x86),'bold':!![],'children':_0x2b3b52[_0x2ff877(0x82)]}),a44_0x39084c(Text,{'color':_0x2ff877(0x86),'children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x367e84=a45_0x26d2;(function(_0x597ee3,_0x161c47){const _0x425fa3=a45_0x26d2,_0x243a4d=_0x597ee3();while(!![]){try{const _0x1b272b=-parseInt(_0x425fa3(0xac))/0x1+parseInt(_0x425fa3(0x9c))/0x2+parseInt(_0x425fa3(0x9d))/0x3+parseInt(_0x425fa3(0x99))/0x4+parseInt(_0x425fa3(0xa4))/0x5+parseInt(_0x425fa3(0xa0))/0x6+-parseInt(_0x425fa3(0xa2))/0x7*(parseInt(_0x425fa3(0xa5))/0x8);if(_0x1b272b===_0x161c47)break;else _0x243a4d['push'](_0x243a4d['shift']());}catch(_0x5212b6){_0x243a4d['push'](_0x243a4d['shift']());}}}(a45_0x51ae,0x6c085));function a45_0x51ae(){const _0x18e615=['8xDhUYG','copy','info','项目模板复制完成','项目模板复制失败','success','../../templates/projects/sub-app-react-demo','381774IwGkpC','dirname','1052484WNwJDf','复制项目文件','now','530208GAhGVt','1310967tWJsHS','开始复制项目模板','cwd','2564778PntRTm','resolve','9953678OAcdae','message','4267760UgEOIQ'];a45_0x51ae=function(){return _0x18e615;};return a45_0x51ae();}import a45_0x5ab8e6 from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a45_0x26d2(_0x2fc7f4,_0x4b9a7f){const _0x51ae2d=a45_0x51ae();return a45_0x26d2=function(_0x26d20b,_0x167e1b){_0x26d20b=_0x26d20b-0x98;let _0x1bec98=_0x51ae2d[_0x26d20b];return _0x1bec98;},a45_0x26d2(_0x2fc7f4,_0x4b9a7f);}const __dirname=a45_0x5ab8e6[a45_0x367e84(0x98)](fileURLToPath(import.meta['url'])),templateDir=a45_0x5ab8e6[a45_0x367e84(0xa1)](__dirname,a45_0x367e84(0xab));export function useCopyProjectTemplate(){const _0x1ca885=a45_0x367e84,[_0x4869d9,_0x26057f]=useState(![]),[_0x29851d,_0x52f7c5]=useState(![]),[_0x2b633d,_0x272e3d]=useState(''),_0x5826d7=useCallback(async _0x53640b=>{const _0x1e44ed=a45_0x26d2,_0x1a6fe8=Date[_0x1e44ed(0x9b)](),_0x3d6970=a45_0x5ab8e6[_0x1e44ed(0xa1)](process[_0x1e44ed(0x9f)](),_0x53640b);_0x26057f(!![]);try{logger[_0x1e44ed(0xa7)]('copy',_0x1e44ed(0x9e),{'projectCode':_0x53640b,'templateDir':templateDir}),await copyDirectory(templateDir,_0x3d6970);const _0x490d48=Date[_0x1e44ed(0x9b)]()-_0x1a6fe8;logger[_0x1e44ed(0xaa)](_0x1e44ed(0xa6),_0x1e44ed(0xa8),_0x490d48,{'projectCode':_0x53640b});}catch(_0x3d1c95){const _0x169eb1=Date[_0x1e44ed(0x9b)]()-_0x1a6fe8;logger['error'](_0x1e44ed(0xa6),_0x1e44ed(0xa9),{'projectCode':_0x53640b,'error':_0x3d1c95 instanceof Error?_0x3d1c95[_0x1e44ed(0xa3)]:String(_0x3d1c95),'duration':_0x169eb1});throw _0x3d1c95;}finally{_0x26057f(![]),_0x52f7c5(!![]),_0x272e3d(formatElapsed(_0x1a6fe8));}},[]);return{'taskName':_0x1ca885(0x9a),'finished':_0x29851d,'loading':_0x4869d9,'elapsed':_0x2b633d,'doTask':_0x5826d7};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x226d2e,_0x5dd906){const _0x4ba3bf=a46_0x1c8d,_0x536d7e=_0x226d2e();while(!![]){try{const _0x8d2fb8=-parseInt(_0x4ba3bf(0x174))/0x1+-parseInt(_0x4ba3bf(0x16b))/0x2+-parseInt(_0x4ba3bf(0x177))/0x3*(-parseInt(_0x4ba3bf(0x16f))/0x4)+parseInt(_0x4ba3bf(0x178))/0x5+parseInt(_0x4ba3bf(0x170))/0x6*(-parseInt(_0x4ba3bf(0x16a))/0x7)+-parseInt(_0x4ba3bf(0x173))/0x8*(parseInt(_0x4ba3bf(0x169))/0x9)+parseInt(_0x4ba3bf(0x171))/0xa;if(_0x8d2fb8===_0x5dd906)break;else _0x536d7e['push'](_0x536d7e['shift']());}catch(_0x3d6051){_0x536d7e['push'](_0x536d7e['shift']());}}}(a46_0x31a8,0xb0be3));import a46_0x553ba5 from'node:path';function a46_0x1c8d(_0x2f119d,_0x1c4cb1){const _0x31a8de=a46_0x31a8();return a46_0x1c8d=function(_0x1c8d46,_0x4a98ac){_0x1c8d46=_0x1c8d46-0x163;let _0x2136b0=_0x31a8de[_0x1c8d46];return _0x2136b0;},a46_0x1c8d(_0x2f119d,_0x1c4cb1);}import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x47a6bb=a46_0x1c8d,[_0x1a2138,_0x381b84]=useState(![]),[_0x45d6f3,_0x50b813]=useState(![]),[_0x1f0d6b,_0x1be79b]=useState(''),_0x130d99=useCallback(async _0x105e8f=>{const _0x306f90=a46_0x1c8d,_0x34a219=Date[_0x306f90(0x172)](),_0x5a7f4f=a46_0x553ba5[_0x306f90(0x164)](process[_0x306f90(0x165)](),_0x105e8f);_0x381b84(!![]);try{logger[_0x306f90(0x17a)](_0x306f90(0x16c),_0x306f90(0x167),{'projectCode':_0x105e8f}),await execa(_0x306f90(0x179),[_0x306f90(0x166),_0x306f90(0x163),'.'],{'cwd':_0x5a7f4f});const _0x2952de=Date[_0x306f90(0x172)]()-_0x34a219;logger['success'](_0x306f90(0x16c),_0x306f90(0x175),_0x2952de,{'projectCode':_0x105e8f});}catch(_0x1bac92){const _0x2bf217=Date[_0x306f90(0x172)]()-_0x34a219;logger[_0x306f90(0x16e)](_0x306f90(0x16c),_0x306f90(0x16d),{'projectCode':_0x105e8f,'error':_0x1bac92 instanceof Error?_0x1bac92[_0x306f90(0x176)]:String(_0x1bac92),'duration':_0x2bf217});throw _0x1bac92;}finally{_0x381b84(![]),_0x50b813(!![]),_0x1be79b(formatElapsed(_0x34a219));}},[]);return{'taskName':_0x47a6bb(0x168),'finished':_0x45d6f3,'loading':_0x1a2138,'elapsed':_0x1f0d6b,'doTask':_0x130d99};}function a46_0x31a8(){const _0x18430d=['4978135mqVDEa','npx','info','--write','resolve','cwd','prettier','开始格式化代码','格式化代码','13320kYKlBJ','5711363uBpUxE','2014102JkEiag','format','代码格式化失败','error','40icdAwo','6vasxOI','20852810XwtYJH','now','2920RVYlDx','1440099AMJXkH','代码格式化完成','message','433887CGGYQK'];a46_0x31a8=function(){return _0x18430d;};return a46_0x31a8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x28ebb6,_0x196cc7){const _0x524377=a47_0x3dce,_0x1b5cb1=_0x28ebb6();while(!![]){try{const _0xae0cd4=-parseInt(_0x524377(0x130))/0x1+-parseInt(_0x524377(0x12d))/0x2*(parseInt(_0x524377(0x128))/0x3)+-parseInt(_0x524377(0x12a))/0x4+parseInt(_0x524377(0x126))/0x5*(parseInt(_0x524377(0x129))/0x6)+parseInt(_0x524377(0x121))/0x7*(parseInt(_0x524377(0x131))/0x8)+-parseInt(_0x524377(0x12e))/0x9+parseInt(_0x524377(0x124))/0xa;if(_0xae0cd4===_0x196cc7)break;else _0x1b5cb1['push'](_0x1b5cb1['shift']());}catch(_0x1f4e4c){_0x1b5cb1['push'](_0x1b5cb1['shift']());}}}(a47_0x1632,0x99cdc));import a47_0x1c6405 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';function a47_0x3dce(_0x5b6f02,_0x372c73){const _0x163239=a47_0x1632();return a47_0x3dce=function(_0x3dce2c,_0x4fe8a6){_0x3dce2c=_0x3dce2c-0x11c;let _0x164a70=_0x163239[_0x3dce2c];return _0x164a70;},a47_0x3dce(_0x5b6f02,_0x372c73);}import{formatElapsed}from'./format-elapsed.js';function a47_0x1632(){const _0x41eada=['10jKcqBr','message','1668003yUeOHs','3251154ILJvGf','2418788aLfSRz','npm','安装依赖','4xJIZwJ','4000338OgeQhi','install','1073084jQOgDn','48jruuMT','now','开始安装依赖','cwd','依赖安装完成','resolve','1403304hgiDIq','依赖安装失败','https://registry.npmmirror.com','15776950qHTlYW','info'];a47_0x1632=function(){return _0x41eada;};return a47_0x1632();}import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x5e17df=a47_0x3dce,[_0x35fa19,_0x49c312]=useState(![]),[_0x279e7c,_0x5cd0d3]=useState(![]),[_0x3815b8,_0x4a2734]=useState(''),_0x195b11=useCallback(async _0x57489e=>{const _0x394fbb=a47_0x3dce,_0x48d36e=Date['now'](),_0xe65ff0=a47_0x1c6405[_0x394fbb(0x120)](process[_0x394fbb(0x11e)](),_0x57489e);_0x49c312(!![]),_0x5cd0d3(![]);const _0x131687=async(_0x121be3,_0x1df91f)=>{await execa(_0x121be3,_0x1df91f,{'cwd':_0xe65ff0});};try{logger[_0x394fbb(0x125)]('install',_0x394fbb(0x11d),{'projectCode':_0x57489e,'registry':'https://registry.npmmirror.com'}),await _0x131687(_0x394fbb(0x12b),[_0x394fbb(0x12f),'--registry',_0x394fbb(0x123)]);const _0x2bd5e5=Date[_0x394fbb(0x11c)]()-_0x48d36e;logger['success']('install',_0x394fbb(0x11f),_0x2bd5e5,{'projectCode':_0x57489e});}catch(_0x487ef8){const _0x2f2257=Date[_0x394fbb(0x11c)]()-_0x48d36e;logger['error'](_0x394fbb(0x12f),_0x394fbb(0x122),{'projectCode':_0x57489e,'error':_0x487ef8 instanceof Error?_0x487ef8[_0x394fbb(0x127)]:String(_0x487ef8),'duration':_0x2f2257});throw _0x487ef8;}finally{_0x49c312(![]),_0x5cd0d3(!![]),_0x4a2734(formatElapsed(_0x48d36e));}},[]);return{'taskName':_0x5e17df(0x12c),'finished':_0x279e7c,'loading':_0x35fa19,'elapsed':_0x3815b8,'doTask':_0x195b11};}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a48_0x4032(){var _0x3cb8ba=['!\x20请指定一个有效的命令。','12050048CVnfqL','3442820heWXEM','column','2732136XEIffn','310LCAEas','13800zPqezr','918368GZDaqM','285081AppPCf','lovrabet\x20--help','green','6827394PiLKfh'];a48_0x4032=function(){return _0x3cb8ba;};return a48_0x4032();}(function(_0x39f138,_0x15743c){var _0x51fd8f=a48_0x15d0,_0x33bfa0=_0x39f138();while(!![]){try{var _0x3c4b42=parseInt(_0x51fd8f(0x137))/0x1+-parseInt(_0x51fd8f(0x136))/0x2+parseInt(_0x51fd8f(0x133))/0x3+-parseInt(_0x51fd8f(0x131))/0x4+-parseInt(_0x51fd8f(0x134))/0x5*(-parseInt(_0x51fd8f(0x135))/0x6)+-parseInt(_0x51fd8f(0x13a))/0x7+parseInt(_0x51fd8f(0x130))/0x8;if(_0x3c4b42===_0x15743c)break;else _0x33bfa0['push'](_0x33bfa0['shift']());}catch(_0x16cf01){_0x33bfa0['push'](_0x33bfa0['shift']());}}}(a48_0x4032,0x8622a));function a48_0x15d0(_0x3b3dde,_0x331feb){var _0x403231=a48_0x4032();return a48_0x15d0=function(_0x15d04b,_0x5127c8){_0x15d04b=_0x15d04b-0x130;var _0x4859e6=_0x403231[_0x15d04b];return _0x4859e6;},a48_0x15d0(_0x3b3dde,_0x331feb);}import{jsx as a48_0x33de45,jsxs as a48_0xd57e78}from'react/jsx-runtime';import{Box,Text}from'ink';export function Help(){var _0x21b4fd=a48_0x15d0;return a48_0xd57e78(Box,{'flexDirection':_0x21b4fd(0x132),'marginTop':0x1,'marginBottom':0x1,'children':[a48_0xd57e78(Box,{'children':[a48_0x33de45(Box,{'width':'1'}),a48_0x33de45(Text,{'children':_0x21b4fd(0x13b)})]}),a48_0xd57e78(Box,{'marginTop':0x1,'children':[a48_0x33de45(Box,{'width':'1'}),a48_0xd57e78(Text,{'children':['\x20\x20','使用']}),a48_0xd57e78(Text,{'bold':!![],'color':_0x21b4fd(0x139),'children':['\x20',_0x21b4fd(0x138),'\x20']}),a48_0x33de45(Text,{'children':'查看可用命令。'})]})]});}
|
package/lib/init/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x109e9a,_0x219a7f){const _0x37ebea=a49_0x2d15,_0x4bc9f4=_0x109e9a();while(!![]){try{const _0x510fc9=parseInt(_0x37ebea(0x1cd))/0x1*(-parseInt(_0x37ebea(0x1c6))/0x2)+parseInt(_0x37ebea(0x1bc))/0x3+parseInt(_0x37ebea(0x1ba))/0x4*(-parseInt(_0x37ebea(0x1b8))/0x5)+parseInt(_0x37ebea(0x1a9))/0x6+parseInt(_0x37ebea(0x1bf))/0x7+-parseInt(_0x37ebea(0x1a4))/0x8+-parseInt(_0x37ebea(0x1a6))/0x9*(-parseInt(_0x37ebea(0x1ab))/0xa);if(_0x510fc9===_0x219a7f)break;else _0x4bc9f4['push'](_0x4bc9f4['shift']());}catch(_0x1fd7ee){_0x4bc9f4['push'](_0x4bc9f4['shift']());}}}(a49_0x5a48,0x39beb));import{jsxs as a49_0x5ed453,jsx as a49_0x44aeb5}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';function a49_0x2d15(_0x4dcea1,_0x18181c){const _0x5a4877=a49_0x5a48();return a49_0x2d15=function(_0x2d151b,_0x12ecbd){_0x2d151b=_0x2d151b-0x19f;let _0x58ed7f=_0x5a4877[_0x2d151b];return _0x58ed7f;},a49_0x2d15(_0x4dcea1,_0x18181c);}import{resolve,join,dirname}from'node:path';function a49_0x5a48(){const _0x9faf67=['trim','utf8','toLocaleString','column','正在初始化配置文件...','message','应用代码只能包含字母、数字、-\x20和\x20_','cwd','.lovrabetrc','return','../..','init','15SWoHPa','1.0.0','556164lWVyPn','parse','76296McYcKK','green','test','2713648lKQmKW','length','env','AppCode:\x20','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','\x20←\x20','应用代码不能为空','126878MhRUAn','gray','ctrl','red','请输入应用代码\x20(AppCode):\x20','cyan','应用代码不合法','5TzWlns','version','当前目录已存在\x20.lovrabetrc\x20文件','delete','exit','url','199704ENkaiw','应用代码长度不能超过\x20100\x20个字符','320391mQKesS','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','string','2641872GPNCZz','创建配置文件失败','40RiNsbm'];a49_0x5a48=function(){return _0x9faf67;};return a49_0x5a48();}import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';export function Init({appcode:_0x3eca48,env:_0x193c78}){const _0x34d3a9=a49_0x2d15,[_0x20d9da,_0x39cd2]=useState(null),[_0x3c9785,_0x5dbc2a]=useState(![]),[_0x5770e2,_0xffd527]=useState(!_0x3eca48),[_0x3124b6,_0x107987]=useState(''),[_0xb0908b,_0x4daa3b]=useState(''),[_0x1a5684,_0xd10440]=useState(_0x3eca48||''),[_0x247cd8]=useState(_0x193c78);function _0x4a5c50(_0x4d38fd){const _0x160ecb=a49_0x2d15;if(_0x4d38fd[_0x160ecb(0x1c0)]===0x0)return{'valid':![],'message':''};if(_0x4d38fd[_0x160ecb(0x1c0)]>0x64)return{'valid':![],'message':_0x160ecb(0x1a5)};const _0x4be6b4=/^[A-Za-z0-9_-]+$/;if(!_0x4be6b4[_0x160ecb(0x1be)](_0x4d38fd))return{'valid':![],'message':_0x160ecb(0x1b2)};return{'valid':!![]};}useInput((_0x58222f,_0x53ea4f)=>{const _0xe1c6d7=a49_0x2d15;if(!_0x5770e2)return;if(_0x53ea4f[_0xe1c6d7(0x1b5)]){if(_0xb0908b||!_0x3124b6[_0xe1c6d7(0x1ac)]()){_0x4daa3b(_0xe1c6d7(0x1c5));return;}const _0xbd61ba=_0x3124b6['trim'](),{valid:_0x1e9c3f,message:_0x4f0977}=_0x4a5c50(_0xbd61ba);if(!_0x1e9c3f){_0x4daa3b(_0x4f0977||_0xe1c6d7(0x1cc));return;}_0xd10440(_0xbd61ba),_0xffd527(![]);}else{if(_0x53ea4f['backspace']||_0x53ea4f[_0xe1c6d7(0x1a1)])_0x107987(_0x4f20d7=>{const _0x37ba2d=_0xe1c6d7,_0x24a65a=_0x4f20d7['slice'](0x0,-0x1);if(_0x24a65a[_0x37ba2d(0x1c0)]===0x0)_0x4daa3b('');else{const {valid:_0x3238ac,message:_0xfb477f}=_0x4a5c50(_0x24a65a);_0x4daa3b(_0x3238ac?'':_0xfb477f||_0x37ba2d(0x1cc));}return _0x24a65a;});else _0x53ea4f[_0xe1c6d7(0x1c8)]&&_0x58222f==='c'?process['exit'](0x0):_0x107987(_0x16356a=>{const _0x589ff2=_0xe1c6d7,_0x25dbe3=_0x16356a+_0x58222f,{valid:_0x3fdec4,message:_0x4491eb}=_0x4a5c50(_0x25dbe3);return _0x4daa3b(_0x3fdec4?'':_0x4491eb||_0x589ff2(0x1cc)),_0x25dbe3;});}},{'isActive':_0x5770e2}),useEffect(()=>{const _0x5db40d=a49_0x2d15;if(!_0x1a5684||_0x5770e2)return;const _0x26d8ed=resolve(process[_0x5db40d(0x1b3)](),_0x5db40d(0x1b4));if(existsSync(_0x26d8ed)){_0x39cd2(_0x5db40d(0x1a0)),setTimeout(()=>process[_0x5db40d(0x1a2)](0x1),0x64);return;}try{const _0xf6e752=fileURLToPath(import.meta[_0x5db40d(0x1a3)]),_0xf41a17=resolve(dirname(_0xf6e752),_0x5db40d(0x1b6)),_0x167e7f=join(_0xf41a17,'package.json');let _0x5b12b7=_0x5db40d(0x1b9);try{const _0x4a7803=JSON[_0x5db40d(0x1bb)](readFileSync(_0x167e7f,'utf8'));_0x5b12b7=_0x4a7803[_0x5db40d(0x19f)]||'1.0.0';}catch(_0x43aa23){}const _0x1cd17e=readConfig(),_0x5ea81c=typeof _0x1cd17e['env']===_0x5db40d(0x1a8)?_0x1cd17e[_0x5db40d(0x1c1)]:undefined,{app:_0x536806,appcode:_0x170e13,..._0x330ff8}=_0x1cd17e,_0x1c772d={..._0x330ff8,'appcode':_0x1a5684,'env':_0x247cd8||_0x5ea81c||'online','createdAt':new Date()[_0x5db40d(0x1ae)](),'version':_0x5b12b7};writeFileSync(_0x26d8ed,JSON['stringify'](_0x1c772d,null,0x2),{'encoding':_0x5db40d(0x1ad),'mode':0x180}),logger['setLogPath'](process[_0x5db40d(0x1b3)]()),logger['info'](_0x5db40d(0x1b7),'初始化项目配置文件成功',{'appcode':_0x1a5684,'env':_0x1c772d[_0x5db40d(0x1c1)],'version':_0x1c772d['version'],'configPath':_0x26d8ed}),_0x5dbc2a(!![]),setTimeout(()=>process[_0x5db40d(0x1a2)](0x0),0x64);}catch(_0x2e8023){logger['error'](_0x5db40d(0x1b7),_0x5db40d(0x1aa),{'error':_0x2e8023 instanceof Error?_0x2e8023[_0x5db40d(0x1b1)]:String(_0x2e8023)}),_0x39cd2('创建配置文件失败:\x20'+(_0x2e8023 instanceof Error?_0x2e8023[_0x5db40d(0x1b1)]:String(_0x2e8023))),setTimeout(()=>process[_0x5db40d(0x1a2)](0x1),0x64);}},[_0x1a5684,_0x5770e2,_0x247cd8]);if(_0x20d9da)return a49_0x44aeb5(Box,{'flexDirection':'column','children':a49_0x5ed453(Text,{'color':_0x34d3a9(0x1c9),'children':['✗\x20',_0x20d9da]})});if(_0x5770e2)return a49_0x5ed453(Box,{'flexDirection':'column','children':[a49_0x5ed453(Box,{'children':[a49_0x44aeb5(Text,{'color':_0x34d3a9(0x1cb),'children':_0x34d3a9(0x1ca)}),_0x3124b6?a49_0x44aeb5(Text,{'color':_0x34d3a9(0x1bd),'children':_0x3124b6}):a49_0x44aeb5(Text,{'color':_0x34d3a9(0x1c7),'children':'_'}),_0xb0908b&&a49_0x5ed453(Text,{'color':_0x34d3a9(0x1c9),'children':[_0x34d3a9(0x1c4),_0xb0908b]})]}),!_0xb0908b&&!_0x3124b6&&a49_0x44aeb5(Box,{'children':a49_0x44aeb5(Text,{'color':'gray','children':_0x34d3a9(0x1a7)})})]});if(_0x3c9785)return a49_0x5ed453(Box,{'flexDirection':_0x34d3a9(0x1af),'children':[a49_0x44aeb5(Text,{'color':_0x34d3a9(0x1bd),'children':_0x34d3a9(0x1c3)}),a49_0x5ed453(Text,{'color':_0x34d3a9(0x1cb),'children':[_0x34d3a9(0x1c2),_0x1a5684]}),a49_0x44aeb5(Text,{'children':'现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了'})]});return a49_0x44aeb5(Box,{'children':a49_0x44aeb5(Text,{'children':_0x34d3a9(0x1b0)})});}
|