From e472f17c616d36e7b3b1d59e26aa4cd710a1cc19 Mon Sep 17 00:00:00 2001 From: Dominic Gunther Bauer <46312751+DominicGBauer@users.noreply.github.com> Date: Fri, 23 Feb 2024 18:18:10 +0200 Subject: [PATCH] chore: minor improvements (#79) Co-authored-by: DominicGBauer --- .changeset/great-boxes-mate.md | 5 +++++ demos/nextjs-supabase-todolist/README.md | 2 +- demos/react-native-supabase-todolist/README.md | 4 ++-- demos/yjs-nextjs-supabase-text-collab/sync-rules.yaml | 2 +- packages/powersync-attachments/package.json | 2 +- packages/powersync-react/package.json | 2 +- packages/powersync-sdk-common/README.md | 1 + packages/powersync-sdk-common/package.json | 2 +- packages/powersync-sdk-react-native/README.md | 8 ++++---- packages/powersync-sdk-react-native/package.json | 2 +- packages/powersync-sdk-web/README.md | 10 ++++------ packages/powersync-sdk-web/package.json | 8 ++++---- .../src/db/adapters/wa-sqlite/WASQLiteDBAdapter.ts | 1 - .../src/worker/db/SharedWASQLiteDB.worker.ts | 3 +-- .../src/worker/sync/SharedSyncImplementation.worker.ts | 1 - packages/powersync-sdk-web/tsconfig.json | 6 +++--- 16 files changed, 30 insertions(+), 29 deletions(-) create mode 100644 .changeset/great-boxes-mate.md diff --git a/.changeset/great-boxes-mate.md b/.changeset/great-boxes-mate.md new file mode 100644 index 00000000..0d96194d --- /dev/null +++ b/.changeset/great-boxes-mate.md @@ -0,0 +1,5 @@ +--- +"@journeyapps/powersync-sdk-web": patch +--- + +Change to use lib instead of dist build folder diff --git a/demos/nextjs-supabase-todolist/README.md b/demos/nextjs-supabase-todolist/README.md index 724f688e..faa1b4a8 100644 --- a/demos/nextjs-supabase-todolist/README.md +++ b/demos/nextjs-supabase-todolist/README.md @@ -8,7 +8,7 @@ This package is currently in a beta release. Demo app demonstrating use of the [PowerSync SDK for Web](https://www.npmjs.com/package/@journeyapps/powersync-sdk-web) together with Supabase. -A step-by-step guide on Supabase<>PowerSync integration is available [here](https://docs.powersync.co/integration-guides/supabase). +A step-by-step guide on Supabase<>PowerSync integration is available [here](https://docs.powersync.com/integration-guides/supabase). This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). diff --git a/demos/react-native-supabase-todolist/README.md b/demos/react-native-supabase-todolist/README.md index ecfe4486..721429b5 100644 --- a/demos/react-native-supabase-todolist/README.md +++ b/demos/react-native-supabase-todolist/README.md @@ -4,7 +4,7 @@ Demo app demonstrating use of the [PowerSync SDK for React Native](https://www.npmjs.com/package/@journeyapps/powersync-sdk-react-native) together with Supabase. -A step-by-step guide on Supabase<>PowerSync integration is available [here](https://docs.powersync.co/integration-guides/supabase). +A step-by-step guide on Supabase<>PowerSync integration is available [here](https://docs.powersync.com/integration-guides/supabase). ![docs-react-native-supabase-powersync-setup](https://github.com/journeyapps/powersync-supabase-react-native-todolist-demo/assets/277659/923dc9a2-6a0e-4ce4-934d-29e3ab8b0f09) @@ -21,7 +21,7 @@ It does the following: ## Set up PowerSync Instance -Create a new PowerSync instance, connecting to the database of the Supabase project (find detailed instructions in the [Supabase<>PowerSync integration guide](https://docs.powersync.co/integration-guides/supabase)). +Create a new PowerSync instance, connecting to the database of the Supabase project (find detailed instructions in the [Supabase<>PowerSync integration guide](https://docs.powersync.com/integration-guides/supabase)). Then deploy the following sync rules: diff --git a/demos/yjs-nextjs-supabase-text-collab/sync-rules.yaml b/demos/yjs-nextjs-supabase-text-collab/sync-rules.yaml index 826b8d73..68148486 100644 --- a/demos/yjs-nextjs-supabase-text-collab/sync-rules.yaml +++ b/demos/yjs-nextjs-supabase-text-collab/sync-rules.yaml @@ -1,4 +1,4 @@ -# Sync-rule docs: https://docs.powersync.co/usage/sync-rules +# Sync-rule docs: https://docs.powersync.com/usage/sync-rules bucket_definitions: global: data: diff --git a/packages/powersync-attachments/package.json b/packages/powersync-attachments/package.json index 1e73501e..717ac56a 100644 --- a/packages/powersync-attachments/package.json +++ b/packages/powersync-attachments/package.json @@ -11,7 +11,7 @@ }, "author": "JOURNEYAPPS", "license": "Apache-2.0", - "homepage": "https://docs.powersync.co/resources/api-reference", + "homepage": "https://docs.powersync.com/resources/api-reference", "bugs": { "url": "https://github.com/powersync-ja/powersync-js/issues" }, diff --git a/packages/powersync-react/package.json b/packages/powersync-react/package.json index 4bcae53c..58110f4d 100644 --- a/packages/powersync-react/package.json +++ b/packages/powersync-react/package.json @@ -25,7 +25,7 @@ "bugs": { "url": "https://github.com/powersync-ja/powersync-js/issues" }, - "homepage": "https://docs.powersync.co/resources/api-reference", + "homepage": "https://docs.powersync.com/resources/api-reference", "dependencies": { "@journeyapps/powersync-sdk-common": "workspace:*" }, diff --git a/packages/powersync-sdk-common/README.md b/packages/powersync-sdk-common/README.md index a3af9247..702ae7cb 100644 --- a/packages/powersync-sdk-common/README.md +++ b/packages/powersync-sdk-common/README.md @@ -1,5 +1,6 @@ # PowerSync SDK common JS This package contains a TypeScript implementation of a PowerSync database connector and streaming sync bucket implementation, which is used in the following SDKs: + - [packages/powersync-sdk-react-native](./packages/powersync-sdk-react-native/README.md) - [packages/powersync-sdk-web](./packages/powersync-sdk-web/README.md) diff --git a/packages/powersync-sdk-common/package.json b/packages/powersync-sdk-common/package.json index 55babae1..ff273edf 100644 --- a/packages/powersync-sdk-common/package.json +++ b/packages/powersync-sdk-common/package.json @@ -20,7 +20,7 @@ "bugs": { "url": "https://github.com/powersync-ja/powersync-js/issues" }, - "homepage": "https://docs.powersync.co/resources/api-reference", + "homepage": "https://docs.powersync.com/resources/api-reference", "scripts": { "build": "tsc -b", "clean": "rm -rf lib tsconfig.tsbuildinfo" diff --git a/packages/powersync-sdk-react-native/README.md b/packages/powersync-sdk-react-native/README.md index 31d5f12e..f40f4352 100644 --- a/packages/powersync-sdk-react-native/README.md +++ b/packages/powersync-sdk-react-native/README.md @@ -4,7 +4,7 @@ # PowerSync SDK for React Native -[PowerSync](https://powersync.com) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases. +[PowerSync](https://powersync.com) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases. This package (`packages/powersync-sdk-react-native`) is the PowerSync SDK for React Native clients. It is an extension of `packages/powersync-sdk-common`. @@ -116,6 +116,6 @@ For example projects built with PowerSync and React Native, see our [Demo Apps / # Found a bug or need help? -* Join our [Discord server](https://discord.gg/powersync) where you can browse topics from our community, ask questions, share feedback, or just say hello :) -* Please open a [GitHub issue](https://github.com/powersync-ja/powersync-js/issues) when you come across a bug. -* Have feedback or an idea? [Submit an idea](https://roadmap.powersync.com/tabs/5-roadmap/submit-idea) via our public roadmap or [schedule a chat](https://calendly.com/powersync-product/powersync-chat) with someone from our product team. \ No newline at end of file +- Join our [Discord server](https://discord.gg/powersync) where you can browse topics from our community, ask questions, share feedback, or just say hello :) +- Please open a [GitHub issue](https://github.com/powersync-ja/powersync-js/issues) when you come across a bug. +- Have feedback or an idea? [Submit an idea](https://roadmap.powersync.com/tabs/5-roadmap/submit-idea) via our public roadmap or [schedule a chat](https://calendly.com/powersync-product/powersync-chat) with someone from our product team. diff --git a/packages/powersync-sdk-react-native/package.json b/packages/powersync-sdk-react-native/package.json index fbe69cb9..2416a7b0 100644 --- a/packages/powersync-sdk-react-native/package.json +++ b/packages/powersync-sdk-react-native/package.json @@ -25,7 +25,7 @@ "bugs": { "url": "https://github.com/powersync-ja/powersync-js/issues" }, - "homepage": "https://docs.powersync.co/", + "homepage": "https://docs.powersync.com/", "peerDependencies": { "@journeyapps/react-native-quick-sqlite": "^1.1.1", "base-64": "^1.0.0", diff --git a/packages/powersync-sdk-web/README.md b/packages/powersync-sdk-web/README.md index 6a5eee5a..adb58d9e 100644 --- a/packages/powersync-sdk-web/README.md +++ b/packages/powersync-sdk-web/README.md @@ -4,7 +4,7 @@ # PowerSync SDK for Web -[PowerSync](https://powersync.com) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases. +[PowerSync](https://powersync.com) is a service and set of SDKs that keeps Postgres databases in sync with on-device SQLite databases. This package (`packages/powersync-sdk-web`) is the PowerSync SDK for JavaScript Web clients. It is an extension of `packages/powersync-sdk-common`. @@ -50,8 +50,6 @@ For example projects built with PowerSync on Web, see our [Demo Apps / Example P # Found a bug or need help? -* Join our [Discord server](https://discord.gg/powersync) where you can browse topics from our community, ask questions, share feedback, or just say hello :) -* Please open a [GitHub issue](https://github.com/powersync-ja/powersync-js/issues) when you come across a bug. -* Have feedback or an idea? [Submit an idea](https://roadmap.powersync.com/tabs/5-roadmap/submit-idea) via our public roadmap or [schedule a chat](https://calendly.com/powersync-product/powersync-chat) with someone from our product team. - - +- Join our [Discord server](https://discord.gg/powersync) where you can browse topics from our community, ask questions, share feedback, or just say hello :) +- Please open a [GitHub issue](https://github.com/powersync-ja/powersync-js/issues) when you come across a bug. +- Have feedback or an idea? [Submit an idea](https://roadmap.powersync.com/tabs/5-roadmap/submit-idea) via our public roadmap or [schedule a chat](https://calendly.com/powersync-product/powersync-chat) with someone from our product team. diff --git a/packages/powersync-sdk-web/package.json b/packages/powersync-sdk-web/package.json index 8871492b..c3446672 100644 --- a/packages/powersync-sdk-web/package.json +++ b/packages/powersync-sdk-web/package.json @@ -2,10 +2,10 @@ "name": "@journeyapps/powersync-sdk-web", "version": "0.2.2", "description": "A Web SDK for JourneyApps PowerSync", - "main": "dist/index.js", - "types": "dist/index.d.ts", + "main": "lib/src/index.js", + "types": "lib/src/index.d.ts", "files": [ - "dist" + "lib" ], "repository": "https://github.com/powersync-ja/powersync-js", "bugs": { @@ -15,7 +15,7 @@ "registry": "https://registry.npmjs.org/", "access": "public" }, - "homepage": "https://docs.powersync.co", + "homepage": "https://docs.powersync.com", "scripts": { "build": "tsc --build", "clean": "rm -rf dist tsconfig.tsbuildinfo", diff --git a/packages/powersync-sdk-web/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.ts b/packages/powersync-sdk-web/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.ts index 9738373c..2651018d 100644 --- a/packages/powersync-sdk-web/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.ts +++ b/packages/powersync-sdk-web/src/db/adapters/wa-sqlite/WASQLiteDBAdapter.ts @@ -9,7 +9,6 @@ import { QueryResult, Transaction } from '@journeyapps/powersync-sdk-common'; -import _ from 'lodash'; import * as Comlink from 'comlink'; import Logger, { ILogger } from 'js-logger'; import type { DBWorkerInterface, OpenDB } from '../../../worker/db/open-db'; diff --git a/packages/powersync-sdk-web/src/worker/db/SharedWASQLiteDB.worker.ts b/packages/powersync-sdk-web/src/worker/db/SharedWASQLiteDB.worker.ts index ebf7dcda..48b85f51 100644 --- a/packages/powersync-sdk-web/src/worker/db/SharedWASQLiteDB.worker.ts +++ b/packages/powersync-sdk-web/src/worker/db/SharedWASQLiteDB.worker.ts @@ -1,6 +1,5 @@ import '@journeyapps/wa-sqlite'; -import _ from 'lodash'; import * as Comlink from 'comlink'; import { DBWorkerInterface, _openDB } from './open-db'; @@ -27,7 +26,7 @@ _self.onconnect = function (event: MessageEvent) { Comlink.expose(openDB, port); }; -addEventListener('beforeunload', (event) => { +addEventListener('beforeunload', () => { Array.from(DBMap.values()).forEach(async (dbPromise) => { const db = await dbPromise; db.close?.(); diff --git a/packages/powersync-sdk-web/src/worker/sync/SharedSyncImplementation.worker.ts b/packages/powersync-sdk-web/src/worker/sync/SharedSyncImplementation.worker.ts index 24de577b..d807666a 100644 --- a/packages/powersync-sdk-web/src/worker/sync/SharedSyncImplementation.worker.ts +++ b/packages/powersync-sdk-web/src/worker/sync/SharedSyncImplementation.worker.ts @@ -1,4 +1,3 @@ -import _ from 'lodash'; import * as Comlink from 'comlink'; import { SharedSyncImplementation, SharedSyncMessageType } from './SharedSyncImplementation'; diff --git a/packages/powersync-sdk-web/tsconfig.json b/packages/powersync-sdk-web/tsconfig.json index ec7384ae..dd7c0c64 100644 --- a/packages/powersync-sdk-web/tsconfig.json +++ b/packages/powersync-sdk-web/tsconfig.json @@ -7,11 +7,11 @@ "lib": ["DOM", "ES2020", "WebWorker"] /* Specify library files to be included in the compilation. */, "module": "es2020" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, "moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */, - "outDir": "./dist" /* Redirect output structure to the directory. */, - "rootDir": "./src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, + "outDir": "./lib" /* Redirect output structure to the directory. */, "skipLibCheck": true /* Skip type checking of declaration files. */, "sourceMap": true /* Generates corresponding '.map' file. */, "strict": true /* Enable all strict type-checking options. */, "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */ - } + }, + "include": ["src/**/*"] }