From 16a8496bfb62d78c9692a44515f63e73248e7aab Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Fri, 4 Oct 2024 17:04:39 +0200 Subject: [PATCH] Publish node compatible sdk (#1115) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## 🎟ī¸ Tracking ## 📔 Objective ## ⏰ Reminders before review - Contributor guidelines followed - All formatters and local linters executed and passed - Written new unit and / or integration tests where applicable - Protected functional changes with optionality (feature flags) - Used internationalization (i18n) for all UI strings - CI builds passed - Communicated to DevOps any deployment requirements - Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team ## đŸĻŽ Reviewer guidelines - 👍 (`:+1:`) or similar for great changes - 📝 (`:memo:`) or ℹī¸ (`:information_source:`) for notes or general info - ❓ (`:question:`) for questions - 🤔 (`:thinking:`) or 💭 (`:thought_balloon:`) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion - 🎨 (`:art:`) for suggestions / improvements - ❌ (`:x:`) or ⚠ī¸ (`:warning:`) for more significant problems or concerns needing attention - 🌱 (`:seedling:`) or â™ģī¸ (`:recycle:`) for future improvements or indications of technical debt - ⛏ (`:pick:`) for minor or nitpick changes --- crates/bitwarden-wasm-internal/build.sh | 2 ++ languages/js/sdk-internal/package.json | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/bitwarden-wasm-internal/build.sh b/crates/bitwarden-wasm-internal/build.sh index b02ee1ea1..109037e89 100755 --- a/crates/bitwarden-wasm-internal/build.sh +++ b/crates/bitwarden-wasm-internal/build.sh @@ -6,10 +6,12 @@ if [ "$1" != "-r" ]; then # Dev cargo build -p bitwarden-wasm-internal --target wasm32-unknown-unknown wasm-bindgen --target bundler --out-dir languages/js/sdk-internal ./target/wasm32-unknown-unknown/debug/bitwarden_wasm_internal.wasm + wasm-bindgen --target nodejs --out-dir languages/js/sdk-internal/node ./target/wasm32-unknown-unknown/debug/bitwarden_wasm_internal.wasm else # Release cargo build -p bitwarden-wasm-internal --target wasm32-unknown-unknown --release wasm-bindgen --target bundler --out-dir languages/js/sdk-internal ./target/wasm32-unknown-unknown/release/bitwarden_wasm_internal.wasm + wasm-bindgen --target nodejs --out-dir languages/js/sdk-internal/node ./target/wasm32-unknown-unknown/release/bitwarden_wasm_internal.wasm fi # Format diff --git a/languages/js/sdk-internal/package.json b/languages/js/sdk-internal/package.json index 51cfa577c..29e5c5a54 100644 --- a/languages/js/sdk-internal/package.json +++ b/languages/js/sdk-internal/package.json @@ -9,8 +9,13 @@ "bitwarden_wasm_internal_bg.wasm.js", "bitwarden_wasm_internal.d.ts", "bitwarden_wasm_internal.js", - "index.js" + "index.js", + "node/bitwarden_wasm_internal_bg.wasm", + "node/bitwarden_wasm_internal_bg.wasm.d.ts", + "node/bitwarden_wasm_internal.d.ts", + "node/bitwarden_wasm_internal.js" ], + "main": "node/bitwarden_wasm_internal.js", "module": "index.js", "types": "bitwarden_wasm_internal.d.ts", "scripts": {},