panache 2.41.1

An LSP, formatter, and linter for Markdown, Quarto, and R Markdown
version: "3"

tasks:
  lint:
    desc: Run linter
    cmds:
      - cargo clippy --workspace --all-targets --all-features -- -D warnings

  format:
    desc: Check code formatting
    cmds:
      - cargo fmt --

  build-release:
    desc: Build release version
    cmds:
      - cargo build --release

  test:
    desc: Run tests
    cmds:
      - cargo test --workspace

  test-debug:
    desc: Run tests with debug logging
    cmds:
      - RUST_LOG=debug cargo test

  test-trace:
    desc: Run tests with trace logging for parser
    cmds:
      - RUST_LOG=panache::parser=trace cargo test

  test-quiet:
    desc: Run tests quietly (no debug output)
    cmds:
      - RUST_LOG=off cargo test

  dev:
    desc: Development workflow - check, test, lint
    cmds:
      - cargo check
      - cargo test
      - cargo clippy --all-targets --all-features -- -D warnings

  docs-preview:
    desc: Preview documentation site locally
    cmds:
      - cd docs && quarto preview --no-browser

  benchmarks:
    desc: Run multi-formatter benchmark and write JSON consumed by docs/guide/performance.qmd
    cmds:
      - bash benches/compare_all.sh --json --out docs/guide/performance_data.json

  refresh-benchmarks:
    desc: Re-run benchmarks and rebuild the performance page (invalidates freeze cache)
    cmds:
      - bash benches/compare_all.sh --json --out docs/guide/performance_data.json
      - rm -rf docs/_freeze/guide/performance
      - cd docs && quarto render guide/performance.qmd

  wasm-build:
    desc: Build and sync panache-wasm for playground
    cmds:
      - wasm-pack build crates/panache-wasm --target web
      - rm -rf docs/playground/pkg
      - cp -r crates/panache-wasm/pkg docs/playground/
      - rm -f docs/playground/pkg/.gitignore

  playground-serve:
    desc: Serve playground locally
    cmds:
      - cd docs/playground && python3 -m http.server

  update-golden-expected:
    desc: Update expected golden test outputs
    cmds:
      - UPDATE_EXPECTED=1 cargo test --test golden_cases

  update-yaml-fixtures:
    desc: Download and refresh panache-parser yaml-test-suite fixtures (default data-2022-01-17)
    cmds:
      - ./crates/panache-parser/scripts/update-yaml-test-suite-fixtures.sh data-2022-01-17

  update-commonmark-fixtures:
    desc: Download and refresh CommonMark spec.txt fixture (default 0.31.2)
    cmds:
      - ./crates/panache-parser/scripts/update-commonmark-spec-fixtures.sh 0.31.2

  coverage:
    desc: Generate code coverage report
    cmds:
      - cargo llvm-cov --all-features --workspace --html
      - echo "Coverage report generated at target/llvm-cov/html/index.html"

  coverage-open:
    desc: Generate and open coverage report in browser
    cmds:
      - cargo llvm-cov --all-features --workspace --open

  vsix:
    desc: Build VS Code extension package
    dir: editors/code
    cmds:
      - npm install
      - npm run compile
      - npx @vscode/vsce package
      - code --install-extension *.vsix --force