[package]
name = "portfolio"
version = "0.6.0"
edition = "2021"

[lib]
crate-type = ["cdylib", "rlib"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
leptos = { version = "0.6", features = ["nightly"] }
leptos_meta = { version = "0.6", features = ["nightly"] }
leptos_router = { version = "0.6", features = ["nightly"] }
gloo-net = { version = "0.5", features = ["http"] }
log = "0.4"
cfg-if = "1.0"
serde = "1.0"
chrono = { version = "0.4", features = ["serde"] }

# https://carlosted.github.io/icondata/
leptos_icons = "0.3"
icondata = "0.3"

# dependecies for client (enable when csr or hydrate set)
wasm-bindgen = { version = "0.2", optional = true }
console_log = { version = "1.0", optional = true }
console_error_panic_hook = { version = "0.1", optional = true }

# dependecies for server (enable when ssr set)
actix-files = { version = "0.6", optional = true }
actix-web = { version = "4.5", features = ["macros"], optional = true }
leptos_actix = { version = "0.6", optional = true }
futures = { version = "0.3", optional = true }
simple_logger = { version = "4.3", optional = true }
pulldown-cmark = { version = "0.10", optional = true } # Markdown parser
gray_matter = { version = "0.2", optional = true } # frontmatter parser
serde_yaml = { version = "0.9", optional = true }
anyhow = { version = "1.0", optional = true }
thiserror = { version = "1.0", optional = true }
estimated_read_time = { version = "1.0", optional = true }

[features]
default = ["csr"]
hydrate = [
    "leptos/hydrate",
    "leptos_meta/hydrate",
    "leptos_router/hydrate",
    "dep:wasm-bindgen",
    "dep:console_log",
    "dep:console_error_panic_hook",
]
csr = [
    "leptos/csr",
    "leptos_meta/csr",
    "leptos_router/csr",
    "dep:wasm-bindgen",
    "dep:console_log",
    "dep:console_error_panic_hook",
]
ssr = [
    "leptos/ssr",
    "leptos_meta/ssr",
    "leptos_router/ssr",
    "dep:leptos_actix",
    "dep:actix-web",
    "dep:actix-files",
    "dep:futures",
    "dep:simple_logger",
    "dep:pulldown-cmark",
    "dep:gray_matter",
    "dep:serde_yaml",
    "dep:anyhow",
    "dep:thiserror",
    "dep:estimated_read_time"
]

[package.metadata.cargo-all-features]
denylist = [
    "actix-files",
    "actix-web",
    "console_error_panic_hook",
    "console_log",
    "futures",
    "leptos_actix",
    "simple_logger",
    "wasm-bindgen",
]
skip_feature_sets = [["csr", "ssr"], ["csr", "hydrate"], ["ssr", "hydrate"]]

[profile.release]
codegen-units = 1
lto = true
opt-level = 'z'

[package.metadata.leptos]
name = "portfolio"
site-root = "target/site"
site-pkg-dir = "pkg"
style-file = "style/main.scss" # Important for Hot Reload to work properly (File must exist)
tailwind-input-file = "style/portfolio.css"
watch-additional-files = ["data_src"]
assets-dir = "public"
site-addr = "127.0.0.1:3000"
reload-port = 3001
browserquery = "defaults"
watch = false
env = "DEV"

bin-features = ["ssr"]
bin-default-features = false

lib-features = ["hydrate"]
lib-default-features = false