Skip to content

Commit

Permalink
repl: add new Rockbox REPL
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Dec 22, 2024
1 parent 5e18f52 commit af11de1
Show file tree
Hide file tree
Showing 46 changed files with 2,929 additions and 2,184 deletions.
3,354 changes: 2,613 additions & 741 deletions Cargo.lock

Large diffs are not rendered by default.

281 changes: 281 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,285 @@ members = [
]
resolver = "2"

[workspace.package]
authors = ["Tsiry Sandratraina <tsiry.sndr@fluentci.io"]
edition = "2021"
license = "LGPL-2.1"
repository = "https://github.com/tsirysndr/rockbox-zig"

[workspace.dependencies]
async-trait = "0.1.73"
base64 = "0.21.7"
boxed_error = "0.2.3"
bytes = "1.4.0"
cache_control = "=0.2.0"
capacity_builder = "0.1.3"
color-print = "0.3.5"
chrono = { version = "0.4", default-features = false, features = [
"std",
"serde",
] }
console_static_text = "=0.8.1"
dashmap = "5.5.3"
data-encoding = "2.3.3"
deno_ast = { version = "=0.44.0", features = ["transpiling"] }
deno_core = { version = "0.326.0" }
deno_cache_dir = "=0.15.0"
deno_config = { version = "=0.39.3", features = ["workspace", "sync"] }
deno_error = "=0.5.2"
deno_lockfile = "=0.23.2"
deno_npm = "=0.26.0"
deno_npm_cache = { version = "0.3.0", path = "./deno/resolvers/npm_cache" }
deno_resolver = { version = "0.15.0", path = "./deno/resolvers/deno" }
node_resolver = { version = "0.22.0", path = "./deno/resolvers/node" }
deno_runtime = { version = "0.192.0", path = "./deno/runtime" }
deno_permissions = { version = "0.43.0", path = "./deno/runtime/permissions" }
deno_package_json = { version = "0.2.1", default-features = false }
deno_path_util = "=0.2.2"
deno_bench_util = { version = "0.178.0", path = "./deno/bench_util" }
test_util = { package = "test_server", path = "./deno/tests/util/server" }
dlopen2 = "0.6.1"
deno_semver = "=0.6.1"
deno_terminal = "0.2.0"
faster-hex = "0.9"
encoding_rs = "=0.8.33"
flate2 = { version = "1.0.30", default-features = false }
fs3 = "0.5.0"
http = "1.0"
http-body = "1.0"
http-body-util = "0.1.2"
http_v02 = { package = "http", version = "0.2.9" }
httparse = "1.8.0"
hyper = { version = "1.4.1", features = ["full"] }
hyper-rustls = { version = "0.27.2", default-features = false, features = [
"http1",
"http2",
"tls12",
"ring",
] }
hyper-util = { version = "0.1.10", features = [
"tokio",
"client",
"client-legacy",
"server",
"server-auto",
] }
hyper_v014 = { package = "hyper", version = "0.14.26", features = [
"runtime",
"http1",
] }
indexmap = { version = "2", features = ["serde"] }
jsonc-parser = { version = "=0.26.2", features = ["serde"] }
lazy-regex = "3"
libc = "0.2.168"
libz-sys = { version = "1.1.20", default-features = false }
log = { version = "0.4.20", features = ["kv"] }
lsp-types = "=0.97.0" # used by tower-lsp and "proposed" feature is unstable in patch releases
memmem = "0.1.1"
monch = "=0.5.0"
notify = "=6.1.1"
num-bigint = { version = "0.4", features = ["rand"] }
once_cell = "1.17.1"
os_pipe = { version = "=1.1.5", features = ["io_safety"] }
p224 = { version = "0.13.0", features = ["ecdh"] }
p256 = { version = "0.13.2", features = ["ecdh", "jwk"] }
p384 = { version = "0.13.0", features = ["ecdh", "jwk"] }
parking_lot = "0.12.0"
percent-encoding = "2.3.0"
phf = { version = "0.11", features = ["macros"] }
pin-project = "1.0.11" # don't pin because they yank crates from cargo
pretty_assertions = "=1.4.0"
prost = "0.13"
prost-build = "0.13"
rand = "=0.8.5"
regex = "^1.7.0"
reqwest = { version = "=0.12.5", default-features = false, features = [
"rustls-tls",
"stream",
"gzip",
"brotli",
"socks",
"json",
"http2",
] } # pinned because of https://github.com/seanmonstar/reqwest/pull/1955
ring = "^0.17.0"
rusqlite = { version = "0.32.0", features = ["unlock_notify", "bundled"] }
rustls = { version = "0.23.11", default-features = false, features = [
"logging",
"std",
"tls12",
"ring",
] }
rustls-pemfile = "2"
rustls-tokio-stream = "=0.3.0"
rustls-webpki = "0.102"
rustyline = "=13.0.0"
saffron = "=0.1.0"
scopeguard = "1.2.0"
sec1 = "0.7"
serde = { version = "1.0.149", features = ["derive"] }
serde_bytes = "0.11"
serde_json = "1.0.85"
serde_repr = "=0.1.19"
sha1 = { version = "0.10.6", features = ["oid"] }
sha2 = { version = "0.10.8", features = ["oid"] }
signature = "2.1"
slab = "0.4"
smallvec = "1.8"
socket2 = { version = "0.5.3", features = ["all"] }
spki = "0.7.2"
tar = "=0.4.40"
tempfile = "3.4.0"
termcolor = "1.1.3"
thiserror = "2.0.3"
tokio = { version = "1.36.0", features = ["full"] }
tokio-metrics = { version = "0.3.0", features = ["rt"] }
tokio-rustls = { version = "0.26.0", default-features = false, features = [
"ring",
"tls12",
] }
tokio-socks = "0.5.1"
tokio-util = "0.7.4"
tower = { version = "0.5.2", default-features = false, features = [
"retry",
"util",
] }
tower-http = { version = "0.6.1", features = [
"decompression-br",
"decompression-gzip",
] }
tower-lsp = { package = "deno_tower_lsp", version = "0.1.0", features = [
"proposed",
] }
tower-service = "0.3.2"
twox-hash = "=1.6.3"
url = { version = "2.5", features = ["serde", "expose_internals"] }
uuid = { version = "1.3.0", features = ["v4"] }
webpki-root-certs = "0.26.5"
webpki-roots = "0.26"
which = "4.2.5"
yoke = { version = "0.7.4", features = ["derive"] }
zeromq = { version = "=0.4.1", default-features = false, features = [
"tcp-transport",
"tokio-runtime",
] }
zstd = "=0.12.4"
aes = "=0.8.3"
cbc = { version = "=0.1.2", features = ["alloc"] }
rsa = { version = "0.9.3", default-features = false, features = [
"std",
"pem",
"hazmat",
] } # hazmat needed for PrehashSigner in ext/node
bencher = "0.1"
data-url = "=0.3.1"
hickory-resolver = { version = "0.25.0-alpha.4", features = [
"tokio-runtime",
"serde",
] }
ipnet = "2.3"
fast-socks5 = "0.9.6"
filetime = "0.2.16"
brotli = "6.0.0"

# unix
nix = "=0.27.1"

# webgpu
raw-window-handle = "0.6.0"
wgpu-core = "0.21.1"
wgpu-types = "0.20"


# windows deps
junction = "=0.2.0"
winapi = "=0.3.9"
winres = "=0.1.12"
windows-sys = { version = "0.59.0", features = [
"Win32_Foundation",
"Win32_Media",
"Win32_Storage_FileSystem",
"Win32_System_IO",
"Win32_System_WindowsProgramming",
"Wdk",
"Wdk_System",
"Wdk_System_SystemInformation",
"Win32_Security",
"Win32_System_Pipes",
"Wdk_Storage_FileSystem",
"Win32_System_Registry",
"Win32_System_Kernel",
"Win32_System_Threading",
"Win32_UI",
"Win32_UI_Shell",
] }

anyhow = "1.0.57"
deno_unsync = "0.4.2"
futures = "0.3.21"
base32 = "=0.5.1"
deno_media_type = { version = "0.2.0", features = ["module_specifier"] }

denokv_proto = "0.8.4"
denokv_remote = "0.8.4"
# denokv_sqlite brings in bundled sqlite if we don't disable the default features
denokv_sqlite = { default-features = false, version = "0.8.4" }

fastwebsockets = { version = "0.8", features = ["upgrade", "unstable-split"] }
glob = "0.3.1"
h2 = "0.4.4"
ecb = "=0.1.2"
hkdf = "0.12.3"
elliptic-curve = { version = "0.13.4", features = [
"alloc",
"arithmetic",
"ecdh",
"std",
"pem",
"jwk",
] }

# macros
quote = "1"
syn = { version = "2", features = ["full", "extra-traits"] }

# exts
deno_broadcast_channel = { version = "0.178.0", path = "./deno/ext/broadcast_channel" }
deno_cache = { version = "0.116.0", path = "./deno/ext/cache" }
deno_canvas = { version = "0.53.0", path = "./deno/ext/canvas" }
deno_console = { version = "0.184.0", path = "./deno/ext/console" }
deno_cron = { version = "0.64.0", path = "./deno/ext/cron" }
deno_crypto = { version = "0.198.0", path = "./deno/ext/crypto" }
deno_fetch = { version = "0.208.0", path = "./deno/ext/fetch" }
deno_ffi = { version = "0.171.0", path = "./deno/ext/ffi" }
deno_fs = { version = "0.94.0", path = "./deno/ext/fs" }
deno_http = { version = "0.182.0", path = "./deno/ext/http" }
deno_io = { version = "0.94.0", path = "./deno/ext/io" }
deno_kv = { version = "0.92.0", path = "./deno/ext/kv" }
deno_napi = { version = "0.115.0", path = "./deno/ext/napi" }
deno_net = { version = "0.176.0", path = "./deno/ext/net" }
deno_node = { version = "0.122.0", path = "./deno/ext/node" }
deno_rb = { version = "0.1.0", path = "./deno/ext/rb" }
deno_telemetry = { version = "0.6.0", path = "./deno/ext/telemetry" }
deno_tls = { version = "0.171.0", path = "./deno/ext/tls" }
deno_url = { version = "0.184.0", path = "./deno/ext/url" }
deno_web = { version = "0.215.0", path = "./deno/ext/web" }
deno_webgpu = { version = "0.151.0", path = "./deno/ext/webgpu" }
deno_webidl = { version = "0.184.0", path = "./deno/ext/webidl" }
deno_websocket = { version = "0.189.0", path = "./deno/ext/websocket" }
deno_webstorage = { version = "0.179.0", path = "./deno/ext/webstorage" }
napi_sym = { version = "0.114.0", path = "./deno/ext/napi/sym" }

opentelemetry = "0.27.0"
opentelemetry-http = "0.27.0"
opentelemetry-otlp = { version = "0.27.0", features = [
"logs",
"http-proto",
"http-json",
] }
opentelemetry-semantic-conventions = { version = "0.27.0", features = [
"semconv_experimental",
] }
opentelemetry_sdk = "0.27.0"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7 changes: 6 additions & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,19 @@ version = "0.1.0"

[dependencies]
anyhow = "1.0.91"
clap = "4.5.20"
clap = "4.5.16"
opener = "0.7.2"
owo-colors = "4.1.0"
prost = "0.13.2"
tokio = { version = "1.36.0", features = ["full"] }
tonic = "0.12.3"
tonic-reflection = "0.12.3"
tonic-web = "0.12.3"
flate2 = { version = "1.0.30", default-features = false }
zip = { version = "=2.1.6", default-features = false, features = [
"deflate-flate2",
] }
deno = { path = "../deno/cli", features = ["upgrade", "__vendored_zlib_ng"] } # a custom fork of Deno with Rockbox extension

[build-dependencies]
tonic-build = "0.12.3"
1 change: 1 addition & 0 deletions cli/src/cmd/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pub mod community;
pub mod repl;
pub mod scan;
pub mod start;
pub mod webui;
12 changes: 12 additions & 0 deletions cli/src/cmd/repl.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use std::thread;

macro_rules! svec {
($($x:expr),*) => (vec![$($x.to_string().into()), *])
}

pub fn repl() {
let handle = thread::spawn(|| {
deno::cli(svec!["deno", "repl", "-A"]);
});
handle.join().unwrap();
}
10 changes: 9 additions & 1 deletion cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use anyhow::Error;
use clap::{arg, Command};
use owo_colors::OwoColorize;

use cmd::{community::*, scan::*, start::*, webui::*};
use cmd::{community::*, repl::*, scan::*, start::*, webui::*};

pub mod cmd;

Expand Down Expand Up @@ -40,6 +40,11 @@ fn cli() -> Command {
.about("Open the Rockbox web UI in your browser")
.visible_alias("web"),
)
.subcommand(
Command::new("repl")
.about("Start the Rockbox REPL")
.visible_alias("shell"),
)
}

#[tokio::main]
Expand All @@ -60,6 +65,9 @@ async fn main() -> Result<(), Error> {
Some(("webui", _)) => {
webui()?;
}
Some(("repl", _)) => {
repl();
}
_ => {
start()?;
}
Expand Down
2 changes: 1 addition & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ crate-type = ["staticlib"]

[dependencies]
anyhow = "1.0.90"
clap = "4.5.17"
clap = "4.5.16"
owo-colors = "4.1.0"
rockbox-library = {path = "../library"}
rockbox-search = {path = "../search"}
Expand Down
Loading

0 comments on commit af11de1

Please sign in to comment.