• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kahwee / bunki / 22291699081

23 Feb 2026 03:18AM UTC coverage: 81.38% (-0.2%) from 81.61%
22291699081

push

github

kahwee
refactor: DRY up codebase with centralized constants and utilities

- Create src/constants.ts for centralized configuration values
  - PAGINATION: page size (10), batch size (10), RSS feed limit (40)
  - FILES: write buffer (1MB), sitemap limits
  - SEO: noindex threshold
  - CACHE: time constants
  - DATE: month names array

- Extract template engine setup to src/utils/template-engine.ts
  - Reduces site-generator.ts constructor from 47 to 11 lines
  - Makes Nunjucks configuration testable and reusable
  - Centralizes date filter logic

- Create src/utils/schema-factory.ts for JSON-LD schema generation
  - Eliminates 64 lines of duplication across tag/year pages
  - Provides generateCollectionSchemas() helper
  - DRY up breadcrumb generation

- Update generators to use constants instead of magic numbers
  - Replace hardcoded 10, 15, 40000, 1000 with semantic constants
  - Improve code readability and maintainability

- Export new utilities from src/index.ts for public API

Impact: -69 lines in core files, +223 lines of reusable utilities
All 427 tests pass, TypeScript compiles without errors

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

127 of 141 new or added lines in 7 files covered. (90.07%)

2417 of 2970 relevant lines covered (81.38%)

32.17 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

72.41
/src/utils/template-engine.ts


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc