quickjs-oxide 0.4.0

A safe Rust JavaScript engine targeting semantic parity with QuickJS
Documentation
[package]
name = "quickjs-oxide"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
publish.workspace = true
description = "A safe Rust JavaScript engine targeting semantic parity with QuickJS"
homepage.workspace = true
readme = "README.md"
# The engine and its documentation; the tests, corpora and tooling stay in
# the repository.
include = ["/src", "/examples", "/README.md", "/LICENSE", "/NOTICE", "/LICENSES"]
keywords = ["javascript", "ecmascript", "quickjs", "interpreter", "engine"]
categories = ["compilers", "development-tools"]

[lints]
workspace = true

[dependencies]
# The engine (#122): the lowering's target and the API's runtime.
oxide-core = { workspace = true }
# The regular-expression engine and Unicode tables.
oxide-regexp = { workspace = true }
num-bigint = { workspace = true }
num-traits = { workspace = true }

[features]
default = []
test262-host = []
test-support = []
# The core's stress mode (collect before every allocation), for the register
# lowering's tests and `qjs --gc-stress`.
gc-stress = ["oxide-core/gc-stress"]
# `qjs --ic-stats`: the core's inline-cache counters.
ic-stats = ["oxide-core/ic-stats"]
# Lowers every function as one whose operand stack passes the register
# window, with two temporaries in registers, so the corpora run the spill
# paths.
register-stress = []
[dev-dependencies]
# A path without a version: the host depends on this crate, and Cargo drops
# the dependency from the published manifest.
quickjs-oxide-host = { path = "adapters/native", features = ["engine-test-support"] }
oxide-regexp = { workspace = true, features = ["test-hooks"] }

# Real-main-thread stack-guard matrix; its fn main is the test body so Cargo
# always builds the probe it spawns (no pre-built example artifact required).
[[test]]
name = "main_thread_stack_probe"
harness = false

[workspace]
members = ["adapters/native", "adapters/web", ".", "apps/cli", "apps/web", "conformance/test262", "core", "regexp"]
default-members = [".", "apps/cli"]
resolver = "3"

[workspace.package]
version = "0.4.0"
edition = "2024"
rust-version = "1.99"
license = "MIT"
repository = "https://github.com/pocket-nexus/quickjs-oxide"
homepage = "https://quickjs-oxide.pocket.nexus/"
# The release workflow publishes every member except the web packages and
# the Test262 runner to crates.io.
publish = true

[workspace.dependencies]
# Each published member carries the workspace version, which cut-release.sh
# sets here too.
quickjs-oxide-web-host = { path = "adapters/web", version = "0.4.0" }
quickjs-oxide-host = { path = "adapters/native", version = "0.4.0" }
quickjs-oxide = { path = ".", version = "0.4.0", default-features = false }
# The core and regexp packages are named for the engine (`oxide-core` is
# taken on crates.io); their libraries keep the names `oxide_core` and
# `oxide_regexp`.
oxide-core = { path = "core", version = "0.4.0", package = "quickjs-oxide-core" }
oxide-regexp = { path = "regexp", version = "0.4.0", package = "quickjs-oxide-regexp" }
num-bigint = "=0.5.1"
num-traits = "=0.2.19"
tz-rs = "=0.7.3"
js-sys = { version = "=0.3.103", default-features = false }
wasm-bindgen = "=0.2.126"

[workspace.lints.rust]
unsafe_code = "forbid"
[workspace.lints.clippy]
all = { level = "warn", priority = -1 }
# Its arm-guard rewrite moves the inner test into the guard, so a false
# test falls through to later arms instead of leaving the arm; several
# sites test with side effects (`delimiters.pop()`).
collapsible_match = "allow"

[profile.release]
lto = "fat"
codegen-units = 1

[profile.web]
inherits = "release"
opt-level = "s"
lto = true
codegen-units = 1
strip = true
panic = "abort"