You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/src/content/docs/api/app.md
+14-14Lines changed: 14 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,12 @@
1
1
---
2
2
title: "app"
3
-
description: "The application lifecycle controller in bunmaska - a drop-in equivalent of Electron's app for managing readiness, quitting, paths, locale, the single-instance lock, and macOS desktop integration."
3
+
description: "The application lifecycle controller in Bunmaska - a drop-in equivalent of Electron's app for managing readiness, quitting, paths, locale, the single-instance lock, and macOS desktop integration."
4
4
order: 1
5
5
---
6
6
7
7
Process: Main
8
8
9
-
The `app` module controls your application's event lifecycle. In bunmaska it is the drop-in equivalent of Electron's `app`: it tracks readiness, coordinates a clean quit, resolves the standard special directories, reports name/version/locale, manages the single-instance lock, and exposes the macOS desktop bits (dock, hide/show, about panel, badge). It extends Node's `EventEmitter`, so the full listener API (`on` / `once` / `addListener` / `removeListener` / `emit` / …) matches Electron's contract.
9
+
The `app` module controls your application's event lifecycle. In Bunmaska it is the drop-in equivalent of Electron's `app`: it tracks readiness, coordinates a clean quit, resolves the standard special directories, reports name/version/locale, manages the single-instance lock, and exposes the macOS desktop bits (dock, hide/show, about panel, badge). It extends Node's `EventEmitter`, so the full listener API (`on` / `once` / `addListener` / `removeListener` / `emit` / …) matches Electron's contract.
10
10
11
11
`app` is a singleton - import it; do not construct it.
12
12
@@ -49,7 +49,7 @@ if (!app.isReady()) {
49
49
50
50
Begins shutting the app down. Emits the cancelable `before-quit` event, then `will-quit`; if a listener calls `preventDefault()` on either, the quit is aborted. If neither vetoes, emits `quit` with the exit code and exits the process. Idempotent - a second call while already quitting is ignored.
51
51
52
-
Note: unlike Electron, bunmaska's `quit()` does not run web-page `beforeunload`/`unload` handlers as a veto path; the veto comes from your main-process `before-quit` / `will-quit` listeners.
52
+
Note: unlike Electron, Bunmaska's `quit()` does not run web-page `beforeunload`/`unload` handlers as a veto path; the veto comes from your main-process `before-quit` / `will-quit` listeners.
53
53
54
54
```ts
55
55
import { app } from'bunmaska'
@@ -106,7 +106,7 @@ console.log(app.getAppPath())
106
106
107
107
Returns `string` - a path to the special directory associated with `name`, honoring any override set via `setPath`.
108
108
109
-
bunmaska supports the common subset of Electron's names. It does **not** support `recent` (Windows-only in Electron anyway) or `assets`.
109
+
Bunmaska supports the common subset of Electron's names. It does **not** support `recent` (Windows-only in Electron anyway) or `assets`.
*`name` string - one of the names accepted by `getPath`.
121
121
*`path` string
122
122
123
-
Overrides the path returned by `getPath` for a given name. Unlike Electron, bunmaska does not validate that the directory exists - create it yourself if needed.
123
+
Overrides the path returned by `getPath` for a given name. Unlike Electron, Bunmaska does not validate that the directory exists - create it yourself if needed.
124
124
125
125
```ts
126
126
import { app } from'bunmaska'
@@ -184,7 +184,7 @@ console.log(app.getLocale()) // e.g. 'en-US'
184
184
185
185
### `app.getSystemLocale()`
186
186
187
-
Returns `string` - the system locale. In bunmaska this matches `getLocale()` (there is a single resolved host locale rather than Electron's separate Chromium/OS sources).
187
+
Returns `string` - the system locale. In Bunmaska this matches `getLocale()` (there is a single resolved host locale rather than Electron's separate Chromium/OS sources).
188
188
189
189
```ts
190
190
import { app } from'bunmaska'
@@ -274,7 +274,7 @@ import { app } from 'bunmaska'
274
274
app.showAboutPanel()
275
275
```
276
276
277
-
bunmaska does not implement `setAboutPanelOptions` - the panel uses platform defaults.
277
+
Bunmaska does not implement `setAboutPanelOptions` - the panel uses platform defaults.
278
278
279
279
### `app.setBadgeCount([count])`_macOS_
280
280
@@ -354,9 +354,9 @@ Returns:
354
354
355
355
*`event` Event
356
356
357
-
Emitted once, when bunmaska has finished initializing and is ready to create windows. Fires at most once. You can also call `isReady()` or use `whenReady()`.
357
+
Emitted once, when Bunmaska has finished initializing and is ready to create windows. Fires at most once. You can also call `isReady()` or use `whenReady()`.
358
358
359
-
Note: unlike Electron, bunmaska's `ready` does not carry a `launchInfo` argument.
359
+
Note: unlike Electron, Bunmaska's `ready` does not carry a `launchInfo` argument.
A `Dock | undefined` property - the macOS dock object, or `undefined` on other platforms. The bunmaska`Dock` is a small object with:
497
+
A `Dock | undefined` property - the macOS dock object, or `undefined` on other platforms. The Bunmaska`Dock` is a small object with:
498
498
499
499
*`setBadge(text: string): void` - set the dock badge text (`''` clears it).
500
500
*`getBadge(): string` - the current dock badge text.
@@ -509,15 +509,15 @@ app.dock?.setBadge('!')
509
509
app.dock?.bounce('critical')
510
510
```
511
511
512
-
## Not in bunmaska (yet)
512
+
## Not in Bunmaska (yet)
513
513
514
-
bunmaska implements the lifecycle, paths, metadata, locale, single-instance, and macOS desktop core of Electron's `app`. The following notable Electron members are **not** implemented:
514
+
Bunmaska implements the lifecycle, paths, metadata, locale, single-instance, and macOS desktop core of Electron's `app`. The following notable Electron members are **not** implemented:
515
515
516
516
-**`app.focus()`** - no programmatic app/window focus from the `app` module.
517
517
-**`app.getFileIcon()`** - no file-icon lookup.
518
518
-**Protocol-client APIs** - `setAsDefaultProtocolClient`, `removeAsDefaultProtocolClient`, `isDefaultProtocolClient`, `getApplicationNameForProtocol`, `getApplicationInfoForProtocol` are all absent.
-**GPU / hardware APIs** - `disableHardwareAcceleration`, `isHardwareAccelerationEnabled`, `disableDomainBlockingFor3DAPIs`, `getGPUFeatureStatus`, `getGPUInfo`, `getAppMetrics`. (bunmaska runs on system WebKit, not Chromium, so the `chrome://gpu`-shaped surface does not exist.)
520
+
-**GPU / hardware APIs** - `disableHardwareAcceleration`, `isHardwareAccelerationEnabled`, `disableDomainBlockingFor3DAPIs`, `getGPUFeatureStatus`, `getGPUInfo`, `getAppMetrics`. (Bunmaska runs on system WebKit, not Chromium, so the `chrome://gpu`-shaped surface does not exist.)
-**`getPath` names** - `recent` and `assets` are not supported.
528
528
-**Properties** - `commandLine`, `runningUnderARM64Translation`, and `accessibilitySupportEnabled` are not exposed.
529
-
-**Windows taskbar/jump-list APIs** - `setUserTasks`, `getJumpListSettings`, `setJumpList`, `setAppUserModelId`, `setToastActivatorCLSID`, and the `toastActivatorCLSID` property. (bunmaska runs on Windows, but these jump-list/taskbar extras are not wired on any platform yet.)
529
+
-**Windows taskbar/jump-list APIs** - `setUserTasks`, `getJumpListSettings`, `setJumpList`, `setAppUserModelId`, `setToastActivatorCLSID`, and the `toastActivatorCLSID` property. (Bunmaska runs on Windows, but these jump-list/taskbar extras are not wired on any platform yet.)
530
530
-**Events** - many Electron `app` events are not emitted by this module, including `will-finish-launching`, `certificate-error`, `select-client-certificate`, `login`, `gpu-info-update`, `render-process-gone`, `child-process-gone`, `accessibility-support-changed`, `session-created`, and the macOS `did-become-active` / `did-resign-active` / `new-window-for-tab` events. Some cross-cutting events that Electron raises on `app` (e.g. `activate`, `open-url`, `open-file`, `browser-window-created`/`-focus`/`-blur`, `web-contents-created`) are reserved as listenable names but are emitted by the window/web-contents subsystems rather than by this module - consult those modules' docs for current coverage.
Copy file name to clipboardExpand all lines: website/src/content/docs/api/auto-updater.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,15 @@
1
1
---
2
2
title: "autoUpdater"
3
-
description: "Application self-update for bunmaska on macOS, Linux, and Windows: an explicit check/download/verify flow over a version.json feed, with no Squirrel and an experimental install step everywhere."
3
+
description: "Application self-update for Bunmaska on macOS, Linux, and Windows: an explicit check/download/verify flow over a version.json feed, with no Squirrel and an experimental install step everywhere."
4
4
order: 23
5
5
---
6
6
7
-
Enables bunmaska apps to update themselves from a channel feed that `bunmaska build` produces. It is a drop-in subset of Electron's `autoUpdater`, but built on plain Bun rather than Squirrel: it reads an `update.json` manifest, compares versions, downloads + integrity-checks the artifact (size and wyhash), decompresses (zstd) and stages a `.tar`, then relaunches via an installer seam.
7
+
Enables Bunmaska apps to update themselves from a channel feed that `bunmaska build` produces. It is a drop-in subset of Electron's `autoUpdater`, but built on plain Bun rather than Squirrel: it reads an `update.json` manifest, compares versions, downloads + integrity-checks the artifact (size and wyhash), decompresses (zstd) and stages a `.tar`, then relaunches via an installer seam.
8
8
9
9
Process: Main. The `autoUpdater` singleton is a Node.js [`EventEmitter`](https://nodejs.org/api/events.html). Two things that differ from Electron up front, so you don't get surprised:
10
10
11
11
- The flow is **electron-updater style**, not Electron-core style. `checkForUpdates()` does *not* download automatically - you call `downloadUpdate()` yourself once an update is available.
12
-
- The check/download/verify/stage pipeline works on **all three platforms bunmaska targets - macOS, Linux, and Windows**. There is no Squirrel anywhere in this module. The one caveat is the final **install** step: it is an **experimental stub on every platform** (no Squirrel.Mac, no Squirrel.Windows), so apps are expected to supply their own installer for deterministic results (see _Replacing the installer_).
12
+
- The check/download/verify/stage pipeline works on **all three platforms Bunmaska targets - macOS, Linux, and Windows**. There is no Squirrel anywhere in this module. The one caveat is the final **install** step: it is an **experimental stub on every platform** (no Squirrel.Mac, no Squirrel.Windows), so apps are expected to supply their own installer for deterministic results (see _Replacing the installer_).
Sets the base URL of the channel feed - the directory where `update.json` and the build artifacts live. Accepts either an options object or a bare string. Throws if the URL is missing or empty.
33
33
34
-
Note the shape: bunmaska accepts only a `url`. Electron's `headers`, `serverType`, and `allowAnyVersion` options are not implemented (the feed is a static directory + JSON, so there's nothing to authenticate or negotiate).
34
+
Note the shape: Bunmaska accepts only a `url`. Electron's `headers`, `serverType`, and `allowAnyVersion` options are not implemented (the feed is a static directory + JSON, so there's nothing to authenticate or negotiate).
Installs the staged update and relaunches, via the installer seam. Throws if nothing has been downloaded - call `downloadUpdate()` first. Should only be called after `update-downloaded` has been emitted.
106
106
107
-
> **Note:** the default installer is **EXPERIMENTAL on every platform** (macOS, Linux, and Windows alike). It hands the staged tar to a best-effort, platform-specific swap-and-relaunch and is the one step not exercised by bunmaska's test suite. Apps that need deterministic installs should inject their own installer (see _Replacing the installer_ below). _macOS_, _Linux_, and _Windows_ bundle layouts differ, which is exactly why this step is fenced off.
107
+
> **Note:** the default installer is **EXPERIMENTAL on every platform** (macOS, Linux, and Windows alike). It hands the staged tar to a best-effort, platform-specific swap-and-relaunch and is the one step not exercised by Bunmaska's test suite. Apps that need deterministic installs should inject their own installer (see _Replacing the installer_ below). _macOS_, _Linux_, and _Windows_ bundle layouts differ, which is exactly why this step is fenced off.
108
108
109
109
```ts
110
110
import { autoUpdater } from'bunmaska';
@@ -168,7 +168,7 @@ Returns:
168
168
169
169
Emitted after `downloadUpdate()` has fetched, verified, and staged the update. Call `quitAndInstall()` to apply it.
170
170
171
-
Note the payload differs from Electron: bunmaska emits a single `UpdateInfo` object. Electron's `releaseNotes`, `releaseDate`, and `updateURL` fields are not present, because the `version.json` manifest does not carry them.
171
+
Note the payload differs from Electron: Bunmaska emits a single `UpdateInfo` object. Electron's `releaseNotes`, `releaseDate`, and `updateURL` fields are not present, because the `version.json` manifest does not carry them.
172
172
173
173
```ts
174
174
import { autoUpdater } from'bunmaska';
@@ -224,13 +224,13 @@ const updater = new AutoUpdaterImpl({
224
224
225
225
`setDepsForTesting()` exists too, but as the name says, it is for tests - don't reach for it in app code.
226
226
227
-
## Not in bunmaska (yet)
227
+
## Not in Bunmaska (yet)
228
228
229
229
Compared to Electron's `autoUpdater`, the following are intentionally absent:
230
230
231
-
-**Squirrel.Windows / MSIX** - bunmaska runs the same plain tar + zstd pipeline on Windows as elsewhere, so there is no Squirrel.Windows, no MSIX detection, no `allowAnyVersion` downgrade option, and no `--squirrel-firstrun` handling. The check/download/verify/stage steps work on Windows; only the final install is the experimental cross-platform stub.
231
+
-**Squirrel.Windows / MSIX** - Bunmaska runs the same plain tar + zstd pipeline on Windows as elsewhere, so there is no Squirrel.Windows, no MSIX detection, no `allowAnyVersion` downgrade option, and no `--squirrel-firstrun` handling. The check/download/verify/stage steps work on Windows; only the final install is the experimental cross-platform stub.
232
232
-**Squirrel.Mac** - even on macOS there is no Squirrel. Integrity is a wyhash content hash + byte-length check against the manifest, and you are responsible for code-signing the swapped bundle yourself.
233
233
-**Event: `before-quit-for-update`** - not emitted. `quitAndInstall()` goes straight through the installer seam (the default calls `app.quit()`).
234
-
-**Automatic download** - Electron downloads as soon as an update is available; bunmaska makes it an explicit `downloadUpdate()` call (electron-updater style). This is a deliberate behavioral difference, not a missing feature.
234
+
-**Automatic download** - Electron downloads as soon as an update is available; Bunmaska makes it an explicit `downloadUpdate()` call (electron-updater style). This is a deliberate behavioral difference, not a missing feature.
235
235
-**`setFeedURL` options `headers`, `serverType`, `allowAnyVersion`** - only `{ url }` (or a bare string) is accepted. The feed is a static directory, so there's nothing to send headers to or negotiate a server type with.
236
236
-**Rich `update-downloaded` payload** - `releaseNotes`, `releaseName` as a standalone arg, `releaseDate`, and `updateURL` are not provided. You get a single `UpdateInfo` (`version`, `releaseName`); the `version.json` manifest carries nothing more.
0 commit comments