From 6e183ae14519235ae39ef1e501644fa2c07e597a Mon Sep 17 00:00:00 2001 From: msfstef Date: Thu, 25 Apr 2024 17:36:36 +0300 Subject: [PATCH] Address Kevin's PR comments --- clients/typescript/src/satellite/mock.ts | 29 ++++++++++++------------ components/toolbar/README.md | 4 ++-- components/toolbar/package.json | 3 +-- pnpm-lock.yaml | 7 ------ 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/clients/typescript/src/satellite/mock.ts b/clients/typescript/src/satellite/mock.ts index 1ef39c168a..5133e65961 100644 --- a/clients/typescript/src/satellite/mock.ts +++ b/clients/typescript/src/satellite/mock.ts @@ -164,22 +164,21 @@ export class MockRegistry extends BaseRegistry { const opts = { ...satelliteDefaults, ...overrides } const satellites = this.satellites - const satellite = satellites[dbName] - if (satellite !== undefined) { - return satellite - } else { - const satellite = new MockSatelliteProcess( - dbName, - adapter, - migrator, - notifier, - socketFactory, - opts - ) - await satellite.start() - this.satellites[dbName] = satellite - return satellite + if (satellites[dbName] !== undefined) { + return satellites[dbName] } + + const satellite = new MockSatelliteProcess( + dbName, + adapter, + migrator, + notifier, + socketFactory, + opts + ) + this.satellites[dbName] = satellite + await satellite.start() + return satellite } } diff --git a/components/toolbar/README.md b/components/toolbar/README.md index 6ef50c1e4f..2dac959bdb 100644 --- a/components/toolbar/README.md +++ b/components/toolbar/README.md @@ -34,8 +34,8 @@ In your code after calling `electrify`, if in debug mode, import and pass the el const electric = await electrify(conn, schema, config) if (config.debug) { - import('@electric-sql/debug-toolbar') - .then(({ addToolbar }) => addToolbar(electric)) + const { addToolbar } = await import('@electric-sql/debug-toolbar') + addToolbar(electric) } ``` diff --git a/components/toolbar/package.json b/components/toolbar/package.json index a2b15365e4..44d5844666 100644 --- a/components/toolbar/package.json +++ b/components/toolbar/package.json @@ -35,8 +35,7 @@ "jsdom": "24.0.0", "prettier": "3.2.5", "typescript": "^5.4.5", - "vitest": "^1.5.0", - "zod": "^3.23.3" + "vitest": "^1.5.0" }, "peerDependencies": { "electric-sql": "workspace:*" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dd542412c4..330d7f3889 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -333,9 +333,6 @@ importers: vitest: specifier: ^1.5.0 version: 1.5.0(@types/node@20.12.7)(jsdom@24.0.0) - zod: - specifier: ^3.23.3 - version: 3.23.3 e2e/satellite_client: dependencies: @@ -19009,10 +19006,6 @@ packages: resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==} dev: false - /zod@3.23.3: - resolution: {integrity: sha512-tPvq1B/2Yu/dh2uAIH2/BhUlUeLIUvAjr6dpL/75I0pCYefHgjhXk1o1Kob3kTU8C7yU1j396jFHlsVWFi9ogg==} - dev: true - github.com/rhashimoto/wa-sqlite/ca2084cdd188c56532ba3e272696d0b9e21a23bf: resolution: {tarball: https://codeload.github.com/rhashimoto/wa-sqlite/tar.gz/ca2084cdd188c56532ba3e272696d0b9e21a23bf} name: wa-sqlite