@peleke.s/buildlog 0.9.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/README.md +67 -0
- package/bin/buildlog.mjs +85 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# buildlog
|
|
2
|
+
|
|
3
|
+
Engineering notebook for AI-assisted development. Capture your work as publishable content. Include the fuckups.
|
|
4
|
+
|
|
5
|
+
This is the npm wrapper for [buildlog](https://github.com/Peleke/buildlog-template). It lets you use buildlog via `npx`/`bunx` in TypeScript and JavaScript projects.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @peleke.s/buildlog init
|
|
11
|
+
npx @peleke.s/buildlog new my-feature
|
|
12
|
+
npx @peleke.s/buildlog commit -m "feat: add auth"
|
|
13
|
+
npx @peleke.s/buildlog skills
|
|
14
|
+
npx @peleke.s/buildlog gauntlet loop src/
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# One-off (no install needed)
|
|
21
|
+
npx @peleke.s/buildlog init
|
|
22
|
+
|
|
23
|
+
# Pin as dev dependency
|
|
24
|
+
npm install -D buildlog
|
|
25
|
+
# or
|
|
26
|
+
bun add -D buildlog
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Requirements
|
|
30
|
+
|
|
31
|
+
Python 3.10+ must be available. The npm package is a thin wrapper that invokes the Python CLI.
|
|
32
|
+
|
|
33
|
+
If `buildlog` isn't already installed, the wrapper will try `uvx buildlog` (auto-downloads from PyPI) or `python -m buildlog` as fallbacks.
|
|
34
|
+
|
|
35
|
+
To install the Python CLI directly:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install buildlog
|
|
39
|
+
# or
|
|
40
|
+
uv tool install buildlog
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## How it works
|
|
44
|
+
|
|
45
|
+
The npm package ships a single bin shim that:
|
|
46
|
+
|
|
47
|
+
1. Looks for `buildlog` on PATH
|
|
48
|
+
2. Falls back to `uvx buildlog` (zero-install via uv)
|
|
49
|
+
3. Falls back to `python3 -m buildlog`
|
|
50
|
+
4. Passes through all arguments and stdio transparently
|
|
51
|
+
|
|
52
|
+
Every command works identically to the Python CLI. See the [full documentation](https://github.com/Peleke/buildlog-template) for details.
|
|
53
|
+
|
|
54
|
+
## package.json scripts
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"scripts": {
|
|
59
|
+
"gauntlet": "buildlog gauntlet loop src/",
|
|
60
|
+
"buildlog:commit": "buildlog commit"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT
|
package/bin/buildlog.mjs
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* buildlog npm wrapper
|
|
5
|
+
*
|
|
6
|
+
* Thin shim that finds and invokes the Python buildlog CLI.
|
|
7
|
+
* Resolution order:
|
|
8
|
+
* 1. `buildlog` on PATH (pip install / pipx / system)
|
|
9
|
+
* 2. `uvx buildlog` (auto-downloads, no install needed)
|
|
10
|
+
* 3. `python3 -m buildlog` / `python -m buildlog`
|
|
11
|
+
*
|
|
12
|
+
* All arguments and stdio are passed through transparently.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { spawn, execFileSync } from "node:child_process";
|
|
16
|
+
|
|
17
|
+
const args = process.argv.slice(2);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Check if a command exists on PATH.
|
|
21
|
+
*/
|
|
22
|
+
function commandExists(cmd) {
|
|
23
|
+
try {
|
|
24
|
+
execFileSync(process.platform === "win32" ? "where" : "which", [cmd], {
|
|
25
|
+
stdio: "ignore",
|
|
26
|
+
});
|
|
27
|
+
return true;
|
|
28
|
+
} catch {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Spawn a child process with full stdio passthrough.
|
|
35
|
+
* Returns a promise that resolves with the exit code.
|
|
36
|
+
*/
|
|
37
|
+
function run(cmd, cmdArgs) {
|
|
38
|
+
return new Promise((resolve) => {
|
|
39
|
+
const child = spawn(cmd, cmdArgs, {
|
|
40
|
+
stdio: "inherit",
|
|
41
|
+
env: process.env,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
child.on("error", () => resolve(null));
|
|
45
|
+
child.on("close", (code) => resolve(code));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async function main() {
|
|
50
|
+
// Strategy 1: buildlog on PATH
|
|
51
|
+
if (commandExists("buildlog")) {
|
|
52
|
+
const code = await run("buildlog", args);
|
|
53
|
+
if (code !== null) process.exit(code);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Strategy 2: uvx buildlog (auto-downloads from PyPI)
|
|
57
|
+
if (commandExists("uvx")) {
|
|
58
|
+
const code = await run("uvx", ["buildlog", ...args]);
|
|
59
|
+
if (code !== null) process.exit(code);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Strategy 3: python -m buildlog
|
|
63
|
+
for (const python of ["python3", "python"]) {
|
|
64
|
+
if (commandExists(python)) {
|
|
65
|
+
const code = await run(python, ["-m", "buildlog", ...args]);
|
|
66
|
+
if (code !== null) process.exit(code);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Nothing worked
|
|
71
|
+
console.error(`buildlog: Python CLI not found.
|
|
72
|
+
|
|
73
|
+
Install buildlog (pick one):
|
|
74
|
+
pip install buildlog
|
|
75
|
+
uv tool install buildlog
|
|
76
|
+
pipx install buildlog
|
|
77
|
+
|
|
78
|
+
Or install Python: https://www.python.org/downloads/
|
|
79
|
+
|
|
80
|
+
The npm package is a thin wrapper around the Python CLI.
|
|
81
|
+
Python is required to run buildlog.`);
|
|
82
|
+
process.exit(127);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@peleke.s/buildlog",
|
|
3
|
+
"publishConfig": {
|
|
4
|
+
"access": "public"
|
|
5
|
+
},
|
|
6
|
+
"version": "0.9.0",
|
|
7
|
+
"description": "Engineering notebook for AI-assisted development. Capture your work as publishable content.",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/Peleke/buildlog-template.git",
|
|
12
|
+
"directory": "packages/buildlog-npm"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/Peleke/buildlog-template",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"buildlog",
|
|
17
|
+
"ai",
|
|
18
|
+
"development",
|
|
19
|
+
"engineering-notebook",
|
|
20
|
+
"claude",
|
|
21
|
+
"cursor",
|
|
22
|
+
"copilot",
|
|
23
|
+
"agent-rules"
|
|
24
|
+
],
|
|
25
|
+
"bin": {
|
|
26
|
+
"buildlog": "bin/buildlog.mjs"
|
|
27
|
+
},
|
|
28
|
+
"type": "module",
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"bin/",
|
|
34
|
+
"README.md"
|
|
35
|
+
]
|
|
36
|
+
}
|