@pikku/queue-bullmq 0.12.9 → 0.12.10

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pikku/queue-bullmq",
3
- "version": "0.12.9",
3
+ "version": "0.12.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/pikkujs/pikku.git",
@@ -16,18 +16,24 @@
16
16
  "tsc": "tsc",
17
17
  "test": "bash run-tests.sh",
18
18
  "ncu": "npx npm-check-updates",
19
- "build": "tsc -b",
19
+ "build": "bun run clean && tsc -b",
20
20
  "release": "npm run build && npm test",
21
- "prepublishOnly": "bun run build"
21
+ "prepublishOnly": "bun run build",
22
+ "clean": "rm -rf dist tsconfig.tsbuildinfo"
22
23
  },
23
24
  "peerDependencies": {
24
- "@pikku/core": "^0.12.143"
25
+ "@pikku/core": "^0.12.144"
25
26
  },
26
27
  "dependencies": {
27
- "bullmq": "^6.1.1",
28
+ "bullmq": "^6.3.16",
28
29
  "ioredis": "^6.0.0"
29
30
  },
30
31
  "exports": {
31
- ".": "./dist/index.js"
32
- }
32
+ ".": "./dist/index.js",
33
+ "./package.json": "./package.json"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "!dist/**/*.tsbuildinfo"
38
+ ]
33
39
  }
package/CHANGELOG.md DELETED
@@ -1,397 +0,0 @@
1
- ## 0.12.9
2
-
3
- ### Patch Changes
4
-
5
- - de9af6a: RPCs for Pikku Studio's migrated screens. Runtime state that must be visible on a deployed app lives in `@pikku/addon-admin`; local-copy tools stay in `@pikku/addon-console`.
6
-
7
- `@pikku/addon-admin`:
8
-
9
- - `admin:getSchedulerHistory` returns each scheduled task's last run, next run and recent runs, from a new `SchedulerService.getTaskRuns()` (empty by default). `InMemorySchedulerService` records the last 50 runs per cron task with status, duration and error. Scope `admin:schedules:read`.
10
- - `admin:getQueueHistory({ queueNames?, limit? })` returns live counts and recent jobs per queue, from a new optional `QueueService.inspect(queueName, { limit })`, implemented by `InMemoryQueueService` and `BullQueueService` and forwarded by `SignedQueueService`. Scope `admin:queues:read`.
11
- - `admin:listIncomingWebhookReceipts` / `admin:getIncomingWebhookReceipt` expose received webhooks, backed by a new `IncomingWebhookService.getReceipt(receiptId)` (null by default; implemented by `KyselyIncomingWebhookService`). Scope `admin:webhooks:read`.
12
-
13
- `@pikku/addon-console`:
14
-
15
- - `console:variableGet` / `console:variableSet` read and write a project variable, gated on `pikku:console:variables:read` / `:write`.
16
- - `console:runScenarios({ names?, environment? })` starts `pikku scenario run` as a detached child process and returns `{ runId }` to follow through `listScenarioRuns` / `getScenarioRun`, gated on the new `pikku:console:scenarios:run` scope. `pikku scenario run` takes `--run-id <id>` to record under a caller-chosen id.
17
-
18
- - Updated dependencies [de9af6a]
19
- - @pikku/core@0.12.143
20
-
21
- ## 0.12.8
22
-
23
- ### Patch Changes
24
-
25
- - 4c7a1b5: Run the monorepo's own scripts through bun instead of yarn. What moves is the
26
- package manager each package's `prepublishOnly` and build scripts invoke, plus
27
- the two manifest fixes bun needs to resolve the tree: `uWebSockets.js` is
28
- declared with an explicit `github:` specifier, and `@pikku/uws-handler` marks
29
- its `uWebSockets.js` peer optional so a bun install of a consumer that brings
30
- its own uWS app does not try to fetch it from the registry.
31
-
32
- Three published behaviours change, all of them cases where an isolated
33
- `node_modules` or bun as the runtime had been papered over by yarn's hoisting:
34
-
35
- - `@pikku/migrator-sql` turns foreign keys on when it opens a sqlite database
36
- through bun. `node:sqlite` enforces them by default and `bun:sqlite` does not,
37
- which silently turned every `ON DELETE CASCADE` into a no-op under
38
- `bunx --bun pikku`.
39
- - `@pikku/cli` resolves a deploy provider against the project being deployed
40
- rather than against wherever the CLI itself is installed, which is what its
41
- own "is not installed" error asks the user to arrange.
42
- - `@pikku/cli` treats a specifier a runtime hands straight back — bun does this
43
- for the modules it implements itself — as not resolved from the project, so
44
- it falls back rather than loading the runtime's own copy.
45
-
46
- - Updated dependencies [4c7a1b5]
47
- - @pikku/core@0.12.108
48
-
49
- ## 0.12.7
50
-
51
- ### Patch Changes
52
-
53
- - 266e3bc: One door per name: `@pikku/core/ecosystem/*` and the package root are gone
54
-
55
- `@pikku/core` published every module twice. `ecosystem/http` re-exported
56
- `./http`, `ecosystem/services` re-exported `./services`, and a name was
57
- reachable through either — so every addition had to be made in two places, and a
58
- consumer's import said nothing about what it actually used. The package root was
59
- the same problem at a larger scale: a single barrel of 206 names that no bundler
60
- could take apart, and the one specifier that revealed nothing at all.
61
-
62
- Both are deleted. Every name now lives on the subpath that owns it, and every
63
- import carries that subpath — `@pikku/core/http`, `@pikku/core/services`,
64
- `@pikku/core/errors`, `@pikku/core/types`.
65
-
66
- Deleting the facades meant the raw subpaths had to become a superset of them,
67
- which they were not: the facade tree had accumulated 25 names with no raw home
68
- and about 26 more filed under a different area than the module they came from.
69
- Those names moved to the area that owns them, and three areas were published as
70
- new entry points rather than left on a root that is going away — `./types` (the
71
- shared type surface, the largest single destination), `./state` and
72
- `./classification`.
73
-
74
- `./classification` is one door onto one subject: what a value is and how it must
75
- be handled. Its three halves would each have been an entry point — the brands
76
- and manifest types, the stored-form helpers (`hashToken`, `unsafeAsSealed` and
77
- friends), and `SecretValue` — split by whether a name happens to be a type or a
78
- value, which is the same defect as the facades. The duration and versioned-id
79
- helpers went to `./utils`, which already published, and `PikkuRequest` went to
80
- `./function`: it is the transport-agnostic request base, not an HTTP one — HTTP
81
- has `PikkuHTTPAbstractRequest`, and the only thing outside core that extends
82
- `PikkuRequest` is Azure's timer request.
83
-
84
- `./types` inherited the root barrel's habit before it inherited its contents, so
85
- the names with an owner elsewhere were moved off it. The middleware types and the
86
- five middleware factories — `pikkuMiddleware`, `pikkuMiddlewareFactory`,
87
- `pikkuChannelMiddleware`, `pikkuChannelMiddlewareFactory` and
88
- `pikkuAgentMiddleware`, runtime values on a types entry point — are now
89
- `@pikku/core/middleware`; the function meta types are `@pikku/core/function`;
90
- `SerializedError` is `@pikku/core/errors`; and the generic TypeScript helpers
91
- (`MakeRequired`, `PickRequired`, `PickOptional`, `RequireAtLeastOne`,
92
- `JSONPrimitive`, `JSONValue`) are `@pikku/core/utils`. What is left on `./types`
93
- is the vocabulary the wirings share, which no single module owns.
94
-
95
- `pikku` was itself a root barrel — `export * from '@pikku/core'` — and
96
- now exports only the services it bundles.
97
-
98
- One module survives at the old specifier, and only for the bootstrap:
99
- `packages/cli` is generated by the _published_ CLI pinned in its `build.sh`, and
100
- that CLI still writes a bare `@pikku/core` into the files it generates for the
101
- CLI itself. `bootstrap-compat/root.ts` carries the eight types it names, a test
102
- in core fails if that list grows, and it goes when the pin moves to a CLI
103
- released from this branch. The adapter names the pinned CLI reaches for —
104
- `pikkuState` and `CreateWireServices` — are rewritten to `@pikku/core/state` and
105
- `@pikku/core/types` by the same `build.sh` patch pass, so no second shim is
106
- needed for them.
107
-
108
- A guard test keeps the root shut: it parses imports and rejects a bare
109
- `@pikku/core` rather than grepping for it, because several tests hold a user's
110
- file as a template literal, where `import … from '@pikku/core'` is fixture text
111
- rather than an import this repo makes.
112
-
113
- An agent scaffold a project generated under an older CLI is refreshed rather
114
- than left to fail: `pikku all` already deleted one importing an entry point
115
- `@pikku/core` no longer publishes, and the `#pikku` hub joins that list.
116
- Without it a project that scaffolds the agent endpoint but
117
- declares no agents keeps the old file forever — the generator that would rewrite
118
- it only runs when agents exist, and the file being present is what stops it
119
- being regenerated as missing.
120
-
121
- `pikku new addon` also wrote a tsconfig `paths` map naming only the deleted hub.
122
- An addon's `imports` map points into `dist`, so `paths` is what resolves
123
- `#pikku/<leaf>` for the addon's own source build — it now names the two leaf
124
- patterns, in both the addon and its test harness.
125
-
126
- - 786dae5: Bump every dependency whose latest release is a major across the monorepo, and
127
- port the code the majors broke: `cookie` 2's `parseCookie`/`stringifySetCookie`
128
- API in `@pikku/core` and the three runtime HTTP adapters, and assistant-ui 0.15's
129
- store client in `@pikku/assistant-ui`.
130
- - 6eef0a0: Bump every dependency to its latest compatible minor/patch across the monorepo.
131
- - Updated dependencies [7722ceb]
132
- - Updated dependencies [375c1ff]
133
- - Updated dependencies [02a70cd]
134
- - Updated dependencies [aeef159]
135
- - Updated dependencies [a281de6]
136
- - Updated dependencies [266e3bc]
137
- - Updated dependencies [02a70cd]
138
- - Updated dependencies [786dae5]
139
- - Updated dependencies [6eef0a0]
140
- - Updated dependencies [3561d67]
141
- - Updated dependencies [a91c433]
142
- - Updated dependencies [02a70cd]
143
- - Updated dependencies [9537f74]
144
- - Updated dependencies [2b57ca8]
145
- - Updated dependencies [266e3bc]
146
- - Updated dependencies [9fce0f1]
147
- - Updated dependencies [83683a0]
148
- - Updated dependencies [456c88b]
149
- - Updated dependencies [456c88b]
150
- - Updated dependencies [c127273]
151
- - @pikku/core@0.12.85
152
-
153
- ## 0.12.6
154
-
155
- ### Patch Changes
156
-
157
- - 6794681: Publish the ecosystem surface as per-area sub-barrels under `@pikku/core/ecosystem/*`, and point generated code, the CLI, the inspector and the runtime adapters at them.
158
-
159
- 348 names that only generated code, the toolchain or a runtime adapter ever imports now have a second home on `@pikku/core/ecosystem/<area>` — one sub-barrel per area, matching how core already publishes its entrypoints, so no single barrel grows without bound and a consumer only pulls in the area it uses.
160
-
161
- This step is additive: every name is still exported from the entrypoint it was published from before, so nothing downstream breaks. Removing them from the app-facing barrels is a later change, and needs a release carrying `./ecosystem/*` first.
162
-
163
- - Updated dependencies [7406bfe]
164
- - Updated dependencies [6794681]
165
- - @pikku/core@0.12.84
166
-
167
- ## 0.12.5
168
-
169
- ### Patch Changes
170
-
171
- - e3d4454: Add job groups, so one shared queue can stay fair without splitting into one
172
- queue per producer.
173
-
174
- A job may now carry `group: { id, tier }`, and a worker may cap how many jobs
175
- of any one group run at once via `groupConcurrency`. On pg-boss this maps to
176
- `localGroupConcurrency`, which excludes at-capacity groups from the fetch query
177
- itself, so a capped group costs nothing rather than being fetched and restored.
178
- BullMQ declares it unsupported (groups are a BullMQ Pro feature) — being
179
- push-based, it can simply use a queue per group at no polling cost.
180
-
181
- Workflow services accept a `queueStrategy`. The default `'per-workflow'` is
182
- unchanged: every workflow gets its own `wf-orchestrator-*` / `wf-step-*` queue,
183
- which is also what lets serverless providers deploy one unit per workflow. The
184
- new `'shared-groups'` routes every workflow through the shared
185
- orchestrator/step-worker queues and isolates them by group instead, so a
186
- monolith runs one set of pollers rather than one per workflow — on a
187
- pull-based backend with dozens of workflows that is the difference between
188
- hundreds of poll loops and twenty. It is for single-process runtimes only; a
189
- per-unit serverless deploy still needs the per-workflow queues to route to its
190
- units.
191
-
192
- - Updated dependencies [24252b8]
193
- - Updated dependencies [e3d4454]
194
- - @pikku/core@0.12.69
195
-
196
- ## 0.12.4
197
-
198
- ### Patch Changes
199
-
200
- - 41ce2cb: Upgrade to TypeScript 6 and raise the minimum Node.js version to 22.
201
-
202
- All packages now build against `typescript@^6.0.3` and declare `engines.node >= 22`. Internal tooling (`ts-json-schema-generator`, `zod-to-ts`) was bumped to TypeScript 6-compatible releases.
203
-
204
- - Updated dependencies [41ce2cb]
205
- - @pikku/core@0.12.44
206
-
207
- ## 0.12.3
208
-
209
- ### Patch Changes
210
-
211
- - 92cd5b1: feat(workflow): workflow-owned step retries + stable invocationId
212
-
213
- The workflow — not the queue — now owns step retry policy, and each step
214
- invocation gets a stable idempotency key.
215
- - **Default `retries: 5` with exponential backoff.** A step with no `retries`
216
- previously inherited the queue's bare default (e.g. pg-boss `retry_limit 2`,
217
- no backoff) so retries fired instantly and couldn't outlast a transient
218
- outage. Retries now default to 5 with backoff, resolved at the workflow layer.
219
- - **`retries: 0` is honored.** Dispatch previously passed `undefined` options
220
- for `retries: 0`, letting the queue re-run a non-idempotent step up to its own
221
- default. The resolved policy now always sets `attempts` (`retries: 0` →
222
- `attempts: 1`), so the queue never second-guesses the workflow. The persisted
223
- step retries and the dispatched `attempts` are resolved together so
224
- "retries exhausted" and "no more redeliveries" are the same event.
225
- - **`workflowStep.invocationId`** — a deterministic, dependency-free
226
- `uuidv5(runId:stepName)` handed to every step. Unlike `stepId` (minted per
227
- attempt), it is identical across retries, so a step can dedupe on it
228
- (`ON CONFLICT (invocationId)`, Stripe idempotency keys, etc.).
229
- - **queue-bullmq**: `mapPikkuJobToBull` now maps `backoff` (previously dropped,
230
- so a step's backoff silently never applied on Redis), and `registerQueues`
231
- throws a clear error when no logger is available (matching queue-pg-boss).
232
- - **Dispatch failures are recoverable, not fatal.** A step is now marked
233
- `scheduled` only _after_ it is successfully handed to its transport (queue or
234
- scheduler) — a failed hand-off leaves it `pending` so a replay re-dispatches
235
- it, instead of stranding it in `scheduled` (replay would pause forever on a
236
- job that was never enqueued). A transport outage (e.g. pg-boss momentarily
237
- down) is surfaced as a new `WorkflowDispatchException`, which the orchestrator
238
- treats as transient: the run is left running and the orchestrator job is
239
- rethrown for redelivery (it replays idempotently from the snapshot) rather
240
- than the whole run being marked `failed`. The orchestrator job now also
241
- carries its own retry policy, so this holds even when the orchestrator queue
242
- is configured `retry_limit 0`. A genuine step error still fails the run.
243
- - **Same step name can be invoked multiple times in one run.** Step rows are now
244
- keyed per _invocation_: the Nth reach of a step name in a replay resolves to a
245
- physical key (`name` for the first, `name#N` for repeats), so a literal
246
- duplicate name no longer clobbers the earlier step's state. The first reach
247
- keeps the bare name, so existing rows, graph-node matching and `invocationId`s
248
- are unchanged. Ordinals are derived deterministically from DSL execution order
249
- and reset each replay.
250
- - **Step provenance (`fromStepName`) + graph cycles.** Every step now records
251
- the predecessor it was scheduled from (`fromStepName`; entry steps have none),
252
- persisted on the step row across all stores (in-memory, kysely, redis,
253
- mongodb, cloudflare DO) and carried in the queued payload. The DSL wire
254
- exposes the derived `fromInvocationId` (`uuidv5(runId:fromStepName)`) so
255
- consumers get the stable predecessor key without a second persisted id —
256
- `fromStepName` is the source of truth (it is replay-deterministic; `stepId`,
257
- minted per row, is not). This makes the walked path reconstructable even when
258
- a node is reached more than once: in `a → b → a → c` the second `a` is a
259
- distinct ordinal instance (`a#1`) whose `fromStepName` is `b`.
260
- The graph runner now supports **cycles**: a forward edge into an
261
- already-started node still collapses to a single run (joins/diamonds are
262
- unchanged), but a _back-edge_ — one whose target can reach its source — fires
263
- a fresh ordinal instance, so a node can loop back to itself. Termination is
264
- the graph's responsibility (branch routing must converge); the engine enforces
265
- no visit cap.
266
-
267
- - Updated dependencies [92cd5b1]
268
- - @pikku/core@0.12.38
269
-
270
- ## 0.12.0
271
-
272
- ## 0.12.2
273
-
274
- ### Patch Changes
275
-
276
- - 3e04565: chore: update dependencies to latest minor/patch versions
277
- - Updated dependencies [cc4c9e9]
278
- - Updated dependencies [3e04565]
279
- - @pikku/core@0.12.2
280
-
281
- ## 0.12.1
282
-
283
- ### Patch Changes
284
-
285
- - e04531f: Code quality improvements: resolve oxlint warnings and apply autofixes across the codebase (unused bindings, unnecessary constructors, prefer `const` over `let`, etc.). No behaviour changes.
286
- - Updated dependencies [62a8725]
287
- - Updated dependencies [a3bdb0d]
288
- - Updated dependencies [e0349ff]
289
- - Updated dependencies [62a8725]
290
- - Updated dependencies [e04531f]
291
- - Updated dependencies [62a8725]
292
- - Updated dependencies [a83efb8]
293
- - Updated dependencies [8eed717]
294
- - Updated dependencies [62a8725]
295
- - Updated dependencies [62a8725]
296
- - Updated dependencies [62a8725]
297
- - @pikku/core@0.12.1
298
-
299
- ### New Features
300
-
301
- - Recurring cron scheduled tasks support via `BullSchedulerService`
302
- - `setServices()`, `start()`, `stop()` lifecycle methods on scheduler and queue workers
303
-
304
- ## 0.11.0
305
-
306
- ## 0.11.2
307
-
308
- ### Patch Changes
309
-
310
- - db9c7bf: Simplify CreateWireServices type signature for custom Config compatibility
311
- - Updated dependencies [db9c7bf]
312
- - @pikku/core@0.11.2
313
-
314
- ### Fixes
315
-
316
- - ddd87eaf: Simplify CreateWireServices type signature for custom Config compatibility
317
-
318
- ## 0.11.1
319
-
320
- ### Patch Changes
321
-
322
- - 4b811db: chore: updating all dependencies
323
- - 06e1a31: breaking: change session services to wire services
324
- - Updated dependencies [4b811db]
325
- - Updated dependencies [e12a00c]
326
- - Updated dependencies [4579434]
327
- - Updated dependencies [28aeb7f]
328
- - Updated dependencies [ce902b1]
329
- - Updated dependencies [06e1a31]
330
- - @pikku/core@0.11.1
331
-
332
- ### Minor Changes
333
-
334
- - Add scheduler service implementation
335
- - Add service factory for queue and scheduler creation
336
-
337
- # @pikku/queue-bullmq
338
-
339
- ## 0.10.0
340
-
341
- This release includes significant improvements across the framework including tree-shaking support, middleware/permission factories, enhanced CLI functionality, improved TypeScript type safety, and comprehensive test strategies.
342
-
343
- For complete details, see https://pikku.dev/changelogs/0_10_0.md
344
-
345
- ## 0.9.5-next.0
346
-
347
- ### Patch Changes
348
-
349
- - Updated dependencies
350
- - @pikku/core@0.9.12-next.0
351
-
352
- ## 0.9.4
353
-
354
- ### Patch Changes
355
-
356
- - 3bb5824: fix: forcing release to see if dist is generated
357
- - Updated dependencies [99c2b3a]
358
- - @pikku/core@0.9.9
359
-
360
- ## 0.9.3
361
-
362
- ### Patch Changes
363
-
364
- - c18800d: feat: adding queue and scheduledTask to interactions
365
- - Updated dependencies [c18800d]
366
- - @pikku/core@0.9.4
367
-
368
- ## 0.9.2
369
-
370
- ### Patch Changes
371
-
372
- - a5905a9: chore: updating all dependencies
373
- - Updated dependencies [1256238]
374
- - Updated dependencies [6cf8efd]
375
- - Updated dependencies [d3a9a09]
376
- - Updated dependencies [840e078]
377
- - Updated dependencies [667d23c]
378
- - Updated dependencies [a5905a9]
379
- - @pikku/core@0.9.2
380
-
381
- ## 0.9.1
382
-
383
- ### Patch Changes
384
-
385
- - fdb1593: core: bumping everything with a patch to sync up the major release inconsistencies in dependencies
386
- - Updated dependencies [fdb1593]
387
- - @pikku/core@0.9.1
388
-
389
- ## 0.9.0
390
-
391
- ### Breaking Changes
392
-
393
- - Normalized all transports to use "wirings" instead of events/routes/transports for consistency across the framework
394
-
395
- ## 0.8.0
396
-
397
- - **BullMQ Integration**: BullMQ queue service implementation for high-performance Redis-based job queues
@@ -1,31 +0,0 @@
1
- ---
2
- type: decision
3
- title: A delayed RPC job carries the caller's session in its data, and a recurring job carries none
4
- description: BullSchedulerService stores the session in the job data and returns it from getTask, while the recurring worker runs the task by name alone
5
- tags: bullmq, scheduler, sessions, rpc
6
- ---
7
-
8
- # A delayed RPC job carries the caller's session in its data, and a recurring job carries none
9
-
10
- `BullSchedulerService` in `packages/services/queue-bullmq/src/bull-scheduler-service.ts` defines the job data
11
- as `{ rpcName, data?, session? }` (lines 17-21).
12
-
13
- **Delayed.** `scheduleRPC` takes an optional `session` (line 56) and puts it in the job data (lines 62-66). The
14
- job is added to the `pikku-remote-internal-rpc` queue with the delay (lines 69-72). `getTask` returns the stored
15
- `session` (line 116). `getAllTasks` returns only the id, rpc name and time (lines 133-137). The session is
16
- therefore stored in Redis with the job.
17
-
18
- **What runs it.** This file has no worker for that queue. The CLI generates one, `remoteRPCHandler`, whose
19
- function destructures only `{ rpcName, data }` and calls `rpc.invoke(rpcName, data)`
20
- (`packages/cli/src/functions/wirings/rpc/serialize-remote-rpc.ts:37-39`). It is wired to the queue at lines
21
- 43-47 of the same file. Nothing in that handler reads the job's `session`.
22
-
23
- **Recurring.** `start` creates a worker on `pikku-recurring-scheduled-task` (lines 161-169) that calls
24
- `runScheduledTask({ name: rpcName })` (line 166). The job data written for each task is `{ rpcName: name }`
25
- (line 179), so there is no session to carry.
26
-
27
- The same question for the in-memory scheduler is open in
28
- [does-a-delayed-rpc-run-as-the-session-it-was-scheduled-with](../../../../core/knowledge/questions/does-a-delayed-rpc-run-as-the-session-it-was-scheduled-with.md).
29
-
30
- **What this rules out:** reading `getTask().session` as evidence that the delayed run executes as that user,
31
- and putting anything secret in a session passed to `scheduleRPC`, since it is stored in the job data.
@@ -1,12 +0,0 @@
1
- ---
2
- type: overview
3
- title: Decisions
4
- ---
5
-
6
- # Decisions
7
-
8
- A rule that was chosen, and what it rules out.
9
-
10
- <!-- pikku:knowledge-index -->
11
- - [A delayed RPC job carries the caller's session in its data, and a recurring job carries none](a-delayed-rpc-job-carries-the-callers-session-and-a-recurring-job-carries-none.md) — BullSchedulerService stores the session in the job data and returns it from getTask, while the recurring worker runs the task by name alone
12
- <!-- /pikku:knowledge-index -->
@@ -1,13 +0,0 @@
1
- ---
2
- type: overview
3
- title: Knowledge
4
- description: What identity a BullMQ job carries when it runs
5
- ---
6
-
7
- # Knowledge
8
-
9
- The BullMQ scheduler runs delayed and recurring jobs. These notes record which of them carry a caller's session.
10
-
11
- <!-- pikku:knowledge-index -->
12
- - [decisions](decisions/index.md) — a rule that was chosen, and what it rules out
13
- <!-- /pikku:knowledge-index -->
package/run-tests.sh DELETED
@@ -1,68 +0,0 @@
1
- #!/bin/bash
2
-
3
- # Enable nullglob to handle cases where no files match the pattern
4
- shopt -s nullglob
5
-
6
- # Initialize variables for options
7
- watch_mode=false
8
- coverage_mode=false
9
-
10
- # Parse command-line options
11
- while [[ $# -gt 0 ]]; do
12
- case $1 in
13
- --watch)
14
- watch_mode=true
15
- shift
16
- ;;
17
- --coverage)
18
- coverage_mode=true
19
- shift
20
- ;;
21
- *)
22
- echo "Unknown option: $1"
23
- exit 1
24
- ;;
25
- esac
26
- done
27
-
28
- # Define the pattern to match your test files
29
- pattern="src/*.test.ts"
30
-
31
- # Expand the pattern into an array of files
32
- files=($(find src -type f -name "*.test.ts"))
33
-
34
- # Check if any files matched the pattern
35
- if [ ${#files[@]} -eq 0 ]; then
36
- echo "No test files found matching pattern: $pattern"
37
- if [ "${STRICT_TEST_DISCOVERY}" = "1" ]; then
38
- exit 1
39
- fi
40
- exit 0
41
- fi
42
-
43
- # Construct the bun command
44
- #
45
- # --parallel gives every test file its own worker process, which is what node's
46
- # `--test` did. Several suites keep module-level caches (a TypeScript program, a
47
- # temp fixture directory) that a shared process would leak between files.
48
- #
49
- # --timeout because bun caps a test at 5s by default where node had no cap, and
50
- # the suites that build real TypeScript programs run well past that.
51
- bun_cmd=(bun test --parallel --timeout 120000)
52
-
53
- # Append options based on flags
54
- if [ "$watch_mode" = true ]; then
55
- # --watch reruns in one process; parallel workers have nothing to watch.
56
- bun_cmd=(bun test --watch --timeout 120000)
57
- fi
58
-
59
- if [ "$coverage_mode" = true ]; then
60
- # --coverage-dir=. keeps lcov.info at the package root: CI merges every
61
- # package's report by prefixing its SF paths with the file's own directory,
62
- # so a nested coverage/ directory would re-root them one level too deep.
63
- bun_cmd+=(--coverage --coverage-reporter=lcov --coverage-reporter=text --coverage-dir=.)
64
- export PIKKU_TEST_COVERAGE=1
65
- fi
66
-
67
- # Execute the bun command with the expanded list of files
68
- "${bun_cmd[@]}" "${files[@]}"