@team-semicolon/semo-cli 3.2.0 → 3.4.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 +60 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -131,11 +131,12 @@ async function getRemotePackageVersion(packagePath) {
|
|
|
131
131
|
}
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
|
-
* semo-core/semo-skills 원격 버전 가져오기
|
|
134
|
+
* semo-core/semo-skills 원격 버전 가져오기 (semo-system/ 하위 경로)
|
|
135
135
|
*/
|
|
136
136
|
async function getRemoteCoreVersion(type) {
|
|
137
137
|
try {
|
|
138
|
-
|
|
138
|
+
// v5.0: semo-system/ 하위에 Standard 패키지가 위치
|
|
139
|
+
const url = `https://raw.githubusercontent.com/semicolon-devteam/semo/main/semo-system/${type}/VERSION`;
|
|
139
140
|
const response = await fetch(url, { signal: AbortSignal.timeout(5000) });
|
|
140
141
|
if (!response.ok)
|
|
141
142
|
return null;
|
|
@@ -168,12 +169,24 @@ async function showVersionComparison(cwd) {
|
|
|
168
169
|
needsUpdate: latestCliVersion ? isVersionLower(currentCliVersion, latestCliVersion) : false,
|
|
169
170
|
level: 0,
|
|
170
171
|
});
|
|
171
|
-
//
|
|
172
|
-
const
|
|
172
|
+
// 레거시 환경 경고 (루트에 semo-core/semo-skills가 있는 경우)
|
|
173
|
+
const hasLegacyCore = fs.existsSync(path.join(cwd, "semo-core"));
|
|
174
|
+
const hasLegacySkills = fs.existsSync(path.join(cwd, "semo-skills"));
|
|
175
|
+
if (hasLegacyCore || hasLegacySkills) {
|
|
176
|
+
spinner.warn("레거시 환경 감지됨");
|
|
177
|
+
console.log(chalk_1.default.yellow("\n ⚠️ 구버전 SEMO 구조가 감지되었습니다."));
|
|
178
|
+
console.log(chalk_1.default.gray(" 루트에 semo-core/ 또는 semo-skills/가 있습니다."));
|
|
179
|
+
console.log(chalk_1.default.cyan("\n 💡 마이그레이션 방법:"));
|
|
180
|
+
console.log(chalk_1.default.gray(" 1. 기존 semo-core/, semo-skills/ 폴더 삭제"));
|
|
181
|
+
console.log(chalk_1.default.gray(" 2. .claude/ 폴더 삭제"));
|
|
182
|
+
console.log(chalk_1.default.gray(" 3. semo init 다시 실행\n"));
|
|
183
|
+
console.log(chalk_1.default.gray(" 또는: semo migrate --force\n"));
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
// semo-core (semo-system/ 내부만 확인)
|
|
173
187
|
const corePathSystem = path.join(semoSystemDir, "semo-core", "VERSION");
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
const localCore = fs.readFileSync(corePath, "utf-8").trim();
|
|
188
|
+
if (fs.existsSync(corePathSystem)) {
|
|
189
|
+
const localCore = fs.readFileSync(corePathSystem, "utf-8").trim();
|
|
177
190
|
const remoteCore = await getRemoteCoreVersion("semo-core");
|
|
178
191
|
versionInfos.push({
|
|
179
192
|
name: "semo-core",
|
|
@@ -183,12 +196,10 @@ async function showVersionComparison(cwd) {
|
|
|
183
196
|
level: 0,
|
|
184
197
|
});
|
|
185
198
|
}
|
|
186
|
-
// semo-skills (
|
|
187
|
-
const skillsPathRoot = path.join(cwd, "semo-skills", "VERSION");
|
|
199
|
+
// semo-skills (semo-system/ 내부만 확인)
|
|
188
200
|
const skillsPathSystem = path.join(semoSystemDir, "semo-skills", "VERSION");
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
const localSkills = fs.readFileSync(skillsPath, "utf-8").trim();
|
|
201
|
+
if (fs.existsSync(skillsPathSystem)) {
|
|
202
|
+
const localSkills = fs.readFileSync(skillsPathSystem, "utf-8").trim();
|
|
192
203
|
const remoteSkills = await getRemoteCoreVersion("semo-skills");
|
|
193
204
|
versionInfos.push({
|
|
194
205
|
name: "semo-skills",
|
|
@@ -198,6 +209,32 @@ async function showVersionComparison(cwd) {
|
|
|
198
209
|
level: 0,
|
|
199
210
|
});
|
|
200
211
|
}
|
|
212
|
+
// semo-agents (semo-system/ 내부)
|
|
213
|
+
const agentsPathSystem = path.join(semoSystemDir, "semo-agents", "VERSION");
|
|
214
|
+
if (fs.existsSync(agentsPathSystem)) {
|
|
215
|
+
const localAgents = fs.readFileSync(agentsPathSystem, "utf-8").trim();
|
|
216
|
+
const remoteAgents = await getRemoteCoreVersion("semo-agents");
|
|
217
|
+
versionInfos.push({
|
|
218
|
+
name: "semo-agents",
|
|
219
|
+
local: localAgents,
|
|
220
|
+
remote: remoteAgents,
|
|
221
|
+
needsUpdate: remoteAgents ? isVersionLower(localAgents, remoteAgents) : false,
|
|
222
|
+
level: 0,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
// semo-scripts (semo-system/ 내부)
|
|
226
|
+
const scriptsPathSystem = path.join(semoSystemDir, "semo-scripts", "VERSION");
|
|
227
|
+
if (fs.existsSync(scriptsPathSystem)) {
|
|
228
|
+
const localScripts = fs.readFileSync(scriptsPathSystem, "utf-8").trim();
|
|
229
|
+
const remoteScripts = await getRemoteCoreVersion("semo-scripts");
|
|
230
|
+
versionInfos.push({
|
|
231
|
+
name: "semo-scripts",
|
|
232
|
+
local: localScripts,
|
|
233
|
+
remote: remoteScripts,
|
|
234
|
+
needsUpdate: remoteScripts ? isVersionLower(localScripts, remoteScripts) : false,
|
|
235
|
+
level: 0,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
201
238
|
// 그룹 패키지 (eng, biz, ops) 및 하위 Extension - semo-system 내부
|
|
202
239
|
// 그룹별로 묶어서 계층 구조로 출력
|
|
203
240
|
if (hasSemoSystem) {
|
|
@@ -2812,6 +2849,7 @@ program
|
|
|
2812
2849
|
.option("--system", "semo-system만 업데이트")
|
|
2813
2850
|
.option("--skip-cli", "CLI 업데이트 건너뛰기")
|
|
2814
2851
|
.option("--only <packages>", "특정 패키지만 업데이트 (쉼표 구분: semo-core,semo-skills,biz/management)")
|
|
2852
|
+
.option("--migrate", "레거시 환경 강제 마이그레이션")
|
|
2815
2853
|
.action(async (options) => {
|
|
2816
2854
|
console.log(chalk_1.default.cyan.bold("\n🔄 SEMO 업데이트\n"));
|
|
2817
2855
|
const cwd = process.cwd();
|
|
@@ -2819,6 +2857,16 @@ program
|
|
|
2819
2857
|
const claudeDir = path.join(cwd, ".claude");
|
|
2820
2858
|
// 0. 버전 비교
|
|
2821
2859
|
await showVersionComparison(cwd);
|
|
2860
|
+
// 0.5. 레거시 환경 감지 및 마이그레이션
|
|
2861
|
+
const legacyCheck = detectLegacyEnvironment(cwd);
|
|
2862
|
+
if (legacyCheck.hasLegacy || options.migrate) {
|
|
2863
|
+
console.log(chalk_1.default.yellow("\n⚠️ 레거시 환경이 감지되어 업데이트 전 마이그레이션이 필요합니다.\n"));
|
|
2864
|
+
const migrationSuccess = await migrateLegacyEnvironment(cwd);
|
|
2865
|
+
if (migrationSuccess) {
|
|
2866
|
+
console.log(chalk_1.default.cyan("마이그레이션 완료. 'semo init'으로 새 환경을 설치하세요.\n"));
|
|
2867
|
+
}
|
|
2868
|
+
process.exit(0);
|
|
2869
|
+
}
|
|
2822
2870
|
// --only 옵션 파싱
|
|
2823
2871
|
const onlyPackages = options.only
|
|
2824
2872
|
? options.only.split(",").map((p) => p.trim())
|