Build updates (#5)

* Build script updates

* Add @babel/core (peerdep)
This commit is contained in:
Jaco Greeff
2019-03-20 13:14:46 +01:00
committed by GitHub
parent e46602fd62
commit dde6a2f7af
9 changed files with 34 additions and 24 deletions
+2 -1
View File
@@ -10,7 +10,7 @@
],
"resolutions": {
"babel-core": "^7.0.0-bridge.0",
"typescript": "^3.3.3333"
"typescript": "^3.3.4000"
},
"scripts": {
"build": "./scripts/build.sh",
@@ -20,6 +20,7 @@
"test": "echo \"Tests included in build\""
},
"devDependencies": {
"@babel/core": "^7.4.0",
"@polkadot/dev": "^0.28.0-beta.0",
"@polkadot/util": "^0.39.0-beta.0"
}
@@ -2,9 +2,6 @@
set -e
echo "*** Building package"
../../scripts/build-package.sh
# shortcuts for files
echo "*** Adjusting output"
SRC=build/wasm.js
@@ -18,7 +15,7 @@ sed -i -e 's/const TextEncoder = require('\''util'\'')\.TextEncoder;/const { str
sed -i -e 's/let cachedTextEncoder = new /\/\/ let cachedTextEncoder = new /g' $SRC
sed -i -e 's/cachedTextEncoder\.encode/stringToU8a/g' $SRC
echo "*** Testing package"
cargo test -- --nocapture
node ./test/wasm.js
yarn jest ./test/jest.spec.js
# this creates issues in both the browser and RN (@polkadot/util has a polyfill)
sed -i -e 's/const TextDecoder = require('\''util'\'')\.TextDecoder;/const { u8aToString } = require('\''@polkadot\/util'\'');/g' $SRC
sed -i -e 's/let cachedTextDecoder = new /\/\/ let cachedTextDecoder = new /g' $SRC
sed -i -e 's/cachedTextDecoder\.decode/u8aToString/g' $SRC
+1 -4
View File
@@ -1,5 +1,6 @@
{
"name": "@polkadot/wasm-crypto",
"version": "0.2.0-beta.3",
"author": "Jaco Greeff <jacogr@gmail.com>",
"files": [
"crypto-polyfill.js",
@@ -12,10 +13,6 @@
],
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"build": "./build.sh"
},
"version": "0.2.0-beta.3",
"peerDependencies": {
"@polkadot/util": "*"
},
@@ -19,6 +19,4 @@ sed -i -e 's/let cachedTextDecoder = new /\/\/ let cachedTextDecoder = new /g' $
sed -i -e 's/cachedTextDecoder\.decode/u8aToString/g' $SRC
echo "*** Testing package"
cargo test -- --nocapture
node ./test/wasm.js
yarn jest ./test/jest.spec.js
../../scripts/test-package.sh
+1 -4
View File
@@ -1,5 +1,6 @@
{
"name": "@polkadot/wasm-schnorrkel",
"version": "0.2.0-beta.3",
"collaborators": [
"Jaco Greeff <jacogr@gmail.com>",
"kianenigma <Kian.peymani@gmail.com>"
@@ -15,10 +16,6 @@
],
"main": "index.js",
"types": "index.d.ts",
"scripts": {
"build": "./build.sh"
},
"version": "0.2.0-beta.3",
"peerDependencies": {
"@polkadot/util": "*"
},
+2
View File
@@ -2,6 +2,8 @@
set -e
echo "*** Building package"
# cleanup old
echo "*** Cleaning old builds"
rm -rf ./build ./pkg
+5 -1
View File
@@ -14,10 +14,14 @@ for PKG in "${PACKAGES[@]}"; do
echo "*** Building $PKG"
cd $PKG
./build.sh
../../scripts/build-package.sh
./adjust.sh
rm -rf build/*-e build/package.json build/README.md
ls -al build
../../scripts/test-package.sh
cd ..
fi
done
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -e
echo "*** Testing package"
echo "*** Testing Rust"
cargo test -- --nocapture
echo "*** Testing WASM"
node ./test/wasm.js
echo "*** Testing via Jest"
yarn jest ./test/jest.spec.js
+4 -4
View File
@@ -10996,10 +10996,10 @@ typedoc@^0.14.2:
typedoc-default-themes "^0.5.0"
typescript "3.2.x"
typescript@3.2.x, typescript@^3.3.3333, typescript@^3.3.4000:
version "3.3.3333"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3333.tgz#171b2c5af66c59e9431199117a3bcadc66fdcfd6"
integrity sha512-JjSKsAfuHBE/fB2oZ8NxtRTk5iGcg6hkYXMnZ3Wc+b2RSqejEqTaem11mHASMnFilHrax3sLK0GDzcJrekZYLw==
typescript@3.2.x, typescript@^3.3.4000:
version "3.3.4000"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.4000.tgz#76b0f89cfdbf97827e1112d64f283f1151d6adf0"
integrity sha512-jjOcCZvpkl2+z7JFn0yBOoLQyLoIkNZAs/fYJkUG6VKy6zLPHJGfQJYFHzibB6GJaF/8QrcECtlQ5cpvRHSMEA==
uc.micro@^1.0.1, uc.micro@^1.0.5:
version "1.0.6"