projectops 4.120.0 → 4.120.2
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/cli/help.js +3 -2
- package/src/core/copy/script-references.js +77 -0
- package/src/core/copy/simple.js +16 -2
- package/src/core/options-schema.js +1 -1
- package/src/core/verify.js +2 -1
package/README.md
CHANGED
|
@@ -163,7 +163,7 @@ Supported types: <!-- generated: project-types:types-list -->`flutter`, `spring`
|
|
|
163
163
|
Everything is on the **[docs site](https://cassiiopeia.github.io/projectops/)**, in English and [Korean](https://cassiiopeia.github.io/projectops/ko/): [Getting started](https://cassiiopeia.github.io/projectops/getting-started) · [CLI](https://cassiiopeia.github.io/projectops/cli) · [Agent Skills](https://cassiiopeia.github.io/projectops/skills) · [Versioning](https://cassiiopeia.github.io/projectops/version-control) · [Changelog](https://cassiiopeia.github.io/projectops/changelog-automation) · [SSH + Docker deploy](https://cassiiopeia.github.io/projectops/ssh-docker-deployment-guide) · [Flutter CI/CD](https://cassiiopeia.github.io/projectops/flutter-cicd-overview) · [Troubleshooting](https://cassiiopeia.github.io/projectops/troubleshooting)
|
|
164
164
|
|
|
165
165
|
<!-- AUTO-VERSION-SECTION: DO NOT EDIT MANUALLY -->
|
|
166
|
-
## Latest version : v4.120.
|
|
166
|
+
## Latest version : v4.120.2 (2026-11-26)
|
|
167
167
|
|
|
168
168
|
[View full version history](CHANGELOG.md)
|
|
169
169
|
|
package/package.json
CHANGED
package/src/cli/help.js
CHANGED
|
@@ -41,7 +41,8 @@ How it decides (read this before scripting)
|
|
|
41
41
|
|
|
42
42
|
Modes (-m, --mode MODE)
|
|
43
43
|
full everything: version.yml, workflows, scripts, issue/PR templates, setup guide (.coderabbit.yaml only with --coderabbit)
|
|
44
|
-
workflows only .github/workflows plus the scripts, config and util they use. version.yml is not
|
|
44
|
+
workflows only .github/workflows plus the scripts, config and util they use. version.yml is not regenerated:
|
|
45
|
+
only its deploy block and branch keys are updated
|
|
45
46
|
version only version.yml, the README version section and the version scripts
|
|
46
47
|
issues only issue and discussion templates
|
|
47
48
|
skills install or update agent skills for supported IDEs
|
|
@@ -126,7 +127,7 @@ AI agent 나 CI 는 항상 이렇게 실행한다: npx projectops --mode <
|
|
|
126
127
|
|
|
127
128
|
모드 (-m, --mode MODE)
|
|
128
129
|
full 전부: version.yml, 워크플로우, 스크립트, 이슈/PR 템플릿, 설정 안내서 (.coderabbit.yaml 은 --coderabbit 일 때만)
|
|
129
|
-
workflows .github/workflows 와 그것이 쓰는 스크립트·config·util 만. version.yml 은
|
|
130
|
+
workflows .github/workflows 와 그것이 쓰는 스크립트·config·util 만. version.yml 은 deploy 블록·브랜치 키만 갱신한다
|
|
130
131
|
version version.yml, README 버전 섹션, 버전 스크립트만
|
|
131
132
|
issues 이슈·디스커션 템플릿만
|
|
132
133
|
skills 지원 IDE 의 agent 스킬 설치·갱신
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
// Scripts the template workflows run, plus the local files those scripts load (#1288).
|
|
2
|
+
// Workflows > referenced script paths > closure over local imports and sibling file names.
|
|
3
|
+
// The copy list in simple.js stays the documented set; this closure is the guard that keeps
|
|
4
|
+
// a script a workflow calls from being left out of user repos when the list falls behind.
|
|
5
|
+
import { join, posix } from "node:path";
|
|
6
|
+
import { readdirSync, readFileSync, statSync } from "node:fs";
|
|
7
|
+
import { PATHS } from "../paths.js";
|
|
8
|
+
import { exists } from "../fsutil.js";
|
|
9
|
+
|
|
10
|
+
// Workflow call forms: `.github/scripts/<path>` and `$SCRIPTS_DIR/<path>` / `${CI_SCRIPTS_DIR...}/<path>` (default-branch copy, #1006)
|
|
11
|
+
const WORKFLOW_SCRIPT_REFERENCE = /(?:\.github\/scripts|SCRIPTS_DIR\}?)\/([A-Za-z0-9_]+(?:\/[A-Za-z0-9_]+)*\.(?:py|sh))/g;
|
|
12
|
+
// Inside a script: `import a, b` / `from a import x` (first module segment only)
|
|
13
|
+
const PYTHON_IMPORT = /^[ \t]*(?:from[ \t]+([A-Za-z_][A-Za-z0-9_]*)[\w.]*[ \t]+import|import[ \t]+([A-Za-z_][A-Za-z0-9_, \t]*))/gm;
|
|
14
|
+
// Inside a script: a sibling file named by string (shell shims, subprocess calls such as the changelog ladder)
|
|
15
|
+
const SIBLING_FILE_NAME = /\b([A-Za-z0-9_]+\.(?:py|sh))\b/g;
|
|
16
|
+
// Folders copied whole elsewhere (simple.js i18n block), so their files are not listed here
|
|
17
|
+
const WHOLE_COPIED_FOLDERS = new Set(["i18n"]);
|
|
18
|
+
|
|
19
|
+
function listWorkflowFiles(directory) {
|
|
20
|
+
if (!exists(directory)) return [];
|
|
21
|
+
const files = [];
|
|
22
|
+
for (const name of readdirSync(directory)) {
|
|
23
|
+
const path = join(directory, name);
|
|
24
|
+
if (statSync(path).isDirectory()) files.push(...listWorkflowFiles(path));
|
|
25
|
+
else if (/\.ya?ml$/.test(name)) files.push(path);
|
|
26
|
+
}
|
|
27
|
+
return files;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function isWholeCopied(relativePath) {
|
|
31
|
+
return WHOLE_COPIED_FOLDERS.has(relativePath.split("/")[0]);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// Relative script path ("a.py", "changelog_providers/b.py") > local files it loads, relative to the scripts folder
|
|
35
|
+
function findLocalDependencies(scriptsRoot, relativePath) {
|
|
36
|
+
const text = readFileSync(join(scriptsRoot, relativePath), "utf8");
|
|
37
|
+
const folder = posix.dirname(relativePath) === "." ? "" : posix.dirname(relativePath);
|
|
38
|
+
const candidates = new Set();
|
|
39
|
+
for (const match of text.matchAll(SIBLING_FILE_NAME)) candidates.add(match[1]);
|
|
40
|
+
if (relativePath.endsWith(".py")) {
|
|
41
|
+
for (const match of text.matchAll(PYTHON_IMPORT)) {
|
|
42
|
+
const modules = match[1] ? [match[1]] : match[2].split(",").map((m) => m.trim().split(/\s+/)[0]);
|
|
43
|
+
for (const module of modules) if (module) candidates.add(`${module}.py`);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
// Resolve next to the script first, then at the scripts root (scripts add both to sys.path)
|
|
47
|
+
const dependencies = [];
|
|
48
|
+
for (const name of candidates) {
|
|
49
|
+
for (const base of [folder, ""]) {
|
|
50
|
+
const candidate = base ? `${base}/${name}` : name;
|
|
51
|
+
if (exists(join(scriptsRoot, candidate))) { dependencies.push(candidate); break; }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return dependencies;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Template workflows (project-types) > every script they need, relative to .github/scripts
|
|
59
|
+
* Missing files are skipped (a workflow may name an optional script)
|
|
60
|
+
*/
|
|
61
|
+
export function collectReferencedScripts(tempDir) {
|
|
62
|
+
const scriptsRoot = join(tempDir, PATHS.scriptsDir);
|
|
63
|
+
const workflowRoot = join(tempDir, ".github", "workflows", "project-types");
|
|
64
|
+
const pending = [];
|
|
65
|
+
for (const file of listWorkflowFiles(workflowRoot)) {
|
|
66
|
+
for (const match of readFileSync(file, "utf8").matchAll(WORKFLOW_SCRIPT_REFERENCE)) pending.push(match[1]);
|
|
67
|
+
}
|
|
68
|
+
const found = new Set();
|
|
69
|
+
while (pending.length) {
|
|
70
|
+
const relativePath = pending.pop();
|
|
71
|
+
if (found.has(relativePath) || isWholeCopied(relativePath)) continue;
|
|
72
|
+
if (!exists(join(scriptsRoot, relativePath))) continue;
|
|
73
|
+
found.add(relativePath);
|
|
74
|
+
pending.push(...findLocalDependencies(scriptsRoot, relativePath));
|
|
75
|
+
}
|
|
76
|
+
return [...found].sort();
|
|
77
|
+
}
|
package/src/core/copy/simple.js
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
import { join, basename } from "node:path";
|
|
3
3
|
import { chmodSync, readdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
4
4
|
import { PATHS } from "../paths.js";
|
|
5
|
-
import { exists, copyFileSync, copyDirSync } from "../fsutil.js";
|
|
5
|
+
import { exists, copyFileSync, copyDirSync, writeText } from "../fsutil.js";
|
|
6
|
+
import { collectReferencedScripts } from "./script-references.js";
|
|
7
|
+
|
|
8
|
+
// .github/scripts/.gitignore: Python bytecode caches made when the scripts run (#1288)
|
|
9
|
+
const SCRIPTS_GITIGNORE = "__pycache__/\n*.pyc\n";
|
|
6
10
|
|
|
7
11
|
// Always overwrite only the version management/release note scripts + chmod +x.
|
|
8
12
|
// version_manager is a .sh (delegating shim) + .py (real logic) pair — both must be copied to work (#448).
|
|
@@ -49,12 +53,19 @@ export function copyScripts(tempDir, targetRoot = ".") {
|
|
|
49
53
|
"store_deploy_config.py",
|
|
50
54
|
// Prepares store release notes per language (#829). Does nothing without store_locales in version.yml.
|
|
51
55
|
"store_notes.py",
|
|
56
|
+
// Restores Firebase config files from secrets in the Flutter build workflows (CI, Android, iOS) (#1288).
|
|
57
|
+
"firebase_config_files.py",
|
|
58
|
+
// Flutter CI toolchain version check (#1288).
|
|
59
|
+
"toolchain_versions.py",
|
|
52
60
|
"changelog_providers/_common.py", "changelog_providers/ladder.py",
|
|
53
61
|
"changelog_providers/commit.py", "changelog_providers/copilot.py",
|
|
54
62
|
"changelog_providers/openai_compatible.py",
|
|
55
63
|
];
|
|
64
|
+
// Guard (#1288): any script a template workflow calls, and the local files it loads, is copied even when
|
|
65
|
+
// the list above misses it. The list stays the documented set; add new scripts to it with a reason.
|
|
66
|
+
const scriptsToCopy = new Set([...scripts, ...collectReferencedScripts(tempDir)]);
|
|
56
67
|
let copied = 0;
|
|
57
|
-
for (const s of
|
|
68
|
+
for (const s of scriptsToCopy) {
|
|
58
69
|
const src = join(tempDir, PATHS.scriptsDir, s);
|
|
59
70
|
if (exists(src)) {
|
|
60
71
|
const dst = join(targetRoot, PATHS.scriptsDir, s);
|
|
@@ -73,6 +84,9 @@ export function copyScripts(tempDir, targetRoot = ".") {
|
|
|
73
84
|
copied++;
|
|
74
85
|
}
|
|
75
86
|
}
|
|
87
|
+
// The scripts folder carries its own ignore rule (same pattern as logs/ and incoming/, root .gitignore untouched):
|
|
88
|
+
// running the scripts writes __pycache__ next to them, which commit steps staging everything would pick up (#1288)
|
|
89
|
+
writeText(join(targetRoot, PATHS.scriptsDir, ".gitignore"), SCRIPTS_GITIGNORE);
|
|
76
90
|
return copied;
|
|
77
91
|
}
|
|
78
92
|
|
|
@@ -325,7 +325,7 @@ export const KEY_DETAILS = {
|
|
|
325
325
|
export const RECIPES = [
|
|
326
326
|
{ goal: "Install everything in a new repo (stack auto-detected)", command: "npx projectops --mode full --force", note: "Add --type spring,react for several stacks." },
|
|
327
327
|
{ 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." },
|
|
328
|
-
{ goal: "Refresh only the workflows, scripts and config", command: "npx projectops --mode workflows --force", note: "version.yml is not
|
|
328
|
+
{ goal: "Refresh only the workflows, scripts and config", command: "npx projectops --mode workflows --force", note: "version.yml is not regenerated; only its deploy block and branch keys are updated." },
|
|
329
329
|
{ goal: "See the state of an install and the repository settings (read-only)", command: "npx projectops --mode doctor", note: "Add GITHUB_TOKEN=... to also check repository settings." },
|
|
330
330
|
{ goal: "Read every option with values, defaults and effects", command: "npx projectops --mode options --json" },
|
|
331
331
|
{ goal: "Install the CodeRabbit PR review config", command: "npx projectops --mode full --force --coderabbit", note: "Needs the CodeRabbit GitHub app; overwrites an existing .coderabbit.yaml (backup saved as .bak)." },
|
package/src/core/verify.js
CHANGED
|
@@ -70,7 +70,8 @@ const AUTO_SECRETS = new Set(["GITHUB_TOKEN"]);
|
|
|
70
70
|
// would make the notice itself untrustworthy, so they are kept separate.
|
|
71
71
|
// MODEL_API_KEY → if registered, external AI summary; otherwise Copilot → commit analysis (#455·#566 ladder)
|
|
72
72
|
// _GITHUB_PAT_TOKEN → if missing, merge with GITHUB_TOKEN and wake follow-up workflows directly (#551)
|
|
73
|
-
|
|
73
|
+
// APPLE_EXTENSION_PROVISIONING_PROFILE_BASE64 → only for iOS apps with an extension target; skipped when empty (#1288)
|
|
74
|
+
export const OPTIONAL_SECRETS = new Set(["MODEL_API_KEY", "_GITHUB_PAT_TOKEN", "APPLE_EXTENSION_PROVISIONING_PROFILE_BASE64"]);
|
|
74
75
|
|
|
75
76
|
const SECRET_RE = /secrets\.([A-Z_][A-Z0-9_]*)/g;
|
|
76
77
|
|