@lovrabet/cli 1.3.3 → 1.3.4-beta.1
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/ai-setup/AISetupUI.js +1 -1
- package/lib/ai-setup/config.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -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-flags.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-execa.js +1 -0
- 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/non-interactive.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/i18n/I18nProvider.js +1 -1
- package/lib/i18n/hooks.js +1 -1
- package/lib/i18n/index.js +1 -1
- package/lib/i18n/locales/en-US.js +1 -1
- package/lib/i18n/locales/zh-CN.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/SkillInstallUI.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/skill-install-non-interactive.js +1 -1
- package/lib/skills/skill-installer.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +4 -1
- package/templates/README.md +10 -55
- package/lib/add-page/input-page-router.js +0 -1
- package/lib/add-page/main.js +0 -1
- package/lib/add-page/select-page-template.js +0 -1
- package/lib/utils/router-updater.js +0 -1
- package/templates/pages/blank/index.tsx.tpl +0 -13
- package/templates/pages/sdk-fetch/index.tsx.tpl +0 -80
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x33d237,_0x50d316){const _0xc0802e=a44_0xc915,_0x2b4b38=_0x33d237();while(!![]){try{const _0x368372=-parseInt(_0xc0802e(0xd2))/0x1*(parseInt(_0xc0802e(0x136))/0x2)+-parseInt(_0xc0802e(0x121))/0x3*(parseInt(_0xc0802e(0x135))/0x4)+parseInt(_0xc0802e(0xe1))/0x5+-parseInt(_0xc0802e(0xcf))/0x6+parseInt(_0xc0802e(0xec))/0x7+parseInt(_0xc0802e(0x13a))/0x8+-parseInt(_0xc0802e(0x108))/0x9*(-parseInt(_0xc0802e(0x10b))/0xa);if(_0x368372===_0x50d316)break;else _0x2b4b38['push'](_0x2b4b38['shift']());}catch(_0x260533){_0x2b4b38['push'](_0x2b4b38['shift']());}}}(a44_0x2a05,0xd3c21));import{jsx as a44_0x5cd38c,Fragment as a44_0x527903,jsxs as a44_0x4fbcb3}from'react/jsx-runtime';import a44_0x15ba96 from'path';function a44_0xc915(_0x381ce6,_0x906e08){_0x381ce6=_0x381ce6-0xcc;const _0x2a0519=a44_0x2a05();let _0xc91585=_0x2a0519[_0x381ce6];return _0xc91585;}import a44_0x2faac5 from'fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';function a44_0x2a05(){const _0x3170d4=['appCode','\x20Skill\x20','resolve','create.nextSteps.startProject','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','cursor','message','mcp','dirname','selectedIDEs','accessSync','create.steps.pullingApi','create.steps.apiPullFailed','trim','projectName','72fEPMHq','string','length','3653270euftZS','existsSync','doTask','API\x20配置拉取失败:\x20','package.json','online','create','\x20Generated\x20by\x20lovrabet\x20cli\x20','aiSetup','repeat','toLocaleString','create.lovrabetSetup.mcpCompleted','projectCode','../..','\x20\x20✗\x20Skill\x20','create.packageJson.updating','version','create.validation.tooLong','yellow','needsUpgrade','配置应用AppCode失败','create.errors.createFailed','3525558AcjGZm','Claude\x20Code','CLI\x20版本检查','\x20\x20✗\x20MCP\x20','create.results.nextSteps','更新\x20package.json\x20失败','create.config.configuringAppCode','name','配置应用AppCode:\x20','constants','mcp-','gray','W_OK','2.\x20','create.cleanup.inProgress','skill','description','setLogPath','开始创建项目:\x20','push','4cjldIH','10xhDZxb','create.config.createdWithoutAppCode','cwd','ide','615304inxWCa','filter','stringify','manual','API\x20配置拉取异常','test','3.\x20','create.steps.mcpConfigComplete','create.validation.invalidChars','\x20√\x20','lovrabet\x20skill\x20install','7167066SADubs','lovrabet\x20api\x20pull','white','188527AEfzIQ','create.nextSteps.pullApi','writeFileSync','pullApi','status','green','then','env','1.0.0','warn','cyan','column','API\x20配置拉取成功:\x20','parse','create.lovrabetSetup.inProgress','2155935NpvemF','map','.lovrabetrc','create.packageJson.updated','清理项目目录失败:\x20','create.config.creating','error','log','cd\x20','success','create.lovrabetSetup.skillCompleted','5242839psOTTC','create.display.appCode','red','create.display.projectName','join','create.validation.dirExists','info','lovrabet\x20config\x20set\x20appcode\x20[app-code]','Cursor','\x20&&\x20lovrabet\x20start','utf8','has','readFileSync'];a44_0x2a05=function(){return _0x3170d4;};return a44_0x2a05();}import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';import{configureMcp,copySharedSkills,installSkill,createSkillManifest}from'../ai-setup/config.js';import{MCP_IDES}from'../utils/ai_config.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';import{useI18n}from'../i18n/hooks.js';export function CreateApp(_0xf7a107){const _0x31fef6=a44_0xc915,{t:_0x3fadba}=useI18n(),[_0x1f8365,_0x201347]=useState(![]),[_0x525927,_0x1319b6]=useState(![]),[_0x21c010,_0x34dd49]=useState(null),[_0x16edde,_0x3b25ec]=useState(null),_0x3efa72=useCopyProjectTemplate(),_0x329dfe=useInstallDependencies(),_0x537b51=useFormatCode();useEffect(()=>{const _0x5f438e=a44_0xc915;checkCliVersion()[_0x5f438e(0xd8)](_0x1495b5=>{const _0x557350=_0x5f438e;_0x1495b5[_0x557350(0x11e)]&&(printCliUpgradeWarning(_0x1495b5),logger[_0x557350(0xf2)](_0x557350(0x111),_0x557350(0x123),{'currentVersion':_0x1495b5['currentVersion'],'stableVersion':_0x1495b5['stableVersion'],'needsUpgrade':_0x1495b5[_0x557350(0x11e)]}));});},[]);const _0x25a4e7=async _0x12211f=>{const _0x47b455=a44_0xc915;if(!_0x12211f[_0x47b455(0x107)]||_0x12211f[_0x47b455(0x107)][_0x47b455(0x106)]()===''){console[_0x47b455(0xe7)](_0x3fadba('create.validation.required'));return;}const _0x52053e=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x52053e[_0x47b455(0x13f)](_0x12211f[_0x47b455(0x107)])){console[_0x47b455(0xe7)](_0x3fadba(_0x47b455(0xcc)));return;}if(_0x12211f[_0x47b455(0x107)]['length']>0x64){console[_0x47b455(0xe7)](_0x3fadba(_0x47b455(0x11c)));return;}const _0x30a1e7=a44_0x15ba96[_0x47b455(0xfb)](process[_0x47b455(0x138)](),_0x12211f[_0x47b455(0x107)]);if(a44_0x2faac5[_0x47b455(0x10c)](_0x30a1e7)){console[_0x47b455(0xe7)](_0x3fadba(_0x47b455(0xf1),{'name':_0x12211f[_0x47b455(0x107)]}));return;}try{const _0xd4ccb1=a44_0x15ba96[_0x47b455(0x101)](_0x30a1e7);a44_0x2faac5[_0x47b455(0x103)](_0xd4ccb1,a44_0x2faac5[_0x47b455(0x12a)][_0x47b455(0x12d)]);}catch(_0x2229ed){console['error'](_0x3fadba('create.validation.noPermission'));return;}_0x34dd49(_0x12211f),_0x201347(!![]),logger[_0x47b455(0x132)](_0x30a1e7),logger['info'](_0x47b455(0x111),_0x47b455(0x133)+_0x12211f['projectName'],{'projectDir':_0x30a1e7,'appCode':_0x12211f[_0x47b455(0xf9)]});try{await _0x3efa72[_0x47b455(0x10d)](_0x12211f[_0x47b455(0x107)]),await _0x3d8e53(_0x12211f[_0x47b455(0x107)]),await _0x329dfe[_0x47b455(0x10d)](_0x12211f[_0x47b455(0x107)]),await _0x537b51[_0x47b455(0x10d)](_0x12211f[_0x47b455(0x107)]),await _0x4cdd5b(_0x12211f[_0x47b455(0x107)],_0x12211f[_0x47b455(0xf9)]||'',_0x12211f[_0x47b455(0xd9)]);if(_0x12211f['pullApi']&&_0x12211f[_0x47b455(0xf9)]){console['log'](_0x3fadba(_0x47b455(0x104)));try{const _0x3bda20=await pullApiSilent(_0x12211f[_0x47b455(0xf9)],undefined,_0x30a1e7,_0x12211f[_0x47b455(0xd9)]);_0x3bda20?(console[_0x47b455(0xe8)](_0x3fadba('create.steps.apiPullSuccess')),logger[_0x47b455(0xf2)](_0x47b455(0x111),_0x47b455(0xde)+_0x12211f[_0x47b455(0xf9)])):(console[_0x47b455(0xe8)](_0x3fadba(_0x47b455(0x105))),logger[_0x47b455(0xdb)](_0x47b455(0x111),_0x47b455(0x10e)+_0x12211f[_0x47b455(0xf9)]));}catch(_0x106967){console['log'](_0x3fadba('create.steps.apiPullError')),logger[_0x47b455(0xdb)](_0x47b455(0x111),_0x47b455(0x13e),{'error':_0x106967 instanceof Error?_0x106967[_0x47b455(0xff)]:String(_0x106967)});}}if(_0x12211f[_0x47b455(0x113)]&&_0x12211f['selectedIDEs']&&_0x12211f[_0x47b455(0x102)][_0x47b455(0x10a)]>0x0&&_0x12211f['appCode']){console['log'](_0x3fadba(_0x47b455(0xe0)));const _0x6c33f0=[],_0x3dbf25=[],_0x32b468=_0x12211f['selectedIDEs'][_0x47b455(0x13b)](_0x2483ea=>MCP_IDES[_0x47b455(0xf7)](_0x2483ea)),_0x5286b5=_0x12211f[_0x47b455(0x102)];for(const _0x43811d of _0x32b468){try{const _0x474f58=await configureMcp(_0x43811d,_0x30a1e7);_0x6c33f0[_0x47b455(0x134)]({'ide':_0x43811d===_0x47b455(0xfe)?_0x47b455(0xf4):_0x47b455(0x122),'status':_0x474f58[_0x47b455(0xd6)],'message':_0x474f58[_0x47b455(0xff)]}),console[_0x47b455(0xe8)]('\x20\x20'+(_0x474f58['status']==='success'?'✓':_0x474f58['status']===_0x47b455(0x13d)?'⚠️':'✗')+'\x20MCP\x20'+_0x43811d+':\x20'+_0x474f58[_0x47b455(0xff)]);}catch(_0x434112){_0x6c33f0['push']({'ide':_0x43811d===_0x47b455(0xfe)?'Cursor':_0x47b455(0x122),'status':_0x47b455(0xe7),'message':_0x434112 instanceof Error?_0x434112['message']:String(_0x434112)}),console[_0x47b455(0xe8)](_0x47b455(0x124)+_0x43811d+':\x20'+(_0x434112 instanceof Error?_0x434112[_0x47b455(0xff)]:String(_0x434112)));}}await copySharedSkills(_0x30a1e7);for(const _0x37010d of _0x5286b5){try{const _0x4de996=await installSkill(_0x37010d,_0x30a1e7);_0x3dbf25[_0x47b455(0x134)]({'ide':_0x4de996[_0x47b455(0x139)],'status':_0x4de996[_0x47b455(0xd6)],'message':_0x4de996[_0x47b455(0xff)]}),console['log']('\x20\x20'+(_0x4de996[_0x47b455(0xd6)]===_0x47b455(0xea)?'✓':'✗')+_0x47b455(0xfa)+_0x4de996[_0x47b455(0x139)]+':\x20'+_0x4de996[_0x47b455(0xff)]);}catch(_0x20d3c5){_0x3dbf25[_0x47b455(0x134)]({'ide':_0x37010d,'status':'error','message':_0x20d3c5 instanceof Error?_0x20d3c5[_0x47b455(0xff)]:String(_0x20d3c5)}),console[_0x47b455(0xe8)](_0x47b455(0x119)+_0x37010d+':\x20'+(_0x20d3c5 instanceof Error?_0x20d3c5[_0x47b455(0xff)]:String(_0x20d3c5)));}}if(_0x3dbf25['length']>0x0){const _0x566da3=_0x3dbf25[_0x47b455(0x13b)](_0x364132=>_0x364132[_0x47b455(0xd6)]===_0x47b455(0xea))['map'](_0x17cc61=>_0x17cc61[_0x47b455(0x139)]);_0x566da3[_0x47b455(0x10a)]>0x0&&createSkillManifest(_0x30a1e7,_0x566da3);}_0x3b25ec({'mcp':_0x6c33f0,'skill':_0x3dbf25}),console['log'](_0x3fadba(_0x47b455(0x141)));}logger['success'](_0x47b455(0x111),'项目创建完成:\x20'+_0x12211f['projectName']),_0x1319b6(!![]),_0x201347(![]);}catch(_0x5dab9c){logger['error'](_0x47b455(0x111),'项目创建失败:\x20'+_0x12211f[_0x47b455(0x107)],{'error':_0x5dab9c instanceof Error?_0x5dab9c[_0x47b455(0xff)]:String(_0x5dab9c)});try{a44_0x2faac5[_0x47b455(0x10c)](_0x30a1e7)&&(console[_0x47b455(0xe8)](_0x3fadba(_0x47b455(0x12f),{'dir':_0x30a1e7})),a44_0x2faac5['rmSync'](_0x30a1e7,{'recursive':!![],'force':!![]}));}catch(_0x2919ec){logger[_0x47b455(0xdb)]('create',_0x47b455(0xe5)+_0x30a1e7);}_0x201347(![]),console[_0x47b455(0xe7)](_0x3fadba(_0x47b455(0x120),{'error':_0x5dab9c instanceof Error?_0x5dab9c[_0x47b455(0xff)]:String(_0x5dab9c)}));}},_0x508e60=async _0x8535dc=>{const _0x439a04=a44_0xc915;await _0x25a4e7({'projectName':_0x8535dc,'env':_0xf7a107[_0x439a04(0xd9)]});},_0x3d8e53=async _0x25b215=>{const _0x17e30b=a44_0xc915,_0x57d53d=a44_0x15ba96[_0x17e30b(0xfb)](process[_0x17e30b(0x138)](),_0x25b215),_0x305e25=a44_0x15ba96[_0x17e30b(0xf0)](_0x57d53d,_0x17e30b(0x10f));try{console[_0x17e30b(0xe8)](_0x3fadba(_0x17e30b(0x11a)));const _0x452c3c=fileURLToPath(import.meta.url),_0x31afd7=a44_0x15ba96[_0x17e30b(0xfb)](a44_0x15ba96[_0x17e30b(0x101)](_0x452c3c),_0x17e30b(0x118)),_0x8ef061=a44_0x15ba96[_0x17e30b(0xf0)](_0x31afd7,_0x17e30b(0x10f));let _0x4974f7=_0x17e30b(0xda);try{const _0xfcf02d=JSON[_0x17e30b(0xdf)](a44_0x2faac5[_0x17e30b(0xf8)](_0x8ef061,'utf8'));_0x4974f7=_0xfcf02d[_0x17e30b(0x11b)]||'1.0.0';}catch(_0x403c9c){}const _0x45af45=a44_0x2faac5[_0x17e30b(0xf8)](_0x305e25,_0x17e30b(0xf6)),_0x531631=JSON[_0x17e30b(0xdf)](_0x45af45);_0x531631[_0x17e30b(0x128)]=_0x25b215,_0x531631[_0x17e30b(0x131)]=_0x25b215+_0x17e30b(0x112)+_0x4974f7,a44_0x2faac5[_0x17e30b(0xd4)](_0x305e25,JSON[_0x17e30b(0x13c)](_0x531631,null,0x2)+'\x0a',_0x17e30b(0xf6)),console[_0x17e30b(0xe8)](_0x3fadba(_0x17e30b(0xe4),{'name':_0x25b215})),logger[_0x17e30b(0xf2)](_0x17e30b(0x111),'更新\x20package.json\x20name');}catch(_0x883f66){logger[_0x17e30b(0xe7)](_0x17e30b(0x111),_0x17e30b(0x126));throw _0x883f66;}},_0x4cdd5b=async(_0xce616f,_0x2e4d7a,_0x13960a)=>{const _0x468434=a44_0xc915,_0x5f4dfd=a44_0x15ba96[_0x468434(0xfb)](process[_0x468434(0x138)](),_0xce616f),_0x417e66=a44_0x15ba96['join'](_0x5f4dfd,_0x468434(0xe3));try{_0x2e4d7a?console['log'](_0x3fadba(_0x468434(0x127),{'name':_0xce616f,'appCode':_0x2e4d7a})):console['log'](_0x3fadba(_0x468434(0xe6),{'name':_0xce616f}));const _0x32c237=fileURLToPath(import.meta.url),_0x129417=a44_0x15ba96[_0x468434(0xfb)](a44_0x15ba96[_0x468434(0x101)](_0x32c237),_0x468434(0x118)),_0x35e213=a44_0x15ba96[_0x468434(0xf0)](_0x129417,'package.json');let _0x13baf2=_0x468434(0xda);try{const _0x2c0461=JSON[_0x468434(0xdf)](a44_0x2faac5[_0x468434(0xf8)](_0x35e213,_0x468434(0xf6)));_0x13baf2=_0x2c0461[_0x468434(0x11b)]||_0x468434(0xda);}catch(_0x428319){}const _0xb0dbb4=readConfig(),_0x329b45=typeof _0xb0dbb4[_0x468434(0xd9)]===_0x468434(0x109)?_0xb0dbb4[_0x468434(0xd9)]:undefined,{app:_0x57590d,appcode:_0x5f3152,..._0x2f7c74}=_0xb0dbb4,_0x2e947b={..._0x2f7c74,'appcode':_0x2e4d7a||'','env':_0x13960a||_0x329b45||_0x468434(0x110),'createdAt':new Date()[_0x468434(0x115)](),'version':_0x13baf2};a44_0x2faac5[_0x468434(0xd4)](_0x417e66,JSON['stringify'](_0x2e947b,null,0x2),_0x468434(0xf6)),_0x2e4d7a?console['log'](_0x3fadba('create.config.createdWithAppCode',{'appCode':_0x2e4d7a})):console[_0x468434(0xe8)](_0x3fadba(_0x468434(0x137))),logger[_0x468434(0xf2)](_0x468434(0x111),_0x468434(0x129)+_0x2e4d7a);}catch(_0x561695){logger[_0x468434(0xe7)](_0x468434(0x111),_0x468434(0x11f));}};useEffect(()=>{const _0x2f66b7=a44_0xc915;_0xf7a107[_0x2f66b7(0x117)]&&_0x508e60(_0xf7a107[_0x2f66b7(0x117)]);},[_0xf7a107[_0x31fef6(0x117)]]);if(!_0x1f8365&&!_0x525927&&!_0xf7a107[_0x31fef6(0x117)])return a44_0x5cd38c(EnhancedGuidedCreate,{'onCreate':_0x25a4e7,'env':_0xf7a107[_0x31fef6(0xd9)]});if(_0x1f8365)return a44_0x4fbcb3(a44_0x527903,{'children':[a44_0x4fbcb3(Box,{'marginTop':0x1,'children':[a44_0x5cd38c(Box,{'width':'1'}),a44_0x5cd38c(Text,{'color':'green','children':_0x31fef6(0xcd)}),a44_0x5cd38c(Text,{'children':_0x3fadba(_0x31fef6(0xef))}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xd7),'children':_0x21c010?.[_0x31fef6(0x107)]}),_0x21c010?.['appCode']&&a44_0x4fbcb3(a44_0x527903,{'children':[a44_0x5cd38c(Text,{'children':_0x3fadba(_0x31fef6(0xed))}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xdc),'children':_0x21c010[_0x31fef6(0xf9)]})]})]}),a44_0x5cd38c(TaskRunning,{..._0x3efa72}),a44_0x5cd38c(TaskRunning,{..._0x329dfe}),a44_0x5cd38c(TaskRunning,{..._0x537b51})]});if(_0x525927){const _0xf7b6e7=_0x16edde&&(_0x16edde['mcp']['length']>0x0||_0x16edde[_0x31fef6(0x130)][_0x31fef6(0x10a)]>0x0);return a44_0x4fbcb3(a44_0x527903,{'children':[a44_0x4fbcb3(Box,{'marginTop':0x1,'children':[a44_0x5cd38c(Box,{'width':'1'}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xd7),'children':_0x31fef6(0xcd)}),a44_0x5cd38c(Text,{'children':_0x3fadba(_0x31fef6(0xef))}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xd7),'children':_0x21c010?.[_0x31fef6(0x107)]}),_0x21c010?.[_0x31fef6(0xf9)]&&a44_0x4fbcb3(a44_0x527903,{'children':[a44_0x5cd38c(Text,{'children':_0x3fadba('create.display.appCode')}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xdc),'children':_0x21c010[_0x31fef6(0xf9)]})]})]}),a44_0x5cd38c(TaskFinished,{..._0x3efa72}),a44_0x5cd38c(TaskFinished,{..._0x329dfe}),a44_0x5cd38c(TaskFinished,{..._0x537b51}),a44_0x5cd38c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a44_0x5cd38c(Text,{'color':_0x31fef6(0xd7),'children':'─'[_0x31fef6(0x114)](0x3c)})}),_0xf7b6e7&&a44_0x4fbcb3(a44_0x527903,{'children':[_0x16edde['mcp']['length']>0x0&&a44_0x4fbcb3(a44_0x527903,{'children':[a44_0x5cd38c(Box,{'marginTop':0x1,'children':a44_0x5cd38c(Text,{'color':'green','bold':!![],'children':_0x3fadba(_0x31fef6(0x116))})}),_0x16edde[_0x31fef6(0x100)][_0x31fef6(0xe2)]((_0x4d075b,_0x39cd77)=>a44_0x5cd38c(Box,{'marginLeft':0x2,'children':a44_0x4fbcb3(Text,{'color':_0x4d075b[_0x31fef6(0xd6)]===_0x31fef6(0xea)?_0x31fef6(0xd1):_0x4d075b[_0x31fef6(0xd6)]===_0x31fef6(0x13d)?_0x31fef6(0x11d):_0x31fef6(0xee),'children':[_0x4d075b[_0x31fef6(0x139)],':\x20',_0x4d075b[_0x31fef6(0xff)]]})},_0x31fef6(0x12b)+_0x39cd77))]}),_0x16edde['skill'][_0x31fef6(0x10a)]>0x0&&a44_0x4fbcb3(a44_0x527903,{'children':[a44_0x5cd38c(Box,{'marginTop':_0x16edde[_0x31fef6(0x100)][_0x31fef6(0x10a)]>0x0?0x1:0x0,'children':a44_0x5cd38c(Text,{'color':'green','bold':!![],'children':_0x3fadba(_0x31fef6(0xeb))})}),_0x16edde[_0x31fef6(0x130)][_0x31fef6(0xe2)]((_0x37f5ea,_0x339db1)=>a44_0x5cd38c(Box,{'marginLeft':0x2,'children':a44_0x4fbcb3(Text,{'color':_0x37f5ea[_0x31fef6(0xd6)]===_0x31fef6(0xea)?_0x31fef6(0xd1):_0x31fef6(0xee),'children':[_0x37f5ea['ide'],':\x20',_0x37f5ea[_0x31fef6(0xff)]]})},'skill-'+_0x339db1))]}),a44_0x5cd38c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a44_0x5cd38c(Text,{'color':'green','children':'─'[_0x31fef6(0x114)](0x3c)})})]}),a44_0x5cd38c(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a44_0x5cd38c(Text,{'color':'cyan','bold':!![],'children':_0x3fadba(_0x31fef6(0x125))})}),a44_0x4fbcb3(Box,{'marginLeft':0x2,'flexDirection':_0x31fef6(0xdd),'children':[_0xf7b6e7?a44_0x4fbcb3(a44_0x527903,{'children':[a44_0x4fbcb3(Box,{'children':[a44_0x5cd38c(Text,{'color':_0x31fef6(0xd7),'children':'1.\x20'}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xd1),'children':_0x3fadba(_0x31fef6(0xfc))}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xdc),'bold':!![],'children':_0x31fef6(0xe9)+_0x21c010?.[_0x31fef6(0x107)]+_0x31fef6(0xf5)})]}),_0x21c010?.[_0x31fef6(0xf9)]&&!_0x21c010?.[_0x31fef6(0xd5)]&&a44_0x4fbcb3(Box,{'children':[a44_0x5cd38c(Text,{'color':_0x31fef6(0x11d),'children':_0x31fef6(0x12e)}),a44_0x5cd38c(Text,{'color':'white','children':_0x3fadba(_0x31fef6(0xd3))}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xdc),'bold':!![],'children':_0x31fef6(0xd0)})]})]}):a44_0x4fbcb3(a44_0x527903,{'children':[a44_0x5cd38c(Box,{'children':a44_0x5cd38c(Text,{'color':_0x31fef6(0x11d),'bold':!![],'children':_0x3fadba('create.nextSteps.configureMcpAndSkill')})}),a44_0x4fbcb3(Box,{'marginLeft':0x2,'marginTop':0x1,'children':[a44_0x5cd38c(Text,{'color':_0x31fef6(0xd1),'children':_0x3fadba('create.nextSteps.skill')}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xdc),'bold':!![],'children':_0x31fef6(0xce)})]}),a44_0x4fbcb3(Box,{'marginLeft':0x2,'children':[a44_0x5cd38c(Text,{'color':'white','children':_0x3fadba('create.nextSteps.mcp')}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xdc),'bold':!![],'children':'lovrabet\x20mcp\x20install'})]}),a44_0x4fbcb3(Box,{'marginTop':0x1,'children':[a44_0x5cd38c(Text,{'color':'green','children':_0x31fef6(0x12e)}),a44_0x5cd38c(Text,{'color':'white','children':_0x3fadba('create.nextSteps.startProject')}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xdc),'bold':!![],'children':_0x31fef6(0xe9)+_0x21c010?.[_0x31fef6(0x107)]+'\x20&&\x20lovrabet\x20start'})]}),_0x21c010?.[_0x31fef6(0xf9)]&&!_0x21c010?.[_0x31fef6(0xd5)]&&a44_0x4fbcb3(Box,{'children':[a44_0x5cd38c(Text,{'color':_0x31fef6(0x11d),'children':_0x31fef6(0x140)}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xd1),'children':_0x3fadba(_0x31fef6(0xd3))}),a44_0x5cd38c(Text,{'color':'cyan','bold':!![],'children':_0x31fef6(0xd0)})]})]}),!_0x21c010?.[_0x31fef6(0xf9)]&&a44_0x4fbcb3(a44_0x527903,{'children':[a44_0x4fbcb3(Box,{'children':[a44_0x5cd38c(Text,{'color':'gray','children':_0x31fef6(0x12e)}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xd1),'children':_0x3fadba('create.nextSteps.configAppCode')}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xdc),'bold':!![],'children':_0x31fef6(0xf3)})]}),a44_0x4fbcb3(Box,{'children':[a44_0x5cd38c(Text,{'color':_0x31fef6(0x12c),'children':_0x31fef6(0x140)}),a44_0x5cd38c(Text,{'color':_0x31fef6(0xd1),'children':_0x3fadba(_0x31fef6(0xd3))}),a44_0x5cd38c(Text,{'color':'cyan','bold':!![],'children':_0x31fef6(0xfd)})]})]})]}),a44_0x5cd38c(Box,{'marginTop':0x1,'children':a44_0x5cd38c(Text,{'color':'green','children':'─'['repeat'](0x3c)})})]});}return null;}
|
|
1
|
+
(function(_0x511262,_0x29acba){const _0x104cea=a42_0x4fbd,_0x32334b=_0x511262();while(!![]){try{const _0x3ceb1e=-parseInt(_0x104cea(0x1ee))/0x1*(-parseInt(_0x104cea(0x203))/0x2)+parseInt(_0x104cea(0x1c6))/0x3+-parseInt(_0x104cea(0x1b5))/0x4*(-parseInt(_0x104cea(0x1b7))/0x5)+-parseInt(_0x104cea(0x198))/0x6*(-parseInt(_0x104cea(0x1d4))/0x7)+-parseInt(_0x104cea(0x1c1))/0x8*(-parseInt(_0x104cea(0x1cc))/0x9)+-parseInt(_0x104cea(0x207))/0xa+-parseInt(_0x104cea(0x1aa))/0xb*(parseInt(_0x104cea(0x1a6))/0xc);if(_0x3ceb1e===_0x29acba)break;else _0x32334b['push'](_0x32334b['shift']());}catch(_0x581613){_0x32334b['push'](_0x32334b['shift']());}}}(a42_0x1f45,0xa04dc));import{jsx as a42_0x579522,Fragment as a42_0x215853,jsxs as a42_0x4b813b}from'react/jsx-runtime';import a42_0x563c89 from'path';import a42_0x1ec492 from'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';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';import{configureMcp,copySharedSkills,installSkill,createSkillManifest}from'../ai-setup/config.js';import{MCP_IDES}from'../utils/ai_config.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';import{useI18n}from'../i18n/hooks.js';export function CreateApp(_0x5c5ad5){const _0x32af4d=a42_0x4fbd,{t:_0x54a6db}=useI18n(),[_0x2dabfc,_0x327626]=useState(![]),[_0x364c07,_0x57450b]=useState(![]),[_0x3b2e8f,_0x11108b]=useState(null),[_0x219f41,_0x262a32]=useState(null),_0x559efb=useCopyProjectTemplate(),_0x5df570=useInstallDependencies(),_0x217afe=useFormatCode();useEffect(()=>{checkCliVersion()['then'](_0x4bbb9c=>{const _0x755311=a42_0x4fbd;_0x4bbb9c[_0x755311(0x1f5)]&&(printCliUpgradeWarning(_0x4bbb9c),logger[_0x755311(0x1a2)](_0x755311(0x1b9),_0x755311(0x1b8),{'currentVersion':_0x4bbb9c[_0x755311(0x1e6)],'stableVersion':_0x4bbb9c['stableVersion'],'needsUpgrade':_0x4bbb9c[_0x755311(0x1f5)]}));});},[]);const _0x1ce10e=async _0x5e1d=>{const _0x200276=a42_0x4fbd;if(!_0x5e1d['projectName']||_0x5e1d[_0x200276(0x206)][_0x200276(0x1ec)]()===''){console[_0x200276(0x208)](_0x54a6db(_0x200276(0x1a8)));return;}const _0x1a553b=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1a553b[_0x200276(0x20d)](_0x5e1d[_0x200276(0x206)])){console['error'](_0x54a6db('create.validation.invalidChars'));return;}if(_0x5e1d[_0x200276(0x206)][_0x200276(0x1ed)]>0x64){console[_0x200276(0x208)](_0x54a6db(_0x200276(0x1f6)));return;}const _0xba6336=a42_0x563c89['resolve'](process[_0x200276(0x1f2)](),_0x5e1d[_0x200276(0x206)]);if(a42_0x1ec492[_0x200276(0x1df)](_0xba6336)){console[_0x200276(0x208)](_0x54a6db(_0x200276(0x1bd),{'name':_0x5e1d[_0x200276(0x206)]}));return;}try{const _0x5cc519=a42_0x563c89[_0x200276(0x1dd)](_0xba6336);a42_0x1ec492['accessSync'](_0x5cc519,a42_0x1ec492[_0x200276(0x1b0)][_0x200276(0x1c7)]);}catch(_0xa713c8){console[_0x200276(0x208)](_0x54a6db(_0x200276(0x1c9)));return;}_0x11108b(_0x5e1d),_0x327626(!![]),logger[_0x200276(0x1b6)](_0xba6336),logger[_0x200276(0x1a2)](_0x200276(0x1b9),'开始创建项目:\x20'+_0x5e1d[_0x200276(0x206)],{'projectDir':_0xba6336,'appCode':_0x5e1d['appCode']});try{await _0x559efb[_0x200276(0x1a0)](_0x5e1d[_0x200276(0x206)]),await _0x544f19(_0x5e1d[_0x200276(0x206)]),await _0x5df570[_0x200276(0x1a0)](_0x5e1d[_0x200276(0x206)]),await _0x217afe['doTask'](_0x5e1d[_0x200276(0x206)]),await _0x5322a7(_0x5e1d['projectName'],_0x5e1d[_0x200276(0x1af)]||'',_0x5e1d[_0x200276(0x1f7)]);if(_0x5e1d[_0x200276(0x19b)]&&_0x5e1d[_0x200276(0x1af)]){console[_0x200276(0x1a4)](_0x54a6db(_0x200276(0x1da)));try{const _0x334314=await pullApiSilent(_0x5e1d[_0x200276(0x1af)],undefined,_0xba6336,_0x5e1d[_0x200276(0x1f7)]);_0x334314?(console[_0x200276(0x1a4)](_0x54a6db(_0x200276(0x209))),logger[_0x200276(0x1a2)]('create',_0x200276(0x1a7)+_0x5e1d[_0x200276(0x1af)])):(console['log'](_0x54a6db('create.steps.apiPullFailed')),logger[_0x200276(0x20a)](_0x200276(0x1b9),_0x200276(0x1e7)+_0x5e1d[_0x200276(0x1af)]));}catch(_0x5c0ef9){console[_0x200276(0x1a4)](_0x54a6db('create.steps.apiPullError')),logger[_0x200276(0x20a)]('create',_0x200276(0x1e8),{'error':_0x5c0ef9 instanceof Error?_0x5c0ef9[_0x200276(0x1bb)]:String(_0x5c0ef9)});}}if(_0x5e1d[_0x200276(0x1cd)]&&_0x5e1d[_0x200276(0x1dc)]&&_0x5e1d[_0x200276(0x1dc)][_0x200276(0x1ed)]>0x0&&_0x5e1d[_0x200276(0x1af)]){console['log'](_0x54a6db(_0x200276(0x1c0)));const _0x651d05=[],_0x438d80=[],_0x2483ef=_0x5e1d[_0x200276(0x1dc)][_0x200276(0x1d9)](_0x5129dd=>MCP_IDES[_0x200276(0x1a9)](_0x5129dd)),_0x5489a5=_0x5e1d[_0x200276(0x1dc)];for(const _0x436d72 of _0x2483ef){try{const _0x1a8aef=await configureMcp(_0x436d72,_0xba6336);_0x651d05['push']({'ide':_0x436d72===_0x200276(0x1be)?_0x200276(0x1c3):_0x200276(0x1f0),'status':_0x1a8aef[_0x200276(0x1d2)],'message':_0x1a8aef['message']}),console[_0x200276(0x1a4)]('\x20\x20'+(_0x1a8aef[_0x200276(0x1d2)]==='success'?'✓':_0x1a8aef[_0x200276(0x1d2)]===_0x200276(0x1fb)?'⚠️':'✗')+'\x20MCP\x20'+_0x436d72+':\x20'+_0x1a8aef[_0x200276(0x1bb)]);}catch(_0x2986b4){_0x651d05['push']({'ide':_0x436d72==='cursor'?_0x200276(0x1c3):_0x200276(0x1f0),'status':_0x200276(0x208),'message':_0x2986b4 instanceof Error?_0x2986b4[_0x200276(0x1bb)]:String(_0x2986b4)}),console[_0x200276(0x1a4)](_0x200276(0x19c)+_0x436d72+':\x20'+(_0x2986b4 instanceof Error?_0x2986b4[_0x200276(0x1bb)]:String(_0x2986b4)));}}await copySharedSkills(_0xba6336);for(const _0x1786d4 of _0x5489a5){try{const _0xadacc7=await installSkill(_0x1786d4,_0xba6336);_0x438d80[_0x200276(0x1d7)]({'ide':_0xadacc7[_0x200276(0x1ff)],'status':_0xadacc7[_0x200276(0x1d2)],'message':_0xadacc7[_0x200276(0x1bb)]}),console[_0x200276(0x1a4)]('\x20\x20'+(_0xadacc7[_0x200276(0x1d2)]==='success'?'✓':'✗')+_0x200276(0x1c2)+_0xadacc7[_0x200276(0x1ff)]+':\x20'+_0xadacc7[_0x200276(0x1bb)]);}catch(_0x195b3f){_0x438d80[_0x200276(0x1d7)]({'ide':_0x1786d4,'status':_0x200276(0x208),'message':_0x195b3f instanceof Error?_0x195b3f[_0x200276(0x1bb)]:String(_0x195b3f)}),console[_0x200276(0x1a4)](_0x200276(0x19a)+_0x1786d4+':\x20'+(_0x195b3f instanceof Error?_0x195b3f[_0x200276(0x1bb)]:String(_0x195b3f)));}}if(_0x438d80[_0x200276(0x1ed)]>0x0){const _0x565722=_0x438d80[_0x200276(0x1d9)](_0x8fa35b=>_0x8fa35b[_0x200276(0x1d2)]===_0x200276(0x1de))['map'](_0x13dce6=>_0x13dce6[_0x200276(0x1ff)]);_0x565722[_0x200276(0x1ed)]>0x0&&createSkillManifest(_0xba6336,_0x565722);}_0x262a32({'mcp':_0x651d05,'skill':_0x438d80}),console[_0x200276(0x1a4)](_0x54a6db(_0x200276(0x1b4)));}logger[_0x200276(0x1de)](_0x200276(0x1b9),_0x200276(0x1e5)+_0x5e1d[_0x200276(0x206)]),_0x57450b(!![]),_0x327626(![]);}catch(_0x2c5e5e){logger[_0x200276(0x208)]('create',_0x200276(0x201)+_0x5e1d[_0x200276(0x206)],{'error':_0x2c5e5e instanceof Error?_0x2c5e5e[_0x200276(0x1bb)]:String(_0x2c5e5e)});try{a42_0x1ec492[_0x200276(0x1df)](_0xba6336)&&(console[_0x200276(0x1a4)](_0x54a6db(_0x200276(0x20e),{'dir':_0xba6336})),a42_0x1ec492[_0x200276(0x1d8)](_0xba6336,{'recursive':!![],'force':!![]}));}catch(_0x589598){logger[_0x200276(0x20a)](_0x200276(0x1b9),_0x200276(0x1d0)+_0xba6336);}_0x327626(![]),console[_0x200276(0x208)](_0x54a6db(_0x200276(0x1d6),{'error':_0x2c5e5e instanceof Error?_0x2c5e5e[_0x200276(0x1bb)]:String(_0x2c5e5e)}));}},_0x16cdfa=async _0x369a18=>{await _0x1ce10e({'projectName':_0x369a18,'env':_0x5c5ad5['env']});},_0x544f19=async _0x12d8ad=>{const _0x574548=a42_0x4fbd,_0x445d26=a42_0x563c89[_0x574548(0x1b1)](process[_0x574548(0x1f2)](),_0x12d8ad),_0x51d084=a42_0x563c89['join'](_0x445d26,_0x574548(0x1bc));try{console[_0x574548(0x1a4)](_0x54a6db('create.packageJson.updating'));const _0x4afd41=fileURLToPath(import.meta.url),_0x40094e=a42_0x563c89[_0x574548(0x1b1)](a42_0x563c89['dirname'](_0x4afd41),_0x574548(0x1c5)),_0x3b1e96=a42_0x563c89['join'](_0x40094e,_0x574548(0x1bc));let _0x4ad3f6=_0x574548(0x1c4);try{const _0x3bca4c=JSON[_0x574548(0x19e)](a42_0x1ec492[_0x574548(0x1cb)](_0x3b1e96,'utf8'));_0x4ad3f6=_0x3bca4c[_0x574548(0x1fc)]||_0x574548(0x1c4);}catch(_0x2026a5){}const _0x6e5477=a42_0x1ec492['readFileSync'](_0x51d084,_0x574548(0x20f)),_0x5e40d7=JSON['parse'](_0x6e5477);_0x5e40d7['name']=_0x12d8ad,_0x5e40d7[_0x574548(0x1c8)]=_0x12d8ad+_0x574548(0x211)+_0x4ad3f6,a42_0x1ec492[_0x574548(0x1fa)](_0x51d084,JSON[_0x574548(0x1ad)](_0x5e40d7,null,0x2)+'\x0a',_0x574548(0x20f)),console[_0x574548(0x1a4)](_0x54a6db(_0x574548(0x1f1),{'name':_0x12d8ad})),logger['info']('create',_0x574548(0x204));}catch(_0xc14a07){logger[_0x574548(0x208)](_0x574548(0x1b9),_0x574548(0x1f3));throw _0xc14a07;}},_0x5322a7=async(_0x24ac21,_0x574b94,_0x2ef6d5)=>{const _0x659083=a42_0x4fbd,_0x3276b2=a42_0x563c89[_0x659083(0x1b1)](process['cwd'](),_0x24ac21),_0x1e2013=a42_0x563c89[_0x659083(0x1ac)](_0x3276b2,'.lovrabetrc');try{_0x574b94?console['log'](_0x54a6db(_0x659083(0x205),{'name':_0x24ac21,'appCode':_0x574b94})):console[_0x659083(0x1a4)](_0x54a6db(_0x659083(0x1d1),{'name':_0x24ac21}));const _0x279a6d=fileURLToPath(import.meta.url),_0x6bd50d=a42_0x563c89[_0x659083(0x1b1)](a42_0x563c89[_0x659083(0x1dd)](_0x279a6d),_0x659083(0x1c5)),_0x5dc877=a42_0x563c89[_0x659083(0x1ac)](_0x6bd50d,_0x659083(0x1bc));let _0x35c207=_0x659083(0x1c4);try{const _0x1154bc=JSON[_0x659083(0x19e)](a42_0x1ec492[_0x659083(0x1cb)](_0x5dc877,_0x659083(0x20f)));_0x35c207=_0x1154bc[_0x659083(0x1fc)]||'1.0.0';}catch(_0x4753d4){}const _0x374435=readConfig(),_0x2e9ef8=typeof _0x374435[_0x659083(0x1f7)]===_0x659083(0x202)?_0x374435[_0x659083(0x1f7)]:undefined,{app:_0x36c738,appcode:_0x31c2aa,..._0x5959cf}=_0x374435,_0x1599ec={..._0x5959cf,'appcode':_0x574b94||'','env':_0x2ef6d5||_0x2e9ef8||_0x659083(0x1e3),'createdAt':new Date()['toLocaleString'](),'version':_0x35c207};a42_0x1ec492[_0x659083(0x1fa)](_0x1e2013,JSON['stringify'](_0x1599ec,null,0x2),'utf8'),_0x574b94?console[_0x659083(0x1a4)](_0x54a6db('create.config.createdWithAppCode',{'appCode':_0x574b94})):console['log'](_0x54a6db(_0x659083(0x1e4))),logger[_0x659083(0x1a2)]('create',_0x659083(0x1b3)+_0x574b94);}catch(_0x5d26a8){logger[_0x659083(0x208)](_0x659083(0x1b9),_0x659083(0x20c));}};useEffect(()=>{const _0x5e237f=a42_0x4fbd;_0x5c5ad5[_0x5e237f(0x1a5)]&&_0x16cdfa(_0x5c5ad5[_0x5e237f(0x1a5)]);},[_0x5c5ad5[_0x32af4d(0x1a5)]]);if(!_0x2dabfc&&!_0x364c07&&!_0x5c5ad5['projectCode'])return a42_0x579522(EnhancedGuidedCreate,{'onCreate':_0x1ce10e,'env':_0x5c5ad5['env']});if(_0x2dabfc)return a42_0x4b813b(a42_0x215853,{'children':[a42_0x4b813b(Box,{'marginTop':0x1,'children':[a42_0x579522(Box,{'width':'1'}),a42_0x579522(Text,{'color':_0x32af4d(0x19f),'children':'\x20√\x20'}),a42_0x579522(Text,{'children':_0x54a6db(_0x32af4d(0x1ea))}),a42_0x579522(Text,{'color':_0x32af4d(0x19f),'children':_0x3b2e8f?.[_0x32af4d(0x206)]}),_0x3b2e8f?.[_0x32af4d(0x1af)]&&a42_0x4b813b(a42_0x215853,{'children':[a42_0x579522(Text,{'children':_0x54a6db(_0x32af4d(0x20b))}),a42_0x579522(Text,{'color':_0x32af4d(0x210),'children':_0x3b2e8f[_0x32af4d(0x1af)]})]})]}),a42_0x579522(TaskRunning,{..._0x559efb}),a42_0x579522(TaskRunning,{..._0x5df570}),a42_0x579522(TaskRunning,{..._0x217afe})]});if(_0x364c07){const _0x769f81=_0x219f41&&(_0x219f41[_0x32af4d(0x1ab)][_0x32af4d(0x1ed)]>0x0||_0x219f41[_0x32af4d(0x1ca)][_0x32af4d(0x1ed)]>0x0);return a42_0x4b813b(a42_0x215853,{'children':[a42_0x4b813b(Box,{'marginTop':0x1,'children':[a42_0x579522(Box,{'width':'1'}),a42_0x579522(Text,{'color':'green','children':_0x32af4d(0x1ce)}),a42_0x579522(Text,{'children':_0x54a6db('create.display.projectName')}),a42_0x579522(Text,{'color':_0x32af4d(0x19f),'children':_0x3b2e8f?.[_0x32af4d(0x206)]}),_0x3b2e8f?.[_0x32af4d(0x1af)]&&a42_0x4b813b(a42_0x215853,{'children':[a42_0x579522(Text,{'children':_0x54a6db(_0x32af4d(0x20b))}),a42_0x579522(Text,{'color':_0x32af4d(0x210),'children':_0x3b2e8f[_0x32af4d(0x1af)]})]})]}),a42_0x579522(TaskFinished,{..._0x559efb}),a42_0x579522(TaskFinished,{..._0x5df570}),a42_0x579522(TaskFinished,{..._0x217afe}),a42_0x579522(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x579522(Text,{'color':_0x32af4d(0x19f),'children':'─'[_0x32af4d(0x212)](0x3c)})}),_0x769f81&&a42_0x4b813b(a42_0x215853,{'children':[_0x219f41[_0x32af4d(0x1ab)][_0x32af4d(0x1ed)]>0x0&&a42_0x4b813b(a42_0x215853,{'children':[a42_0x579522(Box,{'marginTop':0x1,'children':a42_0x579522(Text,{'color':_0x32af4d(0x19f),'bold':!![],'children':_0x54a6db(_0x32af4d(0x1e0))})}),_0x219f41['mcp'][_0x32af4d(0x1b2)]((_0x7513bd,_0x58844f)=>a42_0x579522(Box,{'marginLeft':0x2,'children':a42_0x4b813b(Text,{'color':_0x7513bd[_0x32af4d(0x1d2)]===_0x32af4d(0x1de)?'white':_0x7513bd['status']===_0x32af4d(0x1fb)?_0x32af4d(0x1ba):'red','children':[_0x7513bd[_0x32af4d(0x1ff)],':\x20',_0x7513bd['message']]})},'mcp-'+_0x58844f))]}),_0x219f41[_0x32af4d(0x1ca)][_0x32af4d(0x1ed)]>0x0&&a42_0x4b813b(a42_0x215853,{'children':[a42_0x579522(Box,{'marginTop':_0x219f41[_0x32af4d(0x1ab)][_0x32af4d(0x1ed)]>0x0?0x1:0x0,'children':a42_0x579522(Text,{'color':_0x32af4d(0x19f),'bold':!![],'children':_0x54a6db(_0x32af4d(0x1d3))})}),_0x219f41[_0x32af4d(0x1ca)][_0x32af4d(0x1b2)]((_0x257b62,_0x29c784)=>a42_0x579522(Box,{'marginLeft':0x2,'children':a42_0x4b813b(Text,{'color':_0x257b62[_0x32af4d(0x1d2)]===_0x32af4d(0x1de)?'white':'red','children':[_0x257b62[_0x32af4d(0x1ff)],':\x20',_0x257b62[_0x32af4d(0x1bb)]]})},_0x32af4d(0x1bf)+_0x29c784))]}),a42_0x579522(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x579522(Text,{'color':_0x32af4d(0x19f),'children':'─'[_0x32af4d(0x212)](0x3c)})})]}),a42_0x579522(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x579522(Text,{'color':_0x32af4d(0x210),'bold':!![],'children':_0x54a6db(_0x32af4d(0x1f4))})}),a42_0x4b813b(Box,{'marginLeft':0x2,'flexDirection':_0x32af4d(0x1d5),'children':[_0x769f81?a42_0x4b813b(a42_0x215853,{'children':[a42_0x4b813b(Box,{'children':[a42_0x579522(Text,{'color':'green','children':_0x32af4d(0x1e9)}),a42_0x579522(Text,{'color':_0x32af4d(0x1f9),'children':_0x54a6db(_0x32af4d(0x199))}),a42_0x579522(Text,{'color':_0x32af4d(0x210),'bold':!![],'children':_0x32af4d(0x1ef)+_0x3b2e8f?.['projectName']+'\x20&&\x20lovrabet\x20start'})]}),_0x3b2e8f?.[_0x32af4d(0x1af)]&&!_0x3b2e8f?.[_0x32af4d(0x19b)]&&a42_0x4b813b(Box,{'children':[a42_0x579522(Text,{'color':'yellow','children':_0x32af4d(0x1f8)}),a42_0x579522(Text,{'color':_0x32af4d(0x1f9),'children':_0x54a6db('create.nextSteps.pullApi')}),a42_0x579522(Text,{'color':_0x32af4d(0x210),'bold':!![],'children':_0x32af4d(0x1fe)})]})]}):a42_0x4b813b(a42_0x215853,{'children':[a42_0x579522(Box,{'children':a42_0x579522(Text,{'color':'yellow','bold':!![],'children':_0x54a6db(_0x32af4d(0x19d))})}),a42_0x4b813b(Box,{'marginLeft':0x2,'marginTop':0x1,'children':[a42_0x579522(Text,{'color':'white','children':_0x54a6db(_0x32af4d(0x1cf))}),a42_0x579522(Text,{'color':'cyan','bold':!![],'children':'lovrabet\x20skill\x20install'})]}),a42_0x4b813b(Box,{'marginLeft':0x2,'children':[a42_0x579522(Text,{'color':_0x32af4d(0x1f9),'children':_0x54a6db(_0x32af4d(0x1a3))}),a42_0x579522(Text,{'color':_0x32af4d(0x210),'bold':!![],'children':_0x32af4d(0x1fd)})]}),a42_0x4b813b(Box,{'marginTop':0x1,'children':[a42_0x579522(Text,{'color':_0x32af4d(0x19f),'children':_0x32af4d(0x1f8)}),a42_0x579522(Text,{'color':'white','children':_0x54a6db(_0x32af4d(0x199))}),a42_0x579522(Text,{'color':_0x32af4d(0x210),'bold':!![],'children':_0x32af4d(0x1ef)+_0x3b2e8f?.[_0x32af4d(0x206)]+_0x32af4d(0x200)})]}),_0x3b2e8f?.[_0x32af4d(0x1af)]&&!_0x3b2e8f?.[_0x32af4d(0x19b)]&&a42_0x4b813b(Box,{'children':[a42_0x579522(Text,{'color':_0x32af4d(0x1ba),'children':_0x32af4d(0x1ae)}),a42_0x579522(Text,{'color':'white','children':_0x54a6db(_0x32af4d(0x1a1))}),a42_0x579522(Text,{'color':'cyan','bold':!![],'children':_0x32af4d(0x1fe)})]})]}),!_0x3b2e8f?.[_0x32af4d(0x1af)]&&a42_0x4b813b(a42_0x215853,{'children':[a42_0x4b813b(Box,{'children':[a42_0x579522(Text,{'color':'gray','children':'2.\x20'}),a42_0x579522(Text,{'color':'white','children':_0x54a6db(_0x32af4d(0x1e1))}),a42_0x579522(Text,{'color':_0x32af4d(0x210),'bold':!![],'children':_0x32af4d(0x1e2)})]}),a42_0x4b813b(Box,{'children':[a42_0x579522(Text,{'color':_0x32af4d(0x1db),'children':_0x32af4d(0x1ae)}),a42_0x579522(Text,{'color':_0x32af4d(0x1f9),'children':_0x54a6db('create.nextSteps.pullApi')}),a42_0x579522(Text,{'color':_0x32af4d(0x210),'bold':!![],'children':_0x32af4d(0x1eb)})]})]})]}),a42_0x579522(Box,{'marginTop':0x1,'children':a42_0x579522(Text,{'color':_0x32af4d(0x19f),'children':'─'[_0x32af4d(0x212)](0x3c)})})]});}return null;}function a42_0x4fbd(_0x5a7e85,_0x5b310b){_0x5a7e85=_0x5a7e85-0x198;const _0x1f4570=a42_0x1f45();let _0x4fbd0e=_0x1f4570[_0x5a7e85];return _0x4fbd0e;}function a42_0x1f45(){const _0x2ef037=['cwd','更新\x20package.json\x20失败','create.results.nextSteps','needsUpgrade','create.validation.tooLong','env','2.\x20','white','writeFileSync','manual','version','lovrabet\x20mcp\x20install','lovrabet\x20api\x20pull','ide','\x20&&\x20lovrabet\x20start','项目创建失败:\x20','string','22EIzXEa','更新\x20package.json\x20name','create.config.configuringAppCode','projectName','12066760sBfBiR','error','create.steps.apiPullSuccess','warn','create.display.appCode','配置应用AppCode失败','test','create.cleanup.inProgress','utf8','cyan','\x20Generated\x20by\x20lovrabet\x20cli\x20','repeat','3959610puPOgp','create.nextSteps.startProject','\x20\x20✗\x20Skill\x20','pullApi','\x20\x20✗\x20MCP\x20','create.nextSteps.configureMcpAndSkill','parse','green','doTask','create.nextSteps.pullApi','info','create.nextSteps.mcp','log','projectCode','589668aEicMh','API\x20配置拉取成功:\x20','create.validation.required','has','154PHZlkS','mcp','join','stringify','3.\x20','appCode','constants','resolve','map','配置应用AppCode:\x20','create.steps.mcpConfigComplete','4KlPJtw','setLogPath','1384090qjFvcz','CLI\x20版本检查','create','yellow','message','package.json','create.validation.dirExists','cursor','skill-','create.lovrabetSetup.inProgress','4776aidpnU','\x20Skill\x20','Cursor','1.0.0','../..','3585210KTkJUw','W_OK','description','create.validation.noPermission','skill','readFileSync','5958eVMGnf','aiSetup','\x20√\x20','create.nextSteps.skill','清理项目目录失败:\x20','create.config.creating','status','create.lovrabetSetup.skillCompleted','7DELNlN','column','create.errors.createFailed','push','rmSync','filter','create.steps.pullingApi','gray','selectedIDEs','dirname','success','existsSync','create.lovrabetSetup.mcpCompleted','create.nextSteps.configAppCode','lovrabet\x20config\x20set\x20appcode\x20[app-code]','online','create.config.createdWithoutAppCode','项目创建完成:\x20','currentVersion','API\x20配置拉取失败:\x20','API\x20配置拉取异常','1.\x20','create.display.projectName','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','trim','length','2199xqJQkm','cd\x20','Claude\x20Code','create.packageJson.updated'];a42_0x1f45=function(){return _0x2ef037;};return a42_0x1f45();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x336cef=a43_0x4053;(function(_0x465cc1,_0x2fc6f3){const _0x34a147=a43_0x4053,_0x29b98a=_0x465cc1();while(!![]){try{const _0x27c7fa=-parseInt(_0x34a147(0x137))/0x1+-parseInt(_0x34a147(0x11e))/0x2+parseInt(_0x34a147(0x12e))/0x3+parseInt(_0x34a147(0x134))/0x4+parseInt(_0x34a147(0x114))/0x5+parseInt(_0x34a147(0x13b))/0x6+-parseInt(_0x34a147(0x126))/0x7;if(_0x27c7fa===_0x2fc6f3)break;else _0x29b98a['push'](_0x29b98a['shift']());}catch(_0x4b5668){_0x29b98a['push'](_0x29b98a['shift']());}}}(a43_0xe1fd,0xe4001));import a43_0x25249a from'path';import{fileURLToPath}from'url';import a43_0x2f3719 from'fs/promises';import{existsSync}from'fs';import{copyDirectory}from'../utils/copy-directory.js';import{exec}from'child_process';import{promisify}from'util';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';function a43_0xe1fd(){const _0xcbb259=['1593258pscUOA','create.validation.tooLong','npm','exit','create.nonInteractive.packageJsonUpdated','4513325GtOPFB','lovrabet.config.json','cwd','bind','log','env','test','../../templates/projects/sub-app-react-demo','needsUpgrade','writeFile','881700KwtEBJ','stringify','error','description','readFile','name','create.nonInteractive.templateCreated','create.validation.invalidChars','15657012BLOgCx','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','access','parse','join','create.nonInteractive.success','trim','create.nonInteractive.codeFormatted','4622520qMRRqL','constants','\x20\x20lovrabet\x20start\x0a','\x20install','utf-8','create.validation.dirExists','6822532pTsxFv','message','bun\x20--version','803226GiRCTJ','依赖安装失败:\x20','create.validation.required','resolve'];a43_0xe1fd=function(){return _0xcbb259;};return a43_0xe1fd();}import a43_0x82ab79 from'../i18n/index.js';const t=a43_0x82ab79['t'][a43_0x336cef(0x117)](a43_0x82ab79),execAsync=promisify(exec);function getTemplateDir(){const _0x325e6d=a43_0x336cef,_0x5c48bd=fileURLToPath(import.meta.url),_0x102b21=a43_0x25249a['dirname'](_0x5c48bd);return a43_0x25249a['resolve'](_0x102b21,_0x325e6d(0x11b));}function a43_0x4053(_0x18ca1d,_0x40aa49){_0x18ca1d=_0x18ca1d-0x111;const _0xe1fdda=a43_0xe1fd();let _0x405328=_0xe1fdda[_0x18ca1d];return _0x405328;}export async function createProjectNonInteractive(_0x13a48f,_0x4a8228){const _0x35d46b=a43_0x336cef,_0x437272=await checkCliVersion();_0x437272[_0x35d46b(0x11c)]&&printCliUpgradeWarning(_0x437272);(!_0x13a48f||_0x13a48f[_0x35d46b(0x12c)]()==='')&&(console[_0x35d46b(0x120)](t(_0x35d46b(0x139))),process[_0x35d46b(0x112)](0x1));const _0xc75774=/[<>:"|?*\x00-\x1f\x7f]/;_0xc75774[_0x35d46b(0x11a)](_0x13a48f)&&(console[_0x35d46b(0x120)](t(_0x35d46b(0x125))),process['exit'](0x1));_0x13a48f['length']>0x64&&(console[_0x35d46b(0x120)](t(_0x35d46b(0x13c))),process['exit'](0x1));const _0x16b3f7=a43_0x25249a['resolve'](process[_0x35d46b(0x116)](),_0x13a48f);existsSync(_0x16b3f7)&&(console[_0x35d46b(0x120)](t(_0x35d46b(0x133),{'name':_0x13a48f})),process['exit'](0x1));try{const _0x29e292=a43_0x25249a['dirname'](_0x16b3f7);await a43_0x2f3719[_0x35d46b(0x128)](_0x29e292,a43_0x2f3719[_0x35d46b(0x12f)]['W_OK']);}catch(_0x1be2b5){console['error'](t('create.validation.noPermission')),process['exit'](0x1);}try{console['log'](t('create.nonInteractive.creating',{'name':_0x13a48f}));const _0x35bcab=getTemplateDir();await copyDirectory(_0x35bcab,_0x16b3f7),console['log'](t(_0x35d46b(0x124))),await updatePackageJsonName(_0x13a48f),console[_0x35d46b(0x118)](t(_0x35d46b(0x113))),console[_0x35d46b(0x118)](t('create.nonInteractive.installingDeps')),console[_0x35d46b(0x118)](t('create.nonInteractive.depsSkipped')),await formatCode(_0x16b3f7),console[_0x35d46b(0x118)](t(_0x35d46b(0x12d))),await configureAppEnv(_0x13a48f,_0x4a8228),console[_0x35d46b(0x118)](t('create.nonInteractive.envConfigured')),console[_0x35d46b(0x118)](t(_0x35d46b(0x12b),{'name':_0x13a48f})),console[_0x35d46b(0x118)]('\x0a\x20\x20cd\x20'+_0x13a48f),console[_0x35d46b(0x118)](_0x35d46b(0x130));}catch(_0x42b96e){const _0xb2541b=_0x42b96e instanceof Error?_0x42b96e[_0x35d46b(0x135)]:String(_0x42b96e);try{existsSync(_0x16b3f7)&&await a43_0x2f3719['rm'](_0x16b3f7,{'recursive':!![],'force':!![]});}catch{}console['error'](t('create.errors.createFailed',{'error':_0xb2541b})),process[_0x35d46b(0x112)](0x1);}}async function updatePackageJsonName(_0xad420c){const _0x2057c5=a43_0x336cef,_0x53d7f2=a43_0x25249a[_0x2057c5(0x13a)](process[_0x2057c5(0x116)](),_0xad420c),_0x395d81=a43_0x25249a[_0x2057c5(0x12a)](_0x53d7f2,'package.json'),_0x764d9=await a43_0x2f3719[_0x2057c5(0x122)](_0x395d81,_0x2057c5(0x132)),_0x3bcb87=JSON[_0x2057c5(0x129)](_0x764d9);_0x3bcb87[_0x2057c5(0x123)]=_0xad420c,_0x3bcb87[_0x2057c5(0x121)]=_0x2057c5(0x127),await a43_0x2f3719[_0x2057c5(0x11d)](_0x395d81,JSON[_0x2057c5(0x11f)](_0x3bcb87,null,0x2)+'\x0a');}async function installDependencies(_0x21ce61){const _0xe6b8cb=a43_0x336cef,_0x301a3a=detectPackageManager(),_0x5e1110=_0x301a3a+_0xe6b8cb(0x131);try{await execAsync(_0x5e1110,{'cwd':_0x21ce61});}catch(_0x3ef5f5){throw new Error(_0xe6b8cb(0x138)+_0x3ef5f5);}}function detectPackageManager(){const _0x36160f=a43_0x336cef;try{return execAsync(_0x36160f(0x136),{}),'bun';}catch{return _0x36160f(0x111);}}async function formatCode(_0x313e7f){try{await execAsync('bun\x20run\x20format',{'cwd':_0x313e7f});}catch{}}async function configureAppEnv(_0x3fe0f0,_0x497d7c){const _0x43cc36=a43_0x336cef,_0x50764c=a43_0x25249a['resolve'](process[_0x43cc36(0x116)](),_0x3fe0f0),_0x37a0ef=a43_0x25249a[_0x43cc36(0x12a)](_0x50764c,_0x43cc36(0x115));let _0x409b8e={};if(existsSync(_0x37a0ef)){const _0x17f722=await a43_0x2f3719['readFile'](_0x37a0ef,_0x43cc36(0x132));_0x409b8e=JSON[_0x43cc36(0x129)](_0x17f722);}_0x497d7c&&(_0x409b8e[_0x43cc36(0x119)]=_0x497d7c),await a43_0x2f3719[_0x43cc36(0x11d)](_0x37a0ef,JSON[_0x43cc36(0x11f)](_0x409b8e,null,0x2)+'\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4ad1cc,_0x270a2a){var _0x4d82cf=a44_0x4ef9,_0x99b3c9=_0x4ad1cc();while(!![]){try{var _0x273089=parseInt(_0x4d82cf(0x9f))/0x1+-parseInt(_0x4d82cf(0xa3))/0x2+parseInt(_0x4d82cf(0xa7))/0x3*(parseInt(_0x4d82cf(0xa9))/0x4)+-parseInt(_0x4d82cf(0x9e))/0x5*(parseInt(_0x4d82cf(0xa0))/0x6)+parseInt(_0x4d82cf(0xa6))/0x7+-parseInt(_0x4d82cf(0xa1))/0x8*(parseInt(_0x4d82cf(0xa4))/0x9)+-parseInt(_0x4d82cf(0xa2))/0xa*(-parseInt(_0x4d82cf(0xab))/0xb);if(_0x273089===_0x270a2a)break;else _0x99b3c9['push'](_0x99b3c9['shift']());}catch(_0x1a5ccc){_0x99b3c9['push'](_0x99b3c9['shift']());}}}(a44_0xace5,0x81c0a));import{jsx as a44_0xb44748,jsxs as a44_0x280561}from'react/jsx-runtime';function a44_0xace5(){var _0x51e194=['655044YmoAiY','2772858hoHorO','216Whaiqx','130HVowZI','1556466gfnlMb','287271lXqDZE','elapsed','6452649pRQlbr','3wFHKAk','green','1929596ffaTLP','taskName','486035QiilMa','5eavWKX'];a44_0xace5=function(){return _0x51e194;};return a44_0xace5();}import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';function a44_0x4ef9(_0x2d6b7d,_0xb1e9d2){_0x2d6b7d=_0x2d6b7d-0x9e;var _0xace572=a44_0xace5();var _0x4ef9e5=_0xace572[_0x2d6b7d];return _0x4ef9e5;}export function TaskFinished(_0x24db9b){var _0x50c657=a44_0x4ef9;return a44_0x280561(Box,{'children':[a44_0xb44748(Box,{'width':'1'}),a44_0xb44748(Text,{'color':_0x50c657(0xa8),'children':'\x20√\x20'}),a44_0xb44748(Text,{'children':_0x24db9b[_0x50c657(0xaa)]}),a44_0xb44748(TaskTime,{'elapsed':_0x24db9b[_0x50c657(0xa5)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a45_0x5459(){var _0x1b2156=['loading','finished','\x20√\x20','7kvAnNE','\x20\x20\x20','15789429cAiTrf','4982082qNksFt','4137880pWDvgy','8686976LYQdhl','1440742TvyUnr','910129yKXcnH','green','3JYdaxa','1257076QYazgk'];a45_0x5459=function(){return _0x1b2156;};return a45_0x5459();}(function(_0x290e00,_0x59fd47){var _0xc29e59=a45_0x2e6f,_0x2da742=_0x290e00();while(!![]){try{var _0x1645a2=parseInt(_0xc29e59(0x197))/0x1+-parseInt(_0xc29e59(0x196))/0x2+parseInt(_0xc29e59(0x199))/0x3*(-parseInt(_0xc29e59(0x19a))/0x4)+parseInt(_0xc29e59(0x194))/0x5+parseInt(_0xc29e59(0x193))/0x6*(parseInt(_0xc29e59(0x190))/0x7)+parseInt(_0xc29e59(0x195))/0x8+-parseInt(_0xc29e59(0x192))/0x9;if(_0x1645a2===_0x59fd47)break;else _0x2da742['push'](_0x2da742['shift']());}catch(_0x5d5e5d){_0x2da742['push'](_0x2da742['shift']());}}}(a45_0x5459,0xd3287));function a45_0x2e6f(_0x1474cf,_0x123411){_0x1474cf=_0x1474cf-0x190;var _0x545969=a45_0x5459();var _0x2e6f53=_0x545969[_0x1474cf];return _0x2e6f53;}import{jsx as a45_0xfe47a1,jsxs as a45_0x56ff34}from'react/jsx-runtime';import{Text}from'ink';import a45_0x9b03ed from'ink-spinner';export function TaskLoading(_0x23859d){var _0x1e7909=a45_0x2e6f;if(_0x23859d[_0x1e7909(0x19c)])return a45_0xfe47a1(Text,{'color':_0x1e7909(0x198),'children':_0x1e7909(0x19d)});if(_0x23859d[_0x1e7909(0x19b)])return a45_0x56ff34(Text,{'color':'green','children':['\x20',a45_0xfe47a1(a45_0x9b03ed,{'type':'dots'}),'\x20']});return a45_0xfe47a1(Text,{'children':_0x1e7909(0x191)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3ab585,_0x4b645d){var _0x1a36c7=a46_0x1134,_0xdb0ea2=_0x3ab585();while(!![]){try{var _0x5a15ac=parseInt(_0x1a36c7(0x1a8))/0x1+parseInt(_0x1a36c7(0x1a6))/0x2+-parseInt(_0x1a36c7(0x1a9))/0x3+-parseInt(_0x1a36c7(0x1a5))/0x4+-parseInt(_0x1a36c7(0x1a7))/0x5+-parseInt(_0x1a36c7(0x1ac))/0x6+parseInt(_0x1a36c7(0x1aa))/0x7;if(_0x5a15ac===_0x4b645d)break;else _0xdb0ea2['push'](_0xdb0ea2['shift']());}catch(_0x4b9677){_0xdb0ea2['push'](_0xdb0ea2['shift']());}}}(a46_0x22f3,0x3d7c0));import{jsx as a46_0x3e1209,jsxs as a46_0x5ad72d}from'react/jsx-runtime';function a46_0x1134(_0x356bc3,_0xe24ac0){_0x356bc3=_0x356bc3-0x1a5;var _0x22f304=a46_0x22f3();var _0x113436=_0x22f304[_0x356bc3];return _0x113436;}import{Box,Text}from'ink';function a46_0x22f3(){var _0x1a9709=['163343WSmuFT','793590LHyccB','5870053BcvfwM','elapsed','2352216TPlGNN','280924OUHbCo','776966lvekWl','2058840rdQpjT'];a46_0x22f3=function(){return _0x1a9709;};return a46_0x22f3();}import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0xebc8ca){var _0x75d1bc=a46_0x1134;return a46_0x5ad72d(Box,{'children':[a46_0x3e1209(Box,{'width':'1'}),a46_0x3e1209(TaskLoading,{..._0xebc8ca}),a46_0x3e1209(Text,{'children':_0xebc8ca['taskName']}),a46_0x3e1209(TaskTime,{'elapsed':_0xebc8ca[_0x75d1bc(0x1ab)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a47_0x56a9(){var _0x3b3a6e=['479943dnwFRw','4737955HJaDtO','4625688VMkCbo','4mqryNi','7XhakcN','494655zggzgC','gray','90KsMSrq','1254636ONetgR','elapsed','1601595VTeepv','633372GXoAqz'];a47_0x56a9=function(){return _0x3b3a6e;};return a47_0x56a9();}(function(_0x247d5e,_0x570596){var _0x16189f=a47_0x4690,_0x3add16=_0x247d5e();while(!![]){try{var _0x18d437=parseInt(_0x16189f(0x1b7))/0x1+parseInt(_0x16189f(0x1bd))/0x2+parseInt(_0x16189f(0x1bc))/0x3+parseInt(_0x16189f(0x1c1))/0x4*(-parseInt(_0x16189f(0x1bf))/0x5)+-parseInt(_0x16189f(0x1ba))/0x6*(-parseInt(_0x16189f(0x1c2))/0x7)+-parseInt(_0x16189f(0x1c0))/0x8+-parseInt(_0x16189f(0x1be))/0x9*(-parseInt(_0x16189f(0x1b9))/0xa);if(_0x18d437===_0x570596)break;else _0x3add16['push'](_0x3add16['shift']());}catch(_0x3a3401){_0x3add16['push'](_0x3add16['shift']());}}}(a47_0x56a9,0x7c225));function a47_0x4690(_0x4cb01f,_0x52b30f){_0x4cb01f=_0x4cb01f-0x1b7;var _0x56a903=a47_0x56a9();var _0x469000=_0x56a903[_0x4cb01f];return _0x469000;}import{jsx as a47_0x23c46b,Fragment as a47_0x14128c,jsxs as a47_0x240cbb}from'react/jsx-runtime';import{Text}from'ink';export function TaskTime(_0x49b5f9){var _0xcf2e1d=a47_0x4690;if(_0x49b5f9[_0xcf2e1d(0x1bb)])return a47_0x240cbb(a47_0x14128c,{'children':[a47_0x23c46b(Text,{'color':_0xcf2e1d(0x1b8),'children':'\x20['}),a47_0x23c46b(Text,{'color':_0xcf2e1d(0x1b8),'bold':!![],'children':_0x49b5f9[_0xcf2e1d(0x1bb)]}),a47_0x23c46b(Text,{'color':'gray','children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a48_0x3b11(_0x5dadd8,_0x10d4b2){_0x5dadd8=_0x5dadd8-0x1ac;const _0x5c427a=a48_0x5c42();let _0x3b11e8=_0x5c427a[_0x5dadd8];return _0x3b11e8;}const a48_0x2f814d=a48_0x3b11;function a48_0x5c42(){const _0x2fe9ab=['项目模板复制失败','181819flpzeo','dirname','10850343dxhQyN','4985304PQUTTl','cwd','项目模板复制完成','12328OVGUzV','8654358CGWNZl','now','5560038MUfKQH','error','create.tasks.copyFiles','4810vIAOTm','120EjiuuT','copy','../../templates/projects/sub-app-react-demo','info','27SDKuXy','5540anzAJz','3730cFmWJn','resolve'];a48_0x5c42=function(){return _0x2fe9ab;};return a48_0x5c42();}(function(_0x38c9fe,_0x171511){const _0xff651a=a48_0x3b11,_0x2f64cd=_0x38c9fe();while(!![]){try{const _0x56948d=parseInt(_0xff651a(0x1b8))/0x1*(parseInt(_0xff651a(0x1bf))/0x2)+-parseInt(_0xff651a(0x1bb))/0x3+-parseInt(_0xff651a(0x1ae))/0x4*(parseInt(_0xff651a(0x1af))/0x5)+-parseInt(_0xff651a(0x1b9))/0x6+-parseInt(_0xff651a(0x1b4))/0x7+-parseInt(_0xff651a(0x1b5))/0x8*(parseInt(_0xff651a(0x1ad))/0x9)+-parseInt(_0xff651a(0x1be))/0xa*(-parseInt(_0xff651a(0x1b2))/0xb);if(_0x56948d===_0x171511)break;else _0x2f64cd['push'](_0x2f64cd['shift']());}catch(_0x2770c0){_0x2f64cd['push'](_0x2f64cd['shift']());}}}(a48_0x5c42,0xe5e4a));import a48_0x6f0876 from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';import{useI18n}from'../i18n/hooks.js';const __dirname=a48_0x6f0876[a48_0x2f814d(0x1b3)](fileURLToPath(import.meta.url)),templateDir=a48_0x6f0876[a48_0x2f814d(0x1b0)](__dirname,a48_0x2f814d(0x1c1));export function useCopyProjectTemplate(){const _0x2e144f=a48_0x2f814d,{t:_0x48a770}=useI18n(),[_0x5164cd,_0x4b5a39]=useState(![]),[_0x1aab2d,_0x4a8758]=useState(![]),[_0x1bafce,_0x2aa23d]=useState(''),_0x12cb38=useCallback(async _0x38ed7e=>{const _0x17985b=a48_0x3b11,_0x4d5488=Date[_0x17985b(0x1ba)](),_0x40d8bc=a48_0x6f0876[_0x17985b(0x1b0)](process[_0x17985b(0x1b6)](),_0x38ed7e);_0x4b5a39(!![]);try{logger[_0x17985b(0x1ac)]('copy','开始复制项目模板',{'projectCode':_0x38ed7e,'templateDir':templateDir}),await copyDirectory(templateDir,_0x40d8bc);const _0x232034=Date[_0x17985b(0x1ba)]()-_0x4d5488;logger['success'](_0x17985b(0x1c0),_0x17985b(0x1b7),_0x232034,{'projectCode':_0x38ed7e});}catch(_0x4c2e99){const _0x2fce7b=Date[_0x17985b(0x1ba)]()-_0x4d5488;logger[_0x17985b(0x1bc)](_0x17985b(0x1c0),_0x17985b(0x1b1),{'projectCode':_0x38ed7e,'error':_0x4c2e99 instanceof Error?_0x4c2e99['message']:String(_0x4c2e99),'duration':_0x2fce7b});throw _0x4c2e99;}finally{_0x4b5a39(![]),_0x4a8758(!![]),_0x2aa23d(formatElapsed(_0x4d5488));}},[]);return{'taskName':_0x48a770(_0x2e144f(0x1bd)),'finished':_0x1aab2d,'loading':_0x5164cd,'elapsed':_0x1bafce,'doTask':_0x12cb38};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a49_0x7672(_0xf2215f,_0x4d3cc8){_0xf2215f=_0xf2215f-0x1f3;const _0x352160=a49_0x3521();let _0x7672c7=_0x352160[_0xf2215f];return _0x7672c7;}(function(_0x823fbf,_0x5d0fcd){const _0x33c8b4=a49_0x7672,_0x2f48fe=_0x823fbf();while(!![]){try{const _0x512493=-parseInt(_0x33c8b4(0x1fd))/0x1*(-parseInt(_0x33c8b4(0x1fc))/0x2)+-parseInt(_0x33c8b4(0x204))/0x3*(parseInt(_0x33c8b4(0x1fa))/0x4)+parseInt(_0x33c8b4(0x200))/0x5+-parseInt(_0x33c8b4(0x1f8))/0x6+-parseInt(_0x33c8b4(0x1fb))/0x7+parseInt(_0x33c8b4(0x1f5))/0x8+parseInt(_0x33c8b4(0x1f9))/0x9*(parseInt(_0x33c8b4(0x1fe))/0xa);if(_0x512493===_0x5d0fcd)break;else _0x2f48fe['push'](_0x2f48fe['shift']());}catch(_0x5eeab4){_0x2f48fe['push'](_0x2f48fe['shift']());}}}(a49_0x3521,0x41d74));import a49_0x3f0dab from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a49_0x3521(){const _0x4a4f4c=['cwd','resolve','3750WxUHfh','create.tasks.formatCode','success','代码格式化完成','format','4146704CPLaSh','开始格式化代码','prettier','3225714QUtEaN','441frAolE','116huicgU','2654743MzRSYH','64HbiTDx','4561fkqroT','85240LbDuDU','now','704180nTFbYT','npx'];a49_0x3521=function(){return _0x4a4f4c;};return a49_0x3521();}import{logger}from'../utils/logger.js';import{useI18n}from'../i18n/hooks.js';export function useFormatCode(){const _0x550ad6=a49_0x7672,{t:_0x2fd6d0}=useI18n(),[_0x212466,_0xdbafa3]=useState(![]),[_0x317a88,_0x37b36c]=useState(![]),[_0x63e8df,_0x2b7bf8]=useState(''),_0x278f52=useCallback(async _0x500e41=>{const _0x3dca9c=a49_0x7672,_0x440999=Date['now'](),_0x52f0e5=a49_0x3f0dab[_0x3dca9c(0x203)](process[_0x3dca9c(0x202)](),_0x500e41);_0xdbafa3(!![]);try{logger['info'](_0x3dca9c(0x1f4),_0x3dca9c(0x1f6),{'projectCode':_0x500e41}),await execa(_0x3dca9c(0x201),[_0x3dca9c(0x1f7),'--write','.'],{'cwd':_0x52f0e5});const _0xdc40e6=Date[_0x3dca9c(0x1ff)]()-_0x440999;logger[_0x3dca9c(0x206)](_0x3dca9c(0x1f4),_0x3dca9c(0x1f3),_0xdc40e6,{'projectCode':_0x500e41});}catch(_0x301ecc){const _0x2f3dde=Date[_0x3dca9c(0x1ff)]()-_0x440999;logger['error'](_0x3dca9c(0x1f4),'代码格式化失败',{'projectCode':_0x500e41,'error':_0x301ecc instanceof Error?_0x301ecc['message']:String(_0x301ecc),'duration':_0x2f3dde});throw _0x301ecc;}finally{_0xdbafa3(![]),_0x37b36c(!![]),_0x2b7bf8(formatElapsed(_0x440999));}},[]);return{'taskName':_0x2fd6d0(_0x550ad6(0x205)),'finished':_0x317a88,'loading':_0x212466,'elapsed':_0x63e8df,'doTask':_0x278f52};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x105582,_0xf5488d){const _0x252ce2=a50_0x1046,_0x312e30=_0x105582();while(!![]){try{const _0xdb43b2=parseInt(_0x252ce2(0xa7))/0x1+parseInt(_0x252ce2(0xb5))/0x2*(-parseInt(_0x252ce2(0xb2))/0x3)+-parseInt(_0x252ce2(0xa5))/0x4*(parseInt(_0x252ce2(0xb3))/0x5)+parseInt(_0x252ce2(0xb1))/0x6*(parseInt(_0x252ce2(0xb9))/0x7)+-parseInt(_0x252ce2(0xb6))/0x8+-parseInt(_0x252ce2(0xb8))/0x9*(-parseInt(_0x252ce2(0xb4))/0xa)+parseInt(_0x252ce2(0xb7))/0xb;if(_0xdb43b2===_0xf5488d)break;else _0x312e30['push'](_0x312e30['shift']());}catch(_0x1379c1){_0x312e30['push'](_0x312e30['shift']());}}}(a50_0x2d8e,0x35593));import a50_0x1ea749 from'node:path';function a50_0x1046(_0x6c8c5f,_0x2fe42a){_0x6c8c5f=_0x6c8c5f-0xa4;const _0x2d8e39=a50_0x2d8e();let _0x10469b=_0x2d8e39[_0x6c8c5f];return _0x10469b;}import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a50_0x2d8e(){const _0x91e4c6=['now','info','6gKIhhD','27mmUzvC','170665QVnaaf','10UNJoJP','2770BLOMFT','2493328eIFySj','4070044OnSDfD','1098891PDoCGo','1967371lcRaIa','resolve','cwd','依赖安装完成','开始安装依赖','44PrIBlZ','message','144953JOypuV','--registry','install','create.tasks.installDependencies','success','error','npm','https://registry.npmmirror.com'];a50_0x2d8e=function(){return _0x91e4c6;};return a50_0x2d8e();}import{logger}from'../utils/logger.js';import{useI18n}from'../i18n/hooks.js';export function useInstallDependencies(){const _0xcba1b3=a50_0x1046,{t:_0x3c0473}=useI18n(),[_0x4bd703,_0xc78801]=useState(![]),[_0x32c013,_0x225315]=useState(![]),[_0x518042,_0x15f710]=useState(''),_0x2416eb=useCallback(async _0xd77a73=>{const _0x4ba31d=a50_0x1046,_0x1bbb0e=Date[_0x4ba31d(0xaf)](),_0x387124=a50_0x1ea749[_0x4ba31d(0xba)](process[_0x4ba31d(0xbb)](),_0xd77a73);_0xc78801(!![]),_0x225315(![]);const _0x522f6d=async(_0x57056b,_0x2ff2b0)=>{await execa(_0x57056b,_0x2ff2b0,{'cwd':_0x387124});};try{logger[_0x4ba31d(0xb0)](_0x4ba31d(0xa9),_0x4ba31d(0xa4),{'projectCode':_0xd77a73,'registry':'https://registry.npmmirror.com'}),await _0x522f6d(_0x4ba31d(0xad),[_0x4ba31d(0xa9),_0x4ba31d(0xa8),_0x4ba31d(0xae)]);const _0x226406=Date['now']()-_0x1bbb0e;logger[_0x4ba31d(0xab)](_0x4ba31d(0xa9),_0x4ba31d(0xbc),_0x226406,{'projectCode':_0xd77a73});}catch(_0x1bd7a5){const _0x4f5ef6=Date['now']()-_0x1bbb0e;logger[_0x4ba31d(0xac)](_0x4ba31d(0xa9),'依赖安装失败',{'projectCode':_0xd77a73,'error':_0x1bd7a5 instanceof Error?_0x1bd7a5[_0x4ba31d(0xa6)]:String(_0x1bd7a5),'duration':_0x4f5ef6});throw _0x1bd7a5;}finally{_0xc78801(![]),_0x225315(!![]),_0x15f710(formatElapsed(_0x1bbb0e));}},[]);return{'taskName':_0x3c0473(_0xcba1b3(0xaa)),'finished':_0x32c013,'loading':_0x4bd703,'elapsed':_0x518042,'doTask':_0x2416eb};}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5143fa,_0x4e56a7){const _0x4f1c22=a51_0x2a6f,_0x20d06e=_0x5143fa();while(!![]){try{const _0x127361=parseInt(_0x4f1c22(0x1e0))/0x1+-parseInt(_0x4f1c22(0x1dd))/0x2*(-parseInt(_0x4f1c22(0x1e3))/0x3)+-parseInt(_0x4f1c22(0x1e1))/0x4*(parseInt(_0x4f1c22(0x1d9))/0x5)+-parseInt(_0x4f1c22(0x1df))/0x6+-parseInt(_0x4f1c22(0x1e2))/0x7+parseInt(_0x4f1c22(0x1dc))/0x8+-parseInt(_0x4f1c22(0x1de))/0x9*(-parseInt(_0x4f1c22(0x1d8))/0xa);if(_0x127361===_0x4e56a7)break;else _0x20d06e['push'](_0x20d06e['shift']());}catch(_0x58b8d4){_0x20d06e['push'](_0x20d06e['shift']());}}}(a51_0x2622,0x36b00));import{jsx as a51_0x4b8555,jsxs as a51_0x547993}from'react/jsx-runtime';import{Box,Text}from'ink';function a51_0x2a6f(_0x3e808f,_0x2bb9a3){_0x3e808f=_0x3e808f-0x1d7;const _0x2622ac=a51_0x2622();let _0x2a6f12=_0x2622ac[_0x3e808f];return _0x2a6f12;}function a51_0x2622(){const _0x3ea9ab=['green','help.viewCommands','1411648IHCxdd','466bbeGEg','9tKeZLM','7632LLQIao','253949TWPPTh','1583296zVYrWy','2030588GbFUff','5115pjkIvF','column','835100Ywiqut','5HvpxTw'];a51_0x2622=function(){return _0x3ea9ab;};return a51_0x2622();}import{useI18n}from'./i18n/hooks.js';export function Help(){const _0x4dba6b=a51_0x2a6f,{t:_0x3a9264}=useI18n();return a51_0x547993(Box,{'flexDirection':_0x4dba6b(0x1d7),'marginTop':0x1,'marginBottom':0x1,'children':[a51_0x547993(Box,{'children':[a51_0x4b8555(Box,{'width':'1'}),a51_0x4b8555(Text,{'children':_0x3a9264('help.invalidCommand')})]}),a51_0x547993(Box,{'marginTop':0x1,'children':[a51_0x4b8555(Box,{'width':'1'}),a51_0x547993(Text,{'children':['\x20\x20',_0x3a9264('help.usageHint')]}),a51_0x547993(Text,{'bold':!![],'color':_0x4dba6b(0x1da),'children':['\x20','lovrabet\x20--help','\x20']}),a51_0x4b8555(Text,{'children':_0x3a9264(_0x4dba6b(0x1db))})]})]});}
|
package/lib/i18n/I18nProvider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e6726,_0x2d7a52){var _0x45e686=a52_0x33b2,_0x529233=_0x3e6726();while(!![]){try{var _0x57e836=parseInt(_0x45e686(0x18e))/0x1+-parseInt(_0x45e686(0x189))/0x2+-parseInt(_0x45e686(0x187))/0x3+parseInt(_0x45e686(0x18a))/0x4+parseInt(_0x45e686(0x18f))/0x5+-parseInt(_0x45e686(0x18d))/0x6+parseInt(_0x45e686(0x18b))/0x7*(-parseInt(_0x45e686(0x188))/0x8);if(_0x57e836===_0x2d7a52)break;else _0x529233['push'](_0x529233['shift']());}catch(_0x384e91){_0x529233['push'](_0x529233['shift']());}}}(a52_0x3e82,0x50a17));import{jsx as a52_0x4c3a26}from'react/jsx-runtime';function a52_0x33b2(_0x4ee70b,_0x55b585){_0x4ee70b=_0x4ee70b-0x187;var _0x3e825b=a52_0x3e82();var _0x33b271=_0x3e825b[_0x4ee70b];return _0x33b271;}function a52_0x3e82(){var _0x22cb33=['180664wMgCXL','211788QbAJdw','1326644FhajeG','49lqHVBq','language','2489004rttmgm','537350hbxEFV','3137040RsnvbN','1462041jTwcjb'];a52_0x3e82=function(){return _0x22cb33;};return a52_0x3e82();}import{I18nextProvider}from'react-i18next';import a52_0x3da489 from'./index.js';export function I18nProvider({children:_0x32abd6,language:_0x436ffa}){var _0x159fa2=a52_0x33b2;return _0x436ffa&&a52_0x3da489[_0x159fa2(0x18c)]!==_0x436ffa&&a52_0x3da489['changeLanguage'](_0x436ffa),a52_0x4c3a26(I18nextProvider,{'i18n':a52_0x3da489,'children':_0x32abd6});}
|
package/lib/i18n/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a53_0x464b(){var _0x5580d0=['950397WEPjYS','657676Iiselh','171096izGRoT','1jPCukI','3370888eAUsbh','2123560lcyxwo','336xTYdni','31067712YKTbYy','207732JmnAer'];a53_0x464b=function(){return _0x5580d0;};return a53_0x464b();}(function(_0x447fb0,_0x2393c6){var _0x4954a9=a53_0x5f49,_0x65f916=_0x447fb0();while(!![]){try{var _0x33107f=parseInt(_0x4954a9(0x112))/0x1*(-parseInt(_0x4954a9(0x110))/0x2)+-parseInt(_0x4954a9(0x10f))/0x3+-parseInt(_0x4954a9(0x113))/0x4+-parseInt(_0x4954a9(0x10b))/0x5+parseInt(_0x4954a9(0x10e))/0x6+-parseInt(_0x4954a9(0x10c))/0x7*(parseInt(_0x4954a9(0x111))/0x8)+parseInt(_0x4954a9(0x10d))/0x9;if(_0x33107f===_0x2393c6)break;else _0x65f916['push'](_0x65f916['shift']());}catch(_0x35f07e){_0x65f916['push'](_0x65f916['shift']());}}}(a53_0x464b,0x8587f));import{useTranslation}from'react-i18next';function a53_0x5f49(_0x446edd,_0x23a3b6){_0x446edd=_0x446edd-0x10b;var _0x464bd7=a53_0x464b();var _0x5f4955=_0x464bd7[_0x446edd];return _0x5f4955;}export function useI18n(){return useTranslation();}export function useI18nNs(_0x566157){return useTranslation(_0x566157);}
|
package/lib/i18n/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a54_0x3c0752=a54_0x5b7b;(function(_0x2d5efb,_0x19931a){const _0xf85937=a54_0x5b7b,_0x496e11=_0x2d5efb();while(!![]){try{const _0x3591fb=-parseInt(_0xf85937(0x1f8))/0x1*(parseInt(_0xf85937(0x1ed))/0x2)+-parseInt(_0xf85937(0x1e9))/0x3+parseInt(_0xf85937(0x1f7))/0x4+-parseInt(_0xf85937(0x1fc))/0x5+parseInt(_0xf85937(0x1f6))/0x6+-parseInt(_0xf85937(0x203))/0x7+parseInt(_0xf85937(0x1fb))/0x8;if(_0x3591fb===_0x19931a)break;else _0x496e11['push'](_0x496e11['shift']());}catch(_0xb79611){_0x496e11['push'](_0x496e11['shift']());}}}(a54_0x1b8c,0x3832e));import a54_0x122e2e from'i18next';import{initReactI18next}from'react-i18next';import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';function a54_0x1b8c(){const _0x3b0dd0=['changeLanguage','1788654LkTKQM','217984ieqSLt','2903WERGVy','DateTimeFormat','LANG','7176248rSGZmw','667305OKBOdN','.lovrabetrc','zh-CN','LOVRABET_LANG','utf8','en-US','language','3182256ypQNMJ','en_US','cwd','toLowerCase','327432NnByfc','zh_CN','string','locale','222XprlpN','init','replace','LC_ALL','lang','parse','env','resolvedOptions'];a54_0x1b8c=function(){return _0x3b0dd0;};return a54_0x1b8c();}import{homedir}from'node:os';import a54_0x31fe15 from'./locales/zh-CN.js';import a54_0x2d4ead from'./locales/en-US.js';function a54_0x5b7b(_0xe49a53,_0x14edd3){_0xe49a53=_0xe49a53-0x1e9;const _0x1b8c51=a54_0x1b8c();let _0x5b7bc0=_0x1b8c51[_0xe49a53];return _0x5b7bc0;}export function isChineseLanguage(_0x14b331){const _0x423f4a=a54_0x5b7b;if(!_0x14b331)return![];const _0xc47b10=_0x14b331[_0x423f4a(0x206)]()[_0x423f4a(0x1ef)]('_','-');return/^zh($|-)/['test'](_0xc47b10);}const LOCALE_MAP={'zh':'zh-CN','zh-cn':a54_0x3c0752(0x1fe),'zh_cn':a54_0x3c0752(0x1fe),'en':'en-US','en-us':a54_0x3c0752(0x201),'en_us':a54_0x3c0752(0x201)};export function normalizeLocale(_0x1fec37){if(!_0x1fec37)return null;return LOCALE_MAP[_0x1fec37['toLowerCase']()]??null;}function readLocaleFromConfig(){const _0x268ff=a54_0x3c0752;try{const _0x2b4cf3=resolve(process[_0x268ff(0x205)](),_0x268ff(0x1fd));if(existsSync(_0x2b4cf3)){const _0xedfd37=readFileSync(_0x2b4cf3,{'encoding':'utf8'});if(_0xedfd37){const _0x2c2a2e=JSON[_0x268ff(0x1f2)](_0xedfd37);if(typeof _0x2c2a2e[_0x268ff(0x1ec)]===_0x268ff(0x1eb)){const _0x55c56a=normalizeLocale(_0x2c2a2e[_0x268ff(0x1ec)]);if(_0x55c56a)return _0x55c56a;}}}}catch{}try{const _0x30babe=resolve(homedir(),'.lovrabetrc');if(existsSync(_0x30babe)){const _0x2a31f9=readFileSync(_0x30babe,{'encoding':_0x268ff(0x200)});if(_0x2a31f9){const _0x54e21e=JSON[_0x268ff(0x1f2)](_0x2a31f9);if(typeof _0x54e21e[_0x268ff(0x1ec)]===_0x268ff(0x1eb)){const _0x2dfab1=normalizeLocale(_0x54e21e[_0x268ff(0x1ec)]);if(_0x2dfab1)return _0x2dfab1;}}}}catch{}return null;}export function detectSystemLanguage(){const _0x168354=a54_0x3c0752,_0x55510f=process[_0x168354(0x1f3)][_0x168354(0x1ff)];if(_0x55510f){const _0x332485=normalizeLocale(_0x55510f);if(_0x332485)return _0x332485;}const _0x198922=readLocaleFromConfig();if(_0x198922)return _0x198922;const _0x2544a8=process[_0x168354(0x1f3)][_0x168354(0x1f0)];if(_0x2544a8&&isChineseLanguage(_0x2544a8))return _0x168354(0x1fe);const _0x326ff1=process[_0x168354(0x1f3)][_0x168354(0x1fa)];if(_0x326ff1&&isChineseLanguage(_0x326ff1))return'zh-CN';try{const _0x48ca20=Intl[_0x168354(0x1f9)]()[_0x168354(0x1f4)]()[_0x168354(0x1ec)];if(_0x48ca20&&isChineseLanguage(_0x48ca20))return _0x168354(0x1fe);}catch{}return _0x168354(0x201);}export function getLanguageFromFlags(_0x4b74c3){const _0x4b89a3=a54_0x3c0752,_0x3dcdb5=_0x4b74c3[_0x4b89a3(0x1f1)];if(_0x3dcdb5===_0x4b89a3(0x1fe)||_0x3dcdb5==='zh'||_0x3dcdb5===_0x4b89a3(0x1ea))return _0x4b89a3(0x1fe);if(_0x3dcdb5===_0x4b89a3(0x201)||_0x3dcdb5==='en'||_0x3dcdb5===_0x4b89a3(0x204))return _0x4b89a3(0x201);return null;}a54_0x122e2e['use'](initReactI18next)[a54_0x3c0752(0x1ee)]({'resources':{'zh-CN':{'translation':a54_0x31fe15},'en-US':{'translation':a54_0x2d4ead}},'lng':detectSystemLanguage(),'fallbackLng':'en-US','interpolation':{'escapeValue':![]},'react':{'useSuspense':![]},'showSupportNotice':![]});export default a54_0x122e2e;export function changeLanguage(_0x5d545c){const _0x4f8be4=a54_0x3c0752;a54_0x122e2e[_0x4f8be4(0x1f5)](_0x5d545c);}export function getCurrentLanguage(){const _0x2813cc=a54_0x3c0752;return a54_0x122e2e[_0x2813cc(0x202)];}
|