Skip to content

Commit

Permalink
feat: export experimental modules (#472)
Browse files Browse the repository at this point in the history
  • Loading branch information
uki00a authored Dec 7, 2024
1 parent e33db58 commit a0406a9
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
6 changes: 5 additions & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"name": "@db/redis",
"version": "0.35.0",
"exports": "./mod.ts",
"exports": {
".": "./mod.ts",
"./experimental/cluster": "./experimental/cluster/mod.ts",
"./experimental/web-streams-connection": "./experimental/web_streams_connection/mod.ts"
},
"exclude": [
"benchmark/node_modules",
"tmp"
Expand Down
2 changes: 1 addition & 1 deletion experimental/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The implementation is based on the
## Usage

```typescript
import { connect } from "https://deno.land/x/redis/experimental/cluster/mod.ts";
import { connect } from "@db/redis/experimental/cluster";

const cluster = await connect({
nodes: [
Expand Down
3 changes: 3 additions & 0 deletions experimental/cluster/mod.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/**
* @module
* @experimental **NOTE**: This is an unstable module.
*
* Based on https://github.com/antirez/redis-rb-cluster which is licensed as follows:
*
* Copyright (C) 2013 Salvatore Sanfilippo <[email protected]>
Expand Down
8 changes: 6 additions & 2 deletions experimental/web_streams_connection/mod.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
/**
* @module
* @experimental **NOTE**: This is an unstable module.
*/
import { kUnstableCreateProtocol } from "../../internal/symbols.ts";
import type { RedisConnectOptions } from "../../redis.ts";
import type { Redis, RedisConnectOptions } from "../../redis.ts";
import { connect as _connect } from "../../redis.ts";
import { Protocol } from "../../protocol/web_streams/mod.ts";

function createProtocol(conn: Deno.Conn) {
return new Protocol(conn);
}

export function connect(options: RedisConnectOptions) {
export function connect(options: RedisConnectOptions): Promise<Redis> {
return _connect({
...options,
[kUnstableCreateProtocol]: createProtocol,
Expand Down

0 comments on commit a0406a9

Please sign in to comment.