File tree Expand file tree Collapse file tree 6 files changed +18
-18
lines changed
packages/nextjs-cache-handler Expand file tree Collapse file tree 6 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -126,10 +126,10 @@ const redisHandler = await createRedisHandler({
126126``` js
127127import { createCluster } from " @redis/client" ;
128128import createRedisHandler from " @fortedigital/nextjs-cache-handler/redis-strings" ;
129- import { withProxy } from " @fortedigital/nextjs-cache-handler/cluster/proxy " ;
129+ import { withAdapter } from " @fortedigital/nextjs-cache-handler/cluster/adapter " ;
130130
131131const { hostname: redisHostName } = new URL (process .env .REDIS_URL );
132- redis = withProxy (
132+ redis = withAdapter (
133133 createCluster ({
134134 rootNodes: [{ url: process .env .REDIS_URL }],
135135
@@ -145,7 +145,7 @@ redis = withProxy(
145145 })
146146);
147147
148- // after using withProxy you can use redis cluster instance as parameter for createRedisHandler
148+ // after using withAdapter you can use redis cluster instance as parameter for createRedisHandler
149149const redisCacheHandler = createRedisHandler ({
150150 client: redis,
151151 keyPrefix: CACHE_PREFIX ,
Original file line number Diff line number Diff line change 1818 " next" ,
1919 " redis"
2020 ],
21- "version" : " 2.1.0-canary9 " ,
21+ "version" : " 2.1.0-canary10 " ,
2222 "type" : " module" ,
2323 "license" : " MIT" ,
2424 "description" : " Next.js cache handlers" ,
3535 "require" : " ./dist/instrumentation/instrumentation.cjs" ,
3636 "import" : " ./dist/instrumentation/instrumentation.js"
3737 },
38- "./cluster/proxy " : {
39- "require" : " ./dist/helpers/redisClusterProxy .cjs" ,
40- "import" : " ./dist/helpers/redisClusterProxy .js"
38+ "./cluster/adapter " : {
39+ "require" : " ./dist/helpers/redisClusterAdapter .cjs" ,
40+ "import" : " ./dist/helpers/redisClusterAdapter .js"
4141 },
4242 "./helpers/withAbortSignal" : {
4343 "require" : " ./dist/helpers/withAbortSignal.cjs" ,
6565 "local-lru" : [
6666 " dist/handlers/local-lru.d.ts"
6767 ],
68- "cluster/proxy " : [
69- " dist/helpers/redisClusterProxy .d.ts"
68+ "cluster/adapter " : [
69+ " dist/helpers/redisClusterAdapter .d.ts"
7070 ],
7171 "helpers/withAbortSignal" : [
7272 " dist/helpers/withAbortSignal.d.ts"
Original file line number Diff line number Diff line change 77 parseBuffersToStrings ,
88} from "../helpers/buffer" ;
99import type { RedisClientType } from "@redis/client" ;
10- import { RedisClusterCacheProxy } from "../helpers/redisClusterProxy " ;
10+ import { RedisClusterCacheAdapter } from "../helpers/redisClusterAdapter " ;
1111import { withAbortSignalProxy } from "../helpers/withAbortSignalProxy" ;
1212
1313/**
@@ -34,7 +34,7 @@ export default function createHandler({
3434 keyExpirationStrategy = "EXPIREAT" ,
3535 revalidateTagQuerySize = 10_000 ,
3636} : CreateRedisStringsHandlerOptions <
37- RedisClientType | RedisClusterCacheProxy
37+ RedisClientType | RedisClusterCacheAdapter
3838> ) : Handler {
3939 const client = withAbortSignalProxy ( innerClient ) ;
4040
Original file line number Diff line number Diff line change 11import type { RedisClusterType } from "@redis/client" ;
22
3- export type RedisClusterCacheProxy = RedisClusterType & {
3+ export type RedisClusterCacheAdapter = RedisClusterType & {
44 isReady : boolean ;
55} ;
66
7- export function withProxy < T extends RedisClusterType > (
7+ export function withAdapter < T extends RedisClusterType > (
88 cluster : RedisClusterType ,
9- ) : RedisClusterCacheProxy {
9+ ) : RedisClusterCacheAdapter {
1010 const handler : ProxyHandler < T > = {
1111 get ( target , prop , receiver ) {
1212 if ( prop === "isReady" ) {
@@ -17,5 +17,5 @@ export function withProxy<T extends RedisClusterType>(
1717 } ,
1818 } ;
1919
20- return new Proxy ( cluster , handler ) as RedisClusterCacheProxy ;
20+ return new Proxy ( cluster , handler ) as RedisClusterCacheAdapter ;
2121}
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ export const tsup = defineConfig({
55 entry : [
66 "src/handlers/*.ts" ,
77 "src/instrumentation/*.ts" ,
8- "src/helpers/redisClusterProxy .ts" ,
8+ "src/helpers/redisClusterAdapter .ts" ,
99 "src/helpers/withAbortSignal.ts" ,
1010 "src/helpers/withAbortSignalProxy.ts" ,
1111 ] ,
You can’t perform that action at this time.
0 commit comments