@lovrabet/cli 1.1.9 → 1.1.11

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 (51) 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 +5 -4
  50. package/templates/projects/sub-app-react-demo/package.json +1 -1
  51. package/templates/projects/sub-app-react-demo/src/pages/sdk-demo/index.tsx +42 -28
@@ -1 +1 @@
1
- (function(_0x19a307,_0x55a8dc){var _0x222e06=a30_0x3700,_0x590c3d=_0x19a307();while(!![]){try{var _0xece98=-parseInt(_0x222e06(0x72))/0x1+-parseInt(_0x222e06(0x75))/0x2+-parseInt(_0x222e06(0x6f))/0x3*(-parseInt(_0x222e06(0x70))/0x4)+-parseInt(_0x222e06(0x6e))/0x5+parseInt(_0x222e06(0x6a))/0x6*(-parseInt(_0x222e06(0x6c))/0x7)+parseInt(_0x222e06(0x74))/0x8+parseInt(_0x222e06(0x6d))/0x9;if(_0xece98===_0x55a8dc)break;else _0x590c3d['push'](_0x590c3d['shift']());}catch(_0xc1dd5b){_0x590c3d['push'](_0x590c3d['shift']());}}}(a30_0x5bf5,0xa3766));import{jsx as a30_0x1efb8a,jsxs as a30_0x5dc3d7}from'react/jsx-runtime';function a30_0x5bf5(){var _0x5e1781=['1294988Etewog','green','5633742ghxhxR','loading','7ZpoIGN','23009112buWjKK','4486420KtkNcw','1231869OgbkZm','8fOvege','finished','875245dyaEeJ','dots','5205664IovFrC'];a30_0x5bf5=function(){return _0x5e1781;};return a30_0x5bf5();}function a30_0x3700(_0x20dbdb,_0x10b751){var _0x5bf546=a30_0x5bf5();return a30_0x3700=function(_0x3700e9,_0x2882a8){_0x3700e9=_0x3700e9-0x6a;var _0x43d842=_0x5bf546[_0x3700e9];return _0x43d842;},a30_0x3700(_0x20dbdb,_0x10b751);}import{Text}from'ink';import a30_0x574e11 from'ink-spinner';export function TaskLoading(_0xa8e08b){var _0x27d871=a30_0x3700;if(_0xa8e08b[_0x27d871(0x71)])return a30_0x1efb8a(Text,{'color':_0x27d871(0x76),'children':'\x20√\x20'});if(_0xa8e08b[_0x27d871(0x6b)])return a30_0x5dc3d7(Text,{'color':_0x27d871(0x76),'children':['\x20',a30_0x1efb8a(a30_0x574e11,{'type':_0x27d871(0x73)}),'\x20']});return a30_0x1efb8a(Text,{'children':'\x20\x20\x20'});}
1
+ function a33_0x4a59(_0x1cd9cc,_0x1b0fe8){var _0x24f0e1=a33_0x24f0();return a33_0x4a59=function(_0x4a5954,_0x5ac022){_0x4a5954=_0x4a5954-0xf8;var _0x5aab11=_0x24f0e1[_0x4a5954];return _0x5aab11;},a33_0x4a59(_0x1cd9cc,_0x1b0fe8);}(function(_0x3976f0,_0xdf705c){var _0x5477de=a33_0x4a59,_0x4c312a=_0x3976f0();while(!![]){try{var _0x25bfca=-parseInt(_0x5477de(0xff))/0x1*(parseInt(_0x5477de(0xfd))/0x2)+-parseInt(_0x5477de(0x102))/0x3*(parseInt(_0x5477de(0x104))/0x4)+-parseInt(_0x5477de(0xf9))/0x5*(-parseInt(_0x5477de(0xf8))/0x6)+parseInt(_0x5477de(0x106))/0x7+-parseInt(_0x5477de(0xfc))/0x8+parseInt(_0x5477de(0x105))/0x9*(parseInt(_0x5477de(0x101))/0xa)+parseInt(_0x5477de(0xfe))/0xb;if(_0x25bfca===_0xdf705c)break;else _0x4c312a['push'](_0x4c312a['shift']());}catch(_0x238c22){_0x4c312a['push'](_0x4c312a['shift']());}}}(a33_0x24f0,0xf1f18));import{jsx as a33_0x59150e,jsxs as a33_0x50c756}from'react/jsx-runtime';import{Text}from'ink';import a33_0x50c1fb from'ink-spinner';export function TaskLoading(_0x5200f4){var _0x17a88d=a33_0x4a59;if(_0x5200f4['finished'])return a33_0x59150e(Text,{'color':_0x17a88d(0xfa),'children':_0x17a88d(0x100)});if(_0x5200f4[_0x17a88d(0x107)])return a33_0x50c756(Text,{'color':_0x17a88d(0xfa),'children':['\x20',a33_0x59150e(a33_0x50c1fb,{'type':_0x17a88d(0xfb)}),'\x20']});return a33_0x59150e(Text,{'children':_0x17a88d(0x103)});}function a33_0x24f0(){var _0x189b61=['3638008QXGNiE','36aOfCqV','14260169qGyTDv','12552kkZHQX','\x20√\x20','200URXYym','4847082gqsHPH','\x20\x20\x20','4yBeqFz','100305riBIZk','7792183uISzes','loading','6MXYQJm','3274665Ndyome','green','dots'];a33_0x24f0=function(){return _0x189b61;};return a33_0x24f0();}
@@ -1 +1 @@
1
- (function(_0xe61e07,_0x504637){var _0xd15841=a31_0x5e85,_0x3a566d=_0xe61e07();while(!![]){try{var _0x3b00f1=parseInt(_0xd15841(0x18d))/0x1*(parseInt(_0xd15841(0x189))/0x2)+-parseInt(_0xd15841(0x18f))/0x3+parseInt(_0xd15841(0x18a))/0x4*(-parseInt(_0xd15841(0x18e))/0x5)+-parseInt(_0xd15841(0x188))/0x6+parseInt(_0xd15841(0x184))/0x7*(parseInt(_0xd15841(0x18c))/0x8)+-parseInt(_0xd15841(0x185))/0x9*(-parseInt(_0xd15841(0x190))/0xa)+parseInt(_0xd15841(0x18b))/0xb;if(_0x3b00f1===_0x504637)break;else _0x3a566d['push'](_0x3a566d['shift']());}catch(_0x1a4b89){_0x3a566d['push'](_0x3a566d['shift']());}}}(a31_0x3a2b,0xe76c4));import{jsx as a31_0x574822,jsxs as a31_0x19db4e}from'react/jsx-runtime';import{Box,Text}from'ink';function a31_0x3a2b(){var _0x4d3e95=['57890SKgJDS','36vNUPRY','taskName','elapsed','8040636uiScyD','851986NqRZLo','170540SEAhvC','14563659JcEHHo','1320vUICwS','1GRRbrI','35velsKj','1916823XDrxXt','277220gSyFhm'];a31_0x3a2b=function(){return _0x4d3e95;};return a31_0x3a2b();}import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';function a31_0x5e85(_0x175dd8,_0x14305){var _0x3a2b98=a31_0x3a2b();return a31_0x5e85=function(_0x5e85b5,_0x5630c5){_0x5e85b5=_0x5e85b5-0x184;var _0x11d0be=_0x3a2b98[_0x5e85b5];return _0x11d0be;},a31_0x5e85(_0x175dd8,_0x14305);}export function TaskRunning(_0x99cbb6){var _0x430c13=a31_0x5e85;return a31_0x19db4e(Box,{'children':[a31_0x574822(Box,{'width':'1'}),a31_0x574822(TaskLoading,{..._0x99cbb6}),a31_0x574822(Text,{'children':_0x99cbb6[_0x430c13(0x186)]}),a31_0x574822(TaskTime,{'elapsed':_0x99cbb6[_0x430c13(0x187)]})]});}
1
+ function a34_0x3139(_0x39f8f3,_0x71ee3d){var _0x338828=a34_0x3388();return a34_0x3139=function(_0x31399f,_0x3689ed){_0x31399f=_0x31399f-0x169;var _0x5218dc=_0x338828[_0x31399f];return _0x5218dc;},a34_0x3139(_0x39f8f3,_0x71ee3d);}(function(_0x27d6a2,_0x5d1192){var _0x302b7e=a34_0x3139,_0x44dea2=_0x27d6a2();while(!![]){try{var _0x41d95c=-parseInt(_0x302b7e(0x16e))/0x1*(-parseInt(_0x302b7e(0x16b))/0x2)+parseInt(_0x302b7e(0x16a))/0x3+-parseInt(_0x302b7e(0x171))/0x4+parseInt(_0x302b7e(0x173))/0x5*(-parseInt(_0x302b7e(0x16c))/0x6)+parseInt(_0x302b7e(0x170))/0x7*(-parseInt(_0x302b7e(0x16d))/0x8)+-parseInt(_0x302b7e(0x172))/0x9+parseInt(_0x302b7e(0x16f))/0xa*(parseInt(_0x302b7e(0x174))/0xb);if(_0x41d95c===_0x5d1192)break;else _0x44dea2['push'](_0x44dea2['shift']());}catch(_0x6bc493){_0x44dea2['push'](_0x44dea2['shift']());}}}(a34_0x3388,0xc09b3));import{jsx as a34_0x476935,jsxs as a34_0x3dc365}from'react/jsx-runtime';import{Box,Text}from'ink';function a34_0x3388(){var _0x245431=['1067940FVInGV','2905pxodfM','737968boxFgA','6530904uRlosc','5630085RpPIya','374VHsvXg','taskName','25335KSTeDA','2lqnquo','6KumGAW','21416zaGqCb','296594qpDNYq'];a34_0x3388=function(){return _0x245431;};return a34_0x3388();}import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';export function TaskRunning(_0x1796e2){var _0x47d2be=a34_0x3139;return a34_0x3dc365(Box,{'children':[a34_0x476935(Box,{'width':'1'}),a34_0x476935(TaskLoading,{..._0x1796e2}),a34_0x476935(Text,{'children':_0x1796e2[_0x47d2be(0x169)]}),a34_0x476935(TaskTime,{'elapsed':_0x1796e2['elapsed']})]});}
@@ -1 +1 @@
1
- function a32_0x1dd6(_0x5a610e,_0x22812d){var _0x4c173f=a32_0x4c17();return a32_0x1dd6=function(_0x1dd6ac,_0x3a7c31){_0x1dd6ac=_0x1dd6ac-0x17d;var _0x250726=_0x4c173f[_0x1dd6ac];return _0x250726;},a32_0x1dd6(_0x5a610e,_0x22812d);}(function(_0x179b70,_0x88d433){var _0x3dede5=a32_0x1dd6,_0x5e895c=_0x179b70();while(!![]){try{var _0x101180=-parseInt(_0x3dede5(0x17d))/0x1+parseInt(_0x3dede5(0x186))/0x2*(parseInt(_0x3dede5(0x183))/0x3)+parseInt(_0x3dede5(0x189))/0x4+-parseInt(_0x3dede5(0x184))/0x5+parseInt(_0x3dede5(0x181))/0x6*(-parseInt(_0x3dede5(0x188))/0x7)+-parseInt(_0x3dede5(0x187))/0x8*(parseInt(_0x3dede5(0x17f))/0x9)+parseInt(_0x3dede5(0x180))/0xa*(parseInt(_0x3dede5(0x17e))/0xb);if(_0x101180===_0x88d433)break;else _0x5e895c['push'](_0x5e895c['shift']());}catch(_0x4410f8){_0x5e895c['push'](_0x5e895c['shift']());}}}(a32_0x4c17,0xb2fe9));import{jsx as a32_0x307579,Fragment as a32_0x4a0564,jsxs as a32_0x2fce10}from'react/jsx-runtime';function a32_0x4c17(){var _0x16219c=['1175719bjyerQ','277255zFgfDz','7365339DDFkra','1450bsPrEP','46278fYHGgM','gray','9MiccHX','7182645nkPIyZ','elapsed','563042IIwWtP','8HtJnZS','595EkzKZD','1280388ydrJKI'];a32_0x4c17=function(){return _0x16219c;};return a32_0x4c17();}import{Text}from'ink';export function TaskTime(_0xcc8e29){var _0xcd9302=a32_0x1dd6;if(_0xcc8e29[_0xcd9302(0x185)])return a32_0x2fce10(a32_0x4a0564,{'children':[a32_0x307579(Text,{'color':_0xcd9302(0x182),'children':'\x20['}),a32_0x307579(Text,{'color':_0xcd9302(0x182),'bold':!![],'children':_0xcc8e29['elapsed']}),a32_0x307579(Text,{'color':_0xcd9302(0x182),'children':']'})]});return null;}
1
+ function a35_0x5c32(){var _0x324edf=['578493wjDcpd','757968dzjnyM','elapsed','18PMWRnk','1974238IfgPCQ','541808lQNUTn','gray','5956vHNJrv','436TyfdaN','6HPQEUl','4647700AeZguv','13985EupDRc'];a35_0x5c32=function(){return _0x324edf;};return a35_0x5c32();}function a35_0x2fe0(_0x5430c9,_0x3c1577){var _0x5c3297=a35_0x5c32();return a35_0x2fe0=function(_0x2fe00b,_0x4d60de){_0x2fe00b=_0x2fe00b-0x1bd;var _0x5f45da=_0x5c3297[_0x2fe00b];return _0x5f45da;},a35_0x2fe0(_0x5430c9,_0x3c1577);}(function(_0x3ead15,_0x53af66){var _0x2f4020=a35_0x2fe0,_0x24da23=_0x3ead15();while(!![]){try{var _0x3993c4=parseInt(_0x2f4020(0x1c8))/0x1+parseInt(_0x2f4020(0x1c6))/0x2+parseInt(_0x2f4020(0x1c1))/0x3+parseInt(_0x2f4020(0x1bd))/0x4*(-parseInt(_0x2f4020(0x1c0))/0x5)+-parseInt(_0x2f4020(0x1be))/0x6*(-parseInt(_0x2f4020(0x1c5))/0x7)+-parseInt(_0x2f4020(0x1c2))/0x8*(-parseInt(_0x2f4020(0x1c4))/0x9)+-parseInt(_0x2f4020(0x1bf))/0xa;if(_0x3993c4===_0x53af66)break;else _0x24da23['push'](_0x24da23['shift']());}catch(_0x2786a2){_0x24da23['push'](_0x24da23['shift']());}}}(a35_0x5c32,0x29e36));import{jsx as a35_0x2acd60,Fragment as a35_0x2b7443,jsxs as a35_0x407180}from'react/jsx-runtime';import{Text}from'ink';export function TaskTime(_0x44af63){var _0x3f52e5=a35_0x2fe0;if(_0x44af63[_0x3f52e5(0x1c3)])return a35_0x407180(a35_0x2b7443,{'children':[a35_0x2acd60(Text,{'color':_0x3f52e5(0x1c7),'children':'\x20['}),a35_0x2acd60(Text,{'color':_0x3f52e5(0x1c7),'bold':!![],'children':_0x44af63[_0x3f52e5(0x1c3)]}),a35_0x2acd60(Text,{'color':_0x3f52e5(0x1c7),'children':']'})]});return null;}
@@ -1 +1 @@
1
- const a33_0x2c7d36=a33_0x3812;(function(_0x30af6b,_0x34f481){const _0x592d2a=a33_0x3812,_0x41c5fd=_0x30af6b();while(!![]){try{const _0x1439cb=parseInt(_0x592d2a(0x9a))/0x1+parseInt(_0x592d2a(0xa5))/0x2*(parseInt(_0x592d2a(0x9e))/0x3)+-parseInt(_0x592d2a(0xa0))/0x4*(-parseInt(_0x592d2a(0x9c))/0x5)+parseInt(_0x592d2a(0xae))/0x6*(parseInt(_0x592d2a(0xac))/0x7)+parseInt(_0x592d2a(0xb1))/0x8*(parseInt(_0x592d2a(0x9d))/0x9)+parseInt(_0x592d2a(0xb0))/0xa*(parseInt(_0x592d2a(0xaa))/0xb)+-parseInt(_0x592d2a(0x99))/0xc;if(_0x1439cb===_0x34f481)break;else _0x41c5fd['push'](_0x41c5fd['shift']());}catch(_0x354cf9){_0x41c5fd['push'](_0x41c5fd['shift']());}}}(a33_0x202f,0xa6c57));import a33_0x826b5b from'node:path';function a33_0x202f(){const _0x4b2789=['copy','19624164TwvcFc','335471MqJEts','cwd','299345DgkluY','198ERxjWe','578913VwhCFK','复制项目文件','4YjCzNr','info','开始复制项目模板','error','项目模板复制失败','10eJpgin','resolve','now','项目模板复制完成','../../templates/projects/sub-app-react-demo','38379NPUFDk','message','7YWhbMg','success','1360116MWmoio','dirname','1790MplXJa','38920cBAzLF'];a33_0x202f=function(){return _0x4b2789;};return a33_0x202f();}import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';import{copyDirectory}from'../utils/copy-directory.js';function a33_0x3812(_0x3379c8,_0x5e9991){const _0x202ffd=a33_0x202f();return a33_0x3812=function(_0x3812a1,_0x17580d){_0x3812a1=_0x3812a1-0x99;let _0x2aad41=_0x202ffd[_0x3812a1];return _0x2aad41;},a33_0x3812(_0x3379c8,_0x5e9991);}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';const __dirname=a33_0x826b5b[a33_0x2c7d36(0xaf)](fileURLToPath(import.meta['url'])),templateDir=a33_0x826b5b[a33_0x2c7d36(0xa6)](__dirname,a33_0x2c7d36(0xa9));export function useCopyProjectTemplate(){const _0x5851f0=a33_0x2c7d36,[_0xa4f8bf,_0x38aadb]=useState(![]),[_0x35208e,_0x23d6df]=useState(![]),[_0x435da6,_0x5009ea]=useState(''),_0x18d684=useCallback(async _0x86f6a8=>{const _0x5c256f=a33_0x3812,_0x300bd9=Date[_0x5c256f(0xa7)](),_0x5ce222=a33_0x826b5b[_0x5c256f(0xa6)](process[_0x5c256f(0x9b)](),_0x86f6a8);_0x38aadb(!![]);try{logger[_0x5c256f(0xa1)](_0x5c256f(0xb2),_0x5c256f(0xa2),{'projectCode':_0x86f6a8,'templateDir':templateDir}),await copyDirectory(templateDir,_0x5ce222);const _0x1faf28=Date[_0x5c256f(0xa7)]()-_0x300bd9;logger[_0x5c256f(0xad)](_0x5c256f(0xb2),_0x5c256f(0xa8),_0x1faf28,{'projectCode':_0x86f6a8});}catch(_0x5614cb){const _0x4ea919=Date[_0x5c256f(0xa7)]()-_0x300bd9;logger[_0x5c256f(0xa3)](_0x5c256f(0xb2),_0x5c256f(0xa4),{'projectCode':_0x86f6a8,'error':_0x5614cb instanceof Error?_0x5614cb[_0x5c256f(0xab)]:String(_0x5614cb),'duration':_0x4ea919});throw _0x5614cb;}finally{_0x38aadb(![]),_0x23d6df(!![]),_0x5009ea(formatElapsed(_0x300bd9));}},[]);return{'taskName':_0x5851f0(0x9f),'finished':_0x35208e,'loading':_0xa4f8bf,'elapsed':_0x435da6,'doTask':_0x18d684};}
1
+ const a36_0x397fe0=a36_0x6111;(function(_0x4f40fe,_0x54c927){const _0x4b5158=a36_0x6111,_0x388c30=_0x4f40fe();while(!![]){try{const _0x519bba=parseInt(_0x4b5158(0x113))/0x1+parseInt(_0x4b5158(0x114))/0x2*(parseInt(_0x4b5158(0x112))/0x3)+parseInt(_0x4b5158(0x110))/0x4+-parseInt(_0x4b5158(0x111))/0x5+-parseInt(_0x4b5158(0x116))/0x6*(parseInt(_0x4b5158(0x11e))/0x7)+parseInt(_0x4b5158(0x115))/0x8+-parseInt(_0x4b5158(0x118))/0x9;if(_0x519bba===_0x54c927)break;else _0x388c30['push'](_0x388c30['shift']());}catch(_0x2f0075){_0x388c30['push'](_0x388c30['shift']());}}}(a36_0x25ed,0x4e6ac));import a36_0x4ffdcb 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 a36_0x25ed(){const _0x39be45=['7nqigmQ','error','项目模板复制完成','copy','info','475616OsbqQK','1234645MaPWCO','3EgevNQ','392551SZrPNt','389012XBzokD','3914928cCBoaS','353460JXHShL','开始复制项目模板','5114628JQlxpe','success','项目模板复制失败','resolve','../../templates/projects/sub-app-react-demo','now'];a36_0x25ed=function(){return _0x39be45;};return a36_0x25ed();}const __dirname=a36_0x4ffdcb['dirname'](fileURLToPath(import.meta['url'])),templateDir=a36_0x4ffdcb['resolve'](__dirname,a36_0x397fe0(0x11c));function a36_0x6111(_0x2e3202,_0x47d486){const _0x25ed74=a36_0x25ed();return a36_0x6111=function(_0x61116c,_0x4e0abc){_0x61116c=_0x61116c-0x10f;let _0x45682d=_0x25ed74[_0x61116c];return _0x45682d;},a36_0x6111(_0x2e3202,_0x47d486);}export function useCopyProjectTemplate(){const [_0x28f48d,_0x2fef6a]=useState(![]),[_0x5d331b,_0x145a7b]=useState(![]),[_0x3ec1ad,_0x160c61]=useState(''),_0x556390=useCallback(async _0x2e555e=>{const _0x3babf7=a36_0x6111,_0x298643=Date['now'](),_0x304763=a36_0x4ffdcb[_0x3babf7(0x11b)](process['cwd'](),_0x2e555e);_0x2fef6a(!![]);try{logger[_0x3babf7(0x10f)]('copy',_0x3babf7(0x117),{'projectCode':_0x2e555e,'templateDir':templateDir}),await copyDirectory(templateDir,_0x304763);const _0x5b38f8=Date['now']()-_0x298643;logger[_0x3babf7(0x119)](_0x3babf7(0x121),_0x3babf7(0x120),_0x5b38f8,{'projectCode':_0x2e555e});}catch(_0x1b44a7){const _0x1f1a7e=Date[_0x3babf7(0x11d)]()-_0x298643;logger[_0x3babf7(0x11f)](_0x3babf7(0x121),_0x3babf7(0x11a),{'projectCode':_0x2e555e,'error':_0x1b44a7 instanceof Error?_0x1b44a7['message']:String(_0x1b44a7),'duration':_0x1f1a7e});throw _0x1b44a7;}finally{_0x2fef6a(![]),_0x145a7b(!![]),_0x160c61(formatElapsed(_0x298643));}},[]);return{'taskName':'复制项目文件','finished':_0x5d331b,'loading':_0x28f48d,'elapsed':_0x3ec1ad,'doTask':_0x556390};}
@@ -1 +1 @@
1
- (function(_0x56b287,_0x3aa550){const _0x5e13df=a34_0x3ca9,_0x361557=_0x56b287();while(!![]){try{const _0x5d4271=-parseInt(_0x5e13df(0x199))/0x1*(-parseInt(_0x5e13df(0x19a))/0x2)+-parseInt(_0x5e13df(0x19f))/0x3*(parseInt(_0x5e13df(0x197))/0x4)+-parseInt(_0x5e13df(0x195))/0x5*(parseInt(_0x5e13df(0x198))/0x6)+parseInt(_0x5e13df(0x1a0))/0x7*(-parseInt(_0x5e13df(0x19b))/0x8)+-parseInt(_0x5e13df(0x1a2))/0x9*(parseInt(_0x5e13df(0x194))/0xa)+parseInt(_0x5e13df(0x1a1))/0xb+parseInt(_0x5e13df(0x1a4))/0xc;if(_0x5d4271===_0x3aa550)break;else _0x361557['push'](_0x361557['shift']());}catch(_0x1e86f6){_0x361557['push'](_0x361557['shift']());}}}(a34_0x1fd5,0x71edb));import a34_0x49c78d from'node:path';import{useCallback,useState}from'react';function a34_0x1fd5(){const _0x195bda=['32748UvDszM','18jilgEY','1uELPmg','41514QNQXAG','8swYLee','prettier','--write','info','75gztxFy','6211807npuQRE','8134995DyiHXu','2042712xpNgHf','message','20927328tBeEnw','now','format','resolve','格式化代码','npx','success','代码格式化失败','20ZPfceF','819305WOIUsM','开始格式化代码'];a34_0x1fd5=function(){return _0x195bda;};return a34_0x1fd5();}function a34_0x3ca9(_0x469652,_0x50da76){const _0x1fd5a1=a34_0x1fd5();return a34_0x3ca9=function(_0x3ca9cb,_0x552292){_0x3ca9cb=_0x3ca9cb-0x191;let _0x16cd7f=_0x1fd5a1[_0x3ca9cb];return _0x16cd7f;},a34_0x3ca9(_0x469652,_0x50da76);}import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x41bf02=a34_0x3ca9,[_0x43ea53,_0x1b4175]=useState(![]),[_0x51d6f3,_0x21bd6c]=useState(![]),[_0x2d048b,_0x472802]=useState(''),_0x3c18dc=useCallback(async _0x41a400=>{const _0x5aa27e=a34_0x3ca9,_0x402106=Date['now'](),_0x52ff68=a34_0x49c78d[_0x5aa27e(0x1a7)](process['cwd'](),_0x41a400);_0x1b4175(!![]);try{logger[_0x5aa27e(0x19e)](_0x5aa27e(0x1a6),_0x5aa27e(0x196),{'projectCode':_0x41a400}),await execa(_0x5aa27e(0x191),[_0x5aa27e(0x19c),_0x5aa27e(0x19d),'.'],{'cwd':_0x52ff68});const _0x3608ab=Date[_0x5aa27e(0x1a5)]()-_0x402106;logger[_0x5aa27e(0x192)](_0x5aa27e(0x1a6),'代码格式化完成',_0x3608ab,{'projectCode':_0x41a400});}catch(_0x19a42f){const _0x4080ca=Date['now']()-_0x402106;logger['error']('format',_0x5aa27e(0x193),{'projectCode':_0x41a400,'error':_0x19a42f instanceof Error?_0x19a42f[_0x5aa27e(0x1a3)]:String(_0x19a42f),'duration':_0x4080ca});throw _0x19a42f;}finally{_0x1b4175(![]),_0x21bd6c(!![]),_0x472802(formatElapsed(_0x402106));}},[]);return{'taskName':_0x41bf02(0x1a8),'finished':_0x51d6f3,'loading':_0x43ea53,'elapsed':_0x2d048b,'doTask':_0x3c18dc};}
1
+ (function(_0x17b85c,_0x9f5c33){const _0x2e51ea=a37_0x5256,_0x9a145e=_0x17b85c();while(!![]){try{const _0x38ffac=parseInt(_0x2e51ea(0x1b3))/0x1+parseInt(_0x2e51ea(0x1b4))/0x2*(parseInt(_0x2e51ea(0x1b0))/0x3)+-parseInt(_0x2e51ea(0x1aa))/0x4*(parseInt(_0x2e51ea(0x1bc))/0x5)+-parseInt(_0x2e51ea(0x1bd))/0x6*(parseInt(_0x2e51ea(0x1ac))/0x7)+parseInt(_0x2e51ea(0x1b9))/0x8+-parseInt(_0x2e51ea(0x1be))/0x9+-parseInt(_0x2e51ea(0x1c0))/0xa;if(_0x38ffac===_0x9f5c33)break;else _0x9a145e['push'](_0x9a145e['shift']());}catch(_0x49ee4d){_0x9a145e['push'](_0x9a145e['shift']());}}}(a37_0x345a,0x44b86));import a37_0x2fbac7 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';function a37_0x345a(){const _0x1fbf8c=['resolve','format','npx','741rmeSca','开始格式化代码','代码格式化失败','384746mClinF','3278AtfKWp','prettier','error','info','message','4125896VqbwQJ','--write','now','15gijCkx','286362gPYXmh','771705zAvxet','格式化代码','5001590zpTtXY','11188YlhOBL','代码格式化完成','63LePXlO'];a37_0x345a=function(){return _0x1fbf8c;};return a37_0x345a();}import{formatElapsed}from'./format-elapsed.js';function a37_0x5256(_0x2d594f,_0x8fdf7d){const _0x345a16=a37_0x345a();return a37_0x5256=function(_0x5256a8,_0x221a78){_0x5256a8=_0x5256a8-0x1aa;let _0x4eebff=_0x345a16[_0x5256a8];return _0x4eebff;},a37_0x5256(_0x2d594f,_0x8fdf7d);}import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x534024=a37_0x5256,[_0x2838e0,_0x124ff9]=useState(![]),[_0x15654b,_0x466d6f]=useState(![]),[_0x53ed0d,_0x4378f2]=useState(''),_0x3507ba=useCallback(async _0xf05fa=>{const _0x446c9b=a37_0x5256,_0x235818=Date['now'](),_0x347a56=a37_0x2fbac7[_0x446c9b(0x1ad)](process['cwd'](),_0xf05fa);_0x124ff9(!![]);try{logger[_0x446c9b(0x1b7)]('format',_0x446c9b(0x1b1),{'projectCode':_0xf05fa}),await execa(_0x446c9b(0x1af),[_0x446c9b(0x1b5),_0x446c9b(0x1ba),'.'],{'cwd':_0x347a56});const _0x26b854=Date[_0x446c9b(0x1bb)]()-_0x235818;logger['success'](_0x446c9b(0x1ae),_0x446c9b(0x1ab),_0x26b854,{'projectCode':_0xf05fa});}catch(_0x49051c){const _0x50a24e=Date[_0x446c9b(0x1bb)]()-_0x235818;logger[_0x446c9b(0x1b6)](_0x446c9b(0x1ae),_0x446c9b(0x1b2),{'projectCode':_0xf05fa,'error':_0x49051c instanceof Error?_0x49051c[_0x446c9b(0x1b8)]:String(_0x49051c),'duration':_0x50a24e});throw _0x49051c;}finally{_0x124ff9(![]),_0x466d6f(!![]),_0x4378f2(formatElapsed(_0x235818));}},[]);return{'taskName':_0x534024(0x1bf),'finished':_0x15654b,'loading':_0x2838e0,'elapsed':_0x53ed0d,'doTask':_0x3507ba};}
@@ -1 +1 @@
1
- function a35_0x2e93(){const _0x2a5c6b=['error','293774YzpiOY','开始安装依赖','347457Okwdft','20meWikZ','安装依赖','322vYhPWV','1564szNZif','459592nlCKre','2185011efIZKO','now','835HqJzWT','1304UwJKVY','cwd','https://registry.npmmirror.com','npm','545532bZpPkA','message','依赖安装失败','info','install','依赖安装完成'];a35_0x2e93=function(){return _0x2a5c6b;};return a35_0x2e93();}(function(_0x3b2831,_0x211202){const _0x348d5b=a35_0x1871,_0x2c3c5d=_0x3b2831();while(!![]){try{const _0x4ca435=parseInt(_0x348d5b(0x1e1))/0x1+parseInt(_0x348d5b(0x1e8))/0x2+parseInt(_0x348d5b(0x1e3))/0x3+-parseInt(_0x348d5b(0x1e7))/0x4*(parseInt(_0x348d5b(0x1eb))/0x5)+parseInt(_0x348d5b(0x1da))/0x6+parseInt(_0x348d5b(0x1e6))/0x7*(-parseInt(_0x348d5b(0x1d6))/0x8)+parseInt(_0x348d5b(0x1e9))/0x9*(-parseInt(_0x348d5b(0x1e4))/0xa);if(_0x4ca435===_0x211202)break;else _0x2c3c5d['push'](_0x2c3c5d['shift']());}catch(_0x199123){_0x2c3c5d['push'](_0x2c3c5d['shift']());}}}(a35_0x2e93,0x29fb6));import a35_0x1b3a02 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a35_0x1871(_0x6f3f8d,_0x27dcfd){const _0x2e9357=a35_0x2e93();return a35_0x1871=function(_0x1871cc,_0x2147bd){_0x1871cc=_0x1871cc-0x1d6;let _0x375e96=_0x2e9357[_0x1871cc];return _0x375e96;},a35_0x1871(_0x6f3f8d,_0x27dcfd);}import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x96bd6e=a35_0x1871,[_0x22aff1,_0x1340df]=useState(![]),[_0x511589,_0x71efaf]=useState(![]),[_0x372fae,_0x11c2be]=useState(''),_0x34be75=useCallback(async _0x33e383=>{const _0x3f0500=a35_0x1871,_0x4feec3=Date[_0x3f0500(0x1ea)](),_0x2b9d99=a35_0x1b3a02['resolve'](process[_0x3f0500(0x1d7)](),_0x33e383);_0x1340df(!![]),_0x71efaf(![]);const _0x179c4e=async(_0x5b9d33,_0x59d41a)=>{await execa(_0x5b9d33,_0x59d41a,{'cwd':_0x2b9d99});};try{logger[_0x3f0500(0x1dd)](_0x3f0500(0x1de),_0x3f0500(0x1e2),{'projectCode':_0x33e383,'registry':'https://registry.npmmirror.com'}),await _0x179c4e(_0x3f0500(0x1d9),[_0x3f0500(0x1de),'--registry',_0x3f0500(0x1d8)]);const _0x3d43e3=Date[_0x3f0500(0x1ea)]()-_0x4feec3;logger['success']('install',_0x3f0500(0x1df),_0x3d43e3,{'projectCode':_0x33e383});}catch(_0x3236a8){const _0x1ed07f=Date[_0x3f0500(0x1ea)]()-_0x4feec3;logger[_0x3f0500(0x1e0)](_0x3f0500(0x1de),_0x3f0500(0x1dc),{'projectCode':_0x33e383,'error':_0x3236a8 instanceof Error?_0x3236a8[_0x3f0500(0x1db)]:String(_0x3236a8),'duration':_0x1ed07f});throw _0x3236a8;}finally{_0x1340df(![]),_0x71efaf(!![]),_0x11c2be(formatElapsed(_0x4feec3));}},[]);return{'taskName':_0x96bd6e(0x1e5),'finished':_0x511589,'loading':_0x22aff1,'elapsed':_0x372fae,'doTask':_0x34be75};}
1
+ (function(_0x2807d1,_0x1f397e){const _0x4b548c=a38_0x4e58,_0x348357=_0x2807d1();while(!![]){try{const _0x50fc9e=-parseInt(_0x4b548c(0x1a2))/0x1*(parseInt(_0x4b548c(0x1ae))/0x2)+-parseInt(_0x4b548c(0x1a7))/0x3+-parseInt(_0x4b548c(0x19b))/0x4+-parseInt(_0x4b548c(0x19d))/0x5+parseInt(_0x4b548c(0x1a4))/0x6*(-parseInt(_0x4b548c(0x1a9))/0x7)+parseInt(_0x4b548c(0x19f))/0x8*(parseInt(_0x4b548c(0x1ac))/0x9)+parseInt(_0x4b548c(0x1ab))/0xa;if(_0x50fc9e===_0x1f397e)break;else _0x348357['push'](_0x348357['shift']());}catch(_0x59053c){_0x348357['push'](_0x348357['shift']());}}}(a38_0x5a51,0x6bc51));function a38_0x5a51(){const _0x15fd53=['1509184nEYVTY','error','3624775vXwWGy','resolve','1278528chKeNr','now','cwd','143fCKPMh','success','405276rSCjAg','info','https://registry.npmmirror.com','2575014BSIDGL','安装依赖','28WGElBi','--registry','31786770OMCeIC','18BDpSjz','install','11554tZmuKs','npm'];a38_0x5a51=function(){return _0x15fd53;};return a38_0x5a51();}import a38_0x53fc01 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a38_0x4e58(_0x54cdf6,_0x43a002){const _0x5a518d=a38_0x5a51();return a38_0x4e58=function(_0x4e58a0,_0x4f8463){_0x4e58a0=_0x4e58a0-0x19b;let _0x2b7e0f=_0x5a518d[_0x4e58a0];return _0x2b7e0f;},a38_0x4e58(_0x54cdf6,_0x43a002);}import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x5b3534=a38_0x4e58,[_0x2ba3b8,_0x42465c]=useState(![]),[_0x59e18c,_0x3b968e]=useState(![]),[_0x30f2bb,_0x38ca8d]=useState(''),_0x38dca7=useCallback(async _0x27a698=>{const _0x288bce=a38_0x4e58,_0x51c674=Date[_0x288bce(0x1a0)](),_0x5a4cb6=a38_0x53fc01[_0x288bce(0x19e)](process[_0x288bce(0x1a1)](),_0x27a698);_0x42465c(!![]),_0x3b968e(![]);const _0xd61200=async(_0x355ae7,_0x3ff5e7)=>{await execa(_0x355ae7,_0x3ff5e7,{'cwd':_0x5a4cb6});};try{logger[_0x288bce(0x1a5)](_0x288bce(0x1ad),'开始安装依赖',{'projectCode':_0x27a698,'registry':_0x288bce(0x1a6)}),await _0xd61200(_0x288bce(0x1af),[_0x288bce(0x1ad),_0x288bce(0x1aa),_0x288bce(0x1a6)]);const _0x32fce9=Date[_0x288bce(0x1a0)]()-_0x51c674;logger[_0x288bce(0x1a3)](_0x288bce(0x1ad),'依赖安装完成',_0x32fce9,{'projectCode':_0x27a698});}catch(_0x21559b){const _0x2739a3=Date[_0x288bce(0x1a0)]()-_0x51c674;logger[_0x288bce(0x19c)]('install','依赖安装失败',{'projectCode':_0x27a698,'error':_0x21559b instanceof Error?_0x21559b['message']:String(_0x21559b),'duration':_0x2739a3});throw _0x21559b;}finally{_0x42465c(![]),_0x3b968e(!![]),_0x38ca8d(formatElapsed(_0x51c674));}},[]);return{'taskName':_0x5b3534(0x1a8),'finished':_0x59e18c,'loading':_0x2ba3b8,'elapsed':_0x30f2bb,'doTask':_0x38dca7};}
package/lib/help.js CHANGED
@@ -1 +1 @@
1
- (function(_0x469b0d,_0x1b3118){var _0x3f433a=a36_0x2595,_0x3beb69=_0x469b0d();while(!![]){try{var _0x3e25ea=-parseInt(_0x3f433a(0x199))/0x1+-parseInt(_0x3f433a(0x194))/0x2*(-parseInt(_0x3f433a(0x197))/0x3)+-parseInt(_0x3f433a(0x193))/0x4*(-parseInt(_0x3f433a(0x195))/0x5)+parseInt(_0x3f433a(0x18f))/0x6*(parseInt(_0x3f433a(0x19a))/0x7)+-parseInt(_0x3f433a(0x18d))/0x8*(-parseInt(_0x3f433a(0x198))/0x9)+-parseInt(_0x3f433a(0x192))/0xa*(parseInt(_0x3f433a(0x190))/0xb)+-parseInt(_0x3f433a(0x196))/0xc;if(_0x3e25ea===_0x1b3118)break;else _0x3beb69['push'](_0x3beb69['shift']());}catch(_0x3da4a9){_0x3beb69['push'](_0x3beb69['shift']());}}}(a36_0xfcc4,0x8043b));function a36_0xfcc4(){var _0x3fd363=['63pOCqhg','555909MFikJi','973bKentl','!\x20请指定一个有效的命令。','34792vVkHHm','green','28554sODSNo','11PIoFts','查看可用命令。','7400810wWemBF','36qWYtzg','2wHHkwl','390425TthRkY','2380392xFDFpb','1875054eiDoez'];a36_0xfcc4=function(){return _0x3fd363;};return a36_0xfcc4();}import{jsx as a36_0x40f1a3,jsxs as a36_0x30c6c3}from'react/jsx-runtime';import{Box,Text}from'ink';function a36_0x2595(_0x199c0e,_0x9fd74c){var _0xfcc44b=a36_0xfcc4();return a36_0x2595=function(_0x25953d,_0x1a611a){_0x25953d=_0x25953d-0x18c;var _0x1c66e5=_0xfcc44b[_0x25953d];return _0x1c66e5;},a36_0x2595(_0x199c0e,_0x9fd74c);}export function Help(){var _0x4f0be2=a36_0x2595;return a36_0x30c6c3(Box,{'flexDirection':'column','marginTop':0x1,'marginBottom':0x1,'children':[a36_0x30c6c3(Box,{'children':[a36_0x40f1a3(Box,{'width':'1'}),a36_0x40f1a3(Text,{'children':_0x4f0be2(0x18c)})]}),a36_0x30c6c3(Box,{'marginTop':0x1,'children':[a36_0x40f1a3(Box,{'width':'1'}),a36_0x30c6c3(Text,{'children':['\x20\x20','使用']}),a36_0x30c6c3(Text,{'bold':!![],'color':_0x4f0be2(0x18e),'children':['\x20','lovrabet\x20--help','\x20']}),a36_0x40f1a3(Text,{'children':_0x4f0be2(0x191)})]})]});}
1
+ function a39_0x5d72(){var _0x420b97=['1285210wVBPlo','2627112sErlhP','275644LOPnml','2113688rbkeGH','green','lovrabet\x20--help','7fotZlH','4814508lrmYwd','1175416YexFqi','!\x20请指定一个有效的命令。','4ysOPHb','column','查看可用命令。','18785007alPqgH'];a39_0x5d72=function(){return _0x420b97;};return a39_0x5d72();}(function(_0x592357,_0x5a2ea3){var _0x49b31f=a39_0x4db4,_0x25cc73=_0x592357();while(!![]){try{var _0x510452=parseInt(_0x49b31f(0x147))/0x1+parseInt(_0x49b31f(0x13f))/0x2+parseInt(_0x49b31f(0x146))/0x3+-parseInt(_0x49b31f(0x141))/0x4*(parseInt(_0x49b31f(0x145))/0x5)+-parseInt(_0x49b31f(0x14c))/0x6*(-parseInt(_0x49b31f(0x14b))/0x7)+parseInt(_0x49b31f(0x148))/0x8+-parseInt(_0x49b31f(0x144))/0x9;if(_0x510452===_0x5a2ea3)break;else _0x25cc73['push'](_0x25cc73['shift']());}catch(_0x3e8c13){_0x25cc73['push'](_0x25cc73['shift']());}}}(a39_0x5d72,0x70a6c));import{jsx as a39_0x2112c4,jsxs as a39_0x1840cd}from'react/jsx-runtime';import{Box,Text}from'ink';function a39_0x4db4(_0x7a5068,_0x3c6e45){var _0x5d7228=a39_0x5d72();return a39_0x4db4=function(_0x4db4a3,_0x17517f){_0x4db4a3=_0x4db4a3-0x13f;var _0x3b6686=_0x5d7228[_0x4db4a3];return _0x3b6686;},a39_0x4db4(_0x7a5068,_0x3c6e45);}export function Help(){var _0xc70705=a39_0x4db4;return a39_0x1840cd(Box,{'flexDirection':_0xc70705(0x142),'marginTop':0x1,'marginBottom':0x1,'children':[a39_0x1840cd(Box,{'children':[a39_0x2112c4(Box,{'width':'1'}),a39_0x2112c4(Text,{'children':_0xc70705(0x140)})]}),a39_0x1840cd(Box,{'marginTop':0x1,'children':[a39_0x2112c4(Box,{'width':'1'}),a39_0x1840cd(Text,{'children':['\x20\x20','使用']}),a39_0x1840cd(Text,{'bold':!![],'color':_0xc70705(0x149),'children':['\x20',_0xc70705(0x14a),'\x20']}),a39_0x2112c4(Text,{'children':_0xc70705(0x143)})]})]});}
@@ -1 +1 @@
1
- const a37_0x19910e=a37_0x1bac;(function(_0x4d62c3,_0x590d9b){const _0x9876e7=a37_0x1bac,_0xed513b=_0x4d62c3();while(!![]){try{const _0xa984a2=parseInt(_0x9876e7(0x12d))/0x1*(-parseInt(_0x9876e7(0x12b))/0x2)+parseInt(_0x9876e7(0x125))/0x3+-parseInt(_0x9876e7(0x12a))/0x4*(-parseInt(_0x9876e7(0x122))/0x5)+parseInt(_0x9876e7(0x120))/0x6*(parseInt(_0x9876e7(0x124))/0x7)+parseInt(_0x9876e7(0x12c))/0x8+parseInt(_0x9876e7(0x121))/0x9*(-parseInt(_0x9876e7(0x123))/0xa)+-parseInt(_0x9876e7(0x127))/0xb*(parseInt(_0x9876e7(0x129))/0xc);if(_0xa984a2===_0x590d9b)break;else _0xed513b['push'](_0xed513b['shift']());}catch(_0x777cdf){_0xed513b['push'](_0xed513b['shift']());}}}(a37_0x1628,0xe9d6c));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a37_0x19910e(0x128)](),'.lovrabetrc');export const globalConfigPath=resolve(homedir(),'.lovrabetrc');export function readConfig(){const _0x3aeb9c=a37_0x19910e;let _0x58429b={};try{if(existsSync(globalConfigPath)){const _0x49f0d9=readFileSync(globalConfigPath,{'encoding':_0x3aeb9c(0x126)});_0x49f0d9&&(_0x58429b=JSON[_0x3aeb9c(0x12e)](_0x49f0d9));}}catch(_0x30ff3f){}try{if(existsSync(projectConfigPath)){const _0x4472c9=readFileSync(projectConfigPath,{'encoding':'utf8'});if(_0x4472c9){const _0x5ff639=JSON[_0x3aeb9c(0x12e)](_0x4472c9);_0x58429b={..._0x58429b,..._0x5ff639};}}}catch(_0x3af2f4){}return _0x58429b;}function a37_0x1bac(_0x40b7bb,_0x301a77){const _0x1628bf=a37_0x1628();return a37_0x1bac=function(_0x1baca8,_0x39716a){_0x1baca8=_0x1baca8-0x120;let _0x537303=_0x1628bf[_0x1baca8];return _0x537303;},a37_0x1bac(_0x40b7bb,_0x301a77);}export function isInProject(){return existsSync(projectConfigPath);}function a37_0x1628(){const _0x36da3f=['5yTInEI','18275410AHSSCk','458899BZwymY','1415973AAMoMc','utf8','11EtPPcx','cwd','19958916CzsuHm','5084504NTCmyv','2WUrUrV','12842864pcwfqf','79913JcOtda','parse','108WBpqHz','9cYBNSE'];a37_0x1628=function(){return _0x36da3f;};return a37_0x1628();}
1
+ const a40_0x21c4a8=a40_0x3b46;function a40_0x3b46(_0x1fc74e,_0x3622cb){const _0x1d5ce2=a40_0x1d5c();return a40_0x3b46=function(_0x3b469,_0x4ccd33){_0x3b469=_0x3b469-0x125;let _0x348fc2=_0x1d5ce2[_0x3b469];return _0x348fc2;},a40_0x3b46(_0x1fc74e,_0x3622cb);}(function(_0x164146,_0xee9f3c){const _0x2a057f=a40_0x3b46,_0x5d564a=_0x164146();while(!![]){try{const _0x5896e8=-parseInt(_0x2a057f(0x127))/0x1+-parseInt(_0x2a057f(0x125))/0x2+parseInt(_0x2a057f(0x133))/0x3+-parseInt(_0x2a057f(0x12c))/0x4+parseInt(_0x2a057f(0x12f))/0x5+-parseInt(_0x2a057f(0x131))/0x6*(-parseInt(_0x2a057f(0x12e))/0x7)+parseInt(_0x2a057f(0x12b))/0x8*(parseInt(_0x2a057f(0x129))/0x9);if(_0x5896e8===_0xee9f3c)break;else _0x5d564a['push'](_0x5d564a['shift']());}catch(_0x1bd825){_0x5d564a['push'](_0x5d564a['shift']());}}}(a40_0x1d5c,0x4c2fc));import{existsSync,readFileSync}from'node:fs';import{resolve}from'node:path';import{homedir}from'node:os';export const projectConfigPath=resolve(process[a40_0x21c4a8(0x126)](),'.lovrabetrc');export const globalConfigPath=resolve(homedir(),a40_0x21c4a8(0x130));export function readConfig(){const _0x4a6b24=a40_0x21c4a8;let _0x5b3cce={};try{if(existsSync(globalConfigPath)){const _0xbe1c0c=readFileSync(globalConfigPath,{'encoding':_0x4a6b24(0x128)});_0xbe1c0c&&(_0x5b3cce=JSON[_0x4a6b24(0x132)](_0xbe1c0c));}}catch(_0x3cf27a){}try{if(existsSync(projectConfigPath)){const _0x47c642=readFileSync(projectConfigPath,{'encoding':'utf8'});if(_0x47c642){const _0xbd24d5=JSON['parse'](_0x47c642);_0x5b3cce={..._0x5b3cce,..._0xbd24d5};}}}catch(_0x10460e){}return _0x5b3cce;}export function getConfigAppCode(){const _0x380e32=a40_0x21c4a8;let _0x39d933={},_0x594778={};try{if(existsSync(globalConfigPath)){const _0x521de8=readFileSync(globalConfigPath,{'encoding':'utf8'});_0x521de8&&(_0x594778=JSON[_0x380e32(0x132)](_0x521de8));}}catch(_0xe53b5e){}try{if(existsSync(projectConfigPath)){const _0x54d9ba=readFileSync(projectConfigPath,{'encoding':_0x380e32(0x128)});_0x54d9ba&&(_0x39d933=JSON[_0x380e32(0x132)](_0x54d9ba));}}catch(_0x50a808){}let _0x2f9666;if('appcode'in _0x39d933)_0x2f9666=_0x39d933[_0x380e32(0x12d)];else{if(_0x380e32(0x134)in _0x39d933)_0x2f9666=_0x39d933[_0x380e32(0x134)];else{if('appcode'in _0x594778)_0x2f9666=_0x594778[_0x380e32(0x12d)];else _0x380e32(0x134)in _0x594778&&(_0x2f9666=_0x594778['app']);}}if(typeof _0x2f9666!==_0x380e32(0x12a)||_0x2f9666['trim']()==='')return undefined;return _0x2f9666;}export function isInProject(){return existsSync(projectConfigPath);}function a40_0x1d5c(){const _0xfd61c7=['parse','734046TaRKEG','app','52684USjjZy','cwd','492379OsSdxh','utf8','3478887CgfTMg','string','8Nzgwsr','176136HWtuAM','appcode','147DTaVeB','1087750aPYrCD','.lovrabetrc','7440MoPIVJ'];a40_0x1d5c=function(){return _0xfd61c7;};return a40_0x1d5c();}
@@ -1 +1 @@
1
- (function(_0x392710,_0x574f0a){const _0x3d9529=a38_0x50f9,_0x9b53be=_0x392710();while(!![]){try{const _0x49f190=-parseInt(_0x3d9529(0xe4))/0x1+-parseInt(_0x3d9529(0xe3))/0x2+parseInt(_0x3d9529(0xe5))/0x3*(-parseInt(_0x3d9529(0xe9))/0x4)+parseInt(_0x3d9529(0xe1))/0x5*(parseInt(_0x3d9529(0xe2))/0x6)+parseInt(_0x3d9529(0xec))/0x7*(parseInt(_0x3d9529(0xe7))/0x8)+parseInt(_0x3d9529(0xe8))/0x9*(parseInt(_0x3d9529(0xdc))/0xa)+-parseInt(_0x3d9529(0xdf))/0xb*(-parseInt(_0x3d9529(0xdb))/0xc);if(_0x49f190===_0x574f0a)break;else _0x9b53be['push'](_0x9b53be['shift']());}catch(_0x5829b0){_0x9b53be['push'](_0x9b53be['shift']());}}}(a38_0x3d3b,0x47e99));import a38_0x403125 from'node:path';function a38_0x50f9(_0x33f705,_0x4c10ef){const _0x3d3bb4=a38_0x3d3b();return a38_0x50f9=function(_0x50f9af,_0xea1abe){_0x50f9af=_0x50f9af-0xdb;let _0xcf736d=_0x3d3bb4[_0x50f9af];return _0xcf736d;},a38_0x50f9(_0x33f705,_0x4c10ef);}import a38_0x1e22bc from'node:fs';export async function copyDirectory(_0x28ef1e,_0x382839){const _0x161f35=a38_0x50f9;try{const _0x27fe8b=a38_0x1e22bc[_0x161f35(0xe6)](_0x28ef1e,{'withFileTypes':!![]});a38_0x1e22bc[_0x161f35(0xe0)](_0x382839,{'recursive':!![]});for(const _0x527894 of _0x27fe8b){const _0x4f47a5=a38_0x403125[_0x161f35(0xea)](_0x28ef1e,_0x527894['name']),_0x1014d1=a38_0x403125[_0x161f35(0xea)](_0x382839,_0x527894['name']);_0x527894[_0x161f35(0xeb)]()?await copyDirectory(_0x4f47a5,_0x1014d1):a38_0x1e22bc['copyFileSync'](_0x4f47a5,_0x1014d1);}}catch(_0x44dd62){console[_0x161f35(0xde)](_0x161f35(0xdd),_0x44dd62);}}function a38_0x3d3b(){const _0x2e7ad2=['复制目录时出错:','error','19437izNius','mkdirSync','194280NIsPTX','48MuFASz','913380Znngco','423205WHchLD','25863yOcABk','readdirSync','400160RORXfV','279OMQbDo','148uQocyT','join','isDirectory','21Ozayrd','5232spSCga','84550QNjjTi'];a38_0x3d3b=function(){return _0x2e7ad2;};return a38_0x3d3b();}
1
+ function a41_0x593f(_0x5e600f,_0x4c0978){const _0x1071bd=a41_0x1071();return a41_0x593f=function(_0x593f47,_0x559b72){_0x593f47=_0x593f47-0x139;let _0x3952e0=_0x1071bd[_0x593f47];return _0x3952e0;},a41_0x593f(_0x5e600f,_0x4c0978);}(function(_0x11c3b2,_0x2a899c){const _0x387c9f=a41_0x593f,_0xe14f12=_0x11c3b2();while(!![]){try{const _0x458657=parseInt(_0x387c9f(0x140))/0x1+parseInt(_0x387c9f(0x143))/0x2+-parseInt(_0x387c9f(0x147))/0x3+-parseInt(_0x387c9f(0x144))/0x4+parseInt(_0x387c9f(0x13b))/0x5*(-parseInt(_0x387c9f(0x141))/0x6)+-parseInt(_0x387c9f(0x13f))/0x7+-parseInt(_0x387c9f(0x142))/0x8*(-parseInt(_0x387c9f(0x13c))/0x9);if(_0x458657===_0x2a899c)break;else _0xe14f12['push'](_0xe14f12['shift']());}catch(_0x4bf711){_0xe14f12['push'](_0xe14f12['shift']());}}}(a41_0x1071,0x511eb));import a41_0x52faf6 from'node:path';function a41_0x1071(){const _0x574065=['name','readdirSync','5sCKxtZ','1540827flqmUW','error','isDirectory','1148336ScoSTv','202245RiSyKh','2505882vVjZMp','40XCXete','258698CfBtmr','250908potndH','join','copyFileSync','632760pzBbSl'];a41_0x1071=function(){return _0x574065;};return a41_0x1071();}import a41_0xc3a5e3 from'node:fs';export async function copyDirectory(_0x45d7ff,_0x53e537){const _0x3a87d6=a41_0x593f;try{const _0x4a6c58=a41_0xc3a5e3[_0x3a87d6(0x13a)](_0x45d7ff,{'withFileTypes':!![]});a41_0xc3a5e3['mkdirSync'](_0x53e537,{'recursive':!![]});for(const _0x287c13 of _0x4a6c58){const _0xc5494=a41_0x52faf6[_0x3a87d6(0x145)](_0x45d7ff,_0x287c13['name']),_0x1ca51a=a41_0x52faf6[_0x3a87d6(0x145)](_0x53e537,_0x287c13[_0x3a87d6(0x139)]);_0x287c13[_0x3a87d6(0x13e)]()?await copyDirectory(_0xc5494,_0x1ca51a):a41_0xc3a5e3[_0x3a87d6(0x146)](_0xc5494,_0x1ca51a);}}catch(_0x44f681){console[_0x3a87d6(0x13d)]('复制目录时出错:',_0x44f681);}}
@@ -1 +1 @@
1
- (function(_0x27b59c,_0x225cad){const _0x443d1f=a39_0x1afc,_0x41fa83=_0x27b59c();while(!![]){try{const _0x48500d=parseInt(_0x443d1f(0x1d6))/0x1*(parseInt(_0x443d1f(0x1d0))/0x2)+parseInt(_0x443d1f(0x1de))/0x3+parseInt(_0x443d1f(0x1d8))/0x4+-parseInt(_0x443d1f(0x1e5))/0x5+-parseInt(_0x443d1f(0x1d9))/0x6+parseInt(_0x443d1f(0x1ce))/0x7+-parseInt(_0x443d1f(0x1cf))/0x8;if(_0x48500d===_0x225cad)break;else _0x41fa83['push'](_0x41fa83['shift']());}catch(_0x47cbb6){_0x41fa83['push'](_0x41fa83['shift']());}}}(a39_0x4c39,0x32030));function a39_0x4c39(){const _0x162869=['ms\x20后进行第\x20','includes','Request\x20failed','name','get','message','1243985JMlDvV','454874qSeBZl','219952KkTQty','21126NqzbtF','text','url','\x20次重试...','fetch','log','35zddkSP','content-type','64868GxnBNZ','641226eAehGI','statusText','ENOTFOUND','headers','json','411318ySPzwk'];a39_0x4c39=function(){return _0x162869;};return a39_0x4c39();}export async function httpRequest(_0xcefcfb,_0x265de1={}){const _0x5f4341=a39_0x1afc,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x265de1;let _0x37f290=null;for(let _0x298456=0x0;_0x298456<=retries;_0x298456++){try{const _0x48810b=new AbortController(),_0x87630f=setTimeout(()=>_0x48810b['abort'](),timeout),_0x393252=await fetch(_0xcefcfb,{'headers':headers,'signal':_0x48810b['signal']});clearTimeout(_0x87630f);let _0x4dbb22;const _0x3cabc1=_0x393252[_0x5f4341(0x1dc)][_0x5f4341(0x1e3)](_0x5f4341(0x1d7));return _0x3cabc1?.['includes']('application/json')?_0x4dbb22=await _0x393252[_0x5f4341(0x1dd)]():_0x4dbb22=await _0x393252[_0x5f4341(0x1d1)](),{'ok':_0x393252['ok'],'status':_0x393252['status'],'statusText':_0x393252[_0x5f4341(0x1da)],'data':_0x4dbb22,'headers':_0x393252[_0x5f4341(0x1dc)],'url':_0x393252[_0x5f4341(0x1d2)],'text':()=>_0x393252['text']()};}catch(_0x32449e){_0x37f290=_0x32449e instanceof Error?_0x32449e:new Error(String(_0x32449e));if(_0x298456===retries)break;if(shouldRetry(_0x32449e)){console[_0x5f4341(0x1d5)]('*\x20请求失败,'+retryDelay+_0x5f4341(0x1df)+(_0x298456+0x1)+_0x5f4341(0x1d3)),await sleep(retryDelay);continue;}else break;}}throw _0x37f290||new Error(_0x5f4341(0x1e1));}function a39_0x1afc(_0xc6008c,_0x45ded6){const _0x4c39be=a39_0x4c39();return a39_0x1afc=function(_0x1afc69,_0x3d6064){_0x1afc69=_0x1afc69-0x1ce;let _0x20e20f=_0x4c39be[_0x1afc69];return _0x20e20f;},a39_0x1afc(_0xc6008c,_0x45ded6);}function shouldRetry(_0x12e28e){const _0x4faed7=a39_0x1afc;if(_0x12e28e instanceof Error){if(_0x12e28e[_0x4faed7(0x1e2)]==='AbortError')return![];if(_0x12e28e[_0x4faed7(0x1e2)]==='TypeError'&&_0x12e28e[_0x4faed7(0x1e4)][_0x4faed7(0x1e0)](_0x4faed7(0x1d4)))return!![];if(_0x12e28e['message'][_0x4faed7(0x1e0)]('ECONNRESET'))return!![];if(_0x12e28e[_0x4faed7(0x1e4)][_0x4faed7(0x1e0)](_0x4faed7(0x1db)))return![];}return![];}function sleep(_0x55f200){return new Promise(_0x369299=>setTimeout(_0x369299,_0x55f200));}export function validateUrl(_0x32eaa0){try{return new URL(_0x32eaa0),!![];}catch{return![];}}
1
+ (function(_0x1bb1d3,_0x373f36){const _0x10d19b=a42_0x33fa,_0x452759=_0x1bb1d3();while(!![]){try{const _0x84e687=-parseInt(_0x10d19b(0x162))/0x1*(parseInt(_0x10d19b(0x15a))/0x2)+-parseInt(_0x10d19b(0x169))/0x3+-parseInt(_0x10d19b(0x15d))/0x4+parseInt(_0x10d19b(0x157))/0x5+parseInt(_0x10d19b(0x15b))/0x6*(parseInt(_0x10d19b(0x15e))/0x7)+-parseInt(_0x10d19b(0x15f))/0x8+parseInt(_0x10d19b(0x16a))/0x9;if(_0x84e687===_0x373f36)break;else _0x452759['push'](_0x452759['shift']());}catch(_0x7b0582){_0x452759['push'](_0x452759['shift']());}}}(a42_0x3740,0xb1d3f));export async function httpRequest(_0x4fd396,_0x3854b2={}){const _0x4733f3=a42_0x33fa,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x3854b2;let _0x81fd11=null;for(let _0x1c50fc=0x0;_0x1c50fc<=retries;_0x1c50fc++){try{const _0x17b6c2=new AbortController(),_0x3f30b4=setTimeout(()=>_0x17b6c2[_0x4733f3(0x156)](),timeout),_0xa334f1=await fetch(_0x4fd396,{'headers':headers,'signal':_0x17b6c2['signal']});clearTimeout(_0x3f30b4);let _0x54fa3d;const _0xa86381=_0xa334f1[_0x4733f3(0x170)]['get'](_0x4733f3(0x163));return _0xa86381?.[_0x4733f3(0x158)]('application/json')?_0x54fa3d=await _0xa334f1[_0x4733f3(0x16c)]():_0x54fa3d=await _0xa334f1[_0x4733f3(0x16d)](),{'ok':_0xa334f1['ok'],'status':_0xa334f1[_0x4733f3(0x168)],'statusText':_0xa334f1['statusText'],'data':_0x54fa3d,'headers':_0xa334f1[_0x4733f3(0x170)],'url':_0xa334f1[_0x4733f3(0x161)],'text':()=>_0xa334f1[_0x4733f3(0x16d)]()};}catch(_0x3ad873){_0x81fd11=_0x3ad873 instanceof Error?_0x3ad873:new Error(String(_0x3ad873));if(_0x1c50fc===retries)break;if(shouldRetry(_0x3ad873)){console[_0x4733f3(0x165)](_0x4733f3(0x16b)+retryDelay+_0x4733f3(0x160)+(_0x1c50fc+0x1)+_0x4733f3(0x159)),await sleep(retryDelay);continue;}else break;}}throw _0x81fd11||new Error('Request\x20failed');}function a42_0x3740(){const _0x3c6bcb=['abort','3657380CxdABd','includes','\x20次重试...','2SDkDOR','174UFfeek','TypeError','3702336hYfBQx','341866stpZdM','1536784fQqtgb','ms\x20后进行第\x20','url','736410Nsqvgn','content-type','message','log','ENOTFOUND','ECONNRESET','status','3414432bAglba','14155569maIYuS','*\x20请求失败,','json','text','fetch','AbortError','headers'];a42_0x3740=function(){return _0x3c6bcb;};return a42_0x3740();}function shouldRetry(_0x58bf58){const _0x3d3f53=a42_0x33fa;if(_0x58bf58 instanceof Error){if(_0x58bf58['name']===_0x3d3f53(0x16f))return![];if(_0x58bf58['name']===_0x3d3f53(0x15c)&&_0x58bf58[_0x3d3f53(0x164)][_0x3d3f53(0x158)](_0x3d3f53(0x16e)))return!![];if(_0x58bf58['message']['includes'](_0x3d3f53(0x167)))return!![];if(_0x58bf58['message'][_0x3d3f53(0x158)](_0x3d3f53(0x166)))return![];}return![];}function sleep(_0x322f2e){return new Promise(_0x242977=>setTimeout(_0x242977,_0x322f2e));}function a42_0x33fa(_0x373a52,_0x5d771e){const _0x37405a=a42_0x3740();return a42_0x33fa=function(_0x33fa2d,_0x3576bb){_0x33fa2d=_0x33fa2d-0x156;let _0xabae14=_0x37405a[_0x33fa2d];return _0xabae14;},a42_0x33fa(_0x373a52,_0x5d771e);}export function validateUrl(_0x1d0807){try{return new URL(_0x1d0807),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a40_0x175f4f=a40_0x3596;(function(_0x5ddb22,_0x5e1524){const _0x56b714=a40_0x3596,_0x4c1c72=_0x5ddb22();while(!![]){try{const _0x5c52a4=parseInt(_0x56b714(0x8f))/0x1*(parseInt(_0x56b714(0x8c))/0x2)+-parseInt(_0x56b714(0x8d))/0x3+-parseInt(_0x56b714(0xaf))/0x4+-parseInt(_0x56b714(0x96))/0x5*(-parseInt(_0x56b714(0xa5))/0x6)+parseInt(_0x56b714(0xab))/0x7*(-parseInt(_0x56b714(0xb0))/0x8)+-parseInt(_0x56b714(0xb2))/0x9*(parseInt(_0x56b714(0x95))/0xa)+parseInt(_0x56b714(0x9b))/0xb*(parseInt(_0x56b714(0xb6))/0xc);if(_0x5c52a4===_0x5e1524)break;else _0x4c1c72['push'](_0x4c1c72['shift']());}catch(_0x522cbb){_0x4c1c72['push'](_0x4c1c72['shift']());}}}(a40_0x1cfd,0x8dafe));function a40_0x1cfd(){const _0xf173b1=['log','command','split','readLogs','11nNFqGf','duration','red','map','combine','winstonLogger','initWinstonLogger','transports','clearLogs','join','4520274azBpAb','filter','green','writeFileSync','error','clear','349496BojKEZ','format','info','timestamp','236184KELYMo','64JEdtpr','dirname','18xCIEGZ','utf8','logFilePath','yellow','1175316blJRTZ','.lovrabet.log','unknown','Failed\x20to\x20clear\x20logs:','setLogPath','printf','now','existsSync','success','warn','message','774AjBWsv','928773nflZwZ','details','2079qUkBxD','Failed\x20to\x20read\x20logs:','createLogger','stringify','File','getWinstonInstance','1537420XIkLLJ','5wjNGRm'];a40_0x1cfd=function(){return _0xf173b1;};return a40_0x1cfd();}function a40_0x3596(_0xfa0f01,_0x101080){const _0x1cfd1a=a40_0x1cfd();return a40_0x3596=function(_0x3596d0,_0x1341fd){_0x3596d0=_0x3596d0-0x87;let _0x55b01e=_0x1cfd1a[_0x3596d0];return _0x55b01e;},a40_0x3596(_0xfa0f01,_0x101080);}import a40_0x9e10cd from'winston';import a40_0x528f20 from'node:fs';import a40_0x2806c9 from'node:path';class Logger{[a40_0x175f4f(0xa0)];['logFilePath'];constructor(){const _0x345fa5=a40_0x175f4f;this[_0x345fa5(0xb4)]='';}[a40_0x175f4f(0xa1)](){const _0x39031a=a40_0x175f4f,_0x468b15=a40_0x2806c9[_0x39031a(0xb1)](this[_0x39031a(0xb4)]);!a40_0x528f20[_0x39031a(0x88)](_0x468b15)&&a40_0x528f20['mkdirSync'](_0x468b15,{'recursive':!![]});const _0x4a37e9=a40_0x9e10cd['format'][_0x39031a(0x9f)](a40_0x9e10cd[_0x39031a(0xac)]['timestamp'](),a40_0x9e10cd[_0x39031a(0xac)]['errors']({'stack':!![]}),a40_0x9e10cd[_0x39031a(0xac)][_0x39031a(0xbb)](_0x2fc6a0=>{const _0x28b9cd=_0x39031a,_0x3ba415={'timestamp':_0x2fc6a0[_0x28b9cd(0xae)]||new Date()['toISOString'](),'level':_0x2fc6a0['level']||'info','command':_0x2fc6a0[_0x28b9cd(0x98)]||_0x28b9cd(0xb8),'message':_0x2fc6a0[_0x28b9cd(0x8b)]||'','duration':_0x2fc6a0[_0x28b9cd(0x9c)]||undefined,'details':_0x2fc6a0[_0x28b9cd(0x8e)]||undefined};return JSON[_0x28b9cd(0x92)](_0x3ba415);}));this[_0x39031a(0xa0)]=a40_0x9e10cd[_0x39031a(0x91)]({'level':_0x39031a(0xad),'format':_0x4a37e9,'transports':[new a40_0x9e10cd[(_0x39031a(0xa2))][(_0x39031a(0x93))]({'filename':this['logFilePath'],'level':_0x39031a(0xad)})],'silent':![]}),a40_0x9e10cd['addColors']({'success':_0x39031a(0xa7),'error':_0x39031a(0x9d),'warn':_0x39031a(0xb5),'info':'blue'});}[a40_0x175f4f(0xba)](_0x2a3fc4){const _0x1e3d03=a40_0x175f4f;this[_0x1e3d03(0xb4)]=a40_0x2806c9[_0x1e3d03(0xa4)](_0x2a3fc4,_0x1e3d03(0xb7)),this[_0x1e3d03(0xa0)]&&this[_0x1e3d03(0xa0)][_0x1e3d03(0xaa)](),this[_0x1e3d03(0xa1)]();}['info'](_0x2bb433,_0x110591,_0x20f5ff){const _0x54b251=a40_0x175f4f;if(!this['logFilePath']||!this[_0x54b251(0xa0)])return;this[_0x54b251(0xa0)][_0x54b251(0xad)](_0x110591,{'command':_0x2bb433,'details':_0x20f5ff});}[a40_0x175f4f(0x89)](_0x5de38c,_0x761e9a,_0x39004c,_0x4ddc8f){const _0x1550dd=a40_0x175f4f;if(!this[_0x1550dd(0xb4)]||!this['winstonLogger'])return;this[_0x1550dd(0xa0)][_0x1550dd(0x97)](_0x1550dd(0xad),_0x761e9a,{'level':'success','command':_0x5de38c,'duration':_0x39004c,'details':_0x4ddc8f});}[a40_0x175f4f(0xa9)](_0x27992f,_0x84b15a,_0x4cc1a2){const _0x1b629b=a40_0x175f4f;if(!this[_0x1b629b(0xb4)]||!this[_0x1b629b(0xa0)])return;this[_0x1b629b(0xa0)]['error'](_0x84b15a,{'command':_0x27992f,'details':_0x4cc1a2});}['warn'](_0x49e8fa,_0x414bca,_0x5a94a5){const _0x472e9f=a40_0x175f4f;if(!this[_0x472e9f(0xb4)]||!this[_0x472e9f(0xa0)])return;this[_0x472e9f(0xa0)][_0x472e9f(0x8a)](_0x414bca,{'command':_0x49e8fa,'details':_0x5a94a5});}async['logTask'](_0x2f72fd,_0x302f49,_0x1d1679){const _0x41c0f5=a40_0x175f4f,_0x39f937=Date['now']();this[_0x41c0f5(0xad)](_0x2f72fd,'开始执行:\x20'+_0x302f49);try{const _0x20367a=await _0x1d1679(),_0x6793fd=Date['now']()-_0x39f937;return this[_0x41c0f5(0x89)](_0x2f72fd,'完成:\x20'+_0x302f49,_0x6793fd),_0x20367a;}catch(_0x385b33){const _0x1ac685=Date[_0x41c0f5(0x87)]()-_0x39f937;this[_0x41c0f5(0xa9)](_0x2f72fd,'失败:\x20'+_0x302f49,{'error':_0x385b33 instanceof Error?_0x385b33[_0x41c0f5(0x8b)]:String(_0x385b33),'duration':_0x1ac685});throw _0x385b33;}}[a40_0x175f4f(0x9a)](){const _0x42e904=a40_0x175f4f;try{if(!a40_0x528f20[_0x42e904(0x88)](this[_0x42e904(0xb4)]))return[];const _0x137be0=a40_0x528f20['readFileSync'](this[_0x42e904(0xb4)],_0x42e904(0xb3));return _0x137be0[_0x42e904(0x99)]('\x0a')[_0x42e904(0xa6)](_0x5cb8ac=>_0x5cb8ac['trim']())[_0x42e904(0x9e)](_0x2109c1=>JSON['parse'](_0x2109c1));}catch(_0x513f9f){return console[_0x42e904(0x8a)](_0x42e904(0x90),_0x513f9f),[];}}[a40_0x175f4f(0xa3)](){const _0x23446c=a40_0x175f4f;try{a40_0x528f20[_0x23446c(0x88)](this[_0x23446c(0xb4)])&&a40_0x528f20[_0x23446c(0xa8)](this[_0x23446c(0xb4)],'',_0x23446c(0xb3));}catch(_0x35d810){console[_0x23446c(0x8a)](_0x23446c(0xb9),_0x35d810);}}[a40_0x175f4f(0x94)](){return this['winstonLogger'];}}export const logger=new Logger();
1
+ const a43_0x128fc8=a43_0x4c00;function a43_0x4c00(_0x141159,_0x468b24){const _0x567b47=a43_0x567b();return a43_0x4c00=function(_0x4c00b9,_0x1bd086){_0x4c00b9=_0x4c00b9-0x135;let _0x957542=_0x567b47[_0x4c00b9];return _0x957542;},a43_0x4c00(_0x141159,_0x468b24);}(function(_0x1b1cc7,_0x3a6c28){const _0x11c078=a43_0x4c00,_0x26d1fd=_0x1b1cc7();while(!![]){try{const _0xc5eb4d=parseInt(_0x11c078(0x141))/0x1+parseInt(_0x11c078(0x15f))/0x2+-parseInt(_0x11c078(0x155))/0x3+-parseInt(_0x11c078(0x144))/0x4+-parseInt(_0x11c078(0x148))/0x5*(-parseInt(_0x11c078(0x14b))/0x6)+parseInt(_0x11c078(0x16b))/0x7+-parseInt(_0x11c078(0x13d))/0x8;if(_0xc5eb4d===_0x3a6c28)break;else _0x26d1fd['push'](_0x26d1fd['shift']());}catch(_0x2aea60){_0x26d1fd['push'](_0x26d1fd['shift']());}}}(a43_0x567b,0x5479a));import a43_0x41fa72 from'winston';import a43_0x5bd804 from'node:fs';import a43_0x13afc0 from'node:path';function a43_0x567b(){const _0x1a39dc=['logFilePath','clearLogs','warn','clear','error','writeFileSync','3439443LrpdZw','green','setRawCommand','now','initWinstonLogger','.lovrabet.log','log','getWinstonInstance','trim','6171800DKlzMx','mkdirSync','完成:\x20','toISOString','273996WUDAzv','失败:\x20','readFileSync','1871964McDbCg','File','blue','transports','347405GskqbZ','utf8','existsSync','30tfQzua','printf','message','unknown','map','winstonLogger','currentRawCommand','level','开始执行:\x20','parse','103584IedRvh','readLogs','logTask','format','timestamp','setLogPath','info','stringify','split','details','1014508DMaLdR','join','success','red','addColors','rawCommand'];a43_0x567b=function(){return _0x1a39dc;};return a43_0x567b();}class Logger{[a43_0x128fc8(0x150)];[a43_0x128fc8(0x165)];[a43_0x128fc8(0x151)]='';constructor(){const _0x8dcb4c=a43_0x128fc8;this[_0x8dcb4c(0x165)]='';}[a43_0x128fc8(0x136)](_0x3daef7){const _0x231842=a43_0x128fc8;this[_0x231842(0x151)]=_0x3daef7;}[a43_0x128fc8(0x138)](){const _0x54a792=a43_0x128fc8,_0x2bee56=a43_0x13afc0['dirname'](this[_0x54a792(0x165)]);!a43_0x5bd804[_0x54a792(0x14a)](_0x2bee56)&&a43_0x5bd804[_0x54a792(0x13e)](_0x2bee56,{'recursive':!![]});const _0x9d7e0=a43_0x41fa72[_0x54a792(0x158)]['combine'](a43_0x41fa72[_0x54a792(0x158)][_0x54a792(0x159)](),a43_0x41fa72[_0x54a792(0x158)]['errors']({'stack':!![]}),a43_0x41fa72[_0x54a792(0x158)][_0x54a792(0x14c)](_0x55a37a=>{const _0x1b854b=_0x54a792,_0x30567e={'timestamp':_0x55a37a[_0x1b854b(0x159)]||new Date()[_0x1b854b(0x140)](),'level':_0x55a37a[_0x1b854b(0x152)]||_0x1b854b(0x15b),'command':_0x55a37a['command']||_0x1b854b(0x14e),'rawCommand':_0x55a37a[_0x1b854b(0x164)]||this[_0x1b854b(0x151)]||undefined,'message':_0x55a37a[_0x1b854b(0x14d)]||'','duration':_0x55a37a['duration']||undefined,'details':_0x55a37a[_0x1b854b(0x15e)]||undefined};return JSON[_0x1b854b(0x15c)](_0x30567e);}));this['winstonLogger']=a43_0x41fa72['createLogger']({'level':_0x54a792(0x15b),'format':_0x9d7e0,'transports':[new a43_0x41fa72[(_0x54a792(0x147))][(_0x54a792(0x145))]({'filename':this['logFilePath'],'level':'info'})],'silent':![]}),a43_0x41fa72[_0x54a792(0x163)]({'success':_0x54a792(0x135),'error':_0x54a792(0x162),'warn':'yellow','info':_0x54a792(0x146)});}[a43_0x128fc8(0x15a)](_0x4a83be){const _0x16e914=a43_0x128fc8;this[_0x16e914(0x165)]=a43_0x13afc0[_0x16e914(0x160)](_0x4a83be,_0x16e914(0x139)),this['winstonLogger']&&this[_0x16e914(0x150)][_0x16e914(0x168)](),this[_0x16e914(0x138)]();}[a43_0x128fc8(0x15b)](_0xd1ffc,_0x4e9da0,_0x487ed4){const _0x1ea518=a43_0x128fc8;if(!this[_0x1ea518(0x165)]||!this[_0x1ea518(0x150)])return;this[_0x1ea518(0x150)][_0x1ea518(0x15b)](_0x4e9da0,{'command':_0xd1ffc,'details':_0x487ed4});}[a43_0x128fc8(0x161)](_0x37c0f8,_0x518609,_0x3002b0,_0x42c54d){const _0x13f7ee=a43_0x128fc8;if(!this[_0x13f7ee(0x165)]||!this[_0x13f7ee(0x150)])return;this[_0x13f7ee(0x150)][_0x13f7ee(0x13a)]('info',_0x518609,{'level':'success','command':_0x37c0f8,'duration':_0x3002b0,'details':_0x42c54d});}[a43_0x128fc8(0x169)](_0x5a25b1,_0x9f2f04,_0x1a4eb7){const _0x2ea27f=a43_0x128fc8;if(!this[_0x2ea27f(0x165)]||!this['winstonLogger'])return;this[_0x2ea27f(0x150)][_0x2ea27f(0x169)](_0x9f2f04,{'command':_0x5a25b1,'details':_0x1a4eb7});}[a43_0x128fc8(0x167)](_0x3e3607,_0x39b182,_0x153b6b){const _0x5353c6=a43_0x128fc8;if(!this['logFilePath']||!this[_0x5353c6(0x150)])return;this[_0x5353c6(0x150)][_0x5353c6(0x167)](_0x39b182,{'command':_0x3e3607,'details':_0x153b6b});}async[a43_0x128fc8(0x157)](_0x7ee523,_0x183a7b,_0x20233f){const _0x499d2c=a43_0x128fc8,_0x51684b=Date['now']();this['info'](_0x7ee523,_0x499d2c(0x153)+_0x183a7b);try{const _0x54e623=await _0x20233f(),_0x277487=Date['now']()-_0x51684b;return this[_0x499d2c(0x161)](_0x7ee523,_0x499d2c(0x13f)+_0x183a7b,_0x277487),_0x54e623;}catch(_0x48ff79){const _0x343ff1=Date[_0x499d2c(0x137)]()-_0x51684b;this[_0x499d2c(0x169)](_0x7ee523,_0x499d2c(0x142)+_0x183a7b,{'error':_0x48ff79 instanceof Error?_0x48ff79[_0x499d2c(0x14d)]:String(_0x48ff79),'duration':_0x343ff1});throw _0x48ff79;}}[a43_0x128fc8(0x156)](){const _0x1e61b8=a43_0x128fc8;try{if(!a43_0x5bd804[_0x1e61b8(0x14a)](this['logFilePath']))return[];const _0x18dba2=a43_0x5bd804[_0x1e61b8(0x143)](this[_0x1e61b8(0x165)],_0x1e61b8(0x149));return _0x18dba2[_0x1e61b8(0x15d)]('\x0a')['filter'](_0x1b5ad4=>_0x1b5ad4[_0x1e61b8(0x13c)]())[_0x1e61b8(0x14f)](_0x338369=>JSON[_0x1e61b8(0x154)](_0x338369));}catch(_0x218f01){return console[_0x1e61b8(0x167)]('Failed\x20to\x20read\x20logs:',_0x218f01),[];}}[a43_0x128fc8(0x166)](){const _0x1b8acc=a43_0x128fc8;try{a43_0x5bd804[_0x1b8acc(0x14a)](this[_0x1b8acc(0x165)])&&a43_0x5bd804[_0x1b8acc(0x16a)](this[_0x1b8acc(0x165)],'',_0x1b8acc(0x149));}catch(_0x19b382){console[_0x1b8acc(0x167)]('Failed\x20to\x20clear\x20logs:',_0x19b382);}}[a43_0x128fc8(0x13b)](){const _0x1cca6d=a43_0x128fc8;return this[_0x1cca6d(0x150)];}}export const logger=new Logger();
@@ -1 +1 @@
1
- const a41_0x56a5b7=a41_0x225f;(function(_0xa43623,_0x34a050){const _0x5d92b5=a41_0x225f,_0x1974e8=_0xa43623();while(!![]){try{const _0x29d36f=parseInt(_0x5d92b5(0x1b0))/0x1*(-parseInt(_0x5d92b5(0x18e))/0x2)+parseInt(_0x5d92b5(0x191))/0x3*(-parseInt(_0x5d92b5(0x18b))/0x4)+-parseInt(_0x5d92b5(0x197))/0x5+parseInt(_0x5d92b5(0x196))/0x6+-parseInt(_0x5d92b5(0x19d))/0x7*(-parseInt(_0x5d92b5(0x18d))/0x8)+-parseInt(_0x5d92b5(0x189))/0x9+parseInt(_0x5d92b5(0x185))/0xa;if(_0x29d36f===_0x34a050)break;else _0x1974e8['push'](_0x1974e8['shift']());}catch(_0x2e20ad){_0x1974e8['push'](_0x1974e8['shift']());}}}(a41_0x2ae2,0xe2b6b));import a41_0x3fb513 from'node:fs';import a41_0x4dbb1d from'node:path';function a41_0x225f(_0x19f927,_0x313ab3){const _0x2ae203=a41_0x2ae2();return a41_0x225f=function(_0x225f0c,_0x1d9ffc){_0x225f0c=_0x225f0c-0x184;let _0x34f19c=_0x2ae203[_0x225f0c];return _0x34f19c;},a41_0x225f(_0x19f927,_0x313ab3);}import{logger}from'./logger.js';function a41_0x2ae2(){const _0x5f1199=['766132cSAmOh','index.tsx','now','24PybJLs','charAt','includes','toComponentName','路由配置更新失败','8670228MdxcoT','9030815KHdteu','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','writeFile','slice','length','addPageRoute','53179sqtrGE','match','src','previewChanges','path:\x20\x22','map','readFile','utf8','error','开始更新路由配置','addRoute','info','import\x20','router','addImport','\x20from\x20\x22../pages/','existsSync','promises','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','3cnpJlL','toLowerCase','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','35416750XUdtVp','join','路由文件不存在:\x20','toUpperCase','4864059YCGkck','index','729364GiXFnh','routerFilePath','944EWjsKE'];a41_0x2ae2=function(){return _0x5f1199;};return a41_0x2ae2();}export class RouterUpdater{[a41_0x56a5b7(0x18c)];constructor(_0x5c1ee7){const _0x5c56cc=a41_0x56a5b7;this[_0x5c56cc(0x18c)]=a41_0x4dbb1d[_0x5c56cc(0x186)](_0x5c1ee7,_0x5c56cc(0x19f),_0x5c56cc(0x1aa),_0x5c56cc(0x18f));}async[a41_0x56a5b7(0x19c)](_0x3f7ef7,_0x471f22){const _0x3c5459=a41_0x56a5b7;if(!a41_0x3fb513['existsSync'](this[_0x3c5459(0x18c)]))throw new Error(_0x3c5459(0x187)+this['routerFilePath']);const _0x19189b=Date[_0x3c5459(0x190)]();logger[_0x3c5459(0x1a8)](_0x3c5459(0x1aa),_0x3c5459(0x1a6),{'pageName':_0x3f7ef7,'routePath':_0x471f22,'file':this[_0x3c5459(0x18c)]});try{const _0x20a0c3=await a41_0x3fb513[_0x3c5459(0x1ae)][_0x3c5459(0x1a3)](this[_0x3c5459(0x18c)],_0x3c5459(0x1a4)),_0x11d4e5=this[_0x3c5459(0x194)](_0x3f7ef7),_0x50f9c8=this[_0x3c5459(0x1ab)](_0x20a0c3,_0x11d4e5,_0x3f7ef7),_0x355229=this[_0x3c5459(0x1a7)](_0x50f9c8,_0x471f22,_0x11d4e5);await a41_0x3fb513[_0x3c5459(0x1ae)][_0x3c5459(0x199)](this[_0x3c5459(0x18c)],_0x355229,_0x3c5459(0x1a4));const _0x42d84f=Date[_0x3c5459(0x190)]()-_0x19189b;logger['success'](_0x3c5459(0x1aa),'路由配置更新完成',_0x42d84f,{'pageName':_0x3f7ef7,'routePath':_0x471f22,'componentName':_0x11d4e5});}catch(_0x59fc0d){const _0x1922c4=Date[_0x3c5459(0x190)]()-_0x19189b;logger[_0x3c5459(0x1a5)](_0x3c5459(0x1aa),_0x3c5459(0x195),{'pageName':_0x3f7ef7,'routePath':_0x471f22,'error':_0x59fc0d instanceof Error?_0x59fc0d['message']:String(_0x59fc0d),'duration':_0x1922c4});throw _0x59fc0d;}}['toComponentName'](_0x3308f1){const _0x395205=a41_0x56a5b7;return _0x3308f1['split']('-')[_0x395205(0x1a2)](_0xcc35da=>_0xcc35da[_0x395205(0x192)](0x0)[_0x395205(0x188)]()+_0xcc35da[_0x395205(0x19a)](0x1)[_0x395205(0x1b1)]())[_0x395205(0x186)]('');}[a41_0x56a5b7(0x1ab)](_0x4d5a56,_0x4bfa5d,_0x5d6233){const _0x26a06f=a41_0x56a5b7,_0x2cfc2d=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x5f17ce=_0x4d5a56[_0x26a06f(0x19e)](_0x2cfc2d)||[],_0x200c3f=_0x26a06f(0x1a9)+_0x4bfa5d+_0x26a06f(0x1ac)+_0x5d6233+'\x22;';if(_0x4d5a56[_0x26a06f(0x193)](_0x200c3f))return _0x4d5a56;if(_0x5f17ce[_0x26a06f(0x19b)]>0x0){const _0x226bf5=_0x5f17ce[_0x5f17ce[_0x26a06f(0x19b)]-0x1];if(_0x226bf5){const _0x1903fe=_0x4d5a56['lastIndexOf'](_0x226bf5),_0x4151d8=_0x1903fe+_0x226bf5['length'];return _0x4d5a56[_0x26a06f(0x19a)](0x0,_0x4151d8)+_0x200c3f+'\x0a'+_0x4d5a56[_0x26a06f(0x19a)](_0x4151d8);}}const _0x249dcb=_0x4d5a56[_0x26a06f(0x19e)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x249dcb&&_0x249dcb['index']!==undefined){const _0x42275a=_0x249dcb['index']+_0x249dcb[0x0][_0x26a06f(0x19b)];return _0x4d5a56[_0x26a06f(0x19a)](0x0,_0x42275a)+_0x200c3f+'\x0a'+_0x4d5a56[_0x26a06f(0x19a)](_0x42275a);}return _0x4d5a56;}[a41_0x56a5b7(0x1a7)](_0x5530fe,_0x2697fd,_0x39efc3){const _0x5c7b9d=a41_0x56a5b7,_0x2c736c=_0x5c7b9d(0x1af)+_0x2697fd+_0x5c7b9d(0x184)+_0x39efc3+_0x5c7b9d(0x198);if(_0x5530fe[_0x5c7b9d(0x193)](_0x5c7b9d(0x1a1)+_0x2697fd+'\x22'))return _0x5530fe;const _0x4c0553=/children:\s*\[([\s\S]*?)\]/,_0x47751f=_0x5530fe[_0x5c7b9d(0x19e)](_0x4c0553);if(!_0x47751f||_0x47751f[_0x5c7b9d(0x18a)]===undefined)throw new Error('未找到路由配置的\x20children\x20数组');const _0x446b93=_0x47751f[0x1],_0x46649e=_0x47751f[_0x5c7b9d(0x18a)]+_0x47751f[0x0]['indexOf']('[')+0x1,_0x23e84f=_0x446b93?.[_0x5c7b9d(0x19e)](/\{[\s\S]*?\},/g)||[];if(_0x23e84f[_0x5c7b9d(0x19b)]>0x0){const _0x5f00ec=_0x23e84f[_0x23e84f[_0x5c7b9d(0x19b)]-0x1];if(_0x5f00ec){const _0x47e945=_0x5530fe['lastIndexOf'](_0x5f00ec),_0x32f7d6=_0x47e945+_0x5f00ec[_0x5c7b9d(0x19b)];return _0x5530fe[_0x5c7b9d(0x19a)](0x0,_0x32f7d6)+'\x0a'+_0x2c736c+_0x5530fe[_0x5c7b9d(0x19a)](_0x32f7d6);}}return _0x5530fe[_0x5c7b9d(0x19a)](0x0,_0x46649e)+'\x0a'+_0x2c736c+_0x5530fe[_0x5c7b9d(0x19a)](_0x46649e);}async[a41_0x56a5b7(0x1a0)](_0x4332b3,_0x5256ef){const _0x54d5a3=a41_0x56a5b7;if(!a41_0x3fb513[_0x54d5a3(0x1ad)](this['routerFilePath']))throw new Error(_0x54d5a3(0x187)+this[_0x54d5a3(0x18c)]);const _0x8b8974=await a41_0x3fb513[_0x54d5a3(0x1ae)][_0x54d5a3(0x1a3)](this[_0x54d5a3(0x18c)],'utf8'),_0x2850a3=this[_0x54d5a3(0x194)](_0x4332b3);let _0x5062d9=this[_0x54d5a3(0x1ab)](_0x8b8974,_0x2850a3,_0x4332b3);return _0x5062d9=this[_0x54d5a3(0x1a7)](_0x5062d9,_0x5256ef,_0x2850a3),_0x5062d9;}}
1
+ function a44_0x5946(_0x38f6bc,_0x3989e7){const _0x30676c=a44_0x3067();return a44_0x5946=function(_0x594671,_0x475676){_0x594671=_0x594671-0x107;let _0x2e3536=_0x30676c[_0x594671];return _0x2e3536;},a44_0x5946(_0x38f6bc,_0x3989e7);}const a44_0x4ec9dd=a44_0x5946;(function(_0x56b7dc,_0x3c49c2){const _0x1f4384=a44_0x5946,_0x4d1d1c=_0x56b7dc();while(!![]){try{const _0x498c92=parseInt(_0x1f4384(0x11d))/0x1*(parseInt(_0x1f4384(0x10f))/0x2)+-parseInt(_0x1f4384(0x114))/0x3+parseInt(_0x1f4384(0x112))/0x4*(parseInt(_0x1f4384(0x111))/0x5)+-parseInt(_0x1f4384(0x12a))/0x6*(parseInt(_0x1f4384(0x108))/0x7)+parseInt(_0x1f4384(0x12d))/0x8*(parseInt(_0x1f4384(0x129))/0x9)+-parseInt(_0x1f4384(0x117))/0xa*(parseInt(_0x1f4384(0x133))/0xb)+-parseInt(_0x1f4384(0x118))/0xc;if(_0x498c92===_0x3c49c2)break;else _0x4d1d1c['push'](_0x4d1d1c['shift']());}catch(_0x41c64e){_0x4d1d1c['push'](_0x4d1d1c['shift']());}}}(a44_0x3067,0xc0abe));import a44_0x89daaa from'node:fs';import a44_0x44ee97 from'node:path';import{logger}from'./logger.js';function a44_0x3067(){const _0xa938d6=['index.tsx','src','previewChanges','addPageRoute','utf8','9159557KmylNv','message','join','match','toComponentName','112511iJVqWt','addImport','indexOf','路由文件不存在:\x20','slice','existsSync','\x20from\x20\x22../pages/','6dIyOPR','error','5SxqgYc','6234044GIoulJ','length','1656135cBXeXy','promises','success','10WDGwTs','992868GmFpuY','lastIndexOf','routerFilePath','toLowerCase','router','31417uKJAYI','index','info','开始更新路由配置','import\x20','map','now','readFile','path:\x20\x22','split','路由配置更新失败','includes','5283WdECJo','318XXIzwh','addRoute','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','19840GGqaYT'];a44_0x3067=function(){return _0xa938d6;};return a44_0x3067();}export class RouterUpdater{[a44_0x4ec9dd(0x11a)];constructor(_0x2efdee){const _0x76f0b0=a44_0x4ec9dd;this[_0x76f0b0(0x11a)]=a44_0x44ee97[_0x76f0b0(0x135)](_0x2efdee,_0x76f0b0(0x12f),_0x76f0b0(0x11c),_0x76f0b0(0x12e));}async[a44_0x4ec9dd(0x131)](_0x1fd39b,_0x53479d){const _0xf5484b=a44_0x4ec9dd;if(!a44_0x89daaa['existsSync'](this['routerFilePath']))throw new Error(_0xf5484b(0x10b)+this[_0xf5484b(0x11a)]);const _0x3f4711=Date[_0xf5484b(0x123)]();logger[_0xf5484b(0x11f)](_0xf5484b(0x11c),_0xf5484b(0x120),{'pageName':_0x1fd39b,'routePath':_0x53479d,'file':this[_0xf5484b(0x11a)]});try{const _0x3eb3d5=await a44_0x89daaa[_0xf5484b(0x115)][_0xf5484b(0x124)](this['routerFilePath'],_0xf5484b(0x132)),_0x42c316=this[_0xf5484b(0x107)](_0x1fd39b),_0x1ad79c=this[_0xf5484b(0x109)](_0x3eb3d5,_0x42c316,_0x1fd39b),_0x1afc35=this[_0xf5484b(0x12b)](_0x1ad79c,_0x53479d,_0x42c316);await a44_0x89daaa[_0xf5484b(0x115)]['writeFile'](this[_0xf5484b(0x11a)],_0x1afc35,_0xf5484b(0x132));const _0x20b1bf=Date['now']()-_0x3f4711;logger[_0xf5484b(0x116)](_0xf5484b(0x11c),'路由配置更新完成',_0x20b1bf,{'pageName':_0x1fd39b,'routePath':_0x53479d,'componentName':_0x42c316});}catch(_0x100bf4){const _0x375a4e=Date[_0xf5484b(0x123)]()-_0x3f4711;logger[_0xf5484b(0x110)](_0xf5484b(0x11c),_0xf5484b(0x127),{'pageName':_0x1fd39b,'routePath':_0x53479d,'error':_0x100bf4 instanceof Error?_0x100bf4[_0xf5484b(0x134)]:String(_0x100bf4),'duration':_0x375a4e});throw _0x100bf4;}}['toComponentName'](_0x3fadba){const _0x4c5d75=a44_0x4ec9dd;return _0x3fadba[_0x4c5d75(0x126)]('-')[_0x4c5d75(0x122)](_0x2e5e21=>_0x2e5e21['charAt'](0x0)['toUpperCase']()+_0x2e5e21[_0x4c5d75(0x10c)](0x1)[_0x4c5d75(0x11b)]())['join']('');}[a44_0x4ec9dd(0x109)](_0x7b2226,_0x462aac,_0x309df0){const _0x59c323=a44_0x4ec9dd,_0x31dc8a=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x35345a=_0x7b2226['match'](_0x31dc8a)||[],_0x37c04b=_0x59c323(0x121)+_0x462aac+_0x59c323(0x10e)+_0x309df0+'\x22;';if(_0x7b2226[_0x59c323(0x128)](_0x37c04b))return _0x7b2226;if(_0x35345a['length']>0x0){const _0x3a905d=_0x35345a[_0x35345a[_0x59c323(0x113)]-0x1];if(_0x3a905d){const _0x10f709=_0x7b2226['lastIndexOf'](_0x3a905d),_0x2ed7ea=_0x10f709+_0x3a905d[_0x59c323(0x113)];return _0x7b2226[_0x59c323(0x10c)](0x0,_0x2ed7ea)+_0x37c04b+'\x0a'+_0x7b2226[_0x59c323(0x10c)](_0x2ed7ea);}}const _0x2b6f8c=_0x7b2226['match'](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x2b6f8c&&_0x2b6f8c[_0x59c323(0x11e)]!==undefined){const _0x4d66c8=_0x2b6f8c['index']+_0x2b6f8c[0x0][_0x59c323(0x113)];return _0x7b2226[_0x59c323(0x10c)](0x0,_0x4d66c8)+_0x37c04b+'\x0a'+_0x7b2226[_0x59c323(0x10c)](_0x4d66c8);}return _0x7b2226;}[a44_0x4ec9dd(0x12b)](_0x235264,_0x26663b,_0x34f3c4){const _0x3fde8f=a44_0x4ec9dd,_0x1853fd='\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22'+_0x26663b+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<'+_0x34f3c4+_0x3fde8f(0x12c);if(_0x235264['includes'](_0x3fde8f(0x125)+_0x26663b+'\x22'))return _0x235264;const _0x3dd846=/children:\s*\[([\s\S]*?)\]/,_0x3b9a82=_0x235264[_0x3fde8f(0x136)](_0x3dd846);if(!_0x3b9a82||_0x3b9a82['index']===undefined)throw new Error('未找到路由配置的\x20children\x20数组');const _0x2975b9=_0x3b9a82[0x1],_0x3055b3=_0x3b9a82[_0x3fde8f(0x11e)]+_0x3b9a82[0x0][_0x3fde8f(0x10a)]('[')+0x1,_0x35eb9d=_0x2975b9?.[_0x3fde8f(0x136)](/\{[\s\S]*?\},/g)||[];if(_0x35eb9d[_0x3fde8f(0x113)]>0x0){const _0x188666=_0x35eb9d[_0x35eb9d[_0x3fde8f(0x113)]-0x1];if(_0x188666){const _0x460574=_0x235264[_0x3fde8f(0x119)](_0x188666),_0x48cb98=_0x460574+_0x188666[_0x3fde8f(0x113)];return _0x235264[_0x3fde8f(0x10c)](0x0,_0x48cb98)+'\x0a'+_0x1853fd+_0x235264[_0x3fde8f(0x10c)](_0x48cb98);}}return _0x235264['slice'](0x0,_0x3055b3)+'\x0a'+_0x1853fd+_0x235264[_0x3fde8f(0x10c)](_0x3055b3);}async[a44_0x4ec9dd(0x130)](_0x201aa0,_0x4d0aae){const _0x1fc125=a44_0x4ec9dd;if(!a44_0x89daaa[_0x1fc125(0x10d)](this[_0x1fc125(0x11a)]))throw new Error(_0x1fc125(0x10b)+this['routerFilePath']);const _0x3e47b2=await a44_0x89daaa['promises'][_0x1fc125(0x124)](this[_0x1fc125(0x11a)],'utf8'),_0x4de295=this[_0x1fc125(0x107)](_0x201aa0);let _0xf9d958=this[_0x1fc125(0x109)](_0x3e47b2,_0x4de295,_0x201aa0);return _0xf9d958=this[_0x1fc125(0x12b)](_0xf9d958,_0x4d0aae,_0x4de295),_0xf9d958;}}
@@ -1 +1 @@
1
- const a42_0x52117f=a42_0x1904;(function(_0x4c1c9b,_0xa7c47){const _0x2e151f=a42_0x1904,_0x1711aa=_0x4c1c9b();while(!![]){try{const _0x5a7d68=parseInt(_0x2e151f(0x100))/0x1*(parseInt(_0x2e151f(0xfc))/0x2)+parseInt(_0x2e151f(0x11d))/0x3+-parseInt(_0x2e151f(0xfa))/0x4*(-parseInt(_0x2e151f(0x105))/0x5)+parseInt(_0x2e151f(0x11f))/0x6*(parseInt(_0x2e151f(0x122))/0x7)+-parseInt(_0x2e151f(0x10b))/0x8*(parseInt(_0x2e151f(0x10f))/0x9)+-parseInt(_0x2e151f(0xf0))/0xa+-parseInt(_0x2e151f(0x10c))/0xb;if(_0x5a7d68===_0xa7c47)break;else _0x1711aa['push'](_0x1711aa['shift']());}catch(_0x12383d){_0x1711aa['push'](_0x1711aa['shift']());}}}(a42_0x50c6,0x5d063));import a42_0xc8c1d7 from'node:fs';function a42_0x50c6(){const _0x2f0117=['utf8','toDisplayTitle','4466460kyRVLn','pop','toLocaleString','join','copyFile','includes','processTemplate','isFile','.jsx','name','132472vxpBFj','split','237814liCdDn','YourModel','toUpperCase','.css','5XiNJnm','numeric','slice','processDirectory','开始处理模板内容替换','85axTaqd','toComponentName','.json','toLocaleDateString','.scss','readdir','227608dnZKRU','11884510rFJFLJ','success','error','9HZRDsF','processFile','toLowerCase','.tpl','template','charAt','extname','模板内容替换完成','2-digit','endsWith','default','isDirectory','promises','map','1213200fIyvme','stringify','6Zjcwme','toISOString','replace','2622151oyfCit','replaceApiContent','now','.js'];a42_0x50c6=function(){return _0x2f0117;};return a42_0x50c6();}function a42_0x1904(_0x1a130a,_0x251277){const _0x50c69c=a42_0x50c6();return a42_0x1904=function(_0x19048c,_0x441ac9){_0x19048c=_0x19048c-0xee;let _0x611256=_0x50c69c[_0x19048c];return _0x611256;},a42_0x1904(_0x1a130a,_0x251277);}import a42_0x2c5acb from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static[a42_0x52117f(0x106)](_0x30bde5){const _0xadfe66=a42_0x52117f,_0xc16300=_0x30bde5[_0xadfe66(0xfb)]('/')['pop']()||_0x30bde5;return _0xc16300[_0xadfe66(0xfb)]('-')[_0xadfe66(0x11c)](_0x593d43=>_0x593d43[_0xadfe66(0x114)](0x0)[_0xadfe66(0xfe)]()+_0x593d43[_0xadfe66(0x102)](0x1)[_0xadfe66(0x111)]())[_0xadfe66(0xf3)]('');}static[a42_0x52117f(0xef)](_0xc0f96c){const _0x51076e=a42_0x52117f,_0x1339dd=_0xc0f96c['split']('/')[_0x51076e(0xf1)]()||_0xc0f96c;return _0x1339dd[_0x51076e(0xfb)]('-')[_0x51076e(0x11c)](_0x48ec6d=>_0x48ec6d[_0x51076e(0x114)](0x0)[_0x51076e(0xfe)]()+_0x48ec6d[_0x51076e(0x102)](0x1)[_0x51076e(0x111)]())[_0x51076e(0xf3)]('\x20');}static['replaceContent'](_0x432980,_0x5df7ae,_0x87c03b){const _0x32c9f4=a42_0x52117f,_0x9451b3=this[_0x32c9f4(0x106)](_0x5df7ae),_0x5681f8=this[_0x32c9f4(0xef)](_0x5df7ae),_0x3cca37=new Date(),_0x2e0e32=_0x3cca37[_0x32c9f4(0xf2)](undefined,{'year':_0x32c9f4(0x101),'month':_0x32c9f4(0x117),'day':'2-digit','hour':_0x32c9f4(0x117),'minute':_0x32c9f4(0x117),'second':_0x32c9f4(0x117),'hour12':![]})[_0x32c9f4(0x121)](/\//g,'-'),_0x4df29d=_0x3cca37[_0x32c9f4(0x108)](undefined,{'year':_0x32c9f4(0x101),'month':'2-digit','day':_0x32c9f4(0x117)})[_0x32c9f4(0x121)](/\//g,'-'),_0x22d282=_0x3cca37['toLocaleTimeString'](undefined,{'hour12':![]});let _0x46ee9d=_0x432980['replace'](/\{ComponentName\}/g,_0x9451b3)[_0x32c9f4(0x121)](/\{DisplayTitle\}/g,_0x5681f8)[_0x32c9f4(0x121)](/\{PageName\}/g,_0x5df7ae)[_0x32c9f4(0x121)](/\{TemplateName\}/g,_0x87c03b)[_0x32c9f4(0x121)](/\{CreatedAt\}/g,_0x2e0e32)[_0x32c9f4(0x121)](/\{CreatedDate\}/g,_0x4df29d)[_0x32c9f4(0x121)](/\{CreatedTime\}/g,_0x22d282);return _0x46ee9d;}static[a42_0x52117f(0x123)](_0x200651,_0x168e96,_0x5124e8,_0x599287,_0x4dad45,_0x268e5a,_0x550bf8){const _0x1fc888=a42_0x52117f,_0x39bb18=new Date(),_0x337458=_0x39bb18[_0x1fc888(0x120)](),_0x25a4e0=JSON[_0x1fc888(0x11e)](_0x5124e8,null,0x2)[_0x1fc888(0xfb)]('\x0a')['slice'](0x1,-0x1)[_0x1fc888(0x11c)](_0x17e98c=>_0x17e98c[_0x1fc888(0x121)](/^ /,'\x20\x20\x20\x20'))[_0x1fc888(0xf3)]('\x0a'),_0x3a6be2=_0x599287||Object['keys'](_0x5124e8)[0x0]||_0x1fc888(0xfd);let _0x19888f=_0x200651[_0x1fc888(0x121)](/\{AppCode\}/g,_0x168e96)[_0x1fc888(0x121)](/\{ModelConfigs\}/g,_0x25a4e0)[_0x1fc888(0x121)](/\{ExampleModelName\}/g,_0x3a6be2)[_0x1fc888(0x121)](/\{ApiFileName\}/g,_0x4dad45||'api')[_0x1fc888(0x121)](/\{ConfigName\}/g,_0x268e5a||_0x1fc888(0x119))['replace'](/\{ClientConfigParam\}/g,_0x550bf8||'')['replace'](/\{CreatedAt\}/g,_0x337458);return _0x19888f;}static async[a42_0x52117f(0xf6)](_0x57d74e,_0x59ac33,_0x35ed2e,_0x1a1c60,_0x1614ce=!![]){const _0x380f84=a42_0x52117f,_0x30d022=Date[_0x380f84(0x124)]();try{_0x1614ce&&logger['info'](_0x380f84(0x113),_0x380f84(0x104),{'templatePath':_0x57d74e,'targetPath':_0x59ac33,'pageName':_0x35ed2e,'templateName':_0x1a1c60});await a42_0xc8c1d7[_0x380f84(0x11b)]['mkdir'](_0x59ac33,{'recursive':!![]}),await this['processDirectory'](_0x57d74e,_0x59ac33,_0x35ed2e,_0x1a1c60);if(_0x1614ce){const _0x4ac348=Date[_0x380f84(0x124)]()-_0x30d022;logger[_0x380f84(0x10d)](_0x380f84(0x113),_0x380f84(0x116),_0x4ac348,{'pageName':_0x35ed2e,'templateName':_0x1a1c60});}}catch(_0x10af32){if(_0x1614ce){const _0x50c447=Date['now']()-_0x30d022;logger[_0x380f84(0x10e)](_0x380f84(0x113),'模板内容替换失败',{'templatePath':_0x57d74e,'targetPath':_0x59ac33,'pageName':_0x35ed2e,'templateName':_0x1a1c60,'error':_0x10af32 instanceof Error?_0x10af32['message']:String(_0x10af32),'duration':_0x50c447});}throw _0x10af32;}}static async[a42_0x52117f(0x103)](_0x53f7a1,_0x34ee81,_0x33b286,_0x78625f){const _0x7ba78a=a42_0x52117f,_0x43785c=await a42_0xc8c1d7[_0x7ba78a(0x11b)][_0x7ba78a(0x10a)](_0x53f7a1,{'withFileTypes':!![]});for(const _0x21eb8d of _0x43785c){const _0xbfab0a=a42_0x2c5acb['join'](_0x53f7a1,_0x21eb8d['name']);let _0x285709=a42_0x2c5acb[_0x7ba78a(0xf3)](_0x34ee81,_0x21eb8d['name']);_0x21eb8d['name'][_0x7ba78a(0x118)](_0x7ba78a(0x112))&&(_0x285709=a42_0x2c5acb[_0x7ba78a(0xf3)](_0x34ee81,_0x21eb8d[_0x7ba78a(0xf9)][_0x7ba78a(0x121)](/\.tpl$/,'')));if(_0x21eb8d[_0x7ba78a(0x11a)]())await a42_0xc8c1d7['promises']['mkdir'](_0x285709,{'recursive':!![]}),await this[_0x7ba78a(0x103)](_0xbfab0a,_0x285709,_0x33b286,_0x78625f);else _0x21eb8d[_0x7ba78a(0xf7)]()&&await this[_0x7ba78a(0x110)](_0xbfab0a,_0x285709,_0x33b286,_0x78625f);}}static async['processFile'](_0x4f7a80,_0x49e4ee,_0x239f16,_0x18d44c){const _0xaa8022=a42_0x52117f,_0x4780bc=a42_0x2c5acb[_0xaa8022(0x115)](_0x4f7a80)[_0xaa8022(0x111)]();_0x4f7a80[_0xaa8022(0x118)](_0xaa8022(0x112))&&(_0x49e4ee=_0x49e4ee[_0xaa8022(0x121)](/\.tpl$/,''));const _0x30cbe3=['.tsx','.ts',_0xaa8022(0xf8),_0xaa8022(0x125),_0xaa8022(0x107),'.md',_0xaa8022(0xff),_0xaa8022(0x109),'.tpl'];if(_0x30cbe3[_0xaa8022(0xf5)](_0x4780bc)||_0x4f7a80[_0xaa8022(0x118)]('.tpl')){const _0x417397=await a42_0xc8c1d7['promises']['readFile'](_0x4f7a80,_0xaa8022(0xee)),_0x5dbb42=this['replaceContent'](_0x417397,_0x239f16,_0x18d44c);await a42_0xc8c1d7[_0xaa8022(0x11b)]['writeFile'](_0x49e4ee,_0x5dbb42,_0xaa8022(0xee));}else await a42_0xc8c1d7[_0xaa8022(0x11b)][_0xaa8022(0xf4)](_0x4f7a80,_0x49e4ee);}}
1
+ const a45_0x5925c5=a45_0x28ee;(function(_0x59f97f,_0x29c634){const _0x5d1ecb=a45_0x28ee,_0x8bd539=_0x59f97f();while(!![]){try{const _0x5880a2=-parseInt(_0x5d1ecb(0xb8))/0x1+parseInt(_0x5d1ecb(0xb0))/0x2+-parseInt(_0x5d1ecb(0xac))/0x3*(-parseInt(_0x5d1ecb(0xa7))/0x4)+parseInt(_0x5d1ecb(0xa8))/0x5*(parseInt(_0x5d1ecb(0xb1))/0x6)+parseInt(_0x5d1ecb(0xa0))/0x7+-parseInt(_0x5d1ecb(0xc3))/0x8*(parseInt(_0x5d1ecb(0xb5))/0x9)+-parseInt(_0x5d1ecb(0x9c))/0xa*(parseInt(_0x5d1ecb(0xab))/0xb);if(_0x5880a2===_0x29c634)break;else _0x8bd539['push'](_0x8bd539['shift']());}catch(_0x5a9c43){_0x8bd539['push'](_0x8bd539['shift']());}}}(a45_0x2a68,0x6a8b2));import a45_0x37bafa from'node:fs';import a45_0xa352cf from'node:path';import{logger}from'./logger.js';function a45_0x28ee(_0x77aa57,_0x3a7e32){const _0x2a687e=a45_0x2a68();return a45_0x28ee=function(_0x28ee34,_0x14bd31){_0x28ee34=_0x28ee34-0x8a;let _0x4fa5f6=_0x2a687e[_0x28ee34];return _0x4fa5f6;},a45_0x28ee(_0x77aa57,_0x3a7e32);}function a45_0x2a68(){const _0x2b3689=['replace','extname','isFile','name','default','模板内容替换完成','44216cSClXk','now','processDirectory','2-digit','pop','.js','readFile','toLowerCase','map','success','api','toDisplayTitle','toLocaleString','template','split','.tsx','endsWith','copyFile','promises','isDirectory','415210qLctvr','join','模板内容替换失败','slice','3444980sNMFrL','.jsx','.tpl','replaceContent','开始处理模板内容替换','message','includes','350372FxbeyY','140cczxOu','processTemplate','.ts','187gwWOPY','24CbHcSp','YourModel','toComponentName','error','270284HwsOYB','72552JJalZm','numeric','.json','toLocaleDateString','477jyfSMl','info','.scss','231412nFsFCO','writeFile','.css','toUpperCase','charAt'];a45_0x2a68=function(){return _0x2b3689;};return a45_0x2a68();}export class TemplateReplacer{static[a45_0x5925c5(0xae)](_0x14ea20){const _0x1caa6f=a45_0x5925c5,_0x3e017c=_0x14ea20[_0x1caa6f(0x96)]('/')[_0x1caa6f(0x8c)]()||_0x14ea20;return _0x3e017c[_0x1caa6f(0x96)]('-')[_0x1caa6f(0x90)](_0x3aaa01=>_0x3aaa01[_0x1caa6f(0xbc)](0x0)[_0x1caa6f(0xbb)]()+_0x3aaa01['slice'](0x1)[_0x1caa6f(0x8f)]())['join']('');}static[a45_0x5925c5(0x93)](_0x3d12b4){const _0x3c1258=a45_0x5925c5,_0x8c630f=_0x3d12b4['split']('/')[_0x3c1258(0x8c)]()||_0x3d12b4;return _0x8c630f[_0x3c1258(0x96)]('-')[_0x3c1258(0x90)](_0x9d2808=>_0x9d2808['charAt'](0x0)[_0x3c1258(0xbb)]()+_0x9d2808['slice'](0x1)[_0x3c1258(0x8f)]())[_0x3c1258(0x9d)]('\x20');}static[a45_0x5925c5(0xa3)](_0x1792b3,_0x47a054,_0x128b2f){const _0x3e425c=a45_0x5925c5,_0xc7ab3a=this['toComponentName'](_0x47a054),_0x1be474=this['toDisplayTitle'](_0x47a054),_0x4bf1e2=new Date(),_0x22d249=_0x4bf1e2[_0x3e425c(0x94)](undefined,{'year':_0x3e425c(0xb2),'month':_0x3e425c(0x8b),'day':_0x3e425c(0x8b),'hour':'2-digit','minute':_0x3e425c(0x8b),'second':_0x3e425c(0x8b),'hour12':![]})[_0x3e425c(0xbd)](/\//g,'-'),_0x39406a=_0x4bf1e2[_0x3e425c(0xb4)](undefined,{'year':_0x3e425c(0xb2),'month':'2-digit','day':_0x3e425c(0x8b)})['replace'](/\//g,'-'),_0x1e1705=_0x4bf1e2['toLocaleTimeString'](undefined,{'hour12':![]});let _0x1af0f2=_0x1792b3[_0x3e425c(0xbd)](/\{ComponentName\}/g,_0xc7ab3a)[_0x3e425c(0xbd)](/\{DisplayTitle\}/g,_0x1be474)[_0x3e425c(0xbd)](/\{PageName\}/g,_0x47a054)[_0x3e425c(0xbd)](/\{TemplateName\}/g,_0x128b2f)['replace'](/\{CreatedAt\}/g,_0x22d249)[_0x3e425c(0xbd)](/\{CreatedDate\}/g,_0x39406a)['replace'](/\{CreatedTime\}/g,_0x1e1705);return _0x1af0f2;}static['replaceApiContent'](_0x195c65,_0xa7a2b5,_0x5b39e4,_0x26d63d,_0x3d37c6,_0x261936,_0xce4543){const _0x586256=a45_0x5925c5,_0x32f696=new Date(),_0x1f7abd=_0x32f696['toISOString'](),_0x1a7d57=JSON['stringify'](_0x5b39e4,null,0x2)[_0x586256(0x96)]('\x0a')[_0x586256(0x9f)](0x1,-0x1)['map'](_0x5d3556=>_0x5d3556['replace'](/^ /,'\x20\x20\x20\x20'))[_0x586256(0x9d)]('\x0a'),_0x4e7b3e=_0x26d63d||Object['keys'](_0x5b39e4)[0x0]||_0x586256(0xad);let _0x32b665=_0x195c65[_0x586256(0xbd)](/\{AppCode\}/g,_0xa7a2b5)[_0x586256(0xbd)](/\{ModelConfigs\}/g,_0x1a7d57)[_0x586256(0xbd)](/\{ExampleModelName\}/g,_0x4e7b3e)['replace'](/\{ApiFileName\}/g,_0x3d37c6||_0x586256(0x92))[_0x586256(0xbd)](/\{ConfigName\}/g,_0x261936||_0x586256(0xc1))[_0x586256(0xbd)](/\{ClientConfigParam\}/g,_0xce4543||'')[_0x586256(0xbd)](/\{CreatedAt\}/g,_0x1f7abd);return _0x32b665;}static async[a45_0x5925c5(0xa9)](_0x198af2,_0x2db967,_0x144f3b,_0xbc031f,_0xe5a06a=!![]){const _0x18540c=a45_0x5925c5,_0x1a30bd=Date[_0x18540c(0xc4)]();try{_0xe5a06a&&logger[_0x18540c(0xb6)](_0x18540c(0x95),_0x18540c(0xa4),{'templatePath':_0x198af2,'targetPath':_0x2db967,'pageName':_0x144f3b,'templateName':_0xbc031f});await a45_0x37bafa['promises']['mkdir'](_0x2db967,{'recursive':!![]}),await this['processDirectory'](_0x198af2,_0x2db967,_0x144f3b,_0xbc031f);if(_0xe5a06a){const _0x2b205b=Date[_0x18540c(0xc4)]()-_0x1a30bd;logger[_0x18540c(0x91)](_0x18540c(0x95),_0x18540c(0xc2),_0x2b205b,{'pageName':_0x144f3b,'templateName':_0xbc031f});}}catch(_0x16d248){if(_0xe5a06a){const _0x343faf=Date[_0x18540c(0xc4)]()-_0x1a30bd;logger[_0x18540c(0xaf)](_0x18540c(0x95),_0x18540c(0x9e),{'templatePath':_0x198af2,'targetPath':_0x2db967,'pageName':_0x144f3b,'templateName':_0xbc031f,'error':_0x16d248 instanceof Error?_0x16d248[_0x18540c(0xa5)]:String(_0x16d248),'duration':_0x343faf});}throw _0x16d248;}}static async[a45_0x5925c5(0x8a)](_0x5b4088,_0x4030a1,_0x23b1f0,_0x368b36){const _0x232fec=a45_0x5925c5,_0x7f444a=await a45_0x37bafa['promises']['readdir'](_0x5b4088,{'withFileTypes':!![]});for(const _0x93dc81 of _0x7f444a){const _0x5e0125=a45_0xa352cf['join'](_0x5b4088,_0x93dc81[_0x232fec(0xc0)]);let _0xab32fa=a45_0xa352cf['join'](_0x4030a1,_0x93dc81[_0x232fec(0xc0)]);_0x93dc81[_0x232fec(0xc0)][_0x232fec(0x98)]('.tpl')&&(_0xab32fa=a45_0xa352cf[_0x232fec(0x9d)](_0x4030a1,_0x93dc81[_0x232fec(0xc0)][_0x232fec(0xbd)](/\.tpl$/,'')));if(_0x93dc81[_0x232fec(0x9b)]())await a45_0x37bafa[_0x232fec(0x9a)]['mkdir'](_0xab32fa,{'recursive':!![]}),await this[_0x232fec(0x8a)](_0x5e0125,_0xab32fa,_0x23b1f0,_0x368b36);else _0x93dc81[_0x232fec(0xbf)]()&&await this['processFile'](_0x5e0125,_0xab32fa,_0x23b1f0,_0x368b36);}}static async['processFile'](_0x404545,_0x50675d,_0x100cfc,_0x179982){const _0x46fa6b=a45_0x5925c5,_0x789713=a45_0xa352cf[_0x46fa6b(0xbe)](_0x404545)[_0x46fa6b(0x8f)]();_0x404545[_0x46fa6b(0x98)](_0x46fa6b(0xa2))&&(_0x50675d=_0x50675d['replace'](/\.tpl$/,''));const _0x287ef3=[_0x46fa6b(0x97),_0x46fa6b(0xaa),_0x46fa6b(0xa1),_0x46fa6b(0x8d),_0x46fa6b(0xb3),'.md',_0x46fa6b(0xba),_0x46fa6b(0xb7),_0x46fa6b(0xa2)];if(_0x287ef3[_0x46fa6b(0xa6)](_0x789713)||_0x404545[_0x46fa6b(0x98)](_0x46fa6b(0xa2))){const _0x3c1f76=await a45_0x37bafa['promises'][_0x46fa6b(0x8e)](_0x404545,'utf8'),_0x41f2a8=this['replaceContent'](_0x3c1f76,_0x100cfc,_0x179982);await a45_0x37bafa[_0x46fa6b(0x9a)][_0x46fa6b(0xb9)](_0x50675d,_0x41f2a8,'utf8');}else await a45_0x37bafa[_0x46fa6b(0x9a)][_0x46fa6b(0x99)](_0x404545,_0x50675d);}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/cli",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
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.12",
13
+ "@lovrabet/sdk": "^1.1.16",
14
14
  "antd": "^5.26.7",
15
15
  "echarts": "^5.6.0",
16
16
  "echarts-for-react": "^3.0.2",
@@ -450,9 +450,10 @@
450
450
  }
451
451
  },
452
452
  "node_modules/@lovrabet/sdk": {
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==",
453
+ "version": "1.1.16",
454
+ "resolved": "https://registry.npmjs.org/@lovrabet/sdk/-/sdk-1.1.16.tgz",
455
+ "integrity": "sha512-Pbw7bK54QrPidliob6RkYNcAAy1kBk7Fvpj2y+z3K6PON8ptdjAeQs6vjBtBYei/Uuv3ggjkNVZh6Ickqand9g==",
456
+ "license": "SEE LICENSE IN LICENSE",
456
457
  "peerDependencies": {
457
458
  "typescript": "^5"
458
459
  }
@@ -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.14",
14
+ "@lovrabet/sdk": "^1.1.16",
15
15
  "antd": "^5.26.7",
16
16
  "echarts": "^5.6.0",
17
17
  "echarts-for-react": "^3.0.2",