@lovrabet/cli 1.1.8 → 1.1.10

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.
Files changed (50) hide show
  1. package/README.md +51 -0
  2. package/lib/add-page/input-page-router.js +1 -1
  3. package/lib/add-page/main.js +1 -1
  4. package/lib/add-page/select-page-template.js +1 -1
  5. package/lib/api/api-doc-ui.js +1 -0
  6. package/lib/api/api-doc.js +1 -0
  7. package/lib/api/api-pull-ui.js +1 -1
  8. package/lib/api/fetch-datasets.js +1 -0
  9. package/lib/api/format-dataset.js +1 -1
  10. package/lib/api/generate-api-file.js +1 -1
  11. package/lib/api/main.js +1 -1
  12. package/lib/api/pull-silent.js +1 -1
  13. package/lib/api/pull.js +1 -1
  14. package/lib/auth/auth-server-ui.js +1 -1
  15. package/lib/auth/auth-server.js +1 -1
  16. package/lib/auth/constant.js +1 -1
  17. package/lib/auth/get-cookie.js +1 -1
  18. package/lib/auth/is-session-valid.js +1 -1
  19. package/lib/auth/logout.js +1 -1
  20. package/lib/cli.js +1 -1
  21. package/lib/cmd/build-watch.js +1 -1
  22. package/lib/cmd/build.js +1 -1
  23. package/lib/cmd/logs.js +1 -1
  24. package/lib/cmd/preview.js +1 -1
  25. package/lib/cmd/start.js +1 -1
  26. package/lib/config/config-help.js +1 -1
  27. package/lib/config/main.js +1 -1
  28. package/lib/constant/domain.js +1 -1
  29. package/lib/constant/env.js +1 -1
  30. package/lib/create-app/enhanced-guided-create.js +1 -1
  31. package/lib/create-app/format-elapsed.js +1 -1
  32. package/lib/create-app/main.js +1 -1
  33. package/lib/create-app/task-finished.js +1 -1
  34. package/lib/create-app/task-loading.js +1 -1
  35. package/lib/create-app/task-running.js +1 -1
  36. package/lib/create-app/task-time.js +1 -1
  37. package/lib/create-app/use-copy-project-template.js +1 -1
  38. package/lib/create-app/use-format-code.js +1 -1
  39. package/lib/create-app/use-install-dependencies.js +1 -1
  40. package/lib/help.js +1 -1
  41. package/lib/utils/config.js +1 -1
  42. package/lib/utils/copy-directory.js +1 -1
  43. package/lib/utils/http-client.js +1 -1
  44. package/lib/utils/logger.js +1 -1
  45. package/lib/utils/router-updater.js +1 -1
  46. package/lib/utils/template-replacer.js +1 -1
  47. package/package.json +1 -1
  48. package/templates/pages/sdk-fetch/index.tsx.tpl +41 -52
  49. package/templates/projects/sub-app-react-demo/package-lock.json +4 -4
  50. package/templates/projects/sub-app-react-demo/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x2d1acf,_0x103600){var _0x13e05c=a30_0x2842,_0x18315c=_0x2d1acf();while(!![]){try{var _0x3251d4=parseInt(_0x13e05c(0xc2))/0x1+parseInt(_0x13e05c(0xba))/0x2+parseInt(_0x13e05c(0xc3))/0x3+-parseInt(_0x13e05c(0xc0))/0x4*(-parseInt(_0x13e05c(0xb8))/0x5)+parseInt(_0x13e05c(0xb6))/0x6*(parseInt(_0x13e05c(0xb7))/0x7)+-parseInt(_0x13e05c(0xbe))/0x8*(parseInt(_0x13e05c(0xc5))/0x9)+parseInt(_0x13e05c(0xc4))/0xa*(-parseInt(_0x13e05c(0xbf))/0xb);if(_0x3251d4===_0x103600)break;else _0x18315c['push'](_0x18315c['shift']());}catch(_0x50d874){_0x18315c['push'](_0x18315c['shift']());}}}(a30_0x58bc,0xdbd70));import{jsx as a30_0x4ab563,jsxs as a30_0x2409a5}from'react/jsx-runtime';function a30_0x58bc(){var _0x5317c6=['dots','72CeJqfL','137621gARajI','78212rIYFGm','\x20\x20\x20','86860VZjIeM','4295511cEGIEe','1030klUCNK','1516329jNvhPE','4638CTPpdt','511QhpqCz','225OFcVLE','green','2500830NTNFLr','loading','finished'];a30_0x58bc=function(){return _0x5317c6;};return a30_0x58bc();}import{Text}from'ink';import a30_0x18183d from'ink-spinner';function a30_0x2842(_0x3b2b4a,_0x5730a5){var _0x58bcad=a30_0x58bc();return a30_0x2842=function(_0x2842ae,_0x11f5bc){_0x2842ae=_0x2842ae-0xb6;var _0x5354f4=_0x58bcad[_0x2842ae];return _0x5354f4;},a30_0x2842(_0x3b2b4a,_0x5730a5);}export function TaskLoading(_0x249dac){var _0x1c1204=a30_0x2842;if(_0x249dac[_0x1c1204(0xbc)])return a30_0x4ab563(Text,{'color':_0x1c1204(0xb9),'children':'\x20√\x20'});if(_0x249dac[_0x1c1204(0xbb)])return a30_0x2409a5(Text,{'color':_0x1c1204(0xb9),'children':['\x20',a30_0x4ab563(a30_0x18183d,{'type':_0x1c1204(0xbd)}),'\x20']});return a30_0x4ab563(Text,{'children':_0x1c1204(0xc1)});}
1
+ (function(_0x390965,_0x436c14){var _0x28f674=a33_0x3dd1,_0x3c2ba4=_0x390965();while(!![]){try{var _0x59decc=-parseInt(_0x28f674(0xbe))/0x1+parseInt(_0x28f674(0xc8))/0x2+-parseInt(_0x28f674(0xbf))/0x3*(parseInt(_0x28f674(0xc9))/0x4)+-parseInt(_0x28f674(0xc0))/0x5*(parseInt(_0x28f674(0xc2))/0x6)+-parseInt(_0x28f674(0xc1))/0x7+-parseInt(_0x28f674(0xc5))/0x8*(-parseInt(_0x28f674(0xc6))/0x9)+parseInt(_0x28f674(0xc4))/0xa;if(_0x59decc===_0x436c14)break;else _0x3c2ba4['push'](_0x3c2ba4['shift']());}catch(_0x30c9c5){_0x3c2ba4['push'](_0x3c2ba4['shift']());}}}(a33_0x5af1,0xa5842));function a33_0x3dd1(_0x21f093,_0x496bea){var _0x5af17a=a33_0x5af1();return a33_0x3dd1=function(_0x3dd185,_0x6a7f7){_0x3dd185=_0x3dd185-0xbc;var _0x3e5f62=_0x5af17a[_0x3dd185];return _0x3e5f62;},a33_0x3dd1(_0x21f093,_0x496bea);}import{jsx as a33_0x135110,jsxs as a33_0x61ed8b}from'react/jsx-runtime';import{Text}from'ink';import a33_0x141fdc from'ink-spinner';export function TaskLoading(_0x4da383){var _0x583929=a33_0x3dd1;if(_0x4da383[_0x583929(0xbd)])return a33_0x135110(Text,{'color':_0x583929(0xca),'children':'\x20√\x20'});if(_0x4da383[_0x583929(0xbc)])return a33_0x61ed8b(Text,{'color':_0x583929(0xca),'children':['\x20',a33_0x135110(a33_0x141fdc,{'type':_0x583929(0xc7)}),'\x20']});return a33_0x135110(Text,{'children':_0x583929(0xc3)});}function a33_0x5af1(){var _0x51995d=['dots','1048870YoTZhJ','731772ViPkob','green','loading','finished','805379wDgWBI','9ZGJwQu','635FsQpYc','6409340rHQFIt','59676YRDtio','\x20\x20\x20','26647450NAhbrh','1216Gtpefs','60498hkBrNp'];a33_0x5af1=function(){return _0x51995d;};return a33_0x5af1();}
@@ -1 +1 @@
1
- function a31_0x7fe6(_0x481d01,_0x5d7899){var _0x6b221f=a31_0x6b22();return a31_0x7fe6=function(_0x7fe6c6,_0x336564){_0x7fe6c6=_0x7fe6c6-0xf7;var _0x1d8746=_0x6b221f[_0x7fe6c6];return _0x1d8746;},a31_0x7fe6(_0x481d01,_0x5d7899);}(function(_0x3b44df,_0x58f35b){var _0x3dc317=a31_0x7fe6,_0x324280=_0x3b44df();while(!![]){try{var _0x4ca32a=parseInt(_0x3dc317(0x100))/0x1+parseInt(_0x3dc317(0x101))/0x2*(parseInt(_0x3dc317(0xf9))/0x3)+-parseInt(_0x3dc317(0xfd))/0x4+parseInt(_0x3dc317(0xf8))/0x5*(-parseInt(_0x3dc317(0xfc))/0x6)+-parseInt(_0x3dc317(0xfb))/0x7*(-parseInt(_0x3dc317(0xf7))/0x8)+-parseInt(_0x3dc317(0xfe))/0x9+parseInt(_0x3dc317(0xff))/0xa;if(_0x4ca32a===_0x58f35b)break;else _0x324280['push'](_0x324280['shift']());}catch(_0x37cd1c){_0x324280['push'](_0x324280['shift']());}}}(a31_0x6b22,0xe7881));import{jsx as a31_0x4be461,jsxs as a31_0x24eedf}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';function a31_0x6b22(){var _0x435494=['19406510JlzYlY','601788AiQbpu','38046caoHiz','32wAKrKP','15zPDnvI','123ABWIlM','elapsed','1735622QqncvR','981126sHaiji','4442788nQCaoC','15880977BrRUfC'];a31_0x6b22=function(){return _0x435494;};return a31_0x6b22();}import{TaskTime}from'./task-time.js';export function TaskRunning(_0x36e265){var _0x3bc01d=a31_0x7fe6;return a31_0x24eedf(Box,{'children':[a31_0x4be461(Box,{'width':'1'}),a31_0x4be461(TaskLoading,{..._0x36e265}),a31_0x4be461(Text,{'children':_0x36e265['taskName']}),a31_0x4be461(TaskTime,{'elapsed':_0x36e265[_0x3bc01d(0xfa)]})]});}
1
+ (function(_0x55060e,_0x3be511){var _0x1e58fa=a34_0x37a0,_0x357143=_0x55060e();while(!![]){try{var _0x39c922=parseInt(_0x1e58fa(0xf8))/0x1*(parseInt(_0x1e58fa(0xf5))/0x2)+parseInt(_0x1e58fa(0xf6))/0x3*(parseInt(_0x1e58fa(0xfa))/0x4)+-parseInt(_0x1e58fa(0xf4))/0x5*(parseInt(_0x1e58fa(0xfc))/0x6)+parseInt(_0x1e58fa(0xf9))/0x7*(parseInt(_0x1e58fa(0x100))/0x8)+-parseInt(_0x1e58fa(0xff))/0x9*(-parseInt(_0x1e58fa(0xfd))/0xa)+parseInt(_0x1e58fa(0xf7))/0xb+-parseInt(_0x1e58fa(0xfb))/0xc;if(_0x39c922===_0x3be511)break;else _0x357143['push'](_0x357143['shift']());}catch(_0x4b0071){_0x357143['push'](_0x357143['shift']());}}}(a34_0x927b,0x94f44));import{jsx as a34_0x4ad39b,jsxs as a34_0x569fb6}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x2e09ea){var _0x5958bf=a34_0x37a0;return a34_0x569fb6(Box,{'children':[a34_0x4ad39b(Box,{'width':'1'}),a34_0x4ad39b(TaskLoading,{..._0x2e09ea}),a34_0x4ad39b(Text,{'children':_0x2e09ea[_0x5958bf(0xfe)]}),a34_0x4ad39b(TaskTime,{'elapsed':_0x2e09ea['elapsed']})]});}function a34_0x37a0(_0x254d18,_0x4b604c){var _0x927b71=a34_0x927b();return a34_0x37a0=function(_0x37a072,_0x5c172d){_0x37a072=_0x37a072-0xf4;var _0x359ce4=_0x927b71[_0x37a072];return _0x359ce4;},a34_0x37a0(_0x254d18,_0x4b604c);}function a34_0x927b(){var _0x5149b3=['15991440VrmpmV','18fYzrCj','1440QgDUei','taskName','26028WKRBGC','7688phMyRn','1655390cvkPMU','402RJIuun','31209zIVOhp','7582553XeFeVj','2987djUOHO','168WmAaQi','464yxnGkr'];a34_0x927b=function(){return _0x5149b3;};return a34_0x927b();}
@@ -1 +1 @@
1
- (function(_0x1a6715,_0x32c511){var _0x157924=a32_0x4293,_0x3a8324=_0x1a6715();while(!![]){try{var _0x391675=-parseInt(_0x157924(0x16e))/0x1+parseInt(_0x157924(0x16a))/0x2+-parseInt(_0x157924(0x162))/0x3*(-parseInt(_0x157924(0x163))/0x4)+-parseInt(_0x157924(0x166))/0x5*(-parseInt(_0x157924(0x165))/0x6)+-parseInt(_0x157924(0x16f))/0x7*(parseInt(_0x157924(0x164))/0x8)+parseInt(_0x157924(0x16c))/0x9*(parseInt(_0x157924(0x16b))/0xa)+-parseInt(_0x157924(0x168))/0xb*(parseInt(_0x157924(0x169))/0xc);if(_0x391675===_0x32c511)break;else _0x3a8324['push'](_0x3a8324['shift']());}catch(_0x27abd6){_0x3a8324['push'](_0x3a8324['shift']());}}}(a32_0x1b61,0x31b6d));import{jsx as a32_0x373f03,Fragment as a32_0x5e617f,jsxs as a32_0x229be1}from'react/jsx-runtime';import{Text}from'ink';function a32_0x4293(_0x128833,_0x562b80){var _0x1b616c=a32_0x1b61();return a32_0x4293=function(_0x42935e,_0x194d42){_0x42935e=_0x42935e-0x162;var _0x5a1596=_0x1b616c[_0x42935e];return _0x5a1596;},a32_0x4293(_0x128833,_0x562b80);}function a32_0x1b61(){var _0x247821=['520390rQdtQF','511430AfBQgn','9KJwMQp','elapsed','129069epJGDd','1241989MdxFoX','585MfQkha','1436PYomqv','8lUrvZw','13254PQvkuh','655HXdUlC','gray','11mZGbwS','1927164VQtLKK'];a32_0x1b61=function(){return _0x247821;};return a32_0x1b61();}export function TaskTime(_0xae9350){var _0x3cb7d3=a32_0x4293;if(_0xae9350[_0x3cb7d3(0x16d)])return a32_0x229be1(a32_0x5e617f,{'children':[a32_0x373f03(Text,{'color':_0x3cb7d3(0x167),'children':'\x20['}),a32_0x373f03(Text,{'color':_0x3cb7d3(0x167),'bold':!![],'children':_0xae9350['elapsed']}),a32_0x373f03(Text,{'color':_0x3cb7d3(0x167),'children':']'})]});return null;}
1
+ (function(_0x580ba9,_0x19c7f7){var _0x2d2007=a35_0x5977,_0x28a692=_0x580ba9();while(!![]){try{var _0x53eecc=parseInt(_0x2d2007(0x1e8))/0x1*(-parseInt(_0x2d2007(0x1f0))/0x2)+parseInt(_0x2d2007(0x1e7))/0x3*(-parseInt(_0x2d2007(0x1e6))/0x4)+parseInt(_0x2d2007(0x1ec))/0x5*(parseInt(_0x2d2007(0x1e4))/0x6)+-parseInt(_0x2d2007(0x1eb))/0x7*(-parseInt(_0x2d2007(0x1e3))/0x8)+parseInt(_0x2d2007(0x1ed))/0x9*(parseInt(_0x2d2007(0x1ef))/0xa)+-parseInt(_0x2d2007(0x1e2))/0xb+parseInt(_0x2d2007(0x1ea))/0xc*(-parseInt(_0x2d2007(0x1ee))/0xd);if(_0x53eecc===_0x19c7f7)break;else _0x28a692['push'](_0x28a692['shift']());}catch(_0x42a7f0){_0x28a692['push'](_0x28a692['shift']());}}}(a35_0x4764,0x48b8e));function a35_0x5977(_0x185b9d,_0x5716ea){var _0x476490=a35_0x4764();return a35_0x5977=function(_0x597739,_0x12cd54){_0x597739=_0x597739-0x1e2;var _0x417d11=_0x476490[_0x597739];return _0x417d11;},a35_0x5977(_0x185b9d,_0x5716ea);}import{jsx as a35_0x2d6a62,Fragment as a35_0x3e36b9,jsxs as a35_0x3c8b1e}from'react/jsx-runtime';import{Text}from'ink';function a35_0x4764(){var _0x1af8a9=['10WSjoLJ','168356JZwSxe','3785441EFuhto','24Fpqfhe','6204FOWknx','elapsed','43496HLnizS','6QloGlv','2bwbAAd','gray','175632IUpuHi','1180403tzFlUy','845mhgdKs','2153592nkVQyS','78BJHQwb'];a35_0x4764=function(){return _0x1af8a9;};return a35_0x4764();}export function TaskTime(_0x14bb92){var _0x2fa59d=a35_0x5977;if(_0x14bb92[_0x2fa59d(0x1e5)])return a35_0x3c8b1e(a35_0x3e36b9,{'children':[a35_0x2d6a62(Text,{'color':_0x2fa59d(0x1e9),'children':'\x20['}),a35_0x2d6a62(Text,{'color':_0x2fa59d(0x1e9),'bold':!![],'children':_0x14bb92[_0x2fa59d(0x1e5)]}),a35_0x2d6a62(Text,{'color':_0x2fa59d(0x1e9),'children':']'})]});return null;}
@@ -1 +1 @@
1
- function a33_0x3315(_0x568c30,_0x3cbaa5){const _0x4b6eb2=a33_0x4b6e();return a33_0x3315=function(_0x3315fb,_0x1cd3a0){_0x3315fb=_0x3315fb-0xa4;let _0x27b9eb=_0x4b6eb2[_0x3315fb];return _0x27b9eb;},a33_0x3315(_0x568c30,_0x3cbaa5);}const a33_0x45e4ac=a33_0x3315;(function(_0x1a1a0e,_0x4dcfb9){const _0x57984a=a33_0x3315,_0x5b3202=_0x1a1a0e();while(!![]){try{const _0x1bf54d=parseInt(_0x57984a(0xa5))/0x1*(parseInt(_0x57984a(0xb3))/0x2)+parseInt(_0x57984a(0xb7))/0x3+parseInt(_0x57984a(0xb5))/0x4*(-parseInt(_0x57984a(0xa9))/0x5)+-parseInt(_0x57984a(0xa4))/0x6+parseInt(_0x57984a(0xa6))/0x7*(-parseInt(_0x57984a(0xb6))/0x8)+parseInt(_0x57984a(0xa8))/0x9*(parseInt(_0x57984a(0xb8))/0xa)+-parseInt(_0x57984a(0xb0))/0xb*(parseInt(_0x57984a(0xb1))/0xc);if(_0x1bf54d===_0x4dcfb9)break;else _0x5b3202['push'](_0x5b3202['shift']());}catch(_0x162837){_0x5b3202['push'](_0x5b3202['shift']());}}}(a33_0x4b6e,0xa7754));import a33_0xa1efc5 from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a33_0x4b6e(){const _0x24a706=['1006098lrZFFO','589957nGQCzl','1411627dXVSRM','info','702414QYgJMg','50NCFLEw','resolve','error','dirname','开始复制项目模板','copy','复制项目文件','14729qJvfdd','6168GwAmno','项目模板复制完成','4IsHujT','success','544340fhjwUZ','32CGRQTC','3607905COcnTa','170PpEoLC','now','url'];a33_0x4b6e=function(){return _0x24a706;};return a33_0x4b6e();}const __dirname=a33_0xa1efc5[a33_0x45e4ac(0xac)](fileURLToPath(import.meta[a33_0x45e4ac(0xba)])),templateDir=a33_0xa1efc5[a33_0x45e4ac(0xaa)](__dirname,'../../templates/projects/sub-app-react-demo');export function useCopyProjectTemplate(){const _0x39158b=a33_0x45e4ac,[_0x3717f1,_0x560860]=useState(![]),[_0x544067,_0xaf566c]=useState(![]),[_0x4bb182,_0x445973]=useState(''),_0x68002d=useCallback(async _0x183a65=>{const _0x18deba=a33_0x3315,_0x1167d1=Date[_0x18deba(0xb9)](),_0x3d16f6=a33_0xa1efc5[_0x18deba(0xaa)](process['cwd'](),_0x183a65);_0x560860(!![]);try{logger[_0x18deba(0xa7)](_0x18deba(0xae),_0x18deba(0xad),{'projectCode':_0x183a65,'templateDir':templateDir}),await copyDirectory(templateDir,_0x3d16f6);const _0x240100=Date[_0x18deba(0xb9)]()-_0x1167d1;logger[_0x18deba(0xb4)](_0x18deba(0xae),_0x18deba(0xb2),_0x240100,{'projectCode':_0x183a65});}catch(_0x58da7e){const _0x1cbe1f=Date[_0x18deba(0xb9)]()-_0x1167d1;logger[_0x18deba(0xab)]('copy','项目模板复制失败',{'projectCode':_0x183a65,'error':_0x58da7e instanceof Error?_0x58da7e['message']:String(_0x58da7e),'duration':_0x1cbe1f});throw _0x58da7e;}finally{_0x560860(![]),_0xaf566c(!![]),_0x445973(formatElapsed(_0x1167d1));}},[]);return{'taskName':_0x39158b(0xaf),'finished':_0x544067,'loading':_0x3717f1,'elapsed':_0x4bb182,'doTask':_0x68002d};}
1
+ const a36_0x14e36a=a36_0x252d;(function(_0x87f8d8,_0x60162f){const _0x52160f=a36_0x252d,_0x906ab3=_0x87f8d8();while(!![]){try{const _0x495e3b=parseInt(_0x52160f(0x108))/0x1*(parseInt(_0x52160f(0x11d))/0x2)+parseInt(_0x52160f(0x114))/0x3*(parseInt(_0x52160f(0x107))/0x4)+-parseInt(_0x52160f(0x112))/0x5+parseInt(_0x52160f(0x10a))/0x6+parseInt(_0x52160f(0x11a))/0x7*(parseInt(_0x52160f(0x110))/0x8)+-parseInt(_0x52160f(0x10e))/0x9*(parseInt(_0x52160f(0x10d))/0xa)+parseInt(_0x52160f(0x10f))/0xb*(parseInt(_0x52160f(0x11b))/0xc);if(_0x495e3b===_0x60162f)break;else _0x906ab3['push'](_0x906ab3['shift']());}catch(_0x11fbc4){_0x906ab3['push'](_0x906ab3['shift']());}}}(a36_0x22b6,0x80d36));function a36_0x252d(_0x22231d,_0x3f22a0){const _0x22b638=a36_0x22b6();return a36_0x252d=function(_0x252d66,_0x5489de){_0x252d66=_0x252d66-0x107;let _0x59561e=_0x22b638[_0x252d66];return _0x59561e;},a36_0x252d(_0x22231d,_0x3f22a0);}import a36_0x371364 from'node:path';import{fileURLToPath}from'node:url';function a36_0x22b6(){const _0x5350a8=['cwd','项目模板复制失败','resolve','复制项目文件','35693cDfpYJ','24tZPOVH','now','4656TFlyvI','150668wxkZes','265dcdBoS','message','425910uVrLcD','copy','项目模板复制完成','1060AttLEl','88821MnWQyI','2561537wzEHAC','1632MKjmYE','success','4041930TntKZC','url','15slKOtX','../../templates/projects/sub-app-react-demo'];a36_0x22b6=function(){return _0x5350a8;};return a36_0x22b6();}import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a36_0x371364['dirname'](fileURLToPath(import.meta[a36_0x14e36a(0x113)])),templateDir=a36_0x371364['resolve'](__dirname,a36_0x14e36a(0x115));export function useCopyProjectTemplate(){const _0xc036a3=a36_0x14e36a,[_0x17c77b,_0x1a5df4]=useState(![]),[_0x2bdaf0,_0x194db0]=useState(![]),[_0x4c463d,_0x551731]=useState(''),_0x1ed1c7=useCallback(async _0x7a6586=>{const _0x1d01d6=a36_0x252d,_0x15e077=Date[_0x1d01d6(0x11c)](),_0x5b0888=a36_0x371364[_0x1d01d6(0x118)](process[_0x1d01d6(0x116)](),_0x7a6586);_0x1a5df4(!![]);try{logger['info'](_0x1d01d6(0x10b),'开始复制项目模板',{'projectCode':_0x7a6586,'templateDir':templateDir}),await copyDirectory(templateDir,_0x5b0888);const _0x3387d2=Date[_0x1d01d6(0x11c)]()-_0x15e077;logger[_0x1d01d6(0x111)](_0x1d01d6(0x10b),_0x1d01d6(0x10c),_0x3387d2,{'projectCode':_0x7a6586});}catch(_0x3f2d89){const _0x26941b=Date[_0x1d01d6(0x11c)]()-_0x15e077;logger['error']('copy',_0x1d01d6(0x117),{'projectCode':_0x7a6586,'error':_0x3f2d89 instanceof Error?_0x3f2d89[_0x1d01d6(0x109)]:String(_0x3f2d89),'duration':_0x26941b});throw _0x3f2d89;}finally{_0x1a5df4(![]),_0x194db0(!![]),_0x551731(formatElapsed(_0x15e077));}},[]);return{'taskName':_0xc036a3(0x119),'finished':_0x2bdaf0,'loading':_0x17c77b,'elapsed':_0x4c463d,'doTask':_0x1ed1c7};}
@@ -1 +1 @@
1
- (function(_0xa0d5fe,_0x2a8c5c){const _0x1921ae=a34_0x55c1,_0x3718cc=_0xa0d5fe();while(!![]){try{const _0x1ed17a=-parseInt(_0x1921ae(0x194))/0x1*(-parseInt(_0x1921ae(0x191))/0x2)+-parseInt(_0x1921ae(0x190))/0x3*(-parseInt(_0x1921ae(0x184))/0x4)+parseInt(_0x1921ae(0x198))/0x5+parseInt(_0x1921ae(0x197))/0x6*(-parseInt(_0x1921ae(0x187))/0x7)+-parseInt(_0x1921ae(0x18f))/0x8+parseInt(_0x1921ae(0x193))/0x9*(-parseInt(_0x1921ae(0x185))/0xa)+parseInt(_0x1921ae(0x19d))/0xb;if(_0x1ed17a===_0x2a8c5c)break;else _0x3718cc['push'](_0x3718cc['shift']());}catch(_0x271932){_0x3718cc['push'](_0x3718cc['shift']());}}}(a34_0x53fc,0x36409));import a34_0x14b66e from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';function a34_0x53fc(){const _0x230f2e=['success','格式化代码','cwd','2648664HwDqOv','112083AboPwJ','2prViyv','--write','153963faTzio','279949IZJnRZ','format','开始格式化代码','48fFzyIG','443585DWclmI','error','代码格式化失败','prettier','npx','2800842UgfBgc','16TDxytB','80AbnWSu','代码格式化完成','72254XKxKnz','message','now','resolve','info'];a34_0x53fc=function(){return _0x230f2e;};return a34_0x53fc();}import{formatElapsed}from'./format-elapsed.js';function a34_0x55c1(_0x2a9727,_0x4a15a3){const _0x53fcc5=a34_0x53fc();return a34_0x55c1=function(_0x55c19d,_0x286b8c){_0x55c19d=_0x55c19d-0x184;let _0xd93b70=_0x53fcc5[_0x55c19d];return _0xd93b70;},a34_0x55c1(_0x2a9727,_0x4a15a3);}import{logger}from'../utils/logger.js';export function useFormatCode(){const _0xaf7d2c=a34_0x55c1,[_0xa9ee5b,_0x5480bb]=useState(![]),[_0x5b31c4,_0x462253]=useState(![]),[_0x49a347,_0xa8ee56]=useState(''),_0x18f8d9=useCallback(async _0x22d78b=>{const _0xc05f9f=a34_0x55c1,_0x184ba8=Date[_0xc05f9f(0x189)](),_0x368d6d=a34_0x14b66e[_0xc05f9f(0x18a)](process[_0xc05f9f(0x18e)](),_0x22d78b);_0x5480bb(!![]);try{logger[_0xc05f9f(0x18b)]('format',_0xc05f9f(0x196),{'projectCode':_0x22d78b}),await execa(_0xc05f9f(0x19c),[_0xc05f9f(0x19b),_0xc05f9f(0x192),'.'],{'cwd':_0x368d6d});const _0x2a842a=Date['now']()-_0x184ba8;logger[_0xc05f9f(0x18c)](_0xc05f9f(0x195),_0xc05f9f(0x186),_0x2a842a,{'projectCode':_0x22d78b});}catch(_0x6f40f6){const _0x20acca=Date[_0xc05f9f(0x189)]()-_0x184ba8;logger[_0xc05f9f(0x199)]('format',_0xc05f9f(0x19a),{'projectCode':_0x22d78b,'error':_0x6f40f6 instanceof Error?_0x6f40f6[_0xc05f9f(0x188)]:String(_0x6f40f6),'duration':_0x20acca});throw _0x6f40f6;}finally{_0x5480bb(![]),_0x462253(!![]),_0xa8ee56(formatElapsed(_0x184ba8));}},[]);return{'taskName':_0xaf7d2c(0x18d),'finished':_0x5b31c4,'loading':_0xa9ee5b,'elapsed':_0x49a347,'doTask':_0x18f8d9};}
1
+ (function(_0xbe64f2,_0x62eb04){const _0x489e34=a37_0x5e30,_0x1b7635=_0xbe64f2();while(!![]){try{const _0x1c445a=parseInt(_0x489e34(0x1e7))/0x1*(-parseInt(_0x489e34(0x1f2))/0x2)+-parseInt(_0x489e34(0x1f4))/0x3*(-parseInt(_0x489e34(0x1ec))/0x4)+parseInt(_0x489e34(0x1e2))/0x5*(parseInt(_0x489e34(0x1e4))/0x6)+parseInt(_0x489e34(0x1eb))/0x7*(-parseInt(_0x489e34(0x1ed))/0x8)+-parseInt(_0x489e34(0x1f3))/0x9+-parseInt(_0x489e34(0x1f5))/0xa+parseInt(_0x489e34(0x1e5))/0xb;if(_0x1c445a===_0x62eb04)break;else _0x1b7635['push'](_0x1b7635['shift']());}catch(_0x2d5d66){_0x1b7635['push'](_0x1b7635['shift']());}}}(a37_0x2b6c,0xf23c4));import a37_0x373884 from'node:path';import{useCallback,useState}from'react';function a37_0x5e30(_0x2bc8ce,_0x48455d){const _0x2b6c5c=a37_0x2b6c();return a37_0x5e30=function(_0x5e3076,_0x46824d){_0x5e3076=_0x5e3076-0x1df;let _0x1b15ee=_0x2b6c5c[_0x5e3076];return _0x1b15ee;},a37_0x5e30(_0x2bc8ce,_0x48455d);}import{execa}from'execa';function a37_0x2b6c(){const _0x14fe1f=['53795rXTSTv','3360tFwkxO','16ZUVUDG','--write','error','info','npx','10UQICHu','6981777Hmaesg','3HluyxJ','3388460wFEkDQ','resolve','格式化代码','now','4435IcIWai','cwd','3354uabMiq','19432292atQfFD','代码格式化失败','28216fSaeWX','代码格式化完成','message','format'];a37_0x2b6c=function(){return _0x14fe1f;};return a37_0x2b6c();}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x280206=a37_0x5e30,[_0x1b26da,_0x25e2da]=useState(![]),[_0x4a58ef,_0x5e8cf0]=useState(![]),[_0x55d249,_0x320765]=useState(''),_0x60944e=useCallback(async _0x1770de=>{const _0x3634ec=a37_0x5e30,_0x413a55=Date[_0x3634ec(0x1e1)](),_0x6e0c24=a37_0x373884[_0x3634ec(0x1df)](process[_0x3634ec(0x1e3)](),_0x1770de);_0x25e2da(!![]);try{logger[_0x3634ec(0x1f0)](_0x3634ec(0x1ea),'开始格式化代码',{'projectCode':_0x1770de}),await execa(_0x3634ec(0x1f1),['prettier',_0x3634ec(0x1ee),'.'],{'cwd':_0x6e0c24});const _0x1f8134=Date[_0x3634ec(0x1e1)]()-_0x413a55;logger['success'](_0x3634ec(0x1ea),_0x3634ec(0x1e8),_0x1f8134,{'projectCode':_0x1770de});}catch(_0x29f1b6){const _0x27ba98=Date[_0x3634ec(0x1e1)]()-_0x413a55;logger[_0x3634ec(0x1ef)]('format',_0x3634ec(0x1e6),{'projectCode':_0x1770de,'error':_0x29f1b6 instanceof Error?_0x29f1b6[_0x3634ec(0x1e9)]:String(_0x29f1b6),'duration':_0x27ba98});throw _0x29f1b6;}finally{_0x25e2da(![]),_0x5e8cf0(!![]),_0x320765(formatElapsed(_0x413a55));}},[]);return{'taskName':_0x280206(0x1e0),'finished':_0x4a58ef,'loading':_0x1b26da,'elapsed':_0x55d249,'doTask':_0x60944e};}
@@ -1 +1 @@
1
- (function(_0x11143d,_0x334e0e){const _0x5e2daf=a35_0x1a1c,_0x4fc358=_0x11143d();while(!![]){try{const _0x48a99a=-parseInt(_0x5e2daf(0x1ee))/0x1*(parseInt(_0x5e2daf(0x204))/0x2)+parseInt(_0x5e2daf(0x1fd))/0x3*(-parseInt(_0x5e2daf(0x1ff))/0x4)+parseInt(_0x5e2daf(0x205))/0x5+parseInt(_0x5e2daf(0x202))/0x6+parseInt(_0x5e2daf(0x1f8))/0x7*(-parseInt(_0x5e2daf(0x200))/0x8)+-parseInt(_0x5e2daf(0x1f9))/0x9+parseInt(_0x5e2daf(0x1f7))/0xa;if(_0x48a99a===_0x334e0e)break;else _0x4fc358['push'](_0x4fc358['shift']());}catch(_0x1bdabc){_0x4fc358['push'](_0x4fc358['shift']());}}}(a35_0x42bc,0xa6631));function a35_0x42bc(){const _0x43c3cf=['1507340OfFAjm','3ZnrxMN','resolve','message','开始安装依赖','now','info','安装依赖','cwd','https://registry.npmmirror.com','22471930xatYho','5943777rjbflp','5108715SnkhUq','npm','--registry','install','9PMxHuS','error','205148SACnUb','8immCTs','success','374574MINksM','依赖安装失败','239308qMcEGN'];a35_0x42bc=function(){return _0x43c3cf;};return a35_0x42bc();}import a35_0x5a5133 from'node:path';import{useCallback,useState}from'react';function a35_0x1a1c(_0x1735cd,_0xf49f37){const _0x42bcbd=a35_0x42bc();return a35_0x1a1c=function(_0x1a1cd8,_0x41485e){_0x1a1cd8=_0x1a1cd8-0x1ee;let _0x2cfaab=_0x42bcbd[_0x1a1cd8];return _0x2cfaab;},a35_0x1a1c(_0x1735cd,_0xf49f37);}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x403772=a35_0x1a1c,[_0x1e0259,_0x3bd50e]=useState(![]),[_0x2cf60,_0x3b1bf7]=useState(![]),[_0x4f188c,_0x37a250]=useState(''),_0xdc061=useCallback(async _0x8effcf=>{const _0x94a57=a35_0x1a1c,_0x3a6666=Date[_0x94a57(0x1f2)](),_0x5cc1fb=a35_0x5a5133[_0x94a57(0x1ef)](process[_0x94a57(0x1f5)](),_0x8effcf);_0x3bd50e(!![]),_0x3b1bf7(![]);const _0x1d33a7=async(_0xaec872,_0x204e97)=>{await execa(_0xaec872,_0x204e97,{'cwd':_0x5cc1fb});};try{logger[_0x94a57(0x1f3)](_0x94a57(0x1fc),_0x94a57(0x1f1),{'projectCode':_0x8effcf,'registry':_0x94a57(0x1f6)}),await _0x1d33a7(_0x94a57(0x1fa),['install',_0x94a57(0x1fb),'https://registry.npmmirror.com']);const _0x52f6c5=Date[_0x94a57(0x1f2)]()-_0x3a6666;logger[_0x94a57(0x201)]('install','依赖安装完成',_0x52f6c5,{'projectCode':_0x8effcf});}catch(_0x2448ab){const _0x25f8c3=Date[_0x94a57(0x1f2)]()-_0x3a6666;logger[_0x94a57(0x1fe)]('install',_0x94a57(0x203),{'projectCode':_0x8effcf,'error':_0x2448ab instanceof Error?_0x2448ab[_0x94a57(0x1f0)]:String(_0x2448ab),'duration':_0x25f8c3});throw _0x2448ab;}finally{_0x3bd50e(![]),_0x3b1bf7(!![]),_0x37a250(formatElapsed(_0x3a6666));}},[]);return{'taskName':_0x403772(0x1f4),'finished':_0x2cf60,'loading':_0x1e0259,'elapsed':_0x4f188c,'doTask':_0xdc061};}
1
+ function a38_0x3104(_0x3ed5b6,_0x5a6c4a){const _0x5774b5=a38_0x5774();return a38_0x3104=function(_0x31043d,_0x2a6b94){_0x31043d=_0x31043d-0x15f;let _0x348b16=_0x5774b5[_0x31043d];return _0x348b16;},a38_0x3104(_0x3ed5b6,_0x5a6c4a);}(function(_0x27ed05,_0x31ef63){const _0x2bb704=a38_0x3104,_0x44bb5e=_0x27ed05();while(!![]){try{const _0x14a462=-parseInt(_0x2bb704(0x173))/0x1*(parseInt(_0x2bb704(0x170))/0x2)+parseInt(_0x2bb704(0x172))/0x3+parseInt(_0x2bb704(0x162))/0x4*(parseInt(_0x2bb704(0x169))/0x5)+parseInt(_0x2bb704(0x163))/0x6+parseInt(_0x2bb704(0x160))/0x7*(-parseInt(_0x2bb704(0x16a))/0x8)+-parseInt(_0x2bb704(0x174))/0x9+parseInt(_0x2bb704(0x165))/0xa*(parseInt(_0x2bb704(0x167))/0xb);if(_0x14a462===_0x31ef63)break;else _0x44bb5e['push'](_0x44bb5e['shift']());}catch(_0x3b6508){_0x44bb5e['push'](_0x44bb5e['shift']());}}}(a38_0x5774,0xdc65d));import a38_0x1ab6d5 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a38_0x5774(){const _0x17405b=['8cINetE','npm','--registry','依赖安装失败','install','error','2eFbQWS','https://registry.npmmirror.com','2432592TUXxxI','1282719bDTQwX','14438574FPFKRP','开始安装依赖','安装依赖','10253257dVKcNj','resolve','12JtkegR','6565014SoWiwj','success','20bvlsQH','now','10446326kfkrJH','info','2416900xqMGvV'];a38_0x5774=function(){return _0x17405b;};return a38_0x5774();}export function useInstallDependencies(){const _0x29fe18=a38_0x3104,[_0x3f7493,_0x3908df]=useState(![]),[_0x238b3b,_0x304647]=useState(![]),[_0x5225fb,_0x1a846b]=useState(''),_0x3ef92f=useCallback(async _0x4a66ee=>{const _0x211ddc=a38_0x3104,_0x35ed1a=Date[_0x211ddc(0x166)](),_0x344f49=a38_0x1ab6d5[_0x211ddc(0x161)](process['cwd'](),_0x4a66ee);_0x3908df(!![]),_0x304647(![]);const _0x151a2a=async(_0x53613b,_0x2a59b6)=>{await execa(_0x53613b,_0x2a59b6,{'cwd':_0x344f49});};try{logger[_0x211ddc(0x168)]('install',_0x211ddc(0x175),{'projectCode':_0x4a66ee,'registry':_0x211ddc(0x171)}),await _0x151a2a(_0x211ddc(0x16b),[_0x211ddc(0x16e),_0x211ddc(0x16c),_0x211ddc(0x171)]);const _0x3ac83e=Date['now']()-_0x35ed1a;logger[_0x211ddc(0x164)](_0x211ddc(0x16e),'依赖安装完成',_0x3ac83e,{'projectCode':_0x4a66ee});}catch(_0x37c1c8){const _0x3a6b25=Date['now']()-_0x35ed1a;logger[_0x211ddc(0x16f)](_0x211ddc(0x16e),_0x211ddc(0x16d),{'projectCode':_0x4a66ee,'error':_0x37c1c8 instanceof Error?_0x37c1c8['message']:String(_0x37c1c8),'duration':_0x3a6b25});throw _0x37c1c8;}finally{_0x3908df(![]),_0x304647(!![]),_0x1a846b(formatElapsed(_0x35ed1a));}},[]);return{'taskName':_0x29fe18(0x15f),'finished':_0x238b3b,'loading':_0x3f7493,'elapsed':_0x5225fb,'doTask':_0x3ef92f};}
package/lib/help.js CHANGED
@@ -1 +1 @@
1
- (function(_0x58bfe0,_0x555d5d){var _0x2c8847=a36_0x188f,_0x3f7572=_0x58bfe0();while(!![]){try{var _0x3a83e9=parseInt(_0x2c8847(0x14d))/0x1*(-parseInt(_0x2c8847(0x146))/0x2)+parseInt(_0x2c8847(0x143))/0x3+-parseInt(_0x2c8847(0x148))/0x4*(-parseInt(_0x2c8847(0x14b))/0x5)+-parseInt(_0x2c8847(0x149))/0x6+parseInt(_0x2c8847(0x14e))/0x7+-parseInt(_0x2c8847(0x142))/0x8*(-parseInt(_0x2c8847(0x14c))/0x9)+parseInt(_0x2c8847(0x145))/0xa*(-parseInt(_0x2c8847(0x141))/0xb);if(_0x3a83e9===_0x555d5d)break;else _0x3f7572['push'](_0x3f7572['shift']());}catch(_0x4b9e9e){_0x3f7572['push'](_0x3f7572['shift']());}}}(a36_0x34d0,0x21404));import{jsx as a36_0x8daa2e,jsxs as a36_0x127fbd}from'react/jsx-runtime';import{Box,Text}from'ink';function a36_0x188f(_0x55d5fb,_0x48067e){var _0x34d050=a36_0x34d0();return a36_0x188f=function(_0x188f47,_0x1a92c0){_0x188f47=_0x188f47-0x13f;var _0x117b69=_0x34d050[_0x188f47];return _0x117b69;},a36_0x188f(_0x55d5fb,_0x48067e);}function a36_0x34d0(){var _0x280801=['30lbdWev','2zaojhM','查看可用命令。','4HkdSOi','443046cmQick','lovrabet\x20--help','325285niTRwK','58887WdBncM','60529PgtpuC','1815821bNPehX','column','green','1132351Rvgzvv','184hfuwvd','313320ZdzLsS','!\x20请指定一个有效的命令。'];a36_0x34d0=function(){return _0x280801;};return a36_0x34d0();}export function Help(){var _0x123c0c=a36_0x188f;return a36_0x127fbd(Box,{'flexDirection':_0x123c0c(0x13f),'marginTop':0x1,'marginBottom':0x1,'children':[a36_0x127fbd(Box,{'children':[a36_0x8daa2e(Box,{'width':'1'}),a36_0x8daa2e(Text,{'children':_0x123c0c(0x144)})]}),a36_0x127fbd(Box,{'marginTop':0x1,'children':[a36_0x8daa2e(Box,{'width':'1'}),a36_0x127fbd(Text,{'children':['\x20\x20','使用']}),a36_0x127fbd(Text,{'bold':!![],'color':_0x123c0c(0x140),'children':['\x20',_0x123c0c(0x14a),'\x20']}),a36_0x8daa2e(Text,{'children':_0x123c0c(0x147)})]})]});}
1
+ (function(_0x28e887,_0x5722e6){var _0x402d3a=a39_0x396e,_0x305185=_0x28e887();while(!![]){try{var _0x2f2764=-parseInt(_0x402d3a(0x6d))/0x1+parseInt(_0x402d3a(0x71))/0x2+parseInt(_0x402d3a(0x79))/0x3*(-parseInt(_0x402d3a(0x70))/0x4)+-parseInt(_0x402d3a(0x7a))/0x5*(parseInt(_0x402d3a(0x72))/0x6)+parseInt(_0x402d3a(0x77))/0x7*(parseInt(_0x402d3a(0x76))/0x8)+-parseInt(_0x402d3a(0x73))/0x9*(-parseInt(_0x402d3a(0x6e))/0xa)+parseInt(_0x402d3a(0x74))/0xb;if(_0x2f2764===_0x5722e6)break;else _0x305185['push'](_0x305185['shift']());}catch(_0x4e2e29){_0x305185['push'](_0x305185['shift']());}}}(a39_0x2800,0xd0c7f));import{jsx as a39_0x1a669f,jsxs as a39_0x5929b3}from'react/jsx-runtime';import{Box,Text}from'ink';function a39_0x2800(){var _0x4ae553=['1630416mIvtwv','5xOaNaz','257491GmXsAz','47090VMQUOG','column','4SzNQbU','524776aMMLrH','4801044ZsbePC','495ozsuzX','17247340EqfpQw','!\x20请指定一个有效的命令。','8sGFucr','2568867yoouuH','lovrabet\x20--help'];a39_0x2800=function(){return _0x4ae553;};return a39_0x2800();}function a39_0x396e(_0x3cd0af,_0x46b2f1){var _0x28009f=a39_0x2800();return a39_0x396e=function(_0x396e0d,_0x4f318b){_0x396e0d=_0x396e0d-0x6d;var _0x12c232=_0x28009f[_0x396e0d];return _0x12c232;},a39_0x396e(_0x3cd0af,_0x46b2f1);}export function Help(){var _0x5ade1c=a39_0x396e;return a39_0x5929b3(Box,{'flexDirection':_0x5ade1c(0x6f),'marginTop':0x1,'marginBottom':0x1,'children':[a39_0x5929b3(Box,{'children':[a39_0x1a669f(Box,{'width':'1'}),a39_0x1a669f(Text,{'children':_0x5ade1c(0x75)})]}),a39_0x5929b3(Box,{'marginTop':0x1,'children':[a39_0x1a669f(Box,{'width':'1'}),a39_0x5929b3(Text,{'children':['\x20\x20','使用']}),a39_0x5929b3(Text,{'bold':!![],'color':'green','children':['\x20',_0x5ade1c(0x78),'\x20']}),a39_0x1a669f(Text,{'children':'查看可用命令。'})]})]});}
@@ -1 +1 @@
1
- const a37_0x3ecc39=a37_0x2087;(function(_0x52520c,_0x3f2ea9){const _0x58cc01=a37_0x2087,_0x19b177=_0x52520c();while(!![]){try{const _0x5d7e67=-parseInt(_0x58cc01(0x90))/0x1+-parseInt(_0x58cc01(0x91))/0x2*(-parseInt(_0x58cc01(0x97))/0x3)+parseInt(_0x58cc01(0x9a))/0x4*(-parseInt(_0x58cc01(0x9b))/0x5)+-parseInt(_0x58cc01(0x93))/0x6+parseInt(_0x58cc01(0x94))/0x7*(-parseInt(_0x58cc01(0x8f))/0x8)+parseInt(_0x58cc01(0x95))/0x9+parseInt(_0x58cc01(0x9c))/0xa*(parseInt(_0x58cc01(0x92))/0xb);if(_0x5d7e67===_0x3f2ea9)break;else _0x19b177['push'](_0x19b177['shift']());}catch(_0x331319){_0x19b177['push'](_0x19b177['shift']());}}}(a37_0x577a,0x94051));import{existsSync,readFileSync}from'node:fs';function a37_0x2087(_0x46c570,_0x353ee4){const _0x577a09=a37_0x577a();return a37_0x2087=function(_0x20870b,_0x467b97){_0x20870b=_0x20870b-0x8f;let _0x210c2d=_0x577a09[_0x20870b];return _0x210c2d;},a37_0x2087(_0x46c570,_0x353ee4);}function a37_0x577a(){const _0x4b4d84=['130552uhhcFo','919859GPjJiQ','1556VnTXWM','504009VzqSKi','4780326lsuZNn','70kgKJLk','7211547HyAmll','.lovrabetrc','3261VPcqBm','utf8','parse','1592092IHWjMP','5qLBPrD','270nDwRvC','cwd'];a37_0x577a=function(){return _0x4b4d84;};return a37_0x577a();}import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a37_0x3ecc39(0x9d)](),'.lovrabetrc');export const globalConfigPath=resolve(homedir(),a37_0x3ecc39(0x96));export function readConfig(){const _0x58fc54=a37_0x3ecc39;let _0x3eba24={};try{if(existsSync(globalConfigPath)){const _0x1f44d9=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x1f44d9&&(_0x3eba24=JSON[_0x58fc54(0x99)](_0x1f44d9));}}catch(_0x3cd0ce){}try{if(existsSync(projectConfigPath)){const _0x4946ed=readFileSync(projectConfigPath,{'encoding':_0x58fc54(0x98)});if(_0x4946ed){const _0x4cda31=JSON[_0x58fc54(0x99)](_0x4946ed);_0x3eba24={..._0x3eba24,..._0x4cda31};}}}catch(_0x3a2143){}return _0x3eba24;}export function isInProject(){return existsSync(projectConfigPath);}
1
+ const a40_0x543a71=a40_0x23d7;function a40_0xb32a(){const _0x4f6fac=['15629559kfDRlY','7758LXbDfJ','7800216MNUehD','.lovrabetrc','201kDfOhE','parse','15XTYFec','appcode','app','8470orrJzf','1328436EVEVti','275975gVRtEr','18yfQKCi','utf8','5820kZhKBf','2015629QnsnkV'];a40_0xb32a=function(){return _0x4f6fac;};return a40_0xb32a();}(function(_0xaa9362,_0x2112f5){const _0x4a7a5e=a40_0x23d7,_0x3a6e83=_0xaa9362();while(!![]){try{const _0x460973=-parseInt(_0x4a7a5e(0xac))/0x1+-parseInt(_0x4a7a5e(0x9f))/0x2*(-parseInt(_0x4a7a5e(0xa5))/0x3)+parseInt(_0x4a7a5e(0xab))/0x4*(parseInt(_0x4a7a5e(0xa7))/0x5)+-parseInt(_0x4a7a5e(0xad))/0x6*(-parseInt(_0x4a7a5e(0xa0))/0x7)+parseInt(_0x4a7a5e(0xa3))/0x8+-parseInt(_0x4a7a5e(0xa2))/0x9*(parseInt(_0x4a7a5e(0xaa))/0xa)+-parseInt(_0x4a7a5e(0xa1))/0xb;if(_0x460973===_0x2112f5)break;else _0x3a6e83['push'](_0x3a6e83['shift']());}catch(_0x5b9d16){_0x3a6e83['push'](_0x3a6e83['shift']());}}}(a40_0xb32a,0x93447));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process['cwd'](),'.lovrabetrc');export const globalConfigPath=resolve(homedir(),a40_0x543a71(0xa4));export function readConfig(){const _0x5acdd9=a40_0x543a71;let _0x46a095={};try{if(existsSync(globalConfigPath)){const _0x3ec847=readFileSync(globalConfigPath,{'encoding':_0x5acdd9(0x9e)});_0x3ec847&&(_0x46a095=JSON[_0x5acdd9(0xa6)](_0x3ec847));}}catch(_0x2c8a1e){}try{if(existsSync(projectConfigPath)){const _0x1cf5d5=readFileSync(projectConfigPath,{'encoding':_0x5acdd9(0x9e)});if(_0x1cf5d5){const _0xcf5f81=JSON[_0x5acdd9(0xa6)](_0x1cf5d5);_0x46a095={..._0x46a095,..._0xcf5f81};}}}catch(_0x5655d0){}return _0x46a095;}function a40_0x23d7(_0x5c378a,_0x2902ed){const _0xb32a65=a40_0xb32a();return a40_0x23d7=function(_0x23d790,_0x2f68ed){_0x23d790=_0x23d790-0x9e;let _0x2ed844=_0xb32a65[_0x23d790];return _0x2ed844;},a40_0x23d7(_0x5c378a,_0x2902ed);}export function getConfigAppCode(){const _0x443a13=a40_0x543a71;let _0x4ab980={},_0x1a0a8f={};try{if(existsSync(globalConfigPath)){const _0x11df5f=readFileSync(globalConfigPath,{'encoding':_0x443a13(0x9e)});_0x11df5f&&(_0x1a0a8f=JSON['parse'](_0x11df5f));}}catch(_0x1ab5c6){}try{if(existsSync(projectConfigPath)){const _0x1caa5f=readFileSync(projectConfigPath,{'encoding':_0x443a13(0x9e)});_0x1caa5f&&(_0x4ab980=JSON[_0x443a13(0xa6)](_0x1caa5f));}}catch(_0xfd6362){}let _0x32121a;if(_0x443a13(0xa8)in _0x4ab980)_0x32121a=_0x4ab980['appcode'];else{if(_0x443a13(0xa9)in _0x4ab980)_0x32121a=_0x4ab980['app'];else{if(_0x443a13(0xa8)in _0x1a0a8f)_0x32121a=_0x1a0a8f[_0x443a13(0xa8)];else _0x443a13(0xa9)in _0x1a0a8f&&(_0x32121a=_0x1a0a8f['app']);}}if(typeof _0x32121a!=='string'||_0x32121a['trim']()==='')return undefined;return _0x32121a;}export function isInProject(){return existsSync(projectConfigPath);}
@@ -1 +1 @@
1
- (function(_0x572ff2,_0x2e6a45){const _0x50e80c=a38_0x53af,_0x4c7642=_0x572ff2();while(!![]){try{const _0x2f2026=parseInt(_0x50e80c(0xbe))/0x1*(-parseInt(_0x50e80c(0xcb))/0x2)+-parseInt(_0x50e80c(0xca))/0x3+-parseInt(_0x50e80c(0xc1))/0x4*(parseInt(_0x50e80c(0xc4))/0x5)+-parseInt(_0x50e80c(0xc0))/0x6*(parseInt(_0x50e80c(0xc3))/0x7)+-parseInt(_0x50e80c(0xbd))/0x8+parseInt(_0x50e80c(0xc5))/0x9*(-parseInt(_0x50e80c(0xc9))/0xa)+-parseInt(_0x50e80c(0xc7))/0xb*(-parseInt(_0x50e80c(0xba))/0xc);if(_0x2f2026===_0x2e6a45)break;else _0x4c7642['push'](_0x4c7642['shift']());}catch(_0x1e310a){_0x4c7642['push'](_0x4c7642['shift']());}}}(a38_0x3184,0xc3df6));import a38_0x2591aa from'node:path';function a38_0x3184(){const _0x5bfd19=['mkdirSync','3834aKpost','8NjiEYx','复制目录时出错:','13097giLGUz','1042025bBhxDz','21213nZTzRn','error','58383413nPLIwy','readdirSync','2510oDBfBp','2579634rWwZPW','6NfAUjK','copyFileSync','12owBjBm','join','name','6190608xQaQsc','222533hwlZID'];a38_0x3184=function(){return _0x5bfd19;};return a38_0x3184();}function a38_0x53af(_0x4ab13b,_0x34382b){const _0x318420=a38_0x3184();return a38_0x53af=function(_0x53afe7,_0x329db9){_0x53afe7=_0x53afe7-0xba;let _0x374214=_0x318420[_0x53afe7];return _0x374214;},a38_0x53af(_0x4ab13b,_0x34382b);}import a38_0x408958 from'node:fs';export async function copyDirectory(_0x4413fa,_0x2e778e){const _0x4165e8=a38_0x53af;try{const _0x4f07b1=a38_0x408958[_0x4165e8(0xc8)](_0x4413fa,{'withFileTypes':!![]});a38_0x408958[_0x4165e8(0xbf)](_0x2e778e,{'recursive':!![]});for(const _0x5d9331 of _0x4f07b1){const _0x421742=a38_0x2591aa[_0x4165e8(0xbb)](_0x4413fa,_0x5d9331['name']),_0x29b251=a38_0x2591aa[_0x4165e8(0xbb)](_0x2e778e,_0x5d9331[_0x4165e8(0xbc)]);_0x5d9331['isDirectory']()?await copyDirectory(_0x421742,_0x29b251):a38_0x408958[_0x4165e8(0xcc)](_0x421742,_0x29b251);}}catch(_0xf4857d){console[_0x4165e8(0xc6)](_0x4165e8(0xc2),_0xf4857d);}}
1
+ (function(_0x564b5f,_0x587a68){const _0x2758b2=a41_0x46bb,_0x168403=_0x564b5f();while(!![]){try{const _0x193a09=-parseInt(_0x2758b2(0x160))/0x1+parseInt(_0x2758b2(0x162))/0x2+-parseInt(_0x2758b2(0x15e))/0x3*(parseInt(_0x2758b2(0x167))/0x4)+parseInt(_0x2758b2(0x15f))/0x5+-parseInt(_0x2758b2(0x16a))/0x6+-parseInt(_0x2758b2(0x169))/0x7+-parseInt(_0x2758b2(0x164))/0x8*(-parseInt(_0x2758b2(0x168))/0x9);if(_0x193a09===_0x587a68)break;else _0x168403['push'](_0x168403['shift']());}catch(_0x1f63c5){_0x168403['push'](_0x168403['shift']());}}}(a41_0x14bc,0x5f6ce));function a41_0x14bc(){const _0x4fa2a2=['copyFileSync','1280670AbLUfp','readdirSync','24FTgahp','name','error','3376eXTJcH','4650228PKRNOC','2338091ezKUkR','2925378rivoUL','join','1023BnkDty','258305mSVjRG','741830QvgFGq'];a41_0x14bc=function(){return _0x4fa2a2;};return a41_0x14bc();}import a41_0x117816 from'node:path';function a41_0x46bb(_0x29dbfc,_0x3ce918){const _0x14bcef=a41_0x14bc();return a41_0x46bb=function(_0x46bbe0,_0x54e400){_0x46bbe0=_0x46bbe0-0x15e;let _0x44e55f=_0x14bcef[_0x46bbe0];return _0x44e55f;},a41_0x46bb(_0x29dbfc,_0x3ce918);}import a41_0x2fef03 from'node:fs';export async function copyDirectory(_0x5229b2,_0x276374){const _0x275a42=a41_0x46bb;try{const _0x2f0507=a41_0x2fef03[_0x275a42(0x163)](_0x5229b2,{'withFileTypes':!![]});a41_0x2fef03['mkdirSync'](_0x276374,{'recursive':!![]});for(const _0x4762da of _0x2f0507){const _0x28c208=a41_0x117816[_0x275a42(0x16b)](_0x5229b2,_0x4762da['name']),_0x373429=a41_0x117816[_0x275a42(0x16b)](_0x276374,_0x4762da[_0x275a42(0x165)]);_0x4762da['isDirectory']()?await copyDirectory(_0x28c208,_0x373429):a41_0x2fef03[_0x275a42(0x161)](_0x28c208,_0x373429);}}catch(_0x473009){console[_0x275a42(0x166)]('复制目录时出错:',_0x473009);}}
@@ -1 +1 @@
1
- (function(_0x523c18,_0x405974){const _0x5c7340=a39_0x5ec1,_0x2d7b73=_0x523c18();while(!![]){try{const _0x165bab=-parseInt(_0x5c7340(0x8f))/0x1*(-parseInt(_0x5c7340(0x9a))/0x2)+parseInt(_0x5c7340(0x88))/0x3+parseInt(_0x5c7340(0x92))/0x4*(-parseInt(_0x5c7340(0x80))/0x5)+-parseInt(_0x5c7340(0x83))/0x6*(-parseInt(_0x5c7340(0x8c))/0x7)+-parseInt(_0x5c7340(0x85))/0x8*(parseInt(_0x5c7340(0x94))/0x9)+parseInt(_0x5c7340(0x99))/0xa+-parseInt(_0x5c7340(0x9b))/0xb;if(_0x165bab===_0x405974)break;else _0x2d7b73['push'](_0x2d7b73['shift']());}catch(_0x24d3d6){_0x2d7b73['push'](_0x2d7b73['shift']());}}}(a39_0x4918,0xacbf8));function a39_0x4918(){const _0xced451=['signal','1205560AbefEg','log','get','1235013LZHYwL','ENOTFOUND','text','*\x20请求失败,','1833797sHvRIN','includes','status','513179xzuUan','Request\x20failed','content-type','4tFjtwT','headers','9bIEXoR','json','statusText','ECONNRESET','message','2916540tuawia','2rbjtLY','6150243NeVOUT','AbortError','fetch','1615310XskVkY','TypeError','name','12BVryYS'];a39_0x4918=function(){return _0xced451;};return a39_0x4918();}function a39_0x5ec1(_0x787407,_0x50f8c4){const _0x4918fa=a39_0x4918();return a39_0x5ec1=function(_0x5ec1a7,_0x5bb1bd){_0x5ec1a7=_0x5ec1a7-0x7e;let _0x2c2332=_0x4918fa[_0x5ec1a7];return _0x2c2332;},a39_0x5ec1(_0x787407,_0x50f8c4);}export async function httpRequest(_0x161c00,_0x2f60e4={}){const _0x58f5d3=a39_0x5ec1,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x2f60e4;let _0x302284=null;for(let _0x6e2893=0x0;_0x6e2893<=retries;_0x6e2893++){try{const _0x12d674=new AbortController(),_0x540243=setTimeout(()=>_0x12d674['abort'](),timeout),_0x492f6f=await fetch(_0x161c00,{'headers':headers,'signal':_0x12d674[_0x58f5d3(0x84)]});clearTimeout(_0x540243);let _0x2dca86;const _0x3d81db=_0x492f6f[_0x58f5d3(0x93)][_0x58f5d3(0x87)](_0x58f5d3(0x91));return _0x3d81db?.[_0x58f5d3(0x8d)]('application/json')?_0x2dca86=await _0x492f6f[_0x58f5d3(0x95)]():_0x2dca86=await _0x492f6f[_0x58f5d3(0x8a)](),{'ok':_0x492f6f['ok'],'status':_0x492f6f[_0x58f5d3(0x8e)],'statusText':_0x492f6f[_0x58f5d3(0x96)],'data':_0x2dca86,'headers':_0x492f6f['headers'],'url':_0x492f6f['url'],'text':()=>_0x492f6f[_0x58f5d3(0x8a)]()};}catch(_0x120908){_0x302284=_0x120908 instanceof Error?_0x120908:new Error(String(_0x120908));if(_0x6e2893===retries)break;if(shouldRetry(_0x120908)){console[_0x58f5d3(0x86)](_0x58f5d3(0x8b)+retryDelay+'ms\x20后进行第\x20'+(_0x6e2893+0x1)+'\x20次重试...'),await sleep(retryDelay);continue;}else break;}}throw _0x302284||new Error(_0x58f5d3(0x90));}function shouldRetry(_0x25f34c){const _0x377314=a39_0x5ec1;if(_0x25f34c instanceof Error){if(_0x25f34c[_0x377314(0x82)]===_0x377314(0x7e))return![];if(_0x25f34c['name']===_0x377314(0x81)&&_0x25f34c[_0x377314(0x98)][_0x377314(0x8d)](_0x377314(0x7f)))return!![];if(_0x25f34c['message'][_0x377314(0x8d)](_0x377314(0x97)))return!![];if(_0x25f34c[_0x377314(0x98)][_0x377314(0x8d)](_0x377314(0x89)))return![];}return![];}function sleep(_0x4516b8){return new Promise(_0x1f4f8f=>setTimeout(_0x1f4f8f,_0x4516b8));}export function validateUrl(_0x1c6f53){try{return new URL(_0x1c6f53),!![];}catch{return![];}}
1
+ (function(_0x5cefec,_0x5c6f47){const _0x666d84=a42_0x1325,_0x3020ce=_0x5cefec();while(!![]){try{const _0xce3d8d=parseInt(_0x666d84(0xce))/0x1*(-parseInt(_0x666d84(0xe5))/0x2)+-parseInt(_0x666d84(0xe6))/0x3*(-parseInt(_0x666d84(0xcc))/0x4)+-parseInt(_0x666d84(0xd3))/0x5+-parseInt(_0x666d84(0xca))/0x6+parseInt(_0x666d84(0xe4))/0x7+parseInt(_0x666d84(0xdb))/0x8*(-parseInt(_0x666d84(0xd7))/0x9)+parseInt(_0x666d84(0xdf))/0xa;if(_0xce3d8d===_0x5c6f47)break;else _0x3020ce['push'](_0x3020ce['shift']());}catch(_0x140d79){_0x3020ce['push'](_0x3020ce['shift']());}}}(a42_0x233f,0x41cb4));function a42_0x233f(){const _0x228b5b=['AbortError','statusText','application/json','url','3061135pDwKNL','6MezMND','684309tpZERJ','2430834AczCmY','ENOTFOUND','4StIjui','includes','131154nlVRqH','ms\x20后进行第\x20','abort','\x20次重试...','ECONNRESET','698490bfCnJJ','headers','name','text','9fiVikg','*\x20请求失败,','TypeError','json','2410728QuSrGx','signal','message','status','8437240KmYpxB'];a42_0x233f=function(){return _0x228b5b;};return a42_0x233f();}export async function httpRequest(_0x2c71f7,_0x416d9e={}){const _0x1ffff5=a42_0x1325,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x416d9e;let _0x2522d3=null;for(let _0x5caedd=0x0;_0x5caedd<=retries;_0x5caedd++){try{const _0x1ef32c=new AbortController(),_0x38095d=setTimeout(()=>_0x1ef32c[_0x1ffff5(0xd0)](),timeout),_0x44f21d=await fetch(_0x2c71f7,{'headers':headers,'signal':_0x1ef32c[_0x1ffff5(0xdc)]});clearTimeout(_0x38095d);let _0x152ac3;const _0x11a96c=_0x44f21d[_0x1ffff5(0xd4)]['get']('content-type');return _0x11a96c?.[_0x1ffff5(0xcd)](_0x1ffff5(0xe2))?_0x152ac3=await _0x44f21d[_0x1ffff5(0xda)]():_0x152ac3=await _0x44f21d[_0x1ffff5(0xd6)](),{'ok':_0x44f21d['ok'],'status':_0x44f21d[_0x1ffff5(0xde)],'statusText':_0x44f21d[_0x1ffff5(0xe1)],'data':_0x152ac3,'headers':_0x44f21d[_0x1ffff5(0xd4)],'url':_0x44f21d[_0x1ffff5(0xe3)],'text':()=>_0x44f21d[_0x1ffff5(0xd6)]()};}catch(_0x88f6ec){_0x2522d3=_0x88f6ec instanceof Error?_0x88f6ec:new Error(String(_0x88f6ec));if(_0x5caedd===retries)break;if(shouldRetry(_0x88f6ec)){console['log'](_0x1ffff5(0xd8)+retryDelay+_0x1ffff5(0xcf)+(_0x5caedd+0x1)+_0x1ffff5(0xd1)),await sleep(retryDelay);continue;}else break;}}throw _0x2522d3||new Error('Request\x20failed');}function shouldRetry(_0x8bc05f){const _0x49cd13=a42_0x1325;if(_0x8bc05f instanceof Error){if(_0x8bc05f[_0x49cd13(0xd5)]===_0x49cd13(0xe0))return![];if(_0x8bc05f['name']===_0x49cd13(0xd9)&&_0x8bc05f[_0x49cd13(0xdd)][_0x49cd13(0xcd)]('fetch'))return!![];if(_0x8bc05f[_0x49cd13(0xdd)]['includes'](_0x49cd13(0xd2)))return!![];if(_0x8bc05f[_0x49cd13(0xdd)][_0x49cd13(0xcd)](_0x49cd13(0xcb)))return![];}return![];}function sleep(_0x413421){return new Promise(_0x1569fd=>setTimeout(_0x1569fd,_0x413421));}function a42_0x1325(_0xd930ef,_0x52f84c){const _0x233f6a=a42_0x233f();return a42_0x1325=function(_0x1325f2,_0x2370bc){_0x1325f2=_0x1325f2-0xca;let _0x1a0045=_0x233f6a[_0x1325f2];return _0x1a0045;},a42_0x1325(_0xd930ef,_0x52f84c);}export function validateUrl(_0x360af1){try{return new URL(_0x360af1),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a40_0x3b978a=a40_0x38c0;(function(_0x1d1044,_0x3614af){const _0x3cd2bb=a40_0x38c0,_0xee15aa=_0x1d1044();while(!![]){try{const _0x1b38d9=parseInt(_0x3cd2bb(0x1f3))/0x1+parseInt(_0x3cd2bb(0x205))/0x2*(parseInt(_0x3cd2bb(0x1e9))/0x3)+-parseInt(_0x3cd2bb(0x1f1))/0x4*(parseInt(_0x3cd2bb(0x1ef))/0x5)+-parseInt(_0x3cd2bb(0x1dc))/0x6*(parseInt(_0x3cd2bb(0x1e8))/0x7)+parseInt(_0x3cd2bb(0x1fe))/0x8+parseInt(_0x3cd2bb(0x1df))/0x9+parseInt(_0x3cd2bb(0x208))/0xa*(-parseInt(_0x3cd2bb(0x1ec))/0xb);if(_0x1b38d9===_0x3614af)break;else _0xee15aa['push'](_0xee15aa['shift']());}catch(_0x3d46d1){_0xee15aa['push'](_0xee15aa['shift']());}}}(a40_0xdad8,0xd0436));import a40_0x3eeac6 from'winston';import a40_0x23a1a4 from'node:fs';function a40_0xdad8(){const _0x240a46=['713474ozoNPQ','stringify','readFileSync','14510NxXcbA','error','dirname','.lovrabet.log','unknown','initWinstonLogger','File','green','getWinstonInstance','174nLVHJm','existsSync','warn','154899HSRcPE','red','timestamp','command','writeFileSync','Failed\x20to\x20clear\x20logs:','开始执行:\x20','map','duration','8617xuspRj','9RroTQL','level','winstonLogger','21439xlBGPn','now','Failed\x20to\x20read\x20logs:','5150wuOYlu','logFilePath','1348tfuENC','trim','1336909njIZDC','format','combine','log','toISOString','parse','info','logTask','details','yellow','printf','13116184cwfzXu','clear','addColors','message','utf8','transports','success'];a40_0xdad8=function(){return _0x240a46;};return a40_0xdad8();}function a40_0x38c0(_0x327462,_0x4042fe){const _0xdad841=a40_0xdad8();return a40_0x38c0=function(_0x38c0da,_0x576c07){_0x38c0da=_0x38c0da-0x1db;let _0x483db0=_0xdad841[_0x38c0da];return _0x483db0;},a40_0x38c0(_0x327462,_0x4042fe);}import a40_0x2d51fa from'node:path';class Logger{[a40_0x3b978a(0x1eb)];[a40_0x3b978a(0x1f0)];constructor(){const _0x25a23e=a40_0x3b978a;this[_0x25a23e(0x1f0)]='';}[a40_0x3b978a(0x20d)](){const _0x4fb63d=a40_0x3b978a,_0x35f2a1=a40_0x2d51fa[_0x4fb63d(0x20a)](this[_0x4fb63d(0x1f0)]);!a40_0x23a1a4[_0x4fb63d(0x1dd)](_0x35f2a1)&&a40_0x23a1a4['mkdirSync'](_0x35f2a1,{'recursive':!![]});const _0x50d874=a40_0x3eeac6[_0x4fb63d(0x1f4)][_0x4fb63d(0x1f5)](a40_0x3eeac6[_0x4fb63d(0x1f4)][_0x4fb63d(0x1e1)](),a40_0x3eeac6[_0x4fb63d(0x1f4)]['errors']({'stack':!![]}),a40_0x3eeac6[_0x4fb63d(0x1f4)][_0x4fb63d(0x1fd)](_0x33e78d=>{const _0xe142d8=_0x4fb63d,_0x1015fe={'timestamp':_0x33e78d['timestamp']||new Date()[_0xe142d8(0x1f7)](),'level':_0x33e78d[_0xe142d8(0x1ea)]||_0xe142d8(0x1f9),'command':_0x33e78d[_0xe142d8(0x1e2)]||_0xe142d8(0x20c),'message':_0x33e78d[_0xe142d8(0x201)]||'','duration':_0x33e78d[_0xe142d8(0x1e7)]||undefined,'details':_0x33e78d[_0xe142d8(0x1fb)]||undefined};return JSON[_0xe142d8(0x206)](_0x1015fe);}));this[_0x4fb63d(0x1eb)]=a40_0x3eeac6['createLogger']({'level':_0x4fb63d(0x1f9),'format':_0x50d874,'transports':[new a40_0x3eeac6[(_0x4fb63d(0x203))][(_0x4fb63d(0x20e))]({'filename':this[_0x4fb63d(0x1f0)],'level':_0x4fb63d(0x1f9)})],'silent':![]}),a40_0x3eeac6[_0x4fb63d(0x200)]({'success':_0x4fb63d(0x20f),'error':_0x4fb63d(0x1e0),'warn':_0x4fb63d(0x1fc),'info':'blue'});}['setLogPath'](_0x6625b2){const _0x14052d=a40_0x3b978a;this['logFilePath']=a40_0x2d51fa['join'](_0x6625b2,_0x14052d(0x20b)),this[_0x14052d(0x1eb)]&&this[_0x14052d(0x1eb)][_0x14052d(0x1ff)](),this[_0x14052d(0x20d)]();}['info'](_0x4be2ed,_0x51c827,_0x339435){const _0x5aebe0=a40_0x3b978a;if(!this[_0x5aebe0(0x1f0)]||!this[_0x5aebe0(0x1eb)])return;this[_0x5aebe0(0x1eb)][_0x5aebe0(0x1f9)](_0x51c827,{'command':_0x4be2ed,'details':_0x339435});}[a40_0x3b978a(0x204)](_0xfad895,_0x4fa848,_0x2c8199,_0x2eff7a){const _0x35924f=a40_0x3b978a;if(!this[_0x35924f(0x1f0)]||!this[_0x35924f(0x1eb)])return;this[_0x35924f(0x1eb)][_0x35924f(0x1f6)]('info',_0x4fa848,{'level':'success','command':_0xfad895,'duration':_0x2c8199,'details':_0x2eff7a});}[a40_0x3b978a(0x209)](_0x3def66,_0x51e3d6,_0x1cdfd9){const _0x23d2e3=a40_0x3b978a;if(!this[_0x23d2e3(0x1f0)]||!this[_0x23d2e3(0x1eb)])return;this[_0x23d2e3(0x1eb)]['error'](_0x51e3d6,{'command':_0x3def66,'details':_0x1cdfd9});}[a40_0x3b978a(0x1de)](_0x1d93f6,_0xd759b9,_0x327d6b){const _0x5a091b=a40_0x3b978a;if(!this[_0x5a091b(0x1f0)]||!this[_0x5a091b(0x1eb)])return;this['winstonLogger'][_0x5a091b(0x1de)](_0xd759b9,{'command':_0x1d93f6,'details':_0x327d6b});}async[a40_0x3b978a(0x1fa)](_0x37a6ef,_0x3c3ea7,_0x26739a){const _0x51f5ee=a40_0x3b978a,_0x47670a=Date['now']();this[_0x51f5ee(0x1f9)](_0x37a6ef,_0x51f5ee(0x1e5)+_0x3c3ea7);try{const _0x577028=await _0x26739a(),_0x3a537a=Date[_0x51f5ee(0x1ed)]()-_0x47670a;return this[_0x51f5ee(0x204)](_0x37a6ef,'完成:\x20'+_0x3c3ea7,_0x3a537a),_0x577028;}catch(_0x59dd49){const _0x6a91ae=Date['now']()-_0x47670a;this[_0x51f5ee(0x209)](_0x37a6ef,'失败:\x20'+_0x3c3ea7,{'error':_0x59dd49 instanceof Error?_0x59dd49[_0x51f5ee(0x201)]:String(_0x59dd49),'duration':_0x6a91ae});throw _0x59dd49;}}['readLogs'](){const _0x347e09=a40_0x3b978a;try{if(!a40_0x23a1a4[_0x347e09(0x1dd)](this['logFilePath']))return[];const _0x18d8e0=a40_0x23a1a4[_0x347e09(0x207)](this[_0x347e09(0x1f0)],_0x347e09(0x202));return _0x18d8e0['split']('\x0a')['filter'](_0x1c72aa=>_0x1c72aa[_0x347e09(0x1f2)]())[_0x347e09(0x1e6)](_0x3c7ba9=>JSON[_0x347e09(0x1f8)](_0x3c7ba9));}catch(_0x4cf216){return console[_0x347e09(0x1de)](_0x347e09(0x1ee),_0x4cf216),[];}}['clearLogs'](){const _0x3ccaf2=a40_0x3b978a;try{a40_0x23a1a4[_0x3ccaf2(0x1dd)](this[_0x3ccaf2(0x1f0)])&&a40_0x23a1a4[_0x3ccaf2(0x1e3)](this[_0x3ccaf2(0x1f0)],'','utf8');}catch(_0x22029e){console['warn'](_0x3ccaf2(0x1e4),_0x22029e);}}[a40_0x3b978a(0x1db)](){const _0x4edc39=a40_0x3b978a;return this[_0x4edc39(0x1eb)];}}export const logger=new Logger();
1
+ const a43_0x21c955=a43_0x2668;(function(_0x15e629,_0x396152){const _0x5cffbf=a43_0x2668,_0x2d5e57=_0x15e629();while(!![]){try{const _0x11391f=parseInt(_0x5cffbf(0x112))/0x1+parseInt(_0x5cffbf(0x128))/0x2*(parseInt(_0x5cffbf(0x100))/0x3)+-parseInt(_0x5cffbf(0xfb))/0x4*(-parseInt(_0x5cffbf(0x118))/0x5)+parseInt(_0x5cffbf(0x117))/0x6*(parseInt(_0x5cffbf(0x11d))/0x7)+parseInt(_0x5cffbf(0x11c))/0x8*(parseInt(_0x5cffbf(0xfc))/0x9)+parseInt(_0x5cffbf(0x116))/0xa+-parseInt(_0x5cffbf(0x11a))/0xb;if(_0x11391f===_0x396152)break;else _0x2d5e57['push'](_0x2d5e57['shift']());}catch(_0x28ec64){_0x2d5e57['push'](_0x2d5e57['shift']());}}}(a43_0x40e9,0xa31e6));import a43_0x403776 from'winston';import a43_0x6a5944 from'node:fs';function a43_0x40e9(){const _0x1c5a62=['644sBBJOK','initWinstonLogger','createLogger','red','mkdirSync','timestamp','clearLogs','format','success','4517524XdPYMc','9BvQGIB','message','rawCommand','map','1527uDUwbJ','logFilePath','existsSync','setLogPath','unknown','currentRawCommand','writeFileSync','details','File','getWinstonInstance','log','.lovrabet.log','info','开始执行:\x20','blue','combine','失败:\x20','logTask','321236PaoovJ','level','warn','split','10812450Sunijd','4565424ntjuIf','5lDnBVH','readFileSync','41386158jNLVeH','now','7790784ZsjyZj','7ZBvnfQ','utf8','trim','yellow','winstonLogger','error','Failed\x20to\x20clear\x20logs:','printf','stringify','join','clear'];a43_0x40e9=function(){return _0x1c5a62;};return a43_0x40e9();}import a43_0x24b5cd from'node:path';class Logger{[a43_0x21c955(0x121)];[a43_0x21c955(0x101)];[a43_0x21c955(0x105)]='';constructor(){const _0x1d1985=a43_0x21c955;this[_0x1d1985(0x101)]='';}['setRawCommand'](_0x3824ae){const _0x167378=a43_0x21c955;this[_0x167378(0x105)]=_0x3824ae;}['initWinstonLogger'](){const _0x518ac3=a43_0x21c955,_0x431031=a43_0x24b5cd['dirname'](this['logFilePath']);!a43_0x6a5944['existsSync'](_0x431031)&&a43_0x6a5944[_0x518ac3(0x12c)](_0x431031,{'recursive':!![]});const _0x3f3a03=a43_0x403776['format'][_0x518ac3(0x10f)](a43_0x403776[_0x518ac3(0x12f)][_0x518ac3(0x12d)](),a43_0x403776[_0x518ac3(0x12f)]['errors']({'stack':!![]}),a43_0x403776[_0x518ac3(0x12f)][_0x518ac3(0x124)](_0x57653f=>{const _0x4404ce=_0x518ac3,_0x408a6b={'timestamp':_0x57653f[_0x4404ce(0x12d)]||new Date()['toISOString'](),'level':_0x57653f[_0x4404ce(0x113)]||_0x4404ce(0x10c),'command':_0x57653f['command']||_0x4404ce(0x104),'rawCommand':_0x57653f[_0x4404ce(0xfe)]||this[_0x4404ce(0x105)]||undefined,'message':_0x57653f[_0x4404ce(0xfd)]||'','duration':_0x57653f['duration']||undefined,'details':_0x57653f[_0x4404ce(0x107)]||undefined};return JSON[_0x4404ce(0x125)](_0x408a6b);}));this[_0x518ac3(0x121)]=a43_0x403776[_0x518ac3(0x12a)]({'level':_0x518ac3(0x10c),'format':_0x3f3a03,'transports':[new a43_0x403776['transports'][(_0x518ac3(0x108))]({'filename':this['logFilePath'],'level':_0x518ac3(0x10c)})],'silent':![]}),a43_0x403776['addColors']({'success':'green','error':_0x518ac3(0x12b),'warn':_0x518ac3(0x120),'info':_0x518ac3(0x10e)});}[a43_0x21c955(0x103)](_0x451976){const _0x11cdce=a43_0x21c955;this[_0x11cdce(0x101)]=a43_0x24b5cd[_0x11cdce(0x126)](_0x451976,_0x11cdce(0x10b)),this[_0x11cdce(0x121)]&&this[_0x11cdce(0x121)][_0x11cdce(0x127)](),this[_0x11cdce(0x129)]();}[a43_0x21c955(0x10c)](_0x2fce44,_0x56ff44,_0x558073){const _0x1b956e=a43_0x21c955;if(!this[_0x1b956e(0x101)]||!this['winstonLogger'])return;this[_0x1b956e(0x121)][_0x1b956e(0x10c)](_0x56ff44,{'command':_0x2fce44,'details':_0x558073});}[a43_0x21c955(0xfa)](_0x471b71,_0x54bb89,_0x57a5d7,_0x50db52){const _0x26edef=a43_0x21c955;if(!this[_0x26edef(0x101)]||!this['winstonLogger'])return;this[_0x26edef(0x121)][_0x26edef(0x10a)]('info',_0x54bb89,{'level':'success','command':_0x471b71,'duration':_0x57a5d7,'details':_0x50db52});}[a43_0x21c955(0x122)](_0x286eed,_0x55debd,_0x5c892f){const _0x1aa846=a43_0x21c955;if(!this[_0x1aa846(0x101)]||!this[_0x1aa846(0x121)])return;this[_0x1aa846(0x121)][_0x1aa846(0x122)](_0x55debd,{'command':_0x286eed,'details':_0x5c892f});}[a43_0x21c955(0x114)](_0x4d7021,_0x57dad9,_0x6f8b78){const _0x13ede1=a43_0x21c955;if(!this[_0x13ede1(0x101)]||!this[_0x13ede1(0x121)])return;this[_0x13ede1(0x121)][_0x13ede1(0x114)](_0x57dad9,{'command':_0x4d7021,'details':_0x6f8b78});}async[a43_0x21c955(0x111)](_0x5cf242,_0x415fd6,_0x592e20){const _0x15bfb0=a43_0x21c955,_0xded063=Date[_0x15bfb0(0x11b)]();this['info'](_0x5cf242,_0x15bfb0(0x10d)+_0x415fd6);try{const _0x2bc454=await _0x592e20(),_0x92bcc9=Date[_0x15bfb0(0x11b)]()-_0xded063;return this[_0x15bfb0(0xfa)](_0x5cf242,'完成:\x20'+_0x415fd6,_0x92bcc9),_0x2bc454;}catch(_0x23a29f){const _0x3c7303=Date['now']()-_0xded063;this[_0x15bfb0(0x122)](_0x5cf242,_0x15bfb0(0x110)+_0x415fd6,{'error':_0x23a29f instanceof Error?_0x23a29f[_0x15bfb0(0xfd)]:String(_0x23a29f),'duration':_0x3c7303});throw _0x23a29f;}}['readLogs'](){const _0x13b05e=a43_0x21c955;try{if(!a43_0x6a5944[_0x13b05e(0x102)](this[_0x13b05e(0x101)]))return[];const _0x15947c=a43_0x6a5944[_0x13b05e(0x119)](this[_0x13b05e(0x101)],_0x13b05e(0x11e));return _0x15947c[_0x13b05e(0x115)]('\x0a')['filter'](_0x5cfba5=>_0x5cfba5[_0x13b05e(0x11f)]())[_0x13b05e(0xff)](_0x472260=>JSON['parse'](_0x472260));}catch(_0xbfbe95){return console['warn']('Failed\x20to\x20read\x20logs:',_0xbfbe95),[];}}[a43_0x21c955(0x12e)](){const _0x1e6029=a43_0x21c955;try{a43_0x6a5944[_0x1e6029(0x102)](this[_0x1e6029(0x101)])&&a43_0x6a5944[_0x1e6029(0x106)](this[_0x1e6029(0x101)],'',_0x1e6029(0x11e));}catch(_0x1fb8ae){console['warn'](_0x1e6029(0x123),_0x1fb8ae);}}[a43_0x21c955(0x109)](){const _0x3d1878=a43_0x21c955;return this[_0x3d1878(0x121)];}}function a43_0x2668(_0x3711ca,_0x3a129b){const _0x40e9e7=a43_0x40e9();return a43_0x2668=function(_0x2668df,_0x3921a5){_0x2668df=_0x2668df-0xfa;let _0x421de6=_0x40e9e7[_0x2668df];return _0x421de6;},a43_0x2668(_0x3711ca,_0x3a129b);}export const logger=new Logger();
@@ -1 +1 @@
1
- const a41_0x6037ed=a41_0x482e;function a41_0x5d40(){const _0x1b9cbf=['\x20from\x20\x22../pages/','charAt','map','531486GUPgio','writeFile','now','toComponentName','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','addPageRoute','6aMRiWT','2144165GhDsmR','path:\x20\x22','2209536bfuyEE','includes','toUpperCase','addImport','slice','index','src','success','readFile','existsSync','56248vjLqRl','1719oGBkPR','868538knjHXM','router','未找到路由配置的\x20children\x20数组','previewChanges','length','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','开始更新路由配置','info','message','match','路由文件不存在:\x20','lastIndexOf','utf8','indexOf','1944735QNplqZ','路由配置更新失败','routerFilePath','路由配置更新完成','join','promises','index.tsx','addRoute','242308JVdQdX','toLowerCase'];a41_0x5d40=function(){return _0x1b9cbf;};return a41_0x5d40();}(function(_0x1a607c,_0x2511ee){const _0x378993=a41_0x482e,_0x10bb4d=_0x1a607c();while(!![]){try{const _0x26b403=parseInt(_0x378993(0x10a))/0x1+-parseInt(_0x378993(0xf5))/0x2+-parseInt(_0x378993(0xe8))/0x3+-parseInt(_0x378993(0xf0))/0x4+-parseInt(_0x378993(0xfc))/0x5*(parseInt(_0x378993(0xfb))/0x6)+-parseInt(_0x378993(0xfe))/0x7+-parseInt(_0x378993(0x108))/0x8*(-parseInt(_0x378993(0x109))/0x9);if(_0x26b403===_0x2511ee)break;else _0x10bb4d['push'](_0x10bb4d['shift']());}catch(_0x3c2afc){_0x10bb4d['push'](_0x10bb4d['shift']());}}}(a41_0x5d40,0x7837d));function a41_0x482e(_0xd528ce,_0x226d5a){const _0x5d402b=a41_0x5d40();return a41_0x482e=function(_0x482ec9,_0x2bcbe8){_0x482ec9=_0x482ec9-0xe0;let _0x530a18=_0x5d402b[_0x482ec9];return _0x530a18;},a41_0x482e(_0xd528ce,_0x226d5a);}import a41_0x5973f1 from'node:fs';import a41_0x2835fd from'node:path';import{logger}from'./logger.js';export class RouterUpdater{['routerFilePath'];constructor(_0x478503){const _0xe454f8=a41_0x482e;this['routerFilePath']=a41_0x2835fd[_0xe454f8(0xec)](_0x478503,_0xe454f8(0x104),_0xe454f8(0x10b),_0xe454f8(0xee));}async[a41_0x6037ed(0xfa)](_0x38b7aa,_0xde9671){const _0x33e550=a41_0x6037ed;if(!a41_0x5973f1[_0x33e550(0x107)](this[_0x33e550(0xea)]))throw new Error(_0x33e550(0xe4)+this['routerFilePath']);const _0x5cbf2d=Date[_0x33e550(0xf7)]();logger[_0x33e550(0xe1)](_0x33e550(0x10b),_0x33e550(0xe0),{'pageName':_0x38b7aa,'routePath':_0xde9671,'file':this[_0x33e550(0xea)]});try{const _0x44e5b9=await a41_0x5973f1['promises'][_0x33e550(0x106)](this['routerFilePath'],_0x33e550(0xe6)),_0x486c24=this[_0x33e550(0xf8)](_0x38b7aa),_0x3f5e64=this['addImport'](_0x44e5b9,_0x486c24,_0x38b7aa),_0x295f6a=this[_0x33e550(0xef)](_0x3f5e64,_0xde9671,_0x486c24);await a41_0x5973f1[_0x33e550(0xed)][_0x33e550(0xf6)](this['routerFilePath'],_0x295f6a,'utf8');const _0x5a3cd0=Date[_0x33e550(0xf7)]()-_0x5cbf2d;logger[_0x33e550(0x105)](_0x33e550(0x10b),_0x33e550(0xeb),_0x5a3cd0,{'pageName':_0x38b7aa,'routePath':_0xde9671,'componentName':_0x486c24});}catch(_0x2d0e92){const _0x1c04e8=Date[_0x33e550(0xf7)]()-_0x5cbf2d;logger['error'](_0x33e550(0x10b),_0x33e550(0xe9),{'pageName':_0x38b7aa,'routePath':_0xde9671,'error':_0x2d0e92 instanceof Error?_0x2d0e92[_0x33e550(0xe2)]:String(_0x2d0e92),'duration':_0x1c04e8});throw _0x2d0e92;}}[a41_0x6037ed(0xf8)](_0x5bd7ff){const _0x3cd084=a41_0x6037ed;return _0x5bd7ff['split']('-')[_0x3cd084(0xf4)](_0xe8636c=>_0xe8636c[_0x3cd084(0xf3)](0x0)[_0x3cd084(0x100)]()+_0xe8636c['slice'](0x1)[_0x3cd084(0xf1)]())[_0x3cd084(0xec)]('');}[a41_0x6037ed(0x101)](_0x12bbd5,_0x4b7e0c,_0x54b471){const _0x74ff0b=a41_0x6037ed,_0x2dbbbb=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x28c657=_0x12bbd5[_0x74ff0b(0xe3)](_0x2dbbbb)||[],_0x14e97f='import\x20'+_0x4b7e0c+_0x74ff0b(0xf2)+_0x54b471+'\x22;';if(_0x12bbd5[_0x74ff0b(0xff)](_0x14e97f))return _0x12bbd5;if(_0x28c657[_0x74ff0b(0x10e)]>0x0){const _0x7a9f2d=_0x28c657[_0x28c657['length']-0x1];if(_0x7a9f2d){const _0x221640=_0x12bbd5[_0x74ff0b(0xe5)](_0x7a9f2d),_0x1687a5=_0x221640+_0x7a9f2d['length'];return _0x12bbd5[_0x74ff0b(0x102)](0x0,_0x1687a5)+_0x14e97f+'\x0a'+_0x12bbd5[_0x74ff0b(0x102)](_0x1687a5);}}const _0x2b5073=_0x12bbd5[_0x74ff0b(0xe3)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x2b5073&&_0x2b5073[_0x74ff0b(0x103)]!==undefined){const _0x392aad=_0x2b5073['index']+_0x2b5073[0x0][_0x74ff0b(0x10e)];return _0x12bbd5[_0x74ff0b(0x102)](0x0,_0x392aad)+_0x14e97f+'\x0a'+_0x12bbd5[_0x74ff0b(0x102)](_0x392aad);}return _0x12bbd5;}[a41_0x6037ed(0xef)](_0x316974,_0x35397b,_0x2a6cf9){const _0x494327=a41_0x6037ed,_0x34a9d3='\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22'+_0x35397b+_0x494327(0x10f)+_0x2a6cf9+_0x494327(0xf9);if(_0x316974[_0x494327(0xff)](_0x494327(0xfd)+_0x35397b+'\x22'))return _0x316974;const _0x5b74d9=/children:\s*\[([\s\S]*?)\]/,_0x4da162=_0x316974['match'](_0x5b74d9);if(!_0x4da162||_0x4da162[_0x494327(0x103)]===undefined)throw new Error(_0x494327(0x10c));const _0x465d56=_0x4da162[0x1],_0xdb947=_0x4da162[_0x494327(0x103)]+_0x4da162[0x0][_0x494327(0xe7)]('[')+0x1,_0x32282a=_0x465d56?.[_0x494327(0xe3)](/\{[\s\S]*?\},/g)||[];if(_0x32282a['length']>0x0){const _0x12eab8=_0x32282a[_0x32282a[_0x494327(0x10e)]-0x1];if(_0x12eab8){const _0x203f6b=_0x316974[_0x494327(0xe5)](_0x12eab8),_0x5bdeab=_0x203f6b+_0x12eab8[_0x494327(0x10e)];return _0x316974[_0x494327(0x102)](0x0,_0x5bdeab)+'\x0a'+_0x34a9d3+_0x316974['slice'](_0x5bdeab);}}return _0x316974[_0x494327(0x102)](0x0,_0xdb947)+'\x0a'+_0x34a9d3+_0x316974['slice'](_0xdb947);}async[a41_0x6037ed(0x10d)](_0x508090,_0x568585){const _0x115bb3=a41_0x6037ed;if(!a41_0x5973f1[_0x115bb3(0x107)](this['routerFilePath']))throw new Error(_0x115bb3(0xe4)+this['routerFilePath']);const _0x52d707=await a41_0x5973f1[_0x115bb3(0xed)][_0x115bb3(0x106)](this['routerFilePath'],_0x115bb3(0xe6)),_0x2533f0=this['toComponentName'](_0x508090);let _0x28c385=this[_0x115bb3(0x101)](_0x52d707,_0x2533f0,_0x508090);return _0x28c385=this[_0x115bb3(0xef)](_0x28c385,_0x568585,_0x2533f0),_0x28c385;}}
1
+ const a44_0x20c653=a44_0x378e;function a44_0x4b87(){const _0x51f556=['118804jGnCvp','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','5570iSivKq','charAt','addImport','routerFilePath','includes','slice','2727927XmieWB','toComponentName','success','11592GeGJYh','addRoute','info','match','92vwbeWs','lastIndexOf','router','1296IBROvA','路由文件不存在:\x20','now','src','1126696UAWJxy','map','151393suSYkQ','408aigAib','index','3307482FXdgRO','utf8','error','addPageRoute','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','路由配置更新完成','join','index.tsx','existsSync','5robnvq','toUpperCase','promises','length','未找到路由配置的\x20children\x20数组','12374NieSTc','message','路由配置更新失败','previewChanges','readFile','writeFile'];a44_0x4b87=function(){return _0x51f556;};return a44_0x4b87();}(function(_0x29a53d,_0x17b096){const _0x4cea45=a44_0x378e,_0x524bab=_0x29a53d();while(!![]){try{const _0x3af0c8=-parseInt(_0x4cea45(0xa0))/0x1*(-parseInt(_0x4cea45(0x8b))/0x2)+-parseInt(_0x4cea45(0x99))/0x3+-parseInt(_0x4cea45(0xa7))/0x4*(parseInt(_0x4cea45(0x86))/0x5)+-parseInt(_0x4cea45(0x7d))/0x6+parseInt(_0x4cea45(0x91))/0x7*(parseInt(_0x4cea45(0xaa))/0x8)+parseInt(_0x4cea45(0x9c))/0x9*(-parseInt(_0x4cea45(0x93))/0xa)+parseInt(_0x4cea45(0xa9))/0xb*(parseInt(_0x4cea45(0xa3))/0xc);if(_0x3af0c8===_0x17b096)break;else _0x524bab['push'](_0x524bab['shift']());}catch(_0x22acee){_0x524bab['push'](_0x524bab['shift']());}}}(a44_0x4b87,0x70ade));function a44_0x378e(_0x24d1fe,_0x2b2f1d){const _0x4b87c4=a44_0x4b87();return a44_0x378e=function(_0x378e69,_0x424843){_0x378e69=_0x378e69-0x7c;let _0x31dce3=_0x4b87c4[_0x378e69];return _0x31dce3;},a44_0x378e(_0x24d1fe,_0x2b2f1d);}import a44_0x32cb1b from'node:fs';import a44_0x59ac12 from'node:path';import{logger}from'./logger.js';export class RouterUpdater{[a44_0x20c653(0x96)];constructor(_0x522f68){const _0x2e368c=a44_0x20c653;this[_0x2e368c(0x96)]=a44_0x59ac12[_0x2e368c(0x83)](_0x522f68,_0x2e368c(0xa6),_0x2e368c(0xa2),_0x2e368c(0x84));}async[a44_0x20c653(0x80)](_0x1dd877,_0x1b5a32){const _0x26b5eb=a44_0x20c653;if(!a44_0x32cb1b[_0x26b5eb(0x85)](this['routerFilePath']))throw new Error(_0x26b5eb(0xa4)+this[_0x26b5eb(0x96)]);const _0x5da18b=Date[_0x26b5eb(0xa5)]();logger[_0x26b5eb(0x9e)](_0x26b5eb(0xa2),'开始更新路由配置',{'pageName':_0x1dd877,'routePath':_0x1b5a32,'file':this['routerFilePath']});try{const _0x5b5f67=await a44_0x32cb1b[_0x26b5eb(0x88)]['readFile'](this['routerFilePath'],'utf8'),_0x1f8812=this[_0x26b5eb(0x9a)](_0x1dd877),_0x566128=this[_0x26b5eb(0x95)](_0x5b5f67,_0x1f8812,_0x1dd877),_0x2cc3e8=this[_0x26b5eb(0x9d)](_0x566128,_0x1b5a32,_0x1f8812);await a44_0x32cb1b[_0x26b5eb(0x88)][_0x26b5eb(0x90)](this[_0x26b5eb(0x96)],_0x2cc3e8,_0x26b5eb(0x7e));const _0x466522=Date[_0x26b5eb(0xa5)]()-_0x5da18b;logger[_0x26b5eb(0x9b)](_0x26b5eb(0xa2),_0x26b5eb(0x82),_0x466522,{'pageName':_0x1dd877,'routePath':_0x1b5a32,'componentName':_0x1f8812});}catch(_0x56817d){const _0x42eb52=Date['now']()-_0x5da18b;logger[_0x26b5eb(0x7f)]('router',_0x26b5eb(0x8d),{'pageName':_0x1dd877,'routePath':_0x1b5a32,'error':_0x56817d instanceof Error?_0x56817d[_0x26b5eb(0x8c)]:String(_0x56817d),'duration':_0x42eb52});throw _0x56817d;}}[a44_0x20c653(0x9a)](_0x594407){const _0x352463=a44_0x20c653;return _0x594407['split']('-')[_0x352463(0xa8)](_0x132665=>_0x132665[_0x352463(0x94)](0x0)[_0x352463(0x87)]()+_0x132665[_0x352463(0x98)](0x1)['toLowerCase']())[_0x352463(0x83)]('');}['addImport'](_0x528b79,_0x10efd6,_0x1527d3){const _0x39b33b=a44_0x20c653,_0x16b7e2=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x1a99b9=_0x528b79[_0x39b33b(0x9f)](_0x16b7e2)||[],_0x3e8456='import\x20'+_0x10efd6+'\x20from\x20\x22../pages/'+_0x1527d3+'\x22;';if(_0x528b79[_0x39b33b(0x97)](_0x3e8456))return _0x528b79;if(_0x1a99b9[_0x39b33b(0x89)]>0x0){const _0x312e5f=_0x1a99b9[_0x1a99b9[_0x39b33b(0x89)]-0x1];if(_0x312e5f){const _0x82123=_0x528b79['lastIndexOf'](_0x312e5f),_0x256822=_0x82123+_0x312e5f[_0x39b33b(0x89)];return _0x528b79[_0x39b33b(0x98)](0x0,_0x256822)+_0x3e8456+'\x0a'+_0x528b79[_0x39b33b(0x98)](_0x256822);}}const _0x4597ab=_0x528b79[_0x39b33b(0x9f)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x4597ab&&_0x4597ab[_0x39b33b(0x7c)]!==undefined){const _0x3faf0a=_0x4597ab[_0x39b33b(0x7c)]+_0x4597ab[0x0][_0x39b33b(0x89)];return _0x528b79['slice'](0x0,_0x3faf0a)+_0x3e8456+'\x0a'+_0x528b79['slice'](_0x3faf0a);}return _0x528b79;}[a44_0x20c653(0x9d)](_0x2bd556,_0x5b2cb4,_0xbdf9e8){const _0x599567=a44_0x20c653,_0x5449fd=_0x599567(0x81)+_0x5b2cb4+_0x599567(0x92)+_0xbdf9e8+'\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},';if(_0x2bd556[_0x599567(0x97)]('path:\x20\x22'+_0x5b2cb4+'\x22'))return _0x2bd556;const _0x23f03c=/children:\s*\[([\s\S]*?)\]/,_0x41afd7=_0x2bd556[_0x599567(0x9f)](_0x23f03c);if(!_0x41afd7||_0x41afd7[_0x599567(0x7c)]===undefined)throw new Error(_0x599567(0x8a));const _0x42d8a7=_0x41afd7[0x1],_0x24569d=_0x41afd7[_0x599567(0x7c)]+_0x41afd7[0x0]['indexOf']('[')+0x1,_0x4892d0=_0x42d8a7?.['match'](/\{[\s\S]*?\},/g)||[];if(_0x4892d0[_0x599567(0x89)]>0x0){const _0xf51501=_0x4892d0[_0x4892d0[_0x599567(0x89)]-0x1];if(_0xf51501){const _0x420f1d=_0x2bd556[_0x599567(0xa1)](_0xf51501),_0x49d84f=_0x420f1d+_0xf51501[_0x599567(0x89)];return _0x2bd556[_0x599567(0x98)](0x0,_0x49d84f)+'\x0a'+_0x5449fd+_0x2bd556[_0x599567(0x98)](_0x49d84f);}}return _0x2bd556[_0x599567(0x98)](0x0,_0x24569d)+'\x0a'+_0x5449fd+_0x2bd556[_0x599567(0x98)](_0x24569d);}async[a44_0x20c653(0x8e)](_0x329486,_0x40b827){const _0x3b779f=a44_0x20c653;if(!a44_0x32cb1b[_0x3b779f(0x85)](this[_0x3b779f(0x96)]))throw new Error(_0x3b779f(0xa4)+this['routerFilePath']);const _0x1e7f72=await a44_0x32cb1b['promises'][_0x3b779f(0x8f)](this['routerFilePath'],_0x3b779f(0x7e)),_0x2f71ed=this[_0x3b779f(0x9a)](_0x329486);let _0x2a5706=this[_0x3b779f(0x95)](_0x1e7f72,_0x2f71ed,_0x329486);return _0x2a5706=this[_0x3b779f(0x9d)](_0x2a5706,_0x40b827,_0x2f71ed),_0x2a5706;}}
@@ -1 +1 @@
1
- function a42_0x532e(){const _0x198f08=['mkdir','split','map','.tpl','9656460eigSKd','message','.tsx','processFile','writeFile','readFile','模板内容替换失败','isDirectory','108oTyzZv','toISOString','keys','stringify','.json','name','replaceApiContent','.ts','template','now','模板内容替换完成','8134392tegRbk','6121350ZRUISk','.js','numeric','toDisplayTitle','toUpperCase','includes','.jsx','YourModel','toLowerCase','toLocaleString','pop','api','readdir','10293864JMasQX','promises','info','charAt','endsWith','350623npdrbU','2-digit','.scss','success','开始处理模板内容替换','toLocaleDateString','48466gnSFJQ','slice','default','processDirectory','6231028nojcll','utf8','toComponentName','join','replace'];a42_0x532e=function(){return _0x198f08;};return a42_0x532e();}const a42_0x1e044f=a42_0x16e3;(function(_0x1abf7e,_0x10fcf7){const _0x36f07f=a42_0x16e3,_0x3b538b=_0x1abf7e();while(!![]){try{const _0x5c052c=parseInt(_0x36f07f(0x177))/0x1+-parseInt(_0x36f07f(0x17d))/0x2*(parseInt(_0x36f07f(0x159))/0x3)+parseInt(_0x36f07f(0x148))/0x4+-parseInt(_0x36f07f(0x165))/0x5+parseInt(_0x36f07f(0x151))/0x6+-parseInt(_0x36f07f(0x172))/0x7+parseInt(_0x36f07f(0x164))/0x8;if(_0x5c052c===_0x10fcf7)break;else _0x3b538b['push'](_0x3b538b['shift']());}catch(_0x57bc14){_0x3b538b['push'](_0x3b538b['shift']());}}}(a42_0x532e,0xec2d3));function a42_0x16e3(_0x5a1a77,_0x59fa38){const _0x532ecc=a42_0x532e();return a42_0x16e3=function(_0x16e3a7,_0x5e55f6){_0x16e3a7=_0x16e3a7-0x147;let _0x340cd2=_0x532ecc[_0x16e3a7];return _0x340cd2;},a42_0x16e3(_0x5a1a77,_0x59fa38);}import a42_0xb2cc0 from'node:fs';import a42_0x3eb393 from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static[a42_0x1e044f(0x14a)](_0x4555b8){const _0xb22fbb=a42_0x1e044f,_0x5d92aa=_0x4555b8[_0xb22fbb(0x14e)]('/')[_0xb22fbb(0x16f)]()||_0x4555b8;return _0x5d92aa['split']('-')[_0xb22fbb(0x14f)](_0x84cfc0=>_0x84cfc0['charAt'](0x0)[_0xb22fbb(0x169)]()+_0x84cfc0[_0xb22fbb(0x17e)](0x1)[_0xb22fbb(0x16d)]())[_0xb22fbb(0x14b)]('');}static[a42_0x1e044f(0x168)](_0x451aca){const _0x3516fe=a42_0x1e044f,_0x34e514=_0x451aca[_0x3516fe(0x14e)]('/')[_0x3516fe(0x16f)]()||_0x451aca;return _0x34e514['split']('-')[_0x3516fe(0x14f)](_0x1332ca=>_0x1332ca[_0x3516fe(0x175)](0x0)['toUpperCase']()+_0x1332ca[_0x3516fe(0x17e)](0x1)[_0x3516fe(0x16d)]())[_0x3516fe(0x14b)]('\x20');}static['replaceContent'](_0x15d584,_0x2c13d2,_0x43ddf6){const _0x3ff237=a42_0x1e044f,_0x236d81=this['toComponentName'](_0x2c13d2),_0xcc0d5f=this['toDisplayTitle'](_0x2c13d2),_0x4a99df=new Date(),_0xcce2f2=_0x4a99df[_0x3ff237(0x16e)](undefined,{'year':_0x3ff237(0x167),'month':_0x3ff237(0x178),'day':_0x3ff237(0x178),'hour':_0x3ff237(0x178),'minute':'2-digit','second':_0x3ff237(0x178),'hour12':![]})[_0x3ff237(0x14c)](/\//g,'-'),_0xd3794d=_0x4a99df[_0x3ff237(0x17c)](undefined,{'year':_0x3ff237(0x167),'month':_0x3ff237(0x178),'day':'2-digit'})[_0x3ff237(0x14c)](/\//g,'-'),_0x280595=_0x4a99df['toLocaleTimeString'](undefined,{'hour12':![]});let _0x4a1a49=_0x15d584[_0x3ff237(0x14c)](/\{ComponentName\}/g,_0x236d81)[_0x3ff237(0x14c)](/\{DisplayTitle\}/g,_0xcc0d5f)[_0x3ff237(0x14c)](/\{PageName\}/g,_0x2c13d2)[_0x3ff237(0x14c)](/\{TemplateName\}/g,_0x43ddf6)[_0x3ff237(0x14c)](/\{CreatedAt\}/g,_0xcce2f2)[_0x3ff237(0x14c)](/\{CreatedDate\}/g,_0xd3794d)['replace'](/\{CreatedTime\}/g,_0x280595);return _0x4a1a49;}static[a42_0x1e044f(0x15f)](_0x5254f7,_0x4ae240,_0x2fbdac,_0x1688c0,_0x1fc4f5,_0x1a3f14,_0x4ff997){const _0xec6a69=a42_0x1e044f,_0x5d3ff1=new Date(),_0x5c8770=_0x5d3ff1[_0xec6a69(0x15a)](),_0xd29412=JSON[_0xec6a69(0x15c)](_0x2fbdac,null,0x2)[_0xec6a69(0x14e)]('\x0a')[_0xec6a69(0x17e)](0x1,-0x1)[_0xec6a69(0x14f)](_0x2e3e96=>_0x2e3e96[_0xec6a69(0x14c)](/^ /,'\x20\x20\x20\x20'))[_0xec6a69(0x14b)]('\x0a'),_0x34cc68=_0x1688c0||Object[_0xec6a69(0x15b)](_0x2fbdac)[0x0]||_0xec6a69(0x16c);let _0x447db3=_0x5254f7[_0xec6a69(0x14c)](/\{AppCode\}/g,_0x4ae240)['replace'](/\{ModelConfigs\}/g,_0xd29412)['replace'](/\{ExampleModelName\}/g,_0x34cc68)['replace'](/\{ApiFileName\}/g,_0x1fc4f5||_0xec6a69(0x170))[_0xec6a69(0x14c)](/\{ConfigName\}/g,_0x1a3f14||_0xec6a69(0x17f))[_0xec6a69(0x14c)](/\{ClientConfigParam\}/g,_0x4ff997||'')[_0xec6a69(0x14c)](/\{CreatedAt\}/g,_0x5c8770);return _0x447db3;}static async['processTemplate'](_0x3aab97,_0x3ec8cd,_0x18076c,_0x2cb147,_0x345596=!![]){const _0x201408=a42_0x1e044f,_0x8a3ba=Date[_0x201408(0x162)]();try{_0x345596&&logger[_0x201408(0x174)]('template',_0x201408(0x17b),{'templatePath':_0x3aab97,'targetPath':_0x3ec8cd,'pageName':_0x18076c,'templateName':_0x2cb147});await a42_0xb2cc0['promises'][_0x201408(0x14d)](_0x3ec8cd,{'recursive':!![]}),await this[_0x201408(0x147)](_0x3aab97,_0x3ec8cd,_0x18076c,_0x2cb147);if(_0x345596){const _0x37432f=Date['now']()-_0x8a3ba;logger[_0x201408(0x17a)](_0x201408(0x161),_0x201408(0x163),_0x37432f,{'pageName':_0x18076c,'templateName':_0x2cb147});}}catch(_0x52c9a7){if(_0x345596){const _0x17061f=Date[_0x201408(0x162)]()-_0x8a3ba;logger['error'](_0x201408(0x161),_0x201408(0x157),{'templatePath':_0x3aab97,'targetPath':_0x3ec8cd,'pageName':_0x18076c,'templateName':_0x2cb147,'error':_0x52c9a7 instanceof Error?_0x52c9a7[_0x201408(0x152)]:String(_0x52c9a7),'duration':_0x17061f});}throw _0x52c9a7;}}static async[a42_0x1e044f(0x147)](_0x338890,_0x5fc9b,_0x2ecb22,_0x1f3b0b){const _0x38b0eb=a42_0x1e044f,_0x39a386=await a42_0xb2cc0[_0x38b0eb(0x173)][_0x38b0eb(0x171)](_0x338890,{'withFileTypes':!![]});for(const _0x4eaea1 of _0x39a386){const _0x3033e6=a42_0x3eb393[_0x38b0eb(0x14b)](_0x338890,_0x4eaea1['name']);let _0x216533=a42_0x3eb393[_0x38b0eb(0x14b)](_0x5fc9b,_0x4eaea1[_0x38b0eb(0x15e)]);_0x4eaea1[_0x38b0eb(0x15e)][_0x38b0eb(0x176)](_0x38b0eb(0x150))&&(_0x216533=a42_0x3eb393[_0x38b0eb(0x14b)](_0x5fc9b,_0x4eaea1[_0x38b0eb(0x15e)][_0x38b0eb(0x14c)](/\.tpl$/,'')));if(_0x4eaea1[_0x38b0eb(0x158)]())await a42_0xb2cc0['promises']['mkdir'](_0x216533,{'recursive':!![]}),await this[_0x38b0eb(0x147)](_0x3033e6,_0x216533,_0x2ecb22,_0x1f3b0b);else _0x4eaea1['isFile']()&&await this[_0x38b0eb(0x154)](_0x3033e6,_0x216533,_0x2ecb22,_0x1f3b0b);}}static async[a42_0x1e044f(0x154)](_0x3305e0,_0x8824ee,_0x19771e,_0xf33796){const _0x34feba=a42_0x1e044f,_0x4d2dac=a42_0x3eb393['extname'](_0x3305e0)['toLowerCase']();_0x3305e0['endsWith'](_0x34feba(0x150))&&(_0x8824ee=_0x8824ee[_0x34feba(0x14c)](/\.tpl$/,''));const _0x9bc3d7=[_0x34feba(0x153),_0x34feba(0x160),_0x34feba(0x16b),_0x34feba(0x166),_0x34feba(0x15d),'.md','.css',_0x34feba(0x179),_0x34feba(0x150)];if(_0x9bc3d7[_0x34feba(0x16a)](_0x4d2dac)||_0x3305e0['endsWith'](_0x34feba(0x150))){const _0x37fb9d=await a42_0xb2cc0[_0x34feba(0x173)][_0x34feba(0x156)](_0x3305e0,_0x34feba(0x149)),_0x5a38dd=this['replaceContent'](_0x37fb9d,_0x19771e,_0xf33796);await a42_0xb2cc0[_0x34feba(0x173)][_0x34feba(0x155)](_0x8824ee,_0x5a38dd,'utf8');}else await a42_0xb2cc0[_0x34feba(0x173)]['copyFile'](_0x3305e0,_0x8824ee);}}
1
+ const a45_0x386e6e=a45_0x390c;(function(_0x1aaeb6,_0x21aa2e){const _0x2ce5c4=a45_0x390c,_0x403526=_0x1aaeb6();while(!![]){try{const _0x4d6f3c=parseInt(_0x2ce5c4(0x210))/0x1*(-parseInt(_0x2ce5c4(0x1e6))/0x2)+parseInt(_0x2ce5c4(0x200))/0x3+-parseInt(_0x2ce5c4(0x1f1))/0x4*(-parseInt(_0x2ce5c4(0x1dc))/0x5)+parseInt(_0x2ce5c4(0x1d4))/0x6+-parseInt(_0x2ce5c4(0x1ee))/0x7+-parseInt(_0x2ce5c4(0x1f0))/0x8+-parseInt(_0x2ce5c4(0x1d8))/0x9*(-parseInt(_0x2ce5c4(0x1e5))/0xa);if(_0x4d6f3c===_0x21aa2e)break;else _0x403526['push'](_0x403526['shift']());}catch(_0x25674a){_0x403526['push'](_0x403526['shift']());}}}(a45_0xc327,0x6ba89));function a45_0x390c(_0x4676cc,_0x3b9833){const _0xc327c4=a45_0xc327();return a45_0x390c=function(_0x390cdf,_0x4c50f8){_0x390cdf=_0x390cdf-0x1d4;let _0xbc5880=_0xc327c4[_0x390cdf];return _0xbc5880;},a45_0x390c(_0x4676cc,_0x3b9833);}import a45_0x3c2e75 from'node:fs';import a45_0x5642cd from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static['toComponentName'](_0x4b71ac){const _0x299abc=a45_0x390c,_0x4a2d5c=_0x4b71ac['split']('/')['pop']()||_0x4b71ac;return _0x4a2d5c['split']('-')['map'](_0x959d5a=>_0x959d5a['charAt'](0x0)['toUpperCase']()+_0x959d5a['slice'](0x1)[_0x299abc(0x212)]())[_0x299abc(0x1fb)]('');}static['toDisplayTitle'](_0x2a3492){const _0x2135c8=a45_0x390c,_0x57073f=_0x2a3492['split']('/')[_0x2135c8(0x1ff)]()||_0x2a3492;return _0x57073f['split']('-')[_0x2135c8(0x1ed)](_0x202ad1=>_0x202ad1['charAt'](0x0)[_0x2135c8(0x1db)]()+_0x202ad1['slice'](0x1)[_0x2135c8(0x212)]())[_0x2135c8(0x1fb)]('\x20');}static[a45_0x386e6e(0x206)](_0x3275d6,_0xbe43d4,_0x1aa976){const _0x43ba5f=a45_0x386e6e,_0x152112=this[_0x43ba5f(0x1ec)](_0xbe43d4),_0x20533c=this[_0x43ba5f(0x1dd)](_0xbe43d4),_0x382331=new Date(),_0x5764fa=_0x382331[_0x43ba5f(0x20c)](undefined,{'year':_0x43ba5f(0x203),'month':'2-digit','day':'2-digit','hour':_0x43ba5f(0x1f8),'minute':_0x43ba5f(0x1f8),'second':_0x43ba5f(0x1f8),'hour12':![]})[_0x43ba5f(0x1f7)](/\//g,'-'),_0x364796=_0x382331[_0x43ba5f(0x1d9)](undefined,{'year':_0x43ba5f(0x203),'month':_0x43ba5f(0x1f8),'day':'2-digit'})[_0x43ba5f(0x1f7)](/\//g,'-'),_0x520d76=_0x382331[_0x43ba5f(0x1da)](undefined,{'hour12':![]});let _0x32f76c=_0x3275d6[_0x43ba5f(0x1f7)](/\{ComponentName\}/g,_0x152112)[_0x43ba5f(0x1f7)](/\{DisplayTitle\}/g,_0x20533c)[_0x43ba5f(0x1f7)](/\{PageName\}/g,_0xbe43d4)[_0x43ba5f(0x1f7)](/\{TemplateName\}/g,_0x1aa976)[_0x43ba5f(0x1f7)](/\{CreatedAt\}/g,_0x5764fa)[_0x43ba5f(0x1f7)](/\{CreatedDate\}/g,_0x364796)[_0x43ba5f(0x1f7)](/\{CreatedTime\}/g,_0x520d76);return _0x32f76c;}static[a45_0x386e6e(0x1d5)](_0x160108,_0x4fc5e2,_0x9351af,_0x1fbc52,_0x18c929,_0x4974e2,_0x4dd800){const _0x85763a=a45_0x386e6e,_0x129265=new Date(),_0x1d24af=_0x129265[_0x85763a(0x1e3)](),_0x278257=JSON[_0x85763a(0x20a)](_0x9351af,null,0x2)[_0x85763a(0x1f2)]('\x0a')[_0x85763a(0x1ef)](0x1,-0x1)[_0x85763a(0x1ed)](_0x54c46b=>_0x54c46b[_0x85763a(0x1f7)](/^ /,_0x85763a(0x20e)))[_0x85763a(0x1fb)]('\x0a'),_0x47f506=_0x1fbc52||Object[_0x85763a(0x1e1)](_0x9351af)[0x0]||_0x85763a(0x1fe);let _0x191926=_0x160108[_0x85763a(0x1f7)](/\{AppCode\}/g,_0x4fc5e2)['replace'](/\{ModelConfigs\}/g,_0x278257)[_0x85763a(0x1f7)](/\{ExampleModelName\}/g,_0x47f506)[_0x85763a(0x1f7)](/\{ApiFileName\}/g,_0x18c929||_0x85763a(0x20b))[_0x85763a(0x1f7)](/\{ConfigName\}/g,_0x4974e2||_0x85763a(0x1d7))[_0x85763a(0x1f7)](/\{ClientConfigParam\}/g,_0x4dd800||'')['replace'](/\{CreatedAt\}/g,_0x1d24af);return _0x191926;}static async['processTemplate'](_0x51f740,_0x58b6fe,_0xe43f16,_0x5e29ba,_0xe97ffa=!![]){const _0x35ccb2=a45_0x386e6e,_0x1291c3=Date['now']();try{_0xe97ffa&&logger[_0x35ccb2(0x211)]('template','开始处理模板内容替换',{'templatePath':_0x51f740,'targetPath':_0x58b6fe,'pageName':_0xe43f16,'templateName':_0x5e29ba});await a45_0x3c2e75[_0x35ccb2(0x204)]['mkdir'](_0x58b6fe,{'recursive':!![]}),await this[_0x35ccb2(0x208)](_0x51f740,_0x58b6fe,_0xe43f16,_0x5e29ba);if(_0xe97ffa){const _0x225d42=Date[_0x35ccb2(0x1e4)]()-_0x1291c3;logger['success'](_0x35ccb2(0x213),_0x35ccb2(0x1fd),_0x225d42,{'pageName':_0xe43f16,'templateName':_0x5e29ba});}}catch(_0x36891c){if(_0xe97ffa){const _0x7be55f=Date[_0x35ccb2(0x1e4)]()-_0x1291c3;logger[_0x35ccb2(0x1fc)]('template',_0x35ccb2(0x20f),{'templatePath':_0x51f740,'targetPath':_0x58b6fe,'pageName':_0xe43f16,'templateName':_0x5e29ba,'error':_0x36891c instanceof Error?_0x36891c[_0x35ccb2(0x1e8)]:String(_0x36891c),'duration':_0x7be55f});}throw _0x36891c;}}static async['processDirectory'](_0x419192,_0x5c114f,_0x1d521c,_0x4e2e40){const _0x4456b8=a45_0x386e6e,_0x579a6e=await a45_0x3c2e75[_0x4456b8(0x204)][_0x4456b8(0x1e7)](_0x419192,{'withFileTypes':!![]});for(const _0xc68cc2 of _0x579a6e){const _0x40d0f7=a45_0x5642cd['join'](_0x419192,_0xc68cc2['name']);let _0x2a923c=a45_0x5642cd[_0x4456b8(0x1fb)](_0x5c114f,_0xc68cc2[_0x4456b8(0x207)]);_0xc68cc2[_0x4456b8(0x207)][_0x4456b8(0x1de)]('.tpl')&&(_0x2a923c=a45_0x5642cd[_0x4456b8(0x1fb)](_0x5c114f,_0xc68cc2['name'][_0x4456b8(0x1f7)](/\.tpl$/,'')));if(_0xc68cc2[_0x4456b8(0x1f6)]())await a45_0x3c2e75['promises'][_0x4456b8(0x1d6)](_0x2a923c,{'recursive':!![]}),await this['processDirectory'](_0x40d0f7,_0x2a923c,_0x1d521c,_0x4e2e40);else _0xc68cc2[_0x4456b8(0x20d)]()&&await this[_0x4456b8(0x1f4)](_0x40d0f7,_0x2a923c,_0x1d521c,_0x4e2e40);}}static async[a45_0x386e6e(0x1f4)](_0xfc0636,_0x4a8a0a,_0x562956,_0x498b7f){const _0x112b16=a45_0x386e6e,_0x2f20f1=a45_0x5642cd[_0x112b16(0x1f9)](_0xfc0636)[_0x112b16(0x212)]();_0xfc0636['endsWith'](_0x112b16(0x205))&&(_0x4a8a0a=_0x4a8a0a[_0x112b16(0x1f7)](/\.tpl$/,''));const _0x1771fa=[_0x112b16(0x1e2),_0x112b16(0x1ea),_0x112b16(0x1f3),_0x112b16(0x209),_0x112b16(0x1df),_0x112b16(0x1e9),_0x112b16(0x1f5),_0x112b16(0x1e0),_0x112b16(0x205)];if(_0x1771fa[_0x112b16(0x201)](_0x2f20f1)||_0xfc0636[_0x112b16(0x1de)]('.tpl')){const _0x42fb9a=await a45_0x3c2e75['promises'][_0x112b16(0x202)](_0xfc0636,_0x112b16(0x1fa)),_0x44d9d7=this[_0x112b16(0x206)](_0x42fb9a,_0x562956,_0x498b7f);await a45_0x3c2e75[_0x112b16(0x204)]['writeFile'](_0x4a8a0a,_0x44d9d7,'utf8');}else await a45_0x3c2e75[_0x112b16(0x204)][_0x112b16(0x1eb)](_0xfc0636,_0x4a8a0a);}}function a45_0xc327(){const _0x5d2c8d=['.md','.ts','copyFile','toComponentName','map','4390603dYCnka','slice','4211408fqmvei','8lmmsZv','split','.jsx','processFile','.css','isDirectory','replace','2-digit','extname','utf8','join','error','模板内容替换完成','YourModel','pop','998868QzpZef','includes','readFile','numeric','promises','.tpl','replaceContent','name','processDirectory','.js','stringify','api','toLocaleString','isFile','\x20\x20\x20\x20','模板内容替换失败','841vWcOIV','info','toLowerCase','template','2713698eYehNU','replaceApiContent','mkdir','default','4995576vLlOKb','toLocaleDateString','toLocaleTimeString','toUpperCase','1386385FyHacL','toDisplayTitle','endsWith','.json','.scss','keys','.tsx','toISOString','now','20LPikHw','2034JkvjjS','readdir','message'];a45_0xc327=function(){return _0x5d2c8d;};return a45_0xc327();}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/cli",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "bin": {
6
6
  "lovrabet": "lib/cli.js"
@@ -4,86 +4,75 @@
4
4
  * Created: {CreatedAt}
5
5
  * Page: {PageName}
6
6
  */
7
- import React, { useState, useEffect } from "react";
8
- import { Card, Button, Space, Typography, Alert } from "antd";
9
- import { ReloadOutlined, ApiOutlined } from "@ant-design/icons";
7
+ import React, { useState } from "react";
8
+ import { Button, Typography, Table, message } from "antd";
9
+ import { ApiOutlined } from "@ant-design/icons";
10
10
  import { lovrabetClient } from "../../api/client";
11
+ import { SortOrder } from "@lovrabet/sdk";
11
12
 
12
13
  const { Title, Paragraph, Text } = Typography;
13
14
 
14
15
  function {ComponentName}() {
15
16
  const [loading, setLoading] = useState(false);
16
17
  const [data, setData] = useState<any>({});
18
+ const [columns, setColumns] = useState<any[]>([]);
17
19
 
18
20
  // SDK 调用示例
19
21
  const fetchData = async () => {
20
22
  setLoading(true);
21
23
  try {
22
- // 动态获取第一个模型
24
+ // 动态获取第一个模型,请以实际业务诉求自行修改
23
25
  const firstModel = lovrabetClient.getModel(0);
24
- const data = await firstModel.getList({
25
- currentPage: 1,
26
- pageSize: 10,
27
- });
28
- setData(data || []);
26
+ const data = await firstModel.getList(
27
+ {
28
+ currentPage: 1,
29
+ pageSize: 10,
30
+ },
31
+ // 排序,请以实际业务字段自行修改
32
+ [{ id: SortOrder.ASC }],
33
+ );
34
+ processResponse(data, "获取数据成功");
29
35
  } catch (error) {
30
36
  console.error("获取数据失败:", error);
31
37
  } finally {
32
38
  setLoading(false);
33
39
  }
34
40
  };
41
+ /**
42
+ * 处理响应数据
43
+ */
44
+ const processResponse = (response: any, successMessage: string) => {
45
+ // 处理返回的数据
46
+ setData(response.tableData || []);
47
+
48
+ // 动态生成表格列
49
+ if (response.tableColumns) {
50
+ const tableColumns = response.tableColumns.map((column: any) => ({
51
+ title: column.title || column.dataIndex,
52
+ dataIndex: column.dataIndex,
53
+ key: column.dataIndex,
54
+ }));
55
+ setColumns(tableColumns);
56
+ }
57
+
58
+ message.success(successMessage);
59
+ };
35
60
 
36
61
  return (
37
62
  <div style={{ padding: "24px" }}>
38
63
  <Title level={2}>
39
- <ApiOutlined /> {DisplayTitle}
64
+ <ApiOutlined /> Fetch Data - {PageName}
40
65
  </Title>
41
66
  <Paragraph style={{ color: "#666", marginBottom: 24 }}>
42
67
  使用 lovrabetClient 调用 SDK 的示例页面
43
68
  </Paragraph>
44
69
 
45
- <Space direction="vertical" size="large" style={{ width: "100%" }}>
46
- <Alert
47
- message="SDK 调用示例"
48
- description={
49
- <div style={{ margin: "8px 0" }}>
50
- <Text code>lovrabetClient.models.YourModel.getList()</Text> - 获取数据列表
51
- <br />
52
- <Text code>lovrabetClient.models.YourModel.getOne()</Text> - 获取单条数据
53
- <br />
54
- <Text code>lovrabetClient.models.YourModel.create()</Text> - 创建数据
55
- <br />
56
- <Text code>lovrabetClient.models.YourModel.update()</Text> - 更新数据
57
- <br />
58
- <Text code>lovrabetClient.models.YourModel.delete()</Text> - 删除数据
59
- </div>
60
- }
61
- type="info"
62
- showIcon
63
- />
64
-
65
- <Card title="基础操作" size="small">
66
- <Space>
67
- <Button
68
- type="primary"
69
- icon={<ReloadOutlined />}
70
- loading={loading}
71
- onClick={fetchData}
72
- >
73
- 获取数据
74
- </Button>
75
- <Text type="secondary">数据条数: {data?.tableData?.length ?? 0}</Text>
76
- </Space>
77
- </Card>
78
-
79
- <Card title="接口数据" size="small">
80
- <Space>
81
- <Text type="secondary">{JSON.stringify(data,null,4)}</Text>
82
- </Space>
83
- </Card>
84
-
85
- {/* 可以在这里添加更多功能 */}
86
- </Space>
70
+ <p>
71
+ <Button onClick={fetchData} type="primary">
72
+ Fetch Data
73
+ </Button>
74
+ </p>
75
+ {data.length > 0 && <Table dataSource={data} columns={columns} />}
87
76
  </div>
88
77
  );
89
78
  }
@@ -10,7 +10,7 @@
10
10
  "dependencies": {
11
11
  "@ant-design/icons": "^6.0.0",
12
12
  "@ice/stark-app": "^1.5.0",
13
- "@lovrabet/sdk": "^1.1.8",
13
+ "@lovrabet/sdk": "^1.1.12",
14
14
  "antd": "^5.26.7",
15
15
  "echarts": "^5.6.0",
16
16
  "echarts-for-react": "^3.0.2",
@@ -450,9 +450,9 @@
450
450
  }
451
451
  },
452
452
  "node_modules/@lovrabet/sdk": {
453
- "version": "1.1.8",
454
- "resolved": "https://registry.npmjs.org/@lovrabet/sdk/-/sdk-1.1.8.tgz",
455
- "integrity": "sha512-44oN2ecAhsQhm0NG68CwU8o/vQoS3dW0IZnFq9OR4msR8Mb+TiHK2NWgkRcevxFeCSLO/EI6uVA3PEhWVhLsZQ==",
453
+ "version": "1.1.12",
454
+ "resolved": "https://registry.npmjs.org/@lovrabet/sdk/-/sdk-1.1.12.tgz",
455
+ "integrity": "sha512-+S+jt5dWnipGGl7nR4sYs9Mw97Wgdtq2o08QZfDNHHRCXjVwXAWtd6vxXYkeUZ8nJ+4r+/TrYT6023rHA8kM/Q==",
456
456
  "peerDependencies": {
457
457
  "typescript": "^5"
458
458
  }
@@ -11,7 +11,7 @@
11
11
  "dependencies": {
12
12
  "@ant-design/icons": "^6.0.0",
13
13
  "@ice/stark-app": "^1.5.0",
14
- "@lovrabet/sdk": "^1.1.8",
14
+ "@lovrabet/sdk": "^1.1.15",
15
15
  "antd": "^5.26.7",
16
16
  "echarts": "^5.6.0",
17
17
  "echarts-for-react": "^3.0.2",