bstack 1.1.4 → 1.1.6
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 +6 -3
- package/dist/bstack.mjs +5 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# bstack
|
|
2
2
|
|
|
3
|
+
[](https://npmx.dev/package/bstack)
|
|
4
|
+
|
|
3
5
|
Convert a series of commits in a local branch into a native GitHub stack of pull requests.
|
|
4
6
|
|
|
5
7
|
## Install
|
|
@@ -21,10 +23,11 @@ Write and edit commits locally. `bstack` handles the GitHub ops for you:
|
|
|
21
23
|
|
|
22
24
|
You
|
|
23
25
|
|
|
24
|
-
- Do not push your local feature
|
|
26
|
+
- Do not push your local feature branches.
|
|
25
27
|
- Do not open pull requests manually.
|
|
26
|
-
- Run `bstack` when your commits are ready.
|
|
27
|
-
|
|
28
|
+
- Run `bstack` when your commits are ready.
|
|
29
|
+
|
|
30
|
+
**bstack** pushes dedicated remote branches and creates one pull request for each commit.
|
|
28
31
|
|
|
29
32
|
### Start a stack
|
|
30
33
|
|
package/dist/bstack.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import * as v from "valibot";
|
|
|
6
6
|
import { mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
|
|
7
7
|
import { dirname } from "node:path";
|
|
8
8
|
//#region package.json
|
|
9
|
-
var version = "1.1.
|
|
9
|
+
var version = "1.1.6";
|
|
10
10
|
//#endregion
|
|
11
11
|
//#region src/command.ts
|
|
12
12
|
var CommandError = class extends Error {
|
|
@@ -59,6 +59,7 @@ function checkoutStack(dependencies, options) {
|
|
|
59
59
|
const { repository, github, reporter } = dependencies;
|
|
60
60
|
reporter.progress("Checking the repository and GitHub prerequisites");
|
|
61
61
|
repository.assertReady();
|
|
62
|
+
repository.assertClean();
|
|
62
63
|
github.assertReady();
|
|
63
64
|
const remote = repository.resolveRemote(options.remote);
|
|
64
65
|
reporter.progress(`Looking up pull request ${options.reference}`);
|
|
@@ -166,7 +167,9 @@ var GitCliRepository = class {
|
|
|
166
167
|
}
|
|
167
168
|
assertReady() {
|
|
168
169
|
this.git(["rev-parse", "--show-toplevel"]);
|
|
169
|
-
|
|
170
|
+
}
|
|
171
|
+
assertClean() {
|
|
172
|
+
if (this.git(["status", "--porcelain"]).stdout.trim()) throw new Error("The working tree must be clean before checkout");
|
|
170
173
|
}
|
|
171
174
|
currentBranch() {
|
|
172
175
|
return this.git([
|