projectops 4.2.44 → 4.2.46
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/README.md +1 -1
- package/package.json +1 -1
- package/src/commands/full.js +2 -2
- package/src/commands/interactive.js +5 -2
- package/src/commands/version.js +2 -2
- package/src/context.js +1 -0
- package/src/core/migration-guide.js +1 -1
- package/src/core/version-yml.js +13 -2
- package/src/index.js +4 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/src/commands/full.js
CHANGED
|
@@ -24,7 +24,7 @@ export function runFull(context, tempDir, targetRoot = ".", hooks = {}) {
|
|
|
24
24
|
force = true, now, today, templateVersion = "unknown",
|
|
25
25
|
deployTarget = "docker-ssh", publishTargets = [], includeSecretBackup = false,
|
|
26
26
|
changelogProvider = "github-ai", changelogBaseUrl = "", codeReviewCoderabbit = true,
|
|
27
|
-
deployBranch = "", intent = null } = context;
|
|
27
|
+
deployBranch = "", intent = null, semverAuto = true } = context;
|
|
28
28
|
|
|
29
29
|
// project_paths 마커 계산 (.sh existing_marker_in_dir 등가 — 대표 마커명)
|
|
30
30
|
const pathMarkers = new Map();
|
|
@@ -41,7 +41,7 @@ export function runFull(context, tempDir, targetRoot = ".", hooks = {}) {
|
|
|
41
41
|
version, types, paths, pathMarkers, branch, deployBranch, versionCode, now, today,
|
|
42
42
|
deployValues,
|
|
43
43
|
templateOptions: { templateVersion, deployTarget, publishTargets, includeSecretBackup, optionsDate: today,
|
|
44
|
-
changelogProvider, changelogBaseUrl, codeReviewCoderabbit, intent, mode: "full" },
|
|
44
|
+
changelogProvider, changelogBaseUrl, codeReviewCoderabbit, intent, mode: "full", semverAuto },
|
|
45
45
|
}));
|
|
46
46
|
|
|
47
47
|
// 2. README 버전 섹션
|
|
@@ -110,6 +110,9 @@ export async function runInteractive(baseCtx, { cwd = process.cwd(), source = {
|
|
|
110
110
|
let deployBranchReady = null; // #490 — 이번 실행에서 개발 브랜치 존재/생성이 확인됐는지
|
|
111
111
|
let deployBranchCreated = null; // #493 — 마법사가 직접 생성했는지 (가이드 기록용)
|
|
112
112
|
let intent = existing?.options?.intent ?? null; // #485 프로젝트 성격
|
|
113
|
+
// semver 자동 승격(#546) — 질문하지 않는다(#485 질문 부담 축소 방향 유지).
|
|
114
|
+
// 저장값이 있으면 보존, 없으면 신규 통합만 ON. 기존 레포는 업데이트만으로 버전이 튀지 않는다.
|
|
115
|
+
const semverAuto = existing?.options?.semverAuto ?? (existing ? false : true);
|
|
113
116
|
const showOptional = mode === "full" || mode === "workflows";
|
|
114
117
|
const realTty = process.stdout.isTTY === true;
|
|
115
118
|
|
|
@@ -278,7 +281,7 @@ export async function runInteractive(baseCtx, { cwd = process.cwd(), source = {
|
|
|
278
281
|
const { now, today } = clock || utcNow();
|
|
279
282
|
const ctx = createContext({
|
|
280
283
|
mode, force: true, types, version, versionCode, branch, paths, deployTarget, publishTargets, includeSecretBackup,
|
|
281
|
-
codeReviewCoderabbit, changelogProvider, changelogBaseUrl, deployBranch, intent,
|
|
284
|
+
codeReviewCoderabbit, changelogProvider, changelogBaseUrl, deployBranch, intent, semverAuto,
|
|
282
285
|
repoName, templateVersion, resolvers, envValues, envUseDefaults, now, today,
|
|
283
286
|
// #502 — version 모드가 기존 full 기록을 강등하지 않도록 (full이 우세)
|
|
284
287
|
recordMode: existing?.templateMode === "full" ? "full" : "version",
|
|
@@ -366,7 +369,7 @@ export async function runInteractive(baseCtx, { cwd = process.cwd(), source = {
|
|
|
366
369
|
migrationGuidePath = appendGuideEntry(cwd, {
|
|
367
370
|
now, mode, types, repoName,
|
|
368
371
|
templateFrom: existing?.templateVersion || "", templateTo: templateVersion,
|
|
369
|
-
options: { deploy: deployTarget, publish: publishTargets, secretBackup: includeSecretBackup, coderabbit: codeReviewCoderabbit, changelogProvider, intent },
|
|
372
|
+
options: { deploy: deployTarget, publish: publishTargets, secretBackup: includeSecretBackup, coderabbit: codeReviewCoderabbit, changelogProvider, intent, semverAuto },
|
|
370
373
|
branches: { defaultBranch: branch, deployBranch, ready: deployBranchReady, created: deployBranchCreated },
|
|
371
374
|
breaking: breakingReport, migrations: migrationsResult, orphans: orphanReport,
|
|
372
375
|
events: trace.events, counters: { skipped: result?.workflows?.skipped ?? 0 },
|
package/src/commands/version.js
CHANGED
|
@@ -14,7 +14,7 @@ export function runVersion(context, tempDir, targetRoot = ".") {
|
|
|
14
14
|
const { version, types = [], paths = new Map(), branch = "main", versionCode = 1,
|
|
15
15
|
now, today, templateVersion = "unknown", deployTarget = "docker-ssh", publishTargets = [], includeSecretBackup = false,
|
|
16
16
|
changelogProvider = "github-ai", changelogBaseUrl = "", codeReviewCoderabbit = true,
|
|
17
|
-
deployBranch = "", recordMode = "version" } = context;
|
|
17
|
+
deployBranch = "", recordMode = "version", semverAuto = true } = context;
|
|
18
18
|
|
|
19
19
|
const pathMarkers = new Map();
|
|
20
20
|
for (const [t] of paths) pathMarkers.set(t, markerForType(t));
|
|
@@ -25,7 +25,7 @@ export function runVersion(context, tempDir, targetRoot = ".") {
|
|
|
25
25
|
// mode(#502): version 모드가 기존 full 통합 기록을 "version"으로 강등하지 않도록
|
|
26
26
|
// 호출부가 recordMode로 기존 값을 넘긴다 (full이 우세 — 업데이트 재실행 범위 축소 방지).
|
|
27
27
|
templateOptions: { templateVersion, deployTarget, publishTargets, includeSecretBackup, optionsDate: today,
|
|
28
|
-
changelogProvider, changelogBaseUrl, codeReviewCoderabbit, mode: recordMode },
|
|
28
|
+
changelogProvider, changelogBaseUrl, codeReviewCoderabbit, mode: recordMode, semverAuto },
|
|
29
29
|
}));
|
|
30
30
|
addVersionSectionToReadme(version, targetRoot);
|
|
31
31
|
copyScripts(tempDir, targetRoot);
|
package/src/context.js
CHANGED
|
@@ -25,6 +25,7 @@ export function createContext(overrides = {}) {
|
|
|
25
25
|
codeReviewCoderabbit: null,
|
|
26
26
|
deployBranch: "", // 릴리스 PR head 브랜치 (#456). 빈 값=metadata.deploy_branch 미출력
|
|
27
27
|
intent: null, // 프로젝트 성격 (#485 — app/library/both/none/manual). null=미설정(역추론)
|
|
28
|
+
semverAuto: null, // semver 자동 승격 (#546). null=미설정(신규 통합 true / 기존 레포 false)
|
|
28
29
|
templateVersion: "",
|
|
29
30
|
tempDir: "",
|
|
30
31
|
deployValues: new Map(), // "type.KEY" -> value
|
|
@@ -156,7 +156,7 @@ export function renderGuideEntry(report) {
|
|
|
156
156
|
L.push(`template: { from: ${yq(from)}, to: ${yq(to)} }`);
|
|
157
157
|
L.push(`mode: ${r.mode || "full"}`);
|
|
158
158
|
L.push(`types: ${ylist(r.types)}`);
|
|
159
|
-
L.push(`options: { deploy: ${yq(r.options?.deploy ?? "")}, publish: ${ylist(r.options?.publish)}, secret_backup: ${r.options?.secretBackup === true}, coderabbit: ${r.options?.coderabbit === true}, changelog_provider: ${yq(r.options?.changelogProvider ?? "")}, intent: ${yq(r.options?.intent ?? "")} }`);
|
|
159
|
+
L.push(`options: { deploy: ${yq(r.options?.deploy ?? "")}, publish: ${ylist(r.options?.publish)}, secret_backup: ${r.options?.secretBackup === true}, coderabbit: ${r.options?.coderabbit === true}, changelog_provider: ${yq(r.options?.changelogProvider ?? "")}, intent: ${yq(r.options?.intent ?? "")}, semver_auto: ${r.options?.semverAuto === true} }`);
|
|
160
160
|
L.push(`branches: { default: ${yq(r.branches?.defaultBranch ?? "main")}, deploy: ${yq(r.branches?.deployBranch ?? "develop")}, deploy_branch_created: ${r.branches?.created === true} }`);
|
|
161
161
|
L.push("workflows:");
|
|
162
162
|
L.push(` added: ${ylist(wf.added)}`);
|
package/src/core/version-yml.js
CHANGED
|
@@ -52,7 +52,7 @@ const HEADER = `# ==============================================================
|
|
|
52
52
|
export function parseTemplateOptions(content) {
|
|
53
53
|
const out = { deploy: null, publish: null, secretBackup: null,
|
|
54
54
|
changelogProvider: null, changelogBaseUrl: null, codeReviewCoderabbit: null,
|
|
55
|
-
deployBranch: null, intent: null };
|
|
55
|
+
deployBranch: null, intent: null, semverAuto: null };
|
|
56
56
|
// deploy_branch는 metadata 직속(#456) — template.options 밖이라 별도로 스캔한다.
|
|
57
57
|
for (const line of String(content || "").split("\n")) {
|
|
58
58
|
if (line.startsWith("#")) continue;
|
|
@@ -118,6 +118,14 @@ export function parseTemplateOptions(content) {
|
|
|
118
118
|
if (v === "false") out.secretBackup = false;
|
|
119
119
|
continue;
|
|
120
120
|
}
|
|
121
|
+
// semver 자동 승격(#546). null(미기재)은 "기존 통합 레포" 신호 — 호출부가 OFF로 해석한다.
|
|
122
|
+
// 캡처를 true|false로 한정한다(intent와 같은 방식) — 값 뒤 인라인 주석이 값에 딸려오면
|
|
123
|
+
// strip()은 따옴표·공백만 걷어내므로 "true # ..."가 되어 매칭이 조용히 실패한다.
|
|
124
|
+
m = line.match(/^\s+semver_auto:\s*["']?(true|false)["']?/);
|
|
125
|
+
if (m) {
|
|
126
|
+
out.semverAuto = m[1] === "true";
|
|
127
|
+
continue;
|
|
128
|
+
}
|
|
121
129
|
m = line.match(/^\s+npm_publish:\s*(.+)/);
|
|
122
130
|
if (m) {
|
|
123
131
|
const v = strip(m[1]);
|
|
@@ -294,7 +302,8 @@ export function buildVersionYml({ version, types = [], paths = new Map(), pathMa
|
|
|
294
302
|
// template 옵션 블록 (.sh save_template_options 신규 추가 케이스). templateOptions 지정 시.
|
|
295
303
|
if (templateOptions) {
|
|
296
304
|
const { templateVersion = "unknown", deployTarget = "docker-ssh", publishTargets = [], includeSecretBackup = false, optionsDate = today,
|
|
297
|
-
changelogProvider = "github-ai", changelogBaseUrl = "", codeReviewCoderabbit = true, intent = null, mode = null
|
|
305
|
+
changelogProvider = "github-ai", changelogBaseUrl = "", codeReviewCoderabbit = true, intent = null, mode = null,
|
|
306
|
+
semverAuto = true } = templateOptions;
|
|
298
307
|
const publishJson = `[${publishTargets.map((t) => `"${t}"`).join(",")}]`;
|
|
299
308
|
// intent(프로젝트 성격, #485) — 미지정이면 deploy/publish에서 역추론해 기록 (재통합 시 진입 질문 생략용)
|
|
300
309
|
const intentVal = intent || inferIntent(deployTarget, publishTargets) || "manual";
|
|
@@ -310,6 +319,8 @@ export function buildVersionYml({ version, types = [], paths = new Map(), pathMa
|
|
|
310
319
|
out += ` deploy: "${deployTarget}"\n`;
|
|
311
320
|
out += ` publish: ${publishJson}\n`;
|
|
312
321
|
out += ` secret_backup: ${includeSecretBackup}\n`;
|
|
322
|
+
// semver 자동 승격(#546) — 릴리스 시 커밋 제목으로 major/minor/patch 결정. false면 항상 patch.
|
|
323
|
+
out += ` semver_auto: ${semverAuto} # 커밋 제목으로 버전 승격 폭 결정 (false면 항상 patch)\n`;
|
|
313
324
|
out += ` code_review:\n`;
|
|
314
325
|
out += ` coderabbit: ${codeReviewCoderabbit}\n`;
|
|
315
326
|
out += ` changelog:\n`;
|
package/src/index.js
CHANGED
|
@@ -141,6 +141,9 @@ export async function run(argv, { cwd = process.cwd(), source = { type: "git" },
|
|
|
141
141
|
changelogProvider: existing?.options?.changelogProvider ?? "github-ai",
|
|
142
142
|
changelogBaseUrl: existing?.options?.changelogBaseUrl ?? "",
|
|
143
143
|
codeReviewCoderabbit: existing?.options?.codeReviewCoderabbit ?? false,
|
|
144
|
+
// semver 자동 승격(#546): 저장값 → (기존 통합 레포면 false / 신규면 true).
|
|
145
|
+
// 이미 통합된 레포의 버전이 업데이트만으로 예고 없이 minor로 튀지 않게 하는 안전장치다.
|
|
146
|
+
semverAuto: existing?.options?.semverAuto ?? (existing ? false : true),
|
|
144
147
|
repoName,
|
|
145
148
|
// 실 resolver 4종 (.sh resolve_token 등가 — spring-app-yml 스텁 제거)
|
|
146
149
|
resolvers: makeResolvers(cwd, repoName, paths),
|
|
@@ -206,7 +209,7 @@ export async function run(argv, { cwd = process.cwd(), source = { type: "git" },
|
|
|
206
209
|
migrationGuidePath = appendGuideEntry(cwd, {
|
|
207
210
|
now, mode: opts.mode, types, repoName,
|
|
208
211
|
templateFrom: existing?.templateVersion || "", templateTo: context.templateVersion,
|
|
209
|
-
options: { deploy: deployTarget, publish: publishTargets, secretBackup: context.includeSecretBackup, coderabbit: context.codeReviewCoderabbit, changelogProvider: context.changelogProvider, intent },
|
|
212
|
+
options: { deploy: deployTarget, publish: publishTargets, secretBackup: context.includeSecretBackup, coderabbit: context.codeReviewCoderabbit, changelogProvider: context.changelogProvider, intent, semverAuto: context.semverAuto },
|
|
210
213
|
branches: { defaultBranch: branch, deployBranch: context.deployBranch || "develop", ready: null, created: null },
|
|
211
214
|
breaking: breakingReport, migrations: migrationsResult, orphans: { cleaned: [], pending: orphanPending },
|
|
212
215
|
events: trace.events, counters: { skipped: result?.workflows?.skipped ?? 0 },
|