Skip to content

Commit

Permalink
Merge pull request #19 from powersync-ja/powersync_builds
Browse files Browse the repository at this point in the history
Static + Dynamic PowerSync Builds
  • Loading branch information
stevensJourney authored Nov 18, 2024
2 parents e139801 + f68e066 commit 86a2b16
Show file tree
Hide file tree
Showing 196 changed files with 16,295 additions and 18,782 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-ghosts-attack.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@journeyapps/wa-sqlite': minor
---

Updated PowerSync core build steps by removing Git submodules. Added ability to load PowerSync extension as a dynamic side module.
5 changes: 5 additions & 0 deletions .changeset/perfect-radios-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@journeyapps/wa-sqlite': major
---

Updated from upstream to v1.0.4
43 changes: 24 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,66 +5,71 @@ name: wa-sqlite CI

on:
push:
branches: ["master"]
branches: ['master']
pull_request:
branches: ["master"]
branches: ['master']

env:
EM_VERSION: 3.1.64
EM_CACHE_FOLDER: "emsdk-cache"
EM_CACHE_FOLDER: 'emsdk-cache'

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache: 'npm'

- uses: browser-actions/setup-chrome@v1
id: setup-chrome
with:
chrome-version: 129
- run: |
${{ steps.setup-chrome.outputs.chrome-path }} --version
# Install yarn dependencies.
# Install yarn dependencies.
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- run: yarn install
- name: Rust Setup
run: |
rustup toolchain install nightly-2024-05-18-x86_64-unknown-linux-gnu
rustup component add rust-src --toolchain nightly-2024-05-18-x86_64-unknown-linux-gnu
- name: Test with checked-in WASM files
run: yarn test --reporters progress
run: yarn test

# Install EMSDK
- name: Setup Emscripten
id: cache-system-libraries
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{ runner.os }}
- uses: mymindstorm/setup-emsdk@v12
- uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
- run: emcc -v

# For some reason the Makefile fails to execute this with a "Permission denied"
# error on Github actions. Doing this here prevents the error.
- name: Download PowerSync Core
run: node scripts/download-core-build.js

- name: Test WASM build
run: |
make clean && make
yarn test --reporters progress
yarn test
2 changes: 1 addition & 1 deletion .github/workflows/dev-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Setup NodeJS
uses: actions/setup-node@v2
with:
node-version: 16
node-version: 20

- name: Setup Yarn
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 20

- name: Install Dependencies
run: yarn
Expand Down
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
!.yarn/versions
.pnp.*

# PowerSync Rust Core
libpowersync*.wasm
powersync-libs

/cache
/debug
/deps
/tmp

/dist-xl.zip
/dist-xl
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "powersync-sqlite-core"]
path = powersync-sqlite-core
url = [email protected]:powersync-ja/powersync-sqlite-core.git
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"arcanis.vscode-zipfs"
]
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"search.exclude": {
"**/.yarn": true,
"**/.pnp.*": true
},
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
768 changes: 0 additions & 768 deletions .yarn/releases/yarn-3.1.1.cjs

This file was deleted.

893 changes: 893 additions & 0 deletions .yarn/releases/yarn-4.0.2.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarn/sdks/integrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This file is automatically generated by @yarnpkg/sdks.
# Manual changes might be lost!

integrations:
- vscode
20 changes: 20 additions & 0 deletions .yarn/sdks/typescript/bin/tsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsc
require(absPnpApiPath).setup();
}
}

// Defer to the real typescript/bin/tsc your application uses
module.exports = absRequire(`typescript/bin/tsc`);
20 changes: 20 additions & 0 deletions .yarn/sdks/typescript/bin/tsserver
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/bin/tsserver
require(absPnpApiPath).setup();
}
}

// Defer to the real typescript/bin/tsserver your application uses
module.exports = absRequire(`typescript/bin/tsserver`);
20 changes: 20 additions & 0 deletions .yarn/sdks/typescript/lib/tsc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env node

const {existsSync} = require(`fs`);
const {createRequire} = require(`module`);
const {resolve} = require(`path`);

const relPnpApiPath = "../../../../.pnp.cjs";

const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absRequire = createRequire(absPnpApiPath);

if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require typescript/lib/tsc.js
require(absPnpApiPath).setup();
}
}

// Defer to the real typescript/lib/tsc.js your application uses
module.exports = absRequire(`typescript/lib/tsc.js`);
Loading

0 comments on commit 86a2b16

Please sign in to comment.