stackboi 0.1.0 → 0.1.2
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 +26 -19
- package/dist/cli.js +36 -37
- package/package.json +10 -7
package/README.md
CHANGED
|
@@ -16,48 +16,55 @@ Stacked PRs let you split large features into small, reviewable chunks that buil
|
|
|
16
16
|
|
|
17
17
|
- Git 2.38+ (for `--update-refs`)
|
|
18
18
|
- [GitHub CLI](https://cli.github.com/) (`gh`) authenticated
|
|
19
|
-
- [Bun](https://bun.sh/)
|
|
20
19
|
|
|
21
20
|
## Installation
|
|
22
21
|
|
|
22
|
+
Install globally with npm:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npm install -g stackboi
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or with Bun:
|
|
29
|
+
|
|
23
30
|
```bash
|
|
24
|
-
|
|
25
|
-
cd stackboi
|
|
26
|
-
bun install
|
|
31
|
+
bun install -g stackboi
|
|
27
32
|
```
|
|
28
33
|
|
|
34
|
+
This installs platform-specific native binaries for optimal performance.
|
|
35
|
+
|
|
29
36
|
## Quick Start
|
|
30
37
|
|
|
31
38
|
```bash
|
|
32
39
|
# Initialize in your repo
|
|
33
|
-
|
|
40
|
+
sb init
|
|
34
41
|
|
|
35
42
|
# Start a new stack from main
|
|
36
43
|
git checkout main
|
|
37
|
-
|
|
44
|
+
sb new feature/auth-base
|
|
38
45
|
|
|
39
46
|
# Add branches to the stack
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
sb add feature/auth-login
|
|
48
|
+
sb add feature/auth-logout
|
|
42
49
|
|
|
43
50
|
# Create PRs for each branch
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
51
|
+
sb pr feature/auth-base
|
|
52
|
+
sb pr feature/auth-login
|
|
53
|
+
sb pr feature/auth-logout
|
|
47
54
|
|
|
48
55
|
# Open the interactive view
|
|
49
|
-
|
|
56
|
+
sb view
|
|
50
57
|
```
|
|
51
58
|
|
|
52
59
|
## Commands
|
|
53
60
|
|
|
54
|
-
| Command
|
|
55
|
-
|
|
|
56
|
-
| `init` | Initialize stackboi in the current repo |
|
|
57
|
-
| `new <branch>` | Create a new stack with an initial branch |
|
|
58
|
-
| `add <branch>` | Add a branch to the current stack |
|
|
59
|
-
| `view` | Open interactive tree view |
|
|
60
|
-
| `pr <branch>` | Create a GitHub PR for a branch |
|
|
61
|
+
| Command | Description |
|
|
62
|
+
| ----------------- | ----------------------------------------- |
|
|
63
|
+
| `sb init` | Initialize stackboi in the current repo |
|
|
64
|
+
| `sb new <branch>` | Create a new stack with an initial branch |
|
|
65
|
+
| `sb add <branch>` | Add a branch to the current stack |
|
|
66
|
+
| `sb view` | Open interactive tree view |
|
|
67
|
+
| `sb pr <branch>` | Create a GitHub PR for a branch |
|
|
61
68
|
|
|
62
69
|
## How It Works
|
|
63
70
|
|
package/dist/cli.js
CHANGED
|
@@ -1,63 +1,62 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { spawnSync } from
|
|
4
|
-
import { createRequire } from
|
|
5
|
-
import
|
|
6
|
-
import path from "node:path";
|
|
3
|
+
import { spawnSync } from 'node:child_process'
|
|
4
|
+
import { createRequire } from 'node:module'
|
|
5
|
+
import path from 'node:path'
|
|
7
6
|
|
|
8
|
-
const require = createRequire(import.meta.url)
|
|
7
|
+
const require = createRequire(import.meta.url)
|
|
9
8
|
|
|
10
9
|
const PLATFORMS = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
10
|
+
'darwin-arm64': '@rohannair/stackboi-darwin-arm64',
|
|
11
|
+
'darwin-x64': '@rohannair/stackboi-darwin-x64',
|
|
12
|
+
'linux-x64': '@rohannair/stackboi-linux-x64',
|
|
13
|
+
'linux-arm64': '@rohannair/stackboi-linux-arm64',
|
|
14
|
+
'win32-x64': '@rohannair/stackboi-win32-x64',
|
|
15
|
+
}
|
|
17
16
|
|
|
18
17
|
function getPlatformPackage() {
|
|
19
|
-
const platform = process.platform
|
|
20
|
-
const arch = process.arch
|
|
21
|
-
const key = `${platform}-${arch}
|
|
18
|
+
const platform = process.platform
|
|
19
|
+
const arch = process.arch
|
|
20
|
+
const key = `${platform}-${arch}`
|
|
22
21
|
|
|
23
|
-
const pkg = PLATFORMS[key]
|
|
22
|
+
const pkg = PLATFORMS[key]
|
|
24
23
|
if (!pkg) {
|
|
25
|
-
console.error(`Unsupported platform: ${platform}-${arch}`)
|
|
26
|
-
console.error(`Supported platforms: ${Object.keys(PLATFORMS).join(
|
|
27
|
-
process.exit(1)
|
|
24
|
+
console.error(`Unsupported platform: ${platform}-${arch}`)
|
|
25
|
+
console.error(`Supported platforms: ${Object.keys(PLATFORMS).join(', ')}`)
|
|
26
|
+
process.exit(1)
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
return pkg
|
|
29
|
+
return pkg
|
|
31
30
|
}
|
|
32
31
|
|
|
33
32
|
function getBinaryPath() {
|
|
34
|
-
const pkg = getPlatformPackage()
|
|
33
|
+
const pkg = getPlatformPackage()
|
|
35
34
|
|
|
36
35
|
try {
|
|
37
|
-
const pkgPath = require.resolve(`${pkg}/package.json`)
|
|
38
|
-
const pkgDir = path.dirname(pkgPath)
|
|
39
|
-
const pkgJson = require(pkgPath)
|
|
40
|
-
const binName = pkgJson.bin?.
|
|
41
|
-
return path.join(pkgDir, binName)
|
|
42
|
-
} catch
|
|
43
|
-
console.error(`Failed to find binary for your platform.`)
|
|
44
|
-
console.error(`Please ensure ${pkg} is installed.`)
|
|
45
|
-
console.error(`Try: npm install ${pkg}`)
|
|
46
|
-
process.exit(1)
|
|
36
|
+
const pkgPath = require.resolve(`${pkg}/package.json`)
|
|
37
|
+
const pkgDir = path.dirname(pkgPath)
|
|
38
|
+
const pkgJson = require(pkgPath)
|
|
39
|
+
const binName = pkgJson.bin?.sb || 'sb'
|
|
40
|
+
return path.join(pkgDir, binName)
|
|
41
|
+
} catch {
|
|
42
|
+
console.error(`Failed to find binary for your platform.`)
|
|
43
|
+
console.error(`Please ensure ${pkg} is installed.`)
|
|
44
|
+
console.error(`Try: npm install ${pkg}`)
|
|
45
|
+
process.exit(1)
|
|
47
46
|
}
|
|
48
47
|
}
|
|
49
48
|
|
|
50
|
-
const binaryPath = getBinaryPath()
|
|
51
|
-
const args = process.argv.slice(2)
|
|
49
|
+
const binaryPath = getBinaryPath()
|
|
50
|
+
const args = process.argv.slice(2)
|
|
52
51
|
|
|
53
52
|
const result = spawnSync(binaryPath, args, {
|
|
54
|
-
stdio:
|
|
53
|
+
stdio: 'inherit',
|
|
55
54
|
env: process.env,
|
|
56
|
-
})
|
|
55
|
+
})
|
|
57
56
|
|
|
58
57
|
if (result.error) {
|
|
59
|
-
console.error(`Failed to run
|
|
60
|
-
process.exit(1)
|
|
58
|
+
console.error(`Failed to run sb: ${result.error.message}`)
|
|
59
|
+
process.exit(1)
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
process.exit(result.status ?? 1)
|
|
62
|
+
process.exit(result.status ?? 1)
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stackboi",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "A stacked branch workflow tool",
|
|
5
5
|
"bin": {
|
|
6
|
-
"
|
|
6
|
+
"sb": "dist/cli.js"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
@@ -14,6 +14,9 @@
|
|
|
14
14
|
"build:current": "bun scripts/build.ts --current",
|
|
15
15
|
"publish:all": "bun scripts/publish.ts",
|
|
16
16
|
"publish:dry-run": "bun scripts/publish.ts --dry-run",
|
|
17
|
+
"release:patch": "bun scripts/release.ts --patch",
|
|
18
|
+
"release:minor": "bun scripts/release.ts --minor",
|
|
19
|
+
"release:major": "bun scripts/release.ts --major",
|
|
17
20
|
"lint": "oxlint .",
|
|
18
21
|
"lint:fix": "oxlint --fix .",
|
|
19
22
|
"format": "oxfmt --write .",
|
|
@@ -39,10 +42,10 @@
|
|
|
39
42
|
"typescript": "^5"
|
|
40
43
|
},
|
|
41
44
|
"optionalDependencies": {
|
|
42
|
-
"@stackboi
|
|
43
|
-
"@stackboi
|
|
44
|
-
"@stackboi
|
|
45
|
-
"@stackboi
|
|
46
|
-
"@stackboi
|
|
45
|
+
"@rohannair/stackboi-darwin-arm64": "0.1.2",
|
|
46
|
+
"@rohannair/stackboi-darwin-x64": "0.1.2",
|
|
47
|
+
"@rohannair/stackboi-linux-arm64": "0.1.2",
|
|
48
|
+
"@rohannair/stackboi-linux-x64": "0.1.2",
|
|
49
|
+
"@rohannair/stackboi-win32-x64": "0.1.2"
|
|
47
50
|
}
|
|
48
51
|
}
|