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
24 changes: 17 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -241,21 +241,28 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
build: |-
set -e &&
rustup toolchain install 1.83 &&
rustup default 1.83 &&
npm install -g n && n 22 &&
rustup toolchain install stable &&
rustup default stable &&
yarn build --target x86_64-unknown-linux-gnu &&
strip *.node
- host: ubuntu-22.04
target: x86_64-unknown-linux-musl
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: set -e && yarn build && strip *.node
build: |-
set -e &&
wget -qO- https://unofficial-builds.nodejs.org/download/release/v22.16.0/node-v22.16.0-linux-x64-musl.tar.gz | tar -xz -C /usr/local --strip-components=1 &&
rustup toolchain install stable &&
rustup default stable &&
yarn build && strip *.node
- host: ubuntu-22.04
target: aarch64-unknown-linux-gnu
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
build: |-
set -e &&
rustup toolchain install 1.83 &&
rustup default 1.83 &&
npm install -g n && n 22 &&
rustup toolchain install stable &&
rustup default stable &&
rustup target add aarch64-unknown-linux-gnu &&
yarn build --target aarch64-unknown-linux-gnu &&
aarch64-unknown-linux-gnu-strip *.node
Expand All @@ -272,6 +279,9 @@ jobs:
docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
build: |-
set -e &&
wget -qO- https://unofficial-builds.nodejs.org/download/release/v22.16.0/node-v22.16.0-linux-x64-musl.tar.gz | tar -xz -C /usr/local --strip-components=1 &&
rustup toolchain install stable &&
rustup default stable &&
rustup target add aarch64-unknown-linux-musl &&
yarn build --target aarch64-unknown-linux-musl &&
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
Expand All @@ -286,8 +296,8 @@ jobs:
yarn build --target armv7-linux-androideabi
${ANDROID_NDK_LATEST_HOME}/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip *.node
node:
- "18"
- "20"
- "22"

name: NodeJS ${{ matrix.node }} on ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
Expand Down Expand Up @@ -456,7 +466,7 @@ jobs:
if: matrix.settings.target == 'armv7-unknown-linux-gnueabihf'
uses: addnab/docker-run-action@v3
with:
image: node:${{ matrix.node }}-bullseye-slim
image: node:${{ matrix.node }}-bookworm-slim
options: "--platform linux/arm/v7 --network host -v ${{ github.workspace }}:/build -w /build/bindings/javascript"
run: |
set -e
Expand Down
3 changes: 3 additions & 0 deletions bindings/javascript/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static"]

[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"

[target.wasm32-unknown-unknown]
rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""]
3 changes: 3 additions & 0 deletions bindings/javascript/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@

### Changed

- Update `napi` to `3`.
- Update `cssparser` to `0.36`.
- Update `html5ever` to `0.36`.
- Update `selectors` to `0.33`.
- Bump MSRV to `1.88`.
- Drop Node.js 18 support.

### Performance

Expand Down
8 changes: 4 additions & 4 deletions bindings/javascript/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ repository = "https://github.com/Stranger6667/css-inline"
keywords = ["css", "html", "email", "stylesheet", "inlining"]
categories = ["web-programming"]
license = "MIT"
rust-version = "1.80"
rust-version = "1.88"
include = ["src/*.rs", "LICENSE", "README.md", "CHANGELOG.md"]

[lib]
Expand All @@ -22,8 +22,8 @@ mimalloc = "0.1"
mimalloc = { version = "0.1", features = ["local_dynamic_tls"] }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
napi = { version = "2.16.0", default-features = false, features = ["napi4"] }
napi-derive = "2.16.0"
napi = { version = "3", default-features = false, features = ["napi4"] }
napi-derive = "3"

[target.'cfg(target_arch = "wasm32")'.dependencies]
wasm-bindgen = "=0.2.106"
Expand All @@ -43,7 +43,7 @@ version = "*"
default-features = false

[build-dependencies]
napi-build = ">=2.1.0, <2.3"
napi-build = "2"

[profile.release]
lto = true
Expand Down
21 changes: 11 additions & 10 deletions bindings/javascript/js-binding.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
/* tslint:disable */
/* auto-generated by NAPI-RS */
/* eslint-disable */
/** Inline CSS styles from <style> tags to matching elements in the HTML tree and return a string. */
export declare function inline(html: string, options?: Options | undefined | null): string

/* auto-generated by NAPI-RS */
/** Inline CSS styles into an HTML fragment. */
export declare function inlineFragment(html: string, css: string, options?: Options | undefined | null): string

export interface StylesheetCache {
/** Cache size. */
size: number
}
export interface Options {
/**
* Whether to inline CSS from "style" tags.
Expand Down Expand Up @@ -37,9 +36,11 @@ export interface Options {
*/
preallocateNodeCapacity?: number
}
/** Inline CSS styles from <style> tags to matching elements in the HTML tree and return a string. */
export declare function inline(html: string, options?: Options | undefined | null): string
/** Inline CSS styles into an HTML fragment. */
export declare function inlineFragment(html: string, css: string, options?: Options | undefined | null): string

export interface StylesheetCache {
/** Cache size. */
size: number
}

/** Get the package version. */
export declare function version(): string
Loading
Loading