@lovrabet/cli 1.3.1 → 1.3.2-beta.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.
- 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/ai-setup/AISetupUI.js +1 -1
- package/lib/ai-setup/config.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/use-get-online-menu-list.js +1 -1
- package/lib/app-menu/utils.js +1 -1
- package/lib/app-menu/valid-url.js +1 -1
- package/lib/app-menu-update-cdn/current-content.js +1 -1
- package/lib/app-menu-update-cdn/input-cdn-asset.js +1 -1
- package/lib/app-menu-update-cdn/main.js +1 -1
- package/lib/app-menu-update-cdn/update-menu-cdn-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-flags.js +1 -0
- 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/non-interactive.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/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/SkillInstallUI.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/skill-install-non-interactive.js +1 -1
- package/lib/skills/skill-installer.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.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/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a78_0x43fa7f=a78_0x2afc;function a78_0x2afc(_0x157fc8,_0x415deb){_0x157fc8=_0x157fc8-0x1c4;const _0x116a2e=a78_0x116a();let _0x2afc71=_0x116a2e[_0x157fc8];return _0x2afc71;}(function(_0x23c83c,_0x20a4ff){const _0x579267=a78_0x2afc,_0x1190ce=_0x23c83c();while(!![]){try{const _0xd643ac=-parseInt(_0x579267(0x1d2))/0x1*(parseInt(_0x579267(0x1f2))/0x2)+parseInt(_0x579267(0x1f5))/0x3+parseInt(_0x579267(0x1d9))/0x4*(parseInt(_0x579267(0x1e6))/0x5)+parseInt(_0x579267(0x1e9))/0x6*(parseInt(_0x579267(0x1e4))/0x7)+-parseInt(_0x579267(0x1ec))/0x8+-parseInt(_0x579267(0x1e5))/0x9+-parseInt(_0x579267(0x1c6))/0xa*(-parseInt(_0x579267(0x1dd))/0xb);if(_0xd643ac===_0x20a4ff)break;else _0x1190ce['push'](_0x1190ce['shift']());}catch(_0xe1f4ba){_0x1190ce['push'](_0x1190ce['shift']());}}}(a78_0x116a,0x51bdb));import a78_0x7a6235 from'node:fs';import a78_0x565699 from'node:path';import{logger}from'./logger.js';function a78_0x116a(){const _0x469d2b=['addImport','121270WbHDmB','toComponentName','indexOf','map','import\x20','未找到路由配置的\x20children\x20数组','length','addPageRoute','split','\x20from\x20\x22../pages/','charAt','index','427cJCLkr','toLowerCase','success','now','src','\x20/>,\x0a\x20\x20\x20\x20\x20\x20\x20\x20},','match','112YDMKOv','\x22,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20element:\x20<','message','路由配置更新完成','99kYpHOR','路由文件不存在:\x20','routerFilePath','index.tsx','error','readFile','writeFile','38990mZgBnC','4251798tmhyvM','39970TBRzvG','路由配置更新失败','promises','690dKwvMr','router','addRoute','4040504nUzfko','join','existsSync','path:\x20\x22','lastIndexOf','slice','602BdTMpv','\x20\x20\x20\x20\x20\x20\x20\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20path:\x20\x22','toUpperCase','1401894plEmoz','includes','utf8'];a78_0x116a=function(){return _0x469d2b;};return a78_0x116a();}export class RouterUpdater{[a78_0x43fa7f(0x1df)];constructor(_0x9bedf7){const _0x207c9f=a78_0x43fa7f;this[_0x207c9f(0x1df)]=a78_0x565699[_0x207c9f(0x1ed)](_0x9bedf7,_0x207c9f(0x1d6),_0x207c9f(0x1ea),_0x207c9f(0x1e0));}async[a78_0x43fa7f(0x1cd)](_0x31a666,_0x3c1dac){const _0x168f4f=a78_0x43fa7f;if(!a78_0x7a6235[_0x168f4f(0x1ee)](this[_0x168f4f(0x1df)]))throw new Error(_0x168f4f(0x1de)+this[_0x168f4f(0x1df)]);const _0x535eb4=Date[_0x168f4f(0x1d5)]();logger['info'](_0x168f4f(0x1ea),'开始更新路由配置',{'pageName':_0x31a666,'routePath':_0x3c1dac,'file':this[_0x168f4f(0x1df)]});try{const _0x3d94dc=await a78_0x7a6235['promises']['readFile'](this['routerFilePath'],_0x168f4f(0x1c4)),_0x5923bc=this['toComponentName'](_0x31a666),_0x3c706a=this['addImport'](_0x3d94dc,_0x5923bc,_0x31a666),_0x458062=this[_0x168f4f(0x1eb)](_0x3c706a,_0x3c1dac,_0x5923bc);await a78_0x7a6235[_0x168f4f(0x1e8)][_0x168f4f(0x1e3)](this[_0x168f4f(0x1df)],_0x458062,_0x168f4f(0x1c4));const _0x471df0=Date['now']()-_0x535eb4;logger[_0x168f4f(0x1d4)]('router',_0x168f4f(0x1dc),_0x471df0,{'pageName':_0x31a666,'routePath':_0x3c1dac,'componentName':_0x5923bc});}catch(_0xbd83c0){const _0x32b7d7=Date['now']()-_0x535eb4;logger[_0x168f4f(0x1e1)]('router',_0x168f4f(0x1e7),{'pageName':_0x31a666,'routePath':_0x3c1dac,'error':_0xbd83c0 instanceof Error?_0xbd83c0[_0x168f4f(0x1db)]:String(_0xbd83c0),'duration':_0x32b7d7});throw _0xbd83c0;}}[a78_0x43fa7f(0x1c7)](_0x591bda){const _0x3a2544=a78_0x43fa7f;return _0x591bda[_0x3a2544(0x1ce)]('-')[_0x3a2544(0x1c9)](_0x322eef=>_0x322eef[_0x3a2544(0x1d0)](0x0)[_0x3a2544(0x1f4)]()+_0x322eef[_0x3a2544(0x1f1)](0x1)[_0x3a2544(0x1d3)]())[_0x3a2544(0x1ed)]('');}['addImport'](_0x210876,_0x387edd,_0x570082){const _0x1b8cfa=a78_0x43fa7f,_0x35c0ee=/import\s+\w+\s+from\s+["']\.\.\/pages\/\w+["'];?\n/g,_0x45378a=_0x210876[_0x1b8cfa(0x1d8)](_0x35c0ee)||[],_0x5c936d=_0x1b8cfa(0x1ca)+_0x387edd+_0x1b8cfa(0x1cf)+_0x570082+'\x22;';if(_0x210876[_0x1b8cfa(0x1f6)](_0x5c936d))return _0x210876;if(_0x45378a['length']>0x0){const _0x2fd22a=_0x45378a[_0x45378a[_0x1b8cfa(0x1cc)]-0x1];if(_0x2fd22a){const _0x331bed=_0x210876[_0x1b8cfa(0x1f0)](_0x2fd22a),_0x38b087=_0x331bed+_0x2fd22a[_0x1b8cfa(0x1cc)];return _0x210876[_0x1b8cfa(0x1f1)](0x0,_0x38b087)+_0x5c936d+'\x0a'+_0x210876[_0x1b8cfa(0x1f1)](_0x38b087);}}const _0x5b87fe=_0x210876[_0x1b8cfa(0x1d8)](/import\s+\w+\s+from\s+["']\.\.\/layouts\/\w+["'];?\n/);if(_0x5b87fe&&_0x5b87fe[_0x1b8cfa(0x1d1)]!==undefined){const _0x492ede=_0x5b87fe[_0x1b8cfa(0x1d1)]+_0x5b87fe[0x0][_0x1b8cfa(0x1cc)];return _0x210876['slice'](0x0,_0x492ede)+_0x5c936d+'\x0a'+_0x210876[_0x1b8cfa(0x1f1)](_0x492ede);}return _0x210876;}[a78_0x43fa7f(0x1eb)](_0x43fc50,_0x593334,_0x501dd0){const _0x181c17=a78_0x43fa7f,_0x5b1180=_0x181c17(0x1f3)+_0x593334+_0x181c17(0x1da)+_0x501dd0+_0x181c17(0x1d7);if(_0x43fc50['includes'](_0x181c17(0x1ef)+_0x593334+'\x22'))return _0x43fc50;const _0x177651=/children:\s*\[([\s\S]*?)\]/,_0x5b4945=_0x43fc50['match'](_0x177651);if(!_0x5b4945||_0x5b4945[_0x181c17(0x1d1)]===undefined)throw new Error(_0x181c17(0x1cb));const _0x476140=_0x5b4945[0x1],_0x58831b=_0x5b4945[_0x181c17(0x1d1)]+_0x5b4945[0x0][_0x181c17(0x1c8)]('[')+0x1,_0x14af25=_0x476140?.[_0x181c17(0x1d8)](/\{[\s\S]*?\},/g)||[];if(_0x14af25[_0x181c17(0x1cc)]>0x0){const _0x4fcbd2=_0x14af25[_0x14af25[_0x181c17(0x1cc)]-0x1];if(_0x4fcbd2){const _0x135e87=_0x43fc50[_0x181c17(0x1f0)](_0x4fcbd2),_0x557533=_0x135e87+_0x4fcbd2[_0x181c17(0x1cc)];return _0x43fc50[_0x181c17(0x1f1)](0x0,_0x557533)+'\x0a'+_0x5b1180+_0x43fc50[_0x181c17(0x1f1)](_0x557533);}}return _0x43fc50[_0x181c17(0x1f1)](0x0,_0x58831b)+'\x0a'+_0x5b1180+_0x43fc50[_0x181c17(0x1f1)](_0x58831b);}async['previewChanges'](_0x2dae28,_0x452f91){const _0x53d78a=a78_0x43fa7f;if(!a78_0x7a6235[_0x53d78a(0x1ee)](this[_0x53d78a(0x1df)]))throw new Error(_0x53d78a(0x1de)+this[_0x53d78a(0x1df)]);const _0xdbd613=await a78_0x7a6235['promises'][_0x53d78a(0x1e2)](this[_0x53d78a(0x1df)],_0x53d78a(0x1c4)),_0x2f6ae7=this[_0x53d78a(0x1c7)](_0x2dae28);let _0x2a7a08=this[_0x53d78a(0x1c5)](_0xdbd613,_0x2f6ae7,_0x2dae28);return _0x2a7a08=this[_0x53d78a(0x1eb)](_0x2a7a08,_0x452f91,_0x2f6ae7),_0x2a7a08;}}
|
package/lib/utils/rules-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a79_0x5b31f7=a79_0x4326;(function(_0x421da8,_0x19dcf1){const _0x57d546=a79_0x4326,_0xfc3952=_0x421da8();while(!![]){try{const _0x1b195d=-parseInt(_0x57d546(0xc2))/0x1+-parseInt(_0x57d546(0xba))/0x2*(parseInt(_0x57d546(0xd0))/0x3)+parseInt(_0x57d546(0xc4))/0x4*(parseInt(_0x57d546(0xcd))/0x5)+parseInt(_0x57d546(0xd2))/0x6+-parseInt(_0x57d546(0xbb))/0x7+parseInt(_0x57d546(0xbf))/0x8+-parseInt(_0x57d546(0xcf))/0x9*(-parseInt(_0x57d546(0xc6))/0xa);if(_0x1b195d===_0x19dcf1)break;else _0xfc3952['push'](_0xfc3952['shift']());}catch(_0x30caca){_0xfc3952['push'](_0xfc3952['shift']());}}}(a79_0x2462,0x2ba95));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 _0x52742a=a79_0x4326,_0x5503f6=getTemplateBaseUrl();return _0x5503f6+_0x52742a(0xcb);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a79_0x5b31f7(0xc1));export async function fetchRulesFromCDN(){const _0x3be81c=a79_0x5b31f7,_0x31ad6b=getRulesCdnUrl(),_0x49ab7d=await fetch(_0x31ad6b,{'headers':{'Accept':'application/json'}});if(!_0x49ab7d['ok'])throw new Error(_0x3be81c(0xc3)+_0x49ab7d[_0x3be81c(0xce)]+'\x20'+_0x49ab7d[_0x3be81c(0xbc)]);const _0x2d2b4e=await _0x49ab7d[_0x3be81c(0xcc)]();if(!_0x2d2b4e[_0x3be81c(0xca)]||typeof _0x2d2b4e[_0x3be81c(0xca)]!=='string')throw new Error(_0x3be81c(0xc7));return _0x2d2b4e;}export async function getRulesContent(){try{const _0x4e0ef2=await fetchRulesFromCDN();return _0x4e0ef2['content'];}catch{return readLocalTemplate();}}function a79_0x2462(){const _0x344054=['/rules/rules.json','json','67370BmRGqO','status','9qXCNxw','1275ZAvtFm','lastUpdated','1576572xDARFD','1594AdvWrr','1940687vlwpSw','statusText','utf-8','agents.md','2669424eAbndc','本地模板文件不存在:\x20','../../cdn-source/rules/lovrabet_rules.mdc.tpl','68889yRZhws','CDN\x20请求失败:\x20','4ZBEVQR','.cursor/rules','2537780EtuPyf','CDN\x20返回数据格式错误','catch','lovrabet_rules.mdc','content'];a79_0x2462=function(){return _0x344054;};return a79_0x2462();}function a79_0x4326(_0x163be2,_0x1d09e0){_0x163be2=_0x163be2-0xba;const _0x24626d=a79_0x2462();let _0x43265d=_0x24626d[_0x163be2];return _0x43265d;}export function readLocalTemplate(){const _0x3ad75f=a79_0x5b31f7;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,'utf-8');throw new Error(_0x3ad75f(0xc0)+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x286b1b){const _0x489c37=a79_0x5b31f7,_0x1b6379=await fetchRulesFromCDN()[_0x489c37(0xc8)](()=>null);let _0x44f5e2;_0x1b6379?(_0x44f5e2=_0x1b6379[_0x489c37(0xca)],_0x1b6379[_0x489c37(0xd1)]&&(_0x44f5e2=appendUpdateTime(_0x44f5e2,_0x1b6379['lastUpdated']))):_0x44f5e2=readLocalTemplate();const _0x54ffab=dirname(_0x286b1b);!existsSync(_0x54ffab)&&mkdirSync(_0x54ffab,{'recursive':!![]}),writeFileSync(_0x286b1b,_0x44f5e2,_0x489c37(0xbd));}export async function copyRulesToCursor(_0x99aaf9){const _0x4f3094=a79_0x5b31f7,_0x22bbdf=join(_0x99aaf9,_0x4f3094(0xc5)),_0x5cd255=join(_0x22bbdf,_0x4f3094(0xc9));if(existsSync(_0x5cd255))return![];return await writeRulesFile(_0x5cd255),!![];}export async function copyRulesToAgentsMd(_0x146813){const _0x10157d=a79_0x5b31f7,_0x190b31=join(_0x146813,_0x10157d(0xbe));if(existsSync(_0x190b31))return![];return await writeRulesFile(_0x190b31),!![];}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x2c4f8a){return new Promise(_0x49f98e=>setTimeout(_0x49f98e,_0x2c4f8a));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a81_0x5a92bd=a81_0x58d2;(function(_0x13a964,_0x581a6c){const _0x4c3593=a81_0x58d2,_0x12bda2=_0x13a964();while(!![]){try{const _0x110ca7=parseInt(_0x4c3593(0x152))/0x1*(-parseInt(_0x4c3593(0x170))/0x2)+parseInt(_0x4c3593(0x166))/0x3+-parseInt(_0x4c3593(0x147))/0x4*(parseInt(_0x4c3593(0x153))/0x5)+parseInt(_0x4c3593(0x160))/0x6+-parseInt(_0x4c3593(0x144))/0x7*(parseInt(_0x4c3593(0x14f))/0x8)+-parseInt(_0x4c3593(0x151))/0x9*(-parseInt(_0x4c3593(0x159))/0xa)+parseInt(_0x4c3593(0x16b))/0xb;if(_0x110ca7===_0x581a6c)break;else _0x12bda2['push'](_0x12bda2['shift']());}catch(_0x2b7490){_0x12bda2['push'](_0x12bda2['shift']());}}}(a81_0x10f0,0x284c7));function a81_0x58d2(_0x12bcb5,_0x4e3426){_0x12bcb5=_0x12bcb5-0x144;const _0x10f00c=a81_0x10f0();let _0x58d21b=_0x10f00c[_0x12bcb5];return _0x58d21b;}import a81_0x50e3d5 from'node:fs';import a81_0x5ce98d from'node:path';import{createRequire}from'node:module';function a81_0x10f0(){const _0x1133f0=['toLowerCase','info','pop','name','.jsx','9496LBAhFq','name:\x20\x22','6507UHGAih','47497eqWMjm','25WZpuge','template','YourModel','endsWith','toLocaleDateString','promises','1270AxzzhI','\x0a\x20\x20\x20\x20{\x20','toLocaleTimeString','success','mkdir','.tsx','isDirectory','260826deyPQq','numeric','slice','readFile','now','alias:\x20\x22','707124rZOtZX','模板内容替换完成','processDirectory','push','.tpl','1910205FCJrti','split','.md','toISOString','version','4vZbLRy','map','readdir','charAt','replace','writeFile','../../package.json','includes','default','join','copyFile','\x20},','extname','2-digit','toDisplayTitle','toUpperCase','763OBBupV','.css','replaceContent','124172oKnxLA','alias','模板内容替换失败'];a81_0x10f0=function(){return _0x1133f0;};return a81_0x10f0();}import{logger}from'./logger.js';const require=createRequire(import.meta.url),CLI_VERSION=require(a81_0x5a92bd(0x176))[a81_0x5a92bd(0x16f)];export class TemplateReplacer{static['toComponentName'](_0x27463b){const _0x816ac0=a81_0x5a92bd,_0x5cd0c2=_0x27463b[_0x816ac0(0x16c)]('/')[_0x816ac0(0x14c)]()||_0x27463b;return _0x5cd0c2[_0x816ac0(0x16c)]('-')['map'](_0x2ab6b0=>_0x2ab6b0[_0x816ac0(0x173)](0x0)[_0x816ac0(0x17f)]()+_0x2ab6b0['slice'](0x1)[_0x816ac0(0x14a)]())[_0x816ac0(0x179)]('');}static[a81_0x5a92bd(0x17e)](_0x4f895b){const _0x55a16c=a81_0x5a92bd,_0x2570bc=_0x4f895b[_0x55a16c(0x16c)]('/')[_0x55a16c(0x14c)]()||_0x4f895b;return _0x2570bc[_0x55a16c(0x16c)]('-')[_0x55a16c(0x171)](_0x1e5a58=>_0x1e5a58[_0x55a16c(0x173)](0x0)[_0x55a16c(0x17f)]()+_0x1e5a58[_0x55a16c(0x162)](0x1)[_0x55a16c(0x14a)]())[_0x55a16c(0x179)]('\x20');}static[a81_0x5a92bd(0x146)](_0x106136,_0x410d9f,_0x2c760b){const _0x593620=a81_0x5a92bd,_0x1fbe8d=this['toComponentName'](_0x410d9f),_0xeaac17=this[_0x593620(0x17e)](_0x410d9f),_0x180ea2=new Date(),_0x4debc9=_0x180ea2['toLocaleString'](undefined,{'year':_0x593620(0x161),'month':'2-digit','day':_0x593620(0x17d),'hour':_0x593620(0x17d),'minute':_0x593620(0x17d),'second':'2-digit','hour12':![]})[_0x593620(0x174)](/\//g,'-'),_0x3212b5=_0x180ea2[_0x593620(0x157)](undefined,{'year':'numeric','month':_0x593620(0x17d),'day':_0x593620(0x17d)})[_0x593620(0x174)](/\//g,'-'),_0x174162=_0x180ea2[_0x593620(0x15b)](undefined,{'hour12':![]});let _0x1f4531=_0x106136[_0x593620(0x174)](/\{CliVersion\}/g,CLI_VERSION)[_0x593620(0x174)](/\{ComponentName\}/g,_0x1fbe8d)['replace'](/\{DisplayTitle\}/g,_0xeaac17)[_0x593620(0x174)](/\{PageName\}/g,_0x410d9f)[_0x593620(0x174)](/\{TemplateName\}/g,_0x2c760b)[_0x593620(0x174)](/\{CreatedAt\}/g,_0x4debc9)[_0x593620(0x174)](/\{CreatedDate\}/g,_0x3212b5)[_0x593620(0x174)](/\{CreatedTime\}/g,_0x174162);return _0x1f4531;}static['replaceApiContent'](_0x5f4240,_0x177c29,_0x3698d9,_0x2765ed,_0x37d15f,_0x90822e,_0x3d6504){const _0x2daf08=a81_0x5a92bd,_0x57ba2a=new Date(),_0x53934c=_0x57ba2a[_0x2daf08(0x16e)](),_0x2170f2=_0x3698d9[_0x2daf08(0x171)](_0x3659d4=>{const _0x4795d7=_0x2daf08,_0x16ff2c=['datasetCode:\x20\x22'+_0x3659d4['datasetCode']+'\x22','tableName:\x20\x22'+_0x3659d4['tableName']+'\x22',_0x4795d7(0x150)+_0x3659d4[_0x4795d7(0x14d)]+'\x22'];return _0x3659d4[_0x4795d7(0x148)]&&_0x16ff2c[_0x4795d7(0x169)](_0x4795d7(0x165)+_0x3659d4[_0x4795d7(0x148)]+'\x22'),_0x4795d7(0x15a)+_0x16ff2c['join'](',\x20')+_0x4795d7(0x17b);})['join'](''),_0x584c68=_0x2765ed||_0x3698d9[0x0]?.[_0x2daf08(0x148)]||_0x2daf08(0x155);let _0x1a5d3f=_0x5f4240[_0x2daf08(0x174)](/\{AppCode\}/g,_0x177c29)['replace'](/\{ModelConfigs\}/g,_0x2170f2)[_0x2daf08(0x174)](/\{ExampleModelName\}/g,_0x584c68)[_0x2daf08(0x174)](/\{ApiFileName\}/g,_0x37d15f||'api')[_0x2daf08(0x174)](/\{ConfigName\}/g,_0x90822e||_0x2daf08(0x178))['replace'](/\{ClientConfigParam\}/g,_0x3d6504||'')[_0x2daf08(0x174)](/\{CreatedAt\}/g,_0x53934c);return _0x1a5d3f;}static async['processTemplate'](_0xfe3311,_0x13b0f4,_0xb3da6c,_0x19810c,_0x1a01d4=!![]){const _0x42f7e9=a81_0x5a92bd,_0x11b6c9=Date[_0x42f7e9(0x164)]();try{_0x1a01d4&&logger[_0x42f7e9(0x14b)](_0x42f7e9(0x154),'开始处理模板内容替换',{'templatePath':_0xfe3311,'targetPath':_0x13b0f4,'pageName':_0xb3da6c,'templateName':_0x19810c});await a81_0x50e3d5['promises'][_0x42f7e9(0x15d)](_0x13b0f4,{'recursive':!![]}),await this['processDirectory'](_0xfe3311,_0x13b0f4,_0xb3da6c,_0x19810c);if(_0x1a01d4){const _0x2ca4f2=Date[_0x42f7e9(0x164)]()-_0x11b6c9;logger[_0x42f7e9(0x15c)](_0x42f7e9(0x154),_0x42f7e9(0x167),_0x2ca4f2,{'pageName':_0xb3da6c,'templateName':_0x19810c});}}catch(_0x5d8380){if(_0x1a01d4){const _0x1d8b06=Date['now']()-_0x11b6c9;logger['error'](_0x42f7e9(0x154),_0x42f7e9(0x149),{'templatePath':_0xfe3311,'targetPath':_0x13b0f4,'pageName':_0xb3da6c,'templateName':_0x19810c,'error':_0x5d8380 instanceof Error?_0x5d8380['message']:String(_0x5d8380),'duration':_0x1d8b06});}throw _0x5d8380;}}static async[a81_0x5a92bd(0x168)](_0x261914,_0x403692,_0x44b596,_0x1a0198){const _0x43e0f1=a81_0x5a92bd,_0x300714=await a81_0x50e3d5['promises'][_0x43e0f1(0x172)](_0x261914,{'withFileTypes':!![]});for(const _0x252cab of _0x300714){const _0x50eff1=a81_0x5ce98d[_0x43e0f1(0x179)](_0x261914,_0x252cab[_0x43e0f1(0x14d)]);let _0x542c62=a81_0x5ce98d[_0x43e0f1(0x179)](_0x403692,_0x252cab[_0x43e0f1(0x14d)]);_0x252cab[_0x43e0f1(0x14d)]['endsWith'](_0x43e0f1(0x16a))&&(_0x542c62=a81_0x5ce98d['join'](_0x403692,_0x252cab[_0x43e0f1(0x14d)]['replace'](/\.tpl$/,'')));if(_0x252cab[_0x43e0f1(0x15f)]())await a81_0x50e3d5[_0x43e0f1(0x158)][_0x43e0f1(0x15d)](_0x542c62,{'recursive':!![]}),await this[_0x43e0f1(0x168)](_0x50eff1,_0x542c62,_0x44b596,_0x1a0198);else _0x252cab['isFile']()&&await this['processFile'](_0x50eff1,_0x542c62,_0x44b596,_0x1a0198);}}static async['processFile'](_0x2e00e8,_0x23eaae,_0x29367a,_0x2f6a33){const _0x16caec=a81_0x5a92bd,_0x1e9384=a81_0x5ce98d[_0x16caec(0x17c)](_0x2e00e8)[_0x16caec(0x14a)]();_0x2e00e8[_0x16caec(0x156)](_0x16caec(0x16a))&&(_0x23eaae=_0x23eaae[_0x16caec(0x174)](/\.tpl$/,''));const _0x5bcd0c=[_0x16caec(0x15e),'.ts',_0x16caec(0x14e),'.js','.json',_0x16caec(0x16d),_0x16caec(0x145),'.scss',_0x16caec(0x16a)];if(_0x5bcd0c[_0x16caec(0x177)](_0x1e9384)||_0x2e00e8[_0x16caec(0x156)]('.tpl')){const _0x809c1b=await a81_0x50e3d5[_0x16caec(0x158)][_0x16caec(0x163)](_0x2e00e8,'utf8'),_0x35842b=this[_0x16caec(0x146)](_0x809c1b,_0x29367a,_0x2f6a33);await a81_0x50e3d5['promises'][_0x16caec(0x175)](_0x23eaae,_0x35842b,'utf8');}else await a81_0x50e3d5[_0x16caec(0x158)][_0x16caec(0x17a)](_0x2e00e8,_0x23eaae);}}
|