diff --git a/apps/remix-ide/.gitignore b/apps/remix-ide/.gitignore index 9377746f02..cf8c2c0ad3 100644 --- a/apps/remix-ide/.gitignore +++ b/apps/remix-ide/.gitignore @@ -12,4 +12,5 @@ remix TODO .tern-port temp_publish_docker -src/assets/version.json \ No newline at end of file +src/assets/version.json +src/assets/js/soljson-v* \ No newline at end of file diff --git a/apps/remix-ide/ci/browser_test.sh b/apps/remix-ide/ci/browser_test.sh index e897339492..2265ab87d9 100755 --- a/apps/remix-ide/ci/browser_test.sh +++ b/apps/remix-ide/ci/browser_test.sh @@ -6,6 +6,7 @@ BUILD_ID=${CIRCLE_BUILD_NUM:-${TRAVIS_JOB_NUMBER}} echo "$BUILD_ID" TEST_EXITCODE=0 +yarn run downloadsolc_assets_e2e & yarn run ganache-cli & yarn run serve:production & echo 'sharing folder: ' $PWD '/apps/remix-ide/contracts' & diff --git a/apps/remix-ide/ci/download_e2e_assets.sh b/apps/remix-ide/ci/download_e2e_assets.sh new file mode 100644 index 0000000000..6fdad45a6c --- /dev/null +++ b/apps/remix-ide/ci/download_e2e_assets.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./apps/remix-ide/src/assets/js/soljson-v0.8.7+commit.e28d00a7.js +wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.16+commit.07a7930e.js -O ./apps/remix-ide/src/assets/js/soljson-v0.8.16+commit.07a7930e.js +wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.15+commit.e14f2714.js -O ./apps/remix-ide/src/assets/js/soljson-v0.8.15+commit.e14f2714.js +wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.7.4+commit.3f05b770.js -O ./apps/remix-ide/src/assets/js/soljson-v0.7.4+commit.3f05b770.js diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index 0281d505c8..e3ea641b87 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -339,11 +339,13 @@ export const CompilerContainer = (props: CompilerContainerProps) => { if (allVersionsWasm && allVersions) { allVersions.forEach((compiler, index) => { const wasmIndex = allVersionsWasm.findIndex(wasmCompiler => { return wasmCompiler.longVersion === compiler.longVersion }) + const URLWasm: string = process && process.env && process.env['NX_WASM_URL'] ? process.env['NX_WASM_URL'] : baseURLWasm + const URLBin: string = process && process.env && process.env['NX_BIN_URL'] ? process.env['NX_BIN_URL'] : baseURLBin if (wasmIndex !== -1) { allVersions[index] = allVersionsWasm[wasmIndex] - pathToURL[compiler.path] = baseURLWasm + pathToURL[compiler.path] = URLWasm } else { - pathToURL[compiler.path] = baseURLBin + pathToURL[compiler.path] = URLBin } }) } diff --git a/package.json b/package.json index 56fc3c130c..3fed7bb585 100644 --- a/package.json +++ b/package.json @@ -50,10 +50,12 @@ "test:libs": "nx run-many --target=test --projects=remix-analyzer,remix-astwalker,remix-debug,remix-lib,remix-simulator,remix-solidity,remix-tests,remix-url-resolver,remixd", "publish:libs": "yarn run build:libs && lerna publish --skip-git && yarn run bumpVersion:libs", "build:e2e": "node apps/remix-ide-e2e/src/buildGroupTests.js && tsc -p apps/remix-ide-e2e/tsconfig.e2e.json", + "serve:e2e": "NX_BIN_URL=http://127.0.0.1:8080/assets/js NX_WASM_URL=http://127.0.0.1:8080/assets/js nx serve", "watch:e2e": "nodemon", "bumpVersion:libs": "gulp & gulp syncLibVersions;", "browsertest": "sleep 5 && yarn run nightwatch_local", "csslint": "csslint --ignore=order-alphabetical --errors='errors,duplicate-properties,empty-rules' --exclude-list='apps/remix-ide/src/assets/css/font-awesome.min.css' apps/remix-ide/src/assets/css/", + "downloadsolc_assets_e2e": "sh ./apps/remix-ide/ci/download_e2e_assets.sh", "downloadsolc_assets": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./apps/remix-ide/src/assets/js/soljson.js && wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./apps/solidity-compiler/src/assets/js/soljson.js", "downloadsolc_assets_dist": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./dist/apps/remix-ide/assets/js/soljson.js && wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.7+commit.e28d00a7.js -O ./dist/apps/solidity-compiler/assets/js/soljson.js", "make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js",