[workspace]
members = [
    "core",
    "macro",
    "quickjs", "quickjs/sys",
    "javascriptcore", "javascriptcore/sys",
    "arkjs", "arkjs/sys",
    "utils/rong_test",
    "examples",
    "modules/rong_timer", "modules/rong_navigator", "modules/rong_path",
    "modules/rong_http", "modules/rong_encoding", "modules/rong_event",
    "modules/rong_assert", "modules/rong_exception", "modules/rong_storage",
    "modules/rong_abort", "modules/rong_console", "modules/rong_url", "modules/rong_buffer",
    "modules/rong_fs", "modules/rong_stream", "modules/rong_process", "modules/rong_child_process",
    "rong_modules", "rong_cli"
]

[workspace.package]
version = "0.2.0"
edition = "2024"
license = "MIT OR Apache-2.0"
repository = "https://github.com/LingXia-Dev/Rong"
readme = "README.md"

[workspace.dependencies]
# Internal dependencies
rong = { path = ".", default-features = false   , version = "0.2.0" }
rong_core = { path = "core"   , version = "0.2.0" }
rong_quickjs = { path = "quickjs"   , version = "0.2.0" }
rong_quickjs_sys = { path = "quickjs/sys"   , version = "0.2.0" }
rong_jscore = { path = "javascriptcore"   , version = "0.2.0" }
rong_jscore_sys = { path = "javascriptcore/sys"   , version = "0.2.0" }
rong_arkjs = { path = "arkjs"   , version = "0.2.0" }
rong_arkjs_sys = { path = "arkjs/sys"   , version = "0.2.0" }
rong_macro = { path = "macro"   , version = "0.2.0" }
rong_test = { path = "utils/rong_test", default-features = false }
rong_modules = { path = "rong_modules"   , version = "0.2.0" }

# Module dependencies
rong_timer = { path = "modules/rong_timer"   , version = "0.2.0", default-features = false }
rong_console = { path = "modules/rong_console"   , version = "0.2.0", default-features = false }
rong_assert = { path = "modules/rong_assert"   , version = "0.2.0", default-features = false }
rong_fs = { path = "modules/rong_fs"   , version = "0.2.0", default-features = false }
rong_http = { path = "modules/rong_http"   , version = "0.2.0", default-features = false }
rong_encoding = { path = "modules/rong_encoding"   , version = "0.2.0", default-features = false }
rong_event = { path = "modules/rong_event"   , version = "0.2.0", default-features = false }
rong_exception = { path = "modules/rong_exception"   , version = "0.2.0", default-features = false }
rong_abort = { path = "modules/rong_abort"   , version = "0.2.0", default-features = false }
rong_url = { path = "modules/rong_url"   , version = "0.2.0", default-features = false }
rong_buffer = { path = "modules/rong_buffer"   , version = "0.2.0", default-features = false }
rong_stream = { path = "modules/rong_stream"   , version = "0.2.0", default-features = false }
rong_navigator = { path = "modules/rong_navigator"   , version = "0.2.0", default-features = false }
rong_path = { path = "modules/rong_path"   , version = "0.2.0", default-features = false }
rong_storage = { path = "modules/rong_storage"   , version = "0.2.0", default-features = false }
rong_process = { path = "modules/rong_process"   , version = "0.2.0", default-features = false }
rong_child_process = { path = "modules/rong_child_process"   , version = "0.2.0", default-features = false }

# External dependencies
tokio = { version = "1.49", features = ["rt", "rt-multi-thread", "time", "macros", "sync", "fs", "io-util", "process", "io-std"] }
futures = "0.3.31"
thiserror = "2.0.9"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

# Additional common dependencies
http = { package = "http", version = "1.4" }
http-body-util = "0.1.3"
hyper = { version = "1.8.1", features = ["client", "http1"] }
hyper-util = { version = "0.1.19", features = ["client", "http1", "tokio"] }
hyper-rustls = { version = "0.27.7", default-features = false, features = ["webpki-roots", "http1", "tls12"] }
rustls = { version = "0.23", default-features = false }
flate2 = { version = "1.1.0" }
uuid = { version = "1.19.0", features = ["v4"] }
axum = { version = "0.8.8", features = ["http1"] }
nix = { version = "0.31", features = ["user", "fs"] }
syn = { version = "2.0", features = ["full"] }
bytes = "1.11.0"
tokio-stream = "0.1.18"


[package]
name = "rong"
version.workspace = true
edition.workspace = true

description = "RongJS runtime and embedding API"
license.workspace = true
repository.workspace = true
readme.workspace = true
[dependencies]
rong_core = { workspace = true }
rong_quickjs = { workspace = true, optional = true }
rong_jscore = { workspace = true, optional = true }
# rong_arkjs = { workspace = true, optional = true }  # Not published to crates.io yet
rong_macro = { workspace = true }
tokio = { workspace = true }
futures = { workspace = true }

[features]
# Default engine for out-of-the-box DX.
# Use `--no-default-features --features jscore` to switch engine.
default = ["quickjs"]
quickjs = ["dep:rong_quickjs", "rong_test/quickjs"]
jscore = ["dep:rong_jscore", "rong_test/jscore"]
arkjs = []  # Placeholder: arkjs engine not available on crates.io yet

[dev-dependencies]
rong_test = { workspace = true }

[profile.test]
debug = true
