[package]
name = "tinymist-cli"
description = "An integrated language service for Typst."
categories = ["compilers", "command-line-utilities"]
keywords = ["cli", "lsp", "language", "typst"]
authors.workspace = true
version.workspace = true
license.workspace = true
edition.workspace = true
homepage.workspace = true
repository.workspace = true
rust-version.workspace = true

[[bin]]
name = "tinymist"
path = "src/main.rs"
doc = false

[dependencies]
anyhow.workspace = true
async-trait.workspace = true
base64.workspace = true
chrono.workspace = true
clap.workspace = true
clap_builder.workspace = true
clap_complete.workspace = true
clap_complete_fig.workspace = true
clap_complete_nushell.workspace = true
clap_mangen.workspace = true
crossbeam-channel.workspace = true
codespan-reporting.workspace = true
comemo.workspace = true
dhat = { workspace = true, optional = true }
dirs.workspace = true
env_logger.workspace = true
futures.workspace = true
hyper.workspace = true
hyper-util = { workspace = true, features = [
    "server",
    "http1",
    "http2",
    "server-graceful",
    "server-auto",
] }
http-body-util.workspace = true
hyper-tungstenite = { workspace = true, optional = true }
itertools.workspace = true
lsp-types.workspace = true
log.workspace = true
open = { workspace = true, optional = true }
parking_lot.workspace = true
paste.workspace = true
rayon.workspace = true
reflexo.workspace = true
reflexo-typst = { workspace = true, features = ["system", "svg"] }
reflexo-vec2svg.workspace = true
rpds.workspace = true
serde.workspace = true
serde_json.workspace = true
serde_yaml.workspace = true
strum.workspace = true
sync-ls = { workspace = true, features = ["lsp", "server", "system"] }
tinymist = { workspace = true, default-features = false, features = ["system"] }
tinymist-assets = { workspace = true }
tinymist-debug.workspace = true
tinymist-l10n.workspace = true
tinymist-preview = { workspace = true, optional = true }
tinymist-project = { workspace = true, features = ["lsp"] }
tinymist-query.workspace = true
tinymist-render.workspace = true
tinymist-std = { workspace = true, default-features = false }
tinymist-task.workspace = true
tokio = { workspace = true, features = ["rt-multi-thread", "io-std"] }
tokio-util.workspace = true
toml.workspace = true
ttf-parser.workspace = true
typlite = { workspace = true, default-features = false }
typst.workspace = true
typst-ansi-hl.workspace = true
typst-html.workspace = true
typst-pdf.workspace = true
typst-render.workspace = true
typst-shim.workspace = true
typst-svg.workspace = true
typst-timing.workspace = true
typstfmt.workspace = true
typstyle-core.workspace = true
unicode-script.workspace = true
walkdir.workspace = true

dapts.workspace = true

[features]
default = [
    "cli",
    "battery",
    "pdf",
    "l10n",
    "lock",
    "export",
    "open",
    "preview",
    "trace",
    "embed-fonts",
    "no-content-hint",
    "dap",
]

cli = ["sync-ls/clap", "clap/wrap_help"]

dhat-heap = ["dhat"]

# Embeds Typst's default fonts for
# - text (Linux Libertine),
# - math (New Computer Modern Math), and
# - code (Deja Vu Sans Mono)
# and additionally New Computer Modern for text
# into the binary.
embed-fonts = ["tinymist-project/fonts"]

pdf = ["tinymist-task/pdf"]

# Disable the default content hint.
# This requires modifying typst.
no-content-hint = [
    "tinymist-task/no-content-hint",
    "tinymist-project/no-content-hint",
    "tinymist-preview/no-content-hint",
    "typlite/no-content-hint",
    "reflexo-typst/no-content-hint",
    "reflexo-vec2svg/no-content-hint",
]

export = ["tinymist/export"]
lock = ["tinymist/lock"]
open = ["tinymist/open", "dep:open"]
preview = ["tinymist/preview", "tinymist-preview", "hyper-tungstenite"]
trace = ["tinymist/trace"]
battery = ["tinymist/battery"]

dap = ["tinymist/dap"]

l10n = ["tinymist-assets/l10n"]

[dev-dependencies]
temp-env.workspace = true

[build-dependencies]
anyhow.workspace = true
cargo_metadata = "0.18.0"
vergen.workspace = true

[lints]
workspace = true
