All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- TypeScript declarations: Published first-class root declarations for the async v3 public API and wired the package
typesexport toindex.d.ts.
- CI/CD Reliability: Restored environment-based OIDC claim to match npm Trusted Publisher configuration.
- CI/CD Reliability: Further modernization of the publishing workflow to align with npm trusted publishing requirements (Node 24, simplified OIDC trust).
- CI Publishing: Repaired the automated publishing workflow to use OIDC trusted publishing and ensure the publish job depends strictly on successful pre-flight tests.
- Async-First Core: Refactored
TrailerCodecService,TrailerCodec, and top-level helpers to beasync, ensuring future-proof non-blocking operation. - Modernized Documentation: Rewrote
README.mdand addedGUIDE.mdto emphasize modern async patterns and better pedagogical flow.
- Breaking: Async API:
decodeMessage,encodeMessage,codec.decode(), andcodec.encode()now returnPromiseinstances and must beawaited. - Breaking: Helper Factory:
createMessageHelpersnow returns a pair of asynchronous functions.
- Convenience method aliases:
TrailerCodecnow exposesdecode()/encode()as shorter aliases fordecodeMessage()/encodeMessage() - Migration guide: Created comprehensive
docs/MIGRATION.mdcovering v1.x → v2.0 and v2.0 → v2.1 upgrades - Enhanced security documentation: Expanded
SECURITY.mdwith detailed DoS protection limits and customization examples - Test coverage: Added 4 new tests for convenience aliases in
test/unit/adapters/FacadeAdapter.test.js - Comprehensive JSDoc: Added detailed JSDoc comments to all 13 public exports in
index.js
- Improved error handling: All errors in
GitCommitMessageconstructor now properly wrapped inCommitMessageInvalidError - Enhanced validation: Added string type validation for trailer values in
normalizeTrailers() - Better error types: Duplicate trailer keys and invalid values now throw
TrailerInvalidErrorwith rich metadata - Domain-specific errors: RegExp construction errors in
GitTrailerSchemanow throwTrailerInvalidErrorinstead of genericTypeError - Reduced constructor complexity: Refactored
GitCommitMessage,TrailerCodecService, andGitTrailerconstructors by extracting validation and error handling into private methods - all ESLint complexity warnings now resolved
- API inconsistency where documentation referenced
codec.decode()but onlycodec.decodeMessage()existed - Missing validation for trailer value types could cause runtime crashes
- Generic Error types in facade layer breaking documented error hierarchy
- README API patterns section now mentions both method name forms
- API_REFERENCE.md typo on line 37 (extra
-character) - TESTING.md incorrect Vitest flags (
--runInBand→--reporter=verbose) - Package.json
filesfield now includesdocs/directory and all documentation files
- Unnecessary Docker configuration: Removed
Dockerfile,docker-compose.yml, and.dockerignore- not needed for pure domain logic library with no I/O or subprocess execution - Simplified CI workflow: Tests now run directly via
npm testwithout Docker overhead
- Created
FIXES_APPLIED.mddocumenting all changes in detail - Updated
API_REFERENCE.mdto document new aliases - Updated
README.mdto clarify both method names are supported - Corrected
TESTING.mdwith accurate Vitest command-line flags
- Integration test suite for real Git commit scenarios
- Performance benchmarks for large messages
- Additional edge case tests (unicode, empty input, concurrent usage)
- Hexagonal architecture refactor with pure domain layer
- Zod-based schema validation for type safety
- Facade pattern for simplified usage
- DoS protection: 5MB message size limit in
decode() - ReDoS protection: 100-character max length on trailer keys
- Comprehensive JSDoc documentation
- Security hardening: consistent regex validation between schema and service
- Validation rules table in README
- GitHub Actions CI workflow
- Standard open-source files: LICENSE, NOTICE, SECURITY.md, CODE_OF_CONDUCT.md
- Trailer keys normalized to lowercase for consistency
GitCommitMessageconstructor accepts array of trailersTrailerCodecService.decodenow validates input size before parsing- Strict schema typing: replaced
z.array(z.any())withz.array(GitTrailerSchema) - Exported
TRAILER_KEY_RAW_PATTERN_STRINGandTRAILER_KEY_REGEXconstants for reuse (regex is compiled from the raw string pattern)
- Regex inconsistency between schema validation and service parsing
- Missing null checks in facade layer
- Unbounded input vulnerability in decode method
- Added input size validation to prevent memory exhaustion attacks
- Limited trailer key length to prevent ReDoS attacks
- Enforced strict regex patterns across validation boundaries