mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 03:54:21 +01:00
Merge 'introduce package.json for separate *-browser package (both database and sync)' from Nikita Sivukhin
This PR introduces separate `package.browser.json` file for `*-browser` npm packages (`@tursodatabase/sync-browser` and `@tursodatabase/database-browser`). The packages are nearly identical and the only change is `package.json` content (browser package mentions only WASM optional dependency which shouldn't confuse NPM and force it to download WASM dep package instead of native one). Due to that, innocent "hack" is implemented which swap `package.json` with `package.browser.json` before publish of `browser` package. Closes #2906
This commit is contained in:
2
sync/javascript/.gitignore
vendored
2
sync/javascript/.gitignore
vendored
@@ -134,3 +134,5 @@ Cargo.lock
|
||||
*-draft
|
||||
*-synced
|
||||
*-info
|
||||
|
||||
package.native.json
|
||||
|
||||
20
sync/javascript/Makefile
Normal file
20
sync/javascript/Makefile
Normal file
@@ -0,0 +1,20 @@
|
||||
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
|
||||
57
sync/javascript/package.browser.json
Normal file
57
sync/javascript/package.browser.json
Normal 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 --skip-optional-publish",
|
||||
"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"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user