@team-semicolon/semo-cli 3.3.0 → 3.5.0
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/dist/index.js +48 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -481,6 +481,23 @@ function detectLegacyEnvironment(cwd) {
|
|
|
481
481
|
legacyPaths.push(dir);
|
|
482
482
|
}
|
|
483
483
|
}
|
|
484
|
+
// semo-system/ 내부의 레거시 Extension 구조 확인
|
|
485
|
+
// 구버전: semo-system/biz/, semo-system/eng/, semo-system/ops/ (그룹 디렉토리)
|
|
486
|
+
// 신버전: semo-system/biz/design/, semo-system/eng/nextjs/ 등 (개별 패키지)
|
|
487
|
+
const semoSystemDir = path.join(cwd, "semo-system");
|
|
488
|
+
if (fs.existsSync(semoSystemDir)) {
|
|
489
|
+
const legacyExtGroups = ["biz", "eng", "ops"];
|
|
490
|
+
for (const group of legacyExtGroups) {
|
|
491
|
+
const groupDir = path.join(semoSystemDir, group);
|
|
492
|
+
if (fs.existsSync(groupDir) && fs.statSync(groupDir).isDirectory()) {
|
|
493
|
+
// VERSION 파일이 그룹 디렉토리에 직접 있으면 레거시 구조
|
|
494
|
+
const groupVersionFile = path.join(groupDir, "VERSION");
|
|
495
|
+
if (fs.existsSync(groupVersionFile)) {
|
|
496
|
+
legacyPaths.push(`semo-system/${group} (레거시 그룹 구조)`);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
}
|
|
484
501
|
// .claude/ 내부의 레거시 구조 확인
|
|
485
502
|
const claudeDir = path.join(cwd, ".claude");
|
|
486
503
|
if (fs.existsSync(claudeDir)) {
|
|
@@ -563,10 +580,28 @@ async function migrateLegacyEnvironment(cwd) {
|
|
|
563
580
|
}
|
|
564
581
|
}
|
|
565
582
|
}
|
|
566
|
-
// 3.
|
|
583
|
+
// 3. semo-system/ 내부의 레거시 Extension 그룹 삭제
|
|
567
584
|
const semoSystemDir = path.join(cwd, "semo-system");
|
|
568
585
|
if (fs.existsSync(semoSystemDir)) {
|
|
569
|
-
|
|
586
|
+
const legacyExtGroups = ["biz", "eng", "ops"];
|
|
587
|
+
for (const group of legacyExtGroups) {
|
|
588
|
+
const groupDir = path.join(semoSystemDir, group);
|
|
589
|
+
const groupVersionFile = path.join(groupDir, "VERSION");
|
|
590
|
+
// VERSION 파일이 그룹 디렉토리에 직접 있으면 레거시 구조이므로 삭제
|
|
591
|
+
if (fs.existsSync(groupVersionFile)) {
|
|
592
|
+
removeRecursive(groupDir);
|
|
593
|
+
console.log(chalk_1.default.gray(` ✓ semo-system/${group}/ 삭제됨 (레거시 그룹 구조)`));
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
}
|
|
597
|
+
// 4. 기존 semo-system이 완전히 레거시인 경우에만 삭제
|
|
598
|
+
// (Standard 패키지가 없는 경우)
|
|
599
|
+
if (fs.existsSync(semoSystemDir)) {
|
|
600
|
+
const hasStandard = fs.existsSync(path.join(semoSystemDir, "semo-core"));
|
|
601
|
+
if (!hasStandard) {
|
|
602
|
+
removeRecursive(semoSystemDir);
|
|
603
|
+
console.log(chalk_1.default.gray(` ✓ semo-system/ 삭제됨 (완전 재설치)`));
|
|
604
|
+
}
|
|
570
605
|
}
|
|
571
606
|
spinner.succeed("레거시 환경 정리 완료");
|
|
572
607
|
console.log(chalk_1.default.green(" → 새 환경으로 설치를 진행합니다.\n"));
|
|
@@ -2849,6 +2884,7 @@ program
|
|
|
2849
2884
|
.option("--system", "semo-system만 업데이트")
|
|
2850
2885
|
.option("--skip-cli", "CLI 업데이트 건너뛰기")
|
|
2851
2886
|
.option("--only <packages>", "특정 패키지만 업데이트 (쉼표 구분: semo-core,semo-skills,biz/management)")
|
|
2887
|
+
.option("--migrate", "레거시 환경 강제 마이그레이션")
|
|
2852
2888
|
.action(async (options) => {
|
|
2853
2889
|
console.log(chalk_1.default.cyan.bold("\n🔄 SEMO 업데이트\n"));
|
|
2854
2890
|
const cwd = process.cwd();
|
|
@@ -2856,6 +2892,16 @@ program
|
|
|
2856
2892
|
const claudeDir = path.join(cwd, ".claude");
|
|
2857
2893
|
// 0. 버전 비교
|
|
2858
2894
|
await showVersionComparison(cwd);
|
|
2895
|
+
// 0.5. 레거시 환경 감지 및 마이그레이션
|
|
2896
|
+
const legacyCheck = detectLegacyEnvironment(cwd);
|
|
2897
|
+
if (legacyCheck.hasLegacy || options.migrate) {
|
|
2898
|
+
console.log(chalk_1.default.yellow("\n⚠️ 레거시 환경이 감지되어 업데이트 전 마이그레이션이 필요합니다.\n"));
|
|
2899
|
+
const migrationSuccess = await migrateLegacyEnvironment(cwd);
|
|
2900
|
+
if (migrationSuccess) {
|
|
2901
|
+
console.log(chalk_1.default.cyan("마이그레이션 완료. 'semo init'으로 새 환경을 설치하세요.\n"));
|
|
2902
|
+
}
|
|
2903
|
+
process.exit(0);
|
|
2904
|
+
}
|
|
2859
2905
|
// --only 옵션 파싱
|
|
2860
2906
|
const onlyPackages = options.only
|
|
2861
2907
|
? options.only.split(",").map((p) => p.trim())
|