contribute-now 0.6.0-dev.211431e → 0.6.0-dev.6c42203

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