projectops 4.104.6 → 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.
- package/README.md +1 -1
- package/bin/projectops.js +4 -4
- package/package.json +1 -1
- package/src/cli/args.js +43 -43
- package/src/cli/errors.js +8 -8
- package/src/cli/help.js +4 -4
- package/src/commands/doctor.js +39 -39
- package/src/commands/full.js +29 -29
- package/src/commands/interactive.js +86 -86
- package/src/commands/issues.js +5 -5
- package/src/commands/skills.js +13 -13
- package/src/commands/version.js +8 -8
- package/src/commands/workflows.js +19 -19
- package/src/context.js +24 -24
- package/src/core/agent-guide.js +5 -5
- package/src/core/assets.js +11 -11
- package/src/core/baseline.js +24 -24
- package/src/core/branch-sub.js +23 -23
- package/src/core/breaking-check.js +21 -21
- package/src/core/breaking.js +6 -6
- package/src/core/ci-minutes-sub.js +13 -13
- package/src/core/constants.js +17 -17
- package/src/core/copy/coderabbit.js +10 -10
- package/src/core/copy/gitignore.js +9 -9
- package/src/core/copy/readme.js +7 -7
- package/src/core/copy/simple.js +35 -35
- package/src/core/copy/util.js +9 -9
- package/src/core/copy/workflows.js +99 -99
- package/src/core/detect-fs.js +21 -21
- package/src/core/detect.js +12 -12
- package/src/core/development-branch.js +11 -11
- package/src/core/exclusions.js +12 -12
- package/src/core/fsutil.js +9 -9
- package/src/core/git-branch.js +11 -11
- package/src/core/ide/adapter.js +23 -23
- package/src/core/ide/adapters/claude.js +12 -12
- package/src/core/ide/adapters/codex.js +4 -4
- package/src/core/ide/adapters/copilot.js +12 -12
- package/src/core/ide/adapters/cursor.js +7 -7
- package/src/core/ide/adapters/gemini.js +5 -5
- package/src/core/ide/adapters/pi-common.js +12 -12
- package/src/core/ide/adapters/pi-harness.js +7 -7
- package/src/core/ide/adapters/pi.js +3 -3
- package/src/core/ide/home-skills.js +6 -6
- package/src/core/ide/legacy.js +8 -8
- package/src/core/ide/registry.js +6 -6
- package/src/core/ide/runner.js +15 -15
- package/src/core/ide/skills-copy.js +34 -34
- package/src/core/ide/stable-entry.js +11 -11
- package/src/core/ide/util.js +4 -4
- package/src/core/incoming.js +13 -13
- package/src/core/label-style.js +12 -12
- package/src/core/migration-guide.js +19 -19
- package/src/core/migrations/index.js +16 -16
- package/src/core/migrations/registry.js +39 -39
- package/src/core/migrations/rules/legacy-dirs.js +6 -6
- package/src/core/migrations/rules/obsolete-workflows.js +4 -4
- package/src/core/migrations/rules/root-files.js +3 -3
- package/src/core/migrations/rules/settings-extractors.js +8 -8
- package/src/core/options-ask.js +104 -104
- package/src/core/options-schema.js +23 -23
- package/src/core/orphan-workflows.js +14 -14
- package/src/core/paths-resolve.js +54 -54
- package/src/core/paths.js +2 -2
- package/src/core/placeholder-triggers.js +10 -10
- package/src/core/repo-language.js +10 -10
- package/src/core/resolve-options.js +30 -30
- package/src/core/run-trace.js +54 -54
- package/src/core/store-locales-hint.js +13 -13
- package/src/core/verify.js +27 -27
- package/src/core/version-yml.js +115 -115
- package/src/core/wizard-env.js +42 -42
- package/src/core/wizard-labels.js +31 -31
- package/src/core/workflow-groups.js +14 -14
- package/src/i18n/core.en.js +1 -1
- package/src/i18n/doctor.en.js +1 -1
- package/src/i18n/ide.en.js +1 -1
- package/src/i18n/migrate.en.js +1 -1
- package/src/i18n/options.en.js +1 -1
- package/src/index.js +60 -60
- package/src/ui/ansi.js +5 -5
- package/src/ui/env-plan.js +44 -44
- package/src/ui/prompts.js +21 -21
- package/src/ui/readline-engine.js +38 -38
- package/src/ui/skills-prompts.js +4 -4
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
// / version.yml
|
|
1
|
+
// Settings migrator (#470 extension, #478) — moves custom settings of old workflows into version.yml before neutralizing.
|
|
2
|
+
// Rules: migrate only values that differ from defaults / leave an existing issue_helper section untouched (new form wins, idempotent)
|
|
3
|
+
// / skip if there is no version.yml / never block neutralization on failure (caller uses try-catch).
|
|
4
4
|
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
|
|
7
|
-
//
|
|
7
|
+
// with: defaults of the shipped old MODULE workflow — values equal to these are not user customizations
|
|
8
8
|
const OLD_DEFAULTS = {
|
|
9
9
|
branch_prefix: "",
|
|
10
10
|
max_branch_length: "100",
|
|
@@ -25,7 +25,7 @@ function parseWithValues(content) {
|
|
|
25
25
|
return out;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
// version.yml
|
|
28
|
+
// Insert the issue_helper block into version.yml. Creates the hierarchy (metadata/template/options) if missing.
|
|
29
29
|
function insertIssueHelperBlock(vyText, carried) {
|
|
30
30
|
const lines = Object.entries(carried)
|
|
31
31
|
.map(([k, v]) => ` ${k}: "${v.replace(/"/g, '\\"')}"`);
|
|
@@ -40,19 +40,19 @@ function insertIssueHelperBlock(vyText, carried) {
|
|
|
40
40
|
return `${vyText.replace(/\n*$/, "\n")}metadata:\n template:\n options:\n${block}\n`;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
//
|
|
43
|
+
// Old SUH-ISSUE-HELPER-MODULE with: → options.issue_helper migration. Returns { carried: [keys...] }
|
|
44
44
|
export function extractIssueHelperModule(targetRoot, entry) {
|
|
45
45
|
const wf = join(targetRoot, ".github", "workflows", entry.file);
|
|
46
46
|
const vy = join(targetRoot, "version.yml");
|
|
47
47
|
if (!existsSync(wf) || !existsSync(vy)) return { carried: [] };
|
|
48
48
|
|
|
49
49
|
const vyText = readFileSync(vy, "utf8");
|
|
50
|
-
if (/^\s*issue_helper:/m.test(vyText)) return { carried: [] }; //
|
|
50
|
+
if (/^\s*issue_helper:/m.test(vyText)) return { carried: [] }; // New-form settings win
|
|
51
51
|
|
|
52
52
|
const vals = parseWithValues(readFileSync(wf, "utf8"));
|
|
53
53
|
const carried = {};
|
|
54
54
|
for (const [k, v] of Object.entries(vals)) {
|
|
55
|
-
if (v !== OLD_DEFAULTS[k]) carried[k] = v; //
|
|
55
|
+
if (v !== OLD_DEFAULTS[k]) carried[k] = v; // Only values that differ from defaults
|
|
56
56
|
}
|
|
57
57
|
if (Object.keys(carried).length === 0) return { carried: [] };
|
|
58
58
|
|
package/src/core/options-ask.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Deploy/publish axes (#439) + secret backup opt-in questions.
|
|
2
2
|
//
|
|
3
|
-
// io
|
|
3
|
+
// io injection contract (readline-engine signatures):
|
|
4
4
|
// io.confirm({message, initialValue}) → bool | CANCEL(symbol)
|
|
5
|
-
// io.select({message, options}) → value | CANCEL (deploy
|
|
6
|
-
// io.multiselect({message, options, initialValues}) → value[] | CANCEL (publish
|
|
7
|
-
// io.log(line) →
|
|
5
|
+
// io.select({message, options}) → value | CANCEL (deploy, pick one)
|
|
6
|
+
// io.multiselect({message, options, initialValues}) → value[] | CANCEL (publish, multiple)
|
|
7
|
+
// io.log(line) → notice output (stderr if missing)
|
|
8
8
|
import { existsSync, readFileSync } from "node:fs";
|
|
9
9
|
import { join } from "node:path";
|
|
10
10
|
import { listYamlFiles } from "./fsutil.js";
|
|
@@ -14,16 +14,16 @@ import { parseTemplateOptions, inferIntent } from "./version-yml.js";
|
|
|
14
14
|
import { branchStatus, createBranch, pushBranch } from "./git-branch.js";
|
|
15
15
|
import { DEPLOY_TARGETS, PUBLISH_TARGETS, CHANGELOG_PROVIDERS, DEFAULT_CODE_REVIEW_CODERABBIT } from "./constants.js";
|
|
16
16
|
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
// git
|
|
20
|
-
//
|
|
21
|
-
// true =
|
|
22
|
-
// false =
|
|
23
|
-
// null =
|
|
24
|
-
//
|
|
17
|
+
// Check the development (release) branch exists + offer to create it (#477) — interactive only.
|
|
18
|
+
// If missing locally and missing (or unknown) on the remote, offer to create it from the default branch, then ask whether to push.
|
|
19
|
+
// No git, not a repo, or cannot ask (no io.confirm) → pass quietly — never block the wizard.
|
|
20
|
+
// Returns ready (#490 — lets the finish summary decide whether to drop the "create the branch" reminder):
|
|
21
|
+
// true = the branch already existed or was created in this run → no creation notice in the summary
|
|
22
|
+
// false = missing and the user declined or creation failed → keep the notice
|
|
23
|
+
// null = could not check at all (not a repo, cannot ask) → keep the notice (conservative)
|
|
24
|
+
// Returns state (#715 — for recording non-interactive results): not-checked · not-a-repo · exists-local · exists-remote ·
|
|
25
25
|
// declined · create-failed · push-declined · pushed · push-failed
|
|
26
|
-
// isNonInteractive:
|
|
26
|
+
// isNonInteractive: blocks credential prompts in remote lookup and push (#988 — interactive unchanged)
|
|
27
27
|
export async function ensureDeployBranch({ targetRoot = ".", deployBranch = "", defaultBranch = "", io = {}, say = () => {}, isNonInteractive = false }) {
|
|
28
28
|
if (!deployBranch || typeof io.confirm !== "function") return { created: false, pushed: false, ready: null, state: "not-checked" };
|
|
29
29
|
const st = branchStatus(targetRoot, deployBranch, { isNonInteractive });
|
|
@@ -44,7 +44,7 @@ export async function ensureDeployBranch({ targetRoot = ".", deployBranch = "",
|
|
|
44
44
|
return { created: false, pushed: false, ready: false, state: "create-failed" };
|
|
45
45
|
}
|
|
46
46
|
say(msg("options.branch.created", { branch: deployBranch }));
|
|
47
|
-
// #481 —
|
|
47
|
+
// #481 — name the branch in the push question (avoids "which branch is being pushed" confusion)
|
|
48
48
|
const up = await io.confirm({ message: msg("options.branch.pushPrompt", { branch: deployBranch }), initialValue: true });
|
|
49
49
|
if (up !== true) return { created: true, pushed: false, ready: true, state: "push-declined" };
|
|
50
50
|
if (pushBranch(targetRoot, deployBranch, { isNonInteractive })) {
|
|
@@ -55,17 +55,17 @@ export async function ensureDeployBranch({ targetRoot = ".", deployBranch = "",
|
|
|
55
55
|
return { created: true, pushed: false, ready: true, state: "push-failed" };
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
//
|
|
58
|
+
// Re-export — the parser itself lives in version-yml.js (avoids circular import: only options-ask → version-yml is allowed)
|
|
59
59
|
export { parseTemplateOptions };
|
|
60
60
|
|
|
61
|
-
//
|
|
61
|
+
// core/constants.js owns the value lists. Re-exported so existing import paths keep working.
|
|
62
62
|
export { DEPLOY_TARGETS, PUBLISH_TARGETS, CHANGELOG_PROVIDERS };
|
|
63
63
|
|
|
64
|
-
// #498 —
|
|
65
|
-
//
|
|
66
|
-
// (Play Store/TestFlight/Firebase
|
|
67
|
-
//
|
|
68
|
-
//
|
|
64
|
+
// #498 — deploy/publish targets applicable per type.
|
|
65
|
+
// Empty array = the axis does not apply to that type. Mobile apps (flutter/react-native/expo) always include store deploy
|
|
66
|
+
// (Play Store/TestFlight/Firebase, etc.) workflows in the type itself, so the server deploy axis does not
|
|
67
|
+
// apply and there is no registry publish either. If only types with both axes empty are selected, the questions are skipped.
|
|
68
|
+
// Server types keep all current choices (behavior unchanged — per-type refinement is follow-up work).
|
|
69
69
|
export const TYPE_DEPLOY_TARGETS = {
|
|
70
70
|
spring: ["docker-ssh", "vercel"],
|
|
71
71
|
react: ["docker-ssh", "vercel"],
|
|
@@ -87,8 +87,8 @@ export const TYPE_PUBLISH_TARGETS = {
|
|
|
87
87
|
basic: [],
|
|
88
88
|
};
|
|
89
89
|
|
|
90
|
-
//
|
|
91
|
-
//
|
|
90
|
+
// Applicable targets = union over the selected types (#498). 'none' is always allowed, so it is left out of the list.
|
|
91
|
+
// Undeclared types allow everything conservatively (question kept) — when adding a new type, add its declaration above too.
|
|
92
92
|
export function applicableTargets(types = []) {
|
|
93
93
|
const deployAll = DEPLOY_TARGETS.filter((t) => t !== "none");
|
|
94
94
|
return {
|
|
@@ -96,14 +96,14 @@ export function applicableTargets(types = []) {
|
|
|
96
96
|
publish: PUBLISH_TARGETS.filter((t) => types.some((ty) => (TYPE_PUBLISH_TARGETS[ty] ?? PUBLISH_TARGETS).includes(t))),
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
// changelog
|
|
100
|
-
//
|
|
101
|
-
//
|
|
102
|
-
// MODEL_API_KEY
|
|
103
|
-
// github-ai
|
|
99
|
+
// changelog generator provider (#455, reworked in #566).
|
|
100
|
+
// Default is commit — no external dependency, so it works in any environment. To use AI,
|
|
101
|
+
// register a per-service key (GEMINI_API_KEY, etc.) and the ladder picks it up (the wizard does not ask).
|
|
102
|
+
// MODEL_API_KEY is the old name and is read only for backward compatibility.
|
|
103
|
+
// github-ai was dropped because GitHub Models shut down (2026-07-30).
|
|
104
104
|
|
|
105
|
-
//
|
|
106
|
-
//
|
|
105
|
+
// Move saved values that no longer work to working ones (#566).
|
|
106
|
+
// The only way an existing repo escapes a dead setting just by running an update.
|
|
107
107
|
const RETIRED_PROVIDERS = { "github-ai": "commit" };
|
|
108
108
|
export function migrateProvider(saved) {
|
|
109
109
|
if (saved == null) return null;
|
|
@@ -112,18 +112,18 @@ export function migrateProvider(saved) {
|
|
|
112
112
|
|
|
113
113
|
const isCancel = (v) => typeof v === "symbol";
|
|
114
114
|
|
|
115
|
-
//
|
|
116
|
-
//
|
|
115
|
+
// One folder-based opt-in question, such as secret backup.
|
|
116
|
+
// Returns true/false/null (no folder or 0 files skips the question → keep the current value).
|
|
117
117
|
async function askOptionalWorkflow({ dir, icon, short, desc, current, force, tty, io, forceAsk, say }) {
|
|
118
|
-
//
|
|
118
|
+
// Skip quietly when the folder is missing or has 0 yaml files — the question does not apply
|
|
119
119
|
if (!existsSync(dir)) return current;
|
|
120
120
|
const files = listYamlFiles(dir);
|
|
121
121
|
if (files.length === 0) return current;
|
|
122
122
|
|
|
123
|
-
//
|
|
123
|
+
// Keep an already-set value unless force-ask (CLI/version.yml first)
|
|
124
124
|
if (!forceAsk && (current === true || current === false)) return current;
|
|
125
125
|
|
|
126
|
-
//
|
|
126
|
+
// Non-interactive (--force or no TTY) excludes by default
|
|
127
127
|
if (force || !tty) return false;
|
|
128
128
|
|
|
129
129
|
say("");
|
|
@@ -142,26 +142,26 @@ async function askOptionalWorkflow({ dir, icon, short, desc, current, force, tty
|
|
|
142
142
|
return include;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
//
|
|
146
|
-
// intent(#485)
|
|
145
|
+
// Axis keys of the option questions (#483 edit scope unit) — the edit menu re-asks one axis at a time.
|
|
146
|
+
// intent (#485) is the project nature — re-asking it re-derives the deploy/publish axes.
|
|
147
147
|
export const OPTION_AXES = ["intent", "deploy", "publish", "code-review", "changelog", "release-branch", "secret"];
|
|
148
148
|
|
|
149
|
-
// intent →
|
|
149
|
+
// intent → which deploy axes to ask (#485). manual asks both (old sequential questions); the rest are derived.
|
|
150
150
|
const INTENT_ASKS_DEPLOY = { app: true, both: true, manual: true, library: false, none: false };
|
|
151
151
|
const INTENT_ASKS_PUBLISH = { library: true, both: true, manual: true, app: false, none: false };
|
|
152
152
|
|
|
153
|
-
//
|
|
154
|
-
// tempDir:
|
|
155
|
-
// current: { deploy: string|null, publish: string[]|null, secretBackup: bool|null } — CLI
|
|
156
|
-
// scope: null
|
|
157
|
-
//
|
|
158
|
-
//
|
|
153
|
+
// Ask the deploy/publish axes + secret backup in order.
|
|
154
|
+
// tempDir: template download root — project-types is at {tempDir}/.github/workflows/project-types
|
|
155
|
+
// current: { deploy: string|null, publish: string[]|null, secretBackup: bool|null } — explicit CLI values
|
|
156
|
+
// scope: null means all axes (initial integration, re-ask all). A Set/array limits forceAsk to those axes (#483 edit menu isolation).
|
|
157
|
+
// Axes outside the scope keep current/saved values even with forceAsk and are not asked again.
|
|
158
|
+
// Returns { deploy, publish, secretBackup, codeReviewCoderabbit, aiPrSummary, changelogProvider, changelogBaseUrl, deployBranch }
|
|
159
159
|
export async function askAllOptionalWorkflows({
|
|
160
160
|
tempDir, types = [], current = {}, targetRoot = ".",
|
|
161
161
|
force = false, tty = true, io = {}, forceAsk = false, defaultBranch = "", scope = null,
|
|
162
162
|
}) {
|
|
163
163
|
const say = io.log || ((m) => process.stderr.write(`${m}\n`));
|
|
164
|
-
//
|
|
164
|
+
// Per-axis re-ask: forced only with global forceAsk and when scope is absent or includes that axis.
|
|
165
165
|
const scopeSet = scope == null ? null : new Set(scope);
|
|
166
166
|
const ask = (axis) => forceAsk && (scopeSet === null || scopeSet.has(axis));
|
|
167
167
|
let deploy = current.deploy ?? null;
|
|
@@ -171,20 +171,20 @@ export async function askAllOptionalWorkflows({
|
|
|
171
171
|
let aiPrSummary = current.aiPrSummary ?? null;
|
|
172
172
|
let changelogProvider = current.changelogProvider ?? null;
|
|
173
173
|
let changelogBaseUrl = current.changelogBaseUrl ?? null;
|
|
174
|
-
let deployBranch = current.deployBranch ?? null; // #456
|
|
175
|
-
let deployBranchReady = null; // #490 —
|
|
176
|
-
let deployBranchCreated = null; // #493 —
|
|
177
|
-
let intent = current.intent ?? null; // #485
|
|
174
|
+
let deployBranch = current.deployBranch ?? null; // #456 release PR head branch
|
|
175
|
+
let deployBranchReady = null; // #490 — whether the branch was confirmed/created in this run (null = not checked)
|
|
176
|
+
let deployBranchCreated = null; // #493 — whether the wizard created it in this run (for the guide record)
|
|
177
|
+
let intent = current.intent ?? null; // #485 project nature (app/library/both/none/manual)
|
|
178
178
|
|
|
179
|
-
//
|
|
180
|
-
//
|
|
181
|
-
// (
|
|
182
|
-
//
|
|
179
|
+
// Type combinations with both axes empty (#498 — basic alone, or a mobile app like flutter alone) have neither server deploy
|
|
180
|
+
// nor library publish. Skip every question and settle quietly on none·[]
|
|
181
|
+
// (mobile store deploy is always included by the type workflows, so no notice is needed — re-asked when the type changes).
|
|
182
|
+
// A generalization of the old isBasicOnly special case.
|
|
183
183
|
const applicable = applicableTargets(types);
|
|
184
184
|
const noAxes = types.length > 0 && applicable.deploy.length === 0 && applicable.publish.length === 0;
|
|
185
185
|
|
|
186
|
-
// ① --force-ask
|
|
187
|
-
// CLI
|
|
186
|
+
// ① Unless --force-ask, read saved version.yml values first to skip re-asking.
|
|
187
|
+
// Explicit CLI values (current) win — saved values only fill the gaps.
|
|
188
188
|
if (!forceAsk) {
|
|
189
189
|
const vy = join(targetRoot, PATHS.versionFile);
|
|
190
190
|
if (existsSync(vy)) {
|
|
@@ -201,43 +201,43 @@ export async function askAllOptionalWorkflows({
|
|
|
201
201
|
secretBackup = saved.secretBackup;
|
|
202
202
|
say(msg("options.saved.secret", { value: secretBackup }));
|
|
203
203
|
}
|
|
204
|
-
// #455 changelog/code_review
|
|
204
|
+
// #455 reuse saved changelog/code_review values
|
|
205
205
|
if (codeReviewCoderabbit === null && saved.codeReviewCoderabbit !== null) codeReviewCoderabbit = saved.codeReviewCoderabbit;
|
|
206
206
|
if (aiPrSummary === null && saved.aiPrSummary != null) aiPrSummary = saved.aiPrSummary;
|
|
207
207
|
if (changelogProvider === null && saved.changelogProvider !== null) changelogProvider = saved.changelogProvider;
|
|
208
208
|
if (changelogBaseUrl === null && saved.changelogBaseUrl !== null) changelogBaseUrl = saved.changelogBaseUrl;
|
|
209
|
-
// #456
|
|
209
|
+
// #456 reuse the saved development branch
|
|
210
210
|
if (deployBranch === null && saved.deployBranch != null) deployBranch = saved.deployBranch;
|
|
211
|
-
// #485
|
|
211
|
+
// #485 reuse the saved intent — if missing, infer it from saved deploy/publish (compat with old version.yml)
|
|
212
212
|
if (intent === null) intent = saved.intent ?? inferIntent(saved.deploy, saved.publish);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
|
|
216
|
-
//
|
|
217
|
-
//
|
|
216
|
+
// Quietly clean up non-applicable targets (#498) — meaningless values saved by old versions (e.g. flutter alone + docker-ssh)
|
|
217
|
+
// produce the same copy result anyway, so they are reduced to none/the intersection without warning (SSOT — no meaningless leftovers).
|
|
218
218
|
if (deploy !== null && deploy !== "none" && !applicable.deploy.includes(deploy)) deploy = "none";
|
|
219
219
|
if (Array.isArray(publish)) publish = publish.filter((t) => applicable.publish.includes(t));
|
|
220
220
|
|
|
221
|
-
// ── ② intent(
|
|
222
|
-
//
|
|
221
|
+
// ── ② intent (project nature) first → derive the deploy axes (#485) ──
|
|
222
|
+
// For type combinations with both axes empty, intent does not apply: skip the question and settle on none/[] (#498).
|
|
223
223
|
if (noAxes) {
|
|
224
224
|
if (deploy === null) deploy = "none";
|
|
225
225
|
if (publish === null) publish = [];
|
|
226
226
|
intent = "none";
|
|
227
227
|
} else {
|
|
228
|
-
//
|
|
229
|
-
// intent
|
|
228
|
+
// When the edit menu targets only the deploy/publish axis (that axis in scope, no intent),
|
|
229
|
+
// skip the intent question and gating and edit that axis directly (#483 isolation). intent keeps its value or is inferred.
|
|
230
230
|
const scopedAxisOnly = scopeSet !== null && !scopeSet.has("intent");
|
|
231
231
|
if (scopedAxisOnly) {
|
|
232
232
|
if (intent === null) intent = inferIntent(deploy, publish) ?? "manual";
|
|
233
233
|
} else {
|
|
234
|
-
// intent
|
|
234
|
+
// intent question: when unsettled (initial integration) or the intent axis is force re-asked (edit menu "project nature").
|
|
235
235
|
const askIntent = ask("intent") || intent === null;
|
|
236
236
|
if (askIntent) {
|
|
237
237
|
if (force || !tty || typeof io.select !== "function") {
|
|
238
|
-
//
|
|
239
|
-
//
|
|
240
|
-
// null
|
|
238
|
+
// Non-interactive: if the CLI gave no intent, infer from deploy/publish; failing that, manual (old behavior)
|
|
239
|
+
// If the axes are not set yet, infer from the same default axes as non-interactive (resolve-options.js) (#851).
|
|
240
|
+
// Inferring from null would record "manual", splitting the results of the two paths for the same repo.
|
|
241
241
|
const defaultDeploy = applicable.deploy.includes("docker-ssh") ? "docker-ssh" : "none";
|
|
242
242
|
intent = intent ?? inferIntent(deploy ?? defaultDeploy, publish ?? []) ?? "manual";
|
|
243
243
|
} else {
|
|
@@ -256,30 +256,30 @@ export async function askAllOptionalWorkflows({
|
|
|
256
256
|
intent = (!isCancel(ans) && INTENT_ASKS_DEPLOY[ans] !== undefined) ? ans : (intent ?? "manual");
|
|
257
257
|
say(msg("options.intent.chosen", { value: intent }));
|
|
258
258
|
}
|
|
259
|
-
// intent
|
|
259
|
+
// After intent is settled: axes not asked get their values settled; asked axes go back to be re-asked.
|
|
260
260
|
if (!INTENT_ASKS_DEPLOY[intent]) deploy = "none";
|
|
261
261
|
if (!INTENT_ASKS_PUBLISH[intent]) publish = [];
|
|
262
262
|
if (INTENT_ASKS_DEPLOY[intent] && ask("intent")) deploy = null;
|
|
263
263
|
if (INTENT_ASKS_PUBLISH[intent] && ask("intent")) publish = null;
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
|
-
// intent
|
|
267
|
-
// scopedAxisOnly(
|
|
266
|
+
// Once intent is set, decide per axis whether to ask, by the derivation rules (#485).
|
|
267
|
+
// With scopedAxisOnly (single axis from the edit menu), ignore the intent gate and edit that axis.
|
|
268
268
|
const deployGate = scopedAxisOnly ? true : INTENT_ASKS_DEPLOY[intent];
|
|
269
269
|
const publishGate = scopedAxisOnly ? true : INTENT_ASKS_PUBLISH[intent];
|
|
270
270
|
const willAskDeploy = deployGate && (ask("deploy") || deploy === null);
|
|
271
271
|
const willAskPublish = publishGate && (ask("publish") || publish === null);
|
|
272
|
-
//
|
|
272
|
+
// Axes not asked by derivation get their defaults.
|
|
273
273
|
if (!deployGate && deploy === null) deploy = "none";
|
|
274
274
|
if (!publishGate && publish === null) publish = [];
|
|
275
|
-
// manual(
|
|
275
|
+
// When manual (pick yourself) asks both, explain once that the two axes are separate (carried over from #480).
|
|
276
276
|
if (intent === "manual" && willAskDeploy && willAskPublish && tty && typeof io.select === "function") {
|
|
277
277
|
say("");
|
|
278
278
|
say(msg("options.axes.intro"));
|
|
279
279
|
say(msg("options.axes.one"));
|
|
280
280
|
say(msg("options.axes.two"));
|
|
281
281
|
}
|
|
282
|
-
//
|
|
282
|
+
// Non-interactive/fallback default (#498) — docker-ssh only when applicable, else none.
|
|
283
283
|
const deployDefault = applicable.deploy.includes("docker-ssh") ? "docker-ssh" : "none";
|
|
284
284
|
if (willAskDeploy) {
|
|
285
285
|
if (force || !tty || typeof io.select !== "function") {
|
|
@@ -288,7 +288,7 @@ export async function askAllOptionalWorkflows({
|
|
|
288
288
|
say("");
|
|
289
289
|
say(msg("options.deploy.intro"));
|
|
290
290
|
say(msg("options.deploy.hint"));
|
|
291
|
-
//
|
|
291
|
+
// Filter choices to applicable targets (#498) — 'none' is always shown.
|
|
292
292
|
const deployLabels = [
|
|
293
293
|
{ value: "docker-ssh", label: msg("options.deploy.dockerSsh") },
|
|
294
294
|
{ value: "vercel", label: "Vercel" },
|
|
@@ -305,7 +305,7 @@ export async function askAllOptionalWorkflows({
|
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
|
|
308
|
-
// ── ③ publish
|
|
308
|
+
// ── ③ publish targets (multi-select) ──
|
|
309
309
|
if (willAskPublish) {
|
|
310
310
|
if (force || !tty || typeof io.multiselect !== "function") {
|
|
311
311
|
publish = publish ?? [];
|
|
@@ -313,7 +313,7 @@ export async function askAllOptionalWorkflows({
|
|
|
313
313
|
say("");
|
|
314
314
|
say(msg("options.publish.intro"));
|
|
315
315
|
say(msg("options.publish.hint"));
|
|
316
|
-
//
|
|
316
|
+
// Filter choices to applicable targets (#498)
|
|
317
317
|
const publishLabels = [
|
|
318
318
|
{ value: "nexus", label: msg("options.publish.nexus") },
|
|
319
319
|
{ value: "npm", label: msg("options.publish.npm") },
|
|
@@ -333,13 +333,13 @@ export async function askAllOptionalWorkflows({
|
|
|
333
333
|
}
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
// ── pr_comment:
|
|
337
|
-
// CodeRabbit
|
|
338
|
-
// (
|
|
336
|
+
// ── pr_comment: review and summary posted on PRs (merged in #566) ──
|
|
337
|
+
// CodeRabbit and the AI change summary compete for the same spot (PR comments), so they are chosen together
|
|
338
|
+
// (asking separately leaves repos with neither).
|
|
339
339
|
if (ask("code-review") || codeReviewCoderabbit === null || aiPrSummary === null) {
|
|
340
340
|
if (force || !tty || typeof io.select !== "function") {
|
|
341
|
-
//
|
|
342
|
-
//
|
|
341
|
+
// Non-interactive default: CodeRabbit works only with a separate app install, so
|
|
342
|
+
// turning it on in automation is pointless. Only the summary, which works with no setup, is on.
|
|
343
343
|
codeReviewCoderabbit = codeReviewCoderabbit ?? DEFAULT_CODE_REVIEW_CODERABBIT;
|
|
344
344
|
aiPrSummary = aiPrSummary ?? true;
|
|
345
345
|
} else {
|
|
@@ -357,13 +357,13 @@ export async function askAllOptionalWorkflows({
|
|
|
357
357
|
{ value: "none", label: msg("options.pr.none") },
|
|
358
358
|
],
|
|
359
359
|
});
|
|
360
|
-
//
|
|
360
|
+
// Cancel or no answer → the recommended value — the same defensive pattern as the other axes.
|
|
361
361
|
const PR_COMMENT_CHOICES = ["summary", "coderabbit", "both", "none"];
|
|
362
362
|
const pick = (!isCancel(ans) && PR_COMMENT_CHOICES.includes(ans)) ? ans : "summary";
|
|
363
363
|
codeReviewCoderabbit = pick === "coderabbit" || pick === "both";
|
|
364
364
|
aiPrSummary = pick === "summary" || pick === "both";
|
|
365
365
|
say(msg("options.pr.chosen", { value: msg(`options.pr.label.${pick}`) }));
|
|
366
|
-
// #481 — "
|
|
366
|
+
// #481 — "use" alone is not enough. Reviews appear only with the app installed and repo access granted.
|
|
367
367
|
if (codeReviewCoderabbit) {
|
|
368
368
|
say(msg("options.pr.crWarn"));
|
|
369
369
|
say(msg("options.pr.crStep1"));
|
|
@@ -373,14 +373,14 @@ export async function askAllOptionalWorkflows({
|
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
375
|
|
|
376
|
-
// ── changelog:
|
|
377
|
-
//
|
|
378
|
-
//
|
|
379
|
-
//
|
|
380
|
-
//
|
|
376
|
+
// ── changelog: the generator is not asked (#566) ──
|
|
377
|
+
// The user wants "good release notes", not a provider choice. Nobody knew what to pick,
|
|
378
|
+
// and even the default (github-ai) was dead. Now the workflow finds the best option
|
|
379
|
+
// itself — respect the PR body → Copilot → external AI (if a key exists) → commit analysis.
|
|
380
|
+
// Saved values stay; only dead values are moved to working ones.
|
|
381
381
|
changelogProvider = migrateProvider(changelogProvider) ?? "commit";
|
|
382
382
|
|
|
383
|
-
//
|
|
383
|
+
// Ask base_url only when ollama is chosen (other providers get a preset base_url — #455)
|
|
384
384
|
if (changelogProvider === "ollama" && (ask("changelog") || changelogBaseUrl === null || changelogBaseUrl === "")) {
|
|
385
385
|
if (force || !tty || typeof io.text !== "function") {
|
|
386
386
|
changelogBaseUrl = changelogBaseUrl ?? "";
|
|
@@ -393,15 +393,15 @@ export async function askAllOptionalWorkflows({
|
|
|
393
393
|
changelogBaseUrl = "";
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
-
// ──
|
|
397
|
-
//
|
|
398
|
-
// "
|
|
396
|
+
// ── Release source (development) branch (#456, version.yml development_branch — #915) ──
|
|
397
|
+
// This is the head of the release PR (development → default), the branch that collects work and goes up to the default branch.
|
|
398
|
+
// Not a "deploy branch" — deploys run on the default branch side. See #482.
|
|
399
399
|
if (ask("release-branch") || deployBranch === null) {
|
|
400
400
|
if (force || !tty || typeof io.text !== "function") {
|
|
401
|
-
//
|
|
401
|
+
// Do not make up a value when we could not ask (#851) — if empty, nothing is recorded and skills fall back to develop.
|
|
402
402
|
deployBranch = deployBranch ?? "";
|
|
403
403
|
} else {
|
|
404
|
-
const base = defaultBranch || "main"; //
|
|
404
|
+
const base = defaultBranch || "main"; // Default branch detected via git (#481 dynamic notice)
|
|
405
405
|
say("");
|
|
406
406
|
say(msg("options.devBranch.intro"));
|
|
407
407
|
say(msg("options.devBranch.detected", { base }));
|
|
@@ -409,15 +409,15 @@ export async function askAllOptionalWorkflows({
|
|
|
409
409
|
const ans = await io.text({ message: msg("options.devBranch.prompt"), initialValue: deployBranch ?? "develop" });
|
|
410
410
|
deployBranch = (typeof ans === "string" && !isCancel(ans) && ans.trim()) ? ans.trim() : (deployBranch ?? "develop");
|
|
411
411
|
say(msg("options.devBranch.chosen", { value: deployBranch }));
|
|
412
|
-
//
|
|
413
|
-
// #490 —
|
|
412
|
+
// Check the branch exists + offer to create it (#477) — otherwise the release pipeline sits idle silently
|
|
413
|
+
// #490 — pass the result (ready) to the finish summary so an already created/confirmed branch is not re-requested
|
|
414
414
|
const br = await ensureDeployBranch({ targetRoot, deployBranch, defaultBranch, io, say });
|
|
415
415
|
deployBranchReady = br.ready;
|
|
416
416
|
deployBranchCreated = br.created;
|
|
417
417
|
}
|
|
418
418
|
}
|
|
419
419
|
|
|
420
|
-
// ── ④ Secret
|
|
420
|
+
// ── ④ Secret backup: common folder (not a deploy axis — keeps the existing folder question) ──
|
|
421
421
|
const real = join(tempDir, PATHS.workflowsDir, PATHS.projectTypesDir);
|
|
422
422
|
const ptDir = existsSync(real) ? real : join(tempDir, PATHS.projectTypesDir);
|
|
423
423
|
secretBackup = await askOptionalWorkflow({
|
|
@@ -426,21 +426,21 @@ export async function askAllOptionalWorkflows({
|
|
|
426
426
|
current: secretBackup, force, tty, io, forceAsk: ask("secret"), say,
|
|
427
427
|
});
|
|
428
428
|
|
|
429
|
-
//
|
|
429
|
+
// The final fallback also uses applicable targets (#498) — so docker-ssh does not leak into mobile/basic combinations.
|
|
430
430
|
const finalDeploy = deploy ?? (applicable.deploy.includes("docker-ssh") ? "docker-ssh" : "none");
|
|
431
431
|
const finalPublish = publish ?? [];
|
|
432
432
|
return {
|
|
433
433
|
deploy: finalDeploy, publish: finalPublish, secretBackup: secretBackup === true,
|
|
434
434
|
codeReviewCoderabbit: codeReviewCoderabbit === true,
|
|
435
|
-
// #566 — AI
|
|
435
|
+
// #566 — whether the AI change summary workflow is included. Default true (works with no extra setup).
|
|
436
436
|
aiPrSummary: aiPrSummary !== false,
|
|
437
437
|
changelogProvider: changelogProvider ?? "commit",
|
|
438
438
|
changelogBaseUrl: changelogBaseUrl ?? "",
|
|
439
439
|
deployBranch: deployBranch ?? "",
|
|
440
|
-
deployBranchReady, // #490 — true
|
|
441
|
-
deployBranchCreated, // #493 — true
|
|
440
|
+
deployBranchReady, // #490 — true = confirmed/created, false = declined/failed, null = not checked
|
|
441
|
+
deployBranchCreated, // #493 — true = created by the wizard in this run, null = not checked
|
|
442
442
|
|
|
443
|
-
// #485 intent —
|
|
443
|
+
// #485 intent — settled value first, else inferred from the final deploy/publish (fixes basic and non-interactive paths)
|
|
444
444
|
intent: intent ?? inferIntent(finalDeploy, finalPublish) ?? "manual",
|
|
445
445
|
};
|
|
446
446
|
}
|