Skip to content

Commit

Permalink
Fix browser build (#59)
Browse files Browse the repository at this point in the history
release 0.0.1-dev.0
  • Loading branch information
jordy25519 authored Jun 22, 2020
1 parent 357073a commit 1d07c84
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
13 changes: 7 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ commands:
- run:
name: Js install + Build
command: |
# install npm + yarn + wasm-pack
sudo apt install npm
# install
# node
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs
# yarn
curl -o- -L https://yarnpkg.com/install.sh | bash
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
# wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# build
# buidl
cd js && yarn build
test-js:
steps:
Expand Down Expand Up @@ -66,9 +70,6 @@ jobs:
command: |
echo "//registry.npmjs.org/:_authToken=${NPM_KEY}" > ~/.npmrc
cd js
# node vs npm versions are funny
npm uninstall -g npm
npm pack
npm publish --access public --tag next
test:
docker:
Expand Down
7 changes: 4 additions & 3 deletions js/build.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# compile the rust codebase
#!/bin/bash
set -ex
echo "building js pkg for $1 out to: $2"
wasm-pack build \
--target $1 \
Expand All @@ -9,5 +10,5 @@ wasm-pack build \

# Remove wasm-pack generated files
# They are unintentionally excluding required files when `npm pack` is run
rm -rf $2/{package.json,README.md,.gitignore,LICENSE}

cd $2
rm package.json README.md .gitignore LICENSE
2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cennznet/cennznut-wasm",
"version": "0.0.1-dev.2",
"version": "0.0.1-dev.0",
"description": "Wasm Cennznut codec",
"main": "libNode/cennznut.js",
"browser": "libBrowser/cennznut.js",
Expand Down

0 comments on commit 1d07c84

Please sign in to comment.