@pikku/queue-nats 0.12.1 → 0.12.3

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,11 @@
1
1
  {
2
2
  "name": "@pikku/queue-nats",
3
- "version": "0.12.1",
3
+ "version": "0.12.3",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/pikkujs/pikku.git",
7
+ "directory": "packages/services/queue-nats"
8
+ },
4
9
  "description": "NATS JetStream queue, worker and scheduler services for Pikku",
5
10
  "author": "yasser.fadl@gmail.com",
6
11
  "license": "MIT",
@@ -12,22 +17,25 @@
12
17
  "test": "bash run-tests.sh",
13
18
  "test:coverage": "bash run-tests.sh --coverage",
14
19
  "ncu": "npx npm-check-updates",
15
- "build": "tsc -b",
20
+ "build": "bun run clean && tsc -b",
16
21
  "release": "npm run build && npm test",
17
- "prepublishOnly": "yarn build"
22
+ "prepublishOnly": "bun run build",
23
+ "clean": "rm -rf dist tsconfig.tsbuildinfo"
18
24
  },
19
25
  "peerDependencies": {
20
- "@pikku/core": "^0.12.105"
26
+ "@pikku/core": "^0.12.144"
21
27
  },
22
28
  "dependencies": {
23
29
  "@nats-io/jetstream": "^3.4.0",
24
30
  "@nats-io/nats-core": "^3.4.0",
25
31
  "@nats-io/transport-node": "^3.4.0"
26
32
  },
27
- "devDependencies": {
28
- "typescript": "^6.0.3"
29
- },
30
33
  "exports": {
31
- ".": "./dist/index.js"
32
- }
34
+ ".": "./dist/index.js",
35
+ "./package.json": "./package.json"
36
+ },
37
+ "files": [
38
+ "dist",
39
+ "!dist/**/*.tsbuildinfo"
40
+ ]
33
41
  }
package/CHANGELOG.md DELETED
@@ -1,9 +0,0 @@
1
- # @pikku/queue-nats
2
-
3
- ## 0.12.1
4
-
5
- ### Patch Changes
6
-
7
- - 427c4fe: **`@pikku/queue-nats`** — NATS JetStream queue, worker and scheduler services, alongside the pg-boss and bullmq adapters. Jobs publish to a work-queue stream, each queue gets its own durable pull consumer, and `max_ack_pending` is real per-message concurrency rather than a batch size, so a slow job occupies one slot instead of holding its batch siblings. The per-job retry policy travels in headers because JetStream's `max_deliver` is per-consumer and cannot express a step marked "never retry", and `ack_wait` is always set to pg-boss's 900s parity rather than left to the server's 30s default — unset, any job running longer than 30s is redelivered while it is still running and executed twice. Cron and one-shot delays use the server's own message scheduler, so a schedule is a retained message on a reserved subject: publishing registers it, republishing replaces it, purging cancels it. That needs a server on 2.14+, and `NatsServiceFactory` refuses to start against anything older rather than silently not scheduling. `supportsResults` is `false`, deliberately — a work-queue stream deletes a message on ack, so there is nowhere for a job result or any job history to live, and per-job outcomes come from telemetry instead.
8
- - Updated dependencies [1ab831e]
9
- - @pikku/core@0.12.105
package/run-tests.sh DELETED
@@ -1,56 +0,0 @@
1
- #!/bin/bash
2
-
3
- script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
4
- cd "$script_dir"
5
-
6
- # Enable nullglob to handle cases where no files match the pattern
7
- shopt -s nullglob
8
-
9
- # Initialize variables for options
10
- watch_mode=false
11
- coverage_mode=false
12
-
13
- # Parse command-line options
14
- while [[ $# -gt 0 ]]; do
15
- case $1 in
16
- --watch)
17
- watch_mode=true
18
- shift
19
- ;;
20
- --coverage)
21
- coverage_mode=true
22
- shift
23
- ;;
24
- *)
25
- echo "Unknown option: $1"
26
- exit 1
27
- ;;
28
- esac
29
- done
30
-
31
- # Define the pattern to match your test files
32
- pattern="src/*.test.ts"
33
-
34
- # Expand the pattern into an array of files
35
- files=($(find src -type f -name "*.test.ts"))
36
-
37
- # Check if any files matched the pattern
38
- if [ ${#files[@]} -eq 0 ]; then
39
- echo "No test files found matching pattern: $pattern"
40
- exit 0
41
- fi
42
-
43
- # Construct the node command
44
- node_cmd=(node --import tsx --test)
45
-
46
- # Append options based on flags
47
- if [ "$watch_mode" = true ]; then
48
- node_cmd+=(--watch)
49
- fi
50
-
51
- if [ "$coverage_mode" = true ]; then
52
- node_cmd+=(--test-coverage-include="src/**/*.{ts,js}" --test-coverage-exclude="**/dist/**" --experimental-test-coverage --test-reporter=lcov --test-reporter-destination=lcov.info)
53
- fi
54
-
55
- # Execute the node command with the expanded list of files
56
- "${node_cmd[@]}" "${files[@]}"