dure 0.2.6

Detachable Windows console sessions that outlive the terminal
[package]
name = "dure"
description = "Detachable Windows console sessions that outlive the terminal"
publish = true
version = "0.2.6"

authors.workspace = true
edition.workspace = true
include.workspace = true
license.workspace = true
repository.workspace = true
rust-version.workspace = true

# `dure` is a command-line tool; its Rust API exists only so the in-package binary and the
# integration tests can reach the crate, so the crate root carries
# `#![cfg_attr(docsrs, doc(hidden))]` (see `src/lib.rs`). Documenting the Windows targets is what
# keeps the rendered page the tool's own introduction rather than an empty Linux build, where
# `#![cfg(windows)]` removes the crate.
[package.metadata.docs.rs]
default-target = "x86_64-pc-windows-msvc"
targets = ["x86_64-pc-windows-msvc", "aarch64-pc-windows-msvc"]

# The release workflow publishes prebuilt archives under release-plz's `<crate>-v<version>` tag,
# which cargo-binstall cannot derive on its own. Ref: docs/release-automation.md.
[package.metadata.binstall]
pkg-url = "{ repo }/releases/download/{ name }-v{ version }/{ name }-v{ version }-{ target }.zip"
bin-dir = "{ bin }{ binary-ext }"
pkg-fmt = "zip"

# A non-Windows build compiles to a stub that only reports the unsupported platform
# (docs/implementation.md, "Platform gate"), so a prebuilt archive for any other target would
# install a binary that can never run. Ref: docs/release-automation.md, "Per-crate targets".
[package.metadata.folo]
release-targets = ["x86_64-pc-windows-msvc", "aarch64-pc-windows-msvc"]

# The Windows integration tests are gated behind `private-test-util`, so a default-feature build
# compiles none of them and the helper they drive looks unused. Same reason as `many_cpus`.
[package.metadata.cargo-udeps.ignore]
development = ["dure-test-helper"]

# External types intentionally exposed in the handoff surface. The check fails when a public
# external type matches no entry, so a new exposure is a deliberate, reviewed act rather than an
# oversight. Each is listed individually rather than globbed, so exposing a further type from an
# already-referenced crate still trips the check. Ref: docs/external-types.md.
#
# The `clap` traits arrive with the `Parser` derive on `Cli`, the `serde` traits with the record
# encoding on `AppCommand`, and `AppError` is what `run` hands back for the binary to report.
[package.metadata.cargo_check_external_types]
allowed_external_types = [
    "clap_builder::derive::Args",
    "clap_builder::derive::CommandFactory",
    "clap_builder::derive::FromArgMatches",
    "clap_builder::derive::Parser",
    "ohno::app::error::AppError",
    "serde_core::de::Deserialize",
    "serde_core::ser::Serialize",
]

[features]
# Exposes the in-crate test support and isolated-store override that the Windows
# integration tests use to drive the real PAL. Not part of the product.
private-test-util = []

# Every dependency is Windows-only because the crate itself is: a non-Windows build compiles to a
# stub that only reports the unsupported platform (docs/implementation.md, "Platform gate"), so
# declaring them unconditionally would make them genuinely unused there.
[target.'cfg(windows)'.dependencies]
clap = { workspace = true, features = ["derive"] }
mimalloc = { workspace = true }
ohno = { workspace = true, features = ["app-err"] }
rand = { workspace = true, features = ["thread_rng"] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
windows = { workspace = true, features = [
    "Win32_Foundation",
    "Win32_Globalization",
    "Win32_Security",
    "Win32_Security_Authorization",
    "Win32_Storage_FileSystem",
    "Win32_System_Com",
    "Win32_System_Console",
    "Win32_System_IO",
    "Win32_System_JobObjects",
    "Win32_System_Pipes",
    "Win32_System_Threading",
    "Win32_UI_Shell",
] }

# The non-Windows stub carries a mutation skip of its own, so unlike every other
# dependency this one is named on both platforms.
[dev-dependencies]
mutants = { workspace = true }

[target.'cfg(windows)'.dev-dependencies]
dure-test-helper = { path = "../dure-test-helper" }
mockall = { workspace = true }
static_assertions = { workspace = true }
tempfile = { workspace = true }
testing = { path = "../testing" }

# The end-to-end Windows suite needs the test support above, which is not part of the product and
# is therefore behind a feature. The CLI suite drives `--store-root`, which is behind the same
# private feature. Declaring the requirement here is what makes that visible: a `cargo test -p
# dure` without the feature skips those targets and says so, rather than building empty ones and
# reporting success for coverage it never compiled. The package's own validation
# (`just package=dure validate-local`) enables all features, so both suites always run there.
[[test]]
name = "windows"
required-features = ["private-test-util"]

[[test]]
name = "cli"
required-features = ["private-test-util"]

[lints]
workspace = true