@absolutejs/sync-bus-redis 0.0.1 → 0.0.2

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.
@@ -0,0 +1,61 @@
1
+ {
2
+ "contract": 1,
3
+ "identity": {
4
+ "accent": "#d82c20",
5
+ "category": "sync",
6
+ "description": "Redis pub/sub `ClusterBus` for `@absolutejs/sync` — cross-instance fan-out via PUBLISH/SUBSCRIBE. No payload cap and lower fan-out latency than the Postgres sibling, at the cost of at-most-once delivery (a disconnected subscriber misses messages — use `@absolutejs/sync-bus-pg` when you need the durable spill table). Works with any Redis client (ioredis, node-redis) through a narrow publisher/subscriber interface.",
7
+ "docsUrl": "https://github.com/absolutejs/sync-adapters/tree/main/redis",
8
+ "name": "@absolutejs/sync-bus-redis",
9
+ "tagline": "Scale live updates across servers with Redis."
10
+ },
11
+ "implements": [
12
+ {
13
+ "contract": "sync/cluster-bus",
14
+ "factory": "createRedisClusterBus",
15
+ "from": "@absolutejs/sync-bus-redis",
16
+ "requires": {
17
+ "env": [
18
+ {
19
+ "description": "Redis connection string the cluster bus publishes and subscribes on",
20
+ "example": "redis://default:pass@host:6379",
21
+ "key": "REDIS_URL",
22
+ "secret": true
23
+ }
24
+ ],
25
+ "services": [
26
+ {
27
+ "description": "Carries change fan-out between server instances",
28
+ "id": "redis"
29
+ }
30
+ ]
31
+ },
32
+ "settings": {
33
+ "type": "object",
34
+ "properties": {
35
+ "channel": {
36
+ "description": "Redis channel name. Two engines on the same Redis can stay separate by using different channels. Default absolutejs_sync_cluster.",
37
+ "title": "Channel name",
38
+ "type": "string"
39
+ }
40
+ }
41
+ },
42
+ "title": "Redis pub/sub (fast fan-out, at-most-once)",
43
+ "wiring": {
44
+ "code": "// TODO: create two Redis connections from ${env.REDIS_URL} with your\n// client (e.g. ioredis: `new Redis(url)` plus a `.duplicate()` for the\n// subscription) and wrap them as RedisPublisher / RedisSubscriber —\n// see the package README for ioredis and node-redis wrappers.\ncreateRedisClusterBus({ publisher: redisPublisher, subscriber: redisSubscriber, ...${settings} })",
45
+ "imports": [
46
+ {
47
+ "from": "@absolutejs/sync-bus-redis",
48
+ "names": [
49
+ "createRedisClusterBus"
50
+ ]
51
+ }
52
+ ]
53
+ }
54
+ }
55
+ ],
56
+ "settings": {
57
+ "type": "object",
58
+ "properties": {}
59
+ },
60
+ "wiring": []
61
+ }
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@absolutejs/sync-bus-redis",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Redis pub/sub ClusterBus for @absolutejs/sync — cross-instance fan-out via PUBLISH/SUBSCRIBE. Sibling to @absolutejs/sync-bus-pg; faster fanout, better geo-replication story. Works with any Redis client (ioredis, node-redis, etc.) via a narrow tag-template interface.",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/absolutejs/sync-adapters.git",
8
8
  "directory": "redis"
9
9
  },
10
+ "homepage": "https://github.com/absolutejs/sync-adapters/tree/main/redis",
11
+ "bugs": {
12
+ "url": "https://github.com/absolutejs/sync-adapters/issues"
13
+ },
10
14
  "main": "./dist/index.js",
11
15
  "module": "./dist/index.js",
12
16
  "types": "./dist/index.d.ts",
@@ -26,7 +30,7 @@
26
30
  "multi-region"
27
31
  ],
28
32
  "scripts": {
29
- "build": "rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync && tsc --project tsconfig.build.json",
33
+ "build": "rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync && tsc --project tsconfig.build.json && absolute-manifest emit",
30
34
  "test": "bun test",
31
35
  "typecheck": "tsc --noEmit",
32
36
  "format": "prettier --write \"./**/*.{ts,json,md}\"",
@@ -46,10 +50,23 @@
46
50
  "types": "./dist/index.d.ts",
47
51
  "import": "./dist/index.js",
48
52
  "default": "./dist/index.js"
49
- }
53
+ },
54
+ "./manifest": {
55
+ "types": "./dist/manifest.d.ts",
56
+ "import": "./dist/manifest.js",
57
+ "default": "./dist/manifest.js"
58
+ },
59
+ "./manifest.json": "./dist/manifest.json"
50
60
  },
51
61
  "files": [
52
62
  "dist",
53
63
  "README.md"
54
- ]
64
+ ],
65
+ "absolutejs": {
66
+ "manifestContract": 1
67
+ },
68
+ "dependencies": {
69
+ "@absolutejs/manifest": "^0.1.0",
70
+ "@sinclair/typebox": "^0.34.0"
71
+ }
55
72
  }