electrobun 1.14.3 → 1.14.5-beta.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 ADDED
@@ -0,0 +1,117 @@
1
+ <p align="center">
2
+ <a href="https://electrobun.dev"><img src="https://github.com/blackboardsh/electrobun/assets/75102186/8799b522-0507-45e9-86e3-c3cfded1aa7c" alt="Logo" height=170></a>
3
+ </p>
4
+
5
+ <h1 align="center">Electrobun</h1>
6
+
7
+ <div align="center">
8
+ Get started with a template <br />
9
+ <code><strong>npx electrobun init</strong></code>
10
+ </div>
11
+
12
+
13
+
14
+ ## What is Electrobun?
15
+
16
+ Electrobun aims to be a complete **solution-in-a-box** for building, updating, and shipping ultra fast, tiny, and cross-platform desktop applications written in Typescript.
17
+ Under the hood it uses <a href="https://bun.sh">bun</a> to execute the main process and to bundle webview typescript, and has native bindings written in <a href="https://ziglang.org/">zig</a>.
18
+
19
+ Visit <a href="https://blackboard.sh/electrobun/">https://blackboard.sh/electrobun/</a> to see api documentation, guides, and more.
20
+
21
+ **Project Goals**
22
+
23
+ - Write typescript for the main process and webviews without having to think about it.
24
+ - Isolation between main and webview processes with fast, typed, easy to implement RPC between them.
25
+ - Small self-extracting app bundles ~12MB (when using system webview, most of this is the bun runtime)
26
+ - Even smaller app updates as small as 14KB (using bsdiff it only downloads tiny patches between versions)
27
+ - Provide everything you need in one tightly integrated workflow to start writing code in 5 minutes and distribute in 10.
28
+
29
+ ## Apps Built with Electrobun
30
+ - [Audio TTS](https://github.com/blackboardsh/audio-tts) - desktop text-to-speech app using Qwen3-TTS for voice design, cloning, and generation
31
+ - [Co(lab)](https://blackboard.sh/colab/) - a hybrid web browser + code editor for deep work
32
+
33
+ ### Video Demos
34
+
35
+ [![Audio TTS Demo](https://img.youtube.com/vi/Z4dNK1d6l6E/maxresdefault.jpg)](https://www.youtube.com/watch?v=Z4dNK1d6l6E)
36
+
37
+ [![Co(lab) Demo](https://img.youtube.com/vi/WWTCqGmE86w/maxresdefault.jpg)](https://www.youtube.com/watch?v=WWTCqGmE86w)
38
+
39
+ ## Star History
40
+
41
+ [![Star History Chart](https://api.star-history.com/svg?repos=blackboardsh/electrobun&type=date&legend=top-left&cache=1)](https://www.star-history.com/#blackboardsh/electrobun&type=date&legend=top-left)
42
+
43
+ ## Contributing
44
+ Ways to get involved:
45
+
46
+ - Follow us on X for updates <a href="https://twitter.com/BlackboardTech">@BlackboardTech</a> or <a href="https://bsky.app/profile/yoav.codes">@yoav.codes</a>
47
+ - Join the conversation on <a href="https://discord.gg/ueKE4tjaCE">Discord</a>
48
+ - Create and participate in Github issues and discussions
49
+ - Let me know what you're building with Electrobun
50
+
51
+ ## Development Setup
52
+ Building apps with Electrobun is as easy as updating your package.json dependencies with `npm add electrobun` or try one of our templates via `npx electrobun init`.
53
+
54
+ **This section is for building Electrobun from source locally in order to contribute fixes to it.**
55
+
56
+ ### Prerequisites
57
+
58
+ **macOS:**
59
+ - Xcode command line tools
60
+ - cmake (install via homebrew: `brew install cmake`)
61
+
62
+ **Windows:**
63
+ - Visual Studio Build Tools or Visual Studio with C++ development tools
64
+ - cmake
65
+
66
+ **Linux:**
67
+ - build-essential package
68
+ - cmake
69
+ - webkit2gtk and GTK development packages
70
+
71
+ On Ubuntu/Debian based distros: `sudo apt install build-essential cmake pkg-config libgtk-3-dev libwebkit2gtk-4.1-dev libayatana-appindicator3-dev librsvg2-dev`
72
+
73
+ ### First-time Setup
74
+
75
+ ```bash
76
+ git clone --recurse-submodules https://github.com/blackboardsh/electrobun.git
77
+ cd electrobun/package
78
+ bun install
79
+ bun dev:clean
80
+ ```
81
+
82
+ ### Development Workflow
83
+
84
+ ```bash
85
+ # All commands are run from the /package directory
86
+ cd electrobun/package
87
+
88
+ # After making changes to source code
89
+ bun dev
90
+
91
+ # If you only changed kitchen sink code (not electrobun source)
92
+ bun dev:rerun
93
+
94
+ # If you need a completely fresh start
95
+ bun dev:clean
96
+ ```
97
+
98
+ ### Additional Commands
99
+
100
+ All commands are run from the `/package` directory:
101
+
102
+ - `bun dev:canary` - Build and run kitchen sink in canary mode
103
+ - `bun build:dev` - Build electrobun in development mode
104
+ - `bun build:release` - Build electrobun in release mode
105
+
106
+ ### Debugging
107
+
108
+ **macOS:** Use `lldb <path-to-bundle>/Contents/MacOS/launcher` and then `run` to debug release builds
109
+
110
+ ## Platform Support
111
+
112
+ | OS | Status |
113
+ |---|---|
114
+ | macOS 14+ | Official |
115
+ | Windows 11+ | Official |
116
+ | Ubuntu 22.04+ | Official |
117
+ | Other Linux distros (gtk3, webkit2gtk-4.1) | Community |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "electrobun",
3
- "version": "1.14.3",
3
+ "version": "1.14.5-beta.0",
4
4
  "description": "Build ultra fast, tiny, and cross-platform desktop apps with Typescript.",
5
5
  "license": "MIT",
6
6
  "author": "Blackboard Technologies Inc.",
@@ -35,8 +35,8 @@
35
35
  "dev:canary": "bun install && bun build:release && cd ../kitchen && bun install && bun build:canary",
36
36
  "dev:stable": "bun install && bun build:release && cd ../kitchen && bun install && bun build:stable",
37
37
  "build:docs:release": "cd ../documentation && bun run build",
38
- "npm:publish": "bun build:release && cp ../README.md . && npm publish && rm README.md",
39
- "npm:publish:beta": "bun build:release && cp ../README.md . && npm publish --tag beta && rm README.md",
38
+ "npm:publish": "bun build:release && npm publish",
39
+ "npm:publish:beta": "bun build:release && npm publish --tag beta",
40
40
  "typecheck": "bunx tsc --noEmit && cd ../kitchen && bunx tsc --noEmit",
41
41
  "push:beta": "bun run typecheck && bun scripts/push-version.js beta",
42
42
  "push:patch": "bun run typecheck && bun scripts/push-version.js patch",
package/src/cli/index.ts CHANGED
@@ -3640,6 +3640,8 @@ Categories=Utility;Application;
3640
3640
  let lastChangedFile = "";
3641
3641
  let debounceTimer: ReturnType<typeof setTimeout> | null = null;
3642
3642
  let shuttingDown = false;
3643
+ let isBuilding = false;
3644
+ let rebuildPending = false;
3643
3645
  let watchers: ReturnType<typeof watch>[] = [];
3644
3646
 
3645
3647
  function startWatchers() {
@@ -3674,9 +3676,25 @@ Categories=Utility;Application;
3674
3676
  async function triggerRebuild() {
3675
3677
  if (shuttingDown) return;
3676
3678
 
3679
+ // Guard against concurrent builds — if already building, mark
3680
+ // that another rebuild is needed and let the current one finish.
3681
+ if (isBuilding) {
3682
+ rebuildPending = true;
3683
+ return;
3684
+ }
3685
+ isBuilding = true;
3686
+ rebuildPending = false;
3687
+
3677
3688
  // Stop watching during build so build output doesn't trigger more events
3678
3689
  stopWatchers();
3679
3690
 
3691
+ // Cancel any lingering debounce timer that may have been queued
3692
+ // before stopWatchers took effect.
3693
+ if (debounceTimer) {
3694
+ clearTimeout(debounceTimer);
3695
+ debounceTimer = null;
3696
+ }
3697
+
3680
3698
  const changedDisplay = lastChangedFile
3681
3699
  ? lastChangedFile.replace(projectRoot + "/", "")
3682
3700
  : "unknown";
@@ -3712,10 +3730,17 @@ Categories=Utility;Application;
3712
3730
  console.log("[electrobun dev --watch] Waiting for file changes...");
3713
3731
  }
3714
3732
 
3733
+ isBuilding = false;
3734
+
3715
3735
  // Resume watching after build + hooks are done
3716
3736
  if (!shuttingDown) {
3717
3737
  startWatchers();
3718
3738
  }
3739
+
3740
+ // If a file change came in while we were building, rebuild again.
3741
+ if (rebuildPending && !shuttingDown) {
3742
+ triggerRebuild();
3743
+ }
3719
3744
  }
3720
3745
 
3721
3746
  function cleanup() {