@lovrabet/cli 1.1.22 → 1.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/add-page/input-page-router.js +1 -1
- package/lib/add-page/main.js +1 -1
- package/lib/add-page/select-page-template.js +1 -1
- package/lib/api/api-doc-ui.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/api-pull-ui.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/main.js +1 -1
- package/lib/api/pull-silent.js +1 -1
- package/lib/app-menu/app-menu-sync-ui.js +1 -1
- package/lib/app-menu/create-menu.js +1 -1
- package/lib/app-menu/get-local-pages.js +1 -1
- package/lib/app-menu/get-online-menu-list.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/cmd/build-watch.js +1 -1
- package/lib/cmd/build.js +1 -1
- package/lib/cmd/logs.js +1 -1
- package/lib/cmd/preview.js +1 -1
- package/lib/cmd/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/router-updater.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
- package/templates/projects/sub-app-react-demo/package-lock.json +4 -4
- package/templates/projects/sub-app-react-demo/package.json +1 -1
- package/templates/rules/lovrabet_rules.mdc.tpl +181 -115
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a49_0x27826a=a49_0x2238;(function(_0x1c9110,_0x346840){const _0x5758ff=a49_0x2238,_0x19e285=_0x1c9110();while(!![]){try{const _0x491ab5=-parseInt(_0x5758ff(0x1a1))/0x1+-parseInt(_0x5758ff(0x186))/0x2*(-parseInt(_0x5758ff(0x19e))/0x3)+parseInt(_0x5758ff(0x1a2))/0x4+-parseInt(_0x5758ff(0x1b0))/0x5+-parseInt(_0x5758ff(0x18a))/0x6*(parseInt(_0x5758ff(0x187))/0x7)+-parseInt(_0x5758ff(0x188))/0x8*(parseInt(_0x5758ff(0x1a5))/0x9)+parseInt(_0x5758ff(0x191))/0xa;if(_0x491ab5===_0x346840)break;else _0x19e285['push'](_0x19e285['shift']());}catch(_0x46471d){_0x19e285['push'](_0x19e285['shift']());}}}(a49_0x4f02,0xbf6c9));function a49_0x2238(_0x3e40e8,_0xcee090){const _0x4f026e=a49_0x4f02();return a49_0x2238=function(_0x223819,_0x245e66){_0x223819=_0x223819-0x17a;let _0xc02001=_0x4f026e[_0x223819];return _0xc02001;},a49_0x2238(_0x3e40e8,_0xcee090);}import a49_0x33c1cf from'winston';import a49_0x542479 from'node:fs';import a49_0x19c3c2 from'node:path';class Logger{[a49_0x27826a(0x182)];[a49_0x27826a(0x197)];[a49_0x27826a(0x1a4)]='';constructor(){const _0x1f1d21=a49_0x27826a;this[_0x1f1d21(0x197)]='';}[a49_0x27826a(0x18e)](_0x52ebff){const _0x13fc36=a49_0x27826a;this[_0x13fc36(0x1a4)]=_0x52ebff;}[a49_0x27826a(0x18f)](){const _0x3f8076=a49_0x27826a,_0x68a8dd=a49_0x19c3c2['dirname'](this['logFilePath']);!a49_0x542479[_0x3f8076(0x1a3)](_0x68a8dd)&&a49_0x542479[_0x3f8076(0x17b)](_0x68a8dd,{'recursive':!![]});const _0x119f84=a49_0x33c1cf[_0x3f8076(0x195)][_0x3f8076(0x17e)](a49_0x33c1cf[_0x3f8076(0x195)][_0x3f8076(0x1a6)](),a49_0x33c1cf[_0x3f8076(0x195)]['errors']({'stack':!![]}),a49_0x33c1cf[_0x3f8076(0x195)][_0x3f8076(0x185)](_0x31b296=>{const _0x4a38fe=_0x3f8076,_0x3eb366={'timestamp':_0x31b296[_0x4a38fe(0x1a6)]||new Date()[_0x4a38fe(0x19f)](),'level':_0x31b296[_0x4a38fe(0x18b)]||_0x4a38fe(0x193),'command':_0x31b296[_0x4a38fe(0x180)]||_0x4a38fe(0x1af),'rawCommand':_0x31b296[_0x4a38fe(0x17a)]||this[_0x4a38fe(0x1a4)]||undefined,'message':_0x31b296[_0x4a38fe(0x19a)]||'','duration':_0x31b296[_0x4a38fe(0x1b1)]||undefined,'details':_0x31b296[_0x4a38fe(0x18c)]||undefined};return JSON[_0x4a38fe(0x1a0)](_0x3eb366);}));this[_0x3f8076(0x182)]=a49_0x33c1cf[_0x3f8076(0x181)]({'level':_0x3f8076(0x193),'format':_0x119f84,'transports':[new a49_0x33c1cf['transports'][(_0x3f8076(0x17c))]({'filename':this[_0x3f8076(0x197)],'level':'info'})],'silent':![]}),a49_0x33c1cf['addColors']({'success':_0x3f8076(0x18d),'error':_0x3f8076(0x190),'warn':_0x3f8076(0x17f),'info':_0x3f8076(0x199)});}[a49_0x27826a(0x1ab)](_0x3c45ad){const _0x8d243f=a49_0x27826a;this['logFilePath']=a49_0x19c3c2[_0x8d243f(0x1b2)](_0x3c45ad,_0x8d243f(0x1a9)),this[_0x8d243f(0x182)]&&this[_0x8d243f(0x182)][_0x8d243f(0x1a8)](),this[_0x8d243f(0x18f)]();}[a49_0x27826a(0x193)](_0x503f9e,_0x5d520a,_0xb432ee){const _0x5435f4=a49_0x27826a;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x5435f4(0x182)][_0x5435f4(0x193)](_0x5d520a,{'command':_0x503f9e,'details':_0xb432ee});}[a49_0x27826a(0x17d)](_0x409044,_0x40dc04,_0x52286b,_0x230cdf){const _0x5a1be5=a49_0x27826a;if(!this['logFilePath']||!this[_0x5a1be5(0x182)])return;this[_0x5a1be5(0x182)]['log'](_0x5a1be5(0x193),_0x40dc04,{'level':_0x5a1be5(0x17d),'command':_0x409044,'duration':_0x52286b,'details':_0x230cdf});}[a49_0x27826a(0x1ad)](_0x5a419c,_0xaaacdc,_0x2b053e){const _0x29f594=a49_0x27826a;if(!this['logFilePath']||!this[_0x29f594(0x182)])return;this[_0x29f594(0x182)][_0x29f594(0x1ad)](_0xaaacdc,{'command':_0x5a419c,'details':_0x2b053e});}['warn'](_0x5c17ea,_0x232bd3,_0x6ccd7f){const _0x5537a0=a49_0x27826a;if(!this[_0x5537a0(0x197)]||!this[_0x5537a0(0x182)])return;this[_0x5537a0(0x182)]['warn'](_0x232bd3,{'command':_0x5c17ea,'details':_0x6ccd7f});}async[a49_0x27826a(0x194)](_0x4e6815,_0x17b7df,_0x53115c){const _0x5f0604=a49_0x27826a,_0x387dbb=Date[_0x5f0604(0x1aa)]();this[_0x5f0604(0x193)](_0x4e6815,_0x5f0604(0x19b)+_0x17b7df);try{const _0x82ef62=await _0x53115c(),_0x3830b0=Date[_0x5f0604(0x1aa)]()-_0x387dbb;return this['success'](_0x4e6815,'完成:\x20'+_0x17b7df,_0x3830b0),_0x82ef62;}catch(_0x2a23ae){const _0x92c264=Date[_0x5f0604(0x1aa)]()-_0x387dbb;this[_0x5f0604(0x1ad)](_0x4e6815,'失败:\x20'+_0x17b7df,{'error':_0x2a23ae instanceof Error?_0x2a23ae['message']:String(_0x2a23ae),'duration':_0x92c264});throw _0x2a23ae;}}[a49_0x27826a(0x184)](){const _0x473483=a49_0x27826a;try{if(!a49_0x542479[_0x473483(0x1a3)](this[_0x473483(0x197)]))return[];const _0x5b1dce=a49_0x542479[_0x473483(0x183)](this[_0x473483(0x197)],_0x473483(0x196));return _0x5b1dce[_0x473483(0x1a7)]('\x0a')[_0x473483(0x1ac)](_0x1dfdeb=>_0x1dfdeb[_0x473483(0x19c)]())['map'](_0x2f1b07=>JSON[_0x473483(0x189)](_0x2f1b07));}catch(_0x555506){return console[_0x473483(0x198)]('Failed\x20to\x20read\x20logs:',_0x555506),[];}}[a49_0x27826a(0x19d)](){const _0x1a9d33=a49_0x27826a;try{a49_0x542479[_0x1a9d33(0x1a3)](this[_0x1a9d33(0x197)])&&a49_0x542479[_0x1a9d33(0x192)](this[_0x1a9d33(0x197)],'',_0x1a9d33(0x196));}catch(_0x2c4d19){console[_0x1a9d33(0x198)]('Failed\x20to\x20clear\x20logs:',_0x2c4d19);}}[a49_0x27826a(0x1ae)](){return this['winstonLogger'];}}function a49_0x4f02(){const _0x134bf9=['开始执行:\x20','trim','clearLogs','4645743ElWBAH','toISOString','stringify','163986gdSCwz','1009780KYOUsM','existsSync','currentRawCommand','96651TAzdoR','timestamp','split','clear','.lovrabet.log','now','setLogPath','filter','error','getWinstonInstance','unknown','7158325ndDVbs','duration','join','rawCommand','mkdirSync','File','success','combine','yellow','command','createLogger','winstonLogger','readFileSync','readLogs','printf','2dQPOFl','7NEBMdP','960ZVogFZ','parse','9065010CYDMfT','level','details','green','setRawCommand','initWinstonLogger','red','33782130tKKEFt','writeFileSync','info','logTask','format','utf8','logFilePath','warn','blue','message'];a49_0x4f02=function(){return _0x134bf9;};return a49_0x4f02();}export const logger=new Logger();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x27dfd8=a50_0x35a8;function a50_0x35a8(_0x4f7181,_0x42f479){const _0xf69003=a50_0xf690();return a50_0x35a8=function(_0x35a8bf,_0x30d0f7){_0x35a8bf=_0x35a8bf-0x17e;let _0x1c004f=_0xf69003[_0x35a8bf];return _0x1c004f;},a50_0x35a8(_0x4f7181,_0x42f479);}(function(_0x55f49c,_0x4e9549){const _0x30eab9=a50_0x35a8,_0x429906=_0x55f49c();while(!![]){try{const _0x4633f8=parseInt(_0x30eab9(0x1a5))/0x1*(parseInt(_0x30eab9(0x183))/0x2)+-parseInt(_0x30eab9(0x182))/0x3*(parseInt(_0x30eab9(0x1b0))/0x4)+-parseInt(_0x30eab9(0x180))/0x5*(-parseInt(_0x30eab9(0x194))/0x6)+parseInt(_0x30eab9(0x17e))/0x7*(-parseInt(_0x30eab9(0x1aa))/0x8)+parseInt(_0x30eab9(0x1a7))/0x9*(-parseInt(_0x30eab9(0x1ab))/0xa)+parseInt(_0x30eab9(0x1a0))/0xb*(parseInt(_0x30eab9(0x193))/0xc)+-parseInt(_0x30eab9(0x1ae))/0xd*(-parseInt(_0x30eab9(0x192))/0xe);if(_0x4633f8===_0x4e9549)break;else _0x429906['push'](_0x429906['shift']());}catch(_0x259349){_0x429906['push'](_0x429906['shift']());}}}(a50_0xf690,0x1a92e));import a50_0x514e07 from'node:fs';function a50_0xf690(){const _0x574648=['路由配置更新完成','writeFile','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','28cWHasR','353244FzUBqy','3372IdnbXd','lastIndexOf','未找到路由配置的\x20children\x20数组','length','info','toComponentName','message','error','map','addRoute','path:\x20\x22','开始更新路由配置','22Bijqtv','existsSync','routerFilePath','router','addImport','4gLPmPB','\x20from\x20\x22../pages/','9684OqaBPW','now','match','1566632IAwyeZ','1880wgnMBy','promises','includes','1590290CwESXn','index','28dJVgZI','7BCtAqo','previewChanges','1255kUXIyP','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','12669MzPAfp','45964GmxaUa','src','toUpperCase','success','路由文件不存在:\x20','import\x20','index.tsx','slice','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','utf8','readFile','join'];a50_0xf690=function(){return _0x574648;};return a50_0xf690();}import a50_0x2ed6e7 from'node:path';import{logger}from'./logger.js';export class RouterUpdater{['routerFilePath'];constructor(_0x562ff6){const _0x5ea661=a50_0x35a8;this[_0x5ea661(0x1a2)]=a50_0x2ed6e7[_0x5ea661(0x18e)](_0x562ff6,_0x5ea661(0x184),_0x5ea661(0x1a3),_0x5ea661(0x189));}async['addPageRoute'](_0x54c6c8,_0x5a9d91){const _0x19313f=a50_0x35a8;if(!a50_0x514e07[_0x19313f(0x1a1)](this[_0x19313f(0x1a2)]))throw new Error('路由文件不存在:\x20'+this[_0x19313f(0x1a2)]);const _0x50c78b=Date[_0x19313f(0x1a8)]();logger[_0x19313f(0x198)]('router',_0x19313f(0x19f),{'pageName':_0x54c6c8,'routePath':_0x5a9d91,'file':this[_0x19313f(0x1a2)]});try{const _0x5b987b=await a50_0x514e07[_0x19313f(0x1ac)][_0x19313f(0x18d)](this[_0x19313f(0x1a2)],_0x19313f(0x18c)),_0x3101ea=this[_0x19313f(0x199)](_0x54c6c8),_0x3847ff=this[_0x19313f(0x1a4)](_0x5b987b,_0x3101ea,_0x54c6c8),_0x5e9610=this['addRoute'](_0x3847ff,_0x5a9d91,_0x3101ea);await a50_0x514e07[_0x19313f(0x1ac)][_0x19313f(0x190)](this[_0x19313f(0x1a2)],_0x5e9610,_0x19313f(0x18c));const _0x13a3d1=Date[_0x19313f(0x1a8)]()-_0x50c78b;logger[_0x19313f(0x186)]('router',_0x19313f(0x18f),_0x13a3d1,{'pageName':_0x54c6c8,'routePath':_0x5a9d91,'componentName':_0x3101ea});}catch(_0x2c7c10){const _0x220123=Date['now']()-_0x50c78b;logger[_0x19313f(0x19b)](_0x19313f(0x1a3),'路由配置更新失败',{'pageName':_0x54c6c8,'routePath':_0x5a9d91,'error':_0x2c7c10 instanceof Error?_0x2c7c10[_0x19313f(0x19a)]:String(_0x2c7c10),'duration':_0x220123});throw _0x2c7c10;}}[a50_0x27dfd8(0x199)](_0x278078){const _0x1bf9bd=a50_0x27dfd8;return _0x278078['split']('-')[_0x1bf9bd(0x19c)](_0x2e6528=>_0x2e6528['charAt'](0x0)[_0x1bf9bd(0x185)]()+_0x2e6528['slice'](0x1)['toLowerCase']())[_0x1bf9bd(0x18e)]('');}[a50_0x27dfd8(0x1a4)](_0x4ba268,_0x5987ff,_0x56a47c){const _0x1a626f=a50_0x27dfd8,_0xca21f1=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x536286=_0x4ba268[_0x1a626f(0x1a9)](_0xca21f1)||[],_0x3adf27=_0x1a626f(0x188)+_0x5987ff+_0x1a626f(0x1a6)+_0x56a47c+'\x22;';if(_0x4ba268[_0x1a626f(0x1ad)](_0x3adf27))return _0x4ba268;if(_0x536286[_0x1a626f(0x197)]>0x0){const _0x19d87d=_0x536286[_0x536286['length']-0x1];if(_0x19d87d){const _0x58c853=_0x4ba268[_0x1a626f(0x195)](_0x19d87d),_0x30b47e=_0x58c853+_0x19d87d[_0x1a626f(0x197)];return _0x4ba268[_0x1a626f(0x18a)](0x0,_0x30b47e)+_0x3adf27+'\x0a'+_0x4ba268[_0x1a626f(0x18a)](_0x30b47e);}}const _0x101d42=_0x4ba268[_0x1a626f(0x1a9)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x101d42&&_0x101d42[_0x1a626f(0x1af)]!==undefined){const _0x5a694d=_0x101d42[_0x1a626f(0x1af)]+_0x101d42[0x0][_0x1a626f(0x197)];return _0x4ba268['slice'](0x0,_0x5a694d)+_0x3adf27+'\x0a'+_0x4ba268[_0x1a626f(0x18a)](_0x5a694d);}return _0x4ba268;}['addRoute'](_0x3f88a5,_0x272bfa,_0x38913a){const _0x11c2b8=a50_0x27dfd8,_0x3eee40=_0x11c2b8(0x181)+_0x272bfa+_0x11c2b8(0x191)+_0x38913a+_0x11c2b8(0x18b);if(_0x3f88a5[_0x11c2b8(0x1ad)](_0x11c2b8(0x19e)+_0x272bfa+'\x22'))return _0x3f88a5;const _0x298d3d=/children:\s*\[([\s\S]*?)\]/,_0x29384a=_0x3f88a5[_0x11c2b8(0x1a9)](_0x298d3d);if(!_0x29384a||_0x29384a[_0x11c2b8(0x1af)]===undefined)throw new Error(_0x11c2b8(0x196));const _0x3423b0=_0x29384a[0x1],_0x868ede=_0x29384a[_0x11c2b8(0x1af)]+_0x29384a[0x0]['indexOf']('[')+0x1,_0x15b124=_0x3423b0?.[_0x11c2b8(0x1a9)](/\{[\s\S]*?\},/g)||[];if(_0x15b124[_0x11c2b8(0x197)]>0x0){const _0x1a6c16=_0x15b124[_0x15b124['length']-0x1];if(_0x1a6c16){const _0x35903d=_0x3f88a5['lastIndexOf'](_0x1a6c16),_0x4953cd=_0x35903d+_0x1a6c16['length'];return _0x3f88a5[_0x11c2b8(0x18a)](0x0,_0x4953cd)+'\x0a'+_0x3eee40+_0x3f88a5[_0x11c2b8(0x18a)](_0x4953cd);}}return _0x3f88a5['slice'](0x0,_0x868ede)+'\x0a'+_0x3eee40+_0x3f88a5['slice'](_0x868ede);}async[a50_0x27dfd8(0x17f)](_0xff7527,_0x1c9a24){const _0x445673=a50_0x27dfd8;if(!a50_0x514e07[_0x445673(0x1a1)](this[_0x445673(0x1a2)]))throw new Error(_0x445673(0x187)+this[_0x445673(0x1a2)]);const _0x227d0c=await a50_0x514e07[_0x445673(0x1ac)][_0x445673(0x18d)](this[_0x445673(0x1a2)],_0x445673(0x18c)),_0x5bd85d=this['toComponentName'](_0xff7527);let _0x41f77d=this[_0x445673(0x1a4)](_0x227d0c,_0x5bd85d,_0xff7527);return _0x41f77d=this[_0x445673(0x19d)](_0x41f77d,_0x1c9a24,_0x5bd85d),_0x41f77d;}}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x205755){return new Promise(_0x12ea59=>setTimeout(_0x12ea59,_0x205755));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a52_0x580db9=a52_0x473d;(function(_0x250cc8,_0xa6def1){const _0x27542f=a52_0x473d,_0x2fcab2=_0x250cc8();while(!![]){try{const _0x11bfec=-parseInt(_0x27542f(0x1f6))/0x1+parseInt(_0x27542f(0x1d9))/0x2*(-parseInt(_0x27542f(0x1d3))/0x3)+parseInt(_0x27542f(0x1e2))/0x4*(-parseInt(_0x27542f(0x1cf))/0x5)+-parseInt(_0x27542f(0x1f5))/0x6*(-parseInt(_0x27542f(0x1be))/0x7)+-parseInt(_0x27542f(0x1ca))/0x8*(-parseInt(_0x27542f(0x1bb))/0x9)+-parseInt(_0x27542f(0x1dc))/0xa+parseInt(_0x27542f(0x1e3))/0xb;if(_0x11bfec===_0xa6def1)break;else _0x2fcab2['push'](_0x2fcab2['shift']());}catch(_0x7bbd45){_0x2fcab2['push'](_0x2fcab2['shift']());}}}(a52_0xd848,0x3f0b8));import a52_0x1441aa from'node:fs';import a52_0x2baacd from'node:path';import{logger}from'./logger.js';function a52_0xd848(){const _0x4d3f1f=['7jNSYSG','processFile','YourModel','utf8','toLowerCase','info','copyFile','toLocaleTimeString','processTemplate','numeric','endsWith','.js','2888NhxPho','map','readdir','readFile','mkdir','6445nVjQmP','default','.tpl','slice','450qzZsGS','split','replaceApiContent','replaceContent','error','extname','2572TSxRyV','.scss','.tsx','5062530YiBoyk','stringify','message','template','isDirectory','promises','52ehPdCy','11076120tLIZaM','开始处理模板内容替换','.ts','writeFile','api','name','charAt','.md','includes','.jsx','pop','模板内容替换完成','replace','toComponentName','\x20\x20\x20\x20','2-digit','join','now','1220082CdXZUt','273308yrNxne','927zRvjQh','toDisplayTitle','processDirectory'];a52_0xd848=function(){return _0x4d3f1f;};return a52_0xd848();}function a52_0x473d(_0xa8774d,_0x256194){const _0xd84868=a52_0xd848();return a52_0x473d=function(_0x473d7e,_0x29e08b){_0x473d7e=_0x473d7e-0x1bb;let _0x469f81=_0xd84868[_0x473d7e];return _0x469f81;},a52_0x473d(_0xa8774d,_0x256194);}export class TemplateReplacer{static[a52_0x580db9(0x1f0)](_0x5674b6){const _0x2668cb=a52_0x580db9,_0x506d25=_0x5674b6[_0x2668cb(0x1d4)]('/')[_0x2668cb(0x1ed)]()||_0x5674b6;return _0x506d25[_0x2668cb(0x1d4)]('-')[_0x2668cb(0x1cb)](_0x405e00=>_0x405e00[_0x2668cb(0x1e9)](0x0)['toUpperCase']()+_0x405e00[_0x2668cb(0x1d2)](0x1)['toLowerCase']())[_0x2668cb(0x1f3)]('');}static[a52_0x580db9(0x1bc)](_0x4774ef){const _0x16bcad=a52_0x580db9,_0x38d613=_0x4774ef[_0x16bcad(0x1d4)]('/')['pop']()||_0x4774ef;return _0x38d613['split']('-')[_0x16bcad(0x1cb)](_0x59618a=>_0x59618a[_0x16bcad(0x1e9)](0x0)['toUpperCase']()+_0x59618a['slice'](0x1)[_0x16bcad(0x1c2)]())[_0x16bcad(0x1f3)]('\x20');}static[a52_0x580db9(0x1d6)](_0x247638,_0x51a585,_0x1e8ea5){const _0x36e5af=a52_0x580db9,_0x329390=this['toComponentName'](_0x51a585),_0x4b5455=this['toDisplayTitle'](_0x51a585),_0x27a1e9=new Date(),_0x15a343=_0x27a1e9['toLocaleString'](undefined,{'year':_0x36e5af(0x1c7),'month':_0x36e5af(0x1f2),'day':'2-digit','hour':_0x36e5af(0x1f2),'minute':'2-digit','second':_0x36e5af(0x1f2),'hour12':![]})[_0x36e5af(0x1ef)](/\//g,'-'),_0x316b90=_0x27a1e9['toLocaleDateString'](undefined,{'year':'numeric','month':_0x36e5af(0x1f2),'day':_0x36e5af(0x1f2)})[_0x36e5af(0x1ef)](/\//g,'-'),_0x4473e4=_0x27a1e9[_0x36e5af(0x1c5)](undefined,{'hour12':![]});let _0x4c265f=_0x247638[_0x36e5af(0x1ef)](/\{ComponentName\}/g,_0x329390)[_0x36e5af(0x1ef)](/\{DisplayTitle\}/g,_0x4b5455)[_0x36e5af(0x1ef)](/\{PageName\}/g,_0x51a585)[_0x36e5af(0x1ef)](/\{TemplateName\}/g,_0x1e8ea5)[_0x36e5af(0x1ef)](/\{CreatedAt\}/g,_0x15a343)['replace'](/\{CreatedDate\}/g,_0x316b90)[_0x36e5af(0x1ef)](/\{CreatedTime\}/g,_0x4473e4);return _0x4c265f;}static[a52_0x580db9(0x1d5)](_0x95aba4,_0xff518e,_0x332791,_0x5b3578,_0x398a68,_0x4bdc8e,_0x4b1896){const _0x5b25e9=a52_0x580db9,_0x36c813=new Date(),_0x43bd46=_0x36c813['toISOString'](),_0x4c0911=JSON[_0x5b25e9(0x1dd)](_0x332791,null,0x2)[_0x5b25e9(0x1d4)]('\x0a')['slice'](0x1,-0x1)[_0x5b25e9(0x1cb)](_0x51c155=>_0x51c155[_0x5b25e9(0x1ef)](/^ /,_0x5b25e9(0x1f1)))[_0x5b25e9(0x1f3)]('\x0a'),_0x180d3a=_0x5b3578||Object['keys'](_0x332791)[0x0]||_0x5b25e9(0x1c0);let _0x254632=_0x95aba4['replace'](/\{AppCode\}/g,_0xff518e)[_0x5b25e9(0x1ef)](/\{ModelConfigs\}/g,_0x4c0911)[_0x5b25e9(0x1ef)](/\{ExampleModelName\}/g,_0x180d3a)[_0x5b25e9(0x1ef)](/\{ApiFileName\}/g,_0x398a68||_0x5b25e9(0x1e7))[_0x5b25e9(0x1ef)](/\{ConfigName\}/g,_0x4bdc8e||_0x5b25e9(0x1d0))[_0x5b25e9(0x1ef)](/\{ClientConfigParam\}/g,_0x4b1896||'')[_0x5b25e9(0x1ef)](/\{CreatedAt\}/g,_0x43bd46);return _0x254632;}static async[a52_0x580db9(0x1c6)](_0x47bfda,_0x3294dc,_0x2c1383,_0x3d0959,_0x990b0e=!![]){const _0x2308c9=a52_0x580db9,_0x264a0c=Date[_0x2308c9(0x1f4)]();try{_0x990b0e&&logger[_0x2308c9(0x1c3)]('template',_0x2308c9(0x1e4),{'templatePath':_0x47bfda,'targetPath':_0x3294dc,'pageName':_0x2c1383,'templateName':_0x3d0959});await a52_0x1441aa[_0x2308c9(0x1e1)][_0x2308c9(0x1ce)](_0x3294dc,{'recursive':!![]}),await this['processDirectory'](_0x47bfda,_0x3294dc,_0x2c1383,_0x3d0959);if(_0x990b0e){const _0x165a06=Date[_0x2308c9(0x1f4)]()-_0x264a0c;logger['success'](_0x2308c9(0x1df),_0x2308c9(0x1ee),_0x165a06,{'pageName':_0x2c1383,'templateName':_0x3d0959});}}catch(_0x530fd5){if(_0x990b0e){const _0x49b71c=Date[_0x2308c9(0x1f4)]()-_0x264a0c;logger[_0x2308c9(0x1d7)]('template','模板内容替换失败',{'templatePath':_0x47bfda,'targetPath':_0x3294dc,'pageName':_0x2c1383,'templateName':_0x3d0959,'error':_0x530fd5 instanceof Error?_0x530fd5[_0x2308c9(0x1de)]:String(_0x530fd5),'duration':_0x49b71c});}throw _0x530fd5;}}static async['processDirectory'](_0x2a23bb,_0x731a79,_0x26bc03,_0x3a627a){const _0x3300de=a52_0x580db9,_0x8355cd=await a52_0x1441aa[_0x3300de(0x1e1)][_0x3300de(0x1cc)](_0x2a23bb,{'withFileTypes':!![]});for(const _0x571cb4 of _0x8355cd){const _0xe17233=a52_0x2baacd[_0x3300de(0x1f3)](_0x2a23bb,_0x571cb4['name']);let _0x43567e=a52_0x2baacd[_0x3300de(0x1f3)](_0x731a79,_0x571cb4['name']);_0x571cb4[_0x3300de(0x1e8)]['endsWith'](_0x3300de(0x1d1))&&(_0x43567e=a52_0x2baacd[_0x3300de(0x1f3)](_0x731a79,_0x571cb4['name'][_0x3300de(0x1ef)](/\.tpl$/,'')));if(_0x571cb4[_0x3300de(0x1e0)]())await a52_0x1441aa[_0x3300de(0x1e1)]['mkdir'](_0x43567e,{'recursive':!![]}),await this[_0x3300de(0x1bd)](_0xe17233,_0x43567e,_0x26bc03,_0x3a627a);else _0x571cb4['isFile']()&&await this['processFile'](_0xe17233,_0x43567e,_0x26bc03,_0x3a627a);}}static async[a52_0x580db9(0x1bf)](_0x4b4ba9,_0x457d37,_0x31678d,_0x17c253){const _0x1d9051=a52_0x580db9,_0x3d6a5e=a52_0x2baacd[_0x1d9051(0x1d8)](_0x4b4ba9)[_0x1d9051(0x1c2)]();_0x4b4ba9[_0x1d9051(0x1c8)](_0x1d9051(0x1d1))&&(_0x457d37=_0x457d37[_0x1d9051(0x1ef)](/\.tpl$/,''));const _0xe2a10a=[_0x1d9051(0x1db),_0x1d9051(0x1e5),_0x1d9051(0x1ec),_0x1d9051(0x1c9),'.json',_0x1d9051(0x1ea),'.css',_0x1d9051(0x1da),_0x1d9051(0x1d1)];if(_0xe2a10a[_0x1d9051(0x1eb)](_0x3d6a5e)||_0x4b4ba9['endsWith'](_0x1d9051(0x1d1))){const _0x509552=await a52_0x1441aa[_0x1d9051(0x1e1)][_0x1d9051(0x1cd)](_0x4b4ba9,'utf8'),_0x5ce007=this[_0x1d9051(0x1d6)](_0x509552,_0x31678d,_0x17c253);await a52_0x1441aa[_0x1d9051(0x1e1)][_0x1d9051(0x1e6)](_0x457d37,_0x5ce007,_0x1d9051(0x1c1));}else await a52_0x1441aa[_0x1d9051(0x1e1)][_0x1d9051(0x1c4)](_0x4b4ba9,_0x457d37);}}
|
package/package.json
CHANGED
|
@@ -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.
|
|
13
|
+
"@lovrabet/sdk": "^1.1.24",
|
|
14
14
|
"antd": "^5.26.7",
|
|
15
15
|
"echarts": "^5.6.0",
|
|
16
16
|
"echarts-for-react": "^3.0.2",
|
|
@@ -937,9 +937,9 @@
|
|
|
937
937
|
}
|
|
938
938
|
},
|
|
939
939
|
"node_modules/@lovrabet/sdk": {
|
|
940
|
-
"version": "1.1.
|
|
941
|
-
"resolved": "https://registry.npmjs.org/@lovrabet/sdk/-/sdk-1.1.
|
|
942
|
-
"integrity": "sha512-
|
|
940
|
+
"version": "1.1.24",
|
|
941
|
+
"resolved": "https://registry.npmjs.org/@lovrabet/sdk/-/sdk-1.1.24.tgz",
|
|
942
|
+
"integrity": "sha512-HjU6AjFu33HA/b6srIjxir5MBWkqbnB054SXxhlB6B7TbhW3eJa0+tekRSm/eAVrXURql0aacaGjKjTdBg2H/g==",
|
|
943
943
|
"license": "SEE LICENSE IN LICENSE",
|
|
944
944
|
"peerDependencies": {
|
|
945
945
|
"typescript": "^5"
|