contribute-now 0.5.0-dev.914e35d → 0.5.0-dev.fefd5d0

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 +38 -32
  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.5.0-dev.914e35d",
2271
+ version: "0.5.0-dev.fefd5d0",
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: {
@@ -3108,18 +3108,28 @@ function gitRun(args) {
3108
3108
  var save_default = defineCommand7({
3109
3109
  meta: {
3110
3110
  name: "save",
3111
- description: "Save, restore, or manage uncommitted changes"
3111
+ description: "Save uncommitted changes for later. Use --list, --restore, or --drop to manage saves."
3112
3112
  },
3113
3113
  args: {
3114
- action: {
3115
- type: "positional",
3116
- description: "Action: save (default), restore, list, drop",
3117
- required: false
3114
+ list: {
3115
+ type: "boolean",
3116
+ alias: "l",
3117
+ description: "List all saved changes"
3118
+ },
3119
+ restore: {
3120
+ type: "boolean",
3121
+ alias: "r",
3122
+ description: "Restore previously saved changes"
3123
+ },
3124
+ drop: {
3125
+ type: "boolean",
3126
+ alias: "d",
3127
+ description: "Discard a specific save entry"
3118
3128
  },
3119
3129
  message: {
3120
3130
  type: "string",
3121
3131
  alias: "m",
3122
- description: "Description for saved changes"
3132
+ description: "Description for saved changes (used with default save)"
3123
3133
  }
3124
3134
  },
3125
3135
  async run({ args }) {
@@ -3127,23 +3137,19 @@ var save_default = defineCommand7({
3127
3137
  error("Not inside a git repository.");
3128
3138
  process.exit(1);
3129
3139
  }
3130
- const action = args.action ?? "save";
3131
- switch (action) {
3132
- case "save":
3133
- await handleSave(args.message);
3134
- break;
3135
- case "restore":
3136
- await handleRestore();
3137
- break;
3138
- case "list":
3139
- await handleList();
3140
- break;
3141
- case "drop":
3142
- await handleDrop();
3143
- break;
3144
- default:
3145
- error(`Unknown action: ${action}. Use save, restore, list, or drop.`);
3146
- process.exit(1);
3140
+ const flags = [args.list, args.restore, args.drop].filter(Boolean);
3141
+ if (flags.length > 1) {
3142
+ error("Please use only one flag at a time: --list, --restore, or --drop.");
3143
+ process.exit(1);
3144
+ }
3145
+ if (args.list) {
3146
+ await handleList();
3147
+ } else if (args.restore) {
3148
+ await handleRestore();
3149
+ } else if (args.drop) {
3150
+ await handleDrop();
3151
+ } else {
3152
+ await handleSave(args.message);
3147
3153
  }
3148
3154
  }
3149
3155
  });
@@ -3162,10 +3168,10 @@ async function handleSave(message) {
3162
3168
  return;
3163
3169
  }
3164
3170
  success(`Saved: ${pc10.dim(label)}`);
3165
- info(`Use ${pc10.bold("contrib save restore")} to bring them back.`);
3171
+ info(`Use ${pc10.bold("contrib save --restore")} to bring them back.`);
3166
3172
  }
3167
3173
  async function handleRestore() {
3168
- heading("\uD83D\uDCBE contrib save restore");
3174
+ heading("\uD83D\uDCBE contrib save --restore");
3169
3175
  const stashes = await getStashList();
3170
3176
  if (stashes.length === 0) {
3171
3177
  info("No saved changes found.");
@@ -3194,7 +3200,7 @@ async function handleRestore() {
3194
3200
  success(`Restored: ${pc10.dim(match?.message ?? "saved changes")}`);
3195
3201
  }
3196
3202
  async function handleList() {
3197
- heading("\uD83D\uDCBE contrib save list");
3203
+ heading("\uD83D\uDCBE contrib save --list");
3198
3204
  const stashes = await getStashList();
3199
3205
  if (stashes.length === 0) {
3200
3206
  info("No saved changes.");
@@ -3207,11 +3213,11 @@ async function handleList() {
3207
3213
  console.log(` ${idx} ${msg}`);
3208
3214
  }
3209
3215
  console.log();
3210
- info(`Use ${pc10.bold("contrib save restore")} to bring changes back.`);
3211
- info(`Use ${pc10.bold("contrib save drop")} to discard saved changes.`);
3216
+ info(`Use ${pc10.bold("contrib save --restore")} to bring changes back.`);
3217
+ info(`Use ${pc10.bold("contrib save --drop")} to discard saved changes.`);
3212
3218
  }
3213
3219
  async function handleDrop() {
3214
- heading("\uD83D\uDCBE contrib save drop");
3220
+ heading("\uD83D\uDCBE contrib save --drop");
3215
3221
  const stashes = await getStashList();
3216
3222
  if (stashes.length === 0) {
3217
3223
  info("No saved changes to drop.");
@@ -4348,13 +4354,13 @@ var switch_default = defineCommand12({
4348
4354
  await exec("git", ["stash", "pop"]);
4349
4355
  info("Restored saved changes.");
4350
4356
  } catch {
4351
- warn("Could not restore save automatically. Use `contrib save restore` to recover.");
4357
+ warn("Could not restore save automatically. Use `contrib save --restore` to recover.");
4352
4358
  }
4353
4359
  process.exit(1);
4354
4360
  }
4355
4361
  success(`Switched to ${pc15.bold(targetBranch)}`);
4356
4362
  info(`Your changes from ${pc15.bold(currentBranch ?? "previous branch")} are saved.`);
4357
- info(`Use ${pc15.bold("contrib save restore")} to bring them back.`);
4363
+ info(`Use ${pc15.bold("contrib save --restore")} to bring them back.`);
4358
4364
  return;
4359
4365
  }
4360
4366
  const result = await checkoutBranch(targetBranch);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "contribute-now",
3
- "version": "0.5.0-dev.914e35d",
3
+ "version": "0.5.0-dev.fefd5d0",
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": {