Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tr1ckydev committed Apr 7, 2024
1 parent 657772b commit ff7e1b1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 15 deletions.
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ Webview is a tiny cross-platform library to make **web-based GUIs for desktop ap

## Installation

> Platforms supported: `linux`, `macos-x64`, `macos-arm64`
> Platforms supported: `win64`, `linux`, `macos-x64`, `macos-arm64`
- Install [webkit2gtk](https://webkitgtk.org/) dependency for linux.

Ubuntu: `sudo apt-get install libwebkit2gtk-4.0-dev`

Arch Linux: `yay -S webkit2gtk`

- Install `webview-bun` and the latest compiled webview library from the releases of this repository.
- Install `webview-bun` with trust flag to run postinstall to automatically fetch pre-built library from latest release.

```bash
bun i webview-bun && bun node_modules/webview-bun/fetchLib.ts
bun i --trust webview-bun
```


Expand Down Expand Up @@ -59,39 +59,42 @@ Refer to the comments in the source code for full documentation.

### Building

- Clone the repository along with the webview submodule.
- Clone the repository along with the [webview](https://github.com/webview/webview) submodule.

```bash
git clone --recurse-submodules --remote-submodules https://github.com/tr1ckydev/webview-bun.git
cd webview-bun
bun i
```

- Install bun-types and build the library for your platform
- Build the library for your platform.

```bash
bun i && bun run build
```

or, fetch the latest compiled library from the releases of this repository.
> [!IMPORTANT]
> If you are on **Windows,** you need to have `c++` compiler in your PATH. If not already, follow the steps [here](https://code.visualstudio.com/docs/cpp/config-mingw#_installing-the-mingww64-toolchain) to install.
```bash
bun i && bun run postinstall
bun run build
```


### Running

> To use your own built webview library, set the `WEBVIEW_PATH` environment variable with the path to your webview shared library file.
> [!TIP]
> To use your own webview library, set the `WEBVIEW_PATH` environment variable with the path to your webview shared library file.
Run the following example to see it in action.

```bash
bun run examples/basic.ts
```

For more examples, browse the `examples` folder of this repository.



## Credits

This repository is a direct port of [webview_deno](https://github.com/webview/webview_deno) by [@eliassjogreen](https://github.com/eliassjogreen) with various changes to work with the bun runtime.
This repository is a port of [webview_deno](https://github.com/webview/webview_deno) with various changes to work with the bun runtime and new windows build script to compile the latest webview.



Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"module": "src/index.ts",
"main": "src/index.ts",
"files": [
"src",
"build",
"src/",
"build/.gitkeep",
"scripts/download.ts"
],
"scripts": {
Expand Down

0 comments on commit ff7e1b1

Please sign in to comment.