@lovrabet/cli 1.2.1-beta.4 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -17
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +3 -3
- package/templates/projects/sub-app-react-demo/package.json +2 -2
- package/templates/projects/sub-app-react-demo/src/api/api.ts +42 -25
- package/templates/projects/sub-app-react-demo/src/api/client.ts +11 -10
- package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +72 -19
- package/templates/projects/sub-app-react-demo/package-lock.json +0 -4062
package/lib/cli.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
function a29_0x1f82(){const _0xd9f2c0=['logout','boolean','1004904CMPNSE','cwd','334534bXYMWq','start','flags','string','setLogPath','logs','10304KMlzOm','create','73122oHlGtS','env','执行初始化配置命令','build','api','config','all','执行更新菜单\x20CDN\x20资源命令','1197927GdQibM','info','1392qvOJOZ','lovrabet\x20','mcp','执行预览命令','update','\x0a\x09Usage\x0a\x09\x20\x20$\x20lovrabet\x0a\x0a\x09Examples\x0a\x09\x20\x20$\x20lovrabet\x20auth\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20登录认证\x0a\x09\x20\x20$\x20lovrabet\x20logout\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20退出登录\x0a\x09\x20\x20$\x20lovrabet\x20init\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20在现有项目中初始化\x20.lovrabetrc\x20配置文件\x0a\x09\x20\x20$\x20lovrabet\x20init\x20--appcode\x20<code>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20使用指定的\x20appcode\x20初始化配置文件\x0a\x09\x20\x20$\x20lovrabet\x20create\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建一个项目\x0a\x09\x20\x20$\x20lovrabet\x20create\x20--env\x20daily\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20创建项目并指定环境\x0a\x09\x20\x20$\x20lovrabet\x20add\x20page\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20添加一个页面\x0a\x09\x20\x20$\x20lovrabet\x20start\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20启动项目\x0a\x09\x20\x20$\x20lovrabet\x20build\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20构建项目\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20sync\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20同步菜单\x0a\x09\x20\x20$\x20lovrabet\x20menu\x20update\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20更新菜单\x20CDN\x20资源\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20预览项目\x0a\x09\x20\x20$\x20lovrabet\x20preview\x20--watch\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20监听文件变化并自动构建预览\x0a\x09\x20\x20$\x20lovrabet\x20config\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20项目配置\x0a\x09\x20\x20$\x20lovrabet\x20api\x20pull\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20拉取并生成\x20API\x20配置文件(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20api\x20doc\x20--[options]\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20生成\x20API\x20文档(详见\x20lovrabet\x20api\x20--help)\x0a\x09\x20\x20$\x20lovrabet\x20mcp\x20cursor\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20配置\x20Cursor\x20的\x20MCP\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20查看日志\x0a\x09\x20\x20$\x20lovrabet\x20logs\x20--clear\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20清空日志\x0a','setRawCommand','auth','appcode','4996640jAmyLL','add','preview','739340AVLrjt','\x20(监听模式)','argv','trim','exit','slice','page','error','input','init'];a29_0x1f82=function(){return _0xd9f2c0;};return a29_0x1f82();}const a29_0x369ace=a29_0x5328;(function(_0x422191,_0x1c42c5){const _0x1acd9b=a29_0x5328,_0x388b2d=_0x422191();while(!![]){try{const _0x40c472=-parseInt(_0x1acd9b(0x1bb))/0x1+-parseInt(_0x1acd9b(0x197))/0x2+parseInt(_0x1acd9b(0x19f))/0x3+-parseInt(_0x1acd9b(0x1b9))/0x4+parseInt(_0x1acd9b(0x1ad))/0x5+parseInt(_0x1acd9b(0x1a1))/0x6*(-parseInt(_0x1acd9b(0x195))/0x7)+parseInt(_0x1acd9b(0x1aa))/0x8;if(_0x40c472===_0x1c42c5)break;else _0x388b2d['push'](_0x388b2d['shift']());}catch(_0x1efa97){_0x388b2d['push'](_0x388b2d['shift']());}}}(a29_0x1f82,0x32c3c));import{jsx as a29_0x537b49}from'react/jsx-runtime';import a29_0x7dee17 from'meow';function a29_0x5328(_0x4cc63e,_0x50a86d){_0x4cc63e=_0x4cc63e-0x191;const _0x1f8241=a29_0x1f82();let _0x53286d=_0x1f8241[_0x4cc63e];return _0x53286d;}import{render}from'ink';import{CreateApp}from'./create-app/main.js';import{AddPage}from'./add-page/main.js';import{Init}from'./init/main.js';import{runStart}from'./cmd/start.js';import{runBuild}from'./cmd/build.js';import{runPreview}from'./cmd/preview.js';import{runBuildWatch}from'./cmd/build-watch.js';import{Config}from'./config/main.js';import{apiCli}from'./api/main.js';import{AuthServer}from'./auth/auth-server-ui.js';import{logout}from'./auth/logout.js';import{Help}from'./help.js';import{logger}from'./utils/logger.js';import{showLogs,clearLogs}from'./cmd/logs.js';import{AppMenuSyncUI}from'./app-menu/app-menu-sync-ui.js';import{mcpCommand}from'./mcp/main.js';import{AppMenuUpdateCdn}from'./app-menu-update-cdn/main.js';const cli=a29_0x7dee17(a29_0x369ace(0x1a6),{'importMeta':import.meta,'flags':{'name':{'type':'string'},'clear':{'type':a29_0x369ace(0x1b8)},'env':{'type':a29_0x369ace(0x192)},'watch':{'type':'boolean'},'help':{'type':a29_0x369ace(0x1b8)},'appcode':{'type':a29_0x369ace(0x192)},'output':{'type':'string'},'params':{'type':a29_0x369ace(0x192)},'datasetcode':{'type':a29_0x369ace(0x192)}},'autoVersion':!![]});await run();async function run(){const _0x59eb5a=a29_0x369ace,_0x1f7297=cli['input'][0x0],_0x15e74d=cli[_0x59eb5a(0x1b5)][0x1],_0x4f5d33=cli[_0x59eb5a(0x1b5)][0x2],_0x2ab877=(_0x59eb5a(0x1a2)+process[_0x59eb5a(0x1af)][_0x59eb5a(0x1b2)](0x2)['join']('\x20'))[_0x59eb5a(0x1b0)]();logger[_0x59eb5a(0x1a7)](_0x2ab877);switch(_0x1f7297){case _0x59eb5a(0x1b6):{const _0xf593bc=cli['flags'][_0x59eb5a(0x1a9)],_0x5cccc5=cli[_0x59eb5a(0x191)][_0x59eb5a(0x198)];logger[_0x59eb5a(0x193)](process[_0x59eb5a(0x1ba)]()),logger['info'](_0x59eb5a(0x1b6),_0x59eb5a(0x199)),render(a29_0x537b49(Init,{'appcode':_0xf593bc,'env':_0x5cccc5}));break;}case _0x59eb5a(0x196):{const _0x518e65=cli[_0x59eb5a(0x1b5)][0x1]?.['trim'](),_0x4c93cf=cli['flags'][_0x59eb5a(0x198)];render(a29_0x537b49(CreateApp,{'projectCode':_0x518e65,'env':_0x4c93cf}));break;}case _0x59eb5a(0x1ab):{cli[_0x59eb5a(0x1b5)][0x1]===_0x59eb5a(0x1b3)&&(logger[_0x59eb5a(0x193)](process[_0x59eb5a(0x1ba)]()),logger[_0x59eb5a(0x1a0)]('add-page','执行添加页面命令'),render(a29_0x537b49(AddPage,{})));break;}case _0x59eb5a(0x1bc):{try{logger['setLogPath'](process[_0x59eb5a(0x1ba)]()),logger[_0x59eb5a(0x1a0)](_0x59eb5a(0x1bc),'执行启动命令'),await runStart();}catch(_0xbca29e){console['error'](_0xbca29e),process['exit'](0x1);}break;}case _0x59eb5a(0x19a):{try{logger[_0x59eb5a(0x193)](process['cwd']()),logger[_0x59eb5a(0x1a0)]('build','执行构建命令'),await runBuild();}catch(_0x33dd39){console[_0x59eb5a(0x1b4)](_0x33dd39),process[_0x59eb5a(0x1b1)](0x1);}break;}case _0x59eb5a(0x1ac):{const _0x2f5f54=cli[_0x59eb5a(0x191)]['watch'];logger['setLogPath'](process[_0x59eb5a(0x1ba)]()),logger[_0x59eb5a(0x1a0)](_0x59eb5a(0x1ac),_0x59eb5a(0x1a4)+(_0x2f5f54?_0x59eb5a(0x1ae):''));if(_0x2f5f54)try{await Promise[_0x59eb5a(0x19d)]([runBuildWatch(),runPreview()]);}catch(_0x1cb2e0){console['error'](_0x1cb2e0),process['exit'](0x1);}else try{await runPreview();}catch(_0x14c8e6){console[_0x59eb5a(0x1b4)](_0x14c8e6),process[_0x59eb5a(0x1b1)](0x1);}break;}case _0x59eb5a(0x19c):{render(a29_0x537b49(Config,{'cli':cli}));break;}case _0x59eb5a(0x19b):{await apiCli(cli);break;}case _0x59eb5a(0x1a8):{render(a29_0x537b49(AuthServer,{}));break;}case'menu':{if(_0x15e74d===_0x59eb5a(0x1a5)){logger[_0x59eb5a(0x193)](process[_0x59eb5a(0x1ba)]()),logger[_0x59eb5a(0x1a0)]('menu-update-cdn',_0x59eb5a(0x19e)),render(a29_0x537b49(AppMenuUpdateCdn,{}));break;}else render(a29_0x537b49(AppMenuSyncUI,{}));break;}case _0x59eb5a(0x1b7):{logout();break;}case _0x59eb5a(0x1a3):{const _0x3cd24c=cli['input'][0x1];await mcpCommand(_0x3cd24c);break;}case _0x59eb5a(0x194):{cli[_0x59eb5a(0x191)]['clear']?clearLogs():showLogs();break;}default:render(a29_0x537b49(Help,{}));break;}}
|
package/lib/cmd/build-watch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xa47d15,_0x533341){const _0x37eb74=a30_0x3fb2,_0x1818d9=_0xa47d15();while(!![]){try{const _0x5870da=-parseInt(_0x37eb74(0x1be))/0x1*(-parseInt(_0x37eb74(0x1c0))/0x2)+-parseInt(_0x37eb74(0x1af))/0x3*(parseInt(_0x37eb74(0x1b1))/0x4)+parseInt(_0x37eb74(0x1bd))/0x5*(parseInt(_0x37eb74(0x1b2))/0x6)+-parseInt(_0x37eb74(0x1c2))/0x7+parseInt(_0x37eb74(0x1b8))/0x8+-parseInt(_0x37eb74(0x1c1))/0x9*(parseInt(_0x37eb74(0x1bb))/0xa)+parseInt(_0x37eb74(0x1b7))/0xb;if(_0x5870da===_0x533341)break;else _0x1818d9['push'](_0x1818d9['shift']());}catch(_0x1ee31a){_0x1818d9['push'](_0x1818d9['shift']());}}}(a30_0x1e72,0x87cf2));import{spawn}from'node:child_process';import{delimiter,join}from'node:path';function a30_0x1e72(){const _0xd26f08=['260MymiSd','vite','44615qzRvQq','89tuOUQV','npm\x20run\x20build\x20exited\x20with\x20code\x20','23858HxPRtM','115344XvLNel','2435377lrSnyk','870LHlOKK','node_modules','14152sZUsHp','90ZLCCif','env','PATH','cwd','error','6018958HZcEGm','4165736wflCLF','close','.bin'];a30_0x1e72=function(){return _0xd26f08;};return a30_0x1e72();}function a30_0x3fb2(_0x1eec03,_0x273a49){_0x1eec03=_0x1eec03-0x1af;const _0x1e7254=a30_0x1e72();let _0x3fb21a=_0x1e7254[_0x1eec03];return _0x3fb21a;}export function runBuildWatch(){return new Promise((_0x855810,_0x2ba4a5)=>{const _0x3beb54=a30_0x3fb2,_0x15081d=spawn(_0x3beb54(0x1bc),['build','--watch'],{'stdio':'inherit','shell':!![],'env':{...process[_0x3beb54(0x1b3)],'PATH':''+join(process[_0x3beb54(0x1b5)](),_0x3beb54(0x1b0),_0x3beb54(0x1ba))+delimiter+process['env'][_0x3beb54(0x1b4)]}});_0x15081d['on'](_0x3beb54(0x1b9),_0x333952=>{const _0x4427a5=_0x3beb54;if(_0x333952===0x0||_0x333952===null)_0x855810();else _0x2ba4a5(new Error(_0x4427a5(0x1bf)+_0x333952));}),_0x15081d['on'](_0x3beb54(0x1b6),_0x2ba4a5);});}
|
package/lib/cmd/build.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5f2dcd,_0x5a3bc4){const _0x5a4731=a31_0x2a6f,_0x4c0f57=_0x5f2dcd();while(!![]){try{const _0x2db443=parseInt(_0x5a4731(0xb1))/0x1+parseInt(_0x5a4731(0xae))/0x2+parseInt(_0x5a4731(0x96))/0x3*(-parseInt(_0x5a4731(0x98))/0x4)+-parseInt(_0x5a4731(0xb2))/0x5*(parseInt(_0x5a4731(0xa7))/0x6)+-parseInt(_0x5a4731(0x95))/0x7*(parseInt(_0x5a4731(0x93))/0x8)+-parseInt(_0x5a4731(0x97))/0x9*(-parseInt(_0x5a4731(0x9b))/0xa)+-parseInt(_0x5a4731(0x9c))/0xb;if(_0x2db443===_0x5a3bc4)break;else _0x4c0f57['push'](_0x4c0f57['shift']());}catch(_0x3dde76){_0x4c0f57['push'](_0x4c0f57['shift']());}}}(a31_0x1495,0xc5a85));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function a31_0x1495(){const _0xd47cdc=['1458666kCdcak','995ysifxe','toString','env','125144wcPsJZ','now','7dDVIgc','2699847OYjSXK','5399289SgHDWQ','4kmbhrm','stderr','项目构建出错','20TZcvIs','12206150BmKwmP','success','npm','close','cwd','run','build','info','项目构建成功','.bin','error','28818DNrDol','npm\x20run\x20build','trim','pipe','inherit','PATH','node_modules','2264272MfvQkK','data','npm\x20run\x20build\x20exited\x20with\x20code\x20'];a31_0x1495=function(){return _0xd47cdc;};return a31_0x1495();}function a31_0x2a6f(_0x397c7b,_0x13bee9){_0x397c7b=_0x397c7b-0x92;const _0x1495bb=a31_0x1495();let _0x2a6f27=_0x1495bb[_0x397c7b];return _0x2a6f27;}import{logger}from'../utils/logger.js';export function runBuild(){return new Promise((_0x3a8c9f,_0x3b575b)=>{const _0x545e24=a31_0x2a6f,_0x20edc2=Date[_0x545e24(0x94)]();logger[_0x545e24(0xa3)](_0x545e24(0xa2),'开始构建项目',{'command':_0x545e24(0xa8)});let _0x59dad0='';const _0xc59baf=spawn(_0x545e24(0x9e),[_0x545e24(0xa1),_0x545e24(0xa2)],{'stdio':[_0x545e24(0xab),_0x545e24(0xab),_0x545e24(0xaa)],'shell':!![],'env':{...process[_0x545e24(0x92)],'PATH':''+join(process['cwd'](),_0x545e24(0xad),_0x545e24(0xa5))+delimiter+process[_0x545e24(0x92)][_0x545e24(0xac)]}});_0xc59baf[_0x545e24(0x99)]?.['on'](_0x545e24(0xaf),_0x54f353=>{const _0x3ee2ff=_0x545e24;_0x59dad0+=_0x54f353[_0x3ee2ff(0xb3)]();}),_0xc59baf['on'](_0x545e24(0x9f),_0x2b6910=>{const _0x236163=_0x545e24,_0x1e19b6=Date[_0x236163(0x94)]()-_0x20edc2;if(_0x2b6910===0x0||_0x2b6910===null)logger[_0x236163(0x9d)](_0x236163(0xa2),_0x236163(0xa4),_0x1e19b6),_0x3a8c9f();else{const _0x2845c5={'exitCode':_0x2b6910,'duration':_0x1e19b6,'command':_0x236163(0xa8),'cwd':process[_0x236163(0xa0)]()};_0x59dad0['trim']()&&(_0x2845c5[_0x236163(0x99)]=_0x59dad0['trim']()),logger[_0x236163(0xa6)](_0x236163(0xa2),'项目构建失败',_0x2845c5),_0x3b575b(new Error(_0x236163(0xb0)+_0x2b6910));}}),_0xc59baf['on'](_0x545e24(0xa6),_0x3777c0=>{const _0x2c3810=_0x545e24,_0x9798a8=Date['now']()-_0x20edc2;logger[_0x2c3810(0xa6)](_0x2c3810(0xa2),_0x2c3810(0x9a),{'error':_0x3777c0['message'],'duration':_0x9798a8,'stderr':_0x59dad0[_0x2c3810(0xa9)]()||undefined}),_0x3b575b(_0x3777c0);});});}
|
package/lib/cmd/logs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a32_0x5315(_0x1de5f2,_0x42cd4d){_0x1de5f2=_0x1de5f2-0x176;const _0x413fae=a32_0x413f();let _0x531569=_0x413fae[_0x1de5f2];return _0x531569;}(function(_0x1be00a,_0x3006da){const _0x5c16ee=a32_0x5315,_0x1b70e9=_0x1be00a();while(!![]){try{const _0x205f5b=-parseInt(_0x5c16ee(0x180))/0x1+-parseInt(_0x5c16ee(0x176))/0x2+parseInt(_0x5c16ee(0x182))/0x3*(parseInt(_0x5c16ee(0x188))/0x4)+-parseInt(_0x5c16ee(0x194))/0x5*(parseInt(_0x5c16ee(0x190))/0x6)+parseInt(_0x5c16ee(0x17d))/0x7*(parseInt(_0x5c16ee(0x185))/0x8)+parseInt(_0x5c16ee(0x192))/0x9*(-parseInt(_0x5c16ee(0x191))/0xa)+parseInt(_0x5c16ee(0x178))/0xb;if(_0x205f5b===_0x3006da)break;else _0x1b70e9['push'](_0x1b70e9['shift']());}catch(_0x5d3fdb){_0x1b70e9['push'](_0x1b70e9['shift']());}}}(a32_0x413f,0xbce50));import{logger}from'../utils/logger.js';function a32_0x413f(){const _0x2c6f4a=['*\x20暂无日志记录','duration','7oaYeTp','setLogPath','keys','189320YQlNuE','readLogs','15ZoRdNb','warn','toLocaleString','3265960DoIwed','\x20\x20\x20耗时:\x20','timestamp','199812XVgiGx','*\x20日志已清空','success','error','clearLogs','log','\x20\x20\x20详情:\x20','forEach','3546AaQDlc','101930heLLdb','9SBKrUv','details','1915IqnmCl','message','1764238NWnorQ','cwd','15660557zupsZb','level','command'];a32_0x413f=function(){return _0x2c6f4a;};return a32_0x413f();}export function showLogs(){const _0xbf9d1e=a32_0x5315;logger[_0xbf9d1e(0x17e)](process[_0xbf9d1e(0x177)]());const _0x59f9ba=logger[_0xbf9d1e(0x181)]();if(_0x59f9ba['length']===0x0){console[_0xbf9d1e(0x18d)](_0xbf9d1e(0x17b));return;}console[_0xbf9d1e(0x18d)]('*\x20Lovrabet\x20CLI\x20日志记录:\x0a'),_0x59f9ba[_0xbf9d1e(0x18f)]((_0x4e85be,_0x3c2a48)=>{const _0x4c07b4=_0xbf9d1e,_0x386225=new Date(_0x4e85be[_0x4c07b4(0x187)])[_0x4c07b4(0x184)]('zh-CN'),_0x24c03a=_0x4e85be[_0x4c07b4(0x179)]===_0x4c07b4(0x18a)?'√':_0x4e85be[_0x4c07b4(0x179)]===_0x4c07b4(0x18b)?'×':_0x4e85be[_0x4c07b4(0x179)]===_0x4c07b4(0x183)?'!':'i';console[_0x4c07b4(0x18d)](_0x3c2a48+0x1+'.\x20'+_0x24c03a+'\x20['+_0x4e85be[_0x4c07b4(0x17a)]+']\x20'+_0x4e85be[_0x4c07b4(0x195)]),console[_0x4c07b4(0x18d)]('\x20\x20\x20时间:\x20'+_0x386225),_0x4e85be[_0x4c07b4(0x17c)]&&console['log'](_0x4c07b4(0x186)+_0x4e85be[_0x4c07b4(0x17c)]+'ms'),_0x4e85be[_0x4c07b4(0x193)]&&Object[_0x4c07b4(0x17f)](_0x4e85be[_0x4c07b4(0x193)])['length']>0x0&&console[_0x4c07b4(0x18d)](_0x4c07b4(0x18e)+JSON['stringify'](_0x4e85be['details'],null,0x2)),console[_0x4c07b4(0x18d)]('');});}export function clearLogs(){const _0x8de30b=a32_0x5315;logger['setLogPath'](process[_0x8de30b(0x177)]()),logger[_0x8de30b(0x18c)](),console[_0x8de30b(0x18d)](_0x8de30b(0x189));}
|
package/lib/cmd/preview.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5d23b5,_0x4f391b){const _0x1fc115=a33_0x2043,_0x4648b2=_0x5d23b5();while(!![]){try{const _0xeb3819=parseInt(_0x1fc115(0x1ce))/0x1*(-parseInt(_0x1fc115(0x1dc))/0x2)+parseInt(_0x1fc115(0x1db))/0x3+parseInt(_0x1fc115(0x1e4))/0x4*(parseInt(_0x1fc115(0x1cf))/0x5)+parseInt(_0x1fc115(0x1d6))/0x6+-parseInt(_0x1fc115(0x1eb))/0x7*(-parseInt(_0x1fc115(0x1e7))/0x8)+parseInt(_0x1fc115(0x1e6))/0x9*(-parseInt(_0x1fc115(0x1da))/0xa)+-parseInt(_0x1fc115(0x1e1))/0xb;if(_0xeb3819===_0x4f391b)break;else _0x4648b2['push'](_0x4648b2['shift']());}catch(_0x476ee5){_0x4648b2['push'](_0x4648b2['shift']());}}}(a33_0x5e1f,0x755f4));function a33_0x5e1f(){const _0x464f3c=['1595847ssyJeH','trim','PATH','214048lsSOWE','message','132921FgCfix','22128xtZavJ','预览服务器启动出错','info','success','651hPTzKG','toString','pipe','1SulDVX','70CSGSlI','.bin','预览服务器启动成功','node_modules','preview','stderr','error','5175282JlKfUl','预览服务器启动失败','启动预览服务器','env','590NMNMlH','387594WJpOGJ','1001894XVwbgg','vite\x20preview','inherit','cwd','now'];a33_0x5e1f=function(){return _0x464f3c;};return a33_0x5e1f();}function a33_0x2043(_0x5db96b,_0x104bd6){_0x5db96b=_0x5db96b-0x1ce;const _0x5e1f45=a33_0x5e1f();let _0x204348=_0x5e1f45[_0x5db96b];return _0x204348;}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';export function runPreview(){return new Promise((_0x32b89b,_0x2d6bbf)=>{const _0x197e1b=a33_0x2043,_0x59b791=Date['now']();logger[_0x197e1b(0x1e9)](_0x197e1b(0x1d3),_0x197e1b(0x1d8),{'command':_0x197e1b(0x1dd)});let _0x27dff2='';const _0x3a049f=spawn('vite',[_0x197e1b(0x1d3)],{'stdio':[_0x197e1b(0x1de),'inherit',_0x197e1b(0x1ed)],'shell':!![],'env':{...process[_0x197e1b(0x1d9)],'PATH':''+join(process[_0x197e1b(0x1df)](),_0x197e1b(0x1d2),_0x197e1b(0x1d0))+delimiter+process[_0x197e1b(0x1d9)][_0x197e1b(0x1e3)]}});_0x3a049f[_0x197e1b(0x1d4)]?.['on']('data',_0x465817=>{const _0x37697f=_0x197e1b;_0x27dff2+=_0x465817[_0x37697f(0x1ec)]();}),_0x3a049f['on']('close',_0x20fa01=>{const _0x1db09b=_0x197e1b,_0x1f3236=Date['now']()-_0x59b791;if(_0x20fa01===0x0||_0x20fa01===null)logger[_0x1db09b(0x1ea)]('preview',_0x1db09b(0x1d1),_0x1f3236),_0x32b89b();else{const _0x39b65c={'exitCode':_0x20fa01,'duration':_0x1f3236,'command':_0x1db09b(0x1dd),'cwd':process[_0x1db09b(0x1df)]()};_0x27dff2['trim']()&&(_0x39b65c[_0x1db09b(0x1d4)]=_0x27dff2[_0x1db09b(0x1e2)]()),logger[_0x1db09b(0x1d5)](_0x1db09b(0x1d3),_0x1db09b(0x1d7),_0x39b65c),_0x2d6bbf(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x20fa01));}}),_0x3a049f['on']('error',_0x3d2972=>{const _0x4ca3b9=_0x197e1b,_0x4d637a=Date[_0x4ca3b9(0x1e0)]()-_0x59b791;logger['error'](_0x4ca3b9(0x1d3),_0x4ca3b9(0x1e8),{'error':_0x3d2972[_0x4ca3b9(0x1e5)],'duration':_0x4d637a,'stderr':_0x27dff2['trim']()||undefined}),_0x2d6bbf(_0x3d2972);});});}
|
package/lib/cmd/start.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x15117e,_0x5e4315){const _0x8ee3b8=a34_0x2ec1,_0x2f0e40=_0x15117e();while(!![]){try{const _0x28b6af=parseInt(_0x8ee3b8(0xaf))/0x1*(-parseInt(_0x8ee3b8(0x97))/0x2)+parseInt(_0x8ee3b8(0x99))/0x3*(parseInt(_0x8ee3b8(0xab))/0x4)+parseInt(_0x8ee3b8(0xae))/0x5*(-parseInt(_0x8ee3b8(0xaa))/0x6)+-parseInt(_0x8ee3b8(0x9d))/0x7+-parseInt(_0x8ee3b8(0xad))/0x8*(parseInt(_0x8ee3b8(0x94))/0x9)+-parseInt(_0x8ee3b8(0xa9))/0xa+parseInt(_0x8ee3b8(0xa1))/0xb*(parseInt(_0x8ee3b8(0xac))/0xc);if(_0x28b6af===_0x5e4315)break;else _0x2f0e40['push'](_0x2f0e40['shift']());}catch(_0x8afa9e){_0x2f0e40['push'](_0x2f0e40['shift']());}}}(a34_0xdd19,0x3fd54));import{delimiter,join}from'node:path';import{spawn}from'node:child_process';import{logger}from'../utils/logger.js';function a34_0x2ec1(_0x59e488,_0x59498a){_0x59e488=_0x59e488-0x90;const _0xdd195b=a34_0xdd19();let _0x2ec13b=_0xdd195b[_0x59e488];return _0x2ec13b;}import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';function a34_0xdd19(){const _0x18340c=['error','开发服务器启动失败','1356201dejBqk','start','minVersion','now','51568FHwCLo','vite\x20exited\x20with\x20code\x20','PATH','inherit','env','stderr','vite','启动开发服务器','273100cBixlt','144iKubpF','257008AxoMBQ','2004wiEbMq','3632KHbyYL','51195zLgHeQ','1mkubNF','warn','SDK\x20版本低于推荐版本','info','node_modules','write','cwd','1971VRTNzh','trim','success','167450rCILZN','data','6TTECts','close'];a34_0xdd19=function(){return _0x18340c;};return a34_0xdd19();}export function runStart(_0x75f112){return new Promise((_0x274b12,_0x4d5438)=>{const _0x2de47c=a34_0x2ec1,_0x5f8a84=Date[_0x2de47c(0xa0)](),_0x5b26be=_0x75f112||process[_0x2de47c(0x93)](),_0x44bdb3=checkSdkVersion(_0x5b26be);_0x44bdb3['needsUpgrade']&&(printSdkUpgradeWarning(_0x44bdb3),logger[_0x2de47c(0xb0)]('start',_0x2de47c(0xb1),{'currentVersion':_0x44bdb3['version'],'minVersion':_0x44bdb3[_0x2de47c(0x9f)]}));logger[_0x2de47c(0x90)](_0x2de47c(0x9e),_0x2de47c(0xa8),{'command':_0x2de47c(0xa7),'cwd':_0x5b26be});let _0x255dbf='';const _0x32b6e7=spawn('vite',{'stdio':[_0x2de47c(0xa4),'inherit','pipe'],'shell':!![],'cwd':_0x5b26be,'env':{...process['env'],'PATH':''+join(_0x5b26be,_0x2de47c(0x91),'.bin')+delimiter+process[_0x2de47c(0xa5)][_0x2de47c(0xa3)]}});_0x32b6e7[_0x2de47c(0xa6)]?.['on'](_0x2de47c(0x98),_0x309f13=>{const _0x464e61=_0x2de47c,_0x214b2c=_0x309f13['toString']();_0x255dbf+=_0x214b2c,process[_0x464e61(0xa6)][_0x464e61(0x92)](_0x214b2c);}),_0x32b6e7['on'](_0x2de47c(0x9a),_0x552cf3=>{const _0x27e2d6=_0x2de47c,_0x443b5c=Date[_0x27e2d6(0xa0)]()-_0x5f8a84;if(_0x552cf3===0x0||_0x552cf3===null)logger[_0x27e2d6(0x96)]('start','开发服务器启动成功',_0x443b5c),_0x274b12();else{const _0x336c0c={'exitCode':_0x552cf3,'duration':_0x443b5c,'command':'vite','cwd':_0x5b26be};_0x255dbf[_0x27e2d6(0x95)]()&&(_0x336c0c[_0x27e2d6(0xa6)]=_0x255dbf[_0x27e2d6(0x95)]()),logger['error'](_0x27e2d6(0x9e),_0x27e2d6(0x9c),_0x336c0c),_0x4d5438(new Error(_0x27e2d6(0xa2)+_0x552cf3));}}),_0x32b6e7['on'](_0x2de47c(0x9b),_0x4da6d0=>{const _0x5b220d=_0x2de47c,_0xc47fa6=Date[_0x5b220d(0xa0)]()-_0x5f8a84,_0x34184f={'error':_0x4da6d0['message'],'duration':_0xc47fa6,'command':_0x5b220d(0xa7),'cwd':_0x5b26be};_0x255dbf[_0x5b220d(0x95)]()&&(_0x34184f[_0x5b220d(0xa6)]=_0x255dbf[_0x5b220d(0x95)]()),logger[_0x5b220d(0x9b)](_0x5b220d(0x9e),'开发服务器启动出错',_0x34184f),_0x4d5438(_0x4da6d0);});});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a35_0x46b0(){const _0x3edbb3=['列出所有配置项','gray','command','88913ccwFqw','1062FEaYBI','834790SdNiLG','9342180GNkWFi','lovrabet\x20config\x20set\x20<key>\x20<value>\x20\x20\x20','map','配置当前项目的\x20App\x20Code','设置环境\x20(online/daily)','lovrabet\x20config\x20get\x20<key>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','7992UdUCtC','2648548PcHaCB','669yeurgc','685964OYHWzy','lovrabet\x20config\x20set\x20app\x20app-xxxxx\x20\x20\x20','6003NXneTt','description','24vKnIPL'];a35_0x46b0=function(){return _0x3edbb3;};return a35_0x46b0();}(function(_0x3f60eb,_0x423ab9){const _0x14b6c7=a35_0x1e17,_0x4459c9=_0x3f60eb();while(!![]){try{const _0x18701a=parseInt(_0x14b6c7(0x1f6))/0x1+-parseInt(_0x14b6c7(0x1f7))/0x2*(-parseInt(_0x14b6c7(0x1ed))/0x3)+parseInt(_0x14b6c7(0x1ee))/0x4+-parseInt(_0x14b6c7(0x1f8))/0x5*(-parseInt(_0x14b6c7(0x1f2))/0x6)+-parseInt(_0x14b6c7(0x1ec))/0x7+-parseInt(_0x14b6c7(0x1eb))/0x8*(-parseInt(_0x14b6c7(0x1f0))/0x9)+-parseInt(_0x14b6c7(0x1f9))/0xa;if(_0x18701a===_0x423ab9)break;else _0x4459c9['push'](_0x4459c9['shift']());}catch(_0x29aef1){_0x4459c9['push'](_0x4459c9['shift']());}}}(a35_0x46b0,0x61c10));function a35_0x1e17(_0x2a10ce,_0x37e192){_0x2a10ce=_0x2a10ce-0x1e8;const _0x46b013=a35_0x46b0();let _0x1e1762=_0x46b013[_0x2a10ce];return _0x1e1762;}import{jsxs as a35_0x142c6c,jsx as a35_0x101ae4}from'react/jsx-runtime';import{Box,Text}from'ink';export function ConfigHelp(){const _0x236806=a35_0x1e17,_0x28a2c5=[{'command':_0x236806(0x1fa),'description':'设置配置项'},{'command':_0x236806(0x1ea),'description':'获取配置项'},{'command':'lovrabet\x20config\x20list\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','description':_0x236806(0x1f3)}],_0x257f15=[{'command':_0x236806(0x1ef),'description':_0x236806(0x1e8)},{'command':'lovrabet\x20config\x20set\x20env\x20daily\x20\x20\x20\x20\x20\x20\x20','description':_0x236806(0x1e9)}];return a35_0x142c6c(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a35_0x101ae4(Box,{'marginBottom':0x1,'children':a35_0x142c6c(Text,{'color':'gray','children':['\x20!','\x20\x20','无效的命令,可用命令如下:']})}),_0x28a2c5[_0x236806(0x1fb)](_0x3a8282=>a35_0x142c6c(Box,{'children':[a35_0x142c6c(Text,{'children':['\x20\x20\x20\x20',_0x3a8282['command']]}),a35_0x101ae4(Text,{'color':'gray','children':_0x3a8282[_0x236806(0x1f1)]})]},_0x3a8282[_0x236806(0x1f5)])),a35_0x101ae4(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a35_0x101ae4(Text,{'color':_0x236806(0x1f4),'children':'\x20*\x20配置示例:'})}),_0x257f15[_0x236806(0x1fb)](_0x2fc073=>a35_0x142c6c(Box,{'children':[a35_0x142c6c(Text,{'children':['\x20\x20\x20\x20',_0x2fc073['command']]}),a35_0x101ae4(Text,{'color':_0x236806(0x1f4),'children':_0x2fc073[_0x236806(0x1f1)]})]},_0x2fc073[_0x236806(0x1f5)]))]});}
|
package/lib/config/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a36_0x2da4(){const _0x58c182=['flags','1148072zCTUMJ','环境配置已设置为:\x20','168644ujMcek','renameSync','未提供配置值','config','includes','dirname','配置值无效或过长','input','get','1HtpuKw','786561wxDwfJ','parse','mkdirSync','stringify','env','保存配置失败','1220344CCHTMB','.tmp','log','11kjBADK','message','set','2973831oKGTkq','--help','319530AmSNjC','help','length','app','18WABezD','utf8','35sKgnNP','保存配置失败:\x20','red','string','error','10649480NEqAHo','环境配置值只能是\x20\x22online\x22\x20或\x20\x22daily\x22','undefined','appcode'];a36_0x2da4=function(){return _0x58c182;};return a36_0x2da4();}(function(_0x2b0130,_0x4ac25f){const _0x5e367e=a36_0x2bbc,_0x230b26=_0x2b0130();while(!![]){try{const _0x2fb2a3=parseInt(_0x5e367e(0x19b))/0x1*(parseInt(_0x5e367e(0x1bc))/0x2)+-parseInt(_0x5e367e(0x19c))/0x3+-parseInt(_0x5e367e(0x1a2))/0x4+parseInt(_0x5e367e(0x1b0))/0x5*(parseInt(_0x5e367e(0x1aa))/0x6)+-parseInt(_0x5e367e(0x1a8))/0x7+-parseInt(_0x5e367e(0x1ba))/0x8*(parseInt(_0x5e367e(0x1ae))/0x9)+-parseInt(_0x5e367e(0x1b5))/0xa*(-parseInt(_0x5e367e(0x1a5))/0xb);if(_0x2fb2a3===_0x4ac25f)break;else _0x230b26['push'](_0x230b26['shift']());}catch(_0x22341a){_0x230b26['push'](_0x230b26['shift']());}}}(a36_0x2da4,0x3b4f3));import{jsx as a36_0x316f65,jsxs as a36_0x2db172}from'react/jsx-runtime';import{existsSync,readFileSync,writeFileSync}from'node:fs';import a36_0x5e5b12 from'node:fs';function a36_0x2bbc(_0x5e3a83,_0x2a989c){_0x5e3a83=_0x5e3a83-0x198;const _0x2da41e=a36_0x2da4();let _0x2bbc8d=_0x2da41e[_0x5e3a83];return _0x2bbc8d;}import a36_0x2ae3cc from'node:path';import{ConfigHelp}from'./config-help.js';import{Box,Text}from'ink';import{readConfig,isInProject,projectConfigPath,globalConfigPath}from'../utils/config.js';import{logger}from'../utils/logger.js';export function Config(_0x5941b4){const _0x75bd19=a36_0x2bbc,{cli:_0x21b97c}=_0x5941b4,_0x502b73=_0x21b97c[_0x75bd19(0x199)][0x1],_0x16e92=_0x21b97c[_0x75bd19(0x199)][0x2],_0x3a2b8a=[_0x75bd19(0x1a7),_0x75bd19(0x19a)][_0x75bd19(0x1c0)](_0x502b73||''),_0x46e730=_0x21b97c[_0x75bd19(0x199)][_0x75bd19(0x1ac)]>=0x3;if(_0x16e92===_0x75bd19(0x1a9)||_0x21b97c[_0x75bd19(0x1b9)][_0x75bd19(0x1ab)])return a36_0x316f65(ConfigHelp,{});const _0x15717a=readConfig();if(_0x502b73==='set'){if(_0x16e92){const _0x3b20bd=_0x21b97c[_0x75bd19(0x199)][0x3];if(typeof _0x3b20bd!=='undefined'){if(_0x16e92===_0x75bd19(0x1a0)&&!['online','daily']['includes'](_0x3b20bd))return a36_0x316f65(Box,{'children':a36_0x316f65(Text,{'color':'red','children':_0x75bd19(0x1b6)})});const _0xb8228e=isInProject(),_0x1822a4=_0xb8228e?projectConfigPath:globalConfigPath;let _0x2682dd={};try{if(existsSync(_0x1822a4)){const _0x329094=readFileSync(_0x1822a4,{'encoding':_0x75bd19(0x1af)});_0x329094&&(_0x2682dd=JSON[_0x75bd19(0x19d)](_0x329094));}}catch(_0x4e37ff){}if(typeof _0x3b20bd!==_0x75bd19(0x1b3)||_0x3b20bd[_0x75bd19(0x1ac)]>0x1f4)return a36_0x316f65(Box,{'children':a36_0x316f65(Text,{'color':'red','children':_0x75bd19(0x198)})});let _0x37fd8a=_0x16e92;_0x16e92===_0x75bd19(0x1ad)&&(_0x37fd8a=_0x75bd19(0x1b8),delete _0x2682dd['app']);_0x16e92===_0x75bd19(0x1b8)&&delete _0x2682dd['app'];_0x2682dd[_0x37fd8a]=_0x3b20bd;try{const _0x211423=a36_0x2ae3cc[_0x75bd19(0x1c1)](_0x1822a4);!existsSync(_0x211423)&&a36_0x5e5b12[_0x75bd19(0x19e)](_0x211423,{'recursive':!![]});const _0x50c327=_0x1822a4+'.tmp';writeFileSync(_0x50c327,JSON[_0x75bd19(0x19f)](_0x2682dd,null,0x2),{'encoding':_0x75bd19(0x1af),'mode':0x180}),a36_0x5e5b12[_0x75bd19(0x1bd)](_0x50c327,_0x1822a4);if(_0x16e92===_0x75bd19(0x1a0)){const _0x1c8744=_0xb8228e?'项目':'全局';console[_0x75bd19(0x1a4)]('✓\x20'+_0x1c8744+_0x75bd19(0x1bb)+_0x3b20bd);}}catch(_0xabb565){const _0x11b6ac=_0x1822a4+_0x75bd19(0x1a3);try{existsSync(_0x11b6ac)&&a36_0x5e5b12['unlinkSync'](_0x11b6ac);}catch(_0x379016){}return logger[_0x75bd19(0x1b4)](_0x75bd19(0x1bf),_0x75bd19(0x1a1),{'error':_0xabb565 instanceof Error?_0xabb565['message']:String(_0xabb565),'configKey':_0x16e92,'configValue':_0x3b20bd,'targetConfigPath':_0x1822a4}),a36_0x316f65(Box,{'children':a36_0x2db172(Text,{'color':_0x75bd19(0x1b2),'children':[_0x75bd19(0x1b1),_0xabb565 instanceof Error?_0xabb565[_0x75bd19(0x1a6)]:String(_0xabb565)]})});}return null;}return a36_0x316f65(Box,{'children':a36_0x316f65(Text,{'color':_0x75bd19(0x1b2),'children':_0x75bd19(0x1be)})});}}if(_0x502b73===_0x75bd19(0x19a)){if(_0x16e92){let _0x2f4f60=_0x16e92;return _0x16e92==='app'&&(_0x2f4f60=_0x75bd19(0x1b8)),console[_0x75bd19(0x1a4)](_0x15717a[_0x2f4f60]||_0x75bd19(0x1b7)),null;}return null;}if(_0x502b73==='list')return console[_0x75bd19(0x1a4)](JSON[_0x75bd19(0x19f)](_0x15717a,null,0x2)),null;if(!_0x3a2b8a||!_0x46e730)return a36_0x316f65(ConfigHelp,{});return null;}
|
package/lib/constant/domain.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x2143b1=a37_0x251c;(function(_0x5b8cfc,_0x2e7313){const _0x1c5158=a37_0x251c,_0x3b84d9=_0x5b8cfc();while(!![]){try{const _0x11156a=-parseInt(_0x1c5158(0x1ba))/0x1*(-parseInt(_0x1c5158(0x1bb))/0x2)+parseInt(_0x1c5158(0x1bd))/0x3+-parseInt(_0x1c5158(0x1b4))/0x4*(-parseInt(_0x1c5158(0x1af))/0x5)+-parseInt(_0x1c5158(0x1b7))/0x6*(-parseInt(_0x1c5158(0x1b6))/0x7)+parseInt(_0x1c5158(0x1b1))/0x8*(-parseInt(_0x1c5158(0x1b8))/0x9)+parseInt(_0x1c5158(0x1b3))/0xa*(parseInt(_0x1c5158(0x1b2))/0xb)+-parseInt(_0x1c5158(0x1b0))/0xc;if(_0x11156a===_0x2e7313)break;else _0x3b84d9['push'](_0x3b84d9['shift']());}catch(_0x2d4de9){_0x3b84d9['push'](_0x3b84d9['shift']());}}}(a37_0x90a9,0xc1b60));import{getEnv}from'./env.js';function a37_0x90a9(){const _0x39cafc=['22634280xXnIwW','664528zodLnO','232067DQomdv','40wbzWsT','16zAmtPV','https://user-daily.lovrabet.com','4586232OWXqRP','12kZUtMF','117cqyOfP','online','1KShMrs','869690BmZPaT','https://api.lovrabet.com','2307345ZaHTtp','https://daily-api.lovrabet.com','1450985dtcmUm'];a37_0x90a9=function(){return _0x39cafc;};return a37_0x90a9();}function a37_0x251c(_0x3c6d74,_0x91b217){_0x3c6d74=_0x3c6d74-0x1ae;const _0x90a9d1=a37_0x90a9();let _0x251c51=_0x90a9d1[_0x3c6d74];return _0x251c51;}export const getUserDomain=()=>getEnv()===a37_0x2143b1(0x1b9)?'https://user.lovrabet.com':a37_0x2143b1(0x1b5);export const getApiDomain=()=>getEnv()===a37_0x2143b1(0x1b9)?a37_0x2143b1(0x1bc):a37_0x2143b1(0x1ae);
|
package/lib/constant/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a38_0x8e7226=a38_0x5e51;function a38_0x5e51(_0x536953,_0x17e1b9){_0x536953=_0x536953-0x171;const _0x3d9887=a38_0x3d98();let _0x5e51b4=_0x3d9887[_0x536953];return _0x5e51b4;}(function(_0x471dff,_0x8f2d42){const _0x239b43=a38_0x5e51,_0x48c8c5=_0x471dff();while(!![]){try{const _0x14ab30=-parseInt(_0x239b43(0x177))/0x1*(-parseInt(_0x239b43(0x178))/0x2)+parseInt(_0x239b43(0x174))/0x3+parseInt(_0x239b43(0x173))/0x4+parseInt(_0x239b43(0x17c))/0x5*(parseInt(_0x239b43(0x179))/0x6)+parseInt(_0x239b43(0x17a))/0x7+parseInt(_0x239b43(0x176))/0x8*(parseInt(_0x239b43(0x175))/0x9)+-parseInt(_0x239b43(0x17d))/0xa;if(_0x14ab30===_0x8f2d42)break;else _0x48c8c5['push'](_0x48c8c5['shift']());}catch(_0x210d4d){_0x48c8c5['push'](_0x48c8c5['shift']());}}}(a38_0x3d98,0xacc87));let env=process[a38_0x8e7226(0x172)][a38_0x8e7226(0x171)]||a38_0x8e7226(0x17b);export function getEnv(){return env;}function a38_0x3d98(){const _0x314210=['36157520lVbnwo','LOVRABET_ENV','env','3267696mICwFp','3913065CqUDaG','1368rEiKYR','28576raEtoT','87uQWarr','3618IrvrOQ','767202fnYAHA','1562365GLRTon','online','50lPzLih'];a38_0x3d98=function(){return _0x314210;};return a38_0x3d98();}export function initEnv(_0x1a878f){env=_0x1a878f;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2d3874,_0x122eba){const _0x501f38=a39_0x4dae,_0x4af7c9=_0x2d3874();while(!![]){try{const _0x90937b=parseInt(_0x501f38(0x150))/0x1*(parseInt(_0x501f38(0x155))/0x2)+parseInt(_0x501f38(0x15e))/0x3*(-parseInt(_0x501f38(0x143))/0x4)+-parseInt(_0x501f38(0x11f))/0x5*(parseInt(_0x501f38(0x124))/0x6)+-parseInt(_0x501f38(0x12a))/0x7+-parseInt(_0x501f38(0x146))/0x8*(parseInt(_0x501f38(0x139))/0x9)+-parseInt(_0x501f38(0x12c))/0xa*(parseInt(_0x501f38(0x120))/0xb)+parseInt(_0x501f38(0x147))/0xc;if(_0x90937b===_0x122eba)break;else _0x4af7c9['push'](_0x4af7c9['shift']());}catch(_0x21eae7){_0x4af7c9['push'](_0x4af7c9['shift']());}}}(a39_0x4860,0xde391));import{jsx as a39_0x4fe754,jsxs as a39_0xf4aba8,Fragment as a39_0x49a188}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';function a39_0x4dae(_0x20c37b,_0x33578a){_0x20c37b=_0x20c37b-0x11f;const _0x486014=a39_0x4860();let _0x4dae74=_0x486014[_0x20c37b];return _0x4dae74;}import{readConfig}from'../utils/config.js';function a39_0x4860(){const _0x1b2a75=['includes','*\x20创建新项目','登录状态','red','13947bpRNvw','项目名','online','api-pull','673415dlnOOa','13734721kOxTIP','test','√\x20检测到有效登录状态','rightArrow','12BlrgyD','登录失败','length','\x20\x20使用\x20←→\x20选择,回车确认','\x20←\x20','*\x20应用AppCode\x20','428680NYDBzy','应用AppCode','10ruGEHb','delete','project-name','Yes','return','column','my-app','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','step','\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口','leftArrow','[可选]:\x20','项目名不合法','657hSTKZn','yellow','项目名长度不能超过\x2050\x20个字符','green','slice','*\x20正在登录,请前往浏览器完成登录...','label','\x20直接回车确认,或输入自定义名称','应用AppCode不合法','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','544GmSQNL','confirm-api-pull','login-prompt','118408jvAeyJ','42707436mRhKeg','env','trim','app-code','backspace','creating','应用AppCode长度不能超过\x20100\x20个字符','login','login-check','16927SryFRi','*\x20是否要先登录以便拉取\x20API\x20配置?','\x20登录中...','*\x20是否要自动拉取\x20API\x20配置?','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','76JpEBAA','已登录','map','login-process','gray'];a39_0x4860=function(){return _0x1b2a75;};return a39_0x4860();}export function EnhancedGuidedCreate(_0x4ab04e){const _0x29d1d5=a39_0x4dae,{onCreate:_0x23d34c,env:_0x8e8c3b}=_0x4ab04e,[_0x2ba40d,_0x15c465]=useState(_0x29d1d5(0x12e)),[_0x19f942,_0x2a88ee]=useState(''),[_0x48a104,_0x5ac2ad]=useState(''),[_0x311ced,_0x3ba32f]=useState(''),[_0x3b9abb,_0x4c3332]=useState(''),[_0x44c15d,_0xa23ada]=useState([]),[_0x17dc5a,_0x52d7b2]=useState(null),[_0x146350,_0x285aec]=useState(![]),[_0xf1104c,_0x4b5e23]=useState(![]),[_0x52c89c,_0x2334f7]=useState(![]),[_0x3ec752,_0x3b8dfc]=useState(0x0),[_0x547edc,_0x4fb3f0]=useState(0x0),_0x2dca57=_0x29d1d5(0x132),_0x185142=readConfig(),_0x29827a=typeof _0x185142[_0x29d1d5(0x148)]==='string'?_0x185142[_0x29d1d5(0x148)]:undefined;function _0x4d82a0(_0x55f3c3){const _0x4b80d5=_0x29d1d5;if(_0x55f3c3['length']>0x32)return{'valid':![],'message':_0x4b80d5(0x13b)};const _0x4e426e=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x55f3c3?.['trim']()&&!_0x4e426e[_0x4b80d5(0x121)](_0x55f3c3))return{'valid':![],'message':_0x4b80d5(0x154)};return{'valid':!![]};}function _0x4926a0(_0x59a63b){const _0x1be289=_0x29d1d5;if(!_0x59a63b['trim']())return{'valid':!![]};if(_0x59a63b[_0x1be289(0x126)]>0x64)return{'valid':![],'message':_0x1be289(0x14d)};const _0x12be27=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x12be27[_0x1be289(0x121)](_0x59a63b))return{'valid':![],'message':_0x1be289(0x142)};return{'valid':!![]};}async function _0x47b64c(){_0x285aec(!![]);try{const _0x47c9a6=await getIsSessionValid();return _0x52d7b2(_0x47c9a6),_0x47c9a6;}catch(_0x5e347e){return _0x52d7b2(![]),![];}finally{_0x285aec(![]);}}async function _0x118393(){_0x4b5e23(!![]);try{const _0x36306c=await authServer({'silent':!![]});return _0x52d7b2(_0x36306c),_0x36306c;}catch(_0x38bcea){return _0x52d7b2(![]),![];}finally{_0x4b5e23(![]);}}return useInput(async(_0x257d4f,_0x454811)=>{const _0x4e33b6=_0x29d1d5;if(_0x454811[_0x4e33b6(0x136)]||_0x454811[_0x4e33b6(0x123)]){if(_0x2ba40d===_0x4e33b6(0x144)){_0x3b8dfc(_0x4ba5a1=>_0x4ba5a1===0x0?0x1:0x0);return;}if(_0x2ba40d==='login-prompt'){_0x4fb3f0(_0x1b9558=>_0x1b9558===0x0?0x1:0x0);return;}}if(_0x454811[_0x4e33b6(0x130)]){if(_0x2ba40d==='project-name'){const _0x9a5d3b=_0x311ced[_0x4e33b6(0x149)]()||_0x2dca57;if(_0x3b9abb)return;_0x2a88ee(_0x9a5d3b),_0xa23ada([{'step':_0x4e33b6(0x12e),'label':_0x4e33b6(0x15f),'value':_0x9a5d3b}]),_0x3ba32f(''),_0x4c3332(''),_0x15c465(_0x4e33b6(0x14a));return;}if(_0x2ba40d===_0x4e33b6(0x14a)){if(_0x3b9abb)return;const _0x52902a=_0x311ced[_0x4e33b6(0x149)]();_0x5ac2ad(_0x52902a),_0xa23ada(_0x2b0471=>[..._0x2b0471,{'step':_0x4e33b6(0x14a),'label':_0x4e33b6(0x12b),'value':_0x52902a||'未设置'}]),_0x3ba32f(''),_0x4c3332('');if(_0x52902a){_0x15c465('login-check');const _0x38a645=await _0x47b64c();_0x38a645?_0x15c465(_0x4e33b6(0x144)):_0x15c465('login-prompt');}else{const _0x3a3a93=_0x8e8c3b||_0x29827a||_0x4e33b6(0x160);_0x23d34c({'projectName':_0x19f942,'appCode':undefined,'pullApi':![],'env':_0x3a3a93}),_0x15c465(_0x4e33b6(0x14c));}return;}if(_0x2ba40d==='confirm-api-pull'){const _0x5baebe=_0x3ec752===0x0;_0x2334f7(_0x5baebe),_0xa23ada(_0x44d25b=>[..._0x44d25b,{'step':_0x4e33b6(0x161),'label':'拉取API配置','value':_0x5baebe?'是':'否'}]);const _0x258b35=_0x8e8c3b||_0x29827a||_0x4e33b6(0x160);_0x23d34c({'projectName':_0x19f942,'appCode':_0x48a104,'pullApi':_0x5baebe,'env':_0x258b35}),_0x15c465(_0x4e33b6(0x14c));return;}if(_0x2ba40d===_0x4e33b6(0x145)){const _0x599c5e=_0x547edc===0x0;if(_0x599c5e){_0x15c465(_0x4e33b6(0x158));const _0x2c2f48=await _0x118393();if(_0x2c2f48)_0xa23ada(_0x51b5f4=>[..._0x51b5f4,{'step':_0x4e33b6(0x14e),'label':_0x4e33b6(0x15c),'value':_0x4e33b6(0x156)}]),_0x15c465(_0x4e33b6(0x144));else{_0xa23ada(_0xcd9551=>[..._0xcd9551,{'step':_0x4e33b6(0x14e),'label':'登录状态','value':_0x4e33b6(0x125)}]);const _0x4bc790=_0x8e8c3b||_0x29827a||_0x4e33b6(0x160);_0x23d34c({'projectName':_0x19f942,'appCode':_0x48a104,'pullApi':![],'env':_0x4bc790}),_0x15c465('creating');}}else{_0xa23ada(_0x47512d=>[..._0x47512d,{'step':_0x4e33b6(0x14e),'label':_0x4e33b6(0x15c),'value':'跳过登录'}]);const _0x546ac6=_0x8e8c3b||_0x29827a||_0x4e33b6(0x160);_0x23d34c({'projectName':_0x19f942,'appCode':_0x48a104,'pullApi':![],'env':_0x546ac6}),_0x15c465(_0x4e33b6(0x14c));}return;}}if(_0x454811[_0x4e33b6(0x14b)]||_0x454811[_0x4e33b6(0x12d)]){_0x3ba32f(_0x13c52e=>{const _0x2c9fba=_0x4e33b6,_0x2a3565=_0x13c52e[_0x2c9fba(0x13d)](0x0,-0x1);if(_0x2ba40d==='project-name'){const {valid:_0x48142c,message:_0x24b487}=_0x4d82a0(_0x2a3565);_0x4c3332(_0x48142c?'':_0x24b487||_0x2c9fba(0x138));}else{if(_0x2ba40d===_0x2c9fba(0x14a)){const {valid:_0x220a54,message:_0x2262f7}=_0x4926a0(_0x2a3565);_0x4c3332(_0x220a54?'':_0x2262f7||_0x2c9fba(0x141));}}return _0x2a3565;});return;}if([_0x4e33b6(0x14c),'login-check','login-process'][_0x4e33b6(0x15a)](_0x2ba40d))return;if(_0x2ba40d==='confirm-api-pull'||_0x2ba40d===_0x4e33b6(0x145))return;_0x3ba32f(_0x2bee49=>{const _0x4c8432=_0x4e33b6,_0x2c134d=_0x2bee49+_0x257d4f;if(_0x2ba40d===_0x4c8432(0x12e)){const {valid:_0x5d1535,message:_0x1ba21d}=_0x4d82a0(_0x2c134d);_0x4c3332(_0x5d1535?'':_0x1ba21d||'项目名不合法');}else{if(_0x2ba40d==='app-code'){const {valid:_0x4ee2ea,message:_0x51a7b3}=_0x4926a0(_0x2c134d);_0x4c3332(_0x4ee2ea?'':_0x51a7b3||_0x4c8432(0x141));}}return _0x2c134d;});}),a39_0xf4aba8(Box,{'flexDirection':_0x29d1d5(0x131),'marginTop':0x1,'children':[_0x44c15d[_0x29d1d5(0x126)]===0x0&&a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':'cyan','children':_0x29d1d5(0x15b)})}),_0x44c15d[_0x29d1d5(0x157)](_0x9ed6a4=>a39_0xf4aba8(Box,{'children':[a39_0xf4aba8(Text,{'color':_0x29d1d5(0x13c),'children':['√\x20',_0x9ed6a4[_0x29d1d5(0x13f)],':\x20']}),a39_0x4fe754(Text,{'color':'cyan','children':_0x9ed6a4['value']})]},_0x9ed6a4[_0x29d1d5(0x134)])),_0x2ba40d===_0x29d1d5(0x12e)&&a39_0xf4aba8(a39_0x49a188,{'children':[a39_0xf4aba8(Box,{'children':[a39_0x4fe754(Text,{'children':'*\x20项目名:\x20'}),_0x311ced?a39_0x4fe754(Text,{'color':_0x29d1d5(0x13c),'children':_0x311ced}):a39_0x4fe754(Text,{'color':_0x29d1d5(0x159),'children':_0x2dca57}),_0x3b9abb&&a39_0xf4aba8(Text,{'color':_0x29d1d5(0x15d),'children':[_0x29d1d5(0x128),_0x3b9abb]})]}),!_0x3b9abb&&!_0x311ced&&a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x159),'children':_0x29d1d5(0x140)})})]}),_0x2ba40d===_0x29d1d5(0x14a)&&a39_0xf4aba8(a39_0x49a188,{'children':[a39_0xf4aba8(Box,{'children':[a39_0x4fe754(Text,{'children':_0x29d1d5(0x129)}),a39_0x4fe754(Text,{'color':_0x29d1d5(0x159),'children':_0x29d1d5(0x137)}),a39_0x4fe754(Text,{'color':_0x29d1d5(0x13c),'children':_0x311ced}),_0x3b9abb&&a39_0xf4aba8(Text,{'color':'red','children':[_0x29d1d5(0x128),_0x3b9abb]})]}),!_0x3b9abb&&a39_0x4fe754(Box,{'children':a39_0xf4aba8(Text,{'color':'gray','children':['\x20',_0x29d1d5(0x133)]})})]}),_0x2ba40d===_0x29d1d5(0x14f)&&a39_0xf4aba8(Box,{'children':[a39_0x4fe754(Text,{'children':'*\x20正在检查登录状态...'}),_0x146350&&a39_0x4fe754(Text,{'color':'gray','children':'\x20检查中...'})]}),_0x2ba40d===_0x29d1d5(0x144)&&a39_0xf4aba8(a39_0x49a188,{'children':[a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x13c),'children':_0x29d1d5(0x122)})}),a39_0x4fe754(Box,{'marginTop':0x1,'children':a39_0x4fe754(Text,{'children':_0x29d1d5(0x153)})}),a39_0xf4aba8(Box,{'marginLeft':0x2,'children':[a39_0xf4aba8(Text,{'color':_0x3ec752===0x0?'green':'gray','children':[_0x3ec752===0x0?'▶\x20':'\x20\x20',_0x29d1d5(0x12f)]}),a39_0x4fe754(Text,{'children':'\x20'}),a39_0xf4aba8(Text,{'color':_0x3ec752===0x1?_0x29d1d5(0x13c):_0x29d1d5(0x159),'children':[_0x3ec752===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x159),'children':_0x29d1d5(0x127)})}),a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x13a),'children':_0x29d1d5(0x135)})})]}),_0x2ba40d===_0x29d1d5(0x145)&&a39_0xf4aba8(a39_0x49a188,{'children':[a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x13a),'children':'!\x20未检测到有效登录'})}),a39_0x4fe754(Box,{'marginTop':0x1,'children':a39_0x4fe754(Text,{'children':_0x29d1d5(0x151)})}),a39_0xf4aba8(Box,{'marginLeft':0x2,'children':[a39_0xf4aba8(Text,{'color':_0x547edc===0x0?_0x29d1d5(0x13c):_0x29d1d5(0x159),'children':[_0x547edc===0x0?'▶\x20':'\x20\x20',_0x29d1d5(0x12f)]}),a39_0x4fe754(Text,{'children':'\x20'}),a39_0xf4aba8(Text,{'color':_0x547edc===0x1?'green':_0x29d1d5(0x159),'children':[_0x547edc===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x159),'children':_0x29d1d5(0x127)})}),a39_0x4fe754(Box,{'children':a39_0x4fe754(Text,{'color':_0x29d1d5(0x13a),'children':'\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口'})})]}),_0x2ba40d===_0x29d1d5(0x158)&&a39_0xf4aba8(Box,{'children':[a39_0x4fe754(Text,{'children':_0x29d1d5(0x13e)}),_0xf1104c&&a39_0x4fe754(Text,{'color':_0x29d1d5(0x159),'children':_0x29d1d5(0x152)})]})]});}
|
|
1
|
+
(function(_0x5dcc5d,_0x5c298f){const _0x68ebaf=a39_0x478e,_0x2e5510=_0x5dcc5d();while(!![]){try{const _0x16dcdd=parseInt(_0x68ebaf(0x13f))/0x1*(-parseInt(_0x68ebaf(0x14c))/0x2)+parseInt(_0x68ebaf(0x133))/0x3+parseInt(_0x68ebaf(0x13e))/0x4*(parseInt(_0x68ebaf(0x121))/0x5)+-parseInt(_0x68ebaf(0x153))/0x6*(-parseInt(_0x68ebaf(0x11e))/0x7)+parseInt(_0x68ebaf(0x13b))/0x8*(parseInt(_0x68ebaf(0x116))/0x9)+parseInt(_0x68ebaf(0x110))/0xa+parseInt(_0x68ebaf(0x13d))/0xb*(-parseInt(_0x68ebaf(0x125))/0xc);if(_0x16dcdd===_0x5c298f)break;else _0x2e5510['push'](_0x2e5510['shift']());}catch(_0x350b48){_0x2e5510['push'](_0x2e5510['shift']());}}}(a39_0x3034,0x9d735));import{jsx as a39_0x8d199c,jsxs as a39_0x262220,Fragment as a39_0x3f13e4}from'react/jsx-runtime';function a39_0x3034(){const _0x13b281=['已登录','step','trim','backspace','login-prompt','8ksclmV','api-pull','31596697vMgvFS','192vnkjvL','11190xUAVGL','value','Yes','my-app','未设置','red','yellow','string','login-process','app-code','拉取API配置','*\x20创建新项目','\x20直接回车确认,或输入自定义名称','6cxNolt','includes','[可选]:\x20','green','rightArrow','应用AppCode不合法','\x20\x20推荐选择\x20Yes,登录后可自动拉取并配置\x20API\x20接口','1486314UWAmPH','return','3057230sGWOBQ','项目名不合法','slice','login','登录状态','creating','5025411kSKqeW','test','*\x20是否要先登录以便拉取\x20API\x20配置?','leftArrow','*\x20项目名:\x20','绑定应用AppCode可自动配置\x20API,如:\x20app-c4c89304\x20(直接回车跳过)','gray','项目名','21FchuTR','\x20\x20使用\x20←→\x20选择,回车确认','!\x20未检测到有效登录','89795VjwNlf','*\x20是否要自动拉取\x20API\x20配置?','应用AppCode只能包含字母、数字、连字符和下划线,且必须以字母或数字开头','online','12kyORdQ','√\x20检测到有效登录状态','\x20检查中...','*\x20应用AppCode\x20','confirm-api-pull','应用AppCode','length','login-check','cyan','登录失败','项目名只能以字母或数字开头,且只包含字母、数字、-\x20和\x20_','column','项目名长度不能超过\x2050\x20个字符','跳过登录','3244869qTWOOA','project-name','\x20←\x20'];a39_0x3034=function(){return _0x13b281;};return a39_0x3034();}import{useState}from'react';function a39_0x478e(_0x8b2000,_0x3dd1e0){_0x8b2000=_0x8b2000-0x10f;const _0x303470=a39_0x3034();let _0x478e60=_0x303470[_0x8b2000];return _0x478e60;}import{Text,Box,useInput}from'ink';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x1d2cef){const _0x4f179c=a39_0x478e,{onCreate:_0x38c351,env:_0x1e385e}=_0x1d2cef,[_0x598fd4,_0x21d771]=useState(_0x4f179c(0x134)),[_0x3ee4d3,_0x4bb567]=useState(''),[_0x5ee608,_0x15d85f]=useState(''),[_0x33afec,_0x2497a9]=useState(''),[_0x2bcf76,_0x4db00c]=useState(''),[_0x28a682,_0x53eb54]=useState([]),[_0x4b7b97,_0x44ef03]=useState(null),[_0x26ceab,_0x40d93d]=useState(![]),[_0x496c0a,_0x51c3e3]=useState(![]),[_0x2b5b2a,_0x3c9c94]=useState(![]),[_0x3e7963,_0x3d398b]=useState(0x0),[_0x5a05d2,_0x3c9689]=useState(0x0),_0x17fe9f=_0x4f179c(0x142),_0x1f4b96=readConfig(),_0x4a79c8=typeof _0x1f4b96['env']===_0x4f179c(0x146)?_0x1f4b96['env']:undefined;function _0x2cc452(_0x28d951){const _0x3a1119=_0x4f179c;if(_0x28d951[_0x3a1119(0x12b)]>0x32)return{'valid':![],'message':_0x3a1119(0x131)};const _0xa09755=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x28d951?.['trim']()&&!_0xa09755[_0x3a1119(0x117)](_0x28d951))return{'valid':![],'message':_0x3a1119(0x12f)};return{'valid':!![]};}function _0xaa7faf(_0x6e379e){const _0x1171d2=_0x4f179c;if(!_0x6e379e[_0x1171d2(0x138)]())return{'valid':!![]};if(_0x6e379e[_0x1171d2(0x12b)]>0x64)return{'valid':![],'message':'应用AppCode长度不能超过\x20100\x20个字符'};const _0x166cfc=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x166cfc[_0x1171d2(0x117)](_0x6e379e))return{'valid':![],'message':_0x1171d2(0x123)};return{'valid':!![]};}async function _0x31bd12(){_0x40d93d(!![]);try{const _0x548ebd=await getIsSessionValid();return _0x44ef03(_0x548ebd),_0x548ebd;}catch(_0x53ba0b){return _0x44ef03(![]),![];}finally{_0x40d93d(![]);}}async function _0x4710c1(){_0x51c3e3(!![]);try{const _0x2248d2=await authServer({'silent':!![]});return _0x44ef03(_0x2248d2),_0x2248d2;}catch(_0x5b52be){return _0x44ef03(![]),![];}finally{_0x51c3e3(![]);}}return useInput(async(_0x2b3a6a,_0x9ac038)=>{const _0x37e41c=_0x4f179c;if(_0x9ac038[_0x37e41c(0x119)]||_0x9ac038[_0x37e41c(0x150)]){if(_0x598fd4==='confirm-api-pull'){_0x3d398b(_0x56baad=>_0x56baad===0x0?0x1:0x0);return;}if(_0x598fd4==='login-prompt'){_0x3c9689(_0x1b1d50=>_0x1b1d50===0x0?0x1:0x0);return;}}if(_0x9ac038[_0x37e41c(0x10f)]){if(_0x598fd4===_0x37e41c(0x134)){const _0x4c6e64=_0x33afec[_0x37e41c(0x138)]()||_0x17fe9f;if(_0x2bcf76)return;_0x4bb567(_0x4c6e64),_0x53eb54([{'step':_0x37e41c(0x134),'label':_0x37e41c(0x11d),'value':_0x4c6e64}]),_0x2497a9(''),_0x4db00c(''),_0x21d771('app-code');return;}if(_0x598fd4===_0x37e41c(0x148)){if(_0x2bcf76)return;const _0x2e34e0=_0x33afec[_0x37e41c(0x138)]();_0x15d85f(_0x2e34e0),_0x53eb54(_0x29452a=>[..._0x29452a,{'step':_0x37e41c(0x148),'label':_0x37e41c(0x12a),'value':_0x2e34e0||_0x37e41c(0x143)}]),_0x2497a9(''),_0x4db00c('');if(_0x2e34e0){_0x21d771(_0x37e41c(0x12c));const _0x48ebd8=await _0x31bd12();_0x48ebd8?_0x21d771(_0x37e41c(0x129)):_0x21d771(_0x37e41c(0x13a));}else{const _0x3ac3ff=_0x1e385e||_0x4a79c8||'online';_0x38c351({'projectName':_0x3ee4d3,'appCode':undefined,'pullApi':![],'env':_0x3ac3ff}),_0x21d771(_0x37e41c(0x115));}return;}if(_0x598fd4==='confirm-api-pull'){const _0x29b881=_0x3e7963===0x0;_0x3c9c94(_0x29b881),_0x53eb54(_0x5580ab=>[..._0x5580ab,{'step':_0x37e41c(0x13c),'label':_0x37e41c(0x149),'value':_0x29b881?'是':'否'}]);const _0x20ae31=_0x1e385e||_0x4a79c8||_0x37e41c(0x124);_0x38c351({'projectName':_0x3ee4d3,'appCode':_0x5ee608,'pullApi':_0x29b881,'env':_0x20ae31}),_0x21d771('creating');return;}if(_0x598fd4===_0x37e41c(0x13a)){const _0x3dabf7=_0x5a05d2===0x0;if(_0x3dabf7){_0x21d771('login-process');const _0x3c03c1=await _0x4710c1();if(_0x3c03c1)_0x53eb54(_0x305df8=>[..._0x305df8,{'step':_0x37e41c(0x113),'label':_0x37e41c(0x114),'value':_0x37e41c(0x136)}]),_0x21d771(_0x37e41c(0x129));else{_0x53eb54(_0x2588a6=>[..._0x2588a6,{'step':'login','label':_0x37e41c(0x114),'value':_0x37e41c(0x12e)}]);const _0x377a79=_0x1e385e||_0x4a79c8||'online';_0x38c351({'projectName':_0x3ee4d3,'appCode':_0x5ee608,'pullApi':![],'env':_0x377a79}),_0x21d771(_0x37e41c(0x115));}}else{_0x53eb54(_0x478970=>[..._0x478970,{'step':_0x37e41c(0x113),'label':_0x37e41c(0x114),'value':_0x37e41c(0x132)}]);const _0x3bf170=_0x1e385e||_0x4a79c8||_0x37e41c(0x124);_0x38c351({'projectName':_0x3ee4d3,'appCode':_0x5ee608,'pullApi':![],'env':_0x3bf170}),_0x21d771(_0x37e41c(0x115));}return;}}if(_0x9ac038[_0x37e41c(0x139)]||_0x9ac038['delete']){_0x2497a9(_0x16dfaa=>{const _0x3eb413=_0x37e41c,_0x25e072=_0x16dfaa[_0x3eb413(0x112)](0x0,-0x1);if(_0x598fd4===_0x3eb413(0x134)){const {valid:_0x810d01,message:_0x4d0dca}=_0x2cc452(_0x25e072);_0x4db00c(_0x810d01?'':_0x4d0dca||_0x3eb413(0x111));}else{if(_0x598fd4===_0x3eb413(0x148)){const {valid:_0x53a6a2,message:_0x5e4b06}=_0xaa7faf(_0x25e072);_0x4db00c(_0x53a6a2?'':_0x5e4b06||_0x3eb413(0x151));}}return _0x25e072;});return;}if([_0x37e41c(0x115),_0x37e41c(0x12c),_0x37e41c(0x147)][_0x37e41c(0x14d)](_0x598fd4))return;if(_0x598fd4===_0x37e41c(0x129)||_0x598fd4===_0x37e41c(0x13a))return;_0x2497a9(_0x2920da=>{const _0x542e41=_0x37e41c,_0x255b76=_0x2920da+_0x2b3a6a;if(_0x598fd4===_0x542e41(0x134)){const {valid:_0x4b7eb4,message:_0x5dbc96}=_0x2cc452(_0x255b76);_0x4db00c(_0x4b7eb4?'':_0x5dbc96||_0x542e41(0x111));}else{if(_0x598fd4===_0x542e41(0x148)){const {valid:_0x3e3323,message:_0x427c0a}=_0xaa7faf(_0x255b76);_0x4db00c(_0x3e3323?'':_0x427c0a||_0x542e41(0x151));}}return _0x255b76;});}),a39_0x262220(Box,{'flexDirection':_0x4f179c(0x130),'marginTop':0x1,'children':[_0x28a682[_0x4f179c(0x12b)]===0x0&&a39_0x8d199c(Box,{'children':a39_0x8d199c(Text,{'color':'cyan','children':_0x4f179c(0x14a)})}),_0x28a682['map'](_0x17bf26=>a39_0x262220(Box,{'children':[a39_0x262220(Text,{'color':_0x4f179c(0x14f),'children':['√\x20',_0x17bf26['label'],':\x20']}),a39_0x8d199c(Text,{'color':_0x4f179c(0x12d),'children':_0x17bf26[_0x4f179c(0x140)]})]},_0x17bf26[_0x4f179c(0x137)])),_0x598fd4==='project-name'&&a39_0x262220(a39_0x3f13e4,{'children':[a39_0x262220(Box,{'children':[a39_0x8d199c(Text,{'children':_0x4f179c(0x11a)}),_0x33afec?a39_0x8d199c(Text,{'color':_0x4f179c(0x14f),'children':_0x33afec}):a39_0x8d199c(Text,{'color':_0x4f179c(0x11c),'children':_0x17fe9f}),_0x2bcf76&&a39_0x262220(Text,{'color':'red','children':[_0x4f179c(0x135),_0x2bcf76]})]}),!_0x2bcf76&&!_0x33afec&&a39_0x8d199c(Box,{'children':a39_0x8d199c(Text,{'color':_0x4f179c(0x11c),'children':_0x4f179c(0x14b)})})]}),_0x598fd4===_0x4f179c(0x148)&&a39_0x262220(a39_0x3f13e4,{'children':[a39_0x262220(Box,{'children':[a39_0x8d199c(Text,{'children':_0x4f179c(0x128)}),a39_0x8d199c(Text,{'color':_0x4f179c(0x11c),'children':_0x4f179c(0x14e)}),a39_0x8d199c(Text,{'color':'green','children':_0x33afec}),_0x2bcf76&&a39_0x262220(Text,{'color':_0x4f179c(0x144),'children':['\x20←\x20',_0x2bcf76]})]}),!_0x2bcf76&&a39_0x8d199c(Box,{'children':a39_0x262220(Text,{'color':'gray','children':['\x20',_0x4f179c(0x11b)]})})]}),_0x598fd4===_0x4f179c(0x12c)&&a39_0x262220(Box,{'children':[a39_0x8d199c(Text,{'children':'*\x20正在检查登录状态...'}),_0x26ceab&&a39_0x8d199c(Text,{'color':_0x4f179c(0x11c),'children':_0x4f179c(0x127)})]}),_0x598fd4===_0x4f179c(0x129)&&a39_0x262220(a39_0x3f13e4,{'children':[a39_0x8d199c(Box,{'children':a39_0x8d199c(Text,{'color':'green','children':_0x4f179c(0x126)})}),a39_0x8d199c(Box,{'marginTop':0x1,'children':a39_0x8d199c(Text,{'children':_0x4f179c(0x122)})}),a39_0x262220(Box,{'marginLeft':0x2,'children':[a39_0x262220(Text,{'color':_0x3e7963===0x0?'green':_0x4f179c(0x11c),'children':[_0x3e7963===0x0?'▶\x20':'\x20\x20','Yes']}),a39_0x8d199c(Text,{'children':'\x20'}),a39_0x262220(Text,{'color':_0x3e7963===0x1?_0x4f179c(0x14f):_0x4f179c(0x11c),'children':[_0x3e7963===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x8d199c(Box,{'children':a39_0x8d199c(Text,{'color':_0x4f179c(0x11c),'children':_0x4f179c(0x11f)})}),a39_0x8d199c(Box,{'children':a39_0x8d199c(Text,{'color':'yellow','children':'\x20\x20推荐选择\x20Yes,可自动配置\x20API\x20接口'})})]}),_0x598fd4===_0x4f179c(0x13a)&&a39_0x262220(a39_0x3f13e4,{'children':[a39_0x8d199c(Box,{'children':a39_0x8d199c(Text,{'color':_0x4f179c(0x145),'children':_0x4f179c(0x120)})}),a39_0x8d199c(Box,{'marginTop':0x1,'children':a39_0x8d199c(Text,{'children':_0x4f179c(0x118)})}),a39_0x262220(Box,{'marginLeft':0x2,'children':[a39_0x262220(Text,{'color':_0x5a05d2===0x0?_0x4f179c(0x14f):_0x4f179c(0x11c),'children':[_0x5a05d2===0x0?'▶\x20':'\x20\x20',_0x4f179c(0x141)]}),a39_0x8d199c(Text,{'children':'\x20'}),a39_0x262220(Text,{'color':_0x5a05d2===0x1?_0x4f179c(0x14f):'gray','children':[_0x5a05d2===0x1?'▶\x20':'\x20\x20','No']})]}),a39_0x8d199c(Box,{'children':a39_0x8d199c(Text,{'color':'gray','children':'\x20\x20使用\x20←→\x20选择,回车确认'})}),a39_0x8d199c(Box,{'children':a39_0x8d199c(Text,{'color':_0x4f179c(0x145),'children':_0x4f179c(0x152)})})]}),_0x598fd4===_0x4f179c(0x147)&&a39_0x262220(Box,{'children':[a39_0x8d199c(Text,{'children':'*\x20正在登录,请前往浏览器完成登录...'}),_0x496c0a&&a39_0x8d199c(Text,{'color':_0x4f179c(0x11c),'children':'\x20登录中...'})]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a40_0x22bb(_0xde4772,_0x59c094){_0xde4772=_0xde4772-0x165;const _0x1e2748=a40_0x1e27();let _0x22bbbf=_0x1e2748[_0xde4772];return _0x22bbbf;}(function(_0x323cc0,_0x45c282){const _0x232965=a40_0x22bb,_0x483d9a=_0x323cc0();while(!![]){try{const _0x1e841a=-parseInt(_0x232965(0x169))/0x1+-parseInt(_0x232965(0x167))/0x2*(-parseInt(_0x232965(0x166))/0x3)+parseInt(_0x232965(0x165))/0x4*(parseInt(_0x232965(0x172))/0x5)+parseInt(_0x232965(0x168))/0x6+-parseInt(_0x232965(0x16c))/0x7*(parseInt(_0x232965(0x170))/0x8)+parseInt(_0x232965(0x16b))/0x9*(parseInt(_0x232965(0x16e))/0xa)+parseInt(_0x232965(0x16f))/0xb*(-parseInt(_0x232965(0x16a))/0xc);if(_0x1e841a===_0x45c282)break;else _0x483d9a['push'](_0x483d9a['shift']());}catch(_0x19f515){_0x483d9a['push'](_0x483d9a['shift']());}}}(a40_0x1e27,0xb9978));export function formatElapsed(_0x4de5ab){const _0x4e0857=a40_0x22bb,_0x3ee6e9=Date[_0x4e0857(0x16d)]()-_0x4de5ab;if(_0x3ee6e9<0x3e8)return _0x3ee6e9+'ms';const _0xa5811f=(_0x3ee6e9/0x3e8)[_0x4e0857(0x171)](0x2),_0x5af70d=_0xa5811f['replace'](/\.?0+$/u,'');return _0x5af70d+'s';}function a40_0x1e27(){const _0x29e54f=['8uJqAgI','3WCWffM','2866158hceNdC','2443710Ehuopc','501996EaFOVb','432HUJcvL','1076022aGuQwh','14812jejGzZ','now','60pLLXZu','580107HUMylE','1256gkWXAW','toFixed','2338030gPLnBH'];a40_0x1e27=function(){return _0x29e54f;};return a40_0x1e27();}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x50b2c,_0x26fd62){const _0x505500=a41_0x30df,_0x54bd3d=_0x50b2c();while(!![]){try{const _0x36cda5=parseInt(_0x505500(0x1db))/0x1*(parseInt(_0x505500(0x237))/0x2)+-parseInt(_0x505500(0x1da))/0x3*(parseInt(_0x505500(0x1ea))/0x4)+parseInt(_0x505500(0x234))/0x5+-parseInt(_0x505500(0x1f6))/0x6+parseInt(_0x505500(0x1ec))/0x7*(parseInt(_0x505500(0x201))/0x8)+parseInt(_0x505500(0x212))/0x9+parseInt(_0x505500(0x218))/0xa*(-parseInt(_0x505500(0x205))/0xb);if(_0x36cda5===_0x26fd62)break;else _0x54bd3d['push'](_0x54bd3d['shift']());}catch(_0x3cf951){_0x54bd3d['push'](_0x54bd3d['shift']());}}}(a41_0x42f6,0x390f8));function a41_0x42f6(){const _0xb994d4=['lovrabet\x20api\x20pull','*\x20正在拉取\x20API\x20配置...','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','配置应用AppCode:\x20','192486zTdbbu','1gMnWcn','package.json','项目名称:\x20','cyan','cd\x20','gray','version','lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','parse','清理项目目录失败:\x20','column','\x20|\x20应用AppCode:\x20','拉取API配置:\x20','.lovrabetrc','√\x20package.json\x20已更新:\x20name=','4SjoFjb','log','731241uZXCLq','create','utf8','\x20√\x20','项目创建完成:\x20','green','existsSync','配置AppCode:\x20','appCode','projectCode','1328304dhPbRg','trim','length','配置应用AppCode失败:\x20','🎉\x20项目创建成功!','name','error','accessSync','dirname','\x20Generated\x20by\x20lovrabet\x20cli\x20','更新\x20package.json\x20失败:\x20','8HlyQsl','setLogPath','×\x20项目目录\x20','writeFileSync','11QIxOhE','repeat','1.\x20','更新\x20package.json\x20name\x20和\x20description\x20字段','doTask','√\x20配置文件已创建,应用AppCode:\x20','env','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','cwd','string','×\x20项目名过长,最多支持\x20100\x20个字符','🚀\x20接下来可以:','×\x20项目创建失败:\x20','3635874BZMqXr','pullApi','projectName','×\x20项目名不能为空','../..','1.0.0','4942210NzBCEk','\x20创建配置文件','info','stringify','white','API\x20配置拉取成功:\x20',',\x20description=','2.\x20','online','description','📁\x20项目名称:\x20','success','!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull','*\x20配置文件路径:\x20','yellow','resolve','join','test','lovrabet\x20config\x20set\x20appcode\x20[app-code]','W_OK','*\x20正在为项目\x20','message','\x20配置应用AppCode:\x20','warn','*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段','readFileSync','\x20已存在,请使用其他项目名','×\x20无法在当前目录创建项目,请检查目录权限','726160TvUCiM','需手动拉取','未配置','719612EsXVYy','√\x20API\x20配置拉取完成'];a41_0x42f6=function(){return _0xb994d4;};return a41_0x42f6();}import{jsx as a41_0xc02386,Fragment as a41_0xa965e9,jsxs as a41_0x4312da}from'react/jsx-runtime';import a41_0x79bd0d from'node:path';import a41_0x5b1801 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';function a41_0x30df(_0x8b7031,_0x11a87c){_0x8b7031=_0x8b7031-0x1d7;const _0x42f691=a41_0x42f6();let _0x30dff8=_0x42f691[_0x8b7031];return _0x30dff8;}import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x27237b){const _0x3a93a5=a41_0x30df,[_0x53104a,_0x40600f]=useState(![]),[_0x205f8f,_0xac69b7]=useState(![]),[_0x2d3ecb,_0x5954f9]=useState(null),_0x2da05b=useCopyProjectTemplate(),_0x5a80d9=useInstallDependencies(),_0x36fe14=useFormatCode(),_0x5800bf=async _0x278c78=>{const _0x31baef=a41_0x30df;if(!_0x278c78[_0x31baef(0x214)]||_0x278c78[_0x31baef(0x214)][_0x31baef(0x1f7)]()===''){console['error'](_0x31baef(0x215));return;}const _0x37aa44=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x37aa44[_0x31baef(0x229)](_0x278c78[_0x31baef(0x214)])){console[_0x31baef(0x1fc)](_0x31baef(0x1d7));return;}if(_0x278c78[_0x31baef(0x214)][_0x31baef(0x1f8)]>0x64){console[_0x31baef(0x1fc)](_0x31baef(0x20f));return;}const _0x50c3af=a41_0x79bd0d[_0x31baef(0x227)](process[_0x31baef(0x20d)](),_0x278c78[_0x31baef(0x214)]);if(a41_0x5b1801[_0x31baef(0x1f2)](_0x50c3af)){console['error'](_0x31baef(0x203)+_0x278c78[_0x31baef(0x214)]+_0x31baef(0x232));return;}try{const _0x49ae01=a41_0x79bd0d[_0x31baef(0x1fe)](_0x50c3af);a41_0x5b1801[_0x31baef(0x1fd)](_0x49ae01,a41_0x5b1801['constants'][_0x31baef(0x22b)]);}catch(_0x33145c){console[_0x31baef(0x1fc)](_0x31baef(0x233));return;}_0x5954f9(_0x278c78),_0x40600f(!![]),logger[_0x31baef(0x202)](_0x50c3af),logger[_0x31baef(0x21a)](_0x31baef(0x1ed),'开始创建项目:\x20'+_0x278c78[_0x31baef(0x214)],{'projectDir':_0x50c3af,'appCode':_0x278c78[_0x31baef(0x1f4)]});try{await _0x2da05b[_0x31baef(0x209)](_0x278c78[_0x31baef(0x214)]),await _0x326a13(_0x278c78[_0x31baef(0x214)]),await _0x5a80d9[_0x31baef(0x209)](_0x278c78['projectName']),await _0x36fe14[_0x31baef(0x209)](_0x278c78[_0x31baef(0x214)]),await _0x4f0210(_0x278c78['projectName'],_0x278c78['appCode']||'',_0x278c78[_0x31baef(0x20b)]);if(_0x278c78[_0x31baef(0x213)]&&_0x278c78[_0x31baef(0x1f4)]){console[_0x31baef(0x1eb)](_0x31baef(0x23a));try{const _0x374a33=await pullApiSilent(_0x278c78['appCode'],undefined,_0x50c3af,_0x278c78['env']);_0x374a33?(console['log'](_0x31baef(0x238)),logger[_0x31baef(0x21a)](_0x31baef(0x1ed),_0x31baef(0x21d)+_0x278c78[_0x31baef(0x1f4)],{'projectDir':_0x50c3af,'appCode':_0x278c78[_0x31baef(0x1f4)],'env':_0x278c78['env']})):(console[_0x31baef(0x1eb)](_0x31baef(0x224)),logger[_0x31baef(0x22f)](_0x31baef(0x1ed),'API\x20配置拉取失败:\x20'+_0x278c78[_0x31baef(0x1f4)],{'projectDir':_0x50c3af,'appCode':_0x278c78['appCode'],'env':_0x278c78[_0x31baef(0x20b)]}));}catch(_0x266ba4){console[_0x31baef(0x1eb)](_0x31baef(0x20c)),logger[_0x31baef(0x22f)](_0x31baef(0x1ed),'API\x20配置拉取异常:\x20'+_0x278c78[_0x31baef(0x1f4)],{'projectDir':_0x50c3af,'appCode':_0x278c78['appCode'],'env':_0x278c78[_0x31baef(0x20b)],'error':_0x266ba4 instanceof Error?_0x266ba4[_0x31baef(0x22d)]:String(_0x266ba4)});}}logger[_0x31baef(0x223)](_0x31baef(0x1ed),_0x31baef(0x1f0)+_0x278c78[_0x31baef(0x214)]),_0xac69b7(!![]),_0x40600f(![]);}catch(_0x24c000){logger['error'](_0x31baef(0x1ed),'项目创建失败:\x20'+_0x278c78['projectName'],{'error':_0x24c000 instanceof Error?_0x24c000[_0x31baef(0x22d)]:String(_0x24c000)});try{a41_0x5b1801[_0x31baef(0x1f2)](_0x50c3af)&&(console[_0x31baef(0x1eb)]('*\x20清理失败的项目目录:\x20'+_0x50c3af),a41_0x5b1801['rmSync'](_0x50c3af,{'recursive':!![],'force':!![]}));}catch(_0x17d538){logger[_0x31baef(0x22f)](_0x31baef(0x1ed),_0x31baef(0x1e4)+_0x50c3af,{'error':_0x17d538 instanceof Error?_0x17d538[_0x31baef(0x22d)]:String(_0x17d538)});}_0x40600f(![]),console['error'](_0x31baef(0x211)+(_0x24c000 instanceof Error?_0x24c000[_0x31baef(0x22d)]:String(_0x24c000)));}},_0x425219=async _0x580a5e=>{const _0x3c0310=a41_0x30df;await _0x5800bf({'projectName':_0x580a5e,'env':_0x27237b[_0x3c0310(0x20b)]});},_0x326a13=async _0x321b50=>{const _0x4e7c6b=a41_0x30df,_0x15e462=a41_0x79bd0d[_0x4e7c6b(0x227)](process[_0x4e7c6b(0x20d)](),_0x321b50),_0x580e4d=a41_0x79bd0d[_0x4e7c6b(0x228)](_0x15e462,_0x4e7c6b(0x1dc));try{console[_0x4e7c6b(0x1eb)](_0x4e7c6b(0x230));const _0x26904d=fileURLToPath(import.meta.url),_0xa65e0f=a41_0x79bd0d['resolve'](a41_0x79bd0d['dirname'](_0x26904d),'../..'),_0x29afdd=a41_0x79bd0d[_0x4e7c6b(0x228)](_0xa65e0f,_0x4e7c6b(0x1dc));let _0x1aebe8='1.0.0';try{const _0x24363f=JSON[_0x4e7c6b(0x1e3)](a41_0x5b1801[_0x4e7c6b(0x231)](_0x29afdd,'utf8'));_0x1aebe8=_0x24363f[_0x4e7c6b(0x1e1)]||_0x4e7c6b(0x217);}catch(_0x2a3502){}const _0x5e1cb9=a41_0x5b1801[_0x4e7c6b(0x231)](_0x580e4d,_0x4e7c6b(0x1ee)),_0x475168=JSON[_0x4e7c6b(0x1e3)](_0x5e1cb9);_0x475168[_0x4e7c6b(0x1fb)]=_0x321b50,_0x475168[_0x4e7c6b(0x221)]=_0x321b50+_0x4e7c6b(0x1ff)+_0x1aebe8,a41_0x5b1801[_0x4e7c6b(0x204)](_0x580e4d,JSON[_0x4e7c6b(0x21b)](_0x475168,null,0x2)+'\x0a',_0x4e7c6b(0x1ee)),console[_0x4e7c6b(0x1eb)](_0x4e7c6b(0x1e9)+_0x321b50+_0x4e7c6b(0x21e)+_0x475168[_0x4e7c6b(0x221)]),logger[_0x4e7c6b(0x21a)]('create',_0x4e7c6b(0x208),{'projectName':_0x321b50,'description':_0x475168[_0x4e7c6b(0x221)],'cliVersion':_0x1aebe8,'packageJsonPath':'package.json'});}catch(_0x595a22){logger[_0x4e7c6b(0x1fc)](_0x4e7c6b(0x1ed),_0x4e7c6b(0x200)+_0x321b50,{'projectName':_0x321b50,'error':_0x595a22 instanceof Error?_0x595a22['message']:String(_0x595a22)});throw _0x595a22;}},_0x4f0210=async(_0x34b3da,_0x3500b1,_0x2d0195)=>{const _0x6a3d72=a41_0x30df,_0x5597ad=a41_0x79bd0d[_0x6a3d72(0x227)](process[_0x6a3d72(0x20d)](),_0x34b3da),_0x15f9dd=a41_0x79bd0d[_0x6a3d72(0x228)](_0x5597ad,_0x6a3d72(0x1e8));try{_0x3500b1?console[_0x6a3d72(0x1eb)](_0x6a3d72(0x22c)+_0x34b3da+_0x6a3d72(0x22e)+_0x3500b1):console[_0x6a3d72(0x1eb)](_0x6a3d72(0x22c)+_0x34b3da+_0x6a3d72(0x219));console['log'](_0x6a3d72(0x225)+_0x15f9dd);const _0x1e166a=fileURLToPath(import.meta.url),_0x7d990a=a41_0x79bd0d[_0x6a3d72(0x227)](a41_0x79bd0d[_0x6a3d72(0x1fe)](_0x1e166a),_0x6a3d72(0x216)),_0x5a1468=a41_0x79bd0d[_0x6a3d72(0x228)](_0x7d990a,_0x6a3d72(0x1dc));let _0x4af519=_0x6a3d72(0x217);try{const _0x3e560f=JSON[_0x6a3d72(0x1e3)](a41_0x5b1801[_0x6a3d72(0x231)](_0x5a1468,_0x6a3d72(0x1ee)));_0x4af519=_0x3e560f[_0x6a3d72(0x1e1)]||_0x6a3d72(0x217);}catch(_0x1e8ef6){}const _0x467118=readConfig(),_0xfc18a3=typeof _0x467118[_0x6a3d72(0x20b)]===_0x6a3d72(0x20e)?_0x467118[_0x6a3d72(0x20b)]:undefined,{app:_0x257402,appcode:_0x5dd49a,..._0x47bde9}=_0x467118,_0x4f1df9={..._0x47bde9,'appcode':_0x3500b1||'','env':_0x2d0195||_0xfc18a3||_0x6a3d72(0x220),'createdAt':new Date()['toLocaleString'](),'version':_0x4af519};a41_0x5b1801['writeFileSync'](_0x15f9dd,JSON[_0x6a3d72(0x21b)](_0x4f1df9,null,0x2),_0x6a3d72(0x1ee)),_0x3500b1?console[_0x6a3d72(0x1eb)](_0x6a3d72(0x20a)+_0x3500b1):console[_0x6a3d72(0x1eb)](_0x6a3d72(0x1d8)),logger[_0x6a3d72(0x21a)](_0x6a3d72(0x1ed),_0x6a3d72(0x1d9)+_0x3500b1,{'projectName':_0x34b3da,'configFile':_0x6a3d72(0x1e8)});}catch(_0x4442e2){logger[_0x6a3d72(0x1fc)](_0x6a3d72(0x1ed),_0x6a3d72(0x1f9)+_0x3500b1,{'projectName':_0x34b3da,'error':_0x4442e2 instanceof Error?_0x4442e2['message']:String(_0x4442e2)});}};useEffect(()=>{const _0x3b1447=a41_0x30df;_0x27237b['projectCode']&&_0x425219(_0x27237b[_0x3b1447(0x1f5)]);},[_0x27237b[_0x3a93a5(0x1f5)]]);if(!_0x53104a&&!_0x205f8f&&!_0x27237b[_0x3a93a5(0x1f5)])return a41_0xc02386(EnhancedGuidedCreate,{'onCreate':_0x5800bf,'env':_0x27237b[_0x3a93a5(0x20b)]});if(_0x53104a)return a41_0x4312da(a41_0xa965e9,{'children':[a41_0x4312da(Box,{'marginTop':0x1,'children':[a41_0xc02386(Box,{'width':'1'}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'children':_0x3a93a5(0x1ef)}),a41_0xc02386(Text,{'children':'项目名称:\x20'}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'children':_0x2d3ecb?.['projectName']}),_0x2d3ecb?.[_0x3a93a5(0x1f4)]&&a41_0x4312da(a41_0xa965e9,{'children':[a41_0xc02386(Text,{'children':_0x3a93a5(0x1e6)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'children':_0x2d3ecb[_0x3a93a5(0x1f4)]})]})]}),a41_0xc02386(TaskRunning,{..._0x2da05b}),a41_0xc02386(TaskRunning,{..._0x5a80d9}),a41_0xc02386(TaskRunning,{..._0x36fe14})]});if(_0x205f8f)return a41_0x4312da(a41_0xa965e9,{'children':[a41_0x4312da(Box,{'marginTop':0x1,'children':[a41_0xc02386(Box,{'width':'1'}),a41_0xc02386(Text,{'color':'green','children':'\x20√\x20'}),a41_0xc02386(Text,{'children':_0x3a93a5(0x1dd)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'children':_0x2d3ecb?.[_0x3a93a5(0x214)]}),_0x2d3ecb?.[_0x3a93a5(0x1f4)]&&a41_0x4312da(a41_0xa965e9,{'children':[a41_0xc02386(Text,{'children':_0x3a93a5(0x1e6)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'children':_0x2d3ecb[_0x3a93a5(0x1f4)]})]})]}),a41_0xc02386(TaskFinished,{..._0x2da05b}),a41_0xc02386(TaskFinished,{..._0x5a80d9}),a41_0xc02386(TaskFinished,{..._0x36fe14}),a41_0xc02386(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'children':'─'[_0x3a93a5(0x206)](0x3c)})}),a41_0xc02386(Box,{'children':a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'bold':!![],'children':_0x3a93a5(0x1fa)})}),a41_0x4312da(Box,{'marginTop':0x1,'flexDirection':'column','children':[a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'children':_0x3a93a5(0x222)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x21c),'bold':!![],'children':_0x2d3ecb?.[_0x3a93a5(0x214)]})]}),_0x2d3ecb?.['appCode']&&a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'children':'🔗\x20应用AppCode:\x20'}),a41_0xc02386(Text,{'color':_0x3a93a5(0x21c),'bold':!![],'children':_0x2d3ecb[_0x3a93a5(0x1f4)]})]}),a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'children':'📦\x20API配置:\x20'}),_0x2d3ecb?.['pullApi']?a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'bold':!![],'children':'已自动拉取\x20✓'}):_0x2d3ecb?.[_0x3a93a5(0x1f4)]?a41_0xc02386(Text,{'color':_0x3a93a5(0x226),'bold':!![],'children':_0x3a93a5(0x235)}):a41_0xc02386(Text,{'color':_0x3a93a5(0x1e0),'bold':!![],'children':_0x3a93a5(0x236)})]})]}),a41_0xc02386(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'bold':!![],'children':_0x3a93a5(0x210)})}),a41_0x4312da(Box,{'marginLeft':0x2,'flexDirection':_0x3a93a5(0x1e5),'children':[a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'children':_0x3a93a5(0x207)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x21c),'children':'启动项目:\x20'}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'bold':!![],'children':_0x3a93a5(0x1df)+_0x2d3ecb?.[_0x3a93a5(0x214)]+'\x20&&\x20lovrabet\x20start'})]}),_0x2d3ecb?.[_0x3a93a5(0x1f4)]&&!_0x2d3ecb?.['pullApi']&&a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x226),'children':'2.\x20'}),a41_0xc02386(Text,{'color':_0x3a93a5(0x21c),'children':_0x3a93a5(0x1e7)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'bold':!![],'children':_0x3a93a5(0x239)})]}),!_0x2d3ecb?.[_0x3a93a5(0x1f4)]&&a41_0x4312da(a41_0xa965e9,{'children':[a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x1e0),'children':_0x3a93a5(0x21f)}),a41_0xc02386(Text,{'color':'white','children':_0x3a93a5(0x1f3)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'bold':!![],'children':_0x3a93a5(0x22a)})]}),a41_0x4312da(Box,{'children':[a41_0xc02386(Text,{'color':_0x3a93a5(0x1e0),'children':'3.\x20'}),a41_0xc02386(Text,{'color':_0x3a93a5(0x21c),'children':_0x3a93a5(0x1e7)}),a41_0xc02386(Text,{'color':_0x3a93a5(0x1de),'bold':!![],'children':_0x3a93a5(0x1e2)})]})]})]}),a41_0xc02386(Box,{'marginTop':0x1,'children':a41_0xc02386(Text,{'color':_0x3a93a5(0x1f1),'children':'─'[_0x3a93a5(0x206)](0x3c)})})]});return null;}
|
|
1
|
+
(function(_0x11e880,_0x1bb300){const _0x24b23e=a41_0x3873,_0x3a4243=_0x11e880();while(!![]){try{const _0x330d54=-parseInt(_0x24b23e(0x15a))/0x1+-parseInt(_0x24b23e(0x121))/0x2+-parseInt(_0x24b23e(0x146))/0x3*(-parseInt(_0x24b23e(0x135))/0x4)+-parseInt(_0x24b23e(0x147))/0x5+parseInt(_0x24b23e(0x16e))/0x6+parseInt(_0x24b23e(0x144))/0x7*(parseInt(_0x24b23e(0x177))/0x8)+parseInt(_0x24b23e(0x162))/0x9;if(_0x330d54===_0x1bb300)break;else _0x3a4243['push'](_0x3a4243['shift']());}catch(_0x50039a){_0x3a4243['push'](_0x3a4243['shift']());}}}(a41_0x1dfd,0x638ef));import{jsx as a41_0x30a03e,Fragment as a41_0x57e905,jsxs as a41_0x200a49}from'react/jsx-runtime';import a41_0xf60639 from'node:path';import a41_0x256ed9 from'node:fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';function a41_0x1dfd(){const _0x8c70f1=['lovrabet\x20api\x20pull\x20--appcode\x20[app-code]','🚀\x20接下来可以:','length','appCode','projectCode','已自动拉取\x20✓','cyan','×\x20项目名不能为空','\x20已存在,请使用其他项目名','white','574805xSQocM','doTask','972810ZFMnMZ','3178275kaLWFI','lovrabet\x20config\x20set\x20appcode\x20[app-code]','success','√\x20配置文件已创建,应用AppCode:\x20','readFileSync','parse','online','utf8','toLocaleString','\x20Generated\x20by\x20lovrabet\x20cli\x20','dirname','existsSync','1.\x20','version','拉取API配置:\x20','env','pullApi','resolve','1.0.0','810762PWnahO','2.\x20','!\x20API\x20配置拉取异常,项目已创建,可稍后手动执行:\x20lovrabet\x20api\x20pull','√\x20package.json\x20已更新:\x20name=','×\x20项目创建失败:\x20','配置应用AppCode:\x20','warn','cd\x20','10968147xWIbKt','\x20创建配置文件','.lovrabetrc','\x20配置应用AppCode:\x20','*\x20清理失败的项目目录:\x20','name','清理项目目录失败:\x20','setLogPath','📁\x20项目名称:\x20','yellow','项目名称:\x20','../..','811146bxSzFJ','trim','message','log','info','writeFileSync','未配置','string','cwd','8YdyOUR','更新\x20package.json\x20失败:\x20','join','green','error','\x20|\x20应用AppCode:\x20','stringify','constants','lovrabet\x20api\x20pull','460642kuOwuB','×\x20项目名包含非法字符,不允许使用:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20及控制字符','开始创建项目:\x20','description','配置应用AppCode失败:\x20','API\x20配置拉取失败:\x20','\x20√\x20','🎉\x20项目创建成功!','gray','√\x20配置文件已创建,可稍后使用\x20\x27lovrabet\x20config\x20set\x20appcode\x20<app-code>\x27\x20配置','启动项目:\x20','*\x20正在为项目\x20','create','×\x20项目名过长,最多支持\x20100\x20个字符','projectName','\x20&&\x20lovrabet\x20start','×\x20无法在当前目录创建项目,请检查目录权限','package.json','column','🔗\x20应用AppCode:\x20','8kqxpIr','×\x20项目目录\x20','API\x20配置拉取异常:\x20','accessSync','*\x20正在拉取\x20API\x20配置...'];a41_0x1dfd=function(){return _0x8c70f1;};return a41_0x1dfd();}function a41_0x3873(_0x4101b7,_0x350c23){_0x4101b7=_0x4101b7-0x11f;const _0x1dfd5c=a41_0x1dfd();let _0x3873df=_0x1dfd5c[_0x4101b7];return _0x3873df;}import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{pullApiSilent}from'../api/pull-silent.js';import{readConfig}from'../utils/config.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';export function CreateApp(_0x38addd){const _0x262bb9=a41_0x3873,[_0x310cea,_0x1d287a]=useState(![]),[_0x4aafe0,_0x5ea151]=useState(![]),[_0x367564,_0x21e607]=useState(null),_0x5d838e=useCopyProjectTemplate(),_0x35691b=useInstallDependencies(),_0x446100=useFormatCode(),_0x18603c=async _0x24f2f7=>{const _0x59b865=a41_0x3873;if(!_0x24f2f7['projectName']||_0x24f2f7[_0x59b865(0x12f)][_0x59b865(0x16f)]()===''){console['error'](_0x59b865(0x141));return;}const _0x4d282c=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x4d282c['test'](_0x24f2f7[_0x59b865(0x12f)])){console[_0x59b865(0x17b)](_0x59b865(0x122));return;}if(_0x24f2f7['projectName'][_0x59b865(0x13c)]>0x64){console[_0x59b865(0x17b)](_0x59b865(0x12e));return;}const _0x55006b=a41_0xf60639[_0x59b865(0x158)](process[_0x59b865(0x176)](),_0x24f2f7[_0x59b865(0x12f)]);if(a41_0x256ed9['existsSync'](_0x55006b)){console[_0x59b865(0x17b)](_0x59b865(0x136)+_0x24f2f7['projectName']+_0x59b865(0x142));return;}try{const _0x2dad25=a41_0xf60639[_0x59b865(0x151)](_0x55006b);a41_0x256ed9[_0x59b865(0x138)](_0x2dad25,a41_0x256ed9[_0x59b865(0x11f)]['W_OK']);}catch(_0xde19cf){console[_0x59b865(0x17b)](_0x59b865(0x131));return;}_0x21e607(_0x24f2f7),_0x1d287a(!![]),logger[_0x59b865(0x169)](_0x55006b),logger[_0x59b865(0x172)](_0x59b865(0x12d),_0x59b865(0x123)+_0x24f2f7['projectName'],{'projectDir':_0x55006b,'appCode':_0x24f2f7['appCode']});try{await _0x5d838e[_0x59b865(0x145)](_0x24f2f7['projectName']),await _0x4faa38(_0x24f2f7[_0x59b865(0x12f)]),await _0x35691b['doTask'](_0x24f2f7['projectName']),await _0x446100['doTask'](_0x24f2f7[_0x59b865(0x12f)]),await _0x4fc4cb(_0x24f2f7[_0x59b865(0x12f)],_0x24f2f7['appCode']||'',_0x24f2f7[_0x59b865(0x156)]);if(_0x24f2f7[_0x59b865(0x157)]&&_0x24f2f7[_0x59b865(0x13d)]){console['log'](_0x59b865(0x139));try{const _0x510168=await pullApiSilent(_0x24f2f7[_0x59b865(0x13d)],undefined,_0x55006b,_0x24f2f7[_0x59b865(0x156)]);_0x510168?(console[_0x59b865(0x171)]('√\x20API\x20配置拉取完成'),logger[_0x59b865(0x172)](_0x59b865(0x12d),'API\x20配置拉取成功:\x20'+_0x24f2f7['appCode'],{'projectDir':_0x55006b,'appCode':_0x24f2f7[_0x59b865(0x13d)],'env':_0x24f2f7[_0x59b865(0x156)]})):(console[_0x59b865(0x171)]('!\x20API\x20配置拉取失败,可稍后手动执行:\x20lovrabet\x20api\x20pull'),logger['warn'](_0x59b865(0x12d),_0x59b865(0x126)+_0x24f2f7[_0x59b865(0x13d)],{'projectDir':_0x55006b,'appCode':_0x24f2f7['appCode'],'env':_0x24f2f7[_0x59b865(0x156)]}));}catch(_0x219925){console[_0x59b865(0x171)](_0x59b865(0x15c)),logger[_0x59b865(0x160)](_0x59b865(0x12d),_0x59b865(0x137)+_0x24f2f7[_0x59b865(0x13d)],{'projectDir':_0x55006b,'appCode':_0x24f2f7[_0x59b865(0x13d)],'env':_0x24f2f7[_0x59b865(0x156)],'error':_0x219925 instanceof Error?_0x219925[_0x59b865(0x170)]:String(_0x219925)});}}logger[_0x59b865(0x149)](_0x59b865(0x12d),'项目创建完成:\x20'+_0x24f2f7['projectName']),_0x5ea151(!![]),_0x1d287a(![]);}catch(_0x189abe){logger[_0x59b865(0x17b)](_0x59b865(0x12d),'项目创建失败:\x20'+_0x24f2f7['projectName'],{'error':_0x189abe instanceof Error?_0x189abe[_0x59b865(0x170)]:String(_0x189abe)});try{a41_0x256ed9[_0x59b865(0x152)](_0x55006b)&&(console[_0x59b865(0x171)](_0x59b865(0x166)+_0x55006b),a41_0x256ed9['rmSync'](_0x55006b,{'recursive':!![],'force':!![]}));}catch(_0x568931){logger[_0x59b865(0x160)](_0x59b865(0x12d),_0x59b865(0x168)+_0x55006b,{'error':_0x568931 instanceof Error?_0x568931[_0x59b865(0x170)]:String(_0x568931)});}_0x1d287a(![]),console['error'](_0x59b865(0x15e)+(_0x189abe instanceof Error?_0x189abe[_0x59b865(0x170)]:String(_0x189abe)));}},_0x5ebcc6=async _0xb222a3=>{const _0x3227af=a41_0x3873;await _0x18603c({'projectName':_0xb222a3,'env':_0x38addd[_0x3227af(0x156)]});},_0x4faa38=async _0x63ef9d=>{const _0x4e35ce=a41_0x3873,_0x2b19fc=a41_0xf60639[_0x4e35ce(0x158)](process['cwd'](),_0x63ef9d),_0x39eefb=a41_0xf60639[_0x4e35ce(0x179)](_0x2b19fc,'package.json');try{console['log']('*\x20正在更新\x20package.json\x20的\x20name\x20和\x20description\x20字段');const _0x501110=fileURLToPath(import.meta.url),_0x5e391=a41_0xf60639[_0x4e35ce(0x158)](a41_0xf60639[_0x4e35ce(0x151)](_0x501110),'../..'),_0x47bf3a=a41_0xf60639[_0x4e35ce(0x179)](_0x5e391,'package.json');let _0x11a562=_0x4e35ce(0x159);try{const _0x4300ab=JSON[_0x4e35ce(0x14c)](a41_0x256ed9[_0x4e35ce(0x14b)](_0x47bf3a,_0x4e35ce(0x14e)));_0x11a562=_0x4300ab[_0x4e35ce(0x154)]||'1.0.0';}catch(_0x56b73e){}const _0x16537c=a41_0x256ed9[_0x4e35ce(0x14b)](_0x39eefb,_0x4e35ce(0x14e)),_0x4998bf=JSON['parse'](_0x16537c);_0x4998bf[_0x4e35ce(0x167)]=_0x63ef9d,_0x4998bf[_0x4e35ce(0x124)]=_0x63ef9d+_0x4e35ce(0x150)+_0x11a562,a41_0x256ed9[_0x4e35ce(0x173)](_0x39eefb,JSON[_0x4e35ce(0x17d)](_0x4998bf,null,0x2)+'\x0a',_0x4e35ce(0x14e)),console[_0x4e35ce(0x171)](_0x4e35ce(0x15d)+_0x63ef9d+',\x20description='+_0x4998bf[_0x4e35ce(0x124)]),logger[_0x4e35ce(0x172)]('create','更新\x20package.json\x20name\x20和\x20description\x20字段',{'projectName':_0x63ef9d,'description':_0x4998bf['description'],'cliVersion':_0x11a562,'packageJsonPath':_0x4e35ce(0x132)});}catch(_0x4d03a8){logger[_0x4e35ce(0x17b)](_0x4e35ce(0x12d),_0x4e35ce(0x178)+_0x63ef9d,{'projectName':_0x63ef9d,'error':_0x4d03a8 instanceof Error?_0x4d03a8['message']:String(_0x4d03a8)});throw _0x4d03a8;}},_0x4fc4cb=async(_0x3e35f8,_0x3a5e31,_0x3677f1)=>{const _0x4aeb76=a41_0x3873,_0x1ce710=a41_0xf60639[_0x4aeb76(0x158)](process[_0x4aeb76(0x176)](),_0x3e35f8),_0x533684=a41_0xf60639[_0x4aeb76(0x179)](_0x1ce710,_0x4aeb76(0x164));try{_0x3a5e31?console[_0x4aeb76(0x171)](_0x4aeb76(0x12c)+_0x3e35f8+_0x4aeb76(0x165)+_0x3a5e31):console[_0x4aeb76(0x171)](_0x4aeb76(0x12c)+_0x3e35f8+_0x4aeb76(0x163));console[_0x4aeb76(0x171)]('*\x20配置文件路径:\x20'+_0x533684);const _0x3fa9c9=fileURLToPath(import.meta.url),_0x18323a=a41_0xf60639[_0x4aeb76(0x158)](a41_0xf60639[_0x4aeb76(0x151)](_0x3fa9c9),_0x4aeb76(0x16d)),_0x3f46e6=a41_0xf60639['join'](_0x18323a,'package.json');let _0x5f5364='1.0.0';try{const _0x2c7474=JSON['parse'](a41_0x256ed9[_0x4aeb76(0x14b)](_0x3f46e6,'utf8'));_0x5f5364=_0x2c7474['version']||_0x4aeb76(0x159);}catch(_0x20a288){}const _0xf0485d=readConfig(),_0x2b1d6f=typeof _0xf0485d[_0x4aeb76(0x156)]===_0x4aeb76(0x175)?_0xf0485d[_0x4aeb76(0x156)]:undefined,{app:_0x2f5779,appcode:_0x4a6ecf,..._0x239a62}=_0xf0485d,_0x4b52ad={..._0x239a62,'appcode':_0x3a5e31||'','env':_0x3677f1||_0x2b1d6f||_0x4aeb76(0x14d),'createdAt':new Date()[_0x4aeb76(0x14f)](),'version':_0x5f5364};a41_0x256ed9['writeFileSync'](_0x533684,JSON['stringify'](_0x4b52ad,null,0x2),_0x4aeb76(0x14e)),_0x3a5e31?console[_0x4aeb76(0x171)](_0x4aeb76(0x14a)+_0x3a5e31):console[_0x4aeb76(0x171)](_0x4aeb76(0x12a)),logger[_0x4aeb76(0x172)]('create',_0x4aeb76(0x15f)+_0x3a5e31,{'projectName':_0x3e35f8,'configFile':_0x4aeb76(0x164)});}catch(_0x137c66){logger[_0x4aeb76(0x17b)]('create',_0x4aeb76(0x125)+_0x3a5e31,{'projectName':_0x3e35f8,'error':_0x137c66 instanceof Error?_0x137c66[_0x4aeb76(0x170)]:String(_0x137c66)});}};useEffect(()=>{const _0x822c8e=a41_0x3873;_0x38addd[_0x822c8e(0x13e)]&&_0x5ebcc6(_0x38addd[_0x822c8e(0x13e)]);},[_0x38addd['projectCode']]);if(!_0x310cea&&!_0x4aafe0&&!_0x38addd[_0x262bb9(0x13e)])return a41_0x30a03e(EnhancedGuidedCreate,{'onCreate':_0x18603c,'env':_0x38addd['env']});if(_0x310cea)return a41_0x200a49(a41_0x57e905,{'children':[a41_0x200a49(Box,{'marginTop':0x1,'children':[a41_0x30a03e(Box,{'width':'1'}),a41_0x30a03e(Text,{'color':_0x262bb9(0x17a),'children':_0x262bb9(0x127)}),a41_0x30a03e(Text,{'children':_0x262bb9(0x16c)}),a41_0x30a03e(Text,{'color':_0x262bb9(0x17a),'children':_0x367564?.['projectName']}),_0x367564?.[_0x262bb9(0x13d)]&&a41_0x200a49(a41_0x57e905,{'children':[a41_0x30a03e(Text,{'children':_0x262bb9(0x17c)}),a41_0x30a03e(Text,{'color':_0x262bb9(0x140),'children':_0x367564[_0x262bb9(0x13d)]})]})]}),a41_0x30a03e(TaskRunning,{..._0x5d838e}),a41_0x30a03e(TaskRunning,{..._0x35691b}),a41_0x30a03e(TaskRunning,{..._0x446100})]});if(_0x4aafe0)return a41_0x200a49(a41_0x57e905,{'children':[a41_0x200a49(Box,{'marginTop':0x1,'children':[a41_0x30a03e(Box,{'width':'1'}),a41_0x30a03e(Text,{'color':_0x262bb9(0x17a),'children':'\x20√\x20'}),a41_0x30a03e(Text,{'children':_0x262bb9(0x16c)}),a41_0x30a03e(Text,{'color':_0x262bb9(0x17a),'children':_0x367564?.[_0x262bb9(0x12f)]}),_0x367564?.[_0x262bb9(0x13d)]&&a41_0x200a49(a41_0x57e905,{'children':[a41_0x30a03e(Text,{'children':_0x262bb9(0x17c)}),a41_0x30a03e(Text,{'color':'cyan','children':_0x367564[_0x262bb9(0x13d)]})]})]}),a41_0x30a03e(TaskFinished,{..._0x5d838e}),a41_0x30a03e(TaskFinished,{..._0x35691b}),a41_0x30a03e(TaskFinished,{..._0x446100}),a41_0x30a03e(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0x30a03e(Text,{'color':_0x262bb9(0x17a),'children':'─'['repeat'](0x3c)})}),a41_0x30a03e(Box,{'children':a41_0x30a03e(Text,{'color':_0x262bb9(0x17a),'bold':!![],'children':_0x262bb9(0x128)})}),a41_0x200a49(Box,{'marginTop':0x1,'flexDirection':'column','children':[a41_0x200a49(Box,{'children':[a41_0x30a03e(Text,{'color':_0x262bb9(0x140),'children':_0x262bb9(0x16a)}),a41_0x30a03e(Text,{'color':'white','bold':!![],'children':_0x367564?.[_0x262bb9(0x12f)]})]}),_0x367564?.[_0x262bb9(0x13d)]&&a41_0x200a49(Box,{'children':[a41_0x30a03e(Text,{'color':_0x262bb9(0x140),'children':_0x262bb9(0x134)}),a41_0x30a03e(Text,{'color':_0x262bb9(0x143),'bold':!![],'children':_0x367564[_0x262bb9(0x13d)]})]}),a41_0x200a49(Box,{'children':[a41_0x30a03e(Text,{'color':_0x262bb9(0x140),'children':'📦\x20API配置:\x20'}),_0x367564?.[_0x262bb9(0x157)]?a41_0x30a03e(Text,{'color':_0x262bb9(0x17a),'bold':!![],'children':_0x262bb9(0x13f)}):_0x367564?.['appCode']?a41_0x30a03e(Text,{'color':_0x262bb9(0x16b),'bold':!![],'children':'需手动拉取'}):a41_0x30a03e(Text,{'color':'gray','bold':!![],'children':_0x262bb9(0x174)})]})]}),a41_0x30a03e(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a41_0x30a03e(Text,{'color':'cyan','bold':!![],'children':_0x262bb9(0x13b)})}),a41_0x200a49(Box,{'marginLeft':0x2,'flexDirection':_0x262bb9(0x133),'children':[a41_0x200a49(Box,{'children':[a41_0x30a03e(Text,{'color':'green','children':_0x262bb9(0x153)}),a41_0x30a03e(Text,{'color':'white','children':_0x262bb9(0x12b)}),a41_0x30a03e(Text,{'color':_0x262bb9(0x140),'bold':!![],'children':_0x262bb9(0x161)+_0x367564?.[_0x262bb9(0x12f)]+_0x262bb9(0x130)})]}),_0x367564?.[_0x262bb9(0x13d)]&&!_0x367564?.[_0x262bb9(0x157)]&&a41_0x200a49(Box,{'children':[a41_0x30a03e(Text,{'color':_0x262bb9(0x16b),'children':_0x262bb9(0x15b)}),a41_0x30a03e(Text,{'color':_0x262bb9(0x143),'children':_0x262bb9(0x155)}),a41_0x30a03e(Text,{'color':_0x262bb9(0x140),'bold':!![],'children':_0x262bb9(0x120)})]}),!_0x367564?.['appCode']&&a41_0x200a49(a41_0x57e905,{'children':[a41_0x200a49(Box,{'children':[a41_0x30a03e(Text,{'color':_0x262bb9(0x129),'children':_0x262bb9(0x15b)}),a41_0x30a03e(Text,{'color':_0x262bb9(0x143),'children':'配置AppCode:\x20'}),a41_0x30a03e(Text,{'color':_0x262bb9(0x140),'bold':!![],'children':_0x262bb9(0x148)})]}),a41_0x200a49(Box,{'children':[a41_0x30a03e(Text,{'color':_0x262bb9(0x129),'children':'3.\x20'}),a41_0x30a03e(Text,{'color':_0x262bb9(0x143),'children':'拉取API配置:\x20'}),a41_0x30a03e(Text,{'color':'cyan','bold':!![],'children':_0x262bb9(0x13a)})]})]})]}),a41_0x30a03e(Box,{'marginTop':0x1,'children':a41_0x30a03e(Text,{'color':_0x262bb9(0x17a),'children':'─'['repeat'](0x3c)})})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x25d749,_0x25eabf){var _0xb4c1ac=a42_0x6137,_0x42ce0a=_0x25d749();while(!![]){try{var _0x5d2bea=-parseInt(_0xb4c1ac(0x1d6))/0x1*(-parseInt(_0xb4c1ac(0x1cd))/0x2)+parseInt(_0xb4c1ac(0x1d4))/0x3+-parseInt(_0xb4c1ac(0x1d0))/0x4+parseInt(_0xb4c1ac(0x1d2))/0x5*(parseInt(_0xb4c1ac(0x1da))/0x6)+parseInt(_0xb4c1ac(0x1d8))/0x7+parseInt(_0xb4c1ac(0x1d3))/0x8*(-parseInt(_0xb4c1ac(0x1db))/0x9)+-parseInt(_0xb4c1ac(0x1d1))/0xa*(parseInt(_0xb4c1ac(0x1d7))/0xb);if(_0x5d2bea===_0x25eabf)break;else _0x42ce0a['push'](_0x42ce0a['shift']());}catch(_0x339783){_0x42ce0a['push'](_0x42ce0a['shift']());}}}(a42_0x1a40,0x1e5e8));import{jsx as a42_0x453b89,jsxs as a42_0xe2fd78}from'react/jsx-runtime';function a42_0x6137(_0x366718,_0x4766c5){_0x366718=_0x366718-0x1cd;var _0x1a40c0=a42_0x1a40();var _0x613706=_0x1a40c0[_0x366718];return _0x613706;}import{Box,Text}from'ink';function a42_0x1a40(){var _0x3f3662=['taskName','\x20√\x20','778104lkHccn','24050VOpaUM','2260fgahcN','56qFYGcW','301962FyGKLx','green','29510eqDKKm','506FQrQTi','1391047SPzsQj','elapsed','360lIeQjX','19269XWCRTQ','8JqguyO'];a42_0x1a40=function(){return _0x3f3662;};return a42_0x1a40();}import{TaskTime}from'./task-time.js';export function TaskFinished(_0x1eaa75){var _0x5cc263=a42_0x6137;return a42_0xe2fd78(Box,{'children':[a42_0x453b89(Box,{'width':'1'}),a42_0x453b89(Text,{'color':_0x5cc263(0x1d5),'children':_0x5cc263(0x1cf)}),a42_0x453b89(Text,{'children':_0x1eaa75[_0x5cc263(0x1ce)]}),a42_0x453b89(TaskTime,{'elapsed':_0x1eaa75[_0x5cc263(0x1d9)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x48fdde,_0x1b4493){var _0x38c2d4=a43_0x1b0f,_0x28d0c6=_0x48fdde();while(!![]){try{var _0x325216=parseInt(_0x38c2d4(0xc0))/0x1+parseInt(_0x38c2d4(0xbf))/0x2*(parseInt(_0x38c2d4(0xb9))/0x3)+parseInt(_0x38c2d4(0xc1))/0x4+parseInt(_0x38c2d4(0xbc))/0x5+parseInt(_0x38c2d4(0xbd))/0x6*(parseInt(_0x38c2d4(0xb7))/0x7)+-parseInt(_0x38c2d4(0xba))/0x8+-parseInt(_0x38c2d4(0xc2))/0x9;if(_0x325216===_0x1b4493)break;else _0x28d0c6['push'](_0x28d0c6['shift']());}catch(_0x12955e){_0x28d0c6['push'](_0x28d0c6['shift']());}}}(a43_0x313f,0x6ff90));function a43_0x1b0f(_0x3c7711,_0x3d9a59){_0x3c7711=_0x3c7711-0xb6;var _0x313fe4=a43_0x313f();var _0x1b0f2f=_0x313fe4[_0x3c7711];return _0x1b0f2f;}import{jsx as a43_0x1413c5,jsxs as a43_0x4bccd3}from'react/jsx-runtime';import{Text}from'ink';function a43_0x313f(){var _0x22a222=['green','45HxPiGZ','2856480GlEfWA','dots','680310xwIdrx','12YbKLyf','finished','120634rwwLtj','754985wOURZp','1511716beJrfx','19085643cvNVPW','loading','2669086ljkDDS'];a43_0x313f=function(){return _0x22a222;};return a43_0x313f();}import a43_0x5311f9 from'ink-spinner';export function TaskLoading(_0x49df93){var _0x54e32e=a43_0x1b0f;if(_0x49df93[_0x54e32e(0xbe)])return a43_0x1413c5(Text,{'color':_0x54e32e(0xb8),'children':'\x20√\x20'});if(_0x49df93[_0x54e32e(0xb6)])return a43_0x4bccd3(Text,{'color':'green','children':['\x20',a43_0x1413c5(a43_0x5311f9,{'type':_0x54e32e(0xbb)}),'\x20']});return a43_0x1413c5(Text,{'children':'\x20\x20\x20'});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a44_0x3cdf(_0x1692b0,_0x35f3e5){_0x1692b0=_0x1692b0-0x110;var _0x4ccee9=a44_0x4cce();var _0x3cdff7=_0x4ccee9[_0x1692b0];return _0x3cdff7;}(function(_0x93a208,_0x44e00d){var _0x10d35f=a44_0x3cdf,_0x3ecc34=_0x93a208();while(!![]){try{var _0x1132d9=-parseInt(_0x10d35f(0x112))/0x1+-parseInt(_0x10d35f(0x116))/0x2+-parseInt(_0x10d35f(0x113))/0x3*(-parseInt(_0x10d35f(0x119))/0x4)+parseInt(_0x10d35f(0x111))/0x5*(-parseInt(_0x10d35f(0x115))/0x6)+parseInt(_0x10d35f(0x118))/0x7*(-parseInt(_0x10d35f(0x11b))/0x8)+parseInt(_0x10d35f(0x114))/0x9*(parseInt(_0x10d35f(0x11a))/0xa)+parseInt(_0x10d35f(0x117))/0xb*(parseInt(_0x10d35f(0x110))/0xc);if(_0x1132d9===_0x44e00d)break;else _0x3ecc34['push'](_0x3ecc34['shift']());}catch(_0x1ad735){_0x3ecc34['push'](_0x3ecc34['shift']());}}}(a44_0x4cce,0x8052b));import{jsx as a44_0x4f20ba,jsxs as a44_0x5a0522}from'react/jsx-runtime';function a44_0x4cce(){var _0x49db92=['232QEeCvT','12NAgjoR','20VFNUGx','835731NjsGLY','24syRLNq','2079IcURNT','208788tgEJNn','1011376GfZEzk','16493235eGLQMt','6181sBdGyT','225104BbtnNB','3560MyRASe'];a44_0x4cce=function(){return _0x49db92;};return a44_0x4cce();}import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x2600df){return a44_0x5a0522(Box,{'children':[a44_0x4f20ba(Box,{'width':'1'}),a44_0x4f20ba(TaskLoading,{..._0x2600df}),a44_0x4f20ba(Text,{'children':_0x2600df['taskName']}),a44_0x4f20ba(TaskTime,{'elapsed':_0x2600df['elapsed']})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x146ea7,_0x114cb4){var _0x650673=a45_0x4812,_0x28dee5=_0x146ea7();while(!![]){try{var _0x5cdbbb=-parseInt(_0x650673(0xc2))/0x1*(parseInt(_0x650673(0xcc))/0x2)+parseInt(_0x650673(0xc3))/0x3+-parseInt(_0x650673(0xca))/0x4*(parseInt(_0x650673(0xcf))/0x5)+-parseInt(_0x650673(0xc7))/0x6*(-parseInt(_0x650673(0xce))/0x7)+parseInt(_0x650673(0xc4))/0x8*(-parseInt(_0x650673(0xc1))/0x9)+-parseInt(_0x650673(0xcd))/0xa*(parseInt(_0x650673(0xc8))/0xb)+-parseInt(_0x650673(0xc5))/0xc*(-parseInt(_0x650673(0xc6))/0xd);if(_0x5cdbbb===_0x114cb4)break;else _0x28dee5['push'](_0x28dee5['shift']());}catch(_0x150b30){_0x28dee5['push'](_0x28dee5['shift']());}}}(a45_0x5dda,0x84ba8));function a45_0x4812(_0x1321d0,_0x58ea81){_0x1321d0=_0x1321d0-0xc1;var _0x5ddadd=a45_0x5dda();var _0x481270=_0x5ddadd[_0x1321d0];return _0x481270;}import{jsx as a45_0x5965cc,Fragment as a45_0x357ed7,jsxs as a45_0x157142}from'react/jsx-runtime';import{Text}from'ink';function a45_0x5dda(){var _0x5a6c60=['279504unDIXB','108mchuad','1723839ENRnbV','83802GBFOLm','11WvNSce','gray','394276IZNgyz','elapsed','128lXVpXS','5200450qyyGjs','301Fpapek','25TLpxEg','45RDEFFV','7383aGWuHS','1229220cfSzpR'];a45_0x5dda=function(){return _0x5a6c60;};return a45_0x5dda();}export function TaskTime(_0x41211c){var _0x5b19ca=a45_0x4812;if(_0x41211c[_0x5b19ca(0xcb)])return a45_0x157142(a45_0x357ed7,{'children':[a45_0x5965cc(Text,{'color':_0x5b19ca(0xc9),'children':'\x20['}),a45_0x5965cc(Text,{'color':_0x5b19ca(0xc9),'bold':!![],'children':_0x41211c['elapsed']}),a45_0x5965cc(Text,{'color':_0x5b19ca(0xc9),'children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x2270c1=a46_0x57c2;(function(_0xea891d,_0x407bcd){const _0x3b305d=a46_0x57c2,_0x38271b=_0xea891d();while(!![]){try{const _0x1c2668=-parseInt(_0x3b305d(0x72))/0x1*(-parseInt(_0x3b305d(0x65))/0x2)+parseInt(_0x3b305d(0x66))/0x3+-parseInt(_0x3b305d(0x78))/0x4*(parseInt(_0x3b305d(0x69))/0x5)+parseInt(_0x3b305d(0x6e))/0x6*(parseInt(_0x3b305d(0x75))/0x7)+-parseInt(_0x3b305d(0x6f))/0x8*(-parseInt(_0x3b305d(0x76))/0x9)+-parseInt(_0x3b305d(0x6c))/0xa+-parseInt(_0x3b305d(0x68))/0xb*(parseInt(_0x3b305d(0x67))/0xc);if(_0x1c2668===_0x407bcd)break;else _0x38271b['push'](_0x38271b['shift']());}catch(_0x144eff){_0x38271b['push'](_0x38271b['shift']());}}}(a46_0xda6b,0x694d1));import a46_0x1cbd2d 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';function a46_0x57c2(_0x2adff4,_0x5b4368){_0x2adff4=_0x2adff4-0x64;const _0xda6b94=a46_0xda6b();let _0x57c2ec=_0xda6b94[_0x2adff4];return _0x57c2ec;}import{logger}from'../utils/logger.js';const __dirname=a46_0x1cbd2d[a46_0x2270c1(0x6b)](fileURLToPath(import.meta.url)),templateDir=a46_0x1cbd2d[a46_0x2270c1(0x77)](__dirname,'../../templates/projects/sub-app-react-demo');export function useCopyProjectTemplate(){const _0x1c600d=a46_0x2270c1,[_0x1e3ec4,_0xe0a6ab]=useState(![]),[_0x4e0130,_0x27a6d9]=useState(![]),[_0x7026ec,_0x2ac3de]=useState(''),_0x5eec6b=useCallback(async _0x102bdd=>{const _0x25f92c=a46_0x57c2,_0x34232b=Date[_0x25f92c(0x6a)](),_0x7c2304=a46_0x1cbd2d['resolve'](process[_0x25f92c(0x71)](),_0x102bdd);_0xe0a6ab(!![]);try{logger[_0x25f92c(0x70)](_0x25f92c(0x79),'开始复制项目模板',{'projectCode':_0x102bdd,'templateDir':templateDir}),await copyDirectory(templateDir,_0x7c2304);const _0x4aaeab=Date[_0x25f92c(0x6a)]()-_0x34232b;logger[_0x25f92c(0x74)](_0x25f92c(0x79),_0x25f92c(0x73),_0x4aaeab,{'projectCode':_0x102bdd});}catch(_0x56304d){const _0x4bf26f=Date['now']()-_0x34232b;logger[_0x25f92c(0x64)](_0x25f92c(0x79),_0x25f92c(0x7a),{'projectCode':_0x102bdd,'error':_0x56304d instanceof Error?_0x56304d['message']:String(_0x56304d),'duration':_0x4bf26f});throw _0x56304d;}finally{_0xe0a6ab(![]),_0x27a6d9(!![]),_0x2ac3de(formatElapsed(_0x34232b));}},[]);return{'taskName':_0x1c600d(0x6d),'finished':_0x4e0130,'loading':_0x1e3ec4,'elapsed':_0x7026ec,'doTask':_0x5eec6b};}function a46_0xda6b(){const _0x2d6376=['5139ZVsTnz','resolve','284vJfith','copy','项目模板复制失败','error','2mpVloe','1685385UWbGiB','24aOPlMz','5370541Xyvykz','35765QFoCca','now','dirname','2216290cWXbAt','复制项目文件','2550162fQxBma','328Iaylhs','info','cwd','702007MffJco','项目模板复制完成','success','14lHGYbB'];a46_0xda6b=function(){return _0x2d6376;};return a46_0xda6b();}
|