@starci/hfs 4.2.0 → 4.2.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/CHANGELOG.md +4 -0
- package/package.json +1 -1
- package/runtime/knowledge/hfs/canon-pins.yaml +4 -4
- package/templates/be/patterns/queues/platform/bullmq-queue-transport.client.spec.ts.tpl +3 -2
- package/templates/be/patterns/queues/platform/bullmq-queue-transport.client.ts.tpl +6 -1
- package/templates/be/patterns/queues/platform/queue-relay.service.spec.ts.tpl +1 -0
- package/templates/be/patterns/queues/platform/queue-transport.port.ts.tpl +2 -0
- package/templates/be/patterns/queues/platform/queue-worker.service.spec.ts.tpl +1 -0
- package/templates/be/patterns/queues/platform/queue.config.ts.tpl +1 -0
- package/templates/be/patterns/queues/platform/queue.options.ts.tpl +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.2.1 - 2026-10-10
|
|
4
|
+
|
|
5
|
+
- Fixed: queue templates preserve the declared Redis database for both Queue and Worker connections, with a nonzero-database adapter regression.
|
|
6
|
+
|
|
3
7
|
## 4.2.0 - 2026-10-09
|
|
4
8
|
|
|
5
9
|
- Changed: the lint runner (`lint/run.mjs`) and the bundled runtime copies follow the runtime of 1.0.0-alpha.9. Version 4.1.0 on the registry carries the copies of an earlier runtime.
|
package/package.json
CHANGED
|
@@ -29,14 +29,14 @@ pins:
|
|
|
29
29
|
source: packages/grammar/package.json
|
|
30
30
|
why: 'the grammar front ends read: the brand layer sets `--font-sans` and `--font-mono` and the grammar reads them; it carries the Input tel kind and the IconButton disclosure props. The runtime source version wins for a @starci package.'
|
|
31
31
|
'@starci/eslint-canon-be':
|
|
32
|
-
version: 3.2.
|
|
32
|
+
version: 3.2.1
|
|
33
33
|
group: starci
|
|
34
34
|
install: registry
|
|
35
35
|
side: be
|
|
36
36
|
source: packages/eslint/be/package.json
|
|
37
37
|
why: 'the back-end ESLint canon: `loadHfs(import.meta.url)` of be/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the be side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; `starciBeConfig({ hfs: loadHfs(import.meta.url) })` is the typed factory and the BE-CONVENTION laws are its rules.'
|
|
38
38
|
'@starci/eslint-canon-fe':
|
|
39
|
-
version: 8.2.
|
|
39
|
+
version: 8.2.1
|
|
40
40
|
group: starci
|
|
41
41
|
install: registry
|
|
42
42
|
side: fe
|
|
@@ -76,14 +76,14 @@ pins:
|
|
|
76
76
|
source: packages/test-world/package.json
|
|
77
77
|
why: 'the shared e2e library of every back end (R47, R48), a devDependency of every back end: the warm stack behind toxiproxy, the network-edge fakes, the Nest boot, the typed useTestWorld handle, useSandbox for contract specs and the outage lock. Kafka is real own infra (the one digest-pinned apache/kafka KRaft image, a broker listener and proxy per slot, slot-prefixed topics, consumer groups and client ids) and Postgres is schema-per-context (a schema and a login role per context in a shared database). Each worker has its own data slot (<ns>_w<k>) with its own databases, Keycloak realm, leased Redis DB, bucket/collection/topic prefixes, fakes host, toxiproxy proxies and outage lock; a run provisions min(jest workers, workers cap, default 2) slots, and state file protocol 2 pairs exactly with @starci/jest-preset (TEST_WORLD_PAIR_MISMATCH otherwise). A modules world boots real peer apps beside its modules, world.apps.<name>.during(fn) is the outage of a peer app, w.keycloak.clientSecret(client) answers the run-generated secret of a confidential realm client, world.keycloak.events/sessions read the realm user events and live sessions, world.infra.postgresql.connection(name) takes one database connection down while the others serve, and world.resolve and scope.resolve take any Nest token. Every path a declaration names (`stack`, seeds, the realm, Dockerfiles) resolves from the app root (the directory of hfs.json); the globalSetup registers the path aliases as TypeScript resolves them. Its CLI main is exported at ./cli for starci app stack.'
|
|
78
78
|
'@starci/cli':
|
|
79
|
-
version: 1.2.
|
|
79
|
+
version: 1.2.1
|
|
80
80
|
group: starci
|
|
81
81
|
install: registry
|
|
82
82
|
side: both
|
|
83
83
|
source: packages/cli/package.json
|
|
84
84
|
why: 'the only StarCi command package; product repositories install it for starci app, while @starci/hfs remains its pinned transitive implementation.'
|
|
85
85
|
'@starci/hfs':
|
|
86
|
-
version: 4.2.
|
|
86
|
+
version: 4.2.1
|
|
87
87
|
group: starci
|
|
88
88
|
install: registry
|
|
89
89
|
side: both
|
|
@@ -10,6 +10,7 @@ import type { BullmqJob, BullmqQueue, BullmqWorker, QueueFactory } from "./queue
|
|
|
10
10
|
const options: QueueOptions = {
|
|
11
11
|
redisHost: "redis.test",
|
|
12
12
|
redisPort: 6380,
|
|
13
|
+
redisDb: 7,
|
|
13
14
|
prefix: "spec.",
|
|
14
15
|
relayIntervalMs: 100,
|
|
15
16
|
relayBatch: 50,
|
|
@@ -45,7 +46,7 @@ describe("BullmqQueueTransportClient", () => {
|
|
|
45
46
|
expect(factory.queue).toHaveBeenCalledTimes(1)
|
|
46
47
|
expect(factory.queue).toHaveBeenCalledWith("orders", {
|
|
47
48
|
prefix: "spec.",
|
|
48
|
-
connection: { host: "redis.test", port: 6380, maxRetriesPerRequest: null },
|
|
49
|
+
connection: { host: "redis.test", port: 6380, db: 7, maxRetriesPerRequest: null },
|
|
49
50
|
})
|
|
50
51
|
expect(queue.add).toHaveBeenNthCalledWith(1, "orders", payload, {
|
|
51
52
|
jobId: "outbox-1",
|
|
@@ -84,7 +85,7 @@ describe("BullmqQueueTransportClient", () => {
|
|
|
84
85
|
|
|
85
86
|
expect(factory.worker).toHaveBeenCalledWith("orders", expect.any(Function), {
|
|
86
87
|
prefix: "spec.",
|
|
87
|
-
connection: { host: "redis.test", port: 6380, maxRetriesPerRequest: null },
|
|
88
|
+
connection: { host: "redis.test", port: 6380, db: 7, maxRetriesPerRequest: null },
|
|
88
89
|
concurrency: 3,
|
|
89
90
|
})
|
|
90
91
|
const processor = factory.worker.mock.calls[0]?.[1]
|
|
@@ -67,7 +67,12 @@ export class BullmqQueueTransportClient implements QueueTransport {
|
|
|
67
67
|
private connection(): BullmqConnection {
|
|
68
68
|
return {
|
|
69
69
|
prefix: this.options.prefix,
|
|
70
|
-
connection: {
|
|
70
|
+
connection: {
|
|
71
|
+
host: this.options.redisHost,
|
|
72
|
+
port: this.options.redisPort,
|
|
73
|
+
db: this.options.redisDb,
|
|
74
|
+
maxRetriesPerRequest: null,
|
|
75
|
+
},
|
|
71
76
|
}
|
|
72
77
|
}
|
|
73
78
|
|
|
@@ -20,6 +20,8 @@ export interface BullmqRedis {
|
|
|
20
20
|
readonly host: string
|
|
21
21
|
/** The port. */
|
|
22
22
|
readonly port: number
|
|
23
|
+
/** The Redis database that holds this app's queue state. */
|
|
24
|
+
readonly db: number
|
|
23
25
|
/** BullMQ answers to commands only through a client that does not retry on its own. */
|
|
24
26
|
readonly maxRetriesPerRequest: number | null
|
|
25
27
|
}
|
|
@@ -8,6 +8,7 @@ export type QueueConfig = Omit<QueueOptions, "connections" | "schedulers">
|
|
|
8
8
|
export const parseQueueConfig = (env: EnvSource): QueueConfig => ({
|
|
9
9
|
redisHost: env.string("QUEUE_REDIS_HOST"),
|
|
10
10
|
redisPort: env.int("QUEUE_REDIS_PORT", 6379),
|
|
11
|
+
redisDb: env.int("QUEUE_REDIS_DB", 0),
|
|
11
12
|
prefix: env.optional("QUEUE_PREFIX") ?? "queue",
|
|
12
13
|
relayIntervalMs: env.duration("QUEUE_RELAY_INTERVAL", 200),
|
|
13
14
|
relayBatch: env.int("QUEUE_RELAY_BATCH", 50),
|
|
@@ -7,6 +7,8 @@ export interface QueueOptions {
|
|
|
7
7
|
readonly redisHost: string
|
|
8
8
|
/** The Redis port. */
|
|
9
9
|
readonly redisPort: number
|
|
10
|
+
/** The Redis database that holds this app's queue state. */
|
|
11
|
+
readonly redisDb: number
|
|
10
12
|
/** What every BullMQ key starts with: the shared default in a deployment, the run prefix of a test world. */
|
|
11
13
|
readonly prefix: string
|
|
12
14
|
/** The pause between two relay passes over an empty outbox. */
|