braeburn 1.2.2 → 1.3.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/dist/ui/state.js CHANGED
@@ -1,14 +1,14 @@
1
- export function createInitialAppState(steps, version, showLogo) {
1
+ export function createInitialAppState(steps, version, logoVisibility) {
2
2
  return {
3
3
  steps,
4
4
  version,
5
- showLogo,
5
+ logoVisibility,
6
6
  currentStepIndex: 0,
7
7
  currentPhase: "checking-availability",
8
8
  completedStepRecords: [],
9
9
  currentOutputLines: [],
10
10
  currentPrompt: undefined,
11
- isFinished: false,
11
+ runCompletion: "in-progress",
12
12
  versionReport: undefined,
13
13
  };
14
14
  }
@@ -0,0 +1,6 @@
1
+ type TerminalOptions = {
2
+ output?: NodeJS.WritableStream;
3
+ };
4
+ type CursorCleanup = () => void;
5
+ export declare function hideCursorDuringExecution(options?: TerminalOptions): CursorCleanup;
6
+ export {};
@@ -0,0 +1,16 @@
1
+ export function hideCursorDuringExecution(options = {}) {
2
+ const output = options.output ?? process.stdout;
3
+ output.write("\x1b[?25l");
4
+ const restoreOnExit = () => output.write("\x1b[?25h");
5
+ const restoreAndExitOnInterrupt = () => {
6
+ output.write("\x1b[?25h\n");
7
+ process.exit(130);
8
+ };
9
+ process.on("exit", restoreOnExit);
10
+ process.on("SIGINT", restoreAndExitOnInterrupt);
11
+ return () => {
12
+ process.removeListener("exit", restoreOnExit);
13
+ process.removeListener("SIGINT", restoreAndExitOnInterrupt);
14
+ output.write("\x1b[?25h");
15
+ };
16
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braeburn",
3
- "version": "1.2.2",
3
+ "version": "1.3.0",
4
4
  "description": "macOS system updater CLI",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,6 +17,8 @@
17
17
  "postbuild": "chmod +x dist/index.js",
18
18
  "dev": "tsx src/index.ts",
19
19
  "start": "node dist/index.js",
20
+ "test": "vitest run",
21
+ "test:watch": "vitest",
20
22
  "prepublishOnly": "npm run build"
21
23
  },
22
24
  "dependencies": {
@@ -28,6 +30,7 @@
28
30
  "devDependencies": {
29
31
  "@types/node": "^24.0.0",
30
32
  "tsx": "^4.7.0",
31
- "typescript": "^5.5.0"
33
+ "typescript": "^5.5.0",
34
+ "vitest": "^4.0.18"
32
35
  }
33
36
  }