Merge branch 'master' into fix_logger

This commit is contained in:
debris 2017-11-24 12:55:33 +01:00
commit 9f10fa3c3d
15 changed files with 4922 additions and 1262 deletions

12
Cargo.lock generated
View File

@ -2200,8 +2200,8 @@ version = "1.9.0"
dependencies = [ dependencies = [
"parity-ui-dev 1.9.0", "parity-ui-dev 1.9.0",
"parity-ui-old-dev 1.9.0", "parity-ui-old-dev 1.9.0",
"parity-ui-old-precompiled 1.9.0 (git+https://github.com/paritytech/js-precompiled.git?branch=v1)", "parity-ui-old-precompiled 1.9.0 (git+https://github.com/js-dist-paritytech/parity-master-1-9-v1.git)",
"parity-ui-precompiled 1.9.0 (git+https://github.com/paritytech/js-precompiled.git)", "parity-ui-precompiled 1.9.0 (git+https://github.com/js-dist-paritytech/parity-master-1-9-shell.git)",
"rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -2222,7 +2222,7 @@ dependencies = [
[[package]] [[package]]
name = "parity-ui-old-precompiled" name = "parity-ui-old-precompiled"
version = "1.9.0" version = "1.9.0"
source = "git+https://github.com/paritytech/js-precompiled.git?branch=v1#acfb0974cbbdacf12463bf40e51ea8b60939be95" source = "git+https://github.com/js-dist-paritytech/parity-master-1-9-v1.git#78f0af2479807e209d72e25e9826c8b31285eba1"
dependencies = [ dependencies = [
"parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -2230,7 +2230,7 @@ dependencies = [
[[package]] [[package]]
name = "parity-ui-precompiled" name = "parity-ui-precompiled"
version = "1.9.0" version = "1.9.0"
source = "git+https://github.com/paritytech/js-precompiled.git#9b9f760d25aa28504177742f629bf6c639ff5062" source = "git+https://github.com/js-dist-paritytech/parity-master-1-9-shell.git#8de0d074b982b04adff50d4814c063225fbb2809"
dependencies = [ dependencies = [
"parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)", "parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
] ]
@ -3651,8 +3651,8 @@ dependencies = [
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
"checksum parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "261c025c67ba416e9fe63aa9b3236520ce3c74cfbe43590c9cdcec4ccc8180e4" "checksum parity-dapps-glue 1.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "261c025c67ba416e9fe63aa9b3236520ce3c74cfbe43590c9cdcec4ccc8180e4"
"checksum parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc)" = "<none>" "checksum parity-tokio-ipc 0.1.5 (git+https://github.com/nikvolf/parity-tokio-ipc)" = "<none>"
"checksum parity-ui-old-precompiled 1.9.0 (git+https://github.com/paritytech/js-precompiled.git?branch=v1)" = "<none>" "checksum parity-ui-old-precompiled 1.9.0 (git+https://github.com/js-dist-paritytech/parity-master-1-9-v1.git)" = "<none>"
"checksum parity-ui-precompiled 1.9.0 (git+https://github.com/paritytech/js-precompiled.git)" = "<none>" "checksum parity-ui-precompiled 1.9.0 (git+https://github.com/js-dist-paritytech/parity-master-1-9-shell.git)" = "<none>"
"checksum parity-wasm 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8431a184ad88cfbcd71a792aaca319cc7203a94300c26b8dce2d0df0681ea87d" "checksum parity-wasm 0.15.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8431a184ad88cfbcd71a792aaca319cc7203a94300c26b8dce2d0df0681ea87d"
"checksum parity-wordlist 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "81451bfab101d186f8fc4a0aa13cb5539b31b02c4ed96425a0842e2a413daba6" "checksum parity-wordlist 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "81451bfab101d186f8fc4a0aa13cb5539b31b02c4ed96425a0842e2a413daba6"
"checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e" "checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e"

View File

@ -306,7 +306,7 @@ mod tests {
version: "".into(), version: "".into(),
author: "".into(), author: "".into(),
icon_url: "".into(), icon_url: "".into(),
local_url: "".into(), local_url: Some("".into()),
}, Default::default(), None); }, Default::default(), None);
// when // when

View File

@ -180,14 +180,15 @@ fn should_return_fetched_dapp_content() {
assert_security_headers_for_embed(&response2.headers); assert_security_headers_for_embed(&response2.headers);
assert_eq!( assert_eq!(
response2.body, response2.body,
r#"BE r#"D2
{ {
"id": "9c94e154dab8acf859b30ee80fc828fb1d38359d938751b65db71d460588d82a", "id": "9c94e154dab8acf859b30ee80fc828fb1d38359d938751b65db71d460588d82a",
"name": "Gavcoin", "name": "Gavcoin",
"description": "Gavcoin", "description": "Gavcoin",
"version": "1.0.0", "version": "1.0.0",
"author": "", "author": "",
"iconUrl": "icon.png" "iconUrl": "icon.png",
"localUrl": null
} }
0 0

View File

@ -13,8 +13,8 @@ rustc_version = "0.1"
parity-ui-dev = { path = "../../js", optional = true } parity-ui-dev = { path = "../../js", optional = true }
parity-ui-old-dev = { path = "../../js-old", optional = true } parity-ui-old-dev = { path = "../../js-old", optional = true }
# This is managed by the js/scripts/release.sh script on CI - keep it in a single line # This is managed by the js/scripts/release.sh script on CI - keep it in a single line
parity-ui-old-precompiled = { git = "https://github.com/paritytech/js-precompiled.git", optional = true, branch = "v1" } parity-ui-old-precompiled = { git = "https://github.com/js-dist-paritytech/parity-master-1-9-v1.git", optional = true }
parity-ui-precompiled = { git = "https://github.com/paritytech/js-precompiled.git", optional = true, branch = "master" } parity-ui-precompiled = { git = "https://github.com/js-dist-paritytech/parity-master-1-9-shell.git", optional = true }
[features] [features]
no-precompiled-js = ["parity-ui-dev", "parity-ui-old-dev"] no-precompiled-js = ["parity-ui-dev", "parity-ui-old-dev"]

View File

@ -2,51 +2,39 @@
set -e set -e
# variables # variables
PVER="1-9"
PTYPE="v1"
UTCDATE=`date -u "+%Y%m%d-%H%M%S"` UTCDATE=`date -u "+%Y%m%d-%H%M%S"`
PRECOMPILED_BRANCH="v1" PRE_REPO="js-dist-paritytech/parity-${CI_BUILD_REF_NAME}-${PVER}-${PTYPE}.git"
GIT_JS_PRECOMPILED="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/js-precompiled.git" PRE_REPO_TOKEN="https://${GITHUB_JS_PRECOMPILED}:@github.com/${PRE_REPO}"
BASEDIR=`dirname $0` BASEDIR=`dirname $0`
GITLOG=./.git/.git-release.log
# setup the git user defaults for the current repo pushd $BASEDIR/..
function setup_git_user {
git config push.default simple
git config merge.ours.driver true
git config user.email "$GITHUB_EMAIL"
git config user.name "GitLab Build Bot"
}
# change into the build directory echo "*** [$PRE_REPO] Cloning repo"
pushd $BASEDIR rm -rf precompiled
cd ../.dist git clone https://github.com/$PRE_REPO precompiled
cd precompiled
git config push.default simple
git config merge.ours.driver true
git config user.email "$GITHUB_EMAIL"
git config user.name "GitLab Build Bot"
git remote set-url origin $PRE_REPO_TOKEN > /dev/null 2>&1
# add local files and send it up echo "*** [$PRE_REPO] Copying build"
echo "*** [v1 precompiled] Setting up GitHub config for js-precompiled"
rm -rf ./.git
git init
setup_git_user
echo "*** [v1 precompiled] Checking out $PRECOMPILED_BRANCH branch"
git remote add origin $GIT_JS_PRECOMPILED
git fetch origin 2>$GITLOG
git checkout -b $PRECOMPILED_BRANCH
echo "*** [v1 precompiled] Committing compiled files for $UTCDATE"
mv build ../build.new
git add .
git commit -m "$UTCDATE [update]"
git merge origin/$PRECOMPILED_BRANCH -X ours --commit -m "$UTCDATE [merge]"
git rm -r build
rm -rf build rm -rf build
git commit -m "$UTCDATE [cleanup]" cp -rf ../.dist/build .
mv ../build.new build
echo "*** [$PRE_REPO] Adding to git"
echo "$UTCDATE" >README.md
git add . git add .
git commit -m "$UTCDATE [release]" git commit -m "$UTCDATE"
echo "*** [v1 precompiled] Merging remote" echo "*** [$PRE_REPO] Pushing upstream"
git push origin HEAD:refs/heads/$PRECOMPILED_BRANCH 2>$GITLOG git push --quiet origin HEAD:refs/heads/master > /dev/null 2>&1
# move to root cd ..
rm -rf precompiled
popd popd
# exit with exit code # exit with exit code

View File

@ -1 +1 @@
// test script 14 // test script 16

5969
js/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -44,6 +44,19 @@
"test:coverage": "cross-env NODE_ENV=test istanbul cover _mocha -- --compilers ejs:ejsify 'src/**/*.spec.js'" "test:coverage": "cross-env NODE_ENV=test istanbul cover _mocha -- --compilers ejs:ejsify 'src/**/*.spec.js'"
}, },
"devDependencies": { "devDependencies": {
"@parity/dapp-console": "paritytech/dapp-console",
"@parity/dapp-dapp-accounts": "paritytech/dapp-dapp-accounts",
"@parity/dapp-dapp-methods": "js-dist-paritytech/dapp-dapp-methods",
"@parity/dapp-dapp-visible": "paritytech/dapp-dapp-visible",
"@parity/dapp-dappreg": "paritytech/dapp-dappreg",
"@parity/dapp-githubhint": "paritytech/dapp-githubhint",
"@parity/dapp-localtx": "paritytech/dapp-localtx",
"@parity/dapp-registry": "paritytech/dapp-registry",
"@parity/dapp-signaturereg": "paritytech/dapp-signaturereg",
"@parity/dapp-tokendeploy": "paritytech/dapp-tokendeploy",
"@parity/dapp-tokenreg": "paritytech/dapp-tokenreg",
"@parity/dapp-vaults": "paritytech/dapp-vaults",
"@parity/dapp-web": "paritytech/dapp-web",
"babel-cli": "6.26.0", "babel-cli": "6.26.0",
"babel-core": "6.26.0", "babel-core": "6.26.0",
"babel-eslint": "7.1.1", "babel-eslint": "7.1.1",
@ -132,19 +145,6 @@
"dependencies": { "dependencies": {
"@parity/api": "2.1.x", "@parity/api": "2.1.x",
"@parity/dapp-accounts": "paritytech/dapp-accounts", "@parity/dapp-accounts": "paritytech/dapp-accounts",
"@parity/dapp-console": "paritytech/dapp-console",
"@parity/dapp-dapp-accounts": "paritytech/dapp-dapp-accounts",
"@parity/dapp-dapp-methods": "paritytech/dapp-dapp-methods",
"@parity/dapp-dapp-visible": "paritytech/dapp-dapp-visible",
"@parity/dapp-dappreg": "paritytech/dapp-dappreg",
"@parity/dapp-githubhint": "paritytech/dapp-githubhint",
"@parity/dapp-localtx": "paritytech/dapp-localtx",
"@parity/dapp-registry": "paritytech/dapp-registry",
"@parity/dapp-signaturereg": "paritytech/dapp-signaturereg",
"@parity/dapp-tokendeploy": "paritytech/dapp-tokendeploy",
"@parity/dapp-tokenreg": "paritytech/dapp-tokenreg",
"@parity/dapp-vaults": "paritytech/dapp-vaults",
"@parity/dapp-web": "paritytech/dapp-web",
"@parity/plugin-signer-account": "paritytech/plugin-signer-account", "@parity/plugin-signer-account": "paritytech/plugin-signer-account",
"@parity/plugin-signer-default": "paritytech/plugin-signer-default", "@parity/plugin-signer-default": "paritytech/plugin-signer-default",
"@parity/plugin-signer-hardware": "paritytech/plugin-signer-hardware", "@parity/plugin-signer-hardware": "paritytech/plugin-signer-hardware",

View File

@ -2,23 +2,18 @@
set -e set -e
# variables # variables
PVER="1-9"
UTCDATE=`date -u "+%Y%m%d-%H%M%S"` UTCDATE=`date -u "+%Y%m%d-%H%M%S"`
BRANCH=$CI_BUILD_REF_NAME BRANCH=$CI_BUILD_REF_NAME
GIT_PARITY="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/parity.git" GIT_PARITY="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/parity.git"
GITLOG=./.git/.git-release.log
# setup the git user defaults for the current repo
function setup_git_user {
git config push.default simple
git config merge.ours.driver true
git config user.email "$GITHUB_EMAIL"
git config user.name "GitLab Build Bot"
}
echo "*** [cargo] Setting up GitHub config for parity" echo "*** [cargo] Setting up GitHub config for parity"
setup_git_user git config push.default simple
git remote set-url origin $GIT_PARITY git config merge.ours.driver true
git reset --hard origin/$BRANCH 2>$GITLOG git config user.email "$GITHUB_EMAIL"
git config user.name "GitLab Build Bot"
git remote set-url origin $GIT_PARITY > /dev/null 2>&1
git reset --hard origin/$BRANCH 2>/dev/null
git submodule update git submodule update
if [ "$BRANCH" == "master" ]; then if [ "$BRANCH" == "master" ]; then
@ -34,15 +29,18 @@ if [ "$BRANCH" == "master" ]; then
fi fi
echo "*** [cargo] Updating cargo parity-ui-precompiled" echo "*** [cargo] Updating cargo parity-ui-precompiled"
sed -i "/^parity-ui-precompiled/ { s/branch = \".*\"/branch = \"$BRANCH\"/g; }" dapps/ui/Cargo.toml sed -i "/^parity-ui-precompiled/ { s/git = \".*\"/git = \"https:\/\/github.com\/js-dist-paritytech\/parity-$BRANCH-$PVER-shell.git\"/g; }" dapps/ui/Cargo.toml
cargo update -p parity-ui-precompiled cargo update -p parity-ui-precompiled
echo "*** [cargo] Updating cargo parity-ui-old-precompiled"
sed -i "/^parity-ui-old-precompiled/ { s/git = \".*\"/git = \"https:\/\/github.com\/js-dist-paritytech\/parity-$BRANCH-$PVER-v1.git\"/g; }" dapps/ui/Cargo.toml
cargo update -p parity-ui-old-precompiled cargo update -p parity-ui-old-precompiled
echo "*** [cargo] Committing updated files" echo "*** [cargo] Committing updated files"
git add dapps/ui/Cargo.toml git add dapps/ui/Cargo.toml
git add Cargo.lock git add Cargo.lock
git commit -m "[ci skip] js-precompiled $UTCDATE" git commit -m "[ci skip] js-precompiled $UTCDATE"
git push origin HEAD:refs/heads/$BRANCH 2>$GITLOG git push origin HEAD:refs/heads/$BRANCH 2>/dev/null
# exit with exit code # exit with exit code
exit 0 exit 0

View File

@ -2,50 +2,39 @@
set -e set -e
# variables # variables
PVER="1-9"
PTYPE="v1"
UTCDATE=`date -u "+%Y%m%d-%H%M%S"` UTCDATE=`date -u "+%Y%m%d-%H%M%S"`
BRANCH=$CI_BUILD_REF_NAME PRE_REPO="js-dist-paritytech/parity-${CI_BUILD_REF_NAME}-${PVER}-${PTYPE}.git"
GIT_JS_PRECOMPILED="https://${GITHUB_JS_PRECOMPILED}:@github.com/paritytech/js-precompiled.git" PRE_REPO_TOKEN="https://${GITHUB_JS_PRECOMPILED}:@github.com/${PRE_REPO}"
BASEDIR=`dirname $0` BASEDIR=`dirname $0`
GITLOG=./.git/.git-release.log
# setup the git user defaults for the current repo pushd $BASEDIR/..
function setup_git_user {
git config push.default simple
git config merge.ours.driver true
git config user.email "$GITHUB_EMAIL"
git config user.name "GitLab Build Bot"
}
# change into the build directory echo "*** [$PRE_REPO] Cloning repo"
pushd $BASEDIR rm -rf precompiled
cd ../.dist git clone https://github.com/$PRE_REPO precompiled
cd precompiled
git config push.default simple
git config merge.ours.driver true
git config user.email "$GITHUB_EMAIL"
git config user.name "GitLab Build Bot"
git remote set-url origin $PRE_REPO_TOKEN > /dev/null 2>&1
# add local files and send it up echo "*** [$PRE_REPO] Copying build"
echo "*** [v2 precompiled] Setting up GitHub config"
rm -rf ./.git
git init
setup_git_user
echo "*** [v2 precompiled] Checking out $BRANCH branch"
git remote add origin $GIT_JS_PRECOMPILED
git fetch origin 2>$GITLOG
git checkout -b $BRANCH
echo "*** [v2 precompiled] Committing compiled files for $UTCDATE"
mv build ../build.new
git add .
git commit -m "$UTCDATE [update]"
git merge origin/$BRANCH -X ours --commit -m "$UTCDATE [merge]"
git rm -r build
rm -rf build rm -rf build
git commit -m "$UTCDATE [cleanup]" cp -rf ../.dist/build .
mv ../build.new build
echo "*** [$PRE_REPO] Adding to git"
echo "$UTCDATE" >README.md
git add . git add .
git commit -m "$UTCDATE [release]" git commit -m "$UTCDATE"
echo "*** [v2 precompiled] Merging remote" echo "*** [$PRE_REPO] Pushing upstream"
git push origin HEAD:refs/heads/$BRANCH 2>$GITLOG git push --quiet origin HEAD:refs/heads/master > /dev/null 2>&1
cd ..
rm -rf precompiled
popd popd
# exit with exit code # exit with exit code

View File

@ -1 +1 @@
// test script 19 // test script 21

View File

@ -18,6 +18,7 @@
const Api = require('@parity/api'); const Api = require('@parity/api');
const fs = require('fs'); const fs = require('fs');
const path = require('path'); const path = require('path');
const rimraf = require('rimraf');
const flatten = require('lodash.flatten'); const flatten = require('lodash.flatten');
// const ReactIntlAggregatePlugin = require('react-intl-aggregate-webpack-plugin'); // const ReactIntlAggregatePlugin = require('react-intl-aggregate-webpack-plugin');
const ExtractTextPlugin = require('extract-text-webpack-plugin'); const ExtractTextPlugin = require('extract-text-webpack-plugin');
@ -208,7 +209,7 @@ module.exports = {
.map((dapp) => { .map((dapp) => {
const dir = path.join(__dirname, '../node_modules', dapp.package); const dir = path.join(__dirname, '../node_modules', dapp.package);
if (!fs.existsSync(path.join(dir, 'dist'))) { if (!fs.existsSync(dir)) {
return null; return null;
} }
@ -216,6 +217,15 @@ module.exports = {
? dapp.id ? dapp.id
: Api.util.sha3(dapp.url); : Api.util.sha3(dapp.url);
if (!fs.existsSync(path.join(dir, 'dist'))) {
rimraf.sync(path.join(dir, 'node_modules'));
return {
from: path.join(dir),
to: `dapps/${destination}/`
};
}
return [ return [
'icon.png', 'index.html', 'dist.css', 'dist.js', 'icon.png', 'index.html', 'dist.css', 'dist.js',
isProd ? null : 'dist.css.map', isProd ? null : 'dist.css.map',

View File

@ -32,6 +32,7 @@ impl DappsService for TestDappsService {
version: "0.1".into(), version: "0.1".into(),
author: "Parity Technologies Ltd".into(), author: "Parity Technologies Ltd".into(),
icon_url: "title.png".into(), icon_url: "title.png".into(),
local_url: None,
}] }]
} }

View File

@ -250,7 +250,7 @@ fn rpc_parity_set_dapps_list() {
io.extend_with(parity_set_client(&client, &miner, &updater, &network).to_delegate()); io.extend_with(parity_set_client(&client, &miner, &updater, &network).to_delegate());
let request = r#"{"jsonrpc": "2.0", "method": "parity_dappsList", "params":[], "id": 1}"#; let request = r#"{"jsonrpc": "2.0", "method": "parity_dappsList", "params":[], "id": 1}"#;
let response = r#"{"jsonrpc":"2.0","result":[{"author":"Parity Technologies Ltd","description":"A skeleton dapp","iconUrl":"title.png","id":"skeleton","name":"Skeleton","version":"0.1"}],"id":1}"#; let response = r#"{"jsonrpc":"2.0","result":[{"author":"Parity Technologies Ltd","description":"A skeleton dapp","iconUrl":"title.png","id":"skeleton","localUrl":null,"name":"Skeleton","version":"0.1"}],"id":1}"#;
assert_eq!(io.handle_request_sync(request), Some(response.to_owned())); assert_eq!(io.handle_request_sync(request), Some(response.to_owned()));
} }

View File

@ -52,7 +52,7 @@ mod tests {
version: "0.1".into(), version: "0.1".into(),
author: "Parity Technologies Ltd".into(), author: "Parity Technologies Ltd".into(),
icon_url: "title.png".into(), icon_url: "title.png".into(),
local_url: "http://localhost:5000".into(), local_url: Some("http://localhost:5000".into()),
}; };
let serialized = serde_json::to_string(&dapp).unwrap(); let serialized = serde_json::to_string(&dapp).unwrap();