Skip to content

Commit 5c2e676

Browse files
update from main
2 parents 42ca457 + af0031b commit 5c2e676

File tree

23 files changed

+1192
-1618
lines changed

23 files changed

+1192
-1618
lines changed

.changeset/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Changesets
2+
3+
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
4+
with multi-package repos, or single-package repos to help you version and publish your code. You can
5+
find the full documentation for it [in our repository](https://github.com/changesets/changesets)
6+
7+
We have a quick list of common questions to get you started engaging with this project in
8+
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)

.changeset/config.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@2.3.1/schema.json",
3+
"changelog": "@changesets/cli/changelog",
4+
"commit": false,
5+
"fixed": [],
6+
"linked": [],
7+
"access": "restricted",
8+
"baseBranch": "main",
9+
"updateInternalDependencies": "patch",
10+
"ignore": []
11+
}
Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
name: Packages Deploy
1+
# Ensures packages build correctly
2+
name: Build Packages
23

34
on:
45
push:
@@ -8,42 +9,15 @@ jobs:
89
name: Build Packages
910
runs-on: ubuntu-latest
1011
steps:
11-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1213
with:
13-
submodules: true
14-
15-
- name: Setup NodeJS
16-
uses: actions/setup-node@v2
17-
with:
18-
node-version: 16
19-
cache: 'yarn'
20-
21-
- name: Setup Yarn
22-
run: |
23-
npm install -g yarn
24-
echo "Yarn version: $(yarn -v)"
25-
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc
26-
27-
- name: Install Dependencies
28-
run: yarn install --frozen-lockfile
29-
30-
- name: Build
31-
run: yarn build:packages
32-
33-
publish:
34-
name: Publish Production Packages
35-
runs-on: ubuntu-latest
36-
needs: build
37-
if: github.ref == 'refs/heads/main'
38-
steps:
39-
- uses: actions/checkout@v3
40-
with:
41-
submodules: true
14+
persist-credentials: false
4215

4316
- name: Setup NodeJS
4417
uses: actions/setup-node@v2
4518
with:
4619
node-version: 18
20+
cache: 'yarn'
4721

4822
- name: Setup Yarn
4923
run: |
@@ -56,6 +30,3 @@ jobs:
5630

5731
- name: Build
5832
run: yarn build:packages
59-
60-
- name: Publish
61-
run: lerna exec "npm publish --tag=latest --no-git-checks" --parallel

.github/workflows/dev-packages.yaml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Action to publish packages under the `next` tag for testing
2+
# Packages are versioned as `0.0.0-{tag}-DATETIMESTAMP`
13
name: Packages Deploy
24

35
on: workflow_dispatch
@@ -7,9 +9,9 @@ jobs:
79
name: Publish Dev Packages
810
runs-on: ubuntu-latest
911
steps:
10-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1113
with:
12-
submodules: true
14+
persist-credentials: false
1315

1416
- name: Setup NodeJS
1517
uses: actions/setup-node@v2
@@ -28,11 +30,7 @@ jobs:
2830
- name: Build
2931
run: yarn build:packages
3032

31-
- name: Development Version
32-
run: |
33-
export SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`
34-
export VERSION="0.0.0-dev.$SHORT_SHA"
35-
lerna version $VERSION --no-private --exact --force-publish --no-push --no-git-tag-version --yes
36-
3733
- name: Publish
38-
run: lerna exec "npm publish --tag=next --no-git-checks"
34+
run: |
35+
yarn changeset version --no-git-tag --snapshot dev
36+
yarn changeset publish --tag dev

.github/workflows/release.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Repo
16+
uses: actions/checkout@v3
17+
18+
- name: Setup Node.js 18
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
23+
- name: Install Dependencies
24+
run: yarn
25+
26+
- name: Create Release Pull Request or Publish to npm
27+
id: changesets
28+
uses: changesets/action@v1
29+
with:
30+
# This expects you to have a script called release which does a build for your packages and calls changeset publish
31+
publish: yarn release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ dist
44
tsconfig.tsbuildinfo
55
yarn-error.log
66
.vscode
7-
.DS_STORE
7+
.DS_STORE
8+
.idea

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
[submodule "apps/supabase-todolist"]
22
path = apps/supabase-todolist
33
url = git@github.com:journeyapps/powersync-supabase-react-native-todolist-demo.git
4-
[submodule "packages/journeyapps-react-native-quick-sqlite"]
5-
path = packages/journeyapps-react-native-quick-sqlite
6-
url = git@github.com:journeyapps/react-native-quick-sqlite.git

README.md

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,20 @@
22

33
Monorepo for all things React Native and PowerSync.
44

5-
## Monorepo structure
5+
## Monorepo Structure
66

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

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

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

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

21-
## Git submodules
18+
## Git Submodules
2219
After cloning this repo be sure to init the Git submodules
2320

2421
```bash
@@ -37,6 +34,41 @@ Build packages
3734
yarn build:packages
3835
```
3936

37+
38+
## Versioning
39+
40+
41+
### Development Packages
42+
Development packages can be published by manually triggering the `dev-packages` workflow. Development packages are versioned as `0.0.0-{tag}-DATETIMESTAMP`.
43+
44+
### Production Packages
45+
Pull requests should contain Changesets for changed packages.
46+
47+
Add changesets with
48+
```Bash
49+
yarn changeset add
50+
```
51+
52+
Merging a PR with Changesets will automatically create a PR with version bumps. That PR will be merged when releasing.
53+
54+
## React Native Quick SQLite Development
55+
56+
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.
57+
58+
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`.
59+
60+
```bash
61+
npm install -g mtsl
62+
```
63+
```bash
64+
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
65+
```
66+
67+
```bash
68+
mtsl start "[the id returned from step above]"
69+
```
70+
71+
4072
## Testing Supabase example app
4173

4274
``` bash

apps/supabase-todolist

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
{
22
"private": true,
3-
"name": "monorepo",
3+
"name": "powersync-react-native",
44
"version": "1.0.0",
55
"license": "Apache-2.0",
66
"scripts": {
77
"clean:packages": "lerna run clean",
88
"build:packages": "lerna run build",
9-
"watch:packages": "yarn workspace @journeyapps/powersync-sdk-react-native watch"
9+
"watch:packages": "yarn workspace @journeyapps/powersync-sdk-react-native watch",
10+
"release": "yarn build:packages && yarn changeset publish"
1011
},
1112
"workspaces": {
1213
"packages": [
@@ -23,6 +24,7 @@
2324
},
2425
"dependencies": {},
2526
"devDependencies": {
27+
"@changesets/cli": "^2.26.2",
2628
"lerna": "7.3.0"
2729
}
2830
}

0 commit comments

Comments
 (0)