mirror of
https://github.com/ivuorinen/everforest-resources.git
synced 2026-01-26 03:04:02 +00:00
- Complete project structure with directories for all target platforms - Template system for CLI tools with color placeholder replacement - Working generator that processes templates for 6 theme variants - GitHub workflows for build, snapshots, commitlint, and cli-verify - Installer and verifier scripts for CLI tool deployment - Comprehensive documentation and specifications - Biome 2.x linting and formatting setup - Husky git hooks for pre-commit validation
3.7 KiB
3.7 KiB
Architecture Deep Dive - Everforest Resources
Core Generator Architecture
EverforestGenerator Class
Located in scripts/generate-themes.mjs, this is the heart of the system:
class EverforestGenerator {
constructor() {
this.palette = null; // Loaded from palettes/everforest.json
}
// Key methods:
async loadPalette() // Loads JSON palette definition
async processTemplate() // Processes template.txt with placeholders
getColorsForVariant() // Maps palette to color variables
async generateAll() // Main entry point - generates all variants
async generateVariant() // Processes single variant
}
Template Processing System
- Template Files: Each CLI tool has
template.txtin its directory - Placeholders:
{{bg}},{{fg}},{{red}}, etc. replaced with actual colors - Variant Processing: Generates 6 versions (dark/light × hard/medium/soft)
- Output Generation: Creates final config files from processed templates
Palette Structure
{
"variants": {
"dark": { "hard": {...}, "medium": {...}, "soft": {...} },
"light": { "hard": {...}, "medium": {...}, "soft": {...} }
},
"accents": { "red": "#e67e80", "orange": "#e69875", ... },
"grays": { "dark": {...}, "light": {...} }
}
Supported Tools & Platforms
CLI Tools (24+ supported)
- System Monitors: btop, bottom, glances, neofetch, htop
- File Management: ranger, lf, mc, LS_COLORS, eza/exa
- Git Tools: lazygit, gitui, tig, delta
- Search & Processing: ripgrep, fzf, fd, jq, bat
- Shell & Productivity: starship, zsh, fish, tmux, less
- Modern Utils: zoxide, atuin
Editors (5 types)
- Neovim: Lua module with setup() function
- VS Code: JSON themes + package.json
- JetBrains: Unified .icls files (IntelliJ, WebStorm, PyCharm, etc.)
- Zed: JSON theme files
- Sublime Text: .sublime-color-scheme files
Terminals
- WezTerm, Alacritty, Kitty, Windows Terminal, Ghostty
Color Philosophy
ANSI vs Hex Usage
- CLI Tools: ANSI-16 SGR codes only (no raw hex)
- GUI Applications: Hex values allowed (from generator only)
- Consistent Mapping: Same semantic colors across all tools
Theme Variants
- Dark: hard/medium/soft (different background intensities)
- Light: hard/medium/soft (different background intensities)
- Fallback: Medium variant if specific not available
File Structure Pattern
cli/
starship/
template.txt # Template with {{color}} placeholders
starship.toml # Generated output (never edit directly)
README.md # Tool-specific documentation
fish/
colors-template.txt # Multiple templates for complex tools
prompt-template.txt
tide-template.txt
everforest-*.fish # Generated variants
README.md
Development Patterns
Generator Extension
To add new CLI tool:
- Create
cli/newtool/template.txt - Add processing logic to generator
- Update installer and verifier
- Add to documentation
Template Design
- Use semantic color names:
{{bg}}not{{color1}} - Include tool-specific syntax
- Test with all 6 variants
- Follow tool's native config format
Error Handling
- Graceful failures with descriptive messages
- Exit codes for CI integration
- Emoji-prefixed console output for visibility
CI/CD Integration
Required Checks
- build: Generator runs successfully
- snapshots: Web demo renders correctly
- commitlint: Conventional commit format
- cli-verify: Generated configs work in container
Validation Pipeline
- Palette structure validation
- Template processing verification
- No raw hex in CLI configs
- All variants present
- File structure compliance