Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "monthly"
open-pull-requests-limit: 5
79 changes: 79 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: CI
on:
pull_request:
push:
branches:
- "*"
tags:
- "*"
env:
CEF_VERSION: "136.1.6+g1ac1b14+chromium-136.0.7103.114"

jobs:
test:
name: Test
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
run_on: macos-latest
- target: x86_64-linux-gnu
run_on: ubuntu-latest
- target: x86_64-windows-msvc
run_on: windows-latest
runs-on: ${{ matrix.run_on }}
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: clippy
- name: Install system dependencies
if: ${{ matrix.run_on != 'windows-latest' }}
run: script/bootstrap
- name: Machete
if: ${{ matrix.run_on == 'macos-latest' }}
uses: bnjbvr/cargo-machete@v0.9.1
- name: Setup | Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: test-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}
- name: Cache CEF
id: cache-cef
uses: actions/cache@v4
with:
path: $HOME/.cef
key: cef-${{ env.CEF_VERSION }}-${{ matrix.target }}
- name: Init CEF
if: ${{ !steps.cache-cef.outputs.cache-hit }}
run: |
cargo run -p cargo-wef -- wef init
- name: Typo check
if: ${{ matrix.run_on == 'macos-latest' }}
run: |
cargo install typos-cli || echo "typos-cli already installed"
typos
- name: Lint
if: ${{ matrix.run_on == 'macos-latest' }}
run: |
cargo clippy -- --deny warnings
- name: Test Linux
if: ${{ matrix.run_on == 'ubuntu-latest' }}
run: |
cargo run -p cargo-wef -- wef add-framework target/debug
cargo test --all
- name: Test Windows
if: ${{ matrix.run_on == 'windows-latest' }}
run: |
cargo run -p cargo-wef -- wef add-framework target/debug
cargo test --all
- name: Test macOS
if: ${{ matrix.run_on == 'macos-latest' }}
run: |
cargo test --all
35 changes: 35 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/target/
Cargo.lock

# IDE
.vscode/
.idea/

# OS
.DS_Store
Thumbs.db

# Temporary files
*.tmp
*.temp
*.swp
*.swo
*~

# CEF files (will be downloaded by cargo-wef)
.cef/
*.pak
*.dat
*.bin
*.dll
*.so
*.dylib
libcef.*
libEGL.*
libGLESv2.*
icudtl.dat
resources.pak
chrome_*.pak
snapshot_blob.bin
v8_context_snapshot.bin
locales/
95 changes: 95 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Contributing to Wef

Thank you for your interest in contributing to Wef! This document provides guidelines and information for contributors.

## Prerequisites

Before you can build and test Wef, you'll need:

## Development Setup

1. **Clone the repository**

```bash
git clone https://github.com/longbridge/wef.git
cd wef
```

2. **Install cargo-wef**

```bash
cargo install --path cargo-wef
```

3. **Initialize CEF**

```bash
cargo wef init
```

This downloads the Chromium Embedded Framework binaries to `~/.cef`

## Building and Testing

### Building

```bash
# Build everything
cargo wef build

# Build specific components
cargo build -p wef # Core library
cargo build -p cargo-wef # CLI tool
```

### Testing

```bash
# Run all tests
cargo test --all

# Test specific components
cargo test -p wef
cargo test -p cargo-wef
```

### Running Examples

```bash
cargo wef run -p wef-example
```

## Development Tips

### CEF Troubleshooting

If you encounter CEF-related build issues:

1. **Clear CEF cache**

```bash
rm -rf ~/.cef
cargo wef init
```

2. **Check CEF version**
The CEF version is defined in `.github/workflows/ci.yml`

3. **Verify system dependencies**
Ensure all required system packages are installed

### Debugging

- Use `cargo wef run -p wef-winit` to test changes quickly
- Enable debug logging with `RUST_LOG=debug`
- Use the debugger-friendly debug profile for development

## Getting Help

- **Documentation**: Check the [README](README.md) and [library docs](wef/README.md)
- **Issues**: Search existing [GitHub issues](https://github.com/longbridge/wef/issues)
- **Discussions**: Use [GitHub Discussions](https://github.com/longbridge/wef/discussions) for questions

## License

By contributing to Wef, you agree that your contributions will be licensed under the Apache License 2.0.
64 changes: 64 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
[workspace]
members = [
"crates/wef",
"crates/cargo-wef",
"crates/webview",
"examples/wef-winit",
"examples/wef-example",
]

default-members = ["crates/wef"]
resolver = "2"

[workspace.dependencies]
wef = { path = "crates/wef" }
gpui-webview = { path = "crates/webview" }
ropey = { version = "=2.0.0-beta.1", features = ["metric_utf16", "metric_lines_lf"] }

anyhow = "1"
log = "0.4"
serde = { version = "1.0.219", features = ["derive"] }
serde_repr = "0.1"
serde_json = "1"
schemars = "1"
smallvec = "1"
rust-i18n = "3"
raw-window-handle = "0.6.2"
smol = "1"
tracing = "0.1.41"
notify = "7.0.0"
lsp-types = "0.97.0"

[workspace.dependencies.windows]
features = ["Wdk", "Wdk_System", "Wdk_System_SystemServices"]
version = "0.58.0"

[workspace.lints.clippy]
almost_complete_range = "allow"
arc_with_non_send_sync = "allow"
borrowed_box = "allow"
dbg_macro = "deny"
let_underscore_future = "allow"
map_entry = "allow"
module_inception = "allow"
non_canonical_partial_ord_impl = "allow"
reversed_empty_ranges = "allow"
single_range_in_vec_init = "allow"
style = { level = "allow", priority = -1 }
todo = "deny"
type_complexity = "allow"
manual_is_multiple_of = "allow"

[profile.dev]
codegen-units = 16
debug = "limited"
split-debuginfo = "unpacked"

[profile.dev.package]
# Optimize image processing libraries in debug builds for better performance
image = { opt-level = 3 }
png = { opt-level = 3 }
reqwest = { opt-level = 3 }

[workspace.metadata.typos]
files.extend-exclude = ["**/fixtures/*"]
Loading
Loading