@lovrabet/cli 1.1.26 → 1.2.1-beta.4
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-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -0
- 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/types/index.js +1 -0
- package/lib/utils/check-sdk-version.js +1 -0
- 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 +3 -1
- package/templates/generate-api/api.ts.tpl +9 -4
- package/templates/rules/lovrabet_rules.mdc.tpl +90 -34
- package/lib/app-menu-cdn-version/app-menu-sync-cdn-version-ui.js +0 -1
- package/lib/app-menu-cdn-version/cdn-url-compare-table.js +0 -1
- package/lib/app-menu-cdn-version/update-menu-cdn-url.js +0 -1
- /package/lib/{app-menu-cdn-version → app-menu-update-cdn}/types.js +0 -0
package/lib/cmd/logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x50d91b,_0x2fad77){const _0x3d0654=a32_0x25c8,_0x213dec=_0x50d91b();while(!![]){try{const _0x42fc14=parseInt(_0x3d0654(0x1f5))/0x1*(-parseInt(_0x3d0654(0x1e8))/0x2)+parseInt(_0x3d0654(0x1e5))/0x3*(-parseInt(_0x3d0654(0x1f4))/0x4)+-parseInt(_0x3d0654(0x1f2))/0x5*(parseInt(_0x3d0654(0x1e3))/0x6)+-parseInt(_0x3d0654(0x1f9))/0x7+parseInt(_0x3d0654(0x1f7))/0x8*(-parseInt(_0x3d0654(0x1da))/0x9)+parseInt(_0x3d0654(0x1d7))/0xa*(-parseInt(_0x3d0654(0x1df))/0xb)+parseInt(_0x3d0654(0x1e0))/0xc*(parseInt(_0x3d0654(0x1d6))/0xd);if(_0x42fc14===_0x2fad77)break;else _0x213dec['push'](_0x213dec['shift']());}catch(_0x2071dd){_0x213dec['push'](_0x213dec['shift']());}}}(a32_0x119e,0x2c159));import{logger}from'../utils/logger.js';export function showLogs(){const _0x5a2998=a32_0x25c8;logger[_0x5a2998(0x1eb)](process[_0x5a2998(0x1ec)]());const _0x23ce0e=logger[_0x5a2998(0x1ed)]();if(_0x23ce0e[_0x5a2998(0x1e1)]===0x0){console[_0x5a2998(0x1f1)](_0x5a2998(0x1ea));return;}console[_0x5a2998(0x1f1)](_0x5a2998(0x1e7)),_0x23ce0e[_0x5a2998(0x1e9)]((_0x52e7c6,_0x25097b)=>{const _0x4a20c7=_0x5a2998,_0x2b6dcd=new Date(_0x52e7c6['timestamp'])[_0x4a20c7(0x1dd)](_0x4a20c7(0x1de)),_0x68941c=_0x52e7c6[_0x4a20c7(0x1f3)]==='success'?'√':_0x52e7c6[_0x4a20c7(0x1f3)]===_0x4a20c7(0x1f0)?'×':_0x52e7c6[_0x4a20c7(0x1f3)]===_0x4a20c7(0x1d9)?'!':'i';console[_0x4a20c7(0x1f1)](_0x25097b+0x1+'.\x20'+_0x68941c+'\x20['+_0x52e7c6[_0x4a20c7(0x1dc)]+']\x20'+_0x52e7c6['message']),console[_0x4a20c7(0x1f1)](_0x4a20c7(0x1e4)+_0x2b6dcd),_0x52e7c6[_0x4a20c7(0x1f6)]&&console[_0x4a20c7(0x1f1)](_0x4a20c7(0x1d8)+_0x52e7c6[_0x4a20c7(0x1f6)]+'ms'),_0x52e7c6['details']&&Object[_0x4a20c7(0x1e6)](_0x52e7c6[_0x4a20c7(0x1f8)])[_0x4a20c7(0x1e1)]>0x0&&console['log'](_0x4a20c7(0x1e2)+JSON[_0x4a20c7(0x1ee)](_0x52e7c6[_0x4a20c7(0x1f8)],null,0x2)),console['log']('');});}function a32_0x25c8(_0x35c025,_0x17f06a){_0x35c025=_0x35c025-0x1d6;const _0x119e5f=a32_0x119e();let _0x25c84a=_0x119e5f[_0x35c025];return _0x25c84a;}export function clearLogs(){const _0x81cf08=a32_0x25c8;logger[_0x81cf08(0x1eb)](process[_0x81cf08(0x1ec)]()),logger[_0x81cf08(0x1ef)](),console[_0x81cf08(0x1f1)](_0x81cf08(0x1db));}function a32_0x119e(){const _0x44226d=['15204bbHmrh','length','\x20\x20\x20详情:\x20','344010umuqFQ','\x20\x20\x20时间:\x20','96BMBsTF','keys','*\x20Lovrabet\x20CLI\x20日志记录:\x0a','22738JoSlkZ','forEach','*\x20暂无日志记录','setLogPath','cwd','readLogs','stringify','clearLogs','error','log','5XaWHFp','level','42208JHFFyG','1Yehaae','duration','24qPNUQN','details','1684228SUGumO','12233bxTsfM','10znbVGb','\x20\x20\x20耗时:\x20','warn','996831gHzDQN','*\x20日志已清空','command','toLocaleString','zh-CN','356719CLDLiT'];a32_0x119e=function(){return _0x44226d;};return a32_0x119e();}
|
package/lib/cmd/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x183776,_0x2a30e9){const _0x190f62=a33_0x31e0,_0x342a2f=_0x183776();while(!![]){try{const _0x2d7f37=-parseInt(_0x190f62(0xf0))/0x1*(-parseInt(_0x190f62(0xe7))/0x2)+parseInt(_0x190f62(0xd9))/0x3*(parseInt(_0x190f62(0xe5))/0x4)+-parseInt(_0x190f62(0xdb))/0x5+parseInt(_0x190f62(0xf2))/0x6+-parseInt(_0x190f62(0xf6))/0x7*(parseInt(_0x190f62(0xe0))/0x8)+-parseInt(_0x190f62(0xda))/0x9*(parseInt(_0x190f62(0xf1))/0xa)+-parseInt(_0x190f62(0xdd))/0xb*(-parseInt(_0x190f62(0xef))/0xc);if(_0x2d7f37===_0x2a30e9)break;else _0x342a2f['push'](_0x342a2f['shift']());}catch(_0x56d0b9){_0x342a2f['push'](_0x342a2f['shift']());}}}(a33_0x3bb8,0x3f1fa));import{delimiter,join}from'node:path';function a33_0x3bb8(){const _0x20619e=['27213dyjySx','99nVletb','671695uHqAhp','vite\x20preview','5512210XzDYEF','data','message','8ZIPGlX','cwd','trim','预览服务器启动失败','inherit','40WgmUZP','PATH','378002RZeDbC','info','vite','error','stderr','node_modules','预览服务器启动出错','preview','12jwouOH','1tBHMGL','292770hXmljN','144924SPjExA','success','启动预览服务器','env','630245hZRDuy','now','.bin'];a33_0x3bb8=function(){return _0x20619e;};return a33_0x3bb8();}import{spawn}from'node:child_process';function a33_0x31e0(_0x58ebd7,_0x5a7913){_0x58ebd7=_0x58ebd7-0xd8;const _0x3bb844=a33_0x3bb8();let _0x31e050=_0x3bb844[_0x58ebd7];return _0x31e050;}import{logger}from'../utils/logger.js';export function runPreview(){return new Promise((_0x12e6fb,_0x879525)=>{const _0x426d2f=a33_0x31e0,_0x2a4a81=Date[_0x426d2f(0xf7)]();logger[_0x426d2f(0xe8)](_0x426d2f(0xee),_0x426d2f(0xf4),{'command':_0x426d2f(0xdc)});let _0x1229a1='';const _0x5c4035=spawn(_0x426d2f(0xe9),[_0x426d2f(0xee)],{'stdio':[_0x426d2f(0xe4),_0x426d2f(0xe4),'pipe'],'shell':!![],'env':{...process[_0x426d2f(0xf5)],'PATH':''+join(process[_0x426d2f(0xe1)](),_0x426d2f(0xec),_0x426d2f(0xd8))+delimiter+process['env'][_0x426d2f(0xe6)]}});_0x5c4035[_0x426d2f(0xeb)]?.['on'](_0x426d2f(0xde),_0x1516a0=>{_0x1229a1+=_0x1516a0['toString']();}),_0x5c4035['on']('close',_0x26754b=>{const _0x34da62=_0x426d2f,_0x5e3e2c=Date[_0x34da62(0xf7)]()-_0x2a4a81;if(_0x26754b===0x0||_0x26754b===null)logger[_0x34da62(0xf3)](_0x34da62(0xee),'预览服务器启动成功',_0x5e3e2c),_0x12e6fb();else{const _0x14aa6f={'exitCode':_0x26754b,'duration':_0x5e3e2c,'command':'vite\x20preview','cwd':process[_0x34da62(0xe1)]()};_0x1229a1['trim']()&&(_0x14aa6f[_0x34da62(0xeb)]=_0x1229a1['trim']()),logger['error'](_0x34da62(0xee),_0x34da62(0xe3),_0x14aa6f),_0x879525(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x26754b));}}),_0x5c4035['on'](_0x426d2f(0xea),_0x1a8639=>{const _0xa42b72=_0x426d2f,_0x1c4274=Date[_0xa42b72(0xf7)]()-_0x2a4a81;logger[_0xa42b72(0xea)]('preview',_0xa42b72(0xed),{'error':_0x1a8639[_0xa42b72(0xdf)],'duration':_0x1c4274,'stderr':_0x1229a1[_0xa42b72(0xe2)]()||undefined}),_0x879525(_0x1a8639);});});}
|
package/lib/cmd/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4242fc,_0x18acb2){const _0x5c1b06=a34_0x18ac,_0xb755ce=_0x4242fc();while(!![]){try{const _0xa27c0c=parseInt(_0x5c1b06(0x1fc))/0x1*(parseInt(_0x5c1b06(0x20f))/0x2)+-parseInt(_0x5c1b06(0x200))/0x3+parseInt(_0x5c1b06(0x1f0))/0x4*(parseInt(_0x5c1b06(0x1f6))/0x5)+parseInt(_0x5c1b06(0x1f7))/0x6*(parseInt(_0x5c1b06(0x207))/0x7)+-parseInt(_0x5c1b06(0x1f5))/0x8+parseInt(_0x5c1b06(0x1f8))/0x9*(parseInt(_0x5c1b06(0x1f3))/0xa)+-parseInt(_0x5c1b06(0x202))/0xb*(parseInt(_0x5c1b06(0x1f1))/0xc);if(_0xa27c0c===_0x18acb2)break;else _0xb755ce['push'](_0xb755ce['shift']());}catch(_0x34b66d){_0xb755ce['push'](_0xb755ce['shift']());}}}(a34_0x1eae,0x8e6fa));function a34_0x18ac(_0x298816,_0x5134ed){_0x298816=_0x298816-0x1ee;const _0x1eaefa=a34_0x1eae();let _0x18ac2d=_0x1eaefa[_0x298816];return _0x18ac2d;}function a34_0x1eae(){const _0x317c93=['cwd','3418Dridhv','inherit','minVersion','node_modules','8QYHkkS','1188YiLnOE','vite','3789910fJxLoM','data','7259592MSBWQW','861550phbRkw','516RFfXHo','9TRLgJV','error','PATH','env','368lTrjMp','now','needsUpgrade','trim','1019394FGzZWO','开发服务器启动出错','18062tLjDOs','toString','vite\x20exited\x20with\x20code\x20','开发服务器启动失败','info','52150TsFIwm','开发服务器启动成功','start','stderr','message','version','success'];a34_0x1eae=function(){return _0x317c93;};return a34_0x1eae();}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';export function runStart(_0x22bd14){return new Promise((_0x46d385,_0x3e1a8b)=>{const _0x84bbf3=a34_0x18ac,_0x4bef18=Date[_0x84bbf3(0x1fd)](),_0x16bb30=_0x22bd14||process[_0x84bbf3(0x20e)](),_0x10813a=checkSdkVersion(_0x16bb30);_0x10813a[_0x84bbf3(0x1fe)]&&(printSdkUpgradeWarning(_0x10813a),logger['warn']('start','SDK\x20版本低于推荐版本',{'currentVersion':_0x10813a[_0x84bbf3(0x20c)],'minVersion':_0x10813a[_0x84bbf3(0x1ee)]}));logger[_0x84bbf3(0x206)](_0x84bbf3(0x209),'启动开发服务器',{'command':_0x84bbf3(0x1f2),'cwd':_0x16bb30});let _0x12bdb1='';const _0x2f9c46=spawn(_0x84bbf3(0x1f2),{'stdio':[_0x84bbf3(0x210),_0x84bbf3(0x210),'pipe'],'shell':!![],'cwd':_0x16bb30,'env':{...process[_0x84bbf3(0x1fb)],'PATH':''+join(_0x16bb30,_0x84bbf3(0x1ef),'.bin')+delimiter+process[_0x84bbf3(0x1fb)][_0x84bbf3(0x1fa)]}});_0x2f9c46[_0x84bbf3(0x20a)]?.['on'](_0x84bbf3(0x1f4),_0x3a0252=>{const _0x37ccd4=_0x84bbf3,_0x3ab99c=_0x3a0252[_0x37ccd4(0x203)]();_0x12bdb1+=_0x3ab99c,process[_0x37ccd4(0x20a)]['write'](_0x3ab99c);}),_0x2f9c46['on']('close',_0x5ec40b=>{const _0x2c5e64=_0x84bbf3,_0x1f82ef=Date[_0x2c5e64(0x1fd)]()-_0x4bef18;if(_0x5ec40b===0x0||_0x5ec40b===null)logger[_0x2c5e64(0x20d)](_0x2c5e64(0x209),_0x2c5e64(0x208),_0x1f82ef),_0x46d385();else{const _0x478816={'exitCode':_0x5ec40b,'duration':_0x1f82ef,'command':_0x2c5e64(0x1f2),'cwd':_0x16bb30};_0x12bdb1[_0x2c5e64(0x1ff)]()&&(_0x478816[_0x2c5e64(0x20a)]=_0x12bdb1['trim']()),logger[_0x2c5e64(0x1f9)]('start',_0x2c5e64(0x205),_0x478816),_0x3e1a8b(new Error(_0x2c5e64(0x204)+_0x5ec40b));}}),_0x2f9c46['on'](_0x84bbf3(0x1f9),_0x2a3ab6=>{const _0x58e104=_0x84bbf3,_0x5c3af2=Date[_0x58e104(0x1fd)]()-_0x4bef18,_0x3bec3b={'error':_0x2a3ab6[_0x58e104(0x20b)],'duration':_0x5c3af2,'command':_0x58e104(0x1f2),'cwd':_0x16bb30};_0x12bdb1[_0x58e104(0x1ff)]()&&(_0x3bec3b[_0x58e104(0x20a)]=_0x12bdb1[_0x58e104(0x1ff)]()),logger['error'](_0x58e104(0x209),_0x58e104(0x201),_0x3bec3b),_0x3e1a8b(_0x2a3ab6);});});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a35_0x2eeb(){const _0x4278b0=['lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','gray','配置当前项目的\x20App\x20Code','16280eRYRXk','lovrabet\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','6545688cVPaAH','获取配置项','1226365RmEKZK','431006iKErvg','6gQJsvA','无效的命令,可用命令如下:','lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20\x20\x20\x20','map','command','2FDeYQy','列出所有配置项','1188ZGKsma','column','lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','19463810VYuunK','设置环境\x20(online/daily)','589001azxfTI','description','1757836XPCoKk','lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','设置配置项'];a35_0x2eeb=function(){return _0x4278b0;};return a35_0x2eeb();}(function(_0x528c60,_0x402794){const _0x586c43=a35_0x5bb3,_0x40b987=_0x528c60();while(!![]){try{const _0x876038=parseInt(_0x586c43(0xb5))/0x1*(parseInt(_0x586c43(0xa1))/0x2)+parseInt(_0x586c43(0xb6))/0x3*(parseInt(_0x586c43(0xaa))/0x4)+-parseInt(_0x586c43(0xb4))/0x5+parseInt(_0x586c43(0xb2))/0x6+parseInt(_0x586c43(0xa8))/0x7+parseInt(_0x586c43(0xb0))/0x8*(parseInt(_0x586c43(0xa3))/0x9)+-parseInt(_0x586c43(0xa6))/0xa;if(_0x876038===_0x402794)break;else _0x40b987['push'](_0x40b987['shift']());}catch(_0x4f8093){_0x40b987['push'](_0x40b987['shift']());}}}(a35_0x2eeb,0x8933d));function a35_0x5bb3(_0xa749d,_0x345a48){_0xa749d=_0xa749d-0x9d;const _0x2eeb26=a35_0x2eeb();let _0x5bb3a8=_0x2eeb26[_0xa749d];return _0x5bb3a8;}import{jsxs as a35_0x1fbc1f,jsx as a35_0x2a114f}from'react/jsx-runtime';import{Box,Text}from'ink';export function ConfigHelp(){const _0x41f415=a35_0x5bb3,_0x10577b=[{'command':_0x41f415(0xa5),'description':_0x41f415(0xac)},{'command':_0x41f415(0xab),'description':_0x41f415(0xb3)},{'command':_0x41f415(0x9d),'description':_0x41f415(0xa2)}],_0x34644d=[{'command':_0x41f415(0xad),'description':_0x41f415(0xaf)},{'command':_0x41f415(0xb1),'description':_0x41f415(0xa7)}];return a35_0x1fbc1f(Box,{'flexDirection':_0x41f415(0xa4),'marginTop':0x1,'marginBottom':0x1,'children':[a35_0x2a114f(Box,{'marginBottom':0x1,'children':a35_0x1fbc1f(Text,{'color':_0x41f415(0xae),'children':['\x20!','\x20\x20',_0x41f415(0xb7)]})}),_0x10577b['map'](_0x116172=>a35_0x1fbc1f(Box,{'children':[a35_0x1fbc1f(Text,{'children':[_0x41f415(0x9e),_0x116172[_0x41f415(0xa0)]]}),a35_0x2a114f(Text,{'color':_0x41f415(0xae),'children':_0x116172['description']})]},_0x116172[_0x41f415(0xa0)])),a35_0x2a114f(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a35_0x2a114f(Text,{'color':'gray','children':'\x20*\x20配置示例:'})}),_0x34644d[_0x41f415(0x9f)](_0x2dfe3d=>a35_0x1fbc1f(Box,{'children':[a35_0x1fbc1f(Text,{'children':[_0x41f415(0x9e),_0x2dfe3d[_0x41f415(0xa0)]]}),a35_0x2a114f(Text,{'color':_0x41f415(0xae),'children':_0x2dfe3d[_0x41f415(0xa9)]})]},_0x2dfe3d['command']))]});}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2ceb26,_0x4c2c71){const _0x665222=a36_0x2ea9,_0x4db291=_0x2ceb26();while(!![]){try{const _0x2fa65e=parseInt(_0x665222(0x1e4))/0x1+parseInt(_0x665222(0x1dd))/0x2*(parseInt(_0x665222(0x1d3))/0x3)+-parseInt(_0x665222(0x1c9))/0x4+parseInt(_0x665222(0x1ca))/0x5+parseInt(_0x665222(0x1cb))/0x6*(-parseInt(_0x665222(0x1c8))/0x7)+parseInt(_0x665222(0x1c4))/0x8+-parseInt(_0x665222(0x1e6))/0x9*(parseInt(_0x665222(0x1c5))/0xa);if(_0x2fa65e===_0x4c2c71)break;else _0x4db291['push'](_0x4db291['shift']());}catch(_0x399313){_0x4db291['push'](_0x4db291['shift']());}}}(a36_0x32e0,0x6f7d9));import{jsx as a36_0x2699bd,jsxs as a36_0x46b368}from'react/jsx-runtime';function a36_0x2ea9(_0x9b13ba,_0x19fd25){_0x9b13ba=_0x9b13ba-0x1bd;const _0x32e09a=a36_0x32e0();let _0x2ea99e=_0x32e09a[_0x9b13ba];return _0x2ea99e;}import{existsSync,readFileSync,writeFileSync}from'node:fs';import a36_0x2a1011 from'node:fs';import a36_0x3511fd from'node:path';import{ConfigHelp}from'./config-help.js';function a36_0x32e0(){const _0x3dd35a=['help','list','20847bDRlvC','unlinkSync','保存配置失败:\x20','log','includes','环境配置已设置为:\x20','appcode','未提供配置值','env','flags','104xdeTDh','string','online','message','保存配置失败','utf8','parse','847922jtzYqY','length','9fXiRZi','daily','--help','input','set','red','配置值无效或过长','renameSync','5530760pmUxgt','12701820VgwQkM','.tmp','error','7cSKEVt','1286256HROQvi','1307155paYdrs','681810yLubrd','config','stringify','undefined','get','app'];a36_0x32e0=function(){return _0x3dd35a;};return a36_0x32e0();}import{Box,Text}from'ink';import{readConfig,isInProject,projectConfigPath,globalConfigPath}from'../utils/config.js';import{logger}from'../utils/logger.js';export function Config(_0x2f3552){const _0x2100f0=a36_0x2ea9,{cli:_0x49df2b}=_0x2f3552,_0x1f11ad=_0x49df2b[_0x2100f0(0x1bf)][0x1],_0x3953ae=_0x49df2b['input'][0x2],_0x2406cc=[_0x2100f0(0x1c0),_0x2100f0(0x1cf)][_0x2100f0(0x1d7)](_0x1f11ad||''),_0x403614=_0x49df2b[_0x2100f0(0x1bf)][_0x2100f0(0x1e5)]>=0x3;if(_0x3953ae===_0x2100f0(0x1be)||_0x49df2b[_0x2100f0(0x1dc)][_0x2100f0(0x1d1)])return a36_0x2699bd(ConfigHelp,{});const _0x39392d=readConfig();if(_0x1f11ad==='set'){if(_0x3953ae){const _0x413a58=_0x49df2b[_0x2100f0(0x1bf)][0x3];if(typeof _0x413a58!==_0x2100f0(0x1ce)){if(_0x3953ae===_0x2100f0(0x1db)&&![_0x2100f0(0x1df),_0x2100f0(0x1bd)][_0x2100f0(0x1d7)](_0x413a58))return a36_0x2699bd(Box,{'children':a36_0x2699bd(Text,{'color':_0x2100f0(0x1c1),'children':'环境配置值只能是\x20\x22online\x22\x20或\x20\x22daily\x22'})});const _0x3ddb24=isInProject(),_0x5b4173=_0x3ddb24?projectConfigPath:globalConfigPath;let _0x5670e8={};try{if(existsSync(_0x5b4173)){const _0x2c3d65=readFileSync(_0x5b4173,{'encoding':_0x2100f0(0x1e2)});_0x2c3d65&&(_0x5670e8=JSON[_0x2100f0(0x1e3)](_0x2c3d65));}}catch(_0x4480f2){}if(typeof _0x413a58!==_0x2100f0(0x1de)||_0x413a58[_0x2100f0(0x1e5)]>0x1f4)return a36_0x2699bd(Box,{'children':a36_0x2699bd(Text,{'color':_0x2100f0(0x1c1),'children':_0x2100f0(0x1c2)})});let _0x33c3db=_0x3953ae;_0x3953ae==='app'&&(_0x33c3db=_0x2100f0(0x1d9),delete _0x5670e8[_0x2100f0(0x1d0)]);_0x3953ae===_0x2100f0(0x1d9)&&delete _0x5670e8[_0x2100f0(0x1d0)];_0x5670e8[_0x33c3db]=_0x413a58;try{const _0x3173b0=a36_0x3511fd['dirname'](_0x5b4173);!existsSync(_0x3173b0)&&a36_0x2a1011['mkdirSync'](_0x3173b0,{'recursive':!![]});const _0x3e5ec5=_0x5b4173+'.tmp';writeFileSync(_0x3e5ec5,JSON[_0x2100f0(0x1cd)](_0x5670e8,null,0x2),{'encoding':_0x2100f0(0x1e2),'mode':0x180}),a36_0x2a1011[_0x2100f0(0x1c3)](_0x3e5ec5,_0x5b4173);if(_0x3953ae===_0x2100f0(0x1db)){const _0x2a7e6a=_0x3ddb24?'项目':'全局';console['log']('✓\x20'+_0x2a7e6a+_0x2100f0(0x1d8)+_0x413a58);}}catch(_0x310b18){const _0xeafbc8=_0x5b4173+_0x2100f0(0x1c6);try{existsSync(_0xeafbc8)&&a36_0x2a1011[_0x2100f0(0x1d4)](_0xeafbc8);}catch(_0x2b83d3){}return logger[_0x2100f0(0x1c7)](_0x2100f0(0x1cc),_0x2100f0(0x1e1),{'error':_0x310b18 instanceof Error?_0x310b18['message']:String(_0x310b18),'configKey':_0x3953ae,'configValue':_0x413a58,'targetConfigPath':_0x5b4173}),a36_0x2699bd(Box,{'children':a36_0x46b368(Text,{'color':_0x2100f0(0x1c1),'children':[_0x2100f0(0x1d5),_0x310b18 instanceof Error?_0x310b18[_0x2100f0(0x1e0)]:String(_0x310b18)]})});}return null;}return a36_0x2699bd(Box,{'children':a36_0x2699bd(Text,{'color':_0x2100f0(0x1c1),'children':_0x2100f0(0x1da)})});}}if(_0x1f11ad==='get'){if(_0x3953ae){let _0x519bd1=_0x3953ae;return _0x3953ae===_0x2100f0(0x1d0)&&(_0x519bd1=_0x2100f0(0x1d9)),console[_0x2100f0(0x1d6)](_0x39392d[_0x519bd1]||'undefined'),null;}return null;}if(_0x1f11ad===_0x2100f0(0x1d2))return console[_0x2100f0(0x1d6)](JSON[_0x2100f0(0x1cd)](_0x39392d,null,0x2)),null;if(!_0x2406cc||!_0x403614)return a36_0x2699bd(ConfigHelp,{});return null;}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x552ac9=a37_0x5587;function a37_0x4928(){const _0x3a9038=['5990ONErtb','3176BzNeaE','online','6054608OQwRmY','1516558HAhKah','https://daily-api.lovrabet.com','14gwjjqL','3552206KboqqW','9470694NkixON','2305806DvIwIq','https://user.lovrabet.com','https://user-daily.lovrabet.com','10945smcjmw','93897VvCzuS'];a37_0x4928=function(){return _0x3a9038;};return a37_0x4928();}(function(_0x28c5f3,_0x27005e){const _0x3c2b87=a37_0x5587,_0x58ee98=_0x28c5f3();while(!![]){try{const _0x23a86e=-parseInt(_0x3c2b87(0x1a3))/0x1+parseInt(_0x3c2b87(0x1a6))/0x2+-parseInt(_0x3c2b87(0x19a))/0x3+parseInt(_0x3c2b87(0x1a0))/0x4*(-parseInt(_0x3c2b87(0x19d))/0x5)+-parseInt(_0x3c2b87(0x199))/0x6+parseInt(_0x3c2b87(0x1a5))/0x7*(-parseInt(_0x3c2b87(0x1a2))/0x8)+-parseInt(_0x3c2b87(0x19e))/0x9*(-parseInt(_0x3c2b87(0x19f))/0xa);if(_0x23a86e===_0x27005e)break;else _0x58ee98['push'](_0x58ee98['shift']());}catch(_0x367ec5){_0x58ee98['push'](_0x58ee98['shift']());}}}(a37_0x4928,0xde33f));import{getEnv}from'./env.js';export const getUserDomain=()=>getEnv()===a37_0x552ac9(0x1a1)?a37_0x552ac9(0x19b):a37_0x552ac9(0x19c);function a37_0x5587(_0x1d0b87,_0x206a8f){_0x1d0b87=_0x1d0b87-0x199;const _0x49285e=a37_0x4928();let _0x5587b6=_0x49285e[_0x1d0b87];return _0x5587b6;}export const getApiDomain=()=>getEnv()===a37_0x552ac9(0x1a1)?'https://api.lovrabet.com':a37_0x552ac9(0x1a4);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a38_0x4035(){const _0x34a044=['108213IrmiJx','2977218ViQlZl','3010448kwgbmX','3589655JNUeQO','7htrkim','online','1071QJxJfh','25830ftclZk','2243872SxkpKo','28cnIHBq','824229MPYUot','LOVRABET_ENV'];a38_0x4035=function(){return _0x34a044;};return a38_0x4035();}const a38_0x3a4bfb=a38_0x45ca;(function(_0x59b839,_0xdfe839){const _0x28ecd8=a38_0x45ca,_0x2e62ee=_0x59b839();while(!![]){try{const _0x157db6=parseInt(_0x28ecd8(0x122))/0x1+-parseInt(_0x28ecd8(0x121))/0x2*(parseInt(_0x28ecd8(0x124))/0x3)+parseInt(_0x28ecd8(0x126))/0x4+-parseInt(_0x28ecd8(0x127))/0x5+-parseInt(_0x28ecd8(0x125))/0x6*(parseInt(_0x28ecd8(0x128))/0x7)+parseInt(_0x28ecd8(0x120))/0x8+-parseInt(_0x28ecd8(0x11e))/0x9*(-parseInt(_0x28ecd8(0x11f))/0xa);if(_0x157db6===_0xdfe839)break;else _0x2e62ee['push'](_0x2e62ee['shift']());}catch(_0xa79d56){_0x2e62ee['push'](_0x2e62ee['shift']());}}}(a38_0x4035,0x6cc86));let env=process['env'][a38_0x3a4bfb(0x123)]||a38_0x3a4bfb(0x11d);export function getEnv(){return env;}function a38_0x45ca(_0x28838e,_0x2125be){_0x28838e=_0x28838e-0x11d;const _0x40357a=a38_0x4035();let _0x45ca9c=_0x40357a[_0x28838e];return _0x45ca9c;}export function initEnv(_0x2b5a66){env=_0x2b5a66;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4053af,_0x591560){const _0x7d3534=a41_0x2be4,_0x42f87d=_0x4053af();while(!![]){try{const _0x168f14=parseInt(_0x7d3534(0x188))/0x1*(parseInt(_0x7d3534(0x177))/0x2)+-parseInt(_0x7d3534(0x180))/0x3*(-parseInt(_0x7d3534(0x1a5))/0x4)+parseInt(_0x7d3534(0x1ac))/0x5+parseInt(_0x7d3534(0x19b))/0x6+-parseInt(_0x7d3534(0x1a0))/0x7*(-parseInt(_0x7d3534(0x19f))/0x8)+parseInt(_0x7d3534(0x172))/0x9*(-parseInt(_0x7d3534(0x19a))/0xa)+-parseInt(_0x7d3534(0x18f))/0xb;if(_0x168f14===_0x591560)break;else _0x42f87d['push'](_0x42f87d['shift']());}catch(_0x3b4c61){_0x42f87d['push'](_0x42f87d['shift']());}}}(a41_0x1835,0x27073));import{jsx as a41_0x264e77,jsxs as a41_0x7f3309,Fragment as a41_0xaffb98}from'react/jsx-runtime';function a41_0x2be4(_0x2aaad0,_0x25f9eb){_0x2aaad0=_0x2aaad0-0x169;const _0x18358d=a41_0x1835();let _0x2be42d=_0x18358d[_0x2aaad0];return _0x2be42d;}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';export function EnhancedGuidedCreate(_0x56f7ee){const _0x3581e0=a41_0x2be4,{onCreate:_0x52d0cb,env:_0x40231b}=_0x56f7ee,[_0x37f45b,_0x48936b]=useState('project-name'),[_0x31e5d4,_0x33b989]=useState(''),[_0x5aa71c,_0xad81c4]=useState(''),[_0x123cf0,_0x2d0442]=useState(''),[_0x3924df,_0x2d8954]=useState(''),[_0x4c78d0,_0x3a074a]=useState([]),[_0x207218,_0x222011]=useState(null),[_0x59a069,_0x4ba640]=useState(![]),[_0x1735e2,_0x4f36fd]=useState(![]),[_0x375626,_0x2d9bea]=useState(![]),[_0x752721,_0x2bf96a]=useState(0x0),[_0x4456fb,_0x196850]=useState(0x0),_0x592730=_0x3581e0(0x187),_0x1349db=readConfig(),_0x5dff25=typeof _0x1349db[_0x3581e0(0x1aa)]==='string'?_0x1349db[_0x3581e0(0x1aa)]:undefined;function _0x30c9de(_0x4c3d96){const _0x13df4e=_0x3581e0;if(_0x4c3d96['length']>0x32)return{'valid':![],'message':'项目名长度不能超过\x2050\x20个字符'};const _0x190cfc=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x4c3d96?.[_0x13df4e(0x173)]()&&!_0x190cfc[_0x13df4e(0x16d)](_0x4c3d96))return{'valid':![],'message':_0x13df4e(0x17e)};return{'valid':!![]};}function _0x3aef77(_0x5c5ec7){const _0x1bc9b1=_0x3581e0;if(!_0x5c5ec7[_0x1bc9b1(0x173)]())return{'valid':!![]};if(_0x5c5ec7[_0x1bc9b1(0x190)]>0x64)return{'valid':![],'message':_0x1bc9b1(0x18b)};const _0x84ac8=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x84ac8[_0x1bc9b1(0x16d)](_0x5c5ec7))return{'valid':![],'message':_0x1bc9b1(0x19d)};return{'valid':!![]};}async function _0x572f95(){_0x4ba640(!![]);try{const _0x5cffdb=await getIsSessionValid();return _0x222011(_0x5cffdb),_0x5cffdb;}catch(_0x37843f){return _0x222011(![]),![];}finally{_0x4ba640(![]);}}async function _0x2d4c4e(){_0x4f36fd(!![]);try{const _0x2259a4=await authServer({'silent':!![]});return _0x222011(_0x2259a4),_0x2259a4;}catch(_0x2a7295){return _0x222011(![]),![];}finally{_0x4f36fd(![]);}}return useInput(async(_0x3504df,_0x4a3d14)=>{const _0x3b5db2=_0x3581e0;if(_0x4a3d14[_0x3b5db2(0x178)]||_0x4a3d14['rightArrow']){if(_0x37f45b===_0x3b5db2(0x1a2)){_0x2bf96a(_0x4847f2=>_0x4847f2===0x0?0x1:0x0);return;}if(_0x37f45b===_0x3b5db2(0x192)){_0x196850(_0x5b63d8=>_0x5b63d8===0x0?0x1:0x0);return;}}if(_0x4a3d14['return']){if(_0x37f45b===_0x3b5db2(0x19c)){const _0x35e836=_0x123cf0[_0x3b5db2(0x173)]()||_0x592730;if(_0x3924df)return;_0x33b989(_0x35e836),_0x3a074a([{'step':_0x3b5db2(0x19c),'label':_0x3b5db2(0x16a),'value':_0x35e836}]),_0x2d0442(''),_0x2d8954(''),_0x48936b(_0x3b5db2(0x179));return;}if(_0x37f45b==='app-code'){if(_0x3924df)return;const _0x586c58=_0x123cf0[_0x3b5db2(0x173)]();_0xad81c4(_0x586c58),_0x3a074a(_0x5a52a8=>[..._0x5a52a8,{'step':_0x3b5db2(0x179),'label':_0x3b5db2(0x1a6),'value':_0x586c58||_0x3b5db2(0x1a1)}]),_0x2d0442(''),_0x2d8954('');if(_0x586c58){_0x48936b(_0x3b5db2(0x174));const _0x3343df=await _0x572f95();_0x3343df?_0x48936b(_0x3b5db2(0x1a2)):_0x48936b(_0x3b5db2(0x192));}else{const _0x2c44f0=_0x40231b||_0x5dff25||_0x3b5db2(0x17a);_0x52d0cb({'projectName':_0x31e5d4,'appCode':undefined,'pullApi':![],'env':_0x2c44f0}),_0x48936b(_0x3b5db2(0x16c));}return;}if(_0x37f45b===_0x3b5db2(0x1a2)){const _0x318c42=_0x752721===0x0;_0x2d9bea(_0x318c42),_0x3a074a(_0x56a455=>[..._0x56a455,{'step':'api-pull','label':_0x3b5db2(0x175),'value':_0x318c42?'是':'否'}]);const _0x2779e2=_0x40231b||_0x5dff25||_0x3b5db2(0x17a);_0x52d0cb({'projectName':_0x31e5d4,'appCode':_0x5aa71c,'pullApi':_0x318c42,'env':_0x2779e2}),_0x48936b(_0x3b5db2(0x16c));return;}if(_0x37f45b==='login-prompt'){const _0x10a38b=_0x4456fb===0x0;if(_0x10a38b){_0x48936b(_0x3b5db2(0x16b));const _0x3b421f=await _0x2d4c4e();if(_0x3b421f)_0x3a074a(_0x2c3d7f=>[..._0x2c3d7f,{'step':_0x3b5db2(0x181),'label':_0x3b5db2(0x191),'value':'已登录'}]),_0x48936b(_0x3b5db2(0x1a2));else{_0x3a074a(_0x308f19=>[..._0x308f19,{'step':_0x3b5db2(0x181),'label':_0x3b5db2(0x191),'value':_0x3b5db2(0x197)}]);const _0x56a05c=_0x40231b||_0x5dff25||'online';_0x52d0cb({'projectName':_0x31e5d4,'appCode':_0x5aa71c,'pullApi':![],'env':_0x56a05c}),_0x48936b(_0x3b5db2(0x16c));}}else{_0x3a074a(_0x49e04f=>[..._0x49e04f,{'step':_0x3b5db2(0x181),'label':'登录状态','value':_0x3b5db2(0x185)}]);const _0xe7c88d=_0x40231b||_0x5dff25||_0x3b5db2(0x17a);_0x52d0cb({'projectName':_0x31e5d4,'appCode':_0x5aa71c,'pullApi':![],'env':_0xe7c88d}),_0x48936b(_0x3b5db2(0x16c));}return;}}if(_0x4a3d14[_0x3b5db2(0x193)]||_0x4a3d14[_0x3b5db2(0x169)]){_0x2d0442(_0x1809c3=>{const _0x21df60=_0x3b5db2,_0x203c3c=_0x1809c3[_0x21df60(0x186)](0x0,-0x1);if(_0x37f45b==='project-name'){const {valid:_0x3f15dd,message:_0x34f29a}=_0x30c9de(_0x203c3c);_0x2d8954(_0x3f15dd?'':_0x34f29a||_0x21df60(0x194));}else{if(_0x37f45b===_0x21df60(0x179)){const {valid:_0x2cb071,message:_0x5d4d28}=_0x3aef77(_0x203c3c);_0x2d8954(_0x2cb071?'':_0x5d4d28||_0x21df60(0x17c));}}return _0x203c3c;});return;}if([_0x3b5db2(0x16c),_0x3b5db2(0x174),'login-process'][_0x3b5db2(0x195)](_0x37f45b))return;if(_0x37f45b==='confirm-api-pull'||_0x37f45b===_0x3b5db2(0x192))return;_0x2d0442(_0x333308=>{const _0x4bd8f6=_0x3b5db2,_0x64a89=_0x333308+_0x3504df;if(_0x37f45b===_0x4bd8f6(0x19c)){const {valid:_0x4c3b1e,message:_0x151af1}=_0x30c9de(_0x64a89);_0x2d8954(_0x4c3b1e?'':_0x151af1||_0x4bd8f6(0x194));}else{if(_0x37f45b===_0x4bd8f6(0x179)){const {valid:_0x588dcc,message:_0x4c9f6b}=_0x3aef77(_0x64a89);_0x2d8954(_0x588dcc?'':_0x4c9f6b||'应用AppCode不合法');}}return _0x64a89;});}),a41_0x7f3309(Box,{'flexDirection':_0x3581e0(0x1a4),'marginTop':0x1,'children':[_0x4c78d0[_0x3581e0(0x190)]===0x0&&a41_0x264e77(Box,{'children':a41_0x264e77(Text,{'color':_0x3581e0(0x16e),'children':_0x3581e0(0x170)})}),_0x4c78d0[_0x3581e0(0x184)](_0x57f16f=>a41_0x7f3309(Box,{'children':[a41_0x7f3309(Text,{'color':'green','children':['√\x20',_0x57f16f[_0x3581e0(0x17b)],':\x20']}),a41_0x264e77(Text,{'color':'cyan','children':_0x57f16f[_0x3581e0(0x189)]})]},_0x57f16f[_0x3581e0(0x176)])),_0x37f45b===_0x3581e0(0x19c)&&a41_0x7f3309(a41_0xaffb98,{'children':[a41_0x7f3309(Box,{'children':[a41_0x264e77(Text,{'children':_0x3581e0(0x1a7)}),_0x123cf0?a41_0x264e77(Text,{'color':'green','children':_0x123cf0}):a41_0x264e77(Text,{'color':_0x3581e0(0x1a8),'children':_0x592730}),_0x3924df&&a41_0x7f3309(Text,{'color':'red','children':[_0x3581e0(0x198),_0x3924df]})]}),!_0x3924df&&!_0x123cf0&&a41_0x264e77(Box,{'children':a41_0x264e77(Text,{'color':'gray','children':_0x3581e0(0x17d)})})]}),_0x37f45b===_0x3581e0(0x179)&&a41_0x7f3309(a41_0xaffb98,{'children':[a41_0x7f3309(Box,{'children':[a41_0x264e77(Text,{'children':_0x3581e0(0x1a3)}),a41_0x264e77(Text,{'color':_0x3581e0(0x1a8),'children':_0x3581e0(0x1a9)}),a41_0x264e77(Text,{'color':_0x3581e0(0x171),'children':_0x123cf0}),_0x3924df&&a41_0x7f3309(Text,{'color':_0x3581e0(0x183),'children':['\x20←\x20',_0x3924df]})]}),!_0x3924df&&a41_0x264e77(Box,{'children':a41_0x7f3309(Text,{'color':_0x3581e0(0x1a8),'children':['\x20',_0x3581e0(0x18c)]})})]}),_0x37f45b===_0x3581e0(0x174)&&a41_0x7f3309(Box,{'children':[a41_0x264e77(Text,{'children':_0x3581e0(0x18e)}),_0x59a069&&a41_0x264e77(Text,{'color':_0x3581e0(0x1a8),'children':_0x3581e0(0x18a)})]}),_0x37f45b==='confirm-api-pull'&&a41_0x7f3309(a41_0xaffb98,{'children':[a41_0x264e77(Box,{'children':a41_0x264e77(Text,{'color':_0x3581e0(0x171),'children':_0x3581e0(0x17f)})}),a41_0x264e77(Box,{'marginTop':0x1,'children':a41_0x264e77(Text,{'children':'*\x20是否要自动拉取\x20API\x20配置?'})}),a41_0x7f3309(Box,{'marginLeft':0x2,'children':[a41_0x7f3309(Text,{'color':_0x752721===0x0?_0x3581e0(0x171):_0x3581e0(0x1a8),'children':[_0x752721===0x0?'▶\x20':'\x20\x20',_0x3581e0(0x16f)]}),a41_0x264e77(Text,{'children':'\x20'}),a41_0x7f3309(Text,{'color':_0x752721===0x1?'green':'gray','children':[_0x752721===0x1?'▶\x20':'\x20\x20','No']})]}),a41_0x264e77(Box,{'children':a41_0x264e77(Text,{'color':_0x3581e0(0x1a8),'children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a41_0x264e77(Box,{'children':a41_0x264e77(Text,{'color':_0x3581e0(0x199),'children':_0x3581e0(0x182)})})]}),_0x37f45b==='login-prompt'&&a41_0x7f3309(a41_0xaffb98,{'children':[a41_0x264e77(Box,{'children':a41_0x264e77(Text,{'color':_0x3581e0(0x199),'children':_0x3581e0(0x1ab)})}),a41_0x264e77(Box,{'marginTop':0x1,'children':a41_0x264e77(Text,{'children':_0x3581e0(0x19e)})}),a41_0x7f3309(Box,{'marginLeft':0x2,'children':[a41_0x7f3309(Text,{'color':_0x4456fb===0x0?'green':_0x3581e0(0x1a8),'children':[_0x4456fb===0x0?'▶\x20':'\x20\x20',_0x3581e0(0x16f)]}),a41_0x264e77(Text,{'children':'\x20'}),a41_0x7f3309(Text,{'color':_0x4456fb===0x1?_0x3581e0(0x171):_0x3581e0(0x1a8),'children':[_0x4456fb===0x1?'▶\x20':'\x20\x20','No']})]}),a41_0x264e77(Box,{'children':a41_0x264e77(Text,{'color':_0x3581e0(0x1a8),'children':_0x3581e0(0x196)})}),a41_0x264e77(Box,{'children':a41_0x264e77(Text,{'color':_0x3581e0(0x199),'children':'\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口'})})]}),_0x37f45b===_0x3581e0(0x16b)&&a41_0x7f3309(Box,{'children':[a41_0x264e77(Text,{'children':_0x3581e0(0x18d)}),_0x1735e2&&a41_0x264e77(Text,{'color':'gray','children':'\x20登录中...'})]})]});}function a41_0x1835(){const _0x21eca5=['绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','*\x20正在登录,请前往浏览器完成登录...','*\x20正在检查登录状态...','5797088czPpih','length','登录状态','login-prompt','backspace','项目名不合法','includes','\x20\x20使用\x20←→\x20选择,回车确认','登录失败','\x20←\x20','yellow','1867990gYImhZ','969702yNgzqC','project-name','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','*\x20是否要先登录以便拉取\x20API\x20配置?','8eyDzkc','2134559akjPIs','未设置','confirm-api-pull','*\x20应用AppCode\x20','column','76CQROLG','应用AppCode','*\x20项目名:\x20','gray','[可选]:\x20','env','!\x20未检测到有效登录','743010bFvUcC','delete','项目名','login-process','creating','test','cyan','Yes','*\x20创建新项目','green','9pkwuHc','trim','login-check','拉取API配置','step','1934QMhAva','leftArrow','app-code','online','label','应用AppCode不合法','\x20直接回车确认,或输入自定义名称','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','√\x20检测到有效登录状态','26007ZmuMwx','login','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','red','map','跳过登录','slice','my-app','97ruymar','value','\x20检查中...','应用AppCode长度不能超过\x20100\x20个字符'];a41_0x1835=function(){return _0x21eca5;};return a41_0x1835();}
|
|
1
|
+
(function(_0x2d3874,_0x122eba){const _0x501f38=a39_0x4dae,_0x4af7c9=_0x2d3874();while(!![]){try{const _0x90937b=parseInt(_0x501f38(0x150))/0x1*(parseInt(_0x501f38(0x155))/0x2)+parseInt(_0x501f38(0x15e))/0x3*(-parseInt(_0x501f38(0x143))/0x4)+-parseInt(_0x501f38(0x11f))/0x5*(parseInt(_0x501f38(0x124))/0x6)+-parseInt(_0x501f38(0x12a))/0x7+-parseInt(_0x501f38(0x146))/0x8*(parseInt(_0x501f38(0x139))/0x9)+-parseInt(_0x501f38(0x12c))/0xa*(parseInt(_0x501f38(0x120))/0xb)+parseInt(_0x501f38(0x147))/0xc;if(_0x90937b===_0x122eba)break;else _0x4af7c9['push'](_0x4af7c9['shift']());}catch(_0x21eae7){_0x4af7c9['push'](_0x4af7c9['shift']());}}}(a39_0x4860,0xde391));import{jsx as a39_0x4fe754,jsxs as a39_0xf4aba8,Fragment as a39_0x49a188}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';function a39_0x4dae(_0x20c37b,_0x33578a){_0x20c37b=_0x20c37b-0x11f;const _0x486014=a39_0x4860();let _0x4dae74=_0x486014[_0x20c37b];return _0x4dae74;}import{readConfig}from'../utils/config.js';function a39_0x4860(){const _0x1b2a75=['includes','*\x20创建新项目','登录状态','red','13947bpRNvw','项目名','online','api-pull','673415dlnOOa','13734721kOxTIP','test','√\x20检测到有效登录状态','rightArrow','12BlrgyD','登录失败','length','\x20\x20使用\x20←→\x20选择,回车确认','\x20←\x20','*\x20应用AppCode\x20','428680NYDBzy','应用AppCode','10ruGEHb','delete','project-name','Yes','return','column','my-app','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','step','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','leftArrow','[可选]:\x20','项目名不合法','657hSTKZn','yellow','项目名长度不能超过\x2050\x20个字符','green','slice','*\x20正在登录,请前往浏览器完成登录...','label','\x20直接回车确认,或输入自定义名称','应用AppCode不合法','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','544GmSQNL','confirm-api-pull','login-prompt','118408jvAeyJ','42707436mRhKeg','env','trim','app-code','backspace','creating','应用AppCode长度不能超过\x20100\x20个字符','login','login-check','16927SryFRi','*\x20是否要先登录以便拉取\x20API\x20配置?','\x20登录中...','*\x20是否要自动拉取\x20API\x20配置?','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','76JpEBAA','已登录','map','login-process','gray'];a39_0x4860=function(){return _0x1b2a75;};return a39_0x4860();}export function EnhancedGuidedCreate(_0x4ab04e){const _0x29d1d5=a39_0x4dae,{onCreate:_0x23d34c,env:_0x8e8c3b}=_0x4ab04e,[_0x2ba40d,_0x15c465]=useState(_0x29d1d5(0x12e)),[_0x19f942,_0x2a88ee]=useState(''),[_0x48a104,_0x5ac2ad]=useState(''),[_0x311ced,_0x3ba32f]=useState(''),[_0x3b9abb,_0x4c3332]=useState(''),[_0x44c15d,_0xa23ada]=useState([]),[_0x17dc5a,_0x52d7b2]=useState(null),[_0x146350,_0x285aec]=useState(![]),[_0xf1104c,_0x4b5e23]=useState(![]),[_0x52c89c,_0x2334f7]=useState(![]),[_0x3ec752,_0x3b8dfc]=useState(0x0),[_0x547edc,_0x4fb3f0]=useState(0x0),_0x2dca57=_0x29d1d5(0x132),_0x185142=readConfig(),_0x29827a=typeof _0x185142[_0x29d1d5(0x148)]==='string'?_0x185142[_0x29d1d5(0x148)]:undefined;function _0x4d82a0(_0x55f3c3){const _0x4b80d5=_0x29d1d5;if(_0x55f3c3['length']>0x32)return{'valid':![],'message':_0x4b80d5(0x13b)};const _0x4e426e=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x55f3c3?.['trim']()&&!_0x4e426e[_0x4b80d5(0x121)](_0x55f3c3))return{'valid':![],'message':_0x4b80d5(0x154)};return{'valid':!![]};}function _0x4926a0(_0x59a63b){const _0x1be289=_0x29d1d5;if(!_0x59a63b['trim']())return{'valid':!![]};if(_0x59a63b[_0x1be289(0x126)]>0x64)return{'valid':![],'message':_0x1be289(0x14d)};const _0x12be27=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x12be27[_0x1be289(0x121)](_0x59a63b))return{'valid':![],'message':_0x1be289(0x142)};return{'valid':!![]};}async function _0x47b64c(){_0x285aec(!![]);try{const _0x47c9a6=await getIsSessionValid();return _0x52d7b2(_0x47c9a6),_0x47c9a6;}catch(_0x5e347e){return _0x52d7b2(![]),![];}finally{_0x285aec(![]);}}async function _0x118393(){_0x4b5e23(!![]);try{const _0x36306c=await authServer({'silent':!![]});return _0x52d7b2(_0x36306c),_0x36306c;}catch(_0x38bcea){return _0x52d7b2(![]),![];}finally{_0x4b5e23(![]);}}return useInput(async(_0x257d4f,_0x454811)=>{const _0x4e33b6=_0x29d1d5;if(_0x454811[_0x4e33b6(0x136)]||_0x454811[_0x4e33b6(0x123)]){if(_0x2ba40d===_0x4e33b6(0x144)){_0x3b8dfc(_0x4ba5a1=>_0x4ba5a1===0x0?0x1:0x0);return;}if(_0x2ba40d==='login-prompt'){_0x4fb3f0(_0x1b9558=>_0x1b9558===0x0?0x1:0x0);return;}}if(_0x454811[_0x4e33b6(0x130)]){if(_0x2ba40d==='project-name'){const _0x9a5d3b=_0x311ced[_0x4e33b6(0x149)]()||_0x2dca57;if(_0x3b9abb)return;_0x2a88ee(_0x9a5d3b),_0xa23ada([{'step':_0x4e33b6(0x12e),'label':_0x4e33b6(0x15f),'value':_0x9a5d3b}]),_0x3ba32f(''),_0x4c3332(''),_0x15c465(_0x4e33b6(0x14a));return;}if(_0x2ba40d===_0x4e33b6(0x14a)){if(_0x3b9abb)return;const _0x52902a=_0x311ced[_0x4e33b6(0x149)]();_0x5ac2ad(_0x52902a),_0xa23ada(_0x2b0471=>[..._0x2b0471,{'step':_0x4e33b6(0x14a),'label':_0x4e33b6(0x12b),'value':_0x52902a||'未设置'}]),_0x3ba32f(''),_0x4c3332('');if(_0x52902a){_0x15c465('login-check');const _0x38a645=await _0x47b64c();_0x38a645?_0x15c465(_0x4e33b6(0x144)):_0x15c465('login-prompt');}else{const _0x3a3a93=_0x8e8c3b||_0x29827a||_0x4e33b6(0x160);_0x23d34c({'projectName':_0x19f942,'appCode':undefined,'pullApi':![],'env':_0x3a3a93}),_0x15c465(_0x4e33b6(0x14c));}return;}if(_0x2ba40d==='confirm-api-pull'){const _0x5baebe=_0x3ec752===0x0;_0x2334f7(_0x5baebe),_0xa23ada(_0x44d25b=>[..._0x44d25b,{'step':_0x4e33b6(0x161),'label':'拉取API配置','value':_0x5baebe?'是':'否'}]);const _0x258b35=_0x8e8c3b||_0x29827a||_0x4e33b6(0x160);_0x23d34c({'projectName':_0x19f942,'appCode':_0x48a104,'pullApi':_0x5baebe,'env':_0x258b35}),_0x15c465(_0x4e33b6(0x14c));return;}if(_0x2ba40d===_0x4e33b6(0x145)){const _0x599c5e=_0x547edc===0x0;if(_0x599c5e){_0x15c465(_0x4e33b6(0x158));const _0x2c2f48=await _0x118393();if(_0x2c2f48)_0xa23ada(_0x51b5f4=>[..._0x51b5f4,{'step':_0x4e33b6(0x14e),'label':_0x4e33b6(0x15c),'value':_0x4e33b6(0x156)}]),_0x15c465(_0x4e33b6(0x144));else{_0xa23ada(_0xcd9551=>[..._0xcd9551,{'step':_0x4e33b6(0x14e),'label':'登录状态','value':_0x4e33b6(0x125)}]);const _0x4bc790=_0x8e8c3b||_0x29827a||_0x4e33b6(0x160);_0x23d34c({'projectName':_0x19f942,'appCode':_0x48a104,'pullApi':![],'env':_0x4bc790}),_0x15c465('creating');}}else{_0xa23ada(_0x47512d=>[..._0x47512d,{'step':_0x4e33b6(0x14e),'label':_0x4e33b6(0x15c),'value':'跳过登录'}]);const _0x546ac6=_0x8e8c3b||_0x29827a||_0x4e33b6(0x160);_0x23d34c({'projectName':_0x19f942,'appCode':_0x48a104,'pullApi':![],'env':_0x546ac6}),_0x15c465(_0x4e33b6(0x14c));}return;}}if(_0x454811[_0x4e33b6(0x14b)]||_0x454811[_0x4e33b6(0x12d)]){_0x3ba32f(_0x13c52e=>{const _0x2c9fba=_0x4e33b6,_0x2a3565=_0x13c52e[_0x2c9fba(0x13d)](0x0,-0x1);if(_0x2ba40d==='project-name'){const {valid:_0x48142c,message:_0x24b487}=_0x4d82a0(_0x2a3565);_0x4c3332(_0x48142c?'':_0x24b487||_0x2c9fba(0x138));}else{if(_0x2ba40d===_0x2c9fba(0x14a)){const {valid:_0x220a54,message:_0x2262f7}=_0x4926a0(_0x2a3565);_0x4c3332(_0x220a54?'':_0x2262f7||_0x2c9fba(0x141));}}return _0x2a3565;});return;}if([_0x4e33b6(0x14c),'login-check','login-process'][_0x4e33b6(0x15a)](_0x2ba40d))return;if(_0x2ba40d==='confirm-api-pull'||_0x2ba40d===_0x4e33b6(0x145))return;_0x3ba32f(_0x2bee49=>{const _0x4c8432=_0x4e33b6,_0x2c134d=_0x2bee49+_0x257d4f;if(_0x2ba40d===_0x4c8432(0x12e)){const {valid:_0x5d1535,message:_0x1ba21d}=_0x4d82a0(_0x2c134d);_0x4c3332(_0x5d1535?'':_0x1ba21d||'项目名不合法');}else{if(_0x2ba40d==='app-code'){const {valid:_0x4ee2ea,message:_0x51a7b3}=_0x4926a0(_0x2c134d);_0x4c3332(_0x4ee2ea?'':_0x51a7b3||_0x4c8432(0x141));}}return _0x2c134d;});}),a39_0xf4aba8(Box,{'flexDirection':_0x29d1d5(0x131),'marginTop':0x1,'children':[_0x44c15d[_0x29d1d5(0x126)]===0x0&&a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':'cyan','children':_0x29d1d5(0x15b)})}),_0x44c15d[_0x29d1d5(0x157)](_0x9ed6a4=>a39_0xf4aba8(Box,{'children':[a39_0xf4aba8(Text,{'color':_0x29d1d5(0x13c),'children':['√\x20',_0x9ed6a4[_0x29d1d5(0x13f)],':\x20']}),a39_0x4fe754(Text,{'color':'cyan','children':_0x9ed6a4['value']})]},_0x9ed6a4[_0x29d1d5(0x134)])),_0x2ba40d===_0x29d1d5(0x12e)&&a39_0xf4aba8(a39_0x49a188,{'children':[a39_0xf4aba8(Box,{'children':[a39_0x4fe754(Text,{'children':'*\x20项目名:\x20'}),_0x311ced?a39_0x4fe754(Text,{'color':_0x29d1d5(0x13c),'children':_0x311ced}):a39_0x4fe754(Text,{'color':_0x29d1d5(0x159),'children':_0x2dca57}),_0x3b9abb&&a39_0xf4aba8(Text,{'color':_0x29d1d5(0x15d),'children':[_0x29d1d5(0x128),_0x3b9abb]})]}),!_0x3b9abb&&!_0x311ced&&a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x159),'children':_0x29d1d5(0x140)})})]}),_0x2ba40d===_0x29d1d5(0x14a)&&a39_0xf4aba8(a39_0x49a188,{'children':[a39_0xf4aba8(Box,{'children':[a39_0x4fe754(Text,{'children':_0x29d1d5(0x129)}),a39_0x4fe754(Text,{'color':_0x29d1d5(0x159),'children':_0x29d1d5(0x137)}),a39_0x4fe754(Text,{'color':_0x29d1d5(0x13c),'children':_0x311ced}),_0x3b9abb&&a39_0xf4aba8(Text,{'color':'red','children':[_0x29d1d5(0x128),_0x3b9abb]})]}),!_0x3b9abb&&a39_0x4fe754(Box,{'children':a39_0xf4aba8(Text,{'color':'gray','children':['\x20',_0x29d1d5(0x133)]})})]}),_0x2ba40d===_0x29d1d5(0x14f)&&a39_0xf4aba8(Box,{'children':[a39_0x4fe754(Text,{'children':'*\x20正在检查登录状态...'}),_0x146350&&a39_0x4fe754(Text,{'color':'gray','children':'\x20检查中...'})]}),_0x2ba40d===_0x29d1d5(0x144)&&a39_0xf4aba8(a39_0x49a188,{'children':[a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x13c),'children':_0x29d1d5(0x122)})}),a39_0x4fe754(Box,{'marginTop':0x1,'children':a39_0x4fe754(Text,{'children':_0x29d1d5(0x153)})}),a39_0xf4aba8(Box,{'marginLeft':0x2,'children':[a39_0xf4aba8(Text,{'color':_0x3ec752===0x0?'green':'gray','children':[_0x3ec752===0x0?'▶\x20':'\x20\x20',_0x29d1d5(0x12f)]}),a39_0x4fe754(Text,{'children':'\x20'}),a39_0xf4aba8(Text,{'color':_0x3ec752===0x1?_0x29d1d5(0x13c):_0x29d1d5(0x159),'children':[_0x3ec752===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x159),'children':_0x29d1d5(0x127)})}),a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x13a),'children':_0x29d1d5(0x135)})})]}),_0x2ba40d===_0x29d1d5(0x145)&&a39_0xf4aba8(a39_0x49a188,{'children':[a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x13a),'children':'!\x20未检测到有效登录'})}),a39_0x4fe754(Box,{'marginTop':0x1,'children':a39_0x4fe754(Text,{'children':_0x29d1d5(0x151)})}),a39_0xf4aba8(Box,{'marginLeft':0x2,'children':[a39_0xf4aba8(Text,{'color':_0x547edc===0x0?_0x29d1d5(0x13c):_0x29d1d5(0x159),'children':[_0x547edc===0x0?'▶\x20':'\x20\x20',_0x29d1d5(0x12f)]}),a39_0x4fe754(Text,{'children':'\x20'}),a39_0xf4aba8(Text,{'color':_0x547edc===0x1?'green':_0x29d1d5(0x159),'children':[_0x547edc===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x159),'children':_0x29d1d5(0x127)})}),a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x13a),'children':'\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口'})})]}),_0x2ba40d===_0x29d1d5(0x158)&&a39_0xf4aba8(Box,{'children':[a39_0x4fe754(Text,{'children':_0x29d1d5(0x13e)}),_0xf1104c&&a39_0x4fe754(Text,{'color':_0x29d1d5(0x159),'children':_0x29d1d5(0x152)})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a40_0x42b8(_0x4abedf,_0x18c952){_0x4abedf=_0x4abedf-0x6f;const _0x2058a0=a40_0x2058();let _0x42b8aa=_0x2058a0[_0x4abedf];return _0x42b8aa;}(function(_0x246894,_0xb5c869){const _0x5e37a9=a40_0x42b8,_0x21ba99=_0x246894();while(!![]){try{const _0x534a7d=parseInt(_0x5e37a9(0x77))/0x1+parseInt(_0x5e37a9(0x74))/0x2+-parseInt(_0x5e37a9(0x6f))/0x3+-parseInt(_0x5e37a9(0x78))/0x4*(parseInt(_0x5e37a9(0x7a))/0x5)+parseInt(_0x5e37a9(0x71))/0x6*(-parseInt(_0x5e37a9(0x79))/0x7)+-parseInt(_0x5e37a9(0x76))/0x8+-parseInt(_0x5e37a9(0x70))/0x9*(parseInt(_0x5e37a9(0x72))/0xa);if(_0x534a7d===_0xb5c869)break;else _0x21ba99['push'](_0x21ba99['shift']());}catch(_0x585790){_0x21ba99['push'](_0x21ba99['shift']());}}}(a40_0x2058,0x3c140));export function formatElapsed(_0x1faf6f){const _0x596636=a40_0x42b8,_0x151c0c=Date[_0x596636(0x75)]()-_0x1faf6f;if(_0x151c0c<0x3e8)return _0x151c0c+'ms';const _0x3f6199=(_0x151c0c/0x3e8)['toFixed'](0x2),_0x3ab85d=_0x3f6199[_0x596636(0x73)](/\.?0+$/u,'');return _0x3ab85d+'s';}function a40_0x2058(){const _0xa15b4e=['1980536naXrUP','441994vSupce','76vyaXUQ','966679BQLGra','10555RwbYNY','7263BClmUg','1224PqZdPH','6CPCKDH','7630uEMWJX','replace','672096KMlCVI','now'];a40_0x2058=function(){return _0xa15b4e;};return a40_0x2058();}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x187b1e,_0x410917){const _0x108b76=a43_0x4b61,_0x370c70=_0x187b1e();while(!![]){try{const _0x5cdcbe=parseInt(_0x108b76(0xe4))/0x1+parseInt(_0x108b76(0xd3))/0x2+parseInt(_0x108b76(0xe3))/0x3*(-parseInt(_0x108b76(0xda))/0x4)+parseInt(_0x108b76(0xb2))/0x5*(-parseInt(_0x108b76(0xbb))/0x6)+-parseInt(_0x108b76(0x9c))/0x7*(-parseInt(_0x108b76(0xd9))/0x8)+-parseInt(_0x108b76(0xbc))/0x9*(-parseInt(_0x108b76(0xa1))/0xa)+-parseInt(_0x108b76(0xa6))/0xb;if(_0x5cdcbe===_0x410917)break;else _0x370c70['push'](_0x370c70['shift']());}catch(_0x4bdac0){_0x370c70['push'](_0x370c70['shift']());}}}(a43_0x10f6,0x43f91));import{jsx as a43_0x32eb99,Fragment as a43_0x4cc24c,jsxs as a43_0x2ba9da}from'react/jsx-runtime';import a43_0x596acd from'node:path';import a43_0x1a8784 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';function a43_0x4b61(_0x1ecc31,_0x5124ca){_0x1ecc31=_0x1ecc31-0x8b;const _0x10f609=a43_0x10f6();let _0x4b61b8=_0x10f609[_0x1ecc31];return _0x4b61b8;}import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';function a43_0x10f6(){const _0x460626=['更新\x20package.json\x20name\x20和\x20description\x20字段','existsSync','readFileSync','online','pullApi','配置AppCode:\x20','utf8','length','23508kgRaNF','135oVmhiH','error','create','repeat','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','×\x20项目目录\x20','.lovrabetrc','column','📦\x20API配置:\x20','🎉\x20项目创建成功!','gray','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','yellow','version','\x20√\x20','*\x20正在为项目\x20','doTask','项目创建失败:\x20','success','更新\x20package.json\x20失败:\x20','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','拉取API配置:\x20','parse','103022IIchXp','warn','配置应用AppCode失败:\x20','1.0.0','开始创建项目:\x20','accessSync','16ZUwTxc','4BslEVU','writeFileSync','√\x20配置文件已创建,应用AppCode:\x20','lovrabet\x20api\x20pull','message','stringify','cwd','white','🔗\x20应用AppCode:\x20','1073238skLUpS','209718CglNYk','join','test','已自动拉取\x20✓','description','清理项目目录失败:\x20','未配置','info','dirname','🚀\x20接下来可以:','cd\x20','projectCode','env','projectName','cyan','../..','\x20创建配置文件','×\x20无法在当前目录创建项目,请检查目录权限','API\x20配置拉取失败:\x20','\x20&&\x20lovrabet\x20start','*\x20正在拉取\x20API\x20配置...','2.\x20','📁\x20项目名称:\x20','465766jnzeXj','*\x20配置文件路径:\x20','√\x20package.json\x20已更新:\x20name=','toLocaleString','\x20|\x20应用AppCode:\x20','268980vTwPgH','×\x20项目名不能为空','需手动拉取','string','3.\x20','355498GgwFFh','appCode','setLogPath',',\x20description=','resolve','green','项目名称:\x20','log','package.json','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','×\x20项目创建失败:\x20','rmSync','165oTOUFY'];a43_0x10f6=function(){return _0x460626;};return a43_0x10f6();}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(_0x2f58ba){const _0x434095=a43_0x4b61,[_0x1d5947,_0x16604f]=useState(![]),[_0x137868,_0x124059]=useState(![]),[_0x560629,_0x297c88]=useState(null),_0x49f1b6=useCopyProjectTemplate(),_0x521fe6=useInstallDependencies(),_0x2d78ff=useFormatCode(),_0x469b55=async _0x528cba=>{const _0x5bc2e3=a43_0x4b61;if(!_0x528cba['projectName']||_0x528cba[_0x5bc2e3(0x92)]['trim']()===''){console[_0x5bc2e3(0xbd)](_0x5bc2e3(0xa2));return;}const _0x4fc2ec=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x4fc2ec[_0x5bc2e3(0xe6)](_0x528cba[_0x5bc2e3(0x92)])){console['error'](_0x5bc2e3(0xd0));return;}if(_0x528cba[_0x5bc2e3(0x92)][_0x5bc2e3(0xba)]>0x64){console['error']('×\x20项目名过长,最多支持\x20100\x20个字符');return;}const _0xeeec8d=a43_0x596acd[_0x5bc2e3(0xaa)](process[_0x5bc2e3(0xe0)](),_0x528cba['projectName']);if(a43_0x1a8784[_0x5bc2e3(0xb4)](_0xeeec8d)){console[_0x5bc2e3(0xbd)](_0x5bc2e3(0xc1)+_0x528cba['projectName']+'\x20已存在,请使用其他项目名');return;}try{const _0x3017cd=a43_0x596acd['dirname'](_0xeeec8d);a43_0x1a8784[_0x5bc2e3(0xd8)](_0x3017cd,a43_0x1a8784['constants']['W_OK']);}catch(_0x25910b){console[_0x5bc2e3(0xbd)](_0x5bc2e3(0x96));return;}_0x297c88(_0x528cba),_0x16604f(!![]),logger[_0x5bc2e3(0xa8)](_0xeeec8d),logger[_0x5bc2e3(0x8c)](_0x5bc2e3(0xbe),_0x5bc2e3(0xd7)+_0x528cba[_0x5bc2e3(0x92)],{'projectDir':_0xeeec8d,'appCode':_0x528cba[_0x5bc2e3(0xa7)]});try{await _0x49f1b6[_0x5bc2e3(0xcc)](_0x528cba[_0x5bc2e3(0x92)]),await _0x2ad07c(_0x528cba['projectName']),await _0x521fe6[_0x5bc2e3(0xcc)](_0x528cba['projectName']),await _0x2d78ff['doTask'](_0x528cba[_0x5bc2e3(0x92)]),await _0x49eda3(_0x528cba[_0x5bc2e3(0x92)],_0x528cba['appCode']||'',_0x528cba[_0x5bc2e3(0x91)]);if(_0x528cba[_0x5bc2e3(0xb7)]&&_0x528cba[_0x5bc2e3(0xa7)]){console[_0x5bc2e3(0xad)](_0x5bc2e3(0x99));try{const _0x35f3f4=await pullApiSilent(_0x528cba['appCode'],undefined,_0xeeec8d,_0x528cba[_0x5bc2e3(0x91)]);_0x35f3f4?(console[_0x5bc2e3(0xad)]('√\x20API\x20配置拉取完成'),logger['info']('create','API\x20配置拉取成功:\x20'+_0x528cba[_0x5bc2e3(0xa7)],{'projectDir':_0xeeec8d,'appCode':_0x528cba[_0x5bc2e3(0xa7)],'env':_0x528cba[_0x5bc2e3(0x91)]})):(console['log'](_0x5bc2e3(0xc7)),logger[_0x5bc2e3(0xd4)]('create',_0x5bc2e3(0x97)+_0x528cba[_0x5bc2e3(0xa7)],{'projectDir':_0xeeec8d,'appCode':_0x528cba[_0x5bc2e3(0xa7)],'env':_0x528cba[_0x5bc2e3(0x91)]}));}catch(_0x4261f4){console[_0x5bc2e3(0xad)](_0x5bc2e3(0xc0)),logger[_0x5bc2e3(0xd4)](_0x5bc2e3(0xbe),'API\x20配置拉取异常:\x20'+_0x528cba[_0x5bc2e3(0xa7)],{'projectDir':_0xeeec8d,'appCode':_0x528cba[_0x5bc2e3(0xa7)],'env':_0x528cba['env'],'error':_0x4261f4 instanceof Error?_0x4261f4[_0x5bc2e3(0xde)]:String(_0x4261f4)});}}logger[_0x5bc2e3(0xce)](_0x5bc2e3(0xbe),'项目创建完成:\x20'+_0x528cba[_0x5bc2e3(0x92)]),_0x124059(!![]),_0x16604f(![]);}catch(_0x378bfa){logger['error'](_0x5bc2e3(0xbe),_0x5bc2e3(0xcd)+_0x528cba[_0x5bc2e3(0x92)],{'error':_0x378bfa instanceof Error?_0x378bfa['message']:String(_0x378bfa)});try{a43_0x1a8784[_0x5bc2e3(0xb4)](_0xeeec8d)&&(console[_0x5bc2e3(0xad)]('*\x20清理失败的项目目录:\x20'+_0xeeec8d),a43_0x1a8784[_0x5bc2e3(0xb1)](_0xeeec8d,{'recursive':!![],'force':!![]}));}catch(_0x5933a5){logger[_0x5bc2e3(0xd4)](_0x5bc2e3(0xbe),_0x5bc2e3(0xe9)+_0xeeec8d,{'error':_0x5933a5 instanceof Error?_0x5933a5[_0x5bc2e3(0xde)]:String(_0x5933a5)});}_0x16604f(![]),console[_0x5bc2e3(0xbd)](_0x5bc2e3(0xb0)+(_0x378bfa instanceof Error?_0x378bfa['message']:String(_0x378bfa)));}},_0x569b4d=async _0x3cfe40=>{await _0x469b55({'projectName':_0x3cfe40,'env':_0x2f58ba['env']});},_0x2ad07c=async _0x3f0ff8=>{const _0x3f556c=a43_0x4b61,_0x5de38d=a43_0x596acd[_0x3f556c(0xaa)](process[_0x3f556c(0xe0)](),_0x3f0ff8),_0x6ad52a=a43_0x596acd['join'](_0x5de38d,_0x3f556c(0xae));try{console[_0x3f556c(0xad)]('*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段');const _0x88ebe9=fileURLToPath(import.meta.url),_0x20f339=a43_0x596acd[_0x3f556c(0xaa)](a43_0x596acd[_0x3f556c(0x8d)](_0x88ebe9),_0x3f556c(0x94)),_0x345bef=a43_0x596acd[_0x3f556c(0xe5)](_0x20f339,'package.json');let _0x870c08=_0x3f556c(0xd6);try{const _0x101638=JSON[_0x3f556c(0xd2)](a43_0x1a8784[_0x3f556c(0xb5)](_0x345bef,_0x3f556c(0xb9)));_0x870c08=_0x101638[_0x3f556c(0xc9)]||_0x3f556c(0xd6);}catch(_0x42e885){}const _0x3a9133=a43_0x1a8784['readFileSync'](_0x6ad52a,_0x3f556c(0xb9)),_0x434da7=JSON[_0x3f556c(0xd2)](_0x3a9133);_0x434da7['name']=_0x3f0ff8,_0x434da7['description']=_0x3f0ff8+'\x20Generated\x20by\x20lovrabet\x20cli\x20'+_0x870c08,a43_0x1a8784[_0x3f556c(0xdb)](_0x6ad52a,JSON[_0x3f556c(0xdf)](_0x434da7,null,0x2)+'\x0a',_0x3f556c(0xb9)),console['log'](_0x3f556c(0x9e)+_0x3f0ff8+_0x3f556c(0xa9)+_0x434da7[_0x3f556c(0xe8)]),logger['info']('create',_0x3f556c(0xb3),{'projectName':_0x3f0ff8,'description':_0x434da7[_0x3f556c(0xe8)],'cliVersion':_0x870c08,'packageJsonPath':_0x3f556c(0xae)});}catch(_0x3e6c4c){logger[_0x3f556c(0xbd)]('create',_0x3f556c(0xcf)+_0x3f0ff8,{'projectName':_0x3f0ff8,'error':_0x3e6c4c instanceof Error?_0x3e6c4c['message']:String(_0x3e6c4c)});throw _0x3e6c4c;}},_0x49eda3=async(_0x24827d,_0x240911,_0x2addb5)=>{const _0x12010f=a43_0x4b61,_0x1000b5=a43_0x596acd[_0x12010f(0xaa)](process[_0x12010f(0xe0)](),_0x24827d),_0xea4fbf=a43_0x596acd[_0x12010f(0xe5)](_0x1000b5,_0x12010f(0xc2));try{_0x240911?console[_0x12010f(0xad)](_0x12010f(0xcb)+_0x24827d+'\x20配置应用AppCode:\x20'+_0x240911):console[_0x12010f(0xad)](_0x12010f(0xcb)+_0x24827d+_0x12010f(0x95));console['log'](_0x12010f(0x9d)+_0xea4fbf);const _0x11ffa9=fileURLToPath(import.meta.url),_0x50f092=a43_0x596acd[_0x12010f(0xaa)](a43_0x596acd[_0x12010f(0x8d)](_0x11ffa9),'../..'),_0x304655=a43_0x596acd['join'](_0x50f092,_0x12010f(0xae));let _0x1ffcef=_0x12010f(0xd6);try{const _0x24ab2c=JSON[_0x12010f(0xd2)](a43_0x1a8784[_0x12010f(0xb5)](_0x304655,'utf8'));_0x1ffcef=_0x24ab2c['version']||_0x12010f(0xd6);}catch(_0x42cbd4){}const _0x282284=readConfig(),_0x5b9932=typeof _0x282284[_0x12010f(0x91)]===_0x12010f(0xa4)?_0x282284[_0x12010f(0x91)]:undefined,{app:_0x378458,appcode:_0x3e26b5,..._0x35c634}=_0x282284,_0x1e84d1={..._0x35c634,'appcode':_0x240911||'','env':_0x2addb5||_0x5b9932||_0x12010f(0xb6),'createdAt':new Date()[_0x12010f(0x9f)](),'version':_0x1ffcef};a43_0x1a8784['writeFileSync'](_0xea4fbf,JSON['stringify'](_0x1e84d1,null,0x2),_0x12010f(0xb9)),_0x240911?console[_0x12010f(0xad)](_0x12010f(0xdc)+_0x240911):console[_0x12010f(0xad)](_0x12010f(0xaf)),logger[_0x12010f(0x8c)](_0x12010f(0xbe),'配置应用AppCode:\x20'+_0x240911,{'projectName':_0x24827d,'configFile':_0x12010f(0xc2)});}catch(_0x1e2fb5){logger[_0x12010f(0xbd)](_0x12010f(0xbe),_0x12010f(0xd5)+_0x240911,{'projectName':_0x24827d,'error':_0x1e2fb5 instanceof Error?_0x1e2fb5[_0x12010f(0xde)]:String(_0x1e2fb5)});}};useEffect(()=>{const _0xa4025d=a43_0x4b61;_0x2f58ba[_0xa4025d(0x90)]&&_0x569b4d(_0x2f58ba[_0xa4025d(0x90)]);},[_0x2f58ba[_0x434095(0x90)]]);if(!_0x1d5947&&!_0x137868&&!_0x2f58ba[_0x434095(0x90)])return a43_0x32eb99(EnhancedGuidedCreate,{'onCreate':_0x469b55,'env':_0x2f58ba[_0x434095(0x91)]});if(_0x1d5947)return a43_0x2ba9da(a43_0x4cc24c,{'children':[a43_0x2ba9da(Box,{'marginTop':0x1,'children':[a43_0x32eb99(Box,{'width':'1'}),a43_0x32eb99(Text,{'color':'green','children':_0x434095(0xca)}),a43_0x32eb99(Text,{'children':_0x434095(0xac)}),a43_0x32eb99(Text,{'color':_0x434095(0xab),'children':_0x560629?.[_0x434095(0x92)]}),_0x560629?.['appCode']&&a43_0x2ba9da(a43_0x4cc24c,{'children':[a43_0x32eb99(Text,{'children':_0x434095(0xa0)}),a43_0x32eb99(Text,{'color':_0x434095(0x93),'children':_0x560629[_0x434095(0xa7)]})]})]}),a43_0x32eb99(TaskRunning,{..._0x49f1b6}),a43_0x32eb99(TaskRunning,{..._0x521fe6}),a43_0x32eb99(TaskRunning,{..._0x2d78ff})]});if(_0x137868)return a43_0x2ba9da(a43_0x4cc24c,{'children':[a43_0x2ba9da(Box,{'marginTop':0x1,'children':[a43_0x32eb99(Box,{'width':'1'}),a43_0x32eb99(Text,{'color':_0x434095(0xab),'children':_0x434095(0xca)}),a43_0x32eb99(Text,{'children':'项目名称:\x20'}),a43_0x32eb99(Text,{'color':_0x434095(0xab),'children':_0x560629?.[_0x434095(0x92)]}),_0x560629?.['appCode']&&a43_0x2ba9da(a43_0x4cc24c,{'children':[a43_0x32eb99(Text,{'children':_0x434095(0xa0)}),a43_0x32eb99(Text,{'color':_0x434095(0x93),'children':_0x560629['appCode']})]})]}),a43_0x32eb99(TaskFinished,{..._0x49f1b6}),a43_0x32eb99(TaskFinished,{..._0x521fe6}),a43_0x32eb99(TaskFinished,{..._0x2d78ff}),a43_0x32eb99(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a43_0x32eb99(Text,{'color':_0x434095(0xab),'children':'─'[_0x434095(0xbf)](0x3c)})}),a43_0x32eb99(Box,{'children':a43_0x32eb99(Text,{'color':'green','bold':!![],'children':_0x434095(0xc5)})}),a43_0x2ba9da(Box,{'marginTop':0x1,'flexDirection':_0x434095(0xc3),'children':[a43_0x2ba9da(Box,{'children':[a43_0x32eb99(Text,{'color':_0x434095(0x93),'children':_0x434095(0x9b)}),a43_0x32eb99(Text,{'color':_0x434095(0xe1),'bold':!![],'children':_0x560629?.[_0x434095(0x92)]})]}),_0x560629?.[_0x434095(0xa7)]&&a43_0x2ba9da(Box,{'children':[a43_0x32eb99(Text,{'color':'cyan','children':_0x434095(0xe2)}),a43_0x32eb99(Text,{'color':_0x434095(0xe1),'bold':!![],'children':_0x560629[_0x434095(0xa7)]})]}),a43_0x2ba9da(Box,{'children':[a43_0x32eb99(Text,{'color':_0x434095(0x93),'children':_0x434095(0xc4)}),_0x560629?.['pullApi']?a43_0x32eb99(Text,{'color':_0x434095(0xab),'bold':!![],'children':_0x434095(0xe7)}):_0x560629?.[_0x434095(0xa7)]?a43_0x32eb99(Text,{'color':_0x434095(0xc8),'bold':!![],'children':_0x434095(0xa3)}):a43_0x32eb99(Text,{'color':_0x434095(0xc6),'bold':!![],'children':_0x434095(0x8b)})]})]}),a43_0x32eb99(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a43_0x32eb99(Text,{'color':'cyan','bold':!![],'children':_0x434095(0x8e)})}),a43_0x2ba9da(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a43_0x2ba9da(Box,{'children':[a43_0x32eb99(Text,{'color':'green','children':'1.\x20'}),a43_0x32eb99(Text,{'color':_0x434095(0xe1),'children':'启动项目:\x20'}),a43_0x32eb99(Text,{'color':_0x434095(0x93),'bold':!![],'children':_0x434095(0x8f)+_0x560629?.[_0x434095(0x92)]+_0x434095(0x98)})]}),_0x560629?.[_0x434095(0xa7)]&&!_0x560629?.[_0x434095(0xb7)]&&a43_0x2ba9da(Box,{'children':[a43_0x32eb99(Text,{'color':'yellow','children':_0x434095(0x9a)}),a43_0x32eb99(Text,{'color':_0x434095(0xe1),'children':_0x434095(0xd1)}),a43_0x32eb99(Text,{'color':_0x434095(0x93),'bold':!![],'children':_0x434095(0xdd)})]}),!_0x560629?.[_0x434095(0xa7)]&&a43_0x2ba9da(a43_0x4cc24c,{'children':[a43_0x2ba9da(Box,{'children':[a43_0x32eb99(Text,{'color':_0x434095(0xc6),'children':'2.\x20'}),a43_0x32eb99(Text,{'color':'white','children':_0x434095(0xb8)}),a43_0x32eb99(Text,{'color':'cyan','bold':!![],'children':'lovrabet\x20config\x20set\x20appcode\x20[app-code]'})]}),a43_0x2ba9da(Box,{'children':[a43_0x32eb99(Text,{'color':'gray','children':_0x434095(0xa5)}),a43_0x32eb99(Text,{'color':'white','children':_0x434095(0xd1)}),a43_0x32eb99(Text,{'color':_0x434095(0x93),'bold':!![],'children':'lovrabet\x20api\x20pull\x20--appcode\x20[app-code]'})]})]})]}),a43_0x32eb99(Box,{'marginTop':0x1,'children':a43_0x32eb99(Text,{'color':_0x434095(0xab),'children':'─'[_0x434095(0xbf)](0x3c)})})]});return null;}
|
|
1
|
+
(function(_0x50b2c,_0x26fd62){const _0x505500=a41_0x30df,_0x54bd3d=_0x50b2c();while(!![]){try{const _0x36cda5=parseInt(_0x505500(0x1db))/0x1*(parseInt(_0x505500(0x237))/0x2)+-parseInt(_0x505500(0x1da))/0x3*(parseInt(_0x505500(0x1ea))/0x4)+parseInt(_0x505500(0x234))/0x5+-parseInt(_0x505500(0x1f6))/0x6+parseInt(_0x505500(0x1ec))/0x7*(parseInt(_0x505500(0x201))/0x8)+parseInt(_0x505500(0x212))/0x9+parseInt(_0x505500(0x218))/0xa*(-parseInt(_0x505500(0x205))/0xb);if(_0x36cda5===_0x26fd62)break;else _0x54bd3d['push'](_0x54bd3d['shift']());}catch(_0x3cf951){_0x54bd3d['push'](_0x54bd3d['shift']());}}}(a41_0x42f6,0x390f8));function a41_0x42f6(){const _0xb994d4=['lovrabet\x20api\x20pull','*\x20正在拉取\x20API\x20配置...','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','配置应用AppCode:\x20','192486zTdbbu','1gMnWcn','package.json','项目名称:\x20','cyan','cd\x20','gray','version','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','parse','清理项目目录失败:\x20','column','\x20|\x20应用AppCode:\x20','拉取API配置:\x20','.lovrabetrc','√\x20package.json\x20已更新:\x20name=','4SjoFjb','log','731241uZXCLq','create','utf8','\x20√\x20','项目创建完成:\x20','green','existsSync','配置AppCode:\x20','appCode','projectCode','1328304dhPbRg','trim','length','配置应用AppCode失败:\x20','🎉\x20项目创建成功!','name','error','accessSync','dirname','\x20Generated\x20by\x20lovrabet\x20cli\x20','更新\x20package.json\x20失败:\x20','8HlyQsl','setLogPath','×\x20项目目录\x20','writeFileSync','11QIxOhE','repeat','1.\x20','更新\x20package.json\x20name\x20和\x20description\x20字段','doTask','√\x20配置文件已创建,应用AppCode:\x20','env','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','cwd','string','×\x20项目名过长,最多支持\x20100\x20个字符','🚀\x20接下来可以:','×\x20项目创建失败:\x20','3635874BZMqXr','pullApi','projectName','×\x20项目名不能为空','../..','1.0.0','4942210NzBCEk','\x20创建配置文件','info','stringify','white','API\x20配置拉取成功:\x20',',\x20description=','2.\x20','online','description','📁\x20项目名称:\x20','success','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','*\x20配置文件路径:\x20','yellow','resolve','join','test','lovrabet\x20config\x20set\x20appcode\x20[app-code]','W_OK','*\x20正在为项目\x20','message','\x20配置应用AppCode:\x20','warn','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','readFileSync','\x20已存在,请使用其他项目名','×\x20无法在当前目录创建项目,请检查目录权限','726160TvUCiM','需手动拉取','未配置','719612EsXVYy','√\x20API\x20配置拉取完成'];a41_0x42f6=function(){return _0xb994d4;};return a41_0x42f6();}import{jsx as a41_0xc02386,Fragment as a41_0xa965e9,jsxs as a41_0x4312da}from'react/jsx-runtime';import a41_0x79bd0d from'node:path';import a41_0x5b1801 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';function a41_0x30df(_0x8b7031,_0x11a87c){_0x8b7031=_0x8b7031-0x1d7;const _0x42f691=a41_0x42f6();let _0x30dff8=_0x42f691[_0x8b7031];return _0x30dff8;}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(_0x27237b){const _0x3a93a5=a41_0x30df,[_0x53104a,_0x40600f]=useState(![]),[_0x205f8f,_0xac69b7]=useState(![]),[_0x2d3ecb,_0x5954f9]=useState(null),_0x2da05b=useCopyProjectTemplate(),_0x5a80d9=useInstallDependencies(),_0x36fe14=useFormatCode(),_0x5800bf=async _0x278c78=>{const _0x31baef=a41_0x30df;if(!_0x278c78[_0x31baef(0x214)]||_0x278c78[_0x31baef(0x214)][_0x31baef(0x1f7)]()===''){console['error'](_0x31baef(0x215));return;}const _0x37aa44=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x37aa44[_0x31baef(0x229)](_0x278c78[_0x31baef(0x214)])){console[_0x31baef(0x1fc)](_0x31baef(0x1d7));return;}if(_0x278c78[_0x31baef(0x214)][_0x31baef(0x1f8)]>0x64){console[_0x31baef(0x1fc)](_0x31baef(0x20f));return;}const _0x50c3af=a41_0x79bd0d[_0x31baef(0x227)](process[_0x31baef(0x20d)](),_0x278c78[_0x31baef(0x214)]);if(a41_0x5b1801[_0x31baef(0x1f2)](_0x50c3af)){console['error'](_0x31baef(0x203)+_0x278c78[_0x31baef(0x214)]+_0x31baef(0x232));return;}try{const _0x49ae01=a41_0x79bd0d[_0x31baef(0x1fe)](_0x50c3af);a41_0x5b1801[_0x31baef(0x1fd)](_0x49ae01,a41_0x5b1801['constants'][_0x31baef(0x22b)]);}catch(_0x33145c){console[_0x31baef(0x1fc)](_0x31baef(0x233));return;}_0x5954f9(_0x278c78),_0x40600f(!![]),logger[_0x31baef(0x202)](_0x50c3af),logger[_0x31baef(0x21a)](_0x31baef(0x1ed),'开始创建项目:\x20'+_0x278c78[_0x31baef(0x214)],{'projectDir':_0x50c3af,'appCode':_0x278c78[_0x31baef(0x1f4)]});try{await _0x2da05b[_0x31baef(0x209)](_0x278c78[_0x31baef(0x214)]),await _0x326a13(_0x278c78[_0x31baef(0x214)]),await _0x5a80d9[_0x31baef(0x209)](_0x278c78['projectName']),await _0x36fe14[_0x31baef(0x209)](_0x278c78[_0x31baef(0x214)]),await _0x4f0210(_0x278c78['projectName'],_0x278c78['appCode']||'',_0x278c78[_0x31baef(0x20b)]);if(_0x278c78[_0x31baef(0x213)]&&_0x278c78[_0x31baef(0x1f4)]){console[_0x31baef(0x1eb)](_0x31baef(0x23a));try{const _0x374a33=await pullApiSilent(_0x278c78['appCode'],undefined,_0x50c3af,_0x278c78['env']);_0x374a33?(console['log'](_0x31baef(0x238)),logger[_0x31baef(0x21a)](_0x31baef(0x1ed),_0x31baef(0x21d)+_0x278c78[_0x31baef(0x1f4)],{'projectDir':_0x50c3af,'appCode':_0x278c78[_0x31baef(0x1f4)],'env':_0x278c78['env']})):(console[_0x31baef(0x1eb)](_0x31baef(0x224)),logger[_0x31baef(0x22f)](_0x31baef(0x1ed),'API\x20配置拉取失败:\x20'+_0x278c78[_0x31baef(0x1f4)],{'projectDir':_0x50c3af,'appCode':_0x278c78['appCode'],'env':_0x278c78[_0x31baef(0x20b)]}));}catch(_0x266ba4){console[_0x31baef(0x1eb)](_0x31baef(0x20c)),logger[_0x31baef(0x22f)](_0x31baef(0x1ed),'API\x20配置拉取异常:\x20'+_0x278c78[_0x31baef(0x1f4)],{'projectDir':_0x50c3af,'appCode':_0x278c78['appCode'],'env':_0x278c78[_0x31baef(0x20b)],'error':_0x266ba4 instanceof Error?_0x266ba4[_0x31baef(0x22d)]:String(_0x266ba4)});}}logger[_0x31baef(0x223)](_0x31baef(0x1ed),_0x31baef(0x1f0)+_0x278c78[_0x31baef(0x214)]),_0xac69b7(!![]),_0x40600f(![]);}catch(_0x24c000){logger['error'](_0x31baef(0x1ed),'项目创建失败:\x20'+_0x278c78['projectName'],{'error':_0x24c000 instanceof Error?_0x24c000[_0x31baef(0x22d)]:String(_0x24c000)});try{a41_0x5b1801[_0x31baef(0x1f2)](_0x50c3af)&&(console[_0x31baef(0x1eb)]('*\x20清理失败的项目目录:\x20'+_0x50c3af),a41_0x5b1801['rmSync'](_0x50c3af,{'recursive':!![],'force':!![]}));}catch(_0x17d538){logger[_0x31baef(0x22f)](_0x31baef(0x1ed),_0x31baef(0x1e4)+_0x50c3af,{'error':_0x17d538 instanceof Error?_0x17d538[_0x31baef(0x22d)]:String(_0x17d538)});}_0x40600f(![]),console['error'](_0x31baef(0x211)+(_0x24c000 instanceof Error?_0x24c000[_0x31baef(0x22d)]:String(_0x24c000)));}},_0x425219=async _0x580a5e=>{const _0x3c0310=a41_0x30df;await _0x5800bf({'projectName':_0x580a5e,'env':_0x27237b[_0x3c0310(0x20b)]});},_0x326a13=async _0x321b50=>{const _0x4e7c6b=a41_0x30df,_0x15e462=a41_0x79bd0d[_0x4e7c6b(0x227)](process[_0x4e7c6b(0x20d)](),_0x321b50),_0x580e4d=a41_0x79bd0d[_0x4e7c6b(0x228)](_0x15e462,_0x4e7c6b(0x1dc));try{console[_0x4e7c6b(0x1eb)](_0x4e7c6b(0x230));const _0x26904d=fileURLToPath(import.meta.url),_0xa65e0f=a41_0x79bd0d['resolve'](a41_0x79bd0d['dirname'](_0x26904d),'../..'),_0x29afdd=a41_0x79bd0d[_0x4e7c6b(0x228)](_0xa65e0f,_0x4e7c6b(0x1dc));let _0x1aebe8='1.0.0';try{const _0x24363f=JSON[_0x4e7c6b(0x1e3)](a41_0x5b1801[_0x4e7c6b(0x231)](_0x29afdd,'utf8'));_0x1aebe8=_0x24363f[_0x4e7c6b(0x1e1)]||_0x4e7c6b(0x217);}catch(_0x2a3502){}const _0x5e1cb9=a41_0x5b1801[_0x4e7c6b(0x231)](_0x580e4d,_0x4e7c6b(0x1ee)),_0x475168=JSON[_0x4e7c6b(0x1e3)](_0x5e1cb9);_0x475168[_0x4e7c6b(0x1fb)]=_0x321b50,_0x475168[_0x4e7c6b(0x221)]=_0x321b50+_0x4e7c6b(0x1ff)+_0x1aebe8,a41_0x5b1801[_0x4e7c6b(0x204)](_0x580e4d,JSON[_0x4e7c6b(0x21b)](_0x475168,null,0x2)+'\x0a',_0x4e7c6b(0x1ee)),console[_0x4e7c6b(0x1eb)](_0x4e7c6b(0x1e9)+_0x321b50+_0x4e7c6b(0x21e)+_0x475168[_0x4e7c6b(0x221)]),logger[_0x4e7c6b(0x21a)]('create',_0x4e7c6b(0x208),{'projectName':_0x321b50,'description':_0x475168[_0x4e7c6b(0x221)],'cliVersion':_0x1aebe8,'packageJsonPath':'package.json'});}catch(_0x595a22){logger[_0x4e7c6b(0x1fc)](_0x4e7c6b(0x1ed),_0x4e7c6b(0x200)+_0x321b50,{'projectName':_0x321b50,'error':_0x595a22 instanceof Error?_0x595a22['message']:String(_0x595a22)});throw _0x595a22;}},_0x4f0210=async(_0x34b3da,_0x3500b1,_0x2d0195)=>{const _0x6a3d72=a41_0x30df,_0x5597ad=a41_0x79bd0d[_0x6a3d72(0x227)](process[_0x6a3d72(0x20d)](),_0x34b3da),_0x15f9dd=a41_0x79bd0d[_0x6a3d72(0x228)](_0x5597ad,_0x6a3d72(0x1e8));try{_0x3500b1?console[_0x6a3d72(0x1eb)](_0x6a3d72(0x22c)+_0x34b3da+_0x6a3d72(0x22e)+_0x3500b1):console[_0x6a3d72(0x1eb)](_0x6a3d72(0x22c)+_0x34b3da+_0x6a3d72(0x219));console['log'](_0x6a3d72(0x225)+_0x15f9dd);const _0x1e166a=fileURLToPath(import.meta.url),_0x7d990a=a41_0x79bd0d[_0x6a3d72(0x227)](a41_0x79bd0d[_0x6a3d72(0x1fe)](_0x1e166a),_0x6a3d72(0x216)),_0x5a1468=a41_0x79bd0d[_0x6a3d72(0x228)](_0x7d990a,_0x6a3d72(0x1dc));let _0x4af519=_0x6a3d72(0x217);try{const _0x3e560f=JSON[_0x6a3d72(0x1e3)](a41_0x5b1801[_0x6a3d72(0x231)](_0x5a1468,_0x6a3d72(0x1ee)));_0x4af519=_0x3e560f[_0x6a3d72(0x1e1)]||_0x6a3d72(0x217);}catch(_0x1e8ef6){}const _0x467118=readConfig(),_0xfc18a3=typeof _0x467118[_0x6a3d72(0x20b)]===_0x6a3d72(0x20e)?_0x467118[_0x6a3d72(0x20b)]:undefined,{app:_0x257402,appcode:_0x5dd49a,..._0x47bde9}=_0x467118,_0x4f1df9={..._0x47bde9,'appcode':_0x3500b1||'','env':_0x2d0195||_0xfc18a3||_0x6a3d72(0x220),'createdAt':new Date()['toLocaleString'](),'version':_0x4af519};a41_0x5b1801['writeFileSync'](_0x15f9dd,JSON[_0x6a3d72(0x21b)](_0x4f1df9,null,0x2),_0x6a3d72(0x1ee)),_0x3500b1?console[_0x6a3d72(0x1eb)](_0x6a3d72(0x20a)+_0x3500b1):console[_0x6a3d72(0x1eb)](_0x6a3d72(0x1d8)),logger[_0x6a3d72(0x21a)](_0x6a3d72(0x1ed),_0x6a3d72(0x1d9)+_0x3500b1,{'projectName':_0x34b3da,'configFile':_0x6a3d72(0x1e8)});}catch(_0x4442e2){logger[_0x6a3d72(0x1fc)](_0x6a3d72(0x1ed),_0x6a3d72(0x1f9)+_0x3500b1,{'projectName':_0x34b3da,'error':_0x4442e2 instanceof Error?_0x4442e2['message']:String(_0x4442e2)});}};useEffect(()=>{const _0x3b1447=a41_0x30df;_0x27237b['projectCode']&&_0x425219(_0x27237b[_0x3b1447(0x1f5)]);},[_0x27237b[_0x3a93a5(0x1f5)]]);if(!_0x53104a&&!_0x205f8f&&!_0x27237b[_0x3a93a5(0x1f5)])return a41_0xc02386(EnhancedGuidedCreate,{'onCreate':_0x5800bf,'env':_0x27237b[_0x3a93a5(0x20b)]});if(_0x53104a)return a41_0x4312da(a41_0xa965e9,{'children':[a41_0x4312da(Box,{'marginTop':0x1,'children':[a41_0xc02386(Box,{'width':'1'}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'children':_0x3a93a5(0x1ef)}),a41_0xc02386(Text,{'children':'项目名称:\x20'}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'children':_0x2d3ecb?.['projectName']}),_0x2d3ecb?.[_0x3a93a5(0x1f4)]&&a41_0x4312da(a41_0xa965e9,{'children':[a41_0xc02386(Text,{'children':_0x3a93a5(0x1e6)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'children':_0x2d3ecb[_0x3a93a5(0x1f4)]})]})]}),a41_0xc02386(TaskRunning,{..._0x2da05b}),a41_0xc02386(TaskRunning,{..._0x5a80d9}),a41_0xc02386(TaskRunning,{..._0x36fe14})]});if(_0x205f8f)return a41_0x4312da(a41_0xa965e9,{'children':[a41_0x4312da(Box,{'marginTop':0x1,'children':[a41_0xc02386(Box,{'width':'1'}),a41_0xc02386(Text,{'color':'green','children':'\x20√\x20'}),a41_0xc02386(Text,{'children':_0x3a93a5(0x1dd)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'children':_0x2d3ecb?.[_0x3a93a5(0x214)]}),_0x2d3ecb?.[_0x3a93a5(0x1f4)]&&a41_0x4312da(a41_0xa965e9,{'children':[a41_0xc02386(Text,{'children':_0x3a93a5(0x1e6)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'children':_0x2d3ecb[_0x3a93a5(0x1f4)]})]})]}),a41_0xc02386(TaskFinished,{..._0x2da05b}),a41_0xc02386(TaskFinished,{..._0x5a80d9}),a41_0xc02386(TaskFinished,{..._0x36fe14}),a41_0xc02386(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'children':'─'[_0x3a93a5(0x206)](0x3c)})}),a41_0xc02386(Box,{'children':a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'bold':!![],'children':_0x3a93a5(0x1fa)})}),a41_0x4312da(Box,{'marginTop':0x1,'flexDirection':'column','children':[a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'children':_0x3a93a5(0x222)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x21c),'bold':!![],'children':_0x2d3ecb?.[_0x3a93a5(0x214)]})]}),_0x2d3ecb?.['appCode']&&a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'children':'🔗\x20应用AppCode:\x20'}),a41_0xc02386(Text,{'color':_0x3a93a5(0x21c),'bold':!![],'children':_0x2d3ecb[_0x3a93a5(0x1f4)]})]}),a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'children':'📦\x20API配置:\x20'}),_0x2d3ecb?.['pullApi']?a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'bold':!![],'children':'已自动拉取\x20✓'}):_0x2d3ecb?.[_0x3a93a5(0x1f4)]?a41_0xc02386(Text,{'color':_0x3a93a5(0x226),'bold':!![],'children':_0x3a93a5(0x235)}):a41_0xc02386(Text,{'color':_0x3a93a5(0x1e0),'bold':!![],'children':_0x3a93a5(0x236)})]})]}),a41_0xc02386(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'bold':!![],'children':_0x3a93a5(0x210)})}),a41_0x4312da(Box,{'marginLeft':0x2,'flexDirection':_0x3a93a5(0x1e5),'children':[a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'children':_0x3a93a5(0x207)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x21c),'children':'启动项目:\x20'}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'bold':!![],'children':_0x3a93a5(0x1df)+_0x2d3ecb?.[_0x3a93a5(0x214)]+'\x20&&\x20lovrabet\x20start'})]}),_0x2d3ecb?.[_0x3a93a5(0x1f4)]&&!_0x2d3ecb?.['pullApi']&&a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x226),'children':'2.\x20'}),a41_0xc02386(Text,{'color':_0x3a93a5(0x21c),'children':_0x3a93a5(0x1e7)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'bold':!![],'children':_0x3a93a5(0x239)})]}),!_0x2d3ecb?.[_0x3a93a5(0x1f4)]&&a41_0x4312da(a41_0xa965e9,{'children':[a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x1e0),'children':_0x3a93a5(0x21f)}),a41_0xc02386(Text,{'color':'white','children':_0x3a93a5(0x1f3)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'bold':!![],'children':_0x3a93a5(0x22a)})]}),a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x1e0),'children':'3.\x20'}),a41_0xc02386(Text,{'color':_0x3a93a5(0x21c),'children':_0x3a93a5(0x1e7)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'bold':!![],'children':_0x3a93a5(0x1e2)})]})]})]}),a41_0xc02386(Box,{'marginTop':0x1,'children':a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'children':'─'[_0x3a93a5(0x206)](0x3c)})})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a42_0x4432(_0x5be27c,_0x3335d7){_0x5be27c=_0x5be27c-0x1f3;var _0x4192bf=a42_0x4192();var _0x44326b=_0x4192bf[_0x5be27c];return _0x44326b;}(function(_0x2c2507,_0x47e76e){var _0x2ec97c=a42_0x4432,_0x24925a=_0x2c2507();while(!![]){try{var _0x882ea7=parseInt(_0x2ec97c(0x1fc))/0x1*(parseInt(_0x2ec97c(0x1f7))/0x2)+-parseInt(_0x2ec97c(0x1f8))/0x3+-parseInt(_0x2ec97c(0x1fd))/0x4+-parseInt(_0x2ec97c(0x1f4))/0x5+-parseInt(_0x2ec97c(0x1f3))/0x6+parseInt(_0x2ec97c(0x1ff))/0x7*(parseInt(_0x2ec97c(0x1f9))/0x8)+parseInt(_0x2ec97c(0x1fa))/0x9*(parseInt(_0x2ec97c(0x1f6))/0xa);if(_0x882ea7===_0x47e76e)break;else _0x24925a['push'](_0x24925a['shift']());}catch(_0x51a754){_0x24925a['push'](_0x24925a['shift']());}}}(a42_0x4192,0x2d3c5));import{jsx as a42_0x47b4f3,jsxs as a42_0x5551e7}from'react/jsx-runtime';import{Box,Text}from'ink';function a42_0x4192(){var _0xda0cd9=['green','31859ZMgQUL','419060KkwbdQ','\x20√\x20','7AMKsYd','1571256RUtwMu','577585VueRPC','taskName','680VVcBws','6MuPSyH','16689aZnwNw','792936MmfYNA','63306HPSWPM'];a42_0x4192=function(){return _0xda0cd9;};return a42_0x4192();}import{TaskTime}from'./task-time.js';export function TaskFinished(_0x25e935){var _0x2d6d62=a42_0x4432;return a42_0x5551e7(Box,{'children':[a42_0x47b4f3(Box,{'width':'1'}),a42_0x47b4f3(Text,{'color':_0x2d6d62(0x1fb),'children':_0x2d6d62(0x1fe)}),a42_0x47b4f3(Text,{'children':_0x25e935[_0x2d6d62(0x1f5)]}),a42_0x47b4f3(TaskTime,{'elapsed':_0x25e935['elapsed']})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x292106,_0x2cd3cb){var _0x40ae9a=a43_0x4498,_0x18e299=_0x292106();while(!![]){try{var _0x15711d=-parseInt(_0x40ae9a(0x198))/0x1+parseInt(_0x40ae9a(0x193))/0x2+parseInt(_0x40ae9a(0x191))/0x3*(-parseInt(_0x40ae9a(0x189))/0x4)+-parseInt(_0x40ae9a(0x195))/0x5*(parseInt(_0x40ae9a(0x18e))/0x6)+parseInt(_0x40ae9a(0x196))/0x7+parseInt(_0x40ae9a(0x18b))/0x8*(parseInt(_0x40ae9a(0x194))/0x9)+-parseInt(_0x40ae9a(0x18c))/0xa*(-parseInt(_0x40ae9a(0x18f))/0xb);if(_0x15711d===_0x2cd3cb)break;else _0x18e299['push'](_0x18e299['shift']());}catch(_0x5d566b){_0x18e299['push'](_0x18e299['shift']());}}}(a43_0x15e3,0xb8bd7));import{jsx as a43_0x4e24ed,jsxs as a43_0x28a8ff}from'react/jsx-runtime';import{Text}from'ink';function a43_0x4498(_0x1f2cff,_0x393a91){_0x1f2cff=_0x1f2cff-0x189;var _0x15e368=a43_0x15e3();var _0x4498db=_0x15e368[_0x1f2cff];return _0x4498db;}import a43_0x32d905 from'ink-spinner';export function TaskLoading(_0x4a42ff){var _0x1ffa72=a43_0x4498;if(_0x4a42ff[_0x1ffa72(0x190)])return a43_0x4e24ed(Text,{'color':_0x1ffa72(0x18a),'children':_0x1ffa72(0x197)});if(_0x4a42ff['loading'])return a43_0x28a8ff(Text,{'color':'green','children':['\x20',a43_0x4e24ed(a43_0x32d905,{'type':_0x1ffa72(0x18d)}),'\x20']});return a43_0x4e24ed(Text,{'children':_0x1ffa72(0x192)});}function a43_0x15e3(){var _0x2011fc=['5351076yJkQrU','11aIlMOO','finished','1347kxJYnR','\x20\x20\x20','1203290XFzCva','9CYKgHn','5PhETGg','2030588GuKFkn','\x20√\x20','1435873dfJIdB','140aOvFTD','green','1688520zhWdVq','19973350nmTuYJ','dots'];a43_0x15e3=function(){return _0x2011fc;};return a43_0x15e3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x35ccd7,_0x5708e7){var _0x4a0a64=a44_0x1ce7,_0x419e07=_0x35ccd7();while(!![]){try{var _0x505d35=-parseInt(_0x4a0a64(0x8c))/0x1+parseInt(_0x4a0a64(0x87))/0x2+-parseInt(_0x4a0a64(0x88))/0x3+-parseInt(_0x4a0a64(0x90))/0x4*(parseInt(_0x4a0a64(0x89))/0x5)+parseInt(_0x4a0a64(0x8a))/0x6+parseInt(_0x4a0a64(0x8f))/0x7*(-parseInt(_0x4a0a64(0x8b))/0x8)+parseInt(_0x4a0a64(0x86))/0x9*(parseInt(_0x4a0a64(0x91))/0xa);if(_0x505d35===_0x5708e7)break;else _0x419e07['push'](_0x419e07['shift']());}catch(_0x2ba0f5){_0x419e07['push'](_0x419e07['shift']());}}}(a44_0x437c,0xa5e6e));import{jsx as a44_0x53d7d4,jsxs as a44_0x406009}from'react/jsx-runtime';function a44_0x437c(){var _0x5809ff=['5310CaVmvd','4826028tnpjyY','2056RQSNFu','57175wvVPbQ','elapsed','taskName','8148LpxzDm','304ivtaGk','11670SYSrrx','2943xCzrUl','1043076WeYWUS','1772748hEcRRP'];a44_0x437c=function(){return _0x5809ff;};return a44_0x437c();}function a44_0x1ce7(_0x2fac6d,_0x18c1bd){_0x2fac6d=_0x2fac6d-0x86;var _0x437cdc=a44_0x437c();var _0x1ce768=_0x437cdc[_0x2fac6d];return _0x1ce768;}import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x424473){var _0x3c9db9=a44_0x1ce7;return a44_0x406009(Box,{'children':[a44_0x53d7d4(Box,{'width':'1'}),a44_0x53d7d4(TaskLoading,{..._0x424473}),a44_0x53d7d4(Text,{'children':_0x424473[_0x3c9db9(0x8e)]}),a44_0x53d7d4(TaskTime,{'elapsed':_0x424473[_0x3c9db9(0x8d)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x31157b,_0x238c31){var _0x157683=a45_0x487d,_0xc4aa56=_0x31157b();while(!![]){try{var _0x3e0795=parseInt(_0x157683(0x93))/0x1*(parseInt(_0x157683(0x8a))/0x2)+parseInt(_0x157683(0x8d))/0x3+parseInt(_0x157683(0x8e))/0x4*(-parseInt(_0x157683(0x92))/0x5)+parseInt(_0x157683(0x90))/0x6*(parseInt(_0x157683(0x91))/0x7)+-parseInt(_0x157683(0x8f))/0x8+-parseInt(_0x157683(0x94))/0x9+-parseInt(_0x157683(0x89))/0xa*(-parseInt(_0x157683(0x8c))/0xb);if(_0x3e0795===_0x238c31)break;else _0xc4aa56['push'](_0xc4aa56['shift']());}catch(_0x3c532a){_0xc4aa56['push'](_0xc4aa56['shift']());}}}(a45_0x512d,0x290a2));import{jsx as a45_0x24cda4,Fragment as a45_0x235b9c,jsxs as a45_0x3aab57}from'react/jsx-runtime';import{Text}from'ink';function a45_0x487d(_0xf6db5f,_0x46c0d2){_0xf6db5f=_0xf6db5f-0x89;var _0x512d13=a45_0x512d();var _0x487d60=_0x512d13[_0xf6db5f];return _0x487d60;}export function TaskTime(_0x219f7e){var _0x44a924=a45_0x487d;if(_0x219f7e['elapsed'])return a45_0x3aab57(a45_0x235b9c,{'children':[a45_0x24cda4(Text,{'color':_0x44a924(0x8b),'children':'\x20['}),a45_0x24cda4(Text,{'color':_0x44a924(0x8b),'bold':!![],'children':_0x219f7e[_0x44a924(0x95)]}),a45_0x24cda4(Text,{'color':'gray','children':']'})]});return null;}function a45_0x512d(){var _0xb3e2ba=['144234EuBsWc','gray','145486wIwjAg','157119LVirZp','80sZzWNT','495528yMWWjl','306hrPeex','41741fjpsPj','54040pRCokk','1PESjyp','2222316ZxCOsO','elapsed','200mcvWsf'];a45_0x512d=function(){return _0xb3e2ba;};return a45_0x512d();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x45a490=a46_0x351f;(function(_0x337ec0,_0x31343c){const _0x1c1d57=a46_0x351f,_0x2c88d8=_0x337ec0();while(!![]){try{const _0x1452a2=-parseInt(_0x1c1d57(0x1f9))/0x1*(-parseInt(_0x1c1d57(0x1fa))/0x2)+-parseInt(_0x1c1d57(0x200))/0x3*(-parseInt(_0x1c1d57(0x1f1))/0x4)+parseInt(_0x1c1d57(0x1f2))/0x5*(-parseInt(_0x1c1d57(0x1ed))/0x6)+-parseInt(_0x1c1d57(0x1f0))/0x7*(parseInt(_0x1c1d57(0x1ff))/0x8)+parseInt(_0x1c1d57(0x1fc))/0x9+parseInt(_0x1c1d57(0x201))/0xa+parseInt(_0x1c1d57(0x203))/0xb*(-parseInt(_0x1c1d57(0x1f3))/0xc);if(_0x1452a2===_0x31343c)break;else _0x2c88d8['push'](_0x2c88d8['shift']());}catch(_0x5b4de9){_0x2c88d8['push'](_0x2c88d8['shift']());}}}(a46_0x1b22,0x321a8));import a46_0x39c414 from'node:path';function a46_0x351f(_0x4c3938,_0x35e1bb){_0x4c3938=_0x4c3938-0x1ec;const _0x1b22c4=a46_0x1b22();let _0x351fbd=_0x1b22c4[_0x4c3938];return _0x351fbd;}import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';function a46_0x1b22(){const _0x46f938=['now','info','message','error','开始复制项目模板','1SixciA','446356PdoJhz','项目模板复制完成','2159766czyGDm','resolve','项目模板复制失败','1832368LcNvdR','6FZzvPI','878980KIyyaP','cwd','36421BwrrCB','success','dirname','copy','97494xGVqTK','复制项目文件','../../templates/projects/sub-app-react-demo','7CUdyMW','498924mtoskj','75WPHYxU','444soslLM'];a46_0x1b22=function(){return _0x46f938;};return a46_0x1b22();}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a46_0x39c414[a46_0x45a490(0x205)](fileURLToPath(import.meta.url)),templateDir=a46_0x39c414[a46_0x45a490(0x1fd)](__dirname,a46_0x45a490(0x1ef));export function useCopyProjectTemplate(){const _0x37d914=a46_0x45a490,[_0x221875,_0x3fb503]=useState(![]),[_0x3f18cc,_0x385f7a]=useState(![]),[_0x21e25f,_0x5a8e48]=useState(''),_0x18941d=useCallback(async _0x4d459b=>{const _0x3abdad=a46_0x351f,_0x563465=Date[_0x3abdad(0x1f4)](),_0x36db0a=a46_0x39c414[_0x3abdad(0x1fd)](process[_0x3abdad(0x202)](),_0x4d459b);_0x3fb503(!![]);try{logger[_0x3abdad(0x1f5)](_0x3abdad(0x1ec),_0x3abdad(0x1f8),{'projectCode':_0x4d459b,'templateDir':templateDir}),await copyDirectory(templateDir,_0x36db0a);const _0x272f48=Date[_0x3abdad(0x1f4)]()-_0x563465;logger[_0x3abdad(0x204)](_0x3abdad(0x1ec),_0x3abdad(0x1fb),_0x272f48,{'projectCode':_0x4d459b});}catch(_0x1620c1){const _0x1abd73=Date[_0x3abdad(0x1f4)]()-_0x563465;logger[_0x3abdad(0x1f7)]('copy',_0x3abdad(0x1fe),{'projectCode':_0x4d459b,'error':_0x1620c1 instanceof Error?_0x1620c1[_0x3abdad(0x1f6)]:String(_0x1620c1),'duration':_0x1abd73});throw _0x1620c1;}finally{_0x3fb503(![]),_0x385f7a(!![]),_0x5a8e48(formatElapsed(_0x563465));}},[]);return{'taskName':_0x37d914(0x1ee),'finished':_0x3f18cc,'loading':_0x221875,'elapsed':_0x21e25f,'doTask':_0x18941d};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x54e5db,_0x3004cf){const _0x591a7b=a47_0x4d12,_0x1edbf1=_0x54e5db();while(!![]){try{const _0x3860ea=parseInt(_0x591a7b(0x159))/0x1*(parseInt(_0x591a7b(0x14c))/0x2)+parseInt(_0x591a7b(0x154))/0x3+parseInt(_0x591a7b(0x144))/0x4*(parseInt(_0x591a7b(0x14a))/0x5)+parseInt(_0x591a7b(0x14f))/0x6+-parseInt(_0x591a7b(0x14b))/0x7*(-parseInt(_0x591a7b(0x151))/0x8)+-parseInt(_0x591a7b(0x143))/0x9*(parseInt(_0x591a7b(0x146))/0xa)+parseInt(_0x591a7b(0x145))/0xb*(-parseInt(_0x591a7b(0x158))/0xc);if(_0x3860ea===_0x3004cf)break;else _0x1edbf1['push'](_0x1edbf1['shift']());}catch(_0x323b3d){_0x1edbf1['push'](_0x1edbf1['shift']());}}}(a47_0x3f83,0x57f4e));import a47_0x41ef3a from'node:path';function a47_0x3f83(){const _0x12eea7=['17286012orYztH','2882AWqKoN','18pwkbWf','52hZTIGi','11VHxlSx','87430Tggwxj','开始格式化代码','format','message','117835hZcMUJ','7763fQwtSX','366SswMCc','代码格式化完成','代码格式化失败','598038kPWQdh','格式化代码','3368RRzZzb','error','npx','1253754RhIKFT','info','prettier','now'];a47_0x3f83=function(){return _0x12eea7;};return a47_0x3f83();}import{useCallback,useState}from'react';function a47_0x4d12(_0xd0d6e0,_0x4d858c){_0xd0d6e0=_0xd0d6e0-0x143;const _0x3f83d3=a47_0x3f83();let _0x4d12c8=_0x3f83d3[_0xd0d6e0];return _0x4d12c8;}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x3d3bfc=a47_0x4d12,[_0x28f787,_0x4d118f]=useState(![]),[_0x3c11fe,_0x3dd6e6]=useState(![]),[_0x319d68,_0x31b0bc]=useState(''),_0x41bec0=useCallback(async _0x3da2e6=>{const _0x5bedc6=a47_0x4d12,_0x5bd0c7=Date[_0x5bedc6(0x157)](),_0x7b4799=a47_0x41ef3a['resolve'](process['cwd'](),_0x3da2e6);_0x4d118f(!![]);try{logger[_0x5bedc6(0x155)](_0x5bedc6(0x148),_0x5bedc6(0x147),{'projectCode':_0x3da2e6}),await execa(_0x5bedc6(0x153),[_0x5bedc6(0x156),'--write','.'],{'cwd':_0x7b4799});const _0x8dec23=Date[_0x5bedc6(0x157)]()-_0x5bd0c7;logger['success']('format',_0x5bedc6(0x14d),_0x8dec23,{'projectCode':_0x3da2e6});}catch(_0x5407c9){const _0x28e82e=Date[_0x5bedc6(0x157)]()-_0x5bd0c7;logger[_0x5bedc6(0x152)](_0x5bedc6(0x148),_0x5bedc6(0x14e),{'projectCode':_0x3da2e6,'error':_0x5407c9 instanceof Error?_0x5407c9[_0x5bedc6(0x149)]:String(_0x5407c9),'duration':_0x28e82e});throw _0x5407c9;}finally{_0x4d118f(![]),_0x3dd6e6(!![]),_0x31b0bc(formatElapsed(_0x5bd0c7));}},[]);return{'taskName':_0x3d3bfc(0x150),'finished':_0x3c11fe,'loading':_0x28f787,'elapsed':_0x319d68,'doTask':_0x41bec0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x14a509,_0x1b0190){const _0x41a21e=a48_0x5e41,_0x398c65=_0x14a509();while(!![]){try{const _0x3d459=-parseInt(_0x41a21e(0x1c2))/0x1+parseInt(_0x41a21e(0x1cf))/0x2+parseInt(_0x41a21e(0x1be))/0x3*(-parseInt(_0x41a21e(0x1c6))/0x4)+-parseInt(_0x41a21e(0x1ce))/0x5*(-parseInt(_0x41a21e(0x1c3))/0x6)+parseInt(_0x41a21e(0x1c1))/0x7+-parseInt(_0x41a21e(0x1b9))/0x8*(parseInt(_0x41a21e(0x1bf))/0x9)+parseInt(_0x41a21e(0x1cc))/0xa;if(_0x3d459===_0x1b0190)break;else _0x398c65['push'](_0x398c65['shift']());}catch(_0x4ca193){_0x398c65['push'](_0x398c65['shift']());}}}(a48_0x3210,0x6c8be));import a48_0x4de047 from'node:path';function a48_0x5e41(_0x119f4c,_0x22ab21){_0x119f4c=_0x119f4c-0x1b9;const _0x3210c3=a48_0x3210();let _0x5e41d0=_0x3210c3[_0x119f4c];return _0x5e41d0;}import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a48_0x3210(){const _0x3949ff=['https://registry.npmmirror.com','1500490ksgBAT','开始安装依赖','5Okjfec','1090172jMcEQV','376BTLRzI','依赖安装失败','cwd','now','error','27zrhmJx','111969HUPJLb','依赖安装完成','5400150zSgVkD','488853yeCTkR','3229602STJvUR','resolve','--registry','216296NUcZDl','success','安装依赖','install','info'];a48_0x3210=function(){return _0x3949ff;};return a48_0x3210();}export function useInstallDependencies(){const _0x4f779c=a48_0x5e41,[_0x28998c,_0x5eb0ef]=useState(![]),[_0x2f2980,_0x567a40]=useState(![]),[_0x2bd953,_0x541f0d]=useState(''),_0x1f1e47=useCallback(async _0x179609=>{const _0x341ae7=a48_0x5e41,_0x17b0a0=Date[_0x341ae7(0x1bc)](),_0x109705=a48_0x4de047[_0x341ae7(0x1c4)](process[_0x341ae7(0x1bb)](),_0x179609);_0x5eb0ef(!![]),_0x567a40(![]);const _0x28a69d=async(_0x383286,_0x235ccd)=>{await execa(_0x383286,_0x235ccd,{'cwd':_0x109705});};try{logger[_0x341ae7(0x1ca)](_0x341ae7(0x1c9),_0x341ae7(0x1cd),{'projectCode':_0x179609,'registry':_0x341ae7(0x1cb)}),await _0x28a69d('npm',[_0x341ae7(0x1c9),_0x341ae7(0x1c5),_0x341ae7(0x1cb)]);const _0xe3ca38=Date[_0x341ae7(0x1bc)]()-_0x17b0a0;logger[_0x341ae7(0x1c7)](_0x341ae7(0x1c9),_0x341ae7(0x1c0),_0xe3ca38,{'projectCode':_0x179609});}catch(_0x2fb77d){const _0x2cf783=Date['now']()-_0x17b0a0;logger[_0x341ae7(0x1bd)]('install',_0x341ae7(0x1ba),{'projectCode':_0x179609,'error':_0x2fb77d instanceof Error?_0x2fb77d['message']:String(_0x2fb77d),'duration':_0x2cf783});throw _0x2fb77d;}finally{_0x5eb0ef(![]),_0x567a40(!![]),_0x541f0d(formatElapsed(_0x17b0a0));}},[]);return{'taskName':_0x4f779c(0x1c8),'finished':_0x2f2980,'loading':_0x28998c,'elapsed':_0x2bd953,'doTask':_0x1f1e47};}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x7a5025,_0x58e11b){var _0x9788d7=a49_0x3ab8,_0x2add21=_0x7a5025();while(!![]){try{var _0x162893=parseInt(_0x9788d7(0x13e))/0x1+parseInt(_0x9788d7(0x145))/0x2*(-parseInt(_0x9788d7(0x13b))/0x3)+parseInt(_0x9788d7(0x141))/0x4+parseInt(_0x9788d7(0x148))/0x5*(parseInt(_0x9788d7(0x142))/0x6)+-parseInt(_0x9788d7(0x14a))/0x7*(parseInt(_0x9788d7(0x140))/0x8)+parseInt(_0x9788d7(0x146))/0x9*(parseInt(_0x9788d7(0x14b))/0xa)+-parseInt(_0x9788d7(0x13c))/0xb*(parseInt(_0x9788d7(0x13d))/0xc);if(_0x162893===_0x58e11b)break;else _0x2add21['push'](_0x2add21['shift']());}catch(_0x10e8c5){_0x2add21['push'](_0x2add21['shift']());}}}(a49_0x20d8,0x6b093));import{jsx as a49_0x1c0335,jsxs as a49_0x4f756f}from'react/jsx-runtime';function a49_0x20d8(){var _0x1a8ade=['81907FTVHzY','130bXiGgb','3zOdqLD','11TWVrFF','9431592WFfNSs','746846PzGaCU','查看可用命令。','32VpHKZs','1004244DoEbHV','1279716BnhWBW','lovrabet\x20--help','!\x20请指定一个有效的命令。','867514UpjCRN','341829WukyNO','green','5UDhBnU','column'];a49_0x20d8=function(){return _0x1a8ade;};return a49_0x20d8();}function a49_0x3ab8(_0xe67aef,_0x5e89e4){_0xe67aef=_0xe67aef-0x13b;var _0x20d823=a49_0x20d8();var _0x3ab847=_0x20d823[_0xe67aef];return _0x3ab847;}import{Box,Text}from'ink';export function Help(){var _0x4505db=a49_0x3ab8;return a49_0x4f756f(Box,{'flexDirection':_0x4505db(0x149),'marginTop':0x1,'marginBottom':0x1,'children':[a49_0x4f756f(Box,{'children':[a49_0x1c0335(Box,{'width':'1'}),a49_0x1c0335(Text,{'children':_0x4505db(0x144)})]}),a49_0x4f756f(Box,{'marginTop':0x1,'children':[a49_0x1c0335(Box,{'width':'1'}),a49_0x4f756f(Text,{'children':['\x20\x20','使用']}),a49_0x4f756f(Text,{'bold':!![],'color':_0x4505db(0x147),'children':['\x20',_0x4505db(0x143),'\x20']}),a49_0x1c0335(Text,{'children':_0x4505db(0x13f)})]})]});}
|
package/lib/init/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2b0b17,_0x9582e7){const _0x787ba7=a50_0x26a2,_0x374139=_0x2b0b17();while(!![]){try{const _0x59fb06=-parseInt(_0x787ba7(0x7e))/0x1*(parseInt(_0x787ba7(0xa3))/0x2)+parseInt(_0x787ba7(0x9a))/0x3+-parseInt(_0x787ba7(0x7c))/0x4+parseInt(_0x787ba7(0x87))/0x5+-parseInt(_0x787ba7(0x9b))/0x6+-parseInt(_0x787ba7(0x93))/0x7+parseInt(_0x787ba7(0x81))/0x8*(parseInt(_0x787ba7(0x9e))/0x9);if(_0x59fb06===_0x9582e7)break;else _0x374139['push'](_0x374139['shift']());}catch(_0x30897e){_0x374139['push'](_0x374139['shift']());}}}(a50_0x3526,0x3d27c));import{jsxs as a50_0x1315c1,jsx as a50_0x39652d}from'react/jsx-runtime';import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';function a50_0x26a2(_0x5f3bef,_0x10ea7f){_0x5f3bef=_0x5f3bef-0x79;const _0x352698=a50_0x3526();let _0x26a2cc=_0x352698[_0x5f3bef];return _0x26a2cc;}function a50_0x3526(){const _0xc80ffd=['message','version','green','初始化项目配置文件成功','string','676396ZvGePq','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','12469KISDnN','cyan','online','720bTJYeA','env','test','应用代码只能包含字母、数字、-\x20和\x20_','error','info','1829260eWdUUK','cwd','trim','AppCode:\x20','应用代码不合法','ctrl','.lovrabetrc','创建配置文件失败','slice','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','exit','red','1422596NFlSIx','请输入应用代码\x20(AppCode):\x20','column','stringify','length','创建配置文件失败:\x20','1.0.0','26733veXCHb','367272cDBBqi','setLogPath','正在初始化配置文件...','78309wZXcay','utf8','backspace','gray','package.json','76sYXELb','../..'];a50_0x3526=function(){return _0xc80ffd;};return a50_0x3526();}export function Init({appcode:_0xc7f4ec,env:_0x4f4fe5}){const _0x3e4a80=a50_0x26a2,[_0x15337f,_0x40d148]=useState(null),[_0x5a9440,_0x28b82f]=useState(![]),[_0x5c24ba,_0x2704df]=useState(!_0xc7f4ec),[_0x2f5592,_0x3ba9f0]=useState(''),[_0x733738,_0x578530]=useState(''),[_0x5e23d2,_0x3b9dc8]=useState(_0xc7f4ec||''),[_0x2158af]=useState(_0x4f4fe5);function _0x40f0f8(_0x11b8d7){const _0x391325=a50_0x26a2;if(_0x11b8d7[_0x391325(0x97)]===0x0)return{'valid':![],'message':''};if(_0x11b8d7[_0x391325(0x97)]>0x64)return{'valid':![],'message':'应用代码长度不能超过\x20100\x20个字符'};const _0x404b44=/^[A-Za-z0-9_-]+$/;if(!_0x404b44[_0x391325(0x83)](_0x11b8d7))return{'valid':![],'message':_0x391325(0x84)};return{'valid':!![]};}useInput((_0x18e822,_0x6673df)=>{const _0x14c1c1=a50_0x26a2;if(!_0x5c24ba)return;if(_0x6673df['return']){if(_0x733738||!_0x2f5592['trim']()){_0x578530('应用代码不能为空');return;}const _0x5edbc2=_0x2f5592[_0x14c1c1(0x89)](),{valid:_0xa4f7a4,message:_0x1e1bb2}=_0x40f0f8(_0x5edbc2);if(!_0xa4f7a4){_0x578530(_0x1e1bb2||'应用代码不合法');return;}_0x3b9dc8(_0x5edbc2),_0x2704df(![]);}else{if(_0x6673df[_0x14c1c1(0xa0)]||_0x6673df['delete'])_0x3ba9f0(_0x3debea=>{const _0x2cf3b7=_0x14c1c1,_0x3842fb=_0x3debea[_0x2cf3b7(0x8f)](0x0,-0x1);if(_0x3842fb[_0x2cf3b7(0x97)]===0x0)_0x578530('');else{const {valid:_0x54b41f,message:_0x50702f}=_0x40f0f8(_0x3842fb);_0x578530(_0x54b41f?'':_0x50702f||_0x2cf3b7(0x8b));}return _0x3842fb;});else _0x6673df[_0x14c1c1(0x8c)]&&_0x18e822==='c'?process['exit'](0x0):_0x3ba9f0(_0xc76aa8=>{const _0x39942f=_0x14c1c1,_0x31e64a=_0xc76aa8+_0x18e822,{valid:_0x4bbe47,message:_0x100c02}=_0x40f0f8(_0x31e64a);return _0x578530(_0x4bbe47?'':_0x100c02||_0x39942f(0x8b)),_0x31e64a;});}},{'isActive':_0x5c24ba}),useEffect(()=>{const _0x307840=a50_0x26a2;if(!_0x5e23d2||_0x5c24ba)return;const _0xebeea=resolve(process['cwd'](),_0x307840(0x8d));if(existsSync(_0xebeea)){_0x40d148('当前目录已存在\x20.lovrabetrc\x20文件'),setTimeout(()=>process[_0x307840(0x91)](0x1),0x64);return;}try{const _0x233345=fileURLToPath(import.meta.url),_0x394c9b=resolve(dirname(_0x233345),_0x307840(0xa4)),_0x5cc395=join(_0x394c9b,_0x307840(0xa2));let _0x540bae=_0x307840(0x99);try{const _0x5d2634=JSON['parse'](readFileSync(_0x5cc395,_0x307840(0x9f)));_0x540bae=_0x5d2634[_0x307840(0xa6)]||'1.0.0';}catch(_0x340eda){}const _0x33e968=readConfig(),_0x3a6f71=typeof _0x33e968['env']===_0x307840(0x7b)?_0x33e968['env']:undefined,{app:_0x395939,appcode:_0x32b8a1,..._0x2e6436}=_0x33e968,_0x1cc1ee={..._0x2e6436,'appcode':_0x5e23d2,'env':_0x2158af||_0x3a6f71||_0x307840(0x80),'createdAt':new Date()['toLocaleString'](),'version':_0x540bae};writeFileSync(_0xebeea,JSON[_0x307840(0x96)](_0x1cc1ee,null,0x2),{'encoding':'utf8','mode':0x180}),logger[_0x307840(0x9c)](process[_0x307840(0x88)]()),logger[_0x307840(0x86)]('init',_0x307840(0x7a),{'appcode':_0x5e23d2,'env':_0x1cc1ee[_0x307840(0x82)],'version':_0x1cc1ee[_0x307840(0xa6)],'configPath':_0xebeea}),_0x28b82f(!![]),setTimeout(()=>process[_0x307840(0x91)](0x0),0x64);}catch(_0x4301c3){logger[_0x307840(0x85)]('init',_0x307840(0x8e),{'error':_0x4301c3 instanceof Error?_0x4301c3[_0x307840(0xa5)]:String(_0x4301c3)}),_0x40d148(_0x307840(0x98)+(_0x4301c3 instanceof Error?_0x4301c3[_0x307840(0xa5)]:String(_0x4301c3))),setTimeout(()=>process[_0x307840(0x91)](0x1),0x64);}},[_0x5e23d2,_0x5c24ba,_0x2158af]);if(_0x15337f)return a50_0x39652d(Box,{'flexDirection':_0x3e4a80(0x95),'children':a50_0x1315c1(Text,{'color':_0x3e4a80(0x92),'children':['✗\x20',_0x15337f]})});if(_0x5c24ba)return a50_0x1315c1(Box,{'flexDirection':'column','children':[a50_0x1315c1(Box,{'children':[a50_0x39652d(Text,{'color':_0x3e4a80(0x7f),'children':_0x3e4a80(0x94)}),_0x2f5592?a50_0x39652d(Text,{'color':'green','children':_0x2f5592}):a50_0x39652d(Text,{'color':_0x3e4a80(0xa1),'children':'_'}),_0x733738&&a50_0x1315c1(Text,{'color':'red','children':['\x20←\x20',_0x733738]})]}),!_0x733738&&!_0x2f5592&&a50_0x39652d(Box,{'children':a50_0x39652d(Text,{'color':_0x3e4a80(0xa1),'children':_0x3e4a80(0x7d)})})]});if(_0x5a9440)return a50_0x1315c1(Box,{'flexDirection':_0x3e4a80(0x95),'children':[a50_0x39652d(Text,{'color':_0x3e4a80(0x79),'children':'✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件'}),a50_0x1315c1(Text,{'color':_0x3e4a80(0x7f),'children':[_0x3e4a80(0x8a),_0x5e23d2]}),a50_0x39652d(Text,{'children':_0x3e4a80(0x90)})]});return a50_0x39652d(Box,{'children':a50_0x39652d(Text,{'children':_0x3e4a80(0x9d)})});}
|