@lovrabet/rabetbase-cli 2.0.2-beta.6 → 2.0.2-beta.7
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/ai-setup/config.js +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.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/get-session-user.js +1 -0
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/doc.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/app.js +1 -1
- package/lib/commands/auth.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/new.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/build.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/config.js +1 -1
- package/lib/commands/create.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/logout.js +1 -1
- package/lib/commands/logs.js +1 -1
- package/lib/commands/mcp.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/preview.js +1 -1
- package/lib/commands/project-upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run.js +1 -1
- package/lib/commands/skill.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sql-validator.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/errors.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/generated/build-info.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/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -0
- package/lib/telemetry/otel-logger-version.js +1 -0
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -0
- 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/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a79_0x4d96(){const _0x3a1f35=['beforeScriptId','functionNode','push','780MKFWEs','HOOK/','endsWith','operationType','.js','before','map','1634725tSrSwT','split','set','106788QqkmtB','HOOK','functionName','2553026QTPUph','scriptsRootDir','name','ENOENT','datasetCode','isDirectory','315124OmAfnx','652092bsaYOv','afterScriptId','replace','code','all','get','COMMON','1480899hRRkog','includes','ENDPOINT','toUpperCase','F_OK','alias','after'];a79_0x4d96=function(){return _0x3a1f35;};return a79_0x4d96();}const a79_0x3c2bef=a79_0x367a;(function(_0x2ed49c,_0x161a78){const _0x32e17d=a79_0x367a,_0x576147=_0x2ed49c();while(!![]){try{const _0x29e1a4=parseInt(_0x32e17d(0xd8))/0x1+parseInt(_0x32e17d(0xc5))/0x2+parseInt(_0x32e17d(0xbb))/0x3+parseInt(_0x32e17d(0xcf))/0x4+-parseInt(_0x32e17d(0xcc))/0x5+parseInt(_0x32e17d(0xd9))/0x6+-parseInt(_0x32e17d(0xd2))/0x7;if(_0x29e1a4===_0x161a78)break;else _0x576147['push'](_0x576147['shift']());}catch(_0x201c75){_0x576147['push'](_0x576147['shift']());}}}(a79_0x4d96,0x3dbbf));import{access,mkdir,readdir,stat}from'node:fs/promises';import{constants}from'node:fs';import{dirname,join}from'node:path';import{findHookLocationByRemoteId,snakeToCamel}from'./utils.js';function a79_0x367a(_0x416327,_0x537ec3){_0x416327=_0x416327-0xbb;const _0x4d9606=a79_0x4d96();let _0x367ae7=_0x4d9606[_0x416327];return _0x367ae7;}export const SUPPORTED_BFF_TYPES=[a79_0x3c2bef(0xdf),a79_0x3c2bef(0xbd),a79_0x3c2bef(0xd0)];export function normalizeBffType(_0x4c388b){const _0xf7c6de=a79_0x3c2bef;if(!_0x4c388b)return undefined;const _0x56b1eb=_0x4c388b['trim']()[_0xf7c6de(0xbe)]();return SUPPORTED_BFF_TYPES[_0xf7c6de(0xbc)](_0x56b1eb)?_0x56b1eb:undefined;}async function scanJsFilesRecursively(_0x179c03,_0x19ebdd){const _0x551da2=a79_0x3c2bef,_0x47b2a9=[];try{const _0x434ba0=await readdir(_0x179c03,{'withFileTypes':!![]});for(const _0x2070a2 of _0x434ba0){const _0x5efb4c=join(_0x179c03,_0x2070a2[_0x551da2(0xd4)]);if(_0x2070a2['isDirectory']())_0x47b2a9[_0x551da2(0xc4)](...await scanJsFilesRecursively(_0x5efb4c,_0x19ebdd+'/'+_0x2070a2[_0x551da2(0xd4)]));else _0x2070a2['isFile']()&&_0x2070a2[_0x551da2(0xd4)][_0x551da2(0xc7)]('.js')&&_0x47b2a9[_0x551da2(0xc4)]({'lockKey':_0x19ebdd+'/'+_0x2070a2['name'][_0x551da2(0xdb)](/\.js$/,''),'filePath':_0x5efb4c});}}catch(_0x6242c4){if(_0x6242c4[_0x551da2(0xdc)]!=='ENOENT')throw _0x6242c4;}return _0x47b2a9;}async function scanFlatFunctions(_0x5e5512,_0x510b26){const _0x1f1d0f=a79_0x3c2bef,_0x36ba54=join(_0x5e5512[_0x1f1d0f(0xd3)],_0x510b26),_0x347408=await scanJsFilesRecursively(_0x36ba54,_0x510b26);return _0x347408[_0x1f1d0f(0xcb)](({lockKey:_0x576f93,filePath:_0x1347c7})=>({'type':_0x510b26,'name':_0x576f93[_0x1f1d0f(0xcd)]('/')['at'](-0x1)??'','filePath':_0x1347c7,'lockKey':_0x576f93}));}async function scanHookFunctions(_0x17f848){const _0x3b60e1=a79_0x3c2bef,_0x1f1004=join(_0x17f848[_0x3b60e1(0xd3)],'HOOK'),_0x38d06c=[];try{const _0x1767b0=await readdir(_0x1f1004,{'withFileTypes':!![]});for(const _0x1c8764 of _0x1767b0){if(!_0x1c8764[_0x3b60e1(0xd7)]())continue;const _0x2b83af=_0x1c8764[_0x3b60e1(0xd4)],_0x4b06ef=join(_0x1f1004,_0x2b83af),_0x15201d=await readdir(_0x4b06ef,{'withFileTypes':!![]});for(const _0x33348f of _0x15201d){if(!_0x33348f[_0x3b60e1(0xd7)]())continue;const _0x21ec13=_0x33348f[_0x3b60e1(0xd4)],_0x2a1f35=join(_0x4b06ef,_0x21ec13),_0x223672=await readdir(_0x2a1f35,{'withFileTypes':!![]});for(const _0x3853cd of _0x223672){if(!_0x3853cd[_0x3b60e1(0xd7)]())continue;const _0x52da0d=_0x3853cd[_0x3b60e1(0xd4)],_0x31b66d=join(_0x2a1f35,_0x52da0d),_0x45b4c5=await readdir(_0x31b66d,{'withFileTypes':!![]});for(const _0x41a35b of _0x45b4c5){if(!_0x41a35b['isFile']()||!_0x41a35b[_0x3b60e1(0xd4)][_0x3b60e1(0xc7)](_0x3b60e1(0xc9)))continue;const _0x495291=_0x41a35b[_0x3b60e1(0xd4)][_0x3b60e1(0xdb)](/\.js$/,'');_0x38d06c['push']({'type':'HOOK','name':_0x495291,'filePath':join(_0x31b66d,_0x41a35b[_0x3b60e1(0xd4)]),'lockKey':_0x3b60e1(0xc6)+_0x2b83af+'/'+_0x21ec13+'/'+_0x52da0d+'/'+_0x495291,'alias':_0x2b83af,'operationType':_0x21ec13,'functionNode':_0x52da0d});}}}}}catch(_0x265ef5){if(_0x265ef5['code']!==_0x3b60e1(0xd5))throw _0x265ef5;}return _0x38d06c;}export async function scanLocalBffFunctions(_0x7b22dd,_0x59823a){const _0x39b518=a79_0x3c2bef;if(_0x59823a===_0x39b518(0xdf)||_0x59823a==='ENDPOINT')return scanFlatFunctions(_0x7b22dd,_0x59823a);if(_0x59823a===_0x39b518(0xd0))return scanHookFunctions(_0x7b22dd);const [_0x477c95,_0x54d195,_0xa841d7]=await Promise[_0x39b518(0xdd)]([scanFlatFunctions(_0x7b22dd,'COMMON'),scanFlatFunctions(_0x7b22dd,_0x39b518(0xbd)),scanHookFunctions(_0x7b22dd)]);return[..._0x477c95,..._0x54d195,..._0xa841d7];}export function resolveLocalFilePathFromLockKey(_0x2b09ec,_0x374578){const _0x14f5b7=a79_0x3c2bef;return join(_0x2b09ec[_0x14f5b7(0xd3)],..._0x374578['split']('/'))+_0x14f5b7(0xc9);}export function createHookLocationMap(_0x44d0f0){const _0x1eaf5d=a79_0x3c2bef,_0x7fc5f1=new Map();for(const _0x190428 of _0x44d0f0){_0x190428[_0x1eaf5d(0xc2)]&&_0x7fc5f1[_0x1eaf5d(0xce)](_0x190428[_0x1eaf5d(0xc2)],{'datasetCode':_0x190428[_0x1eaf5d(0xd6)],'operationType':snakeToCamel(_0x190428[_0x1eaf5d(0xc8)]),'functionNode':_0x1eaf5d(0xca)}),_0x190428[_0x1eaf5d(0xda)]&&_0x7fc5f1[_0x1eaf5d(0xce)](_0x190428[_0x1eaf5d(0xda)],{'datasetCode':_0x190428['datasetCode'],'operationType':snakeToCamel(_0x190428[_0x1eaf5d(0xc8)]),'functionNode':_0x1eaf5d(0xc1)});}return _0x7fc5f1;}export function resolveRemoteScriptTarget(_0x7ccad6,_0x272b38,_0x3f7ef4,_0x8eb6e4,_0x468e82){const _0x1adb98=a79_0x3c2bef,_0x2bd219=normalizeBffType(_0x272b38['scriptType']);if(!_0x2bd219||!_0x272b38[_0x1adb98(0xd1)])return null;if(_0x2bd219===_0x1adb98(0xd0)){const _0x29a8a3=(_0x272b38['id']?_0x3f7ef4[_0x1adb98(0xde)](_0x272b38['id']):undefined)??findHookLocationByRemoteId(_0x8eb6e4,_0x272b38['id']);if(!_0x29a8a3)return null;const _0x4f2612=_0x29a8a3[_0x1adb98(0xc0)]||_0x468e82[_0x1adb98(0xde)](_0x29a8a3[_0x1adb98(0xd6)]),_0x58dc3f=_0x4f2612??_0x29a8a3[_0x1adb98(0xd6)],_0x5cc291={..._0x29a8a3,'alias':_0x4f2612},_0x785e23=_0x1adb98(0xc6)+_0x58dc3f+'/'+_0x5cc291[_0x1adb98(0xc8)]+'/'+_0x5cc291[_0x1adb98(0xc3)]+'/'+_0x272b38[_0x1adb98(0xd1)];return{'lockKey':_0x785e23,'filePath':resolveLocalFilePathFromLockKey(_0x7ccad6,_0x785e23),'type':'HOOK','hookLocation':_0x5cc291};}const _0x3683c4=_0x2bd219+'/'+_0x272b38['functionName'];return{'lockKey':_0x3683c4,'filePath':resolveLocalFilePathFromLockKey(_0x7ccad6,_0x3683c4),'type':_0x2bd219};}export async function ensureParentDirectory(_0xf18d77){await mkdir(dirname(_0xf18d77),{'recursive':!![]});}export async function fileExists(_0x54d6c5){const _0x2a5fd4=a79_0x3c2bef;try{return await access(_0x54d6c5,constants[_0x2a5fd4(0xbf)]),!![];}catch{return![];}}export async function directoryExists(_0x56bac6){const _0x5361b1=a79_0x3c2bef;try{const _0x1b31c5=await stat(_0x56bac6);return _0x1b31c5[_0x5361b1(0xd7)]();}catch{return![];}}
|
package/lib/core/bff/hash.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3189c5,_0x44578e){const _0x2c36c8=a80_0x461a,_0x5a8554=_0x3189c5();while(!![]){try{const _0x31efee=parseInt(_0x2c36c8(0xfd))/0x1*(-parseInt(_0x2c36c8(0xfe))/0x2)+-parseInt(_0x2c36c8(0x103))/0x3*(-parseInt(_0x2c36c8(0xfc))/0x4)+parseInt(_0x2c36c8(0xff))/0x5+parseInt(_0x2c36c8(0xf9))/0x6+parseInt(_0x2c36c8(0xfb))/0x7*(-parseInt(_0x2c36c8(0x104))/0x8)+-parseInt(_0x2c36c8(0x102))/0x9+parseInt(_0x2c36c8(0x105))/0xa*(parseInt(_0x2c36c8(0x100))/0xb);if(_0x31efee===_0x44578e)break;else _0x5a8554['push'](_0x5a8554['shift']());}catch(_0x47b14b){_0x5a8554['push'](_0x5a8554['shift']());}}}(a80_0x12f7,0x248c1));import{readFile}from'node:fs/promises';import a80_0x372bf2 from'node:crypto';export function computeContentHash(_0x20e40d){const _0x30a478=a80_0x461a;return a80_0x372bf2['createHash'](_0x30a478(0x106))[_0x30a478(0xfa)](_0x20e40d)[_0x30a478(0x101)](_0x30a478(0xf8));}export async function computeFileHash(_0x5dddea){const _0x3b0ee5=await readFile(_0x5dddea,'utf8');return computeContentHash(_0x3b0ee5);}function a80_0x461a(_0x1500e6,_0x7139c1){_0x1500e6=_0x1500e6-0xf8;const _0x12f7c1=a80_0x12f7();let _0x461a77=_0x12f7c1[_0x1500e6];return _0x461a77;}function a80_0x12f7(){const _0x2041e1=['5290lsVHYZ','323805VuSEix','5756201hsDcKe','digest','223866vbuJGu','111JFLrWh','136zMtafz','10nXbUhp','md5','hex','34122vfuQMx','update','102431PTKsHi','11316OhPAJz','104qgroIo'];a80_0x12f7=function(){return _0x2041e1;};return a80_0x12f7();}
|
package/lib/core/bff/lock.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x46710d,_0x1e2abc){const _0x1943d0=a81_0x1fcd,_0x1d2b82=_0x46710d();while(!![]){try{const _0x2cada5=-parseInt(_0x1943d0(0x85))/0x1*(-parseInt(_0x1943d0(0x7d))/0x2)+-parseInt(_0x1943d0(0x78))/0x3+parseInt(_0x1943d0(0x6c))/0x4*(-parseInt(_0x1943d0(0x6e))/0x5)+parseInt(_0x1943d0(0x7b))/0x6+-parseInt(_0x1943d0(0x7c))/0x7+-parseInt(_0x1943d0(0x84))/0x8+-parseInt(_0x1943d0(0x82))/0x9;if(_0x2cada5===_0x1e2abc)break;else _0x1d2b82['push'](_0x1d2b82['shift']());}catch(_0x43b616){_0x1d2b82['push'](_0x1d2b82['shift']());}}}(a81_0x503b,0x957cc));function a81_0x503b(){const _0x5e282f=['lastSync','utf8','parse','aliases','ENOENT','current\x20\x22','Failed\x20to\x20read\x20BFF\x20lock\x20file:\x20','functions','2039457LjQItb','\x22.\x20','object','6890022meDaXq','4312077ukFcZh','14gYbxSX','default','meta','scriptsRoot','Check\x20.rabetbase/bff.lock.json\x20or\x20operate\x20from\x20the\x20correct\x20project\x20directory.','779985clMynD','appCode','1165296gbuzeD','168325BWNxuw','code','4804tEoqNW','apps','775aGRklq',':\x20scriptsRoot\x20mismatch\x20—\x20'];a81_0x503b=function(){return _0x5e282f;};return a81_0x503b();}import{mkdir,readFile,writeFile}from'node:fs/promises';import{dirname}from'node:path';export function createEmptyBffLock(_0x4a13ef){return{'aliases':_0x4a13ef?{'default':_0x4a13ef}:{},'apps':{}};}function a81_0x1fcd(_0xbc5eec,_0xc3285f){_0xbc5eec=_0xbc5eec-0x6b;const _0x503b05=a81_0x503b();let _0x1fcd9e=_0x503b05[_0xbc5eec];return _0x1fcd9e;}function normalizeLockFile(_0x13486e,_0x45ad99,_0x1ae7e6){const _0x2fda80=a81_0x1fcd;if(_0x2fda80(0x6d)in _0x13486e&&_0x13486e['apps']&&typeof _0x13486e[_0x2fda80(0x6d)]===_0x2fda80(0x7a))return(!_0x13486e[_0x2fda80(0x73)]||typeof _0x13486e['aliases']!==_0x2fda80(0x7a))&&(_0x13486e[_0x2fda80(0x73)]={}),!_0x13486e['aliases'][_0x2fda80(0x7e)]&&(_0x13486e[_0x2fda80(0x73)][_0x2fda80(0x7e)]=_0x45ad99),_0x13486e;const _0x2bd997=_0x13486e,_0x27b570=_0x2bd997[_0x2fda80(0x7f)]?.[_0x2fda80(0x83)]?.['trim']()||_0x45ad99,_0x1077ef=_0x2bd997[_0x2fda80(0x7f)]?.['scriptsRoot']?.['trim']()||_0x1ae7e6;return{'aliases':{'default':_0x27b570},'apps':{[_0x27b570]:{'scriptsRoot':_0x1077ef,'lastSync':_0x2bd997[_0x2fda80(0x70)]||'','functions':_0x2bd997[_0x2fda80(0x77)]||{}}}};}export function ensureLockScope(_0x4f39ae,_0x14aacf,_0x2c9dbc,_0x58de7c,_0x14a2a8,_0x523d79){const _0x50fcd2=a81_0x1fcd,_0x25dd75=normalizeLockFile(_0x4f39ae,_0x14a2a8,_0x523d79);!_0x25dd75[_0x50fcd2(0x73)][_0x50fcd2(0x7e)]&&(_0x25dd75[_0x50fcd2(0x73)]['default']=_0x14a2a8);let _0x4fbf19=_0x25dd75[_0x50fcd2(0x6d)][_0x14aacf];if(!_0x4fbf19)return _0x4fbf19={'scriptsRoot':_0x2c9dbc,'lastSync':'','functions':{}},_0x25dd75['apps'][_0x14aacf]=_0x4fbf19,{'lockData':_0x25dd75,'appLock':_0x4fbf19};if(!_0x4fbf19[_0x50fcd2(0x80)])_0x4fbf19[_0x50fcd2(0x80)]=_0x2c9dbc;else{if(_0x4fbf19[_0x50fcd2(0x80)]!==_0x2c9dbc)throw new Error(_0x58de7c+_0x50fcd2(0x6f)+(_0x50fcd2(0x75)+_0x2c9dbc+'\x22\x20vs\x20lock\x20\x22'+_0x4fbf19[_0x50fcd2(0x80)]+_0x50fcd2(0x79))+_0x50fcd2(0x81));}return!_0x4fbf19[_0x50fcd2(0x77)]&&(_0x4fbf19[_0x50fcd2(0x77)]={}),!_0x4fbf19[_0x50fcd2(0x70)]&&(_0x4fbf19[_0x50fcd2(0x70)]=''),{'lockData':_0x25dd75,'appLock':_0x4fbf19};}export async function readBffLockFile(_0x51af67){const _0x332962=a81_0x1fcd;try{const _0x50f712=await readFile(_0x51af67,'utf8');return JSON[_0x332962(0x72)](_0x50f712);}catch(_0xfb88bb){if(_0xfb88bb[_0x332962(0x6b)]===_0x332962(0x74))return null;throw new Error(_0x332962(0x76)+String(_0xfb88bb));}}export async function writeBffLockFile(_0x5d0ebf,_0x373bb8){const _0x224e45=a81_0x1fcd;await mkdir(dirname(_0x5d0ebf),{'recursive':!![]}),await writeFile(_0x5d0ebf,JSON['stringify'](_0x373bb8,null,0x2),_0x224e45(0x71));}
|
package/lib/core/bff/utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1df89f,_0x1788b3){const _0x12f614=a83_0x2632,_0x339cff=_0x1df89f();while(!![]){try{const _0x298a2e=-parseInt(_0x12f614(0x1b7))/0x1+parseInt(_0x12f614(0x1b3))/0x2+-parseInt(_0x12f614(0x1be))/0x3+parseInt(_0x12f614(0x1b6))/0x4*(-parseInt(_0x12f614(0x1ad))/0x5)+-parseInt(_0x12f614(0x1bc))/0x6*(parseInt(_0x12f614(0x1b2))/0x7)+parseInt(_0x12f614(0x1b8))/0x8*(-parseInt(_0x12f614(0x1bd))/0x9)+-parseInt(_0x12f614(0x1b5))/0xa*(-parseInt(_0x12f614(0x1b9))/0xb);if(_0x298a2e===_0x1788b3)break;else _0x339cff['push'](_0x339cff['shift']());}catch(_0x3aa484){_0x339cff['push'](_0x339cff['shift']());}}}(a83_0x261e,0xdf8d1));export function snakeToCamel(_0x5c1126){const _0x5c3971=a83_0x2632;return _0x5c1126[_0x5c3971(0x1bb)]()['replace'](/_([a-z])/g,(_0x3e3fd5,_0x1c47cb)=>_0x1c47cb[_0x5c3971(0x1af)]());}export function findHookLocationByRemoteId(_0x3dc4c0,_0x1f9a3e){const _0x1357ff=a83_0x2632;if(!_0x1f9a3e)return undefined;for(const _0x3a86b4 of Object['values'](_0x3dc4c0)){if(_0x3a86b4['remoteId']===_0x1f9a3e&&_0x3a86b4['datasetCode']&&_0x3a86b4[_0x1357ff(0x1b0)]&&_0x3a86b4['functionNode'])return{'datasetCode':_0x3a86b4[_0x1357ff(0x1b4)],'operationType':_0x3a86b4[_0x1357ff(0x1b0)],'functionNode':_0x3a86b4['functionNode']};}return undefined;}export function extractScriptDescription(_0x3d76ad){const _0x24d969=a83_0x2632,_0x45e634=_0x3d76ad[_0x24d969(0x1b1)](/\[\s*脚本描述\s*]\s*(.+)/);return _0x45e634?.[0x1]?.['trim']()||undefined;}export function isValidBffFunctionName(_0x586c60){const _0x252a3e=a83_0x2632;return/^[A-Za-z_$][A-Za-z0-9_$]*$/[_0x252a3e(0x1ba)](_0x586c60);}export function normalizeHookFunctionNode(_0x55cff5){const _0x53eb58=a83_0x2632;if(!_0x55cff5)return undefined;const _0x3659b0=_0x55cff5['trim']()[_0x53eb58(0x1bb)]();if(_0x3659b0===_0x53eb58(0x1bf)||_0x3659b0===_0x53eb58(0x1ae))return _0x3659b0;return undefined;}function a83_0x2632(_0x2ef493,_0x1ee564){_0x2ef493=_0x2ef493-0x1ad;const _0x261eff=a83_0x261e();let _0x263217=_0x261eff[_0x2ef493];return _0x263217;}function a83_0x261e(){const _0x36afc6=['40fkFIXj','84noHbdR','1460677XEhCgx','10822832aXAzqz','12181807QMQVaP','test','toLowerCase','66942MIGlsD','9vlVVba','553344xzYlPU','before','396475fTNxPx','after','toUpperCase','operationType','match','133vgAZim','2722148fTDfZi','datasetCode'];a83_0x261e=function(){return _0x36afc6;};return a83_0x261e();}
|
package/lib/core/db-resolver.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x395050,_0x3953ea){const _0x48cce7=a84_0x3e77,_0x45479=_0x395050();while(!![]){try{const _0x3420f7=parseInt(_0x48cce7(0xa6))/0x1*(parseInt(_0x48cce7(0x9c))/0x2)+-parseInt(_0x48cce7(0xa7))/0x3*(parseInt(_0x48cce7(0xad))/0x4)+parseInt(_0x48cce7(0xa0))/0x5*(-parseInt(_0x48cce7(0xa5))/0x6)+parseInt(_0x48cce7(0x9f))/0x7*(-parseInt(_0x48cce7(0xb0))/0x8)+-parseInt(_0x48cce7(0xa8))/0x9+parseInt(_0x48cce7(0xb3))/0xa*(parseInt(_0x48cce7(0x99))/0xb)+-parseInt(_0x48cce7(0xb2))/0xc*(-parseInt(_0x48cce7(0xaf))/0xd);if(_0x3420f7===_0x3953ea)break;else _0x45479['push'](_0x45479['shift']());}catch(_0x24cf04){_0x45479['push'](_0x45479['shift']());}}}(a84_0x3a12,0xa74b8));function a84_0x3a12(){const _0x1cb801=['276330kTHGoN','join','filter','7NdYFYG','25715hFzwYK','length','dbtableConfig','Multiple\x20databases\x20found.\x20Specify\x20one\x20with\x20--db:\x20','dbId','330OtONdp','1QwdpGf','1040313qYSyQN','6027840tWTwoF','No\x20database\x20matching\x20\x22','isNaN','map','toLowerCase','8MSQwKr','db-','30392713PbgMmA','2098784heBgfH','.\x20Be\x20more\x20specific.','12lGMUyq','106990UXwxGV','includes','\x22\x20matches\x20multiple\x20databases:\x20','find','\x22.\x20Available:\x20','set','121KUJrpo','has','dbName'];a84_0x3a12=function(){return _0x1cb801;};return a84_0x3a12();}import{listDatasets}from'./api-client.js';const cache=new Map();function a84_0x3e77(_0x43670c,_0x12d8b6){_0x43670c=_0x43670c-0x96;const _0x3a1224=a84_0x3a12();let _0x3e77f1=_0x3a1224[_0x43670c];return _0x3e77f1;}export async function listDatabases(_0x2ea861){const _0x30d95a=a84_0x3e77;if(cache[_0x30d95a(0x9a)](_0x2ea861))return cache['get'](_0x2ea861);const _0x298ccd=await listDatasets(_0x2ea861),_0x5dc727=new Map();for(const _0x41d213 of _0x298ccd){const _0x25634c=_0x41d213[_0x30d95a(0xa2)];_0x25634c?.[_0x30d95a(0xa4)]!=null&&_0x5dc727[_0x30d95a(0x98)](_0x25634c[_0x30d95a(0xa4)],_0x25634c[_0x30d95a(0x9b)]??_0x30d95a(0xae)+_0x25634c[_0x30d95a(0xa4)]);}const _0x5430e9=[..._0x5dc727['entries']()][_0x30d95a(0xab)](([_0x82de9f,_0x505116])=>({'dbId':_0x82de9f,'dbName':_0x505116}));return cache[_0x30d95a(0x98)](_0x2ea861,_0x5430e9),_0x5430e9;}export async function resolveDb(_0x369159,_0x3bb80e){const _0x140fd4=a84_0x3e77,_0x38c877=await listDatabases(_0x369159);if(_0x38c877[_0x140fd4(0xa1)]===0x0)return{'resolved':[],'error':'No\x20linked\x20databases\x20found\x20for\x20this\x20app.\x20Make\x20sure\x20datasets\x20have\x20been\x20created.'};if(!_0x3bb80e)return{'resolved':_0x38c877};const _0x26546e=Number(_0x3bb80e);if(!Number[_0x140fd4(0xaa)](_0x26546e)){const _0x364a2d=_0x38c877['find'](_0x290beb=>_0x290beb[_0x140fd4(0xa4)]===_0x26546e);if(_0x364a2d)return{'resolved':[_0x364a2d]};}const _0x2dfea0=_0x3bb80e[_0x140fd4(0xac)](),_0x229084=_0x38c877[_0x140fd4(0x9e)](_0x35c502=>_0x35c502[_0x140fd4(0x9b)][_0x140fd4(0xac)]()[_0x140fd4(0xb4)](_0x2dfea0));if(_0x229084['length']>0x0)return{'resolved':_0x229084};const _0x4217ff=_0x38c877[_0x140fd4(0xab)](_0x421fa0=>_0x421fa0['dbName']+'\x20('+_0x421fa0[_0x140fd4(0xa4)]+')')[_0x140fd4(0x9d)](',\x20');return{'resolved':[],'error':_0x140fd4(0xa9)+_0x3bb80e+_0x140fd4(0x97)+_0x4217ff};}export async function resolveOneDb(_0x20ba98,_0x4f43af){const _0x434ef2=a84_0x3e77,{resolved:_0x255590,error:_0x52fbdb}=await resolveDb(_0x20ba98,_0x4f43af);if(_0x52fbdb)return{'db':null,'error':_0x52fbdb};if(_0x255590[_0x434ef2(0xa1)]===0x1)return{'db':_0x255590[0x0]};if(!_0x4f43af){const _0x2eeaba=_0x255590['map'](_0x4a4413=>_0x4a4413[_0x434ef2(0x9b)]+'\x20('+_0x4a4413[_0x434ef2(0xa4)]+')')['join'](',\x20');return{'db':null,'error':_0x434ef2(0xa3)+_0x2eeaba};}const _0x427f09=_0x255590[_0x434ef2(0xab)](_0x215cdb=>_0x215cdb[_0x434ef2(0x9b)]+'\x20('+_0x215cdb[_0x434ef2(0xa4)]+')')[_0x434ef2(0x9d)](',\x20');return{'db':null,'error':'\x22'+_0x4f43af+_0x434ef2(0xb5)+_0x427f09+_0x434ef2(0xb1)};}export async function getDbName(_0x4f872b,_0x7fb131){const _0x48e973=a84_0x3e77,_0x5c98c8=await listDatabases(_0x4f872b);return _0x5c98c8[_0x48e973(0x96)](_0x5335e1=>_0x5335e1['dbId']===_0x7fb131)?.[_0x48e973(0x9b)];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x351571,_0x78d49d){const _0x326628=a85_0x1785,_0x50cdc3=_0x351571();while(!![]){try{const _0x2a0f50=-parseInt(_0x326628(0xbf))/0x1+parseInt(_0x326628(0xb3))/0x2*(parseInt(_0x326628(0xb2))/0x3)+parseInt(_0x326628(0xbb))/0x4+-parseInt(_0x326628(0xd1))/0x5*(-parseInt(_0x326628(0xd6))/0x6)+-parseInt(_0x326628(0xd2))/0x7*(parseInt(_0x326628(0xbe))/0x8)+-parseInt(_0x326628(0xcc))/0x9*(-parseInt(_0x326628(0xd8))/0xa)+-parseInt(_0x326628(0xd4))/0xb;if(_0x2a0f50===_0x78d49d)break;else _0x50cdc3['push'](_0x50cdc3['shift']());}catch(_0x4efe4a){_0x50cdc3['push'](_0x50cdc3['shift']());}}}(a85_0x5c5c,0xad1a9));export function detectSqlType(_0x5547f6){const _0x36179e=a85_0x1785;if(!_0x5547f6?.['trim']())return{'type':'UNKNOWN','isSelectOnly':![],'isDangerous':![],'reason':_0x36179e(0xd0)};const _0x2b8541=_0x5547f6[_0x36179e(0xd7)](/#\{[^}]*\}/g,'?')[_0x36179e(0xd7)](/\$\{[^}]*\}/g,'?')['replace'](/@[^(\s]+(\([^)]*\))?/g,'')[_0x36179e(0xd7)](/\/\*[\s\S]*?\*\//g,'')['trim'](),_0x2c2578=_0x2b8541[_0x36179e(0xb8)]('\x0a');let _0x14367f='';for(const _0x3d00b5 of _0x2c2578){const _0x3edf61=_0x3d00b5[_0x36179e(0xba)]();if(!_0x3edf61||_0x3edf61[_0x36179e(0xd5)]('--')||_0x3edf61[_0x36179e(0xd5)]('/*'))continue;_0x14367f=_0x3edf61;break;}const _0x581444=_0x14367f[_0x36179e(0xcb)]();if(_0x581444[_0x36179e(0xd5)](_0x36179e(0xc3))||_0x581444['startsWith'](_0x36179e(0xc2))){const _0x2f5e00=/\b(INSERT|UPDATE|DELETE|DROP|ALTER|CREATE|TRUNCATE)\b/i[_0x36179e(0xbd)](_0x2b8541);return{'type':'SELECT','isSelectOnly':!_0x2f5e00,'isDangerous':_0x2f5e00,'reason':_0x2f5e00?'SQL\x20contains\x20modification\x20statements\x20alongside\x20SELECT':undefined};}if(_0x581444[_0x36179e(0xd5)](_0x36179e(0xb7)))return{'type':_0x36179e(0xb7),'isSelectOnly':![],'isDangerous':![]};if(_0x581444[_0x36179e(0xd5)](_0x36179e(0xc1)))return{'type':'UPDATE','isSelectOnly':![],'isDangerous':![]};if(_0x581444['startsWith']('DELETE'))return{'type':'DELETE','isSelectOnly':![],'isDangerous':!![],'reason':_0x36179e(0xb4)};if(/^(CREATE|ALTER|DROP|TRUNCATE)/i[_0x36179e(0xbd)](_0x581444))return{'type':_0x36179e(0xc0),'isSelectOnly':![],'isDangerous':!![],'reason':_0x36179e(0xc5)};return{'type':_0x36179e(0xc7),'isSelectOnly':![],'isDangerous':![]};}function a85_0x1785(_0x1b34fd,_0x3ca960){_0x1b34fd=_0x1b34fd-0xb2;const _0x5c5cdb=a85_0x5c5c();let _0x1785e3=_0x5c5cdb[_0x1b34fd];return _0x1785e3;}function extractTables(_0x28718e){const _0x2ea40b=a85_0x1785,_0x18ea54=_0x28718e[_0x2ea40b(0xd7)](/#\{[^}]*\}/g,'?')[_0x2ea40b(0xd7)](/\$\{[^}]*\}/g,'?')[_0x2ea40b(0xd7)](/'[^']*'/g,'\x27\x27')[_0x2ea40b(0xd7)](/--.*$/gm,'')[_0x2ea40b(0xd7)](/\/\*[\s\S]*?\*\//g,''),_0x410e36=[],_0x4156bf=_0x18ea54[_0x2ea40b(0xbc)](/FROM\s+([^\s,)(]+)/i);if(_0x4156bf?.[0x1])_0x410e36[_0x2ea40b(0xb5)](_0x4156bf[0x1]['replace'](/[`"]/g,''));for(const _0x4cabe9 of _0x18ea54['matchAll'](/(?:INNER|LEFT|RIGHT|FULL|CROSS)?\s*JOIN\s+([^\s,)(]+)/gi)){const _0x1b8c60=_0x4cabe9[0x1]?.['replace'](/[`"]/g,'');if(_0x1b8c60&&!_0x410e36[_0x2ea40b(0xca)](_0x1b8c60))_0x410e36['push'](_0x1b8c60);}const _0x357c5e=_0x18ea54[_0x2ea40b(0xbc)](/INTO\s+([^\s(]+)/i);if(_0x357c5e?.[0x1]){const _0x4fefdc=_0x357c5e[0x1]['replace'](/[`"]/g,'');if(!_0x410e36[_0x2ea40b(0xca)](_0x4fefdc))_0x410e36[_0x2ea40b(0xb5)](_0x4fefdc);}const _0x3bfbe4=_0x18ea54['match'](/UPDATE\s+([^\s,)(]+)/i);if(_0x3bfbe4?.[0x1]){const _0x3903f9=_0x3bfbe4[0x1][_0x2ea40b(0xd7)](/[`"]/g,'');if(!_0x410e36[_0x2ea40b(0xca)](_0x3903f9))_0x410e36[_0x2ea40b(0xb5)](_0x3903f9);}return _0x410e36;}function a85_0x5c5c(){const _0x52029b=['INSERT','split','unknown\x20table(s)','trim','3190136usOnTg','match','test','8cgTKZJ','1017379GgIRsA','DDL','UPDATE','WITH','SELECT','from','DDL\x20statements\x20are\x20blocked\x20from\x20auto-save','\x20with\x20parameters:\x20','UNKNOWN','matchAll','length','includes','toUpperCase','1737GXkQmC','\x20query\x20targeting\x20','type','\x20statements\x20cannot\x20be\x20auto-saved.\x20Please\x20operate\x20manually\x20on\x20the\x20platform.','SQL\x20content\x20is\x20empty','5jAkFrM','4680221zTEDLD','isDangerous','9358613FcdIYw','startsWith','4118130YLXaro','replace','22230PufexT','3998610WnfZkn','2lRepfT','DELETE\x20statements\x20are\x20blocked\x20from\x20auto-save','push','Unable\x20to\x20detect\x20SQL\x20type.\x20Please\x20check\x20the\x20SQL\x20content.'];a85_0x5c5c=function(){return _0x52029b;};return a85_0x5c5c();}function extractParameters(_0xbd3563){const _0x9dbe03=a85_0x1785,_0x1afdd3=new Set();for(const _0x316a92 of _0xbd3563[_0x9dbe03(0xc8)](/#\{(\w+)\}/g))if(_0x316a92[0x1])_0x1afdd3['add'](_0x316a92[0x1]);for(const _0x4acdaf of _0xbd3563[_0x9dbe03(0xc8)](/\$\{(\w+)\}/g))if(_0x4acdaf[0x1])_0x1afdd3['add'](_0x4acdaf[0x1]);return Array[_0x9dbe03(0xc4)](_0x1afdd3);}export function validateSql(_0x4b8e90){const _0x1083ef=a85_0x1785,_0x24fb7c=detectSqlType(_0x4b8e90),_0x40c90b=extractTables(_0x4b8e90),_0x3b0207=extractParameters(_0x4b8e90);if(_0x24fb7c[_0x1083ef(0xd3)])return{'valid':![],'sqlType':_0x24fb7c,'tables':_0x40c90b,'parameters':_0x3b0207,'message':_0x24fb7c['reason']||_0x24fb7c['type']+_0x1083ef(0xcf)};if(_0x24fb7c[_0x1083ef(0xce)]===_0x1083ef(0xc7))return{'valid':![],'sqlType':_0x24fb7c,'tables':_0x40c90b,'parameters':_0x3b0207,'message':_0x1083ef(0xb6)};return{'valid':!![],'sqlType':_0x24fb7c,'tables':_0x40c90b,'parameters':_0x3b0207,'message':_0x24fb7c[_0x1083ef(0xce)]+_0x1083ef(0xcd)+(_0x40c90b[_0x1083ef(0xc9)]?_0x40c90b['join'](',\x20'):_0x1083ef(0xb9))+(_0x3b0207[_0x1083ef(0xc9)]?_0x1083ef(0xc6)+_0x3b0207['join'](',\x20'):'')};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5e367d,_0x41f917){const _0x233ed2=a85_0x8072,_0x3ec48c=_0x5e367d();while(!![]){try{const _0x1bd22e=parseInt(_0x233ed2(0xe1))/0x1+-parseInt(_0x233ed2(0xdb))/0x2*(parseInt(_0x233ed2(0xc6))/0x3)+-parseInt(_0x233ed2(0xd0))/0x4+parseInt(_0x233ed2(0xab))/0x5*(parseInt(_0x233ed2(0xce))/0x6)+-parseInt(_0x233ed2(0xaf))/0x7+-parseInt(_0x233ed2(0xa8))/0x8*(parseInt(_0x233ed2(0xae))/0x9)+-parseInt(_0x233ed2(0xe4))/0xa*(-parseInt(_0x233ed2(0xb5))/0xb);if(_0x1bd22e===_0x41f917)break;else _0x3ec48c['push'](_0x3ec48c['shift']());}catch(_0xc12be8){_0x3ec48c['push'](_0x3ec48c['shift']());}}}(a85_0x2b5c,0x43308));function a85_0x2b5c(){const _0x6b3eb5=['slice','66PAUImT','label','cyan','production','length','Project\x20Name','App\x20Code','rightArrow','login-check','*\x20Login\x20first\x20to\x20pull\x20API\x20config?','project-name','green','column','Bind\x20AppCode\x20to\x20auto-configure\x20API,\x20e.g.\x20app-c4c89304\x20(press\x20Enter\x20to\x20skip)','Invalid\x20project\x20name','Logged\x20in','Project\x20name\x20cannot\x20exceed\x2050\x20characters','222135qQjMNO','login-prompt','app-code','red','Project\x20directory\x20','Login\x20status','\x22\x20already\x20exists','step','900aPRQlJ','return','1005764mrHOHh','gray','\x20already\x20exists,\x20please\x20use\x20a\x20different\x20name','login','\x20←\x20','login-process','Press\x20Enter\x20to\x20confirm\x20or\x20type\x20a\x20custom\x20name','delete','Yes','AppCode\x20can\x20only\x20contain\x20letters,\x20numbers,\x20hyphens\x20and\x20underscores,\x20and\x20must\x20start\x20with\x20a\x20letter\x20or\x20number','*\x20Creating\x20project...','10nwiFoF','creating','Login\x20skipped','map','trim','AppCode\x20cannot\x20exceed\x20100\x20characters','341501YKyvJV','*\x20Logging\x20in,\x20please\x20complete\x20in\x20browser...','*\x20Create\x20new\x20project','1412640JLXjmW','\x20Checking...','leftArrow','Not\x20set','\x20\x20Use\x20←→\x20to\x20choose,\x20press\x20Enter\x20to\x20confirm','80560yrSBck','Invalid\x20AppCode','resolve','11230nwiARN','[optional]:\x20','cwd','396VwuMxY','1302217TkEcsG','Project\x20name\x20must\x20start\x20with\x20a\x20letter\x20or\x20number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','string','Directory\x20\x22','env'];a85_0x2b5c=function(){return _0x6b3eb5;};return a85_0x2b5c();}function a85_0x8072(_0x4030d8,_0xe4e520){_0x4030d8=_0x4030d8-0xa7;const _0x2b5c8e=a85_0x2b5c();let _0x8072ce=_0x2b5c8e[_0x4030d8];return _0x8072ce;}import{jsx as a85_0x4e8542,jsxs as a85_0x2c1f78,Fragment as a85_0x4ed775}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{existsSync}from'node:fs';import a85_0x316d4f from'node:path';import{getIsSessionValid}from'../auth/is-session-valid.js';import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x5570a0){const _0x29f853=a85_0x8072,{onCreate:_0x1a7845,env:_0xb4fdf5}=_0x5570a0,[_0x407c3c,_0xf4bddb]=useState('project-name'),[_0x5e75bc,_0x1d07a8]=useState(''),[_0x4cead8,_0x41d128]=useState(''),[_0x12e2c9,_0x2bf332]=useState(''),[_0x1685d4,_0x52d59b]=useState(''),[_0x1ed2f5,_0x549919]=useState([]),[_0x3cbf66,_0x52d01a]=useState(null),[_0x569f0c,_0xa1e00a]=useState(![]),[_0x522d44,_0x529f06]=useState(![]),[_0x30b66a,_0x1221e2]=useState(0x0),[_0x2ab046,_0x27af41]=useState(''),_0xf9932c='my-app',_0xe8600e=readConfig(),_0x5f3b12=typeof _0xe8600e[_0x29f853(0xb3)]===_0x29f853(0xb1)?_0xe8600e[_0x29f853(0xb3)]:undefined;function _0x318c32(_0x9538bf){const _0x945b23=_0x29f853,_0x3bdc1c=_0x9538bf||_0xf9932c,_0x108dc6=a85_0x316d4f[_0x945b23(0xaa)](process[_0x945b23(0xad)](),_0x3bdc1c);return existsSync(_0x108dc6);}function _0x119c76(_0x1a39b1){const _0x3a10ea=_0x29f853;if(_0x1a39b1[_0x3a10ea(0xb9)]>0x32)return{'valid':![],'message':_0x3a10ea(0xc5)};const _0x2bace1=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x1a39b1?.[_0x3a10ea(0xdf)]()&&!_0x2bace1['test'](_0x1a39b1))return{'valid':![],'message':_0x3a10ea(0xb0)};return{'valid':!![]};}function _0x333d05(_0xdac9ad){const _0x546213=_0x29f853;if(!_0xdac9ad['trim']())return{'valid':!![]};if(_0xdac9ad[_0x546213(0xb9)]>0x64)return{'valid':![],'message':_0x546213(0xe0)};const _0x2e1f1d=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x2e1f1d['test'](_0xdac9ad))return{'valid':![],'message':_0x546213(0xd9)};return{'valid':!![]};}async function _0x486354(){_0xa1e00a(!![]);try{const _0x8b1dea=await getIsSessionValid();return _0x52d01a(_0x8b1dea),_0x8b1dea;}catch(_0x14d5a1){return _0x52d01a(![]),![];}finally{_0xa1e00a(![]);}}async function _0x4cea5e(){_0x529f06(!![]);try{const _0x3dd7ab=await authServer({'silent':!![]});return _0x52d01a(_0x3dd7ab),_0x3dd7ab;}catch(_0x49b6fb){return _0x52d01a(![]),![];}finally{_0x529f06(![]);}}function _0x19b3d6(_0x48b28d){const _0x4b1cab=_0x29f853,_0x2bd0e8=_0xb4fdf5||_0x5f3b12||_0x4b1cab(0xb8);_0x1a7845({'projectName':_0x5e75bc,'appCode':_0x48b28d,'env':_0x2bd0e8}),_0xf4bddb(_0x4b1cab(0xdc));}return useInput(async(_0x57b973,_0x428caf)=>{const _0x3b0f0a=_0x29f853;if(_0x428caf[_0x3b0f0a(0xe6)]||_0x428caf[_0x3b0f0a(0xbc)]){if(_0x407c3c==='login-prompt'){_0x1221e2(_0x1f2703=>_0x1f2703===0x0?0x1:0x0);return;}}if(_0x428caf[_0x3b0f0a(0xcf)]){if(_0x407c3c===_0x3b0f0a(0xbf)){const _0x167e0e=_0x12e2c9[_0x3b0f0a(0xdf)]()||_0xf9932c;if(_0x1685d4)return;if(_0x318c32(_0x167e0e)){_0x27af41(_0x3b0f0a(0xca)+_0x167e0e+_0x3b0f0a(0xd2));return;}_0x1d07a8(_0x167e0e),_0x549919([{'step':_0x3b0f0a(0xbf),'label':_0x3b0f0a(0xba),'value':_0x167e0e}]),_0x2bf332(''),_0x52d59b(''),_0x27af41(''),_0xf4bddb(_0x3b0f0a(0xc8));return;}if(_0x407c3c===_0x3b0f0a(0xc8)){if(_0x1685d4)return;const _0x474b5c=_0x12e2c9[_0x3b0f0a(0xdf)]();_0x41d128(_0x474b5c),_0x549919(_0x4c268f=>[..._0x4c268f,{'step':_0x3b0f0a(0xc8),'label':_0x3b0f0a(0xbb),'value':_0x474b5c||_0x3b0f0a(0xe7)}]),_0x2bf332(''),_0x52d59b('');if(_0x474b5c){_0xf4bddb(_0x3b0f0a(0xbd));const _0x83f7f3=await _0x486354();_0x83f7f3?_0x19b3d6(_0x474b5c):_0xf4bddb(_0x3b0f0a(0xc7));}else _0x19b3d6(undefined);return;}if(_0x407c3c===_0x3b0f0a(0xc7)){const _0x2b09ed=_0x30b66a===0x0;if(_0x2b09ed){_0xf4bddb(_0x3b0f0a(0xd5));const _0x5afb3d=await _0x4cea5e();_0x5afb3d?(_0x549919(_0x4b25cb=>[..._0x4b25cb,{'step':_0x3b0f0a(0xd3),'label':_0x3b0f0a(0xcb),'value':_0x3b0f0a(0xc4)}]),_0x19b3d6(_0x4cead8)):(_0x549919(_0x11ee85=>[..._0x11ee85,{'step':'login','label':_0x3b0f0a(0xcb),'value':'Login\x20failed'}]),_0x19b3d6(_0x4cead8));}else _0x549919(_0x224aaf=>[..._0x224aaf,{'step':_0x3b0f0a(0xd3),'label':_0x3b0f0a(0xcb),'value':_0x3b0f0a(0xdd)}]),_0x19b3d6(_0x4cead8);return;}}if(_0x428caf['backspace']||_0x428caf[_0x3b0f0a(0xd7)]){_0x2bf332(_0xad7bb6=>{const _0x1a014b=_0x3b0f0a,_0x2ca474=_0xad7bb6[_0x1a014b(0xb4)](0x0,-0x1);if(_0x407c3c==='project-name'){const {valid:_0x45e821,message:_0x18bc8f}=_0x119c76(_0x2ca474);_0x52d59b(_0x45e821?'':_0x18bc8f||_0x1a014b(0xc3));if(_0x45e821&&!_0x1685d4){const _0x2e47e2=_0x2ca474||_0xf9932c;_0x318c32(_0x2e47e2)?_0x27af41(_0x1a014b(0xb2)+_0x2e47e2+_0x1a014b(0xcc)):_0x27af41('');}}else{if(_0x407c3c==='app-code'){const {valid:_0x124ff3,message:_0x55b86d}=_0x333d05(_0x2ca474);_0x52d59b(_0x124ff3?'':_0x55b86d||_0x1a014b(0xa9));}}return _0x2ca474;});return;}if([_0x3b0f0a(0xdc),_0x3b0f0a(0xbd),_0x3b0f0a(0xd5),_0x3b0f0a(0xc7)]['includes'](_0x407c3c))return;_0x2bf332(_0x1fb53e=>{const _0x30c241=_0x3b0f0a,_0x4c9dc8=_0x1fb53e+_0x57b973;if(_0x407c3c===_0x30c241(0xbf)){const {valid:_0x1027ce,message:_0x34d297}=_0x119c76(_0x4c9dc8);_0x52d59b(_0x1027ce?'':_0x34d297||_0x30c241(0xc3));if(_0x1027ce&&!_0x1685d4){const _0x34ed5a=_0x4c9dc8||_0xf9932c;_0x318c32(_0x34ed5a)?_0x27af41(_0x30c241(0xb2)+_0x34ed5a+'\x22\x20already\x20exists'):_0x27af41('');}}else{if(_0x407c3c===_0x30c241(0xc8)){const {valid:_0x53197b,message:_0x2cb6d4}=_0x333d05(_0x4c9dc8);_0x52d59b(_0x53197b?'':_0x2cb6d4||'Invalid\x20AppCode');}}return _0x4c9dc8;});}),a85_0x2c1f78(Box,{'flexDirection':_0x29f853(0xc1),'marginTop':0x1,'children':[_0x1ed2f5[_0x29f853(0xb9)]===0x0&&a85_0x4e8542(Box,{'children':a85_0x4e8542(Text,{'color':_0x29f853(0xb7),'children':_0x29f853(0xe3)})}),_0x1ed2f5[_0x29f853(0xde)](_0x1709fe=>a85_0x2c1f78(Box,{'children':[a85_0x4e8542(Text,{'color':_0x29f853(0xc0),'children':'√\x20'+_0x1709fe[_0x29f853(0xb6)]+':\x20'}),a85_0x4e8542(Text,{'color':'cyan','children':_0x1709fe['value']})]},_0x1709fe[_0x29f853(0xcd)])),_0x407c3c===_0x29f853(0xbf)&&a85_0x2c1f78(a85_0x4ed775,{'children':[a85_0x2c1f78(Box,{'children':[a85_0x4e8542(Text,{'children':'*\x20Project\x20name:\x20'}),_0x12e2c9?a85_0x4e8542(Text,{'color':_0x29f853(0xc0),'children':_0x12e2c9}):a85_0x4e8542(Text,{'color':_0x29f853(0xd1),'children':_0xf9932c}),_0x1685d4&&a85_0x2c1f78(Text,{'color':_0x29f853(0xc9),'children':[_0x29f853(0xd4),_0x1685d4]}),_0x2ab046&&a85_0x2c1f78(Text,{'color':'red','children':[_0x29f853(0xd4),_0x2ab046]})]}),!_0x1685d4&&!_0x2ab046&&!_0x12e2c9&&a85_0x4e8542(Box,{'children':a85_0x4e8542(Text,{'color':_0x29f853(0xd1),'children':_0x29f853(0xd6)})})]}),_0x407c3c===_0x29f853(0xc8)&&a85_0x2c1f78(a85_0x4ed775,{'children':[a85_0x2c1f78(Box,{'children':[a85_0x4e8542(Text,{'children':'*\x20AppCode\x20'}),a85_0x4e8542(Text,{'color':_0x29f853(0xd1),'children':_0x29f853(0xac)}),a85_0x4e8542(Text,{'color':_0x29f853(0xc0),'children':_0x12e2c9}),_0x1685d4&&a85_0x2c1f78(Text,{'color':'red','children':[_0x29f853(0xd4),_0x1685d4]})]}),!_0x1685d4&&a85_0x4e8542(Box,{'children':a85_0x4e8542(Text,{'color':_0x29f853(0xd1),'children':_0x29f853(0xc2)})})]}),_0x407c3c===_0x29f853(0xbd)&&a85_0x2c1f78(Box,{'children':[a85_0x4e8542(Text,{'children':'*\x20Checking\x20login\x20status...'}),_0x569f0c&&a85_0x4e8542(Text,{'color':'gray','children':_0x29f853(0xe5)})]}),_0x407c3c==='login-prompt'&&a85_0x2c1f78(a85_0x4ed775,{'children':[a85_0x4e8542(Box,{'children':a85_0x4e8542(Text,{'color':'yellow','children':'!\x20No\x20valid\x20login\x20detected'})}),a85_0x4e8542(Box,{'marginTop':0x1,'children':a85_0x4e8542(Text,{'children':_0x29f853(0xbe)})}),a85_0x2c1f78(Box,{'marginLeft':0x2,'children':[a85_0x2c1f78(Text,{'color':_0x30b66a===0x0?'green':_0x29f853(0xd1),'children':[_0x30b66a===0x0?'▶\x20':'\x20\x20',_0x29f853(0xd8)]}),a85_0x4e8542(Text,{'children':'\x20'}),a85_0x2c1f78(Text,{'color':_0x30b66a===0x1?'green':_0x29f853(0xd1),'children':[_0x30b66a===0x1?'▶\x20':'\x20\x20','No']})]}),a85_0x4e8542(Box,{'children':a85_0x4e8542(Text,{'color':_0x29f853(0xd1),'children':_0x29f853(0xa7)})})]}),_0x407c3c===_0x29f853(0xd5)&&a85_0x2c1f78(Box,{'children':[a85_0x4e8542(Text,{'children':_0x29f853(0xe2)}),_0x522d44&&a85_0x4e8542(Text,{'color':_0x29f853(0xd1),'children':'\x20Logging\x20in...'})]}),_0x407c3c==='creating'&&a85_0x4e8542(Box,{'children':a85_0x4e8542(Text,{'color':'green','children':_0x29f853(0xda)})})]});}
|
|
1
|
+
(function(_0x183a89,_0x4dd4ca){const _0x5b7a40=a86_0xfdb9,_0x5a85a5=_0x183a89();while(!![]){try{const _0x227d90=parseInt(_0x5b7a40(0xc3))/0x1+-parseInt(_0x5b7a40(0xe4))/0x2*(parseInt(_0x5b7a40(0xb0))/0x3)+-parseInt(_0x5b7a40(0xd6))/0x4*(parseInt(_0x5b7a40(0xa1))/0x5)+parseInt(_0x5b7a40(0xb9))/0x6+parseInt(_0x5b7a40(0xa7))/0x7+-parseInt(_0x5b7a40(0xde))/0x8*(parseInt(_0x5b7a40(0xc2))/0x9)+parseInt(_0x5b7a40(0xbd))/0xa;if(_0x227d90===_0x4dd4ca)break;else _0x5a85a5['push'](_0x5a85a5['shift']());}catch(_0x37b89f){_0x5a85a5['push'](_0x5a85a5['shift']());}}}(a86_0x8f48,0xe17c8));function a86_0xfdb9(_0x2c1674,_0x289f3f){_0x2c1674=_0x2c1674-0xa1;const _0x8f48=a86_0x8f48();let _0xfdb93a=_0x8f48[_0x2c1674];return _0xfdb93a;}import{jsx as a86_0x1bfb89,jsxs as a86_0x19d4ef,Fragment as a86_0xd926ad}from'react/jsx-runtime';import{useState}from'react';import{Text,Box,useInput}from'ink';import{existsSync}from'node:fs';import a86_0x1bddd8 from'node:path';import{getIsSessionValid}from'../auth/is-session-valid.js';function a86_0x8f48(){const _0x58e5d4=['Invalid\x20project\x20name','\x20←\x20','map','Login\x20status','*\x20AppCode\x20','\x22\x20already\x20exists','Login\x20failed','app-code','1381014yBGJEs','my-app','project-name','env','12915050UAiAdG','*\x20Project\x20name:\x20','Logged\x20in','resolve','value','2284533Secvig','1449250shmlsn','Invalid\x20AppCode','login-process','login-prompt','AppCode\x20cannot\x20exceed\x20100\x20characters','rightArrow','gray','*\x20Checking\x20login\x20status...','return','leftArrow','backspace','Login\x20skipped','label','test','\x20\x20Use\x20←→\x20to\x20choose,\x20press\x20Enter\x20to\x20confirm','string','Bind\x20AppCode\x20to\x20auto-configure\x20API,\x20e.g.\x20app-c4c89304\x20(press\x20Enter\x20to\x20skip)','delete','Yes','16rzdZPG','*\x20Creating\x20project...','creating','login-check','*\x20Logging\x20in,\x20please\x20complete\x20in\x20browser...','production','green','login','40BFvZno','Not\x20set','!\x20No\x20valid\x20login\x20detected','includes','*\x20Create\x20new\x20project','red','48578CWWcPA','1396915sDRdjz','column','cyan','slice','Directory\x20\x22','step','5436109yfWnoO','Press\x20Enter\x20to\x20confirm\x20or\x20type\x20a\x20custom\x20name','trim','Project\x20name\x20cannot\x20exceed\x2050\x20characters','length','Project\x20name\x20must\x20start\x20with\x20a\x20letter\x20or\x20number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','yellow','*\x20Login\x20first\x20to\x20pull\x20API\x20config?','AppCode\x20can\x20only\x20contain\x20letters,\x20numbers,\x20hyphens\x20and\x20underscores,\x20and\x20must\x20start\x20with\x20a\x20letter\x20or\x20number','54CGbrqq'];a86_0x8f48=function(){return _0x58e5d4;};return a86_0x8f48();}import{authServer}from'../auth/auth-server.js';import{readConfig}from'../utils/config.js';export function EnhancedGuidedCreate(_0x180c84){const _0x55237d=a86_0xfdb9,{onCreate:_0x2c0f92,env:_0x1c7f49}=_0x180c84,[_0x46b402,_0x578bcc]=useState(_0x55237d(0xbb)),[_0x1696d5,_0x34179d]=useState(''),[_0x11ea2f,_0x15b8a7]=useState(''),[_0x2bb249,_0x4664f3]=useState(''),[_0x40041c,_0x38f17e]=useState(''),[_0x374308,_0x4f9b16]=useState([]),[_0x232170,_0x213c17]=useState(null),[_0x228091,_0x204607]=useState(![]),[_0x436d36,_0x15c768]=useState(![]),[_0x373787,_0x5341da]=useState(0x0),[_0xb9bdd9,_0x1c60bf]=useState(''),_0x50e756=_0x55237d(0xba),_0x53f3e8=readConfig(),_0x20af1a=typeof _0x53f3e8[_0x55237d(0xbc)]===_0x55237d(0xd2)?_0x53f3e8[_0x55237d(0xbc)]:undefined;function _0x1c4470(_0x7e1122){const _0x45276e=_0x55237d,_0x1548c5=_0x7e1122||_0x50e756,_0x4d16b5=a86_0x1bddd8[_0x45276e(0xc0)](process['cwd'](),_0x1548c5);return existsSync(_0x4d16b5);}function _0x2c9461(_0x6c2a2f){const _0x437f2a=_0x55237d;if(_0x6c2a2f[_0x437f2a(0xab)]>0x32)return{'valid':![],'message':_0x437f2a(0xaa)};const _0x1df550=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x6c2a2f?.[_0x437f2a(0xa9)]()&&!_0x1df550[_0x437f2a(0xd0)](_0x6c2a2f))return{'valid':![],'message':_0x437f2a(0xac)};return{'valid':!![]};}function _0x2359f6(_0x3cb8c2){const _0x3cdf9a=_0x55237d;if(!_0x3cb8c2[_0x3cdf9a(0xa9)]())return{'valid':!![]};if(_0x3cb8c2[_0x3cdf9a(0xab)]>0x64)return{'valid':![],'message':_0x3cdf9a(0xc7)};const _0x3f6799=/^[a-zA-Z0-9][a-zA-Z0-9_-]*$/;if(!_0x3f6799[_0x3cdf9a(0xd0)](_0x3cb8c2))return{'valid':![],'message':_0x3cdf9a(0xaf)};return{'valid':!![]};}async function _0x29a060(){_0x204607(!![]);try{const _0x4ac039=await getIsSessionValid();return _0x213c17(_0x4ac039),_0x4ac039;}catch(_0x1bd876){return _0x213c17(![]),![];}finally{_0x204607(![]);}}async function _0xc4bce1(){_0x15c768(!![]);try{const _0xb28268=await authServer({'silent':!![]});return _0x213c17(_0xb28268),_0xb28268;}catch(_0x2a08e1){return _0x213c17(![]),![];}finally{_0x15c768(![]);}}function _0x52044c(_0xc27a75){const _0xeb174c=_0x55237d,_0x23a395=_0x1c7f49||_0x20af1a||_0xeb174c(0xdb);_0x2c0f92({'projectName':_0x1696d5,'appCode':_0xc27a75,'env':_0x23a395}),_0x578bcc(_0xeb174c(0xd8));}return useInput(async(_0x20b1a0,_0x23392a)=>{const _0x10b0fc=_0x55237d;if(_0x23392a[_0x10b0fc(0xcc)]||_0x23392a[_0x10b0fc(0xc8)]){if(_0x46b402===_0x10b0fc(0xc6)){_0x5341da(_0x296de2=>_0x296de2===0x0?0x1:0x0);return;}}if(_0x23392a[_0x10b0fc(0xcb)]){if(_0x46b402===_0x10b0fc(0xbb)){const _0x3ceeaf=_0x2bb249['trim']()||_0x50e756;if(_0x40041c)return;if(_0x1c4470(_0x3ceeaf)){_0x1c60bf('Project\x20directory\x20'+_0x3ceeaf+'\x20already\x20exists,\x20please\x20use\x20a\x20different\x20name');return;}_0x34179d(_0x3ceeaf),_0x4f9b16([{'step':'project-name','label':'Project\x20Name','value':_0x3ceeaf}]),_0x4664f3(''),_0x38f17e(''),_0x1c60bf(''),_0x578bcc(_0x10b0fc(0xb8));return;}if(_0x46b402===_0x10b0fc(0xb8)){if(_0x40041c)return;const _0x9f335e=_0x2bb249['trim']();_0x15b8a7(_0x9f335e),_0x4f9b16(_0x1c56f4=>[..._0x1c56f4,{'step':_0x10b0fc(0xb8),'label':'App\x20Code','value':_0x9f335e||_0x10b0fc(0xdf)}]),_0x4664f3(''),_0x38f17e('');if(_0x9f335e){_0x578bcc('login-check');const _0x2420b7=await _0x29a060();_0x2420b7?_0x52044c(_0x9f335e):_0x578bcc(_0x10b0fc(0xc6));}else _0x52044c(undefined);return;}if(_0x46b402===_0x10b0fc(0xc6)){const _0x47ff84=_0x373787===0x0;if(_0x47ff84){_0x578bcc('login-process');const _0x31f17b=await _0xc4bce1();_0x31f17b?(_0x4f9b16(_0xd39d6c=>[..._0xd39d6c,{'step':_0x10b0fc(0xdd),'label':_0x10b0fc(0xb4),'value':_0x10b0fc(0xbf)}]),_0x52044c(_0x11ea2f)):(_0x4f9b16(_0x536894=>[..._0x536894,{'step':'login','label':_0x10b0fc(0xb4),'value':_0x10b0fc(0xb7)}]),_0x52044c(_0x11ea2f));}else _0x4f9b16(_0x11722e=>[..._0x11722e,{'step':'login','label':'Login\x20status','value':_0x10b0fc(0xce)}]),_0x52044c(_0x11ea2f);return;}}if(_0x23392a[_0x10b0fc(0xcd)]||_0x23392a[_0x10b0fc(0xd4)]){_0x4664f3(_0x14019e=>{const _0x14e3ab=_0x10b0fc,_0x4b06e6=_0x14019e[_0x14e3ab(0xa4)](0x0,-0x1);if(_0x46b402===_0x14e3ab(0xbb)){const {valid:_0x1cca82,message:_0x20ceb3}=_0x2c9461(_0x4b06e6);_0x38f17e(_0x1cca82?'':_0x20ceb3||_0x14e3ab(0xb1));if(_0x1cca82&&!_0x40041c){const _0x4ae025=_0x4b06e6||_0x50e756;_0x1c4470(_0x4ae025)?_0x1c60bf(_0x14e3ab(0xa5)+_0x4ae025+'\x22\x20already\x20exists'):_0x1c60bf('');}}else{if(_0x46b402===_0x14e3ab(0xb8)){const {valid:_0x2782fc,message:_0x20a8f0}=_0x2359f6(_0x4b06e6);_0x38f17e(_0x2782fc?'':_0x20a8f0||_0x14e3ab(0xc4));}}return _0x4b06e6;});return;}if([_0x10b0fc(0xd8),_0x10b0fc(0xd9),_0x10b0fc(0xc5),_0x10b0fc(0xc6)][_0x10b0fc(0xe1)](_0x46b402))return;_0x4664f3(_0x137638=>{const _0x4d50ae=_0x10b0fc,_0x3f5108=_0x137638+_0x20b1a0;if(_0x46b402===_0x4d50ae(0xbb)){const {valid:_0x247f5d,message:_0x529ba8}=_0x2c9461(_0x3f5108);_0x38f17e(_0x247f5d?'':_0x529ba8||_0x4d50ae(0xb1));if(_0x247f5d&&!_0x40041c){const _0x34cf80=_0x3f5108||_0x50e756;_0x1c4470(_0x34cf80)?_0x1c60bf('Directory\x20\x22'+_0x34cf80+_0x4d50ae(0xb6)):_0x1c60bf('');}}else{if(_0x46b402===_0x4d50ae(0xb8)){const {valid:_0x3cf5f3,message:_0x297ed9}=_0x2359f6(_0x3f5108);_0x38f17e(_0x3cf5f3?'':_0x297ed9||_0x4d50ae(0xc4));}}return _0x3f5108;});}),a86_0x19d4ef(Box,{'flexDirection':_0x55237d(0xa2),'marginTop':0x1,'children':[_0x374308[_0x55237d(0xab)]===0x0&&a86_0x1bfb89(Box,{'children':a86_0x1bfb89(Text,{'color':_0x55237d(0xa3),'children':_0x55237d(0xe2)})}),_0x374308[_0x55237d(0xb3)](_0x240ac0=>a86_0x19d4ef(Box,{'children':[a86_0x1bfb89(Text,{'color':_0x55237d(0xdc),'children':'√\x20'+_0x240ac0[_0x55237d(0xcf)]+':\x20'}),a86_0x1bfb89(Text,{'color':'cyan','children':_0x240ac0[_0x55237d(0xc1)]})]},_0x240ac0[_0x55237d(0xa6)])),_0x46b402==='project-name'&&a86_0x19d4ef(a86_0xd926ad,{'children':[a86_0x19d4ef(Box,{'children':[a86_0x1bfb89(Text,{'children':_0x55237d(0xbe)}),_0x2bb249?a86_0x1bfb89(Text,{'color':_0x55237d(0xdc),'children':_0x2bb249}):a86_0x1bfb89(Text,{'color':_0x55237d(0xc9),'children':_0x50e756}),_0x40041c&&a86_0x19d4ef(Text,{'color':_0x55237d(0xe3),'children':['\x20←\x20',_0x40041c]}),_0xb9bdd9&&a86_0x19d4ef(Text,{'color':_0x55237d(0xe3),'children':[_0x55237d(0xb2),_0xb9bdd9]})]}),!_0x40041c&&!_0xb9bdd9&&!_0x2bb249&&a86_0x1bfb89(Box,{'children':a86_0x1bfb89(Text,{'color':_0x55237d(0xc9),'children':_0x55237d(0xa8)})})]}),_0x46b402===_0x55237d(0xb8)&&a86_0x19d4ef(a86_0xd926ad,{'children':[a86_0x19d4ef(Box,{'children':[a86_0x1bfb89(Text,{'children':_0x55237d(0xb5)}),a86_0x1bfb89(Text,{'color':_0x55237d(0xc9),'children':'[optional]:\x20'}),a86_0x1bfb89(Text,{'color':'green','children':_0x2bb249}),_0x40041c&&a86_0x19d4ef(Text,{'color':_0x55237d(0xe3),'children':[_0x55237d(0xb2),_0x40041c]})]}),!_0x40041c&&a86_0x1bfb89(Box,{'children':a86_0x1bfb89(Text,{'color':'gray','children':_0x55237d(0xd3)})})]}),_0x46b402==='login-check'&&a86_0x19d4ef(Box,{'children':[a86_0x1bfb89(Text,{'children':_0x55237d(0xca)}),_0x228091&&a86_0x1bfb89(Text,{'color':'gray','children':'\x20Checking...'})]}),_0x46b402==='login-prompt'&&a86_0x19d4ef(a86_0xd926ad,{'children':[a86_0x1bfb89(Box,{'children':a86_0x1bfb89(Text,{'color':_0x55237d(0xad),'children':_0x55237d(0xe0)})}),a86_0x1bfb89(Box,{'marginTop':0x1,'children':a86_0x1bfb89(Text,{'children':_0x55237d(0xae)})}),a86_0x19d4ef(Box,{'marginLeft':0x2,'children':[a86_0x19d4ef(Text,{'color':_0x373787===0x0?_0x55237d(0xdc):_0x55237d(0xc9),'children':[_0x373787===0x0?'▶\x20':'\x20\x20',_0x55237d(0xd5)]}),a86_0x1bfb89(Text,{'children':'\x20'}),a86_0x19d4ef(Text,{'color':_0x373787===0x1?'green':'gray','children':[_0x373787===0x1?'▶\x20':'\x20\x20','No']})]}),a86_0x1bfb89(Box,{'children':a86_0x1bfb89(Text,{'color':_0x55237d(0xc9),'children':_0x55237d(0xd1)})})]}),_0x46b402==='login-process'&&a86_0x19d4ef(Box,{'children':[a86_0x1bfb89(Text,{'children':_0x55237d(0xda)}),_0x436d36&&a86_0x1bfb89(Text,{'color':'gray','children':'\x20Logging\x20in...'})]}),_0x46b402===_0x55237d(0xd8)&&a86_0x1bfb89(Box,{'children':a86_0x1bfb89(Text,{'color':'green','children':_0x55237d(0xd7)})})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a87_0x311b(){const _0x7b2823=['1110500fBBtif','78206ilhFuj','7881536rBKXgm','10dfjgpr','175fuEaJr','17IExpfB','8273177PcGjMK','2278266lHJBIk','replace','3460599gYpAOV','now','234798AHSiYH','30UGMYkW'];a87_0x311b=function(){return _0x7b2823;};return a87_0x311b();}function a87_0x151a(_0xd093dd,_0x2b2a6b){_0xd093dd=_0xd093dd-0xc9;const _0x311b88=a87_0x311b();let _0x151a0a=_0x311b88[_0xd093dd];return _0x151a0a;}(function(_0x40eb8e,_0xd22ebf){const _0x4d4be5=a87_0x151a,_0x1bf016=_0x40eb8e();while(!![]){try{const _0xa4b7f8=parseInt(_0x4d4be5(0xd3))/0x1*(-parseInt(_0x4d4be5(0xcf))/0x2)+-parseInt(_0x4d4be5(0xd5))/0x3+parseInt(_0x4d4be5(0xce))/0x4*(-parseInt(_0x4d4be5(0xd1))/0x5)+parseInt(_0x4d4be5(0xcc))/0x6*(parseInt(_0x4d4be5(0xd2))/0x7)+-parseInt(_0x4d4be5(0xd0))/0x8+parseInt(_0x4d4be5(0xca))/0x9+-parseInt(_0x4d4be5(0xcd))/0xa*(-parseInt(_0x4d4be5(0xd4))/0xb);if(_0xa4b7f8===_0xd22ebf)break;else _0x1bf016['push'](_0x1bf016['shift']());}catch(_0x341c25){_0x1bf016['push'](_0x1bf016['shift']());}}}(a87_0x311b,0x9fcce));export function formatElapsed(_0x37f299){const _0x4b6481=a87_0x151a,_0x140af5=Date[_0x4b6481(0xcb)]()-_0x37f299;if(_0x140af5<0x3e8)return _0x140af5+'ms';const _0x303aba=(_0x140af5/0x3e8)['toFixed'](0x2),_0x2ab825=_0x303aba[_0x4b6481(0xc9)](/\.?0+$/u,'');return _0x2ab825+'s';}
|
package/lib/create-app/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x13a17c,_0x5912de){const _0x79aff9=a87_0x3bb5,_0x219f8c=_0x13a17c();while(!![]){try{const _0x59b109=-parseInt(_0x79aff9(0xa0))/0x1*(-parseInt(_0x79aff9(0xba))/0x2)+-parseInt(_0x79aff9(0x8a))/0x3*(-parseInt(_0x79aff9(0xb8))/0x4)+parseInt(_0x79aff9(0x96))/0x5+parseInt(_0x79aff9(0xd9))/0x6*(-parseInt(_0x79aff9(0x9b))/0x7)+-parseInt(_0x79aff9(0x90))/0x8+-parseInt(_0x79aff9(0xac))/0x9*(-parseInt(_0x79aff9(0x9c))/0xa)+parseInt(_0x79aff9(0xcf))/0xb;if(_0x59b109===_0x5912de)break;else _0x219f8c['push'](_0x219f8c['shift']());}catch(_0x497c61){_0x219f8c['push'](_0x219f8c['shift']());}}}(a87_0x2fb4,0x2fd6b));import{jsx as a87_0x1ff642,Fragment as a87_0x4b3849,jsxs as a87_0x38b553}from'react/jsx-runtime';function a87_0x3bb5(_0x535d06,_0x498e0f){_0x535d06=_0x535d06-0x84;const _0x2fb411=a87_0x2fb4();let _0x3bb57a=_0x2fb411[_0x535d06];return _0x3bb57a;}import a87_0x209598 from'path';function a87_0x2fb4(){const _0x82ca45=['rmSync','error','description','Project\x20name\x20cannot\x20be\x20empty','env','Project\x20directory\x20','项目创建完成:\x20','test','existsSync','constants','stringify','8235vcZgqr','√\x20Pulled\x20','projectCode','green','API\x20configuration\x20pulled:\x20','version','\x20Generated\x20by\x20rabetbase\x20cli\x20','更新\x20package.json\x20失败','stableVersion','cwd','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','项目创建失败:\x20','29292gYKbTN','\x20already\x20exists,\x20please\x20use\x20a\x20different\x20name','14228LRpbIq','!\x20API\x20configuration\x20pull\x20error,\x20project\x20created,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','doTask','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27rabetbase\x20config\x20set\x20appcode\x20<app-code>\x27','Start\x20project:','length','currentVersion','warn','trim','info','create','../..','cyan','accessSync','success','🚀\x20Next\x20Steps:','string','resolve','appCode','join','1208328vkMdqe','log','projectName','\x20|\x20AppCode:\x20','name','dirname','white','1.0.0','parse','\x20dataset(s),\x20generated\x20','12rifSIN','cookie','modelCount','Project\x20name:\x20','√\x20Configuration\x20file\x20created,\x20AppCode:\x20','清理项目目录失败:\x20','\x20√\x20','production','1.\x20','readFileSync','setLogPath','column','./src/api/','repeat','Project\x20name\x20contains\x20invalid\x20characters.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','3cWiLYa','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','rabetbase\x20api\x20pull','2.\x20','cd\x20','配置应用AppCode失败','942528BaorDG','√\x20package.json\x20updated:\x20name=','utf8','needsUpgrade','×\x20Project\x20creation\x20failed:\x20','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','634815RqzIUl','yellow','chdir','开始创建项目:\x20','message','394233mTymxO','1370OInouL','package.json','配置应用AppCode:\x20','then','8qDSvOy'];a87_0x2fb4=function(){return _0x82ca45;};return a87_0x2fb4();}import a87_0x118fc0 from'fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{fetchModelList}from'../api/fetch-model-list.js';import{generateApiFile}from'../api/generate-api-file.js';import{initEnv}from'../constant/env.js';import{readConfig}from'../utils/config.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../context.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';export function CreateApp(_0x14be20){const _0x2a30e6=a87_0x3bb5,[_0x139dc0,_0x59418e]=useState(![]),[_0x4e1dee,_0x1ca472]=useState(![]),[_0x2f6b3a,_0x1d9b48]=useState(![]),[_0x276697,_0x55135a]=useState(null),_0x43f85f=useCopyProjectTemplate(),_0x3dfd19=useInstallDependencies(),_0x3d62dc=useFormatCode();useEffect(()=>{const _0xa7ab93=a87_0x3bb5;checkCliVersion()[_0xa7ab93(0x9f)](_0x554b10=>{const _0x4ac534=_0xa7ab93;_0x554b10[_0x4ac534(0x93)]&&(printCliUpgradeWarning(_0x554b10),logger['info'](_0x4ac534(0xc5),'CLI\x20版本检查',{'currentVersion':_0x554b10[_0x4ac534(0xc1)],'stableVersion':_0x554b10[_0x4ac534(0xb4)],'needsUpgrade':_0x554b10[_0x4ac534(0x93)]}));});},[]);const _0x1ac7e4=async _0x166a09=>{const _0x20b4ba=a87_0x3bb5;if(!_0x166a09[_0x20b4ba(0xd1)]||_0x166a09[_0x20b4ba(0xd1)][_0x20b4ba(0xc3)]()===''){console[_0x20b4ba(0xa2)](_0x20b4ba(0xa4));return;}const _0x329d51=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x329d51[_0x20b4ba(0xa8)](_0x166a09[_0x20b4ba(0xd1)])){console[_0x20b4ba(0xa2)](_0x20b4ba(0x89));return;}if(_0x166a09[_0x20b4ba(0xd1)][_0x20b4ba(0xc0)]>0x64){console[_0x20b4ba(0xa2)](_0x20b4ba(0xbd));return;}const _0x15df00=a87_0x209598[_0x20b4ba(0xcc)](process[_0x20b4ba(0xb5)](),_0x166a09[_0x20b4ba(0xd1)]);if(a87_0x118fc0['existsSync'](_0x15df00)){console[_0x20b4ba(0xa2)](_0x20b4ba(0xa6)+_0x166a09['projectName']+_0x20b4ba(0xb9));return;}try{const _0x3a6694=a87_0x209598[_0x20b4ba(0xd4)](_0x15df00);a87_0x118fc0[_0x20b4ba(0xc8)](_0x3a6694,a87_0x118fc0[_0x20b4ba(0xaa)]['W_OK']);}catch(_0x18b52b){console[_0x20b4ba(0xa2)]('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');return;}_0x55135a(_0x166a09),_0x59418e(!![]),logger[_0x20b4ba(0x85)](_0x15df00),logger['info']('create',_0x20b4ba(0x99)+_0x166a09[_0x20b4ba(0xd1)],{'projectDir':_0x15df00,'appCode':_0x166a09['appCode']});try{await _0x43f85f[_0x20b4ba(0xbc)](_0x166a09[_0x20b4ba(0xd1)]),await _0x6019ab(_0x166a09[_0x20b4ba(0xd1)]),await _0x3dfd19['doTask'](_0x166a09[_0x20b4ba(0xd1)]),await _0x3d62dc[_0x20b4ba(0xbc)](_0x166a09[_0x20b4ba(0xd1)]),await _0x45748b(_0x166a09[_0x20b4ba(0xd1)],_0x166a09[_0x20b4ba(0xcd)]||'',_0x166a09[_0x20b4ba(0xa5)]);if(_0x166a09[_0x20b4ba(0xcd)]){console[_0x20b4ba(0xd0)]('*\x20Pulling\x20API\x20configuration...');const _0x54b190=process[_0x20b4ba(0xb5)]();try{process[_0x20b4ba(0x98)](_0x15df00);const _0x3ee441=_0x166a09[_0x20b4ba(0xa5)]||_0x20b4ba(0xe0);initEnv(_0x3ee441);const {configArray:_0x1cc040}=await fetchModelList(_0x166a09[_0x20b4ba(0xcd)],_0x14be20[_0x20b4ba(0xda)]||''),_0x50d84c=_0x20b4ba(0x87),_0x210037=await generateApiFile(_0x1cc040,'',_0x166a09['appCode'],!![],_0x3ee441,_0x50d84c);console['log'](_0x20b4ba(0xad)+_0x1cc040[_0x20b4ba(0xc0)]+_0x20b4ba(0xd8)+_0x210037[_0x20b4ba(0xdb)]+'\x20model(s)'),logger[_0x20b4ba(0xc4)]('create',_0x20b4ba(0xb0)+_0x166a09[_0x20b4ba(0xcd)]),_0x1d9b48(!![]);}catch(_0x48ad64){console['log'](_0x20b4ba(0xbb)),logger[_0x20b4ba(0xc2)]('create','API\x20配置拉取异常',{'error':_0x48ad64 instanceof Error?_0x48ad64[_0x20b4ba(0x9a)]:String(_0x48ad64)});}finally{process['chdir'](_0x54b190);}}logger[_0x20b4ba(0xc9)](_0x20b4ba(0xc5),_0x20b4ba(0xa7)+_0x166a09[_0x20b4ba(0xd1)]),_0x1ca472(!![]),_0x59418e(![]);}catch(_0x5cfaa5){logger['error'](_0x20b4ba(0xc5),_0x20b4ba(0xb7)+_0x166a09[_0x20b4ba(0xd1)],{'error':_0x5cfaa5 instanceof Error?_0x5cfaa5[_0x20b4ba(0x9a)]:String(_0x5cfaa5)});try{a87_0x118fc0[_0x20b4ba(0xa9)](_0x15df00)&&(console[_0x20b4ba(0xd0)](_0x20b4ba(0x8b)+_0x15df00),a87_0x118fc0[_0x20b4ba(0xa1)](_0x15df00,{'recursive':!![],'force':!![]}));}catch(_0x1b1856){logger[_0x20b4ba(0xc2)](_0x20b4ba(0xc5),_0x20b4ba(0xde)+_0x15df00);}_0x59418e(![]),console[_0x20b4ba(0xa2)](_0x20b4ba(0x94)+(_0x5cfaa5 instanceof Error?_0x5cfaa5[_0x20b4ba(0x9a)]:String(_0x5cfaa5)));}},_0x5655e3=async _0xe132f1=>{await _0x1ac7e4({'projectName':_0xe132f1,'env':_0x14be20['env']});},_0x6019ab=async _0x449f52=>{const _0x5c2945=a87_0x3bb5,_0x2f9e33=a87_0x209598[_0x5c2945(0xcc)](process[_0x5c2945(0xb5)](),_0x449f52),_0x407833=a87_0x209598[_0x5c2945(0xce)](_0x2f9e33,_0x5c2945(0x9d));try{console[_0x5c2945(0xd0)](_0x5c2945(0x95));const _0x4adbb4=fileURLToPath(import.meta.url),_0x2fa01d=a87_0x209598[_0x5c2945(0xcc)](a87_0x209598[_0x5c2945(0xd4)](_0x4adbb4),'../..'),_0x21d644=a87_0x209598[_0x5c2945(0xce)](_0x2fa01d,_0x5c2945(0x9d));let _0x39a082='1.0.0';try{const _0x2012d2=JSON[_0x5c2945(0xd7)](a87_0x118fc0[_0x5c2945(0x84)](_0x21d644,_0x5c2945(0x92)));_0x39a082=_0x2012d2[_0x5c2945(0xb1)]||_0x5c2945(0xd6);}catch(_0x2cf30d){}const _0x1ca11f=a87_0x118fc0['readFileSync'](_0x407833,_0x5c2945(0x92)),_0x22b8bb=JSON['parse'](_0x1ca11f);_0x22b8bb[_0x5c2945(0xd3)]=_0x449f52,_0x22b8bb[_0x5c2945(0xa3)]=_0x449f52+_0x5c2945(0xb2)+_0x39a082,a87_0x118fc0['writeFileSync'](_0x407833,JSON[_0x5c2945(0xab)](_0x22b8bb,null,0x2)+'\x0a',_0x5c2945(0x92)),console[_0x5c2945(0xd0)](_0x5c2945(0x91)+_0x449f52),logger['info']('create','更新\x20package.json\x20name');}catch(_0x389b01){logger[_0x5c2945(0xa2)](_0x5c2945(0xc5),_0x5c2945(0xb3));throw _0x389b01;}},_0x45748b=async(_0x5d9c71,_0x5045f2,_0x41ed87)=>{const _0x1efd43=a87_0x3bb5,_0x3f09f2=a87_0x209598[_0x1efd43(0xcc)](process['cwd'](),_0x5d9c71),_0x2c5987=a87_0x209598[_0x1efd43(0xce)](_0x3f09f2,NEW_CONFIG_NAME);try{_0x5045f2?console[_0x1efd43(0xd0)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x5d9c71+':\x20'+_0x5045f2):console['log'](_0x1efd43(0xb6)+_0x5d9c71);const _0x2276b9=fileURLToPath(import.meta.url),_0xb95d92=a87_0x209598[_0x1efd43(0xcc)](a87_0x209598[_0x1efd43(0xd4)](_0x2276b9),_0x1efd43(0xc6)),_0x305dd1=a87_0x209598[_0x1efd43(0xce)](_0xb95d92,'package.json');let _0x3f842a='1.0.0';try{const _0x217532=JSON[_0x1efd43(0xd7)](a87_0x118fc0[_0x1efd43(0x84)](_0x305dd1,_0x1efd43(0x92)));_0x3f842a=_0x217532[_0x1efd43(0xb1)]||_0x1efd43(0xd6);}catch{}const _0x9bbbdb=readConfig(),_0x5a470c=typeof _0x9bbbdb['env']===_0x1efd43(0xcb)?_0x9bbbdb[_0x1efd43(0xa5)]:undefined,{app:_0x5190a1,appcode:_0x48f9db,..._0x269b44}=_0x9bbbdb,_0x65a638={..._0x269b44,'appcode':_0x5045f2||'','env':_0x41ed87||_0x5a470c||'production','createdAt':new Date()['toLocaleString'](),'version':_0x3f842a};writeConfigFile(_0x2c5987,_0x65a638),_0x5045f2?console['log'](_0x1efd43(0xdd)+_0x5045f2):console[_0x1efd43(0xd0)](_0x1efd43(0xbe)),logger[_0x1efd43(0xc4)](_0x1efd43(0xc5),_0x1efd43(0x9e)+_0x5045f2);}catch(_0x2472ab){logger[_0x1efd43(0xa2)]('create',_0x1efd43(0x8f));}};useEffect(()=>{const _0x38ad15=a87_0x3bb5;_0x14be20[_0x38ad15(0xae)]&&_0x5655e3(_0x14be20[_0x38ad15(0xae)]);},[_0x14be20['projectCode']]);if(!_0x139dc0&&!_0x4e1dee&&!_0x14be20['projectCode'])return a87_0x1ff642(EnhancedGuidedCreate,{'onCreate':_0x1ac7e4,'env':_0x14be20[_0x2a30e6(0xa5)]});if(_0x139dc0)return a87_0x38b553(a87_0x4b3849,{'children':[a87_0x38b553(Box,{'marginTop':0x1,'children':[a87_0x1ff642(Box,{'width':'1'}),a87_0x1ff642(Text,{'color':'green','children':_0x2a30e6(0xdf)}),a87_0x1ff642(Text,{'children':_0x2a30e6(0xdc)}),a87_0x1ff642(Text,{'color':_0x2a30e6(0xaf),'children':_0x276697?.['projectName']}),_0x276697?.[_0x2a30e6(0xcd)]&&a87_0x38b553(a87_0x4b3849,{'children':[a87_0x1ff642(Text,{'children':_0x2a30e6(0xd2)}),a87_0x1ff642(Text,{'color':_0x2a30e6(0xc7),'children':_0x276697['appCode']})]})]}),a87_0x1ff642(TaskRunning,{..._0x43f85f}),a87_0x1ff642(TaskRunning,{..._0x3dfd19}),a87_0x1ff642(TaskRunning,{..._0x3d62dc})]});if(_0x4e1dee)return a87_0x38b553(a87_0x4b3849,{'children':[a87_0x38b553(Box,{'marginTop':0x1,'children':[a87_0x1ff642(Box,{'width':'1'}),a87_0x1ff642(Text,{'color':'green','children':'\x20√\x20'}),a87_0x1ff642(Text,{'children':_0x2a30e6(0xdc)}),a87_0x1ff642(Text,{'color':'green','children':_0x276697?.['projectName']}),_0x276697?.[_0x2a30e6(0xcd)]&&a87_0x38b553(a87_0x4b3849,{'children':[a87_0x1ff642(Text,{'children':_0x2a30e6(0xd2)}),a87_0x1ff642(Text,{'color':_0x2a30e6(0xc7),'children':_0x276697['appCode']})]})]}),a87_0x1ff642(TaskFinished,{..._0x43f85f}),a87_0x1ff642(TaskFinished,{..._0x3dfd19}),a87_0x1ff642(TaskFinished,{..._0x3d62dc}),a87_0x1ff642(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a87_0x1ff642(Text,{'color':'green','children':'─'[_0x2a30e6(0x88)](0x3c)})}),a87_0x1ff642(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a87_0x1ff642(Text,{'color':'cyan','bold':!![],'children':_0x2a30e6(0xca)})}),a87_0x38b553(Box,{'marginLeft':0x2,'flexDirection':_0x2a30e6(0x86),'children':[a87_0x38b553(Box,{'children':[a87_0x1ff642(Text,{'color':_0x2a30e6(0xaf),'children':_0x2a30e6(0xe1)}),a87_0x1ff642(Text,{'color':_0x2a30e6(0xd5),'children':_0x2a30e6(0xbf)}),a87_0x1ff642(Text,{'color':_0x2a30e6(0xc7),'bold':!![],'children':_0x2a30e6(0x8e)+_0x276697?.[_0x2a30e6(0xd1)]+'\x20&&\x20rabetbase\x20run\x20start'})]}),_0x276697?.[_0x2a30e6(0xcd)]&&!_0x2f6b3a&&a87_0x38b553(Box,{'marginTop':0x1,'children':[a87_0x1ff642(Text,{'color':_0x2a30e6(0x97),'children':_0x2a30e6(0x8d)}),a87_0x1ff642(Text,{'color':'white','children':'Pull\x20API\x20configuration:'}),a87_0x1ff642(Text,{'color':_0x2a30e6(0xc7),'bold':!![],'children':_0x2a30e6(0x8c)})]})]}),a87_0x1ff642(Box,{'marginTop':0x1,'children':a87_0x1ff642(Text,{'color':_0x2a30e6(0xaf),'children':'─'['repeat'](0x3c)})})]});return null;}
|
|
1
|
+
(function(_0xed39f0,_0x14a9fd){const _0x43ca66=a88_0x4d3e,_0x580f14=_0xed39f0();while(!![]){try{const _0x45e8bb=-parseInt(_0x43ca66(0x17c))/0x1+parseInt(_0x43ca66(0x15d))/0x2*(-parseInt(_0x43ca66(0x195))/0x3)+-parseInt(_0x43ca66(0x18d))/0x4+parseInt(_0x43ca66(0x172))/0x5+-parseInt(_0x43ca66(0x1a2))/0x6*(-parseInt(_0x43ca66(0x19e))/0x7)+parseInt(_0x43ca66(0x188))/0x8+parseInt(_0x43ca66(0x184))/0x9*(parseInt(_0x43ca66(0x19d))/0xa);if(_0x45e8bb===_0x14a9fd)break;else _0x580f14['push'](_0x580f14['shift']());}catch(_0x3d6bec){_0x580f14['push'](_0x580f14['shift']());}}}(a88_0xbd85,0x7406b));function a88_0x4d3e(_0x5c96cb,_0x467f28){_0x5c96cb=_0x5c96cb-0x159;const _0xbd85f8=a88_0xbd85();let _0x4d3e3=_0xbd85f8[_0x5c96cb];return _0x4d3e3;}import{jsx as a88_0x165e89,Fragment as a88_0x187d90,jsxs as a88_0x3d4fb7}from'react/jsx-runtime';import a88_0x43b42f from'path';import a88_0x345ca1 from'fs';import{fileURLToPath}from'node:url';import{Box,Text}from'ink';function a88_0xbd85(){const _0xa3de5e=['dirname','doTask','*\x20Configuring\x20AppCode\x20for\x20project\x20','repeat','×\x20Project\x20creation\x20failed:\x20','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','11191815jsMuWR','success','更新\x20package.json\x20失败','version','321408CxNfNP','writeFileSync','currentVersion','existsSync','2.\x20','1774284YijfRT','项目创建失败:\x20','toLocaleString','string','utf8','Project\x20name\x20contains\x20invalid\x20characters.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','error','resolve','89772pRFIRe','join','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27rabetbase\x20config\x20set\x20appcode\x20<app-code>\x27','API\x20configuration\x20pulled:\x20','chdir','\x20&&\x20rabetbase\x20run\x20start','清理项目目录失败:\x20','\x20√\x20','10xuCvSk','7BvFuqK','green','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','log','2479458SFezsW','CLI\x20版本检查','配置应用AppCode失败','production','配置应用AppCode:\x20','cyan','√\x20package.json\x20updated:\x20name=','\x20Generated\x20by\x20rabetbase\x20cli\x20','needsUpgrade','appCode','*\x20Pulling\x20API\x20configuration...','🚀\x20Next\x20Steps:','parse','readFileSync','length','开始创建项目:\x20','1.\x20','package.json','cd\x20','34iqdsSV','description','rmSync','then','Start\x20project:','\x20|\x20AppCode:\x20','stableVersion','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','message','rabetbase\x20api\x20pull','test','name','√\x20Pulled\x20','create','W_OK','Project\x20directory\x20','cookie','info','white','env','3227095moJWcH','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','cwd','accessSync','Project\x20name:\x20','warn','projectCode','√\x20Configuration\x20file\x20created,\x20AppCode:\x20','../..','projectName','914851QttNZs','1.0.0'];a88_0xbd85=function(){return _0xa3de5e;};return a88_0xbd85();}import{useEffect,useState}from'react';import{EnhancedGuidedCreate}from'./enhanced-guided-create.js';import{fetchModelList}from'../api/fetch-model-list.js';import{generateApiFile}from'../api/generate-api-file.js';import{initEnv}from'../constant/env.js';import{readConfig}from'../utils/config.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../context.js';import{useCopyProjectTemplate}from'./use-copy-project-template.js';import{useInstallDependencies}from'./use-install-dependencies.js';import{useFormatCode}from'./use-format-code.js';import{TaskFinished}from'./task-finished.js';import{TaskRunning}from'./task-running.js';import{logger}from'../utils/logger.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';export function CreateApp(_0x22e9f2){const _0x347452=a88_0x4d3e,[_0xe58826,_0x148231]=useState(![]),[_0x3499b0,_0x1caa91]=useState(![]),[_0x1a1aa1,_0x26ee34]=useState(![]),[_0xcde3ea,_0x59001b]=useState(null),_0x48cdc9=useCopyProjectTemplate(),_0x190789=useInstallDependencies(),_0x41ffd4=useFormatCode();useEffect(()=>{const _0x12bf0e=a88_0x4d3e;checkCliVersion()[_0x12bf0e(0x160)](_0x146a2f=>{const _0x47f881=_0x12bf0e;_0x146a2f[_0x47f881(0x1aa)]&&(printCliUpgradeWarning(_0x146a2f),logger['info'](_0x47f881(0x16b),_0x47f881(0x1a3),{'currentVersion':_0x146a2f[_0x47f881(0x18a)],'stableVersion':_0x146a2f[_0x47f881(0x163)],'needsUpgrade':_0x146a2f[_0x47f881(0x1aa)]}));});},[]);const _0x3747f1=async _0x1448ff=>{const _0xf3ef7d=a88_0x4d3e;if(!_0x1448ff['projectName']||_0x1448ff[_0xf3ef7d(0x17b)]['trim']()===''){console['error']('Project\x20name\x20cannot\x20be\x20empty');return;}const _0x74e7f0=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x74e7f0[_0xf3ef7d(0x168)](_0x1448ff[_0xf3ef7d(0x17b)])){console[_0xf3ef7d(0x193)](_0xf3ef7d(0x192));return;}if(_0x1448ff[_0xf3ef7d(0x17b)][_0xf3ef7d(0x1b0)]>0x64){console[_0xf3ef7d(0x193)](_0xf3ef7d(0x165));return;}const _0x43eddc=a88_0x43b42f['resolve'](process['cwd'](),_0x1448ff[_0xf3ef7d(0x17b)]);if(a88_0x345ca1[_0xf3ef7d(0x18b)](_0x43eddc)){console['error'](_0xf3ef7d(0x16d)+_0x1448ff[_0xf3ef7d(0x17b)]+'\x20already\x20exists,\x20please\x20use\x20a\x20different\x20name');return;}try{const _0x4374cc=a88_0x43b42f[_0xf3ef7d(0x17e)](_0x43eddc);a88_0x345ca1[_0xf3ef7d(0x175)](_0x4374cc,a88_0x345ca1['constants'][_0xf3ef7d(0x16c)]);}catch(_0x41d3b0){console['error'](_0xf3ef7d(0x183));return;}_0x59001b(_0x1448ff),_0x148231(!![]),logger['setLogPath'](_0x43eddc),logger[_0xf3ef7d(0x16f)](_0xf3ef7d(0x16b),_0xf3ef7d(0x159)+_0x1448ff[_0xf3ef7d(0x17b)],{'projectDir':_0x43eddc,'appCode':_0x1448ff[_0xf3ef7d(0x1ab)]});try{await _0x48cdc9[_0xf3ef7d(0x17f)](_0x1448ff['projectName']),await _0xf14b84(_0x1448ff[_0xf3ef7d(0x17b)]),await _0x190789['doTask'](_0x1448ff[_0xf3ef7d(0x17b)]),await _0x41ffd4[_0xf3ef7d(0x17f)](_0x1448ff[_0xf3ef7d(0x17b)]),await _0x3d9f82(_0x1448ff[_0xf3ef7d(0x17b)],_0x1448ff[_0xf3ef7d(0x1ab)]||'',_0x1448ff[_0xf3ef7d(0x171)]);if(_0x1448ff[_0xf3ef7d(0x1ab)]){console[_0xf3ef7d(0x1a1)](_0xf3ef7d(0x1ac));const _0x1fb885=process[_0xf3ef7d(0x174)]();try{process[_0xf3ef7d(0x199)](_0x43eddc);const _0x1f387c=_0x1448ff[_0xf3ef7d(0x171)]||'production';initEnv(_0x1f387c);const {configArray:_0x139f2e}=await fetchModelList(_0x1448ff[_0xf3ef7d(0x1ab)],_0x22e9f2[_0xf3ef7d(0x16e)]||''),_0x1c3f77='./src/api/',_0x2b7e69=await generateApiFile(_0x139f2e,'',_0x1448ff[_0xf3ef7d(0x1ab)],!![],_0x1f387c,_0x1c3f77);console[_0xf3ef7d(0x1a1)](_0xf3ef7d(0x16a)+_0x139f2e['length']+'\x20dataset(s),\x20generated\x20'+_0x2b7e69['modelCount']+'\x20model(s)'),logger[_0xf3ef7d(0x16f)]('create',_0xf3ef7d(0x198)+_0x1448ff[_0xf3ef7d(0x1ab)]),_0x26ee34(!![]);}catch(_0x3c4d3c){console[_0xf3ef7d(0x1a1)]('!\x20API\x20configuration\x20pull\x20error,\x20project\x20created,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull'),logger[_0xf3ef7d(0x177)](_0xf3ef7d(0x16b),'API\x20配置拉取异常',{'error':_0x3c4d3c instanceof Error?_0x3c4d3c[_0xf3ef7d(0x166)]:String(_0x3c4d3c)});}finally{process['chdir'](_0x1fb885);}}logger[_0xf3ef7d(0x185)](_0xf3ef7d(0x16b),'项目创建完成:\x20'+_0x1448ff['projectName']),_0x1caa91(!![]),_0x148231(![]);}catch(_0x349732){logger[_0xf3ef7d(0x193)]('create',_0xf3ef7d(0x18e)+_0x1448ff[_0xf3ef7d(0x17b)],{'error':_0x349732 instanceof Error?_0x349732[_0xf3ef7d(0x166)]:String(_0x349732)});try{a88_0x345ca1['existsSync'](_0x43eddc)&&(console[_0xf3ef7d(0x1a1)](_0xf3ef7d(0x1a0)+_0x43eddc),a88_0x345ca1[_0xf3ef7d(0x15f)](_0x43eddc,{'recursive':!![],'force':!![]}));}catch(_0x1a335b){logger['warn'](_0xf3ef7d(0x16b),_0xf3ef7d(0x19b)+_0x43eddc);}_0x148231(![]),console[_0xf3ef7d(0x193)](_0xf3ef7d(0x182)+(_0x349732 instanceof Error?_0x349732[_0xf3ef7d(0x166)]:String(_0x349732)));}},_0x58b54c=async _0x2db9fc=>{const _0x59dfb5=a88_0x4d3e;await _0x3747f1({'projectName':_0x2db9fc,'env':_0x22e9f2[_0x59dfb5(0x171)]});},_0xf14b84=async _0x344507=>{const _0x4b83e6=a88_0x4d3e,_0x34bb5f=a88_0x43b42f[_0x4b83e6(0x194)](process[_0x4b83e6(0x174)](),_0x344507),_0x3091b0=a88_0x43b42f['join'](_0x34bb5f,'package.json');try{console[_0x4b83e6(0x1a1)](_0x4b83e6(0x173));const _0x4ced8b=fileURLToPath(import.meta.url),_0x1d67cc=a88_0x43b42f[_0x4b83e6(0x194)](a88_0x43b42f[_0x4b83e6(0x17e)](_0x4ced8b),_0x4b83e6(0x17a)),_0x530469=a88_0x43b42f[_0x4b83e6(0x196)](_0x1d67cc,_0x4b83e6(0x15b));let _0x48f488=_0x4b83e6(0x17d);try{const _0x1a33ae=JSON[_0x4b83e6(0x1ae)](a88_0x345ca1[_0x4b83e6(0x1af)](_0x530469,_0x4b83e6(0x191)));_0x48f488=_0x1a33ae[_0x4b83e6(0x187)]||'1.0.0';}catch(_0x2e75d6){}const _0x5d831b=a88_0x345ca1[_0x4b83e6(0x1af)](_0x3091b0,_0x4b83e6(0x191)),_0x3458aa=JSON[_0x4b83e6(0x1ae)](_0x5d831b);_0x3458aa[_0x4b83e6(0x169)]=_0x344507,_0x3458aa[_0x4b83e6(0x15e)]=_0x344507+_0x4b83e6(0x1a9)+_0x48f488,a88_0x345ca1[_0x4b83e6(0x189)](_0x3091b0,JSON['stringify'](_0x3458aa,null,0x2)+'\x0a','utf8'),console[_0x4b83e6(0x1a1)](_0x4b83e6(0x1a8)+_0x344507),logger[_0x4b83e6(0x16f)]('create','更新\x20package.json\x20name');}catch(_0x2c0e79){logger[_0x4b83e6(0x193)]('create',_0x4b83e6(0x186));throw _0x2c0e79;}},_0x3d9f82=async(_0x145989,_0x375121,_0x3893ec)=>{const _0x5117da=a88_0x4d3e,_0x1aeb33=a88_0x43b42f[_0x5117da(0x194)](process[_0x5117da(0x174)](),_0x145989),_0x42c13b=a88_0x43b42f[_0x5117da(0x196)](_0x1aeb33,NEW_CONFIG_NAME);try{_0x375121?console[_0x5117da(0x1a1)](_0x5117da(0x180)+_0x145989+':\x20'+_0x375121):console[_0x5117da(0x1a1)](_0x5117da(0x164)+_0x145989);const _0x557a0b=fileURLToPath(import.meta.url),_0x324ba5=a88_0x43b42f[_0x5117da(0x194)](a88_0x43b42f['dirname'](_0x557a0b),'../..'),_0x4c835e=a88_0x43b42f['join'](_0x324ba5,_0x5117da(0x15b));let _0x256143=_0x5117da(0x17d);try{const _0x5cda48=JSON[_0x5117da(0x1ae)](a88_0x345ca1['readFileSync'](_0x4c835e,_0x5117da(0x191)));_0x256143=_0x5cda48[_0x5117da(0x187)]||_0x5117da(0x17d);}catch{}const _0x7430be=readConfig(),_0x51d112=typeof _0x7430be[_0x5117da(0x171)]===_0x5117da(0x190)?_0x7430be[_0x5117da(0x171)]:undefined,{app:_0x384cb1,appcode:_0x43b895,..._0x517ef7}=_0x7430be,_0x37dc3={..._0x517ef7,'appcode':_0x375121||'','env':_0x3893ec||_0x51d112||_0x5117da(0x1a5),'createdAt':new Date()[_0x5117da(0x18f)](),'version':_0x256143};writeConfigFile(_0x42c13b,_0x37dc3),_0x375121?console[_0x5117da(0x1a1)](_0x5117da(0x179)+_0x375121):console[_0x5117da(0x1a1)](_0x5117da(0x197)),logger[_0x5117da(0x16f)](_0x5117da(0x16b),_0x5117da(0x1a6)+_0x375121);}catch(_0x1dbd8a){logger[_0x5117da(0x193)](_0x5117da(0x16b),_0x5117da(0x1a4));}};useEffect(()=>{const _0xf8fed2=a88_0x4d3e;_0x22e9f2[_0xf8fed2(0x178)]&&_0x58b54c(_0x22e9f2[_0xf8fed2(0x178)]);},[_0x22e9f2[_0x347452(0x178)]]);if(!_0xe58826&&!_0x3499b0&&!_0x22e9f2[_0x347452(0x178)])return a88_0x165e89(EnhancedGuidedCreate,{'onCreate':_0x3747f1,'env':_0x22e9f2[_0x347452(0x171)]});if(_0xe58826)return a88_0x3d4fb7(a88_0x187d90,{'children':[a88_0x3d4fb7(Box,{'marginTop':0x1,'children':[a88_0x165e89(Box,{'width':'1'}),a88_0x165e89(Text,{'color':_0x347452(0x19f),'children':'\x20√\x20'}),a88_0x165e89(Text,{'children':_0x347452(0x176)}),a88_0x165e89(Text,{'color':_0x347452(0x19f),'children':_0xcde3ea?.[_0x347452(0x17b)]}),_0xcde3ea?.['appCode']&&a88_0x3d4fb7(a88_0x187d90,{'children':[a88_0x165e89(Text,{'children':_0x347452(0x162)}),a88_0x165e89(Text,{'color':_0x347452(0x1a7),'children':_0xcde3ea[_0x347452(0x1ab)]})]})]}),a88_0x165e89(TaskRunning,{..._0x48cdc9}),a88_0x165e89(TaskRunning,{..._0x190789}),a88_0x165e89(TaskRunning,{..._0x41ffd4})]});if(_0x3499b0)return a88_0x3d4fb7(a88_0x187d90,{'children':[a88_0x3d4fb7(Box,{'marginTop':0x1,'children':[a88_0x165e89(Box,{'width':'1'}),a88_0x165e89(Text,{'color':_0x347452(0x19f),'children':_0x347452(0x19c)}),a88_0x165e89(Text,{'children':_0x347452(0x176)}),a88_0x165e89(Text,{'color':'green','children':_0xcde3ea?.['projectName']}),_0xcde3ea?.[_0x347452(0x1ab)]&&a88_0x3d4fb7(a88_0x187d90,{'children':[a88_0x165e89(Text,{'children':'\x20|\x20AppCode:\x20'}),a88_0x165e89(Text,{'color':_0x347452(0x1a7),'children':_0xcde3ea[_0x347452(0x1ab)]})]})]}),a88_0x165e89(TaskFinished,{..._0x48cdc9}),a88_0x165e89(TaskFinished,{..._0x190789}),a88_0x165e89(TaskFinished,{..._0x41ffd4}),a88_0x165e89(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a88_0x165e89(Text,{'color':'green','children':'─'[_0x347452(0x181)](0x3c)})}),a88_0x165e89(Box,{'marginTop':0x1,'marginBottom':0x1,'children':a88_0x165e89(Text,{'color':_0x347452(0x1a7),'bold':!![],'children':_0x347452(0x1ad)})}),a88_0x3d4fb7(Box,{'marginLeft':0x2,'flexDirection':'column','children':[a88_0x3d4fb7(Box,{'children':[a88_0x165e89(Text,{'color':_0x347452(0x19f),'children':_0x347452(0x15a)}),a88_0x165e89(Text,{'color':_0x347452(0x170),'children':_0x347452(0x161)}),a88_0x165e89(Text,{'color':_0x347452(0x1a7),'bold':!![],'children':_0x347452(0x15c)+_0xcde3ea?.[_0x347452(0x17b)]+_0x347452(0x19a)})]}),_0xcde3ea?.[_0x347452(0x1ab)]&&!_0x1a1aa1&&a88_0x3d4fb7(Box,{'marginTop':0x1,'children':[a88_0x165e89(Text,{'color':'yellow','children':_0x347452(0x18c)}),a88_0x165e89(Text,{'color':'white','children':'Pull\x20API\x20configuration:'}),a88_0x165e89(Text,{'color':_0x347452(0x1a7),'bold':!![],'children':_0x347452(0x167)})]})]}),a88_0x165e89(Box,{'marginTop':0x1,'children':a88_0x165e89(Text,{'color':_0x347452(0x19f),'children':'─'[_0x347452(0x181)](0x3c)})})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a89_0x4563(){const _0x3e448f=['utf-8','writeFile','Project\x20name\x20cannot\x20be\x20empty','\x20\x20Installing\x20dependencies...','402957unSPjg','8MTqWOf','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','env','W_OK','311590wJxqni','error','stringify','readFile','test','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','1493040StgsVJ','npm','bun\x20--version','509398sCCZAh','\x0a\x20\x20cd\x20','resolve','285135gjcEJu','bun\x20run\x20format','4914UfsvSx','length','message','...','12tFjVfa','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','bun','log','\x20install','\x20created\x20successfully!','10WLKTwT','../../templates/projects/sub-app-react-demo','776uMLisO','*\x20Creating\x20project\x20','needsUpgrade','join','依赖安装失败:\x20','dirname','Project\x20name\x20contains\x20invalid\x20characters.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','exit','parse','\x20\x20√\x20Environment\x20configured','\x20\x20√\x20package.json\x20updated','rabetbase.config.json','\x20\x20√\x20Project\x20template\x20created','trim','\x0a√\x20Project\x20','6903017grhIIw','Project\x20directory\x20','×\x20Project\x20creation\x20failed:\x20','cwd'];a89_0x4563=function(){return _0x3e448f;};return a89_0x4563();}(function(_0x1ef4e0,_0x16ddae){const _0x34c314=a89_0x37f4,_0x2dcb5a=_0x1ef4e0();while(!![]){try{const _0x5970c2=-parseInt(_0x34c314(0x1f4))/0x1+-parseInt(_0x34c314(0x1e7))/0x2*(-parseInt(_0x34c314(0x1f7))/0x3)+-parseInt(_0x34c314(0x1fd))/0x4*(-parseInt(_0x34c314(0x1eb))/0x5)+-parseInt(_0x34c314(0x1f1))/0x6+-parseInt(_0x34c314(0x1f9))/0x7*(parseInt(_0x34c314(0x205))/0x8)+-parseInt(_0x34c314(0x1e6))/0x9+parseInt(_0x34c314(0x203))/0xa*(parseInt(_0x34c314(0x1de))/0xb);if(_0x5970c2===_0x16ddae)break;else _0x2dcb5a['push'](_0x2dcb5a['shift']());}catch(_0x110885){_0x2dcb5a['push'](_0x2dcb5a['shift']());}}}(a89_0x4563,0x4eff8));import a89_0x2364bd from'path';import{fileURLToPath}from'url';import a89_0x38949a from'fs/promises';import{existsSync}from'fs';import{copyDirectory}from'../utils/copy-directory.js';import{exec}from'child_process';import{promisify}from'util';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';const execAsync=promisify(exec);function getTemplateDir(){const _0x95a9d3=a89_0x37f4,_0x643ffa=fileURLToPath(import.meta.url),_0x1291b3=a89_0x2364bd[_0x95a9d3(0x20a)](_0x643ffa);return a89_0x2364bd[_0x95a9d3(0x1f6)](_0x1291b3,_0x95a9d3(0x204));}export async function createProjectNonInteractive(_0xd62c8e,_0xd0fed1){const _0x260d6d=a89_0x37f4,_0x16ca34=await checkCliVersion();_0x16ca34[_0x260d6d(0x207)]&&printCliUpgradeWarning(_0x16ca34);(!_0xd62c8e||_0xd62c8e[_0x260d6d(0x1dc)]()==='')&&(console[_0x260d6d(0x1ec)](_0x260d6d(0x1e4)),process[_0x260d6d(0x20c)](0x1));const _0x2a683b=/[<>:"|?*\x00-\x1f\x7f]/;_0x2a683b[_0x260d6d(0x1ef)](_0xd62c8e)&&(console[_0x260d6d(0x1ec)](_0x260d6d(0x20b)),process[_0x260d6d(0x20c)](0x1));_0xd62c8e[_0x260d6d(0x1fa)]>0x64&&(console[_0x260d6d(0x1ec)](_0x260d6d(0x1e8)),process['exit'](0x1));const _0x42c532=a89_0x2364bd[_0x260d6d(0x1f6)](process[_0x260d6d(0x1e1)](),_0xd62c8e);existsSync(_0x42c532)&&(console[_0x260d6d(0x1ec)](_0x260d6d(0x1df)+_0xd62c8e+'\x20already\x20exists,\x20please\x20use\x20a\x20different\x20name'),process[_0x260d6d(0x20c)](0x1));try{const _0x2ab667=a89_0x2364bd['dirname'](_0x42c532);await a89_0x38949a['access'](_0x2ab667,a89_0x38949a['constants'][_0x260d6d(0x1ea)]);}catch(_0xf7f4db){console[_0x260d6d(0x1ec)](_0x260d6d(0x1fe)),process[_0x260d6d(0x20c)](0x1);}try{console[_0x260d6d(0x200)](_0x260d6d(0x206)+_0xd62c8e+_0x260d6d(0x1fc));const _0x25a5c2=getTemplateDir();await copyDirectory(_0x25a5c2,_0x42c532),console['log'](_0x260d6d(0x1db)),await updatePackageJsonName(_0xd62c8e),console['log'](_0x260d6d(0x1d9)),console[_0x260d6d(0x200)](_0x260d6d(0x1e5)),console['log']('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x42c532),console[_0x260d6d(0x200)]('\x20\x20√\x20Code\x20formatted'),await configureAppEnv(_0xd62c8e,_0xd0fed1),console[_0x260d6d(0x200)](_0x260d6d(0x20e)),console[_0x260d6d(0x200)](_0x260d6d(0x1dd)+_0xd62c8e+_0x260d6d(0x202)),console['log'](_0x260d6d(0x1f5)+_0xd62c8e),console[_0x260d6d(0x200)]('\x20\x20rabetbase\x20run\x20start\x0a');}catch(_0x4fe20e){const _0x1a9a46=_0x4fe20e instanceof Error?_0x4fe20e[_0x260d6d(0x1fb)]:String(_0x4fe20e);try{existsSync(_0x42c532)&&await a89_0x38949a['rm'](_0x42c532,{'recursive':!![],'force':!![]});}catch{}console[_0x260d6d(0x1ec)](_0x260d6d(0x1e0)+_0x1a9a46),process['exit'](0x1);}}async function updatePackageJsonName(_0xc574b2){const _0x4a49e2=a89_0x37f4,_0x588223=a89_0x2364bd['resolve'](process[_0x4a49e2(0x1e1)](),_0xc574b2),_0x4694e1=a89_0x2364bd[_0x4a49e2(0x208)](_0x588223,'package.json'),_0x5ba298=await a89_0x38949a['readFile'](_0x4694e1,_0x4a49e2(0x1e2)),_0x458451=JSON[_0x4a49e2(0x20d)](_0x5ba298);_0x458451['name']=_0xc574b2,_0x458451['description']=_0x4a49e2(0x1f0),await a89_0x38949a[_0x4a49e2(0x1e3)](_0x4694e1,JSON[_0x4a49e2(0x1ed)](_0x458451,null,0x2)+'\x0a');}async function installDependencies(_0x57d63a){const _0x39a65b=a89_0x37f4,_0x2529e6=detectPackageManager(),_0x47a8a9=_0x2529e6+_0x39a65b(0x201);try{await execAsync(_0x47a8a9,{'cwd':_0x57d63a});}catch(_0x744cd2){throw new Error(_0x39a65b(0x209)+_0x744cd2);}}function detectPackageManager(){const _0x10ad23=a89_0x37f4;try{return execAsync(_0x10ad23(0x1f3),{}),_0x10ad23(0x1ff);}catch{return _0x10ad23(0x1f2);}}async function formatCode(_0x1518f5){const _0x2d132a=a89_0x37f4;try{await execAsync(_0x2d132a(0x1f8),{'cwd':_0x1518f5});}catch{}}function a89_0x37f4(_0x100022,_0x990811){_0x100022=_0x100022-0x1d9;const _0x45634c=a89_0x4563();let _0x37f444=_0x45634c[_0x100022];return _0x37f444;}async function configureAppEnv(_0x5f33da,_0x5aaac1){const _0x2ec4a0=a89_0x37f4,_0x5b4783=a89_0x2364bd[_0x2ec4a0(0x1f6)](process['cwd'](),_0x5f33da),_0x44edac=a89_0x2364bd['join'](_0x5b4783,_0x2ec4a0(0x1da));let _0x461c85={};if(existsSync(_0x44edac)){const _0x156523=await a89_0x38949a[_0x2ec4a0(0x1ee)](_0x44edac,_0x2ec4a0(0x1e2));_0x461c85=JSON[_0x2ec4a0(0x20d)](_0x156523);}_0x5aaac1&&(_0x461c85[_0x2ec4a0(0x1e9)]=_0x5aaac1),await a89_0x38949a['writeFile'](_0x44edac,JSON[_0x2ec4a0(0x1ed)](_0x461c85,null,0x2)+'\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4255e6,_0x14d8d9){var _0x1c2522=a90_0x2186,_0x4a8a2a=_0x4255e6();while(!![]){try{var _0x2978bd=parseInt(_0x1c2522(0xc6))/0x1*(-parseInt(_0x1c2522(0xbf))/0x2)+parseInt(_0x1c2522(0xcb))/0x3+parseInt(_0x1c2522(0xcc))/0x4*(-parseInt(_0x1c2522(0xc8))/0x5)+parseInt(_0x1c2522(0xc1))/0x6*(-parseInt(_0x1c2522(0xc0))/0x7)+parseInt(_0x1c2522(0xc4))/0x8*(-parseInt(_0x1c2522(0xc9))/0x9)+-parseInt(_0x1c2522(0xc5))/0xa+parseInt(_0x1c2522(0xc7))/0xb;if(_0x2978bd===_0x14d8d9)break;else _0x4a8a2a['push'](_0x4a8a2a['shift']());}catch(_0x47a366){_0x4a8a2a['push'](_0x4a8a2a['shift']());}}}(a90_0x2634,0x7e7b3));import{jsx as a90_0x444fc7,jsxs as a90_0x2439af}from'react/jsx-runtime';function a90_0x2634(){var _0x39121d=['1284332yloaFE','6ydiWoI','elapsed','\x20√\x20','16YcKcGk','1013930JqfbIo','2BeGQWU','15613609UewTjx','5cnoXXp','3261771KhcHkp','taskName','2970522qZDBZV','268756pYDhBt','814630LeunyF'];a90_0x2634=function(){return _0x39121d;};return a90_0x2634();}function a90_0x2186(_0x3e8dc7,_0x39fdee){_0x3e8dc7=_0x3e8dc7-0xbf;var _0x2634fa=a90_0x2634();var _0x21869a=_0x2634fa[_0x3e8dc7];return _0x21869a;}import{Box,Text}from'ink';import{TaskTime}from'./task-time.js';export function TaskFinished(_0xcfc315){var _0x627309=a90_0x2186;return a90_0x2439af(Box,{'children':[a90_0x444fc7(Box,{'width':'1'}),a90_0x444fc7(Text,{'color':'green','children':_0x627309(0xc3)}),a90_0x444fc7(Text,{'children':_0xcfc315[_0x627309(0xca)]}),a90_0x444fc7(TaskTime,{'elapsed':_0xcfc315[_0x627309(0xc2)]})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4b46ea,_0x138a18){var _0x539153=a91_0xc16c,_0x31ce89=_0x4b46ea();while(!![]){try{var _0x1a5a5d=-parseInt(_0x539153(0x166))/0x1+-parseInt(_0x539153(0x165))/0x2+-parseInt(_0x539153(0x159))/0x3*(-parseInt(_0x539153(0x15a))/0x4)+parseInt(_0x539153(0x15d))/0x5+-parseInt(_0x539153(0x15f))/0x6+parseInt(_0x539153(0x160))/0x7*(parseInt(_0x539153(0x163))/0x8)+-parseInt(_0x539153(0x15c))/0x9*(-parseInt(_0x539153(0x161))/0xa);if(_0x1a5a5d===_0x138a18)break;else _0x31ce89['push'](_0x31ce89['shift']());}catch(_0x41a893){_0x31ce89['push'](_0x31ce89['shift']());}}}(a91_0x1c8d,0x2e0a6));function a91_0x1c8d(){var _0xec0e5e=['787065WwUcfm','\x20√\x20','1798722SZgYzu','231539ZRPBFf','123010vIUOcj','\x20\x20\x20','24OIlijo','dots','736970omnbdQ','249620vIBKJI','green','29019ZQscqn','92JYeFvY','loading','459NAsRHB'];a91_0x1c8d=function(){return _0xec0e5e;};return a91_0x1c8d();}import{jsx as a91_0x1f10b8,jsxs as a91_0x117fad}from'react/jsx-runtime';import{Text}from'ink';import a91_0x4be1f9 from'ink-spinner';function a91_0xc16c(_0x3b0715,_0x118d23){_0x3b0715=_0x3b0715-0x158;var _0x1c8df4=a91_0x1c8d();var _0xc16c26=_0x1c8df4[_0x3b0715];return _0xc16c26;}export function TaskLoading(_0x3774ec){var _0x2d78e4=a91_0xc16c;if(_0x3774ec['finished'])return a91_0x1f10b8(Text,{'color':_0x2d78e4(0x158),'children':_0x2d78e4(0x15e)});if(_0x3774ec[_0x2d78e4(0x15b)])return a91_0x117fad(Text,{'color':_0x2d78e4(0x158),'children':['\x20',a91_0x1f10b8(a91_0x4be1f9,{'type':_0x2d78e4(0x164)}),'\x20']});return a91_0x1f10b8(Text,{'children':_0x2d78e4(0x162)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a92_0x544d(_0x49bfdd,_0x1aae8a){_0x49bfdd=_0x49bfdd-0x150;var _0x272c08=a92_0x272c();var _0x544d48=_0x272c08[_0x49bfdd];return _0x544d48;}(function(_0x2a57bf,_0x248819){var _0x29bcf0=a92_0x544d,_0xffa04c=_0x2a57bf();while(!![]){try{var _0x330d9c=-parseInt(_0x29bcf0(0x154))/0x1*(parseInt(_0x29bcf0(0x159))/0x2)+-parseInt(_0x29bcf0(0x158))/0x3*(-parseInt(_0x29bcf0(0x15b))/0x4)+parseInt(_0x29bcf0(0x157))/0x5+parseInt(_0x29bcf0(0x152))/0x6*(-parseInt(_0x29bcf0(0x153))/0x7)+-parseInt(_0x29bcf0(0x150))/0x8*(-parseInt(_0x29bcf0(0x155))/0x9)+parseInt(_0x29bcf0(0x151))/0xa+parseInt(_0x29bcf0(0x156))/0xb*(-parseInt(_0x29bcf0(0x15a))/0xc);if(_0x330d9c===_0x248819)break;else _0xffa04c['push'](_0xffa04c['shift']());}catch(_0x234071){_0xffa04c['push'](_0xffa04c['shift']());}}}(a92_0x272c,0x74341));import{jsx as a92_0x2b1d12,jsxs as a92_0xffbd3f}from'react/jsx-runtime';import{Box,Text}from'ink';import{TaskLoading}from'./task-loading.js';import{TaskTime}from'./task-time.js';function a92_0x272c(){var _0x1b89cd=['7AWhUgL','1QoFdns','162lsBnQH','1998711urrGwJ','4004855DNofAh','31026abvrHh','239212HHJFDn','12RQAYjf','4KAYEOA','367512CLIpPo','453120RJCdFw','5437506RjpPhL'];a92_0x272c=function(){return _0x1b89cd;};return a92_0x272c();}export function TaskRunning(_0x3f3a26){return a92_0xffbd3f(Box,{'children':[a92_0x2b1d12(Box,{'width':'1'}),a92_0x2b1d12(TaskLoading,{..._0x3f3a26}),a92_0x2b1d12(Text,{'children':_0x3f3a26['taskName']}),a92_0x2b1d12(TaskTime,{'elapsed':_0x3f3a26['elapsed']})]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5de9d4,_0x54f17d){var _0x24c4cb=a93_0x174a,_0xb38ee5=_0x5de9d4();while(!![]){try{var _0x1f1cbc=parseInt(_0x24c4cb(0xe5))/0x1+-parseInt(_0x24c4cb(0xe8))/0x2*(parseInt(_0x24c4cb(0xe1))/0x3)+parseInt(_0x24c4cb(0xe0))/0x4+-parseInt(_0x24c4cb(0xe2))/0x5+parseInt(_0x24c4cb(0xe6))/0x6+parseInt(_0x24c4cb(0xe7))/0x7+parseInt(_0x24c4cb(0xe3))/0x8*(-parseInt(_0x24c4cb(0xea))/0x9);if(_0x1f1cbc===_0x54f17d)break;else _0xb38ee5['push'](_0xb38ee5['shift']());}catch(_0x2ce599){_0xb38ee5['push'](_0xb38ee5['shift']());}}}(a93_0x3882,0x8e8a2));import{jsx as a93_0x2cf645,Fragment as a93_0x1ad947,jsxs as a93_0x4730e3}from'react/jsx-runtime';function a93_0x174a(_0x236ea3,_0x505ad9){_0x236ea3=_0x236ea3-0xe0;var _0x3882c6=a93_0x3882();var _0x174ae2=_0x3882c6[_0x236ea3];return _0x174ae2;}function a93_0x3882(){var _0x3ca768=['2063530RYtQDm','654344AsvVir','gray','640537GAYNJW','670638LEVuIm','2559396qsCxiI','16430sNoCXq','elapsed','9WvfdAF','2174672ecNufG','213bIBpXz'];a93_0x3882=function(){return _0x3ca768;};return a93_0x3882();}import{Text}from'ink';export function TaskTime(_0x103bb2){var _0x50ca61=a93_0x174a;if(_0x103bb2[_0x50ca61(0xe9)])return a93_0x4730e3(a93_0x1ad947,{'children':[a93_0x2cf645(Text,{'color':_0x50ca61(0xe4),'children':'\x20['}),a93_0x2cf645(Text,{'color':_0x50ca61(0xe4),'bold':!![],'children':_0x103bb2[_0x50ca61(0xe9)]}),a93_0x2cf645(Text,{'color':'gray','children':']'})]});return null;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a94_0x39b2ef=a94_0x5273;(function(_0x2ef3b8,_0x5bf9fd){const _0x579f7a=a94_0x5273,_0x1a1e70=_0x2ef3b8();while(!![]){try{const _0xa37ebb=parseInt(_0x579f7a(0x71))/0x1*(-parseInt(_0x579f7a(0x6f))/0x2)+parseInt(_0x579f7a(0x7f))/0x3+-parseInt(_0x579f7a(0x7b))/0x4+parseInt(_0x579f7a(0x74))/0x5*(parseInt(_0x579f7a(0x72))/0x6)+parseInt(_0x579f7a(0x6b))/0x7*(-parseInt(_0x579f7a(0x7e))/0x8)+parseInt(_0x579f7a(0x79))/0x9*(-parseInt(_0x579f7a(0x80))/0xa)+parseInt(_0x579f7a(0x7a))/0xb*(parseInt(_0x579f7a(0x6e))/0xc);if(_0xa37ebb===_0x5bf9fd)break;else _0x1a1e70['push'](_0x1a1e70['shift']());}catch(_0x2d7239){_0x1a1e70['push'](_0x1a1e70['shift']());}}}(a94_0x54e7,0xb68e9));import a94_0x45d401 from'node:path';import{fileURLToPath}from'node:url';import{useCallback,useState}from'react';function a94_0x5273(_0x1c56a4,_0x5b5168){_0x1c56a4=_0x1c56a4-0x6b;const _0x54e7a7=a94_0x54e7();let _0x52735f=_0x54e7a7[_0x1c56a4];return _0x52735f;}import{copyDirectory}from'../utils/copy-directory.js';import{formatElapsed}from'./format-elapsed.js';function a94_0x54e7(){const _0x20b1c1=['20qMjhlB','message','info','success','now','27HYWTWq','2607803jDEpGD','5262868cYbTeP','copy','error','8tTVKme','3464964wJWiEN','2785960wvEXUU','dirname','7378763bgLqtU','开始复制项目模板','../../templates/projects/sub-app-react-demo','156HgmFmq','480826ugKcyM','项目模板复制完成','2obQwMg','295884uoPBrF','Copy\x20project\x20files'];a94_0x54e7=function(){return _0x20b1c1;};return a94_0x54e7();}import{logger}from'../utils/logger.js';const __dirname=a94_0x45d401[a94_0x39b2ef(0x81)](fileURLToPath(import.meta.url)),templateDir=a94_0x45d401['resolve'](__dirname,a94_0x39b2ef(0x6d));export function useCopyProjectTemplate(){const _0x740d19=a94_0x39b2ef,[_0x42b75f,_0x4bd29f]=useState(![]),[_0x541326,_0x5c0007]=useState(![]),[_0x847fc8,_0x20cd6]=useState(''),_0x47b3ea=useCallback(async _0x3f73eb=>{const _0x2343df=a94_0x5273,_0x11190c=Date[_0x2343df(0x78)](),_0x14aa34=a94_0x45d401['resolve'](process['cwd'](),_0x3f73eb);_0x4bd29f(!![]);try{logger[_0x2343df(0x76)](_0x2343df(0x7c),_0x2343df(0x6c),{'projectCode':_0x3f73eb,'templateDir':templateDir}),await copyDirectory(templateDir,_0x14aa34);const _0x5c1347=Date['now']()-_0x11190c;logger[_0x2343df(0x77)](_0x2343df(0x7c),_0x2343df(0x70),_0x5c1347,{'projectCode':_0x3f73eb});}catch(_0x24285b){const _0x32a9cc=Date[_0x2343df(0x78)]()-_0x11190c;logger[_0x2343df(0x7d)]('copy','项目模板复制失败',{'projectCode':_0x3f73eb,'error':_0x24285b instanceof Error?_0x24285b[_0x2343df(0x75)]:String(_0x24285b),'duration':_0x32a9cc});throw _0x24285b;}finally{_0x4bd29f(![]),_0x5c0007(!![]),_0x20cd6(formatElapsed(_0x11190c));}},[]);return{'taskName':_0x740d19(0x73),'finished':_0x541326,'loading':_0x42b75f,'elapsed':_0x847fc8,'doTask':_0x47b3ea};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a95_0x32aa(_0x21d72d,_0x388b87){_0x21d72d=_0x21d72d-0xba;const _0x114d53=a95_0x114d();let _0x32aa98=_0x114d53[_0x21d72d];return _0x32aa98;}(function(_0x51b416,_0x23fb03){const _0x573b28=a95_0x32aa,_0x404d7b=_0x51b416();while(!![]){try{const _0x32193b=-parseInt(_0x573b28(0xc9))/0x1*(-parseInt(_0x573b28(0xba))/0x2)+-parseInt(_0x573b28(0xbc))/0x3*(parseInt(_0x573b28(0xc8))/0x4)+parseInt(_0x573b28(0xbd))/0x5+-parseInt(_0x573b28(0xbe))/0x6+-parseInt(_0x573b28(0xc6))/0x7+parseInt(_0x573b28(0xbb))/0x8+-parseInt(_0x573b28(0xcd))/0x9;if(_0x32193b===_0x23fb03)break;else _0x404d7b['push'](_0x404d7b['shift']());}catch(_0x60a006){_0x404d7b['push'](_0x404d7b['shift']());}}}(a95_0x114d,0x29f5a));import a95_0x37d900 from'node:path';function a95_0x114d(){const _0x158926=['788daEfwG','993zLIlAS','message','Format\x20code','--write','513441rPRbhl','446SPzhpE','1598552KfvaXk','189Azyccg','1336370TQeVTI','1804182UCkYLV','format','success','开始格式化代码','info','npx','resolve','now','1025563lpiSej','prettier'];a95_0x114d=function(){return _0x158926;};return a95_0x114d();}import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';export function useFormatCode(){const _0x4f90c1=a95_0x32aa,[_0x27432b,_0x196f4b]=useState(![]),[_0x27ddce,_0x5a02b0]=useState(![]),[_0x464de3,_0x29a8ae]=useState(''),_0x2b58be=useCallback(async _0x5920c2=>{const _0x3daba5=a95_0x32aa,_0x3c912f=Date[_0x3daba5(0xc5)](),_0xd31818=a95_0x37d900[_0x3daba5(0xc4)](process['cwd'](),_0x5920c2);_0x196f4b(!![]);try{logger[_0x3daba5(0xc2)]('format',_0x3daba5(0xc1),{'projectCode':_0x5920c2}),await execa(_0x3daba5(0xc3),[_0x3daba5(0xc7),_0x3daba5(0xcc),'.'],{'cwd':_0xd31818});const _0x2d4c18=Date[_0x3daba5(0xc5)]()-_0x3c912f;logger[_0x3daba5(0xc0)](_0x3daba5(0xbf),'代码格式化完成',_0x2d4c18,{'projectCode':_0x5920c2});}catch(_0x8b0ced){const _0x3984e8=Date['now']()-_0x3c912f;logger['error']('format','代码格式化失败',{'projectCode':_0x5920c2,'error':_0x8b0ced instanceof Error?_0x8b0ced[_0x3daba5(0xca)]:String(_0x8b0ced),'duration':_0x3984e8});throw _0x8b0ced;}finally{_0x196f4b(![]),_0x5a02b0(!![]),_0x29a8ae(formatElapsed(_0x3c912f));}},[]);return{'taskName':_0x4f90c1(0xcb),'finished':_0x27ddce,'loading':_0x27432b,'elapsed':_0x464de3,'doTask':_0x2b58be};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a96_0x24bc(_0x4533f3,_0x2e0fe6){_0x4533f3=_0x4533f3-0xea;const _0x519404=a96_0x5194();let _0x24bc0f=_0x519404[_0x4533f3];return _0x24bc0f;}(function(_0x48554e,_0x395aa4){const _0x4774f6=a96_0x24bc,_0x586a17=_0x48554e();while(!![]){try{const _0x4fc778=-parseInt(_0x4774f6(0xef))/0x1*(-parseInt(_0x4774f6(0xf2))/0x2)+-parseInt(_0x4774f6(0xed))/0x3+parseInt(_0x4774f6(0xee))/0x4+parseInt(_0x4774f6(0xfa))/0x5+parseInt(_0x4774f6(0xf3))/0x6*(parseInt(_0x4774f6(0xf7))/0x7)+-parseInt(_0x4774f6(0xea))/0x8*(parseInt(_0x4774f6(0xfd))/0x9)+parseInt(_0x4774f6(0xf4))/0xa;if(_0x4fc778===_0x395aa4)break;else _0x586a17['push'](_0x586a17['shift']());}catch(_0x3fa781){_0x586a17['push'](_0x586a17['shift']());}}}(a96_0x5194,0xcab0b));import a96_0x25b40f from'node:path';import{useCallback,useState}from'react';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';function a96_0x5194(){const _0x1c23b3=['https://registry.npmmirror.com','9WAJgBs','cwd','now','依赖安装完成','8182168oNGDkc','npm','info','4108446ivlCdE','4332216DrDWzL','26MAJnYw','Install\x20dependencies','success','71082MIrnuJ','30idCDdQ','4868620pKCOVG','依赖安装失败','message','238133MxSZLr','--registry','install','2791975GHMpZY','error'];a96_0x5194=function(){return _0x1c23b3;};return a96_0x5194();}import{logger}from'../utils/logger.js';export function useInstallDependencies(){const _0x53ebe4=a96_0x24bc,[_0x500794,_0x30552c]=useState(![]),[_0x2d4d42,_0x5b90fa]=useState(![]),[_0x2e19fe,_0x41b2a1]=useState(''),_0x34c0cb=useCallback(async _0x403c1b=>{const _0x27f1b6=a96_0x24bc,_0x28477b=Date[_0x27f1b6(0xff)](),_0x2d2fcd=a96_0x25b40f['resolve'](process[_0x27f1b6(0xfe)](),_0x403c1b);_0x30552c(!![]),_0x5b90fa(![]);const _0x344ad6=async(_0x55c0bf,_0x5431f7)=>{await execa(_0x55c0bf,_0x5431f7,{'cwd':_0x2d2fcd});};try{logger[_0x27f1b6(0xec)](_0x27f1b6(0xf9),'开始安装依赖',{'projectCode':_0x403c1b,'registry':'https://registry.npmmirror.com'}),await _0x344ad6(_0x27f1b6(0xeb),[_0x27f1b6(0xf9),_0x27f1b6(0xf8),_0x27f1b6(0xfc)]);const _0x4de98f=Date[_0x27f1b6(0xff)]()-_0x28477b;logger[_0x27f1b6(0xf1)](_0x27f1b6(0xf9),_0x27f1b6(0x100),_0x4de98f,{'projectCode':_0x403c1b});}catch(_0x4bc878){const _0x5ccf38=Date[_0x27f1b6(0xff)]()-_0x28477b;logger[_0x27f1b6(0xfb)]('install',_0x27f1b6(0xf5),{'projectCode':_0x403c1b,'error':_0x4bc878 instanceof Error?_0x4bc878[_0x27f1b6(0xf6)]:String(_0x4bc878),'duration':_0x5ccf38});throw _0x4bc878;}finally{_0x30552c(![]),_0x5b90fa(!![]),_0x41b2a1(formatElapsed(_0x28477b));}},[]);return{'taskName':_0x53ebe4(0xf0),'finished':_0x2d4d42,'loading':_0x500794,'elapsed':_0x2e19fe,'doTask':_0x34c0cb};}
|