contribute-now 0.6.0 → 0.6.1
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/dist/index.js +26 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2268,7 +2268,7 @@ import pc7 from "picocolors";
|
|
|
2268
2268
|
// package.json
|
|
2269
2269
|
var package_default = {
|
|
2270
2270
|
name: "contribute-now",
|
|
2271
|
-
version: "0.6.
|
|
2271
|
+
version: "0.6.1",
|
|
2272
2272
|
description: "Developer CLI that automates git workflows — branching, syncing, committing, and PRs — with multi-workflow and commit convention support.",
|
|
2273
2273
|
type: "module",
|
|
2274
2274
|
bin: {
|
|
@@ -4142,22 +4142,39 @@ ${pc14.dim("AI body preview:")}`);
|
|
|
4142
4142
|
warn(`AI unavailable: ${copilotError}`);
|
|
4143
4143
|
}
|
|
4144
4144
|
}
|
|
4145
|
-
if (!args["no-ai"]) {
|
|
4146
|
-
await tryGenerateAI();
|
|
4147
|
-
}
|
|
4148
4145
|
const CANCEL = "Cancel";
|
|
4149
4146
|
const SQUASH_LOCAL = `Squash merge to ${baseBranch} locally (no PR)`;
|
|
4150
4147
|
const REGENERATE = "Regenerate AI description";
|
|
4151
4148
|
let submitAction = "cancel";
|
|
4152
4149
|
const isMaintainer = config.role === "maintainer";
|
|
4150
|
+
if (isMaintainer) {
|
|
4151
|
+
const maintainerChoice = await selectPrompt("How would you like to submit your changes?", ["Create a PR", SQUASH_LOCAL, CANCEL]);
|
|
4152
|
+
if (maintainerChoice === CANCEL) {
|
|
4153
|
+
warn("Submit cancelled.");
|
|
4154
|
+
return;
|
|
4155
|
+
}
|
|
4156
|
+
if (maintainerChoice === SQUASH_LOCAL) {
|
|
4157
|
+
await performSquashMerge(origin, baseBranch, currentBranch, {
|
|
4158
|
+
model: args.model,
|
|
4159
|
+
convention: config.commitConvention
|
|
4160
|
+
});
|
|
4161
|
+
return;
|
|
4162
|
+
}
|
|
4163
|
+
}
|
|
4164
|
+
if (!args["no-ai"]) {
|
|
4165
|
+
await tryGenerateAI();
|
|
4166
|
+
}
|
|
4153
4167
|
let actionResolved = false;
|
|
4154
4168
|
while (!actionResolved) {
|
|
4155
4169
|
if (prTitle && prBody) {
|
|
4156
|
-
const
|
|
4157
|
-
|
|
4158
|
-
|
|
4159
|
-
|
|
4160
|
-
|
|
4170
|
+
const action = await selectPrompt("What would you like to do with the PR description?", [
|
|
4171
|
+
"Use AI description",
|
|
4172
|
+
"Edit title",
|
|
4173
|
+
"Write manually",
|
|
4174
|
+
"Use gh --fill (auto-fill from commits)",
|
|
4175
|
+
REGENERATE,
|
|
4176
|
+
CANCEL
|
|
4177
|
+
]);
|
|
4161
4178
|
if (action === CANCEL) {
|
|
4162
4179
|
submitAction = "cancel";
|
|
4163
4180
|
actionResolved = true;
|
|
@@ -4165,9 +4182,6 @@ ${pc14.dim("AI body preview:")}`);
|
|
|
4165
4182
|
prTitle = null;
|
|
4166
4183
|
prBody = null;
|
|
4167
4184
|
await tryGenerateAI();
|
|
4168
|
-
} else if (action === SQUASH_LOCAL) {
|
|
4169
|
-
submitAction = "squash";
|
|
4170
|
-
actionResolved = true;
|
|
4171
4185
|
} else if (action === "Use AI description") {
|
|
4172
4186
|
submitAction = "create-pr";
|
|
4173
4187
|
actionResolved = true;
|
|
@@ -4186,8 +4200,6 @@ ${pc14.dim("AI body preview:")}`);
|
|
|
4186
4200
|
}
|
|
4187
4201
|
} else {
|
|
4188
4202
|
const choices = [];
|
|
4189
|
-
if (isMaintainer)
|
|
4190
|
-
choices.push(SQUASH_LOCAL);
|
|
4191
4203
|
if (!args["no-ai"])
|
|
4192
4204
|
choices.push(REGENERATE);
|
|
4193
4205
|
choices.push("Write title & body manually", "Use gh --fill (auto-fill from commits)", CANCEL);
|
|
@@ -4197,9 +4209,6 @@ ${pc14.dim("AI body preview:")}`);
|
|
|
4197
4209
|
actionResolved = true;
|
|
4198
4210
|
} else if (action === REGENERATE) {
|
|
4199
4211
|
await tryGenerateAI();
|
|
4200
|
-
} else if (action === SQUASH_LOCAL) {
|
|
4201
|
-
submitAction = "squash";
|
|
4202
|
-
actionResolved = true;
|
|
4203
4212
|
} else if (action === "Write title & body manually") {
|
|
4204
4213
|
prTitle = await inputPrompt("PR title");
|
|
4205
4214
|
prBody = await inputPrompt("PR body (markdown)");
|
|
@@ -4215,13 +4224,6 @@ ${pc14.dim("AI body preview:")}`);
|
|
|
4215
4224
|
warn("Submit cancelled.");
|
|
4216
4225
|
return;
|
|
4217
4226
|
}
|
|
4218
|
-
if (submitAction === "squash") {
|
|
4219
|
-
await performSquashMerge(origin, baseBranch, currentBranch, {
|
|
4220
|
-
model: args.model,
|
|
4221
|
-
convention: config.commitConvention
|
|
4222
|
-
});
|
|
4223
|
-
return;
|
|
4224
|
-
}
|
|
4225
4227
|
info(`Pushing ${pc14.bold(currentBranch)} to ${origin}...`);
|
|
4226
4228
|
const pushResult = await pushSetUpstream(origin, currentBranch);
|
|
4227
4229
|
if (pushResult.exitCode !== 0) {
|
package/package.json
CHANGED