Skip to content

New features and improvements#8

Merged
chaqchase merged 6 commits into
mainfrom
feat/enhancements-cleanup
Sep 3, 2025
Merged

New features and improvements#8
chaqchase merged 6 commits into
mainfrom
feat/enhancements-cleanup

Conversation

@chaqchase
Copy link
Copy Markdown
Owner

This pull request introduces several new features and improvements to the cronbake package, focusing on enhanced scheduling controls, robust overrun protection, and a pluggable persistence system. It also updates documentation, fixes cron parsing and type issues, and improves packaging and public API surface.

Major features and improvements:

Scheduling Controls & Overrun Protection

  • Added immediate and delay options to allow the first cron callback to run immediately or after a configurable delay. Introduced overrunProtection (default: true) to prevent overlapping executions if a previous run is still in progress. These features are now documented and available in both the API and README usage examples. [1] [2] [3] F1ca759aL4R4, [4] [5]

Persistence System

  • Refactored persistence to use pluggable providers. Added FilePersistenceProvider (JSON on disk) and RedisPersistenceProvider (single-key JSON via injected client). The persistence system now uses a provider interface, and the public API exports these providers for external use. Documentation and usage examples in the README have been updated accordingly. [1] [2] [3] [4] [5] [6]

Cron Expression & Type Fixes

  • Improved cron expression parsing, including correct mapping for @on_<day>, fixes for @every_<n>_months and @every_<n>_dayOfWeek, and replaced the custom Timer type with ReturnType<typeof setTimeout|setInterval> for better portability. [1] [2] [3] [4] [5]

Documentation & Examples

  • Updated the README and CHANGELOG with new features, usage examples for immediate/delayed runs, overrun protection, and persistence providers. Added notes about new metrics (skippedExecutions) and clarified persistence options. [1] F1ca759aL4R4, [2] [3] [4]

Packaging & Public API

  • Changed package access from restricted to public and fixed build issues by replacing path aliases (@/lib) with relative imports. Ensured new persistence providers and types are exported from the main API. [1] [2] [3] [4]

These changes collectively make cronbake more flexible, robust, and easier to integrate with various persistence backends, while improving reliability and developer experience.

@chaqchase chaqchase merged commit 8bc49c6 into main Sep 3, 2025
1 check passed
@chaqchase chaqchase deleted the feat/enhancements-cleanup branch November 15, 2025 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant