@bb-labs/bldr 0.0.13 → 0.0.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/README.md +1 -11
- package/dist/utils/process.d.ts +1 -2
- package/dist/utils/process.js +3 -27
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ A TypeScript build tool with watch mode, automatic dist synchronization, and spl
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
bun add -d @bb-labs/bldr
|
|
8
|
+
bun add -d @bb-labs/bldr
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
@@ -32,16 +32,6 @@ bun add -d @bb-labs/bldr tsc-alias typescript
|
|
|
32
32
|
- **Ctrl+L**: Jump all panels to the bottom
|
|
33
33
|
- **Ctrl+C/Escape/Q**: Exit the application
|
|
34
34
|
|
|
35
|
-
## Testing
|
|
36
|
-
|
|
37
|
-
Run `bun run test:dev` to test the build tool with the included test files in `test-src/`. This will:
|
|
38
|
-
|
|
39
|
-
- Build files from `test-src/` to `test-dist/`
|
|
40
|
-
- Show the split-terminal UI with real-time updates
|
|
41
|
-
- Watch for changes and rebuild automatically
|
|
42
|
-
|
|
43
|
-
Add or modify files in `test-src/` to see the build tool in action!
|
|
44
|
-
|
|
45
35
|
## Features
|
|
46
36
|
|
|
47
37
|
- **Split Terminal UI**: In watch mode, displays three panels side by side showing output from TypeScript compiler, tsc-alias, and bldr itself
|
package/dist/utils/process.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { type ChildProcess } from "node:child_process";
|
|
2
2
|
/**
|
|
3
3
|
* Checks if required dependencies (tsc, tsc-alias) are available.
|
|
4
|
-
* If not,
|
|
5
|
-
* Returns true if dependencies are available, false if user declined to install.
|
|
4
|
+
* If not, automatically installs them.
|
|
6
5
|
*/
|
|
7
6
|
export declare function checkDependencies(): Promise<boolean>;
|
|
8
7
|
/**
|
package/dist/utils/process.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { spawn, spawnSync } from "node:child_process";
|
|
2
|
-
import * as readline from "node:readline";
|
|
3
2
|
/**
|
|
4
3
|
* Checks if a command is available in the PATH.
|
|
5
4
|
*/
|
|
@@ -7,23 +6,6 @@ function commandExists(cmd) {
|
|
|
7
6
|
const result = spawnSync("which", [cmd], { stdio: "pipe" });
|
|
8
7
|
return result.status === 0;
|
|
9
8
|
}
|
|
10
|
-
/**
|
|
11
|
-
* Prompts the user for yes/no input. Defaults to yes on empty input.
|
|
12
|
-
*/
|
|
13
|
-
async function promptYesNo(question) {
|
|
14
|
-
const rl = readline.createInterface({
|
|
15
|
-
input: process.stdin,
|
|
16
|
-
output: process.stdout,
|
|
17
|
-
});
|
|
18
|
-
return new Promise((resolve) => {
|
|
19
|
-
rl.question(`${question} [Y/n]: `, (answer) => {
|
|
20
|
-
rl.close();
|
|
21
|
-
const normalized = answer.trim().toLowerCase();
|
|
22
|
-
// Empty or 'y' or 'yes' = true, anything else = false
|
|
23
|
-
resolve(normalized === "" || normalized === "y" || normalized === "yes");
|
|
24
|
-
});
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
9
|
/**
|
|
28
10
|
* Installs missing dependencies using bun.
|
|
29
11
|
*/
|
|
@@ -50,8 +32,7 @@ async function installDeps(deps) {
|
|
|
50
32
|
}
|
|
51
33
|
/**
|
|
52
34
|
* Checks if required dependencies (tsc, tsc-alias) are available.
|
|
53
|
-
* If not,
|
|
54
|
-
* Returns true if dependencies are available, false if user declined to install.
|
|
35
|
+
* If not, automatically installs them.
|
|
55
36
|
*/
|
|
56
37
|
export async function checkDependencies() {
|
|
57
38
|
const missing = [];
|
|
@@ -65,13 +46,8 @@ export async function checkDependencies() {
|
|
|
65
46
|
return true;
|
|
66
47
|
}
|
|
67
48
|
console.log(`\n⚠️ Missing required dependencies: ${missing.join(", ")}`);
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
await installDeps(missing);
|
|
71
|
-
return true;
|
|
72
|
-
}
|
|
73
|
-
console.log(`\n❌ Please install missing dependencies manually:\n bun add -d ${missing.join(" ")}\n`);
|
|
74
|
-
return false;
|
|
49
|
+
await installDeps(missing);
|
|
50
|
+
return true;
|
|
75
51
|
}
|
|
76
52
|
/**
|
|
77
53
|
* Runs a command and returns a promise that resolves when the command finishes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bb-labs/bldr",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"bldr": "./dist/index.js"
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc",
|
|
13
13
|
"postbuild": "chmod +x dist/index.js",
|
|
14
|
-
"test:build": "node dist/index.js --project test
|
|
15
|
-
"test:watch": "node dist/index.js --watch --project test
|
|
14
|
+
"test:build": "node dist/index.js --project test/tsconfig.json",
|
|
15
|
+
"test:watch": "node dist/index.js --watch --project test/tsconfig.json",
|
|
16
16
|
"clean": "rm -rf node_modules bun.lock dist"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|