@12-apps/jobs 4.3.0 → 4.4.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/package.json +7 -3
- package/src/manifest/index.ts +12 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@12-apps/jobs",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Generic background-job library: a typed job registry with retries, exponential backoff and cron schedules, behind a swappable driver port (BullMQ/Redis in production, inline execution in tests and zero-config dev). The runtime half (./server) is one factory — createApiJobs: driver resolution, worker bootstrap, graceful drain, the single-writer sweep lease and a health endpoint — with a Hono adapter (./hono) and the package-owned SweepLease Prisma partial + migrations. Knows nothing about the host app's domain, ORM or transport.",
|
|
6
6
|
"exports": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"bullmq": "^5.81.2"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@12-apps/eslint-config": "^1.21.
|
|
28
|
-
"@12-apps/typescript-config": "^1.20.
|
|
27
|
+
"@12-apps/eslint-config": "^1.21.1",
|
|
28
|
+
"@12-apps/typescript-config": "^1.20.1",
|
|
29
29
|
"eslint": "^9.39.1",
|
|
30
30
|
"eslint-plugin-test-flakiness": "^1.4.0",
|
|
31
31
|
"hono": "^4.6.0",
|
|
@@ -71,6 +71,10 @@
|
|
|
71
71
|
"!**/test-helpers.*"
|
|
72
72
|
],
|
|
73
73
|
"wiring": {
|
|
74
|
+
"db": {
|
|
75
|
+
"partial": "prisma/jobs.prisma",
|
|
76
|
+
"migrations": "prisma/migrations"
|
|
77
|
+
},
|
|
74
78
|
"env": [
|
|
75
79
|
{
|
|
76
80
|
"name": "REDIS_URL",
|
package/src/manifest/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@12-apps/jobs/manifest` — the SHARED wiring manifest.
|
|
3
3
|
*
|
|
4
|
-
* A pure-data manifest: identity
|
|
5
|
-
* runtime capabilities deliberately stay UNDECLARED for now — hosts mount
|
|
4
|
+
* A pure-data manifest: identity, the env surface and the db contribution.
|
|
5
|
+
* The runtime capabilities deliberately stay UNDECLARED for now — hosts mount
|
|
6
6
|
* this package directly (`createJobs`, the Hono adapter) rather than through
|
|
7
7
|
* the wiring consumer, and inventorying `server` here would oblige every one
|
|
8
8
|
* of them to adopt or decline it. The env declaration carries its own weight
|
|
@@ -10,6 +10,15 @@
|
|
|
10
10
|
* `package.json` for tooling that cannot execute TypeScript, so a host's
|
|
11
11
|
* `.env.example` can stop rotting by hand.
|
|
12
12
|
*
|
|
13
|
+
* The db contribution is the SweepLease partial — the single-flight lease
|
|
14
|
+
* table `withSweepLease` claims its names in. It was the one capability this
|
|
15
|
+
* package shipped that no manifest said so: the partial and its migration
|
|
16
|
+
* rode the tarball while every host discovered them through a sync script's
|
|
17
|
+
* comment, which is exactly the silent-arrival the declaration (and its
|
|
18
|
+
* `package.json` mirror, readable by plain-Node assemblers) exists to end.
|
|
19
|
+
* Host-agnostic by construction: the lease names a JOB, so the model carries
|
|
20
|
+
* no relation into any host table — the `composed` mode's qualification.
|
|
21
|
+
*
|
|
13
22
|
* Every key is OPTIONAL by this package's own design: absence selects the
|
|
14
23
|
* inline/off driver and logs the decision — it never throws. Config always
|
|
15
24
|
* wins over env (`config.x ?? process.env.Y`). `NODE_ENV` is read too, but
|
|
@@ -27,6 +36,7 @@
|
|
|
27
36
|
export const jobsManifest = {
|
|
28
37
|
name: "@12-apps/jobs",
|
|
29
38
|
contract: 1,
|
|
39
|
+
db: { partial: "prisma/jobs.prisma", migrations: "prisma/migrations" },
|
|
30
40
|
env: [
|
|
31
41
|
{ name: "REDIS_URL", description: "Set it and the queue turns itself on; unset selects the inline/off driver." },
|
|
32
42
|
{ name: "JOBS_DRIVER", description: "bullmq | inline | off; unset picks by REDIS_URL and NODE_ENV." },
|