@12-apps/jobs 4.2.0 → 4.3.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 +25 -3
- package/src/manifest/index.ts +36 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@12-apps/jobs",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.3.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": {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"./hono": "./src/hono/index.ts",
|
|
10
10
|
"./bullmq": "./src/drivers/bullmq.ts",
|
|
11
11
|
"./inline": "./src/drivers/inline.ts",
|
|
12
|
+
"./manifest": "./src/manifest/index.ts",
|
|
12
13
|
"./package.json": "./package.json"
|
|
13
14
|
},
|
|
14
15
|
"scripts": {
|
|
@@ -23,7 +24,7 @@
|
|
|
23
24
|
"bullmq": "^5.81.2"
|
|
24
25
|
},
|
|
25
26
|
"devDependencies": {
|
|
26
|
-
"@12-apps/eslint-config": "^1.
|
|
27
|
+
"@12-apps/eslint-config": "^1.21.0",
|
|
27
28
|
"@12-apps/typescript-config": "^1.20.0",
|
|
28
29
|
"eslint": "^9.39.1",
|
|
29
30
|
"eslint-plugin-test-flakiness": "^1.4.0",
|
|
@@ -68,5 +69,26 @@
|
|
|
68
69
|
"!**/*.stories.*",
|
|
69
70
|
"!**/*.test-story.*",
|
|
70
71
|
"!**/test-helpers.*"
|
|
71
|
-
]
|
|
72
|
+
],
|
|
73
|
+
"wiring": {
|
|
74
|
+
"env": [
|
|
75
|
+
{
|
|
76
|
+
"name": "REDIS_URL",
|
|
77
|
+
"description": "Set it and the queue turns itself on; unset selects the inline/off driver."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "JOBS_DRIVER",
|
|
81
|
+
"description": "bullmq | inline | off; unset picks by REDIS_URL and NODE_ENV."
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"name": "JOBS_WORKER",
|
|
85
|
+
"scope": "worker",
|
|
86
|
+
"description": "\"1\" on the ONE process that consumes the queue and runs schedules."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "JOBS_QUEUE_PREFIX",
|
|
90
|
+
"description": "Optional key prefix, to share one Redis across environments."
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
}
|
|
72
94
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@12-apps/jobs/manifest` — the SHARED wiring manifest.
|
|
3
|
+
*
|
|
4
|
+
* A pure-data manifest: identity plus the env surface, nothing else. The
|
|
5
|
+
* runtime capabilities deliberately stay UNDECLARED for now — hosts mount
|
|
6
|
+
* this package directly (`createJobs`, the Hono adapter) rather than through
|
|
7
|
+
* the wiring consumer, and inventorying `server` here would oblige every one
|
|
8
|
+
* of them to adopt or decline it. The env declaration carries its own weight
|
|
9
|
+
* today: the exact `process.env` keys the queue reads, mirrored into
|
|
10
|
+
* `package.json` for tooling that cannot execute TypeScript, so a host's
|
|
11
|
+
* `.env.example` can stop rotting by hand.
|
|
12
|
+
*
|
|
13
|
+
* Every key is OPTIONAL by this package's own design: absence selects the
|
|
14
|
+
* inline/off driver and logs the decision — it never throws. Config always
|
|
15
|
+
* wins over env (`config.x ?? process.env.Y`). `NODE_ENV` is read too, but
|
|
16
|
+
* it is platform vocabulary, not a contribution.
|
|
17
|
+
*
|
|
18
|
+
* This package depends on `@12-apps/wiring` in NEITHER direction — wiring
|
|
19
|
+
* already devDepends on jobs for its blueprint-compat suite, so an edge back
|
|
20
|
+
* would close a turbo build cycle. The manifest is therefore untyped pure
|
|
21
|
+
* data here, and the producer assertions (defineManifest, both mirrors, the
|
|
22
|
+
* exports tripwire) run in WIRING's own suite, which imports this subpath —
|
|
23
|
+
* the same "fails in a test run before any host sees it" guarantee, one
|
|
24
|
+
* package over, along the dependency edge that already exists.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
export const jobsManifest = {
|
|
28
|
+
name: "@12-apps/jobs",
|
|
29
|
+
contract: 1,
|
|
30
|
+
env: [
|
|
31
|
+
{ name: "REDIS_URL", description: "Set it and the queue turns itself on; unset selects the inline/off driver." },
|
|
32
|
+
{ name: "JOBS_DRIVER", description: "bullmq | inline | off; unset picks by REDIS_URL and NODE_ENV." },
|
|
33
|
+
{ name: "JOBS_WORKER", scope: "worker", description: "\"1\" on the ONE process that consumes the queue and runs schedules." },
|
|
34
|
+
{ name: "JOBS_QUEUE_PREFIX", description: "Optional key prefix, to share one Redis across environments." },
|
|
35
|
+
],
|
|
36
|
+
} as const;
|