@lovrabet/cli 1.1.26-beta.9 → 1.2.1-beta.3
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 -0
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -0
- package/lib/app-menu-update-cdn/main.js +1 -0
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x517b1b,_0x12c2f9){const _0x5e43dd=a35_0x49b4,_0x530aed=_0x517b1b();while(!![]){try{const _0x7185=parseInt(_0x5e43dd(0x12c))/0x1*(-parseInt(_0x5e43dd(0x12a))/0x2)+-parseInt(_0x5e43dd(0x11a))/0x3+-parseInt(_0x5e43dd(0x11e))/0x4*(parseInt(_0x5e43dd(0x121))/0x5)+-parseInt(_0x5e43dd(0x131))/0x6+parseInt(_0x5e43dd(0x127))/0x7+parseInt(_0x5e43dd(0x12e))/0x8+parseInt(_0x5e43dd(0x12d))/0x9;if(_0x7185===_0x12c2f9)break;else _0x530aed['push'](_0x530aed['shift']());}catch(_0x4124cf){_0x530aed['push'](_0x530aed['shift']());}}}(a35_0x3fe4,0x9f005));import{jsxs as a35_0xbbdb2,jsx as a35_0x59eb31}from'react/jsx-runtime';import{Box,Text}from'ink';function a35_0x49b4(_0x93bd14,_0xe8eddd){_0x93bd14=_0x93bd14-0x11a;const _0x3fe45a=a35_0x3fe4();let _0x49b434=_0x3fe45a[_0x93bd14];return _0x49b434;}function a35_0x3fe4(){const _0x360992=['lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','2598565hMKTgi','command','map','设置环境\x20(online/daily)','设置配置项','无效的命令,可用命令如下:','3862740HkZjuQ','获取配置项','column','16hLmBzQ','lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','115777dfaLnl','16287552mFBzpt','7353752vMlthf','\x20\x20\x20\x20','\x20*\x20配置示例:','1381152SbUSAH','2860131umfFbt','lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','description','4cAzKVG','gray'];a35_0x3fe4=function(){return _0x360992;};return a35_0x3fe4();}export function ConfigHelp(){const _0x31e013=a35_0x49b4,_0x527f7e=[{'command':_0x31e013(0x120),'description':_0x31e013(0x125)},{'command':_0x31e013(0x11b),'description':_0x31e013(0x128)},{'command':_0x31e013(0x11c),'description':'列出所有配置项'}],_0x2626cb=[{'command':_0x31e013(0x12b),'description':'配置当前项目的\x20App\x20Code'},{'command':'lovrabet\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','description':_0x31e013(0x124)}];return a35_0xbbdb2(Box,{'flexDirection':_0x31e013(0x129),'marginTop':0x1,'marginBottom':0x1,'children':[a35_0x59eb31(Box,{'marginBottom':0x1,'children':a35_0xbbdb2(Text,{'color':_0x31e013(0x11f),'children':['\x20!','\x20\x20',_0x31e013(0x126)]})}),_0x527f7e[_0x31e013(0x123)](_0x313dd8=>a35_0xbbdb2(Box,{'children':[a35_0xbbdb2(Text,{'children':['\x20\x20\x20\x20',_0x313dd8[_0x31e013(0x122)]]}),a35_0x59eb31(Text,{'color':_0x31e013(0x11f),'children':_0x313dd8[_0x31e013(0x11d)]})]},_0x313dd8[_0x31e013(0x122)])),a35_0x59eb31(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a35_0x59eb31(Text,{'color':_0x31e013(0x11f),'children':_0x31e013(0x130)})}),_0x2626cb['map'](_0x802e70=>a35_0xbbdb2(Box,{'children':[a35_0xbbdb2(Text,{'children':[_0x31e013(0x12f),_0x802e70['command']]}),a35_0x59eb31(Text,{'color':'gray','children':_0x802e70[_0x31e013(0x11d)]})]},_0x802e70[_0x31e013(0x122)]))]});}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2fc115,_0x44e594){const _0x5b6dc9=a36_0x2216,_0x566c76=_0x2fc115();while(!![]){try{const _0x2b9192=parseInt(_0x5b6dc9(0x1fb))/0x1+parseInt(_0x5b6dc9(0x1f4))/0x2*(parseInt(_0x5b6dc9(0x217))/0x3)+-parseInt(_0x5b6dc9(0x1f3))/0x4+parseInt(_0x5b6dc9(0x21c))/0x5*(-parseInt(_0x5b6dc9(0x219))/0x6)+parseInt(_0x5b6dc9(0x213))/0x7+parseInt(_0x5b6dc9(0x20f))/0x8*(-parseInt(_0x5b6dc9(0x212))/0x9)+-parseInt(_0x5b6dc9(0x208))/0xa*(-parseInt(_0x5b6dc9(0x21b))/0xb);if(_0x2b9192===_0x44e594)break;else _0x566c76['push'](_0x566c76['shift']());}catch(_0x333c95){_0x566c76['push'](_0x566c76['shift']());}}}(a36_0x5611,0x3124e));import{jsx as a36_0x8803d,jsxs as a36_0x314285}from'react/jsx-runtime';import{existsSync,readFileSync,writeFileSync}from'node:fs';import a36_0x2cdba6 from'node:fs';import a36_0x21cc94 from'node:path';import{ConfigHelp}from'./config-help.js';function a36_0x5611(){const _0x43aaed=['未提供配置值','10362slRceC','保存配置失败:\x20','11yntwpg','305pWCYLj','log','487460KWXUJH','2NVLwaL','input','includes','unlinkSync','length','string','保存配置失败','80934iPLJsE','.tmp','flags','环境配置值只能是\x20\x22online\x22\x20或\x20\x22daily\x22','red','config','help','utf8','undefined','配置值无效或过长','error','appcode','daily','5152180LMxVEu','online','app','message','set','get','--help','662344lYIfpi','dirname','环境配置已设置为:\x20','27weyZEc','343007YkyXKw','list','env','stringify','95196jwXhjG'];a36_0x5611=function(){return _0x43aaed;};return a36_0x5611();}import{Box,Text}from'ink';import{readConfig,isInProject,projectConfigPath,globalConfigPath}from'../utils/config.js';function a36_0x2216(_0x155810,_0x516f00){_0x155810=_0x155810-0x1f3;const _0x561147=a36_0x5611();let _0x2216da=_0x561147[_0x155810];return _0x2216da;}import{logger}from'../utils/logger.js';export function Config(_0x2d0ee1){const _0x52e693=a36_0x2216,{cli:_0x298a7c}=_0x2d0ee1,_0x2ce54d=_0x298a7c[_0x52e693(0x1f5)][0x1],_0x42f777=_0x298a7c[_0x52e693(0x1f5)][0x2],_0xf461f6=[_0x52e693(0x20c),_0x52e693(0x20d)][_0x52e693(0x1f6)](_0x2ce54d||''),_0x4ca83f=_0x298a7c['input'][_0x52e693(0x1f8)]>=0x3;if(_0x42f777===_0x52e693(0x20e)||_0x298a7c[_0x52e693(0x1fd)][_0x52e693(0x201)])return a36_0x8803d(ConfigHelp,{});const _0x5da26b=readConfig();if(_0x2ce54d==='set'){if(_0x42f777){const _0x20c34c=_0x298a7c[_0x52e693(0x1f5)][0x3];if(typeof _0x20c34c!==_0x52e693(0x203)){if(_0x42f777==='env'&&![_0x52e693(0x209),_0x52e693(0x207)][_0x52e693(0x1f6)](_0x20c34c))return a36_0x8803d(Box,{'children':a36_0x8803d(Text,{'color':'red','children':_0x52e693(0x1fe)})});const _0x3a13af=isInProject(),_0x6ef02f=_0x3a13af?projectConfigPath:globalConfigPath;let _0x18bd00={};try{if(existsSync(_0x6ef02f)){const _0x95b857=readFileSync(_0x6ef02f,{'encoding':_0x52e693(0x202)});_0x95b857&&(_0x18bd00=JSON['parse'](_0x95b857));}}catch(_0x29b5f9){}if(typeof _0x20c34c!==_0x52e693(0x1f9)||_0x20c34c['length']>0x1f4)return a36_0x8803d(Box,{'children':a36_0x8803d(Text,{'color':'red','children':_0x52e693(0x204)})});let _0x7e1290=_0x42f777;_0x42f777==='app'&&(_0x7e1290='appcode',delete _0x18bd00[_0x52e693(0x20a)]);_0x42f777===_0x52e693(0x206)&&delete _0x18bd00['app'];_0x18bd00[_0x7e1290]=_0x20c34c;try{const _0xadc86d=a36_0x21cc94[_0x52e693(0x210)](_0x6ef02f);!existsSync(_0xadc86d)&&a36_0x2cdba6['mkdirSync'](_0xadc86d,{'recursive':!![]});const _0x178359=_0x6ef02f+'.tmp';writeFileSync(_0x178359,JSON[_0x52e693(0x216)](_0x18bd00,null,0x2),{'encoding':_0x52e693(0x202),'mode':0x180}),a36_0x2cdba6['renameSync'](_0x178359,_0x6ef02f);if(_0x42f777===_0x52e693(0x215)){const _0xec15e3=_0x3a13af?'项目':'全局';console[_0x52e693(0x21d)]('✓\x20'+_0xec15e3+_0x52e693(0x211)+_0x20c34c);}}catch(_0xb89bfa){const _0x108766=_0x6ef02f+_0x52e693(0x1fc);try{existsSync(_0x108766)&&a36_0x2cdba6[_0x52e693(0x1f7)](_0x108766);}catch(_0x36bd28){}return logger[_0x52e693(0x205)](_0x52e693(0x200),_0x52e693(0x1fa),{'error':_0xb89bfa instanceof Error?_0xb89bfa['message']:String(_0xb89bfa),'configKey':_0x42f777,'configValue':_0x20c34c,'targetConfigPath':_0x6ef02f}),a36_0x8803d(Box,{'children':a36_0x314285(Text,{'color':_0x52e693(0x1ff),'children':[_0x52e693(0x21a),_0xb89bfa instanceof Error?_0xb89bfa[_0x52e693(0x20b)]:String(_0xb89bfa)]})});}return null;}return a36_0x8803d(Box,{'children':a36_0x8803d(Text,{'color':_0x52e693(0x1ff),'children':_0x52e693(0x218)})});}}if(_0x2ce54d==='get'){if(_0x42f777){let _0x52db76=_0x42f777;return _0x42f777===_0x52e693(0x20a)&&(_0x52db76=_0x52e693(0x206)),console[_0x52e693(0x21d)](_0x5da26b[_0x52db76]||'undefined'),null;}return null;}if(_0x2ce54d===_0x52e693(0x214))return console[_0x52e693(0x21d)](JSON['stringify'](_0x5da26b,null,0x2)),null;if(!_0xf461f6||!_0x4ca83f)return a36_0x8803d(ConfigHelp,{});return null;}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a37_0x43e3d6=a37_0x4122;(function(_0x649bf4,_0x58e6bb){const _0x4866ac=a37_0x4122,_0x551cf1=_0x649bf4();while(!![]){try{const _0x272cbd=-parseInt(_0x4866ac(0x1af))/0x1*(parseInt(_0x4866ac(0x1b8))/0x2)+parseInt(_0x4866ac(0x1b7))/0x3*(-parseInt(_0x4866ac(0x1b3))/0x4)+parseInt(_0x4866ac(0x1b6))/0x5+-parseInt(_0x4866ac(0x1b9))/0x6*(-parseInt(_0x4866ac(0x1b0))/0x7)+parseInt(_0x4866ac(0x1b5))/0x8*(parseInt(_0x4866ac(0x1b1))/0x9)+-parseInt(_0x4866ac(0x1bb))/0xa+parseInt(_0x4866ac(0x1ba))/0xb;if(_0x272cbd===_0x58e6bb)break;else _0x551cf1['push'](_0x551cf1['shift']());}catch(_0x5cb65){_0x551cf1['push'](_0x551cf1['shift']());}}}(a37_0x1b5c,0xba71a));import{getEnv}from'./env.js';function a37_0x4122(_0x2501b8,_0x3692bf){_0x2501b8=_0x2501b8-0x1ad;const _0x1b5c9c=a37_0x1b5c();let _0x4122cb=_0x1b5c9c[_0x2501b8];return _0x4122cb;}export const getUserDomain=()=>getEnv()==='online'?a37_0x43e3d6(0x1b4):'https://user-daily.lovrabet.com';function a37_0x1b5c(){const _0x318b80=['130ZRNrjs','38796MVDOUR','4487538FychAJ','13213700OfGieX','https://daily-api.lovrabet.com','online','6512ipSAso','1561OBFEWM','13707kJgbgF','https://api.lovrabet.com','2346964BOyfuG','https://user.lovrabet.com','3096simJeH','3278940IUehSC','3CeHVWa'];a37_0x1b5c=function(){return _0x318b80;};return a37_0x1b5c();}export const getApiDomain=()=>getEnv()===a37_0x43e3d6(0x1ae)?a37_0x43e3d6(0x1b2):a37_0x43e3d6(0x1ad);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a38_0x180d(){const _0x16eb88=['160833xizVSc','41230cHbOyF','314354SUtHzn','4104402SbSYmR','44TKTMYK','5CdJjLE','1297653IrgEKx','LOVRABET_ENV','4068075OxWvFz','2zHOHqK','386586jAIIIo','24GaZrfD'];a38_0x180d=function(){return _0x16eb88;};return a38_0x180d();}const a38_0x37a86f=a38_0x5c7c;(function(_0x989faa,_0xd7869e){const _0x482631=a38_0x5c7c,_0x472d8a=_0x989faa();while(!![]){try{const _0x38412e=parseInt(_0x482631(0x148))/0x1*(parseInt(_0x482631(0x141))/0x2)+parseInt(_0x482631(0x14b))/0x3*(-parseInt(_0x482631(0x143))/0x4)+parseInt(_0x482631(0x144))/0x5*(parseInt(_0x482631(0x142))/0x6)+-parseInt(_0x482631(0x145))/0x7+parseInt(_0x482631(0x14a))/0x8*(-parseInt(_0x482631(0x149))/0x9)+-parseInt(_0x482631(0x140))/0xa+parseInt(_0x482631(0x147))/0xb;if(_0x38412e===_0xd7869e)break;else _0x472d8a['push'](_0x472d8a['shift']());}catch(_0x6a8f7d){_0x472d8a['push'](_0x472d8a['shift']());}}}(a38_0x180d,0x70581));let env=process['env'][a38_0x37a86f(0x146)]||'online';export function getEnv(){return env;}function a38_0x5c7c(_0x2bc3f2,_0xe229ae){_0x2bc3f2=_0x2bc3f2-0x140;const _0x180d38=a38_0x180d();let _0x5c7c5a=_0x180d38[_0x2bc3f2];return _0x5c7c5a;}export function initEnv(_0x2e1cb7){env=_0x2e1cb7;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x592ba4,_0x3b5be8){const _0x236c1d=a38_0x2d5f,_0x16e115=_0x592ba4();while(!![]){try{const _0x29c9f8=parseInt(_0x236c1d(0x220))/0x1+-parseInt(_0x236c1d(0x216))/0x2+-parseInt(_0x236c1d(0x20a))/0x3*(-parseInt(_0x236c1d(0x219))/0x4)+-parseInt(_0x236c1d(0x205))/0x5*(-parseInt(_0x236c1d(0x1ef))/0x6)+parseInt(_0x236c1d(0x212))/0x7+-parseInt(_0x236c1d(0x21e))/0x8*(-parseInt(_0x236c1d(0x21d))/0x9)+-parseInt(_0x236c1d(0x207))/0xa;if(_0x29c9f8===_0x3b5be8)break;else _0x16e115['push'](_0x16e115['shift']());}catch(_0x4f942f){_0x16e115['push'](_0x16e115['shift']());}}}(a38_0x3877,0xba242));import{jsx as a38_0x481c44,jsxs as a38_0x48d3fc,Fragment as a38_0x528de6}from'react/jsx-runtime';function a38_0x2d5f(_0x5c038b,_0x128c8a){const _0x3877d3=a38_0x3877();return a38_0x2d5f=function(_0x2d5f09,_0x28c98f){_0x2d5f09=_0x2d5f09-0x1eb;let _0x451eb7=_0x3877d3[_0x2d5f09];return _0x451eb7;},a38_0x2d5f(_0x5c038b,_0x128c8a);}import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';function a38_0x3877(){const _0x4be034=['login-prompt','\x20\x20使用\x20←→\x20选择,回车确认','step','拉取API配置','login-check','yellow','应用AppCode不合法','*\x20正在检查登录状态...','gray','!\x20未检测到有效登录','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','18ySRaqJ','项目名','*\x20应用AppCode\x20','*\x20是否要先登录以便拉取\x20API\x20配置?','跳过登录','trim','未设置','*\x20创建新项目','\x20登录中...','Yes','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','cyan','delete','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','已登录','test','slice','env','label','online','*\x20是否要自动拉取\x20API\x20配置?','\x20←\x20','342620fjftdS','*\x20项目名:\x20','11892090qAJOlQ','creating','length','2457423pQRvWJ','green','\x20检查中...','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','project-name','√\x20检测到有效登录状态','includes','confirm-api-pull','3174192rEgVIu','login','\x20直接回车确认,或输入自定义名称','rightArrow','2410306xnUbHQ','应用AppCode长度不能超过\x20100\x20个字符','value','4uAymtE','login-process','column','app-code','169002xsTZXi','296RrFydi','red','983841VCSAja','my-app','登录状态'];a38_0x3877=function(){return _0x4be034;};return a38_0x3877();}import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x1a441c){const _0x4d301c=a38_0x2d5f,{onCreate:_0x2cc701,env:_0xe8c040}=_0x1a441c,[_0x248c9f,_0x4be61b]=useState(_0x4d301c(0x20e)),[_0x499143,_0x4854e4]=useState(''),[_0x549052,_0x547c4a]=useState(''),[_0x2b8f7b,_0x1e2b54]=useState(''),[_0x2e00fd,_0x3629c1]=useState(''),[_0x1a6183,_0x337606]=useState([]),[_0x246fb1,_0xbb3eb0]=useState(null),[_0x190cc5,_0x4feb6a]=useState(![]),[_0x2a399a,_0x2b5e89]=useState(![]),[_0x3a0747,_0x3d4bcc]=useState(![]),[_0x19a39f,_0x1b4c40]=useState(0x0),[_0x2c9911,_0x55b708]=useState(0x0),_0x25e444=_0x4d301c(0x221),_0x5451aa=readConfig(),_0x308490=typeof _0x5451aa[_0x4d301c(0x200)]==='string'?_0x5451aa[_0x4d301c(0x200)]:undefined;function _0xf57268(_0x1cfa0f){const _0x367cb7=_0x4d301c;if(_0x1cfa0f[_0x367cb7(0x209)]>0x32)return{'valid':![],'message':'项目名长度不能超过\x2050\x20个字符'};const _0x57c59e=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x1cfa0f?.[_0x367cb7(0x1f4)]()&&!_0x57c59e[_0x367cb7(0x1fe)](_0x1cfa0f))return{'valid':![],'message':_0x367cb7(0x1fc)};return{'valid':!![]};}function _0x5440c0(_0x515903){const _0x306879=_0x4d301c;if(!_0x515903[_0x306879(0x1f4)]())return{'valid':!![]};if(_0x515903['length']>0x64)return{'valid':![],'message':_0x306879(0x217)};const _0x26eb0b=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x26eb0b[_0x306879(0x1fe)](_0x515903))return{'valid':![],'message':_0x306879(0x20d)};return{'valid':!![]};}async function _0x2da39e(){_0x4feb6a(!![]);try{const _0x4a6ee4=await getIsSessionValid();return _0xbb3eb0(_0x4a6ee4),_0x4a6ee4;}catch(_0x491799){return _0xbb3eb0(![]),![];}finally{_0x4feb6a(![]);}}async function _0x1ae4aa(){_0x2b5e89(!![]);try{const _0x147ec0=await authServer({'silent':!![]});return _0xbb3eb0(_0x147ec0),_0x147ec0;}catch(_0x1cbbaa){return _0xbb3eb0(![]),![];}finally{_0x2b5e89(![]);}}return useInput(async(_0xe63fb,_0x2b777b)=>{const _0x3092d0=_0x4d301c;if(_0x2b777b['leftArrow']||_0x2b777b[_0x3092d0(0x215)]){if(_0x248c9f===_0x3092d0(0x211)){_0x1b4c40(_0xd370a4=>_0xd370a4===0x0?0x1:0x0);return;}if(_0x248c9f===_0x3092d0(0x223)){_0x55b708(_0x2ff4f8=>_0x2ff4f8===0x0?0x1:0x0);return;}}if(_0x2b777b['return']){if(_0x248c9f==='project-name'){const _0x5dfe14=_0x2b8f7b[_0x3092d0(0x1f4)]()||_0x25e444;if(_0x2e00fd)return;_0x4854e4(_0x5dfe14),_0x337606([{'step':_0x3092d0(0x20e),'label':_0x3092d0(0x1f0),'value':_0x5dfe14}]),_0x1e2b54(''),_0x3629c1(''),_0x4be61b(_0x3092d0(0x21c));return;}if(_0x248c9f===_0x3092d0(0x21c)){if(_0x2e00fd)return;const _0x3de3dc=_0x2b8f7b[_0x3092d0(0x1f4)]();_0x547c4a(_0x3de3dc),_0x337606(_0x407146=>[..._0x407146,{'step':_0x3092d0(0x21c),'label':'应用AppCode','value':_0x3de3dc||_0x3092d0(0x1f5)}]),_0x1e2b54(''),_0x3629c1('');if(_0x3de3dc){_0x4be61b('login-check');const _0x3bff24=await _0x2da39e();_0x3bff24?_0x4be61b(_0x3092d0(0x211)):_0x4be61b('login-prompt');}else{const _0x1b54c5=_0xe8c040||_0x308490||_0x3092d0(0x202);_0x2cc701({'projectName':_0x499143,'appCode':undefined,'pullApi':![],'env':_0x1b54c5}),_0x4be61b(_0x3092d0(0x208));}return;}if(_0x248c9f==='confirm-api-pull'){const _0x464d70=_0x19a39f===0x0;_0x3d4bcc(_0x464d70),_0x337606(_0x22b0c9=>[..._0x22b0c9,{'step':'api-pull','label':_0x3092d0(0x226),'value':_0x464d70?'是':'否'}]);const _0x46a3c9=_0xe8c040||_0x308490||_0x3092d0(0x202);_0x2cc701({'projectName':_0x499143,'appCode':_0x549052,'pullApi':_0x464d70,'env':_0x46a3c9}),_0x4be61b(_0x3092d0(0x208));return;}if(_0x248c9f===_0x3092d0(0x223)){const _0x2efccf=_0x2c9911===0x0;if(_0x2efccf){_0x4be61b(_0x3092d0(0x21a));const _0x400b35=await _0x1ae4aa();if(_0x400b35)_0x337606(_0x496a6c=>[..._0x496a6c,{'step':'login','label':_0x3092d0(0x222),'value':_0x3092d0(0x1fd)}]),_0x4be61b(_0x3092d0(0x211));else{_0x337606(_0x3ac731=>[..._0x3ac731,{'step':'login','label':_0x3092d0(0x222),'value':'登录失败'}]);const _0x157626=_0xe8c040||_0x308490||_0x3092d0(0x202);_0x2cc701({'projectName':_0x499143,'appCode':_0x549052,'pullApi':![],'env':_0x157626}),_0x4be61b(_0x3092d0(0x208));}}else{_0x337606(_0x55f9e8=>[..._0x55f9e8,{'step':_0x3092d0(0x213),'label':_0x3092d0(0x222),'value':_0x3092d0(0x1f3)}]);const _0x5c5946=_0xe8c040||_0x308490||_0x3092d0(0x202);_0x2cc701({'projectName':_0x499143,'appCode':_0x549052,'pullApi':![],'env':_0x5c5946}),_0x4be61b(_0x3092d0(0x208));}return;}}if(_0x2b777b['backspace']||_0x2b777b[_0x3092d0(0x1fb)]){_0x1e2b54(_0x491382=>{const _0x3d393a=_0x3092d0,_0x145154=_0x491382[_0x3d393a(0x1ff)](0x0,-0x1);if(_0x248c9f==='project-name'){const {valid:_0x73936f,message:_0x58a262}=_0xf57268(_0x145154);_0x3629c1(_0x73936f?'':_0x58a262||'项目名不合法');}else{if(_0x248c9f==='app-code'){const {valid:_0x3dfabd,message:_0x4bcde2}=_0x5440c0(_0x145154);_0x3629c1(_0x3dfabd?'':_0x4bcde2||'应用AppCode不合法');}}return _0x145154;});return;}if([_0x3092d0(0x208),_0x3092d0(0x227),_0x3092d0(0x21a)][_0x3092d0(0x210)](_0x248c9f))return;if(_0x248c9f==='confirm-api-pull'||_0x248c9f==='login-prompt')return;_0x1e2b54(_0xe6f9a3=>{const _0x12fe28=_0x3092d0,_0x14873e=_0xe6f9a3+_0xe63fb;if(_0x248c9f===_0x12fe28(0x20e)){const {valid:_0xd15533,message:_0x291b55}=_0xf57268(_0x14873e);_0x3629c1(_0xd15533?'':_0x291b55||'项目名不合法');}else{if(_0x248c9f===_0x12fe28(0x21c)){const {valid:_0x16eea2,message:_0x3a4d60}=_0x5440c0(_0x14873e);_0x3629c1(_0x16eea2?'':_0x3a4d60||_0x12fe28(0x229));}}return _0x14873e;});}),a38_0x48d3fc(Box,{'flexDirection':_0x4d301c(0x21b),'marginTop':0x1,'children':[_0x1a6183[_0x4d301c(0x209)]===0x0&&a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':_0x4d301c(0x1fa),'children':_0x4d301c(0x1f6)})}),_0x1a6183['map'](_0x301a64=>a38_0x48d3fc(Box,{'children':[a38_0x48d3fc(Text,{'color':_0x4d301c(0x20b),'children':['√\x20',_0x301a64[_0x4d301c(0x201)],':\x20']}),a38_0x481c44(Text,{'color':'cyan','children':_0x301a64[_0x4d301c(0x218)]})]},_0x301a64[_0x4d301c(0x225)])),_0x248c9f===_0x4d301c(0x20e)&&a38_0x48d3fc(a38_0x528de6,{'children':[a38_0x48d3fc(Box,{'children':[a38_0x481c44(Text,{'children':_0x4d301c(0x206)}),_0x2b8f7b?a38_0x481c44(Text,{'color':_0x4d301c(0x20b),'children':_0x2b8f7b}):a38_0x481c44(Text,{'color':_0x4d301c(0x1ec),'children':_0x25e444}),_0x2e00fd&&a38_0x48d3fc(Text,{'color':_0x4d301c(0x21f),'children':[_0x4d301c(0x204),_0x2e00fd]})]}),!_0x2e00fd&&!_0x2b8f7b&&a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':_0x4d301c(0x1ec),'children':_0x4d301c(0x214)})})]}),_0x248c9f===_0x4d301c(0x21c)&&a38_0x48d3fc(a38_0x528de6,{'children':[a38_0x48d3fc(Box,{'children':[a38_0x481c44(Text,{'children':_0x4d301c(0x1f1)}),a38_0x481c44(Text,{'color':_0x4d301c(0x1ec),'children':'[可选]:\x20'}),a38_0x481c44(Text,{'color':'green','children':_0x2b8f7b}),_0x2e00fd&&a38_0x48d3fc(Text,{'color':_0x4d301c(0x21f),'children':['\x20←\x20',_0x2e00fd]})]}),!_0x2e00fd&&a38_0x481c44(Box,{'children':a38_0x48d3fc(Text,{'color':'gray','children':['\x20',_0x4d301c(0x1f9)]})})]}),_0x248c9f==='login-check'&&a38_0x48d3fc(Box,{'children':[a38_0x481c44(Text,{'children':_0x4d301c(0x1eb)}),_0x190cc5&&a38_0x481c44(Text,{'color':'gray','children':_0x4d301c(0x20c)})]}),_0x248c9f==='confirm-api-pull'&&a38_0x48d3fc(a38_0x528de6,{'children':[a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':_0x4d301c(0x20b),'children':_0x4d301c(0x20f)})}),a38_0x481c44(Box,{'marginTop':0x1,'children':a38_0x481c44(Text,{'children':_0x4d301c(0x203)})}),a38_0x48d3fc(Box,{'marginLeft':0x2,'children':[a38_0x48d3fc(Text,{'color':_0x19a39f===0x0?'green':_0x4d301c(0x1ec),'children':[_0x19a39f===0x0?'▶\x20':'\x20\x20','Yes']}),a38_0x481c44(Text,{'children':'\x20'}),a38_0x48d3fc(Text,{'color':_0x19a39f===0x1?_0x4d301c(0x20b):_0x4d301c(0x1ec),'children':[_0x19a39f===0x1?'▶\x20':'\x20\x20','No']})]}),a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':'gray','children':_0x4d301c(0x224)})}),a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':_0x4d301c(0x228),'children':'\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口'})})]}),_0x248c9f===_0x4d301c(0x223)&&a38_0x48d3fc(a38_0x528de6,{'children':[a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':_0x4d301c(0x228),'children':_0x4d301c(0x1ed)})}),a38_0x481c44(Box,{'marginTop':0x1,'children':a38_0x481c44(Text,{'children':_0x4d301c(0x1f2)})}),a38_0x48d3fc(Box,{'marginLeft':0x2,'children':[a38_0x48d3fc(Text,{'color':_0x2c9911===0x0?_0x4d301c(0x20b):_0x4d301c(0x1ec),'children':[_0x2c9911===0x0?'▶\x20':'\x20\x20',_0x4d301c(0x1f8)]}),a38_0x481c44(Text,{'children':'\x20'}),a38_0x48d3fc(Text,{'color':_0x2c9911===0x1?'green':_0x4d301c(0x1ec),'children':[_0x2c9911===0x1?'▶\x20':'\x20\x20','No']})]}),a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':'gray','children':_0x4d301c(0x224)})}),a38_0x481c44(Box,{'children':a38_0x481c44(Text,{'color':_0x4d301c(0x228),'children':_0x4d301c(0x1ee)})})]}),_0x248c9f===_0x4d301c(0x21a)&&a38_0x48d3fc(Box,{'children':[a38_0x481c44(Text,{'children':'*\x20正在登录,请前往浏览器完成登录...'}),_0x2a399a&&a38_0x481c44(Text,{'color':_0x4d301c(0x1ec),'children':_0x4d301c(0x1f7)})]})]});}
|
|
1
|
+
(function(_0x5266bf,_0x35250a){const _0x1dc515=a39_0x5902,_0x39decd=_0x5266bf();while(!![]){try{const _0x4d185e=-parseInt(_0x1dc515(0x1d9))/0x1*(-parseInt(_0x1dc515(0x1c8))/0x2)+-parseInt(_0x1dc515(0x1ea))/0x3+-parseInt(_0x1dc515(0x1fc))/0x4+-parseInt(_0x1dc515(0x1f4))/0x5+parseInt(_0x1dc515(0x1db))/0x6*(parseInt(_0x1dc515(0x1e4))/0x7)+parseInt(_0x1dc515(0x1d5))/0x8*(parseInt(_0x1dc515(0x1f9))/0x9)+parseInt(_0x1dc515(0x1c6))/0xa*(parseInt(_0x1dc515(0x1c4))/0xb);if(_0x4d185e===_0x35250a)break;else _0x39decd['push'](_0x39decd['shift']());}catch(_0x1bc179){_0x39decd['push'](_0x39decd['shift']());}}}(a39_0x35cb,0x3b1ea));import{jsx as a39_0x2e7943,jsxs as a39_0x2ec2f6,Fragment as a39_0x166faa}from'react/jsx-runtime';import{useState}from'react';function a39_0x35cb(){const _0x855331=['拉取API配置','\x20登录中...','11GFELUY','rightArrow','3645490cdpiCt','value','3796GPPLFV','test','column','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','trim','*\x20正在检查登录状态...','!\x20未检测到有效登录','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','*\x20创建新项目','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','cyan','*\x20项目名:\x20','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','8eyZEUT','red','登录状态','leftArrow','42AXvwQh','online','6ZyEMKW','项目名不合法','green','login','login-check','env','login-prompt','\x20←\x20','已登录','619815XmjcFu','confirm-api-pull','string','return','map','includes','704649nyukBl','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','\x20\x20使用\x20←→\x20选择,回车确认','label','yellow','creating','登录失败','project-name','[可选]:\x20','*\x20应用AppCode\x20','998855YAzFRl','\x20检查中...','Yes','backspace','gray','1569717sGRzzd','应用AppCode','项目名长度不能超过\x2050\x20个字符','121660rASCdH','未设置','slice','app-code','length'];a39_0x35cb=function(){return _0x855331;};return a39_0x35cb();}function a39_0x5902(_0x1e4f32,_0x305e56){_0x1e4f32=_0x1e4f32-0x1c4;const _0x35cb8d=a39_0x35cb();let _0x5902e3=_0x35cb8d[_0x1e4f32];return _0x5902e3;}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(_0x3a92f3){const _0x52c7e7=a39_0x5902,{onCreate:_0x798227,env:_0x31f566}=_0x3a92f3,[_0x2f0eca,_0x5117b4]=useState(_0x52c7e7(0x1f1)),[_0x5b279d,_0x38221e]=useState(''),[_0x41dd5d,_0x490120]=useState(''),[_0x1480a7,_0xf42a33]=useState(''),[_0x999d15,_0x16ca46]=useState(''),[_0x1b032d,_0x49cbb6]=useState([]),[_0x58a5d5,_0x535ec4]=useState(null),[_0x408059,_0x3ba60e]=useState(![]),[_0x3ba90e,_0x2fef6d]=useState(![]),[_0x3f0ef3,_0x5aeae6]=useState(![]),[_0x1776f7,_0x260da3]=useState(0x0),[_0x938d5c,_0x36f093]=useState(0x0),_0xe115eb='my-app',_0x4a8416=readConfig(),_0x320f3b=typeof _0x4a8416[_0x52c7e7(0x1e0)]===_0x52c7e7(0x1e6)?_0x4a8416[_0x52c7e7(0x1e0)]:undefined;function _0x314cba(_0x519f96){const _0x1296c0=_0x52c7e7;if(_0x519f96[_0x1296c0(0x200)]>0x32)return{'valid':![],'message':_0x1296c0(0x1fb)};const _0x1663f8=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x519f96?.[_0x1296c0(0x1cc)]()&&!_0x1663f8[_0x1296c0(0x1c9)](_0x519f96))return{'valid':![],'message':_0x1296c0(0x1d4)};return{'valid':!![]};}function _0x31172b(_0x4617d3){const _0x130f44=_0x52c7e7;if(!_0x4617d3[_0x130f44(0x1cc)]())return{'valid':!![]};if(_0x4617d3[_0x130f44(0x200)]>0x64)return{'valid':![],'message':'应用AppCode长度不能超过\x20100\x20个字符'};const _0xe6030d=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0xe6030d[_0x130f44(0x1c9)](_0x4617d3))return{'valid':![],'message':_0x130f44(0x1eb)};return{'valid':!![]};}async function _0x2e2723(){_0x3ba60e(!![]);try{const _0x3ed6d5=await getIsSessionValid();return _0x535ec4(_0x3ed6d5),_0x3ed6d5;}catch(_0xe68bd9){return _0x535ec4(![]),![];}finally{_0x3ba60e(![]);}}async function _0x5179db(){_0x2fef6d(!![]);try{const _0xd706ca=await authServer({'silent':!![]});return _0x535ec4(_0xd706ca),_0xd706ca;}catch(_0x1a87fb){return _0x535ec4(![]),![];}finally{_0x2fef6d(![]);}}return useInput(async(_0x160879,_0x162ea2)=>{const _0xa7933b=_0x52c7e7;if(_0x162ea2[_0xa7933b(0x1d8)]||_0x162ea2[_0xa7933b(0x1c5)]){if(_0x2f0eca===_0xa7933b(0x1e5)){_0x260da3(_0x548e83=>_0x548e83===0x0?0x1:0x0);return;}if(_0x2f0eca===_0xa7933b(0x1e1)){_0x36f093(_0x2ff3fb=>_0x2ff3fb===0x0?0x1:0x0);return;}}if(_0x162ea2[_0xa7933b(0x1e7)]){if(_0x2f0eca===_0xa7933b(0x1f1)){const _0x2450e9=_0x1480a7[_0xa7933b(0x1cc)]()||_0xe115eb;if(_0x999d15)return;_0x38221e(_0x2450e9),_0x49cbb6([{'step':_0xa7933b(0x1f1),'label':'项目名','value':_0x2450e9}]),_0xf42a33(''),_0x16ca46(''),_0x5117b4(_0xa7933b(0x1ff));return;}if(_0x2f0eca===_0xa7933b(0x1ff)){if(_0x999d15)return;const _0x3761da=_0x1480a7['trim']();_0x490120(_0x3761da),_0x49cbb6(_0x1a1267=>[..._0x1a1267,{'step':_0xa7933b(0x1ff),'label':_0xa7933b(0x1fa),'value':_0x3761da||_0xa7933b(0x1fd)}]),_0xf42a33(''),_0x16ca46('');if(_0x3761da){_0x5117b4(_0xa7933b(0x1df));const _0x6aa7e8=await _0x2e2723();_0x6aa7e8?_0x5117b4('confirm-api-pull'):_0x5117b4(_0xa7933b(0x1e1));}else{const _0xf5f5c=_0x31f566||_0x320f3b||_0xa7933b(0x1da);_0x798227({'projectName':_0x5b279d,'appCode':undefined,'pullApi':![],'env':_0xf5f5c}),_0x5117b4(_0xa7933b(0x1ef));}return;}if(_0x2f0eca===_0xa7933b(0x1e5)){const _0x1f8de4=_0x1776f7===0x0;_0x5aeae6(_0x1f8de4),_0x49cbb6(_0x5d52d8=>[..._0x5d52d8,{'step':'api-pull','label':_0xa7933b(0x201),'value':_0x1f8de4?'是':'否'}]);const _0x28ff9a=_0x31f566||_0x320f3b||_0xa7933b(0x1da);_0x798227({'projectName':_0x5b279d,'appCode':_0x41dd5d,'pullApi':_0x1f8de4,'env':_0x28ff9a}),_0x5117b4(_0xa7933b(0x1ef));return;}if(_0x2f0eca===_0xa7933b(0x1e1)){const _0x2f949e=_0x938d5c===0x0;if(_0x2f949e){_0x5117b4('login-process');const _0x5b5599=await _0x5179db();if(_0x5b5599)_0x49cbb6(_0x235b26=>[..._0x235b26,{'step':'login','label':_0xa7933b(0x1d7),'value':_0xa7933b(0x1e3)}]),_0x5117b4(_0xa7933b(0x1e5));else{_0x49cbb6(_0x7e102f=>[..._0x7e102f,{'step':_0xa7933b(0x1de),'label':'登录状态','value':_0xa7933b(0x1f0)}]);const _0x90b16b=_0x31f566||_0x320f3b||_0xa7933b(0x1da);_0x798227({'projectName':_0x5b279d,'appCode':_0x41dd5d,'pullApi':![],'env':_0x90b16b}),_0x5117b4('creating');}}else{_0x49cbb6(_0x22852a=>[..._0x22852a,{'step':_0xa7933b(0x1de),'label':'登录状态','value':'跳过登录'}]);const _0x333c07=_0x31f566||_0x320f3b||_0xa7933b(0x1da);_0x798227({'projectName':_0x5b279d,'appCode':_0x41dd5d,'pullApi':![],'env':_0x333c07}),_0x5117b4(_0xa7933b(0x1ef));}return;}}if(_0x162ea2[_0xa7933b(0x1f7)]||_0x162ea2['delete']){_0xf42a33(_0x35ae6a=>{const _0x26b328=_0xa7933b,_0x5e5a77=_0x35ae6a[_0x26b328(0x1fe)](0x0,-0x1);if(_0x2f0eca===_0x26b328(0x1f1)){const {valid:_0x467240,message:_0x302d8b}=_0x314cba(_0x5e5a77);_0x16ca46(_0x467240?'':_0x302d8b||_0x26b328(0x1dc));}else{if(_0x2f0eca===_0x26b328(0x1ff)){const {valid:_0x53390a,message:_0x974253}=_0x31172b(_0x5e5a77);_0x16ca46(_0x53390a?'':_0x974253||'应用AppCode不合法');}}return _0x5e5a77;});return;}if([_0xa7933b(0x1ef),_0xa7933b(0x1df),'login-process'][_0xa7933b(0x1e9)](_0x2f0eca))return;if(_0x2f0eca===_0xa7933b(0x1e5)||_0x2f0eca===_0xa7933b(0x1e1))return;_0xf42a33(_0x27a9f0=>{const _0x19fe21=_0xa7933b,_0x465335=_0x27a9f0+_0x160879;if(_0x2f0eca===_0x19fe21(0x1f1)){const {valid:_0x1cde2c,message:_0xa85ea2}=_0x314cba(_0x465335);_0x16ca46(_0x1cde2c?'':_0xa85ea2||_0x19fe21(0x1dc));}else{if(_0x2f0eca===_0x19fe21(0x1ff)){const {valid:_0x440370,message:_0x3de772}=_0x31172b(_0x465335);_0x16ca46(_0x440370?'':_0x3de772||'应用AppCode不合法');}}return _0x465335;});}),a39_0x2ec2f6(Box,{'flexDirection':_0x52c7e7(0x1ca),'marginTop':0x1,'children':[_0x1b032d[_0x52c7e7(0x200)]===0x0&&a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1d2),'children':_0x52c7e7(0x1d0)})}),_0x1b032d[_0x52c7e7(0x1e8)](_0x2eec24=>a39_0x2ec2f6(Box,{'children':[a39_0x2ec2f6(Text,{'color':_0x52c7e7(0x1dd),'children':['√\x20',_0x2eec24[_0x52c7e7(0x1ed)],':\x20']}),a39_0x2e7943(Text,{'color':_0x52c7e7(0x1d2),'children':_0x2eec24[_0x52c7e7(0x1c7)]})]},_0x2eec24['step'])),_0x2f0eca==='project-name'&&a39_0x2ec2f6(a39_0x166faa,{'children':[a39_0x2ec2f6(Box,{'children':[a39_0x2e7943(Text,{'children':_0x52c7e7(0x1d3)}),_0x1480a7?a39_0x2e7943(Text,{'color':'green','children':_0x1480a7}):a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':_0xe115eb}),_0x999d15&&a39_0x2ec2f6(Text,{'color':_0x52c7e7(0x1d6),'children':[_0x52c7e7(0x1e2),_0x999d15]})]}),!_0x999d15&&!_0x1480a7&&a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':'\x20直接回车确认,或输入自定义名称'})})]}),_0x2f0eca===_0x52c7e7(0x1ff)&&a39_0x2ec2f6(a39_0x166faa,{'children':[a39_0x2ec2f6(Box,{'children':[a39_0x2e7943(Text,{'children':_0x52c7e7(0x1f3)}),a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':_0x52c7e7(0x1f2)}),a39_0x2e7943(Text,{'color':_0x52c7e7(0x1dd),'children':_0x1480a7}),_0x999d15&&a39_0x2ec2f6(Text,{'color':_0x52c7e7(0x1d6),'children':[_0x52c7e7(0x1e2),_0x999d15]})]}),!_0x999d15&&a39_0x2e7943(Box,{'children':a39_0x2ec2f6(Text,{'color':_0x52c7e7(0x1f8),'children':['\x20',_0x52c7e7(0x1cb)]})})]}),_0x2f0eca===_0x52c7e7(0x1df)&&a39_0x2ec2f6(Box,{'children':[a39_0x2e7943(Text,{'children':_0x52c7e7(0x1cd)}),_0x408059&&a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':_0x52c7e7(0x1f5)})]}),_0x2f0eca==='confirm-api-pull'&&a39_0x2ec2f6(a39_0x166faa,{'children':[a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1dd),'children':'√\x20检测到有效登录状态'})}),a39_0x2e7943(Box,{'marginTop':0x1,'children':a39_0x2e7943(Text,{'children':'*\x20是否要自动拉取\x20API\x20配置?'})}),a39_0x2ec2f6(Box,{'marginLeft':0x2,'children':[a39_0x2ec2f6(Text,{'color':_0x1776f7===0x0?_0x52c7e7(0x1dd):_0x52c7e7(0x1f8),'children':[_0x1776f7===0x0?'▶\x20':'\x20\x20',_0x52c7e7(0x1f6)]}),a39_0x2e7943(Text,{'children':'\x20'}),a39_0x2ec2f6(Text,{'color':_0x1776f7===0x1?_0x52c7e7(0x1dd):_0x52c7e7(0x1f8),'children':[_0x1776f7===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':_0x52c7e7(0x1ec)})}),a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1ee),'children':_0x52c7e7(0x1d1)})})]}),_0x2f0eca===_0x52c7e7(0x1e1)&&a39_0x2ec2f6(a39_0x166faa,{'children':[a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1ee),'children':_0x52c7e7(0x1ce)})}),a39_0x2e7943(Box,{'marginTop':0x1,'children':a39_0x2e7943(Text,{'children':'*\x20是否要先登录以便拉取\x20API\x20配置?'})}),a39_0x2ec2f6(Box,{'marginLeft':0x2,'children':[a39_0x2ec2f6(Text,{'color':_0x938d5c===0x0?'green':'gray','children':[_0x938d5c===0x0?'▶\x20':'\x20\x20',_0x52c7e7(0x1f6)]}),a39_0x2e7943(Text,{'children':'\x20'}),a39_0x2ec2f6(Text,{'color':_0x938d5c===0x1?_0x52c7e7(0x1dd):_0x52c7e7(0x1f8),'children':[_0x938d5c===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a39_0x2e7943(Box,{'children':a39_0x2e7943(Text,{'color':'yellow','children':_0x52c7e7(0x1cf)})})]}),_0x2f0eca==='login-process'&&a39_0x2ec2f6(Box,{'children':[a39_0x2e7943(Text,{'children':'*\x20正在登录,请前往浏览器完成登录...'}),_0x3ba90e&&a39_0x2e7943(Text,{'color':_0x52c7e7(0x1f8),'children':_0x52c7e7(0x202)})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1e5c8b,_0x17b50d){const _0x4ee697=a40_0x21b3,_0xc3b03d=_0x1e5c8b();while(!![]){try{const _0x48d155=-parseInt(_0x4ee697(0x159))/0x1*(-parseInt(_0x4ee697(0x153))/0x2)+parseInt(_0x4ee697(0x156))/0x3+-parseInt(_0x4ee697(0x15b))/0x4+-parseInt(_0x4ee697(0x15c))/0x5+parseInt(_0x4ee697(0x158))/0x6*(parseInt(_0x4ee697(0x155))/0x7)+-parseInt(_0x4ee697(0x154))/0x8+parseInt(_0x4ee697(0x15e))/0x9*(parseInt(_0x4ee697(0x15a))/0xa);if(_0x48d155===_0x17b50d)break;else _0xc3b03d['push'](_0xc3b03d['shift']());}catch(_0x16901c){_0xc3b03d['push'](_0xc3b03d['shift']());}}}(a40_0x1cc4,0x24ad3));function a40_0x1cc4(){const _0x5b23de=['1023284TyZePS','942695QXpqIN','now','973881vGpMFu','2napHoT','690920fqlmQd','880551xwcfVD','362688fgISnr','toFixed','6zltPCz','1427zrGGTV','40gPxDdv'];a40_0x1cc4=function(){return _0x5b23de;};return a40_0x1cc4();}function a40_0x21b3(_0xbf3380,_0x7215bf){_0xbf3380=_0xbf3380-0x153;const _0x1cc429=a40_0x1cc4();let _0x21b353=_0x1cc429[_0xbf3380];return _0x21b353;}export function formatElapsed(_0xd4f0af){const _0x4290b4=a40_0x21b3,_0x52e025=Date[_0x4290b4(0x15d)]()-_0xd4f0af;if(_0x52e025<0x3e8)return _0x52e025+'ms';const _0x347dde=(_0x52e025/0x3e8)[_0x4290b4(0x157)](0x2),_0x150ab9=_0x347dde['replace'](/\.?0+$/u,'');return _0x150ab9+'s';}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xc2f7f4,_0x1098c1){const _0x4c7685=a40_0x54a3,_0x4c4dff=_0xc2f7f4();while(!![]){try{const _0x37ee55=parseInt(_0x4c7685(0x137))/0x1+-parseInt(_0x4c7685(0x14e))/0x2*(parseInt(_0x4c7685(0x181))/0x3)+-parseInt(_0x4c7685(0x184))/0x4*(-parseInt(_0x4c7685(0x140))/0x5)+-parseInt(_0x4c7685(0x188))/0x6*(-parseInt(_0x4c7685(0x13e))/0x7)+parseInt(_0x4c7685(0x157))/0x8*(parseInt(_0x4c7685(0x191))/0x9)+-parseInt(_0x4c7685(0x189))/0xa*(-parseInt(_0x4c7685(0x148))/0xb)+-parseInt(_0x4c7685(0x158))/0xc;if(_0x37ee55===_0x1098c1)break;else _0x4c4dff['push'](_0x4c4dff['shift']());}catch(_0x3c86c8){_0x4c4dff['push'](_0x4c4dff['shift']());}}}(a40_0x524b,0xad8b8));import{jsx as a40_0x145927,Fragment as a40_0x5d06ee,jsxs as a40_0x4ff03b}from'react/jsx-runtime';import a40_0x171467 from'node:path';import a40_0x4ee4e7 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';function a40_0x54a3(_0xf08abf,_0x2a4bbf){const _0x524b36=a40_0x524b();return a40_0x54a3=function(_0x54a38f,_0x20d13b){_0x54a38f=_0x54a38f-0x131;let _0x28df01=_0x524b36[_0x54a38f];return _0x28df01;},a40_0x54a3(_0xf08abf,_0x2a4bbf);}function a40_0x524b(){const _0x5b4a8e=['1.0.0','env','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','gray','\x20Generated\x20by\x20lovrabet\x20cli\x20','1247067AfmgQj','√\x20package.json\x20已更新:\x20name=','resolve','message','*\x20正在拉取\x20API\x20配置...','success','warn','3850364KHlpqY','doTask','1015tEdZPq','🎉\x20项目创建成功!','rmSync','package.json','projectName','test','accessSync','API\x20配置拉取失败:\x20','423335Fitcgs','length','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','项目创建失败:\x20','url','已自动拉取\x20✓','4XNKTLL','../..','🚀\x20接下来可以:','setLogPath','log','更新\x20package.json\x20失败:\x20','readFileSync','parse','拉取API配置:\x20','163336dhGhux','30835008SFAjPL','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','description','toLocaleString','W_OK','*\x20清理失败的项目目录:\x20','writeFileSync','配置应用AppCode:\x20','启动项目:\x20','white','dirname','*\x20正在为项目\x20','\x20&&\x20lovrabet\x20start','green','string','version','1.\x20','\x20|\x20应用AppCode:\x20','name','API\x20配置拉取异常:\x20','cyan','online','error','constants','未配置','yellow','appCode','info','📁\x20项目名称:\x20','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','API\x20配置拉取成功:\x20','.lovrabetrc','projectCode','×\x20项目名过长,最多支持\x20100\x20个字符','×\x20项目目录\x20','trim','清理项目目录失败:\x20','更新\x20package.json\x20name\x20和\x20description\x20字段','×\x20无法在当前目录创建项目,请检查目录权限','项目创建完成:\x20','utf8','1078689FgXrXZ','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','2.\x20','26044LApcDx','cwd','repeat','×\x20项目创建失败:\x20','12MiFyZI','70KOnArb','\x20√\x20','\x20已存在,请使用其他项目名','\x20创建配置文件','create','🔗\x20应用AppCode:\x20','需手动拉取','项目名称:\x20','27kxURRE','pullApi','column','existsSync','配置应用AppCode失败:\x20','join'];a40_0x524b=function(){return _0x5b4a8e;};return a40_0x524b();}import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x1d97b2){const _0xfbac6c=a40_0x54a3,[_0x565baf,_0x3887b7]=useState(![]),[_0x4a0469,_0x38b77f]=useState(![]),[_0x4056c1,_0x3b6138]=useState(null),_0xaab65c=useCopyProjectTemplate(),_0x5e6f35=useInstallDependencies(),_0x2a16b9=useFormatCode(),_0x441f78=async _0x2bd15f=>{const _0x5d2cb7=a40_0x54a3;if(!_0x2bd15f['projectName']||_0x2bd15f[_0x5d2cb7(0x144)][_0x5d2cb7(0x17b)]()===''){console['error']('×\x20项目名不能为空');return;}const _0x28278e=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x28278e[_0x5d2cb7(0x145)](_0x2bd15f[_0x5d2cb7(0x144)])){console[_0x5d2cb7(0x16e)](_0x5d2cb7(0x14a));return;}if(_0x2bd15f[_0x5d2cb7(0x144)][_0x5d2cb7(0x149)]>0x64){console[_0x5d2cb7(0x16e)](_0x5d2cb7(0x179));return;}const _0x4eb246=a40_0x171467['resolve'](process[_0x5d2cb7(0x185)](),_0x2bd15f[_0x5d2cb7(0x144)]);if(a40_0x4ee4e7[_0x5d2cb7(0x194)](_0x4eb246)){console[_0x5d2cb7(0x16e)](_0x5d2cb7(0x17a)+_0x2bd15f[_0x5d2cb7(0x144)]+_0x5d2cb7(0x18b));return;}try{const _0x133453=a40_0x171467['dirname'](_0x4eb246);a40_0x4ee4e7[_0x5d2cb7(0x146)](_0x133453,a40_0x4ee4e7[_0x5d2cb7(0x16f)][_0x5d2cb7(0x15c)]);}catch(_0x21efd8){console['error'](_0x5d2cb7(0x17e));return;}_0x3b6138(_0x2bd15f),_0x3887b7(!![]),logger[_0x5d2cb7(0x151)](_0x4eb246),logger[_0x5d2cb7(0x173)]('create','开始创建项目:\x20'+_0x2bd15f[_0x5d2cb7(0x144)],{'projectDir':_0x4eb246,'appCode':_0x2bd15f[_0x5d2cb7(0x172)]});try{await _0xaab65c[_0x5d2cb7(0x13f)](_0x2bd15f[_0x5d2cb7(0x144)]),await _0x5e7111(_0x2bd15f[_0x5d2cb7(0x144)]),await _0x5e6f35['doTask'](_0x2bd15f[_0x5d2cb7(0x144)]),await _0x2a16b9[_0x5d2cb7(0x13f)](_0x2bd15f[_0x5d2cb7(0x144)]),await _0x48528d(_0x2bd15f['projectName'],_0x2bd15f[_0x5d2cb7(0x172)]||'',_0x2bd15f['env']);if(_0x2bd15f[_0x5d2cb7(0x192)]&&_0x2bd15f[_0x5d2cb7(0x172)]){console['log'](_0x5d2cb7(0x13b));try{const _0x247516=await pullApiSilent(_0x2bd15f[_0x5d2cb7(0x172)],undefined,_0x4eb246,_0x2bd15f[_0x5d2cb7(0x133)]);_0x247516?(console[_0x5d2cb7(0x152)]('√\x20API\x20配置拉取完成'),logger[_0x5d2cb7(0x173)](_0x5d2cb7(0x18d),_0x5d2cb7(0x176)+_0x2bd15f[_0x5d2cb7(0x172)],{'projectDir':_0x4eb246,'appCode':_0x2bd15f['appCode'],'env':_0x2bd15f[_0x5d2cb7(0x133)]})):(console[_0x5d2cb7(0x152)]('!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x5d2cb7(0x13d)](_0x5d2cb7(0x18d),_0x5d2cb7(0x147)+_0x2bd15f['appCode'],{'projectDir':_0x4eb246,'appCode':_0x2bd15f[_0x5d2cb7(0x172)],'env':_0x2bd15f[_0x5d2cb7(0x133)]}));}catch(_0x254bc0){console[_0x5d2cb7(0x152)](_0x5d2cb7(0x182)),logger[_0x5d2cb7(0x13d)](_0x5d2cb7(0x18d),_0x5d2cb7(0x16b)+_0x2bd15f['appCode'],{'projectDir':_0x4eb246,'appCode':_0x2bd15f[_0x5d2cb7(0x172)],'env':_0x2bd15f['env'],'error':_0x254bc0 instanceof Error?_0x254bc0[_0x5d2cb7(0x13a)]:String(_0x254bc0)});}}logger[_0x5d2cb7(0x13c)]('create',_0x5d2cb7(0x17f)+_0x2bd15f[_0x5d2cb7(0x144)]),_0x38b77f(!![]),_0x3887b7(![]);}catch(_0x1e0d06){logger[_0x5d2cb7(0x16e)](_0x5d2cb7(0x18d),_0x5d2cb7(0x14b)+_0x2bd15f[_0x5d2cb7(0x144)],{'error':_0x1e0d06 instanceof Error?_0x1e0d06[_0x5d2cb7(0x13a)]:String(_0x1e0d06)});try{a40_0x4ee4e7['existsSync'](_0x4eb246)&&(console['log'](_0x5d2cb7(0x15d)+_0x4eb246),a40_0x4ee4e7[_0x5d2cb7(0x142)](_0x4eb246,{'recursive':!![],'force':!![]}));}catch(_0x40d09e){logger[_0x5d2cb7(0x13d)]('create',_0x5d2cb7(0x17c)+_0x4eb246,{'error':_0x40d09e instanceof Error?_0x40d09e[_0x5d2cb7(0x13a)]:String(_0x40d09e)});}_0x3887b7(![]),console[_0x5d2cb7(0x16e)](_0x5d2cb7(0x187)+(_0x1e0d06 instanceof Error?_0x1e0d06[_0x5d2cb7(0x13a)]:String(_0x1e0d06)));}},_0x4fea42=async _0x11b7e9=>{const _0x4c16e4=a40_0x54a3;await _0x441f78({'projectName':_0x11b7e9,'env':_0x1d97b2[_0x4c16e4(0x133)]});},_0x5e7111=async _0x288cd4=>{const _0x3c85a1=a40_0x54a3,_0x5d2981=a40_0x171467[_0x3c85a1(0x139)](process[_0x3c85a1(0x185)](),_0x288cd4),_0x3bd69a=a40_0x171467['join'](_0x5d2981,'package.json');try{console[_0x3c85a1(0x152)](_0x3c85a1(0x175));const _0x487f8c=fileURLToPath(import.meta['url']),_0x5a1714=a40_0x171467[_0x3c85a1(0x139)](a40_0x171467[_0x3c85a1(0x162)](_0x487f8c),_0x3c85a1(0x14f)),_0x20fece=a40_0x171467[_0x3c85a1(0x131)](_0x5a1714,'package.json');let _0x1ff976='1.0.0';try{const _0x1f90e5=JSON['parse'](a40_0x4ee4e7[_0x3c85a1(0x154)](_0x20fece,'utf8'));_0x1ff976=_0x1f90e5[_0x3c85a1(0x167)]||'1.0.0';}catch(_0xac2413){}const _0x4379c8=a40_0x4ee4e7[_0x3c85a1(0x154)](_0x3bd69a,'utf8'),_0x4a389c=JSON['parse'](_0x4379c8);_0x4a389c[_0x3c85a1(0x16a)]=_0x288cd4,_0x4a389c[_0x3c85a1(0x15a)]=_0x288cd4+_0x3c85a1(0x136)+_0x1ff976,a40_0x4ee4e7['writeFileSync'](_0x3bd69a,JSON['stringify'](_0x4a389c,null,0x2)+'\x0a',_0x3c85a1(0x180)),console[_0x3c85a1(0x152)](_0x3c85a1(0x138)+_0x288cd4+',\x20description='+_0x4a389c[_0x3c85a1(0x15a)]),logger[_0x3c85a1(0x173)](_0x3c85a1(0x18d),_0x3c85a1(0x17d),{'projectName':_0x288cd4,'description':_0x4a389c['description'],'cliVersion':_0x1ff976,'packageJsonPath':_0x3c85a1(0x143)});}catch(_0x4d9a41){logger[_0x3c85a1(0x16e)](_0x3c85a1(0x18d),_0x3c85a1(0x153)+_0x288cd4,{'projectName':_0x288cd4,'error':_0x4d9a41 instanceof Error?_0x4d9a41[_0x3c85a1(0x13a)]:String(_0x4d9a41)});throw _0x4d9a41;}},_0x48528d=async(_0x307bdf,_0x32ff54,_0x544014)=>{const _0x3ac47e=a40_0x54a3,_0x8b13fd=a40_0x171467[_0x3ac47e(0x139)](process['cwd'](),_0x307bdf),_0x190846=a40_0x171467[_0x3ac47e(0x131)](_0x8b13fd,_0x3ac47e(0x177));try{_0x32ff54?console[_0x3ac47e(0x152)](_0x3ac47e(0x163)+_0x307bdf+'\x20配置应用AppCode:\x20'+_0x32ff54):console['log'](_0x3ac47e(0x163)+_0x307bdf+_0x3ac47e(0x18c));console[_0x3ac47e(0x152)]('*\x20配置文件路径:\x20'+_0x190846);const _0x53021b=fileURLToPath(import.meta[_0x3ac47e(0x14c)]),_0x32c9fb=a40_0x171467['resolve'](a40_0x171467[_0x3ac47e(0x162)](_0x53021b),'../..'),_0x4fab5d=a40_0x171467[_0x3ac47e(0x131)](_0x32c9fb,'package.json');let _0x350135=_0x3ac47e(0x132);try{const _0x34db4b=JSON[_0x3ac47e(0x155)](a40_0x4ee4e7[_0x3ac47e(0x154)](_0x4fab5d,_0x3ac47e(0x180)));_0x350135=_0x34db4b[_0x3ac47e(0x167)]||_0x3ac47e(0x132);}catch(_0xebd454){}const _0x24d0cf=readConfig(),_0xef94f9=typeof _0x24d0cf[_0x3ac47e(0x133)]===_0x3ac47e(0x166)?_0x24d0cf['env']:undefined,{app:_0x2abe5f,appcode:_0x24219a,..._0x5d1f00}=_0x24d0cf,_0x6a0f37={..._0x5d1f00,'appcode':_0x32ff54||'','env':_0x544014||_0xef94f9||_0x3ac47e(0x16d),'createdAt':new Date()[_0x3ac47e(0x15b)](),'version':_0x350135};a40_0x4ee4e7[_0x3ac47e(0x15e)](_0x190846,JSON['stringify'](_0x6a0f37,null,0x2),_0x3ac47e(0x180)),_0x32ff54?console['log']('√\x20配置文件已创建,应用AppCode:\x20'+_0x32ff54):console[_0x3ac47e(0x152)](_0x3ac47e(0x159)),logger[_0x3ac47e(0x173)](_0x3ac47e(0x18d),_0x3ac47e(0x15f)+_0x32ff54,{'projectName':_0x307bdf,'configFile':_0x3ac47e(0x177)});}catch(_0x4a56ba){logger[_0x3ac47e(0x16e)]('create',_0x3ac47e(0x195)+_0x32ff54,{'projectName':_0x307bdf,'error':_0x4a56ba instanceof Error?_0x4a56ba['message']:String(_0x4a56ba)});}};useEffect(()=>{const _0x189c84=a40_0x54a3;_0x1d97b2[_0x189c84(0x178)]&&_0x4fea42(_0x1d97b2[_0x189c84(0x178)]);},[_0x1d97b2[_0xfbac6c(0x178)]]);if(!_0x565baf&&!_0x4a0469&&!_0x1d97b2[_0xfbac6c(0x178)])return a40_0x145927(EnhancedGuidedCreate,{'onCreate':_0x441f78,'env':_0x1d97b2[_0xfbac6c(0x133)]});if(_0x565baf)return a40_0x4ff03b(a40_0x5d06ee,{'children':[a40_0x4ff03b(Box,{'marginTop':0x1,'children':[a40_0x145927(Box,{'width':'1'}),a40_0x145927(Text,{'color':'green','children':_0xfbac6c(0x18a)}),a40_0x145927(Text,{'children':'项目名称:\x20'}),a40_0x145927(Text,{'color':_0xfbac6c(0x165),'children':_0x4056c1?.[_0xfbac6c(0x144)]}),_0x4056c1?.[_0xfbac6c(0x172)]&&a40_0x4ff03b(a40_0x5d06ee,{'children':[a40_0x145927(Text,{'children':_0xfbac6c(0x169)}),a40_0x145927(Text,{'color':'cyan','children':_0x4056c1[_0xfbac6c(0x172)]})]})]}),a40_0x145927(TaskRunning,{..._0xaab65c}),a40_0x145927(TaskRunning,{..._0x5e6f35}),a40_0x145927(TaskRunning,{..._0x2a16b9})]});if(_0x4a0469)return a40_0x4ff03b(a40_0x5d06ee,{'children':[a40_0x4ff03b(Box,{'marginTop':0x1,'children':[a40_0x145927(Box,{'width':'1'}),a40_0x145927(Text,{'color':_0xfbac6c(0x165),'children':_0xfbac6c(0x18a)}),a40_0x145927(Text,{'children':_0xfbac6c(0x190)}),a40_0x145927(Text,{'color':'green','children':_0x4056c1?.[_0xfbac6c(0x144)]}),_0x4056c1?.[_0xfbac6c(0x172)]&&a40_0x4ff03b(a40_0x5d06ee,{'children':[a40_0x145927(Text,{'children':'\x20|\x20应用AppCode:\x20'}),a40_0x145927(Text,{'color':'cyan','children':_0x4056c1[_0xfbac6c(0x172)]})]})]}),a40_0x145927(TaskFinished,{..._0xaab65c}),a40_0x145927(TaskFinished,{..._0x5e6f35}),a40_0x145927(TaskFinished,{..._0x2a16b9}),a40_0x145927(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a40_0x145927(Text,{'color':_0xfbac6c(0x165),'children':'─'[_0xfbac6c(0x186)](0x3c)})}),a40_0x145927(Box,{'children':a40_0x145927(Text,{'color':'green','bold':!![],'children':_0xfbac6c(0x141)})}),a40_0x4ff03b(Box,{'marginTop':0x1,'flexDirection':_0xfbac6c(0x193),'children':[a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':_0xfbac6c(0x16c),'children':_0xfbac6c(0x174)}),a40_0x145927(Text,{'color':_0xfbac6c(0x161),'bold':!![],'children':_0x4056c1?.[_0xfbac6c(0x144)]})]}),_0x4056c1?.[_0xfbac6c(0x172)]&&a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':_0xfbac6c(0x16c),'children':_0xfbac6c(0x18e)}),a40_0x145927(Text,{'color':_0xfbac6c(0x161),'bold':!![],'children':_0x4056c1['appCode']})]}),a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':_0xfbac6c(0x16c),'children':'📦\x20API配置:\x20'}),_0x4056c1?.['pullApi']?a40_0x145927(Text,{'color':_0xfbac6c(0x165),'bold':!![],'children':_0xfbac6c(0x14d)}):_0x4056c1?.[_0xfbac6c(0x172)]?a40_0x145927(Text,{'color':_0xfbac6c(0x171),'bold':!![],'children':_0xfbac6c(0x18f)}):a40_0x145927(Text,{'color':_0xfbac6c(0x135),'bold':!![],'children':_0xfbac6c(0x170)})]})]}),a40_0x145927(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a40_0x145927(Text,{'color':_0xfbac6c(0x16c),'bold':!![],'children':_0xfbac6c(0x150)})}),a40_0x4ff03b(Box,{'marginLeft':0x2,'flexDirection':_0xfbac6c(0x193),'children':[a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':'green','children':_0xfbac6c(0x168)}),a40_0x145927(Text,{'color':_0xfbac6c(0x161),'children':_0xfbac6c(0x160)}),a40_0x145927(Text,{'color':'cyan','bold':!![],'children':'cd\x20'+_0x4056c1?.[_0xfbac6c(0x144)]+_0xfbac6c(0x164)})]}),_0x4056c1?.[_0xfbac6c(0x172)]&&!_0x4056c1?.[_0xfbac6c(0x192)]&&a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':'yellow','children':_0xfbac6c(0x183)}),a40_0x145927(Text,{'color':_0xfbac6c(0x161),'children':'拉取API配置:\x20'}),a40_0x145927(Text,{'color':_0xfbac6c(0x16c),'bold':!![],'children':'lovrabet\x20api\x20pull'})]}),!_0x4056c1?.[_0xfbac6c(0x172)]&&a40_0x4ff03b(a40_0x5d06ee,{'children':[a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':_0xfbac6c(0x135),'children':_0xfbac6c(0x183)}),a40_0x145927(Text,{'color':_0xfbac6c(0x161),'children':'配置AppCode:\x20'}),a40_0x145927(Text,{'color':_0xfbac6c(0x16c),'bold':!![],'children':'lovrabet\x20config\x20set\x20appcode\x20[app-code]'})]}),a40_0x4ff03b(Box,{'children':[a40_0x145927(Text,{'color':_0xfbac6c(0x135),'children':'3.\x20'}),a40_0x145927(Text,{'color':_0xfbac6c(0x161),'children':_0xfbac6c(0x156)}),a40_0x145927(Text,{'color':'cyan','bold':!![],'children':_0xfbac6c(0x134)})]})]})]}),a40_0x145927(Box,{'marginTop':0x1,'children':a40_0x145927(Text,{'color':'green','children':'─'[_0xfbac6c(0x186)](0x3c)})})]});return null;}
|
|
1
|
+
(function(_0x5ab037,_0x3316c7){const _0x4477f9=a41_0x5857,_0x2fc739=_0x5ab037();while(!![]){try{const _0x212908=parseInt(_0x4477f9(0x180))/0x1*(-parseInt(_0x4477f9(0x1bc))/0x2)+parseInt(_0x4477f9(0x198))/0x3*(-parseInt(_0x4477f9(0x196))/0x4)+-parseInt(_0x4477f9(0x181))/0x5*(-parseInt(_0x4477f9(0x1ba))/0x6)+-parseInt(_0x4477f9(0x174))/0x7*(-parseInt(_0x4477f9(0x1c5))/0x8)+parseInt(_0x4477f9(0x1b6))/0x9*(parseInt(_0x4477f9(0x16d))/0xa)+-parseInt(_0x4477f9(0x1b8))/0xb+parseInt(_0x4477f9(0x16f))/0xc*(-parseInt(_0x4477f9(0x195))/0xd);if(_0x212908===_0x3316c7)break;else _0x2fc739['push'](_0x2fc739['shift']());}catch(_0x3b0f34){_0x2fc739['push'](_0x2fc739['shift']());}}}(a41_0x5a47,0x61df0));import{jsx as a41_0x5e2cd4,Fragment as a41_0x4d7a9c,jsxs as a41_0x4a67d7}from'react/jsx-runtime';import a41_0x5d9fea from'node:path';import a41_0x31105d from'node:fs';import{fileURLToPath}from'node:url';function a41_0x5857(_0x54a561,_0x2d624c){_0x54a561=_0x54a561-0x164;const _0x5a47c0=a41_0x5a47();let _0x585774=_0x5a47c0[_0x54a561];return _0x585774;}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';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(_0x3f2892){const _0x3aa6d8=a41_0x5857,[_0x328de8,_0x5c599b]=useState(![]),[_0x31cdeb,_0x4d2f81]=useState(![]),[_0xba93ff,_0x5025e3]=useState(null),_0x5d60a2=useCopyProjectTemplate(),_0x459e2b=useInstallDependencies(),_0xdc1691=useFormatCode(),_0x16dfd2=async _0x2984fe=>{const _0x1e5212=a41_0x5857;if(!_0x2984fe[_0x1e5212(0x17a)]||_0x2984fe['projectName'][_0x1e5212(0x1bb)]()===''){console['error'](_0x1e5212(0x18f));return;}const _0x1c88d1=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1c88d1[_0x1e5212(0x17b)](_0x2984fe[_0x1e5212(0x17a)])){console['error'](_0x1e5212(0x197));return;}if(_0x2984fe[_0x1e5212(0x17a)][_0x1e5212(0x1c8)]>0x64){console[_0x1e5212(0x1a5)]('×\x20项目名过长,最多支持\x20100\x20个字符');return;}const _0x26b402=a41_0x5d9fea[_0x1e5212(0x19a)](process['cwd'](),_0x2984fe['projectName']);if(a41_0x31105d[_0x1e5212(0x1b5)](_0x26b402)){console[_0x1e5212(0x1a5)](_0x1e5212(0x1a9)+_0x2984fe[_0x1e5212(0x17a)]+_0x1e5212(0x192));return;}try{const _0x27c648=a41_0x5d9fea[_0x1e5212(0x179)](_0x26b402);a41_0x31105d[_0x1e5212(0x185)](_0x27c648,a41_0x31105d[_0x1e5212(0x164)][_0x1e5212(0x1be)]);}catch(_0x5916df){console['error'](_0x1e5212(0x17c));return;}_0x5025e3(_0x2984fe),_0x5c599b(!![]),logger[_0x1e5212(0x190)](_0x26b402),logger[_0x1e5212(0x1ae)](_0x1e5212(0x189),'开始创建项目:\x20'+_0x2984fe[_0x1e5212(0x17a)],{'projectDir':_0x26b402,'appCode':_0x2984fe['appCode']});try{await _0x5d60a2[_0x1e5212(0x1b3)](_0x2984fe[_0x1e5212(0x17a)]),await _0x37981b(_0x2984fe[_0x1e5212(0x17a)]),await _0x459e2b[_0x1e5212(0x1b3)](_0x2984fe['projectName']),await _0xdc1691[_0x1e5212(0x1b3)](_0x2984fe[_0x1e5212(0x17a)]),await _0x2a43b7(_0x2984fe[_0x1e5212(0x17a)],_0x2984fe['appCode']||'',_0x2984fe['env']);if(_0x2984fe['pullApi']&&_0x2984fe[_0x1e5212(0x1a0)]){console['log'](_0x1e5212(0x17e));try{const _0x23ab2f=await pullApiSilent(_0x2984fe['appCode'],undefined,_0x26b402,_0x2984fe[_0x1e5212(0x1a1)]);_0x23ab2f?(console['log'](_0x1e5212(0x1a7)),logger['info'](_0x1e5212(0x189),_0x1e5212(0x17d)+_0x2984fe[_0x1e5212(0x1a0)],{'projectDir':_0x26b402,'appCode':_0x2984fe[_0x1e5212(0x1a0)],'env':_0x2984fe[_0x1e5212(0x1a1)]})):(console['log'](_0x1e5212(0x1a8)),logger[_0x1e5212(0x166)](_0x1e5212(0x189),_0x1e5212(0x1b2)+_0x2984fe[_0x1e5212(0x1a0)],{'projectDir':_0x26b402,'appCode':_0x2984fe['appCode'],'env':_0x2984fe[_0x1e5212(0x1a1)]}));}catch(_0x54c412){console[_0x1e5212(0x19d)]('!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x1e5212(0x166)]('create','API\x20配置拉取异常:\x20'+_0x2984fe[_0x1e5212(0x1a0)],{'projectDir':_0x26b402,'appCode':_0x2984fe[_0x1e5212(0x1a0)],'env':_0x2984fe[_0x1e5212(0x1a1)],'error':_0x54c412 instanceof Error?_0x54c412['message']:String(_0x54c412)});}}logger[_0x1e5212(0x18a)](_0x1e5212(0x189),'项目创建完成:\x20'+_0x2984fe[_0x1e5212(0x17a)]),_0x4d2f81(!![]),_0x5c599b(![]);}catch(_0x18ffd4){logger['error'](_0x1e5212(0x189),_0x1e5212(0x19c)+_0x2984fe['projectName'],{'error':_0x18ffd4 instanceof Error?_0x18ffd4[_0x1e5212(0x1b1)]:String(_0x18ffd4)});try{a41_0x31105d[_0x1e5212(0x1b5)](_0x26b402)&&(console['log'](_0x1e5212(0x18b)+_0x26b402),a41_0x31105d[_0x1e5212(0x18c)](_0x26b402,{'recursive':!![],'force':!![]}));}catch(_0x232da2){logger['warn']('create','清理项目目录失败:\x20'+_0x26b402,{'error':_0x232da2 instanceof Error?_0x232da2[_0x1e5212(0x1b1)]:String(_0x232da2)});}_0x5c599b(![]),console['error'](_0x1e5212(0x172)+(_0x18ffd4 instanceof Error?_0x18ffd4[_0x1e5212(0x1b1)]:String(_0x18ffd4)));}},_0xd73077=async _0x1a801f=>{const _0x3f41fc=a41_0x5857;await _0x16dfd2({'projectName':_0x1a801f,'env':_0x3f2892[_0x3f41fc(0x1a1)]});},_0x37981b=async _0x462ea6=>{const _0x502ff8=a41_0x5857,_0x34ea7a=a41_0x5d9fea[_0x502ff8(0x19a)](process[_0x502ff8(0x171)](),_0x462ea6),_0x32af4b=a41_0x5d9fea['join'](_0x34ea7a,'package.json');try{console['log'](_0x502ff8(0x170));const _0x4f82cf=fileURLToPath(import.meta.url),_0x153aea=a41_0x5d9fea['resolve'](a41_0x5d9fea[_0x502ff8(0x179)](_0x4f82cf),'../..'),_0x4542d3=a41_0x5d9fea['join'](_0x153aea,_0x502ff8(0x1ac));let _0x4ae39d=_0x502ff8(0x167);try{const _0x247f2b=JSON[_0x502ff8(0x1c4)](a41_0x31105d[_0x502ff8(0x1c2)](_0x4542d3,'utf8'));_0x4ae39d=_0x247f2b['version']||'1.0.0';}catch(_0x33f1b7){}const _0x50e59e=a41_0x31105d[_0x502ff8(0x1c2)](_0x32af4b,_0x502ff8(0x1c3)),_0x44d1ab=JSON[_0x502ff8(0x1c4)](_0x50e59e);_0x44d1ab[_0x502ff8(0x1aa)]=_0x462ea6,_0x44d1ab[_0x502ff8(0x169)]=_0x462ea6+_0x502ff8(0x18d)+_0x4ae39d,a41_0x31105d[_0x502ff8(0x1af)](_0x32af4b,JSON['stringify'](_0x44d1ab,null,0x2)+'\x0a',_0x502ff8(0x1c3)),console['log'](_0x502ff8(0x187)+_0x462ea6+_0x502ff8(0x1b7)+_0x44d1ab[_0x502ff8(0x169)]),logger[_0x502ff8(0x1ae)](_0x502ff8(0x189),_0x502ff8(0x1ad),{'projectName':_0x462ea6,'description':_0x44d1ab[_0x502ff8(0x169)],'cliVersion':_0x4ae39d,'packageJsonPath':_0x502ff8(0x1ac)});}catch(_0xd59806){logger[_0x502ff8(0x1a5)](_0x502ff8(0x189),'更新\x20package.json\x20失败:\x20'+_0x462ea6,{'projectName':_0x462ea6,'error':_0xd59806 instanceof Error?_0xd59806['message']:String(_0xd59806)});throw _0xd59806;}},_0x2a43b7=async(_0x2bb23e,_0x48c880,_0x52cd47)=>{const _0x13f4c1=a41_0x5857,_0x3dce57=a41_0x5d9fea[_0x13f4c1(0x19a)](process[_0x13f4c1(0x171)](),_0x2bb23e),_0x2e501b=a41_0x5d9fea[_0x13f4c1(0x19f)](_0x3dce57,'.lovrabetrc');try{_0x48c880?console[_0x13f4c1(0x19d)]('*\x20正在为项目\x20'+_0x2bb23e+_0x13f4c1(0x1a3)+_0x48c880):console[_0x13f4c1(0x19d)](_0x13f4c1(0x1a4)+_0x2bb23e+_0x13f4c1(0x186));console['log'](_0x13f4c1(0x184)+_0x2e501b);const _0x4a3510=fileURLToPath(import.meta.url),_0x2b1be2=a41_0x5d9fea[_0x13f4c1(0x19a)](a41_0x5d9fea['dirname'](_0x4a3510),_0x13f4c1(0x1ab)),_0x297f12=a41_0x5d9fea[_0x13f4c1(0x19f)](_0x2b1be2,'package.json');let _0x4c373f=_0x13f4c1(0x167);try{const _0x516c44=JSON[_0x13f4c1(0x1c4)](a41_0x31105d[_0x13f4c1(0x1c2)](_0x297f12,_0x13f4c1(0x1c3)));_0x4c373f=_0x516c44['version']||'1.0.0';}catch(_0x38ca3f){}const _0x50549d=readConfig(),_0x5981d9=typeof _0x50549d[_0x13f4c1(0x1a1)]==='string'?_0x50549d[_0x13f4c1(0x1a1)]:undefined,{app:_0x2330df,appcode:_0x497db3,..._0x313336}=_0x50549d,_0x3ff843={..._0x313336,'appcode':_0x48c880||'','env':_0x52cd47||_0x5981d9||'online','createdAt':new Date()['toLocaleString'](),'version':_0x4c373f};a41_0x31105d[_0x13f4c1(0x1af)](_0x2e501b,JSON[_0x13f4c1(0x1b9)](_0x3ff843,null,0x2),_0x13f4c1(0x1c3)),_0x48c880?console[_0x13f4c1(0x19d)](_0x13f4c1(0x1c1)+_0x48c880):console[_0x13f4c1(0x19d)]('√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置'),logger[_0x13f4c1(0x1ae)](_0x13f4c1(0x189),_0x13f4c1(0x173)+_0x48c880,{'projectName':_0x2bb23e,'configFile':_0x13f4c1(0x191)});}catch(_0x64c02d){logger['error']('create','配置应用AppCode失败:\x20'+_0x48c880,{'projectName':_0x2bb23e,'error':_0x64c02d instanceof Error?_0x64c02d[_0x13f4c1(0x1b1)]:String(_0x64c02d)});}};useEffect(()=>{const _0x33db0f=a41_0x5857;_0x3f2892[_0x33db0f(0x1b0)]&&_0xd73077(_0x3f2892['projectCode']);},[_0x3f2892[_0x3aa6d8(0x1b0)]]);if(!_0x328de8&&!_0x31cdeb&&!_0x3f2892[_0x3aa6d8(0x1b0)])return a41_0x5e2cd4(EnhancedGuidedCreate,{'onCreate':_0x16dfd2,'env':_0x3f2892[_0x3aa6d8(0x1a1)]});if(_0x328de8)return a41_0x4a67d7(a41_0x4d7a9c,{'children':[a41_0x4a67d7(Box,{'marginTop':0x1,'children':[a41_0x5e2cd4(Box,{'width':'1'}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'children':_0x3aa6d8(0x175)}),a41_0x5e2cd4(Text,{'children':_0x3aa6d8(0x1b4)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'children':_0xba93ff?.['projectName']}),_0xba93ff?.[_0x3aa6d8(0x1a0)]&&a41_0x4a67d7(a41_0x4d7a9c,{'children':[a41_0x5e2cd4(Text,{'children':_0x3aa6d8(0x18e)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'children':_0xba93ff[_0x3aa6d8(0x1a0)]})]})]}),a41_0x5e2cd4(TaskRunning,{..._0x5d60a2}),a41_0x5e2cd4(TaskRunning,{..._0x459e2b}),a41_0x5e2cd4(TaskRunning,{..._0xdc1691})]});if(_0x31cdeb)return a41_0x4a67d7(a41_0x4d7a9c,{'children':[a41_0x4a67d7(Box,{'marginTop':0x1,'children':[a41_0x5e2cd4(Box,{'width':'1'}),a41_0x5e2cd4(Text,{'color':'green','children':_0x3aa6d8(0x175)}),a41_0x5e2cd4(Text,{'children':'项目名称:\x20'}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'children':_0xba93ff?.['projectName']}),_0xba93ff?.[_0x3aa6d8(0x1a0)]&&a41_0x4a67d7(a41_0x4d7a9c,{'children':[a41_0x5e2cd4(Text,{'children':'\x20|\x20应用AppCode:\x20'}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'children':_0xba93ff['appCode']})]})]}),a41_0x5e2cd4(TaskFinished,{..._0x5d60a2}),a41_0x5e2cd4(TaskFinished,{..._0x459e2b}),a41_0x5e2cd4(TaskFinished,{..._0xdc1691}),a41_0x5e2cd4(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0x5e2cd4(Text,{'color':'green','children':'─'[_0x3aa6d8(0x1bf)](0x3c)})}),a41_0x5e2cd4(Box,{'children':a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'bold':!![],'children':_0x3aa6d8(0x16b)})}),a41_0x4a67d7(Box,{'marginTop':0x1,'flexDirection':'column','children':[a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'children':_0x3aa6d8(0x16c)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x168),'bold':!![],'children':_0xba93ff?.[_0x3aa6d8(0x17a)]})]}),_0xba93ff?.[_0x3aa6d8(0x1a0)]&&a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'children':_0x3aa6d8(0x19e)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x168),'bold':!![],'children':_0xba93ff[_0x3aa6d8(0x1a0)]})]}),a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'children':_0x3aa6d8(0x199)}),_0xba93ff?.[_0x3aa6d8(0x1a2)]?a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'bold':!![],'children':_0x3aa6d8(0x16a)}):_0xba93ff?.['appCode']?a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x182),'bold':!![],'children':_0x3aa6d8(0x1c0)}):a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x176),'bold':!![],'children':'未配置'})]})]}),a41_0x5e2cd4(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'bold':!![],'children':_0x3aa6d8(0x188)})}),a41_0x4a67d7(Box,{'marginLeft':0x2,'flexDirection':_0x3aa6d8(0x178),'children':[a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'children':_0x3aa6d8(0x17f)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x168),'children':_0x3aa6d8(0x194)}),a41_0x5e2cd4(Text,{'color':'cyan','bold':!![],'children':_0x3aa6d8(0x1c7)+_0xba93ff?.['projectName']+'\x20&&\x20lovrabet\x20start'})]}),_0xba93ff?.[_0x3aa6d8(0x1a0)]&&!_0xba93ff?.[_0x3aa6d8(0x1a2)]&&a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x182),'children':_0x3aa6d8(0x16e)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x168),'children':_0x3aa6d8(0x193)}),a41_0x5e2cd4(Text,{'color':'cyan','bold':!![],'children':_0x3aa6d8(0x1a6)})]}),!_0xba93ff?.[_0x3aa6d8(0x1a0)]&&a41_0x4a67d7(a41_0x4d7a9c,{'children':[a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x176),'children':_0x3aa6d8(0x16e)}),a41_0x5e2cd4(Text,{'color':'white','children':_0x3aa6d8(0x1bd)}),a41_0x5e2cd4(Text,{'color':'cyan','bold':!![],'children':_0x3aa6d8(0x183)})]}),a41_0x4a67d7(Box,{'children':[a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x176),'children':_0x3aa6d8(0x19b)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x168),'children':_0x3aa6d8(0x193)}),a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x1c6),'bold':!![],'children':_0x3aa6d8(0x177)})]})]})]}),a41_0x5e2cd4(Box,{'marginTop':0x1,'children':a41_0x5e2cd4(Text,{'color':_0x3aa6d8(0x165),'children':'─'[_0x3aa6d8(0x1bf)](0x3c)})})]});return null;}function a41_0x5a47(){const _0x40a80f=['项目名称:\x20','existsSync','27441YKYZoW',',\x20description=','5270672KocUCX','stringify','73836EdrGgj','trim','292106IDaaWC','配置AppCode:\x20','W_OK','repeat','需手动拉取','√\x20配置文件已创建,应用AppCode:\x20','readFileSync','utf8','parse','4514592wVFqOI','cyan','cd\x20','length','constants','green','warn','1.0.0','white','description','已自动拉取\x20✓','🎉\x20项目创建成功!','📁\x20项目名称:\x20','670GdFfki','2.\x20','1596tGnZHf','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','cwd','×\x20项目创建失败:\x20','配置应用AppCode:\x20','7wAOowb','\x20√\x20','gray','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','column','dirname','projectName','test','×\x20无法在当前目录创建项目,请检查目录权限','API\x20配置拉取成功:\x20','*\x20正在拉取\x20API\x20配置...','1.\x20','1yAwDBE','285NCyznL','yellow','lovrabet\x20config\x20set\x20appcode\x20[app-code]','*\x20配置文件路径:\x20','accessSync','\x20创建配置文件','√\x20package.json\x20已更新:\x20name=','🚀\x20接下来可以:','create','success','*\x20清理失败的项目目录:\x20','rmSync','\x20Generated\x20by\x20lovrabet\x20cli\x20','\x20|\x20应用AppCode:\x20','×\x20项目名不能为空','setLogPath','.lovrabetrc','\x20已存在,请使用其他项目名','拉取API配置:\x20','启动项目:\x20','36634fTgGIr','20qsFGMR','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','41502Szgcpk','📦\x20API配置:\x20','resolve','3.\x20','项目创建失败:\x20','log','🔗\x20应用AppCode:\x20','join','appCode','env','pullApi','\x20配置应用AppCode:\x20','*\x20正在为项目\x20','error','lovrabet\x20api\x20pull','√\x20API\x20配置拉取完成','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','×\x20项目目录\x20','name','../..','package.json','更新\x20package.json\x20name\x20和\x20description\x20字段','info','writeFileSync','projectCode','message','API\x20配置拉取失败:\x20','doTask'];a41_0x5a47=function(){return _0x40a80f;};return a41_0x5a47();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a42_0x319d(){var _0x45da73=['30678PqESgr','4170201RoYxtR','40hTumuJ','3523212kyIvnt','16VZMnmc','\x20√\x20','1045517XHJLkF','4025241dVTnmt','taskName','green','3260lsYrZS','13717485VmUQzT'];a42_0x319d=function(){return _0x45da73;};return a42_0x319d();}function a42_0x5250(_0x462c94,_0x5618eb){_0x462c94=_0x462c94-0x87;var _0x319d37=a42_0x319d();var _0x525023=_0x319d37[_0x462c94];return _0x525023;}(function(_0x4ca48f,_0xecb859){var _0x10cdbf=a42_0x5250,_0x2681b0=_0x4ca48f();while(!![]){try{var _0x3e17b6=-parseInt(_0x10cdbf(0x8c))/0x1+parseInt(_0x10cdbf(0x92))/0x2+-parseInt(_0x10cdbf(0x8d))/0x3+parseInt(_0x10cdbf(0x88))/0x4*(parseInt(_0x10cdbf(0x90))/0x5)+-parseInt(_0x10cdbf(0x89))/0x6+parseInt(_0x10cdbf(0x87))/0x7+-parseInt(_0x10cdbf(0x8a))/0x8*(-parseInt(_0x10cdbf(0x91))/0x9);if(_0x3e17b6===_0xecb859)break;else _0x2681b0['push'](_0x2681b0['shift']());}catch(_0xed7177){_0x2681b0['push'](_0x2681b0['shift']());}}}(a42_0x319d,0xa8d0a));import{jsx as a42_0x57c67f,jsxs as a42_0x216e9a}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';export function TaskFinished(_0x56c3fd){var _0x153e92=a42_0x5250;return a42_0x216e9a(Box,{'children':[a42_0x57c67f(Box,{'width':'1'}),a42_0x57c67f(Text,{'color':_0x153e92(0x8f),'children':_0x153e92(0x8b)}),a42_0x57c67f(Text,{'children':_0x56c3fd[_0x153e92(0x8e)]}),a42_0x57c67f(TaskTime,{'elapsed':_0x56c3fd['elapsed']})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f0ad6,_0x319dcf){var _0x383d1d=a43_0x28c3,_0x2fa4b9=_0x4f0ad6();while(!![]){try{var _0x11ffd1=parseInt(_0x383d1d(0xf1))/0x1+-parseInt(_0x383d1d(0xf3))/0x2+parseInt(_0x383d1d(0xec))/0x3+parseInt(_0x383d1d(0xeb))/0x4*(-parseInt(_0x383d1d(0xf0))/0x5)+-parseInt(_0x383d1d(0xf7))/0x6*(-parseInt(_0x383d1d(0xf6))/0x7)+parseInt(_0x383d1d(0xef))/0x8+-parseInt(_0x383d1d(0xf5))/0x9*(parseInt(_0x383d1d(0xf2))/0xa);if(_0x11ffd1===_0x319dcf)break;else _0x2fa4b9['push'](_0x2fa4b9['shift']());}catch(_0x38e52f){_0x2fa4b9['push'](_0x2fa4b9['shift']());}}}(a43_0x4cb1,0xbc147));function a43_0x28c3(_0x5a88cb,_0x31c5d4){_0x5a88cb=_0x5a88cb-0xe9;var _0x4cb138=a43_0x4cb1();var _0x28c3e1=_0x4cb138[_0x5a88cb];return _0x28c3e1;}function a43_0x4cb1(){var _0x1df463=['35sMPQZm','1414541KvOAgh','350FuIKNy','453638JVmWKx','green','439047jTayAr','311815ZCiacf','30YIMpXs','dots','loading','593524QLKDQR','4030851iwumRe','finished','\x20√\x20','6099064wDARhG'];a43_0x4cb1=function(){return _0x1df463;};return a43_0x4cb1();}import{jsx as a43_0x5a4951,jsxs as a43_0x3eea96}from'react/jsx-runtime';import{Text}from'ink';import a43_0x447cd6 from'ink-spinner';export function TaskLoading(_0x3e4145){var _0x2e25bc=a43_0x28c3;if(_0x3e4145[_0x2e25bc(0xed)])return a43_0x5a4951(Text,{'color':'green','children':_0x2e25bc(0xee)});if(_0x3e4145[_0x2e25bc(0xea)])return a43_0x3eea96(Text,{'color':_0x2e25bc(0xf4),'children':['\x20',a43_0x5a4951(a43_0x447cd6,{'type':_0x2e25bc(0xe9)}),'\x20']});return a43_0x5a4951(Text,{'children':'\x20\x20\x20'});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x10136f,_0x3fec65){var _0x296a7d=a44_0xbcf2,_0x25aea4=_0x10136f();while(!![]){try{var _0x5300d8=parseInt(_0x296a7d(0x19b))/0x1*(parseInt(_0x296a7d(0x19d))/0x2)+parseInt(_0x296a7d(0x19c))/0x3*(-parseInt(_0x296a7d(0x196))/0x4)+parseInt(_0x296a7d(0x19f))/0x5+-parseInt(_0x296a7d(0x194))/0x6+parseInt(_0x296a7d(0x199))/0x7*(parseInt(_0x296a7d(0x198))/0x8)+-parseInt(_0x296a7d(0x195))/0x9*(parseInt(_0x296a7d(0x19e))/0xa)+-parseInt(_0x296a7d(0x19a))/0xb*(-parseInt(_0x296a7d(0x1a0))/0xc);if(_0x5300d8===_0x3fec65)break;else _0x25aea4['push'](_0x25aea4['shift']());}catch(_0x1545e6){_0x25aea4['push'](_0x25aea4['shift']());}}}(a44_0x20fb,0x8f44d));import{jsx as a44_0x40a3f7,jsxs as a44_0xc0c5d4}from'react/jsx-runtime';import{Box,Text}from'ink';function a44_0xbcf2(_0x35181c,_0x35898a){_0x35181c=_0x35181c-0x194;var _0x20fb2b=a44_0x20fb();var _0xbcf28f=_0x20fb2b[_0x35181c];return _0xbcf28f;}import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x2f5cb4){var _0x20d904=a44_0xbcf2;return a44_0xc0c5d4(Box,{'children':[a44_0x40a3f7(Box,{'width':'1'}),a44_0x40a3f7(TaskLoading,{..._0x2f5cb4}),a44_0x40a3f7(Text,{'children':_0x2f5cb4['taskName']}),a44_0x40a3f7(TaskTime,{'elapsed':_0x2f5cb4[_0x20d904(0x197)]})]});}function a44_0x20fb(){var _0x20f5c7=['6zPwpwQ','2802000WbpXxz','654130RxWRtq','5187744JRWFaD','72078WyujdD','27PujYOg','4GNmplM','elapsed','64wFXNEl','29239ZDJkjd','44gGyLXn','230477lFfsha','3436437zEFtEW'];a44_0x20fb=function(){return _0x20f5c7;};return a44_0x20fb();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a45_0x20ee(){var _0x3fe5e1=['gray','4nQwwVz','967571DInjAb','605850wWaGzg','12lPnwTU','482212KBWBFU','27fVWbDk','48DMnjkZ','1217704oNOdEq','321279KehOBz','588970kNlntq','8MjvuoL','120705vXzSOZ','elapsed'];a45_0x20ee=function(){return _0x3fe5e1;};return a45_0x20ee();}(function(_0x5ed3d0,_0x3d102f){var _0x2599a6=a45_0x3382,_0x54ab4e=_0x5ed3d0();while(!![]){try{var _0x51109f=parseInt(_0x2599a6(0xf3))/0x1+-parseInt(_0x2599a6(0xeb))/0x2*(parseInt(_0x2599a6(0xec))/0x3)+-parseInt(_0x2599a6(0xef))/0x4*(parseInt(_0x2599a6(0xf1))/0x5)+-parseInt(_0x2599a6(0xf5))/0x6*(parseInt(_0x2599a6(0xf7))/0x7)+parseInt(_0x2599a6(0xf6))/0x8*(parseInt(_0x2599a6(0xf4))/0x9)+parseInt(_0x2599a6(0xf8))/0xa+parseInt(_0x2599a6(0xf0))/0xb*(-parseInt(_0x2599a6(0xf2))/0xc);if(_0x51109f===_0x3d102f)break;else _0x54ab4e['push'](_0x54ab4e['shift']());}catch(_0x216612){_0x54ab4e['push'](_0x54ab4e['shift']());}}}(a45_0x20ee,0x3f995));function a45_0x3382(_0x2bade9,_0x50c6a1){_0x2bade9=_0x2bade9-0xeb;var _0x20eef6=a45_0x20ee();var _0x3382b2=_0x20eef6[_0x2bade9];return _0x3382b2;}import{jsx as a45_0xe83e61,Fragment as a45_0x45ce29,jsxs as a45_0x575eb0}from'react/jsx-runtime';import{Text}from'ink';export function TaskTime(_0x62025c){var _0x56cbac=a45_0x3382;if(_0x62025c['elapsed'])return a45_0x575eb0(a45_0x45ce29,{'children':[a45_0xe83e61(Text,{'color':_0x56cbac(0xee),'children':'\x20['}),a45_0xe83e61(Text,{'color':_0x56cbac(0xee),'bold':!![],'children':_0x62025c[_0x56cbac(0xed)]}),a45_0xe83e61(Text,{'color':'gray','children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x5ea8a2=a46_0x5ef6;(function(_0xdda252,_0x321d1e){const _0x346d1d=a46_0x5ef6,_0x2ca290=_0xdda252();while(!![]){try{const _0x2381e2=-parseInt(_0x346d1d(0xe7))/0x1+-parseInt(_0x346d1d(0xf5))/0x2*(parseInt(_0x346d1d(0xec))/0x3)+-parseInt(_0x346d1d(0xf3))/0x4*(-parseInt(_0x346d1d(0xea))/0x5)+parseInt(_0x346d1d(0xee))/0x6*(-parseInt(_0x346d1d(0xe6))/0x7)+parseInt(_0x346d1d(0xe4))/0x8*(parseInt(_0x346d1d(0xef))/0x9)+-parseInt(_0x346d1d(0xf8))/0xa+parseInt(_0x346d1d(0xe5))/0xb;if(_0x2381e2===_0x321d1e)break;else _0x2ca290['push'](_0x2ca290['shift']());}catch(_0x48a68e){_0x2ca290['push'](_0x2ca290['shift']());}}}(a46_0x496b,0x21c7a));import a46_0x435017 from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a46_0x435017[a46_0x5ea8a2(0xf9)](fileURLToPath(import.meta.url)),templateDir=a46_0x435017[a46_0x5ea8a2(0xed)](__dirname,a46_0x5ea8a2(0xf0));function a46_0x5ef6(_0x12d7f4,_0x19c1e7){_0x12d7f4=_0x12d7f4-0xe3;const _0x496bfa=a46_0x496b();let _0x5ef658=_0x496bfa[_0x12d7f4];return _0x5ef658;}export function useCopyProjectTemplate(){const _0x12517b=a46_0x5ea8a2,[_0x1da982,_0x1c10c5]=useState(![]),[_0x198a1b,_0x5a61a1]=useState(![]),[_0x4db61d,_0x318241]=useState(''),_0x79db49=useCallback(async _0x1bc41c=>{const _0x36a505=a46_0x5ef6,_0x1253fc=Date[_0x36a505(0xf6)](),_0x23b04f=a46_0x435017[_0x36a505(0xed)](process['cwd'](),_0x1bc41c);_0x1c10c5(!![]);try{logger[_0x36a505(0xf4)]('copy',_0x36a505(0xe9),{'projectCode':_0x1bc41c,'templateDir':templateDir}),await copyDirectory(templateDir,_0x23b04f);const _0x49e039=Date[_0x36a505(0xf6)]()-_0x1253fc;logger[_0x36a505(0xf1)](_0x36a505(0xe8),_0x36a505(0xeb),_0x49e039,{'projectCode':_0x1bc41c});}catch(_0xc36d1){const _0x3ea7ac=Date['now']()-_0x1253fc;logger[_0x36a505(0xf7)](_0x36a505(0xe8),'项目模板复制失败',{'projectCode':_0x1bc41c,'error':_0xc36d1 instanceof Error?_0xc36d1[_0x36a505(0xf2)]:String(_0xc36d1),'duration':_0x3ea7ac});throw _0xc36d1;}finally{_0x1c10c5(![]),_0x5a61a1(!![]),_0x318241(formatElapsed(_0x1253fc));}},[]);return{'taskName':_0x12517b(0xe3),'finished':_0x198a1b,'loading':_0x1da982,'elapsed':_0x4db61d,'doTask':_0x79db49};}function a46_0x496b(){const _0x565165=['开始复制项目模板','5vKvosj','项目模板复制完成','3zcSLXK','resolve','6BsTVYH','99EIAbjN','../../templates/projects/sub-app-react-demo','success','message','71780UgzVya','info','208556Cmrjyi','now','error','805810rDLaOo','dirname','复制项目文件','140848OQiyBe','2707870wuIUzW','398881UwKNCd','77577lYthsm','copy'];a46_0x496b=function(){return _0x565165;};return a46_0x496b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa44078,_0x46e3b3){const _0x59984d=a47_0xc41d,_0x5becce=_0xa44078();while(!![]){try{const _0x51ad99=-parseInt(_0x59984d(0xaf))/0x1+parseInt(_0x59984d(0xa3))/0x2*(-parseInt(_0x59984d(0xa2))/0x3)+parseInt(_0x59984d(0xab))/0x4*(-parseInt(_0x59984d(0xb2))/0x5)+-parseInt(_0x59984d(0xa5))/0x6+-parseInt(_0x59984d(0xa4))/0x7+-parseInt(_0x59984d(0xa7))/0x8+parseInt(_0x59984d(0xb3))/0x9;if(_0x51ad99===_0x46e3b3)break;else _0x5becce['push'](_0x5becce['shift']());}catch(_0x368734){_0x5becce['push'](_0x5becce['shift']());}}}(a47_0x5c90,0x26327));import a47_0x6e8cbc from'node:path';import{useCallback,useState}from'react';function a47_0xc41d(_0x50d299,_0x3d7dcf){_0x50d299=_0x50d299-0xa2;const _0x5c900f=a47_0x5c90();let _0xc41d0e=_0x5c900f[_0x50d299];return _0xc41d0e;}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const [_0x5ab880,_0x4909ee]=useState(![]),[_0x1e8c9a,_0x359464]=useState(![]),[_0x1c2b2f,_0x1c83c7]=useState(''),_0x2b7ea8=useCallback(async _0x3593ce=>{const _0x549864=a47_0xc41d,_0x531cf1=Date[_0x549864(0xae)](),_0xf0d0ac=a47_0x6e8cbc[_0x549864(0xa9)](process['cwd'](),_0x3593ce);_0x4909ee(!![]);try{logger[_0x549864(0xb1)]('format',_0x549864(0xaa),{'projectCode':_0x3593ce}),await execa('npx',[_0x549864(0xa6),_0x549864(0xb0),'.'],{'cwd':_0xf0d0ac});const _0xe640c7=Date[_0x549864(0xae)]()-_0x531cf1;logger[_0x549864(0xac)](_0x549864(0xad),_0x549864(0xa8),_0xe640c7,{'projectCode':_0x3593ce});}catch(_0x5df1df){const _0xffe98a=Date[_0x549864(0xae)]()-_0x531cf1;logger[_0x549864(0xb4)](_0x549864(0xad),_0x549864(0xb5),{'projectCode':_0x3593ce,'error':_0x5df1df instanceof Error?_0x5df1df[_0x549864(0xb6)]:String(_0x5df1df),'duration':_0xffe98a});throw _0x5df1df;}finally{_0x4909ee(![]),_0x359464(!![]),_0x1c83c7(formatElapsed(_0x531cf1));}},[]);return{'taskName':'格式化代码','finished':_0x1e8c9a,'loading':_0x5ab880,'elapsed':_0x1c2b2f,'doTask':_0x2b7ea8};}function a47_0x5c90(){const _0x30be69=['message','1842uTemJc','454ecxmMa','1584478ShHwqh','1849836UfUOJD','prettier','2003944GEvcbS','代码格式化完成','resolve','开始格式化代码','508204THgiLZ','success','format','now','174062JUdZLs','--write','info','5luGtMw','12438891EIpean','error','代码格式化失败'];a47_0x5c90=function(){return _0x30be69;};return a47_0x5c90();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3d941e,_0x333f3c){const _0x4ea657=a48_0x1c86,_0x386de8=_0x3d941e();while(!![]){try{const _0x279d78=parseInt(_0x4ea657(0x1ed))/0x1+parseInt(_0x4ea657(0x1e7))/0x2+-parseInt(_0x4ea657(0x1e8))/0x3+parseInt(_0x4ea657(0x1f0))/0x4+parseInt(_0x4ea657(0x1f8))/0x5*(parseInt(_0x4ea657(0x1f5))/0x6)+parseInt(_0x4ea657(0x1ea))/0x7+-parseInt(_0x4ea657(0x1ee))/0x8*(parseInt(_0x4ea657(0x1f1))/0x9);if(_0x279d78===_0x333f3c)break;else _0x386de8['push'](_0x386de8['shift']());}catch(_0x21f9d6){_0x386de8['push'](_0x386de8['shift']());}}}(a48_0x2f92,0x4cac0));function a48_0x2f92(){const _0x4b26a7=['success','https://registry.npmmirror.com','144256XEPxrv','695604DAcqHf','开始安装依赖','2921611ohKhbX','安装依赖','cwd','153538ylLsro','5120144bsgfrj','install','1812104lEwdQm','9JXgvwH','resolve','依赖安装完成','info','78vnAKoO','--registry','now','34565xxdukO'];a48_0x2f92=function(){return _0x4b26a7;};return a48_0x2f92();}import a48_0x5988d3 from'node:path';import{useCallback,useState}from'react';function a48_0x1c86(_0x2e6189,_0x3fab9e){_0x2e6189=_0x2e6189-0x1e6;const _0x2f920d=a48_0x2f92();let _0x1c86a7=_0x2f920d[_0x2e6189];return _0x1c86a7;}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x38b255=a48_0x1c86,[_0x5849f7,_0x331681]=useState(![]),[_0x4e7460,_0x37bb71]=useState(![]),[_0x422e87,_0x2db282]=useState(''),_0x370fbf=useCallback(async _0x3bcd7b=>{const _0x51e2e2=a48_0x1c86,_0x1a3e33=Date[_0x51e2e2(0x1f7)](),_0x56991e=a48_0x5988d3[_0x51e2e2(0x1f2)](process[_0x51e2e2(0x1ec)](),_0x3bcd7b);_0x331681(!![]),_0x37bb71(![]);const _0x20a4f6=async(_0x560101,_0x3dfe99)=>{await execa(_0x560101,_0x3dfe99,{'cwd':_0x56991e});};try{logger[_0x51e2e2(0x1f4)](_0x51e2e2(0x1ef),_0x51e2e2(0x1e9),{'projectCode':_0x3bcd7b,'registry':'https://registry.npmmirror.com'}),await _0x20a4f6('npm',['install',_0x51e2e2(0x1f6),_0x51e2e2(0x1e6)]);const _0x117fea=Date['now']()-_0x1a3e33;logger[_0x51e2e2(0x1f9)](_0x51e2e2(0x1ef),_0x51e2e2(0x1f3),_0x117fea,{'projectCode':_0x3bcd7b});}catch(_0x4b6551){const _0x33a404=Date['now']()-_0x1a3e33;logger['error'](_0x51e2e2(0x1ef),'依赖安装失败',{'projectCode':_0x3bcd7b,'error':_0x4b6551 instanceof Error?_0x4b6551['message']:String(_0x4b6551),'duration':_0x33a404});throw _0x4b6551;}finally{_0x331681(![]),_0x37bb71(!![]),_0x2db282(formatElapsed(_0x1a3e33));}},[]);return{'taskName':_0x38b255(0x1eb),'finished':_0x4e7460,'loading':_0x5849f7,'elapsed':_0x422e87,'doTask':_0x370fbf};}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a49_0x33e4(_0x3a8ca4,_0x1ccdbb){_0x3a8ca4=_0x3a8ca4-0x158;var _0x59c860=a49_0x59c8();var _0x33e484=_0x59c860[_0x3a8ca4];return _0x33e484;}(function(_0x5a78c9,_0x1b0a46){var _0x5e97a9=a49_0x33e4,_0x1d545b=_0x5a78c9();while(!![]){try{var _0xe59859=-parseInt(_0x5e97a9(0x162))/0x1+parseInt(_0x5e97a9(0x15e))/0x2*(-parseInt(_0x5e97a9(0x15c))/0x3)+-parseInt(_0x5e97a9(0x161))/0x4+-parseInt(_0x5e97a9(0x15d))/0x5+parseInt(_0x5e97a9(0x15a))/0x6+-parseInt(_0x5e97a9(0x158))/0x7*(-parseInt(_0x5e97a9(0x160))/0x8)+parseInt(_0x5e97a9(0x163))/0x9;if(_0xe59859===_0x1b0a46)break;else _0x1d545b['push'](_0x1d545b['shift']());}catch(_0x4d427c){_0x1d545b['push'](_0x1d545b['shift']());}}}(a49_0x59c8,0xee3d5));import{jsx as a49_0x5948c5,jsxs as a49_0x1989e8}from'react/jsx-runtime';function a49_0x59c8(){var _0x43a681=['lovrabet\x20--help','7590570LNjfps','查看可用命令。','2517702vSvjlK','3163845NYopCd','4FujRUq','green','8PbehHV','5626468scBiuk','1065726uNTIAK','24862257ngLOQA','!\x20请指定一个有效的命令。','12122887Gcvdge'];a49_0x59c8=function(){return _0x43a681;};return a49_0x59c8();}import{Box,Text}from'ink';export function Help(){var _0x2145f4=a49_0x33e4;return a49_0x1989e8(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a49_0x1989e8(Box,{'children':[a49_0x5948c5(Box,{'width':'1'}),a49_0x5948c5(Text,{'children':_0x2145f4(0x164)})]}),a49_0x1989e8(Box,{'marginTop':0x1,'children':[a49_0x5948c5(Box,{'width':'1'}),a49_0x1989e8(Text,{'children':['\x20\x20','使用']}),a49_0x1989e8(Text,{'bold':!![],'color':_0x2145f4(0x15f),'children':['\x20',_0x2145f4(0x159),'\x20']}),a49_0x5948c5(Text,{'children':_0x2145f4(0x15b)})]})]});}
|
package/lib/init/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x279ec1,_0x19e187){const _0x181b5e=a50_0x1cbb,_0x307b63=_0x279ec1();while(!![]){try{const _0x277ebf=-parseInt(_0x181b5e(0xbc))/0x1*(parseInt(_0x181b5e(0xd8))/0x2)+parseInt(_0x181b5e(0xb5))/0x3*(-parseInt(_0x181b5e(0xb3))/0x4)+-parseInt(_0x181b5e(0xb6))/0x5*(parseInt(_0x181b5e(0xb1))/0x6)+-parseInt(_0x181b5e(0xb7))/0x7*(parseInt(_0x181b5e(0xb8))/0x8)+parseInt(_0x181b5e(0xad))/0x9*(-parseInt(_0x181b5e(0xca))/0xa)+parseInt(_0x181b5e(0xdb))/0xb+parseInt(_0x181b5e(0xd9))/0xc;if(_0x277ebf===_0x19e187)break;else _0x307b63['push'](_0x307b63['shift']());}catch(_0x52d868){_0x307b63['push'](_0x307b63['shift']());}}}(a50_0x1e04,0xd7c90));import{jsxs as a50_0x5552b4,jsx as a50_0x361b5c}from'react/jsx-runtime';import{useState,useEffect}from'react';function a50_0x1e04(){const _0x38a60f=['18zXoqSS','version','4wAdqKO','当前目录已存在\x20.lovrabetrc\x20文件','1407459qMpxSr','1952220WpUPak','8337539gECEAk','8mKDqOR','应用代码只能包含字母、数字、-\x20和\x20_','cwd','length','621221bOoWrm','backspace','.lovrabetrc','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','ctrl','trim','../..','init','online','gray','exit','parse','red','return','130nYfCMR','创建配置文件失败','package.json','应用代码长度不能超过\x20100\x20个字符','应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_','test','应用代码不能为空','green','应用代码不合法','message','env','column','error','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','2PCmEDO','56207844LmVsvk','cyan','4494765SiSgPV','string','1.0.0','slice','utf8','创建配置文件失败:\x20','stringify','info','523359hdmPFt','正在初始化配置文件...','setLogPath','\x20←\x20'];a50_0x1e04=function(){return _0x38a60f;};return a50_0x1e04();}function a50_0x1cbb(_0x3920f4,_0x508186){_0x3920f4=_0x3920f4-0xa8;const _0x1e048b=a50_0x1e04();let _0x1cbbce=_0x1e048b[_0x3920f4];return _0x1cbbce;}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';export function Init({appcode:_0x34f063,env:_0x2ad53b}){const _0x3ab1ef=a50_0x1cbb,[_0x535175,_0x3660bc]=useState(null),[_0xc46b5a,_0x319ad2]=useState(![]),[_0x1c83b4,_0x2baf8b]=useState(!_0x34f063),[_0x3dd01a,_0x186fe2]=useState(''),[_0x4a9e7c,_0x314b9e]=useState(''),[_0x574dab,_0x185c7c]=useState(_0x34f063||''),[_0x3d84a5]=useState(_0x2ad53b);function _0x1b6b93(_0x4c43a7){const _0x567bd7=a50_0x1cbb;if(_0x4c43a7[_0x567bd7(0xbb)]===0x0)return{'valid':![],'message':''};if(_0x4c43a7[_0x567bd7(0xbb)]>0x64)return{'valid':![],'message':_0x567bd7(0xcd)};const _0x2f4a0f=/^[A-Za-z0-9_-]+$/;if(!_0x2f4a0f[_0x567bd7(0xcf)](_0x4c43a7))return{'valid':![],'message':_0x567bd7(0xb9)};return{'valid':!![]};}useInput((_0x48cd76,_0x13cefe)=>{const _0xb3f8a4=a50_0x1cbb;if(!_0x1c83b4)return;if(_0x13cefe[_0xb3f8a4(0xc9)]){if(_0x4a9e7c||!_0x3dd01a[_0xb3f8a4(0xc1)]()){_0x314b9e(_0xb3f8a4(0xd0));return;}const _0x138b10=_0x3dd01a[_0xb3f8a4(0xc1)](),{valid:_0x5a77d3,message:_0x5b396c}=_0x1b6b93(_0x138b10);if(!_0x5a77d3){_0x314b9e(_0x5b396c||_0xb3f8a4(0xd2));return;}_0x185c7c(_0x138b10),_0x2baf8b(![]);}else{if(_0x13cefe[_0xb3f8a4(0xbd)]||_0x13cefe['delete'])_0x186fe2(_0x4f7cab=>{const _0x11d376=_0xb3f8a4,_0x4e33cc=_0x4f7cab[_0x11d376(0xa8)](0x0,-0x1);if(_0x4e33cc['length']===0x0)_0x314b9e('');else{const {valid:_0x35f542,message:_0x27d8ba}=_0x1b6b93(_0x4e33cc);_0x314b9e(_0x35f542?'':_0x27d8ba||_0x11d376(0xd2));}return _0x4e33cc;});else _0x13cefe[_0xb3f8a4(0xc0)]&&_0x48cd76==='c'?process[_0xb3f8a4(0xc6)](0x0):_0x186fe2(_0x365fd5=>{const _0x34e303=_0xb3f8a4,_0x33c7d5=_0x365fd5+_0x48cd76,{valid:_0x9d3c59,message:_0x15b2e8}=_0x1b6b93(_0x33c7d5);return _0x314b9e(_0x9d3c59?'':_0x15b2e8||_0x34e303(0xd2)),_0x33c7d5;});}},{'isActive':_0x1c83b4}),useEffect(()=>{const _0x462c1e=a50_0x1cbb;if(!_0x574dab||_0x1c83b4)return;const _0x568101=resolve(process['cwd'](),_0x462c1e(0xbe));if(existsSync(_0x568101)){_0x3660bc(_0x462c1e(0xb4)),setTimeout(()=>process['exit'](0x1),0x64);return;}try{const _0x1e558a=fileURLToPath(import.meta.url),_0x1451b4=resolve(dirname(_0x1e558a),_0x462c1e(0xc2)),_0x398f1c=join(_0x1451b4,_0x462c1e(0xcc));let _0x52c590=_0x462c1e(0xdd);try{const _0xfe744e=JSON[_0x462c1e(0xc7)](readFileSync(_0x398f1c,_0x462c1e(0xa9)));_0x52c590=_0xfe744e[_0x462c1e(0xb2)]||_0x462c1e(0xdd);}catch(_0x30d9ba){}const _0x54bf5f=readConfig(),_0x51f4c1=typeof _0x54bf5f['env']===_0x462c1e(0xdc)?_0x54bf5f[_0x462c1e(0xd4)]:undefined,{app:_0x2b1b48,appcode:_0x58e68e,..._0xaa39e0}=_0x54bf5f,_0x6894be={..._0xaa39e0,'appcode':_0x574dab,'env':_0x3d84a5||_0x51f4c1||_0x462c1e(0xc4),'createdAt':new Date()['toLocaleString'](),'version':_0x52c590};writeFileSync(_0x568101,JSON[_0x462c1e(0xab)](_0x6894be,null,0x2),{'encoding':_0x462c1e(0xa9),'mode':0x180}),logger[_0x462c1e(0xaf)](process[_0x462c1e(0xba)]()),logger[_0x462c1e(0xac)](_0x462c1e(0xc3),'初始化项目配置文件成功',{'appcode':_0x574dab,'env':_0x6894be[_0x462c1e(0xd4)],'version':_0x6894be[_0x462c1e(0xb2)],'configPath':_0x568101}),_0x319ad2(!![]),setTimeout(()=>process[_0x462c1e(0xc6)](0x0),0x64);}catch(_0x134c68){logger[_0x462c1e(0xd6)]('init',_0x462c1e(0xcb),{'error':_0x134c68 instanceof Error?_0x134c68['message']:String(_0x134c68)}),_0x3660bc(_0x462c1e(0xaa)+(_0x134c68 instanceof Error?_0x134c68[_0x462c1e(0xd3)]:String(_0x134c68))),setTimeout(()=>process['exit'](0x1),0x64);}},[_0x574dab,_0x1c83b4,_0x3d84a5]);if(_0x535175)return a50_0x361b5c(Box,{'flexDirection':_0x3ab1ef(0xd5),'children':a50_0x5552b4(Text,{'color':_0x3ab1ef(0xc8),'children':['✗\x20',_0x535175]})});if(_0x1c83b4)return a50_0x5552b4(Box,{'flexDirection':_0x3ab1ef(0xd5),'children':[a50_0x5552b4(Box,{'children':[a50_0x361b5c(Text,{'color':_0x3ab1ef(0xda),'children':'请输入应用代码\x20(AppCode):\x20'}),_0x3dd01a?a50_0x361b5c(Text,{'color':_0x3ab1ef(0xd1),'children':_0x3dd01a}):a50_0x361b5c(Text,{'color':_0x3ab1ef(0xc5),'children':'_'}),_0x4a9e7c&&a50_0x5552b4(Text,{'color':_0x3ab1ef(0xc8),'children':[_0x3ab1ef(0xb0),_0x4a9e7c]})]}),!_0x4a9e7c&&!_0x3dd01a&&a50_0x361b5c(Box,{'children':a50_0x361b5c(Text,{'color':_0x3ab1ef(0xc5),'children':_0x3ab1ef(0xce)})})]});if(_0xc46b5a)return a50_0x5552b4(Box,{'flexDirection':_0x3ab1ef(0xd5),'children':[a50_0x361b5c(Text,{'color':_0x3ab1ef(0xd1),'children':_0x3ab1ef(0xd7)}),a50_0x5552b4(Text,{'color':'cyan','children':['AppCode:\x20',_0x574dab]}),a50_0x361b5c(Text,{'children':_0x3ab1ef(0xbf)})]});return a50_0x361b5c(Box,{'children':a50_0x361b5c(Text,{'children':_0x3ab1ef(0xae)})});}
|
package/lib/mcp/cursor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a51_0x58e7(){const _0x541b04=['请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','复制\x20Cursor\x20Rules\x20文件','lovrabet-dataset','\x0a✓\x20Cursor\x20MCP\x20配置成功!','online','配置\x20Cursor\x20MCP\x20成功','utf8','创建新的\x20mcp.json\x20配置','9909330VuuXPt','4332318wZeqxI','✓\x20创建\x20.cursor\x20目录:\x20','mcp-cursor','log','✓\x20创建\x20mcp.json\x20配置文件','\x20\x20-\x20环境:\x20','exit','Cursor\x20Rules\x20文件已存在,跳过','stringify','npx','error','1581905ZWNYut','错误:\x20解析现有\x20mcp.json\x20失败:\x20','5479280SFfXxu','配置\x20Cursor\x20MCP\x20失败','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','message','mcpServers','9356102DJOanI','创建\x20.cursor\x20目录','1lyKYWG','cwd','错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置','创建\x20.cursor/rules\x20目录','303274CgWFcd','\x20\x20-\x20AppCode:\x20','2731228Xiwzqt','✓\x20更新\x20mcp.json\x20配置','.cursor','复制\x20Cursor\x20Rules\x20文件失败','app','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','info','!\x20Cursor\x20Rules\x20文件已存在,跳过创建,如需重新创建,请删除\x20.cursor/rules/lovrabet_rules.mdc\x20文件','lovrabet_rules.mdc','更新现有\x20mcp.json\x20配置','warn','\x0a配置信息:'];a51_0x58e7=function(){return _0x541b04;};return a51_0x58e7();}(function(_0x2a8886,_0x71719f){const _0x27da31=a51_0x5420,_0x36e2ab=_0x2a8886();while(!![]){try{const _0x41cb87=-parseInt(_0x27da31(0x173))/0x1*(-parseInt(_0x27da31(0x148))/0x2)+parseInt(_0x27da31(0x15f))/0x3+-parseInt(_0x27da31(0x14a))/0x4+parseInt(_0x27da31(0x16a))/0x5+parseInt(_0x27da31(0x15e))/0x6+-parseInt(_0x27da31(0x171))/0x7+-parseInt(_0x27da31(0x16c))/0x8;if(_0x41cb87===_0x71719f)break;else _0x36e2ab['push'](_0x36e2ab['shift']());}catch(_0x49437c){_0x36e2ab['push'](_0x36e2ab['shift']());}}}(a51_0x58e7,0xd1cf0));function a51_0x5420(_0x1a9cb1,_0x1ce972){_0x1a9cb1=_0x1a9cb1-0x147;const _0x58e737=a51_0x58e7();let _0x542099=_0x58e737[_0x1a9cb1];return _0x542099;}import{existsSync,mkdirSync,writeFileSync,readFileSync,copyFileSync}from'node:fs';import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import{readConfig}from'../utils/config.js';import{logger}from'../utils/logger.js';export async function configureCursorMcp(){const _0x255bd9=a51_0x5420;try{const _0x32cd8c=process[_0x255bd9(0x174)](),_0x1c1f91=resolve(_0x32cd8c,_0x255bd9(0x14c)),_0x31297a=resolve(_0x1c1f91,'mcp.json'),_0x16a4d0=readConfig(),_0x469726=_0x16a4d0['appcode']||_0x16a4d0[_0x255bd9(0x14e)],_0x148978=_0x16a4d0['env']||_0x255bd9(0x15a);!_0x469726&&(console[_0x255bd9(0x169)](_0x255bd9(0x175)),logger[_0x255bd9(0x169)]('mcp-cursor','未找到\x20appcode\x20配置'),process[_0x255bd9(0x165)](0x1));!existsSync(_0x1c1f91)&&(mkdirSync(_0x1c1f91,{'recursive':!![]}),logger[_0x255bd9(0x150)](_0x255bd9(0x161),_0x255bd9(0x172),{'path':_0x1c1f91}),console[_0x255bd9(0x162)](_0x255bd9(0x160)+_0x1c1f91));const _0x5be5e8={'command':_0x255bd9(0x168),'args':['-y','@lovrabet/dataset-mcp-server'],'env':{'LOVRABET_APP_CODE':String(_0x469726),'LOVRABET_ENV':String(_0x148978)}};let _0x248989;if(existsSync(_0x31297a))try{const _0x365bee=readFileSync(_0x31297a,'utf8');_0x248989=JSON['parse'](_0x365bee),!_0x248989['mcpServers']&&(_0x248989[_0x255bd9(0x170)]={}),_0x248989[_0x255bd9(0x170)][_0x255bd9(0x158)]=_0x5be5e8,logger[_0x255bd9(0x150)](_0x255bd9(0x161),_0x255bd9(0x153),{'path':_0x31297a,'appcode':_0x469726,'env':_0x148978}),console['log'](_0x255bd9(0x14b));}catch(_0x3619e7){logger[_0x255bd9(0x169)](_0x255bd9(0x161),'解析现有\x20mcp.json\x20失败',{'error':_0x3619e7 instanceof Error?_0x3619e7[_0x255bd9(0x16f)]:String(_0x3619e7)}),console[_0x255bd9(0x169)](_0x255bd9(0x16b)+(_0x3619e7 instanceof Error?_0x3619e7[_0x255bd9(0x16f)]:String(_0x3619e7))),process[_0x255bd9(0x165)](0x1);}else _0x248989={'mcpServers':{'lovrabet-dataset':_0x5be5e8}},logger[_0x255bd9(0x150)](_0x255bd9(0x161),_0x255bd9(0x15d),{'path':_0x31297a,'appcode':_0x469726,'env':_0x148978}),console['log'](_0x255bd9(0x163));writeFileSync(_0x31297a,JSON[_0x255bd9(0x167)](_0x248989,null,0x2),{'encoding':_0x255bd9(0x15c)});const _0x276d81=resolve(_0x1c1f91,'rules'),_0x2896ce=resolve(_0x276d81,_0x255bd9(0x152));if(!existsSync(_0x2896ce))try{!existsSync(_0x276d81)&&(mkdirSync(_0x276d81,{'recursive':!![]}),logger[_0x255bd9(0x150)](_0x255bd9(0x161),_0x255bd9(0x147),{'path':_0x276d81}));const _0x287955=fileURLToPath(import.meta.url),_0x5e5207=dirname(_0x287955),_0x16c6a2=resolve(_0x5e5207,'../../templates/rules/lovrabet_rules.mdc.tpl');existsSync(_0x16c6a2)?(copyFileSync(_0x16c6a2,_0x2896ce),logger[_0x255bd9(0x150)](_0x255bd9(0x161),_0x255bd9(0x157),{'from':_0x16c6a2,'to':_0x2896ce}),console[_0x255bd9(0x162)]('✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc')):logger[_0x255bd9(0x154)](_0x255bd9(0x161),'Cursor\x20Rules\x20模板文件不存在',{'templatePath':_0x16c6a2});}catch(_0xe0a568){logger['error'](_0x255bd9(0x161),_0x255bd9(0x14d),{'error':_0xe0a568 instanceof Error?_0xe0a568[_0x255bd9(0x16f)]:String(_0xe0a568)}),console[_0x255bd9(0x154)](_0x255bd9(0x14f)+(_0xe0a568 instanceof Error?_0xe0a568['message']:String(_0xe0a568)));}else console['log'](_0x255bd9(0x151)),logger['info'](_0x255bd9(0x161),_0x255bd9(0x166),{'path':_0x2896ce});console[_0x255bd9(0x162)](_0x255bd9(0x159)),console[_0x255bd9(0x162)](_0x255bd9(0x155)),console[_0x255bd9(0x162)](_0x255bd9(0x149)+_0x469726),console[_0x255bd9(0x162)](_0x255bd9(0x164)+_0x148978),console[_0x255bd9(0x162)]('\x20\x20-\x20配置文件:\x20'+_0x31297a),console['log'](_0x255bd9(0x16e)),console[_0x255bd9(0x162)](_0x255bd9(0x156)),logger[_0x255bd9(0x150)](_0x255bd9(0x161),_0x255bd9(0x15b),{'appcode':_0x469726,'env':_0x148978,'configPath':_0x31297a}),process['exit'](0x0);}catch(_0xd5c64f){logger[_0x255bd9(0x169)](_0x255bd9(0x161),_0x255bd9(0x16d),{'error':_0xd5c64f instanceof Error?_0xd5c64f[_0x255bd9(0x16f)]:String(_0xd5c64f)}),console[_0x255bd9(0x169)]('错误:\x20配置失败:\x20'+(_0xd5c64f instanceof Error?_0xd5c64f[_0x255bd9(0x16f)]:String(_0xd5c64f))),process[_0x255bd9(0x165)](0x1);}}
|
package/lib/mcp/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5f0395,_0x2fb262){var _0x2173ee=a52_0x2a73,_0x202374=_0x5f0395();while(!![]){try{var _0x133ffc=-parseInt(_0x2173ee(0x6e))/0x1*(-parseInt(_0x2173ee(0x71))/0x2)+parseInt(_0x2173ee(0x7a))/0x3+parseInt(_0x2173ee(0x72))/0x4+-parseInt(_0x2173ee(0x78))/0x5*(-parseInt(_0x2173ee(0x6f))/0x6)+-parseInt(_0x2173ee(0x77))/0x7+-parseInt(_0x2173ee(0x81))/0x8*(-parseInt(_0x2173ee(0x70))/0x9)+parseInt(_0x2173ee(0x74))/0xa*(-parseInt(_0x2173ee(0x7e))/0xb);if(_0x133ffc===_0x2fb262)break;else _0x202374['push'](_0x202374['shift']());}catch(_0x353d13){_0x202374['push'](_0x202374['shift']());}}}(a52_0x2858,0xbfe6f));import{configureCursorMcp}from'./cursor.js';import{logger}from'../utils/logger.js';function a52_0x2a73(_0x4ce2ac,_0x37a174){_0x4ce2ac=_0x4ce2ac-0x6d;var _0x285806=a52_0x2858();var _0x2a73d3=_0x285806[_0x4ce2ac];return _0x2a73d3;}export async function mcpCommand(_0x418af2){var _0x2de01c=a52_0x2a73;logger['setLogPath'](process[_0x2de01c(0x7c)]());if(!_0x418af2){console[_0x2de01c(0x6d)]('错误:\x20请指定\x20IDE\x20类型'),console[_0x2de01c(0x7b)]('\x0a使用方法:'),console[_0x2de01c(0x7b)]('\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP'),console[_0x2de01c(0x7b)](_0x2de01c(0x79)),console['log']('\x20\x20lovrabet\x20mcp\x20cursor'),logger[_0x2de01c(0x6d)](_0x2de01c(0x7f),_0x2de01c(0x82)),process['exit'](0x1);return;}switch(_0x418af2[_0x2de01c(0x83)]()){case _0x2de01c(0x75):logger[_0x2de01c(0x76)](_0x2de01c(0x7f),'执行配置\x20Cursor\x20MCP\x20命令'),await configureCursorMcp();break;default:console['error']('错误:\x20不支持的\x20IDE\x20类型:\x20'+_0x418af2),console[_0x2de01c(0x7b)](_0x2de01c(0x80)),console[_0x2de01c(0x7b)]('\x20\x20-\x20cursor'),logger[_0x2de01c(0x6d)](_0x2de01c(0x7f),_0x2de01c(0x7d)+_0x418af2),process[_0x2de01c(0x73)](0x1);break;}}function a52_0x2858(){var _0x5750a4=['2003uKKTiX','2239788wzfpCF','12113604xtJOhH','398dSRxil','4625984MmUbQl','exit','1560xfbGqJ','cursor','info','8120651rsyHhd','15LxAEdK','\x0a示例:','3693399NzojBI','log','cwd','不支持的\x20IDE\x20类型:\x20','233112wKjVaY','mcp','\x0a当前支持的\x20IDE:','8ilyMMp','未指定\x20IDE\x20类型','toLowerCase','error'];a52_0x2858=function(){return _0x5750a4;};return a52_0x2858();}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|