Skip to content

Commit

Permalink
update from main branch
Browse files Browse the repository at this point in the history
  • Loading branch information
stevensJourney committed Apr 25, 2024
2 parents b6c4cc9 + 405add3 commit 90773c9
Show file tree
Hide file tree
Showing 224 changed files with 4,768 additions and 2,500 deletions.
5 changes: 0 additions & 5 deletions .changeset/blue-cameras-flash.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/chatty-news-appear.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rare-pumpkins-study.md

This file was deleted.

14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ _Bad connectivity is everywhere, and we're tired of it. PowerSync is on a missio

## Monorepo Structure: Packages

- [packages/powersync-sdk-react-native](./packages/powersync-sdk-react-native/README.md)
- [packages/react-native](./packages/react-native/README.md)

- React Native SDK implementation (extension of `packages/powersync-sdk-common`)
- React Native SDK implementation (extension of `packages/common`)

- [packages/powersync-sdk-web](./packages/powersync-sdk-web/README.md)
- [packages/web](./packages/web/README.md)

- JS Web SDK implementation (extension of `packages/powersync-sdk-common`)
- JS Web SDK implementation (extension of `packages/common`)

- [packages/powersync-react](./packages/powersync-react/README.md)
- [packages/react](./packages/react/README.md)

- React integration for PowerSync.

- [packages/powersync-attachments](./packages/powersync-attachments/README.md)
- [packages/attachments](./packages/attachments/README.md)

- Attachments helper package for React Native and JavaScript/TypeScript projects.

- [packages/kysely-driver](./packages/kysely-driver/README.md)

- Kysely integration (ORM) for React Native and JavaScript/TypeScript projects.

- [packages/powersync-sdk-common](./packages/powersync-sdk-common/README.md)
- [packages/common](./packages/common/README.md)
- Shared package: TypeScript implementation of a PowerSync database connector and streaming sync bucket implementation.

## Demo Apps / Example Projects
Expand Down
7 changes: 7 additions & 0 deletions demos/angular-supabase-todolist/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# PowerSync Angular Demo

## 0.0.9

### Patch Changes

- Updated dependencies [ffe37cf]
- @powersync/web@0.5.1

## 0.0.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion demos/angular-supabase-todolist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This demo is currently in an alpha release.

## Overview

Demo app demonstrating use of the [PowerSync SDK for Web](https://www.npmjs.com/package/@journeyapps/powersync-sdk-web) together with Supabase.
Demo app demonstrating use of the [PowerSync SDK for Web](https://www.npmjs.com/package/@powersync/web) together with Supabase.

A step-by-step guide on Supabase<>PowerSync integration is available [here](https://docs.powersync.com/integration-guides/supabase).

Expand Down
6 changes: 3 additions & 3 deletions demos/angular-supabase-todolist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PowerSync Angular Demo",
"version": "0.0.8",
"name": "angular-supabase-todolist",
"version": "0.0.9",
"scripts": {
"ng": "ng",
"serve": "ng serve",
Expand All @@ -20,7 +20,7 @@
"@angular/platform-browser-dynamic": "^17.0.4",
"@angular/router": "^17.0.4",
"@angular/service-worker": "^17.0.4",
"@journeyapps/powersync-sdk-web": "workspace:*",
"@powersync/web": "workspace:*",
"@journeyapps/wa-sqlite": "^0.0.2",
"@supabase/supabase-js": "^2.38.5",
"rxjs": "~7.8.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
Schema,
Table,
WASQLitePowerSyncDatabaseOpenFactory
} from '@journeyapps/powersync-sdk-web';
} from '@powersync/web';

export interface ListRecord {
id: string;
Expand Down
9 changes: 2 additions & 7 deletions demos/angular-supabase-todolist/src/app/supabase.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ import {
type User
} from '@supabase/supabase-js';
import { environment } from '../../environment';
import {
type AbstractPowerSyncDatabase,
type CrudEntry,
UpdateType,
PowerSyncBackendConnector
} from '@journeyapps/powersync-sdk-web';
import { type AbstractPowerSyncDatabase, type CrudEntry, UpdateType, PowerSyncBackendConnector } from '@powersync/web';

/// Postgres Response codes that we cannot recover from by retrying.
const FATAL_RESPONSE_CODES = [
Expand Down Expand Up @@ -118,7 +113,7 @@ export class SupabaseService implements PowerSyncBackendConnector {
try {
// Note: If transactional consistency is important, use database functions
// or edge functions to process the entire transaction in a single call.
for (let op of transaction.crud) {
for (const op of transaction.crud) {
lastOp = op;
const table = this.supabase.from(op.table);
let result: any;
Expand Down
14 changes: 14 additions & 0 deletions demos/django-react-native-todolist/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# django-react-native-todolist

## 1.0.1

### Patch Changes

- Updated dependencies [385edf8]
- Updated dependencies [b902077]
- Updated dependencies [ffe37cf]
- Updated dependencies [f9b9a96]
- Updated dependencies [b902077]
- @powersync/react@1.2.0
- @powersync/common@1.6.1
- @powersync/react-native@1.4.3
4 changes: 2 additions & 2 deletions demos/django-react-native-todolist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Overview

Demo app demonstrating use of the [PowerSync SDK for React Native](https://www.npmjs.com/package/@journeyapps/powersync-sdk-react-native) together with a Django backend.
Demo app demonstrating use of the [PowerSync SDK for React Native](https://www.npmjs.com/package/@powersync/react-native) together with a Django backend.
The sample backend that you can run alongside this demo can be found here: [PowerSync Django Backend: Todo List Demo](https://github.com/powersync-ja/powersync-django-backend-todolist-demo)

## Running the App
Expand All @@ -27,7 +27,7 @@ pnpm android

## Set up Django Backend

This demo requires that you have the [PowerSync Django Backend: Todo List Demo](https://github.com/powersync-ja/powersync-django-backend-todolist-demo) running on your machine.
This demo requires that you have the [PowerSync Django Backend: Todo List Demo](https://github.com/powersync-ja/powersync-django-backend-todolist-demo) running on your machine.
Follow the guide in the README of the PowerSync Django Backend to set it up.

## Set up PowerSync Instance
Expand Down
2 changes: 1 addition & 1 deletion demos/django-react-native-todolist/app/views/console.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import _ from 'lodash';
import React from 'react';
import { Table, Row } from 'react-native-table-component';
import { QueryResult } from '@journeyapps/powersync-sdk-react-native';
import { QueryResult } from '@powersync/react-native';
import { useSystem } from '../../library/stores/system';
import { ScrollView, TextInput } from 'react-native-gesture-handler';

Expand Down
5 changes: 1 addition & 4 deletions demos/django-react-native-todolist/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ module.exports = function (api) {
api.cache(true);
return {
presets: ['babel-preset-expo'],
plugins: [
'react-native-reanimated/plugin',
'@babel/plugin-transform-async-generator-functions'
]
plugins: ['react-native-reanimated/plugin', '@babel/plugin-transform-async-generator-functions']
};
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const AppConfig = {
djangoUrl: '', // This is base url to the Django project
powersyncUrl: '' // This is the PowerSync instance url provided in the PowerSync dashboard
djangoUrl: '', // This is base url to the Django project
powersyncUrl: '' // This is the PowerSync instance url provided in the PowerSync dashboard
};
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {
AbstractPowerSyncDatabase,
CrudEntry,
PowerSyncBackendConnector,
UpdateType
} from '@journeyapps/powersync-sdk-react-native';
import { AbstractPowerSyncDatabase, CrudEntry, PowerSyncBackendConnector, UpdateType } from '@powersync/react-native';

import { AppConfig } from './AppConfig';
import { ApiClient } from './ApiClient';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Transaction } from '@journeyapps/powersync-sdk-react-native';
import { Transaction } from '@powersync/react-native';
import { System } from '../stores/system';
export interface ModelRecord {
id: string;
Expand All @@ -10,7 +10,7 @@ export abstract class AbstractModel<Record extends ModelRecord = ModelRecord> {
constructor(
public record: Record,
protected system: System
) { }
) {}

get id() {
return this.record.id;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'lodash';
import { AbstractModel, ModelRecord } from './AbstractModel';
import { Transaction } from '@journeyapps/powersync-sdk-react-native';
import { Transaction } from '@powersync/react-native';

export interface ListRecord extends ModelRecord {
name: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import _ from 'lodash';
import { AbstractModel, ModelRecord } from './AbstractModel';
import { Transaction } from '@journeyapps/powersync-sdk-react-native';
import { Transaction } from '@powersync/react-native';

export interface TodoRecord extends ModelRecord {
created_at: string;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Column, ColumnType, Index, IndexedColumn, Schema, Table } from '@journeyapps/powersync-sdk-react-native';
import { Column, ColumnType, Index, IndexedColumn, Schema, Table } from '@powersync/react-native';

export const AppSchema = new Schema([
new Table({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import '@azure/core-asynciterator-polyfill';
import 'react-native-polyfill-globals/auto';
import React from 'react';
import { configure, makeAutoObservable, makeObservable, observable } from 'mobx';
import { AbstractPowerSyncDatabase, RNQSPowerSyncDatabaseOpenFactory } from '@journeyapps/powersync-sdk-react-native';
import { AbstractPowerSyncDatabase, RNQSPowerSyncDatabaseOpenFactory } from '@powersync/react-native';
import { AppSchema } from '../powersync/AppSchema';
import { DjangoConnector } from '../django/DjangoConnector';
import { ListStore } from './ListStore';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Alert, Text } from 'react-native';
import { Icon } from 'react-native-elements';
import { useNavigation } from 'expo-router';
import { useSystem } from '../stores/system';
import { usePowerSyncStatus } from '@journeyapps/powersync-react';
import { usePowerSyncStatus } from '@powersync/react';
import { Header } from 'react-native-elements';
import { observer } from 'mobx-react-lite';
import { DrawerActions } from '@react-navigation/native';
Expand Down Expand Up @@ -39,7 +39,8 @@ export const HeaderWidget: React.FC<{
onPress={() => {
Alert.alert(
'Status',
`${status.connected ? 'Connected' : 'Disconnected'}. \nLast Synced at ${status.lastSyncedAt?.toISOString() ?? '-'
`${status.connected ? 'Connected' : 'Disconnected'}. \nLast Synced at ${
status.lastSyncedAt?.toISOString() ?? '-'
}\nVersion: ${powersync.sdkVersion}`
);
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export const ListItemWidget: React.FC<{
pathname: 'views/todos/edit/[id]',
params: { id: model.id }
});
}}></ListItem.Chevron>
}}
></ListItem.Chevron>
</ListItem>
</View>
);
Expand Down
2 changes: 1 addition & 1 deletion demos/django-react-native-todolist/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Learn more https://docs.expo.dev/guides/monorepos
const {getDefaultConfig} = require('expo/metro-config');
const { getDefaultConfig } = require('expo/metro-config');
const path = require('node:path');

// Find the project and workspace directories
Expand Down
14 changes: 7 additions & 7 deletions demos/django-react-native-todolist/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "powersync-example",
"version": "1.0.0",
"name": "django-react-native-todolist",
"version": "1.0.1",
"main": "./index.js",
"scripts": {
"android": "expo run:android",
Expand All @@ -10,10 +10,10 @@
"dependencies": {
"@azure/core-asynciterator-polyfill": "^1.0.2",
"@expo/vector-icons": "^14.0.0",
"@journeyapps/powersync-sdk-react-native": "workspace:*",
"@journeyapps/powersync-react": "workspace:*",
"@journeyapps/powersync-sdk-common": "workspace:*",
"@journeyapps/react-native-quick-sqlite": "1.1.3",
"@powersync/react-native": "workspace:*",
"@powersync/react": "workspace:*",
"@powersync/common": "workspace:*",
"@journeyapps/react-native-quick-sqlite": "^1.1.4",
"@react-native-community/async-storage": "^1.12.1",
"@react-native-community/masked-view": "^0.1.11",
"@react-navigation/drawer": "^6.6.15",
Expand Down Expand Up @@ -53,7 +53,7 @@
"react-navigation-stack": "^2.10.4",
"text-encoding": "^0.7.0",
"typed-async-storage": "^3.1.2",
"uuid": "3.4.0",
"uuid": "^9.0.1",
"web-streams-polyfill": "^3.3.3"
},
"devDependencies": {
Expand Down
Loading

0 comments on commit 90773c9

Please sign in to comment.