Skip to content

Commit 3620c73

Browse files
authored
Fix webview binary path (#143)
* Fix webview binary path * Fix windows binary path construction * Add changelog * Upgrade binary * Fix a bug where events weren't firing correctly * Bump deno client
1 parent e212a33 commit 3620c73

7 files changed

Lines changed: 36 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,28 @@
11
# Changelog
22

3+
## 0.0.2 Python Client; 1.0.1-rc.1 Deno Client; 0.3.0 binary -- 2025-02-23
4+
5+
Binary
6+
7+
- Updated wry to 0.49.0
8+
- Updated tao to 0.32.0
9+
10+
Python Client
11+
12+
- Updated webview binary to 0.3.0
13+
- Fixed readme
14+
- Fixed binary path being wrong
15+
- Fixed windows binary name being incorrectly constructed
16+
- Fixed an issue where events weren't being acknowledged
17+
18+
Deno Client
19+
20+
- Updated webview to 0.3.0
21+
22+
## 0.0.1 Python Client; 0.2.0 binary -- 2025-02-18
23+
24+
- Initial release of the python client
25+
326
## 1.0.0-rc.1 Deno Client; 0.2.0 binary -- 2025-02-17
427

528
- Added new logging that can be triggered with the `LOG_LEVEL` environment variable

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "webview"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
edition = "2021"
55

66
[profile.release]

mise.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ depends = ["lint:*"]
129129
description = "Run a python example"
130130
depends = ["build:python"]
131131
dir = "src/clients/python"
132-
run = "uv run examples/{{arg(name=\"example\")}}.py"
132+
run = "uv run -n examples/{{arg(name=\"example\")}}.py"
133133
env = { LOG_LEVEL = "debug", WEBVIEW_BIN = "../../../target/debug/webview" }
134134

135135
[tasks."example:deno"]

src/clients/deno/deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@justbe/webview",
33
"exports": "./main.ts",
44
"license": "MIT",
5-
"version": "1.0.0-rc.1",
5+
"version": "1.0.1-rc.1",
66
"publish": {
77
"include": ["README.md", "LICENSE", "*.ts", "schemas/*.ts"]
88
},

src/clients/deno/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ if (
5555

5656
// Should match the cargo package version
5757
/** The version of the webview binary that's expected */
58-
export const BIN_VERSION = "0.2.0";
58+
export const BIN_VERSION = "0.3.0";
5959

6060
type WebViewNotification = Extract<
6161
Message,

src/clients/python/src/justbe_webview/__init__.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
)
4949

5050
# Constants
51-
BIN_VERSION = "0.2.0"
51+
BIN_VERSION = "0.3.0"
5252

5353
T = TypeVar("T", bound=WebViewNotification)
5454

@@ -85,26 +85,29 @@ async def get_webview_bin(options: WebViewOptions) -> str:
8585
flags = "-transparent"
8686

8787
cache_dir = get_cache_dir()
88-
file_name = f"deno-webview-{BIN_VERSION}{flags}"
88+
file_name = f"webview-{BIN_VERSION}{flags}"
8989
if platform.system() == "Windows":
9090
file_name += ".exe"
9191
file_path = cache_dir / file_name
9292

9393
if file_path.exists():
9494
return str(file_path)
9595

96-
url = f"https://github.com/zephraph/webview/releases/download/webview-v{BIN_VERSION}/deno-webview"
96+
url = f"https://github.com/zephraph/webview/releases/download/webview-v{BIN_VERSION}/webview"
9797
if platform.system() == "Darwin":
9898
url += "-mac"
9999
if platform.machine() == "arm64":
100100
url += "-arm64"
101101
elif platform.system() == "Linux":
102102
url += "-linux"
103103
elif platform.system() == "Windows":
104-
url += "-windows.exe"
104+
url += "-windows"
105105
else:
106106
raise ValueError("Unsupported OS")
107107

108+
if platform.system() == "Windows":
109+
url += ".exe"
110+
108111
url += flags
109112

110113
async with httpx.AsyncClient() as client:
@@ -216,7 +219,7 @@ async def send(self, request: WebViewRequest) -> WebViewResponse:
216219
def set_result(event: Union[AckResponse, ResultResponse, ErrResponse]) -> None:
217220
future.set_result(event)
218221

219-
self.internal_event.once(request.id, set_result) # type: ignore
222+
self.internal_event.once(str(request.id), set_result) # type: ignore
220223

221224
assert self.process.stdin is not None
222225
encoded = msgspec.json.encode(request)

0 commit comments

Comments
 (0)