gitbasher 3.10.1 → 4.1.0

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/package.json CHANGED
@@ -1,12 +1,33 @@
1
1
  {
2
2
  "name": "gitbasher",
3
- "version": "3.10.1",
3
+ "version": "4.1.0",
4
4
  "description": "Simple bash utility that makes git easy to use",
5
5
  "keywords": [
6
6
  "git",
7
7
  "bash",
8
+ "shell",
8
9
  "cli",
9
- "version-control"
10
+ "command-line",
11
+ "version-control",
12
+ "git-cli",
13
+ "git-helper",
14
+ "git-tools",
15
+ "git-workflow",
16
+ "developer-tools",
17
+ "productivity",
18
+ "interactive",
19
+ "conventional-commits",
20
+ "ai-commit",
21
+ "openai",
22
+ "openrouter",
23
+ "ollama",
24
+ "worktree",
25
+ "rebase",
26
+ "merge",
27
+ "stash",
28
+ "wip",
29
+ "macos",
30
+ "linux"
10
31
  ],
11
32
  "author": "maxbolgarin",
12
33
  "license": "MIT",
@@ -16,18 +37,23 @@
16
37
  },
17
38
  "homepage": "https://github.com/maxbolgarin/gitbasher#readme",
18
39
  "bin": {
19
- "gitb": "bin/gitb"
40
+ "gitb": "dist/gitb"
20
41
  },
21
42
  "files": [
22
- "bin",
23
- "download-release.js",
43
+ "dist/gitb",
24
44
  "README.md",
45
+ "CHANGELOG.md",
25
46
  "LICENSE"
26
47
  ],
27
- "scripts": {
28
- "postinstall": "node download-release.js"
29
- },
30
- "engines": {
31
- "node": ">=14.0.0"
48
+ "devDependencies": {
49
+ "semantic-release": "latest",
50
+ "@semantic-release/commit-analyzer": "latest",
51
+ "@semantic-release/release-notes-generator": "latest",
52
+ "@semantic-release/exec": "latest",
53
+ "@semantic-release/changelog": "latest",
54
+ "@semantic-release/github": "latest",
55
+ "@semantic-release/npm": "latest",
56
+ "@semantic-release/git": "latest",
57
+ "conventional-changelog-conventionalcommits": "latest"
32
58
  }
33
59
  }
package/bin/gitb DELETED
@@ -1,5 +0,0 @@
1
- #!/bin/bash
2
- # Placeholder file - will be replaced during npm install by download-release.js
3
- # This file exists only to satisfy npm publish validation
4
- echo "Error: gitbasher binary not found. Please reinstall: npm install -g gitbasher" >&2
5
- exit 1
@@ -1,119 +0,0 @@
1
- const https = require('https');
2
- const http = require('http');
3
- const fs = require('fs');
4
- const path = require('path');
5
-
6
- const VERSION = process.env.npm_package_version;
7
- if (!VERSION) {
8
- console.error('Error: npm_package_version not found');
9
- process.exit(1);
10
- }
11
-
12
- // __dirname points to the package root when installed via npm
13
- const BIN_DIR = path.join(__dirname, 'bin');
14
- const BIN_PATH = path.join(BIN_DIR, 'gitb');
15
- const RELEASE_URL = `https://github.com/maxbolgarin/gitbasher/releases/download/v${VERSION}/gitb`;
16
-
17
- // Ensure bin directory exists
18
- if (!fs.existsSync(BIN_DIR)) {
19
- fs.mkdirSync(BIN_DIR, { recursive: true });
20
- }
21
-
22
- // Download function with redirect handling
23
- function download(url, outputPath, maxRedirects = 5) {
24
- return new Promise((resolve, reject) => {
25
- if (maxRedirects === 0) {
26
- reject(new Error('Too many redirects'));
27
- return;
28
- }
29
-
30
- const client = url.startsWith('https') ? https : http;
31
- const file = fs.createWriteStream(outputPath);
32
- let downloadedBytes = 0;
33
- let totalBytes = 0;
34
-
35
- // Add timeout (30 seconds)
36
- const timeout = setTimeout(() => {
37
- file.close();
38
- if (fs.existsSync(outputPath)) {
39
- fs.unlinkSync(outputPath);
40
- }
41
- reject(new Error('Download timeout after 30s'));
42
- }, 30000);
43
-
44
- client.get(url, (response) => {
45
- // Handle redirects
46
- if (response.statusCode === 301 || response.statusCode === 302 || response.statusCode === 307 || response.statusCode === 308) {
47
- clearTimeout(timeout);
48
- file.close();
49
- fs.unlinkSync(outputPath);
50
- const redirectUrl = response.headers.location;
51
- if (!redirectUrl) {
52
- reject(new Error('Redirect location not found'));
53
- return;
54
- }
55
- // Resolve relative redirects
56
- const redirectUrlFull = redirectUrl.startsWith('http')
57
- ? redirectUrl
58
- : new URL(redirectUrl, url).href;
59
- return download(redirectUrlFull, outputPath, maxRedirects - 1)
60
- .then(resolve)
61
- .catch(reject);
62
- }
63
-
64
- // Handle errors
65
- if (response.statusCode !== 200) {
66
- file.close();
67
- fs.unlinkSync(outputPath);
68
- reject(new Error(`HTTP ${response.statusCode}: ${response.statusMessage}`));
69
- return;
70
- }
71
-
72
- // Track download progress
73
- totalBytes = parseInt(response.headers['content-length'] || '0', 10);
74
- if (totalBytes > 0) {
75
- response.on('data', (chunk) => {
76
- downloadedBytes += chunk.length;
77
- });
78
- }
79
-
80
- // Pipe response to file
81
- response.pipe(file);
82
-
83
- file.on('finish', () => {
84
- clearTimeout(timeout);
85
- file.close();
86
- fs.chmodSync(outputPath, 0o755);
87
- if (totalBytes > 0) {
88
- const sizeKB = (downloadedBytes / 1024).toFixed(1);
89
- process.stderr.write(`✓ Downloaded ${sizeKB}KB\n`);
90
- } else {
91
- process.stderr.write('✓ Download complete\n');
92
- }
93
- resolve();
94
- });
95
- }).on('error', (err) => {
96
- clearTimeout(timeout);
97
- file.close();
98
- if (fs.existsSync(outputPath)) {
99
- fs.unlinkSync(outputPath);
100
- }
101
- reject(err);
102
- });
103
- });
104
- }
105
-
106
- // Download the release asset
107
- // Use stderr for progress so it's visible during npm install
108
- process.stderr.write(`Downloading gitbasher v${VERSION}...\n`);
109
- const startTime = Date.now();
110
-
111
- download(RELEASE_URL, BIN_PATH)
112
- .then(() => {
113
- const duration = ((Date.now() - startTime) / 1000).toFixed(1);
114
- process.stderr.write(`✓ Installed in ${duration}s\n`);
115
- })
116
- .catch((err) => {
117
- process.stderr.write(`✗ Error downloading release: ${err.message}\n`);
118
- process.exit(1);
119
- });