@zerotal/scheduler 1.8.1 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/api-surface.md +0 -19
- package/package.json +2 -2
- package/src/conventions.ts +4 -0
- package/src/runLog.ts +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,16 @@ follows the Zerotal monorepo's unified versioning.
|
|
|
8
8
|
|
|
9
9
|
## [Unreleased]
|
|
10
10
|
|
|
11
|
+
## [1.9.0] — 2026-08-29
|
|
12
|
+
|
|
13
|
+
### Documented
|
|
14
|
+
|
|
15
|
+
- **Every promised export is documented.** The `docs-coverage` gate reads `maturity: stable` as a
|
|
16
|
+
promise about a package's exports, and measures how much of that promise is written down. It
|
|
17
|
+
was 798 gaps across the suite; it is now zero. This package's share is covered on its own
|
|
18
|
+
pages — types named, options shapes described, and the decisions behind them recorded where
|
|
19
|
+
somebody looking for them will find them.
|
|
20
|
+
|
|
11
21
|
## [1.6.0] — 2026-08-15
|
|
12
22
|
|
|
13
23
|
### Fixed
|
package/api-surface.md
CHANGED
|
@@ -21,13 +21,6 @@ class CronExpression = {
|
|
|
21
21
|
weekday: (v: number | string) => CronExpression
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
class FileScheduleRunStore = {
|
|
25
|
-
new (_path: string, _keep?: number): FileScheduleRunStore
|
|
26
|
-
lastFor: (name: string) => ScheduleRunRecord | undefined
|
|
27
|
-
recent: (limit?: number, name?: string) => ScheduleRunRecord[]
|
|
28
|
-
record: (run: ScheduleRunRecord) => void
|
|
29
|
-
}
|
|
30
|
-
|
|
31
24
|
class Schedule = {
|
|
32
25
|
new (): Schedule
|
|
33
26
|
appendOutputTo?: string
|
|
@@ -179,20 +172,8 @@ class TaskSkipped = {
|
|
|
179
172
|
readonly reason: 'lock' | 'window' | 'env' | 'when' | 'skip' | 'overlap'
|
|
180
173
|
}
|
|
181
174
|
|
|
182
|
-
const DEFAULT_RUN_LOG_KEEP = 500
|
|
183
|
-
|
|
184
|
-
const DEFAULT_RUN_LOG_PATH = 'storage/framework/schedule-runs.jsonl'
|
|
185
|
-
|
|
186
175
|
const Scheduler = SchedulerManager
|
|
187
176
|
|
|
188
|
-
const schedulesConcern = ConcernDescriptor
|
|
189
|
-
|
|
190
|
-
function installScheduleRunLog = (app: Application) => (() => void) | undefined
|
|
191
|
-
|
|
192
|
-
function registerSchedule = (manager: SchedulerManager, schedule: Schedule, fallbackName: string) => ScheduledTask | undefined
|
|
193
|
-
|
|
194
|
-
function resolveRunLogConfig = (app: Application) => RunLogConfig
|
|
195
|
-
|
|
196
177
|
function SchedulerConfig = (options?: Partial<SchedulerConfigShape>) => SchedulerConfigShape
|
|
197
178
|
|
|
198
179
|
interface OverlapLockOptions = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerotal/scheduler",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"maturity": "stable",
|
|
6
6
|
"private": false,
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"typecheck": "tsc --noEmit"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@zerotal/core": "1.
|
|
33
|
+
"@zerotal/core": "1.9.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"typescript": "^5.8.0"
|
package/src/conventions.ts
CHANGED
|
@@ -55,6 +55,8 @@ export function staticScheduleConfigKeys(cls: abstract new () => Schedule): stri
|
|
|
55
55
|
/**
|
|
56
56
|
* Register one Schedule instance with the scheduler manager, translating its declarative
|
|
57
57
|
* settings into a configured ScheduledTask. Exported for testing.
|
|
58
|
+
*
|
|
59
|
+
* @internal
|
|
58
60
|
*/
|
|
59
61
|
export function registerSchedule(
|
|
60
62
|
manager: SchedulerManager,
|
|
@@ -101,6 +103,8 @@ export function registerSchedule(
|
|
|
101
103
|
* `app/schedules/` convention. Every `Schedule` subclass is instantiated and registered with the
|
|
102
104
|
* scheduler. Runs in worker (to execute) and console (so `schedule:list` can enumerate them);
|
|
103
105
|
* never in `web`, so HTTP instances don't run cron. Contributed by `SchedulerProvider`.
|
|
106
|
+
*
|
|
107
|
+
* @internal
|
|
104
108
|
*/
|
|
105
109
|
export const schedulesConcern: ConcernDescriptor = {
|
|
106
110
|
name: "schedules",
|
package/src/runLog.ts
CHANGED
|
@@ -58,10 +58,16 @@ export interface RunLogConfig {
|
|
|
58
58
|
keep: number;
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
/** @internal */
|
|
61
62
|
export const DEFAULT_RUN_LOG_PATH = "storage/framework/schedule-runs.jsonl";
|
|
63
|
+
/** @internal */
|
|
62
64
|
export const DEFAULT_RUN_LOG_KEEP = 500;
|
|
63
65
|
|
|
64
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Resolve `scheduler.runLog` config with defaults, tolerating an absent config binding.
|
|
68
|
+
*
|
|
69
|
+
* @internal
|
|
70
|
+
*/
|
|
65
71
|
export function resolveRunLogConfig(app: Application): RunLogConfig {
|
|
66
72
|
let raw: { enabled?: boolean; path?: string; keep?: number } = {};
|
|
67
73
|
try {
|
|
@@ -81,6 +87,8 @@ export function resolveRunLogConfig(app: Application): RunLogConfig {
|
|
|
81
87
|
/**
|
|
82
88
|
* JSONL-backed run store. Appends are synchronous — runs happen at cron cadence,
|
|
83
89
|
* not request cadence, and a record that survives a crash is the whole point.
|
|
90
|
+
*
|
|
91
|
+
* @internal
|
|
84
92
|
*/
|
|
85
93
|
export class FileScheduleRunStore implements ScheduleRunStore {
|
|
86
94
|
constructor(
|
|
@@ -151,6 +159,8 @@ export class FileScheduleRunStore implements ScheduleRunStore {
|
|
|
151
159
|
* success and `TaskFailed` on a throw, so together they are exactly one record per
|
|
152
160
|
* completed execution (skips are deliberate non-runs and are not recorded). Returns
|
|
153
161
|
* a disposer, or undefined when the run log is disabled.
|
|
162
|
+
*
|
|
163
|
+
* @internal
|
|
154
164
|
*/
|
|
155
165
|
export function installScheduleRunLog(app: Application): (() => void) | undefined {
|
|
156
166
|
const config = resolveRunLogConfig(app);
|