@lovrabet/cli 1.1.20 → 1.1.22
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/valid-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +2 -2
- package/templates/README.md +28 -1
- package/templates/projects/sub-app-react-demo/CHANGELOG.md +16 -0
- package/templates/projects/sub-app-react-demo/README.md +163 -54
- package/templates/projects/sub-app-react-demo/package-lock.json +1347 -149
- package/templates/projects/sub-app-react-demo/package.json +2 -2
- package/templates/projects/sub-app-react-demo/src/layouts/MainLayout.tsx +286 -55
- package/templates/projects/sub-app-react-demo/src/pages/data-screen/index.tsx +526 -0
- package/templates/projects/sub-app-react-demo/src/pages/index.tsx +942 -87
- package/templates/projects/sub-app-react-demo/src/pages/intro/index.tsx +560 -0
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +113 -118
- package/templates/projects/sub-app-react-demo/src/pages/workbench/index.tsx +469 -0
- package/templates/projects/sub-app-react-demo/src/style.css +39 -0
- package/templates/rules/README.md +178 -0
- package/templates/rules/example-project-setup.md +276 -0
- package/templates/rules/lovrabet_rules.mdc.tpl +425 -0
- package/templates/projects/sub-app-react-demo/bun.lock +0 -600
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2d7537,_0x1c6aae){const _0x450907=a32_0x4b57,_0x1d93ab=_0x2d7537();while(!![]){try{const _0x574d1b=parseInt(_0x450907(0x1e7))/0x1+parseInt(_0x450907(0x1b6))/0x2*(parseInt(_0x450907(0x1ba))/0x3)+parseInt(_0x450907(0x1f0))/0x4+parseInt(_0x450907(0x1cb))/0x5*(-parseInt(_0x450907(0x1d5))/0x6)+parseInt(_0x450907(0x1b2))/0x7+parseInt(_0x450907(0x1c1))/0x8*(parseInt(_0x450907(0x1eb))/0x9)+-parseInt(_0x450907(0x1bd))/0xa;if(_0x574d1b===_0x1c6aae)break;else _0x1d93ab['push'](_0x1d93ab['shift']());}catch(_0x52cfe0){_0x1d93ab['push'](_0x1d93ab['shift']());}}}(a32_0x142c,0xcda00));import{jsx as a32_0x40f6d4,jsxs as a32_0x48e955,Fragment as a32_0x167a84}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';function a32_0x4b57(_0x1ad83e,_0x1d7c96){const _0x142c38=a32_0x142c();return a32_0x4b57=function(_0x4b5781,_0xcc82a4){_0x4b5781=_0x4b5781-0x1b1;let _0x118261=_0x142c38[_0x4b5781];return _0x118261;},a32_0x4b57(_0x1ad83e,_0x1d7c96);}import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x418b46){const _0x44738d=a32_0x4b57,{onCreate:_0x2f71f8,env:_0x2599e0}=_0x418b46,[_0x466ece,_0x59504d]=useState('project-name'),[_0x1a2137,_0xd6a489]=useState(''),[_0x1d0cf6,_0x1e6926]=useState(''),[_0x538ee9,_0x131caf]=useState(''),[_0x440658,_0x539827]=useState(''),[_0x2cee4a,_0x4f335c]=useState([]),[_0x27fc39,_0x424b83]=useState(null),[_0x456c2b,_0x2df3ef]=useState(![]),[_0x45c3da,_0x2cdf75]=useState(![]),[_0x6346f3,_0xb77ea7]=useState(![]),[_0x183452,_0x185aff]=useState(0x0),[_0x49896f,_0x2fafbf]=useState(0x0),_0x56024f=_0x44738d(0x1c9),_0x30d323=readConfig(),_0x21b3f9=typeof _0x30d323[_0x44738d(0x1bf)]===_0x44738d(0x1ec)?_0x30d323[_0x44738d(0x1bf)]:undefined;function _0x28aa6b(_0x3c1928){const _0x461888=_0x44738d;if(_0x3c1928[_0x461888(0x1c8)]>0x32)return{'valid':![],'message':_0x461888(0x1c2)};const _0xa763a0=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x3c1928?.[_0x461888(0x1e4)]()&&!_0xa763a0[_0x461888(0x1cc)](_0x3c1928))return{'valid':![],'message':_0x461888(0x1e1)};return{'valid':!![]};}function _0x25d87d(_0x43cb97){const _0x201672=_0x44738d;if(!_0x43cb97[_0x201672(0x1e4)]())return{'valid':!![]};if(_0x43cb97['length']>0x64)return{'valid':![],'message':_0x201672(0x1de)};const _0x59a103=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x59a103[_0x201672(0x1cc)](_0x43cb97))return{'valid':![],'message':'应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头'};return{'valid':!![]};}async function _0x480812(){_0x2df3ef(!![]);try{const _0x3be5be=await getIsSessionValid();return _0x424b83(_0x3be5be),_0x3be5be;}catch(_0x2aa205){return _0x424b83(![]),![];}finally{_0x2df3ef(![]);}}async function _0x34cd30(){_0x2cdf75(!![]);try{const _0x42e891=await authServer({'silent':!![]});return _0x424b83(_0x42e891),_0x42e891;}catch(_0x47b84){return _0x424b83(![]),![];}finally{_0x2cdf75(![]);}}return useInput(async(_0x217e04,_0x1560c3)=>{const _0x2767fc=_0x44738d;if(_0x1560c3[_0x2767fc(0x1e5)]||_0x1560c3['rightArrow']){if(_0x466ece===_0x2767fc(0x1d4)){_0x185aff(_0x2e5417=>_0x2e5417===0x0?0x1:0x0);return;}if(_0x466ece===_0x2767fc(0x1ee)){_0x2fafbf(_0x479b10=>_0x479b10===0x0?0x1:0x0);return;}}if(_0x1560c3['return']){if(_0x466ece===_0x2767fc(0x1d0)){const _0xd01c84=_0x538ee9[_0x2767fc(0x1e4)]()||_0x56024f;if(_0x440658)return;_0xd6a489(_0xd01c84),_0x4f335c([{'step':_0x2767fc(0x1d0),'label':_0x2767fc(0x1ed),'value':_0xd01c84}]),_0x131caf(''),_0x539827(''),_0x59504d('app-code');return;}if(_0x466ece===_0x2767fc(0x1c5)){if(_0x440658)return;const _0xa713c4=_0x538ee9['trim']();_0x1e6926(_0xa713c4),_0x4f335c(_0x31b9ba=>[..._0x31b9ba,{'step':_0x2767fc(0x1c5),'label':_0x2767fc(0x1d3),'value':_0xa713c4||_0x2767fc(0x1c6)}]),_0x131caf(''),_0x539827('');if(_0xa713c4){_0x59504d('login-check');const _0x33cac9=await _0x480812();_0x33cac9?_0x59504d(_0x2767fc(0x1d4)):_0x59504d(_0x2767fc(0x1ee));}else{const _0x344f9f=_0x2599e0||_0x21b3f9||_0x2767fc(0x1ea);_0x2f71f8({'projectName':_0x1a2137,'appCode':undefined,'pullApi':![],'env':_0x344f9f}),_0x59504d(_0x2767fc(0x1e0));}return;}if(_0x466ece==='confirm-api-pull'){const _0x27a14e=_0x183452===0x0;_0xb77ea7(_0x27a14e),_0x4f335c(_0x319744=>[..._0x319744,{'step':_0x2767fc(0x1b1),'label':_0x2767fc(0x1e9),'value':_0x27a14e?'是':'否'}]);const _0xfec375=_0x2599e0||_0x21b3f9||'online';_0x2f71f8({'projectName':_0x1a2137,'appCode':_0x1d0cf6,'pullApi':_0x27a14e,'env':_0xfec375}),_0x59504d('creating');return;}if(_0x466ece===_0x2767fc(0x1ee)){const _0x164163=_0x49896f===0x0;if(_0x164163){_0x59504d(_0x2767fc(0x1df));const _0x2bd73a=await _0x34cd30();if(_0x2bd73a)_0x4f335c(_0x22cf0b=>[..._0x22cf0b,{'step':_0x2767fc(0x1d8),'label':'登录状态','value':_0x2767fc(0x1e8)}]),_0x59504d(_0x2767fc(0x1d4));else{_0x4f335c(_0x50775d=>[..._0x50775d,{'step':_0x2767fc(0x1d8),'label':_0x2767fc(0x1d2),'value':_0x2767fc(0x1b7)}]);const _0xf53b85=_0x2599e0||_0x21b3f9||_0x2767fc(0x1ea);_0x2f71f8({'projectName':_0x1a2137,'appCode':_0x1d0cf6,'pullApi':![],'env':_0xf53b85}),_0x59504d('creating');}}else{_0x4f335c(_0x55489d=>[..._0x55489d,{'step':_0x2767fc(0x1d8),'label':_0x2767fc(0x1d2),'value':_0x2767fc(0x1cf)}]);const _0x5095ce=_0x2599e0||_0x21b3f9||_0x2767fc(0x1ea);_0x2f71f8({'projectName':_0x1a2137,'appCode':_0x1d0cf6,'pullApi':![],'env':_0x5095ce}),_0x59504d(_0x2767fc(0x1e0));}return;}}if(_0x1560c3[_0x2767fc(0x1b9)]||_0x1560c3[_0x2767fc(0x1da)]){_0x131caf(_0x1fa920=>{const _0x316153=_0x2767fc,_0x42eaf3=_0x1fa920[_0x316153(0x1ce)](0x0,-0x1);if(_0x466ece===_0x316153(0x1d0)){const {valid:_0x2db9f8,message:_0x2dd540}=_0x28aa6b(_0x42eaf3);_0x539827(_0x2db9f8?'':_0x2dd540||'项目名不合法');}else{if(_0x466ece===_0x316153(0x1c5)){const {valid:_0x182960,message:_0x30b2c8}=_0x25d87d(_0x42eaf3);_0x539827(_0x182960?'':_0x30b2c8||_0x316153(0x1b5));}}return _0x42eaf3;});return;}if([_0x2767fc(0x1e0),_0x2767fc(0x1f1),_0x2767fc(0x1df)]['includes'](_0x466ece))return;if(_0x466ece===_0x2767fc(0x1d4)||_0x466ece===_0x2767fc(0x1ee))return;_0x131caf(_0x2bd87d=>{const _0x4709ca=_0x2767fc,_0x4d98e8=_0x2bd87d+_0x217e04;if(_0x466ece===_0x4709ca(0x1d0)){const {valid:_0x4882e4,message:_0x408960}=_0x28aa6b(_0x4d98e8);_0x539827(_0x4882e4?'':_0x408960||_0x4709ca(0x1e2));}else{if(_0x466ece==='app-code'){const {valid:_0x41e538,message:_0x5479f4}=_0x25d87d(_0x4d98e8);_0x539827(_0x41e538?'':_0x5479f4||_0x4709ca(0x1b5));}}return _0x4d98e8;});}),a32_0x48e955(Box,{'flexDirection':'column','marginTop':0x1,'children':[_0x2cee4a[_0x44738d(0x1c8)]===0x0&&a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':'cyan','children':'*\x20创建新项目'})}),_0x2cee4a[_0x44738d(0x1b8)](_0x289cb6=>a32_0x48e955(Box,{'children':[a32_0x48e955(Text,{'color':'green','children':['√\x20',_0x289cb6[_0x44738d(0x1ca)],':\x20']}),a32_0x40f6d4(Text,{'color':_0x44738d(0x1db),'children':_0x289cb6[_0x44738d(0x1ef)]})]},_0x289cb6['step'])),_0x466ece===_0x44738d(0x1d0)&&a32_0x48e955(a32_0x167a84,{'children':[a32_0x48e955(Box,{'children':[a32_0x40f6d4(Text,{'children':_0x44738d(0x1e6)}),_0x538ee9?a32_0x40f6d4(Text,{'color':_0x44738d(0x1d7),'children':_0x538ee9}):a32_0x40f6d4(Text,{'color':_0x44738d(0x1dd),'children':_0x56024f}),_0x440658&&a32_0x48e955(Text,{'color':_0x44738d(0x1c3),'children':[_0x44738d(0x1bc),_0x440658]})]}),!_0x440658&&!_0x538ee9&&a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':'gray','children':_0x44738d(0x1b3)})})]}),_0x466ece===_0x44738d(0x1c5)&&a32_0x48e955(a32_0x167a84,{'children':[a32_0x48e955(Box,{'children':[a32_0x40f6d4(Text,{'children':'*\x20应用AppCode\x20'}),a32_0x40f6d4(Text,{'color':'gray','children':'[可选]:\x20'}),a32_0x40f6d4(Text,{'color':_0x44738d(0x1d7),'children':_0x538ee9}),_0x440658&&a32_0x48e955(Text,{'color':_0x44738d(0x1c3),'children':[_0x44738d(0x1bc),_0x440658]})]}),!_0x440658&&a32_0x40f6d4(Box,{'children':a32_0x48e955(Text,{'color':_0x44738d(0x1dd),'children':['\x20',_0x44738d(0x1d9)]})})]}),_0x466ece===_0x44738d(0x1f1)&&a32_0x48e955(Box,{'children':[a32_0x40f6d4(Text,{'children':_0x44738d(0x1d6)}),_0x456c2b&&a32_0x40f6d4(Text,{'color':'gray','children':'\x20检查中...'})]}),_0x466ece==='confirm-api-pull'&&a32_0x48e955(a32_0x167a84,{'children':[a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':_0x44738d(0x1d7),'children':_0x44738d(0x1dc)})}),a32_0x40f6d4(Box,{'marginTop':0x1,'children':a32_0x40f6d4(Text,{'children':_0x44738d(0x1cd)})}),a32_0x48e955(Box,{'marginLeft':0x2,'children':[a32_0x48e955(Text,{'color':_0x183452===0x0?_0x44738d(0x1d7):_0x44738d(0x1dd),'children':[_0x183452===0x0?'▶\x20':'\x20\x20','Yes']}),a32_0x40f6d4(Text,{'children':'\x20'}),a32_0x48e955(Text,{'color':_0x183452===0x1?_0x44738d(0x1d7):_0x44738d(0x1dd),'children':[_0x183452===0x1?'▶\x20':'\x20\x20','No']})]}),a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':_0x44738d(0x1dd),'children':_0x44738d(0x1d1)})}),a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':_0x44738d(0x1b4),'children':_0x44738d(0x1be)})})]}),_0x466ece==='login-prompt'&&a32_0x48e955(a32_0x167a84,{'children':[a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':_0x44738d(0x1b4),'children':'!\x20未检测到有效登录'})}),a32_0x40f6d4(Box,{'marginTop':0x1,'children':a32_0x40f6d4(Text,{'children':_0x44738d(0x1c4)})}),a32_0x48e955(Box,{'marginLeft':0x2,'children':[a32_0x48e955(Text,{'color':_0x49896f===0x0?_0x44738d(0x1d7):_0x44738d(0x1dd),'children':[_0x49896f===0x0?'▶\x20':'\x20\x20',_0x44738d(0x1c7)]}),a32_0x40f6d4(Text,{'children':'\x20'}),a32_0x48e955(Text,{'color':_0x49896f===0x1?_0x44738d(0x1d7):_0x44738d(0x1dd),'children':[_0x49896f===0x1?'▶\x20':'\x20\x20','No']})]}),a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':_0x44738d(0x1dd),'children':_0x44738d(0x1d1)})}),a32_0x40f6d4(Box,{'children':a32_0x40f6d4(Text,{'color':_0x44738d(0x1b4),'children':_0x44738d(0x1c0)})})]}),_0x466ece===_0x44738d(0x1df)&&a32_0x48e955(Box,{'children':[a32_0x40f6d4(Text,{'children':_0x44738d(0x1bb)}),_0x45c3da&&a32_0x40f6d4(Text,{'color':'gray','children':_0x44738d(0x1e3)})]})]});}function a32_0x142c(){const _0x51b858=['length','my-app','label','4737245WjazLo','test','*\x20是否要自动拉取\x20API\x20配置?','slice','跳过登录','project-name','\x20\x20使用\x20←→\x20选择,回车确认','登录状态','应用AppCode','confirm-api-pull','6DVxgpk','*\x20正在检查登录状态...','green','login','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','delete','cyan','√\x20检测到有效登录状态','gray','应用AppCode长度不能超过\x20100\x20个字符','login-process','creating','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','项目名不合法','\x20登录中...','trim','leftArrow','*\x20项目名:\x20','725847UcGUDZ','已登录','拉取API配置','online','1242KvDHni','string','项目名','login-prompt','value','5061156eNLfaD','login-check','api-pull','3258241oFCkxK','\x20直接回车确认,或输入自定义名称','yellow','应用AppCode不合法','112956BgYTKi','登录失败','map','backspace','6tNhBkY','*\x20正在登录,请前往浏览器完成登录...','\x20←\x20','9980440xKmUFC','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','env','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','12648xPlmYf','项目名长度不能超过\x2050\x20个字符','red','*\x20是否要先登录以便拉取\x20API\x20配置?','app-code','未设置','Yes'];a32_0x142c=function(){return _0x51b858;};return a32_0x142c();}
|
|
1
|
+
(function(_0x1dc794,_0x112044){const _0x317916=a32_0x2be4,_0x3ac2ae=_0x1dc794();while(!![]){try{const _0x3ca3cf=-parseInt(_0x317916(0x137))/0x1*(parseInt(_0x317916(0x14a))/0x2)+-parseInt(_0x317916(0x117))/0x3+-parseInt(_0x317916(0x150))/0x4+parseInt(_0x317916(0x12b))/0x5+-parseInt(_0x317916(0x120))/0x6+-parseInt(_0x317916(0x145))/0x7*(-parseInt(_0x317916(0x130))/0x8)+parseInt(_0x317916(0x134))/0x9*(parseInt(_0x317916(0x11d))/0xa);if(_0x3ca3cf===_0x112044)break;else _0x3ac2ae['push'](_0x3ac2ae['shift']());}catch(_0x1f6b04){_0x3ac2ae['push'](_0x3ac2ae['shift']());}}}(a32_0x3763,0x636c0));import{jsx as a32_0x500300,jsxs as a32_0x1febb8,Fragment as a32_0x215995}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';function a32_0x3763(){const _0x14dd80=['登录失败','online','2234964SBFdlm','delete','api-pull','*\x20项目名:\x20','column','test','10YbHvvK','creating','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','582810qnnwgE','red','应用AppCode不合法','[可选]:\x20','login-process','已登录','project-name','项目名不合法','跳过登录','login','my-app','1116570cMUGpp','Yes','label','!\x20未检测到有效登录','string','5136VRhrGJ','\x20登录中...','应用AppCode长度不能超过\x20100\x20个字符','backspace','11335914mGADxP','length','*\x20正在检查登录状态...','249rTYzZj','登录状态','√\x20检测到有效登录状态','项目名','return','cyan','trim','confirm-api-pull','app-code','green','*\x20是否要自动拉取\x20API\x20配置?','\x20检查中...','login-prompt','*\x20是否要先登录以便拉取\x20API\x20配置?','7819jtqOVy','\x20\x20使用\x20←→\x20选择,回车确认','\x20←\x20','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','2328nQbpDH','\x20直接回车确认,或输入自定义名称','value','gray','yellow','env','2643132PMxMZv','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','应用AppCode','step','拉取API配置','login-check','slice','includes','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口'];a32_0x3763=function(){return _0x14dd80;};return a32_0x3763();}import{authServer}from'../auth/auth-server.js';function a32_0x2be4(_0x53631b,_0x38bf49){const _0x376331=a32_0x3763();return a32_0x2be4=function(_0x2be41d,_0x55f108){_0x2be41d=_0x2be41d-0x116;let _0x267daf=_0x376331[_0x2be41d];return _0x267daf;},a32_0x2be4(_0x53631b,_0x38bf49);}import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0xfcde){const _0x28bbbf=a32_0x2be4,{onCreate:_0x6e9f8d,env:_0x34af7a}=_0xfcde,[_0x39ec72,_0x2191e8]=useState(_0x28bbbf(0x126)),[_0xe39ab7,_0x103fad]=useState(''),[_0x3b76a2,_0x48b323]=useState(''),[_0x356871,_0x21e417]=useState(''),[_0x3ee369,_0x1c78cb]=useState(''),[_0x47b387,_0x51b3a0]=useState([]),[_0x15f51a,_0x142329]=useState(null),[_0x1fc65f,_0x3bc2a7]=useState(![]),[_0x3ed53d,_0x3cb38e]=useState(![]),[_0x528a11,_0x3ebfc0]=useState(![]),[_0x3fbfb1,_0x527193]=useState(0x0),[_0x15248c,_0x4b9b86]=useState(0x0),_0x2314cf=_0x28bbbf(0x12a),_0x4eae82=readConfig(),_0x2748b6=typeof _0x4eae82[_0x28bbbf(0x14f)]===_0x28bbbf(0x12f)?_0x4eae82[_0x28bbbf(0x14f)]:undefined;function _0xa3b094(_0x458582){const _0x52b868=_0x28bbbf;if(_0x458582[_0x52b868(0x135)]>0x32)return{'valid':![],'message':'项目名长度不能超过\x2050\x20个字符'};const _0x57d914=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x458582?.[_0x52b868(0x13d)]()&&!_0x57d914[_0x52b868(0x11c)](_0x458582))return{'valid':![],'message':_0x52b868(0x149)};return{'valid':!![]};}function _0x416a57(_0x4b9133){const _0x4bab6e=_0x28bbbf;if(!_0x4b9133[_0x4bab6e(0x13d)]())return{'valid':!![]};if(_0x4b9133['length']>0x64)return{'valid':![],'message':_0x4bab6e(0x132)};const _0x4c1adf=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x4c1adf[_0x4bab6e(0x11c)](_0x4b9133))return{'valid':![],'message':_0x4bab6e(0x11f)};return{'valid':!![]};}async function _0x5558b4(){_0x3bc2a7(!![]);try{const _0x584a9a=await getIsSessionValid();return _0x142329(_0x584a9a),_0x584a9a;}catch(_0x1c1f84){return _0x142329(![]),![];}finally{_0x3bc2a7(![]);}}async function _0x3fe4c9(){_0x3cb38e(!![]);try{const _0x16bc61=await authServer({'silent':!![]});return _0x142329(_0x16bc61),_0x16bc61;}catch(_0x56bfb6){return _0x142329(![]),![];}finally{_0x3cb38e(![]);}}return useInput(async(_0x29cea7,_0x1aee79)=>{const _0x5348e3=_0x28bbbf;if(_0x1aee79['leftArrow']||_0x1aee79['rightArrow']){if(_0x39ec72==='confirm-api-pull'){_0x527193(_0x187d79=>_0x187d79===0x0?0x1:0x0);return;}if(_0x39ec72===_0x5348e3(0x143)){_0x4b9b86(_0x145606=>_0x145606===0x0?0x1:0x0);return;}}if(_0x1aee79[_0x5348e3(0x13b)]){if(_0x39ec72===_0x5348e3(0x126)){const _0x56aa62=_0x356871['trim']()||_0x2314cf;if(_0x3ee369)return;_0x103fad(_0x56aa62),_0x51b3a0([{'step':'project-name','label':_0x5348e3(0x13a),'value':_0x56aa62}]),_0x21e417(''),_0x1c78cb(''),_0x2191e8(_0x5348e3(0x13f));return;}if(_0x39ec72==='app-code'){if(_0x3ee369)return;const _0x263e29=_0x356871[_0x5348e3(0x13d)]();_0x48b323(_0x263e29),_0x51b3a0(_0x1152a4=>[..._0x1152a4,{'step':'app-code','label':_0x5348e3(0x152),'value':_0x263e29||'未设置'}]),_0x21e417(''),_0x1c78cb('');if(_0x263e29){_0x2191e8(_0x5348e3(0x155));const _0x271095=await _0x5558b4();_0x271095?_0x2191e8(_0x5348e3(0x13e)):_0x2191e8(_0x5348e3(0x143));}else{const _0x32616b=_0x34af7a||_0x2748b6||'online';_0x6e9f8d({'projectName':_0xe39ab7,'appCode':undefined,'pullApi':![],'env':_0x32616b}),_0x2191e8('creating');}return;}if(_0x39ec72===_0x5348e3(0x13e)){const _0x15aa17=_0x3fbfb1===0x0;_0x3ebfc0(_0x15aa17),_0x51b3a0(_0x54483c=>[..._0x54483c,{'step':_0x5348e3(0x119),'label':_0x5348e3(0x154),'value':_0x15aa17?'是':'否'}]);const _0x583856=_0x34af7a||_0x2748b6||'online';_0x6e9f8d({'projectName':_0xe39ab7,'appCode':_0x3b76a2,'pullApi':_0x15aa17,'env':_0x583856}),_0x2191e8(_0x5348e3(0x11e));return;}if(_0x39ec72===_0x5348e3(0x143)){const _0x3bc47e=_0x15248c===0x0;if(_0x3bc47e){_0x2191e8(_0x5348e3(0x124));const _0x573b72=await _0x3fe4c9();if(_0x573b72)_0x51b3a0(_0x39b075=>[..._0x39b075,{'step':_0x5348e3(0x129),'label':_0x5348e3(0x138),'value':_0x5348e3(0x125)}]),_0x2191e8(_0x5348e3(0x13e));else{_0x51b3a0(_0x5d6543=>[..._0x5d6543,{'step':_0x5348e3(0x129),'label':_0x5348e3(0x138),'value':_0x5348e3(0x159)}]);const _0xf08a18=_0x34af7a||_0x2748b6||'online';_0x6e9f8d({'projectName':_0xe39ab7,'appCode':_0x3b76a2,'pullApi':![],'env':_0xf08a18}),_0x2191e8('creating');}}else{_0x51b3a0(_0x35dc6b=>[..._0x35dc6b,{'step':'login','label':'登录状态','value':_0x5348e3(0x128)}]);const _0x518caf=_0x34af7a||_0x2748b6||_0x5348e3(0x116);_0x6e9f8d({'projectName':_0xe39ab7,'appCode':_0x3b76a2,'pullApi':![],'env':_0x518caf}),_0x2191e8(_0x5348e3(0x11e));}return;}}if(_0x1aee79[_0x5348e3(0x133)]||_0x1aee79[_0x5348e3(0x118)]){_0x21e417(_0x2b62fe=>{const _0x1dbbcd=_0x5348e3,_0x2fb834=_0x2b62fe[_0x1dbbcd(0x156)](0x0,-0x1);if(_0x39ec72===_0x1dbbcd(0x126)){const {valid:_0x182895,message:_0x5e9076}=_0xa3b094(_0x2fb834);_0x1c78cb(_0x182895?'':_0x5e9076||_0x1dbbcd(0x127));}else{if(_0x39ec72===_0x1dbbcd(0x13f)){const {valid:_0x5743eb,message:_0x4ec837}=_0x416a57(_0x2fb834);_0x1c78cb(_0x5743eb?'':_0x4ec837||'应用AppCode不合法');}}return _0x2fb834;});return;}if(['creating','login-check','login-process'][_0x5348e3(0x157)](_0x39ec72))return;if(_0x39ec72===_0x5348e3(0x13e)||_0x39ec72==='login-prompt')return;_0x21e417(_0x4d2192=>{const _0x11ec94=_0x5348e3,_0x2c2d3b=_0x4d2192+_0x29cea7;if(_0x39ec72==='project-name'){const {valid:_0x3b47d5,message:_0x34452a}=_0xa3b094(_0x2c2d3b);_0x1c78cb(_0x3b47d5?'':_0x34452a||'项目名不合法');}else{if(_0x39ec72===_0x11ec94(0x13f)){const {valid:_0x3d76bf,message:_0x32e728}=_0x416a57(_0x2c2d3b);_0x1c78cb(_0x3d76bf?'':_0x32e728||_0x11ec94(0x122));}}return _0x2c2d3b;});}),a32_0x1febb8(Box,{'flexDirection':_0x28bbbf(0x11b),'marginTop':0x1,'children':[_0x47b387[_0x28bbbf(0x135)]===0x0&&a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':_0x28bbbf(0x13c),'children':'*\x20创建新项目'})}),_0x47b387['map'](_0x1cb5ac=>a32_0x1febb8(Box,{'children':[a32_0x1febb8(Text,{'color':_0x28bbbf(0x140),'children':['√\x20',_0x1cb5ac[_0x28bbbf(0x12d)],':\x20']}),a32_0x500300(Text,{'color':_0x28bbbf(0x13c),'children':_0x1cb5ac[_0x28bbbf(0x14c)]})]},_0x1cb5ac[_0x28bbbf(0x153)])),_0x39ec72===_0x28bbbf(0x126)&&a32_0x1febb8(a32_0x215995,{'children':[a32_0x1febb8(Box,{'children':[a32_0x500300(Text,{'children':_0x28bbbf(0x11a)}),_0x356871?a32_0x500300(Text,{'color':_0x28bbbf(0x140),'children':_0x356871}):a32_0x500300(Text,{'color':_0x28bbbf(0x14d),'children':_0x2314cf}),_0x3ee369&&a32_0x1febb8(Text,{'color':_0x28bbbf(0x121),'children':[_0x28bbbf(0x147),_0x3ee369]})]}),!_0x3ee369&&!_0x356871&&a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':'gray','children':_0x28bbbf(0x14b)})})]}),_0x39ec72===_0x28bbbf(0x13f)&&a32_0x1febb8(a32_0x215995,{'children':[a32_0x1febb8(Box,{'children':[a32_0x500300(Text,{'children':'*\x20应用AppCode\x20'}),a32_0x500300(Text,{'color':_0x28bbbf(0x14d),'children':_0x28bbbf(0x123)}),a32_0x500300(Text,{'color':_0x28bbbf(0x140),'children':_0x356871}),_0x3ee369&&a32_0x1febb8(Text,{'color':'red','children':[_0x28bbbf(0x147),_0x3ee369]})]}),!_0x3ee369&&a32_0x500300(Box,{'children':a32_0x1febb8(Text,{'color':_0x28bbbf(0x14d),'children':['\x20',_0x28bbbf(0x148)]})})]}),_0x39ec72===_0x28bbbf(0x155)&&a32_0x1febb8(Box,{'children':[a32_0x500300(Text,{'children':_0x28bbbf(0x136)}),_0x1fc65f&&a32_0x500300(Text,{'color':'gray','children':_0x28bbbf(0x142)})]}),_0x39ec72===_0x28bbbf(0x13e)&&a32_0x1febb8(a32_0x215995,{'children':[a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':_0x28bbbf(0x140),'children':_0x28bbbf(0x139)})}),a32_0x500300(Box,{'marginTop':0x1,'children':a32_0x500300(Text,{'children':_0x28bbbf(0x141)})}),a32_0x1febb8(Box,{'marginLeft':0x2,'children':[a32_0x1febb8(Text,{'color':_0x3fbfb1===0x0?_0x28bbbf(0x140):_0x28bbbf(0x14d),'children':[_0x3fbfb1===0x0?'▶\x20':'\x20\x20','Yes']}),a32_0x500300(Text,{'children':'\x20'}),a32_0x1febb8(Text,{'color':_0x3fbfb1===0x1?'green':_0x28bbbf(0x14d),'children':[_0x3fbfb1===0x1?'▶\x20':'\x20\x20','No']})]}),a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':_0x28bbbf(0x14d),'children':_0x28bbbf(0x146)})}),a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':'yellow','children':_0x28bbbf(0x158)})})]}),_0x39ec72===_0x28bbbf(0x143)&&a32_0x1febb8(a32_0x215995,{'children':[a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':_0x28bbbf(0x14e),'children':_0x28bbbf(0x12e)})}),a32_0x500300(Box,{'marginTop':0x1,'children':a32_0x500300(Text,{'children':_0x28bbbf(0x144)})}),a32_0x1febb8(Box,{'marginLeft':0x2,'children':[a32_0x1febb8(Text,{'color':_0x15248c===0x0?_0x28bbbf(0x140):_0x28bbbf(0x14d),'children':[_0x15248c===0x0?'▶\x20':'\x20\x20',_0x28bbbf(0x12c)]}),a32_0x500300(Text,{'children':'\x20'}),a32_0x1febb8(Text,{'color':_0x15248c===0x1?'green':'gray','children':[_0x15248c===0x1?'▶\x20':'\x20\x20','No']})]}),a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':_0x28bbbf(0x14d),'children':_0x28bbbf(0x146)})}),a32_0x500300(Box,{'children':a32_0x500300(Text,{'color':_0x28bbbf(0x14e),'children':_0x28bbbf(0x151)})})]}),_0x39ec72===_0x28bbbf(0x124)&&a32_0x1febb8(Box,{'children':[a32_0x500300(Text,{'children':'*\x20正在登录,请前往浏览器完成登录...'}),_0x3ed53d&&a32_0x500300(Text,{'color':_0x28bbbf(0x14d),'children':_0x28bbbf(0x131)})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x417a00,_0x100b47){const _0x4d2671=a33_0x5960,_0x5420a1=_0x417a00();while(!![]){try{const _0x3b42c2=-parseInt(_0x4d2671(0x188))/0x1+-parseInt(_0x4d2671(0x18d))/0x2*(-parseInt(_0x4d2671(0x184))/0x3)+-parseInt(_0x4d2671(0x183))/0x4+parseInt(_0x4d2671(0x185))/0x5+parseInt(_0x4d2671(0x189))/0x6+parseInt(_0x4d2671(0x18c))/0x7*(parseInt(_0x4d2671(0x187))/0x8)+-parseInt(_0x4d2671(0x186))/0x9;if(_0x3b42c2===_0x100b47)break;else _0x5420a1['push'](_0x5420a1['shift']());}catch(_0x1add90){_0x5420a1['push'](_0x5420a1['shift']());}}}(a33_0x5f54,0xa5948));function a33_0x5960(_0x435040,_0x116b93){const _0x5f5498=a33_0x5f54();return a33_0x5960=function(_0x5960ae,_0x2c9ca4){_0x5960ae=_0x5960ae-0x183;let _0x5dce34=_0x5f5498[_0x5960ae];return _0x5dce34;},a33_0x5960(_0x435040,_0x116b93);}function a33_0x5f54(){const _0x2bf94b=['178fWLCoZ','1363776pWgPTA','40344wOfbFj','3862855UyYRPm','6311070SQlQFh','530776uEJBjH','789470TnbgRW','1252092WOGDot','toFixed','replace','35ppUYwK'];a33_0x5f54=function(){return _0x2bf94b;};return a33_0x5f54();}export function formatElapsed(_0x14f705){const _0x3d2934=a33_0x5960,_0xc7b0fc=Date['now']()-_0x14f705;if(_0xc7b0fc<0x3e8)return _0xc7b0fc+'ms';const _0x3aa656=(_0xc7b0fc/0x3e8)[_0x3d2934(0x18a)](0x2),_0x45a09f=_0x3aa656[_0x3d2934(0x18b)](/\.?0+$/u,'');return _0x45a09f+'s';}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x48fc96,_0x268c19){const _0x5301bc=a34_0xea0e,_0xa973d2=_0x48fc96();while(!![]){try{const _0x4e31fa=-parseInt(_0x5301bc(0x1fc))/0x1+-parseInt(_0x5301bc(0x206))/0x2*(parseInt(_0x5301bc(0x24a))/0x3)+parseInt(_0x5301bc(0x1f6))/0x4+-parseInt(_0x5301bc(0x233))/0x5+parseInt(_0x5301bc(0x216))/0x6*(-parseInt(_0x5301bc(0x21d))/0x7)+parseInt(_0x5301bc(0x234))/0x8+parseInt(_0x5301bc(0x227))/0x9;if(_0x4e31fa===_0x268c19)break;else _0xa973d2['push'](_0xa973d2['shift']());}catch(_0x28dd4a){_0xa973d2['push'](_0xa973d2['shift']());}}}(a34_0x5e8f,0xb7372));import{jsx as a34_0x32fa6e,Fragment as a34_0x3e4173,jsxs as a34_0x5563e9}from'react/jsx-runtime';function a34_0xea0e(_0x336889,_0x5b4fe0){const _0x5e8f9c=a34_0x5e8f();return a34_0xea0e=function(_0xea0e10,_0x3c96da){_0xea0e10=_0xea0e10-0x1f2;let _0x3a4578=_0x5e8f9c[_0xea0e10];return _0x3a4578;},a34_0xea0e(_0x336889,_0x5b4fe0);}import a34_0xc9fe69 from'node:path';import a34_0xf6a424 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';function a34_0x5e8f(){const _0x40bee3=['error','cd\x20','×\x20无法在当前目录创建项目,请检查目录权限','package.json','\x20√\x20','cwd','项目创建完成:\x20','*\x20正在拉取\x20API\x20配置...','projectCode','stringify',',\x20description=','\x20配置应用AppCode:\x20','message','string','info','×\x20项目名不能为空','white','21tHTqWu','\x20&&\x20lovrabet\x20start','\x20已存在,请使用其他项目名','cyan','W_OK','√\x20package.json\x20已更新:\x20name=','开始创建项目:\x20','column','5234088ZZwZyC','配置应用AppCode:\x20','url','📁\x20项目名称:\x20','lovrabet\x20config\x20set\x20appcode\x20[app-code]','更新\x20package.json\x20name\x20和\x20description\x20字段','232722IIrMqx','\x20|\x20应用AppCode:\x20','create','*\x20清理失败的项目目录:\x20','已自动拉取\x20✓','pullApi','toLocaleString','1.0.0','resolve','更新\x20package.json\x20失败:\x20','181402kbQeRF','utf8','accessSync','×\x20项目目录\x20','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','doTask','success','warn','name','trim','env','projectName','yellow','.lovrabetrc','\x20创建配置文件','version','1818CMpvzR','📦\x20API配置:\x20','repeat','√\x20配置文件已创建,应用AppCode:\x20','existsSync','parse','setLogPath','15533zXybgS','writeFileSync','🚀\x20接下来可以:','green','join','appCode','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','项目名称:\x20','../..','readFileSync','9191628CXplul','log','拉取API配置:\x20','启动项目:\x20','rmSync','gray','*\x20正在为项目\x20','test','description','需手动拉取','*\x20配置文件路径:\x20','dirname','1300395ciqbLo','1765608dkijVg','lovrabet\x20api\x20pull','2.\x20','1.\x20','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置'];a34_0x5e8f=function(){return _0x40bee3;};return a34_0x5e8f();}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(_0x4c5024){const _0x19ee52=a34_0xea0e,[_0xc115bf,_0x2b8984]=useState(![]),[_0x4c2ed1,_0x58a43f]=useState(![]),[_0x242982,_0x179f71]=useState(null),_0x114491=useCopyProjectTemplate(),_0x1daefb=useInstallDependencies(),_0x4478f5=useFormatCode(),_0x1517f3=async _0xb5f2b6=>{const _0x204348=a34_0xea0e;if(!_0xb5f2b6[_0x204348(0x211)]||_0xb5f2b6[_0x204348(0x211)][_0x204348(0x20f)]()===''){console[_0x204348(0x239)](_0x204348(0x248));return;}const _0x36b904=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x36b904[_0x204348(0x22e)](_0xb5f2b6[_0x204348(0x211)])){console[_0x204348(0x239)](_0x204348(0x20a));return;}if(_0xb5f2b6[_0x204348(0x211)]['length']>0x64){console[_0x204348(0x239)]('×\x20项目名过长,最多支持\x20100\x20个字符');return;}const _0x59b74c=a34_0xc9fe69['resolve'](process[_0x204348(0x23e)](),_0xb5f2b6[_0x204348(0x211)]);if(a34_0xf6a424[_0x204348(0x21a)](_0x59b74c)){console[_0x204348(0x239)](_0x204348(0x209)+_0xb5f2b6[_0x204348(0x211)]+_0x204348(0x24c));return;}try{const _0x34f235=a34_0xc9fe69[_0x204348(0x232)](_0x59b74c);a34_0xf6a424[_0x204348(0x208)](_0x34f235,a34_0xf6a424['constants'][_0x204348(0x1f2)]);}catch(_0x45ac47){console[_0x204348(0x239)](_0x204348(0x23b));return;}_0x179f71(_0xb5f2b6),_0x2b8984(!![]),logger[_0x204348(0x21c)](_0x59b74c),logger[_0x204348(0x247)]('create',_0x204348(0x1f4)+_0xb5f2b6[_0x204348(0x211)],{'projectDir':_0x59b74c,'appCode':_0xb5f2b6[_0x204348(0x222)]});try{await _0x114491[_0x204348(0x20b)](_0xb5f2b6[_0x204348(0x211)]),await _0xff116(_0xb5f2b6[_0x204348(0x211)]),await _0x1daefb[_0x204348(0x20b)](_0xb5f2b6[_0x204348(0x211)]),await _0x4478f5[_0x204348(0x20b)](_0xb5f2b6[_0x204348(0x211)]),await _0x33a8bf(_0xb5f2b6[_0x204348(0x211)],_0xb5f2b6['appCode']||'',_0xb5f2b6['env']);if(_0xb5f2b6[_0x204348(0x201)]&&_0xb5f2b6[_0x204348(0x222)]){console[_0x204348(0x228)](_0x204348(0x240));try{const _0x39b553=await pullApiSilent(_0xb5f2b6[_0x204348(0x222)],undefined,_0x59b74c,_0xb5f2b6[_0x204348(0x210)]);_0x39b553?(console[_0x204348(0x228)]('√\x20API\x20配置拉取完成'),logger[_0x204348(0x247)](_0x204348(0x1fe),'API\x20配置拉取成功:\x20'+_0xb5f2b6[_0x204348(0x222)],{'projectDir':_0x59b74c,'appCode':_0xb5f2b6[_0x204348(0x222)],'env':_0xb5f2b6['env']})):(console[_0x204348(0x228)]('!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x204348(0x20d)](_0x204348(0x1fe),'API\x20配置拉取失败:\x20'+_0xb5f2b6[_0x204348(0x222)],{'projectDir':_0x59b74c,'appCode':_0xb5f2b6[_0x204348(0x222)],'env':_0xb5f2b6[_0x204348(0x210)]}));}catch(_0x184e31){console[_0x204348(0x228)](_0x204348(0x223)),logger[_0x204348(0x20d)](_0x204348(0x1fe),'API\x20配置拉取异常:\x20'+_0xb5f2b6['appCode'],{'projectDir':_0x59b74c,'appCode':_0xb5f2b6[_0x204348(0x222)],'env':_0xb5f2b6['env'],'error':_0x184e31 instanceof Error?_0x184e31[_0x204348(0x245)]:String(_0x184e31)});}}logger[_0x204348(0x20c)](_0x204348(0x1fe),_0x204348(0x23f)+_0xb5f2b6['projectName']),_0x58a43f(!![]),_0x2b8984(![]);}catch(_0x4940d9){logger[_0x204348(0x239)](_0x204348(0x1fe),'项目创建失败:\x20'+_0xb5f2b6[_0x204348(0x211)],{'error':_0x4940d9 instanceof Error?_0x4940d9[_0x204348(0x245)]:String(_0x4940d9)});try{a34_0xf6a424[_0x204348(0x21a)](_0x59b74c)&&(console[_0x204348(0x228)](_0x204348(0x1ff)+_0x59b74c),a34_0xf6a424[_0x204348(0x22b)](_0x59b74c,{'recursive':!![],'force':!![]}));}catch(_0x418d65){logger[_0x204348(0x20d)]('create','清理项目目录失败:\x20'+_0x59b74c,{'error':_0x418d65 instanceof Error?_0x418d65[_0x204348(0x245)]:String(_0x418d65)});}_0x2b8984(![]),console[_0x204348(0x239)]('×\x20项目创建失败:\x20'+(_0x4940d9 instanceof Error?_0x4940d9[_0x204348(0x245)]:String(_0x4940d9)));}},_0x14ff4a=async _0x9d5c31=>{await _0x1517f3({'projectName':_0x9d5c31,'env':_0x4c5024['env']});},_0xff116=async _0x47f6ad=>{const _0x548a13=a34_0xea0e,_0x882b76=a34_0xc9fe69[_0x548a13(0x204)](process[_0x548a13(0x23e)](),_0x47f6ad),_0x27a2e1=a34_0xc9fe69[_0x548a13(0x221)](_0x882b76,_0x548a13(0x23c));try{console[_0x548a13(0x228)]('*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段');const _0x1802aa=fileURLToPath(import.meta[_0x548a13(0x1f8)]),_0xddd894=a34_0xc9fe69[_0x548a13(0x204)](a34_0xc9fe69[_0x548a13(0x232)](_0x1802aa),_0x548a13(0x225)),_0x7b9b60=a34_0xc9fe69[_0x548a13(0x221)](_0xddd894,_0x548a13(0x23c));let _0x2fd61a='1.0.0';try{const _0x5cf7f6=JSON['parse'](a34_0xf6a424[_0x548a13(0x226)](_0x7b9b60,_0x548a13(0x207)));_0x2fd61a=_0x5cf7f6[_0x548a13(0x215)]||_0x548a13(0x203);}catch(_0xa6544b){}const _0x3ea1c0=a34_0xf6a424['readFileSync'](_0x27a2e1,_0x548a13(0x207)),_0x3591d2=JSON['parse'](_0x3ea1c0);_0x3591d2[_0x548a13(0x20e)]=_0x47f6ad,_0x3591d2[_0x548a13(0x22f)]=_0x47f6ad+'\x20Generated\x20by\x20lovrabet\x20cli\x20'+_0x2fd61a,a34_0xf6a424[_0x548a13(0x21e)](_0x27a2e1,JSON[_0x548a13(0x242)](_0x3591d2,null,0x2)+'\x0a',_0x548a13(0x207)),console[_0x548a13(0x228)](_0x548a13(0x1f3)+_0x47f6ad+_0x548a13(0x243)+_0x3591d2['description']),logger[_0x548a13(0x247)](_0x548a13(0x1fe),_0x548a13(0x1fb),{'projectName':_0x47f6ad,'description':_0x3591d2[_0x548a13(0x22f)],'cliVersion':_0x2fd61a,'packageJsonPath':_0x548a13(0x23c)});}catch(_0x34e018){logger[_0x548a13(0x239)](_0x548a13(0x1fe),_0x548a13(0x205)+_0x47f6ad,{'projectName':_0x47f6ad,'error':_0x34e018 instanceof Error?_0x34e018[_0x548a13(0x245)]:String(_0x34e018)});throw _0x34e018;}},_0x33a8bf=async(_0x4eb648,_0x37d337,_0x57cc45)=>{const _0x34d31b=a34_0xea0e,_0xa6d911=a34_0xc9fe69[_0x34d31b(0x204)](process[_0x34d31b(0x23e)](),_0x4eb648),_0x22b096=a34_0xc9fe69[_0x34d31b(0x221)](_0xa6d911,_0x34d31b(0x213));try{_0x37d337?console[_0x34d31b(0x228)]('*\x20正在为项目\x20'+_0x4eb648+_0x34d31b(0x244)+_0x37d337):console['log'](_0x34d31b(0x22d)+_0x4eb648+_0x34d31b(0x214));console[_0x34d31b(0x228)](_0x34d31b(0x231)+_0x22b096);const _0x15cfe0=fileURLToPath(import.meta[_0x34d31b(0x1f8)]),_0x97f925=a34_0xc9fe69[_0x34d31b(0x204)](a34_0xc9fe69[_0x34d31b(0x232)](_0x15cfe0),_0x34d31b(0x225)),_0x456ce3=a34_0xc9fe69[_0x34d31b(0x221)](_0x97f925,_0x34d31b(0x23c));let _0x56034a=_0x34d31b(0x203);try{const _0x303661=JSON[_0x34d31b(0x21b)](a34_0xf6a424[_0x34d31b(0x226)](_0x456ce3,_0x34d31b(0x207)));_0x56034a=_0x303661[_0x34d31b(0x215)]||'1.0.0';}catch(_0x3ac041){}const _0x3fd9c9=readConfig(),_0x386396=typeof _0x3fd9c9['env']===_0x34d31b(0x246)?_0x3fd9c9['env']:undefined,{app:_0x1798fb,appcode:_0x33b87e,..._0x3ed767}=_0x3fd9c9,_0x59a94b={..._0x3ed767,'appcode':_0x37d337||'','env':_0x57cc45||_0x386396||'online','createdAt':new Date()[_0x34d31b(0x202)](),'version':_0x56034a};a34_0xf6a424[_0x34d31b(0x21e)](_0x22b096,JSON['stringify'](_0x59a94b,null,0x2),'utf8'),_0x37d337?console[_0x34d31b(0x228)](_0x34d31b(0x219)+_0x37d337):console[_0x34d31b(0x228)](_0x34d31b(0x238)),logger[_0x34d31b(0x247)]('create',_0x34d31b(0x1f7)+_0x37d337,{'projectName':_0x4eb648,'configFile':_0x34d31b(0x213)});}catch(_0x4902a3){logger[_0x34d31b(0x239)]('create','配置应用AppCode失败:\x20'+_0x37d337,{'projectName':_0x4eb648,'error':_0x4902a3 instanceof Error?_0x4902a3[_0x34d31b(0x245)]:String(_0x4902a3)});}};useEffect(()=>{const _0x27e927=a34_0xea0e;_0x4c5024[_0x27e927(0x241)]&&_0x14ff4a(_0x4c5024[_0x27e927(0x241)]);},[_0x4c5024[_0x19ee52(0x241)]]);if(!_0xc115bf&&!_0x4c2ed1&&!_0x4c5024[_0x19ee52(0x241)])return a34_0x32fa6e(EnhancedGuidedCreate,{'onCreate':_0x1517f3,'env':_0x4c5024['env']});if(_0xc115bf)return a34_0x5563e9(a34_0x3e4173,{'children':[a34_0x5563e9(Box,{'marginTop':0x1,'children':[a34_0x32fa6e(Box,{'width':'1'}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'children':'\x20√\x20'}),a34_0x32fa6e(Text,{'children':'项目名称:\x20'}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'children':_0x242982?.[_0x19ee52(0x211)]}),_0x242982?.[_0x19ee52(0x222)]&&a34_0x5563e9(a34_0x3e4173,{'children':[a34_0x32fa6e(Text,{'children':_0x19ee52(0x1fd)}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'children':_0x242982[_0x19ee52(0x222)]})]})]}),a34_0x32fa6e(TaskRunning,{..._0x114491}),a34_0x32fa6e(TaskRunning,{..._0x1daefb}),a34_0x32fa6e(TaskRunning,{..._0x4478f5})]});if(_0x4c2ed1)return a34_0x5563e9(a34_0x3e4173,{'children':[a34_0x5563e9(Box,{'marginTop':0x1,'children':[a34_0x32fa6e(Box,{'width':'1'}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'children':_0x19ee52(0x23d)}),a34_0x32fa6e(Text,{'children':_0x19ee52(0x224)}),a34_0x32fa6e(Text,{'color':'green','children':_0x242982?.[_0x19ee52(0x211)]}),_0x242982?.[_0x19ee52(0x222)]&&a34_0x5563e9(a34_0x3e4173,{'children':[a34_0x32fa6e(Text,{'children':_0x19ee52(0x1fd)}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'children':_0x242982[_0x19ee52(0x222)]})]})]}),a34_0x32fa6e(TaskFinished,{..._0x114491}),a34_0x32fa6e(TaskFinished,{..._0x1daefb}),a34_0x32fa6e(TaskFinished,{..._0x4478f5}),a34_0x32fa6e(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'children':'─'[_0x19ee52(0x218)](0x3c)})}),a34_0x32fa6e(Box,{'children':a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'bold':!![],'children':'🎉\x20项目创建成功!'})}),a34_0x5563e9(Box,{'marginTop':0x1,'flexDirection':_0x19ee52(0x1f5),'children':[a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':'cyan','children':_0x19ee52(0x1f9)}),a34_0x32fa6e(Text,{'color':'white','bold':!![],'children':_0x242982?.[_0x19ee52(0x211)]})]}),_0x242982?.[_0x19ee52(0x222)]&&a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':'cyan','children':'🔗\x20应用AppCode:\x20'}),a34_0x32fa6e(Text,{'color':'white','bold':!![],'children':_0x242982[_0x19ee52(0x222)]})]}),a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'children':_0x19ee52(0x217)}),_0x242982?.[_0x19ee52(0x201)]?a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'bold':!![],'children':_0x19ee52(0x200)}):_0x242982?.['appCode']?a34_0x32fa6e(Text,{'color':_0x19ee52(0x212),'bold':!![],'children':_0x19ee52(0x230)}):a34_0x32fa6e(Text,{'color':'gray','bold':!![],'children':'未配置'})]})]}),a34_0x32fa6e(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'bold':!![],'children':_0x19ee52(0x21f)})}),a34_0x5563e9(Box,{'marginLeft':0x2,'flexDirection':_0x19ee52(0x1f5),'children':[a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':'green','children':_0x19ee52(0x237)}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x249),'children':_0x19ee52(0x22a)}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'bold':!![],'children':_0x19ee52(0x23a)+_0x242982?.[_0x19ee52(0x211)]+_0x19ee52(0x24b)})]}),_0x242982?.['appCode']&&!_0x242982?.[_0x19ee52(0x201)]&&a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':'yellow','children':_0x19ee52(0x236)}),a34_0x32fa6e(Text,{'color':'white','children':_0x19ee52(0x229)}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'bold':!![],'children':_0x19ee52(0x235)})]}),!_0x242982?.[_0x19ee52(0x222)]&&a34_0x5563e9(a34_0x3e4173,{'children':[a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':_0x19ee52(0x22c),'children':_0x19ee52(0x236)}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x249),'children':'配置AppCode:\x20'}),a34_0x32fa6e(Text,{'color':_0x19ee52(0x24d),'bold':!![],'children':_0x19ee52(0x1fa)})]}),a34_0x5563e9(Box,{'children':[a34_0x32fa6e(Text,{'color':_0x19ee52(0x22c),'children':'3.\x20'}),a34_0x32fa6e(Text,{'color':'white','children':_0x19ee52(0x229)}),a34_0x32fa6e(Text,{'color':'cyan','bold':!![],'children':'lovrabet\x20api\x20pull\x20--appcode\x20[app-code]'})]})]})]}),a34_0x32fa6e(Box,{'marginTop':0x1,'children':a34_0x32fa6e(Text,{'color':_0x19ee52(0x220),'children':'─'[_0x19ee52(0x218)](0x3c)})})]});return null;}
|
|
1
|
+
(function(_0x3a9b61,_0x13ee8b){const _0x58e31f=a34_0x3c12,_0xc28b24=_0x3a9b61();while(!![]){try{const _0x17769a=parseInt(_0x58e31f(0x83))/0x1+-parseInt(_0x58e31f(0x92))/0x2+parseInt(_0x58e31f(0xa8))/0x3+-parseInt(_0x58e31f(0x82))/0x4+parseInt(_0x58e31f(0xc4))/0x5+parseInt(_0x58e31f(0xd3))/0x6+-parseInt(_0x58e31f(0x97))/0x7;if(_0x17769a===_0x13ee8b)break;else _0xc28b24['push'](_0xc28b24['shift']());}catch(_0x2a1ca7){_0xc28b24['push'](_0xc28b24['shift']());}}}(a34_0x272c,0xe53b8));function a34_0x3c12(_0x3855a4,_0x2befeb){const _0x272c86=a34_0x272c();return a34_0x3c12=function(_0x3c12f0,_0x2ab755){_0x3c12f0=_0x3c12f0-0x82;let _0x2efea9=_0x272c86[_0x3c12f0];return _0x2efea9;},a34_0x3c12(_0x3855a4,_0x2befeb);}import{jsx as a34_0x4ea556,Fragment as a34_0x47651b,jsxs as a34_0x2be763}from'react/jsx-runtime';import a34_0x17f8bf from'node:path';import a34_0x243c10 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';function a34_0x272c(){const _0x49aeaa=['!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','*\x20配置文件路径:\x20','2.\x20','length','error','create','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','4756836SnMjWo','1.0.0','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','\x20创建配置文件','gray','开始创建项目:\x20','*\x20正在为项目\x20','🎉\x20项目创建成功!','warn','5050668yqkIJy','246840pjCEvg','需手动拉取','*\x20清理失败的项目目录:\x20',',\x20description=','resolve','更新\x20package.json\x20失败:\x20','rmSync','name','message','version','项目名称:\x20','项目创建完成:\x20','appCode','cyan','配置应用AppCode:\x20','2030712QGgnTK','\x20|\x20应用AppCode:\x20','pullApi','projectCode','配置应用AppCode失败:\x20','3230283eCFsge','🚀\x20接下来可以:','setLogPath','\x20Generated\x20by\x20lovrabet\x20cli\x20','string','online','log','info','url','×\x20无法在当前目录创建项目,请检查目录权限','description','projectName','未配置','启动项目:\x20','📦\x20API配置:\x20','\x20√\x20','package.json','3030354oMnmJe','更新\x20package.json\x20name\x20和\x20description\x20字段','parse','API\x20配置拉取成功:\x20','cwd','column','√\x20API\x20配置拉取完成','√\x20配置文件已创建,应用AppCode:\x20','../..','📁\x20项目名称:\x20','accessSync','1.\x20','green','repeat','env','writeFileSync','API\x20配置拉取异常:\x20','W_OK','*\x20正在拉取\x20API\x20配置...','utf8','清理项目目录失败:\x20','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','existsSync','join','dirname','stringify','项目创建失败:\x20','拉取API配置:\x20','8143320bNZSYB','API\x20配置拉取失败:\x20','doTask','constants','×\x20项目名过长,最多支持\x20100\x20个字符','readFileSync','white','cd\x20'];a34_0x272c=function(){return _0x49aeaa;};return a34_0x272c();}import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x5c75ee){const _0x48bf82=a34_0x3c12,[_0x1c4ca3,_0x49ee48]=useState(![]),[_0x197f10,_0x58358d]=useState(![]),[_0x52cc08,_0x26ad68]=useState(null),_0x32307d=useCopyProjectTemplate(),_0x1d2568=useInstallDependencies(),_0x35bf32=useFormatCode(),_0x5f26ea=async _0x651f1f=>{const _0x32da1f=a34_0x3c12;if(!_0x651f1f[_0x32da1f(0xa2)]||_0x651f1f[_0x32da1f(0xa2)]['trim']()===''){console[_0x32da1f(0xd0)]('×\x20项目名不能为空');return;}const _0x51389c=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x51389c['test'](_0x651f1f[_0x32da1f(0xa2)])){console[_0x32da1f(0xd0)]('×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符');return;}if(_0x651f1f['projectName'][_0x32da1f(0xcf)]>0x64){console[_0x32da1f(0xd0)](_0x32da1f(0xc8));return;}const _0x41c6e1=a34_0x17f8bf[_0x32da1f(0x87)](process[_0x32da1f(0xac)](),_0x651f1f[_0x32da1f(0xa2)]);if(a34_0x243c10[_0x32da1f(0xbe)](_0x41c6e1)){console[_0x32da1f(0xd0)]('×\x20项目目录\x20'+_0x651f1f[_0x32da1f(0xa2)]+'\x20已存在,请使用其他项目名');return;}try{const _0x1823a6=a34_0x17f8bf[_0x32da1f(0xc0)](_0x41c6e1);a34_0x243c10[_0x32da1f(0xb2)](_0x1823a6,a34_0x243c10[_0x32da1f(0xc7)][_0x32da1f(0xb9)]);}catch(_0x2268d3){console['error'](_0x32da1f(0xa0));return;}_0x26ad68(_0x651f1f),_0x49ee48(!![]),logger[_0x32da1f(0x99)](_0x41c6e1),logger[_0x32da1f(0x9e)](_0x32da1f(0xd1),_0x32da1f(0xd8)+_0x651f1f['projectName'],{'projectDir':_0x41c6e1,'appCode':_0x651f1f[_0x32da1f(0x8f)]});try{await _0x32307d[_0x32da1f(0xc6)](_0x651f1f[_0x32da1f(0xa2)]),await _0x12f7b1(_0x651f1f['projectName']),await _0x1d2568[_0x32da1f(0xc6)](_0x651f1f['projectName']),await _0x35bf32[_0x32da1f(0xc6)](_0x651f1f[_0x32da1f(0xa2)]),await _0x401260(_0x651f1f[_0x32da1f(0xa2)],_0x651f1f[_0x32da1f(0x8f)]||'',_0x651f1f[_0x32da1f(0xb6)]);if(_0x651f1f[_0x32da1f(0x94)]&&_0x651f1f['appCode']){console[_0x32da1f(0x9d)](_0x32da1f(0xba));try{const _0x26e9ab=await pullApiSilent(_0x651f1f[_0x32da1f(0x8f)],undefined,_0x41c6e1,_0x651f1f[_0x32da1f(0xb6)]);_0x26e9ab?(console['log'](_0x32da1f(0xae)),logger[_0x32da1f(0x9e)](_0x32da1f(0xd1),_0x32da1f(0xab)+_0x651f1f[_0x32da1f(0x8f)],{'projectDir':_0x41c6e1,'appCode':_0x651f1f[_0x32da1f(0x8f)],'env':_0x651f1f['env']})):(console['log'](_0x32da1f(0xcc)),logger[_0x32da1f(0xdb)](_0x32da1f(0xd1),_0x32da1f(0xc5)+_0x651f1f[_0x32da1f(0x8f)],{'projectDir':_0x41c6e1,'appCode':_0x651f1f[_0x32da1f(0x8f)],'env':_0x651f1f[_0x32da1f(0xb6)]}));}catch(_0xc7127a){console[_0x32da1f(0x9d)]('!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger[_0x32da1f(0xdb)]('create',_0x32da1f(0xb8)+_0x651f1f[_0x32da1f(0x8f)],{'projectDir':_0x41c6e1,'appCode':_0x651f1f['appCode'],'env':_0x651f1f['env'],'error':_0xc7127a instanceof Error?_0xc7127a[_0x32da1f(0x8b)]:String(_0xc7127a)});}}logger['success'](_0x32da1f(0xd1),_0x32da1f(0x8e)+_0x651f1f[_0x32da1f(0xa2)]),_0x58358d(!![]),_0x49ee48(![]);}catch(_0x46fc5e){logger[_0x32da1f(0xd0)](_0x32da1f(0xd1),_0x32da1f(0xc2)+_0x651f1f[_0x32da1f(0xa2)],{'error':_0x46fc5e instanceof Error?_0x46fc5e[_0x32da1f(0x8b)]:String(_0x46fc5e)});try{a34_0x243c10[_0x32da1f(0xbe)](_0x41c6e1)&&(console[_0x32da1f(0x9d)](_0x32da1f(0x85)+_0x41c6e1),a34_0x243c10[_0x32da1f(0x89)](_0x41c6e1,{'recursive':!![],'force':!![]}));}catch(_0xb41ae2){logger['warn'](_0x32da1f(0xd1),_0x32da1f(0xbc)+_0x41c6e1,{'error':_0xb41ae2 instanceof Error?_0xb41ae2[_0x32da1f(0x8b)]:String(_0xb41ae2)});}_0x49ee48(![]),console[_0x32da1f(0xd0)]('×\x20项目创建失败:\x20'+(_0x46fc5e instanceof Error?_0x46fc5e[_0x32da1f(0x8b)]:String(_0x46fc5e)));}},_0x2a8101=async _0x38cd1a=>{await _0x5f26ea({'projectName':_0x38cd1a,'env':_0x5c75ee['env']});},_0x12f7b1=async _0x6bf197=>{const _0x1347d7=a34_0x3c12,_0x546718=a34_0x17f8bf['resolve'](process[_0x1347d7(0xac)](),_0x6bf197),_0x481902=a34_0x17f8bf[_0x1347d7(0xbf)](_0x546718,'package.json');try{console['log'](_0x1347d7(0xd5));const _0x2b235b=fileURLToPath(import.meta[_0x1347d7(0x9f)]),_0x1f5277=a34_0x17f8bf['resolve'](a34_0x17f8bf['dirname'](_0x2b235b),_0x1347d7(0xb0)),_0x421eba=a34_0x17f8bf[_0x1347d7(0xbf)](_0x1f5277,_0x1347d7(0xa7));let _0x55fdc4=_0x1347d7(0xd4);try{const _0x103eb6=JSON[_0x1347d7(0xaa)](a34_0x243c10[_0x1347d7(0xc9)](_0x421eba,_0x1347d7(0xbb)));_0x55fdc4=_0x103eb6[_0x1347d7(0x8c)]||_0x1347d7(0xd4);}catch(_0x14cb58){}const _0x3285d1=a34_0x243c10[_0x1347d7(0xc9)](_0x481902,_0x1347d7(0xbb)),_0x5a789e=JSON[_0x1347d7(0xaa)](_0x3285d1);_0x5a789e[_0x1347d7(0x8a)]=_0x6bf197,_0x5a789e[_0x1347d7(0xa1)]=_0x6bf197+_0x1347d7(0x9a)+_0x55fdc4,a34_0x243c10['writeFileSync'](_0x481902,JSON[_0x1347d7(0xc1)](_0x5a789e,null,0x2)+'\x0a',_0x1347d7(0xbb)),console['log']('√\x20package.json\x20已更新:\x20name='+_0x6bf197+_0x1347d7(0x86)+_0x5a789e[_0x1347d7(0xa1)]),logger[_0x1347d7(0x9e)](_0x1347d7(0xd1),_0x1347d7(0xa9),{'projectName':_0x6bf197,'description':_0x5a789e[_0x1347d7(0xa1)],'cliVersion':_0x55fdc4,'packageJsonPath':'package.json'});}catch(_0x21199d){logger[_0x1347d7(0xd0)](_0x1347d7(0xd1),_0x1347d7(0x88)+_0x6bf197,{'projectName':_0x6bf197,'error':_0x21199d instanceof Error?_0x21199d[_0x1347d7(0x8b)]:String(_0x21199d)});throw _0x21199d;}},_0x401260=async(_0x586fc3,_0xcdbe67,_0x5c0174)=>{const _0x1ae6a1=a34_0x3c12,_0x19b8ce=a34_0x17f8bf[_0x1ae6a1(0x87)](process['cwd'](),_0x586fc3),_0x1adfc6=a34_0x17f8bf[_0x1ae6a1(0xbf)](_0x19b8ce,'.lovrabetrc');try{_0xcdbe67?console['log'](_0x1ae6a1(0xd9)+_0x586fc3+'\x20配置应用AppCode:\x20'+_0xcdbe67):console['log'](_0x1ae6a1(0xd9)+_0x586fc3+_0x1ae6a1(0xd6));console[_0x1ae6a1(0x9d)](_0x1ae6a1(0xcd)+_0x1adfc6);const _0x3beb3a=fileURLToPath(import.meta[_0x1ae6a1(0x9f)]),_0x294543=a34_0x17f8bf['resolve'](a34_0x17f8bf[_0x1ae6a1(0xc0)](_0x3beb3a),_0x1ae6a1(0xb0)),_0x36a116=a34_0x17f8bf[_0x1ae6a1(0xbf)](_0x294543,_0x1ae6a1(0xa7));let _0x21be7d=_0x1ae6a1(0xd4);try{const _0x5cfe97=JSON[_0x1ae6a1(0xaa)](a34_0x243c10[_0x1ae6a1(0xc9)](_0x36a116,_0x1ae6a1(0xbb)));_0x21be7d=_0x5cfe97[_0x1ae6a1(0x8c)]||_0x1ae6a1(0xd4);}catch(_0x405c8b){}const _0x37e893=readConfig(),_0x3b9e04=typeof _0x37e893[_0x1ae6a1(0xb6)]===_0x1ae6a1(0x9b)?_0x37e893[_0x1ae6a1(0xb6)]:undefined,{app:_0x214817,appcode:_0x3a3ad1,..._0x2b4c02}=_0x37e893,_0x16b09b={..._0x2b4c02,'appcode':_0xcdbe67||'','env':_0x5c0174||_0x3b9e04||_0x1ae6a1(0x9c),'createdAt':new Date()['toLocaleString'](),'version':_0x21be7d};a34_0x243c10[_0x1ae6a1(0xb7)](_0x1adfc6,JSON[_0x1ae6a1(0xc1)](_0x16b09b,null,0x2),_0x1ae6a1(0xbb)),_0xcdbe67?console[_0x1ae6a1(0x9d)](_0x1ae6a1(0xaf)+_0xcdbe67):console[_0x1ae6a1(0x9d)](_0x1ae6a1(0xd2)),logger[_0x1ae6a1(0x9e)](_0x1ae6a1(0xd1),_0x1ae6a1(0x91)+_0xcdbe67,{'projectName':_0x586fc3,'configFile':'.lovrabetrc'});}catch(_0x12e082){logger[_0x1ae6a1(0xd0)](_0x1ae6a1(0xd1),_0x1ae6a1(0x96)+_0xcdbe67,{'projectName':_0x586fc3,'error':_0x12e082 instanceof Error?_0x12e082['message']:String(_0x12e082)});}};useEffect(()=>{const _0x37be3d=a34_0x3c12;_0x5c75ee[_0x37be3d(0x95)]&&_0x2a8101(_0x5c75ee[_0x37be3d(0x95)]);},[_0x5c75ee[_0x48bf82(0x95)]]);if(!_0x1c4ca3&&!_0x197f10&&!_0x5c75ee[_0x48bf82(0x95)])return a34_0x4ea556(EnhancedGuidedCreate,{'onCreate':_0x5f26ea,'env':_0x5c75ee['env']});if(_0x1c4ca3)return a34_0x2be763(a34_0x47651b,{'children':[a34_0x2be763(Box,{'marginTop':0x1,'children':[a34_0x4ea556(Box,{'width':'1'}),a34_0x4ea556(Text,{'color':'green','children':_0x48bf82(0xa6)}),a34_0x4ea556(Text,{'children':_0x48bf82(0x8d)}),a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'children':_0x52cc08?.[_0x48bf82(0xa2)]}),_0x52cc08?.[_0x48bf82(0x8f)]&&a34_0x2be763(a34_0x47651b,{'children':[a34_0x4ea556(Text,{'children':_0x48bf82(0x93)}),a34_0x4ea556(Text,{'color':_0x48bf82(0x90),'children':_0x52cc08[_0x48bf82(0x8f)]})]})]}),a34_0x4ea556(TaskRunning,{..._0x32307d}),a34_0x4ea556(TaskRunning,{..._0x1d2568}),a34_0x4ea556(TaskRunning,{..._0x35bf32})]});if(_0x197f10)return a34_0x2be763(a34_0x47651b,{'children':[a34_0x2be763(Box,{'marginTop':0x1,'children':[a34_0x4ea556(Box,{'width':'1'}),a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'children':_0x48bf82(0xa6)}),a34_0x4ea556(Text,{'children':'项目名称:\x20'}),a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'children':_0x52cc08?.[_0x48bf82(0xa2)]}),_0x52cc08?.['appCode']&&a34_0x2be763(a34_0x47651b,{'children':[a34_0x4ea556(Text,{'children':_0x48bf82(0x93)}),a34_0x4ea556(Text,{'color':'cyan','children':_0x52cc08['appCode']})]})]}),a34_0x4ea556(TaskFinished,{..._0x32307d}),a34_0x4ea556(TaskFinished,{..._0x1d2568}),a34_0x4ea556(TaskFinished,{..._0x35bf32}),a34_0x4ea556(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'children':'─'[_0x48bf82(0xb5)](0x3c)})}),a34_0x4ea556(Box,{'children':a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'bold':!![],'children':_0x48bf82(0xda)})}),a34_0x2be763(Box,{'marginTop':0x1,'flexDirection':_0x48bf82(0xad),'children':[a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':'cyan','children':_0x48bf82(0xb1)}),a34_0x4ea556(Text,{'color':_0x48bf82(0xca),'bold':!![],'children':_0x52cc08?.[_0x48bf82(0xa2)]})]}),_0x52cc08?.[_0x48bf82(0x8f)]&&a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':'cyan','children':'🔗\x20应用AppCode:\x20'}),a34_0x4ea556(Text,{'color':'white','bold':!![],'children':_0x52cc08[_0x48bf82(0x8f)]})]}),a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':'cyan','children':_0x48bf82(0xa5)}),_0x52cc08?.[_0x48bf82(0x94)]?a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'bold':!![],'children':'已自动拉取\x20✓'}):_0x52cc08?.[_0x48bf82(0x8f)]?a34_0x4ea556(Text,{'color':'yellow','bold':!![],'children':_0x48bf82(0x84)}):a34_0x4ea556(Text,{'color':_0x48bf82(0xd7),'bold':!![],'children':_0x48bf82(0xa3)})]})]}),a34_0x4ea556(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a34_0x4ea556(Text,{'color':_0x48bf82(0x90),'bold':!![],'children':_0x48bf82(0x98)})}),a34_0x2be763(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':'green','children':_0x48bf82(0xb3)}),a34_0x4ea556(Text,{'color':_0x48bf82(0xca),'children':_0x48bf82(0xa4)}),a34_0x4ea556(Text,{'color':'cyan','bold':!![],'children':_0x48bf82(0xcb)+_0x52cc08?.['projectName']+'\x20&&\x20lovrabet\x20start'})]}),_0x52cc08?.[_0x48bf82(0x8f)]&&!_0x52cc08?.[_0x48bf82(0x94)]&&a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':'yellow','children':_0x48bf82(0xce)}),a34_0x4ea556(Text,{'color':_0x48bf82(0xca),'children':_0x48bf82(0xc3)}),a34_0x4ea556(Text,{'color':_0x48bf82(0x90),'bold':!![],'children':'lovrabet\x20api\x20pull'})]}),!_0x52cc08?.[_0x48bf82(0x8f)]&&a34_0x2be763(a34_0x47651b,{'children':[a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':_0x48bf82(0xd7),'children':_0x48bf82(0xce)}),a34_0x4ea556(Text,{'color':_0x48bf82(0xca),'children':'配置AppCode:\x20'}),a34_0x4ea556(Text,{'color':_0x48bf82(0x90),'bold':!![],'children':'lovrabet\x20config\x20set\x20appcode\x20[app-code]'})]}),a34_0x2be763(Box,{'children':[a34_0x4ea556(Text,{'color':'gray','children':'3.\x20'}),a34_0x4ea556(Text,{'color':_0x48bf82(0xca),'children':_0x48bf82(0xc3)}),a34_0x4ea556(Text,{'color':_0x48bf82(0x90),'bold':!![],'children':_0x48bf82(0xbd)})]})]})]}),a34_0x4ea556(Box,{'marginTop':0x1,'children':a34_0x4ea556(Text,{'color':_0x48bf82(0xb4),'children':'─'[_0x48bf82(0xb5)](0x3c)})})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a35_0x52b1(_0x2c5174,_0xf5f748){var _0x36a5e6=a35_0x36a5();return a35_0x52b1=function(_0x52b164,_0x538ce5){_0x52b164=_0x52b164-0x6c;var _0x6c6914=_0x36a5e6[_0x52b164];return _0x6c6914;},a35_0x52b1(_0x2c5174,_0xf5f748);}(function(_0x5c29e4,_0xdb9922){var _0x528b07=a35_0x52b1,_0x1ecf7c=_0x5c29e4();while(!![]){try{var _0x427c1d=parseInt(_0x528b07(0x77))/0x1+-parseInt(_0x528b07(0x6c))/0x2+parseInt(_0x528b07(0x72))/0x3*(-parseInt(_0x528b07(0x78))/0x4)+-parseInt(_0x528b07(0x74))/0x5+-parseInt(_0x528b07(0x6f))/0x6+-parseInt(_0x528b07(0x6d))/0x7*(parseInt(_0x528b07(0x75))/0x8)+parseInt(_0x528b07(0x71))/0x9*(parseInt(_0x528b07(0x76))/0xa);if(_0x427c1d===_0xdb9922)break;else _0x1ecf7c['push'](_0x1ecf7c['shift']());}catch(_0x368bb1){_0x1ecf7c['push'](_0x1ecf7c['shift']());}}}(a35_0x36a5,0x9b7ce));import{jsx as a35_0x576305,jsxs as a35_0x238025}from'react/jsx-runtime';import{Box,Text}from'ink';function a35_0x36a5(){var _0x570f8c=['5070972BOIInq','2200446njyBXw','91YBCTxt','\x20√\x20','5311458qsyMEY','green','171PuVaEF','3WbHpsE','taskName','602425tsnRgX','406136xdwhIS','2142530xaznUF','599736xFMJRN'];a35_0x36a5=function(){return _0x570f8c;};return a35_0x36a5();}import{TaskTime}from'./task-time.js';export function TaskFinished(_0x246f47){var _0x4bed34=a35_0x52b1;return a35_0x238025(Box,{'children':[a35_0x576305(Box,{'width':'1'}),a35_0x576305(Text,{'color':_0x4bed34(0x70),'children':_0x4bed34(0x6e)}),a35_0x576305(Text,{'children':_0x246f47[_0x4bed34(0x73)]}),a35_0x576305(TaskTime,{'elapsed':_0x246f47['elapsed']})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a36_0x1677(){var _0x2ba2b0=['\x20\x20\x20','1005342YgefFo','707nwbOWt','1095310kDLcuL','233069xjMrhp','724207cYVhKm','2480IfvHXm','20gvUCBE','2DFrWmQ','loading','8WwNyqA','215766yRFXLx','finished','green','dots','201327TseRLv'];a36_0x1677=function(){return _0x2ba2b0;};return a36_0x1677();}(function(_0x3f551d,_0x7af75c){var _0x15f50a=a36_0x31e3,_0x4c0040=_0x3f551d();while(!![]){try{var _0x1f87b3=-parseInt(_0x15f50a(0x176))/0x1*(parseInt(_0x15f50a(0x16a))/0x2)+-parseInt(_0x15f50a(0x171))/0x3*(parseInt(_0x15f50a(0x16c))/0x4)+parseInt(_0x15f50a(0x175))/0x5+parseInt(_0x15f50a(0x173))/0x6+-parseInt(_0x15f50a(0x174))/0x7*(-parseInt(_0x15f50a(0x168))/0x8)+parseInt(_0x15f50a(0x16d))/0x9+-parseInt(_0x15f50a(0x169))/0xa*(-parseInt(_0x15f50a(0x167))/0xb);if(_0x1f87b3===_0x7af75c)break;else _0x4c0040['push'](_0x4c0040['shift']());}catch(_0x10b473){_0x4c0040['push'](_0x4c0040['shift']());}}}(a36_0x1677,0x325d2));import{jsx as a36_0x2bac4d,jsxs as a36_0x4d2d44}from'react/jsx-runtime';function a36_0x31e3(_0x4477c9,_0x467e0c){var _0x167737=a36_0x1677();return a36_0x31e3=function(_0x31e359,_0x46b210){_0x31e359=_0x31e359-0x167;var _0x3ec389=_0x167737[_0x31e359];return _0x3ec389;},a36_0x31e3(_0x4477c9,_0x467e0c);}import{Text}from'ink';import a36_0x1a5196 from'ink-spinner';export function TaskLoading(_0x238767){var _0x16a42b=a36_0x31e3;if(_0x238767[_0x16a42b(0x16e)])return a36_0x2bac4d(Text,{'color':'green','children':'\x20√\x20'});if(_0x238767[_0x16a42b(0x16b)])return a36_0x4d2d44(Text,{'color':_0x16a42b(0x16f),'children':['\x20',a36_0x2bac4d(a36_0x1a5196,{'type':_0x16a42b(0x170)}),'\x20']});return a36_0x2bac4d(Text,{'children':_0x16a42b(0x172)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x89d424,_0x30f220){var _0x5173ad=a37_0x507b,_0x1b1830=_0x89d424();while(!![]){try{var _0x59a849=parseInt(_0x5173ad(0x106))/0x1+parseInt(_0x5173ad(0xfd))/0x2+-parseInt(_0x5173ad(0xff))/0x3*(parseInt(_0x5173ad(0x105))/0x4)+-parseInt(_0x5173ad(0x107))/0x5+-parseInt(_0x5173ad(0x102))/0x6*(parseInt(_0x5173ad(0x101))/0x7)+parseInt(_0x5173ad(0x100))/0x8+parseInt(_0x5173ad(0xfe))/0x9;if(_0x59a849===_0x30f220)break;else _0x1b1830['push'](_0x1b1830['shift']());}catch(_0x44f4d2){_0x1b1830['push'](_0x1b1830['shift']());}}}(a37_0x49d3,0x403ad));import{jsx as a37_0x25cf60,jsxs as a37_0x1bd379}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';function a37_0x507b(_0x58fbb5,_0x5db6c6){var _0x49d3d2=a37_0x49d3();return a37_0x507b=function(_0x507b21,_0xcaa9c){_0x507b21=_0x507b21-0xfd;var _0x3687e0=_0x49d3d2[_0x507b21];return _0x3687e0;},a37_0x507b(_0x58fbb5,_0x5db6c6);}function a37_0x49d3(){var _0x518c40=['elapsed','taskName','1902452zgfzUf','22066RgddqP','1398830YJidXP','361244Zpzzea','4322583UJYYfv','3kOuOLd','2851328jymFoZ','8617fMFWig','102cmXKrV'];a37_0x49d3=function(){return _0x518c40;};return a37_0x49d3();}export function TaskRunning(_0x1c1362){var _0x5f1eb0=a37_0x507b;return a37_0x1bd379(Box,{'children':[a37_0x25cf60(Box,{'width':'1'}),a37_0x25cf60(TaskLoading,{..._0x1c1362}),a37_0x25cf60(Text,{'children':_0x1c1362[_0x5f1eb0(0x104)]}),a37_0x25cf60(TaskTime,{'elapsed':_0x1c1362[_0x5f1eb0(0x103)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a38_0xbe6e(){var _0x5add25=['3925605BAyWJR','58527WhHRML','1297934DSkOmr','8384kbBnFC','5193ZYHVkT','17325LNJbeb','gray','1pcDmPM','4772290kgClCs','4inXUgp','78tuCTrL','2278515mzMvTG','elapsed'];a38_0xbe6e=function(){return _0x5add25;};return a38_0xbe6e();}(function(_0x182fd6,_0x13d08a){var _0x509f52=a38_0xdd72,_0x34e89d=_0x182fd6();while(!![]){try{var _0x56576e=-parseInt(_0x509f52(0x18d))/0x1*(-parseInt(_0x509f52(0x195))/0x2)+parseInt(_0x509f52(0x191))/0x3+parseInt(_0x509f52(0x18f))/0x4*(-parseInt(_0x509f52(0x193))/0x5)+-parseInt(_0x509f52(0x190))/0x6*(-parseInt(_0x509f52(0x194))/0x7)+parseInt(_0x509f52(0x196))/0x8*(parseInt(_0x509f52(0x197))/0x9)+-parseInt(_0x509f52(0x18e))/0xa+-parseInt(_0x509f52(0x198))/0xb;if(_0x56576e===_0x13d08a)break;else _0x34e89d['push'](_0x34e89d['shift']());}catch(_0x4b6d80){_0x34e89d['push'](_0x34e89d['shift']());}}}(a38_0xbe6e,0xd1750));import{jsx as a38_0x2800bb,Fragment as a38_0x105321,jsxs as a38_0x19a944}from'react/jsx-runtime';function a38_0xdd72(_0x528d69,_0x43996b){var _0xbe6ef9=a38_0xbe6e();return a38_0xdd72=function(_0xdd72fe,_0x5f3251){_0xdd72fe=_0xdd72fe-0x18c;var _0x2cb746=_0xbe6ef9[_0xdd72fe];return _0x2cb746;},a38_0xdd72(_0x528d69,_0x43996b);}import{Text}from'ink';export function TaskTime(_0x121677){var _0x4d5950=a38_0xdd72;if(_0x121677[_0x4d5950(0x192)])return a38_0x19a944(a38_0x105321,{'children':[a38_0x2800bb(Text,{'color':_0x4d5950(0x18c),'children':'\x20['}),a38_0x2800bb(Text,{'color':_0x4d5950(0x18c),'bold':!![],'children':_0x121677['elapsed']}),a38_0x2800bb(Text,{'color':_0x4d5950(0x18c),'children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x4c2feb=a39_0x34ce;function a39_0x34ce(_0x57dab3,_0x4b1b31){const _0x1a10f0=a39_0x1a10();return a39_0x34ce=function(_0x34ce21,_0x18acce){_0x34ce21=_0x34ce21-0x144;let _0x276676=_0x1a10f0[_0x34ce21];return _0x276676;},a39_0x34ce(_0x57dab3,_0x4b1b31);}(function(_0x4e8167,_0x4380d2){const _0x47c0fb=a39_0x34ce,_0x5d8450=_0x4e8167();while(!![]){try{const _0x58b1e3=parseInt(_0x47c0fb(0x14c))/0x1*(parseInt(_0x47c0fb(0x147))/0x2)+parseInt(_0x47c0fb(0x144))/0x3*(parseInt(_0x47c0fb(0x14d))/0x4)+-parseInt(_0x47c0fb(0x156))/0x5*(parseInt(_0x47c0fb(0x14e))/0x6)+-parseInt(_0x47c0fb(0x152))/0x7+parseInt(_0x47c0fb(0x148))/0x8+parseInt(_0x47c0fb(0x151))/0x9*(-parseInt(_0x47c0fb(0x159))/0xa)+parseInt(_0x47c0fb(0x15a))/0xb;if(_0x58b1e3===_0x4380d2)break;else _0x5d8450['push'](_0x5d8450['shift']());}catch(_0x5c655a){_0x5d8450['push'](_0x5d8450['shift']());}}}(a39_0x1a10,0x4ec20));import a39_0x39837f from'node:path';import{fileURLToPath}from'node:url';function a39_0x1a10(){const _0x5725fb=['732151okvndQ','url','error','now','1455845rmBJsJ','message','resolve','3433530Ucvipb','2261820NTDbCt','107913UiicWp','dirname','success','4YHWBPh','2150808uSfyRa','copy','项目模板复制失败','../../templates/projects/sub-app-react-demo','277333IIXxnI','36poVsEv','12zrlWEj','项目模板复制完成','cwd','9dVuDEX'];a39_0x1a10=function(){return _0x5725fb;};return a39_0x1a10();}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=a39_0x39837f[a39_0x4c2feb(0x145)](fileURLToPath(import.meta[a39_0x4c2feb(0x153)])),templateDir=a39_0x39837f[a39_0x4c2feb(0x158)](__dirname,a39_0x4c2feb(0x14b));export function useCopyProjectTemplate(){const [_0x2d2b9d,_0x4c1cdd]=useState(![]),[_0x2df903,_0x402538]=useState(![]),[_0x4fd175,_0x45fa62]=useState(''),_0xc9716f=useCallback(async _0x45f0d4=>{const _0x5b5af8=a39_0x34ce,_0x4b413d=Date[_0x5b5af8(0x155)](),_0x44ba8e=a39_0x39837f[_0x5b5af8(0x158)](process[_0x5b5af8(0x150)](),_0x45f0d4);_0x4c1cdd(!![]);try{logger['info'](_0x5b5af8(0x149),'开始复制项目模板',{'projectCode':_0x45f0d4,'templateDir':templateDir}),await copyDirectory(templateDir,_0x44ba8e);const _0x28850a=Date[_0x5b5af8(0x155)]()-_0x4b413d;logger[_0x5b5af8(0x146)](_0x5b5af8(0x149),_0x5b5af8(0x14f),_0x28850a,{'projectCode':_0x45f0d4});}catch(_0x4fac3e){const _0xe3a49f=Date[_0x5b5af8(0x155)]()-_0x4b413d;logger[_0x5b5af8(0x154)](_0x5b5af8(0x149),_0x5b5af8(0x14a),{'projectCode':_0x45f0d4,'error':_0x4fac3e instanceof Error?_0x4fac3e[_0x5b5af8(0x157)]:String(_0x4fac3e),'duration':_0xe3a49f});throw _0x4fac3e;}finally{_0x4c1cdd(![]),_0x402538(!![]),_0x45fa62(formatElapsed(_0x4b413d));}},[]);return{'taskName':'复制项目文件','finished':_0x2df903,'loading':_0x2d2b9d,'elapsed':_0x4fd175,'doTask':_0xc9716f};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x48ef43,_0x54ac13){const _0x43af48=a40_0x1307,_0x1fd1a1=_0x48ef43();while(!![]){try{const _0x5b3042=parseInt(_0x43af48(0x146))/0x1+-parseInt(_0x43af48(0x156))/0x2*(-parseInt(_0x43af48(0x147))/0x3)+-parseInt(_0x43af48(0x14e))/0x4+parseInt(_0x43af48(0x14c))/0x5*(-parseInt(_0x43af48(0x143))/0x6)+parseInt(_0x43af48(0x150))/0x7+-parseInt(_0x43af48(0x151))/0x8*(-parseInt(_0x43af48(0x14d))/0x9)+-parseInt(_0x43af48(0x14a))/0xa;if(_0x5b3042===_0x54ac13)break;else _0x1fd1a1['push'](_0x1fd1a1['shift']());}catch(_0x52974f){_0x1fd1a1['push'](_0x1fd1a1['shift']());}}}(a40_0x52fd,0x53569));import a40_0x498363 from'node:path';import{useCallback,useState}from'react';function a40_0x1307(_0x79bdb7,_0x2920cb){const _0x52fd29=a40_0x52fd();return a40_0x1307=function(_0x130730,_0x586ac8){_0x130730=_0x130730-0x142;let _0x27da63=_0x52fd29[_0x130730];return _0x27da63;},a40_0x1307(_0x79bdb7,_0x2920cb);}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x4ef02b=a40_0x1307,[_0x4affd7,_0x33d794]=useState(![]),[_0x39e8db,_0x52c7ae]=useState(![]),[_0x3891f4,_0x446553]=useState(''),_0x329de6=useCallback(async _0x48a7f7=>{const _0x29ad7d=a40_0x1307,_0x4a9498=Date['now'](),_0x57b880=a40_0x498363[_0x29ad7d(0x153)](process['cwd'](),_0x48a7f7);_0x33d794(!![]);try{logger['info'](_0x29ad7d(0x152),_0x29ad7d(0x14f),{'projectCode':_0x48a7f7}),await execa('npx',[_0x29ad7d(0x14b),_0x29ad7d(0x148),'.'],{'cwd':_0x57b880});const _0x450dec=Date[_0x29ad7d(0x145)]()-_0x4a9498;logger[_0x29ad7d(0x155)](_0x29ad7d(0x152),_0x29ad7d(0x149),_0x450dec,{'projectCode':_0x48a7f7});}catch(_0x4ad05a){const _0x436af1=Date[_0x29ad7d(0x145)]()-_0x4a9498;logger['error'](_0x29ad7d(0x152),_0x29ad7d(0x144),{'projectCode':_0x48a7f7,'error':_0x4ad05a instanceof Error?_0x4ad05a[_0x29ad7d(0x154)]:String(_0x4ad05a),'duration':_0x436af1});throw _0x4ad05a;}finally{_0x33d794(![]),_0x52c7ae(!![]),_0x446553(formatElapsed(_0x4a9498));}},[]);return{'taskName':_0x4ef02b(0x142),'finished':_0x39e8db,'loading':_0x4affd7,'elapsed':_0x3891f4,'doTask':_0x329de6};}function a40_0x52fd(){const _0x2c4bd8=['580124UMiMkv','开始格式化代码','4482303YcAJKA','16OzEqfM','format','resolve','message','success','172AEBzgT','格式化代码','330UaIMfK','代码格式化失败','now','200882RNwBNt','7557UaMiYP','--write','代码格式化完成','7006490VCLxqv','prettier','730qvgOMI','617481hcENnT'];a40_0x52fd=function(){return _0x2c4bd8;};return a40_0x52fd();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1645dd,_0x40dc9c){const _0x5d21f4=a41_0x4b91,_0x20f888=_0x1645dd();while(!![]){try{const _0x5173f7=-parseInt(_0x5d21f4(0xf2))/0x1*(parseInt(_0x5d21f4(0xf9))/0x2)+parseInt(_0x5d21f4(0xfe))/0x3*(-parseInt(_0x5d21f4(0xfd))/0x4)+parseInt(_0x5d21f4(0x102))/0x5+-parseInt(_0x5d21f4(0xf1))/0x6+parseInt(_0x5d21f4(0xf4))/0x7+parseInt(_0x5d21f4(0xfa))/0x8*(parseInt(_0x5d21f4(0xf3))/0x9)+parseInt(_0x5d21f4(0xf7))/0xa;if(_0x5173f7===_0x40dc9c)break;else _0x20f888['push'](_0x20f888['shift']());}catch(_0x5689df){_0x20f888['push'](_0x20f888['shift']());}}}(a41_0x5722,0xedadc));import a41_0x5e4b3b from'node:path';import{useCallback,useState}from'react';function a41_0x4b91(_0x5cfdde,_0x4bb99e){const _0x572241=a41_0x5722();return a41_0x4b91=function(_0x4b91e6,_0x1bacd9){_0x4b91e6=_0x4b91e6-0xf1;let _0x3aceca=_0x572241[_0x4b91e6];return _0x3aceca;},a41_0x4b91(_0x5cfdde,_0x4bb99e);}import{execa}from'execa';function a41_0x5722(){const _0x5909b1=['依赖安装完成','5393424XyakfF','1326009wxMPdG','90nSptnt','6346550dDDpoQ','cwd','message','16676420iVtafZ','安装依赖','2bblbVD','792568lVEoeg','info','https://registry.npmmirror.com','8NvABJM','954501YFwKLT','resolve','success','now','1348885RgpnZh','install'];a41_0x5722=function(){return _0x5909b1;};return a41_0x5722();}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x516276=a41_0x4b91,[_0x2c8d9b,_0x5b7e69]=useState(![]),[_0x18237b,_0x32dae6]=useState(![]),[_0x2582a3,_0x3f9740]=useState(''),_0x42648c=useCallback(async _0x2640c1=>{const _0x595b18=a41_0x4b91,_0x5664ff=Date[_0x595b18(0x101)](),_0x8e85fe=a41_0x5e4b3b[_0x595b18(0xff)](process[_0x595b18(0xf5)](),_0x2640c1);_0x5b7e69(!![]),_0x32dae6(![]);const _0x15d6d0=async(_0x35fc93,_0x31c22a)=>{await execa(_0x35fc93,_0x31c22a,{'cwd':_0x8e85fe});};try{logger[_0x595b18(0xfb)](_0x595b18(0x103),'开始安装依赖',{'projectCode':_0x2640c1,'registry':_0x595b18(0xfc)}),await _0x15d6d0('npm',[_0x595b18(0x103),'--registry',_0x595b18(0xfc)]);const _0x11b738=Date[_0x595b18(0x101)]()-_0x5664ff;logger[_0x595b18(0x100)](_0x595b18(0x103),_0x595b18(0x104),_0x11b738,{'projectCode':_0x2640c1});}catch(_0x5d6767){const _0x283a65=Date[_0x595b18(0x101)]()-_0x5664ff;logger['error'](_0x595b18(0x103),'依赖安装失败',{'projectCode':_0x2640c1,'error':_0x5d6767 instanceof Error?_0x5d6767[_0x595b18(0xf6)]:String(_0x5d6767),'duration':_0x283a65});throw _0x5d6767;}finally{_0x5b7e69(![]),_0x32dae6(!![]),_0x3f9740(formatElapsed(_0x5664ff));}},[]);return{'taskName':_0x516276(0xf8),'finished':_0x18237b,'loading':_0x2c8d9b,'elapsed':_0x2582a3,'doTask':_0x42648c};}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3dbaba,_0x43cb95){var _0x1c5393=a42_0x110c,_0x4e780b=_0x3dbaba();while(!![]){try{var _0x56fbdd=parseInt(_0x1c5393(0xe5))/0x1+parseInt(_0x1c5393(0xe7))/0x2+-parseInt(_0x1c5393(0xe8))/0x3+-parseInt(_0x1c5393(0xe2))/0x4*(parseInt(_0x1c5393(0xe9))/0x5)+parseInt(_0x1c5393(0xeb))/0x6+-parseInt(_0x1c5393(0xe6))/0x7+parseInt(_0x1c5393(0xea))/0x8;if(_0x56fbdd===_0x43cb95)break;else _0x4e780b['push'](_0x4e780b['shift']());}catch(_0x1a6bca){_0x4e780b['push'](_0x4e780b['shift']());}}}(a42_0x4e30,0xa6813));function a42_0x4e30(){var _0x576aef=['3139680EjOtEq','4532598GmdJbD','column','!\x20请指定一个有效的命令。','3225308CFmecp','green','lovrabet\x20--help','1242862fCVveW','3229772DgdtKK','975150xpuasC','2785812qaEtaM','5uzoEAK'];a42_0x4e30=function(){return _0x576aef;};return a42_0x4e30();}import{jsx as a42_0x2bbb80,jsxs as a42_0x19efa1}from'react/jsx-runtime';import{Box,Text}from'ink';function a42_0x110c(_0x108e33,_0x4b1b6f){var _0x4e3035=a42_0x4e30();return a42_0x110c=function(_0x110cc2,_0x2fa948){_0x110cc2=_0x110cc2-0xe1;var _0x5d0a4e=_0x4e3035[_0x110cc2];return _0x5d0a4e;},a42_0x110c(_0x108e33,_0x4b1b6f);}export function Help(){var _0x1cfbc9=a42_0x110c;return a42_0x19efa1(Box,{'flexDirection':_0x1cfbc9(0xec),'marginTop':0x1,'marginBottom':0x1,'children':[a42_0x19efa1(Box,{'children':[a42_0x2bbb80(Box,{'width':'1'}),a42_0x2bbb80(Text,{'children':_0x1cfbc9(0xe1)})]}),a42_0x19efa1(Box,{'marginTop':0x1,'children':[a42_0x2bbb80(Box,{'width':'1'}),a42_0x19efa1(Text,{'children':['\x20\x20','使用']}),a42_0x19efa1(Text,{'bold':!![],'color':_0x1cfbc9(0xe3),'children':['\x20',_0x1cfbc9(0xe4),'\x20']}),a42_0x2bbb80(Text,{'children':'查看可用命令。'})]})]});}
|
package/lib/init/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x54cf94,_0x34ed7f){const _0x1186b2=a43_0x22b4,_0x108403=_0x54cf94();while(!![]){try{const _0x410e00=parseInt(_0x1186b2(0xfb))/0x1+-parseInt(_0x1186b2(0x12a))/0x2*(parseInt(_0x1186b2(0x104))/0x3)+parseInt(_0x1186b2(0x12c))/0x4*(parseInt(_0x1186b2(0x126))/0x5)+parseInt(_0x1186b2(0xff))/0x6*(parseInt(_0x1186b2(0x11c))/0x7)+-parseInt(_0x1186b2(0x103))/0x8+parseInt(_0x1186b2(0x10a))/0x9*(parseInt(_0x1186b2(0x129))/0xa)+parseInt(_0x1186b2(0x123))/0xb;if(_0x410e00===_0x34ed7f)break;else _0x108403['push'](_0x108403['shift']());}catch(_0x28f61d){_0x108403['push'](_0x108403['shift']());}}}(a43_0x1215,0xf1df8));function a43_0x1215(){const _0x5cc412=['test','应用代码只能包含字母、数字、-\x20和\x20_','正在初始化配置文件...','1.0.0','url','4672089TENszT','env','trim','AppCode:\x20','info','gray','column','utf8','slice','cwd','message','string','backspace','delete','\x20←\x20','toLocaleString','应用代码不合法','init','14GgvzVn','../..','package.json','初始化项目配置文件成功','✓\x20成功在当前目录初始化\x20.lovrabetrc\x20文件','stringify','return','12171401DjMCDx','应用代码长度不能超过\x20100\x20个字符','创建配置文件失败','94575SEHHoF','.lovrabetrc','现在您可以使用\x20lovrabet\x20api\x20doc\x20和\x20lovrabet\x20api\x20pull\x20等命令了','30jkOfYj','2rUqEnQ','exit','20vOxMQu','请输入应用代码\x20(AppCode):\x20','cyan','green','292555QHVpdk','应用代码不能为空','version','length','1792734crFWvf','online','创建配置文件失败:\x20','red','11938104DlMMgf','3496761bRusfJ'];a43_0x1215=function(){return _0x5cc412;};return a43_0x1215();}import{jsxs as a43_0x17c667,jsx as a43_0x115c6b}from'react/jsx-runtime';function a43_0x22b4(_0x36093e,_0x5b05bc){const _0x1215fd=a43_0x1215();return a43_0x22b4=function(_0x22b4ba,_0x12c17a){_0x22b4ba=_0x22b4ba-0xf8;let _0x554529=_0x1215fd[_0x22b4ba];return _0x554529;},a43_0x22b4(_0x36093e,_0x5b05bc);}import{useState,useEffect}from'react';import{Box,Text,useInput}from'ink';import{existsSync,writeFileSync,readFileSync}from'node:fs';import{resolve,join,dirname}from'node:path';import{fileURLToPath}from'node:url';import{logger}from'../utils/logger.js';import{readConfig}from'../utils/config.js';export function Init({appcode:_0x576801,env:_0x4c1589}){const _0x1e5de0=a43_0x22b4,[_0x55ef49,_0x23d03a]=useState(null),[_0x1e46e4,_0x3d096c]=useState(![]),[_0x10659e,_0x9a54c7]=useState(!_0x576801),[_0x3fa9a3,_0x4ec2cb]=useState(''),[_0x216b00,_0x55e610]=useState(''),[_0x2843d8,_0x181841]=useState(_0x576801||''),[_0x2300ca]=useState(_0x4c1589);function _0x459687(_0x55605b){const _0x4bb71d=a43_0x22b4;if(_0x55605b[_0x4bb71d(0xfe)]===0x0)return{'valid':![],'message':''};if(_0x55605b['length']>0x64)return{'valid':![],'message':_0x4bb71d(0x124)};const _0x268ce3=/^[A-Za-z0-9_-]+$/;if(!_0x268ce3[_0x4bb71d(0x105)](_0x55605b))return{'valid':![],'message':_0x4bb71d(0x106)};return{'valid':!![]};}useInput((_0x184dae,_0x45abb2)=>{const _0x1bf41e=a43_0x22b4;if(!_0x10659e)return;if(_0x45abb2[_0x1bf41e(0x122)]){if(_0x216b00||!_0x3fa9a3[_0x1bf41e(0x10c)]()){_0x55e610(_0x1bf41e(0xfc));return;}const _0x5aae8b=_0x3fa9a3[_0x1bf41e(0x10c)](),{valid:_0x1dc24f,message:_0x45c028}=_0x459687(_0x5aae8b);if(!_0x1dc24f){_0x55e610(_0x45c028||_0x1bf41e(0x11a));return;}_0x181841(_0x5aae8b),_0x9a54c7(![]);}else{if(_0x45abb2[_0x1bf41e(0x116)]||_0x45abb2[_0x1bf41e(0x117)])_0x4ec2cb(_0x5848e7=>{const _0x5936c7=_0x1bf41e,_0xf648e6=_0x5848e7[_0x5936c7(0x112)](0x0,-0x1);if(_0xf648e6[_0x5936c7(0xfe)]===0x0)_0x55e610('');else{const {valid:_0x55357e,message:_0x5e4a1b}=_0x459687(_0xf648e6);_0x55e610(_0x55357e?'':_0x5e4a1b||_0x5936c7(0x11a));}return _0xf648e6;});else _0x45abb2['ctrl']&&_0x184dae==='c'?process[_0x1bf41e(0x12b)](0x0):_0x4ec2cb(_0x4ae1c6=>{const _0x13b9bd=_0x1bf41e,_0x9eae0c=_0x4ae1c6+_0x184dae,{valid:_0x82931b,message:_0x41c264}=_0x459687(_0x9eae0c);return _0x55e610(_0x82931b?'':_0x41c264||_0x13b9bd(0x11a)),_0x9eae0c;});}},{'isActive':_0x10659e}),useEffect(()=>{const _0x335726=a43_0x22b4;if(!_0x2843d8||_0x10659e)return;const _0x179fd2=resolve(process[_0x335726(0x113)](),_0x335726(0x127));if(existsSync(_0x179fd2)){_0x23d03a('当前目录已存在\x20.lovrabetrc\x20文件'),setTimeout(()=>process['exit'](0x1),0x64);return;}try{const _0x299c09=fileURLToPath(import.meta[_0x335726(0x109)]),_0x56f41e=resolve(dirname(_0x299c09),_0x335726(0x11d)),_0x23fd63=join(_0x56f41e,_0x335726(0x11e));let _0x448ae9=_0x335726(0x108);try{const _0x1a4945=JSON['parse'](readFileSync(_0x23fd63,_0x335726(0x111)));_0x448ae9=_0x1a4945[_0x335726(0xfd)]||_0x335726(0x108);}catch(_0x144d82){}const _0x2d1261=readConfig(),_0x5a2cd3=typeof _0x2d1261[_0x335726(0x10b)]===_0x335726(0x115)?_0x2d1261['env']:undefined,{app:_0x132462,appcode:_0x56c0cc,..._0x151344}=_0x2d1261,_0x153dea={..._0x151344,'appcode':_0x2843d8,'env':_0x2300ca||_0x5a2cd3||_0x335726(0x100),'createdAt':new Date()[_0x335726(0x119)](),'version':_0x448ae9};writeFileSync(_0x179fd2,JSON[_0x335726(0x121)](_0x153dea,null,0x2),{'encoding':'utf8','mode':0x180}),logger['setLogPath'](process['cwd']()),logger[_0x335726(0x10e)](_0x335726(0x11b),_0x335726(0x11f),{'appcode':_0x2843d8,'env':_0x153dea[_0x335726(0x10b)],'version':_0x153dea[_0x335726(0xfd)],'configPath':_0x179fd2}),_0x3d096c(!![]),setTimeout(()=>process['exit'](0x0),0x64);}catch(_0x348682){logger['error'](_0x335726(0x11b),_0x335726(0x125),{'error':_0x348682 instanceof Error?_0x348682[_0x335726(0x114)]:String(_0x348682)}),_0x23d03a(_0x335726(0x101)+(_0x348682 instanceof Error?_0x348682[_0x335726(0x114)]:String(_0x348682))),setTimeout(()=>process[_0x335726(0x12b)](0x1),0x64);}},[_0x2843d8,_0x10659e,_0x2300ca]);if(_0x55ef49)return a43_0x115c6b(Box,{'flexDirection':_0x1e5de0(0x110),'children':a43_0x17c667(Text,{'color':_0x1e5de0(0x102),'children':['✗\x20',_0x55ef49]})});if(_0x10659e)return a43_0x17c667(Box,{'flexDirection':_0x1e5de0(0x110),'children':[a43_0x17c667(Box,{'children':[a43_0x115c6b(Text,{'color':_0x1e5de0(0xf9),'children':_0x1e5de0(0xf8)}),_0x3fa9a3?a43_0x115c6b(Text,{'color':'green','children':_0x3fa9a3}):a43_0x115c6b(Text,{'color':_0x1e5de0(0x10f),'children':'_'}),_0x216b00&&a43_0x17c667(Text,{'color':_0x1e5de0(0x102),'children':[_0x1e5de0(0x118),_0x216b00]})]}),!_0x216b00&&!_0x3fa9a3&&a43_0x115c6b(Box,{'children':a43_0x115c6b(Text,{'color':'gray','children':'应用代码用于标识您的项目,只能包含字母、数字、-\x20和\x20_'})})]});if(_0x1e46e4)return a43_0x17c667(Box,{'flexDirection':'column','children':[a43_0x115c6b(Text,{'color':_0x1e5de0(0xfa),'children':_0x1e5de0(0x120)}),a43_0x17c667(Text,{'color':_0x1e5de0(0xf9),'children':[_0x1e5de0(0x10d),_0x2843d8]}),a43_0x115c6b(Text,{'children':_0x1e5de0(0x128)})]});return a43_0x115c6b(Box,{'children':a43_0x115c6b(Text,{'children':_0x1e5de0(0x107)})});}
|
package/lib/mcp/cursor.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4c09a0,_0x93d7d2){const _0x1373d8=a44_0x2be8,_0x40620d=_0x4c09a0();while(!![]){try{const _0x1576cb=-parseInt(_0x1373d8(0x1cc))/0x1+parseInt(_0x1373d8(0x1d7))/0x2+parseInt(_0x1373d8(0x1c2))/0x3+parseInt(_0x1373d8(0x1d3))/0x4*(parseInt(_0x1373d8(0x1e8))/0x5)+-parseInt(_0x1373d8(0x1c7))/0x6*(-parseInt(_0x1373d8(0x1bc))/0x7)+-parseInt(_0x1373d8(0x1cb))/0x8+parseInt(_0x1373d8(0x1c6))/0x9;if(_0x1576cb===_0x93d7d2)break;else _0x40620d['push'](_0x40620d['shift']());}catch(_0x4a1cdc){_0x40620d['push'](_0x40620d['shift']());}}}(a44_0x90a0,0x6f7b4));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 _0x5a384d=a44_0x2be8;try{const _0x19e4d6=process['cwd'](),_0x37b929=resolve(_0x19e4d6,_0x5a384d(0x1d4)),_0x5a1684=resolve(_0x37b929,_0x5a384d(0x1ce)),_0x1618b6=readConfig(),_0x4feffc=_0x1618b6[_0x5a384d(0x1bf)]||_0x1618b6[_0x5a384d(0x1e4)],_0x583375=_0x1618b6['env']||'online';!_0x4feffc&&(console[_0x5a384d(0x1c1)]('错误:\x20未找到\x20appcode\x20配置,请先运行\x20\x27lovrabet\x20init\x27\x20初始化项目配置'),logger[_0x5a384d(0x1c1)](_0x5a384d(0x1eb),'未找到\x20appcode\x20配置'),process[_0x5a384d(0x1e3)](0x1));!existsSync(_0x37b929)&&(mkdirSync(_0x37b929,{'recursive':!![]}),logger[_0x5a384d(0x1da)](_0x5a384d(0x1eb),_0x5a384d(0x1e2),{'path':_0x37b929}),console[_0x5a384d(0x1cf)](_0x5a384d(0x1d6)+_0x37b929));const _0x2dad42={'command':_0x5a384d(0x1c4),'args':['-y',_0x5a384d(0x1c0)],'env':{'LOVRABET_APP_CODE':String(_0x4feffc),'LOVRABET_ENV':String(_0x583375)}};let _0x5e283f;if(existsSync(_0x5a1684))try{const _0x4f9ae6=readFileSync(_0x5a1684,_0x5a384d(0x1ba));_0x5e283f=JSON[_0x5a384d(0x1d9)](_0x4f9ae6),!_0x5e283f[_0x5a384d(0x1bd)]&&(_0x5e283f['mcpServers']={}),_0x5e283f[_0x5a384d(0x1bd)][_0x5a384d(0x1c8)]=_0x2dad42,logger['info'](_0x5a384d(0x1eb),'更新现有\x20mcp.json\x20配置',{'path':_0x5a1684,'appcode':_0x4feffc,'env':_0x583375}),console['log'](_0x5a384d(0x1d8));}catch(_0x3cda67){logger[_0x5a384d(0x1c1)](_0x5a384d(0x1eb),_0x5a384d(0x1c5),{'error':_0x3cda67 instanceof Error?_0x3cda67[_0x5a384d(0x1c9)]:String(_0x3cda67)}),console[_0x5a384d(0x1c1)](_0x5a384d(0x1ec)+(_0x3cda67 instanceof Error?_0x3cda67[_0x5a384d(0x1c9)]:String(_0x3cda67))),process[_0x5a384d(0x1e3)](0x1);}else _0x5e283f={'mcpServers':{'lovrabet-dataset':_0x2dad42}},logger[_0x5a384d(0x1da)](_0x5a384d(0x1eb),_0x5a384d(0x1e7),{'path':_0x5a1684,'appcode':_0x4feffc,'env':_0x583375}),console[_0x5a384d(0x1cf)](_0x5a384d(0x1d5));writeFileSync(_0x5a1684,JSON['stringify'](_0x5e283f,null,0x2),{'encoding':'utf8'});const _0x470a67=resolve(_0x37b929,_0x5a384d(0x1cd)),_0x14938a=resolve(_0x470a67,_0x5a384d(0x1c3));if(!existsSync(_0x14938a))try{!existsSync(_0x470a67)&&(mkdirSync(_0x470a67,{'recursive':!![]}),logger['info'](_0x5a384d(0x1eb),'创建\x20.cursor/rules\x20目录',{'path':_0x470a67}));const _0x41ffc3=fileURLToPath(import.meta[_0x5a384d(0x1be)]),_0x114de7=dirname(_0x41ffc3),_0x9a7d9=resolve(_0x114de7,_0x5a384d(0x1ea));existsSync(_0x9a7d9)?(copyFileSync(_0x9a7d9,_0x14938a),logger['info'](_0x5a384d(0x1eb),_0x5a384d(0x1d0),{'from':_0x9a7d9,'to':_0x14938a}),console['log'](_0x5a384d(0x1ca))):logger['warn']('mcp-cursor',_0x5a384d(0x1df),{'templatePath':_0x9a7d9});}catch(_0x6c6fc7){logger[_0x5a384d(0x1c1)](_0x5a384d(0x1eb),_0x5a384d(0x1dc),{'error':_0x6c6fc7 instanceof Error?_0x6c6fc7[_0x5a384d(0x1c9)]:String(_0x6c6fc7)}),console[_0x5a384d(0x1e6)](_0x5a384d(0x1e1)+(_0x6c6fc7 instanceof Error?_0x6c6fc7[_0x5a384d(0x1c9)]:String(_0x6c6fc7)));}else logger[_0x5a384d(0x1da)](_0x5a384d(0x1eb),_0x5a384d(0x1d2),{'path':_0x14938a});console[_0x5a384d(0x1cf)](_0x5a384d(0x1db)),console[_0x5a384d(0x1cf)]('\x0a配置信息:'),console[_0x5a384d(0x1cf)](_0x5a384d(0x1bb)+_0x4feffc),console['log'](_0x5a384d(0x1e5)+_0x583375),console['log'](_0x5a384d(0x1d1)+_0x5a1684),console[_0x5a384d(0x1cf)](_0x5a384d(0x1de)),console[_0x5a384d(0x1cf)](_0x5a384d(0x1dd)),logger[_0x5a384d(0x1da)]('mcp-cursor','配置\x20Cursor\x20MCP\x20成功',{'appcode':_0x4feffc,'env':_0x583375,'configPath':_0x5a1684}),process[_0x5a384d(0x1e3)](0x0);}catch(_0x2efddf){logger[_0x5a384d(0x1c1)](_0x5a384d(0x1eb),_0x5a384d(0x1e0),{'error':_0x2efddf instanceof Error?_0x2efddf['message']:String(_0x2efddf)}),console[_0x5a384d(0x1c1)](_0x5a384d(0x1e9)+(_0x2efddf instanceof Error?_0x2efddf[_0x5a384d(0x1c9)]:String(_0x2efddf))),process['exit'](0x1);}}function a44_0x2be8(_0x5757b0,_0x2558e7){const _0x90a093=a44_0x90a0();return a44_0x2be8=function(_0x2be896,_0xc6b1bc){_0x2be896=_0x2be896-0x1ba;let _0x5e1844=_0x90a093[_0x2be896];return _0x5e1844;},a44_0x2be8(_0x5757b0,_0x2558e7);}function a44_0x90a0(){const _0x247cd6=['✓\x20创建\x20mcp.json\x20配置文件','✓\x20创建\x20.cursor\x20目录:\x20','827854btoyPi','✓\x20更新\x20mcp.json\x20配置','parse','info','\x0a✓\x20Cursor\x20MCP\x20配置成功!','复制\x20Cursor\x20Rules\x20文件失败','请重启\x20Cursor\x20以加载新的\x20MCP\x20配置。','\x0a现在您可以在\x20Cursor\x20中使用\x20Lovrabet\x20数据集\x20MCP\x20工具了。','Cursor\x20Rules\x20模板文件不存在','配置\x20Cursor\x20MCP\x20失败','警告:\x20复制\x20Cursor\x20Rules\x20文件失败:\x20','创建\x20.cursor\x20目录','exit','app','\x20\x20-\x20环境:\x20','warn','创建新的\x20mcp.json\x20配置','1456905zmrCZm','错误:\x20配置失败:\x20','../../templates/rules/lovrabet_rules.mdc.tpl','mcp-cursor','错误:\x20解析现有\x20mcp.json\x20失败:\x20','utf8','\x20\x20-\x20AppCode:\x20','2807SBYfib','mcpServers','url','appcode','@lovrabet/dataset-mcp-server','error','291060xtbZhB','lovrabet_rules.mdc','npx','解析现有\x20mcp.json\x20失败','3534705DoDcvP','2130HXIiap','lovrabet-dataset','message','✓\x20创建\x20Cursor\x20Rules\x20文件:\x20.cursor/rules/lovrabet_rules.mdc','188472wRVOeQ','857241urBqNL','rules','mcp.json','log','复制\x20Cursor\x20Rules\x20文件','\x20\x20-\x20配置文件:\x20','Cursor\x20Rules\x20文件已存在,跳过','4vXjJcf','.cursor'];a44_0x90a0=function(){return _0x247cd6;};return a44_0x90a0();}
|
package/lib/mcp/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x55ede4,_0x1c6628){var _0xad6b40=a45_0x432a,_0x5db480=_0x55ede4();while(!![]){try{var _0x265beb=-parseInt(_0xad6b40(0x18c))/0x1*(-parseInt(_0xad6b40(0x1a2))/0x2)+-parseInt(_0xad6b40(0x190))/0x3+-parseInt(_0xad6b40(0x1a0))/0x4*(-parseInt(_0xad6b40(0x198))/0x5)+-parseInt(_0xad6b40(0x19f))/0x6+-parseInt(_0xad6b40(0x192))/0x7+parseInt(_0xad6b40(0x18e))/0x8+parseInt(_0xad6b40(0x18d))/0x9;if(_0x265beb===_0x1c6628)break;else _0x5db480['push'](_0x5db480['shift']());}catch(_0x239f7b){_0x5db480['push'](_0x5db480['shift']());}}}(a45_0x3458,0x9ef23));function a45_0x3458(){var _0x52b031=['不支持的\x20IDE\x20类型:\x20','执行配置\x20Cursor\x20MCP\x20命令','647238mPEBpo','44pviQKs','未指定\x20IDE\x20类型','943864PHBiCx','cwd','错误:\x20不支持的\x20IDE\x20类型:\x20','\x20\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20配置\x20Cursor\x20的\x20MCP','错误:\x20请指定\x20IDE\x20类型','1sJRJgl','4151250OtacBR','1016344yGOUBz','\x0a使用方法:','1357776giweBE','info','2813426hLIFwl','\x0a当前支持的\x20IDE:','log','setLogPath','\x20\x20lovrabet\x20mcp\x20cursor','\x0a示例:','251455rQLThT','error','exit','mcp','toLowerCase'];a45_0x3458=function(){return _0x52b031;};return a45_0x3458();}import{configureCursorMcp}from'./cursor.js';function a45_0x432a(_0x36ff00,_0x3d3d98){var _0x34589a=a45_0x3458();return a45_0x432a=function(_0x432a0b,_0x30459a){_0x432a0b=_0x432a0b-0x18c;var _0x198633=_0x34589a[_0x432a0b];return _0x198633;},a45_0x432a(_0x36ff00,_0x3d3d98);}import{logger}from'../utils/logger.js';export async function mcpCommand(_0x5e7e43){var _0x3a0a07=a45_0x432a;logger[_0x3a0a07(0x195)](process[_0x3a0a07(0x1a3)]());if(!_0x5e7e43){console['error'](_0x3a0a07(0x1a6)),console['log'](_0x3a0a07(0x18f)),console['log'](_0x3a0a07(0x1a5)),console[_0x3a0a07(0x194)](_0x3a0a07(0x197)),console[_0x3a0a07(0x194)](_0x3a0a07(0x196)),logger[_0x3a0a07(0x199)](_0x3a0a07(0x19b),_0x3a0a07(0x1a1)),process[_0x3a0a07(0x19a)](0x1);return;}switch(_0x5e7e43[_0x3a0a07(0x19c)]()){case'cursor':logger[_0x3a0a07(0x191)]('mcp',_0x3a0a07(0x19e)),await configureCursorMcp();break;default:console[_0x3a0a07(0x199)](_0x3a0a07(0x1a4)+_0x5e7e43),console[_0x3a0a07(0x194)](_0x3a0a07(0x193)),console[_0x3a0a07(0x194)]('\x20\x20-\x20cursor'),logger[_0x3a0a07(0x199)](_0x3a0a07(0x19b),_0x3a0a07(0x19d)+_0x5e7e43),process['exit'](0x1);break;}}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x554aae=a46_0x9414;(function(_0x115038,_0x283fcb){const _0x3b309f=a46_0x9414,_0x31195f=_0x115038();while(!![]){try{const _0x4deab5=parseInt(_0x3b309f(0x18b))/0x1+-parseInt(_0x3b309f(0x187))/0x2*(-parseInt(_0x3b309f(0x183))/0x3)+parseInt(_0x3b309f(0x185))/0x4+-parseInt(_0x3b309f(0x182))/0x5+parseInt(_0x3b309f(0x186))/0x6+parseInt(_0x3b309f(0x18e))/0x7*(-parseInt(_0x3b309f(0x180))/0x8)+-parseInt(_0x3b309f(0x18d))/0x9;if(_0x4deab5===_0x283fcb)break;else _0x31195f['push'](_0x31195f['shift']());}catch(_0x56fa78){_0x31195f['push'](_0x31195f['shift']());}}}(a46_0x2c60,0x19933));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';function a46_0x9414(_0x2d4fd1,_0x1c9e86){const _0x2c60ca=a46_0x2c60();return a46_0x9414=function(_0x9414cc,_0x502d40){_0x9414cc=_0x9414cc-0x180;let _0xb55d15=_0x2c60ca[_0x9414cc];return _0xb55d15;},a46_0x9414(_0x2d4fd1,_0x1c9e86);}import{homedir}from'node:os';export const projectConfigPath=resolve(process['cwd'](),a46_0x554aae(0x189));function a46_0x2c60(){const _0x1288a6=['utf8','24BaxRiI','app','757275ffTVrJ','9489DOFpdj','appcode','277764iwrosr','1195548mWlowc','126RfsSvE','trim','.lovrabetrc','string','35766lSLiDA','parse','345411HgjCzP','488005hoKAhl'];a46_0x2c60=function(){return _0x1288a6;};return a46_0x2c60();}export const globalConfigPath=resolve(homedir(),a46_0x554aae(0x189));export function readConfig(){const _0x9d1f59=a46_0x554aae;let _0x3042b0={};try{if(existsSync(globalConfigPath)){const _0x41ac00=readFileSync(globalConfigPath,{'encoding':_0x9d1f59(0x18f)});_0x41ac00&&(_0x3042b0=JSON[_0x9d1f59(0x18c)](_0x41ac00));}}catch(_0x4aba56){}try{if(existsSync(projectConfigPath)){const _0x48337e=readFileSync(projectConfigPath,{'encoding':_0x9d1f59(0x18f)});if(_0x48337e){const _0x123b97=JSON[_0x9d1f59(0x18c)](_0x48337e);_0x3042b0={..._0x3042b0,..._0x123b97};}}}catch(_0x186029){}return _0x3042b0;}export function getConfigAppCode(){const _0x454c26=a46_0x554aae;let _0x3f7dcc={},_0x391040={};try{if(existsSync(globalConfigPath)){const _0x393956=readFileSync(globalConfigPath,{'encoding':_0x454c26(0x18f)});_0x393956&&(_0x391040=JSON[_0x454c26(0x18c)](_0x393956));}}catch(_0x168898){}try{if(existsSync(projectConfigPath)){const _0x36f6b0=readFileSync(projectConfigPath,{'encoding':_0x454c26(0x18f)});_0x36f6b0&&(_0x3f7dcc=JSON[_0x454c26(0x18c)](_0x36f6b0));}}catch(_0x10811c){}let _0x1abafd;if(_0x454c26(0x184)in _0x3f7dcc)_0x1abafd=_0x3f7dcc[_0x454c26(0x184)];else{if('app'in _0x3f7dcc)_0x1abafd=_0x3f7dcc[_0x454c26(0x181)];else{if('appcode'in _0x391040)_0x1abafd=_0x391040['appcode'];else'app'in _0x391040&&(_0x1abafd=_0x391040['app']);}}if(typeof _0x1abafd!==_0x454c26(0x18a)||_0x1abafd[_0x454c26(0x188)]()==='')return undefined;return _0x1abafd;}export function isInProject(){return existsSync(projectConfigPath);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xbd2d7e,_0x2158e9){const _0x3e1015=a47_0x266a,_0x1bde29=_0xbd2d7e();while(!![]){try{const _0x7b704f=-parseInt(_0x3e1015(0xc8))/0x1+parseInt(_0x3e1015(0xca))/0x2*(-parseInt(_0x3e1015(0xc7))/0x3)+-parseInt(_0x3e1015(0xc5))/0x4*(parseInt(_0x3e1015(0xcb))/0x5)+-parseInt(_0x3e1015(0xc4))/0x6+parseInt(_0x3e1015(0xc9))/0x7+-parseInt(_0x3e1015(0xcc))/0x8*(-parseInt(_0x3e1015(0xc2))/0x9)+parseInt(_0x3e1015(0xbd))/0xa;if(_0x7b704f===_0x2158e9)break;else _0x1bde29['push'](_0x1bde29['shift']());}catch(_0x3d67a9){_0x1bde29['push'](_0x1bde29['shift']());}}}(a47_0x2681,0xa777d));function a47_0x266a(_0x2fef56,_0x340f52){const _0x268168=a47_0x2681();return a47_0x266a=function(_0x266a2e,_0x5cef71){_0x266a2e=_0x266a2e-0xbd;let _0x349e66=_0x268168[_0x266a2e];return _0x349e66;},a47_0x266a(_0x2fef56,_0x340f52);}import a47_0x465103 from'node:path';function a47_0x2681(){const _0x10c87f=['join','9sYRsFe','readdirSync','1924368iiyPse','47076cMvfZy','error','13803OlRKse','1320907OVufsv','303807IKSXmK','502kIUikq','90sGjuAC','1089256QjVvmL','35147190zCJhOV','copyFileSync','复制目录时出错:','isDirectory'];a47_0x2681=function(){return _0x10c87f;};return a47_0x2681();}import a47_0x104fa1 from'node:fs';export async function copyDirectory(_0x20bcb9,_0x56f531){const _0x34caea=a47_0x266a;try{const _0x5f1434=a47_0x104fa1[_0x34caea(0xc3)](_0x20bcb9,{'withFileTypes':!![]});a47_0x104fa1['mkdirSync'](_0x56f531,{'recursive':!![]});for(const _0x11d8dd of _0x5f1434){const _0x45386a=a47_0x465103['join'](_0x20bcb9,_0x11d8dd['name']),_0xc9ebf=a47_0x465103[_0x34caea(0xc1)](_0x56f531,_0x11d8dd['name']);_0x11d8dd[_0x34caea(0xc0)]()?await copyDirectory(_0x45386a,_0xc9ebf):a47_0x104fa1[_0x34caea(0xbe)](_0x45386a,_0xc9ebf);}}catch(_0x44251b){console[_0x34caea(0xc6)](_0x34caea(0xbf),_0x44251b);}}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a48_0x450d(_0x10c978,_0x68cf31){const _0x3f0ab1=a48_0x3f0a();return a48_0x450d=function(_0x450d47,_0x52fdae){_0x450d47=_0x450d47-0x156;let _0x274db8=_0x3f0ab1[_0x450d47];return _0x274db8;},a48_0x450d(_0x10c978,_0x68cf31);}(function(_0x1ae347,_0x3746d1){const _0x1670b1=a48_0x450d,_0x473c1f=_0x1ae347();while(!![]){try{const _0x63cbb7=-parseInt(_0x1670b1(0x16a))/0x1+-parseInt(_0x1670b1(0x158))/0x2*(-parseInt(_0x1670b1(0x168))/0x3)+parseInt(_0x1670b1(0x15d))/0x4*(-parseInt(_0x1670b1(0x163))/0x5)+parseInt(_0x1670b1(0x15a))/0x6+-parseInt(_0x1670b1(0x157))/0x7+-parseInt(_0x1670b1(0x160))/0x8*(-parseInt(_0x1670b1(0x16c))/0x9)+parseInt(_0x1670b1(0x16f))/0xa;if(_0x63cbb7===_0x3746d1)break;else _0x473c1f['push'](_0x473c1f['shift']());}catch(_0x1e9982){_0x473c1f['push'](_0x473c1f['shift']());}}}(a48_0x3f0a,0xe46ba));function a48_0x3f0a(){const _0x213b4a=['application/json','129835kLFKdy','name','content-type','*\x20请求失败,','headers','6vKYQeQ','fetch','1002370GAPdkl','TypeError','275013rxhNPo','abort','AbortError','11255950LSGREM','json','status','10181297zTeVxT','1152722UoHKKa','text','5391972PjalIG','ENOTFOUND','message','28cYWbpU','get','log','104RMIMbe','includes'];a48_0x3f0a=function(){return _0x213b4a;};return a48_0x3f0a();}export async function httpRequest(_0x4d604a,_0x157047={}){const _0x3b5298=a48_0x450d,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x157047;let _0x2d84ac=null;for(let _0x1ef0ba=0x0;_0x1ef0ba<=retries;_0x1ef0ba++){try{const _0xedf8f=new AbortController(),_0x54c03b=setTimeout(()=>_0xedf8f[_0x3b5298(0x16d)](),timeout),_0x4e2316=await fetch(_0x4d604a,{'headers':headers,'signal':_0xedf8f['signal']});clearTimeout(_0x54c03b);let _0x1b438a;const _0x5afe1b=_0x4e2316[_0x3b5298(0x167)][_0x3b5298(0x15e)](_0x3b5298(0x165));return _0x5afe1b?.['includes'](_0x3b5298(0x162))?_0x1b438a=await _0x4e2316[_0x3b5298(0x170)]():_0x1b438a=await _0x4e2316[_0x3b5298(0x159)](),{'ok':_0x4e2316['ok'],'status':_0x4e2316[_0x3b5298(0x156)],'statusText':_0x4e2316['statusText'],'data':_0x1b438a,'headers':_0x4e2316[_0x3b5298(0x167)],'url':_0x4e2316['url'],'text':()=>_0x4e2316['text']()};}catch(_0x3302f7){_0x2d84ac=_0x3302f7 instanceof Error?_0x3302f7:new Error(String(_0x3302f7));if(_0x1ef0ba===retries)break;if(shouldRetry(_0x3302f7)){console[_0x3b5298(0x15f)](_0x3b5298(0x166)+retryDelay+'ms\x20后进行第\x20'+(_0x1ef0ba+0x1)+'\x20次重试...'),await sleep(retryDelay);continue;}else break;}}throw _0x2d84ac||new Error('Request\x20failed');}function shouldRetry(_0x5dfbc5){const _0x49d888=a48_0x450d;if(_0x5dfbc5 instanceof Error){if(_0x5dfbc5[_0x49d888(0x164)]===_0x49d888(0x16e))return![];if(_0x5dfbc5[_0x49d888(0x164)]===_0x49d888(0x16b)&&_0x5dfbc5[_0x49d888(0x15c)][_0x49d888(0x161)](_0x49d888(0x169)))return!![];if(_0x5dfbc5[_0x49d888(0x15c)][_0x49d888(0x161)]('ECONNRESET'))return!![];if(_0x5dfbc5[_0x49d888(0x15c)]['includes'](_0x49d888(0x15b)))return![];}return![];}function sleep(_0x573574){return new Promise(_0x1db92d=>setTimeout(_0x1db92d,_0x573574));}export function validateUrl(_0x2f931d){try{return new URL(_0x2f931d),!![];}catch{return![];}}
|