Skip to content

Commit a1957fd

Browse files
committed
Rename and cleanup
1 parent 956ddbe commit a1957fd

File tree

6 files changed

+18
-18
lines changed

6 files changed

+18
-18
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,10 @@ const redisHandler = await createRedisHandler({
126126
```js
127127
import { createCluster } from "@redis/client";
128128
import 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

131131
const { 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
149149
const redisCacheHandler = createRedisHandler({
150150
client: redis,
151151
keyPrefix: CACHE_PREFIX,

packages/nextjs-cache-handler/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/nextjs-cache-handler/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
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",
@@ -35,9 +35,9 @@
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",
@@ -65,8 +65,8 @@
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"

packages/nextjs-cache-handler/src/handlers/redis-strings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import {
77
parseBuffersToStrings,
88
} from "../helpers/buffer";
99
import type { RedisClientType } from "@redis/client";
10-
import { RedisClusterCacheProxy } from "../helpers/redisClusterProxy";
10+
import { RedisClusterCacheAdapter } from "../helpers/redisClusterAdapter";
1111
import { 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 numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import 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
}

packages/nextjs-cache-handler/tsup.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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
],

0 commit comments

Comments
 (0)