diff --git a/context/repo-map.md b/context/repo-map.md index 1b43c03..b44e2c2 100644 --- a/context/repo-map.md +++ b/context/repo-map.md @@ -6,6 +6,7 @@ Library + binary crate: `src/lib.rs` re-exports public modules (many from sub-cr Sub-crates live under `crates/`: - `crates/improvise-core/` — pure-data core: `Model`, `View`, `Workbook`, and number formatting. Depends on `improvise-formula`. Re-exported from the main crate so `crate::model`, `crate::view`, `crate::workbook`, `crate::format` still resolve everywhere. Has no awareness of UI, I/O, or commands — builds standalone via `cargo build -p improvise-core`. - `crates/improvise-formula/` — formula parser, AST (`Expr`, `BinOp`, `AggFunc`, `Formula`, `Filter`), `parse_formula`. Re-exported as `crate::formula` from the main crate via `pub use improvise_formula as formula;`. +- `crates/improvise-io/` — `.improv` persistence (parse/format, save/load, CSV export) and import pipeline (CSV/JSON wizard, field analyzer). Depends on `improvise-core` and `improvise-formula`; has no UI or command code. Re-exported from the main crate so `crate::persistence` and `crate::import` still resolve everywhere. Builds standalone via `cargo build -p improvise-io`. --- @@ -453,22 +454,32 @@ command/cmd/ Cmd trait, CmdContext, CmdRegistry, 40+ comma 12 / 0t ui/mod.rs ``` -### Import layer +### I/O crate layers (sub-crate `improvise-io` under `crates/`) +All of `persistence/` and `import/` now live under `crates/improvise-io/src/`. +Paths below are relative to that root. The main crate re-exports each +as `crate::persistence` and `crate::import` via `src/lib.rs`, so every +consumer path stays unchanged. + +#### Persistence ``` - 773 / 38t import/wizard.rs ImportPipeline + ImportWizard - 292 / 9t import/analyzer.rs Field kind detection (Category/Measure/Time/Skip) - 244 / 8t import/csv_parser.rs CSV parsing, multi-file merge + 124 / 0t persistence/improv.pest PEG grammar — single source of truth for .improv format +2410 / 83t persistence/mod.rs .improv save/load (pest parser + format + gzip + legacy JSON), export_csv +``` + +#### Import +``` +1117 / 38t import/wizard.rs ImportPipeline + ImportWizard + 292 / 9t import/analyzer.rs Field kind detection (Category/Measure/Time/Skip) + 300 / 8t import/csv_parser.rs CSV parsing, multi-file merge 3 / 0t import/mod.rs + 16 / 0t lib.rs Module decls + re-exports of improvise-core/formula modules ``` ### Top-level ``` 400 / 0t draw.rs TUI event loop (run_tui), frame composition 391 / 0t main.rs CLI entry (clap): open, import, cmd, script - 10 / 0t lib.rs Public module exports (enables examples) - 228 / 29t format.rs Number display formatting (view-only rounding) - 124 / 0t persistence/improv.pest PEG grammar — single source of truth for .improv format -2291 / 83t persistence/mod.rs .improv save/load (pest parser + format + gzip + legacy JSON) + 10 / 0t lib.rs Public module re-exports (routes to sub-crates) ``` ### Examples