-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from powersync-ja/docs
[Feat] add docs to github pages
- Loading branch information
Showing
30 changed files
with
9,394 additions
and
3,849 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Deploy docs to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: ["docs", "main"] | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
environment: github-pages | ||
env: | ||
META_LOGO_URL: ${{vars.META_LOGO_URL}} | ||
ALGOLIA_APP_ID: ${{vars.ALGOLIA_APP_ID}} | ||
ALGOLIA_API_KEY: ${{vars.ALGOLIA_API_KEY}} | ||
ALGOLIA_INDEX_NAME: ${{vars.ALGOLIA_INDEX_NAME}} | ||
GH_URL: ${{vars.GH_URL}} | ||
GH_ORG: ${{vars.GH_ORG}} | ||
GH_PROJECT_NAME: ${{vars.GH_PROJECT_NAME}} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup NodeJS | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
cache: yarn | ||
- name: Setup Yarn | ||
run: | | ||
npm install -g yarn | ||
echo "Yarn version: $(yarn -v)" | ||
echo "//registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}" >> ~/.npmrc | ||
- name: Install Dependencies | ||
run: yarn install --frozen-lockfile && cd docs && yarn install --frozen-lockfile | ||
- name: Build Packages | ||
run: yarn build:packages | ||
- name: Build Docs | ||
run: yarn build:docs | ||
- uses: actions/upload-pages-artifact@v2 | ||
with: | ||
path: ./docs/build | ||
deploy: | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
needs: build | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ tsconfig.tsbuildinfo | |
yarn-error.log | ||
.vscode | ||
.DS_STORE | ||
.idea | ||
.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
META_LOGO_URL=https://assets-global.website-files.com/651d89402147985dc475ff48/65577a5d2602b4209f37f936_powersync-website-meta-img.png | ||
|
||
ALGOLIA_APP_ID=8U0Z3F95NH | ||
# Public API key: it is safe to commit it | ||
ALGOLIA_API_KEY=45caa5b7ec2fd9e5f3dbfe8b3c661c04 | ||
ALGOLIA_INDEX_NAME=powersync-react-native-sdk-react-native-sdk | ||
|
||
# Can't use GITHUB_ when using Github actions | ||
GH_URL=https://powersync-ja.github.io/ | ||
GH_ORG=powersync-ja | ||
GH_PROJECT_NAME=powersync-react-native-sdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Dependencies | ||
/node_modules | ||
|
||
# Production | ||
/build | ||
|
||
# Generated files | ||
.docusaurus | ||
.cache-loader | ||
|
||
# Misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
docs/attachments-sdk/ | ||
docs/common-sdk/ | ||
docs/react-native-sdk/ | ||
docs/react-sdk/ | ||
|
||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# Website | ||
|
||
This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator. | ||
|
||
### Installation | ||
|
||
```bash | ||
yarn | ||
``` | ||
|
||
### Local Development | ||
|
||
```bash | ||
yarn start | ||
``` | ||
|
||
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. | ||
|
||
### Build | ||
|
||
```bash | ||
yarn build | ||
``` | ||
|
||
This command generates static content into the `build` directory and can be served using any static contents hosting service. | ||
|
||
### Deployment | ||
|
||
Using SSH: | ||
|
||
```bash | ||
USE_SSH=true yarn deploy | ||
``` | ||
|
||
Not using SSH: | ||
|
||
```bash | ||
GIT_USER=<Your GitHub username> yarn deploy | ||
``` | ||
|
||
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
presets: [require.resolve('@docusaurus/core/lib/babel/preset')], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
--- | ||
id: "index" | ||
title: "PowerSync React Native SDK Docs" | ||
sidebar_label: "Readme" | ||
sidebar_position: 0 | ||
custom_edit_url: null | ||
--- | ||
|
||
# PowerSync React Native SDK | ||
|
||
Monorepo for all things React Native and PowerSync. | ||
|
||
## Monorepo Structure | ||
|
||
- [apps/supabase-todolist](https://github.com/powersync-ja/powersync-supabase-react-native-todolist-demo/tree/e6a1d045ab8244041651757402adc562a6699a4f) | ||
- An Expo React native app using Supabase. | ||
|
||
- [packages/powersync-sdk-common](./common-sdk/index.md) | ||
- A TypeScript implementation of a PowerSync database connector and streaming sync bucket implementation. | ||
|
||
- [packages/powersync-sdk-react-native](./react-native-sdk/index.md) | ||
- An extension of `packages/powersync-sdk-common` which provides React Native specific implementations of abstracted features. | ||
|
||
# Development | ||
|
||
## Git Submodules | ||
|
||
After cloning this repo be sure to init the Git submodules | ||
|
||
```bash | ||
git submodule init && git submodule update | ||
``` | ||
|
||
This monorepo uses Yarn as it works well with React native. | ||
|
||
Install workspace dependencies | ||
|
||
```bash | ||
yarn install | ||
``` | ||
|
||
Build packages | ||
|
||
```bash | ||
yarn build:packages | ||
``` | ||
|
||
## Versioning | ||
|
||
### Development Packages | ||
|
||
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. | ||
|
||
Add changesets with | ||
|
||
```Bash | ||
yarn changeset add | ||
``` | ||
|
||
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]" | ||
``` | ||
|
||
## Testing Supabase example app | ||
|
||
``` bash | ||
cd apps/supabase-todolist | ||
``` | ||
|
||
Test on either Android or iOS | ||
|
||
```bash | ||
yarn ios | ||
``` |
Oops, something went wrong.