@lovrabet/cli 1.3.0 → 1.3.1

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 (79) hide show
  1. package/lib/add-page/input-page-router.js +1 -1
  2. package/lib/add-page/main.js +1 -1
  3. package/lib/add-page/select-page-template.js +1 -1
  4. package/lib/ai-setup/AISetupUI.js +1 -1
  5. package/lib/ai-setup/config.js +1 -1
  6. package/lib/api/api-doc-ui.js +1 -1
  7. package/lib/api/api-doc.js +1 -1
  8. package/lib/api/api-pull-ui.js +1 -1
  9. package/lib/api/fetch-model-list.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/app-menu/app-menu-sync-ui.js +1 -1
  14. package/lib/app-menu/create-menu.js +1 -1
  15. package/lib/app-menu/get-local-pages.js +1 -1
  16. package/lib/app-menu/get-online-menu-list.js +1 -1
  17. package/lib/app-menu/use-get-online-menu-list.js +1 -1
  18. package/lib/app-menu/utils.js +1 -1
  19. package/lib/app-menu/valid-url.js +1 -1
  20. package/lib/app-menu-update-cdn/current-content.js +1 -1
  21. package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
  22. package/lib/app-menu-update-cdn/main.js +1 -1
  23. package/lib/app-menu-update-cdn/update-menu-cdn-url.js +1 -1
  24. package/lib/auth/auth-server-ui.js +1 -1
  25. package/lib/auth/auth-server.js +1 -1
  26. package/lib/auth/constant.js +1 -1
  27. package/lib/auth/get-cookie.js +1 -1
  28. package/lib/auth/is-session-valid.js +1 -1
  29. package/lib/auth/logout.js +1 -1
  30. package/lib/cli.js +1 -1
  31. package/lib/cmd/build-watch.js +1 -1
  32. package/lib/cmd/build.js +1 -1
  33. package/lib/cmd/logs.js +1 -1
  34. package/lib/cmd/preview.js +1 -1
  35. package/lib/cmd/start.js +1 -1
  36. package/lib/config/config-help.js +1 -1
  37. package/lib/config/main.js +1 -1
  38. package/lib/constant/domain.js +1 -1
  39. package/lib/constant/env.js +1 -1
  40. package/lib/create-app/enhanced-guided-create.js +1 -1
  41. package/lib/create-app/format-elapsed.js +1 -1
  42. package/lib/create-app/main.js +1 -1
  43. package/lib/create-app/non-interactive.js +1 -1
  44. package/lib/create-app/task-finished.js +1 -1
  45. package/lib/create-app/task-loading.js +1 -1
  46. package/lib/create-app/task-running.js +1 -1
  47. package/lib/create-app/task-time.js +1 -1
  48. package/lib/create-app/use-copy-project-template.js +1 -1
  49. package/lib/create-app/use-format-code.js +1 -1
  50. package/lib/create-app/use-install-dependencies.js +1 -1
  51. package/lib/help.js +1 -1
  52. package/lib/init/main.js +1 -1
  53. package/lib/mcp/McpInstallUI.js +1 -1
  54. package/lib/mcp/claude.js +1 -1
  55. package/lib/mcp/cursor.js +1 -1
  56. package/lib/mcp/main.js +1 -1
  57. package/lib/mcp/mcp-install-non-interactive.js +1 -1
  58. package/lib/mcp/mcp-installer.js +1 -1
  59. package/lib/skills/SkillInstallUI.js +1 -1
  60. package/lib/skills/main.js +1 -1
  61. package/lib/skills/skill-install-non-interactive.js +1 -1
  62. package/lib/skills/skill-installer.js +1 -1
  63. package/lib/ui/IDESelector.js +1 -1
  64. package/lib/ui/useIDESelection.js +1 -1
  65. package/lib/utils/ai_config.js +1 -1
  66. package/lib/utils/cdn-config.js +1 -1
  67. package/lib/utils/check-sdk-version.js +1 -1
  68. package/lib/utils/cli-version-check.js +1 -1
  69. package/lib/utils/config.js +1 -1
  70. package/lib/utils/copy-directory.js +1 -1
  71. package/lib/utils/file-utils.js +1 -1
  72. package/lib/utils/guides-cdn.js +1 -1
  73. package/lib/utils/http-client.js +1 -1
  74. package/lib/utils/logger.js +1 -1
  75. package/lib/utils/router-updater.js +1 -1
  76. package/lib/utils/rules-cdn.js +1 -1
  77. package/lib/utils/sleep.js +1 -1
  78. package/lib/utils/template-replacer.js +1 -1
  79. package/package.json +1 -1
@@ -1 +1 @@
1
- const a78_0x200d1d=a78_0x4cb4;(function(_0x41d4c8,_0x4a0ed4){const _0xc7fef3=a78_0x4cb4,_0x5c4fa9=_0x41d4c8();while(!![]){try{const _0x428c6c=parseInt(_0xc7fef3(0xda))/0x1*(parseInt(_0xc7fef3(0xce))/0x2)+-parseInt(_0xc7fef3(0xd2))/0x3*(parseInt(_0xc7fef3(0xd8))/0x4)+parseInt(_0xc7fef3(0xd6))/0x5+-parseInt(_0xc7fef3(0xc9))/0x6+parseInt(_0xc7fef3(0xd9))/0x7*(parseInt(_0xc7fef3(0xde))/0x8)+-parseInt(_0xc7fef3(0xd7))/0x9+parseInt(_0xc7fef3(0xcd))/0xa;if(_0x428c6c===_0x4a0ed4)break;else _0x5c4fa9['push'](_0x5c4fa9['shift']());}catch(_0x3f3664){_0x5c4fa9['push'](_0x5c4fa9['shift']());}}}(a78_0x75ce,0xcddf6));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'./config.js';import{appendUpdateTime}from'./guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0x25898e=a78_0x4cb4,_0x59183d=getTemplateBaseUrl();return _0x59183d+_0x25898e(0xd3);}function a78_0x75ce(){const _0x43b613=['utf-8','agents.md','7810270ZgRrIK','12911436WDIkUd','24wUhqCh','49bMPfAH','3447daTIPA','lastUpdated','CDN\x20返回数据格式错误','json','7024NbwtPf','9939066PqCmpJ','content','.cursor/rules','../../cdn-source/rules/lovrabet_rules.mdc.tpl','25122510iyhKoE','16bQPyJF','catch','string','statusText','86829yEJoSw','/rules/rules.json'];a78_0x75ce=function(){return _0x43b613;};return a78_0x75ce();}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a78_0x200d1d(0xcc));export async function fetchRulesFromCDN(){const _0x3ca3f4=a78_0x200d1d,_0x322a3b=getRulesCdnUrl(),_0x5479b2=await fetch(_0x322a3b,{'headers':{'Accept':'application/json'}});if(!_0x5479b2['ok'])throw new Error('CDN\x20请求失败:\x20'+_0x5479b2['status']+'\x20'+_0x5479b2[_0x3ca3f4(0xd1)]);const _0x5db376=await _0x5479b2[_0x3ca3f4(0xdd)]();if(!_0x5db376[_0x3ca3f4(0xca)]||typeof _0x5db376['content']!==_0x3ca3f4(0xd0))throw new Error(_0x3ca3f4(0xdc));return _0x5db376;}export async function getRulesContent(){const _0x8db774=a78_0x200d1d;try{const _0x4904b3=await fetchRulesFromCDN();return _0x4904b3[_0x8db774(0xca)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x4143a7=a78_0x200d1d;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x4143a7(0xd4));throw new Error('本地模板文件不存在:\x20'+LOCAL_TEMPLATE_PATH);}function a78_0x4cb4(_0x48718b,_0x54dcd6){_0x48718b=_0x48718b-0xc9;const _0x75ce54=a78_0x75ce();let _0x4cb414=_0x75ce54[_0x48718b];return _0x4cb414;}export async function writeRulesFile(_0x343ead){const _0x1f736d=a78_0x200d1d,_0x35718a=await fetchRulesFromCDN()[_0x1f736d(0xcf)](()=>null);let _0x590358;_0x35718a?(_0x590358=_0x35718a[_0x1f736d(0xca)],_0x35718a[_0x1f736d(0xdb)]&&(_0x590358=appendUpdateTime(_0x590358,_0x35718a[_0x1f736d(0xdb)]))):_0x590358=readLocalTemplate();const _0x4cdde7=dirname(_0x343ead);!existsSync(_0x4cdde7)&&mkdirSync(_0x4cdde7,{'recursive':!![]}),writeFileSync(_0x343ead,_0x590358,_0x1f736d(0xd4));}export async function copyRulesToCursor(_0x22ef25){const _0x58425b=a78_0x200d1d,_0x2d1e08=join(_0x22ef25,_0x58425b(0xcb)),_0x191dcd=join(_0x2d1e08,'lovrabet_rules.mdc');if(existsSync(_0x191dcd))return![];return await writeRulesFile(_0x191dcd),!![];}export async function copyRulesToAgentsMd(_0x228411){const _0x5259f3=a78_0x200d1d,_0x50899d=join(_0x228411,_0x5259f3(0xd5));if(existsSync(_0x50899d))return![];return await writeRulesFile(_0x50899d),!![];}
1
+ (function(_0x16021d,_0x2f6715){const _0x285a07=a78_0x4a8e,_0x34f4d8=_0x16021d();while(!![]){try{const _0x17794c=-parseInt(_0x285a07(0x8d))/0x1*(parseInt(_0x285a07(0x92))/0x2)+parseInt(_0x285a07(0x88))/0x3*(-parseInt(_0x285a07(0x8c))/0x4)+-parseInt(_0x285a07(0x8f))/0x5+parseInt(_0x285a07(0x86))/0x6+-parseInt(_0x285a07(0x93))/0x7*(parseInt(_0x285a07(0x8e))/0x8)+parseInt(_0x285a07(0x95))/0x9+-parseInt(_0x285a07(0x94))/0xa;if(_0x17794c===_0x2f6715)break;else _0x34f4d8['push'](_0x34f4d8['shift']());}catch(_0x255756){_0x34f4d8['push'](_0x34f4d8['shift']());}}}(a78_0x3b39,0x89d75));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'./config.js';function a78_0x4a8e(_0x4bd103,_0x785253){_0x4bd103=_0x4bd103-0x83;const _0x3b391f=a78_0x3b39();let _0x4a8ee3=_0x3b391f[_0x4bd103];return _0x4a8ee3;}import{appendUpdateTime}from'./guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0x313dc3=getTemplateBaseUrl();return _0x313dc3+'/rules/rules.json';}const LOCAL_TEMPLATE_PATH=resolve(__dirname,'../../cdn-source/rules/lovrabet_rules.mdc.tpl');export async function fetchRulesFromCDN(){const _0x15e7d3=a78_0x4a8e,_0x998071=getRulesCdnUrl(),_0x52906e=await fetch(_0x998071,{'headers':{'Accept':'application/json'}});if(!_0x52906e['ok'])throw new Error(_0x15e7d3(0x8b)+_0x52906e[_0x15e7d3(0x90)]+'\x20'+_0x52906e[_0x15e7d3(0x96)]);const _0x4c1ab2=await _0x52906e[_0x15e7d3(0x8a)]();if(!_0x4c1ab2[_0x15e7d3(0x89)]||typeof _0x4c1ab2[_0x15e7d3(0x89)]!==_0x15e7d3(0x84))throw new Error(_0x15e7d3(0x87));return _0x4c1ab2;}export async function getRulesContent(){const _0x22fca7=a78_0x4a8e;try{const _0x36aeaa=await fetchRulesFromCDN();return _0x36aeaa[_0x22fca7(0x89)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,'utf-8');throw new Error('本地模板文件不存在:\x20'+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0xc330c3){const _0x5fc8cd=a78_0x4a8e,_0x144226=await fetchRulesFromCDN()[_0x5fc8cd(0x91)](()=>null);let _0x23e695;_0x144226?(_0x23e695=_0x144226[_0x5fc8cd(0x89)],_0x144226[_0x5fc8cd(0x85)]&&(_0x23e695=appendUpdateTime(_0x23e695,_0x144226[_0x5fc8cd(0x85)]))):_0x23e695=readLocalTemplate();const _0x5871ec=dirname(_0xc330c3);!existsSync(_0x5871ec)&&mkdirSync(_0x5871ec,{'recursive':!![]}),writeFileSync(_0xc330c3,_0x23e695,'utf-8');}function a78_0x3b39(){const _0x4f9b7d=['status','catch','388174FXUqBT','3870587bEaAfh','481520gQCMVu','8539614DEayoL','statusText','.cursor/rules','agents.md','lovrabet_rules.mdc','string','lastUpdated','4301604xczSvF','CDN\x20返回数据格式错误','111wHzFTQ','content','json','CDN\x20请求失败:\x20','25904CNunGB','1QOMTjk','8yhlBpQ','331955qQPfkL'];a78_0x3b39=function(){return _0x4f9b7d;};return a78_0x3b39();}export async function copyRulesToCursor(_0x377b37){const _0x2232f7=a78_0x4a8e,_0x255047=join(_0x377b37,_0x2232f7(0x97)),_0x2ef95a=join(_0x255047,_0x2232f7(0x83));if(existsSync(_0x2ef95a))return![];return await writeRulesFile(_0x2ef95a),!![];}export async function copyRulesToAgentsMd(_0x3bb004){const _0x598eb1=a78_0x4a8e,_0x1ae242=join(_0x3bb004,_0x598eb1(0x98));if(existsSync(_0x1ae242))return![];return await writeRulesFile(_0x1ae242),!![];}
@@ -1 +1 @@
1
- export function sleep(_0x4332eb){return new Promise(_0x29f5ae=>setTimeout(_0x29f5ae,_0x4332eb));}
1
+ export function sleep(_0x3a7831){return new Promise(_0x3c6384=>setTimeout(_0x3c6384,_0x3a7831));}
@@ -1 +1 @@
1
- function a80_0x2e78(){const _0x2589b8=['template','name','pop','error','19xPvYFr','2089276XQzmpL','模板内容替换失败','40705920hASJWD','42182vwwhRv','numeric','toISOString','processTemplate','slice','1559390wewFCI','isDirectory','join','success','模板内容替换完成','processFile','replaceContent','.jsx','toDisplayTitle','writeFile','.tpl','default','datasetCode','.ts','tableName','map','version','api','toLocaleDateString','alias','27dhpTPS','16096652iXLcFN','datasetCode:\x20\x22','\x20},','102NLUDGy','32025ECfeVk','replace','331457fYAfFa','开始处理模板内容替换','toLocaleString','mkdir','endsWith','80VaGPEg','.css','../../package.json','isFile','processDirectory','charAt','utf8','split','toLocaleTimeString','.json','.scss','toLowerCase','copyFile','promises','tableName:\x20\x22','\x0a\x20\x20\x20\x20{\x20','toComponentName','9wAZEjg','now','.md','2-digit'];a80_0x2e78=function(){return _0x2589b8;};return a80_0x2e78();}function a80_0x1a44(_0x1f77c6,_0x4de07a){_0x1f77c6=_0x1f77c6-0x1ae;const _0x2e78dc=a80_0x2e78();let _0x1a44cb=_0x2e78dc[_0x1f77c6];return _0x1a44cb;}const a80_0x4ee4c7=a80_0x1a44;(function(_0x44abcf,_0x16965e){const _0x4eb555=a80_0x1a44,_0x5affc6=_0x44abcf();while(!![]){try{const _0x522e35=-parseInt(_0x4eb555(0x1bd))/0x1*(-parseInt(_0x4eb555(0x1c1))/0x2)+-parseInt(_0x4eb555(0x1b5))/0x3*(parseInt(_0x4eb555(0x1be))/0x4)+-parseInt(_0x4eb555(0x1df))/0x5*(-parseInt(_0x4eb555(0x1de))/0x6)+parseInt(_0x4eb555(0x1e1))/0x7*(-parseInt(_0x4eb555(0x1e6))/0x8)+-parseInt(_0x4eb555(0x1da))/0x9*(-parseInt(_0x4eb555(0x1c6))/0xa)+-parseInt(_0x4eb555(0x1db))/0xb+parseInt(_0x4eb555(0x1c0))/0xc;if(_0x522e35===_0x16965e)break;else _0x5affc6['push'](_0x5affc6['shift']());}catch(_0x24ecce){_0x5affc6['push'](_0x5affc6['shift']());}}}(a80_0x2e78,0xd3600));import a80_0x17faad from'node:fs';import a80_0x3fe25d from'node:path';import{createRequire}from'node:module';import{logger}from'./logger.js';const require=createRequire(import.meta.url),CLI_VERSION=require(a80_0x4ee4c7(0x1e8))[a80_0x4ee4c7(0x1d6)];export class TemplateReplacer{static['toComponentName'](_0x3c864d){const _0x3a6f1b=a80_0x4ee4c7,_0x477dab=_0x3c864d['split']('/')['pop']()||_0x3c864d;return _0x477dab[_0x3a6f1b(0x1ed)]('-')[_0x3a6f1b(0x1d5)](_0x524df4=>_0x524df4[_0x3a6f1b(0x1eb)](0x0)['toUpperCase']()+_0x524df4[_0x3a6f1b(0x1c5)](0x1)[_0x3a6f1b(0x1af)]())[_0x3a6f1b(0x1c8)]('');}static[a80_0x4ee4c7(0x1ce)](_0x292153){const _0xb377d5=a80_0x4ee4c7,_0xbd0689=_0x292153[_0xb377d5(0x1ed)]('/')[_0xb377d5(0x1bb)]()||_0x292153;return _0xbd0689[_0xb377d5(0x1ed)]('-')[_0xb377d5(0x1d5)](_0xc57010=>_0xc57010[_0xb377d5(0x1eb)](0x0)['toUpperCase']()+_0xc57010[_0xb377d5(0x1c5)](0x1)['toLowerCase']())[_0xb377d5(0x1c8)]('\x20');}static[a80_0x4ee4c7(0x1cc)](_0x61db8a,_0x2effdf,_0x13c239){const _0x59d1bd=a80_0x4ee4c7,_0x1b5ce8=this[_0x59d1bd(0x1b4)](_0x2effdf),_0x5f09e7=this[_0x59d1bd(0x1ce)](_0x2effdf),_0x4c1b18=new Date(),_0x2d4e84=_0x4c1b18[_0x59d1bd(0x1e3)](undefined,{'year':_0x59d1bd(0x1c2),'month':'2-digit','day':'2-digit','hour':_0x59d1bd(0x1b8),'minute':'2-digit','second':'2-digit','hour12':![]})[_0x59d1bd(0x1e0)](/\//g,'-'),_0x70dc6c=_0x4c1b18[_0x59d1bd(0x1d8)](undefined,{'year':'numeric','month':_0x59d1bd(0x1b8),'day':_0x59d1bd(0x1b8)})[_0x59d1bd(0x1e0)](/\//g,'-'),_0x75a023=_0x4c1b18[_0x59d1bd(0x1ee)](undefined,{'hour12':![]});let _0x47f85c=_0x61db8a['replace'](/\{CliVersion\}/g,CLI_VERSION)[_0x59d1bd(0x1e0)](/\{ComponentName\}/g,_0x1b5ce8)[_0x59d1bd(0x1e0)](/\{DisplayTitle\}/g,_0x5f09e7)[_0x59d1bd(0x1e0)](/\{PageName\}/g,_0x2effdf)[_0x59d1bd(0x1e0)](/\{TemplateName\}/g,_0x13c239)['replace'](/\{CreatedAt\}/g,_0x2d4e84)[_0x59d1bd(0x1e0)](/\{CreatedDate\}/g,_0x70dc6c)[_0x59d1bd(0x1e0)](/\{CreatedTime\}/g,_0x75a023);return _0x47f85c;}static['replaceApiContent'](_0xbdd422,_0x20b20b,_0x31775e,_0x5239ce,_0xe67c6e,_0xa26898,_0x1b51e3){const _0x55df67=a80_0x4ee4c7,_0x48d86a=new Date(),_0x44fc68=_0x48d86a[_0x55df67(0x1c3)](),_0x53e6e4=_0x31775e['map'](_0x3a00b5=>{const _0x2c0f36=_0x55df67,_0x266c4b=[_0x2c0f36(0x1dc)+_0x3a00b5[_0x2c0f36(0x1d2)]+'\x22',_0x2c0f36(0x1b2)+_0x3a00b5[_0x2c0f36(0x1d4)]+'\x22','name:\x20\x22'+_0x3a00b5[_0x2c0f36(0x1ba)]+'\x22'];return _0x3a00b5[_0x2c0f36(0x1d9)]&&_0x266c4b['push']('alias:\x20\x22'+_0x3a00b5[_0x2c0f36(0x1d9)]+'\x22'),_0x2c0f36(0x1b3)+_0x266c4b['join'](',\x20')+_0x2c0f36(0x1dd);})['join'](''),_0x47cdd5=_0x5239ce||_0x31775e[0x0]?.[_0x55df67(0x1d9)]||'YourModel';let _0x147f57=_0xbdd422['replace'](/\{AppCode\}/g,_0x20b20b)[_0x55df67(0x1e0)](/\{ModelConfigs\}/g,_0x53e6e4)[_0x55df67(0x1e0)](/\{ExampleModelName\}/g,_0x47cdd5)[_0x55df67(0x1e0)](/\{ApiFileName\}/g,_0xe67c6e||_0x55df67(0x1d7))[_0x55df67(0x1e0)](/\{ConfigName\}/g,_0xa26898||_0x55df67(0x1d1))[_0x55df67(0x1e0)](/\{ClientConfigParam\}/g,_0x1b51e3||'')[_0x55df67(0x1e0)](/\{CreatedAt\}/g,_0x44fc68);return _0x147f57;}static async[a80_0x4ee4c7(0x1c4)](_0x10b9e9,_0x5663c7,_0x4f75ea,_0x297601,_0x150b92=!![]){const _0x18ac11=a80_0x4ee4c7,_0x2dc3f5=Date['now']();try{_0x150b92&&logger['info']('template',_0x18ac11(0x1e2),{'templatePath':_0x10b9e9,'targetPath':_0x5663c7,'pageName':_0x4f75ea,'templateName':_0x297601});await a80_0x17faad['promises'][_0x18ac11(0x1e4)](_0x5663c7,{'recursive':!![]}),await this[_0x18ac11(0x1ea)](_0x10b9e9,_0x5663c7,_0x4f75ea,_0x297601);if(_0x150b92){const _0x15ffa5=Date[_0x18ac11(0x1b6)]()-_0x2dc3f5;logger[_0x18ac11(0x1c9)](_0x18ac11(0x1b9),_0x18ac11(0x1ca),_0x15ffa5,{'pageName':_0x4f75ea,'templateName':_0x297601});}}catch(_0x56b45b){if(_0x150b92){const _0x3e0658=Date[_0x18ac11(0x1b6)]()-_0x2dc3f5;logger[_0x18ac11(0x1bc)](_0x18ac11(0x1b9),_0x18ac11(0x1bf),{'templatePath':_0x10b9e9,'targetPath':_0x5663c7,'pageName':_0x4f75ea,'templateName':_0x297601,'error':_0x56b45b instanceof Error?_0x56b45b['message']:String(_0x56b45b),'duration':_0x3e0658});}throw _0x56b45b;}}static async[a80_0x4ee4c7(0x1ea)](_0x2eb5ad,_0x2525d7,_0xdc873f,_0x47a5f8){const _0xbdca95=a80_0x4ee4c7,_0x13c7d0=await a80_0x17faad[_0xbdca95(0x1b1)]['readdir'](_0x2eb5ad,{'withFileTypes':!![]});for(const _0x338ddf of _0x13c7d0){const _0x6d1905=a80_0x3fe25d[_0xbdca95(0x1c8)](_0x2eb5ad,_0x338ddf[_0xbdca95(0x1ba)]);let _0x729d28=a80_0x3fe25d[_0xbdca95(0x1c8)](_0x2525d7,_0x338ddf['name']);_0x338ddf[_0xbdca95(0x1ba)][_0xbdca95(0x1e5)]('.tpl')&&(_0x729d28=a80_0x3fe25d[_0xbdca95(0x1c8)](_0x2525d7,_0x338ddf[_0xbdca95(0x1ba)][_0xbdca95(0x1e0)](/\.tpl$/,'')));if(_0x338ddf[_0xbdca95(0x1c7)]())await a80_0x17faad[_0xbdca95(0x1b1)]['mkdir'](_0x729d28,{'recursive':!![]}),await this[_0xbdca95(0x1ea)](_0x6d1905,_0x729d28,_0xdc873f,_0x47a5f8);else _0x338ddf[_0xbdca95(0x1e9)]()&&await this[_0xbdca95(0x1cb)](_0x6d1905,_0x729d28,_0xdc873f,_0x47a5f8);}}static async[a80_0x4ee4c7(0x1cb)](_0x36e85c,_0x2136fd,_0x303e42,_0x3eca3a){const _0x3e86eb=a80_0x4ee4c7,_0x4df09d=a80_0x3fe25d['extname'](_0x36e85c)['toLowerCase']();_0x36e85c['endsWith'](_0x3e86eb(0x1d0))&&(_0x2136fd=_0x2136fd[_0x3e86eb(0x1e0)](/\.tpl$/,''));const _0x3996a1=['.tsx',_0x3e86eb(0x1d3),_0x3e86eb(0x1cd),'.js',_0x3e86eb(0x1ef),_0x3e86eb(0x1b7),_0x3e86eb(0x1e7),_0x3e86eb(0x1ae),'.tpl'];if(_0x3996a1['includes'](_0x4df09d)||_0x36e85c[_0x3e86eb(0x1e5)]('.tpl')){const _0x5992f9=await a80_0x17faad[_0x3e86eb(0x1b1)]['readFile'](_0x36e85c,'utf8'),_0x56d524=this[_0x3e86eb(0x1cc)](_0x5992f9,_0x303e42,_0x3eca3a);await a80_0x17faad[_0x3e86eb(0x1b1)][_0x3e86eb(0x1cf)](_0x2136fd,_0x56d524,_0x3e86eb(0x1ec));}else await a80_0x17faad[_0x3e86eb(0x1b1)][_0x3e86eb(0x1b0)](_0x36e85c,_0x2136fd);}}
1
+ const a80_0xd8c56c=a80_0x341b;(function(_0x20c645,_0x352d10){const _0x102dd3=a80_0x341b,_0x36f131=_0x20c645();while(!![]){try{const _0x4fd011=parseInt(_0x102dd3(0x1cd))/0x1*(-parseInt(_0x102dd3(0x1e5))/0x2)+parseInt(_0x102dd3(0x1e1))/0x3+parseInt(_0x102dd3(0x1f4))/0x4+parseInt(_0x102dd3(0x1c3))/0x5+-parseInt(_0x102dd3(0x1d8))/0x6+parseInt(_0x102dd3(0x1d2))/0x7*(-parseInt(_0x102dd3(0x1ea))/0x8)+-parseInt(_0x102dd3(0x1e0))/0x9;if(_0x4fd011===_0x352d10)break;else _0x36f131['push'](_0x36f131['shift']());}catch(_0x4f5229){_0x36f131['push'](_0x36f131['shift']());}}}(a80_0x54b9,0x30094));import a80_0x29dc86 from'node:fs';import a80_0xe32134 from'node:path';import{createRequire}from'node:module';function a80_0x54b9(){const _0xb86b19=['copyFile','toLocaleDateString','908885oaeQIK','\x0a\x20\x20\x20\x20{\x20','info','utf8','.json','processFile','name:\x20\x22','numeric','charAt','mkdir','126674VwgDtK','toComponentName','processDirectory','readdir','includes','3192xVdKgu','success','error','toDisplayTitle','toISOString','message','412338BURkOS','template','split','endsWith','YourModel','now','toLocaleTimeString','alias:\x20\x22','897849OgTOwy','976461gsgkJP','../../package.json','toUpperCase','toLowerCase','2lZrOuF','promises','name','map','alias','4448CarLnI','.js','.tsx','processTemplate','isDirectory','.md','模板内容替换完成','readFile','datasetCode:\x20\x22','开始处理模板内容替换','952744LmPVnf','2-digit','api','replaceContent','.scss','pop','replaceApiContent','version','slice','join','模板内容替换失败','.css','toLocaleString','replace','default','.ts','.tpl'];a80_0x54b9=function(){return _0xb86b19;};return a80_0x54b9();}import{logger}from'./logger.js';function a80_0x341b(_0x2d4ca9,_0x5f577d){_0x2d4ca9=_0x2d4ca9-0x1bf;const _0x54b9aa=a80_0x54b9();let _0x341bdf=_0x54b9aa[_0x2d4ca9];return _0x341bdf;}const require=createRequire(import.meta.url),CLI_VERSION=require(a80_0xd8c56c(0x1e2))[a80_0xd8c56c(0x1fb)];export class TemplateReplacer{static[a80_0xd8c56c(0x1ce)](_0x4f37f8){const _0x4c7e72=a80_0xd8c56c,_0x4fee19=_0x4f37f8[_0x4c7e72(0x1da)]('/')[_0x4c7e72(0x1f9)]()||_0x4f37f8;return _0x4fee19['split']('-')[_0x4c7e72(0x1e8)](_0x3c7ca3=>_0x3c7ca3[_0x4c7e72(0x1cb)](0x0)[_0x4c7e72(0x1e3)]()+_0x3c7ca3[_0x4c7e72(0x1fc)](0x1)[_0x4c7e72(0x1e4)]())[_0x4c7e72(0x1fd)]('');}static[a80_0xd8c56c(0x1d5)](_0x340c25){const _0xfee06b=a80_0xd8c56c,_0x61a656=_0x340c25['split']('/')[_0xfee06b(0x1f9)]()||_0x340c25;return _0x61a656[_0xfee06b(0x1da)]('-')[_0xfee06b(0x1e8)](_0x684d67=>_0x684d67[_0xfee06b(0x1cb)](0x0)[_0xfee06b(0x1e3)]()+_0x684d67['slice'](0x1)[_0xfee06b(0x1e4)]())[_0xfee06b(0x1fd)]('\x20');}static[a80_0xd8c56c(0x1f7)](_0x37d030,_0x3f58e7,_0x480c69){const _0x2e854a=a80_0xd8c56c,_0x1a9ea5=this[_0x2e854a(0x1ce)](_0x3f58e7),_0x25cdba=this[_0x2e854a(0x1d5)](_0x3f58e7),_0x5a1fce=new Date(),_0x2a98cd=_0x5a1fce[_0x2e854a(0x200)](undefined,{'year':_0x2e854a(0x1ca),'month':_0x2e854a(0x1f5),'day':_0x2e854a(0x1f5),'hour':_0x2e854a(0x1f5),'minute':_0x2e854a(0x1f5),'second':_0x2e854a(0x1f5),'hour12':![]})[_0x2e854a(0x201)](/\//g,'-'),_0x59f9a9=_0x5a1fce[_0x2e854a(0x1c2)](undefined,{'year':_0x2e854a(0x1ca),'month':'2-digit','day':'2-digit'})[_0x2e854a(0x201)](/\//g,'-'),_0x2d08c3=_0x5a1fce[_0x2e854a(0x1de)](undefined,{'hour12':![]});let _0x522602=_0x37d030[_0x2e854a(0x201)](/\{CliVersion\}/g,CLI_VERSION)[_0x2e854a(0x201)](/\{ComponentName\}/g,_0x1a9ea5)[_0x2e854a(0x201)](/\{DisplayTitle\}/g,_0x25cdba)['replace'](/\{PageName\}/g,_0x3f58e7)[_0x2e854a(0x201)](/\{TemplateName\}/g,_0x480c69)[_0x2e854a(0x201)](/\{CreatedAt\}/g,_0x2a98cd)[_0x2e854a(0x201)](/\{CreatedDate\}/g,_0x59f9a9)[_0x2e854a(0x201)](/\{CreatedTime\}/g,_0x2d08c3);return _0x522602;}static[a80_0xd8c56c(0x1fa)](_0x272d94,_0x264d95,_0x3d6250,_0x3e8f89,_0x5aaab2,_0x4243f8,_0x596aca){const _0x5218ea=a80_0xd8c56c,_0x2629c2=new Date(),_0xcafd5d=_0x2629c2[_0x5218ea(0x1d6)](),_0x5b6df3=_0x3d6250['map'](_0x238967=>{const _0x2eedf0=_0x5218ea,_0x352bf0=[_0x2eedf0(0x1f2)+_0x238967['datasetCode']+'\x22','tableName:\x20\x22'+_0x238967['tableName']+'\x22',_0x2eedf0(0x1c9)+_0x238967[_0x2eedf0(0x1e7)]+'\x22'];return _0x238967['alias']&&_0x352bf0['push'](_0x2eedf0(0x1df)+_0x238967[_0x2eedf0(0x1e9)]+'\x22'),_0x2eedf0(0x1c4)+_0x352bf0[_0x2eedf0(0x1fd)](',\x20')+'\x20},';})[_0x5218ea(0x1fd)](''),_0x3d4f0d=_0x3e8f89||_0x3d6250[0x0]?.[_0x5218ea(0x1e9)]||_0x5218ea(0x1dc);let _0x3b1d90=_0x272d94['replace'](/\{AppCode\}/g,_0x264d95)[_0x5218ea(0x201)](/\{ModelConfigs\}/g,_0x5b6df3)['replace'](/\{ExampleModelName\}/g,_0x3d4f0d)['replace'](/\{ApiFileName\}/g,_0x5aaab2||_0x5218ea(0x1f6))[_0x5218ea(0x201)](/\{ConfigName\}/g,_0x4243f8||_0x5218ea(0x202))[_0x5218ea(0x201)](/\{ClientConfigParam\}/g,_0x596aca||'')[_0x5218ea(0x201)](/\{CreatedAt\}/g,_0xcafd5d);return _0x3b1d90;}static async[a80_0xd8c56c(0x1ed)](_0x352867,_0x25829d,_0x429551,_0x5edf8d,_0x5c644a=!![]){const _0x2541b7=a80_0xd8c56c,_0x501429=Date[_0x2541b7(0x1dd)]();try{_0x5c644a&&logger[_0x2541b7(0x1c5)](_0x2541b7(0x1d9),_0x2541b7(0x1f3),{'templatePath':_0x352867,'targetPath':_0x25829d,'pageName':_0x429551,'templateName':_0x5edf8d});await a80_0x29dc86[_0x2541b7(0x1e6)][_0x2541b7(0x1cc)](_0x25829d,{'recursive':!![]}),await this[_0x2541b7(0x1cf)](_0x352867,_0x25829d,_0x429551,_0x5edf8d);if(_0x5c644a){const _0x500977=Date[_0x2541b7(0x1dd)]()-_0x501429;logger[_0x2541b7(0x1d3)](_0x2541b7(0x1d9),_0x2541b7(0x1f0),_0x500977,{'pageName':_0x429551,'templateName':_0x5edf8d});}}catch(_0x158094){if(_0x5c644a){const _0x1fe305=Date[_0x2541b7(0x1dd)]()-_0x501429;logger[_0x2541b7(0x1d4)]('template',_0x2541b7(0x1fe),{'templatePath':_0x352867,'targetPath':_0x25829d,'pageName':_0x429551,'templateName':_0x5edf8d,'error':_0x158094 instanceof Error?_0x158094[_0x2541b7(0x1d7)]:String(_0x158094),'duration':_0x1fe305});}throw _0x158094;}}static async[a80_0xd8c56c(0x1cf)](_0xa877d,_0xd13d6c,_0x46e39a,_0x2bbfcd){const _0xe33d3e=a80_0xd8c56c,_0x59d49f=await a80_0x29dc86['promises'][_0xe33d3e(0x1d0)](_0xa877d,{'withFileTypes':!![]});for(const _0x5dd3ef of _0x59d49f){const _0x14795c=a80_0xe32134['join'](_0xa877d,_0x5dd3ef[_0xe33d3e(0x1e7)]);let _0x30c6d5=a80_0xe32134['join'](_0xd13d6c,_0x5dd3ef[_0xe33d3e(0x1e7)]);_0x5dd3ef['name'][_0xe33d3e(0x1db)](_0xe33d3e(0x1c0))&&(_0x30c6d5=a80_0xe32134['join'](_0xd13d6c,_0x5dd3ef[_0xe33d3e(0x1e7)]['replace'](/\.tpl$/,'')));if(_0x5dd3ef[_0xe33d3e(0x1ee)]())await a80_0x29dc86[_0xe33d3e(0x1e6)][_0xe33d3e(0x1cc)](_0x30c6d5,{'recursive':!![]}),await this['processDirectory'](_0x14795c,_0x30c6d5,_0x46e39a,_0x2bbfcd);else _0x5dd3ef['isFile']()&&await this[_0xe33d3e(0x1c8)](_0x14795c,_0x30c6d5,_0x46e39a,_0x2bbfcd);}}static async['processFile'](_0x34bc41,_0xc6af28,_0x1e13c8,_0x3eef98){const _0x1750fe=a80_0xd8c56c,_0xbc3475=a80_0xe32134['extname'](_0x34bc41)[_0x1750fe(0x1e4)]();_0x34bc41[_0x1750fe(0x1db)]('.tpl')&&(_0xc6af28=_0xc6af28[_0x1750fe(0x201)](/\.tpl$/,''));const _0x325be8=[_0x1750fe(0x1ec),_0x1750fe(0x1bf),'.jsx',_0x1750fe(0x1eb),_0x1750fe(0x1c7),_0x1750fe(0x1ef),_0x1750fe(0x1ff),_0x1750fe(0x1f8),'.tpl'];if(_0x325be8[_0x1750fe(0x1d1)](_0xbc3475)||_0x34bc41[_0x1750fe(0x1db)](_0x1750fe(0x1c0))){const _0x41aabb=await a80_0x29dc86[_0x1750fe(0x1e6)][_0x1750fe(0x1f1)](_0x34bc41,_0x1750fe(0x1c6)),_0x1d9b01=this[_0x1750fe(0x1f7)](_0x41aabb,_0x1e13c8,_0x3eef98);await a80_0x29dc86['promises']['writeFile'](_0xc6af28,_0x1d9b01,_0x1750fe(0x1c6));}else await a80_0x29dc86[_0x1750fe(0x1e6)][_0x1750fe(0x1c1)](_0x34bc41,_0xc6af28);}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/cli",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "bin": {
6
6
  "lovrabet": "lib/cli.js"