@zerotal/arch 1.13.0 → 1.13.1
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/docs/changelog.md +33 -0
- package/docs/queue.md +31 -0
- package/package.json +3 -3
package/docs/changelog.md
CHANGED
|
@@ -27,6 +27,39 @@ the section for every version you cross and apply its migration notes, not only
|
|
|
27
27
|
majors. [Releases and versioning](/docs/support-policy#releases-and-versioning) explains
|
|
28
28
|
when that carve-out ends.
|
|
29
29
|
|
|
30
|
+
## 1.13.1 — 2026-08-31
|
|
31
|
+
|
|
32
|
+
One addition, found by sizing a job rather than doing it.
|
|
33
|
+
|
|
34
|
+
The 2.0 ledger carries an entry to prefix every `@internal` export with `_` — 270 symbols,
|
|
35
|
+
filed as mechanical. Three of them are `Job` classes, and a job class name is not a source
|
|
36
|
+
symbol: `JobRegistry` keys on it and that string is written into the persisted queue payload,
|
|
37
|
+
so a job enqueued yesterday is resolved by today's process. Renaming one invalidates every job
|
|
38
|
+
already in the queue, at deploy time rather than at change time, and no test sees it because a
|
|
39
|
+
test enqueues and runs in the same process.
|
|
40
|
+
|
|
41
|
+
The rename is re-scoped. The hazard it exposed is fixed here.
|
|
42
|
+
|
|
43
|
+
### Added
|
|
44
|
+
|
|
45
|
+
- **`Job.jobName`** — a declared name for the queue payload, so renaming a job class is free:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
export class SendWelcomeEmail extends Job {
|
|
49
|
+
static override jobName = "SendWelcomeEmail"; // survives a class rename
|
|
50
|
+
async handle(): Promise<void> {}
|
|
51
|
+
}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
It defaults to the class name, so a job that declares nothing behaves exactly as before.
|
|
55
|
+
This is the same tool [`Migration.id`](/docs/upgrade#1-10-to-1-11) is for a migration's
|
|
56
|
+
filename, shipped in 1.11.0 for the same reason: an identity the framework derived from a
|
|
57
|
+
name someone was free to change, with no way to say otherwise.
|
|
58
|
+
|
|
59
|
+
It also decouples the queue from a build that mangles names. `zt compile` does not minify
|
|
60
|
+
today, so that is not a live hazard — but nothing in the registry said it depended on that,
|
|
61
|
+
and an assumption worth relying on is worth writing down.
|
|
62
|
+
|
|
30
63
|
## 1.13.0 — 2026-08-31
|
|
31
64
|
|
|
32
65
|
Three retirements, taken together on purpose. Each is a small migration, and three minors
|
package/docs/queue.md
CHANGED
|
@@ -141,6 +141,37 @@ export class PruneDeletedContentJob extends Job {
|
|
|
141
141
|
JobRegistry.register(PruneDeletedContentJob as never);
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
+
### Renaming a job class
|
|
145
|
+
|
|
146
|
+
A queued job is a **persisted reference to a class**. The payload in the database or in Redis
|
|
147
|
+
carries a string, and the worker resolves the class by it — so a job enqueued yesterday is
|
|
148
|
+
looked up by today's process. That makes the class name a compatibility surface, and renaming
|
|
149
|
+
the class a silent data migration: jobs already in the queue under the old name stop resolving
|
|
150
|
+
at the moment you deploy.
|
|
151
|
+
|
|
152
|
+
It is invisible to a test suite, because a test enqueues and runs in the same process.
|
|
153
|
+
|
|
154
|
+
Declare the stored name and the class is free to move:
|
|
155
|
+
|
|
156
|
+
```ts
|
|
157
|
+
import { Job } from "@zerotal/queue";
|
|
158
|
+
|
|
159
|
+
export class SendWelcomeEmail extends Job {
|
|
160
|
+
// The name in the queue payload. Keep it when the class is renamed.
|
|
161
|
+
static override jobName = "SendWelcomeEmail";
|
|
162
|
+
|
|
163
|
+
async handle(): Promise<void> {}
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
It defaults to the class name, so a job that says nothing behaves exactly as before. Declare it
|
|
168
|
+
when you rename a job class, or ahead of time on jobs you expect to rename — it is the same
|
|
169
|
+
tool `Migration.id` is for a migration's filename, and the same reason.
|
|
170
|
+
|
|
171
|
+
**Drain before you rename, if you have not declared one.** A rename with jobs in flight and no
|
|
172
|
+
`jobName` leaves rows the worker reports as an unknown job class; `zt queue:failed` lists them
|
|
173
|
+
and `zt queue:retry` can replay them once the name matches again.
|
|
174
|
+
|
|
144
175
|
## Auto-registration
|
|
145
176
|
|
|
146
177
|
You don't import or wire up your jobs anywhere. Any job class placed under
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerotal/arch",
|
|
3
|
-
"version": "1.13.
|
|
3
|
+
"version": "1.13.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"maturity": "stable",
|
|
6
6
|
"private": false,
|
|
@@ -35,11 +35,11 @@
|
|
|
35
35
|
"typecheck": "tsc --noEmit"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@zerotal/core": "1.13.
|
|
38
|
+
"@zerotal/core": "1.13.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"typescript": "^5.8.0",
|
|
42
|
-
"@zerotal/orm": "1.13.
|
|
42
|
+
"@zerotal/orm": "1.13.1"
|
|
43
43
|
},
|
|
44
44
|
"description": "The Zerotal agent surface — an MCP server that hands coding agents the framework's machine-readable truth: exact API signatures, live routes and schema, version-matched docs, and `zt doctor`.",
|
|
45
45
|
"keywords": [
|