Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Chore] Update versions #15

Merged
merged 14 commits into from
Oct 19, 2023
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"access": "restricted",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["powersync-example"]
"ignore": []
}
7 changes: 2 additions & 5 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
{
"mode": "pre",
"mode": "exit",
"tag": "alpha",
"initialVersions": {
"powersync-example": "1.0.0",
"@journeyapps/react-native-quick-sqlite": "0.0.1-alpha.0",
"@journeyapps/powersync-react": "0.0.1-alpha.0",
"@journeyapps/powersync-sdk-common": "0.0.1-alpha.0",
"@journeyapps/powersync-sdk-react-native": "0.0.1-alpha.1"
},
"changesets": [
"serious-bobcats-tie"
]
"changesets": ["serious-bobcats-tie"]
}
7 changes: 7 additions & 0 deletions .changeset/strong-waves-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@journeyapps/powersync-react': patch
'@journeyapps/powersync-sdk-common': patch
'@journeyapps/powersync-sdk-react-native': patch
---

Bump version to exit prerelease mode. Update SDK readme with known issues.
1 change: 0 additions & 1 deletion .github/workflows/build-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false

- name: Setup NodeJS
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/dev-packages.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Action to publish packages under the `next` tag for testing
# Packages are versioned as `0.0.0-dev.{short-sha}`
# Packages are versioned as `0.0.0-{tag}-DATETIMESTAMP`
name: Packages Deploy

on: workflow_dispatch
Expand All @@ -11,7 +11,6 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
submodules: true
persist-credentials: false

- name: Setup NodeJS
Expand All @@ -31,11 +30,7 @@ jobs:
- name: Build
run: yarn build:packages

- name: Development Version
run: |
export SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`
export VERSION="0.0.0-dev.$SHORT_SHA"
lerna version $VERSION --no-private --exact --force-publish --no-push --no-git-tag-version --yes

- name: Publish
run: lerna exec "npm publish --tag=next --no-git-checks"
run: |
yarn changeset version --no-git-tag --snapshot dev
yarn changeset publish --tag dev
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ jobs:
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# Needed for build with frozen lockfile
submodules: true

- name: Setup Node.js 18
uses: actions/setup-node@v3
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "apps/supabase-todolist"]
path = apps/supabase-todolist
url = [email protected]:journeyapps/powersync-supabase-react-native-todolist-demo.git
[submodule "packages/journeyapps-react-native-quick-sqlite"]
path = packages/journeyapps-react-native-quick-sqlite
url = [email protected]:journeyapps/react-native-quick-sqlite.git
30 changes: 21 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,15 @@ Monorepo for all things React Native and PowerSync.

## Monorepo Structure

- `apps/supabase-todolist`
- [apps/supabase-todolist](./apps/supabase-todolist/README.md)
* An Expo React native app using Supabase.

- `packages/powersync-sdk-common`
- [packages/powersync-sdk-common](./packages/powersync-sdk-common/README.md)
* A Typescript implementation of a PowerSync database connector and streaming sync bucket implementation.

- `packages/powersync-sdk-react-native`
- [packages/powersync-sdk-react-native](./packages/powersync-sdk-react-native/README.md)
* An extension of `packages/powersync-sdk-common` which provides React Native specific implementations of abstracted features.

- `packages/journeyapps-react-native-quick-sqlite`
* A Git submodule for a fork of `react-native-quick-sqlite` this module now automatically loads the shared PowerSync Rust SQLite extension.

# Development

## Git Submodules
Expand All @@ -42,7 +39,7 @@ yarn build:packages


### Development Packages
Development packages can be published by manually triggering the `dev-packages` workflow. Development packages are versioned as `0.0.0-dev.{short-sha}`.
Development packages can be published by manually triggering the `dev-packages` workflow. Development packages are versioned as `0.0.0-{tag}-DATETIMESTAMP`.

### Production Packages
Pull requests should contain Changesets for changed packages.
Expand All @@ -52,10 +49,25 @@ Add changesets with
yarn changeset add
```

Submodule production packages should be versioned, tagged and published from their own repository. Any dependencies should be updated here (if applicable) before merging pull requests.
Merging a PR with Changesets will automatically create a PR with version bumps. That PR will be merged when releasing.

## React Native Quick SQLite Development

Testing live development changes to `@journeyapps/react-native-quick-sqlite` will not with with standard `yarn link` commands. Metro does not work well with symlinks https://github.com/facebook/metro/issues/286.

The process of releasing development packages for `@journeyapps/react-native-quick-sqlite` for each change can be tedious and slow. A faster (and hackier) method is to use [mtsl](https://www.npmjs.com/package/mtsl) which will watch and copy the package into this workspace's `node_modules`.

```bash
npm install -g mtsl
```
```bash
mtsl add -s "[source path to your react-native-quick-sqlite repo folder]" -d "[this workspaces root node_modules folder]"/@journeyapps/react-native-quick-sqlite
```

```bash
mtsl start "[the id returned from step above]"
```

Merging a PR with Changesets will automatically create a PR with version bumps. That PR will be merged when releasing.

## Testing Supabase example app

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"name": "monorepo",
"name": "powersync-react-native",
"version": "1.0.0",
"license": "Apache-2.0",
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion packages/journeyapps-react-native-quick-sqlite
Submodule journeyapps-react-native-quick-sqlite deleted from 2fe550
2 changes: 1 addition & 1 deletion packages/powersync-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"bugs": {
"url": "https://github.com/journeyapps/powersync-react-native-sdk/issues"
},
"homepage": "https://github.com/journeyapps/powersync-react-native-sdk/packages/powersync-react/#readme",
"homepage": "https://docs.powersync.co/resources/api-reference",
"dependencies": {
"@journeyapps/powersync-sdk-common": "^0.0.1-alpha.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/powersync-sdk-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"bugs": {
"url": "https://github.com/journeyapps/powersync-react-native-sdk/issues"
},
"homepage": "https://github.com/journeyapps/powersync-react-native-sdk/packages/powersync-sdk-common/#readme",
"homepage": "https://docs.powersync.co/resources/api-reference",
"scripts": {
"build": "tsc -b",
"clean": "rm -rf lib tsconfig.tsbuildinfo"
Expand Down
2 changes: 2 additions & 0 deletions packages/powersync-sdk-react-native/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -510,3 +510,5 @@ Uncomment the following from
// });
// client.addPlugin(networkFlipperPlugin);
```
## iOS
Testing offline mode on an iOS simulator by disabling the host machine's entire internet connection will cause the device to remain offline even after the internet connection has been restored. This issue seems to affect all network requests in an application.
3 changes: 2 additions & 1 deletion packages/powersync-sdk-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
"homepage": "https://docs.powersync.co/",
"peerDependencies": {
"@journeyapps/react-native-quick-sqlite": "^0.0.1-alpha.0",
"@journeyapps/react-native-quick-sqlite": "^0.0.1",
"base-64": "^1.0.0",
"react": "*",
"react-native-fetch-api": "^3.0.0",
Expand All @@ -40,6 +40,7 @@
"async-lock": "^1.4.0"
},
"devDependencies": {
"@journeyapps/react-native-quick-sqlite": "^0.0.1",
"@types/async-lock": "^1.4.0",
"react": "18.2.0",
"typescript": "^4.1.3"
Expand Down
3 changes: 0 additions & 3 deletions packages/powersync-sdk-react-native/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
{
"path": "../powersync-sdk-common"
},
{
"path": "../journeyapps-react-native-quick-sqlite"
},
{
"path": "../powersync-react"
}
Expand Down
Loading
Loading