@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.
- 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.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
package/lib/utils/rules-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
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),!![];}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x3a7831){return new Promise(_0x3c6384=>setTimeout(_0x3c6384,_0x3a7831));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
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);}}
|