@bb-labs/bldr 0.0.13 → 0.0.14

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.
@@ -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, prompts the user to install them.
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
  /**
@@ -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, prompts the user to install them.
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
- const shouldInstall = await promptYesNo("Would you like to install them now?");
69
- if (shouldInstall) {
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.13",
3
+ "version": "0.0.14",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "bldr": "./dist/index.js"