| [workspace] | |
| resolver = "3" | |
| members = ["crates/*", "examples/gallery-rs/native", "examples/rust-exports/native", "examples/embed-gpui/run"] | |
| # The GPUI backend is a workspace of its own (`crates/gpui/Cargo.toml`). | |
| exclude = ["crates/gpui", "third-party/gpui-wgpu", "third-party/icy_sixel"] | |
| # `cargo run` runs the gallery (`crates/xtask/src/run.rs`). | |
| default-members = ["crates/xtask"] | |
| [workspace.package] | |
| version = "0.2.0" | |
| edition = "2024" | |
| license = "Apache-2.0" | |
| homepage = "https://nsh.dev" | |
| readme = "README.md" | |
| repository = "https://github.com/longbridge/nsh" | |
| # The crates published to crates.io (the libraries embedders and apps depend | |
| # on, and the development hosts and release runners the CLI builds an app | |
| # with Rust crates of its own from) do not inherit this; they set | |
| # `homepage`, `readme` and `repository` instead. | |
| publish = false | |
| [workspace.lints.rust] | |
| missing_docs = "warn" | |
| unreachable_pub = "deny" | |
| private_interfaces = "deny" | |
| [workspace.dependencies] | |
| unicode-linebreak = "0.1.5" | |
| nsh-core = { version = "0.2.0", path = "crates/nsh-core" } | |
| nsh-package = { version = "0.2.0", path = "crates/nsh-package" } | |
| # Without `highlight`: the platforms turn it on, the CLI and the bundler leave it off. | |
| nsh-base = { version = "0.2.0", path = "crates/nsh-base", default-features = false } | |
| nsh-macros = { version = "0.2.0", path = "crates/nsh-macros" } | |
| nsh-js = { version = "0.2.0", path = "crates/nsh-js" } | |
| nsh-engine = { version = "0.2.0", path = "crates/nsh-engine", default-features = false } | |
| nsh-bundler = { version = "0.2.0", path = "crates/nsh-bundler", default-features = false } | |
| nsh-platform-ios = { version = "0.2.0", path = "crates/nsh-platform-ios", default-features = false } | |
| nsh-platform-android = { version = "0.2.0", path = "crates/nsh-platform-android", default-features = false } | |
| nsh-platform-linux = { version = "0.2.0", path = "crates/nsh-platform-linux", default-features = false } | |
| nsh-platform-macos = { version = "0.2.0", path = "crates/nsh-platform-macos", default-features = false } | |
| nsh-platform-windows = { version = "0.2.0", path = "crates/nsh-platform-windows", default-features = false } | |
| nsh-platform-tui = { version = "0.2.0", path = "crates/nsh-platform-tui", default-features = false } | |
| nsh-dev = { version = "0.2.0", path = "crates/nsh-dev" } | |
| nsh-testing = { version = "0.2.0", path = "crates/nsh-testing", default-features = false } | |
| anyhow = "1" | |
| thiserror = "2" | |
| clap = { version = "4.6", features = ["derive"] } | |
| crossbeam-channel = "0.5" | |
| ratatui = { version = "0.30", default-features = false, features = ["crossterm"] } | |
| ratatui-image = { version = "11.1", default-features = false, features = ["crossterm"] } | |
| crossterm = { version = "0.29", features = ["event-stream", "bracketed-paste"] } | |
| unicode-segmentation = "1.12" | |
| unicode-width = "0.2" | |
| unicode-bidi = "0.3" | |
| tiny-skia = "0.12" | |
| fontdb = { version = "0.23", default-features = false, features = ["std", "fs", "fontconfig"] } | |
| rustybuzz = "0.20" | |
| signal-hook = "0.3" | |
| notify = "8.2" | |
| log = "0.4" | |
| env_logger = "0.11" | |
| libc = "0.2" | |
| imagesize = "0.15" | |
| # SVG images on the native backends (`nsh-core` feature `svg`): no text, | |
| # system fonts or raster images, so an SVG never reads files or fonts. | |
| resvg = { version = "0.46", default-features = false } | |
| ttf-parser = "0.25" | |
| oxc_sourcemap = "9" | |
| serde = { version = "1", features = ["derive"] } | |
| serde_json = "1" | |
| plist = "1.7" | |
| zip = { version = "8", default-features = false, features = ["deflate"] } | |
| image = { version = "0.25", default-features = false, features = ["png"] } | |
| axum = { version = "0.8", default-features = false, features = ["http1", "tokio", "ws"] } | |
| tungstenite = { version = "0.30", default-features = false, features = ["handshake"] } | |
| rustc-hash = "2.1" | |
| proc-macro2 = "1" | |
| quote = "1" | |
| syn = { version = "2", features = ["full"] } | |
| ed25519-dalek = { version = "2.1", default-features = false, features = ["std", "fast", "zeroize"] } | |
| sha2 = "0.10" | |
| flate2 = "1" | |
| # Test payloads for the zlib module, at the versions LLRT's compression uses. | |
| brotli = { version = "9", default-features = false, features = ["std"] } | |
| zstd = { version = "0.14", default-features = false } | |
| tar = { version = "0.4", default-features = false } | |
| base64 = "0.22" | |
| getrandom = "0.3" | |
| slab = "0.4" | |
| percent-encoding = "2.3" | |
| url = "2.5" | |
| ureq = "3.1" | |
| regex = "1" | |
| markdown = "1.0.0" | |
| html5ever = "0.27" | |
| markup5ever_rcdom = "0.3.0" | |
| # Syntax highlighting of TextView code blocks (`nsh-base` feature `highlight`): pure-Rust | |
| # regexes, so it builds for WebAssembly; two-face carries the syntaxes (bat's set). | |
| syntect = { version = "5.3.0", default-features = false, features = ["parsing", "regex-fancy"] } | |
| two-face = { version = "0.4.5", default-features = false, features = ["syntect-fancy"] } | |
| jni = "0.21" | |
| windows-sys = "0.61" | |
| dunce = "1" | |
| semver = "1" | |
| # The Windows backend: Win32 windows, Direct2D / DirectWrite drawing, WIC images, | |
| # UI Automation. Features per area, like the Apple bindings below. | |
| windows = { version = "0.62", features = [ | |
| "std", | |
| "Foundation_Numerics", | |
| "Win32_Foundation", | |
| "Win32_Globalization", | |
| "Win32_Graphics_Direct2D", | |
| "Win32_Graphics_Direct2D_Common", | |
| "Win32_Graphics_Direct3D", | |
| "Win32_Graphics_Direct3D11", | |
| "Win32_Graphics_DirectComposition", | |
| "Win32_Graphics_DirectWrite", | |
| "Win32_Graphics_Dwm", | |
| "Win32_Graphics_Dxgi", | |
| "Win32_Graphics_Dxgi_Common", | |
| "Win32_Graphics_Gdi", | |
| "Win32_Graphics_Imaging", | |
| "Win32_Graphics_Imaging_D2D", | |
| "Win32_Media_MediaFoundation", | |
| "Win32_Storage_Xps", | |
| "Win32_System_Com", | |
| "Win32_System_Com_StructuredStorage", | |
| "Win32_System_DataExchange", | |
| "Win32_System_Diagnostics_Debug", | |
| "Win32_System_LibraryLoader", | |
| "Win32_System_Memory", | |
| "Win32_System_Ole", | |
| "Win32_System_Performance", | |
| "Win32_System_Registry", | |
| "Win32_System_SystemInformation", | |
| "Win32_System_SystemServices", | |
| "Win32_System_Threading", | |
| "Win32_System_Variant", | |
| "Win32_System_WinRT", | |
| "Win32_UI_Accessibility", | |
| "Win32_UI_Controls", | |
| "Win32_UI_HiDpi", | |
| "Win32_UI_Input_Ime", | |
| "Win32_UI_Input_KeyboardAndMouse", | |
| "Win32_UI_Input_Pointer", | |
| "Win32_UI_Shell", | |
| "Win32_UI_Shell_Common", | |
| "Win32_UI_WindowsAndMessaging", | |
| ] } | |
| windows-core = "0.62" | |
| windows-numerics = "0.3" | |
| # WebView2 (the Windows backend's web views): bindings and the static loader. | |
| webview2-com = "0.39" | |
| # The Linux backend (GTK 4.14+: Ubuntu 24.04, Debian 13, Fedora 40). | |
| gtk4 = { version = "0.11", features = ["v4_14"] } | |
| pango = "0.22" | |
| pangocairo = "0.22" | |
| # The Linux backend's web views (its feature `webview`): WebKitGTK 6.0 (2.40+). | |
| webkit6 = "0.6" | |
| taffy = { version = "0.15", default-features = false, features = ["std", "taffy_tree", "flexbox", "grid", "block_layout", "content_size"] } | |
| # Features per crate: the runtime's binaries get only what they use. | |
| tokio = { version = "1", default-features = false } | |
| # The same QuickJS binding and standard modules run on every platform; the JIT | |
| # stays disabled on wasm, preserving the native compiler's bytecode format. | |
| # `full` is avoided on purpose: it enables `dyn-load` (dlopen2), which does not build for iOS / Catalyst. | |
| rquickjs = { package = "quickjs-jit", version = "=0.14.1", default-features = false, features = ["std", "futures", "loader", "macro"] } | |
| # The standard modules `buffer`, `crypto`, `path`, `url` and `zlib` (all targets): LLRT d9fd873e, | |
| # vendored by quickjs-jit-stdlib, on NSH's exact QuickJS VM. Privileged I/O stays behind NSH grants. | |
| quickjs-jit-stdlib = { version = "=0.14.1", default-features = false, features = ["buffer", "crypto", "path", "zlib", "zlib-zstd"] } | |
| getrandom-stdlib = { package = "getrandom", version = "0.4", default-features = false } | |
| cap-std = "4.0.3" | |
| futures-util = { version = "0.3", features = ["sink"] } | |
| tokio-tungstenite = { version = "0.28", default-features = false, features = ["connect", "rustls-tls-webpki-roots"] } | |
| rolldown = "=1.2.13" | |
| rolldown_common = "=1.2.13" | |
| string_wizard = { version = "=1.2.13", features = ["sourcemap"] } | |
| oxc = { version = "=0.153.0", features = ["transformer", "codegen", "semantic", "ast_visit"] } | |
| # Apple bindings: default features off. The defaults pull in every header | |
| # and link frameworks we never use (CloudKit, CoreData, Metal, ...), which | |
| # costs compile time and app launch time (dyld loads each linked framework). | |
| objc2 = "0.6.5" | |
| objc2-foundation = { version = "0.3.2", default-features = false, features = [ | |
| "std", | |
| "block2", | |
| "NSArray", | |
| "NSAttributedString", | |
| "NSBundle", | |
| "NSCache", | |
| "NSData", | |
| "NSDictionary", | |
| "NSDate", | |
| "NSDistributedNotificationCenter", | |
| "NSEnumerator", | |
| "NSError", | |
| "NSGeometry", | |
| "NSKeyValueObserving", | |
| "NSLocale", | |
| "NSNotification", | |
| "NSObject", | |
| "NSOperation", | |
| "NSProcessInfo", | |
| "NSRange", | |
| "NSRunLoop", | |
| "NSSet", | |
| "NSStream", | |
| "NSString", | |
| "NSThread", | |
| "NSTimer", | |
| "NSURL", | |
| "NSURLRequest", | |
| "NSURLResponse", | |
| "NSURLSession", | |
| "NSUserDefaults", | |
| "NSValue", | |
| ] } | |
| objc2-ui-kit = { version = "0.3.2", default-features = false, features = [ | |
| "std", | |
| "block2", | |
| "objc2-core-foundation", | |
| "objc2-core-graphics", | |
| "objc2-quartz-core", | |
| "NSAttributedString", | |
| "UIBarAppearance", | |
| "UIBehavioralStyle", | |
| "UIBarButtonItem", | |
| "UIBarItem", | |
| "UINavigationBar", | |
| "UINavigationBarAppearance", | |
| "UINavigationController", | |
| "UINavigationItem", | |
| "UIOrientation", | |
| "UIPresentationController", | |
| "UIViewControllerTransitionCoordinator", | |
| "UIAccessibility", | |
| "UIAccessibilityConstants", | |
| "UIAlertController", | |
| "UIPopoverPresentationController", | |
| "UIPopoverSupport", | |
| "UIAccessibilityCustomAction", | |
| "UIAccessibilityIdentification", | |
| "UIEvent", | |
| "UIGestureRecognizerSubclass", | |
| "UIPinchGestureRecognizer", | |
| "UIRotationGestureRecognizer", | |
| "UITouch", | |
| "NSLayoutAnchor", | |
| "NSLayoutConstraint", | |
| "NSText", | |
| "NSTextContainer", | |
| "UIActivityIndicatorView", | |
| "UIApplication", | |
| "UIColor", | |
| "UIControl", | |
| "UIDevice", | |
| "UIFont", | |
| "UIFontDescriptor", | |
| "UIGeometry", | |
| "UIGestureRecognizer", | |
| "UIGraphics", | |
| "UIImage", | |
| "UIInterface", | |
| "UILabel", | |
| "UILayoutGuide", | |
| "UILongPressGestureRecognizer", | |
| "UIMenuController", | |
| "UIPasteboard", | |
| "UIPanGestureRecognizer", | |
| "UIRefreshControl", | |
| "UIResponder", | |
| "UIScene", | |
| "UISceneConfiguration", | |
| "UISceneDefinitions", | |
| "UISceneOptions", | |
| "UISceneSession", | |
| "UIScreen", | |
| "UIScrollView", | |
| "UITapGestureRecognizer", | |
| "UITextField", | |
| "UITextInput", | |
| "UITextInputTraits", | |
| "UITextInteraction", | |
| "UITextView", | |
| "UITraitCollection", | |
| "UIView", | |
| "UIViewController", | |
| "UIWindow", | |
| "UIWindowScene", | |
| "UIBlurEffect", | |
| "UIHoverGestureRecognizer", | |
| "UIHoverStyle", | |
| "UIInteraction", | |
| "UIPointerInteraction", | |
| "UIPointerRegion", | |
| "UIPointerStyle", | |
| "UITargetedPreview", | |
| "UITimingCurveProvider", | |
| "UITimingParameters", | |
| "UIViewAnimating", | |
| "UIViewPropertyAnimator", | |
| "UIVisualEffect", | |
| "UIVisualEffectView", | |
| ] } | |
| # The macOS performance monitor's per-process GPU time (the IO registry). | |
| objc2-io-kit = { version = "0.3.2", default-features = false, features = ["std", "libc"] } | |
| objc2-core-foundation = { version = "0.3.2", default-features = false, features = [ | |
| "std", | |
| "CFArray", | |
| "CFAttributedString", | |
| "CFCGTypes", | |
| "CFData", | |
| "CFDictionary", | |
| "CFNumber", | |
| "CFString", | |
| "CFURL", | |
| ] } | |
| objc2-core-graphics = { version = "0.3.2", default-features = false, features = [ | |
| "std", | |
| "CGBitmapContext", | |
| "CGColor", | |
| "CGColorSpace", | |
| "CGContext", | |
| "CGEvent", | |
| "CGEventTypes", | |
| "CGGradient", | |
| "CGImage", | |
| "CGPath", | |
| "CGWindowLevel", | |
| ] } | |
| objc2-core-text = { version = "0.3.2", default-features = false, features = [ | |
| "std", | |
| "objc2-core-graphics", | |
| "CTFont", | |
| "CTFontDescriptor", | |
| "CTFontManager", | |
| "CTFontTraits", | |
| "CTFrame", | |
| "CTFramesetter", | |
| "CTLine", | |
| "CTParagraphStyle", | |
| "CTRun", | |
| "CTRunDelegate", | |
| "CTStringAttributes", | |
| "CTTypesetter", | |
| ] } | |
| objc2-image-io = { version = "0.3.2", default-features = false, features = [ | |
| "std", | |
| "objc2-core-graphics", | |
| "CGImageProperties", | |
| "CGImageSource", | |
| ] } | |
| block2 = "0.6.2" | |
| objc2-quartz-core = { version = "0.3.2", default-features = false, features = [ | |
| "std", | |
| "objc2-core-foundation", | |
| "objc2-core-graphics", | |
| "CADisplayLink", | |
| "CAFrameRateRange", | |
| "CALayer", | |
| "CATransform3D", | |
| "CAAnimation", | |
| "CAMediaTiming", | |
| "CAShapeLayer", | |
| "CATransaction", | |
| "CAGradientLayer", | |
| "CAMediaTimingFunction", | |
| "CABase", | |
| ] } | |
| dispatch2 = "0.3.1" | |
| # The macOS backend (AppKit). | |
| objc2-app-kit = { version = "0.3.2", default-features = false, features = [ | |
| "std", | |
| "block2", | |
| "objc2-core-foundation", | |
| "objc2-core-graphics", | |
| "objc2-quartz-core", | |
| "NSAccessibility", | |
| "NSAccessibilityConstants", | |
| "NSAccessibilityCustomAction", | |
| "NSAccessibilityElement", | |
| "NSAccessibilityProtocols", | |
| "NSAlert", | |
| "NSAnimationContext", | |
| "NSAppearance", | |
| "NSApplication", | |
| "NSAttributedString", | |
| "NSBezierPath", | |
| "NSBitmapImageRep", | |
| "NSButton", | |
| "NSButtonCell", | |
| "NSCell", | |
| "NSColor", | |
| "NSColorSpace", | |
| "NSControl", | |
| "NSCursor", | |
| "NSDragging", | |
| "NSEvent", | |
| "NSFont", | |
| "NSFontDescriptor", | |
| "NSGraphics", | |
| "NSGraphicsContext", | |
| "NSImage", | |
| "NSImageRep", | |
| "NSLayoutConstraint", | |
| "NSMenu", | |
| "NSMenuItem", | |
| "NSParagraphStyle", | |
| "NSPasteboard", | |
| "NSPasteboardItem", | |
| "NSProgressIndicator", | |
| "NSResponder", | |
| "NSRunningApplication", | |
| "NSScreen", | |
| "NSScrollView", | |
| "NSSecureTextField", | |
| "NSText", | |
| "NSTextContainer", | |
| "NSTextField", | |
| "NSTextFieldCell", | |
| "NSTextInputClient", | |
| "NSTextInputContext", | |
| "NSTextStorage", | |
| "NSTextView", | |
| "NSToolbar", | |
| "NSTrackingArea", | |
| "NSUserInterfaceItemIdentification", | |
| "NSView", | |
| "NSVisualEffectView", | |
| "NSWindow", | |
| "NSWorkspace", | |
| ] } | |
| [profile.release] | |
| opt-level = 3 | |
| lto = "fat" | |
| codegen-units = 1 | |
| # Keep the interpreter and layout fast even in debug builds; they dominate runtime cost. | |
| [profile.dev.package.quickjs-jit-sys] | |
| opt-level = 3 | |
| [profile.dev.package.taffy] | |
| opt-level = 3 | |
| # Syntax highlighting (TextView's code blocks): unoptimized, a block takes seconds. | |
| [profile.dev.package.syntect] | |
| opt-level = 3 | |
| [profile.dev.package.fancy-regex] | |
| opt-level = 3 | |
| # What fancy-regex runs its regexes with (also `regex`'s). | |
| [profile.dev.package.regex-automata] | |
| opt-level = 3 | |
| [profile.dev.package.regex-syntax] | |
| opt-level = 3 | |
| [profile.dev.package.objc2] | |
| opt-level = 3 | |
| [profile.dev.package.objc2-encode] | |
| opt-level = 3 | |
| # SVG images are drawn when they load: unoptimized, a large one takes seconds. | |
| [profile.dev.package.tiny-skia] | |
| opt-level = 3 | |
| [profile.dev.package.tiny-skia-path] | |
| opt-level = 3 | |
| [profile.dev.package.resvg] | |
| opt-level = 3 | |
| [profile.dev.package.usvg] | |
| opt-level = 3 | |
| # The web runtime (`nsh.wasm`): what pages download, so Rust is optimized for | |
| # size (3.7 MB instead of 5.0, 1.0 MB with brotli); QuickJS keeps `-O3`, as | |
| # the interpreter is the slowest link (it is 0.45 MB of the difference). | |
| [profile.web] | |
| inherits = "release" | |
| opt-level = "z" | |
| strip = true | |
| panic = "abort" | |
| [profile.web.package.quickjs-jit-sys] | |
| opt-level = 3 | |
| # Same codec as ratatui-image; only its output sink is made fallible. | |
| [patch.crates-io] | |
| icy_sixel = { path = "third-party/icy_sixel" } |