ferridriver-script 0.3.0

Sandboxed QuickJS scripting engine for ferridriver. Runs JS scripts against Page/Browser/Context with bound args, per-call isolation, scoped fs, and structured errors.
Documentation
[package]
name = "ferridriver-script"
description = "Sandboxed QuickJS scripting engine for ferridriver. Runs JS scripts against Page/Browser/Context with bound args, per-call isolation, scoped fs, and structured errors."
version.workspace = true
edition.workspace = true
license.workspace = true
authors.workspace = true
repository.workspace = true
homepage.workspace = true
keywords.workspace = true
categories.workspace = true

[lints]
workspace = true

[dependencies]
ferridriver = { workspace = true }
ferridriver-expect = { workspace = true }

tokio = { workspace = true }
futures = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
async-trait = { workspace = true }
tracing = { workspace = true }
thiserror = { workspace = true }
rustc-hash = "2"
libc = { workspace = true }
base64 = { workspace = true }
url = "2"

# Direct serde <-> rquickjs::Value (no serde_json::Value middle-hop).
# Correct number coercion (integral float -> int via serde visitors),
# undefined/function drop parity, Proxy + cycle handling.
rquickjs-serde = "0.5"

# `full-async` does NOT imply `parallel`; without it the AsyncRuntime is
# !Send/!Sync and the cross-task route/exposeFunction closures (which
# must be `Arc<dyn Fn + Send + Sync>`) fail to compile. Keep `parallel`.
rquickjs = { version = "0.11", features = ["full-async", "parallel", "macro", "loader", "array-buffer"] }

# Sandbox-safe extras only: timers (setTimeout/Interval), URL/URLSearchParams,
# and the console Formatter (we reuse only its Node-style renderer, not its
# log sink). Deliberately NOT pulling os/sqlite (filesystem/db escape the
# scripting sandbox) — see the rquickjs-extra audit.
rquickjs-extra-timers = "0.2"
rquickjs-extra-url = "0.2"
rquickjs-extra-console = "0.2"

# Step-file front-end: rolldown bundles + tree-shakes + transpiles TS to
# one ESM module (resolving node_modules), which is compiled to QuickJS
# bytecode once.
rolldown = "1"
rolldown_common = "1"
# Remap QuickJS error line:col (bundled output) back to original .ts/.js.
sourcemap = "9"

[dev-dependencies]
tempfile = "3"
tokio = { workspace = true, features = ["full", "test-util"] }