v7.0.0-beta.2 release

This commit is contained in:
HeuJung committed 2026-04-20 20:37:49 +09:00
1 parent 6595fd0eb5
commit fa8eba7a0d
1165 files changed
+107118 -762127

No files matched your search

@@ -18,7 +18,9 @@ class UpdateTemplateCommand extends Command
protected $signature = 'template:update
{identifier : 업데이트할 템플릿 식별자}
{--layout-strategy=overwrite : 레이아웃 전략 (overwrite|keep)}
{--force : 버전 비교 없이 강제 업데이트}';
{--force : 버전 비교 없이 강제 업데이트}
{--source=auto : 업데이트 소스 (auto|bundled|github) — bundled 는 _bundled 만 사용(GitHub 우회)}
{--zip= : 외부 ZIP 파일 경로 (지정 시 GitHub/번들 우회 + 버전은 template.json 기준)}';
/**
* The console command description.
@@ -43,6 +45,8 @@ class UpdateTemplateCommand extends Command
$identifier = $this->argument('identifier');
$layoutStrategy = $this->option('layout-strategy');
$force = $this->option('force');
$sourceOption = (string) $this->option('source');
$zipPath = $this->option('zip');
// 레이아웃 전략 검증
if (! in_array($layoutStrategy, ['overwrite', 'keep'])) {
@@ -51,6 +55,30 @@ class UpdateTemplateCommand extends Command
return Command::FAILURE;
}
if (! in_array($sourceOption, ['auto', 'bundled', 'github'], true)) {
$this->error('❌ --source 는 auto, bundled, github 중 하나여야 합니다.');
return Command::FAILURE;
}
if ($zipPath !== null && $sourceOption !== 'auto') {
$this->error('❌ --zip 은 --source 와 동시에 지정할 수 없습니다.');
return Command::FAILURE;
}
if ($zipPath !== null) {
$resolvedZip = realpath($zipPath);
if (! $resolvedZip || ! is_file($resolvedZip)) {
$this->error('❌ 지정된 ZIP 파일이 존재하지 않습니다: '.$zipPath);
return Command::FAILURE;
}
$zipPath = $resolvedZip;
}
$sourceOverride = $sourceOption === 'auto' ? null : $sourceOption;
try {
$this->templateManager->loadTemplates();
@@ -63,23 +91,29 @@ class UpdateTemplateCommand extends Command
return Command::FAILURE;
}
// 업데이트 확인
$checkResult = $this->templateManager->checkTemplateUpdate($identifier);
// 업데이트 확인 (--zip 모드는 GitHub/번들 비교를 우회하므로 스킵)
if ($zipPath === null) {
$checkResult = $this->templateManager->checkTemplateUpdate($identifier);
if (! $checkResult['update_available'] && ! $force) {
$this->info('✅ '.__('templates.commands.update.no_update', ['template' => $identifier]));
if (! $checkResult['update_available'] && ! $force) {
$this->info('✅ '.__('templates.commands.update.no_update', ['template' => $identifier]));
return Command::SUCCESS;
}
return Command::SUCCESS;
}
// 업데이트 정보 표시
$this->info(__('templates.commands.update.current_version', ['version' => $checkResult['current_version']]));
// 업데이트 정보 표시
$this->info(__('templates.commands.update.current_version', ['version' => $checkResult['current_version']]));
if ($force && ! $checkResult['update_available']) {
$this->warn('⚠️ '.__('templates.commands.update.force_mode'));
if ($force && ! $checkResult['update_available']) {
$this->warn('⚠️ '.__('templates.commands.update.force_mode'));
} else {
$this->info(__('templates.commands.update.latest_version', ['version' => $checkResult['latest_version']]));
$this->info(__('templates.commands.update.update_source', ['source' => $checkResult['update_source']]));
}
} else {
$this->info(__('templates.commands.update.latest_version', ['version' => $checkResult['latest_version']]));
$this->info(__('templates.commands.update.update_source', ['source' => $checkResult['update_source']]));
$this->info(__('templates.commands.update.current_version', ['version' => $template->version]));
$this->info('업데이트 소스: ZIP ('.$zipPath.')');
$this->info('업데이트 버전: (template.json 추출 후 판별)');
}
$this->info(__('templates.commands.update.layout_strategy', ['strategy' => $layoutStrategy]));
@@ -115,7 +149,7 @@ class UpdateTemplateCommand extends Command
// 업데이트 실행
$onProgress = $this->createProgressCallback(TemplateManager::UPDATE_STEPS);
try {
$updateResult = $this->templateManager->updateTemplate($identifier, $layoutStrategy, $force, $onProgress);
$updateResult = $this->templateManager->updateTemplate($identifier, $force, $onProgress, $layoutStrategy, $sourceOverride, $zipPath);
$this->finishProgress();
} catch (\Exception $e) {
$this->finishProgress();