Skip to content

Commit 1ac1095

Browse files
committed
Convert Deno client to universal Node.js/Deno/Bun compatibility
- Replace deno.json with package.json configuration - Convert Deno APIs to Node.js built-ins with node: prefix - Add TypeScript configuration for extensionless imports - Create post-build script to fix imports for Node.js compatibility - Update all examples to use new import paths - Add support for cross-runtime binary downloading - Remove Deno-specific configuration files
1 parent 6894944 commit 1ac1095

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2609
-248
lines changed

src/clients/deno/README.md

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,38 @@
1-
# @justbe/webview Deno Client
1+
# @justbe/webview
22

3-
A light, cross-platform library for building web-based desktop apps with
4-
[Deno](https://deno.com/).
3+
A light, cross-platform library for building web-based desktop apps. This package provides a universal client that is compatible with Deno, Node.js, and Bun.
4+
5+
## Compatibility
6+
7+
-**Node.js** 18+ (fully supported)
8+
-**Deno** (original implementation, fully supported)
9+
- ⚠️ **Bun** (limited support - older versions may have issues)
510

611
## Installation
712

13+
### Node.js
14+
```bash
15+
npm install @justbe/webview
16+
```
17+
18+
### Deno
819
```typescript
920
import { createWebView } from "jsr:@justbe/webview";
1021
```
1122

23+
### Bun
24+
```bash
25+
bun install @justbe/webview
26+
```
27+
1228
## Example
1329

1430
```typescript
15-
import { createWebView } from "jsr:@justbe/webview";
31+
import { createWebView } from "@justbe/webview";
1632

1733
using webview = await createWebView({
1834
title: "Example",
19-
html: "<h1>Hello, World!</h1>",
35+
load: { html: "<h1>Hello, World!</h1>" },
2036
devtools: true,
2137
});
2238

@@ -28,10 +44,17 @@ webview.on("started", async () => {
2844
await webview.waitUntilClosed();
2945
```
3046

31-
You can run this yourself with:
47+
### Running Examples
48+
49+
**Node.js:**
50+
```bash
51+
npm run build
52+
node examples/simple.js
53+
```
3254

33-
```sh
34-
deno run https://raw.githubusercontent.com/zephraph/webview/refs/heads/main/examples/simple.ts
55+
**Deno:**
56+
```bash
57+
deno run --allow-all examples/simple.ts
3558
```
3659

3760
Check out the [examples directory](examples/) for more examples.
@@ -76,4 +99,4 @@ process. In this case, only one permission is needed:
7699

77100
Note that this environment variable will never be _explicitly_ requested. If the
78101
script detects it's not allowed to read this env var it just skips this code
79-
path altogether.
102+
path altogether.

src/clients/deno/deno.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/clients/deno/deno.lock

Lines changed: 0 additions & 83 deletions
This file was deleted.

src/clients/deno/examples/ipc.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export {};
2+
//# sourceMappingURL=ipc.d.ts.map

src/clients/deno/examples/ipc.d.ts.map

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

src/clients/deno/examples/ipc.js

Lines changed: 76 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/clients/deno/examples/ipc.js.map

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

src/clients/deno/examples/ipc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createWebView } from "../main.ts";
1+
import { createWebView } from "../main";
22

33
using webview = await createWebView({
44
title: "Simple",
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
export {};
2+
//# sourceMappingURL=load-html.d.ts.map

src/clients/deno/examples/load-html.d.ts.map

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

0 commit comments

Comments
 (0)