Description
The export logic is fully duplicated between src/features/export/ExportPanel.tsx and cli/index.ts. Both implement Markdown, JSON, and HTML site export independently with slightly different behavior and different security postures.
Duplication
| Feature |
ExportPanel.tsx |
cli/index.ts |
| Markdown export |
✅ Single file |
✅ Per-entity files |
| JSON export |
✅ Single file |
✅ Single file |
| HTML site export |
✅ Single file |
✅ Single file |
| HTML escaping |
Partial (names only) |
None |
| Shared logic |
None |
None |
Recommended Fix
- Extract shared export logic into
src/lib/export/ module
- Create format-specific exporters:
MarkdownExporter, JsonExporter, HtmlSiteExporter
- Use the shared module from both browser and CLI
- Ensure consistent security posture (escaping) across both paths
Acceptance Criteria
Description
The export logic is fully duplicated between
src/features/export/ExportPanel.tsxandcli/index.ts. Both implement Markdown, JSON, and HTML site export independently with slightly different behavior and different security postures.Duplication
Recommended Fix
src/lib/export/moduleMarkdownExporter,JsonExporter,HtmlSiteExporterAcceptance Criteria