projectops 4.104.5 → 4.104.7

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 +19 -19
  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 +115 -115
  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,15 +1,15 @@
1
- // projectops 옵션 정본 (AI agent·사람·문서가 같은 표를 본다).
1
+ // projectops option source of truth (AI agents, people and docs all read the same table).
2
2
  //
3
- // 왜 필요한가: 옵션 설명이 문서 6곳(NPX-WIZARD, VERSION-CONTROL, ISSUE-AUTOMATION ...)에 흩어져 있어
4
- // agent가 "이 옵션이 있나, 기본값이 뭔가"를 확인하려면 문서를 뒤져야 했다. 이제 한 호출로 읽는다:
3
+ // Why: option descriptions were spread over 6 docs (NPX-WIZARD, VERSION-CONTROL, ISSUE-AUTOMATION ...), so an
4
+ // agent had to dig through docs to learn "does this option exist, what is its default". Now one call answers it:
5
5
  // npx projectops --mode options --json
6
6
  //
7
- // 이 표는 손으로 쓰되, test/options-schema.test.js 가 실제 코드와 대조한다.
8
- // - args.js 의 모든 CLI 플래그가 flags 에 있어야 한다
9
- // - parseTemplateOptions 가 읽는 모든 키가 versionYml 에 있어야 한다
10
- // 새 플래그·옵션을 추가하고 여기에 안 쓰면 테스트가 실패한다.
7
+ // The table is hand-written, but test/options-schema.test.js checks it against the real code.
8
+ // - every CLI flag in args.js must be in flags
9
+ // - every key parseTemplateOptions reads must be in versionYml
10
+ // Adding a flag or option without listing it here fails the test.
11
11
  //
12
- // 설명은 영문이다 — 기계가 읽는 표이고, 화면 언어(i18n)와 무관하게 같아야 한다.
12
+ // Descriptions are English — this is a machine-read table and must not change with the screen language (i18n).
13
13
 
14
14
  import { DEPLOY_TARGETS, PUBLISH_TARGETS, INTENT_VALUES, LABEL_STYLES, CHANGELOG_PROVIDERS } from "./constants.js";
15
15
  import { REPO_LANGUAGES } from "./repo-language.js";
@@ -29,7 +29,7 @@ export const MODES = [
29
29
  { name: "options", description: "Print this option table (add --json for machine-readable output). Read-only, no network." },
30
30
  ];
31
31
 
32
- // 프로젝트 타입은 context.js 의 VALID_TYPES 와 같아야 한다 (테스트가 대조).
32
+ // Project types must match VALID_TYPES in context.js (checked by the test).
33
33
  export const FLAGS = [
34
34
  { flag: "--mode", alias: "-m", value: "MODE", values: MODES.map((m) => m.name), default: "interactive",
35
35
  description: "What to do. Agents and CI should always pass an explicit non-interactive mode together with --force." },
@@ -79,12 +79,12 @@ export const FLAGS = [
79
79
  { flag: "--json", description: "With --mode options: print machine-readable JSON instead of a table.", default: "off" },
80
80
  { flag: "--version", alias: "-v", description: "Print the projectops package version and exit." },
81
81
  { flag: "--help", alias: "-h", description: "Print the human-readable help and exit." },
82
- // 지원 종료 예정 — 새 설정에는 쓰지 않는다
82
+ // Scheduled for removal — do not use in new setups
83
83
  { flag: "--nexus", negation: "--no-nexus", deprecated: "Use --publish nexus. Also implies --deploy none." },
84
84
  { flag: "--npm-publish", negation: "--no-npm-publish", deprecated: "Use --publish npm." },
85
85
  ];
86
86
 
87
- // version.yml 의 키. path 는 파일 안의 위치, parserKey 는 parseTemplateOptions 가 돌려주는 이름.
87
+ // version.yml keys. path is the location in the file; parserKey is the name parseTemplateOptions returns.
88
88
  export const VERSION_YML = [
89
89
  { path: "version", type: "string", description: "Project version (x.y.z). The single source of truth; workflows sync it into build files.", edit: "workflow-managed" },
90
90
  { path: "version_code", type: "integer", description: "App build number. +1 on every release. Android release only; iOS and test builds use build_number.py.", edit: "workflow-managed" },
@@ -136,15 +136,15 @@ export const VERSION_YML = [
136
136
  { path: "metadata.template.options.changelog.base_url", parserKey: "changelogBaseUrl", type: "string", description: "Only for provider ollama.", edit: "by hand" },
137
137
  ];
138
138
 
139
- // ── agent 가 읽고 스스로 판단하게 하는 상세 설명 ───────────────────────────────────────────────
140
- // 짧은 description 만으로는 "언제 쓰나 · 쓰면 레포에서 정확히 무엇이 바뀌나 · 안 쓰면 어떻게 되나"를 알 수 없다.
141
- // 사람 없이 이 CLI 를 부르는 AI agent 가 추측하지 않도록 항목마다 적는다.
142
- // when : 이 값을 직접 정해야 하는 상황 / 그냥 둬도 되는 상황
143
- // effect : 레포에서 실제로 바뀌는 것 (어떤 파일이 생기고 사라지는지, 어떤 워크플로가 도는지)
144
- // omitted : 안 주면 어떻게 정해지는가
145
- // example : 그대로 실행할 수 있는 명령
146
- // caution : 되돌리기 어렵거나 놓치기 쉬운 것
147
- // test/options-schema.test.js 가 모든 (폐기 아닌) 플래그·옵션에 when·effect 가 있는지 검사한다 — 새 항목은 여기에도 적는다.
139
+ // ── Detailed notes so an agent can read and decide on its own ───────────────────────────────────────────────
140
+ // A short description alone does not say "when to use it · what exactly changes in the repo · what happens if omitted".
141
+ // Written per entry so an AI agent calling this CLI without a person does not guess.
142
+ // when : when you must set this value yourself / when leaving it is fine
143
+ // effect : what actually changes in the repo (which files appear or disappear, which workflows run)
144
+ // omitted : how the value is decided when not given
145
+ // example : a command you can run as is
146
+ // caution : what is hard to undo or easy to miss
147
+ // test/options-schema.test.js checks that every (non-deprecated) flag and option has when and effect — add new entries here too.
148
148
  export const FLAG_DETAILS = {
149
149
  "--mode": {
150
150
  when: "Always pass it explicitly from an agent or CI. Without it the CLI opens interactive questions.",
@@ -316,7 +316,7 @@ export const KEY_DETAILS = {
316
316
  "metadata.template.options.changelog.base_url": { when: "Only with provider ollama.", effect: "Base URL of the Ollama server (OpenAI-compatible, ending in /v1).", omitted: "" },
317
317
  };
318
318
 
319
- // 자주 하는 일 → 그대로 실행할 명령. agent 가 옵션을 조합하다 틀리지 않게 한다.
319
+ // Common tasks → commands to run as is. Keeps agents from combining options wrong.
320
320
  export const RECIPES = [
321
321
  { goal: "Install everything in a new repo (stack auto-detected)", command: "npx projectops --mode full --force", note: "Add --type spring,react for several stacks." },
322
322
  { goal: "Update an existing install to the newest templates", command: "npx projectops --mode full --force", note: "Files you modified are kept; read .github/.projectops/incoming/ and the completion summary for what was skipped." },
@@ -331,7 +331,7 @@ export const RECIPES = [
331
331
  { goal: "Install a library publish workflow", command: "npx projectops --mode workflows --force --type node --publish npm", note: "Needs the NPM_TOKEN secret." },
332
332
  ];
333
333
 
334
- // 이 CLI 를 사람 없이 쓰는 agent 가 지킬 규칙
334
+ // Rules for an agent using this CLI without a person
335
335
  export const AGENT_RULES = [
336
336
  "Always pass an explicit --mode and --force. Without --force and without a TTY the command stops; with --mode interactive it needs a human.",
337
337
  "Read before you write: run --mode doctor (state) and --mode options --json (this table). Both are read-only and need no network.",
@@ -375,7 +375,7 @@ export function buildSchema(packageVersion = "") {
375
375
  };
376
376
  }
377
377
 
378
- // 사람이 읽는 표 — JSON 이 아닐 때 출력한다.
378
+ // Human-readable table — printed when not JSON.
379
379
  export function renderText(schema) {
380
380
  const lines = [`projectops ${schema.packageVersion} — options (schema v${schema.schemaVersion})`, "", schema.usage, "", "MODES"];
381
381
  for (const m of schema.modes) lines.push(` ${m.name.padEnd(12)} ${m.description}`);
@@ -1,14 +1,14 @@
1
- // 고아 타입 워크플로우 감지·정리 (#487) — 타입 변경으로 선택에서 빠진 타입의
2
- // 템플릿 워크플로우를 감지해 .bak 무해화한다 (레거시 마이그레이션과 동일 방식).
3
- // 안전 원칙: 템플릿 인벤토리와 "정확한 파일명 일치"만 대상 — prefix 매칭 금지
4
- // (사용자 커스텀 워크플로우 오살 방지). common/은 타입이 아니므로 순회에서 제외.
1
+ // Orphan type workflow detection and cleanup (#487) — detects template workflows of types dropped from the selection
2
+ // by a type change and neutralizes them as .bak (same approach as the legacy migration).
3
+ // Safety rule: only exact file name matches against the template inventory — no prefix matching
4
+ // (avoids hitting user custom workflows). common/ is not a type, so it is skipped in the loop.
5
5
  import { existsSync, renameSync, rmSync, readdirSync } from "node:fs";
6
6
  import { join } from "node:path";
7
7
  import { PATHS } from "./paths.js";
8
8
  import { exists, listYamlFiles } from "./fsutil.js";
9
9
  import { commonOptionalGroups, SERVER_DEPLOY_DIR } from "./workflow-groups.js";
10
10
 
11
- // 템플릿의 project-types/<type>/ 인벤토리 — 직하위 + server-deploy/ + publish/*/ (copy 엔진과 동일 범위)
11
+ // Template inventory of project-types/<type>/ — direct children + server-deploy/ + publish/*/ (same scope as the copy engine)
12
12
  function typeInventory(projectTypesDir, type) {
13
13
  const typeDir = join(projectTypesDir, type);
14
14
  const dirs = [typeDir, join(typeDir, SERVER_DEPLOY_DIR)];
@@ -26,10 +26,10 @@ function typeInventory(projectTypesDir, type) {
26
26
  return files;
27
27
  }
28
28
 
29
- // common/ 아래 "선택했을 때만 복사되는" 폴더들 (#566).
30
- // 켜면 복사 엔진이 넣어주지만, 끄면 이미 있던 파일이 그대로 남아 계속 실행됐다.
31
- // 축을 끈 사용자에게는 그게 곧 "껐는데 왜 도나"가 된다 — 여기서 고아로 잡는다.
32
- // 켜짐/꺼짐은 복사 엔진과 같은 표(workflow-groups.js)에서 읽는다 (#851).
29
+ // Folders under common/ that are "copied only when selected" (#566).
30
+ // Turning one on makes the copy engine add it, but turning it off left the existing files in place, still running.
31
+ // For a user who turned the axis off that means "I turned it off, why does it run" — caught here as orphans.
32
+ // On/off is read from the same table as the copy engine (workflow-groups.js) (#851).
33
33
  function commonOptionalOrphans(commonDir, opts) {
34
34
  const out = [];
35
35
  for (const group of commonOptionalGroups(commonDir, opts)) {
@@ -41,12 +41,12 @@ function commonOptionalOrphans(commonDir, opts) {
41
41
  return out;
42
42
  }
43
43
 
44
- // 선택 안 된 타입·옵션의 템플릿 워크플로우가 대상 레포에 실재하면 고아로 반환.
44
+ // Returns as orphans the template workflows of unselected types/options that exist in the target repo.
45
45
  export function detectOrphanWorkflows({ tempDir, targetRoot = ".", selectedTypes = [], options = null }) {
46
46
  const projectTypesDir = join(tempDir, PATHS.workflowsDir, PATHS.projectTypesDir);
47
47
  if (!exists(projectTypesDir)) return [];
48
48
  const selected = new Set(selectedTypes);
49
- // 선택된 타입이 쓰는 파일명 집합 — 교차 방어 (파일명은 타입 prefix로 유일하지만 안전망)
49
+ // File names used by the selected types — cross-check (names are unique by type prefix, but as a safety net)
50
50
  const keep = new Set();
51
51
  for (const t of selected) for (const f of typeInventory(projectTypesDir, t)) keep.add(f);
52
52
  const workflowsDir = join(targetRoot, PATHS.workflowsDir);
@@ -58,7 +58,7 @@ export function detectOrphanWorkflows({ tempDir, targetRoot = ".", selectedTypes
58
58
  if (existsSync(join(workflowsDir, f))) orphans.push({ filename: f, type: e.name });
59
59
  }
60
60
  }
61
- // common의 조건부 폴더 — options를 준 호출부에서만 검사한다(구 호출부 동작 보존).
61
+ // Conditional folders under common — checked only for callers that pass options (keeps old callers' behavior).
62
62
  if (options) {
63
63
  const commonDir = join(projectTypesDir, "common");
64
64
  for (const o of commonOptionalOrphans(commonDir, options)) {
@@ -69,7 +69,7 @@ export function detectOrphanWorkflows({ tempDir, targetRoot = ".", selectedTypes
69
69
  return orphans.sort((a, b) => a.filename.localeCompare(b.filename));
70
70
  }
71
71
 
72
- // .bak 무해화 실행기 — 부분 실패 허용 (migrations applySafeMigrations와 동일 원칙).
72
+ // .bak neutralizer — tolerates partial failure (same principle as migrations applySafeMigrations).
73
73
  export function applyOrphanCleanup(targetRoot, orphans) {
74
74
  const workflowsDir = join(targetRoot, PATHS.workflowsDir);
75
75
  const results = [];
@@ -77,7 +77,7 @@ export function applyOrphanCleanup(targetRoot, orphans) {
77
77
  try {
78
78
  const src = join(workflowsDir, filename);
79
79
  const bak = `${src}.bak`;
80
- if (existsSync(bak)) rmSync(bak, { force: true }); // Windows rename은 대상 존재 시 실패
80
+ if (existsSync(bak)) rmSync(bak, { force: true }); // Windows rename fails when the target exists
81
81
  renameSync(src, bak);
82
82
  results.push({ filename, action: "bak" });
83
83
  } catch (err) {
@@ -1,22 +1,22 @@
1
- // 타입별 프로젝트 경로 감지·확정. 모노레포에서 각 타입의 버전 파일이
2
- // 어느 폴더에 있는지 5단계 우선순위로 확정한다.
1
+ // Detect and settle per-type project paths. In a monorepo, decides which folder holds
2
+ // each type's version file using a 5-step priority.
3
3
  //
4
- // io 주입 계약(readline-engine 시그니처 그대로):
4
+ // io injection contract (same signatures as readline-engine):
5
5
  // io.select({message, options:[{value,label}]}) → value | CANCEL(symbol)
6
6
  // io.text({message, defaultValue}) → string | CANCEL
7
7
  // io.confirm({message, initialValue}) → bool | CANCEL
8
- // io.log(line) → 안내 출력 (없으면 stderr)
8
+ // io.log(line) → notice output (stderr if missing)
9
9
  import { existsSync, readdirSync } from "node:fs";
10
10
  import { join } from "node:path";
11
11
  import { t as msg } from "../i18n/index.js";
12
12
  import { markerForType as baseMarkerForType, extraMarkers } from "./detect.js";
13
13
  import { normalizePath } from "../cli/args.js";
14
14
 
15
- // 취소(ESC/Ctrl+C)는 CANCEL 심볼 — ui를 import하지 않고 심볼 여부로만 판정 (core→ui 역참조 방지)
15
+ // Cancel (ESC/Ctrl+C) is the CANCEL symbol — judged only by symbol identity, without importing ui (avoids a core→ui back reference)
16
16
  const isCancel = (v) => typeof v === "symbol";
17
17
 
18
- // 타입의 대표 마커 파일명.
19
- // detect.js는 미지 타입에 package.json을 기본 반환 — 여기서는 빈 문자열이 되도록 래핑.
18
+ // Main marker file name of a type.
19
+ // detect.js returns package.json for unknown types by default — wrapped here so it becomes an empty string.
20
20
  const KNOWN_MARKER_TYPES = new Set([
21
21
  "flutter", "react", "node", "react-native", "react-native-expo", "python", "spring",
22
22
  ]);
@@ -24,7 +24,7 @@ export function markerForType(type) {
24
24
  return KNOWN_MARKER_TYPES.has(type) ? baseMarkerForType(type) : "";
25
25
  }
26
26
 
27
- // 디렉토리에 실재하는 마커 파일명 반환 — 보조 마커 포함, 없으면 대표 마커 (표시용).
27
+ // Returns the marker file name that actually exists in the directory — including secondary markers, else the main marker (for display).
28
28
  // (spring build.gradle/.kts/pom.xml, python pyproject/setup.py/requirements.txt)
29
29
  export function existingMarkerInDir(type, dir) {
30
30
  const primary = markerForType(type);
@@ -35,8 +35,8 @@ export function existingMarkerInDir(type, dir) {
35
35
  return primary;
36
36
  }
37
37
 
38
- // maxdepth 3 재귀 파일 탐색 — 매치 파일의 "디렉토리" 상대경로(루트는 ".")를 수집.
39
- // find의 maxdepth는 파일 경로 컴포넌트 수 기준(./a/b/f = depth 3)이므로 동일하게 계산.
38
+ // Recursive file search with maxdepth 3 — collects the relative "directory" path of matching files (root is ".").
39
+ // find's maxdepth counts path components of the file (./a/b/f = depth 3), so compute the same way.
40
40
  function walkFindDirs(root, { prune, match, maxDepth = 3 }) {
41
41
  const hits = [];
42
42
  const walk = (rel, depth) => {
@@ -46,34 +46,34 @@ function walkFindDirs(root, { prune, match, maxDepth = 3 }) {
46
46
  const childDepth = depth + 1;
47
47
  const childRel = rel ? `${rel}/${e.name}` : e.name;
48
48
  if (e.isDirectory()) {
49
- // prune 폴더는 하위 전체 제외
49
+ // Pruned folders exclude everything below them
50
50
  if (prune.has(e.name)) continue;
51
- // 자식 파일이 depth ≤ maxDepth 안에 들어올 때만 하강
51
+ // Descend only when child files stay within depth ≤ maxDepth
52
52
  if (childDepth < maxDepth) walk(childRel, childDepth);
53
- // childDepth === maxDepth-0 인 디렉토리 내부 파일은 depth maxDepth+1 → find가 안 봄
54
- else if (childDepth === maxDepth) { /* 파일만 maxDepth까지 — 디렉토리 하강 불필요 */ }
53
+ // Files inside a directory at childDepth === maxDepth-0 are at depth maxDepth+1 → find does not see them
54
+ else if (childDepth === maxDepth) { /* Files only up to maxDepth — no need to descend */ }
55
55
  } else if (childDepth <= maxDepth && match(e.name)) {
56
56
  hits.push(rel === "" ? "." : rel);
57
57
  }
58
58
  }
59
59
  };
60
60
  walk("", 0);
61
- return [...new Set(hits)].sort(); // 중복 제거 + 정렬
61
+ return [...new Set(hits)].sort(); // Dedupe + sort
62
62
  }
63
63
 
64
- // 타입별 마커 파일 후보 검색.
65
- // 반환: 후보 디렉토리 상대경로 배열 (루트는 ".").
64
+ // Search marker file candidates per type.
65
+ // Returns an array of candidate directory relative paths (root is ".").
66
66
  export function findTypePathCandidates(root, type) {
67
- // ── Spring 멀티모듈: settings.gradle(.kts) 폴더 = 모듈 루트로 축약 ──
68
- // version_manager가 그 폴더 아래 build.gradle 전부를 갱신하므로 하위 모듈을 펼치지 않는다.
69
- // android/ 의 settings.gradle(Flutter/RN)은 spring이 아니므로 prune.
67
+ // ── Spring multi-module: collapse to the settings.gradle(.kts) folder = module root ──
68
+ // version_manager updates every build.gradle under that folder, so submodules are not expanded.
69
+ // settings.gradle under android/ (Flutter/RN) is not spring, so prune it.
70
70
  if (type === "spring") {
71
71
  const mm = walkFindDirs(root, {
72
72
  prune: new Set(["node_modules", ".git", "build", "dist", ".gradle", "android", "ios"]),
73
73
  match: (n) => n === "settings.gradle" || n === "settings.gradle.kts",
74
74
  });
75
75
  if (mm.length) return mm;
76
- // settings.gradle 없음 → 단일 모듈, 아래 build.gradle 폴백
76
+ // No settings.gradle → single module, fall back to build.gradle below
77
77
  }
78
78
 
79
79
  const namesByType = {
@@ -91,7 +91,7 @@ export function findTypePathCandidates(root, type) {
91
91
  "node_modules", ".git", "build", "dist", ".dart_tool", "android", "ios",
92
92
  ".gradle", "venv", ".venv", "__pycache__",
93
93
  ]);
94
- // 우선순위 높은 마커에서 발견되면 그것만 사용
94
+ // If found by a higher-priority marker, use only that
95
95
  let found = [];
96
96
  for (const n of names) {
97
97
  found = walkFindDirs(root, { prune, match: (name) => name === n });
@@ -100,37 +100,37 @@ export function findTypePathCandidates(root, type) {
100
100
 
101
101
  return found.filter((d) => {
102
102
  if (type === "flutter") {
103
- // example/ 제외 + lib/ 동반 확인 — 오탐 방지
103
+ // Exclude example/ + require lib/ alongside — avoids false hits
104
104
  if (d.includes("example")) return false;
105
105
  const libDir = d === "." ? join(root, "lib") : join(root, d, "lib");
106
106
  if (!existsSync(libDir)) return false;
107
107
  }
108
108
  if (type === "spring") {
109
- // Flutter/RN의 android/build.gradle 오탐 제외
109
+ // Exclude false hits on android/build.gradle from Flutter/RN
110
110
  if (d.includes("android")) return false;
111
111
  }
112
112
  return true;
113
113
  });
114
114
  }
115
115
 
116
- // 선택된 모든 타입의 경로를 감지·확인하여 Map<type,path> 확정
117
- // (5단계 우선순위).
118
- // ① paths에 이미 있음(--paths) → 유지
119
- // ② 루트에 마커 존재 → "." 자동
120
- // ③ existingPaths(version.yml 저장값)
121
- // ④ 후보 스캔
122
- // ⑤ 분기 — 비대화형: 기존값→후보1개→루트 폴백 / 대화형: 확인·선택·직접입력
116
+ // Detect and confirm paths for all selected types and settle a Map<type,path>
117
+ // (5-step priority).
118
+ // ① already in paths (--paths) → keep
119
+ // ② marker at the root → "." automatically
120
+ // ③ existingPaths (saved in version.yml)
121
+ // ④ candidate scan
122
+ // ⑤ branch — non-interactive: existing value → single candidate → root fallback / interactive: confirm, select, manual input
123
123
  export async function resolveProjectPaths({
124
124
  root, types = [], paths = new Map(), existingPaths = new Map(),
125
125
  force = false, tty = true, io = {},
126
126
  }) {
127
127
  const say = io.log || ((m) => process.stderr.write(`${m}\n`));
128
- const result = new Map(paths); // --paths 사전값 유지 (호출부 Map은 불변)
129
- const targets = types.filter((t) => t !== "basic"); // basic은 경로 불필요
128
+ const result = new Map(paths); // Keep --paths presets (the caller's Map is not mutated)
129
+ const targets = types.filter((t) => t !== "basic"); // basic needs no path
130
130
  if (targets.length === 0) return result;
131
131
 
132
132
  const total = targets.length;
133
- // ── 도입부 안내 (감지 결과 + 무엇을 할지 설명) ──
133
+ // ── Intro notice (detection result + what will happen) ──
134
134
  say("");
135
135
  if (total > 1) say(msg("paths.multi", { total }));
136
136
  else say(msg("paths.single", { type: targets[0] }));
@@ -144,13 +144,13 @@ export async function resolveProjectPaths({
144
144
  idx += 1;
145
145
  const prog = `[${idx}/${total}]`;
146
146
 
147
- // ① --paths 등으로 이미 지정됨 → 최우선
147
+ // ① already given via --paths etc. → top priority
148
148
  if (result.get(t)) {
149
149
  say(msg("paths.byFlag", { type: t, path: result.get(t) }));
150
150
  continue;
151
151
  }
152
152
 
153
- // ② 루트에 마커 존재 → "." 자동 확정 (보조 마커 포함)
153
+ // ② marker at the root → settle "." automatically (including secondary markers)
154
154
  const rootMarker = existingMarkerInDir(t, root);
155
155
  if (rootMarker && existsSync(join(root, rootMarker))) {
156
156
  result.set(t, ".");
@@ -158,14 +158,14 @@ export async function resolveProjectPaths({
158
158
  continue;
159
159
  }
160
160
 
161
- // ③ 기존 version.yml 저장값 → 기본 제안값
161
+ // ③ saved value in the existing version.yml → default suggestion
162
162
  const existing = existingPaths.get(t) || "";
163
163
 
164
- // ④ 후보 검색
164
+ // ④ candidate search
165
165
  const candidates = findTypePathCandidates(root, t);
166
166
  let chosen = "";
167
167
 
168
- // ── ⑤-a 비대화형 (--force 또는 TTY 없음) ──
168
+ // ── ⑤-a non-interactive (--force or no TTY) ──
169
169
  if (force || !tty) {
170
170
  if (existing) {
171
171
  chosen = existing;
@@ -181,8 +181,8 @@ export async function resolveProjectPaths({
181
181
  continue;
182
182
  }
183
183
 
184
- // ── ⑤-b 대화형: 후보 개수별 분기 + 타입 탈출구 (#487) ──
185
- const EXCLUDE = "이 타입 제외"; // 센티넬 — 한국어 value로 노출 (기존 "직접 입력" 패턴)
184
+ // ── ⑤-b interactive: branch by candidate count + type escape hatch (#487) ──
185
+ const EXCLUDE = "이 타입 제외"; // Sentinel — exposed as a Korean value (same pattern as the existing "직접 입력")
186
186
  let excluded = false;
187
187
  if (candidates.length === 1) {
188
188
  const cand = candidates[0];
@@ -201,11 +201,11 @@ export async function resolveProjectPaths({
201
201
  });
202
202
  if (sel === EXCLUDE) excluded = true;
203
203
  else if (!isCancel(sel) && sel != null && sel !== "직접 입력") chosen = sel;
204
- // ESC/직접 입력 → 아래 직접입력 루프로
204
+ // ESC/manual input → manual input loop below
205
205
  } else if (candidates.length > 1) {
206
206
  say("");
207
207
  say(msg("paths.multiFound", { prog, type: t, count: candidates.length }));
208
- // 후보들 + '직접 입력'/'이 타입 제외' 메뉴 — value 자체를 한국어로 (센티넬 노출 방지)
208
+ // Candidates + 'manual input'/'exclude this type' menu — the value itself is Korean (avoids exposing a sentinel)
209
209
  const options = candidates.map((c) => ({
210
210
  value: c,
211
211
  label: `${c} (${existingMarkerInDir(t, c === "." ? root : join(root, c))})`,
@@ -213,7 +213,7 @@ export async function resolveProjectPaths({
213
213
  options.push({ value: "직접 입력", label: msg("paths.manual") });
214
214
  options.push({ value: EXCLUDE, label: msg("paths.exclude", { type: t }) });
215
215
  const sel = await io.select({ message: msg("paths.selectPrompt", { type: t }), options });
216
- // ESC(취소)도 직접 입력으로 폴백
216
+ // ESC (cancel) also falls back to manual input
217
217
  if (sel === EXCLUDE) excluded = true;
218
218
  else if (!isCancel(sel) && sel != null && sel !== "직접 입력") chosen = sel;
219
219
  } else {
@@ -221,18 +221,18 @@ export async function resolveProjectPaths({
221
221
  say(msg("paths.notFound", { prog, type: t }));
222
222
  }
223
223
 
224
- // ── 직접 입력 루프 (위에서 미확정 시) — 제외 탈출구 포함 (#487) ──
224
+ // ── Manual input loop (when not settled above) — includes the exclude escape hatch (#487) ──
225
225
  while (!chosen && !excluded) {
226
226
  const hintMarker = existingMarkerInDir(t, root);
227
227
  let prompt = msg("paths.inputPrompt", { type: t, marker: hintMarker });
228
228
  if (existing) prompt += msg("paths.inputCurrent", { value: existing });
229
229
  prompt += "): ";
230
230
  let input = await io.text({ message: prompt, defaultValue: "" });
231
- if (isCancel(input) || input == null) input = ""; // ESC → 빈값 (아래 폴백)
231
+ if (isCancel(input) || input == null) input = ""; // ESC → empty (fallback below)
232
232
  input = String(input).trim();
233
- // 빈값 → 기존값 또는 루트 — normalizePath 전에 판정
233
+ // Empty → existing value or root — decided before normalizePath
234
234
  input = input === "" ? (existing || ".") : normalizePath(input);
235
- // 검증: 입력 경로에 마커 존재 확인 (보조 마커 포함)
235
+ // Validate: check the marker exists at the entered path (including secondary markers)
236
236
  const m = existingMarkerInDir(t, input === "." ? root : join(root, input));
237
237
  if (m && existsSync(join(root, input === "." ? "" : input, m))) {
238
238
  chosen = input;
@@ -248,7 +248,7 @@ export async function resolveProjectPaths({
248
248
  });
249
249
  if (act === "force") chosen = input;
250
250
  else if (act === EXCLUDE) excluded = true;
251
- // retry/ESC → 루프 계속
251
+ // retry/ESC → keep looping
252
252
  }
253
253
  }
254
254
 
@@ -261,10 +261,10 @@ export async function resolveProjectPaths({
261
261
  say(` ✅ ${t} → ${chosen}`);
262
262
  }
263
263
 
264
- // ── 요약 + 같은 마커 파일 중복 경고 ──
264
+ // ── Summary + warning for duplicate marker files ──
265
265
  say("");
266
266
  say(msg("paths.summary"));
267
- const fileToTypes = new Map(); // 마커 파일 상대경로 → 그 파일을 쓰는 타입들
267
+ const fileToTypes = new Map(); // Marker file relative path → types using that file
268
268
  for (const [pt, pp] of result) {
269
269
  const m = existingMarkerInDir(pt, pp === "." ? root : join(root, pp));
270
270
  const file = pp === "." ? m : `${pp}/${m}`;
@@ -274,7 +274,7 @@ export async function resolveProjectPaths({
274
274
  }
275
275
  for (const [file, ts] of fileToTypes) {
276
276
  if (ts.length > 1) {
277
- // 멱등 동작이라 막지는 않고 경고만
277
+ // Idempotent, so warn only instead of blocking
278
278
  say(msg("paths.duplicate", { types: ts.join(" "), file }));
279
279
  say(msg("paths.duplicateNote"));
280
280
  }
@@ -283,8 +283,8 @@ export async function resolveProjectPaths({
283
283
  return result;
284
284
  }
285
285
 
286
- // 경로 단계에서 제외된 타입 반영 (#487) — basic이 아니면서 paths에 없는 타입 제거.
287
- // 전부 제외되면 basic 폴백 (타입 0개 상태 금지). 비대화형은 제외가 불가능하므로 no-op.
286
+ // Apply types excluded at the path step (#487) — remove non-basic types missing from paths.
287
+ // If all are excluded, fall back to basic (zero types is not allowed). No-op for non-interactive, which cannot exclude.
288
288
  export function filterExcludedTypes(types, paths) {
289
289
  const kept = types.filter((t) => t === "basic" || paths.has(t));
290
290
  return kept.length ? kept : ["basic"];
package/src/core/paths.js CHANGED
@@ -1,4 +1,4 @@
1
- // 경로 상수
1
+ // Path constants
2
2
  export const PATHS = {
3
3
  tempDir: ".template_download_temp",
4
4
  versionFile: "version.yml",
@@ -7,7 +7,7 @@ export const PATHS = {
7
7
  projectTypesDir: "project-types",
8
8
  };
9
9
 
10
- // 템플릿 레포 주소 정본: 소유자/이름 > 웹·git·raw 주소 (src/ 직접 기재는 no-repo-url-literal 규칙이 막는다)
10
+ // Template repo address source of truth: owner/name > web, git, raw URLs (the no-repo-url-literal rule blocks literals in src/)
11
11
  export const TEMPLATE_REPO_OWNER = "Cassiiopeia";
12
12
  export const TEMPLATE_REPO_SLUG = `${TEMPLATE_REPO_OWNER}/projectops`;
13
13
  export const TEMPLATE_REPO_WEB_URL = `https://github.com/${TEMPLATE_REPO_SLUG}`;
@@ -1,26 +1,26 @@
1
- // 자동 트리거 + 예시 값이 함께 남은 워크플로우 감지 (#662)
2
- // 예시 값(your-project 등)은 미치환 토큰(__X__) 검사에 걸리지 않아, 푸시·라벨마다 실패 런이 쌓여도 doctor 가 통과시켰다.
3
- // ⚠️ YAML 파서 없이 라인 단위로 본다 (의존성 0 — 설치 CLI 는 dependencies 가 비어 있다).
1
+ // Detect workflows that keep both an automatic trigger and sample values (#662)
2
+ // Sample values (your-project, etc.) slip past the unreplaced token (__X__) check, so doctor passed while failed runs piled up on every push or label.
3
+ // ⚠️ Line-based, no YAML parser (zero dependencies — the installer CLI has empty dependencies).
4
4
  import { join } from "node:path";
5
5
  import { existsSync, readFileSync, readdirSync } from "node:fs";
6
6
 
7
- // 사람이 직접 눌러야 도는 트리거 3개 — 나머지는 전부 자동 트리거로 본다
7
+ // The 3 triggers a person must fire by hand — everything else counts as automatic
8
8
  const MANUAL_EVENTS = new Set(["workflow_dispatch", "workflow_call", "repository_dispatch"]);
9
9
 
10
- // 예시 값 판정: your-/your_ 접두 단어, example.com 류 도메인, 미치환 토큰 (heredoc 구분자 __SUH_*__ 제외)
10
+ // Sample value test: your-/your_ prefixed words, example.com-style domains, unreplaced tokens (excluding heredoc delimiters __SUH_*__)
11
11
  const PLACEHOLDER_VALUE_RES = [
12
12
  /(^|[^a-z0-9])your[-_][a-z0-9]/i,
13
13
  /(^|[.@/])example\.(com|org|net)\b/i,
14
14
  /__(?!SUH_)[A-Z][A-Z0-9_]*__/,
15
15
  ];
16
16
 
17
- // 환경변수형 줄만 본다: ` KEY: "값"` (run 스크립트 안 URL·문구 오탐 방지)
17
+ // Only env-style lines: ` KEY: "value"` (avoids false hits on URLs and text inside run scripts)
18
18
  const ENV_LINE_RE = /^\s*([A-Z][A-Z0-9_]*):\s*(?:"([^"]*)"|'([^']*)'|([^\s#][^#]*?))\s*(?:#.*)?$/;
19
19
 
20
20
  const isCommented = (line) => /^\s*#/.test(line);
21
21
 
22
22
  /**
23
- * on: 블록 > 이벤트 이름 목록 (인라인 `on: push`, `on: [a, b]`, 블록 형식 3가지)
23
+ * on: block > event names (inline `on: push`, `on: [a, b]`, and block form — 3 shapes)
24
24
  */
25
25
  export function parseTriggerEvents(text) {
26
26
  const lines = String(text || "").split(/\r?\n/);
@@ -29,7 +29,7 @@ export function parseTriggerEvents(text) {
29
29
  const inline = lines[start].replace(/^[^:]*:\s*/, "").replace(/#.*$/, "").trim();
30
30
  if (inline) return inline.replace(/^\[|\]$/g, "").split(",").map((s) => s.trim()).filter(Boolean);
31
31
 
32
- // 블록: 첫 하위 줄의 들여쓰기 깊이에 있는 키만 이벤트로 센다
32
+ // Block form: only keys at the indent depth of the first child line count as events
33
33
  const events = [];
34
34
  let depth = null;
35
35
  for (const line of lines.slice(start + 1)) {
@@ -45,7 +45,7 @@ export function parseTriggerEvents(text) {
45
45
  }
46
46
 
47
47
  /**
48
- * 워크플로우 본문 > 예시 값이 남은 환경변수 줄 [{ key, value, line }]
48
+ * Workflow body > env lines that still hold sample values [{ key, value, line }]
49
49
  */
50
50
  export function findPlaceholderValues(text) {
51
51
  const found = [];
@@ -62,7 +62,7 @@ export function findPlaceholderValues(text) {
62
62
  }
63
63
 
64
64
  /**
65
- * 설치된 워크플로우 폴더 > 자동 트리거와 예시 값을 함께 가진 파일 [{ file, triggers, values }]
65
+ * Installed workflow folder > files with both an automatic trigger and sample values [{ file, triggers, values }]
66
66
  */
67
67
  export function scanPlaceholderTriggers(workflowsDir) {
68
68
  if (!existsSync(workflowsDir)) return [];
@@ -1,13 +1,13 @@
1
- // 레포 문구 언어(#769): 영문("en")이 정본, 한국어("ko")는 오버레이다.
2
- // 한글 사본을 파일마다 따로 두면 두 벌이 어긋나므로, 한국어판은 .github/i18n/ko/ 한 곳에만 두고
3
- // language: ko 일 때 복사 직후 같은 상대경로로 덮는다.
1
+ // Repo text language (#769): English ("en") is the source, Korean ("ko") is an overlay.
2
+ // Keeping a Korean copy next to every file lets the two drift, so the Korean version lives only in .github/i18n/ko/
3
+ // and, with language: ko, is copied over the same relative paths right after the copy.
4
4
  import { join, relative, dirname } from "node:path";
5
5
  import { existsSync, readdirSync, copyFileSync, mkdirSync, statSync } from "node:fs";
6
6
 
7
7
  export const REPO_LANGUAGES = ["en", "ko"];
8
8
 
9
- // version.yml 에 저장값이 없을 때의 결정. 신규 설치는 영문, 이미 설치된 레포는 한국어 유지.
10
- // (label_style 과 같은 원칙 — 업데이트만으로 사용자 레포의 문구가 바뀌면 안 된다.)
9
+ // Decision when version.yml has no saved value. New installs get English; existing installs keep Korean.
10
+ // (Same principle as label_style — an update alone must not change the text in a user repo.)
11
11
  export function resolveRepoLanguage({ flag, stored, existing }) {
12
12
  if (REPO_LANGUAGES.includes(flag)) return flag;
13
13
  if (REPO_LANGUAGES.includes(stored)) return stored;
@@ -24,11 +24,11 @@ function walk(dir) {
24
24
  return out;
25
25
  }
26
26
 
27
- // 한국어 모드: 오버레이의 모든 파일을 targetRoot/.github/ 아래 같은 상대경로로 복사한다.
28
- // 반환: { changed, failed }. changed 는 복사한 파일의 레포 루트 기준 상대경로(.github/...),
29
- // failed 는 복사하지 못한 { file, error }. en 이거나 오버레이가 없으면 둘 다 빈 배열이다.
30
- // 파일 하나가 실패해도 나머지는 계속 복사한다 — 첫 실패에서 멈추면 영문과 한글이 섞이거나 전부 영문으로 남는다.
31
- // 예외는 던지지 않는다: 영문 템플릿이 남을 뿐 설치를 죽일 이유가 아니다. 대신 호출부가 failed 를 알린다.
27
+ // Korean mode: copy every overlay file to the same relative path under targetRoot/.github/.
28
+ // Returns { changed, failed }. changed holds copied paths relative to the repo root (.github/...),
29
+ // failed holds { file, error } entries that could not be copied. Both are empty for en or when there is no overlay.
30
+ // One failure does not stop the rest — stopping at the first failure would leave English and Korean mixed, or all English.
31
+ // Never throws: the English template simply remains, which is no reason to kill the install. The caller reports failed instead.
32
32
  export function applyRepoLanguage(tempDir, targetRoot, language) {
33
33
  const changed = [];
34
34
  const failed = [];