Skip to content

Commit ecce7b7

Browse files
committed
Revert "fix npm pkg issues"
This reverts commit 66752bd.
1 parent 66752bd commit ecce7b7

File tree

4 files changed

+31
-19
lines changed

4 files changed

+31
-19
lines changed

README.md

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,18 @@ This allows you to:
99
## How it Works
1010

1111
The proxy creates two servers:
12-
1. A WebSocket server (port 443) that communicates with the database instance in the browser
13-
2. A TCP server (port 5432) that accepts standard PostgreSQL client connections
12+
1. A WebSocket server that communicates with the database instance in the browser
13+
2. A TCP server that accepts standard PostgreSQL client connections
1414

1515
When a PostgreSQL client connects to the TCP server, the proxy:
1616
1. Forwards the client's messages to the browser through WebSocket
1717
2. Returns the browser's responses back to the client through TCP
1818

19+
### Examples
20+
21+
- [PGlite + Drizzle](https://github.com/f0rr0/pg-browser-proxy/tree/main/examples/pglite-drizzle)
22+
- [PGlite + Prisma](https://github.com/f0rr0/pg-browser-proxy/tree/main/examples/pglite-prisma)
23+
1924
## Usage
2025

2126
### 1. Install the Packages
@@ -31,6 +36,16 @@ Using bunx:
3136
bunx pg-browser-proxy
3237
```
3338

39+
To use custom ports:
40+
```sh
41+
bunx pg-browser-proxy -t 5433 -w 8080
42+
```
43+
44+
See all options:
45+
```sh
46+
bunx pg-browser-proxy -h
47+
```
48+
3449
### 3. Connect Your Database Instance
3550

3651
```typescript
@@ -45,11 +60,13 @@ const db = await PGliteWorker.create(
4560

4661
// Connect to the proxy in development
4762
if (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test") {
48-
connectProxy((message) => db.execProtocolRaw(message));
63+
connectProxy((message) => db.execProtocolRaw(message), {
64+
wsPort: 443, // optional, defaults to 443
65+
});
4966
}
5067
```
5168

52-
The key requirement is that your database must expose be able handle raw [Postgres wire protocol](https://www.postgresql.org/docs/current/protocol.html) messages.
69+
The key requirement is that your database must be able to handle raw [Postgres wire protocol](https://www.postgresql.org/docs/current/protocol.html) messages.
5370

5471
### 4. Connect with PostgreSQL Tools
5572

@@ -78,11 +95,6 @@ export default defineConfig({
7895

7996
- Only one browser connection is allowed at a time
8097

81-
### Examples
82-
83-
- [PGlite + Drizzle](git+https://github.com/f0rr0/pg-browser-proxy.git/tree/main/examples/pglite-drizzle)
84-
- [PGlite + Prisma](git+https://github.com/f0rr0/pg-browser-proxy.git/tree/main/examples/pglite-prisma)
85-
8698
## Further Reading
8799

88100
- [pg-gateway](https://github.com/supabase-community/pg-gateway) - Built on top of this project

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@
1414
"prisma",
1515
"studio"
1616
],
17-
"homepage": "git+https://github.com/f0rr0/pg-browser-proxy.git#readme",
17+
"homepage": "https://github.com/f0rr0/pg-browser-proxy#readme",
1818
"bugs": {
19-
"url": "git+https://github.com/f0rr0/pg-browser-proxy.git/issues"
19+
"url": "https://github.com/f0rr0/pg-browser-proxy/issues"
2020
},
2121
"repository": {
2222
"type": "git",
23-
"url": "git+https://github.com/f0rr0/pg-browser-proxy.git"
23+
"url": "https://github.com/f0rr0/pg-browser-proxy"
2424
},
2525
"funding": {
2626
"type": "github",

packages/pg-browser-proxy/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
"license": "MIT",
3333
"repository": {
3434
"type": "git",
35-
"url": "git+git+https://github.com/f0rr0/pg-browser-proxy.git.git"
35+
"url": "https://github.com/f0rr0/pg-browser-proxy"
3636
},
37-
"homepage": "git+https://github.com/f0rr0/pg-browser-proxy.git#readme",
37+
"homepage": "https://github.com/f0rr0/pg-browser-proxy#readme",
3838
"bugs": {
39-
"url": "git+https://github.com/f0rr0/pg-browser-proxy.git/issues"
39+
"url": "https://github.com/f0rr0/pg-browser-proxy/issues"
4040
},
4141
"funding": {
4242
"type": "github",
@@ -73,11 +73,11 @@
7373
"types": "./dist/browser/index.d.ts"
7474
},
7575
"./proxy": {
76-
"import": "./dist/proxy/proxy.js",
77-
"types": "./dist/proxy/proxy.d.ts"
76+
"import": "./bin/src/proxy.js",
77+
"types": "./bin/src/proxy.d.ts"
7878
}
7979
},
8080
"bin": {
81-
"pg-browser-proxy": "bin/bin.js"
81+
"pg-proxy": "./bin/src/cli/bin.js"
8282
}
8383
}

packages/pg-browser-proxy/src/cli/help.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const command: GluegunCommand = {
3030
$ pg-proxy --tcp-port 5433 --ws-port 8080
3131
3232
${chalk.bold("Documentation:")}
33-
${chalk.blue("git+https://github.com/f0rr0/pg-browser-proxy.git#readme")}
33+
${chalk.blue("https://github.com/f0rr0/pg-browser-proxy#readme")}
3434
3535
${chalk.bold("Environment Variables:")}
3636
${chalk.dim("DEBUG")} Enable debug logs (e.g., DEBUG=pg-proxy:*)

0 commit comments

Comments
 (0)