## Krik TODO / Roadmap
### โ
Recently completed (this branch)
- [x] Robust error handling: removed `unwrap/expect` across CLI, server, init,
lint, templates, markdown, PDF; logging init no longer panics
- [x] Config loading: `SiteConfig::load_from_path` returns `KrikResult`;
generator logs and falls back to defaults
- [x] i18n: centralized `SUPPORTED_LANGUAGES` into a `HashMap`,
`I18nManager::get_language_name()` uses it; parser validates via the map
- [x] Templates module split: `templates/` with `context.rs`, `paths.rs`,
`select.rs`, `render_page.rs`, `render_index.rs`
- [x] TOC/IDs: use AST path for markdown โ TOC/heading IDs; kept an HTML-based
helper for backward-compat tests
- [x] Index bug fix: include non-default language posts (e.g., `foo.it.md`) even
without a default-language counterpart; choose one per base name
preferring default language
- [x] Lint performance: precompile regexes with `once_cell::sync::Lazy`
- [x] Parallelization: scan markdown files in parallel; render pages in
parallel; generate PDFs in parallel with unique temp files
- [x] Template error typing: `render_page` and `render_index` map template
errors to `KrikError::Template` with template name and context
- [x] Dev server modularization: extracted `server/watcher.rs` and
`server/net.rs`; cleaned up imports and warnings
- [x] CLI validation module: centralize path normalization/validation and return
typed errors with user-friendly suggestions
- [x] Adopt `thiserror` for error enums while preserving `KrikError` facade and
exit-code mapping
- [x] Dependencies: upgraded `warp` to 0.4.1 (enabled `server` + `websocket`
features), `notify` to 8.2.0, and `serde` to 1.0.219; verified via
`cargo test` and `cargo run --`
### ๐บ High-priority next steps
- [x] Incremental build cache: maintain a path โ `Document` cache in
`SiteGenerator` and update on change to avoid full rescans
### ๐งช Testing
- [x] Add integration test: index selection when both default and non-default
language variants exist (ensure default wins)
- [x] Add tests for template render error mapping โ `KrikError::Template`
- [ ] Add (feature-gated) tests for dev server watcher failure paths and network
listing fallbacks
- [x] Expand content fixtures to cover nested posts, TOC edge-cases, and PDF
toggles
### โ๏ธ Performance & concurrency
- [ ] Batch template context creation to minimize allocs for large sites;
evaluate small-object reuse where safe
- [ ] avoid redundant stat calls in asset copying
- ### ๐งผ Code quality & API
- [x] Introduce `Theme::builder()` to encapsulate defaults, auto-escape, reload
behavior, and error handling
- [x] Normalize public functions to return `KrikResult<T>`; removed silent
fallbacks in `theme`, `assets`, `server/live_reload`
- [x] Remove remaining duplicated logic covered by `i18n::I18nManager` and
`templates::paths` (parser uses `I18nManager` for language validation)
### ๐ Docs & DX
- [ ] Add CONTRIBUTING.md with coding standards, testing strategy, and release
steps
### ๐ Release readiness
- [ ] Update CHANGELOG with parallelization, index fix, error-handling
improvements
- [x] Add dependency bumps (`warp` 0.4.1, `notify` 8.2.0, `serde` 1.0.219) to
CHANGELOG
- [ ] Bump version; note performance improvements and safer defaults