@lovrabet/cli 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +289 -14
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/format-dataset.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/api/pull.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x233159,_0x4f332c){var _0x233f63=a29_0x419b,_0x47acb2=_0x233159();while(!![]){try{var _0x95b4c2=-parseInt(_0x233f63(0x163))/0x1*(parseInt(_0x233f63(0x162))/0x2)+-parseInt(_0x233f63(0x16b))/0x3*(parseInt(_0x233f63(0x169))/0x4)+parseInt(_0x233f63(0x15f))/0x5*(-parseInt(_0x233f63(0x16d))/0x6)+parseInt(_0x233f63(0x164))/0x7+parseInt(_0x233f63(0x168))/0x8*(parseInt(_0x233f63(0x16a))/0x9)+parseInt(_0x233f63(0x16c))/0xa*(parseInt(_0x233f63(0x167))/0xb)+-parseInt(_0x233f63(0x165))/0xc*(-parseInt(_0x233f63(0x160))/0xd);if(_0x95b4c2===_0x4f332c)break;else _0x47acb2['push'](_0x47acb2['shift']());}catch(_0x283c90){_0x47acb2['push'](_0x47acb2['shift']());}}}(a29_0x21da,0x6747a));import{jsx as a29_0x40781f,jsxs as a29_0x22fe6b}from'react/jsx-runtime';import{Box,Text}from'ink';function a29_0x419b(_0x2f5f4a,_0x3203af){var _0x21da79=a29_0x21da();return a29_0x419b=function(_0x419b1b,_0x22ac35){_0x419b1b=_0x419b1b-0x15f;var _0x1eea33=_0x21da79[_0x419b1b];return _0x1eea33;},a29_0x419b(_0x2f5f4a,_0x3203af);}import{TaskTime}from'./task-time.js';export function TaskFinished(_0x43cd90){var _0x43f851=a29_0x419b;return a29_0x22fe6b(Box,{'children':[a29_0x40781f(Box,{'width':'1'}),a29_0x40781f(Text,{'color':_0x43f851(0x161),'children':'\x20√\x20'}),a29_0x40781f(Text,{'children':_0x43cd90['taskName']}),a29_0x40781f(TaskTime,{'elapsed':_0x43cd90[_0x43f851(0x166)]})]});}function a29_0x21da(){var _0x4c8c2c=['95445Uyifdn','399020RqHLWn','1422UPfeZG','13370UShRwj','7020jOZjuD','green','88940EnqoEz','6VBpqaR','4309844YFFHzH','7872ebareM','elapsed','99NxmrAs','6136kywoWu','76blkHvZ','7029TmakNQ'];a29_0x21da=function(){return _0x4c8c2c;};return a29_0x21da();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a3754,_0x3cf027){var _0x26b1e7=a30_0x5cc3,_0x338b21=_0x2a3754();while(!![]){try{var _0x336c90=parseInt(_0x26b1e7(0x1c7))/0x1*(-parseInt(_0x26b1e7(0x1cb))/0x2)+-parseInt(_0x26b1e7(0x1c2))/0x3+parseInt(_0x26b1e7(0x1c1))/0x4+parseInt(_0x26b1e7(0x1c4))/0x5*(-parseInt(_0x26b1e7(0x1c8))/0x6)+-parseInt(_0x26b1e7(0x1c9))/0x7+-parseInt(_0x26b1e7(0x1c5))/0x8*(-parseInt(_0x26b1e7(0x1c6))/0x9)+parseInt(_0x26b1e7(0x1ca))/0xa;if(_0x336c90===_0x3cf027)break;else _0x338b21['push'](_0x338b21['shift']());}catch(_0x2885a7){_0x338b21['push'](_0x338b21['shift']());}}}(a30_0x1c73,0xcdc72));import{jsx as a30_0x40ca0a,jsxs as a30_0x2bbdb1}from'react/jsx-runtime';function a30_0x1c73(){var _0x2c3128=['3186925FVcaiS','90824dTHMxI','360rEGQmK','1BHltUc','6eXdPjB','3387769CMAuWM','30226170Ehmiui','1663754Ujrjom','green','dots','127736wSNqsg','2137728GacDVi','loading'];a30_0x1c73=function(){return _0x2c3128;};return a30_0x1c73();}import{Text}from'ink';import a30_0x37b146 from'ink-spinner';function a30_0x5cc3(_0xec5088,_0x38ec6b){var _0x1c73f7=a30_0x1c73();return a30_0x5cc3=function(_0x5cc347,_0x56cdaf){_0x5cc347=_0x5cc347-0x1bf;var _0x28e81e=_0x1c73f7[_0x5cc347];return _0x28e81e;},a30_0x5cc3(_0xec5088,_0x38ec6b);}export function TaskLoading(_0xc2c28){var _0x1b947e=a30_0x5cc3;if(_0xc2c28['finished'])return a30_0x40ca0a(Text,{'color':_0x1b947e(0x1bf),'children':'\x20√\x20'});if(_0xc2c28[_0x1b947e(0x1c3)])return a30_0x2bbdb1(Text,{'color':_0x1b947e(0x1bf),'children':['\x20',a30_0x40ca0a(a30_0x37b146,{'type':_0x1b947e(0x1c0)}),'\x20']});return a30_0x40ca0a(Text,{'children':'\x20\x20\x20'});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x7b05ee,_0x3fe7ea){var _0x44fa27=a31_0x4a86,_0x36950b=_0x7b05ee();while(!![]){try{var _0x57ccac=parseInt(_0x44fa27(0x108))/0x1*(-parseInt(_0x44fa27(0x109))/0x2)+-parseInt(_0x44fa27(0x105))/0x3*(-parseInt(_0x44fa27(0x104))/0x4)+-parseInt(_0x44fa27(0x10c))/0x5+-parseInt(_0x44fa27(0x10e))/0x6+parseInt(_0x44fa27(0x10a))/0x7*(parseInt(_0x44fa27(0x10b))/0x8)+parseInt(_0x44fa27(0x107))/0x9+parseInt(_0x44fa27(0x103))/0xa;if(_0x57ccac===_0x3fe7ea)break;else _0x36950b['push'](_0x36950b['shift']());}catch(_0x5f5df4){_0x36950b['push'](_0x36950b['shift']());}}}(a31_0x4b82,0x40be5));import{jsx as a31_0x1d31dd,jsxs as a31_0x8fe9a0}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';function a31_0x4a86(_0x5565b5,_0x528c46){var _0x4b82ab=a31_0x4b82();return a31_0x4a86=function(_0x4a8658,_0x11a8f0){_0x4a8658=_0x4a8658-0x103;var _0x49c43e=_0x4b82ab[_0x4a8658];return _0x49c43e;},a31_0x4a86(_0x5565b5,_0x528c46);}function a31_0x4b82(){var _0xb3102c=['562708EJHoRq','3loqQGe','elapsed','1212912YraDpt','1BADePB','127708rZMdbS','28DdfVCO','931160XCsFuN','1972490oqyqtZ','taskName','229278bxFYGm','207290lekSNS'];a31_0x4b82=function(){return _0xb3102c;};return a31_0x4b82();}import{TaskTime}from'./task-time.js';export function TaskRunning(_0x38ffe6){var _0x273d7a=a31_0x4a86;return a31_0x8fe9a0(Box,{'children':[a31_0x1d31dd(Box,{'width':'1'}),a31_0x1d31dd(TaskLoading,{..._0x38ffe6}),a31_0x1d31dd(Text,{'children':_0x38ffe6[_0x273d7a(0x10d)]}),a31_0x1d31dd(TaskTime,{'elapsed':_0x38ffe6[_0x273d7a(0x106)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x131e9e,_0x43da48){var _0xac91be=a32_0x5e7f,_0xd61d0=_0x131e9e();while(!![]){try{var _0x48bfa2=-parseInt(_0xac91be(0x1e6))/0x1+-parseInt(_0xac91be(0x1e8))/0x2*(parseInt(_0xac91be(0x1ec))/0x3)+parseInt(_0xac91be(0x1e3))/0x4+-parseInt(_0xac91be(0x1e4))/0x5+-parseInt(_0xac91be(0x1e9))/0x6+-parseInt(_0xac91be(0x1e5))/0x7*(-parseInt(_0xac91be(0x1eb))/0x8)+parseInt(_0xac91be(0x1ed))/0x9;if(_0x48bfa2===_0x43da48)break;else _0xd61d0['push'](_0xd61d0['shift']());}catch(_0x9945ef){_0xd61d0['push'](_0xd61d0['shift']());}}}(a32_0x30a0,0xca4ee));import{jsx as a32_0x1d922e,Fragment as a32_0x580277,jsxs as a32_0x3807f3}from'react/jsx-runtime';function a32_0x5e7f(_0x405b00,_0x4fe080){var _0x30a003=a32_0x30a0();return a32_0x5e7f=function(_0x5e7f5e,_0x54e00c){_0x5e7f5e=_0x5e7f5e-0x1e3;var _0x5c358c=_0x30a003[_0x5e7f5e];return _0x5c358c;},a32_0x5e7f(_0x405b00,_0x4fe080);}function a32_0x30a0(){var _0x8f799d=['3690951NvJsdL','35106831lXjCLV','840ovupRv','3805670oYAcaY','3416644QvZYyM','998966jqiHzH','gray','2pfqSmb','6348492hpnbtY','elapsed','16yFOTdW'];a32_0x30a0=function(){return _0x8f799d;};return a32_0x30a0();}import{Text}from'ink';export function TaskTime(_0x5e36c9){var _0x4328a8=a32_0x5e7f;if(_0x5e36c9[_0x4328a8(0x1ea)])return a32_0x3807f3(a32_0x580277,{'children':[a32_0x1d922e(Text,{'color':'gray','children':'\x20['}),a32_0x1d922e(Text,{'color':_0x4328a8(0x1e7),'bold':!![],'children':_0x5e36c9['elapsed']}),a32_0x1d922e(Text,{'color':'gray','children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x53b24e=a33_0x5f4e;(function(_0x19c2f3,_0xc89033){const _0x4260d5=a33_0x5f4e,_0x486037=_0x19c2f3();while(!![]){try{const _0x22ed33=parseInt(_0x4260d5(0x94))/0x1+parseInt(_0x4260d5(0x86))/0x2*(-parseInt(_0x4260d5(0x97))/0x3)+-parseInt(_0x4260d5(0x8e))/0x4*(-parseInt(_0x4260d5(0x8a))/0x5)+-parseInt(_0x4260d5(0x8b))/0x6+parseInt(_0x4260d5(0x8c))/0x7+parseInt(_0x4260d5(0x92))/0x8*(-parseInt(_0x4260d5(0x91))/0x9)+parseInt(_0x4260d5(0x90))/0xa;if(_0x22ed33===_0xc89033)break;else _0x486037['push'](_0x486037['shift']());}catch(_0x4723ce){_0x486037['push'](_0x486037['shift']());}}}(a33_0x2a03,0x37e65));import a33_0x4eb395 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';const __dirname=a33_0x4eb395['dirname'](fileURLToPath(import.meta[a33_0x53b24e(0x88)])),templateDir=a33_0x4eb395[a33_0x53b24e(0x8d)](__dirname,'../../templates/projects/sub-app-react-demo');function a33_0x2a03(){const _0x49dc82=['32hxYolP','项目模板复制失败','417205YSKcBH','error','项目模板复制完成','221049JePyuY','info','2ksNDfN','copy','url','复制项目文件','7405tfHKHk','1784286XBJAbR','1178443DpypAP','resolve','728IKbnTW','now','477090wFSoMz','681246eYofWX'];a33_0x2a03=function(){return _0x49dc82;};return a33_0x2a03();}function a33_0x5f4e(_0x2503e6,_0x3d4475){const _0x2a03e2=a33_0x2a03();return a33_0x5f4e=function(_0x5f4e91,_0x5ba8c0){_0x5f4e91=_0x5f4e91-0x86;let _0x43460c=_0x2a03e2[_0x5f4e91];return _0x43460c;},a33_0x5f4e(_0x2503e6,_0x3d4475);}export function useCopyProjectTemplate(){const _0x3a7f76=a33_0x53b24e,[_0x30d7eb,_0x56f279]=useState(![]),[_0x2dfbf0,_0x61a9af]=useState(![]),[_0x262d5e,_0x57d41e]=useState(''),_0x59d24f=useCallback(async _0x5ed23f=>{const _0x1b312c=a33_0x5f4e,_0x587734=Date[_0x1b312c(0x8f)](),_0x44c456=a33_0x4eb395[_0x1b312c(0x8d)](process['cwd'](),_0x5ed23f);_0x56f279(!![]);try{logger[_0x1b312c(0x98)](_0x1b312c(0x87),'开始复制项目模板',{'projectCode':_0x5ed23f,'templateDir':templateDir}),await copyDirectory(templateDir,_0x44c456);const _0x1d2156=Date['now']()-_0x587734;logger['success']('copy',_0x1b312c(0x96),_0x1d2156,{'projectCode':_0x5ed23f});}catch(_0x31ef21){const _0x508374=Date[_0x1b312c(0x8f)]()-_0x587734;logger[_0x1b312c(0x95)](_0x1b312c(0x87),_0x1b312c(0x93),{'projectCode':_0x5ed23f,'error':_0x31ef21 instanceof Error?_0x31ef21['message']:String(_0x31ef21),'duration':_0x508374});throw _0x31ef21;}finally{_0x56f279(![]),_0x61a9af(!![]),_0x57d41e(formatElapsed(_0x587734));}},[]);return{'taskName':_0x3a7f76(0x89),'finished':_0x2dfbf0,'loading':_0x30d7eb,'elapsed':_0x262d5e,'doTask':_0x59d24f};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a34_0x1fd4(){const _0x2c2de6=['resolve','1120428MbqfvE','9450ESLuHu','format','代码格式化失败','191020oYuPVn','error','4361008DPnQzi','info','success','npx','1JZfuVI','6202189MRmzQU','代码格式化完成','3185bYHeRE','10aFEgZj','225261dJiclN','65826hTzzVT','cwd','格式化代码','now'];a34_0x1fd4=function(){return _0x2c2de6;};return a34_0x1fd4();}(function(_0x35863d,_0x181ed0){const _0x72d718=a34_0x39e1,_0x582476=_0x35863d();while(!![]){try{const _0xe18375=-parseInt(_0x72d718(0x1f6))/0x1*(parseInt(_0x72d718(0x1fc))/0x2)+parseInt(_0x72d718(0x1fb))/0x3+parseInt(_0x72d718(0x1f0))/0x4+-parseInt(_0x72d718(0x1f9))/0x5*(-parseInt(_0x72d718(0x1ed))/0x6)+-parseInt(_0x72d718(0x1f7))/0x7+parseInt(_0x72d718(0x1f2))/0x8+-parseInt(_0x72d718(0x201))/0x9*(parseInt(_0x72d718(0x1fa))/0xa);if(_0xe18375===_0x181ed0)break;else _0x582476['push'](_0x582476['shift']());}catch(_0x402c3b){_0x582476['push'](_0x582476['shift']());}}}(a34_0x1fd4,0x99463));import a34_0x1700db from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a34_0x39e1(_0x20ff4c,_0x9b844b){const _0x1fd4dc=a34_0x1fd4();return a34_0x39e1=function(_0x39e15d,_0x4ac5ae){_0x39e15d=_0x39e15d-0x1ed;let _0x5a5224=_0x1fd4dc[_0x39e15d];return _0x5a5224;},a34_0x39e1(_0x20ff4c,_0x9b844b);}import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x565316=a34_0x39e1,[_0x3f3c1c,_0x39cd26]=useState(![]),[_0x3a782e,_0x1a58a3]=useState(![]),[_0x479a67,_0x5d2a21]=useState(''),_0x4b2518=useCallback(async _0x37e50b=>{const _0xefed2=a34_0x39e1,_0x14b9ec=Date[_0xefed2(0x1ff)](),_0x13f1ba=a34_0x1700db[_0xefed2(0x200)](process[_0xefed2(0x1fd)](),_0x37e50b);_0x39cd26(!![]);try{logger[_0xefed2(0x1f3)]('format','开始格式化代码',{'projectCode':_0x37e50b}),await execa(_0xefed2(0x1f5),['prettier','--write','.'],{'cwd':_0x13f1ba});const _0x28764e=Date[_0xefed2(0x1ff)]()-_0x14b9ec;logger[_0xefed2(0x1f4)](_0xefed2(0x1ee),_0xefed2(0x1f8),_0x28764e,{'projectCode':_0x37e50b});}catch(_0x59ae22){const _0x3a1d17=Date[_0xefed2(0x1ff)]()-_0x14b9ec;logger[_0xefed2(0x1f1)](_0xefed2(0x1ee),_0xefed2(0x1ef),{'projectCode':_0x37e50b,'error':_0x59ae22 instanceof Error?_0x59ae22['message']:String(_0x59ae22),'duration':_0x3a1d17});throw _0x59ae22;}finally{_0x39cd26(![]),_0x1a58a3(!![]),_0x5d2a21(formatElapsed(_0x14b9ec));}},[]);return{'taskName':_0x565316(0x1fe),'finished':_0x3a782e,'loading':_0x3f3c1c,'elapsed':_0x479a67,'doTask':_0x4b2518};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1b576d,_0x269874){const _0x1543fb=a35_0x385a,_0x5c8674=_0x1b576d();while(!![]){try{const _0x7dde0a=-parseInt(_0x1543fb(0x98))/0x1*(-parseInt(_0x1543fb(0x9d))/0x2)+-parseInt(_0x1543fb(0x96))/0x3*(-parseInt(_0x1543fb(0xa0))/0x4)+parseInt(_0x1543fb(0x91))/0x5+-parseInt(_0x1543fb(0x9c))/0x6+-parseInt(_0x1543fb(0x9b))/0x7*(parseInt(_0x1543fb(0x95))/0x8)+parseInt(_0x1543fb(0x9e))/0x9+-parseInt(_0x1543fb(0xa1))/0xa;if(_0x7dde0a===_0x269874)break;else _0x5c8674['push'](_0x5c8674['shift']());}catch(_0x2f5186){_0x5c8674['push'](_0x5c8674['shift']());}}}(a35_0x4df1,0x19922));function a35_0x385a(_0x2e0e90,_0x5dcaaf){const _0x4df18e=a35_0x4df1();return a35_0x385a=function(_0x385aea,_0x12d1c3){_0x385aea=_0x385aea-0x91;let _0x5a43ed=_0x4df18e[_0x385aea];return _0x5a43ed;},a35_0x385a(_0x2e0e90,_0x5dcaaf);}import a35_0x56e628 from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x222482=a35_0x385a,[_0x245873,_0xadc504]=useState(![]),[_0x1b59f8,_0x5c018c]=useState(![]),[_0x2219e2,_0x2b25aa]=useState(''),_0x12e3ca=useCallback(async _0x29c742=>{const _0x4cedb7=a35_0x385a,_0x5bcc52=Date[_0x4cedb7(0xa2)](),_0x284287=a35_0x56e628[_0x4cedb7(0xa4)](process['cwd'](),_0x29c742);_0xadc504(!![]),_0x5c018c(![]);const _0x31a832=async(_0x26828d,_0x3a5d4b)=>{await execa(_0x26828d,_0x3a5d4b,{'cwd':_0x284287});};try{logger[_0x4cedb7(0x94)](_0x4cedb7(0x9f),'开始安装依赖',{'projectCode':_0x29c742,'registry':_0x4cedb7(0xa5)}),await _0x31a832('npm',[_0x4cedb7(0x9f),'--registry',_0x4cedb7(0xa5)]);const _0x19cdce=Date[_0x4cedb7(0xa2)]()-_0x5bcc52;logger[_0x4cedb7(0x97)](_0x4cedb7(0x9f),_0x4cedb7(0x9a),_0x19cdce,{'projectCode':_0x29c742});}catch(_0x5b0dbb){const _0x42847b=Date[_0x4cedb7(0xa2)]()-_0x5bcc52;logger[_0x4cedb7(0x93)](_0x4cedb7(0x9f),_0x4cedb7(0x99),{'projectCode':_0x29c742,'error':_0x5b0dbb instanceof Error?_0x5b0dbb[_0x4cedb7(0xa3)]:String(_0x5b0dbb),'duration':_0x42847b});throw _0x5b0dbb;}finally{_0xadc504(![]),_0x5c018c(!![]),_0x2b25aa(formatElapsed(_0x5bcc52));}},[]);return{'taskName':_0x222482(0x92),'finished':_0x1b59f8,'loading':_0x245873,'elapsed':_0x2219e2,'doTask':_0x12e3ca};}function a35_0x4df1(){const _0x1e2e5d=['安装依赖','error','info','85480PySJmJ','185685YRZoyA','success','1cFoNTb','依赖安装失败','依赖安装完成','63YtvXaT','641142uPXHGH','107182DmZJgk','396045tFpAii','install','4MyQZsJ','417500ESWKtI','now','message','resolve','https://registry.npmmirror.com','950095JvXEyB'];a35_0x4df1=function(){return _0x1e2e5d;};return a35_0x4df1();}
|
package/lib/help.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x94fc1e,_0x3f5b6b){var _0x317747=a36_0x1c1c,_0x3aa31d=_0x94fc1e();while(!![]){try{var _0x5ee8f4=-parseInt(_0x317747(0xa6))/0x1*(parseInt(_0x317747(0xa1))/0x2)+parseInt(_0x317747(0x9f))/0x3*(parseInt(_0x317747(0x9d))/0x4)+-parseInt(_0x317747(0x9e))/0x5*(-parseInt(_0x317747(0x98))/0x6)+parseInt(_0x317747(0xa2))/0x7+parseInt(_0x317747(0xa0))/0x8*(parseInt(_0x317747(0x9c))/0x9)+-parseInt(_0x317747(0xa4))/0xa*(-parseInt(_0x317747(0xa5))/0xb)+-parseInt(_0x317747(0x9a))/0xc*(parseInt(_0x317747(0x99))/0xd);if(_0x5ee8f4===_0x3f5b6b)break;else _0x3aa31d['push'](_0x3aa31d['shift']());}catch(_0x4a5673){_0x3aa31d['push'](_0x3aa31d['shift']());}}}(a36_0x23bb,0xafa46));import{jsx as a36_0x477c90,jsxs as a36_0x151560}from'react/jsx-runtime';function a36_0x1c1c(_0x5f897b,_0x2e7c64){var _0x23bbf9=a36_0x23bb();return a36_0x1c1c=function(_0x1c1c92,_0x2a614f){_0x1c1c92=_0x1c1c92-0x96;var _0x35c186=_0x23bbf9[_0x1c1c92];return _0x35c186;},a36_0x1c1c(_0x5f897b,_0x2e7c64);}function a36_0x23bb(){var _0x104154=['18eUEWQL','13YXIunT','30502812cMZPIw','green','12565719WqlLKe','4QDRehD','956680ybhgqu','4158621TSYjrI','8JSqKxo','60970WAAwdc','1565823ooCIyN','查看可用命令。','10eZWZXJ','852951guxwOF','13PKKvCZ','lovrabet\x20--help','!\x20请指定一个有效的命令。','column'];a36_0x23bb=function(){return _0x104154;};return a36_0x23bb();}import{Box,Text}from'ink';export function Help(){var _0x1cc7ee=a36_0x1c1c;return a36_0x151560(Box,{'flexDirection':_0x1cc7ee(0x97),'marginTop':0x1,'marginBottom':0x1,'children':[a36_0x151560(Box,{'children':[a36_0x477c90(Box,{'width':'1'}),a36_0x477c90(Text,{'children':_0x1cc7ee(0x96)})]}),a36_0x151560(Box,{'marginTop':0x1,'children':[a36_0x477c90(Box,{'width':'1'}),a36_0x151560(Text,{'children':['\x20\x20','使用']}),a36_0x151560(Text,{'bold':!![],'color':_0x1cc7ee(0x9b),'children':['\x20',_0x1cc7ee(0xa7),'\x20']}),a36_0x477c90(Text,{'children':_0x1cc7ee(0xa3)})]})]});}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a37_0x1a0dc4=a37_0x4f7e;function a37_0x1645(){const _0x13e047=['.lovrabetrc','98476IDeDgc','7375674JaCGQI','cwd','2529754jKFIhV','140gcUAoa','105GbElNI','66715PMWCGq','62880snXCrZ','1XBZpRS','parse','3110AeGgYG','2710269HSjSZW','3552JEnZlu','utf8','29961sQvTkF'];a37_0x1645=function(){return _0x13e047;};return a37_0x1645();}(function(_0x1d0560,_0x43d55f){const _0x2ff624=a37_0x4f7e,_0x16cead=_0x1d0560();while(!![]){try{const _0x3088fb=-parseInt(_0x2ff624(0x13c))/0x1*(-parseInt(_0x2ff624(0x137))/0x2)+parseInt(_0x2ff624(0x13f))/0x3+parseInt(_0x2ff624(0x144))/0x4*(parseInt(_0x2ff624(0x139))/0x5)+-parseInt(_0x2ff624(0x135))/0x6+parseInt(_0x2ff624(0x138))/0x7*(parseInt(_0x2ff624(0x13b))/0x8)+-parseInt(_0x2ff624(0x142))/0x9*(-parseInt(_0x2ff624(0x13e))/0xa)+-parseInt(_0x2ff624(0x13a))/0xb*(parseInt(_0x2ff624(0x140))/0xc);if(_0x3088fb===_0x43d55f)break;else _0x16cead['push'](_0x16cead['shift']());}catch(_0x171f03){_0x16cead['push'](_0x16cead['shift']());}}}(a37_0x1645,0xd0533));import{existsSync,readFileSync}from'node:fs';function a37_0x4f7e(_0x2c086d,_0x34f4e1){const _0x1645d3=a37_0x1645();return a37_0x4f7e=function(_0x4f7e12,_0xafcdd){_0x4f7e12=_0x4f7e12-0x135;let _0x563805=_0x1645d3[_0x4f7e12];return _0x563805;},a37_0x4f7e(_0x2c086d,_0x34f4e1);}import{resolve}from'node:path';export const configPath=resolve(process[a37_0x1a0dc4(0x136)](),a37_0x1a0dc4(0x143));export function readConfig(){const _0x2aae2a=a37_0x1a0dc4;try{if(existsSync(configPath)){const _0x486cb6=readFileSync(configPath,{'encoding':_0x2aae2a(0x141)});return _0x486cb6?JSON[_0x2aae2a(0x13d)](_0x486cb6):{};}}catch(_0x39d955){}return{};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x44f4a4,_0x8db6ae){const _0x263176=a38_0x4873,_0x10b51c=_0x44f4a4();while(!![]){try{const _0x404226=parseInt(_0x263176(0x19e))/0x1+parseInt(_0x263176(0x19b))/0x2+parseInt(_0x263176(0x1a2))/0x3+-parseInt(_0x263176(0x19a))/0x4+-parseInt(_0x263176(0x199))/0x5+-parseInt(_0x263176(0x19c))/0x6*(parseInt(_0x263176(0x1a4))/0x7)+-parseInt(_0x263176(0x1a1))/0x8*(-parseInt(_0x263176(0x1a3))/0x9);if(_0x404226===_0x8db6ae)break;else _0x10b51c['push'](_0x10b51c['shift']());}catch(_0x993f5b){_0x10b51c['push'](_0x10b51c['shift']());}}}(a38_0x2198,0xeaa85));import a38_0x390ca7 from'node:path';import a38_0x2f5d07 from'node:fs';function a38_0x4873(_0x2030ad,_0xdc6ffa){const _0x219811=a38_0x2198();return a38_0x4873=function(_0x4873b8,_0x1f1596){_0x4873b8=_0x4873b8-0x198;let _0x1d423e=_0x219811[_0x4873b8];return _0x1d423e;},a38_0x4873(_0x2030ad,_0xdc6ffa);}export async function copyDirectory(_0x1bc896,_0xb10937){const _0x5008b1=a38_0x4873;try{const _0x46d52f=a38_0x2f5d07['readdirSync'](_0x1bc896,{'withFileTypes':!![]});a38_0x2f5d07[_0x5008b1(0x198)](_0xb10937,{'recursive':!![]});for(const _0x16c1b4 of _0x46d52f){const _0x5db597=a38_0x390ca7['join'](_0x1bc896,_0x16c1b4[_0x5008b1(0x19f)]),_0x15e895=a38_0x390ca7[_0x5008b1(0x1a5)](_0xb10937,_0x16c1b4[_0x5008b1(0x19f)]);_0x16c1b4[_0x5008b1(0x1a0)]()?await copyDirectory(_0x5db597,_0x15e895):a38_0x2f5d07['copyFileSync'](_0x5db597,_0x15e895);}}catch(_0x30dd62){console[_0x5008b1(0x1a6)](_0x5008b1(0x19d),_0x30dd62);}}function a38_0x2198(){const _0x5c90e6=['4794925cAjVKl','2305188KmKSfk','1615016FypJKT','5730BomhnE','复制目录时出错:','582281BOlKok','name','isDirectory','8190216SNTKNP','2457534TxyxEQ','9zfOZhS','5397voMRrQ','join','error','mkdirSync'];a38_0x2198=function(){return _0x5c90e6;};return a38_0x2198();}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x455b5d=a39_0x454b;function a39_0x1f4b(){const _0x3c0b06=['7269024gjBfSu','mkdirSync','2yfERVr','warn','parse','split','info','3108GIhivr','level','stringify','command','success','失败:\x20','trim','join','format','Failed\x20to\x20clear\x20logs:','开始执行:\x20','dirname','log','toISOString','green','1266365DjYGlm','clearLogs','1460ymvuBH','68787wyFNln','Failed\x20to\x20read\x20logs:','287916lDxBkA','combine','4303388IYIyJz','errors','blue','error','getWinstonInstance','transports','filter','now','.lovrabet.log','winstonLogger','363PzcPtQ','timestamp','initWinstonLogger','logFilePath','addColors','yellow','3818739rEUasn','clear','9138JMkNXI','5BjYxFF','existsSync','details','readLogs','createLogger'];a39_0x1f4b=function(){return _0x3c0b06;};return a39_0x1f4b();}(function(_0x46d964,_0x521516){const _0xb2db99=a39_0x454b,_0x375d2a=_0x46d964();while(!![]){try{const _0x505bbc=-parseInt(_0xb2db99(0x1be))/0x1+parseInt(_0xb2db99(0x1aa))/0x2*(-parseInt(_0xb2db99(0x1a0))/0x3)+-parseInt(_0xb2db99(0x1c5))/0x4*(-parseInt(_0xb2db99(0x1a3))/0x5)+parseInt(_0xb2db99(0x1a2))/0x6*(-parseInt(_0xb2db99(0x1af))/0x7)+parseInt(_0xb2db99(0x1a8))/0x8+-parseInt(_0xb2db99(0x1c1))/0x9*(-parseInt(_0xb2db99(0x1c0))/0xa)+-parseInt(_0xb2db99(0x1cf))/0xb*(-parseInt(_0xb2db99(0x1c3))/0xc);if(_0x505bbc===_0x521516)break;else _0x375d2a['push'](_0x375d2a['shift']());}catch(_0x4a8e42){_0x375d2a['push'](_0x375d2a['shift']());}}}(a39_0x1f4b,0xa5318));import a39_0x46d67b from'winston';function a39_0x454b(_0x2c1662,_0x9a4928){const _0x1f4b5d=a39_0x1f4b();return a39_0x454b=function(_0x454bca,_0x2d7335){_0x454bca=_0x454bca-0x1a0;let _0x40d5f6=_0x1f4b5d[_0x454bca];return _0x40d5f6;},a39_0x454b(_0x2c1662,_0x9a4928);}import a39_0x4bc1b3 from'node:fs';import a39_0x414bbc from'node:path';class Logger{['winstonLogger'];['logFilePath'];constructor(){this['logFilePath']='';}[a39_0x455b5d(0x1d1)](){const _0x5a7922=a39_0x455b5d,_0x41d67a=a39_0x414bbc[_0x5a7922(0x1ba)](this['logFilePath']);!a39_0x4bc1b3[_0x5a7922(0x1a4)](_0x41d67a)&&a39_0x4bc1b3[_0x5a7922(0x1a9)](_0x41d67a,{'recursive':!![]});const _0x1d97f3=a39_0x46d67b[_0x5a7922(0x1b7)][_0x5a7922(0x1c4)](a39_0x46d67b[_0x5a7922(0x1b7)][_0x5a7922(0x1d0)](),a39_0x46d67b[_0x5a7922(0x1b7)][_0x5a7922(0x1c6)]({'stack':!![]}),a39_0x46d67b[_0x5a7922(0x1b7)]['printf'](_0x12a73b=>{const _0x5f02da=_0x5a7922,_0x168899={'timestamp':_0x12a73b[_0x5f02da(0x1d0)]||new Date()[_0x5f02da(0x1bc)](),'level':_0x12a73b[_0x5f02da(0x1b0)]||'info','command':_0x12a73b[_0x5f02da(0x1b2)]||'unknown','message':_0x12a73b['message']||'','duration':_0x12a73b['duration']||undefined,'details':_0x12a73b[_0x5f02da(0x1a5)]||undefined};return JSON[_0x5f02da(0x1b1)](_0x168899);}));this['winstonLogger']=a39_0x46d67b[_0x5a7922(0x1a7)]({'level':_0x5a7922(0x1ae),'format':_0x1d97f3,'transports':[new a39_0x46d67b[(_0x5a7922(0x1ca))]['File']({'filename':this[_0x5a7922(0x1d2)],'level':_0x5a7922(0x1ae)})],'silent':![]}),a39_0x46d67b[_0x5a7922(0x1d3)]({'success':_0x5a7922(0x1bd),'error':'red','warn':_0x5a7922(0x1d4),'info':_0x5a7922(0x1c7)});}['setLogPath'](_0x453a18){const _0x138b41=a39_0x455b5d;this[_0x138b41(0x1d2)]=a39_0x414bbc[_0x138b41(0x1b6)](_0x453a18,_0x138b41(0x1cd)),this[_0x138b41(0x1ce)]&&this[_0x138b41(0x1ce)][_0x138b41(0x1a1)](),this['initWinstonLogger']();}[a39_0x455b5d(0x1ae)](_0xff3064,_0x4a9e37,_0xb5d4aa){const _0x5a8246=a39_0x455b5d;if(!this[_0x5a8246(0x1d2)]||!this[_0x5a8246(0x1ce)])return;this[_0x5a8246(0x1ce)][_0x5a8246(0x1ae)](_0x4a9e37,{'command':_0xff3064,'details':_0xb5d4aa});}['success'](_0x2dd802,_0x53aecb,_0x765674,_0x4294e0){const _0x3b5cbc=a39_0x455b5d;if(!this[_0x3b5cbc(0x1d2)]||!this['winstonLogger'])return;this[_0x3b5cbc(0x1ce)][_0x3b5cbc(0x1bb)]('info',_0x53aecb,{'level':_0x3b5cbc(0x1b3),'command':_0x2dd802,'duration':_0x765674,'details':_0x4294e0});}['error'](_0x4b25f8,_0x4539d4,_0x1b2d89){const _0x283264=a39_0x455b5d;if(!this[_0x283264(0x1d2)]||!this[_0x283264(0x1ce)])return;this[_0x283264(0x1ce)][_0x283264(0x1c8)](_0x4539d4,{'command':_0x4b25f8,'details':_0x1b2d89});}[a39_0x455b5d(0x1ab)](_0x2c6af1,_0x241e7f,_0x33f4dd){const _0x26b9f0=a39_0x455b5d;if(!this[_0x26b9f0(0x1d2)]||!this[_0x26b9f0(0x1ce)])return;this[_0x26b9f0(0x1ce)][_0x26b9f0(0x1ab)](_0x241e7f,{'command':_0x2c6af1,'details':_0x33f4dd});}async['logTask'](_0x4b1d3a,_0x279e94,_0x12df3c){const _0x16e858=a39_0x455b5d,_0x1914cb=Date[_0x16e858(0x1cc)]();this['info'](_0x4b1d3a,_0x16e858(0x1b9)+_0x279e94);try{const _0x470045=await _0x12df3c(),_0xdbe7ac=Date[_0x16e858(0x1cc)]()-_0x1914cb;return this[_0x16e858(0x1b3)](_0x4b1d3a,'完成:\x20'+_0x279e94,_0xdbe7ac),_0x470045;}catch(_0x3b1c10){const _0x49fc66=Date[_0x16e858(0x1cc)]()-_0x1914cb;this[_0x16e858(0x1c8)](_0x4b1d3a,_0x16e858(0x1b4)+_0x279e94,{'error':_0x3b1c10 instanceof Error?_0x3b1c10['message']:String(_0x3b1c10),'duration':_0x49fc66});throw _0x3b1c10;}}[a39_0x455b5d(0x1a6)](){const _0x402ad9=a39_0x455b5d;try{if(!a39_0x4bc1b3['existsSync'](this['logFilePath']))return[];const _0x48afe4=a39_0x4bc1b3['readFileSync'](this[_0x402ad9(0x1d2)],'utf8');return _0x48afe4[_0x402ad9(0x1ad)]('\x0a')[_0x402ad9(0x1cb)](_0x3eacf7=>_0x3eacf7[_0x402ad9(0x1b5)]())['map'](_0x54e127=>JSON[_0x402ad9(0x1ac)](_0x54e127));}catch(_0x48a30f){return console['warn'](_0x402ad9(0x1c2),_0x48a30f),[];}}[a39_0x455b5d(0x1bf)](){const _0x24f089=a39_0x455b5d;try{a39_0x4bc1b3[_0x24f089(0x1a4)](this[_0x24f089(0x1d2)])&&a39_0x4bc1b3['writeFileSync'](this[_0x24f089(0x1d2)],'','utf8');}catch(_0x102d48){console['warn'](_0x24f089(0x1b8),_0x102d48);}}[a39_0x455b5d(0x1c9)](){const _0x373baf=a39_0x455b5d;return this[_0x373baf(0x1ce)];}}export const logger=new Logger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a40_0xdcf4d8=a40_0x194a;(function(_0x5c04b4,_0x1acb01){const _0x232876=a40_0x194a,_0x550459=_0x5c04b4();while(!![]){try{const _0x129fff=parseInt(_0x232876(0xe1))/0x1*(parseInt(_0x232876(0xdb))/0x2)+parseInt(_0x232876(0xe7))/0x3*(-parseInt(_0x232876(0xca))/0x4)+-parseInt(_0x232876(0xc7))/0x5*(-parseInt(_0x232876(0xc3))/0x6)+-parseInt(_0x232876(0xc4))/0x7+-parseInt(_0x232876(0xcf))/0x8*(parseInt(_0x232876(0xba))/0x9)+parseInt(_0x232876(0xd9))/0xa+parseInt(_0x232876(0xd3))/0xb*(parseInt(_0x232876(0xbc))/0xc);if(_0x129fff===_0x1acb01)break;else _0x550459['push'](_0x550459['shift']());}catch(_0x16d038){_0x550459['push'](_0x550459['shift']());}}}(a40_0x3132,0x7236f));import a40_0x2ea47c from'node:fs';function a40_0x194a(_0x1d0f09,_0x4bf770){const _0x313203=a40_0x3132();return a40_0x194a=function(_0x194a68,_0xd93bd7){_0x194a68=_0x194a68-0xb9;let _0x22aca6=_0x313203[_0x194a68];return _0x22aca6;},a40_0x194a(_0x1d0f09,_0x4bf770);}import a40_0x10a933 from'node:path';import{logger}from'./logger.js';function a40_0x3132(){const _0x332035=['68pOaAOY','src','路由文件不存在:\x20','message','success','path:\x20\x22','3644FqBihW','writeFile','routerFilePath','utf8','promises','lastIndexOf','1390962fZgoLg','addImport','711468jRGZfw','error','23136vtblJc','开始更新路由配置','previewChanges','map','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','length','213642gNfGKt','1866781DnIlrV','import\x20','toUpperCase','125tyvcMp','charAt','addRoute','8ANUluP','slice','addPageRoute','includes','index','56UmKfFx','路由配置更新失败','index.tsx','未找到路由配置的\x20children\x20数组','4631hibPDR','router','now','match','readFile','\x20from\x20\x22../pages/','3894190TsaIXK','toComponentName'];a40_0x3132=function(){return _0x332035;};return a40_0x3132();}export class RouterUpdater{['routerFilePath'];constructor(_0x25b45b){const _0x10b9c9=a40_0x194a;this[_0x10b9c9(0xe3)]=a40_0x10a933['join'](_0x25b45b,_0x10b9c9(0xdc),_0x10b9c9(0xd4),_0x10b9c9(0xd1));}async[a40_0xdcf4d8(0xcc)](_0x15adab,_0x16ca69){const _0x2127b1=a40_0xdcf4d8;if(!a40_0x2ea47c['existsSync'](this['routerFilePath']))throw new Error(_0x2127b1(0xdd)+this[_0x2127b1(0xe3)]);const _0x417092=Date[_0x2127b1(0xd5)]();logger['info']('router',_0x2127b1(0xbd),{'pageName':_0x15adab,'routePath':_0x16ca69,'file':this[_0x2127b1(0xe3)]});try{const _0x5ce0e3=await a40_0x2ea47c[_0x2127b1(0xe5)][_0x2127b1(0xd7)](this['routerFilePath'],'utf8'),_0x3675c1=this[_0x2127b1(0xda)](_0x15adab),_0x1c75c3=this['addImport'](_0x5ce0e3,_0x3675c1,_0x15adab),_0x29a97c=this[_0x2127b1(0xc9)](_0x1c75c3,_0x16ca69,_0x3675c1);await a40_0x2ea47c[_0x2127b1(0xe5)][_0x2127b1(0xe2)](this[_0x2127b1(0xe3)],_0x29a97c,_0x2127b1(0xe4));const _0x570502=Date[_0x2127b1(0xd5)]()-_0x417092;logger[_0x2127b1(0xdf)](_0x2127b1(0xd4),'路由配置更新完成',_0x570502,{'pageName':_0x15adab,'routePath':_0x16ca69,'componentName':_0x3675c1});}catch(_0x33aa9f){const _0x5cc18a=Date['now']()-_0x417092;logger[_0x2127b1(0xbb)](_0x2127b1(0xd4),_0x2127b1(0xd0),{'pageName':_0x15adab,'routePath':_0x16ca69,'error':_0x33aa9f instanceof Error?_0x33aa9f[_0x2127b1(0xde)]:String(_0x33aa9f),'duration':_0x5cc18a});throw _0x33aa9f;}}[a40_0xdcf4d8(0xda)](_0x44d845){const _0x5eabd3=a40_0xdcf4d8;return _0x44d845['split']('-')[_0x5eabd3(0xbf)](_0x4ca7e6=>_0x4ca7e6[_0x5eabd3(0xc8)](0x0)[_0x5eabd3(0xc6)]()+_0x4ca7e6[_0x5eabd3(0xcb)](0x1)['toLowerCase']())['join']('');}[a40_0xdcf4d8(0xb9)](_0x3cc0d3,_0x3f5fdf,_0x3c062c){const _0x5b54f2=a40_0xdcf4d8,_0x4ca0eb=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0xbd85d6=_0x3cc0d3[_0x5b54f2(0xd6)](_0x4ca0eb)||[],_0x4d6a1c=_0x5b54f2(0xc5)+_0x3f5fdf+_0x5b54f2(0xd8)+_0x3c062c+'\x22;';if(_0x3cc0d3[_0x5b54f2(0xcd)](_0x4d6a1c))return _0x3cc0d3;if(_0xbd85d6[_0x5b54f2(0xc2)]>0x0){const _0x391d21=_0xbd85d6[_0xbd85d6[_0x5b54f2(0xc2)]-0x1];if(_0x391d21){const _0x4b59a7=_0x3cc0d3['lastIndexOf'](_0x391d21),_0x3b7dd0=_0x4b59a7+_0x391d21[_0x5b54f2(0xc2)];return _0x3cc0d3[_0x5b54f2(0xcb)](0x0,_0x3b7dd0)+_0x4d6a1c+'\x0a'+_0x3cc0d3[_0x5b54f2(0xcb)](_0x3b7dd0);}}const _0x20dc37=_0x3cc0d3[_0x5b54f2(0xd6)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x20dc37&&_0x20dc37['index']!==undefined){const _0xa139c4=_0x20dc37[_0x5b54f2(0xce)]+_0x20dc37[0x0][_0x5b54f2(0xc2)];return _0x3cc0d3[_0x5b54f2(0xcb)](0x0,_0xa139c4)+_0x4d6a1c+'\x0a'+_0x3cc0d3[_0x5b54f2(0xcb)](_0xa139c4);}return _0x3cc0d3;}[a40_0xdcf4d8(0xc9)](_0x34e5cd,_0x5ea49b,_0x5aa681){const _0x364bf7=a40_0xdcf4d8,_0x32dcc4=_0x364bf7(0xc1)+_0x5ea49b+'\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<'+_0x5aa681+_0x364bf7(0xc0);if(_0x34e5cd[_0x364bf7(0xcd)](_0x364bf7(0xe0)+_0x5ea49b+'\x22'))return _0x34e5cd;const _0x3f3ae7=/children:\s*\[([\s\S]*?)\]/,_0x285336=_0x34e5cd[_0x364bf7(0xd6)](_0x3f3ae7);if(!_0x285336||_0x285336[_0x364bf7(0xce)]===undefined)throw new Error(_0x364bf7(0xd2));const _0x58246e=_0x285336[0x1],_0x4c6c10=_0x285336[_0x364bf7(0xce)]+_0x285336[0x0]['indexOf']('[')+0x1,_0x4dbb2d=_0x58246e?.[_0x364bf7(0xd6)](/\{[\s\S]*?\},/g)||[];if(_0x4dbb2d['length']>0x0){const _0x36fc97=_0x4dbb2d[_0x4dbb2d['length']-0x1];if(_0x36fc97){const _0x136529=_0x34e5cd[_0x364bf7(0xe6)](_0x36fc97),_0x2f93ef=_0x136529+_0x36fc97['length'];return _0x34e5cd['slice'](0x0,_0x2f93ef)+'\x0a'+_0x32dcc4+_0x34e5cd[_0x364bf7(0xcb)](_0x2f93ef);}}return _0x34e5cd[_0x364bf7(0xcb)](0x0,_0x4c6c10)+'\x0a'+_0x32dcc4+_0x34e5cd[_0x364bf7(0xcb)](_0x4c6c10);}async[a40_0xdcf4d8(0xbe)](_0x548c4b,_0x3b3e54){const _0x37a2b6=a40_0xdcf4d8;if(!a40_0x2ea47c['existsSync'](this[_0x37a2b6(0xe3)]))throw new Error(_0x37a2b6(0xdd)+this[_0x37a2b6(0xe3)]);const _0x53b943=await a40_0x2ea47c[_0x37a2b6(0xe5)][_0x37a2b6(0xd7)](this[_0x37a2b6(0xe3)],_0x37a2b6(0xe4)),_0x206ebf=this[_0x37a2b6(0xda)](_0x548c4b);let _0x24c773=this[_0x37a2b6(0xb9)](_0x53b943,_0x206ebf,_0x548c4b);return _0x24c773=this[_0x37a2b6(0xc9)](_0x24c773,_0x3b3e54,_0x206ebf),_0x24c773;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x1873ea=a41_0x3599;(function(_0x1ed4c9,_0x5645d4){const _0x55073d=a41_0x3599,_0x19efd3=_0x1ed4c9();while(!![]){try{const _0x16f556=parseInt(_0x55073d(0x1ee))/0x1+-parseInt(_0x55073d(0x1eb))/0x2*(-parseInt(_0x55073d(0x1f2))/0x3)+parseInt(_0x55073d(0x1ed))/0x4+parseInt(_0x55073d(0x1f9))/0x5+parseInt(_0x55073d(0x1de))/0x6+-parseInt(_0x55073d(0x204))/0x7+-parseInt(_0x55073d(0x1f6))/0x8;if(_0x16f556===_0x5645d4)break;else _0x19efd3['push'](_0x19efd3['shift']());}catch(_0x347228){_0x19efd3['push'](_0x19efd3['shift']());}}}(a41_0x37f0,0xdb29c));function a41_0x37f0(){const _0xe29228=['default','isDirectory','toLocaleTimeString','87xWpcmj','template','.js','message','13805936uTPvkF','processFile','processTemplate','5090545ATTyJT','.tsx','writeFile','.css','map','.md','utf8','mkdir','replace','promises','split','1585633bQOfoa','toComponentName','name','pop','YourModel','includes','numeric','extname','.json','toLowerCase','success','.jsx','toUpperCase','processDirectory','api','toISOString','readFile','slice','84330cwTQei','error','replaceApiContent','模板内容替换失败','toDisplayTitle','now','replaceContent','.tpl','toLocaleDateString','endsWith','toLocaleString','join','2-digit','22546pXISKa','charAt','1409824AZiKsO','1138416Pfgocr'];a41_0x37f0=function(){return _0xe29228;};return a41_0x37f0();}import a41_0x4ed406 from'node:fs';function a41_0x3599(_0x4ce985,_0xfdf5cf){const _0x37f0b0=a41_0x37f0();return a41_0x3599=function(_0x3599d4,_0x54b146){_0x3599d4=_0x3599d4-0x1d3;let _0x8bae6f=_0x37f0b0[_0x3599d4];return _0x8bae6f;},a41_0x3599(_0x4ce985,_0xfdf5cf);}import a41_0x5c676f from'node:path';import{logger}from'./logger.js';export class TemplateReplacer{static[a41_0x1873ea(0x205)](_0x2c88e2){const _0x24214e=a41_0x1873ea,_0x28069a=_0x2c88e2['split']('/')[_0x24214e(0x207)]()||_0x2c88e2;return _0x28069a[_0x24214e(0x203)]('-')[_0x24214e(0x1fd)](_0x59f219=>_0x59f219[_0x24214e(0x1ec)](0x0)[_0x24214e(0x1d8)]()+_0x59f219['slice'](0x1)['toLowerCase']())[_0x24214e(0x1e9)]('');}static[a41_0x1873ea(0x1e2)](_0x23ab88){const _0x2f1d1e=a41_0x1873ea,_0x4e5b63=_0x23ab88[_0x2f1d1e(0x203)]('/')[_0x2f1d1e(0x207)]()||_0x23ab88;return _0x4e5b63[_0x2f1d1e(0x203)]('-')[_0x2f1d1e(0x1fd)](_0x5c51e2=>_0x5c51e2[_0x2f1d1e(0x1ec)](0x0)[_0x2f1d1e(0x1d8)]()+_0x5c51e2[_0x2f1d1e(0x1dd)](0x1)[_0x2f1d1e(0x1d5)]())[_0x2f1d1e(0x1e9)]('\x20');}static[a41_0x1873ea(0x1e4)](_0x47a90b,_0x5ba1c4,_0x4b9e51){const _0x338b64=a41_0x1873ea,_0x56561d=this[_0x338b64(0x205)](_0x5ba1c4),_0x4e05de=this[_0x338b64(0x1e2)](_0x5ba1c4),_0x3e871c=new Date(),_0x46bd78=_0x3e871c[_0x338b64(0x1e8)](undefined,{'year':'numeric','month':'2-digit','day':_0x338b64(0x1ea),'hour':_0x338b64(0x1ea),'minute':_0x338b64(0x1ea),'second':_0x338b64(0x1ea),'hour12':![]})[_0x338b64(0x201)](/\//g,'-'),_0x33ca7d=_0x3e871c[_0x338b64(0x1e6)](undefined,{'year':_0x338b64(0x20a),'month':'2-digit','day':_0x338b64(0x1ea)})[_0x338b64(0x201)](/\//g,'-'),_0x614af1=_0x3e871c[_0x338b64(0x1f1)](undefined,{'hour12':![]});let _0x45ef72=_0x47a90b[_0x338b64(0x201)](/\{ComponentName\}/g,_0x56561d)[_0x338b64(0x201)](/\{DisplayTitle\}/g,_0x4e05de)[_0x338b64(0x201)](/\{PageName\}/g,_0x5ba1c4)[_0x338b64(0x201)](/\{TemplateName\}/g,_0x4b9e51)[_0x338b64(0x201)](/\{CreatedAt\}/g,_0x46bd78)['replace'](/\{CreatedDate\}/g,_0x33ca7d)[_0x338b64(0x201)](/\{CreatedTime\}/g,_0x614af1);return _0x45ef72;}static[a41_0x1873ea(0x1e0)](_0x1164d4,_0x2b7f3f,_0x3a0885,_0x28b631,_0x28b442,_0x1bad89,_0x58b08d){const _0x329de5=a41_0x1873ea,_0x4ed22f=new Date(),_0x4da012=_0x4ed22f[_0x329de5(0x1db)](),_0x4f54d3=JSON['stringify'](_0x3a0885,null,0x2)['split']('\x0a')[_0x329de5(0x1dd)](0x1,-0x1)['map'](_0x45c979=>_0x45c979[_0x329de5(0x201)](/^ /,'\x20\x20\x20\x20'))[_0x329de5(0x1e9)]('\x0a'),_0x531c1c=_0x28b631||Object['keys'](_0x3a0885)[0x0]||_0x329de5(0x208);let _0x2c108b=_0x1164d4['replace'](/\{AppCode\}/g,_0x2b7f3f)[_0x329de5(0x201)](/\{ModelConfigs\}/g,_0x4f54d3)[_0x329de5(0x201)](/\{ExampleModelName\}/g,_0x531c1c)['replace'](/\{ApiFileName\}/g,_0x28b442||_0x329de5(0x1da))[_0x329de5(0x201)](/\{ConfigName\}/g,_0x1bad89||_0x329de5(0x1ef))[_0x329de5(0x201)](/\{ClientConfigParam\}/g,_0x58b08d||'')['replace'](/\{CreatedAt\}/g,_0x4da012);return _0x2c108b;}static async[a41_0x1873ea(0x1f8)](_0x149bf0,_0x291a8b,_0x2477a9,_0x1e06b0,_0x25316f=!![]){const _0x365a77=a41_0x1873ea,_0xad4266=Date[_0x365a77(0x1e3)]();try{_0x25316f&&logger['info'](_0x365a77(0x1f3),'开始处理模板内容替换',{'templatePath':_0x149bf0,'targetPath':_0x291a8b,'pageName':_0x2477a9,'templateName':_0x1e06b0});await a41_0x4ed406[_0x365a77(0x202)][_0x365a77(0x200)](_0x291a8b,{'recursive':!![]}),await this[_0x365a77(0x1d9)](_0x149bf0,_0x291a8b,_0x2477a9,_0x1e06b0);if(_0x25316f){const _0x4ac3e2=Date[_0x365a77(0x1e3)]()-_0xad4266;logger[_0x365a77(0x1d6)](_0x365a77(0x1f3),'模板内容替换完成',_0x4ac3e2,{'pageName':_0x2477a9,'templateName':_0x1e06b0});}}catch(_0x367343){if(_0x25316f){const _0x3ded46=Date[_0x365a77(0x1e3)]()-_0xad4266;logger[_0x365a77(0x1df)]('template',_0x365a77(0x1e1),{'templatePath':_0x149bf0,'targetPath':_0x291a8b,'pageName':_0x2477a9,'templateName':_0x1e06b0,'error':_0x367343 instanceof Error?_0x367343[_0x365a77(0x1f5)]:String(_0x367343),'duration':_0x3ded46});}throw _0x367343;}}static async['processDirectory'](_0x5c8d3a,_0x2d45fe,_0x499aa2,_0x44e55c){const _0x58f31c=a41_0x1873ea,_0x2b86cb=await a41_0x4ed406[_0x58f31c(0x202)]['readdir'](_0x5c8d3a,{'withFileTypes':!![]});for(const _0x401900 of _0x2b86cb){const _0x45d8b5=a41_0x5c676f[_0x58f31c(0x1e9)](_0x5c8d3a,_0x401900[_0x58f31c(0x206)]);let _0x2ccf3b=a41_0x5c676f[_0x58f31c(0x1e9)](_0x2d45fe,_0x401900['name']);_0x401900['name'][_0x58f31c(0x1e7)](_0x58f31c(0x1e5))&&(_0x2ccf3b=a41_0x5c676f[_0x58f31c(0x1e9)](_0x2d45fe,_0x401900['name'][_0x58f31c(0x201)](/\.tpl$/,'')));if(_0x401900[_0x58f31c(0x1f0)]())await a41_0x4ed406[_0x58f31c(0x202)][_0x58f31c(0x200)](_0x2ccf3b,{'recursive':!![]}),await this[_0x58f31c(0x1d9)](_0x45d8b5,_0x2ccf3b,_0x499aa2,_0x44e55c);else _0x401900['isFile']()&&await this[_0x58f31c(0x1f7)](_0x45d8b5,_0x2ccf3b,_0x499aa2,_0x44e55c);}}static async[a41_0x1873ea(0x1f7)](_0x565606,_0x13a1b0,_0x43f005,_0x584263){const _0x293969=a41_0x1873ea,_0x221fc7=a41_0x5c676f[_0x293969(0x1d3)](_0x565606)[_0x293969(0x1d5)]();_0x565606[_0x293969(0x1e7)](_0x293969(0x1e5))&&(_0x13a1b0=_0x13a1b0[_0x293969(0x201)](/\.tpl$/,''));const _0x3f22d1=[_0x293969(0x1fa),'.ts',_0x293969(0x1d7),_0x293969(0x1f4),_0x293969(0x1d4),_0x293969(0x1fe),_0x293969(0x1fc),'.scss',_0x293969(0x1e5)];if(_0x3f22d1[_0x293969(0x209)](_0x221fc7)||_0x565606[_0x293969(0x1e7)]('.tpl')){const _0x5d006b=await a41_0x4ed406[_0x293969(0x202)][_0x293969(0x1dc)](_0x565606,'utf8'),_0x54c4fc=this[_0x293969(0x1e4)](_0x5d006b,_0x43f005,_0x584263);await a41_0x4ed406[_0x293969(0x202)][_0x293969(0x1fb)](_0x13a1b0,_0x54c4fc,_0x293969(0x1ff));}else await a41_0x4ed406[_0x293969(0x202)]['copyFile'](_0x565606,_0x13a1b0);}}
|