@mhbdev/redis 0.2.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.
Files changed (123) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE +21 -0
  3. package/README.md +173 -0
  4. package/dist/bullmq/adapter.d.ts +49 -0
  5. package/dist/bullmq/adapter.d.ts.map +1 -0
  6. package/dist/bullmq/adapter.js +56 -0
  7. package/dist/bullmq/adapter.js.map +1 -0
  8. package/dist/bullmq/index.d.ts +3 -0
  9. package/dist/bullmq/index.d.ts.map +1 -0
  10. package/dist/bullmq/index.js +2 -0
  11. package/dist/bullmq/index.js.map +1 -0
  12. package/dist/cache/cache.d.ts +31 -0
  13. package/dist/cache/cache.d.ts.map +1 -0
  14. package/dist/cache/cache.js +78 -0
  15. package/dist/cache/cache.js.map +1 -0
  16. package/dist/cache/index.d.ts +3 -0
  17. package/dist/cache/index.d.ts.map +1 -0
  18. package/dist/cache/index.js +2 -0
  19. package/dist/cache/index.js.map +1 -0
  20. package/dist/core/codec.d.ts +7 -0
  21. package/dist/core/codec.d.ts.map +1 -0
  22. package/dist/core/codec.js +24 -0
  23. package/dist/core/codec.js.map +1 -0
  24. package/dist/core/errors.d.ts +43 -0
  25. package/dist/core/errors.d.ts.map +1 -0
  26. package/dist/core/errors.js +84 -0
  27. package/dist/core/errors.js.map +1 -0
  28. package/dist/core/executor.d.ts +28 -0
  29. package/dist/core/executor.d.ts.map +1 -0
  30. package/dist/core/executor.js +27 -0
  31. package/dist/core/executor.js.map +1 -0
  32. package/dist/core/keys.d.ts +4 -0
  33. package/dist/core/keys.d.ts.map +1 -0
  34. package/dist/core/keys.js +15 -0
  35. package/dist/core/keys.js.map +1 -0
  36. package/dist/index.d.ts +15 -0
  37. package/dist/index.d.ts.map +1 -0
  38. package/dist/index.js +11 -0
  39. package/dist/index.js.map +1 -0
  40. package/dist/ioredis/executor.d.ts +30 -0
  41. package/dist/ioredis/executor.d.ts.map +1 -0
  42. package/dist/ioredis/executor.js +52 -0
  43. package/dist/ioredis/executor.js.map +1 -0
  44. package/dist/ioredis/index.d.ts +5 -0
  45. package/dist/ioredis/index.d.ts.map +1 -0
  46. package/dist/ioredis/index.js +3 -0
  47. package/dist/ioredis/index.js.map +1 -0
  48. package/dist/ioredis/pubsub.d.ts +16 -0
  49. package/dist/ioredis/pubsub.d.ts.map +1 -0
  50. package/dist/ioredis/pubsub.js +42 -0
  51. package/dist/ioredis/pubsub.js.map +1 -0
  52. package/dist/locks/index.d.ts +3 -0
  53. package/dist/locks/index.d.ts.map +1 -0
  54. package/dist/locks/index.js +2 -0
  55. package/dist/locks/index.js.map +1 -0
  56. package/dist/locks/locks.d.ts +25 -0
  57. package/dist/locks/locks.d.ts.map +1 -0
  58. package/dist/locks/locks.js +77 -0
  59. package/dist/locks/locks.js.map +1 -0
  60. package/dist/node/client.d.ts +47 -0
  61. package/dist/node/client.d.ts.map +1 -0
  62. package/dist/node/client.js +155 -0
  63. package/dist/node/client.js.map +1 -0
  64. package/dist/node/errors.d.ts +3 -0
  65. package/dist/node/errors.d.ts.map +1 -0
  66. package/dist/node/errors.js +16 -0
  67. package/dist/node/errors.js.map +1 -0
  68. package/dist/node/index.d.ts +6 -0
  69. package/dist/node/index.d.ts.map +1 -0
  70. package/dist/node/index.js +4 -0
  71. package/dist/node/index.js.map +1 -0
  72. package/dist/node/pool.d.ts +31 -0
  73. package/dist/node/pool.d.ts.map +1 -0
  74. package/dist/node/pool.js +131 -0
  75. package/dist/node/pool.js.map +1 -0
  76. package/dist/node/pubsub.d.ts +16 -0
  77. package/dist/node/pubsub.d.ts.map +1 -0
  78. package/dist/node/pubsub.js +41 -0
  79. package/dist/node/pubsub.js.map +1 -0
  80. package/dist/pubsub/contracts.d.ts +6 -0
  81. package/dist/pubsub/contracts.d.ts.map +1 -0
  82. package/dist/pubsub/contracts.js +2 -0
  83. package/dist/pubsub/contracts.js.map +1 -0
  84. package/dist/pubsub/index.d.ts +3 -0
  85. package/dist/pubsub/index.d.ts.map +1 -0
  86. package/dist/pubsub/index.js +2 -0
  87. package/dist/pubsub/index.js.map +1 -0
  88. package/dist/pubsub/pubsub.d.ts +15 -0
  89. package/dist/pubsub/pubsub.d.ts.map +1 -0
  90. package/dist/pubsub/pubsub.js +62 -0
  91. package/dist/pubsub/pubsub.js.map +1 -0
  92. package/dist/queue/index.d.ts +3 -0
  93. package/dist/queue/index.d.ts.map +1 -0
  94. package/dist/queue/index.js +2 -0
  95. package/dist/queue/index.js.map +1 -0
  96. package/dist/queue/queue.d.ts +78 -0
  97. package/dist/queue/queue.d.ts.map +1 -0
  98. package/dist/queue/queue.js +260 -0
  99. package/dist/queue/queue.js.map +1 -0
  100. package/dist/rate-limit/contracts.d.ts +93 -0
  101. package/dist/rate-limit/contracts.d.ts.map +1 -0
  102. package/dist/rate-limit/contracts.js +304 -0
  103. package/dist/rate-limit/contracts.js.map +1 -0
  104. package/dist/rate-limit/index.d.ts +3 -0
  105. package/dist/rate-limit/index.d.ts.map +1 -0
  106. package/dist/rate-limit/index.js +2 -0
  107. package/dist/rate-limit/index.js.map +1 -0
  108. package/dist/testing/fake-executor.d.ts +9 -0
  109. package/dist/testing/fake-executor.d.ts.map +1 -0
  110. package/dist/testing/fake-executor.js +15 -0
  111. package/dist/testing/fake-executor.js.map +1 -0
  112. package/dist/testing/index.d.ts +2 -0
  113. package/dist/testing/index.d.ts.map +1 -0
  114. package/dist/testing/index.js +2 -0
  115. package/dist/testing/index.js.map +1 -0
  116. package/docs/adapters.md +41 -0
  117. package/docs/architecture.md +41 -0
  118. package/docs/errors.md +27 -0
  119. package/docs/migration.md +21 -0
  120. package/docs/queues.md +13 -0
  121. package/docs/rate-limiting.md +23 -0
  122. package/docs/releasing.md +45 -0
  123. package/package.json +135 -0
package/package.json ADDED
@@ -0,0 +1,135 @@
1
+ {
2
+ "name": "@mhbdev/redis",
3
+ "version": "0.2.0",
4
+ "description": "Typed, production-ready Redis infrastructure for Node.js and Bun.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/index.js",
8
+ "module": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "sideEffects": false,
11
+ "engines": {
12
+ "node": ">=20"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/mhbdev/redis.git"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/mhbdev/redis/issues"
20
+ },
21
+ "homepage": "https://github.com/mhbdev/redis#readme",
22
+ "keywords": [
23
+ "redis",
24
+ "rate-limit",
25
+ "cache",
26
+ "lock",
27
+ "queue",
28
+ "pubsub",
29
+ "typescript"
30
+ ],
31
+ "files": [
32
+ "dist",
33
+ "README.md",
34
+ "LICENSE",
35
+ "CHANGELOG.md",
36
+ "docs"
37
+ ],
38
+ "exports": {
39
+ ".": {
40
+ "types": "./dist/index.d.ts",
41
+ "import": "./dist/index.js",
42
+ "default": "./dist/index.js"
43
+ },
44
+ "./node": {
45
+ "types": "./dist/node/index.d.ts",
46
+ "import": "./dist/node/index.js",
47
+ "default": "./dist/node/index.js"
48
+ },
49
+ "./ioredis": {
50
+ "types": "./dist/ioredis/index.d.ts",
51
+ "import": "./dist/ioredis/index.js",
52
+ "default": "./dist/ioredis/index.js"
53
+ },
54
+ "./bullmq": {
55
+ "types": "./dist/bullmq/index.d.ts",
56
+ "import": "./dist/bullmq/index.js",
57
+ "default": "./dist/bullmq/index.js"
58
+ },
59
+ "./rate-limit": {
60
+ "types": "./dist/rate-limit/index.d.ts",
61
+ "import": "./dist/rate-limit/index.js",
62
+ "default": "./dist/rate-limit/index.js"
63
+ },
64
+ "./cache": {
65
+ "types": "./dist/cache/index.d.ts",
66
+ "import": "./dist/cache/index.js",
67
+ "default": "./dist/cache/index.js"
68
+ },
69
+ "./locks": {
70
+ "types": "./dist/locks/index.d.ts",
71
+ "import": "./dist/locks/index.js",
72
+ "default": "./dist/locks/index.js"
73
+ },
74
+ "./pubsub": {
75
+ "types": "./dist/pubsub/index.d.ts",
76
+ "import": "./dist/pubsub/index.js",
77
+ "default": "./dist/pubsub/index.js"
78
+ },
79
+ "./queue": {
80
+ "types": "./dist/queue/index.d.ts",
81
+ "import": "./dist/queue/index.js",
82
+ "default": "./dist/queue/index.js"
83
+ },
84
+ "./testing": {
85
+ "types": "./dist/testing/index.d.ts",
86
+ "import": "./dist/testing/index.js",
87
+ "default": "./dist/testing/index.js"
88
+ },
89
+ "./package.json": "./package.json"
90
+ },
91
+ "publishConfig": {
92
+ "access": "public",
93
+ "provenance": true
94
+ },
95
+ "scripts": {
96
+ "build": "tsc -p tsconfig.build.json",
97
+ "clean": "node -e \"import('node:fs/promises').then(({rm}) => rm('dist', {recursive:true, force:true}))\"",
98
+ "typecheck": "tsc --noEmit",
99
+ "test": "vitest run",
100
+ "test:integration": "vitest run test/integration --passWithNoTests",
101
+ "test:watch": "vitest",
102
+ "lint": "biome check .",
103
+ "format": "biome format --write .",
104
+ "audit": "npm audit --audit-level=high && npm audit --omit=dev --audit-level=high && npm audit signatures",
105
+ "pack:check": "npm run build && publint && attw --pack --profile esm-only --quiet && npm pack --dry-run && npm run pack:smoke",
106
+ "pack:smoke": "node scripts/pack-smoke.mjs",
107
+ "version": "changeset version",
108
+ "release": "changeset publish"
109
+ },
110
+ "dependencies": {
111
+ "redis": "^6.3.0"
112
+ },
113
+ "peerDependencies": {
114
+ "bullmq": ">=5",
115
+ "ioredis": ">=5"
116
+ },
117
+ "peerDependenciesMeta": {
118
+ "bullmq": {
119
+ "optional": true
120
+ },
121
+ "ioredis": {
122
+ "optional": true
123
+ }
124
+ },
125
+ "devDependencies": {
126
+ "@arethetypeswrong/cli": "^0.18.2",
127
+ "@biomejs/biome": "^2.5.15",
128
+ "@changesets/changelog-github": "^1.0.1",
129
+ "@changesets/cli": "^3.0.3",
130
+ "@types/node": "^25.0.0",
131
+ "publint": "^0.3.25",
132
+ "typescript": "7.0.2",
133
+ "vitest": "^5.0.3"
134
+ }
135
+ }