Skip to content

Commit d8c0721

Browse files
Fixes the React Todo example (#13)
Co-authored-by: Kyle Mathews <mathews.kyle@gmail.com>
1 parent 21cf95c commit d8c0721

File tree

10 files changed

+24
-23
lines changed

10 files changed

+24
-23
lines changed

examples/react/todo/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## How to run
44

5+
- Go to the root of the repository and run:
6+
7+
- `pnpm install`
8+
- `pnpm build`
9+
510
- Install packages
611
`pnpm install`
712

examples/react/todo/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
POSTGRES_USER: postgres
88
POSTGRES_PASSWORD: postgres
99
ports:
10-
- "54321:5432"
10+
- "54322:5432"
1111
volumes:
1212
- ./postgres.conf:/etc/postgresql/postgresql.conf:ro
1313
tmpfs:
@@ -29,7 +29,7 @@ services:
2929
DATABASE_URL: postgresql://postgres:postgres@postgres:5432/todo_app?sslmode=disable
3030
ELECTRIC_INSECURE: true
3131
ports:
32-
- 3000:3000
32+
- 3003:3000
3333
depends_on:
3434
postgres:
3535
condition: service_healthy

examples/react/todo/drizzle.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default {
77
casing: `snake_case`,
88
dbCredentials: {
99
host: process.env.DB_HOST || `localhost`,
10-
port: parseInt(process.env.DB_PORT || `54321`),
10+
port: parseInt(process.env.DB_PORT || `54322`),
1111
user: process.env.DB_USER || `postgres`,
1212
password: process.env.DB_PASSWORD || `postgres`,
1313
database: process.env.DB_NAME || `todo_app`,

examples/react/todo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"eslint": "^9.22.0",
3333
"eslint-plugin-react-hooks": "^5.2.0",
3434
"eslint-plugin-react-refresh": "^0.4.5",
35+
"pg": "^8.14.1",
3536
"tsx": "^4.6.2",
3637
"typescript": "^5.8.2",
3738
"vite": "^6.2.2"

examples/react/todo/scripts/migrate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dotenv.config()
88
const { Pool } = pkg
99
const pool = new Pool({
1010
host: process.env.DB_HOST || `localhost`,
11-
port: parseInt(process.env.DB_PORT || `54321`),
11+
port: parseInt(process.env.DB_PORT || `54322`),
1212
user: process.env.DB_USER || `postgres`,
1313
password: process.env.DB_PASSWORD || `postgres`,
1414
database: process.env.DB_NAME || `todo_app`,

examples/react/todo/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default function App() {
1818
id: `todos`,
1919
sync: createElectricSync(
2020
{
21-
url: `http://localhost:3000/v1/shape`,
21+
url: `http://localhost:3003/v1/shape`,
2222
params: {
2323
table: `todos`,
2424
},
@@ -69,7 +69,7 @@ export default function App() {
6969
id: `config`,
7070
sync: createElectricSync(
7171
{
72-
url: `http://localhost:3000/v1/shape`,
72+
url: `http://localhost:3003/v1/shape`,
7373
params: {
7474
table: `config`,
7575
},

examples/react/todo/src/db/postgres.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import postgres from "postgres"
33
// Create a postgres instance
44
export const sql = postgres({
55
host: `localhost`,
6-
port: 54321,
6+
port: 54322,
77
user: `postgres`,
88
password: `postgres`,
99
database: `todo_app`,

packages/optimistic/tests/TransactionManager.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ describe(`TransactionManager`, () => {
591591
sync: () => {},
592592
},
593593
mutationFn: {
594+
// eslint-disable-next-line @typescript-eslint/require-await
594595
persist: async () => {
595596
// Throw a string instead of an Error object
596597
throw `String error message`

pnpm-lock.yaml

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

pnpm-workspace.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
packages:
22
- "packages/**"
3-
- "examples/react/*"
3+
- "examples/**"

0 commit comments

Comments
 (0)