backlog.md 0.1.5 → 0.1.15
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/cli.js +126 -41
- package/package.json +10 -9
- package/bin/backlog-darwin-arm64/backlog +0 -0
- package/bin/backlog-darwin-x64/backlog +0 -0
- package/bin/backlog-linux-arm64/backlog +0 -0
- package/bin/backlog-linux-x64/backlog +0 -0
- package/bin/backlog-win32-x64/backlog.exe +0 -0
- package/readme.md +0 -97
package/cli.js
CHANGED
|
@@ -1,62 +1,147 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { spawn } from 'child_process';
|
|
3
|
-
import { fileURLToPath } from 'url';
|
|
4
|
-
import { dirname, join } from 'path';
|
|
5
|
-
import { platform, arch } from 'os';
|
|
6
|
-
import { accessSync, constants } from 'fs';
|
|
7
2
|
|
|
8
|
-
const
|
|
3
|
+
const { spawn } = require('child_process');
|
|
4
|
+
const { join } = require('path');
|
|
5
|
+
const fs = require('fs');
|
|
6
|
+
const https = require('https');
|
|
7
|
+
const { createWriteStream, chmodSync } = require('fs');
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
'
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
9
|
+
// Determine the correct binary based on platform and architecture
|
|
10
|
+
function getBinaryName() {
|
|
11
|
+
const platform = process.platform;
|
|
12
|
+
const arch = process.arch;
|
|
13
|
+
|
|
14
|
+
let binaryName = 'backlog-';
|
|
15
|
+
|
|
16
|
+
// Map Node.js platform names to Bun target names
|
|
17
|
+
switch (platform) {
|
|
18
|
+
case 'linux':
|
|
19
|
+
binaryName += 'bun-linux-';
|
|
20
|
+
break;
|
|
21
|
+
case 'darwin':
|
|
22
|
+
binaryName += 'bun-darwin-';
|
|
23
|
+
break;
|
|
24
|
+
case 'win32':
|
|
25
|
+
binaryName += 'bun-windows-';
|
|
26
|
+
break;
|
|
27
|
+
default:
|
|
28
|
+
console.error(`Unsupported platform: ${platform}`);
|
|
29
|
+
process.exit(1);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
// Map Node.js arch names to Bun target names
|
|
33
|
+
switch (arch) {
|
|
34
|
+
case 'x64':
|
|
35
|
+
binaryName += 'x64';
|
|
36
|
+
break;
|
|
37
|
+
case 'arm64':
|
|
38
|
+
binaryName += 'arm64';
|
|
39
|
+
break;
|
|
40
|
+
default:
|
|
41
|
+
console.error(`Unsupported architecture: ${arch}`);
|
|
42
|
+
process.exit(1);
|
|
43
|
+
}
|
|
34
44
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
} catch (error) {
|
|
39
|
-
throw new Error(`Binary not found for platform ${mappedOs}-${mappedArch} at ${binaryPath}`);
|
|
45
|
+
// Windows executables have .exe extension
|
|
46
|
+
if (platform === 'win32') {
|
|
47
|
+
binaryName += '.exe';
|
|
40
48
|
}
|
|
49
|
+
|
|
50
|
+
return binaryName;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// Download binary from GitHub releases
|
|
54
|
+
async function downloadBinary(binaryName, binaryPath) {
|
|
55
|
+
const packageJson = require(join(__dirname, 'package.json'));
|
|
56
|
+
const version = packageJson.version;
|
|
57
|
+
const url = `https://github.com/MrLesk/Backlog.md/releases/download/v${version}/${binaryName}`;
|
|
58
|
+
|
|
59
|
+
console.log(`Downloading ${binaryName} for your platform...`);
|
|
60
|
+
console.log(`This is a one-time download.`);
|
|
61
|
+
|
|
62
|
+
return new Promise((resolve, reject) => {
|
|
63
|
+
https.get(url, (response) => {
|
|
64
|
+
if (response.statusCode === 302 || response.statusCode === 301) {
|
|
65
|
+
// Follow redirect
|
|
66
|
+
https.get(response.headers.location, (redirectResponse) => {
|
|
67
|
+
if (redirectResponse.statusCode !== 200) {
|
|
68
|
+
reject(new Error(`Failed to download: ${redirectResponse.statusCode}`));
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const file = createWriteStream(binaryPath);
|
|
73
|
+
redirectResponse.pipe(file);
|
|
74
|
+
|
|
75
|
+
file.on('finish', () => {
|
|
76
|
+
file.close();
|
|
77
|
+
chmodSync(binaryPath, 0o755);
|
|
78
|
+
console.log('Download complete!');
|
|
79
|
+
resolve();
|
|
80
|
+
});
|
|
81
|
+
}).on('error', reject);
|
|
82
|
+
} else if (response.statusCode !== 200) {
|
|
83
|
+
reject(new Error(`Failed to download: ${response.statusCode}`));
|
|
84
|
+
} else {
|
|
85
|
+
const file = createWriteStream(binaryPath);
|
|
86
|
+
response.pipe(file);
|
|
87
|
+
|
|
88
|
+
file.on('finish', () => {
|
|
89
|
+
file.close();
|
|
90
|
+
chmodSync(binaryPath, 0o755);
|
|
91
|
+
console.log('Download complete!');
|
|
92
|
+
resolve();
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
}).on('error', reject);
|
|
96
|
+
});
|
|
41
97
|
}
|
|
42
98
|
|
|
43
|
-
|
|
44
|
-
|
|
99
|
+
// Main execution
|
|
100
|
+
async function main() {
|
|
101
|
+
const binaryName = getBinaryName();
|
|
102
|
+
const binDir = join(__dirname, '.bin');
|
|
103
|
+
const binaryPath = join(binDir, binaryName);
|
|
104
|
+
|
|
105
|
+
// Create bin directory if it doesn't exist
|
|
106
|
+
if (!fs.existsSync(binDir)) {
|
|
107
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Check if binary exists
|
|
111
|
+
if (!fs.existsSync(binaryPath)) {
|
|
112
|
+
try {
|
|
113
|
+
await downloadBinary(binaryName, binaryPath);
|
|
114
|
+
} catch (err) {
|
|
115
|
+
console.error('Failed to download binary:', err.message);
|
|
116
|
+
console.error(`Please download manually from: https://github.com/MrLesk/Backlog.md/releases`);
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Spawn the binary with all arguments
|
|
45
122
|
const child = spawn(binaryPath, process.argv.slice(2), {
|
|
46
123
|
stdio: 'inherit',
|
|
47
|
-
|
|
124
|
+
windowsHide: true
|
|
48
125
|
});
|
|
49
126
|
|
|
127
|
+
// Handle exit
|
|
50
128
|
child.on('exit', (code) => {
|
|
51
129
|
process.exit(code || 0);
|
|
52
130
|
});
|
|
53
131
|
|
|
132
|
+
// Handle errors
|
|
54
133
|
child.on('error', (err) => {
|
|
55
|
-
|
|
134
|
+
if (err.code === 'ENOENT') {
|
|
135
|
+
console.error(`Binary not found: ${binaryPath}`);
|
|
136
|
+
console.error(`Please delete ${binDir} and try again.`);
|
|
137
|
+
} else {
|
|
138
|
+
console.error('Failed to start backlog:', err);
|
|
139
|
+
}
|
|
56
140
|
process.exit(1);
|
|
57
141
|
});
|
|
58
|
-
} catch (error) {
|
|
59
|
-
console.error(error.message);
|
|
60
|
-
console.error('\nPlease report this issue at: https://github.com/MrLesk/Backlog.md/issues');
|
|
61
|
-
process.exit(1);
|
|
62
142
|
}
|
|
143
|
+
|
|
144
|
+
main().catch(err => {
|
|
145
|
+
console.error(err);
|
|
146
|
+
process.exit(1);
|
|
147
|
+
});
|
package/package.json
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backlog.md",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"module": "src/index.ts",
|
|
3
|
+
"version": "0.1.15",
|
|
5
4
|
"type": "module",
|
|
6
5
|
"bin": {
|
|
7
6
|
"backlog": "cli.js"
|
|
8
7
|
},
|
|
9
8
|
"dependencies": {
|
|
9
|
+
"@types/prompts": "^2.4.9",
|
|
10
|
+
"blessed": "0.1.81",
|
|
10
11
|
"commander": "14.0.0",
|
|
11
12
|
"gray-matter": "4.0.3",
|
|
12
|
-
"
|
|
13
|
+
"prompts": "2.4.2"
|
|
13
14
|
},
|
|
14
15
|
"scripts": {
|
|
15
16
|
"test": "bun test",
|
|
16
17
|
"format": "biome format --write .",
|
|
17
18
|
"lint": "biome lint --write .",
|
|
18
19
|
"check": "biome check .",
|
|
19
|
-
"build": "bun build --compile --
|
|
20
|
-
"build:standalone": "node scripts/build-standalone.js",
|
|
21
|
-
"build:npm": "node scripts/build.js",
|
|
20
|
+
"build": "bun build --compile --minify --sourcemap --outfile=backlog src/cli.ts",
|
|
22
21
|
"cli": "bun src/cli.ts"
|
|
23
22
|
},
|
|
24
23
|
"lint-staged": {
|
|
@@ -52,7 +51,9 @@
|
|
|
52
51
|
"@biomejs/biome"
|
|
53
52
|
],
|
|
54
53
|
"files": [
|
|
55
|
-
"
|
|
56
|
-
"
|
|
54
|
+
"cli.js",
|
|
55
|
+
"package.json",
|
|
56
|
+
"README.md",
|
|
57
|
+
"LICENSE"
|
|
57
58
|
]
|
|
58
|
-
}
|
|
59
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/readme.md
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
<h1 align="center">Backlog.md</h1>
|
|
2
|
-
<p align="center">✏️ Markdown‑native Task Manager & Kanban visualizer for any Git repository</p>
|
|
3
|
-
|
|
4
|
-
<p align="center">
|
|
5
|
-
<a href="https://www.npmjs.com/package/backlog.md">
|
|
6
|
-
<img src="https://badgen.net/npm/v/backlog.md?icon=npm&label=npm">
|
|
7
|
-
</a>
|
|
8
|
-
<a href="https://bun.sh">
|
|
9
|
-
<img src="https://badgen.net/badge/bun/add%20backlog.md/black?icon=bun">
|
|
10
|
-
</a>
|
|
11
|
-
<a href="LICENSE"><img src="https://badgen.net/github/license/your-org/backlog.md"></a>
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
---
|
|
15
|
-
|
|
16
|
-
> **Backlog.md** turns any folder with a Git repo into a **self‑contained project board**
|
|
17
|
-
> powered by plain Markdown files and a zero‑config CLI.
|
|
18
|
-
|
|
19
|
-
* 100 % offline‑friendly – your backlog lives *inside* your repository
|
|
20
|
-
* Works on **macOS, Linux and Windows** (Node ≥ 18 / Bun ≥ 1.0)
|
|
21
|
-
* Completely free & open‑source (MIT)
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
### Quick install
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
# global – Node
|
|
29
|
-
npm i -g backlog.md
|
|
30
|
-
|
|
31
|
-
# global – Bun
|
|
32
|
-
bun add -g backlog.md # Bun 1.0+
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
> Prefer per‑project installs? `npm i -D backlog.md` → `npx backlog …`
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
### Five‑minute tour
|
|
40
|
-
|
|
41
|
-
```bash
|
|
42
|
-
# 1. Bootstrap a repo + backlog
|
|
43
|
-
backlog init hello-world
|
|
44
|
-
|
|
45
|
-
# 2. Capture work
|
|
46
|
-
backlog task create "Render markdown as kanban"
|
|
47
|
-
|
|
48
|
-
# 3. See where you stand
|
|
49
|
-
backlog board view
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
All data is saved under `.backlog` folder as human‑readable Markdown (`task‑12 - Fix typo.md`).
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## CLI reference (essentials)
|
|
57
|
-
|
|
58
|
-
| Action | Example |
|
|
59
|
-
|-------------|------------------------------------------------------|
|
|
60
|
-
| Create task | `backlog task create "Add OAuth"` |
|
|
61
|
-
| Create sub task | `backlog task create --parent 14 "Add Google auth"`|
|
|
62
|
-
| List tasks | `backlog task list [-s <status>] [-a <assignee>` |
|
|
63
|
-
| View detail | `backlog task 7` |
|
|
64
|
-
| Edit | `backlog task edit 7 -a @sara -l auth,backend` |
|
|
65
|
-
| Archive | `backlog task archive 7` |
|
|
66
|
-
| Draft flow | `backlog draft create "Spike GraphQL"` → `backlog draft promote 3.1` |
|
|
67
|
-
| Demote to draft| `backlog task demote <id>` |
|
|
68
|
-
| Kanban | `backlog board view` |
|
|
69
|
-
|
|
70
|
-
Full help: `backlog --help`
|
|
71
|
-
|
|
72
|
-
---
|
|
73
|
-
|
|
74
|
-
## Configuration
|
|
75
|
-
|
|
76
|
-
Backlog.md merges the following layers (highest → lowest):
|
|
77
|
-
|
|
78
|
-
1. CLI flags
|
|
79
|
-
2. `.backlog/config.yml` (per‑project)
|
|
80
|
-
3. `~/.backlog/user` (per‑user)
|
|
81
|
-
4. Built‑ins
|
|
82
|
-
|
|
83
|
-
Key options:
|
|
84
|
-
|
|
85
|
-
| Key | Purpose | Default |
|
|
86
|
-
|-------------------|--------------------|-------------------------------|
|
|
87
|
-
| `default_assignee`| Pre‑fill assignee | `[]` |
|
|
88
|
-
| `default_status` | First column | `To Do` |
|
|
89
|
-
| `statuses` | Board columns | `[To Do, In Progress, Done]` |
|
|
90
|
-
| `date_format` | ISO or locale | `yyyy-mm-dd` |
|
|
91
|
-
|
|
92
|
-
---
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
## License
|
|
96
|
-
|
|
97
|
-
Backlog.md is released under the **MIT License** – do anything, just give credit. See [LICENSE](LICENSE).
|