|
1 | 1 | # Changelog |
2 | 2 |
|
| 3 | +## Unreleased |
| 4 | + |
| 5 | +### Changed |
| 6 | + |
| 7 | +- **Template build system** - Complete redesign using Vite |
| 8 | + - Templates are now built from source files in `templates_src/` to single-file outputs in `microdocs/templates/` |
| 9 | + - Vite automatically discovers and builds all template directories |
| 10 | + - CSS (Tailwind) and JavaScript are inlined into single HTML files |
| 11 | + - Development server with hot-reloading: `npm run dev` |
| 12 | + - Production builds: `npm run build` |
| 13 | + - Preview built templates: `npm run preview` |
| 14 | + - Source files (`templates_src/`) excluded from PyPI package distribution |
| 15 | +- **Template CLI** - Enhanced template selection |
| 16 | + - `--template` now accepts both template names (e.g., `default`) and file paths |
| 17 | + - Template names automatically resolve to built-in templates |
| 18 | + - Available templates listed in help text |
| 19 | + - Example: `microdocs README.md -t default` or `microdocs README.md -t /path/to/custom.html` |
| 20 | +- **Template structure** - Reorganized for better maintainability |
| 21 | + - Source: `templates_src/{name}/{name}.html`, `{name}.css`, `{name}.js` |
| 22 | + - Output: `microdocs/templates/{name}/{name}.html` (single file) |
| 23 | + - Removed legacy CSS file inlining (`inlined_css` template variable removed) |
| 24 | + - Builder no longer looks for companion `.css` files |
| 25 | +- **Pre-commit hooks** - Removed djhtml hook (Django template formatter) as it's no longer needed |
| 26 | +- **Documentation** - Comprehensive template development guide |
| 27 | + - New `templates_src/TEMPLATES.md` with complete guide for creating custom templates |
| 28 | + - Updated CLAUDE.md with Vite workflow instructions |
| 29 | + - Updated README.md with simplified template usage section |
| 30 | + |
| 31 | +### Added |
| 32 | + |
| 33 | +- **Playwright testing infrastructure** for end-to-end template testing |
| 34 | + - `playwright/build-test-template.js` - Script to build and test templates with real content |
| 35 | + - `playwright/fixtures/` - Sample markdown files for testing |
| 36 | + - `playwright/playwright.config.js` - Playwright configuration |
| 37 | + - Playwright dependencies added to `package.json` |
| 38 | + - Test results directories added to `.gitignore` |
| 39 | +- **Vite configuration** (`vite.config.js`) |
| 40 | + - Auto-discovers template directories |
| 41 | + - Configures single-file builds with viteSingleFile plugin |
| 42 | + - Removes module attributes from inlined scripts |
| 43 | + - Minifies output with Terser |
| 44 | +- **Package build configuration** - Excluded development files from PyPI distribution |
| 45 | + - Excludes: `playwright/`, `templates_src/`, `node_modules/`, config files |
| 46 | + |
| 47 | +### Removed |
| 48 | + |
| 49 | +- **Template tests** - Removed `microdocs/tests/test_templates.py` |
| 50 | + - 16 tests for template variable presence and CSS inlining removed |
| 51 | + - Template testing now handled by Playwright for more realistic E2E testing |
| 52 | +- **Legacy template file** - Removed `microdocs/templates/default.css` |
| 53 | + - CSS now inlined during Vite build process |
| 54 | + |
3 | 55 | ## Version 1.1.0 (2025-01-13) |
4 | 56 |
|
5 | 57 | ### Added |
|
0 commit comments