[package]
name = "bevy-brink"
version.workspace = true
edition.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true
keywords.workspace = true
categories.workspace = true
description = "Bevy asset integration for brink ink stories"

# Render all features on docs.rs (the optional compiler/syntax bindings).
[package.metadata.docs.rs]
all-features = true

[dependencies]
brink-runtime = { workspace = true }
brink-format = { workspace = true }
bevy-brink-derive = { workspace = true }
brink-compiler = { workspace = true, optional = true }
brink-syntax = { workspace = true, optional = true }

bevy_app = { version = "0.18.1", default-features = false }
bevy_asset = { version = "0.18.1", default-features = false }
bevy_ecs = { version = "0.18.1", default-features = false }
bevy_input = { version = "0.18.1", default-features = false, features = ["std", "keyboard"] }
bevy_log = { version = "0.18.1", default-features = false }
bevy_reflect = { version = "0.18.1", default-features = false }
# Async-task bindings (bind_brink_task) spawn detached futures on
# AsyncComputeTaskPool and poll them via poll_once/block_on. `multi_threaded`
# matches what bevy_app's DefaultPlugins set up so spawned work runs off the
# main thread; `futures-lite` (default) supplies poll_once + block_on.
bevy_tasks = { version = "0.18.1", features = ["multi_threaded"] }

bon.workspace = true
serde.workspace = true
thiserror.workspace = true

[features]
default = ["dev"]
# Dev mode: load `.ink` source files, compile at load time, hot-reload
# the program when any file in the transitive INCLUDE graph changes.
# Without this feature only compiled `.inkb` (and eventually `.inkl`,
# `.brkt`) assets are loadable — suitable for shipping a release binary
# that doesn't carry the brink compiler.
dev = ["dep:brink-compiler", "dep:brink-syntax"]

[dev-dependencies]
# The `play_story` example uses the bevy umbrella crate for windowing,
# UI, input, and the file_watcher feature that drives hot-reload.
bevy = { version = "0.18.1", features = ["file_watcher"] }
# Tests compile small inline ink stories to exercise the loader/replay
# code paths. brink-compiler is also pulled in via the `dev` feature
# in the regular dependency set, but adding it as a dev-dep means
# tests work even when someone disables default features.
brink-compiler = { path = "../brink-compiler" }
# Enable brink-runtime's `testing` feature so tests can introspect
# globals by name (Program::global_count, Program::global_name).
brink-runtime = { path = "../brink-runtime", features = ["testing"]  }
# The locale example + tests build `.inkl` overlays via the intl pipeline
# (export_lines + compile_locale).
brink-intl = { path = "../internal/brink-intl" }

[[example]]
name = "play_story"
required-features = ["dev"]

# Headless demo of the engine↔ink dynamic binding facility
# (bind_brink_query / call_ink_function / commands.brink_call / advance_flow).
[[example]]
name = "engine_bindings"

# Headless demo of global, event-driven locale switching (.inkl overlays).
[[example]]
name = "locale_switch"

# Headless demo of .brkt transcript persistence (capture / reload / re-render).
[[example]]
name = "transcript_save"

# Headless demo of bind_brink_task: an async external resolved by a detached
# task on AsyncComputeTaskPool, across frames.
[[example]]
name = "async_task"

# Headless demo of bind_brink_async: the event+resolve primitive for a
# multi-frame World interaction (targeting UI), via BrinkExternalAwaited +
# resolve_brink_external.
[[example]]
name = "async_external"

[lints]
workspace = true
