projectops 4.104.6 → 4.104.8

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.
Files changed (85) hide show
  1. package/README.md +1 -1
  2. package/bin/projectops.js +4 -4
  3. package/package.json +1 -1
  4. package/src/cli/args.js +43 -43
  5. package/src/cli/errors.js +8 -8
  6. package/src/cli/help.js +4 -4
  7. package/src/commands/doctor.js +39 -39
  8. package/src/commands/full.js +29 -29
  9. package/src/commands/interactive.js +86 -86
  10. package/src/commands/issues.js +5 -5
  11. package/src/commands/skills.js +13 -13
  12. package/src/commands/version.js +8 -8
  13. package/src/commands/workflows.js +23 -22
  14. package/src/context.js +24 -24
  15. package/src/core/agent-guide.js +5 -5
  16. package/src/core/assets.js +11 -11
  17. package/src/core/baseline.js +24 -24
  18. package/src/core/branch-sub.js +23 -23
  19. package/src/core/breaking-check.js +21 -21
  20. package/src/core/breaking.js +6 -6
  21. package/src/core/ci-minutes-sub.js +13 -13
  22. package/src/core/constants.js +17 -17
  23. package/src/core/copy/coderabbit.js +10 -10
  24. package/src/core/copy/gitignore.js +9 -9
  25. package/src/core/copy/readme.js +7 -7
  26. package/src/core/copy/simple.js +35 -35
  27. package/src/core/copy/util.js +9 -9
  28. package/src/core/copy/workflows.js +99 -99
  29. package/src/core/detect-fs.js +21 -21
  30. package/src/core/detect.js +12 -12
  31. package/src/core/development-branch.js +11 -11
  32. package/src/core/exclusions.js +12 -12
  33. package/src/core/fsutil.js +9 -9
  34. package/src/core/git-branch.js +11 -11
  35. package/src/core/ide/adapter.js +23 -23
  36. package/src/core/ide/adapters/claude.js +12 -12
  37. package/src/core/ide/adapters/codex.js +4 -4
  38. package/src/core/ide/adapters/copilot.js +12 -12
  39. package/src/core/ide/adapters/cursor.js +7 -7
  40. package/src/core/ide/adapters/gemini.js +5 -5
  41. package/src/core/ide/adapters/pi-common.js +12 -12
  42. package/src/core/ide/adapters/pi-harness.js +7 -7
  43. package/src/core/ide/adapters/pi.js +3 -3
  44. package/src/core/ide/home-skills.js +6 -6
  45. package/src/core/ide/legacy.js +8 -8
  46. package/src/core/ide/registry.js +6 -6
  47. package/src/core/ide/runner.js +15 -15
  48. package/src/core/ide/skills-copy.js +34 -34
  49. package/src/core/ide/stable-entry.js +11 -11
  50. package/src/core/ide/util.js +4 -4
  51. package/src/core/incoming.js +13 -13
  52. package/src/core/label-style.js +12 -12
  53. package/src/core/migration-guide.js +19 -19
  54. package/src/core/migrations/index.js +16 -16
  55. package/src/core/migrations/registry.js +39 -39
  56. package/src/core/migrations/rules/legacy-dirs.js +6 -6
  57. package/src/core/migrations/rules/obsolete-workflows.js +4 -4
  58. package/src/core/migrations/rules/root-files.js +3 -3
  59. package/src/core/migrations/rules/settings-extractors.js +8 -8
  60. package/src/core/options-ask.js +104 -104
  61. package/src/core/options-schema.js +23 -23
  62. package/src/core/orphan-workflows.js +14 -14
  63. package/src/core/paths-resolve.js +54 -54
  64. package/src/core/paths.js +2 -2
  65. package/src/core/placeholder-triggers.js +10 -10
  66. package/src/core/repo-language.js +10 -10
  67. package/src/core/resolve-options.js +30 -30
  68. package/src/core/run-trace.js +54 -54
  69. package/src/core/store-locales-hint.js +13 -13
  70. package/src/core/verify.js +27 -27
  71. package/src/core/version-yml.js +117 -116
  72. package/src/core/wizard-env.js +42 -42
  73. package/src/core/wizard-labels.js +31 -31
  74. package/src/core/workflow-groups.js +14 -14
  75. package/src/i18n/core.en.js +1 -1
  76. package/src/i18n/doctor.en.js +1 -1
  77. package/src/i18n/ide.en.js +1 -1
  78. package/src/i18n/migrate.en.js +1 -1
  79. package/src/i18n/options.en.js +1 -1
  80. package/src/index.js +60 -60
  81. package/src/ui/ansi.js +5 -5
  82. package/src/ui/env-plan.js +44 -44
  83. package/src/ui/prompts.js +21 -21
  84. package/src/ui/readline-engine.js +38 -38
  85. package/src/ui/skills-prompts.js +4 -4
@@ -1,24 +1,24 @@
1
- // IDE Skills 설치 오케스트레이터.
2
- // 레지스트리 기반 — 개별 IDE를 이름으로 알지 않고 ADAPTERS 배열만 순회한다.
3
- // 새 IDE는 adapters/ 에 파일 추가 + registry 등록만으로 여기 수정 없이 동작한다.
1
+ // IDE skills install orchestrator.
2
+ // Registry based — does not know individual IDEs by name, only iterates the ADAPTERS array.
3
+ // A new IDE works with just a file in adapters/ + registry entry, with no changes here.
4
4
  import { ADAPTERS } from "../core/ide/registry.js";
5
5
  import { versionTag } from "../core/ide/util.js";
6
6
  import { defaultIo } from "../core/ide/runner.js";
7
7
  import * as skillsPrompts from "../ui/skills-prompts.js";
8
8
  import { t } from "../i18n/index.js";
9
9
 
10
- // 상태 수집 → [{adapter, status}]. optional 어댑터는 감지 불가(cliMissing)면 목록에서 제외.
10
+ // Collect status → [{adapter, status}]. Optional adapters are left out when undetectable (cliMissing).
11
11
  export function collectStatuses(io) {
12
12
  const rows = [];
13
13
  for (const a of ADAPTERS) {
14
14
  const status = safe(() => a.detect(io), { installed: false, version: null, cliMissing: true });
15
- if (a.optional && status.cliMissing) continue; // harness 등 조건부 항목은 불가 시 숨김
15
+ if (a.optional && status.cliMissing) continue; // Conditional items like the harness are hidden when unavailable
16
16
  rows.push({ adapter: a, status });
17
17
  }
18
18
  return rows;
19
19
  }
20
20
 
21
- // 상태 표시 문자열 목록 (표시용, 순수).
21
+ // Status display strings (for display, pure).
22
22
  export function formatStatuses(rows, templateVersion) {
23
23
  return rows.map(({ adapter, status }) => {
24
24
  const label = adapter.label.padEnd(12);
@@ -31,9 +31,9 @@ export function formatStatuses(rows, templateVersion) {
31
31
  });
32
32
  }
33
33
 
34
- // 대화형/비대화형 공통 진입. opts: {io, templateVersion, sourceSkillsDir, tempDir, interactive, ui, installedOnly}
35
- // installedOnly(#502 — 업데이트 모드): 비대화형 apply를 이미 설치된 어댑터로 한정한다.
36
- // 미설치 IDE에 새로 설치하지 않는다 — 업데이트는 "있는 것을 최신으로"가 계약.
34
+ // Shared entry for interactive/non-interactive. opts: {io, templateVersion, sourceSkillsDir, tempDir, interactive, ui, installedOnly}
35
+ // installedOnly (#502 — update mode): limits non-interactive apply to already-installed adapters.
36
+ // Never installs into IDEs not yet installed — an update's contract is "bring what exists up to date".
37
37
  export async function runSkills(opts = {}) {
38
38
  const io = opts.io || defaultIo();
39
39
  const ui = opts.ui || skillsPrompts;
@@ -45,8 +45,8 @@ export async function runSkills(opts = {}) {
45
45
  for (const line of formatStatuses(rows, ctx.templateVersion)) io.log(line);
46
46
  io.log("");
47
47
 
48
- // 비대화형: 감지된(=관리 가능) 모든 어댑터에 apply(설치/업데이트) 순차 실행.
49
- // installedOnly면 설치된 어댑터만 (업데이트 모드 — 미설치 IDE는 건드리지 않음).
48
+ // Non-interactive: run apply (install/update) in order on every detected (= manageable) adapter.
49
+ // With installedOnly, installed adapters only (update mode — IDEs not installed are left alone).
50
50
  if (!opts.interactive) {
51
51
  for (const { adapter, status } of rows) {
52
52
  if (opts.installedOnly && !status.installed) continue;
@@ -55,7 +55,7 @@ export async function runSkills(opts = {}) {
55
55
  return 0;
56
56
  }
57
57
 
58
- // 대화형: 동작 선택 → IDE 멀티셀렉트 → 실행.
58
+ // Interactive: choose action → IDE multiselect → run.
59
59
  const action = await ui.selectAction();
60
60
  if (action == null || action === skillsPrompts.CANCEL || action === "skip") {
61
61
  io.log(t("skills.unchanged"));
@@ -64,7 +64,7 @@ export async function runSkills(opts = {}) {
64
64
 
65
65
  const choices = rows.map(({ adapter, status }) => ({
66
66
  id: adapter.id, label: adapter.label,
67
- disabled: action === "apply" && status.cliMissing, // 설치는 CLI 있어야, 제거는 무조건 후보
67
+ disabled: action === "apply" && status.cliMissing, // Install needs the CLI; removal is always a candidate
68
68
  }));
69
69
  const preselect = rows
70
70
  .filter(({ status }) => action === "apply" ? !status.cliMissing : true)
@@ -1,6 +1,6 @@
1
- // version 모드 (version.yml 생성·갱신).
2
- // 순서: version.yml → readme → scripts → config → gitignore → setup_guide.
3
- // (워크플로우 미복사 → deploy 블록 없음. util·issue·coderabbit도 없음.)
1
+ // version mode (generate/update version.yml).
2
+ // Order: version.yml → readme → scripts → config → gitignore → setup_guide.
3
+ // (No workflow copy → no deploy block. No util, issue or coderabbit either.)
4
4
  import { existsSync, readFileSync } from "node:fs";
5
5
  import { join } from "node:path";
6
6
  import { writeText } from "../core/fsutil.js";
@@ -15,14 +15,14 @@ import { ensureGitignore } from "../core/copy/gitignore.js";
15
15
  import { toTemplateOptions } from "../core/resolve-options.js";
16
16
 
17
17
  export function runVersion(context, tempDir, targetRoot = ".") {
18
- // 옵션 값은 resolveOptions 가 정해 context 에 넣는다 — 여기서 기본값을 다시 고르지 않는다
18
+ // Option values are decided by resolveOptions and put in context — defaults are not picked again here
19
19
  const { version, types = [], paths = new Map(), branch = "main", versionCode = 1,
20
20
  now, today, templateVersion, deployBranch = "", recordMode = "version", labelStyle } = context;
21
21
 
22
22
  const pathMarkers = new Map();
23
23
  for (const [t] of paths) pathMarkers.set(t, markerForType(t));
24
24
 
25
- // version.yml 은 전체 재생성이라, 읽지 않으면 이전 통합이 남긴 deploy 값(사용자 수정 포함)이 사라진다 (#670)
25
+ // version.yml is fully regenerated, so without reading it, deploy values left by a previous integration (including user edits) vanish (#670)
26
26
  const vyFile = join(targetRoot, PATHS.versionFile);
27
27
  const deployValues = mergeDeployValues(existsSync(vyFile) ? readFileSync(vyFile, "utf8") : "", new Map());
28
28
 
@@ -30,11 +30,11 @@ export function runVersion(context, tempDir, targetRoot = ".") {
30
30
  buildVersionYml({
31
31
  version, types, paths, pathMarkers, branch, deployBranch, versionCode, now, today,
32
32
  deployValues,
33
- // 생성기가 모르는 키(issue_helper 등)를 지킨다 — version.yml 을 매번 다시 쓰므로 안 그러면 업데이트마다 사라진다 (#835)
33
+ // Keep keys the generator does not know (issue_helper, etc.) — version.yml is rewritten every time, so otherwise they vanish on every update (#835)
34
34
  ...customYml(vyFile),
35
35
  updatedBy: resolveUpdatedBy(existsSync(vyFile) ? readFileSync(vyFile, "utf8") : "", targetRoot), // #811
36
- // mode(#502): version 모드가 기존 full 통합 기록을 "version"으로 강등하지 않도록
37
- // 호출부가 recordMode로 기존 값을 넘긴다 (full이 우세 — 업데이트 재실행 범위 축소 방지).
36
+ // mode (#502): so version mode does not downgrade an existing full integration record to "version",
37
+ // the caller passes the existing value as recordMode (full wins — prevents shrinking the update re-run scope).
38
38
  templateOptions: toTemplateOptions(context, { mode: recordMode, optionsDate: today }),
39
39
  }));
40
40
  addVersionSectionToReadme(version, targetRoot, context.language);
@@ -1,6 +1,6 @@
1
- // workflows 모드 (워크플로우만 설치).
2
- // 순서: copy_workflows → update_version_yml_deploy(version.yml 있을 때만) → scripts → config → util(타입별) → setup_guide.
3
- // (version.yml 생성 안 함 — 기존 version.yml이 있을 때만 deploy 블록 추가.)
1
+ // workflows mode (installs workflows only).
2
+ // Order: copy_workflows → update_version_yml_deploy (only if version.yml exists) → scripts → config → util (per type) → setup_guide.
3
+ // (Does not generate version.yml — adds the deploy block only when a version.yml already exists.)
4
4
  import { join } from "node:path";
5
5
  import { existsSync, readFileSync, writeFileSync } from "node:fs";
6
6
  import { PATHS } from "../core/paths.js";
@@ -8,46 +8,46 @@ import { copyWorkflows } from "../core/copy/workflows.js";
8
8
  import { applyLabelStyle } from "../core/label-style.js";
9
9
  import { copyScripts, copyConfigFolder, copySetupGuide } from "../core/copy/simple.js";
10
10
  import { copyUtilModules } from "../core/copy/util.js";
11
- import { convertLegacySingularType, mergeDeployValues } from "../core/version-yml.js";
11
+ import { convertLegacySingularType, mergeDeployValues, commentsFor } from "../core/version-yml.js";
12
12
  import { installAgentGuide } from "../core/agent-guide.js";
13
13
  import { verifyInstall } from "../core/verify.js";
14
14
 
15
15
  export function runWorkflows(context, tempDir, targetRoot = ".", hooks = {}) {
16
- const { types = [], force = true, labelStyle } = context; // labelStyle 은 resolveOptions 가 정한다
16
+ const { types = [], force = true, labelStyle } = context; // labelStyle is decided by resolveOptions
17
17
  const wf = copyWorkflows(context, tempDir, targetRoot, hooks);
18
18
 
19
19
  const vy = join(targetRoot, PATHS.versionFile);
20
20
 
21
- // v4.1.0 이전 단수 project_type 최소 변환 (#471) — 여기서 복사되는 신형 version_manager가
22
- // 단수 키를 거부하므로, 변환 없이 두면 버전 워크플로우가 전부 실패하는 깨진 상태가 된다.
21
+ // Minimal conversion of the pre-v4.1.0 singular project_type (#471) — the new version_manager copied here
22
+ // rejects the singular key, so without converting, every version workflow fails in a broken state.
23
23
  if (existsSync(vy)) {
24
24
  const converted = convertLegacySingularType(readFileSync(vy, "utf8"));
25
25
  if (converted !== null) writeFileSync(vy, converted);
26
26
  }
27
27
 
28
- // update_version_yml_deploy: 기존 version.yml이 있고 ask 값이 있을 때만 deploy 블록 갱신
28
+ // update_version_yml_deploy: update the deploy block only when a version.yml exists and there are ask values
29
29
  if (existsSync(vy) && wf.deployValues && wf.deployValues.size) {
30
30
  const cur = readFileSync(vy, "utf8");
31
- writeFileSync(vy, upsertDeployBlock(cur, mergeDeployValues(cur, wf.deployValues))); // 기존 값 우선 (#670)
31
+ writeFileSync(vy, upsertDeployBlock(cur, mergeDeployValues(cur, wf.deployValues), context.language)); // Existing values first (#670)
32
32
  }
33
33
 
34
34
  copyScripts(tempDir, targetRoot);
35
35
  copyConfigFolder(tempDir, targetRoot);
36
- applyLabelStyle(targetRoot, labelStyle); // #776 — 워크플로우(QA 봇)와 라벨 정의를 같은 표기로 맞춘다
36
+ applyLabelStyle(targetRoot, labelStyle); // #776 — aligns workflows (QA bot) and label definitions to the same style
37
37
  for (const t of types) copyUtilModules(tempDir, t, { force }, targetRoot);
38
38
  copySetupGuide(tempDir, targetRoot);
39
39
  installAgentGuide(targetRoot, context.templateVersion);
40
40
 
41
- // 설치 후 검증 (#549) — 워크플로우만 설치하는 모드라 오히려 더 필요하다.
41
+ // Post-install verification (#549) — all the more needed in a mode that installs only workflows.
42
42
  const verification = verifyInstall(targetRoot);
43
- // detail 키 이름 주의: run-trace의 민감값 가드가 pat|token|secret|password|credential을
44
- // 키에서 걸러낸다(#494). 여기서 다루는 값은 비밀이 아니라 "치환 플레이스홀더 이름"과
45
- // "등록이 필요한 키 이름"이라 가드에 걸리지 않는 이름을 쓴다 — 가드 자체는 우회하지 않는다.
43
+ // Mind the detail key names: the run-trace sensitive value guard filters pat|token|secret|password|credential
44
+ // out of keys (#494). These values are not secrets but "substitution placeholder names" and
45
+ // "key names that need registering", so names that do not trip the guard are used — the guard itself is not bypassed.
46
46
  hooks.trace?.event("verify", "scan", "", {
47
47
  unresolved: verification.unresolved.length,
48
48
  requiredKeys: verification.secrets.size,
49
49
  });
50
- // 미치환 값은 배포 시점에 실패할 자리다 — 어느 파일 몇 번째 줄인지 로그에 남긴다.
50
+ // Unreplaced values are spots that will fail at deploy time — log which file and line.
51
51
  for (const u of verification.unresolved) {
52
52
  hooks.trace?.event("verify", "unresolved", u.filename, { line: u.line, placeholder: u.token });
53
53
  }
@@ -58,27 +58,28 @@ export function runWorkflows(context, tempDir, targetRoot = ".", hooks = {}) {
58
58
  return { workflows: wf, verification };
59
59
  }
60
60
 
61
- // 기존 version.yml에서 deploy: 블록을 제거하고 새로 append (멱등).
62
- export function upsertDeployBlock(content, deployValues) {
63
- // 기존 deploy: 블록 제거 (deploy: 라인 ~ 다음 최상위 키 전까지)
61
+ // Remove the deploy: block from the existing version.yml and append a new one (idempotent).
62
+ // language: resolved repo text language (en | ko), picks the deploy: line comment (#1214)
63
+ export function upsertDeployBlock(content, deployValues, language) {
64
+ // Remove the existing deploy: block (from the deploy: line up to the next top-level key)
64
65
  const lines = content.split(/\r?\n/);
65
66
  const out = [];
66
67
  let inDeploy = false;
67
68
  for (const line of lines) {
68
69
  if (/^deploy:/.test(line)) { inDeploy = true; continue; }
69
70
  if (inDeploy) {
70
- // 4.28.0 이 만든 깨진 구조: deploy 아래 2칸 `template:` 은 deploy 내용이 아니라 metadata 의 자식이다 (#670)
71
+ // Broken structure made by 4.28.0: a 2-space `template:` under deploy is a child of metadata, not deploy content (#670)
71
72
  if (/^ {2}template:/.test(line)) inDeploy = false;
72
- else if (/^\s/.test(line) || line === "") continue; // 들여쓰기/빈줄 = deploy 내부
73
+ else if (/^\s/.test(line) || line === "") continue; // Indented/blank line = inside deploy
73
74
  else inDeploy = false;
74
75
  }
75
76
  out.push(line);
76
77
  }
77
78
  let text = out.join("\n").replace(/\n+$/, "\n");
78
- // 새 deploy 블록 append
79
+ // Append the new deploy block
79
80
  const deployTypes = [...deployValues.keys()].filter((t) => deployValues.get(t)?.size);
80
81
  if (deployTypes.length) {
81
- text += `\ndeploy: # 마법사가 기억하는 배포 설정 (비민감 / 직접 수정 가능)\n`;
82
+ text += `\ndeploy: # ${commentsFor(language).deploy}\n`;
82
83
  for (const t of deployTypes) {
83
84
  text += ` ${t}:\n`;
84
85
  for (const [k, v] of deployValues.get(t)) text += ` ${k}: "${v}"\n`;
package/src/context.js CHANGED
@@ -1,11 +1,11 @@
1
- // 마법사 전역 상태를 하나의 객체로 명시화 (bash 전역 변수군 대체)
2
- // next 타입은 v4.1.0에서 react로 흡수됨 (breaking)
1
+ // Wizard global state made explicit as one object (replaces the bash global variables)
2
+ // The next type was merged into react in v4.1.0 (breaking)
3
3
  export const VALID_TYPES = [
4
4
  "spring", "flutter", "react",
5
5
  "react-native", "react-native-expo", "node", "python", "basic",
6
6
  ];
7
7
 
8
- export const DEFAULT_VERSION = "1.3.14"; // 템플릿 버전 미상 시 (배너 폴백용 — breaking 비교엔 안 씀)
8
+ export const DEFAULT_VERSION = "1.3.14"; // When the template version is unknown (banner fallback — not used for breaking comparison)
9
9
 
10
10
  export function createContext(overrides = {}) {
11
11
  return {
@@ -15,29 +15,29 @@ export function createContext(overrides = {}) {
15
15
  version: "",
16
16
  branch: "",
17
17
  paths: new Map(), // type -> path
18
- // 배포/publish 축 (#439 — 타입 비종속. null=미설정)
19
- deployTarget: null, // 'docker-ssh'(기본) | 'vercel' | 'none'
20
- publishTargets: null, // ['nexus','npm','github-packages'] 부분집합
18
+ // Deploy/publish axes (#439 — type-independent. null = unset)
19
+ deployTarget: null, // 'docker-ssh' (default) | 'vercel' | 'none'
20
+ publishTargets: null, // subset of ['nexus','npm','github-packages']
21
21
  includeSecretBackup: null,
22
- projectsSync: null, // Projects 보드 동기화 포함 여부 (#716). null=미설정(신규 false / 이미 설치된 레포는 유지)
23
- aiPrSummary: null, // #566 — AI 변경 요약 워크플로우 포함 여부
24
- // changelog provider 축 (#455 — null=미설정)
25
- changelogProvider: null, // 'commit'(기본) | 'coderabbit' | 'openai' | 'gemini' | 'claude' | 'ollama' | 'commit'
26
- changelogBaseUrl: null, // ollama일 때만 값
22
+ projectsSync: null, // Whether to include Projects board sync (#716). null = unset (new false / already-installed repos keep it)
23
+ aiPrSummary: null, // #566 — whether to include the AI change summary workflow
24
+ // changelog provider axis (#455 — null = unset)
25
+ changelogProvider: null, // 'commit' (default) | 'coderabbit' | 'openai' | 'gemini' | 'claude' | 'ollama' | 'commit'
26
+ changelogBaseUrl: null, // Only for ollama
27
27
  codeReviewCoderabbit: null,
28
- deployBranch: "", // 릴리스 PR head 브랜치 (#456). 빈 값=metadata.development_branch 미출력
29
- deployTriggerBranch: "", // 푸시되면 배포가 도는 브랜치 (#1114). 빈 값=기본 브랜치와 같음(워크플로 그대로)
30
- ciMinutesSaver: false, // CI 사용 시간 절약 치환 (#1114). false=워크플로 그대로
31
- intent: null, // 프로젝트 성격 (#485 — app/library/both/none/manual). null=미설정(역추론)
32
- semverAuto: null, // semver 자동 승격 (#546). null=미설정 → 신규·기존 모두 true (#814). 명시적 false 만 끈다
33
- closeOnRelease: null, // 릴리스 시 완료 이슈 닫기 (#771). null=미설정(신규 true / 기존 레포 키 없음)
34
- language: null, // 레포 문구 언어 (#769). null=미설정(신규 en / 기존 레포 ko)
35
- labelStyle: null, // 상태 라벨 표기 (#776). null=미설정(신규 en / 기존 레포 ko)
36
- excludedWorkflows: null, // 설치하지 않을 워크플로우 파일명 (#810). null=없음
37
- storeLocales: null, // 스토어 릴리스 노트 언어 (#829). null=미설정 → 현행 동작 유지
38
- storeLocalesIos: null, // App Store 만 언어 구성이 다를 때 (#829). null=공통 store_locales 를 쓴다
39
- storeLocalesPlay: null, // Play 만 언어 구성이 다를 때 (#829)
40
- appRelease: null, // 앱 심사 배포 레포인가 (#553). null=미설정(키 기록 안 함)
28
+ deployBranch: "", // Release PR head branch (#456). Empty = metadata.development_branch not written
29
+ deployTriggerBranch: "", // Branch whose push runs the deploy (#1114). Empty = same as the default branch (workflows as is)
30
+ ciMinutesSaver: false, // CI minutes saver substitution (#1114). false = workflows as is
31
+ intent: null, // Project nature (#485 — app/library/both/none/manual). null = unset (inferred)
32
+ semverAuto: null, // Automatic semver bump (#546). null = unset → true for new and existing (#814). Only an explicit false turns it off
33
+ closeOnRelease: null, // Close done issues on release (#771). null = unset (new true / no key in existing repos)
34
+ language: null, // Repo text language (#769). null = unset (new en / existing repos ko)
35
+ labelStyle: null, // Status label style (#776). null = unset (new en / existing repos ko)
36
+ excludedWorkflows: null, // Workflow file names not to install (#810). null = none
37
+ storeLocales: null, // Store release note languages (#829). null = unset → current behavior kept
38
+ storeLocalesIos: null, // When only the App Store has a different language set (#829). null = use the shared store_locales
39
+ storeLocalesPlay: null, // When only Play has a different language set (#829)
40
+ appRelease: null, // Whether the repo deploys through app review (#553). null = unset (no key written)
41
41
  templateVersion: "",
42
42
  tempDir: "",
43
43
  deployValues: new Map(), // "type.KEY" -> value
@@ -1,10 +1,10 @@
1
- // 사용자 레포에 설치하는 AI agent 안내문 (.github/.projectops/AGENT-GUIDE.md).
1
+ // AI agent guide installed into the user repo (.github/.projectops/AGENT-GUIDE.md).
2
2
  //
3
- // 왜 파일인가: 이 레포의 AGENTS.md 는 템플릿 전용이라 사용자 프로젝트로 가지 않는다. 그래서 projectops 가
4
- // 깔린 레포에서 일하는 agent 는 "이 레포가 무엇으로 관리되는지, 옵션을 어디서 확인하는지"를 알 길이 없었다.
5
- // 레포 루트의 AGENTS.md·CLAUDE.md 는 사용자 것이라 건드리지 않고, 폴더 안에 두고 한 줄 포인터만 안내한다.
3
+ // Why a file: this repo's AGENTS.md is template-only and never reaches user projects, so agents working in a
4
+ // repo with projectops installed had no way to know what manages the repo or where to check options.
5
+ // The repo-root AGENTS.md and CLAUDE.md belong to the user, so we leave them alone, keep this inside the folder, and point to it in one line.
6
6
  //
7
- // 내용에 옵션 표를 박지 않는다 — 박으면 곧 낡는다. 표는 항상 `npx projectops --mode options --json` 이 정본이다.
7
+ // No option table in the content — it would go stale fast. `npx projectops --mode options --json` is always the source of truth.
8
8
  import { join } from "node:path";
9
9
  import { writeText } from "./fsutil.js";
10
10
  import { TEMPLATE_REPO_WEB_URL } from "./paths.js";
@@ -1,4 +1,4 @@
1
- // 템플릿 자산 획득 + 제외 적용.
1
+ // Fetch template assets + apply exclusions.
2
2
  import { execFileSync } from "node:child_process";
3
3
  import { mkdirSync } from "node:fs";
4
4
  import { join } from "node:path";
@@ -7,12 +7,12 @@ import { DOCS_TO_REMOVE, PLUGIN_ITEMS_TO_REMOVE } from "./exclusions.js";
7
7
  import { DEFAULT_VERSION } from "../context.js";
8
8
  import { TEMPLATE_REPO } from "./paths.js";
9
9
 
10
- // 템플릿을 tempDir로 획득한다.
10
+ // Fetch the template into tempDir.
11
11
  // source:
12
- // {type:'git', repo?} → git clone --depth 1 (기본 repo=TEMPLATE_REPO)
13
- // {type:'local', path} → 로컬 트리 복사 (네트워크 없는 등가 검증용)
14
- // 이미 tempDir/.github 있으면 스킵(중복 호출 방지). 획득 후 applyExclusions 자동 호출.
15
- // keep: 제외 목록 중 남길 항목 (스킬 설치 경로: scripts/common 필요 > ["scripts"], #994)
12
+ // {type:'git', repo?} → git clone --depth 1 (default repo=TEMPLATE_REPO)
13
+ // {type:'local', path} → copy a local tree (for offline equivalence checks)
14
+ // Skip if tempDir/.github already exists (prevents duplicate calls). Calls applyExclusions automatically after fetching.
15
+ // keep: exclusion entries to keep (skill install path needs scripts/common > ["scripts"], #994)
16
16
  export function acquireTemplate({ tempDir, source = { type: "git" }, keep = [] }) {
17
17
  if (exists(join(tempDir, ".github"))) {
18
18
  applyExclusions(tempDir, { keep });
@@ -23,23 +23,23 @@ export function acquireTemplate({ tempDir, source = { type: "git" }, keep = [] }
23
23
  copyDirSync(source.path, tempDir);
24
24
  } else {
25
25
  const repo = source.repo || TEMPLATE_REPO;
26
- // clone 은 stdio 를 버려 실패 원인이 사라진다 — 폴더가 읽기 전용이어도 "내려받지 못했다"로 오도되므로
27
- // 먼저 만들어 권한 오류(EACCES/EPERM/EROFS)를 그대로 올린다 (#720). 빈 폴더에는 clone 이 가능하다.
26
+ // clone discards stdio, so the cause of failure is lost — a read-only folder would be misreported as "could not download".
27
+ // Create it first so permission errors (EACCES/EPERM/EROFS) surface as is (#720). clone works into an empty folder.
28
28
  mkdirSync(tempDir, { recursive: true });
29
29
  execFileSync("git", ["clone", "-c", "core.longpaths=true", "--depth", "1", "--quiet", repo, tempDir], { stdio: ["ignore", "ignore", "pipe"] });
30
30
  }
31
31
  applyExclusions(tempDir, { keep });
32
32
  }
33
33
 
34
- // DOCS_TO_REMOVE + PLUGIN_ITEMS_TO_REMOVE 삭제 (keep 항목 제외). skills/ 는 보존.
35
- // 통합 복사는 .github 등 명시 경로만 읽음 > tempDir 에 남긴 scripts/ 는 사용자 레포로 안 감
34
+ // Delete DOCS_TO_REMOVE + PLUGIN_ITEMS_TO_REMOVE (except keep entries). skills/ is kept.
35
+ // The integration copy reads only explicit paths such as .github > scripts/ left in tempDir never reaches the user repo
36
36
  export function applyExclusions(tempDir, { keep = [] } = {}) {
37
37
  const keptItems = new Set(keep);
38
38
  for (const doc of DOCS_TO_REMOVE) remove(join(tempDir, doc));
39
39
  for (const item of PLUGIN_ITEMS_TO_REMOVE) if (!keptItems.has(item)) remove(join(tempDir, item));
40
40
  }
41
41
 
42
- // tempDir/version.yml 의 ^version: 값. 없으면 DEFAULT_VERSION.
42
+ // The ^version: value in tempDir/version.yml. DEFAULT_VERSION if missing.
43
43
  export function readTemplateVersion(tempDir) {
44
44
  const p = join(tempDir, "version.yml");
45
45
  if (!exists(p)) return DEFAULT_VERSION;
@@ -1,19 +1,19 @@
1
- // 설치 시점 baseline (#557) — 업데이트에서 "누가 바꿨는지"를 가르는 기준점.
1
+ // Install-time baseline (#557) — the reference point that tells, during an update, "who changed it".
2
2
  //
3
- // 왜 필요한가: isUnchanged()는 템플릿(theirs)과 설치본(ours)을 2-way로 비교한다.
4
- // base가 없으니 업스트림이 한 글자만 고쳐도 사용자가 손대지 않은 파일이 changed로 떨어지고,
5
- // 결국 "전부 skip(업데이트 못 받음)" 아니면 "전부 overwrite(사용자 수정 전멸)" 둘 중 하나만
6
- // 고를 수 있게 된다. 정작 가려내야 할 진짜 충돌이 나머지에 묻힌다.
3
+ // Why: isUnchanged() compares the template (theirs) with the installed copy (ours) 2-way.
4
+ // With no base, a one-character upstream fix makes a file the user never touched fall into changed,
5
+ // leaving only two choices: "skip everything (no updates)" or "overwrite everything (all user edits lost)".
6
+ // The real conflicts that need sorting get buried among the rest.
7
7
  //
8
- // 파일 사본이 아니라 해시만 남긴다 — 분류가 목적이지 자동 병합이 목적이 아니다.
8
+ // Stores hashes, not file copies — the goal is classification, not automatic merging.
9
9
  //
10
- // 해시를 두 개 두는 이유: env 치환으로 사용자 값이 들어간 파일은 디스크 내용과 "기본값으로
11
- // 렌더한 결과"가 애초에 다르다. 하나로는 두 질문에 동시에 답할 수 없다.
12
- // - installed : 설치 시점 우리가 디스크에 쓴 내용 → "사용자가 그 뒤에 손댔는가"
13
- // - rendered : 그 시점 템플릿을 기본값 치환한 결과 → "업스트림이 그 뒤에 바뀌었는가"
10
+ // Why two hashes: a file with user values substituted via env differs on disk from the "render with
11
+ // defaults" from the start. One hash cannot answer both questions.
12
+ // - installed : what we wrote to disk at install time → "did the user edit it since?"
13
+ // - rendered : the template rendered with defaults then → "did upstream change since?"
14
14
  //
15
- // installed는 우리가 실제로 쓴 파일에만 채운다. 사용자 수정본을 installed로 기록하면
16
- // "우리가 쓴 것"이라고 거짓말하는 셈이고, 다음 업데이트에서 그 파일이 조용히 덮인다.
15
+ // installed is filled only for files we actually wrote. Recording a user-edited file as installed
16
+ // would falsely claim "we wrote it", and the next update would silently overwrite that file.
17
17
  import { createHash } from "node:crypto";
18
18
  import { join } from "node:path";
19
19
  import { existsSync, readFileSync } from "node:fs";
@@ -26,8 +26,8 @@ export function sha256(text) {
26
26
  return "sha256:" + createHash("sha256").update(String(text), "utf8").digest("hex");
27
27
  }
28
28
 
29
- // 없거나 깨졌으면 null — 호출부는 "base 미상"으로 폴백한다(조용히 빈 baseline을 쓰지 않는다.
30
- // 빈 baseline은 "기록이 없다"가 아니라 "전부 삭제됐다"로 오해될 수 있다).
29
+ // null when missing or broken — the caller falls back to "base unknown" (never silently use an empty baseline;
30
+ // an empty baseline could be read as "everything was deleted" rather than "no record").
31
31
  export function readBaseline(targetRoot = ".") {
32
32
  const p = join(targetRoot, BASELINE_PATH);
33
33
  if (!existsSync(p)) return null;
@@ -36,18 +36,18 @@ export function readBaseline(targetRoot = ".") {
36
36
  if (!data || typeof data !== "object" || typeof data.files !== "object" || data.files === null) return null;
37
37
  return data;
38
38
  } catch {
39
- return null; // 손상된 baseline은 없는 것으로 취급 — 업데이트를 막지 않는다
39
+ return null; // Treat a corrupt baseline as missing — do not block the update
40
40
  }
41
41
  }
42
42
 
43
43
  // entries: Map<filename, {installed?:string|null, rendered:string}>
44
- // 기존 baseline은 병합 대상이다 — 이번 실행에서 건드리지 않은 파일의 기준점을 잃지 않는다.
44
+ // The existing baseline is merged — files not touched in this run keep their reference point.
45
45
  export function writeBaseline(targetRoot, { templateVersion, installedAt, entries, previous = null }) {
46
46
  const files = { ...(previous?.files || {}) };
47
47
  for (const [filename, entry] of entries) {
48
48
  const prev = files[filename] || {};
49
49
  files[filename] = {
50
- // installed는 이번에 실제로 쓴 경우에만 갱신. 유지(skip)한 파일은 예전 기준점을 지킨다.
50
+ // installed is updated only when actually written this time. Kept (skipped) files keep the old reference point.
51
51
  installed: entry.installed ?? prev.installed ?? null,
52
52
  rendered: entry.rendered,
53
53
  };
@@ -61,23 +61,23 @@ export function writeBaseline(targetRoot, { templateVersion, installedAt, entrie
61
61
  return out;
62
62
  }
63
63
 
64
- // 사용자가 이 파일을 설치 후 손댔는가.
65
- // baseline이 없거나 그 파일 기록이 없으면 null — "모른다"이지 "안 건드렸다"가 아니다.
66
- // 호출부는 null을 현행 2-way 판정으로 폴백시켜야 한다.
64
+ // Did the user edit this file after install?
65
+ // null when there is no baseline or no record for the file — that means "unknown", not "untouched".
66
+ // The caller must fall back to the current 2-way check on null.
67
67
  export function isUserModified(baseline, filename, installedContent) {
68
68
  const rec = baseline?.files?.[filename];
69
69
  if (!rec || !rec.installed) return null;
70
70
  return rec.installed !== sha256(installedContent);
71
71
  }
72
72
 
73
- // baseline에는 있는데 디스크에 없는 파일 = 사용자가 지운 것.
74
- // 별도의 삭제 이력 파일이 필요 없다는 것이 이 설계의 부산물이다.
75
- // candidates: 템플릿이 이번에 설치하려는 파일명 목록 (그 밖의 baseline 항목은 관심 없다)
73
+ // In the baseline but missing on disk = deleted by the user.
74
+ // A by-product of this design: no separate deletion history file is needed.
75
+ // candidates: file names the template wants to install this time (other baseline entries are irrelevant)
76
76
  export function detectRemoved(baseline, candidates, workflowsDir) {
77
77
  if (!baseline) return [];
78
78
  const removed = [];
79
79
  for (const filename of candidates) {
80
- if (!baseline.files[filename]) continue; // 우리가 설치한 적 없는 파일 — 판단 근거 없음
80
+ if (!baseline.files[filename]) continue; // We never installed this file — no basis to judge
81
81
  if (existsSync(join(workflowsDir, filename))) continue;
82
82
  removed.push(filename);
83
83
  }
@@ -1,20 +1,20 @@
1
- // 워크플로우 브랜치 치환 (#477) — 대상 레포의 브랜치 전략이 표준(main/develop)과 다를 때
2
- // 복사된 워크플로우의 브랜치 리터럴을 설정값으로 교체한다.
3
- // 표준값이면 입력을 그대로 반환(no-op) — 템플릿 원본과 바이트 동일이 유지되어야
4
- // isUnchanged 스킵 로직과 "표준 레포 무변화" 계약이 깨지지 않는다.
1
+ // Workflow branch substitution (#477) — when the target repo's branch strategy differs from the standard (main/develop),
2
+ // replace branch literals in the copied workflows with the configured values.
3
+ // For standard values the input is returned as is (no-op) — staying byte-identical to the template keeps
4
+ // the isUnchanged skip logic and the "standard repo stays unchanged" contract intact.
5
5
  //
6
- // 치환 대상은 실측 전수조사(#477)된 패턴만 다룬다 (글롭·전면 replace 금지 — 오살 방지):
7
- // 1) 트리거 인라인: branches: ["main"] / [develop] / [ develop ] / ["develop"]
8
- // 2) 트리거 멀티라인: " - main" / " - develop" 단독 라인 (뒤 주석 허용)
9
- // 3) 릴리스 가드: == 'develop' (RELEASE-CHANGELOG automerge head 가드)
10
- // 4) step 내부: git fetch origin main (RELEASE-CHANGELOG 커밋 분석)
11
- // 5) 배포 트리거(#1114): 배포 워크플로 파일만, main > deployTriggerBranch (아래 DEPLOY_TRIGGER_WORKFLOWS)
12
- // 6) 배포 스크립트 안 브랜치 검사(#1114): [ "$BRANCH" == "main" ] (REACT-CICD 허용 브랜치 검사)
13
- // 7) CI 사용 시간 절약(#1114): ciMinutesSaver 일 때 ci-minutes-sub.js (브랜치 치환보다 먼저, 템플릿 원문 기준)
6
+ // Only patterns found by a full survey (#477) are substituted (no globs or blanket replace — avoids collateral damage):
7
+ // 1) inline trigger: branches: ["main"] / [develop] / [ develop ] / ["develop"]
8
+ // 2) multi-line trigger: " - main" / " - develop" alone on a line (trailing comment allowed)
9
+ // 3) release guard: == 'develop' (RELEASE-CHANGELOG automerge head guard)
10
+ // 4) inside a step: git fetch origin main (RELEASE-CHANGELOG commit analysis)
11
+ // 5) deploy trigger (#1114): deploy workflow files only, main > deployTriggerBranch (DEPLOY_TRIGGER_WORKFLOWS below)
12
+ // 6) branch check in deploy scripts (#1114): [ "$BRANCH" == "main" ] (REACT-CICD allowed-branch check)
13
+ // 7) CI minutes saver (#1114): with ciMinutesSaver, ci-minutes-sub.js (before branch substitution, on the raw template)
14
14
 
15
15
  import { substituteCiMinutesSaver } from "./ci-minutes-sub.js";
16
16
 
17
- // main(기본 브랜치) 계열 치환
17
+ // main (default branch) substitutions
18
18
  function subDefault(s, db) {
19
19
  s = s.replace(/^(\s*branches:\s*\[\s*["']?)main(["']?\s*\])/gm, `$1${db}$2`);
20
20
  s = s.replace(/^(\s*-\s*)main(\s*(?:#.*)?)$/gm, `$1${db}$2`);
@@ -23,7 +23,7 @@ function subDefault(s, db) {
23
23
  return s;
24
24
  }
25
25
 
26
- // develop(개발/릴리스 head 브랜치) 계열 치환
26
+ // develop (development/release head branch) substitutions
27
27
  function subDeploy(s, dev) {
28
28
  s = s.replace(/^(\s*branches:\s*\[\s*["']?)develop(["']?\s*\])/gm, `$1${dev}$2`);
29
29
  s = s.replace(/^(\s*-\s*)develop(\s*(?:#.*)?)$/gm, `$1${dev}$2`);
@@ -31,9 +31,9 @@ function subDeploy(s, dev) {
31
31
  return s;
32
32
  }
33
33
 
34
- // 푸시되면 배포가 도는 워크플로 (파일 이름 정확 일치). 기본 브랜치와 배포 브랜치를 나눈 레포에서만 쓴다.
35
- // 공통 워크플로(버전 올림 · README 버전 · 릴리스 노트 · 이슈 닫기)는 여기 없다: 기본 브랜치를 따른다.
36
- // 배포 워크플로를 추가하면 이 표에도 넣는다 (안 넣으면 그 파일은 기본 브랜치에서 배포가 돈다)
34
+ // Workflows that deploy when pushed (exact file name match). Used only in repos that split the default and deploy branches.
35
+ // Common workflows (version bump · README version · release notes · issue close) are not here: they follow the default branch.
36
+ // Add new deploy workflows to this table too (otherwise that file deploys from the default branch)
37
37
  export const DEPLOY_TRIGGER_WORKFLOWS = new Set([
38
38
  "PROJECT-FLUTTER-ANDROID-FIREBASE-CICD.yaml", "PROJECT-FLUTTER-ANDROID-PLAYSTORE-CICD.yaml",
39
39
  "PROJECT-FLUTTER-ANDROID-SELFHOSTED-CICD.yaml", "PROJECT-FLUTTER-IOS-TESTFLIGHT.yaml",
@@ -42,7 +42,7 @@ export const DEPLOY_TRIGGER_WORKFLOWS = new Set([
42
42
  "PROJECT-SPRING-NEXUS-PUBLISH.yml", "PROJECT-SPRING-GITHUB-PACKAGES-PUBLISH.yml",
43
43
  ]);
44
44
 
45
- // 배포 트리거 브랜치 치환: 트리거 · 체크아웃 ref · pull · 실행 조건의 main
45
+ // Deploy trigger branch substitution: main in triggers · checkout ref · pull · run conditions
46
46
  function subDeployTrigger(s, trigger) {
47
47
  s = s.replace(/^(\s*branches:\s*\[\s*["']?)main(["']?\s*\])/gm, `$1${trigger}$2`);
48
48
  s = s.replace(/^(\s*-\s*)main(\s*(?:#.*)?)$/gm, `$1${trigger}$2`);
@@ -53,10 +53,10 @@ function subDeployTrigger(s, trigger) {
53
53
  return s;
54
54
  }
55
55
 
56
- // content에 브랜치 설정(+ CI 사용 시간 절약)을 적용한 결과를 반환. branches 미지정/표준값이면 원본 그대로.
57
- // 플레이스홀더 2단 치환: 값 충돌 방지 (예: 기본 브랜치=develop인 레포에서 main→develop 치환 결과가
58
- // 곧이어 develop→X 치환에 다시 걸리는 연쇄 오염을 차단).
59
- // filename: 배포 트리거 치환(#1114)이 배포 워크플로 파일에만 걸리게 하는 기준. 없으면 배포 트리거 치환은 건너뛴다.
56
+ // Returns content with the branch settings (+ CI minutes saver) applied. Unchanged when branches is unset or standard.
57
+ // Two-stage placeholder substitution prevents value collisions (e.g. in a repo whose default branch is develop, the main→develop
58
+ // result would otherwise be caught again by the following develop→X substitution).
59
+ // filename: limits the deploy trigger substitution (#1114) to deploy workflow files. Without it, that substitution is skipped.
60
60
  export function substituteBranches(content, branches = null, filename = "") {
61
61
  if (!branches) return content;
62
62
  const db = branches.defaultBranch || "main";
@@ -67,7 +67,7 @@ export function substituteBranches(content, branches = null, filename = "") {
67
67
  const T_DB = "__PJOPS_DEFAULT__";
68
68
  const T_DEV = "__PJOPS_DEPLOY__";
69
69
  const T_TRIGGER = "__PJOPS_TRIGGER__";
70
- // 배포 워크플로의 main 은 기본 브랜치가 아니라 배포 트리거 브랜치로 간다 (먼저 자리표시자로 빼 둠)
70
+ // main in deploy workflows goes to the deploy trigger branch, not the default branch (moved out to a placeholder first)
71
71
  if (trigger && DEPLOY_TRIGGER_WORKFLOWS.has(filename)) s = subDeployTrigger(s, T_TRIGGER);
72
72
  if (dev !== "develop") s = subDeploy(s, T_DEV);
73
73
  if (db !== "main") s = subDefault(s, T_DB);