javascript: Rename "browser" packages to "wasm"

This commit is contained in:
Pekka Enberg
2025-09-29 07:46:30 +03:00
parent fda1b89540
commit 57c279e2b0
57 changed files with 360 additions and 1344 deletions

View File

@@ -77,8 +77,8 @@ jobs:
export TARGET_CXXFLAGS="--target=wasm32-wasi-threads --sysroot=$(pwd)/wasi-sdk-25.0-x86_64-linux/share/wasi-sysroot -pthread -mllvm -wasm-enable-sjlj -lsetjmp" export TARGET_CXXFLAGS="--target=wasm32-wasi-threads --sysroot=$(pwd)/wasi-sdk-25.0-x86_64-linux/share/wasi-sysroot -pthread -mllvm -wasm-enable-sjlj -lsetjmp"
export TARGET_CFLAGS="$TARGET_CXXFLAGS" export TARGET_CFLAGS="$TARGET_CXXFLAGS"
yarn workspace @tursodatabase/database-common build yarn workspace @tursodatabase/database-common build
yarn workspace @tursodatabase/database-browser-common build yarn workspace @tursodatabase/database-wasm-common build
yarn workspace @tursodatabase/database-browser build yarn workspace @tursodatabase/database-wasm build
- host: ubuntu-latest - host: ubuntu-latest
target: wasm32-wasip1-threads target: wasm32-wasip1-threads
artifact: sync-bindings-wasm32-wasip1-threads artifact: sync-bindings-wasm32-wasip1-threads
@@ -92,9 +92,9 @@ jobs:
export TARGET_CXXFLAGS="--target=wasm32-wasi-threads --sysroot=$(pwd)/wasi-sdk-25.0-x86_64-linux/share/wasi-sysroot -pthread -mllvm -wasm-enable-sjlj -lsetjmp" export TARGET_CXXFLAGS="--target=wasm32-wasi-threads --sysroot=$(pwd)/wasi-sdk-25.0-x86_64-linux/share/wasi-sysroot -pthread -mllvm -wasm-enable-sjlj -lsetjmp"
export TARGET_CFLAGS="$TARGET_CXXFLAGS" export TARGET_CFLAGS="$TARGET_CXXFLAGS"
yarn workspace @tursodatabase/database-common build yarn workspace @tursodatabase/database-common build
yarn workspace @tursodatabase/database-browser-common build yarn workspace @tursodatabase/database-wasm-common build
yarn workspace @tursodatabase/sync-common build yarn workspace @tursodatabase/sync-common build
yarn workspace @tursodatabase/sync-browser build yarn workspace @tursodatabase/sync-wasm build
name: ${{ matrix.settings.artifact }} - node@20 name: ${{ matrix.settings.artifact }} - node@20
runs-on: ${{ matrix.settings.host }} runs-on: ${{ matrix.settings.host }}
steps: steps:
@@ -155,9 +155,9 @@ jobs:
name: ${{ matrix.settings.artifact }} name: ${{ matrix.settings.artifact }}
path: | path: |
bindings/javascript/packages/native/turso.*.node bindings/javascript/packages/native/turso.*.node
bindings/javascript/packages/browser/turso.*.wasm bindings/javascript/packages/wasm/turso.*.wasm
bindings/javascript/sync/packages/native/sync.*.node bindings/javascript/sync/packages/native/sync.*.node
bindings/javascript/sync/packages/browser/sync.*.wasm bindings/javascript/sync/packages/wasm/sync.*.wasm
if-no-files-found: error if-no-files-found: error
test-db-linux-x64-gnu-binding: test-db-linux-x64-gnu-binding:
name: Test DB bindings on Linux-x64-gnu - node@${{ matrix.node }} name: Test DB bindings on Linux-x64-gnu - node@${{ matrix.node }}
@@ -191,7 +191,7 @@ jobs:
shell: bash shell: bash
- name: Test bindings - name: Test bindings
run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim yarn workspace @tursodatabase/database test run: docker run --rm -v $(pwd):/build -w /build node:${{ matrix.node }}-slim yarn workspace @tursodatabase/database test
test-db-browser-binding: test-db-wasm-binding:
name: Test DB bindings on browser@${{ matrix.node }} name: Test DB bindings on browser@${{ matrix.node }}
timeout-minutes: 30 timeout-minutes: 30
needs: needs:
@@ -212,10 +212,10 @@ jobs:
run: yarn install run: yarn install
- name: Build common - name: Build common
run: yarn workspace @tursodatabase/database-common build run: yarn workspace @tursodatabase/database-common build
- name: Build browser-common - name: Build wasm-common
run: yarn workspace @tursodatabase/database-browser-common build run: yarn workspace @tursodatabase/database-wasm-common build
- name: Install playwright with deps - name: Install playwright with deps
run: yarn workspace @tursodatabase/database-browser playwright install --with-deps run: yarn workspace @tursodatabase/database-wasm playwright install --with-deps
- name: Download all DB artifacts - name: Download all DB artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@v4
with: with:
@@ -226,7 +226,7 @@ jobs:
run: ls -R . run: ls -R .
shell: bash shell: bash
- name: Test bindings - name: Test bindings
run: yarn workspace @tursodatabase/database-browser test run: yarn workspace @tursodatabase/database-wasm test
publish: publish:
name: Publish name: Publish
runs-on: ubuntu-latest runs-on: ubuntu-latest
@@ -236,7 +236,7 @@ jobs:
id-token: write id-token: write
needs: needs:
- test-db-linux-x64-gnu-binding - test-db-linux-x64-gnu-binding
- test-db-browser-binding - test-db-wasm-binding
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Setup node - name: Setup node
@@ -284,4 +284,4 @@ jobs:
- name: Publish (dry-run) - name: Publish (dry-run)
if: "!startsWith(github.ref, 'refs/tags/v')" if: "!startsWith(github.ref, 'refs/tags/v')"
run: | run: |
npm publish --workspaces --dry-run npm publish --workspaces --dry-run

View File

@@ -1,20 +1,20 @@
pack-native: pack-native:
npm publish --dry-run && npm pack npm publish --dry-run && npm pack
pack-browser: pack-wasm:
cp package.json package.native.json cp package.json package.native.json
cp package.browser.json package.json cp package.browser.json package.json
npm publish --dry-run && npm pack; cp package.native.json package.json npm publish --dry-run && npm pack; cp package.native.json package.json
publish-native: publish-native:
npm publish --access public npm publish --access public
publish-browser: publish-wasm:
cp package.json package.native.json cp package.json package.native.json
cp package.browser.json package.json cp package.browser.json package.json
npm publish --access public; cp package.native.json package.json npm publish --access public; cp package.native.json package.json
publish-native-next: publish-native-next:
npm publish --tag next --access public npm publish --tag next --access public
publish-browser-next: publish-wasm-next:
cp package.json package.native.json cp package.json package.native.json
cp package.browser.json package.json cp package.browser.json package.json
npm publish --tag next --access public; cp package.native.json package.json npm publish --tag next --access public; cp package.native.json package.json

View File

@@ -27,13 +27,13 @@
] ]
}, },
"../../packages/browser": { "../../packages/browser": {
"name": "@tursodatabase/database-browser", "name": "@tursodatabase/database-wasm",
"version": "0.1.5", "version": "0.1.5",
"extraneous": true, "extraneous": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@napi-rs/wasm-runtime": "^1.0.3", "@napi-rs/wasm-runtime": "^1.0.3",
"@tursodatabase/database-browser-common": "^0.1.5", "@tursodatabase/database-wasm-common": "^0.1.5",
"@tursodatabase/database-common": "^0.1.5" "@tursodatabase/database-common": "^0.1.5"
}, },
"devDependencies": { "devDependencies": {
@@ -45,7 +45,7 @@
} }
}, },
"../../packages/browser-common": { "../../packages/browser-common": {
"name": "@tursodatabase/database-browser-common", "name": "@tursodatabase/database-wasm-common",
"version": "0.1.5", "version": "0.1.5",
"extraneous": true, "extraneous": true,
"license": "MIT", "license": "MIT",
@@ -77,13 +77,13 @@
} }
}, },
"../../sync/packages/browser": { "../../sync/packages/browser": {
"name": "@tursodatabase/sync-browser", "name": "@tursodatabase/sync-wasm",
"version": "0.1.5", "version": "0.1.5",
"extraneous": true, "extraneous": true,
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@napi-rs/wasm-runtime": "^1.0.3", "@napi-rs/wasm-runtime": "^1.0.3",
"@tursodatabase/database-browser-common": "^0.1.5", "@tursodatabase/database-wasm-common": "^0.1.5",
"@tursodatabase/database-common": "^0.1.5", "@tursodatabase/database-common": "^0.1.5",
"@tursodatabase/sync-common": "^0.1.5" "@tursodatabase/sync-common": "^0.1.5"
}, },

View File

@@ -6,7 +6,7 @@ export default defineConfig({
}, },
resolve: { resolve: {
alias: { alias: {
'@tursodatabase/database-wasm32-wasi': '../../turso.wasi-browser.js' '@tursodatabase/database-wasm32-wasi': '../../turso.wasi-wasm.js'
}, },
}, },
server: { server: {

View File

@@ -166,7 +166,7 @@
</main> </main>
<script type="module"> <script type="module">
import { connect } from "@tursodatabase/database-browser"; import { connect } from "@tursodatabase/database-wasm";
const db = await connect('data.db'); const db = await connect('data.db');
// --- Wire your DB here -------------------------------------------------- // --- Wire your DB here --------------------------------------------------
// Provide window.executeQuery = async (sql) => ({ columns: string[], rows: any[][] }) // Provide window.executeQuery = async (sql) => ({ columns: string[], rows: any[][] })

View File

@@ -9,19 +9,19 @@
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"@tursodatabase/database-browser": "../../packages/browser" "@tursodatabase/database-wasm": "../../packages/browser"
}, },
"devDependencies": { "devDependencies": {
"vite": "^7.1.4" "vite": "^7.1.4"
} }
}, },
"../../packages/browser": { "../../packages/browser": {
"name": "@tursodatabase/database-browser", "name": "@tursodatabase/database-wasm",
"version": "0.1.5", "version": "0.1.5",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@napi-rs/wasm-runtime": "^1.0.3", "@napi-rs/wasm-runtime": "^1.0.3",
"@tursodatabase/database-browser-common": "^0.1.5", "@tursodatabase/database-wasm-common": "^0.1.5",
"@tursodatabase/database-common": "^0.1.5" "@tursodatabase/database-common": "^0.1.5"
}, },
"devDependencies": { "devDependencies": {
@@ -71,7 +71,7 @@
"linux" "linux"
] ]
}, },
"node_modules/@tursodatabase/database-browser": { "node_modules/@tursodatabase/database-wasm": {
"resolved": "../../packages/browser", "resolved": "../../packages/browser",
"link": true "link": true
}, },

View File

@@ -14,6 +14,6 @@
"vite": "^7.1.4" "vite": "^7.1.4"
}, },
"dependencies": { "dependencies": {
"@tursodatabase/database-browser": "../../browser" "@tursodatabase/database-wasm": "../../browser"
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -7,12 +7,12 @@
}, },
"workspaces": [ "workspaces": [
"packages/common", "packages/common",
"packages/wasm-common",
"packages/native", "packages/native",
"packages/browser-common", "packages/wasm",
"packages/browser",
"sync/packages/common", "sync/packages/common",
"sync/packages/native", "sync/packages/native",
"sync/packages/browser" "sync/packages/wasm"
], ],
"version": "0.2.0-pre.10" "version": "0.2.0-pre.10"
} }

View File

@@ -1,2 +0,0 @@
import { setupWebWorker } from "@tursodatabase/database-browser-common";
setupWebWorker();

View File

@@ -2,7 +2,7 @@
This package is the Turso embedded database common JS library which is shared between final builds for Node and Browser. This package is the Turso embedded database common JS library which is shared between final builds for Node and Browser.
Do not use this package directly - instead you must use `@tursodatabase/database` or `@tursodatabase/database-browser`. Do not use this package directly - instead you must use `@tursodatabase/database` or `@tursodatabase/database-wasm`.
> **⚠️ Warning:** This software is ALPHA, only use for development, testing, and experimentation. We are working to make it production ready, but do not use it for critical data right now. > **⚠️ Warning:** This software is ALPHA, only use for development, testing, and experimentation. We are working to make it production ready, but do not use it for critical data right now.

View File

@@ -23,7 +23,7 @@ This package is the Turso embedded database library for JavaScript in Node.
- **SQLite compatible:** SQLite query language and file format support ([status](https://github.com/tursodatabase/turso/blob/main/COMPAT.md)). - **SQLite compatible:** SQLite query language and file format support ([status](https://github.com/tursodatabase/turso/blob/main/COMPAT.md)).
- **In-process**: No network overhead, runs directly in your Node.js process - **In-process**: No network overhead, runs directly in your Node.js process
- **TypeScript support**: Full TypeScript definitions included - **TypeScript support**: Full TypeScript definitions included
- **Cross-platform**: Supports Linux (x86 and arm64), macOS, Windows (browser is supported in the separate package `@tursodatabase/database-browser` package) - **Cross-platform**: Supports Linux (x86 and arm64), macOS, Windows (browser is supported in the separate package `@tursodatabase/database-wasm` package)
## Installation ## Installation

View File

@@ -67,7 +67,7 @@ const isMuslFromChildProcess = () => {
function requireNative() { function requireNative() {
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) { if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
try { try {
nativeBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH); return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
} catch (err) { } catch (err) {
loadErrors.push(err) loadErrors.push(err)
} }
@@ -81,8 +81,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-android-arm64') const binding = require('@tursodatabase/database-android-arm64')
const bindingPackageVersion = require('@tursodatabase/database-android-arm64/package.json').version const bindingPackageVersion = require('@tursodatabase/database-android-arm64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -97,8 +97,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-android-arm-eabi') const binding = require('@tursodatabase/database-android-arm-eabi')
const bindingPackageVersion = require('@tursodatabase/database-android-arm-eabi/package.json').version const bindingPackageVersion = require('@tursodatabase/database-android-arm-eabi/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -117,8 +117,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-win32-x64-msvc') const binding = require('@tursodatabase/database-win32-x64-msvc')
const bindingPackageVersion = require('@tursodatabase/database-win32-x64-msvc/package.json').version const bindingPackageVersion = require('@tursodatabase/database-win32-x64-msvc/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -133,8 +133,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-win32-ia32-msvc') const binding = require('@tursodatabase/database-win32-ia32-msvc')
const bindingPackageVersion = require('@tursodatabase/database-win32-ia32-msvc/package.json').version const bindingPackageVersion = require('@tursodatabase/database-win32-ia32-msvc/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -149,8 +149,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-win32-arm64-msvc') const binding = require('@tursodatabase/database-win32-arm64-msvc')
const bindingPackageVersion = require('@tursodatabase/database-win32-arm64-msvc/package.json').version const bindingPackageVersion = require('@tursodatabase/database-win32-arm64-msvc/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -168,8 +168,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-darwin-universal') const binding = require('@tursodatabase/database-darwin-universal')
const bindingPackageVersion = require('@tursodatabase/database-darwin-universal/package.json').version const bindingPackageVersion = require('@tursodatabase/database-darwin-universal/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -184,8 +184,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-darwin-x64') const binding = require('@tursodatabase/database-darwin-x64')
const bindingPackageVersion = require('@tursodatabase/database-darwin-x64/package.json').version const bindingPackageVersion = require('@tursodatabase/database-darwin-x64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -200,8 +200,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-darwin-arm64') const binding = require('@tursodatabase/database-darwin-arm64')
const bindingPackageVersion = require('@tursodatabase/database-darwin-arm64/package.json').version const bindingPackageVersion = require('@tursodatabase/database-darwin-arm64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -220,8 +220,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-freebsd-x64') const binding = require('@tursodatabase/database-freebsd-x64')
const bindingPackageVersion = require('@tursodatabase/database-freebsd-x64/package.json').version const bindingPackageVersion = require('@tursodatabase/database-freebsd-x64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -236,8 +236,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-freebsd-arm64') const binding = require('@tursodatabase/database-freebsd-arm64')
const bindingPackageVersion = require('@tursodatabase/database-freebsd-arm64/package.json').version const bindingPackageVersion = require('@tursodatabase/database-freebsd-arm64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -257,8 +257,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-linux-x64-musl') const binding = require('@tursodatabase/database-linux-x64-musl')
const bindingPackageVersion = require('@tursodatabase/database-linux-x64-musl/package.json').version const bindingPackageVersion = require('@tursodatabase/database-linux-x64-musl/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -273,8 +273,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-linux-x64-gnu') const binding = require('@tursodatabase/database-linux-x64-gnu')
const bindingPackageVersion = require('@tursodatabase/database-linux-x64-gnu/package.json').version const bindingPackageVersion = require('@tursodatabase/database-linux-x64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -291,8 +291,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-linux-arm64-musl') const binding = require('@tursodatabase/database-linux-arm64-musl')
const bindingPackageVersion = require('@tursodatabase/database-linux-arm64-musl/package.json').version const bindingPackageVersion = require('@tursodatabase/database-linux-arm64-musl/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -307,8 +307,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-linux-arm64-gnu') const binding = require('@tursodatabase/database-linux-arm64-gnu')
const bindingPackageVersion = require('@tursodatabase/database-linux-arm64-gnu/package.json').version const bindingPackageVersion = require('@tursodatabase/database-linux-arm64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -325,8 +325,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-linux-arm-musleabihf') const binding = require('@tursodatabase/database-linux-arm-musleabihf')
const bindingPackageVersion = require('@tursodatabase/database-linux-arm-musleabihf/package.json').version const bindingPackageVersion = require('@tursodatabase/database-linux-arm-musleabihf/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -341,8 +341,42 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-linux-arm-gnueabihf') const binding = require('@tursodatabase/database-linux-arm-gnueabihf')
const bindingPackageVersion = require('@tursodatabase/database-linux-arm-gnueabihf/package.json').version const bindingPackageVersion = require('@tursodatabase/database-linux-arm-gnueabihf/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 'loong64') {
if (isMusl()) {
try {
return require('./turso.linux-loong64-musl.node')
} catch (e) {
loadErrors.push(e)
}
try {
const binding = require('@tursodatabase/database-linux-loong64-musl')
const bindingPackageVersion = require('@tursodatabase/database-linux-loong64-musl/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
loadErrors.push(e)
}
} else {
try {
return require('./turso.linux-loong64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
const binding = require('@tursodatabase/database-linux-loong64-gnu')
const bindingPackageVersion = require('@tursodatabase/database-linux-loong64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -359,8 +393,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-linux-riscv64-musl') const binding = require('@tursodatabase/database-linux-riscv64-musl')
const bindingPackageVersion = require('@tursodatabase/database-linux-riscv64-musl/package.json').version const bindingPackageVersion = require('@tursodatabase/database-linux-riscv64-musl/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -375,8 +409,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-linux-riscv64-gnu') const binding = require('@tursodatabase/database-linux-riscv64-gnu')
const bindingPackageVersion = require('@tursodatabase/database-linux-riscv64-gnu/package.json').version const bindingPackageVersion = require('@tursodatabase/database-linux-riscv64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -392,8 +426,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-linux-ppc64-gnu') const binding = require('@tursodatabase/database-linux-ppc64-gnu')
const bindingPackageVersion = require('@tursodatabase/database-linux-ppc64-gnu/package.json').version const bindingPackageVersion = require('@tursodatabase/database-linux-ppc64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -408,8 +442,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-linux-s390x-gnu') const binding = require('@tursodatabase/database-linux-s390x-gnu')
const bindingPackageVersion = require('@tursodatabase/database-linux-s390x-gnu/package.json').version const bindingPackageVersion = require('@tursodatabase/database-linux-s390x-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -428,8 +462,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-openharmony-arm64') const binding = require('@tursodatabase/database-openharmony-arm64')
const bindingPackageVersion = require('@tursodatabase/database-openharmony-arm64/package.json').version const bindingPackageVersion = require('@tursodatabase/database-openharmony-arm64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -444,8 +478,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-openharmony-x64') const binding = require('@tursodatabase/database-openharmony-x64')
const bindingPackageVersion = require('@tursodatabase/database-openharmony-x64/package.json').version const bindingPackageVersion = require('@tursodatabase/database-openharmony-x64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -460,8 +494,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/database-openharmony-arm') const binding = require('@tursodatabase/database-openharmony-arm')
const bindingPackageVersion = require('@tursodatabase/database-openharmony-arm/package.json').version const bindingPackageVersion = require('@tursodatabase/database-openharmony-arm/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.7' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.7 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -478,22 +512,32 @@ function requireNative() {
nativeBinding = requireNative() nativeBinding = requireNative()
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
let wasiBinding = null
let wasiBindingError = null
try { try {
nativeBinding = require('./turso.wasi.cjs') wasiBinding = require('./turso.wasi.cjs')
nativeBinding = wasiBinding
} catch (err) { } catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) { if (process.env.NAPI_RS_FORCE_WASI) {
loadErrors.push(err) wasiBindingError = err
} }
} }
if (!nativeBinding) { if (!nativeBinding) {
try { try {
nativeBinding = require('@tursodatabase/database-wasm32-wasi') wasiBinding = require('@tursodatabase/database-wasm32-wasi')
nativeBinding = wasiBinding
} catch (err) { } catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) { if (process.env.NAPI_RS_FORCE_WASI) {
wasiBindingError.cause = err
loadErrors.push(err) loadErrors.push(err)
} }
} }
} }
if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
error.cause = wasiBindingError
throw error
}
} }
if (!nativeBinding) { if (!nativeBinding) {
@@ -502,7 +546,12 @@ if (!nativeBinding) {
`Cannot find native binding. ` + `Cannot find native binding. ` +
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` + `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
'Please try `npm i` again after removing both package-lock.json and node_modules directory.', 'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
{ cause: loadErrors } {
cause: loadErrors.reduce((err, cur) => {
cur.cause = err
return cur
}),
},
) )
} }
throw new Error(`Failed to load native binding`) throw new Error(`Failed to load native binding`)

View File

@@ -2,7 +2,7 @@
This package is the Turso embedded database common JS library which is shared between final builds for Node and Browser. This package is the Turso embedded database common JS library which is shared between final builds for Node and Browser.
Do not use this package directly - instead you must use `@tursodatabase/database` or `@tursodatabase/database-browser`. Do not use this package directly - instead you must use `@tursodatabase/database` or `@tursodatabase/database-wasm`.
> **⚠️ Warning:** This software is ALPHA, only use for development, testing, and experimentation. We are working to make it production ready, but do not use it for critical data right now. > **⚠️ Warning:** This software is ALPHA, only use for development, testing, and experimentation. We are working to make it production ready, but do not use it for critical data right now.

View File

@@ -1,5 +1,5 @@
{ {
"name": "@tursodatabase/database-browser-common", "name": "@tursodatabase/database-wasm-common",
"version": "0.2.0-pre.10", "version": "0.2.0-pre.10",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -9,6 +9,12 @@
"license": "MIT", "license": "MIT",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"exports": {
".": {
"import": "./dist/index.js",
"types": "./dist/index.d.ts"
}
},
"packageManager": "yarn@4.9.2", "packageManager": "yarn@4.9.2",
"files": [ "files": [
"dist/**", "dist/**",

View File

@@ -27,7 +27,7 @@ This package is the Turso embedded database library for JavaScript in Browser.
## Installation ## Installation
```bash ```bash
npm install @tursodatabase/database-browser npm install @tursodatabase/database-wasm
``` ```
## Getting Started ## Getting Started
@@ -35,7 +35,7 @@ npm install @tursodatabase/database-browser
### In-Memory Database ### In-Memory Database
```javascript ```javascript
import { connect } from '@tursodatabase/database-browser'; import { connect } from '@tursodatabase/database-wasm';
// Create an in-memory database // Create an in-memory database
const db = await connect(':memory:'); const db = await connect(':memory:');
@@ -60,7 +60,7 @@ console.log(users);
### File-Based Database ### File-Based Database
```javascript ```javascript
import { connect } from '@tursodatabase/database-browser'; import { connect } from '@tursodatabase/database-wasm';
// Create or open a database file // Create or open a database file
const db = await connect('my-database.db'); const db = await connect('my-database.db');
@@ -85,7 +85,7 @@ console.log(`Inserted post with ID: ${result.lastInsertRowid}`);
### Transactions ### Transactions
```javascript ```javascript
import { connect } from '@tursodatabase/database-browser'; import { connect } from '@tursodatabase/database-wasm';
const db = await connect('transactions.db'); const db = await connect('transactions.db');

View File

@@ -1,4 +1,4 @@
import { setupMainThread } from "@tursodatabase/database-browser-common"; import { setupMainThread } from "@tursodatabase/database-wasm-common";
//@ts-ignore //@ts-ignore
import TursoWorker from "./worker.js?worker&inline"; import TursoWorker from "./worker.js?worker&inline";

View File

@@ -1,4 +1,4 @@
import { setupMainThread } from "@tursodatabase/database-browser-common"; import { setupMainThread } from "@tursodatabase/database-wasm-common";
const __wasmUrl = new URL('./turso.wasm32-wasi.wasm', import.meta.url).href; const __wasmUrl = new URL('./turso.wasm32-wasi.wasm', import.meta.url).href;
const __wasmFile = await fetch(__wasmUrl).then((res) => res.arrayBuffer()) const __wasmFile = await fetch(__wasmUrl).then((res) => res.arrayBuffer())

View File

@@ -1,4 +1,4 @@
import { setupMainThread } from "@tursodatabase/database-browser-common"; import { setupMainThread } from "@tursodatabase/database-wasm-common";
import { tursoWasm } from "./wasm-inline.js"; import { tursoWasm } from "./wasm-inline.js";
// Next (turbopack) has issues with loading wasm module: https://github.com/vercel/next.js/issues/82520 // Next (turbopack) has issues with loading wasm module: https://github.com/vercel/next.js/issues/82520

View File

@@ -1,4 +1,4 @@
import { isWebWorker, setupMainThread, setupWebWorker } from "@tursodatabase/database-browser-common"; import { isWebWorker, setupMainThread, setupWebWorker } from "@tursodatabase/database-wasm-common";
import { tursoWasm } from "./wasm-inline.js"; import { tursoWasm } from "./wasm-inline.js";
let napiModule = { let napiModule = {

View File

@@ -1,5 +1,5 @@
{ {
"name": "@tursodatabase/database-browser", "name": "@tursodatabase/database-wasm",
"version": "0.2.0-pre.10", "version": "0.2.0-pre.10",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -51,7 +51,7 @@
] ]
}, },
"dependencies": { "dependencies": {
"@tursodatabase/database-browser-common": "^0.2.0-pre.10", "@tursodatabase/database-common": "^0.2.0-pre.10",
"@tursodatabase/database-common": "^0.2.0-pre.10" "@tursodatabase/database-wasm-common": "^0.2.0-pre.10"
} }
} }

View File

@@ -1,5 +1,5 @@
import { DatabasePromise, DatabaseOpts, SqliteError, } from "@tursodatabase/database-common" import { DatabasePromise, DatabaseOpts, SqliteError, } from "@tursodatabase/database-common"
import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-browser-common"; import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-wasm-common";
import { initThreadPool, MainWorker, Database as NativeDatabase } from "./index-bundle.js"; import { initThreadPool, MainWorker, Database as NativeDatabase } from "./index-bundle.js";
async function init(): Promise<Worker> { async function init(): Promise<Worker> {

View File

@@ -1,5 +1,5 @@
import { DatabasePromise, DatabaseOpts, SqliteError, } from "@tursodatabase/database-common" import { DatabasePromise, DatabaseOpts, SqliteError, } from "@tursodatabase/database-common"
import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-browser-common"; import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-wasm-common";
import { initThreadPool, MainWorker, Database as NativeDatabase } from "./index-default.js"; import { initThreadPool, MainWorker, Database as NativeDatabase } from "./index-default.js";
async function init(): Promise<Worker> { async function init(): Promise<Worker> {

View File

@@ -1,5 +1,5 @@
import { DatabasePromise, DatabaseOpts, SqliteError, } from "@tursodatabase/database-common" import { DatabasePromise, DatabaseOpts, SqliteError, } from "@tursodatabase/database-common"
import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-browser-common"; import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-wasm-common";
import { initThreadPool, MainWorker, Database as NativeDatabase } from "./index-turbopack-hack.js"; import { initThreadPool, MainWorker, Database as NativeDatabase } from "./index-turbopack-hack.js";
async function init(): Promise<Worker> { async function init(): Promise<Worker> {

View File

@@ -1,5 +1,5 @@
import { DatabasePromise, DatabaseOpts, SqliteError, } from "@tursodatabase/database-common" import { DatabasePromise, DatabaseOpts, SqliteError, } from "@tursodatabase/database-common"
import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-browser-common"; import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-wasm-common";
import { initThreadPool, MainWorker, Database as NativeDatabase } from "./index-vite-dev-hack.js"; import { initThreadPool, MainWorker, Database as NativeDatabase } from "./index-vite-dev-hack.js";
async function init(): Promise<Worker> { async function init(): Promise<Worker> {

View File

@@ -6,7 +6,7 @@ export default defineConfig({
build: { build: {
lib: { lib: {
entry: resolve(__dirname, 'promise-bundle.ts'), entry: resolve(__dirname, 'promise-bundle.ts'),
name: 'database-browser', name: 'database-wasm',
fileName: format => `main.${format}.js`, fileName: format => `main.${format}.js`,
formats: ['es'], formats: ['es'],
}, },

View File

@@ -0,0 +1,2 @@
import { setupWebWorker } from "@tursodatabase/database-wasm-common";
setupWebWorker();

View File

@@ -1,2 +0,0 @@
import { setupWebWorker } from "@tursodatabase/database-browser-common";
setupWebWorker();

View File

@@ -2,7 +2,7 @@
This package is the Turso Sync common JS library which is shared between final builds for Node and Browser. This package is the Turso Sync common JS library which is shared between final builds for Node and Browser.
Do not use this package directly - instead you must use `@tursodatabase/sync` or `@tursodatabase/sync-browser`. Do not use this package directly - instead you must use `@tursodatabase/sync` or `@tursodatabase/sync-wasm`.
> **⚠️ Warning:** This software is ALPHA, only use for development, testing, and experimentation. We are working to make it production ready, but do not use it for critical data right now. > **⚠️ Warning:** This software is ALPHA, only use for development, testing, and experimentation. We are working to make it production ready, but do not use it for critical data right now.

View File

@@ -23,7 +23,7 @@ This package is the Turso embedded database library for JavaScript in Node.
- **SQLite compatible:** SQLite query language and file format support ([status](https://github.com/tursodatabase/turso/blob/main/COMPAT.md)). - **SQLite compatible:** SQLite query language and file format support ([status](https://github.com/tursodatabase/turso/blob/main/COMPAT.md)).
- **In-process**: No network overhead, runs directly in your Node.js process - **In-process**: No network overhead, runs directly in your Node.js process
- **TypeScript support**: Full TypeScript definitions included - **TypeScript support**: Full TypeScript definitions included
- **Cross-platform**: Supports Linux (x86 and arm64), macOS, Windows (browser is supported in the separate package `@tursodatabase/database-browser` package) - **Cross-platform**: Supports Linux (x86 and arm64), macOS, Windows (browser is supported in the separate package `@tursodatabase/database-wasm` package)
## Installation ## Installation

View File

@@ -67,7 +67,7 @@ const isMuslFromChildProcess = () => {
function requireNative() { function requireNative() {
if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) { if (process.env.NAPI_RS_NATIVE_LIBRARY_PATH) {
try { try {
nativeBinding = require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH); return require(process.env.NAPI_RS_NATIVE_LIBRARY_PATH);
} catch (err) { } catch (err) {
loadErrors.push(err) loadErrors.push(err)
} }
@@ -81,8 +81,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-android-arm64') const binding = require('@tursodatabase/sync-android-arm64')
const bindingPackageVersion = require('@tursodatabase/sync-android-arm64/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-android-arm64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -97,8 +97,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-android-arm-eabi') const binding = require('@tursodatabase/sync-android-arm-eabi')
const bindingPackageVersion = require('@tursodatabase/sync-android-arm-eabi/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-android-arm-eabi/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -117,8 +117,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-win32-x64-msvc') const binding = require('@tursodatabase/sync-win32-x64-msvc')
const bindingPackageVersion = require('@tursodatabase/sync-win32-x64-msvc/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-win32-x64-msvc/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -133,8 +133,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-win32-ia32-msvc') const binding = require('@tursodatabase/sync-win32-ia32-msvc')
const bindingPackageVersion = require('@tursodatabase/sync-win32-ia32-msvc/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-win32-ia32-msvc/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -149,8 +149,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-win32-arm64-msvc') const binding = require('@tursodatabase/sync-win32-arm64-msvc')
const bindingPackageVersion = require('@tursodatabase/sync-win32-arm64-msvc/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-win32-arm64-msvc/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -168,8 +168,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-darwin-universal') const binding = require('@tursodatabase/sync-darwin-universal')
const bindingPackageVersion = require('@tursodatabase/sync-darwin-universal/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-darwin-universal/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -184,8 +184,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-darwin-x64') const binding = require('@tursodatabase/sync-darwin-x64')
const bindingPackageVersion = require('@tursodatabase/sync-darwin-x64/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-darwin-x64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -200,8 +200,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-darwin-arm64') const binding = require('@tursodatabase/sync-darwin-arm64')
const bindingPackageVersion = require('@tursodatabase/sync-darwin-arm64/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-darwin-arm64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -220,8 +220,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-freebsd-x64') const binding = require('@tursodatabase/sync-freebsd-x64')
const bindingPackageVersion = require('@tursodatabase/sync-freebsd-x64/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-freebsd-x64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -236,8 +236,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-freebsd-arm64') const binding = require('@tursodatabase/sync-freebsd-arm64')
const bindingPackageVersion = require('@tursodatabase/sync-freebsd-arm64/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-freebsd-arm64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -257,8 +257,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-linux-x64-musl') const binding = require('@tursodatabase/sync-linux-x64-musl')
const bindingPackageVersion = require('@tursodatabase/sync-linux-x64-musl/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-linux-x64-musl/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -273,8 +273,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-linux-x64-gnu') const binding = require('@tursodatabase/sync-linux-x64-gnu')
const bindingPackageVersion = require('@tursodatabase/sync-linux-x64-gnu/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-linux-x64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -291,8 +291,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-linux-arm64-musl') const binding = require('@tursodatabase/sync-linux-arm64-musl')
const bindingPackageVersion = require('@tursodatabase/sync-linux-arm64-musl/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-linux-arm64-musl/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -307,8 +307,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-linux-arm64-gnu') const binding = require('@tursodatabase/sync-linux-arm64-gnu')
const bindingPackageVersion = require('@tursodatabase/sync-linux-arm64-gnu/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-linux-arm64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -325,8 +325,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-linux-arm-musleabihf') const binding = require('@tursodatabase/sync-linux-arm-musleabihf')
const bindingPackageVersion = require('@tursodatabase/sync-linux-arm-musleabihf/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-linux-arm-musleabihf/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -341,8 +341,42 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-linux-arm-gnueabihf') const binding = require('@tursodatabase/sync-linux-arm-gnueabihf')
const bindingPackageVersion = require('@tursodatabase/sync-linux-arm-gnueabihf/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-linux-arm-gnueabihf/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
loadErrors.push(e)
}
}
} else if (process.arch === 'loong64') {
if (isMusl()) {
try {
return require('./sync.linux-loong64-musl.node')
} catch (e) {
loadErrors.push(e)
}
try {
const binding = require('@tursodatabase/sync-linux-loong64-musl')
const bindingPackageVersion = require('@tursodatabase/sync-linux-loong64-musl/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
loadErrors.push(e)
}
} else {
try {
return require('./sync.linux-loong64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
const binding = require('@tursodatabase/sync-linux-loong64-gnu')
const bindingPackageVersion = require('@tursodatabase/sync-linux-loong64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -359,8 +393,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-linux-riscv64-musl') const binding = require('@tursodatabase/sync-linux-riscv64-musl')
const bindingPackageVersion = require('@tursodatabase/sync-linux-riscv64-musl/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-linux-riscv64-musl/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -375,8 +409,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-linux-riscv64-gnu') const binding = require('@tursodatabase/sync-linux-riscv64-gnu')
const bindingPackageVersion = require('@tursodatabase/sync-linux-riscv64-gnu/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-linux-riscv64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -392,8 +426,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-linux-ppc64-gnu') const binding = require('@tursodatabase/sync-linux-ppc64-gnu')
const bindingPackageVersion = require('@tursodatabase/sync-linux-ppc64-gnu/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-linux-ppc64-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -408,8 +442,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-linux-s390x-gnu') const binding = require('@tursodatabase/sync-linux-s390x-gnu')
const bindingPackageVersion = require('@tursodatabase/sync-linux-s390x-gnu/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-linux-s390x-gnu/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -428,8 +462,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-openharmony-arm64') const binding = require('@tursodatabase/sync-openharmony-arm64')
const bindingPackageVersion = require('@tursodatabase/sync-openharmony-arm64/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-openharmony-arm64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -444,8 +478,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-openharmony-x64') const binding = require('@tursodatabase/sync-openharmony-x64')
const bindingPackageVersion = require('@tursodatabase/sync-openharmony-x64/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-openharmony-x64/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -460,8 +494,8 @@ function requireNative() {
try { try {
const binding = require('@tursodatabase/sync-openharmony-arm') const binding = require('@tursodatabase/sync-openharmony-arm')
const bindingPackageVersion = require('@tursodatabase/sync-openharmony-arm/package.json').version const bindingPackageVersion = require('@tursodatabase/sync-openharmony-arm/package.json').version
if (bindingPackageVersion !== '0.2.0-pre.8' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') { if (bindingPackageVersion !== '0.2.0-pre.10' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.8 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`) throw new Error(`Native binding package version mismatch, expected 0.2.0-pre.10 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
} }
return binding return binding
} catch (e) { } catch (e) {
@@ -478,22 +512,32 @@ function requireNative() {
nativeBinding = requireNative() nativeBinding = requireNative()
if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) { if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
let wasiBinding = null
let wasiBindingError = null
try { try {
nativeBinding = require('./sync.wasi.cjs') wasiBinding = require('./sync.wasi.cjs')
nativeBinding = wasiBinding
} catch (err) { } catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) { if (process.env.NAPI_RS_FORCE_WASI) {
loadErrors.push(err) wasiBindingError = err
} }
} }
if (!nativeBinding) { if (!nativeBinding) {
try { try {
nativeBinding = require('@tursodatabase/sync-wasm32-wasi') wasiBinding = require('@tursodatabase/sync-wasm32-wasi')
nativeBinding = wasiBinding
} catch (err) { } catch (err) {
if (process.env.NAPI_RS_FORCE_WASI) { if (process.env.NAPI_RS_FORCE_WASI) {
wasiBindingError.cause = err
loadErrors.push(err) loadErrors.push(err)
} }
} }
} }
if (process.env.NAPI_RS_FORCE_WASI === 'error' && !wasiBinding) {
const error = new Error('WASI binding not found and NAPI_RS_FORCE_WASI is set to error')
error.cause = wasiBindingError
throw error
}
} }
if (!nativeBinding) { if (!nativeBinding) {
@@ -502,7 +546,12 @@ if (!nativeBinding) {
`Cannot find native binding. ` + `Cannot find native binding. ` +
`npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` + `npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). ` +
'Please try `npm i` again after removing both package-lock.json and node_modules directory.', 'Please try `npm i` again after removing both package-lock.json and node_modules directory.',
{ cause: loadErrors } {
cause: loadErrors.reduce((err, cur) => {
cur.cause = err
return cur
}),
},
) )
} }
throw new Error(`Failed to load native binding`) throw new Error(`Failed to load native binding`)

View File

@@ -27,7 +27,7 @@ This package is the Turso embedded database library for JavaScript in Browser.
## Installation ## Installation
```bash ```bash
npm install @tursodatabase/database-browser npm install @tursodatabase/database-wasm
``` ```
## Getting Started ## Getting Started
@@ -35,7 +35,7 @@ npm install @tursodatabase/database-browser
### In-Memory Database ### In-Memory Database
```javascript ```javascript
import { connect } from '@tursodatabase/database-browser'; import { connect } from '@tursodatabase/database-wasm';
// Create an in-memory database // Create an in-memory database
const db = await connect(':memory:'); const db = await connect(':memory:');
@@ -60,7 +60,7 @@ console.log(users);
### File-Based Database ### File-Based Database
```javascript ```javascript
import { connect } from '@tursodatabase/database-browser'; import { connect } from '@tursodatabase/database-wasm';
// Create or open a database file // Create or open a database file
const db = await connect('my-database.db'); const db = await connect('my-database.db');
@@ -85,7 +85,7 @@ console.log(`Inserted post with ID: ${result.lastInsertRowid}`);
### Transactions ### Transactions
```javascript ```javascript
import { connect } from '@tursodatabase/database-browser'; import { connect } from '@tursodatabase/database-wasm';
const db = await connect('transactions.db'); const db = await connect('transactions.db');

View File

@@ -1,4 +1,4 @@
import { setupMainThread } from "@tursodatabase/database-browser-common"; import { setupMainThread } from "@tursodatabase/database-wasm-common";
//@ts-ignore //@ts-ignore
import TursoWorker from "./worker.js?worker&inline"; import TursoWorker from "./worker.js?worker&inline";

View File

@@ -1,4 +1,4 @@
import { isWebWorker, setupWebWorker, setupMainThread } from "@tursodatabase/database-browser-common"; import { isWebWorker, setupWebWorker, setupMainThread } from "@tursodatabase/database-wasm-common";
export let MainWorker = null; export let MainWorker = null;

View File

@@ -1,4 +1,4 @@
import { setupMainThread } from "@tursodatabase/database-browser-common"; import { setupMainThread } from "@tursodatabase/database-wasm-common";
import { tursoWasm } from "./wasm-inline.js"; import { tursoWasm } from "./wasm-inline.js";
// Next (turbopack) has issues with loading wasm module: https://github.com/vercel/next.js/issues/82520 // Next (turbopack) has issues with loading wasm module: https://github.com/vercel/next.js/issues/82520
@@ -29,4 +29,4 @@ export const JsProtocolIo = napiModule.exports.JsProtocolIo
export const JsProtocolRequestBytes = napiModule.exports.JsProtocolRequestBytes export const JsProtocolRequestBytes = napiModule.exports.JsProtocolRequestBytes
export const SyncEngine = napiModule.exports.SyncEngine export const SyncEngine = napiModule.exports.SyncEngine
export const DatabaseChangeTypeJs = napiModule.exports.DatabaseChangeTypeJs export const DatabaseChangeTypeJs = napiModule.exports.DatabaseChangeTypeJs
export const SyncEngineProtocolVersion = napiModule.exports.SyncEngineProtocolVersion export const SyncEngineProtocolVersion = napiModule.exports.SyncEngineProtocolVersion

View File

@@ -1,4 +1,4 @@
import { isWebWorker, setupMainThread, setupWebWorker } from "@tursodatabase/database-browser-common"; import { isWebWorker, setupMainThread, setupWebWorker } from "@tursodatabase/database-wasm-common";
import { tursoWasm } from "./wasm-inline.js"; import { tursoWasm } from "./wasm-inline.js";
let napiModule = { let napiModule = {

View File

@@ -1,5 +1,5 @@
{ {
"name": "@tursodatabase/sync-browser", "name": "@tursodatabase/sync-wasm",
"version": "0.2.0-pre.10", "version": "0.2.0-pre.10",
"repository": { "repository": {
"type": "git", "type": "git",
@@ -54,8 +54,8 @@
"#index": "./index.js" "#index": "./index.js"
}, },
"dependencies": { "dependencies": {
"@tursodatabase/database-browser-common": "^0.2.0-pre.10",
"@tursodatabase/database-common": "^0.2.0-pre.10", "@tursodatabase/database-common": "^0.2.0-pre.10",
"@tursodatabase/database-wasm-common": "^0.2.0-pre.10",
"@tursodatabase/sync-common": "^0.2.0-pre.10" "@tursodatabase/sync-common": "^0.2.0-pre.10"
} }
} }

View File

@@ -1,4 +1,4 @@
import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-browser-common" import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-wasm-common"
import { DatabasePromise } from "@tursodatabase/database-common" import { DatabasePromise } from "@tursodatabase/database-common"
import { ProtocolIo, run, DatabaseOpts, EncryptionOpts, RunOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult, DatabaseStats, SyncEngineGuards } from "@tursodatabase/sync-common"; import { ProtocolIo, run, DatabaseOpts, EncryptionOpts, RunOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult, DatabaseStats, SyncEngineGuards } from "@tursodatabase/sync-common";
import { SyncEngine, SyncEngineProtocolVersion, initThreadPool, MainWorker } from "./index-bundle.js"; import { SyncEngine, SyncEngineProtocolVersion, initThreadPool, MainWorker } from "./index-bundle.js";

View File

@@ -1,4 +1,4 @@
import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-browser-common" import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-wasm-common"
import { DatabasePromise } from "@tursodatabase/database-common" import { DatabasePromise } from "@tursodatabase/database-common"
import { ProtocolIo, run, DatabaseOpts, EncryptionOpts, RunOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult, DatabaseStats, SyncEngineGuards } from "@tursodatabase/sync-common"; import { ProtocolIo, run, DatabaseOpts, EncryptionOpts, RunOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult, DatabaseStats, SyncEngineGuards } from "@tursodatabase/sync-common";
import { SyncEngine, SyncEngineProtocolVersion, initThreadPool, MainWorker } from "./index-default.js"; import { SyncEngine, SyncEngineProtocolVersion, initThreadPool, MainWorker } from "./index-default.js";

View File

@@ -1,4 +1,4 @@
import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-browser-common" import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-wasm-common"
import { DatabasePromise } from "@tursodatabase/database-common" import { DatabasePromise } from "@tursodatabase/database-common"
import { ProtocolIo, run, DatabaseOpts, EncryptionOpts, RunOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult, DatabaseStats, SyncEngineGuards } from "@tursodatabase/sync-common"; import { ProtocolIo, run, DatabaseOpts, EncryptionOpts, RunOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult, DatabaseStats, SyncEngineGuards } from "@tursodatabase/sync-common";
import { SyncEngine, SyncEngineProtocolVersion, initThreadPool, MainWorker } from "./index-turbopack-hack.js"; import { SyncEngine, SyncEngineProtocolVersion, initThreadPool, MainWorker } from "./index-turbopack-hack.js";
@@ -158,4 +158,4 @@ async function connect(opts: DatabaseOpts): Promise<Database> {
} }
export { connect, Database } export { connect, Database }
export type { DatabaseOpts, EncryptionOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult } export type { DatabaseOpts, EncryptionOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult }

View File

@@ -1,4 +1,4 @@
import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-browser-common" import { registerFileAtWorker, unregisterFileAtWorker } from "@tursodatabase/database-wasm-common"
import { DatabasePromise } from "@tursodatabase/database-common" import { DatabasePromise } from "@tursodatabase/database-common"
import { ProtocolIo, run, DatabaseOpts, EncryptionOpts, RunOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult, DatabaseStats, SyncEngineGuards } from "@tursodatabase/sync-common"; import { ProtocolIo, run, DatabaseOpts, EncryptionOpts, RunOpts, DatabaseRowMutation, DatabaseRowStatement, DatabaseRowTransformResult, DatabaseStats, SyncEngineGuards } from "@tursodatabase/sync-common";
import { SyncEngine, SyncEngineProtocolVersion, initThreadPool, MainWorker } from "./index-vite-dev-hack.js"; import { SyncEngine, SyncEngineProtocolVersion, initThreadPool, MainWorker } from "./index-vite-dev-hack.js";

View File

@@ -6,7 +6,7 @@ export default defineConfig({
build: { build: {
lib: { lib: {
entry: resolve(__dirname, 'promise-bundle.ts'), entry: resolve(__dirname, 'promise-bundle.ts'),
name: 'sync-browser', name: 'sync-wasm',
fileName: format => `main.${format}.js`, fileName: format => `main.${format}.js`,
formats: ['es'], formats: ['es'],
}, },

View File

@@ -0,0 +1,2 @@
import { setupWebWorker } from "@tursodatabase/database-wasm-common";
setupWebWorker();

View File

@@ -1575,22 +1575,30 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@tursodatabase/database-browser-common@npm:^0.2.0-pre.10, @tursodatabase/database-browser-common@workspace:packages/browser-common": "@tursodatabase/database-common@npm:^0.2.0-pre.10, @tursodatabase/database-common@workspace:packages/common":
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "@tursodatabase/database-browser-common@workspace:packages/browser-common" resolution: "@tursodatabase/database-common@workspace:packages/common"
dependencies:
typescript: "npm:^5.9.2"
languageName: unknown
linkType: soft
"@tursodatabase/database-wasm-common@npm:^0.2.0-pre.10, @tursodatabase/database-wasm-common@workspace:packages/wasm-common":
version: 0.0.0-use.local
resolution: "@tursodatabase/database-wasm-common@workspace:packages/wasm-common"
dependencies: dependencies:
"@napi-rs/wasm-runtime": "npm:^1.0.5" "@napi-rs/wasm-runtime": "npm:^1.0.5"
typescript: "npm:^5.9.2" typescript: "npm:^5.9.2"
languageName: unknown languageName: unknown
linkType: soft linkType: soft
"@tursodatabase/database-browser@workspace:packages/browser": "@tursodatabase/database-wasm@workspace:packages/wasm":
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "@tursodatabase/database-browser@workspace:packages/browser" resolution: "@tursodatabase/database-wasm@workspace:packages/wasm"
dependencies: dependencies:
"@napi-rs/cli": "npm:^3.1.5" "@napi-rs/cli": "npm:^3.1.5"
"@tursodatabase/database-browser-common": "npm:^0.2.0-pre.10"
"@tursodatabase/database-common": "npm:^0.2.0-pre.10" "@tursodatabase/database-common": "npm:^0.2.0-pre.10"
"@tursodatabase/database-wasm-common": "npm:^0.2.0-pre.10"
"@vitest/browser": "npm:^3.2.4" "@vitest/browser": "npm:^3.2.4"
playwright: "npm:^1.55.0" playwright: "npm:^1.55.0"
typescript: "npm:^5.9.2" typescript: "npm:^5.9.2"
@@ -1599,14 +1607,6 @@ __metadata:
languageName: unknown languageName: unknown
linkType: soft linkType: soft
"@tursodatabase/database-common@npm:^0.2.0-pre.10, @tursodatabase/database-common@workspace:packages/common":
version: 0.0.0-use.local
resolution: "@tursodatabase/database-common@workspace:packages/common"
dependencies:
typescript: "npm:^5.9.2"
languageName: unknown
linkType: soft
"@tursodatabase/database@workspace:packages/native": "@tursodatabase/database@workspace:packages/native":
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "@tursodatabase/database@workspace:packages/native" resolution: "@tursodatabase/database@workspace:packages/native"
@@ -1622,22 +1622,6 @@ __metadata:
languageName: unknown languageName: unknown
linkType: soft linkType: soft
"@tursodatabase/sync-browser@workspace:sync/packages/browser":
version: 0.0.0-use.local
resolution: "@tursodatabase/sync-browser@workspace:sync/packages/browser"
dependencies:
"@napi-rs/cli": "npm:^3.1.5"
"@tursodatabase/database-browser-common": "npm:^0.2.0-pre.10"
"@tursodatabase/database-common": "npm:^0.2.0-pre.10"
"@tursodatabase/sync-common": "npm:^0.2.0-pre.10"
"@vitest/browser": "npm:^3.2.4"
playwright: "npm:^1.55.0"
typescript: "npm:^5.9.2"
vite: "npm:^7.1.5"
vitest: "npm:^3.2.4"
languageName: unknown
linkType: soft
"@tursodatabase/sync-common@npm:^0.2.0-pre.10, @tursodatabase/sync-common@workspace:sync/packages/common": "@tursodatabase/sync-common@npm:^0.2.0-pre.10, @tursodatabase/sync-common@workspace:sync/packages/common":
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "@tursodatabase/sync-common@workspace:sync/packages/common" resolution: "@tursodatabase/sync-common@workspace:sync/packages/common"
@@ -1647,6 +1631,22 @@ __metadata:
languageName: unknown languageName: unknown
linkType: soft linkType: soft
"@tursodatabase/sync-wasm@workspace:sync/packages/wasm":
version: 0.0.0-use.local
resolution: "@tursodatabase/sync-wasm@workspace:sync/packages/wasm"
dependencies:
"@napi-rs/cli": "npm:^3.1.5"
"@tursodatabase/database-common": "npm:^0.2.0-pre.10"
"@tursodatabase/database-wasm-common": "npm:^0.2.0-pre.10"
"@tursodatabase/sync-common": "npm:^0.2.0-pre.10"
"@vitest/browser": "npm:^3.2.4"
playwright: "npm:^1.55.0"
typescript: "npm:^5.9.2"
vite: "npm:^7.1.5"
vitest: "npm:^3.2.4"
languageName: unknown
linkType: soft
"@tursodatabase/sync@workspace:sync/packages/native": "@tursodatabase/sync@workspace:sync/packages/native":
version: 0.0.0-use.local version: 0.0.0-use.local
resolution: "@tursodatabase/sync@workspace:sync/packages/native" resolution: "@tursodatabase/sync@workspace:sync/packages/native"

View File

@@ -19,16 +19,16 @@ NPM_PACKAGES = [
"bindings/javascript", "bindings/javascript",
"bindings/javascript/packages/common", "bindings/javascript/packages/common",
"bindings/javascript/packages/native", "bindings/javascript/packages/native",
"bindings/javascript/packages/browser", "bindings/javascript/packages/wasm",
"bindings/javascript/packages/browser-common", "bindings/javascript/packages/wasm-common",
"bindings/javascript/sync/packages/common", "bindings/javascript/sync/packages/common",
"bindings/javascript/sync/packages/native", "bindings/javascript/sync/packages/native",
"bindings/javascript/sync/packages/browser", "bindings/javascript/sync/packages/wasm",
] ]
NPM_WORKSPACE_PACKAGES = [ NPM_WORKSPACE_PACKAGES = [
"@tursodatabase/database-common", "@tursodatabase/database-common",
"@tursodatabase/database-browser-common", "@tursodatabase/database-wasm-common",
"@tursodatabase/sync-common", "@tursodatabase/sync-common",
] ]