contribute-now 0.5.0-dev.914e35d → 0.5.0-dev.aa966be
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 +11 -1
- package/dist/index.js +40 -33
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -47,7 +47,9 @@ npm install -g contribute-now
|
|
|
47
47
|
contrib setup
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
>
|
|
50
|
+
> `contrib`, `contribute`, and `cn` all invoke the same binary — use whichever you prefer.
|
|
51
|
+
>
|
|
52
|
+
> **Fun fact:** `cn` is shorter than `git`. Yes, your workflow command is now faster to type than git itself. 🚀
|
|
51
53
|
|
|
52
54
|
---
|
|
53
55
|
|
|
@@ -61,6 +63,14 @@ npm install -g contribute-now
|
|
|
61
63
|
bun install -g contribute-now
|
|
62
64
|
```
|
|
63
65
|
|
|
66
|
+
Once installed, you can use any of the three aliases:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
contrib setup # classic
|
|
70
|
+
contribute setup # spelled out
|
|
71
|
+
cn setup # shortest — even shorter than git!
|
|
72
|
+
```
|
|
73
|
+
|
|
64
74
|
## Prerequisites
|
|
65
75
|
|
|
66
76
|
- **[Git](https://git-scm.com/)** — required
|
package/dist/index.js
CHANGED
|
@@ -2268,12 +2268,13 @@ import pc7 from "picocolors";
|
|
|
2268
2268
|
// package.json
|
|
2269
2269
|
var package_default = {
|
|
2270
2270
|
name: "contribute-now",
|
|
2271
|
-
version: "0.5.0-dev.
|
|
2271
|
+
version: "0.5.0-dev.aa966be",
|
|
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: {
|
|
2275
2275
|
contrib: "dist/index.js",
|
|
2276
|
-
contribute: "dist/index.js"
|
|
2276
|
+
contribute: "dist/index.js",
|
|
2277
|
+
cn: "dist/index.js"
|
|
2277
2278
|
},
|
|
2278
2279
|
files: [
|
|
2279
2280
|
"dist"
|
|
@@ -3108,18 +3109,28 @@ function gitRun(args) {
|
|
|
3108
3109
|
var save_default = defineCommand7({
|
|
3109
3110
|
meta: {
|
|
3110
3111
|
name: "save",
|
|
3111
|
-
description: "Save, restore, or manage
|
|
3112
|
+
description: "Save uncommitted changes for later. Use --list, --restore, or --drop to manage saves."
|
|
3112
3113
|
},
|
|
3113
3114
|
args: {
|
|
3114
|
-
|
|
3115
|
-
type: "
|
|
3116
|
-
|
|
3117
|
-
|
|
3115
|
+
list: {
|
|
3116
|
+
type: "boolean",
|
|
3117
|
+
alias: "l",
|
|
3118
|
+
description: "List all saved changes"
|
|
3119
|
+
},
|
|
3120
|
+
restore: {
|
|
3121
|
+
type: "boolean",
|
|
3122
|
+
alias: "r",
|
|
3123
|
+
description: "Restore previously saved changes"
|
|
3124
|
+
},
|
|
3125
|
+
drop: {
|
|
3126
|
+
type: "boolean",
|
|
3127
|
+
alias: "d",
|
|
3128
|
+
description: "Discard a specific save entry"
|
|
3118
3129
|
},
|
|
3119
3130
|
message: {
|
|
3120
3131
|
type: "string",
|
|
3121
3132
|
alias: "m",
|
|
3122
|
-
description: "Description for saved changes"
|
|
3133
|
+
description: "Description for saved changes (used with default save)"
|
|
3123
3134
|
}
|
|
3124
3135
|
},
|
|
3125
3136
|
async run({ args }) {
|
|
@@ -3127,23 +3138,19 @@ var save_default = defineCommand7({
|
|
|
3127
3138
|
error("Not inside a git repository.");
|
|
3128
3139
|
process.exit(1);
|
|
3129
3140
|
}
|
|
3130
|
-
const
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
break;
|
|
3144
|
-
default:
|
|
3145
|
-
error(`Unknown action: ${action}. Use save, restore, list, or drop.`);
|
|
3146
|
-
process.exit(1);
|
|
3141
|
+
const flags = [args.list, args.restore, args.drop].filter(Boolean);
|
|
3142
|
+
if (flags.length > 1) {
|
|
3143
|
+
error("Please use only one flag at a time: --list, --restore, or --drop.");
|
|
3144
|
+
process.exit(1);
|
|
3145
|
+
}
|
|
3146
|
+
if (args.list) {
|
|
3147
|
+
await handleList();
|
|
3148
|
+
} else if (args.restore) {
|
|
3149
|
+
await handleRestore();
|
|
3150
|
+
} else if (args.drop) {
|
|
3151
|
+
await handleDrop();
|
|
3152
|
+
} else {
|
|
3153
|
+
await handleSave(args.message);
|
|
3147
3154
|
}
|
|
3148
3155
|
}
|
|
3149
3156
|
});
|
|
@@ -3162,10 +3169,10 @@ async function handleSave(message) {
|
|
|
3162
3169
|
return;
|
|
3163
3170
|
}
|
|
3164
3171
|
success(`Saved: ${pc10.dim(label)}`);
|
|
3165
|
-
info(`Use ${pc10.bold("contrib save restore")} to bring them back.`);
|
|
3172
|
+
info(`Use ${pc10.bold("contrib save --restore")} to bring them back.`);
|
|
3166
3173
|
}
|
|
3167
3174
|
async function handleRestore() {
|
|
3168
|
-
heading("\uD83D\uDCBE contrib save restore");
|
|
3175
|
+
heading("\uD83D\uDCBE contrib save --restore");
|
|
3169
3176
|
const stashes = await getStashList();
|
|
3170
3177
|
if (stashes.length === 0) {
|
|
3171
3178
|
info("No saved changes found.");
|
|
@@ -3194,7 +3201,7 @@ async function handleRestore() {
|
|
|
3194
3201
|
success(`Restored: ${pc10.dim(match?.message ?? "saved changes")}`);
|
|
3195
3202
|
}
|
|
3196
3203
|
async function handleList() {
|
|
3197
|
-
heading("\uD83D\uDCBE contrib save list");
|
|
3204
|
+
heading("\uD83D\uDCBE contrib save --list");
|
|
3198
3205
|
const stashes = await getStashList();
|
|
3199
3206
|
if (stashes.length === 0) {
|
|
3200
3207
|
info("No saved changes.");
|
|
@@ -3207,11 +3214,11 @@ async function handleList() {
|
|
|
3207
3214
|
console.log(` ${idx} ${msg}`);
|
|
3208
3215
|
}
|
|
3209
3216
|
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.`);
|
|
3217
|
+
info(`Use ${pc10.bold("contrib save --restore")} to bring changes back.`);
|
|
3218
|
+
info(`Use ${pc10.bold("contrib save --drop")} to discard saved changes.`);
|
|
3212
3219
|
}
|
|
3213
3220
|
async function handleDrop() {
|
|
3214
|
-
heading("\uD83D\uDCBE contrib save drop");
|
|
3221
|
+
heading("\uD83D\uDCBE contrib save --drop");
|
|
3215
3222
|
const stashes = await getStashList();
|
|
3216
3223
|
if (stashes.length === 0) {
|
|
3217
3224
|
info("No saved changes to drop.");
|
|
@@ -4348,13 +4355,13 @@ var switch_default = defineCommand12({
|
|
|
4348
4355
|
await exec("git", ["stash", "pop"]);
|
|
4349
4356
|
info("Restored saved changes.");
|
|
4350
4357
|
} catch {
|
|
4351
|
-
warn("Could not restore save automatically. Use `contrib save restore` to recover.");
|
|
4358
|
+
warn("Could not restore save automatically. Use `contrib save --restore` to recover.");
|
|
4352
4359
|
}
|
|
4353
4360
|
process.exit(1);
|
|
4354
4361
|
}
|
|
4355
4362
|
success(`Switched to ${pc15.bold(targetBranch)}`);
|
|
4356
4363
|
info(`Your changes from ${pc15.bold(currentBranch ?? "previous branch")} are saved.`);
|
|
4357
|
-
info(`Use ${pc15.bold("contrib save restore")} to bring them back.`);
|
|
4364
|
+
info(`Use ${pc15.bold("contrib save --restore")} to bring them back.`);
|
|
4358
4365
|
return;
|
|
4359
4366
|
}
|
|
4360
4367
|
const result = await checkoutBranch(targetBranch);
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "contribute-now",
|
|
3
|
-
"version": "0.5.0-dev.
|
|
3
|
+
"version": "0.5.0-dev.aa966be",
|
|
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": {
|
|
7
7
|
"contrib": "dist/index.js",
|
|
8
|
-
"contribute": "dist/index.js"
|
|
8
|
+
"contribute": "dist/index.js",
|
|
9
|
+
"cn": "dist/index.js"
|
|
9
10
|
},
|
|
10
11
|
"files": [
|
|
11
12
|
"dist"
|