pixelsrc 0.2.0

Pixelsrc - GenAI-native pixel art format and compiler
Documentation
[package]
name = "pixelsrc"
version = "0.2.0"
edition = "2021"
description = "Pixelsrc - GenAI-native pixel art format and compiler"
license = "MIT"
repository = "https://github.com/scbrown/pixelsrc"
homepage = "https://github.com/scbrown/pixelsrc"
keywords = ["pixel-art", "sprite", "gamedev", "genai", "wasm"]
categories = ["graphics", "game-development", "wasm"]
readme = "README.md"

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

[[bin]]
name = "pxl"
path = "src/main.rs"

[features]
default = ["lsp"]
lsp = ["tower-lsp", "tokio"]
wasm = ["wasm-bindgen", "console_error_panic_hook"]

[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
toml = "0.8"
image = "0.24"
clap = { version = "4.0", features = ["derive"] }
glob = "0.3"
wasm-bindgen = { version = "0.2", optional = true }
console_error_panic_hook = { version = "0.1", optional = true }
regex = "1.12.2"
notify = "6.1"
atty = "0.2"
# CSS parsing - using minimal features for WASM compatibility
# Note: bundler and visitor features are NOT available in WASM builds
lightningcss = { version = "1.0.0-alpha.68", default-features = false, features = ["serde"] }
notify-debouncer-mini = "0.4"
rayon = "1.10"
thiserror = "1.0"
tower-lsp = { version = "0.20", optional = true }
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "io-std"], optional = true }

[dev-dependencies]
tempfile = "3"
wasm-bindgen-test = "0.3"
serial_test = "3.0"
sha2 = "0.10"

# Criterion uses rayon which doesn't work on WASM
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }

[[bench]]
name = "critical_paths"
harness = false

[target.'cfg(target_arch = "wasm32")'.dependencies]
# Enable js feature for getrandom to support WASM (required by lightningcss -> ahash -> getrandom)
getrandom = { version = "0.3", features = ["wasm_js"] }

[profile.release]
lto = true
strip = true
codegen-units = 1
panic = "abort"

# Skip wasm-opt to avoid version compatibility issues with bulk memory operations
[package.metadata.wasm-pack.profile.release]
wasm-opt = false

[package.metadata.wasm-pack.profile.dev]
wasm-opt = false

# =============================================================================
# Linting Configuration
# =============================================================================

[lints.rust]
# Forbid unsafe code - this is a pixel art tool, no need for unsafe
unsafe_code = "forbid"

[lints.clippy]
# Enable all common lints (lower priority so individual allows can override)
all = { level = "warn", priority = -1 }

# Warn on common development artifacts that shouldn't be committed
todo = "warn"
dbg_macro = "warn"

# Allow these lints - they're either false positives or intentional patterns
cloned_ref_to_slice_refs = "allow"
needless_range_loop = "allow"       # Sometimes clearer than enumerate()
should_implement_trait = "allow"    # Custom impl choices are intentional
too_many_arguments = "allow"        # Sprite/animation functions need many params
ptr_arg = "allow"                   # &String/&Vec are sometimes clearer
doc_overindented_list_items = "allow"
match_overlapping_arm = "allow"
match_like_matches_macro = "allow"  # Explicit match is sometimes clearer
vec_init_then_push = "allow"        # Sometimes clearer than collect()
useless_vec = "allow"
derivable_impls = "allow"           # Custom Default impls are sometimes clearer
unnecessary_unwrap = "allow"
manual_range_contains = "allow"     # x >= 0 && x < n is sometimes clearer
field_reassign_with_default = "allow"  # Sometimes clearer to assign after default