introduce package.json for separate *-browser package (both database and sync)

This commit is contained in:
Nikita Sivukhin
2025-09-03 17:12:34 +04:00
parent 1de647758f
commit 40dd9be201
8 changed files with 178 additions and 4 deletions

View File

@@ -134,3 +134,5 @@ Cargo.lock
*-draft
*-synced
*-info
package.native.json

25
sync/javascript/Makefile Normal file
View File

@@ -0,0 +1,25 @@
pack-native:
npm publish --dry-run
npm pack
pack-browser:
cp package.json package.native.json
cp package.browser.json package.json
npm publish --dry-run
npm pack
cp package.native.json package.json
publish-native:
npm publish --access public
publish-browser:
cp package.json package.native.json
cp package.browser.json package.json
npm publish --access public
cp package.native.json package.json
publish-native-next:
npm publish --tag next --access public
publish-browser-next:
cp package.json package.native.json
cp package.browser.json package.json
npm publish --tag next --access public
cp package.native.json package.json

View File

@@ -0,0 +1,57 @@
{
"name": "@tursodatabase/sync-browser",
"version": "0.1.5-pre.2",
"repository": {
"type": "git",
"url": "https://github.com/tursodatabase/turso"
},
"description": "Sync engine for the Turso database library specifically for browser/web environment",
"module": "./dist/sync_engine.js",
"main": "./dist/sync_engine.js",
"type": "module",
"exports": "./dist/sync_engine.js",
"files": [
"browser.js",
"dist/**"
],
"types": "./dist/sync_engine.d.ts",
"napi": {
"binaryName": "turso-sync-js",
"targets": [
"wasm32-wasip1-threads"
]
},
"license": "MIT",
"devDependencies": {
"@napi-rs/cli": "^3.0.4",
"@napi-rs/wasm-runtime": "^1.0.1",
"@types/node": "^24.2.0",
"ava": "^6.0.1",
"typescript": "^5.9.2"
},
"ava": {
"timeout": "3m"
},
"engines": {
"node": ">= 10"
},
"scripts": {
"artifacts": "napi artifacts",
"build": "npm exec tsc && napi build --platform --release --esm",
"build:debug": "npm exec tsc && napi build --platform",
"prepublishOnly": "npm exec tsc && napi prepublish -t npm",
"test": "true",
"universal": "napi universalize",
"version": "napi version"
},
"packageManager": "yarn@4.9.2",
"imports": {
"#entry-point": {
"types": "./index.d.ts",
"browser": "./browser.js"
}
},
"dependencies": {
"@tursodatabase/database": "~0.1.4-pre.5"
}
}