Skip to content

Commit 817700e

Browse files
committed
chore: make publishable with litehtml
1 parent e5091c5 commit 817700e

7 files changed

Lines changed: 104 additions & 22 deletions

File tree

.github/workflows/publish.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,7 @@ jobs:
1313

1414
- uses: dtolnay/rust-toolchain@stable
1515

16-
- name: Check
17-
run: cargo check --features blitz
18-
19-
- name: Publish to crates.io
20-
uses: katyo/publish-crates@v2
21-
with:
22-
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
16+
- name: Prepare and publish
17+
run: chmod +x publish.sh && ./publish.sh --publish
18+
env:
19+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ jobs:
1717
steps:
1818
- uses: actions/checkout@v4
1919
- uses: dtolnay/rust-toolchain@stable
20-
- name: Check (blitz)
21-
run: cargo check --features blitz --verbose
20+
- name: Check (default/litehtml)
21+
run: cargo check --verbose
2222
- name: Check (litehtml)
2323
run: cargo check --no-default-features --features litehtml --verbose
2424
- name: Check (servo)

CHANGELOG.md

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

3+
## [0.1.3] - 2026-02-22
4+
5+
### Changed
6+
- Default feature switched from `blitz` to `litehtml` — blitz and servo are git-only and can't be published to crates.io
7+
- Publish workflow uses `publish.sh` to strip git-only deps before publishing
8+
39
## [0.1.2] - 2026-02-22
410

511
### Added

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "iced_webview_v2"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
edition = "2021"
55
rust-version = "1.90.0"
66
description = "An easily embedded webview library for iced"
@@ -23,7 +23,7 @@ opt-level = "s"
2323
lto = "thin"
2424

2525
[features]
26-
default = ["blitz"]
26+
default = ["litehtml"]
2727
blitz = [
2828
"dep:blitz-dom",
2929
"dep:blitz-html",

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,18 @@ This library supports
3636
cargo run --example webview --no-default-features --features cef"
3737
```
3838

39+
### Default engine
40+
41+
The default feature is `litehtml` — it's lightweight, pure-crate.io, and compiles fast. Blitz and Servo are git-only deps and can't be published to crates.io, so they require `--features blitz` or `--features servo` explicitly.
42+
3943
#### examples:
4044

4145
##### `examples/webview`
4246
Minimal example — just the web view, nothing else
4347
```sh
4448
cargo run --release --example webview
45-
# or with litehtml
46-
cargo run --example webview --no-default-features --features litehtml
49+
# or with blitz
50+
cargo run --example webview --no-default-features --features blitz
4751
# or with servo
4852
cargo run --example webview --no-default-features --features servo
4953
# or with cef

publish.sh

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Strip git-only features, deps and patches from Cargo.toml for publishing.
5+
# crates.io rejects packages with git-only deps — even optional ones.
6+
# Backs up Cargo.toml and restores it after publish (or dry-run).
7+
8+
cp Cargo.toml Cargo.toml.bak
9+
trap 'mv Cargo.toml.bak Cargo.toml' EXIT
10+
11+
# --- Features ---
12+
13+
# Remove blitz feature block (multi-line: "blitz = [" through "]")
14+
sed -i '/^blitz = \[$/,/^\]$/d' Cargo.toml
15+
16+
# Remove servo feature line
17+
sed -i '/^servo = \[/d' Cargo.toml
18+
19+
# --- Dependencies ---
20+
21+
# Blitz git deps
22+
sed -i '/^# Blitz engine deps/d' Cargo.toml
23+
sed -i '/^blitz-dom = {/d' Cargo.toml
24+
sed -i '/^blitz-html = {/d' Cargo.toml
25+
sed -i '/^blitz-paint = {/d' Cargo.toml
26+
sed -i '/^blitz-traits = {/d' Cargo.toml
27+
sed -i '/^blitz-net = {/d' Cargo.toml
28+
29+
# Blitz crates.io deps (only used by blitz feature)
30+
sed -i '/^anyrender = {/d' Cargo.toml
31+
sed -i '/^anyrender_vello_cpu = {/d' Cargo.toml
32+
sed -i '/^peniko = {/d' Cargo.toml
33+
sed -i '/^cursor-icon = {/d' Cargo.toml
34+
sed -i '/^keyboard-types = {/d' Cargo.toml
35+
sed -i '/^tokio = {/d' Cargo.toml
36+
37+
# Servo git dep
38+
sed -i '/^# Servo engine deps/d' Cargo.toml
39+
sed -i '/^servo = {/d' Cargo.toml
40+
41+
# Servo crates.io deps (only used by servo feature)
42+
sed -i '/^rustls = {/d' Cargo.toml
43+
sed -i '/^euclid = {/d' Cargo.toml
44+
sed -i '/^keyboard-types-servo = {/d' Cargo.toml
45+
sed -i '/^dpi = {/d' Cargo.toml
46+
47+
# --- Patch section ---
48+
49+
# Remove patch comment block
50+
sed -i '/^# When both blitz/d' Cargo.toml
51+
sed -i '/^# stylo (crates.io/d' Cargo.toml
52+
sed -i '/^# git rev so they/d' Cargo.toml
53+
54+
# Remove [patch.crates-io] section header and all entries
55+
sed -i '/^\[patch\.crates-io\]$/d' Cargo.toml
56+
sed -i '/^stylo = {/d' Cargo.toml
57+
sed -i '/^stylo_traits = {/d' Cargo.toml
58+
sed -i '/^stylo_atoms = {/d' Cargo.toml
59+
sed -i '/^stylo_dom = {/d' Cargo.toml
60+
sed -i '/^selectors = {/d' Cargo.toml
61+
62+
# --- Cleanup ---
63+
64+
# Collapse runs of blank lines into one
65+
sed -i '/^$/N;/^\n$/d' Cargo.toml
66+
67+
echo "=== Stripped Cargo.toml ==="
68+
cat Cargo.toml
69+
echo "==========================="
70+
71+
if [[ "${1:-}" == "--publish" ]]; then
72+
cargo publish --allow-dirty
73+
else
74+
cargo publish --dry-run --allow-dirty
75+
fi

0 commit comments

Comments
 (0)