electrobun 1.18.4-beta.17 → 1.18.4-beta.19
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 +23 -9
- package/bin/electrobun.cjs +165 -0
- package/dash.config.ts +4 -4
- package/dist/api/browser/global.d.ts +2 -0
- package/dist/api/browser/webviewtag.ts +14 -7
- package/dist/api/browser/wgputag.ts +1 -1
- package/dist/api/config/ElectrobunConfig.ts +11 -49
- package/dist/api/preload/.generated/compiled.ts +2 -2
- package/dist/api/preload/events.test.ts +20 -0
- package/dist/api/preload/events.ts +9 -0
- package/dist/api/preload/index-sandboxed.ts +2 -0
- package/dist/api/preload/index.ts +2 -6
- package/dist/api/sdks/{bun → main}/core/BuildConfig.ts +0 -2
- package/dist/api/shared/bridge-payload-ownership.test.ts +1 -1
- package/dist/api/shared/linux-tray-contract.test.ts +4 -4
- package/dist/api/shared/package-exports.test.ts +59 -31
- package/dist/api/shared/published-package-contract.test.ts +8 -3
- package/dist/api/shared/spell-check.test.js +2 -2
- package/dist/api/shared/window-visibility.test.ts +2 -2
- package/dist/api/shared/windows-unicode-ui.test.ts +1 -1
- package/dist/preload-full.js +6 -3
- package/dist/preload-sandboxed.js +6 -0
- package/package.json +40 -20
- /package/dist/api/sdks/{bun → main}/__tests__/build-config.test.ts +0 -0
- /package/dist/api/sdks/{bun → main}/__tests__/ffi-contract.test.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/ApplicationMenu.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/BrowserView.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/BrowserWindow.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/ContextMenu.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/GpuWindow.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/Paths.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/Socket.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/Tray.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/Updater.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/Utils.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/WGPUView.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/WindowsUpdateTask.test.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/WindowsUpdateTask.ts +0 -0
- /package/dist/api/sdks/{bun → main}/core/menuRoles.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/app-menu.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/browser-view.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/browser-window.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/build-config.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/context-menu.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/events.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/gpu-window.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/native.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/paths.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/rpc.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/socket.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/tray.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/updater.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/utils.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/webgpu.ts +0 -0
- /package/dist/api/sdks/{bun → main}/entries/wgpu-view.ts +0 -0
- /package/dist/api/sdks/{bun → main}/events/ApplicationEvents.ts +0 -0
- /package/dist/api/sdks/{bun → main}/events/event.ts +0 -0
- /package/dist/api/sdks/{bun → main}/events/eventEmitter.ts +0 -0
- /package/dist/api/sdks/{bun → main}/events/trayEvents.ts +0 -0
- /package/dist/api/sdks/{bun → main}/events/webviewEvents.ts +0 -0
- /package/dist/api/sdks/{bun → main}/events/windowEvents.ts +0 -0
- /package/dist/api/sdks/{bun → main}/index.ts +0 -0
- /package/dist/api/sdks/{bun → main}/proc/eventBridge.test.ts +0 -0
- /package/dist/api/sdks/{bun → main}/proc/eventBridge.ts +0 -0
- /package/dist/api/sdks/{bun → main}/proc/linux.md +0 -0
- /package/dist/api/sdks/{bun → main}/proc/native.ts +0 -0
- /package/dist/api/sdks/{bun → main}/webGPU.ts +0 -0
- /package/dist/api/sdks/{bun → main}/webgpuAdapter.ts +0 -0
- /package/dist/api/sdks/{bun → main}/webgpuRenderPass.test.ts +0 -0
- /package/dist/api/sdks/{bun → main}/webgpuRenderPass.ts +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<a href="https://electrobun
|
|
2
|
+
<a href="https://framework.blackboard.sh/electrobun/"><img src="https://github.com/blackboardsh/electrobun/assets/75102186/8799b522-0507-45e9-86e3-c3cfded1aa7c" alt="Logo" height=170></a>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">Electrobun</h1>
|
|
@@ -13,28 +13,42 @@
|
|
|
13
13
|
|
|
14
14
|
## What is Electrobun?
|
|
15
15
|
|
|
16
|
-
Electrobun aims to be a complete **solution-in-a-box** for building, updating, and shipping
|
|
17
|
-
|
|
16
|
+
Electrobun aims to be a complete **solution-in-a-box** for building, updating, and shipping fast, compact, cross-platform desktop applications written in TypeScript.
|
|
17
|
+
Hutch is the native build and package-management CLI. Cottontail is Electrobun's JSC-based default JavaScript runtime. Electrobun's platform layer combines Zig, Objective-C, and C++.
|
|
18
18
|
|
|
19
19
|
Visit <a href="https://framework.blackboard.sh/electrobun/">https://framework.blackboard.sh/electrobun/</a> to see api documentation, guides, and more.
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Install Hutch globally, then use it to create a project, install the npm package that provides Electrobun's SDKs, and build the application:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
curl -fsSL https://hutch.blackboard.sh/hutch/install.sh | sh
|
|
25
|
+
hutch electrobun init
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Or bootstrap the same interactive initializer from npm or Bun. This installs
|
|
29
|
+
Hutch when it is not already available:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx electrobun init
|
|
33
|
+
# or
|
|
34
|
+
bunx electrobun init
|
|
35
|
+
```
|
|
22
36
|
|
|
23
37
|
Don't miss our:
|
|
24
|
-
- self-extracting bundles that use
|
|
25
|
-
-
|
|
38
|
+
- self-extracting bundles that use Zstandard compression for compact distributables
|
|
39
|
+
- a Zig-optimized BSDIFF implementation that can produce kilobyte-scale updates
|
|
26
40
|
- `bundleCEF` flag to bundle and pin Chromium for those that want that tradeoff of consistency over file size
|
|
27
41
|
- `bundleWGPU` that lets you use Bun Typescript -> WGPU to control a native GPU surface without a webview
|
|
28
42
|
- Our Three.js and Babylon.js adapters that work directly in the Cottontail main process
|
|
29
|
-
- Our `<electrobun-webview>` and `<electrobun-
|
|
43
|
+
- Our `<electrobun-webview>` and `<electrobun-wgpu>` HTML elements that let you composite isolated webviews and native GPU surfaces into your UIs
|
|
30
44
|
- so much more.
|
|
31
45
|
|
|
32
46
|
**Project Goals**
|
|
33
47
|
|
|
34
48
|
- Write typescript for the main process and webviews without having to think about it.
|
|
35
49
|
- Isolation between main and webview processes with fast, typed, easy to implement RPC between them.
|
|
36
|
-
- Small self-extracting app bundles
|
|
37
|
-
-
|
|
50
|
+
- Small self-extracting app bundles when using the system webview
|
|
51
|
+
- Small updates that use binary patches before falling back to a compressed full download
|
|
38
52
|
- Provide everything you need in one tightly integrated workflow to start writing code in 5 minutes and distribute in 10.
|
|
39
53
|
|
|
40
54
|
## Apps Built with Electrobun
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { existsSync, mkdtempSync, rmSync, writeFileSync } = require("node:fs");
|
|
5
|
+
const { get } = require("node:https");
|
|
6
|
+
const { homedir, tmpdir } = require("node:os");
|
|
7
|
+
const path = require("node:path");
|
|
8
|
+
const { spawnSync } = require("node:child_process");
|
|
9
|
+
|
|
10
|
+
const packageVersion = require("../package.json").version;
|
|
11
|
+
const installerBaseUrl = "https://hutch.blackboard.sh/hutch";
|
|
12
|
+
const maxInstallerBytes = 1024 * 1024;
|
|
13
|
+
|
|
14
|
+
function normalizeChannel(value) {
|
|
15
|
+
if (value === "stable") return "production";
|
|
16
|
+
if (value === "production" || value === "canary") return value;
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function channelForVersion(version, environment) {
|
|
21
|
+
for (const key of ["ELECTROBUN_HUTCH_CHANNEL", "HUTCH_ACTIVE_CHANNEL"]) {
|
|
22
|
+
const selected = normalizeChannel(environment[key]);
|
|
23
|
+
if (selected) return selected;
|
|
24
|
+
}
|
|
25
|
+
return version.includes("-") ? "canary" : "production";
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function hutchBinaryPath(channel, environment, platform, userHome) {
|
|
29
|
+
if (environment.ELECTROBUN_HUTCH_BINARY) {
|
|
30
|
+
return environment.ELECTROBUN_HUTCH_BINARY;
|
|
31
|
+
}
|
|
32
|
+
const dashHome = environment.DASH_HOME || path.join(userHome, ".dash");
|
|
33
|
+
const command = channel === "canary" ? "hutch-canary" : "hutch";
|
|
34
|
+
const pathApi = platform === "win32" ? path.win32 : path.posix;
|
|
35
|
+
return pathApi.join(dashHome, "bin", `${command}${platform === "win32" ? ".exe" : ""}`);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function download(url, redirects = 0) {
|
|
39
|
+
if (redirects > 5) return Promise.reject(new Error("too many installer redirects"));
|
|
40
|
+
return new Promise((resolve, reject) => {
|
|
41
|
+
const request = get(url, (response) => {
|
|
42
|
+
if (response.statusCode >= 300 && response.statusCode < 400 && response.headers.location) {
|
|
43
|
+
response.resume();
|
|
44
|
+
resolve(download(new URL(response.headers.location, url).href, redirects + 1));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (response.statusCode !== 200) {
|
|
48
|
+
response.resume();
|
|
49
|
+
reject(new Error(`installer download returned HTTP ${response.statusCode}`));
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const chunks = [];
|
|
54
|
+
let size = 0;
|
|
55
|
+
response.on("data", (chunk) => {
|
|
56
|
+
size += chunk.length;
|
|
57
|
+
if (size > maxInstallerBytes) {
|
|
58
|
+
request.destroy(new Error("installer download exceeded 1 MiB"));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
chunks.push(chunk);
|
|
62
|
+
});
|
|
63
|
+
response.on("end", () => resolve(Buffer.concat(chunks)));
|
|
64
|
+
});
|
|
65
|
+
request.on("error", reject);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function checkedSpawn(command, args, options) {
|
|
70
|
+
const result = spawnSync(command, args, options);
|
|
71
|
+
if (result.error) throw result.error;
|
|
72
|
+
if (result.status !== 0) {
|
|
73
|
+
throw new Error(`${command} exited with status ${result.status ?? "unknown"}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
async function installHutch({ channel, environment, platform }) {
|
|
78
|
+
const temporary = mkdtempSync(path.join(tmpdir(), "electrobun-hutch-"));
|
|
79
|
+
try {
|
|
80
|
+
if (platform === "win32") {
|
|
81
|
+
const installer = path.join(temporary, "install.ps1");
|
|
82
|
+
writeFileSync(installer, await download(`${installerBaseUrl}/install.ps1`));
|
|
83
|
+
checkedSpawn(
|
|
84
|
+
"powershell.exe",
|
|
85
|
+
[
|
|
86
|
+
"-NoProfile",
|
|
87
|
+
"-NonInteractive",
|
|
88
|
+
"-ExecutionPolicy",
|
|
89
|
+
"Bypass",
|
|
90
|
+
"-File",
|
|
91
|
+
installer,
|
|
92
|
+
"-Channel",
|
|
93
|
+
channel,
|
|
94
|
+
],
|
|
95
|
+
{ env: environment, stdio: "inherit" },
|
|
96
|
+
);
|
|
97
|
+
} else {
|
|
98
|
+
const installer = path.join(temporary, "install.sh");
|
|
99
|
+
writeFileSync(installer, await download(`${installerBaseUrl}/install.sh`), {
|
|
100
|
+
mode: 0o700,
|
|
101
|
+
});
|
|
102
|
+
checkedSpawn("sh", [installer, "--channel", channel], {
|
|
103
|
+
env: environment,
|
|
104
|
+
stdio: "inherit",
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
} finally {
|
|
108
|
+
rmSync(temporary, { force: true, recursive: true });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function runHutch({ binary, args, environment }) {
|
|
113
|
+
const result = spawnSync(binary, ["electrobun", ...args], {
|
|
114
|
+
env: environment,
|
|
115
|
+
stdio: "inherit",
|
|
116
|
+
});
|
|
117
|
+
if (result.error) throw result.error;
|
|
118
|
+
if (result.status !== null) return result.status;
|
|
119
|
+
return result.signal === "SIGINT" ? 130 : result.signal === "SIGTERM" ? 143 : 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
async function main(options = {}) {
|
|
123
|
+
const args = options.args || process.argv.slice(2);
|
|
124
|
+
if (args[0] !== "init") {
|
|
125
|
+
throw new Error(
|
|
126
|
+
"the npm entry point supports only `electrobun init`; use `hutch electrobun` for project commands",
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
const environment = options.environment || process.env;
|
|
130
|
+
const platform = options.platform || process.platform;
|
|
131
|
+
const version = options.version || packageVersion;
|
|
132
|
+
const userHome = options.userHome || homedir();
|
|
133
|
+
const fileExists = options.existsSync || existsSync;
|
|
134
|
+
const install = options.installHutch || installHutch;
|
|
135
|
+
const run = options.runHutch || runHutch;
|
|
136
|
+
const channel = channelForVersion(version, environment);
|
|
137
|
+
const binary = hutchBinaryPath(channel, environment, platform, userHome);
|
|
138
|
+
|
|
139
|
+
if (!fileExists(binary)) {
|
|
140
|
+
if (environment.ELECTROBUN_HUTCH_BINARY) {
|
|
141
|
+
throw new Error(`ELECTROBUN_HUTCH_BINARY does not exist: ${binary}`);
|
|
142
|
+
}
|
|
143
|
+
console.error(`Electrobun requires Hutch; installing the latest ${channel} release...`);
|
|
144
|
+
await install({ channel, environment, platform });
|
|
145
|
+
}
|
|
146
|
+
if (!fileExists(binary)) throw new Error(`Hutch was not installed at ${binary}`);
|
|
147
|
+
return run({ binary, args, environment });
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (require.main === module) {
|
|
151
|
+
main()
|
|
152
|
+
.then((status) => {
|
|
153
|
+
process.exitCode = status;
|
|
154
|
+
})
|
|
155
|
+
.catch((error) => {
|
|
156
|
+
console.error(`electrobun: ${error.message}`);
|
|
157
|
+
process.exitCode = 1;
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
module.exports = {
|
|
162
|
+
channelForVersion,
|
|
163
|
+
hutchBinaryPath,
|
|
164
|
+
main,
|
|
165
|
+
};
|
package/dash.config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// @dash cli=0.5.0-canary.
|
|
1
|
+
// @dash cli=0.5.0-canary.9 cottontail=0.2.3
|
|
2
2
|
export default {
|
|
3
3
|
scripts: {
|
|
4
|
-
start: "hutch src/sdks/
|
|
4
|
+
start: "hutch src/sdks/main/index.ts",
|
|
5
5
|
"check-zig-version": "vendors/zig/zig version",
|
|
6
6
|
"check-rust-version": "vendors/rust/bin/rustc --version",
|
|
7
7
|
"build:dev": "hutch build.ts",
|
|
@@ -34,7 +34,7 @@ export default {
|
|
|
34
34
|
"test:windows-ui-native": "hutch scripts/test-windows-ui-native.js",
|
|
35
35
|
"test:windows-ui-native-integration":
|
|
36
36
|
"hutch scripts/test-windows-ui-native.js --require-native-wrapper",
|
|
37
|
-
"test:unit": "node scripts/run-cottontail-test.js src/shared src/sdks/
|
|
37
|
+
"test:unit": "node scripts/run-cottontail-test.js src/shared src/sdks/main src/config src/preload && hutch test:dialog-paths-native && hutch test:linux-dpi-native && hutch test:linux-x11-geometry-native && hutch test:views-url-native && hutch test:webview2-permissions && hutch test:windows-ui-native",
|
|
38
38
|
"test:linux-native-dialog":
|
|
39
39
|
"node scripts/run-cottontail-test.js src/shared/linux-native-file-dialog.test.ts && scripts/test-linux-native-file-dialog.sh",
|
|
40
40
|
"test:cef-debug": "scripts/test-cef-remote-debugging.ts",
|
|
@@ -46,7 +46,7 @@ export default {
|
|
|
46
46
|
"test:deployment-target": "node scripts/run-cottontail-test.js scripts/verify-macho-deployment-target.test.ts",
|
|
47
47
|
"test:linux-abi": "node scripts/run-cottontail-test.js scripts/verify-linux-elf-abi.test.ts",
|
|
48
48
|
"test:linux-extractor": "node scripts/test-linux-adjacent-extractor.mjs",
|
|
49
|
-
"test:npm-bootstrap": "node scripts/run-cottontail-test.js bin/npm-bootstrap
|
|
49
|
+
"test:npm-bootstrap": "node scripts/run-cottontail-test.js bin/npm-bootstrap.test.ts",
|
|
50
50
|
"test:release-notes": "node scripts/release-notes-contract.test.mjs",
|
|
51
51
|
"test:spell-check": "node --test src/shared/spell-check.test.js",
|
|
52
52
|
"test:macos-spell-check": "scripts/test-macos-spell-check.sh",
|
|
@@ -19,6 +19,7 @@ interface MessageHandler {
|
|
|
19
19
|
|
|
20
20
|
declare global {
|
|
21
21
|
interface Window {
|
|
22
|
+
__electrobunPlatform: "linux" | "macos" | "windows";
|
|
22
23
|
__electrobunWebviewId: number;
|
|
23
24
|
__electrobunWindowId: number;
|
|
24
25
|
__electrobunRpcSocketPort: number;
|
|
@@ -31,6 +32,7 @@ declare global {
|
|
|
31
32
|
__electrobunInternalBridge?: MessageHandler;
|
|
32
33
|
__electrobunHostBridge?: MessageHandler;
|
|
33
34
|
__electrobunBunBridge?: MessageHandler;
|
|
35
|
+
__electrobunSendToHost: (message: unknown) => void;
|
|
34
36
|
}
|
|
35
37
|
}
|
|
36
38
|
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import "./global.d.ts";
|
|
2
2
|
|
|
3
3
|
type WebviewEventTypes =
|
|
4
|
+
| "will-navigate"
|
|
4
5
|
| "did-navigate"
|
|
5
6
|
| "did-navigate-in-page"
|
|
6
7
|
| "did-commit-navigation"
|
|
7
8
|
| "dom-ready"
|
|
8
9
|
| "host-message"
|
|
9
|
-
| "new-window-open"
|
|
10
|
+
| "new-window-open"
|
|
11
|
+
| "download-started"
|
|
12
|
+
| "download-progress"
|
|
13
|
+
| "download-completed"
|
|
14
|
+
| "download-failed"
|
|
15
|
+
| "load-started"
|
|
16
|
+
| "load-committed"
|
|
17
|
+
| "load-finished";
|
|
10
18
|
|
|
11
19
|
/**
|
|
12
20
|
* Interface representing an <electrobun-webview> custom element.
|
|
@@ -19,14 +27,13 @@ type WebviewEventTypes =
|
|
|
19
27
|
*/
|
|
20
28
|
interface WebviewTagElement extends HTMLElement {
|
|
21
29
|
// Properties
|
|
22
|
-
webviewId
|
|
30
|
+
webviewId: number | null;
|
|
23
31
|
maskSelectors: Set<string>;
|
|
24
32
|
transparent: boolean;
|
|
25
33
|
passthroughEnabled: boolean;
|
|
26
34
|
spellCheckEnabled: boolean;
|
|
27
35
|
hidden: boolean;
|
|
28
|
-
|
|
29
|
-
partition: string | null;
|
|
36
|
+
readonly sandbox: boolean;
|
|
30
37
|
|
|
31
38
|
// Attribute-backed properties (getters/setters)
|
|
32
39
|
src: string | null;
|
|
@@ -49,9 +56,9 @@ interface WebviewTagElement extends HTMLElement {
|
|
|
49
56
|
setSpellCheck(enabled: boolean): Promise<boolean>;
|
|
50
57
|
|
|
51
58
|
// Visibility and interaction
|
|
52
|
-
toggleTransparent(transparent?: boolean
|
|
53
|
-
togglePassthrough(enablePassthrough?: boolean
|
|
54
|
-
toggleHidden(hidden?: boolean
|
|
59
|
+
toggleTransparent(transparent?: boolean): void;
|
|
60
|
+
togglePassthrough(enablePassthrough?: boolean): void;
|
|
61
|
+
toggleHidden(hidden?: boolean): void;
|
|
55
62
|
|
|
56
63
|
// Events - listener receives a CustomEvent with detail property
|
|
57
64
|
on(event: WebviewEventTypes, listener: (event: CustomEvent) => void): void;
|
|
@@ -8,12 +8,14 @@ import type { WindowsWebView2Permission } from "./windowsPermissions";
|
|
|
8
8
|
type BundlerOptions = {
|
|
9
9
|
external?: string[];
|
|
10
10
|
define?: Record<string, string>;
|
|
11
|
-
|
|
11
|
+
alias?: Record<string, string>;
|
|
12
12
|
minify?: boolean;
|
|
13
13
|
sourcemap?: boolean | "inline" | "external" | "linked";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
target?: string | string[];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type ViewBundlerOptions = BundlerOptions & {
|
|
18
|
+
format?: "esm" | "cjs" | "iife";
|
|
17
19
|
};
|
|
18
20
|
|
|
19
21
|
type CarrotFileActivatorConfig = {
|
|
@@ -228,8 +230,8 @@ export interface ElectrobunConfig {
|
|
|
228
230
|
|
|
229
231
|
/**
|
|
230
232
|
* Browser view build configurations.
|
|
231
|
-
* Each view accepts bundler options
|
|
232
|
-
*
|
|
233
|
+
* Each view accepts the supported bundler options in addition to the
|
|
234
|
+
* entrypoint.
|
|
233
235
|
*/
|
|
234
236
|
views?: {
|
|
235
237
|
[viewName: string]: {
|
|
@@ -237,7 +239,7 @@ export interface ElectrobunConfig {
|
|
|
237
239
|
* Entry point for this view's TypeScript code
|
|
238
240
|
*/
|
|
239
241
|
entrypoint: string;
|
|
240
|
-
} &
|
|
242
|
+
} & ViewBundlerOptions;
|
|
241
243
|
};
|
|
242
244
|
|
|
243
245
|
/**
|
|
@@ -259,47 +261,6 @@ export interface ElectrobunConfig {
|
|
|
259
261
|
*/
|
|
260
262
|
artifactFolder?: string;
|
|
261
263
|
|
|
262
|
-
/**
|
|
263
|
-
* Build targets to compile for
|
|
264
|
-
* Can be "current", "all", or comma-separated list like "macos-arm64,win-x64"
|
|
265
|
-
*/
|
|
266
|
-
targets?: string;
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Enable ASAR archive packaging for bundled assets
|
|
270
|
-
* When enabled, all files in the Resources folder will be packed into an app.asar archive
|
|
271
|
-
* @default false
|
|
272
|
-
*/
|
|
273
|
-
useAsar?: boolean;
|
|
274
|
-
|
|
275
|
-
/**
|
|
276
|
-
* Glob patterns for files to exclude from ASAR packing (extract to app.asar.unpacked)
|
|
277
|
-
* Useful for native modules or executables that need to be accessible as regular files
|
|
278
|
-
* @default ["*.node", "*.dll", "*.dylib", "*.so"]
|
|
279
|
-
*/
|
|
280
|
-
asarUnpack?: string[];
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* Override the CEF (Chromium Embedded Framework) version.
|
|
284
|
-
* Format: "CEF_VERSION+chromium-CHROMIUM_VERSION"
|
|
285
|
-
* Example: "144.0.11+ge135be2+chromium-144.0.7559.97"
|
|
286
|
-
*
|
|
287
|
-
* Check the electrobun-cef-compat compatibility matrix for tested combinations
|
|
288
|
-
* before overriding. Using an untested version may cause runtime issues.
|
|
289
|
-
* @default Uses the version bundled with this Electrobun release
|
|
290
|
-
*/
|
|
291
|
-
cefVersion?: string;
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Override the Dawn (WebGPU) version.
|
|
295
|
-
* Format: semver string (e.g., "0.2.3") or tag (e.g., "v0.2.3-beta.0")
|
|
296
|
-
*
|
|
297
|
-
* This downloads the specified electrobun-dawn release and uses it
|
|
298
|
-
* instead of the latest release.
|
|
299
|
-
* @default Uses the latest electrobun-dawn release
|
|
300
|
-
*/
|
|
301
|
-
wgpuVersion?: string;
|
|
302
|
-
|
|
303
264
|
/**
|
|
304
265
|
* Additional file or directory paths to watch for changes during `electrobun dev --watch`.
|
|
305
266
|
* Paths are relative to the project root.
|
|
@@ -468,7 +429,8 @@ export interface ElectrobunConfig {
|
|
|
468
429
|
autoGrantPermissions?: WindowsWebView2Permission[];
|
|
469
430
|
|
|
470
431
|
/**
|
|
471
|
-
* Path to application icon
|
|
432
|
+
* Path to an application icon in ICO or PNG format. PNG input is
|
|
433
|
+
* converted to ICO by Hutch.
|
|
472
434
|
* Used for the installer/extractor wrapper, desktop shortcuts, and taskbar
|
|
473
435
|
* Should include multiple sizes (16x16, 32x32, 48x48, 256x256) for best results
|
|
474
436
|
* @example "assets/icon.ico"
|