bindings/javascript: Add optional dependencies

This commit is contained in:
Pekka Enberg
2025-07-29 12:12:55 +03:00
parent 532a014557
commit 9d7a77efde
2 changed files with 13 additions and 1 deletions

View File

@@ -45,5 +45,11 @@
"universal": "napi universalize", "universal": "napi universalize",
"version": "napi version" "version": "napi version"
}, },
"packageManager": "yarn@4.9.2" "packageManager": "yarn@4.9.2",
"optionalDependencies": {
"@tursodatabase/turso-linux-x64-gnu": "0.1.3-pre.9",
"@tursodatabase/turso-win32-x64-msvc": "0.1.3-pre.9",
"@tursodatabase/turso-darwin-universal": "0.1.3-pre.9",
"@tursodatabase/turso-wasm32-wasi": "0.1.3-pre.9"
}
} }

View File

@@ -79,6 +79,12 @@ def update_package_json(dir_path, new_version): # noqa: C901
# Update version regardless of current value # Update version regardless of current value
package_data["version"] = new_version package_data["version"] = new_version
# Update optionalDependencies if they exist
if "optionalDependencies" in package_data:
for dep_name in package_data["optionalDependencies"]:
if dep_name.startswith("@tursodatabase/turso-"):
package_data["optionalDependencies"][dep_name] = new_version
# Write updated package.json # Write updated package.json
with open(package_path, "w") as f: with open(package_path, "w") as f:
json.dump(package_data, f, indent=2) json.dump(package_data, f, indent=2)