Skip to content

Commit 1e47d0a

Browse files
alexjgexpede
andauthored
Bump wasm-bodge to 0.2.1 (#73)
* Bump wasm-bodge to 0.2.1 This release of wasm-bodge correctly handles scoped package names, which means we no longer need the workarounds we had in place. * Run `bodge:all` * Updates automerge_subduction_wasm package name --------- Co-authored-by: Brooklyn Zelenka <hello@brooklynzelenka.com>
1 parent ac925a9 commit 1e47d0a

File tree

6 files changed

+7
-29
lines changed

6 files changed

+7
-29
lines changed

automerge_sedimentree_wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"import": "./dist/esm/slim.js",
6666
"require": "./dist/cjs/slim.cjs"
6767
},
68-
"./wasm": "./dist/@automerge/automerge-sedimentree.wasm",
68+
"./wasm": "./dist/automerge-sedimentree.wasm",
6969
"./wasm-base64": {
7070
"import": "./dist/esm/wasm-base64.js",
7171
"require": "./dist/cjs/wasm-base64.cjs"

automerge_subduction_wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
"import": "./dist/esm/slim.js",
6666
"require": "./dist/cjs/slim.cjs"
6767
},
68-
"./wasm": "./dist/@automerge/automerge-subduction.wasm",
68+
"./wasm": "./dist/automerge-subduction.wasm",
6969
"./wasm-base64": {
7070
"import": "./dist/esm/wasm-base64.js",
7171
"require": "./dist/cjs/wasm-base64.cjs"

flake.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,14 @@
9292

9393
wasm-bodge = wasm-bodge-rustPlatform.buildRustPackage rec {
9494
pname = "wasm-bodge";
95-
version = "0.2.0";
95+
version = "0.2.1";
9696
src = pkgs.fetchFromGitHub {
9797
owner = "alexjg";
9898
repo = "wasm-bodge";
9999
rev = "v${version}";
100-
hash = "sha256-yuCaOiGRHluZdYMG1U8A7eWF7eFOavldd+objwekB9E=";
100+
hash = "sha256-dUlcAmhX1b87cvzv0+fLjVy+vnWR48FwjjrePl0KMfc=";
101101
};
102-
cargoHash = "sha256-UOi8yE+hftKHMU/C/UCt3kfUNzQFDWE9VQ0dc7mDw5M=";
102+
cargoHash = "sha256-CHZ5gzn1PczucqahQi+k9QjVdrTweK1TqNSrDXMRYUE=";
103103
nativeBuildInputs = [ unstable.cargo-auditable ];
104104
doCheck = false; # tests require npm/puppeteer infrastructure
105105
};

nix/commands.nix

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -482,24 +482,9 @@
482482
"bodge:all" = cmd "Build all wasm packages with wasm-bodge" ''
483483
set -e
484484
485-
# Workaround: wasm-bodge doesn't mkdir parents for scoped package names
486-
# (e.g. dist/@automerge/ for @automerge/subduction.wasm).
487-
# Pre-create the scope directory so the .wasm copy succeeds.
488-
ensure_scope_dir() {
489-
local pkg_json="$1"
490-
local out_dir="$2"
491-
local pkg_name
492-
pkg_name=$(${pkgs.jq}/bin/jq -r '.name' "$pkg_json")
493-
if [[ "$pkg_name" == @*/* ]]; then
494-
local scope="''${pkg_name%%/*}"
495-
mkdir -p "$out_dir/$scope"
496-
fi
497-
}
498-
499485
for crate in sedimentree_wasm subduction_wasm automerge_sedimentree_wasm automerge_subduction_wasm; do
500486
echo "===> wasm-bodge build $crate..."
501487
rm -rf "$WORKSPACE_ROOT/$crate/dist"
502-
ensure_scope_dir "$WORKSPACE_ROOT/$crate/package.json" "$WORKSPACE_ROOT/$crate/dist"
503488
${wasm-bodge-bin} build \
504489
--crate-path "$WORKSPACE_ROOT/$crate" \
505490
--package-json "$WORKSPACE_ROOT/$crate/package.json" \
@@ -535,13 +520,6 @@
535520
536521
rm -rf "$WORKSPACE_ROOT/$CRATE/dist"
537522
538-
# Workaround: wasm-bodge doesn't mkdir parents for scoped package names
539-
PKG_NAME=$(${pkgs.jq}/bin/jq -r '.name' "$WORKSPACE_ROOT/$CRATE/package.json")
540-
if [[ "$PKG_NAME" == @*/* ]]; then
541-
SCOPE="''${PKG_NAME%%/*}"
542-
mkdir -p "$WORKSPACE_ROOT/$CRATE/dist/$SCOPE"
543-
fi
544-
545523
echo "===> wasm-bodge build $CRATE..."
546524
${wasm-bodge-bin} build \
547525
--crate-path "$WORKSPACE_ROOT/$CRATE" \

sedimentree_wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"import": "./dist/esm/slim.js",
6565
"require": "./dist/cjs/slim.cjs"
6666
},
67-
"./wasm": "./dist/@automerge/sedimentree.wasm",
67+
"./wasm": "./dist/sedimentree.wasm",
6868
"./wasm-base64": {
6969
"import": "./dist/esm/wasm-base64.js",
7070
"require": "./dist/cjs/wasm-base64.cjs"

subduction_wasm/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"import": "./dist/esm/slim.js",
6969
"require": "./dist/cjs/slim.cjs"
7070
},
71-
"./wasm": "./dist/@automerge/subduction.wasm",
71+
"./wasm": "./dist/subduction.wasm",
7272
"./wasm-base64": {
7373
"import": "./dist/esm/wasm-base64.js",
7474
"require": "./dist/cjs/wasm-base64.cjs"

0 commit comments

Comments
 (0)