Skip to content
This repository has been archived by the owner on Feb 9, 2024. It is now read-only.

Initial #1

Merged
merged 39 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
988aaef
wip
stevensJourney Oct 24, 2023
5d90698
initial test wiring completed
stevensJourney Oct 31, 2023
8bcc002
sql console and watched queries
stevensJourney Nov 2, 2023
ab3134a
wip
stevensJourney Nov 3, 2023
ae4ea98
update versions
stevensJourney Nov 3, 2023
c6f41c7
fix bigint bug and enabled IndexDB storage
stevensJourney Nov 7, 2023
ac904cc
added readme
stevensJourney Nov 7, 2023
b609386
worker DB
stevensJourney Nov 8, 2023
5b134e6
added nav bar
stevensJourney Nov 8, 2023
6fef38c
added views for todo items
stevensJourney Nov 8, 2023
dfa559f
boolean fix
stevensJourney Nov 8, 2023
455fc56
cleanup and add to READMEs
stevensJourney Nov 9, 2023
1d94397
updated packages
stevensJourney Nov 9, 2023
88ab4a5
use ja-wa-sqlite
stevensJourney Nov 9, 2023
023ebb4
added CI and Changesets
stevensJourney Nov 9, 2023
52fed6c
typo
stevensJourney Nov 9, 2023
72eb226
fix action
stevensJourney Nov 9, 2023
e808528
fix build issues
stevensJourney Nov 9, 2023
d936ffd
readme
stevensJourney Nov 9, 2023
99b3478
readme fixes
stevensJourney Nov 9, 2023
181497c
test sdk
stevensJourney Nov 9, 2023
e6ea56c
added files
stevensJourney Nov 9, 2023
1f0a7e2
github actions
stevensJourney Nov 9, 2023
ea7b4f0
only publish dev packages on workflow dispatch
stevensJourney Nov 9, 2023
f802418
minor cleanup changes
stevensJourney Nov 9, 2023
9be2df5
use NodeJS 20
stevensJourney Nov 9, 2023
5b1b36e
better git ignores
stevensJourney Nov 9, 2023
b04c6f3
updated SQL console view to include query button and execute on Retur…
stevensJourney Nov 9, 2023
f21f63d
use system provider
stevensJourney Nov 9, 2023
28d34d1
better closing of connections
stevensJourney Nov 9, 2023
b93b948
cleanup tsconfig
stevensJourney Nov 9, 2023
78f35b2
update README. Use IDBBatchAtomicVFS for better performance. Update S…
stevensJourney Nov 13, 2023
e9b062c
update demo app license to 'CC0 1.0' like other demos. Update SDK pac…
stevensJourney Nov 13, 2023
fbe193e
update React package dependencies
stevensJourney Nov 13, 2023
003dbd7
test actions again
stevensJourney Nov 13, 2023
83e1afd
revert packages test. Update monorepo license to Apache 2.0. Make SDK…
stevensJourney Nov 13, 2023
9329e34
Fix README typo. Add root license file. Cleanup actions
stevensJourney Nov 13, 2023
2ce9bc7
cleanup
stevensJourney Nov 13, 2023
8d86115
cleanup
stevensJourney Nov 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
5 changes: 5 additions & 0 deletions .changeset/many-flowers-talk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@journeyapps/powersync-sdk-web': patch
---

Initial Alpha version
3 changes: 3 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
layout node
use node
[ -f .env ] && dotenv
31 changes: 31 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Ensures packages build correctly
name: Build Packages

on:
push:

jobs:
build:
name: Build Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 18

- name: Setup PNPM
run: |
npm install -g pnpm
echo "PNPM version: $(pnpm -v)"
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build:all
34 changes: 34 additions & 0 deletions .github/workflows/dev-packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Action to publish packages under the `next` tag for testing
# Packages are versioned as `0.0.0-{tag}-DATETIMESTAMP`
name: Packages Deploy

on: workflow_dispatch

jobs:
publish:
name: Publish Dev Packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 18

- name: Setup PNPM
run: |
npm install -g pnpm
echo "PNPM version: $(pnpm -v)"
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build:packages

- name: Publish
run: |
pnpm changeset version --no-git-tag --snapshot dev
pnpm changeset publish --tag dev
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup Node.js 18
uses: actions/setup-node@v3
with:
node-version: 18

- name: Install Dependencies
run: pnpm

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
lib
dist
tsconfig.tsbuildinfo
yarn-error.log
.vscode
.DS_STORE
.idea
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.12.0
Manrich121 marked this conversation as resolved.
Show resolved Hide resolved
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"jsxBracketSameLine": true,
"useTabs": false,
"printWidth": 120,
"trailingComma": "none"
}
27 changes: 26 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
# PowerSync Web SDK

This repo contains the packages for PowerSync's Web SDK.
This monorepo contains the packages for PowerSync's Web SDK.

## Structure

### Demos

Demo applications are located in the `/demos/` directory.

- [apps/powersync-nextjs-demo](./demos/powersync-nextjs-demo/README.md): A NextJS 14 Todo list application.


### Packages

SDK packages are located in the `/packages/` directory.

- [packages/powersync-sdk-web](./packages/powersync-sdk-web/README.md) contains the core PowerSync Web SDK code.

## Getting started

This monorepo uses PNPM.

```bash
pnpm install
```

To run a demo app see [README](./demos/powersync-nextjs-demo/README.md)
3 changes: 3 additions & 0 deletions demos/powersync-nextjs-demo/.env.local.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SUPABASE_URL=
SUPABASE_ANON_KEY=
POWERSYNC_URL=
3 changes: 3 additions & 0 deletions demos/powersync-nextjs-demo/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "next/core-web-vitals"
}
35 changes: 35 additions & 0 deletions demos/powersync-nextjs-demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js
.yarn/install-state.gz

# testing
/coverage

# next.js
/.next/
/out/

# production
/build
# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

Manrich121 marked this conversation as resolved.
Show resolved Hide resolved
# typescript
*.tsbuildinfo
next-env.d.ts
56 changes: 56 additions & 0 deletions demos/powersync-nextjs-demo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# PowerSync + Supabase NextJS Demo: Todo List

## Note: Alpha Release

This package is currently in a 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.

A step-by-step guide on Supabase<>PowerSync integration is available [here](https://docs.powersync.co/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).

## Getting Started


Ensure your terminal focussed to this directory.

```bash
cd demos/powersync-nextjs-demo
```

Setup the Environment variables

```bash
cp .env.local.template .env.local
```

Then insert credentials for Supabase.


Run the development server:

```bash
pnpm watch
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [PowerSync Documentation](https://docs.powersync.co)
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
You can check out [the PowerSync Web SDK GitHub repository](https://github.com/powersync-ja/powersync-web-sdk) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
12 changes: 12 additions & 0 deletions demos/powersync-nextjs-demo/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: false,
webpack(config) {
config.resolve.alias = {
...config.resolve.alias
};
return config;
}
};

module.exports = nextConfig;
Loading
Loading