Skip to content

Commit

Permalink
add wallet-js bundler target
Browse files Browse the repository at this point in the history
add a temporal? patch for the fact that wasm-pack is not including the
'_bg.js' file in the package.json
  • Loading branch information
ecioppettini committed Oct 13, 2020
1 parent c680620 commit daec5ca
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
strategy:
fail-fast: false
matrix:
target: [nodejs, web]
target: [nodejs, web, bundler]
steps:
- name: Checkout sources
uses: actions/checkout@v2
Expand All @@ -139,6 +139,11 @@ jobs:
- name: build
run: wasm-pack build --release --target ${{ matrix.target }} bindings/wallet-js

# FIXME: this shouldn't be necessary, investigate further
- name: patch package.json missing file
working-directory: ./bindings/wallet-js
run: sh patch-packaging.sh

- name: pack
run: wasm-pack pack bindings/wallet-js

Expand Down
9 changes: 9 additions & 0 deletions bindings/wallet-js/patch-packaging.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh

## FIXME: Technical debt, find the real issue in wasm-pack.
## For some reason this file is missing from the 'files' entry in package.json,
## causing the file not to be included in the build, which at least fails for
## the bundle target.

cat pkg/package.json | jq '.files |= (.+ ["wallet_js_bg.js"] | unique)' > tmp.json
mv tmp.json pkg/package.json

0 comments on commit daec5ca

Please sign in to comment.