@lovrabet/cli 1.3.3 → 1.3.4-beta.0
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(_0x3090f1,_0x39ada9){const _0x46a475=a42_0x4017,_0x1ea9ab=_0x3090f1();while(!![]){try{const _0x3cd5b1=parseInt(_0x46a475(0x1f0))/0x1+parseInt(_0x46a475(0x21a))/0x2*(-parseInt(_0x46a475(0x203))/0x3)+parseInt(_0x46a475(0x248))/0x4+parseInt(_0x46a475(0x22a))/0x5+-parseInt(_0x46a475(0x1f8))/0x6*(parseInt(_0x46a475(0x246))/0x7)+-parseInt(_0x46a475(0x211))/0x8*(parseInt(_0x46a475(0x201))/0x9)+parseInt(_0x46a475(0x214))/0xa*(parseInt(_0x46a475(0x23d))/0xb);if(_0x3cd5b1===_0x39ada9)break;else _0x1ea9ab['push'](_0x1ea9ab['shift']());}catch(_0x18813c){_0x1ea9ab['push'](_0x1ea9ab['shift']());}}}(a42_0x24ae,0x5d639));import{jsx as a42_0x17f82a,Fragment as a42_0x279e8e,jsxs as a42_0x152e37}from'react/jsx-runtime';import a42_0x1c17f5 from'path';import a42_0x3c4f61 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';function a42_0x4017(_0x327b59,_0x400678){_0x327b59=_0x327b59-0x1eb;const _0x24ae95=a42_0x24ae();let _0x4017d3=_0x24ae95[_0x327b59];return _0x4017d3;}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(_0x4a033f){const _0x20858a=a42_0x4017,{t:_0x52ff7d}=useI18n(),[_0xd51676,_0x358ec3]=useState(![]),[_0x5a5800,_0x5907cb]=useState(![]),[_0x2bd3a5,_0x3c088c]=useState(null),[_0x368755,_0x22fb45]=useState(null),_0x4e7a4e=useCopyProjectTemplate(),_0x141019=useInstallDependencies(),_0x702284=useFormatCode();useEffect(()=>{const _0x3fc60a=a42_0x4017;checkCliVersion()[_0x3fc60a(0x1fd)](_0x1476bf=>{const _0x19bf51=_0x3fc60a;_0x1476bf['needsUpgrade']&&(printCliUpgradeWarning(_0x1476bf),logger[_0x19bf51(0x222)](_0x19bf51(0x24d),_0x19bf51(0x23f),{'currentVersion':_0x1476bf['currentVersion'],'stableVersion':_0x1476bf[_0x19bf51(0x1fc)],'needsUpgrade':_0x1476bf['needsUpgrade']}));});},[]);const _0x92f888=async _0x1a159b=>{const _0x296f09=a42_0x4017;if(!_0x1a159b[_0x296f09(0x219)]||_0x1a159b[_0x296f09(0x219)][_0x296f09(0x233)]()===''){console[_0x296f09(0x1fb)](_0x52ff7d(_0x296f09(0x237)));return;}const _0xa87853=/[<>:"|?*\x00-\x1f\x7f]/;if(_0xa87853[_0x296f09(0x234)](_0x1a159b[_0x296f09(0x219)])){console[_0x296f09(0x1fb)](_0x52ff7d(_0x296f09(0x206)));return;}if(_0x1a159b[_0x296f09(0x219)][_0x296f09(0x24b)]>0x64){console[_0x296f09(0x1fb)](_0x52ff7d(_0x296f09(0x221)));return;}const _0x77cee6=a42_0x1c17f5['resolve'](process['cwd'](),_0x1a159b['projectName']);if(a42_0x3c4f61[_0x296f09(0x256)](_0x77cee6)){console['error'](_0x52ff7d(_0x296f09(0x210),{'name':_0x1a159b['projectName']}));return;}try{const _0x2e9b1d=a42_0x1c17f5[_0x296f09(0x255)](_0x77cee6);a42_0x3c4f61[_0x296f09(0x20d)](_0x2e9b1d,a42_0x3c4f61[_0x296f09(0x227)][_0x296f09(0x231)]);}catch(_0x12c76a){console[_0x296f09(0x1fb)](_0x52ff7d(_0x296f09(0x250)));return;}_0x3c088c(_0x1a159b),_0x358ec3(!![]),logger[_0x296f09(0x1f4)](_0x77cee6),logger[_0x296f09(0x222)](_0x296f09(0x24d),_0x296f09(0x25c)+_0x1a159b[_0x296f09(0x219)],{'projectDir':_0x77cee6,'appCode':_0x1a159b['appCode']});try{await _0x4e7a4e['doTask'](_0x1a159b[_0x296f09(0x219)]),await _0x4d37f7(_0x1a159b[_0x296f09(0x219)]),await _0x141019[_0x296f09(0x213)](_0x1a159b[_0x296f09(0x219)]),await _0x702284[_0x296f09(0x213)](_0x1a159b[_0x296f09(0x219)]),await _0x5db5aa(_0x1a159b[_0x296f09(0x219)],_0x1a159b['appCode']||'',_0x1a159b[_0x296f09(0x244)]);if(_0x1a159b['pullApi']&&_0x1a159b[_0x296f09(0x202)]){console[_0x296f09(0x212)](_0x52ff7d(_0x296f09(0x218)));try{const _0x4a062a=await pullApiSilent(_0x1a159b[_0x296f09(0x202)],undefined,_0x77cee6,_0x1a159b[_0x296f09(0x244)]);_0x4a062a?(console[_0x296f09(0x212)](_0x52ff7d(_0x296f09(0x1fa))),logger[_0x296f09(0x222)](_0x296f09(0x24d),_0x296f09(0x22c)+_0x1a159b[_0x296f09(0x202)])):(console[_0x296f09(0x212)](_0x52ff7d('create.steps.apiPullFailed')),logger[_0x296f09(0x235)](_0x296f09(0x24d),_0x296f09(0x207)+_0x1a159b[_0x296f09(0x202)]));}catch(_0x4e4ed2){console[_0x296f09(0x212)](_0x52ff7d(_0x296f09(0x1f3))),logger[_0x296f09(0x235)](_0x296f09(0x24d),_0x296f09(0x239),{'error':_0x4e4ed2 instanceof Error?_0x4e4ed2['message']:String(_0x4e4ed2)});}}if(_0x1a159b[_0x296f09(0x236)]&&_0x1a159b[_0x296f09(0x1ec)]&&_0x1a159b[_0x296f09(0x1ec)][_0x296f09(0x24b)]>0x0&&_0x1a159b['appCode']){console[_0x296f09(0x212)](_0x52ff7d('create.lovrabetSetup.inProgress'));const _0x74bfe3=[],_0x41b555=[],_0x674544=_0x1a159b[_0x296f09(0x1ec)][_0x296f09(0x21b)](_0x50365f=>MCP_IDES['has'](_0x50365f)),_0x16cb83=_0x1a159b[_0x296f09(0x1ec)];for(const _0x59c2e2 of _0x674544){try{const _0x1d91f4=await configureMcp(_0x59c2e2,_0x77cee6);_0x74bfe3[_0x296f09(0x216)]({'ide':_0x59c2e2===_0x296f09(0x23b)?'Cursor':_0x296f09(0x1f5),'status':_0x1d91f4['status'],'message':_0x1d91f4[_0x296f09(0x200)]}),console[_0x296f09(0x212)]('\x20\x20'+(_0x1d91f4['status']===_0x296f09(0x249)?'✓':_0x1d91f4[_0x296f09(0x208)]==='manual'?'⚠️':'✗')+_0x296f09(0x1ee)+_0x59c2e2+':\x20'+_0x1d91f4['message']);}catch(_0x3d8824){_0x74bfe3[_0x296f09(0x216)]({'ide':_0x59c2e2===_0x296f09(0x23b)?_0x296f09(0x21d):_0x296f09(0x1f5),'status':_0x296f09(0x1fb),'message':_0x3d8824 instanceof Error?_0x3d8824[_0x296f09(0x200)]:String(_0x3d8824)}),console[_0x296f09(0x212)](_0x296f09(0x25a)+_0x59c2e2+':\x20'+(_0x3d8824 instanceof Error?_0x3d8824[_0x296f09(0x200)]:String(_0x3d8824)));}}await copySharedSkills(_0x77cee6);for(const _0x1b2527 of _0x16cb83){try{const _0x3b8df6=await installSkill(_0x1b2527,_0x77cee6);_0x41b555[_0x296f09(0x216)]({'ide':_0x3b8df6[_0x296f09(0x23a)],'status':_0x3b8df6[_0x296f09(0x208)],'message':_0x3b8df6[_0x296f09(0x200)]}),console[_0x296f09(0x212)]('\x20\x20'+(_0x3b8df6['status']===_0x296f09(0x249)?'✓':'✗')+_0x296f09(0x261)+_0x3b8df6[_0x296f09(0x23a)]+':\x20'+_0x3b8df6[_0x296f09(0x200)]);}catch(_0x80660e){_0x41b555[_0x296f09(0x216)]({'ide':_0x1b2527,'status':_0x296f09(0x1fb),'message':_0x80660e instanceof Error?_0x80660e[_0x296f09(0x200)]:String(_0x80660e)}),console[_0x296f09(0x212)](_0x296f09(0x240)+_0x1b2527+':\x20'+(_0x80660e instanceof Error?_0x80660e[_0x296f09(0x200)]:String(_0x80660e)));}}if(_0x41b555[_0x296f09(0x24b)]>0x0){const _0x3acb7c=_0x41b555[_0x296f09(0x21b)](_0xc67a6a=>_0xc67a6a[_0x296f09(0x208)]===_0x296f09(0x249))[_0x296f09(0x252)](_0x5c13e9=>_0x5c13e9[_0x296f09(0x23a)]);_0x3acb7c['length']>0x0&&createSkillManifest(_0x77cee6,_0x3acb7c);}_0x22fb45({'mcp':_0x74bfe3,'skill':_0x41b555}),console[_0x296f09(0x212)](_0x52ff7d('create.steps.mcpConfigComplete'));}logger[_0x296f09(0x249)]('create',_0x296f09(0x23e)+_0x1a159b[_0x296f09(0x219)]),_0x5907cb(!![]),_0x358ec3(![]);}catch(_0x4fcdfa){logger[_0x296f09(0x1fb)](_0x296f09(0x24d),_0x296f09(0x1eb)+_0x1a159b['projectName'],{'error':_0x4fcdfa instanceof Error?_0x4fcdfa['message']:String(_0x4fcdfa)});try{a42_0x3c4f61[_0x296f09(0x256)](_0x77cee6)&&(console[_0x296f09(0x212)](_0x52ff7d(_0x296f09(0x24a),{'dir':_0x77cee6})),a42_0x3c4f61[_0x296f09(0x20e)](_0x77cee6,{'recursive':!![],'force':!![]}));}catch(_0x5dcefa){logger[_0x296f09(0x235)](_0x296f09(0x24d),_0x296f09(0x20c)+_0x77cee6);}_0x358ec3(![]),console[_0x296f09(0x1fb)](_0x52ff7d(_0x296f09(0x259),{'error':_0x4fcdfa instanceof Error?_0x4fcdfa[_0x296f09(0x200)]:String(_0x4fcdfa)}));}},_0x3c59a1=async _0x487f23=>{await _0x92f888({'projectName':_0x487f23,'env':_0x4a033f['env']});},_0x4d37f7=async _0x2d4a51=>{const _0x18d2c7=a42_0x4017,_0x27b1fe=a42_0x1c17f5[_0x18d2c7(0x1ef)](process[_0x18d2c7(0x24c)](),_0x2d4a51),_0x9ed09c=a42_0x1c17f5[_0x18d2c7(0x241)](_0x27b1fe,_0x18d2c7(0x220));try{console[_0x18d2c7(0x212)](_0x52ff7d('create.packageJson.updating'));const _0x2e481b=fileURLToPath(import.meta.url),_0x35964a=a42_0x1c17f5[_0x18d2c7(0x1ef)](a42_0x1c17f5[_0x18d2c7(0x255)](_0x2e481b),_0x18d2c7(0x23c)),_0x4681bb=a42_0x1c17f5[_0x18d2c7(0x241)](_0x35964a,'package.json');let _0x4a1519='1.0.0';try{const _0x58bd3f=JSON[_0x18d2c7(0x254)](a42_0x3c4f61[_0x18d2c7(0x1f9)](_0x4681bb,_0x18d2c7(0x229)));_0x4a1519=_0x58bd3f[_0x18d2c7(0x22f)]||'1.0.0';}catch(_0x33d4bc){}const _0x50dd64=a42_0x3c4f61[_0x18d2c7(0x1f9)](_0x9ed09c,'utf8'),_0x15a77f=JSON[_0x18d2c7(0x254)](_0x50dd64);_0x15a77f[_0x18d2c7(0x215)]=_0x2d4a51,_0x15a77f[_0x18d2c7(0x238)]=_0x2d4a51+_0x18d2c7(0x25d)+_0x4a1519,a42_0x3c4f61['writeFileSync'](_0x9ed09c,JSON['stringify'](_0x15a77f,null,0x2)+'\x0a',_0x18d2c7(0x229)),console[_0x18d2c7(0x212)](_0x52ff7d(_0x18d2c7(0x228),{'name':_0x2d4a51})),logger['info'](_0x18d2c7(0x24d),_0x18d2c7(0x24f));}catch(_0x99d36d){logger['error'](_0x18d2c7(0x24d),'更新\x20package.json\x20失败');throw _0x99d36d;}},_0x5db5aa=async(_0x534665,_0x2519ab,_0x4f875d)=>{const _0x4cdcc9=a42_0x4017,_0x483b27=a42_0x1c17f5[_0x4cdcc9(0x1ef)](process[_0x4cdcc9(0x24c)](),_0x534665),_0xce61f9=a42_0x1c17f5['join'](_0x483b27,_0x4cdcc9(0x224));try{_0x2519ab?console[_0x4cdcc9(0x212)](_0x52ff7d('create.config.configuringAppCode',{'name':_0x534665,'appCode':_0x2519ab})):console[_0x4cdcc9(0x212)](_0x52ff7d(_0x4cdcc9(0x204),{'name':_0x534665}));const _0x1e856a=fileURLToPath(import.meta.url),_0x4ecdd6=a42_0x1c17f5[_0x4cdcc9(0x1ef)](a42_0x1c17f5[_0x4cdcc9(0x255)](_0x1e856a),_0x4cdcc9(0x23c)),_0x4c1a91=a42_0x1c17f5['join'](_0x4ecdd6,_0x4cdcc9(0x220));let _0x598f0d=_0x4cdcc9(0x1f2);try{const _0x46303c=JSON[_0x4cdcc9(0x254)](a42_0x3c4f61[_0x4cdcc9(0x1f9)](_0x4c1a91,_0x4cdcc9(0x229)));_0x598f0d=_0x46303c[_0x4cdcc9(0x22f)]||_0x4cdcc9(0x1f2);}catch(_0x2af892){}const _0x3141ae=readConfig(),_0x52f0da=typeof _0x3141ae[_0x4cdcc9(0x244)]===_0x4cdcc9(0x257)?_0x3141ae[_0x4cdcc9(0x244)]:undefined,{app:_0x21a85e,appcode:_0x361413,..._0x4b6468}=_0x3141ae,_0x2af2a8={..._0x4b6468,'appcode':_0x2519ab||'','env':_0x4f875d||_0x52f0da||_0x4cdcc9(0x20b),'createdAt':new Date()['toLocaleString'](),'version':_0x598f0d};a42_0x3c4f61['writeFileSync'](_0xce61f9,JSON[_0x4cdcc9(0x226)](_0x2af2a8,null,0x2),'utf8'),_0x2519ab?console[_0x4cdcc9(0x212)](_0x52ff7d(_0x4cdcc9(0x1ff),{'appCode':_0x2519ab})):console['log'](_0x52ff7d('create.config.createdWithoutAppCode')),logger[_0x4cdcc9(0x222)]('create','配置应用AppCode:\x20'+_0x2519ab);}catch(_0x322ff0){logger['error'](_0x4cdcc9(0x24d),_0x4cdcc9(0x242));}};useEffect(()=>{_0x4a033f['projectCode']&&_0x3c59a1(_0x4a033f['projectCode']);},[_0x4a033f[_0x20858a(0x20f)]]);if(!_0xd51676&&!_0x5a5800&&!_0x4a033f[_0x20858a(0x20f)])return a42_0x17f82a(EnhancedGuidedCreate,{'onCreate':_0x92f888,'env':_0x4a033f[_0x20858a(0x244)]});if(_0xd51676)return a42_0x152e37(a42_0x279e8e,{'children':[a42_0x152e37(Box,{'marginTop':0x1,'children':[a42_0x17f82a(Box,{'width':'1'}),a42_0x17f82a(Text,{'color':'green','children':'\x20√\x20'}),a42_0x17f82a(Text,{'children':_0x52ff7d(_0x20858a(0x217))}),a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':_0x2bd3a5?.['projectName']}),_0x2bd3a5?.[_0x20858a(0x202)]&&a42_0x152e37(a42_0x279e8e,{'children':[a42_0x17f82a(Text,{'children':_0x52ff7d('create.display.appCode')}),a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'children':_0x2bd3a5[_0x20858a(0x202)]})]})]}),a42_0x17f82a(TaskRunning,{..._0x4e7a4e}),a42_0x17f82a(TaskRunning,{..._0x141019}),a42_0x17f82a(TaskRunning,{..._0x702284})]});if(_0x5a5800){const _0xd6fc9b=_0x368755&&(_0x368755[_0x20858a(0x205)][_0x20858a(0x24b)]>0x0||_0x368755[_0x20858a(0x25f)]['length']>0x0);return a42_0x152e37(a42_0x279e8e,{'children':[a42_0x152e37(Box,{'marginTop':0x1,'children':[a42_0x17f82a(Box,{'width':'1'}),a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':_0x20858a(0x232)}),a42_0x17f82a(Text,{'children':_0x52ff7d(_0x20858a(0x217))}),a42_0x17f82a(Text,{'color':'green','children':_0x2bd3a5?.[_0x20858a(0x219)]}),_0x2bd3a5?.['appCode']&&a42_0x152e37(a42_0x279e8e,{'children':[a42_0x17f82a(Text,{'children':_0x52ff7d('create.display.appCode')}),a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'children':_0x2bd3a5[_0x20858a(0x202)]})]})]}),a42_0x17f82a(TaskFinished,{..._0x4e7a4e}),a42_0x17f82a(TaskFinished,{..._0x141019}),a42_0x17f82a(TaskFinished,{..._0x702284}),a42_0x17f82a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':'─'[_0x20858a(0x21f)](0x3c)})}),_0xd6fc9b&&a42_0x152e37(a42_0x279e8e,{'children':[_0x368755[_0x20858a(0x205)]['length']>0x0&&a42_0x152e37(a42_0x279e8e,{'children':[a42_0x17f82a(Box,{'marginTop':0x1,'children':a42_0x17f82a(Text,{'color':'green','bold':!![],'children':_0x52ff7d('create.lovrabetSetup.mcpCompleted')})}),_0x368755[_0x20858a(0x205)][_0x20858a(0x252)]((_0x4bf4bf,_0x22db75)=>a42_0x17f82a(Box,{'marginLeft':0x2,'children':a42_0x152e37(Text,{'color':_0x4bf4bf[_0x20858a(0x208)]===_0x20858a(0x249)?_0x20858a(0x230):_0x4bf4bf[_0x20858a(0x208)]==='manual'?_0x20858a(0x253):_0x20858a(0x20a),'children':[_0x4bf4bf[_0x20858a(0x23a)],':\x20',_0x4bf4bf[_0x20858a(0x200)]]})},_0x20858a(0x258)+_0x22db75))]}),_0x368755[_0x20858a(0x25f)][_0x20858a(0x24b)]>0x0&&a42_0x152e37(a42_0x279e8e,{'children':[a42_0x17f82a(Box,{'marginTop':_0x368755[_0x20858a(0x205)][_0x20858a(0x24b)]>0x0?0x1:0x0,'children':a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'bold':!![],'children':_0x52ff7d('create.lovrabetSetup.skillCompleted')})}),_0x368755[_0x20858a(0x25f)]['map']((_0x5b400a,_0x1f452f)=>a42_0x17f82a(Box,{'marginLeft':0x2,'children':a42_0x152e37(Text,{'color':_0x5b400a['status']===_0x20858a(0x249)?_0x20858a(0x230):_0x20858a(0x20a),'children':[_0x5b400a[_0x20858a(0x23a)],':\x20',_0x5b400a[_0x20858a(0x200)]]})},_0x20858a(0x22b)+_0x1f452f))]}),a42_0x17f82a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':'─'[_0x20858a(0x21f)](0x3c)})})]}),a42_0x17f82a(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'bold':!![],'children':_0x52ff7d('create.results.nextSteps')})}),a42_0x152e37(Box,{'marginLeft':0x2,'flexDirection':_0x20858a(0x223),'children':[_0xd6fc9b?a42_0x152e37(a42_0x279e8e,{'children':[a42_0x152e37(Box,{'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':_0x20858a(0x260)}),a42_0x17f82a(Text,{'color':'white','children':_0x52ff7d(_0x20858a(0x251))}),a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'bold':!![],'children':_0x20858a(0x209)+_0x2bd3a5?.['projectName']+_0x20858a(0x25b)})]}),_0x2bd3a5?.['appCode']&&!_0x2bd3a5?.[_0x20858a(0x1f1)]&&a42_0x152e37(Box,{'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x253),'children':_0x20858a(0x21c)}),a42_0x17f82a(Text,{'color':'white','children':_0x52ff7d(_0x20858a(0x225))}),a42_0x17f82a(Text,{'color':'cyan','bold':!![],'children':_0x20858a(0x247)})]})]}):a42_0x152e37(a42_0x279e8e,{'children':[a42_0x17f82a(Box,{'children':a42_0x17f82a(Text,{'color':_0x20858a(0x253),'bold':!![],'children':_0x52ff7d(_0x20858a(0x24e))})}),a42_0x152e37(Box,{'marginLeft':0x2,'marginTop':0x1,'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x230),'children':_0x52ff7d(_0x20858a(0x245))}),a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'bold':!![],'children':'lovrabet\x20skill\x20install'})]}),a42_0x152e37(Box,{'marginLeft':0x2,'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x230),'children':_0x52ff7d(_0x20858a(0x1f7))}),a42_0x17f82a(Text,{'color':'cyan','bold':!![],'children':_0x20858a(0x22e)})]}),a42_0x152e37(Box,{'marginTop':0x1,'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':'2.\x20'}),a42_0x17f82a(Text,{'color':_0x20858a(0x230),'children':_0x52ff7d(_0x20858a(0x251))}),a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'bold':!![],'children':_0x20858a(0x209)+_0x2bd3a5?.[_0x20858a(0x219)]+_0x20858a(0x25b)})]}),_0x2bd3a5?.[_0x20858a(0x202)]&&!_0x2bd3a5?.['pullApi']&&a42_0x152e37(Box,{'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x253),'children':_0x20858a(0x1fe)}),a42_0x17f82a(Text,{'color':'white','children':_0x52ff7d(_0x20858a(0x225))}),a42_0x17f82a(Text,{'color':'cyan','bold':!![],'children':_0x20858a(0x247)})]})]}),!_0x2bd3a5?.['appCode']&&a42_0x152e37(a42_0x279e8e,{'children':[a42_0x152e37(Box,{'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x21e),'children':_0x20858a(0x21c)}),a42_0x17f82a(Text,{'color':_0x20858a(0x230),'children':_0x52ff7d(_0x20858a(0x1f6))}),a42_0x17f82a(Text,{'color':'cyan','bold':!![],'children':_0x20858a(0x243)})]}),a42_0x152e37(Box,{'children':[a42_0x17f82a(Text,{'color':_0x20858a(0x21e),'children':_0x20858a(0x1fe)}),a42_0x17f82a(Text,{'color':_0x20858a(0x230),'children':_0x52ff7d(_0x20858a(0x225))}),a42_0x17f82a(Text,{'color':_0x20858a(0x1ed),'bold':!![],'children':_0x20858a(0x22d)})]})]})]}),a42_0x17f82a(Box,{'marginTop':0x1,'children':a42_0x17f82a(Text,{'color':_0x20858a(0x25e),'children':'─'[_0x20858a(0x21f)](0x3c)})})]});}return null;}function a42_0x24ae(){const _0x53bcd4=['setLogPath','Claude\x20Code','create.nextSteps.configAppCode','create.nextSteps.mcp','152634LQygbq','readFileSync','create.steps.apiPullSuccess','error','stableVersion','then','3.\x20','create.config.createdWithAppCode','message','234lFiRYJ','appCode','30IxKQPz','create.config.creating','mcp','create.validation.invalidChars','API\x20配置拉取失败:\x20','status','cd\x20','red','online','清理项目目录失败:\x20','accessSync','rmSync','projectCode','create.validation.dirExists','95448bvxPCO','log','doTask','231910WxJrLv','name','push','create.display.projectName','create.steps.pullingApi','projectName','118702NGAHPL','filter','2.\x20','Cursor','gray','repeat','package.json','create.validation.tooLong','info','column','.lovrabetrc','create.nextSteps.pullApi','stringify','constants','create.packageJson.updated','utf8','3549045qAEvwM','skill-','API\x20配置拉取成功:\x20','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','lovrabet\x20mcp\x20install','version','white','W_OK','\x20√\x20','trim','test','warn','aiSetup','create.validation.required','description','API\x20配置拉取异常','ide','cursor','../..','319VLpfix','项目创建完成:\x20','CLI\x20版本检查','\x20\x20✗\x20Skill\x20','join','配置应用AppCode失败','lovrabet\x20config\x20set\x20appcode\x20[app-code]','env','create.nextSteps.skill','161woPHgl','lovrabet\x20api\x20pull','118892FHEErB','success','create.cleanup.inProgress','length','cwd','create','create.nextSteps.configureMcpAndSkill','更新\x20package.json\x20name','create.validation.noPermission','create.nextSteps.startProject','map','yellow','parse','dirname','existsSync','string','mcp-','create.errors.createFailed','\x20\x20✗\x20MCP\x20','\x20&&\x20lovrabet\x20start','开始创建项目:\x20','\x20Generated\x20by\x20lovrabet\x20cli\x20','green','skill','1.\x20','\x20Skill\x20','项目创建失败:\x20','selectedIDEs','cyan','\x20MCP\x20','resolve','459263BANbNE','pullApi','1.0.0','create.steps.apiPullError'];a42_0x24ae=function(){return _0x53bcd4;};return a42_0x24ae();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x147257=a43_0x3f85;(function(_0x27eccb,_0x55de90){const _0x4786d0=a43_0x3f85,_0x126f4b=_0x27eccb();while(!![]){try{const _0x4981ef=parseInt(_0x4786d0(0x13e))/0x1*(parseInt(_0x4786d0(0x147))/0x2)+-parseInt(_0x4786d0(0x165))/0x3+-parseInt(_0x4786d0(0x150))/0x4*(parseInt(_0x4786d0(0x14b))/0x5)+parseInt(_0x4786d0(0x140))/0x6+-parseInt(_0x4786d0(0x163))/0x7*(parseInt(_0x4786d0(0x13f))/0x8)+-parseInt(_0x4786d0(0x13a))/0x9+parseInt(_0x4786d0(0x15e))/0xa;if(_0x4981ef===_0x55de90)break;else _0x126f4b['push'](_0x126f4b['shift']());}catch(_0x229cdb){_0x126f4b['push'](_0x126f4b['shift']());}}}(a43_0x3c72,0x70217));import a43_0x29af00 from'path';import{fileURLToPath}from'url';function a43_0x3c72(){const _0x44df44=['exit','\x0a\x20\x20cd\x20','create.validation.required','create.validation.noPermission','依赖安装失败:\x20','test','create.nonInteractive.codeFormatted','20170630zkNUcB','error','resolve','bun\x20--version','parse','10465GmXykQ','log','1421217JcTLGQ','create.nonInteractive.envConfigured','bun','create.nonInteractive.installingDeps','lovrabet.config.json','message','3080241cBjjmT','create.nonInteractive.success','readFile','../../templates/projects/sub-app-react-demo','111746EVBkyT','4616qMqqGK','5286510jYcrLS','utf-8','join','bind','constants','create.validation.tooLong','npm','2SkbjKw','description','needsUpgrade','create.nonInteractive.depsSkipped','1453340TMaYQz','create.nonInteractive.packageJsonUpdated','\x20install','W_OK','\x20\x20lovrabet\x20start\x0a','12rVpwQi','length','name','writeFile','dirname','cwd','create.errors.createFailed'];a43_0x3c72=function(){return _0x44df44;};return a43_0x3c72();}import a43_0x10b1a3 from'fs/promises';import{existsSync}from'fs';import{copyDirectory}from'../utils/copy-directory.js';import{exec}from'child_process';function a43_0x3f85(_0x866945,_0x20975e){_0x866945=_0x866945-0x137;const _0x3c722f=a43_0x3c72();let _0x3f8587=_0x3c722f[_0x866945];return _0x3f8587;}import{promisify}from'util';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';import a43_0x39a486 from'../i18n/index.js';const t=a43_0x39a486['t'][a43_0x147257(0x143)](a43_0x39a486),execAsync=promisify(exec);function getTemplateDir(){const _0x5894d4=a43_0x147257,_0x5944d2=fileURLToPath(import.meta.url),_0x558f83=a43_0x29af00[_0x5894d4(0x154)](_0x5944d2);return a43_0x29af00[_0x5894d4(0x160)](_0x558f83,_0x5894d4(0x13d));}export async function createProjectNonInteractive(_0x1b81e9,_0x5f44de){const _0x573557=a43_0x147257,_0x1ef69f=await checkCliVersion();_0x1ef69f[_0x573557(0x149)]&&printCliUpgradeWarning(_0x1ef69f);(!_0x1b81e9||_0x1b81e9['trim']()==='')&&(console['error'](t(_0x573557(0x159))),process['exit'](0x1));const _0x3c838d=/[<>:"|?*\x00-\x1f\x7f]/;_0x3c838d[_0x573557(0x15c)](_0x1b81e9)&&(console[_0x573557(0x15f)](t('create.validation.invalidChars')),process[_0x573557(0x157)](0x1));_0x1b81e9[_0x573557(0x151)]>0x64&&(console[_0x573557(0x15f)](t(_0x573557(0x145))),process[_0x573557(0x157)](0x1));const _0x3edd3e=a43_0x29af00[_0x573557(0x160)](process['cwd'](),_0x1b81e9);existsSync(_0x3edd3e)&&(console['error'](t('create.validation.dirExists',{'name':_0x1b81e9})),process['exit'](0x1));try{const _0x182980=a43_0x29af00[_0x573557(0x154)](_0x3edd3e);await a43_0x10b1a3['access'](_0x182980,a43_0x10b1a3[_0x573557(0x144)][_0x573557(0x14e)]);}catch(_0x16200a){console['error'](t(_0x573557(0x15a))),process[_0x573557(0x157)](0x1);}try{console[_0x573557(0x164)](t('create.nonInteractive.creating',{'name':_0x1b81e9}));const _0x451a9b=getTemplateDir();await copyDirectory(_0x451a9b,_0x3edd3e),console[_0x573557(0x164)](t('create.nonInteractive.templateCreated')),await updatePackageJsonName(_0x1b81e9),console['log'](t(_0x573557(0x14c))),console[_0x573557(0x164)](t(_0x573557(0x137))),console[_0x573557(0x164)](t(_0x573557(0x14a))),await formatCode(_0x3edd3e),console['log'](t(_0x573557(0x15d))),await configureAppEnv(_0x1b81e9,_0x5f44de),console['log'](t(_0x573557(0x166))),console[_0x573557(0x164)](t(_0x573557(0x13b),{'name':_0x1b81e9})),console[_0x573557(0x164)](_0x573557(0x158)+_0x1b81e9),console['log'](_0x573557(0x14f));}catch(_0x42eba2){const _0x39a437=_0x42eba2 instanceof Error?_0x42eba2[_0x573557(0x139)]:String(_0x42eba2);try{existsSync(_0x3edd3e)&&await a43_0x10b1a3['rm'](_0x3edd3e,{'recursive':!![],'force':!![]});}catch{}console[_0x573557(0x15f)](t(_0x573557(0x156),{'error':_0x39a437})),process['exit'](0x1);}}async function updatePackageJsonName(_0x4391ea){const _0x48e72c=a43_0x147257,_0x2b4425=a43_0x29af00[_0x48e72c(0x160)](process[_0x48e72c(0x155)](),_0x4391ea),_0xbdaf11=a43_0x29af00[_0x48e72c(0x142)](_0x2b4425,'package.json'),_0x163610=await a43_0x10b1a3[_0x48e72c(0x13c)](_0xbdaf11,_0x48e72c(0x141)),_0x70aa6e=JSON['parse'](_0x163610);_0x70aa6e[_0x48e72c(0x152)]=_0x4391ea,_0x70aa6e[_0x48e72c(0x148)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a43_0x10b1a3[_0x48e72c(0x153)](_0xbdaf11,JSON['stringify'](_0x70aa6e,null,0x2)+'\x0a');}async function installDependencies(_0x10cc07){const _0x27d990=a43_0x147257,_0x53ea6a=detectPackageManager(),_0x34a8d3=_0x53ea6a+_0x27d990(0x14d);try{await execAsync(_0x34a8d3,{'cwd':_0x10cc07});}catch(_0x1fb580){throw new Error(_0x27d990(0x15b)+_0x1fb580);}}function detectPackageManager(){const _0x74112=a43_0x147257;try{return execAsync(_0x74112(0x161),{}),_0x74112(0x167);}catch{return _0x74112(0x146);}}async function formatCode(_0x27ca1a){try{await execAsync('bun\x20run\x20format',{'cwd':_0x27ca1a});}catch{}}async function configureAppEnv(_0x2b3579,_0x4466a0){const _0x5ea269=a43_0x147257,_0x53259b=a43_0x29af00[_0x5ea269(0x160)](process[_0x5ea269(0x155)](),_0x2b3579),_0xfda1b7=a43_0x29af00['join'](_0x53259b,_0x5ea269(0x138));let _0x558f31={};if(existsSync(_0xfda1b7)){const _0x175a8d=await a43_0x10b1a3[_0x5ea269(0x13c)](_0xfda1b7,_0x5ea269(0x141));_0x558f31=JSON[_0x5ea269(0x162)](_0x175a8d);}_0x4466a0&&(_0x558f31['env']=_0x4466a0),await a43_0x10b1a3[_0x5ea269(0x153)](_0xfda1b7,JSON['stringify'](_0x558f31,null,0x2)+'\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x56fc18,_0x2491d3){var _0x577fa5=a44_0x4327,_0x4b9046=_0x56fc18();while(!![]){try{var _0x55f90f=-parseInt(_0x577fa5(0x158))/0x1*(parseInt(_0x577fa5(0x153))/0x2)+parseInt(_0x577fa5(0x14c))/0x3*(-parseInt(_0x577fa5(0x14e))/0x4)+parseInt(_0x577fa5(0x151))/0x5*(parseInt(_0x577fa5(0x159))/0x6)+parseInt(_0x577fa5(0x157))/0x7*(-parseInt(_0x577fa5(0x152))/0x8)+-parseInt(_0x577fa5(0x14d))/0x9+-parseInt(_0x577fa5(0x150))/0xa*(-parseInt(_0x577fa5(0x155))/0xb)+-parseInt(_0x577fa5(0x156))/0xc;if(_0x55f90f===_0x2491d3)break;else _0x4b9046['push'](_0x4b9046['shift']());}catch(_0x11bc34){_0x4b9046['push'](_0x4b9046['shift']());}}}(a44_0x5319,0xd0a41));import{jsx as a44_0x90b27f,jsxs as a44_0x5a0a76}from'react/jsx-runtime';import{Box,Text}from'ink';function a44_0x5319(){var _0xeaccc0=['7515252FBrblF','5173pdPjRn','99562QqTyOc','233718JOtUoi','242664pKcrDA','275409hLIayK','4jhWnXJ','taskName','789380yElHcc','130PMCMNr','3272GuOLdz','14bZwFcJ','green','220fYBvaq'];a44_0x5319=function(){return _0xeaccc0;};return a44_0x5319();}function a44_0x4327(_0x1965ee,_0x2d9f5f){_0x1965ee=_0x1965ee-0x14c;var _0x53192e=a44_0x5319();var _0x43270e=_0x53192e[_0x1965ee];return _0x43270e;}import{TaskTime}from'./task-time.js';export function TaskFinished(_0x2c5622){var _0x384204=a44_0x4327;return a44_0x5a0a76(Box,{'children':[a44_0x90b27f(Box,{'width':'1'}),a44_0x90b27f(Text,{'color':_0x384204(0x154),'children':'\x20√\x20'}),a44_0x90b27f(Text,{'children':_0x2c5622[_0x384204(0x14f)]}),a44_0x90b27f(TaskTime,{'elapsed':_0x2c5622['elapsed']})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3b3334,_0x370e97){var _0x59e415=a45_0x1a78,_0x56e0a2=_0x3b3334();while(!![]){try{var _0x128c8b=parseInt(_0x59e415(0x1c5))/0x1*(parseInt(_0x59e415(0x1c3))/0x2)+-parseInt(_0x59e415(0x1c6))/0x3+parseInt(_0x59e415(0x1c2))/0x4*(-parseInt(_0x59e415(0x1be))/0x5)+parseInt(_0x59e415(0x1c7))/0x6+-parseInt(_0x59e415(0x1bf))/0x7+-parseInt(_0x59e415(0x1c0))/0x8+parseInt(_0x59e415(0x1c8))/0x9;if(_0x128c8b===_0x370e97)break;else _0x56e0a2['push'](_0x56e0a2['shift']());}catch(_0x49a491){_0x56e0a2['push'](_0x56e0a2['shift']());}}}(a45_0x4a82,0xc8510));import{jsx as a45_0x38383a,jsxs as a45_0x2a84b0}from'react/jsx-runtime';function a45_0x4a82(){var _0xa8bbf1=['finished','loading','1300bZOpZz','2119348yHhrDd','11550784QSEDeF','dots','11192tISsAE','1853890QPeVrc','\x20√\x20','1OeoCUg','415995cbgqgq','2829138cwxYgD','18313065KhTyex','green'];a45_0x4a82=function(){return _0xa8bbf1;};return a45_0x4a82();}import{Text}from'ink';import a45_0x5d192e from'ink-spinner';function a45_0x1a78(_0x569b5d,_0x2487ca){_0x569b5d=_0x569b5d-0x1bb;var _0x4a8251=a45_0x4a82();var _0x1a781b=_0x4a8251[_0x569b5d];return _0x1a781b;}export function TaskLoading(_0x493a0a){var _0x1c76c6=a45_0x1a78;if(_0x493a0a[_0x1c76c6(0x1bc)])return a45_0x38383a(Text,{'color':_0x1c76c6(0x1bb),'children':_0x1c76c6(0x1c4)});if(_0x493a0a[_0x1c76c6(0x1bd)])return a45_0x2a84b0(Text,{'color':_0x1c76c6(0x1bb),'children':['\x20',a45_0x38383a(a45_0x5d192e,{'type':_0x1c76c6(0x1c1)}),'\x20']});return a45_0x38383a(Text,{'children':'\x20\x20\x20'});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x45b669,_0x3aee10){var _0x381384=a46_0x5e5e,_0x5ef9f4=_0x45b669();while(!![]){try{var _0x49cf82=parseInt(_0x381384(0xc3))/0x1*(parseInt(_0x381384(0xc0))/0x2)+-parseInt(_0x381384(0xba))/0x3*(parseInt(_0x381384(0xc5))/0x4)+parseInt(_0x381384(0xbe))/0x5*(-parseInt(_0x381384(0xbd))/0x6)+-parseInt(_0x381384(0xbc))/0x7+-parseInt(_0x381384(0xc4))/0x8+-parseInt(_0x381384(0xbb))/0x9*(-parseInt(_0x381384(0xc1))/0xa)+parseInt(_0x381384(0xb9))/0xb;if(_0x49cf82===_0x3aee10)break;else _0x5ef9f4['push'](_0x5ef9f4['shift']());}catch(_0x35dbe9){_0x5ef9f4['push'](_0x5ef9f4['shift']());}}}(a46_0x33ca,0x6e0bf));import{jsx as a46_0x6be4c1,jsxs as a46_0x3b2b0d}from'react/jsx-runtime';function a46_0x33ca(){var _0x20c828=['15nwIelA','taskName','57170VmORWU','2843410ozsnEc','elapsed','11DULvaa','7076592TCuxEU','31956MPAEGm','27904250YmCItb','207tWkwxl','9ivHjOs','3653181NONOUx','1454154MIYNDX'];a46_0x33ca=function(){return _0x20c828;};return a46_0x33ca();}import{Box,Text}from'ink';function a46_0x5e5e(_0x595a28,_0x10dc27){_0x595a28=_0x595a28-0xb9;var _0x33ca3d=a46_0x33ca();var _0x5e5e84=_0x33ca3d[_0x595a28];return _0x5e5e84;}import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x21e273){var _0x3e7dd8=a46_0x5e5e;return a46_0x3b2b0d(Box,{'children':[a46_0x6be4c1(Box,{'width':'1'}),a46_0x6be4c1(TaskLoading,{..._0x21e273}),a46_0x6be4c1(Text,{'children':_0x21e273[_0x3e7dd8(0xbf)]}),a46_0x6be4c1(TaskTime,{'elapsed':_0x21e273[_0x3e7dd8(0xc2)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4f352e,_0x7566cb){var _0x32c9fe=a47_0xe86e,_0x19da9a=_0x4f352e();while(!![]){try{var _0x4e6220=parseInt(_0x32c9fe(0x1df))/0x1+parseInt(_0x32c9fe(0x1de))/0x2+-parseInt(_0x32c9fe(0x1dd))/0x3*(parseInt(_0x32c9fe(0x1dc))/0x4)+-parseInt(_0x32c9fe(0x1e2))/0x5+parseInt(_0x32c9fe(0x1e3))/0x6+parseInt(_0x32c9fe(0x1e5))/0x7+-parseInt(_0x32c9fe(0x1e1))/0x8;if(_0x4e6220===_0x7566cb)break;else _0x19da9a['push'](_0x19da9a['shift']());}catch(_0x72f4bd){_0x19da9a['push'](_0x19da9a['shift']());}}}(a47_0x4942,0xc5527));function a47_0x4942(){var _0x2587c8=['gray','1730048tpFeRj','5481220NkZIby','5739552ZncNLj','elapsed','1820042brtHZp','108584dxQCzJ','57fTJjqW','952760TugVyg','943527NXzAEo'];a47_0x4942=function(){return _0x2587c8;};return a47_0x4942();}import{jsx as a47_0x26f781,Fragment as a47_0x1d00a3,jsxs as a47_0x15776b}from'react/jsx-runtime';import{Text}from'ink';function a47_0xe86e(_0x484e67,_0xf39e3c){_0x484e67=_0x484e67-0x1dc;var _0x4942f0=a47_0x4942();var _0xe86e=_0x4942f0[_0x484e67];return _0xe86e;}export function TaskTime(_0x260264){var _0x24fef8=a47_0xe86e;if(_0x260264[_0x24fef8(0x1e4)])return a47_0x15776b(a47_0x1d00a3,{'children':[a47_0x26f781(Text,{'color':'gray','children':'\x20['}),a47_0x26f781(Text,{'color':'gray','bold':!![],'children':_0x260264[_0x24fef8(0x1e4)]}),a47_0x26f781(Text,{'color':_0x24fef8(0x1e0),'children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x74e835=a48_0x2f85;(function(_0x531441,_0x13c545){const _0x9f0aea=a48_0x2f85,_0x16be69=_0x531441();while(!![]){try{const _0x365dba=-parseInt(_0x9f0aea(0x149))/0x1*(parseInt(_0x9f0aea(0x14f))/0x2)+parseInt(_0x9f0aea(0x15e))/0x3*(parseInt(_0x9f0aea(0x15b))/0x4)+-parseInt(_0x9f0aea(0x15a))/0x5*(parseInt(_0x9f0aea(0x154))/0x6)+-parseInt(_0x9f0aea(0x160))/0x7+parseInt(_0x9f0aea(0x14e))/0x8*(parseInt(_0x9f0aea(0x14b))/0x9)+parseInt(_0x9f0aea(0x152))/0xa*(parseInt(_0x9f0aea(0x150))/0xb)+-parseInt(_0x9f0aea(0x158))/0xc;if(_0x365dba===_0x13c545)break;else _0x16be69['push'](_0x16be69['shift']());}catch(_0x3e193b){_0x16be69['push'](_0x16be69['shift']());}}}(a48_0x2499,0x4747e));function a48_0x2f85(_0x4ddee0,_0x16b255){_0x4ddee0=_0x4ddee0-0x149;const _0x2499a9=a48_0x2499();let _0x2f8564=_0x2499a9[_0x4ddee0];return _0x2f8564;}import a48_0x2a35b8 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_0x2a35b8[a48_0x74e835(0x156)](fileURLToPath(import.meta.url)),templateDir=a48_0x2a35b8[a48_0x74e835(0x155)](__dirname,a48_0x74e835(0x159));function a48_0x2499(){const _0x492aae=['30AODQoS','now','6KrBADc','resolve','dirname','error','1623156pcWOLN','../../templates/projects/sub-app-react-demo','1773570eqyLCz','65724BVoTmW','cwd','message','102dwZVAc','开始复制项目模板','3689168nvvmDT','53JDTGdt','copy','27nyTXNZ','项目模板复制完成','create.tasks.copyFiles','1276360gDuHdX','8870VpXmZr','1858021yQvHwe','项目模板复制失败'];a48_0x2499=function(){return _0x492aae;};return a48_0x2499();}export function useCopyProjectTemplate(){const _0x3f1884=a48_0x74e835,{t:_0x61d0c0}=useI18n(),[_0x5d0196,_0x2aece4]=useState(![]),[_0x2b6d6f,_0x17b7fc]=useState(![]),[_0xbef13,_0x31891d]=useState(''),_0x57880f=useCallback(async _0x2b1493=>{const _0x1cbe4c=a48_0x2f85,_0x3b93b7=Date[_0x1cbe4c(0x153)](),_0x175d1d=a48_0x2a35b8[_0x1cbe4c(0x155)](process[_0x1cbe4c(0x15c)](),_0x2b1493);_0x2aece4(!![]);try{logger['info'](_0x1cbe4c(0x14a),_0x1cbe4c(0x15f),{'projectCode':_0x2b1493,'templateDir':templateDir}),await copyDirectory(templateDir,_0x175d1d);const _0x12f33a=Date[_0x1cbe4c(0x153)]()-_0x3b93b7;logger['success'](_0x1cbe4c(0x14a),_0x1cbe4c(0x14c),_0x12f33a,{'projectCode':_0x2b1493});}catch(_0x1398ab){const _0x374190=Date[_0x1cbe4c(0x153)]()-_0x3b93b7;logger[_0x1cbe4c(0x157)](_0x1cbe4c(0x14a),_0x1cbe4c(0x151),{'projectCode':_0x2b1493,'error':_0x1398ab instanceof Error?_0x1398ab[_0x1cbe4c(0x15d)]:String(_0x1398ab),'duration':_0x374190});throw _0x1398ab;}finally{_0x2aece4(![]),_0x17b7fc(!![]),_0x31891d(formatElapsed(_0x3b93b7));}},[]);return{'taskName':_0x61d0c0(_0x3f1884(0x14d)),'finished':_0x2b6d6f,'loading':_0x5d0196,'elapsed':_0xbef13,'doTask':_0x57880f};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1412c8,_0x51d210){const _0x288542=a49_0x3b1b,_0x1ab274=_0x1412c8();while(!![]){try{const _0x17fba0=parseInt(_0x288542(0x196))/0x1+-parseInt(_0x288542(0x187))/0x2+-parseInt(_0x288542(0x18a))/0x3+-parseInt(_0x288542(0x18d))/0x4+parseInt(_0x288542(0x183))/0x5*(parseInt(_0x288542(0x193))/0x6)+parseInt(_0x288542(0x18b))/0x7*(-parseInt(_0x288542(0x18c))/0x8)+parseInt(_0x288542(0x192))/0x9*(parseInt(_0x288542(0x197))/0xa);if(_0x17fba0===_0x51d210)break;else _0x1ab274['push'](_0x1ab274['shift']());}catch(_0x22daab){_0x1ab274['push'](_0x1ab274['shift']());}}}(a49_0x2e48,0x6805c));import a49_0x3938bf from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a49_0x2e48(){const _0xcdc3fe=['create.tasks.formatCode','代码格式化失败','736003pAQQEg','10DdjLOS','开始格式化代码','now','15DaaVvz','success','--write','resolve','1520946GKuOPJ','info','prettier','1319481HIaPHJ','826dxdzdd','36688hPhGXq','1881816krFUnk','error','format','npx','message','16251939XinMNK','192408hhXpwE'];a49_0x2e48=function(){return _0xcdc3fe;};return a49_0x2e48();}function a49_0x3b1b(_0x3dc246,_0x2d47b6){_0x3dc246=_0x3dc246-0x183;const _0x2e48be=a49_0x2e48();let _0x3b1bda=_0x2e48be[_0x3dc246];return _0x3b1bda;}import{useI18n}from'../i18n/hooks.js';export function useFormatCode(){const _0x39d9bc=a49_0x3b1b,{t:_0x42f394}=useI18n(),[_0x55d431,_0x3f9a06]=useState(![]),[_0x2942f0,_0x10ec99]=useState(![]),[_0x228ceb,_0xc2a68c]=useState(''),_0x16d008=useCallback(async _0x10f8c8=>{const _0x5c23b3=a49_0x3b1b,_0x22da21=Date['now'](),_0x4ae112=a49_0x3938bf[_0x5c23b3(0x186)](process['cwd'](),_0x10f8c8);_0x3f9a06(!![]);try{logger[_0x5c23b3(0x188)]('format',_0x5c23b3(0x198),{'projectCode':_0x10f8c8}),await execa(_0x5c23b3(0x190),[_0x5c23b3(0x189),_0x5c23b3(0x185),'.'],{'cwd':_0x4ae112});const _0x273eda=Date[_0x5c23b3(0x199)]()-_0x22da21;logger[_0x5c23b3(0x184)](_0x5c23b3(0x18f),'代码格式化完成',_0x273eda,{'projectCode':_0x10f8c8});}catch(_0x475643){const _0x368adc=Date['now']()-_0x22da21;logger[_0x5c23b3(0x18e)](_0x5c23b3(0x18f),_0x5c23b3(0x195),{'projectCode':_0x10f8c8,'error':_0x475643 instanceof Error?_0x475643[_0x5c23b3(0x191)]:String(_0x475643),'duration':_0x368adc});throw _0x475643;}finally{_0x3f9a06(![]),_0x10ec99(!![]),_0xc2a68c(formatElapsed(_0x22da21));}},[]);return{'taskName':_0x42f394(_0x39d9bc(0x194)),'finished':_0x2942f0,'loading':_0x55d431,'elapsed':_0x228ceb,'doTask':_0x16d008};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x17ddb6,_0x12521d){const _0x221c0b=a50_0x33da,_0x1841cb=_0x17ddb6();while(!![]){try{const _0x23adcf=parseInt(_0x221c0b(0x1cd))/0x1*(-parseInt(_0x221c0b(0x1cc))/0x2)+-parseInt(_0x221c0b(0x1d7))/0x3+-parseInt(_0x221c0b(0x1c9))/0x4+-parseInt(_0x221c0b(0x1db))/0x5+parseInt(_0x221c0b(0x1d9))/0x6*(-parseInt(_0x221c0b(0x1d8))/0x7)+-parseInt(_0x221c0b(0x1d4))/0x8+-parseInt(_0x221c0b(0x1d3))/0x9*(-parseInt(_0x221c0b(0x1cb))/0xa);if(_0x23adcf===_0x12521d)break;else _0x1841cb['push'](_0x1841cb['shift']());}catch(_0x37138b){_0x1841cb['push'](_0x1841cb['shift']());}}}(a50_0x5aaa,0x762e0));import a50_0x37e14e from'node:path';function a50_0x33da(_0x113a51,_0x595b07){_0x113a51=_0x113a51-0x1c9;const _0x5aaa7e=a50_0x5aaa();let _0x33dacf=_0x5aaa7e[_0x113a51];return _0x33dacf;}import{useCallback,useState}from'react';function a50_0x5aaa(){const _0x180532=['609452XXqRoz','依赖安装失败','4650jNBhDz','1054yfofjD','1427dNDErP','npm','error','success','create.tasks.installDependencies','install','60561qvuVOk','2697528PirFfE','resolve','https://registry.npmmirror.com','2360997rCMibz','37786mGQQtR','678yRqlaR','message','31825qffrYK','now','cwd','开始安装依赖','--registry'];a50_0x5aaa=function(){return _0x180532;};return a50_0x5aaa();}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';import{useI18n}from'../i18n/hooks.js';export function useInstallDependencies(){const _0x1a4d75=a50_0x33da,{t:_0xbc2ecd}=useI18n(),[_0x5b3201,_0x214428]=useState(![]),[_0x11e4b1,_0x2c2350]=useState(![]),[_0x48fbb2,_0x4ab978]=useState(''),_0x2e857c=useCallback(async _0x47cbd7=>{const _0x11c312=a50_0x33da,_0x530317=Date[_0x11c312(0x1dc)](),_0x5278be=a50_0x37e14e[_0x11c312(0x1d5)](process[_0x11c312(0x1dd)](),_0x47cbd7);_0x214428(!![]),_0x2c2350(![]);const _0x3a5939=async(_0x5520fc,_0x127948)=>{await execa(_0x5520fc,_0x127948,{'cwd':_0x5278be});};try{logger['info'](_0x11c312(0x1d2),_0x11c312(0x1de),{'projectCode':_0x47cbd7,'registry':_0x11c312(0x1d6)}),await _0x3a5939(_0x11c312(0x1ce),[_0x11c312(0x1d2),_0x11c312(0x1df),_0x11c312(0x1d6)]);const _0x23c172=Date[_0x11c312(0x1dc)]()-_0x530317;logger[_0x11c312(0x1d0)](_0x11c312(0x1d2),'依赖安装完成',_0x23c172,{'projectCode':_0x47cbd7});}catch(_0x43db30){const _0x307f0e=Date[_0x11c312(0x1dc)]()-_0x530317;logger[_0x11c312(0x1cf)](_0x11c312(0x1d2),_0x11c312(0x1ca),{'projectCode':_0x47cbd7,'error':_0x43db30 instanceof Error?_0x43db30[_0x11c312(0x1da)]:String(_0x43db30),'duration':_0x307f0e});throw _0x43db30;}finally{_0x214428(![]),_0x2c2350(!![]),_0x4ab978(formatElapsed(_0x530317));}},[]);return{'taskName':_0xbc2ecd(_0x1a4d75(0x1d1)),'finished':_0x11e4b1,'loading':_0x5b3201,'elapsed':_0x48fbb2,'doTask':_0x2e857c};}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x228a2a,_0x54cab6){const _0x37055c=a51_0x2ef7,_0x3f2235=_0x228a2a();while(!![]){try{const _0x205571=-parseInt(_0x37055c(0x137))/0x1+-parseInt(_0x37055c(0x139))/0x2+-parseInt(_0x37055c(0x130))/0x3+-parseInt(_0x37055c(0x136))/0x4*(-parseInt(_0x37055c(0x134))/0x5)+parseInt(_0x37055c(0x133))/0x6+-parseInt(_0x37055c(0x12f))/0x7+parseInt(_0x37055c(0x131))/0x8*(parseInt(_0x37055c(0x132))/0x9);if(_0x205571===_0x54cab6)break;else _0x3f2235['push'](_0x3f2235['shift']());}catch(_0xd551e1){_0x3f2235['push'](_0x3f2235['shift']());}}}(a51_0x31c1,0x9dd83));function a51_0x31c1(){const _0x370534=['82676jcHKCL','help.usageHint','column','5018573FljylU','1329468GrnCoT','104mhULCd','840501VbiGWz','6688692ztGQWB','353485jVUhUC','help.viewCommands','44MNQxMJ','1258542mMhSkB','help.invalidCommand'];a51_0x31c1=function(){return _0x370534;};return a51_0x31c1();}import{jsx as a51_0x34ab13,jsxs as a51_0x31b5cc}from'react/jsx-runtime';function a51_0x2ef7(_0x5b13f8,_0x38e1c9){_0x5b13f8=_0x5b13f8-0x12e;const _0x31c177=a51_0x31c1();let _0x2ef7eb=_0x31c177[_0x5b13f8];return _0x2ef7eb;}import{Box,Text}from'ink';import{useI18n}from'./i18n/hooks.js';export function Help(){const _0x18f558=a51_0x2ef7,{t:_0x3b41fa}=useI18n();return a51_0x31b5cc(Box,{'flexDirection':_0x18f558(0x12e),'marginTop':0x1,'marginBottom':0x1,'children':[a51_0x31b5cc(Box,{'children':[a51_0x34ab13(Box,{'width':'1'}),a51_0x34ab13(Text,{'children':_0x3b41fa(_0x18f558(0x138))})]}),a51_0x31b5cc(Box,{'marginTop':0x1,'children':[a51_0x34ab13(Box,{'width':'1'}),a51_0x31b5cc(Text,{'children':['\x20\x20',_0x3b41fa(_0x18f558(0x13a))]}),a51_0x31b5cc(Text,{'bold':!![],'color':'green','children':['\x20','lovrabet\x20--help','\x20']}),a51_0x34ab13(Text,{'children':_0x3b41fa(_0x18f558(0x135))})]})]});}
|
package/lib/i18n/I18nProvider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5dec9e,_0x46dc2c){var _0x393e22=a52_0x463c,_0x2161f6=_0x5dec9e();while(!![]){try{var _0x4e94af=-parseInt(_0x393e22(0xf1))/0x1*(-parseInt(_0x393e22(0xee))/0x2)+parseInt(_0x393e22(0xed))/0x3+-parseInt(_0x393e22(0xf4))/0x4*(-parseInt(_0x393e22(0xef))/0x5)+-parseInt(_0x393e22(0xf5))/0x6*(parseInt(_0x393e22(0xf3))/0x7)+-parseInt(_0x393e22(0xea))/0x8*(parseInt(_0x393e22(0xec))/0x9)+parseInt(_0x393e22(0xeb))/0xa+-parseInt(_0x393e22(0xf2))/0xb;if(_0x4e94af===_0x46dc2c)break;else _0x2161f6['push'](_0x2161f6['shift']());}catch(_0xe0b5a0){_0x2161f6['push'](_0x2161f6['shift']());}}}(a52_0x3b53,0x6cf07));function a52_0x3b53(){var _0x3aaf63=['88472uOvDaV','3850880pJtHBT','153DdbxME','2015043UpLsTc','10jYXkgU','610NGqEYx','changeLanguage','79927kdPaSi','3251259NwrKpa','1865003isfcFE','8940uwurTH','18RCoPOX','language'];a52_0x3b53=function(){return _0x3aaf63;};return a52_0x3b53();}import{jsx as a52_0x455ba8}from'react/jsx-runtime';import{I18nextProvider}from'react-i18next';function a52_0x463c(_0x38579d,_0x313c29){_0x38579d=_0x38579d-0xe9;var _0x3b5363=a52_0x3b53();var _0x463ce9=_0x3b5363[_0x38579d];return _0x463ce9;}import a52_0x36347a from'./index.js';export function I18nProvider({children:_0x1ead20,language:_0x415edb}){var _0x4587de=a52_0x463c;return _0x415edb&&a52_0x36347a[_0x4587de(0xe9)]!==_0x415edb&&a52_0x36347a[_0x4587de(0xf0)](_0x415edb),a52_0x455ba8(I18nextProvider,{'i18n':a52_0x36347a,'children':_0x1ead20});}
|
package/lib/i18n/hooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a53_0x5d6c(_0x46ac0f,_0x8c041){_0x46ac0f=_0x46ac0f-0x19b;var _0x4004ba=a53_0x4004();var _0x5d6ccc=_0x4004ba[_0x46ac0f];return _0x5d6ccc;}function a53_0x4004(){var _0x482371=['1385466STmKbb','336872XfsJKg','752690rdVOdO','77361ORmRUH','513966moIcoo','2384123mbmfDB','20XPXSNk','10347000ohLCvO'];a53_0x4004=function(){return _0x482371;};return a53_0x4004();}(function(_0x5dc83f,_0x3906b7){var _0x1da4ef=a53_0x5d6c,_0x491d1c=_0x5dc83f();while(!![]){try{var _0x52ed45=parseInt(_0x1da4ef(0x19d))/0x1+-parseInt(_0x1da4ef(0x19f))/0x2*(-parseInt(_0x1da4ef(0x19c))/0x3)+parseInt(_0x1da4ef(0x1a2))/0x4+parseInt(_0x1da4ef(0x19b))/0x5+parseInt(_0x1da4ef(0x1a1))/0x6+parseInt(_0x1da4ef(0x19e))/0x7+-parseInt(_0x1da4ef(0x1a0))/0x8;if(_0x52ed45===_0x3906b7)break;else _0x491d1c['push'](_0x491d1c['shift']());}catch(_0x1573ff){_0x491d1c['push'](_0x491d1c['shift']());}}}(a53_0x4004,0x4582d));import{useTranslation}from'react-i18next';export function useI18n(){return useTranslation();}export function useI18nNs(_0x24959a){return useTranslation(_0x24959a);}
|
package/lib/i18n/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a54_0x2c01bd=a54_0x1560;(function(_0x59fe4f,_0x951636){const _0x597c7f=a54_0x1560,_0x1fe9bc=_0x59fe4f();while(!![]){try{const _0x3e7232=parseInt(_0x597c7f(0x141))/0x1*(parseInt(_0x597c7f(0x14d))/0x2)+-parseInt(_0x597c7f(0x13c))/0x3*(-parseInt(_0x597c7f(0x139))/0x4)+parseInt(_0x597c7f(0x154))/0x5*(parseInt(_0x597c7f(0x14c))/0x6)+parseInt(_0x597c7f(0x151))/0x7*(parseInt(_0x597c7f(0x13d))/0x8)+parseInt(_0x597c7f(0x156))/0x9+parseInt(_0x597c7f(0x142))/0xa*(-parseInt(_0x597c7f(0x14f))/0xb)+-parseInt(_0x597c7f(0x149))/0xc;if(_0x3e7232===_0x951636)break;else _0x1fe9bc['push'](_0x1fe9bc['shift']());}catch(_0x183f1a){_0x1fe9bc['push'](_0x1fe9bc['shift']());}}}(a54_0x5dee,0xceb41));import a54_0xb7f5ec from'i18next';import{initReactI18next}from'react-i18next';function a54_0x1560(_0x1dda67,_0x3af3f6){_0x1dda67=_0x1dda67-0x139;const _0x5deeda=a54_0x5dee();let _0x156039=_0x5deeda[_0x1dda67];return _0x156039;}import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';import a54_0x692e14 from'./locales/zh-CN.js';import a54_0x2c8b2a from'./locales/en-US.js';function a54_0x5dee(){const _0x1ff1aa=['zh-CN','15744456vdwFZd','resolvedOptions','cwd','6tHbNHN','7894jjFJBz','env','94127qwruVd','LOVRABET_LANG','14FhZlbl','string','toLowerCase','855295IkPDiy','en-US','3863466gyXYAk','replace','utf8','locale','179448iSUukb','language','lang','78jUgoUO','687936TTMlDE','use','.lovrabetrc','test','227JNIxeY','790fBNctr','zh_CN','init','DateTimeFormat','LC_ALL','en_US'];a54_0x5dee=function(){return _0x1ff1aa;};return a54_0x5dee();}export function isChineseLanguage(_0x40d642){const _0x3d9ba0=a54_0x1560;if(!_0x40d642)return![];const _0x88c801=_0x40d642[_0x3d9ba0(0x153)]()[_0x3d9ba0(0x157)]('_','-');return/^zh($|-)/[_0x3d9ba0(0x140)](_0x88c801);}const LOCALE_MAP={'zh':'zh-CN','zh-cn':a54_0x2c01bd(0x148),'zh_cn':a54_0x2c01bd(0x148),'en':a54_0x2c01bd(0x155),'en-us':a54_0x2c01bd(0x155),'en_us':a54_0x2c01bd(0x155)};export function normalizeLocale(_0x913ffd){const _0x1c584a=a54_0x2c01bd;if(!_0x913ffd)return null;return LOCALE_MAP[_0x913ffd[_0x1c584a(0x153)]()]??null;}function readLocaleFromConfig(){const _0x4802c8=a54_0x2c01bd;try{const _0x2c5860=resolve(process[_0x4802c8(0x14b)](),_0x4802c8(0x13f));if(existsSync(_0x2c5860)){const _0x3ff773=readFileSync(_0x2c5860,{'encoding':_0x4802c8(0x158)});if(_0x3ff773){const _0x3cc912=JSON['parse'](_0x3ff773);if(typeof _0x3cc912['locale']===_0x4802c8(0x152)){const _0x5bb4da=normalizeLocale(_0x3cc912[_0x4802c8(0x159)]);if(_0x5bb4da)return _0x5bb4da;}}}}catch{}try{const _0x2742a0=resolve(homedir(),_0x4802c8(0x13f));if(existsSync(_0x2742a0)){const _0x103887=readFileSync(_0x2742a0,{'encoding':'utf8'});if(_0x103887){const _0xde6c15=JSON['parse'](_0x103887);if(typeof _0xde6c15[_0x4802c8(0x159)]===_0x4802c8(0x152)){const _0x186bec=normalizeLocale(_0xde6c15['locale']);if(_0x186bec)return _0x186bec;}}}}catch{}return null;}export function detectSystemLanguage(){const _0x186974=a54_0x2c01bd,_0x53d83c=process[_0x186974(0x14e)][_0x186974(0x150)];if(_0x53d83c){const _0x53299b=normalizeLocale(_0x53d83c);if(_0x53299b)return _0x53299b;}const _0x5996e2=readLocaleFromConfig();if(_0x5996e2)return _0x5996e2;const _0x314182=process['env'][_0x186974(0x146)];if(_0x314182&&isChineseLanguage(_0x314182))return'zh-CN';const _0x15ca95=process['env']['LANG'];if(_0x15ca95&&isChineseLanguage(_0x15ca95))return'zh-CN';try{const _0x2e63f8=Intl[_0x186974(0x145)]()[_0x186974(0x14a)]()[_0x186974(0x159)];if(_0x2e63f8&&isChineseLanguage(_0x2e63f8))return'zh-CN';}catch{}return'en-US';}export function getLanguageFromFlags(_0x2aef7c){const _0x202f1d=a54_0x2c01bd,_0x12800a=_0x2aef7c[_0x202f1d(0x13b)];if(_0x12800a==='zh-CN'||_0x12800a==='zh'||_0x12800a===_0x202f1d(0x143))return'zh-CN';if(_0x12800a===_0x202f1d(0x155)||_0x12800a==='en'||_0x12800a===_0x202f1d(0x147))return _0x202f1d(0x155);return null;}a54_0xb7f5ec[a54_0x2c01bd(0x13e)](initReactI18next)[a54_0x2c01bd(0x144)]({'resources':{'zh-CN':{'translation':a54_0x692e14},'en-US':{'translation':a54_0x2c8b2a}},'lng':detectSystemLanguage(),'fallbackLng':a54_0x2c01bd(0x155),'interpolation':{'escapeValue':![]},'react':{'useSuspense':![]},'showSupportNotice':![]});export default a54_0xb7f5ec;export function changeLanguage(_0x58e9df){a54_0xb7f5ec['changeLanguage'](_0x58e9df);}export function getCurrentLanguage(){const _0x25dec3=a54_0x2c01bd;return a54_0xb7f5ec[_0x25dec3(0x13a)];}
|