From 20e3b666e846f12a74ca7f51572bed46840cbc32 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 12:21:16 +0200 Subject: [PATCH 01/30] grep script --- apps/remix-ide/ci/download_e2e_assets.js | 51 +++++++++++++++++++++++- apps/remix-ide/webpack.config.js | 2 +- 2 files changed, 51 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 392941536a..edd73ba57a 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -1,9 +1,11 @@ const testFolder = './apps/remix-ide-e2e/src/tests/'; const fs = require('fs'); +var child_process = require('child_process'); let url = 'https://binaries.soliditylang.org/wasm/list.json' -const axios = require('axios') +const axios = require('axios'); +const { exit } = require('process'); // use axios to download the file /* @@ -41,6 +43,51 @@ axios({ ) */ + + +var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v0"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); + +if (child.error) { + console.log("ERROR: ", child); + exit(1); +} + + +const re = /(?<=soljson).*(?=(.js))/g; +const soljson = child.stdout.match(re); +if (soljson) { + for (let i = 0; i < soljson.length; i++) { + const version = soljson[i]; + if (version) { + let url = '' + + url = `https://binaries.soliditylang.org/bin/soljson${version}.js`; + console.log(url) + const path = `./dist/apps/remix-ide/assets/js/soljson${version}.js`; + // use axios to get the file + try { + axios({ + method: 'get', + url: url, + }).then(function (response) { + fs.writeFile(path, response.data, function (err) { + if (err) { + console.log(err); + } + }) + }) + } catch (e) { + console.log('Failed to download soljson' + version + ' from ' + url) + } + + + } + + } +} + +/* + fs.readdirSync(testFolder).forEach(file => { let c = fs.readFileSync(testFolder + file, 'utf8'); const re = /(?<=soljson).*(?=(.js))/g; @@ -78,3 +125,5 @@ fs.readdirSync(testFolder).forEach(file => { } }); + +*/ diff --git a/apps/remix-ide/webpack.config.js b/apps/remix-ide/webpack.config.js index a10a6a3e47..8006ff5591 100644 --- a/apps/remix-ide/webpack.config.js +++ b/apps/remix-ide/webpack.config.js @@ -23,7 +23,7 @@ const loadLocalSolJson = async () => { let info = response.data; info.builds = info.builds.filter(build => build.path.indexOf('nightly') === -1) info.builds = info.builds.slice(-1) - const buildurl = `https://solc-bin.ethereum.org/wasm/${info.builds[0].path}`; + const buildurl = `https://binaries.soliditylang.org/bin/${info.builds[0].path}`; console.log(`Copying... ${buildurl} to assets`) const path = `./apps/remix-ide/src/assets/js/soljson.js`; axios({ From 5745504e926f7c04e1ba5358c055199324c15b88 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 12:26:00 +0200 Subject: [PATCH 02/30] md5sum --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index d29fec3eec..0dc6f017fa 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -35,6 +35,7 @@ jobs: fi - run: yarn run build:e2e - run: yarn run downloadsolc_assets_e2e + - run: grep -ir "soljson-v0" apps/* libs/* | md5sum - run: mkdir persist && zip -0 -r persist/dist.zip dist - persist_to_workspace: root: . From c5c61d1c2723430fc493ffe8a72f58b6bff391a5 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 12:30:03 +0200 Subject: [PATCH 03/30] fix lint --- apps/remix-ide/ci/download_e2e_assets.js | 93 ++---------------------- 1 file changed, 8 insertions(+), 85 deletions(-) diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index edd73ba57a..5cb6a3f8e4 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -1,50 +1,9 @@ -const testFolder = './apps/remix-ide-e2e/src/tests/'; + const fs = require('fs'); var child_process = require('child_process'); - -let url = 'https://binaries.soliditylang.org/wasm/list.json' - const axios = require('axios'); const { exit } = require('process'); -// use axios to download the file -/* -axios({ - url: url, - method: 'GET', -}).then((response) => { - - let info = response.data; - info.builds = info.builds.filter(build => build.path.indexOf('nightly') === -1) - for (let build of info.builds) { - - const buildurl = `https://solc-bin.ethereum.org/wasm/${build.path}`; - console.log(buildurl) - - const path = `./dist/apps/remix-ide/assets/js/${build.path}`; - // use axios to get the file - try { - axios({ - method: 'get', - url: buildurl, - }).then(function (response) { - fs.writeFile(path, response.data, function (err) { - if (err) { - console.log(err); - } - }) - }) - } catch (e) { - console.log('Failed to download ' + build.path + ' from ' + buildurl) - } - - } -} -) -*/ - - - var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v0"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); if (child.error) { @@ -62,46 +21,12 @@ if (soljson) { let url = '' url = `https://binaries.soliditylang.org/bin/soljson${version}.js`; - console.log(url) - const path = `./dist/apps/remix-ide/assets/js/soljson${version}.js`; - // use axios to get the file - try { - axios({ - method: 'get', - url: url, - }).then(function (response) { - fs.writeFile(path, response.data, function (err) { - if (err) { - console.log(err); - } - }) - }) - } catch (e) { - console.log('Failed to download soljson' + version + ' from ' + url) - } - - } - - } -} - -/* - -fs.readdirSync(testFolder).forEach(file => { - let c = fs.readFileSync(testFolder + file, 'utf8'); - const re = /(?<=soljson).*(?=(.js))/g; - const soljson = c.match(re); - if (soljson) { - console.log(soljson) - for (let i = 0; i < soljson.length; i++) { - - const version = soljson[i]; - if (version) { - const url = `https://solc-bin.ethereum.org/bin/soljson${version}.js`; + const path = `./dist/apps/remix-ide/assets/js/soljson${version}.js`; + // check if the file exists + const exists = fs.existsSync(path); + if (!exists) { console.log(url) - - const path = `./dist/apps/remix-ide/assets/js/soljson${version}.js`; // use axios to get the file try { axios({ @@ -117,13 +42,11 @@ fs.readdirSync(testFolder).forEach(file => { } catch (e) { console.log('Failed to download soljson' + version + ' from ' + url) } - - } + } - } -}); + } +} -*/ From 18f8e28d3446e84bb2dff470518142a9668306e6 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 12:32:54 +0200 Subject: [PATCH 04/30] restore cache --- .circleci/config.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0dc6f017fa..11a8fe3bcb 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -24,7 +24,6 @@ jobs: key: v1-deps-{{ checksum "yarn.lock" }} paths: - node_modules - - run: name: Build command: | @@ -34,8 +33,13 @@ jobs: NX_BIN_URL=http://127.0.0.1:8080/assets/js NX_WASM_URL=http://127.0.0.1:8080/assets/js NPM_URL=http://localhost:9090/ yarn build fi - run: yarn run build:e2e + + - restore_cache: + keys: + - soljson-{{ grep -ir "soljson-v0" apps/* libs/* | md5sum }} - run: yarn run downloadsolc_assets_e2e - run: grep -ir "soljson-v0" apps/* libs/* | md5sum + - run: mkdir persist && zip -0 -r persist/dist.zip dist - persist_to_workspace: root: . From d05eefa45c79e4564aec1deebecc1f95eeae45c8 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 12:38:26 +0200 Subject: [PATCH 05/30] use file --- .circleci/config.yml | 5 +++-- apps/remix-ide/ci/download_e2e_assets.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 11a8fe3bcb..0aad9fd2ff 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,11 +34,12 @@ jobs: fi - run: yarn run build:e2e + - run: grep -ir "soljson-v0" apps/* libs/* > soljson-versions.txt - restore_cache: keys: - - soljson-{{ grep -ir "soljson-v0" apps/* libs/* | md5sum }} + - soljson-{{ checksum "soljson-versions.txt" }} - run: yarn run downloadsolc_assets_e2e - - run: grep -ir "soljson-v0" apps/* libs/* | md5sum + - run: mkdir persist && zip -0 -r persist/dist.zip dist - persist_to_workspace: diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 5cb6a3f8e4..5349db0358 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -4,7 +4,7 @@ var child_process = require('child_process'); const axios = require('axios'); const { exit } = require('process'); -var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v0"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); +var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); if (child.error) { console.log("ERROR: ", child); @@ -29,6 +29,7 @@ if (soljson) { console.log(url) // use axios to get the file try { + /* axios({ method: 'get', url: url, @@ -38,7 +39,7 @@ if (soljson) { console.log(err); } }) - }) + })*/ } catch (e) { console.log('Failed to download soljson' + version + ' from ' + url) } From 76d9774a059c9c6820a143b9f527370888cd3112 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 12:55:59 +0200 Subject: [PATCH 06/30] use caching --- .circleci/config.yml | 10 +++++++--- apps/remix-ide/.gitignore | 2 +- apps/remix-ide/ci/download_e2e_assets.js | 15 ++++++++++----- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0aad9fd2ff..c510866f33 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -28,9 +28,9 @@ jobs: name: Build command: | if [ "${CIRCLE_BRANCH}" == "master" ]; then - NX_BIN_URL=http://127.0.0.1:8080/assets/js NX_WASM_URL=http://127.0.0.1:8080/assets/js NPM_URL=http://localhost:9090/ yarn build:production + NX_BIN_URL=http://127.0.0.1:8080/assets/js/soljson NX_WASM_URL=http://127.0.0.1:8080/assets/js/soljson NPM_URL=http://localhost:9090/ yarn build:production else - NX_BIN_URL=http://127.0.0.1:8080/assets/js NX_WASM_URL=http://127.0.0.1:8080/assets/js NPM_URL=http://localhost:9090/ yarn build + NX_BIN_URL=http://127.0.0.1:8080/assets/js/soljson NX_WASM_URL=http://127.0.0.1:8080/assets/js/soljson NPM_URL=http://localhost:9090/ yarn build fi - run: yarn run build:e2e @@ -39,7 +39,11 @@ jobs: keys: - soljson-{{ checksum "soljson-versions.txt" }} - run: yarn run downloadsolc_assets_e2e - + - save_cache: + keys: + - soljson-{{ checksum "soljson-versions.txt" }} + paths: + - dist/apps/remix-ide/assets/js/soljson - run: mkdir persist && zip -0 -r persist/dist.zip dist - persist_to_workspace: diff --git a/apps/remix-ide/.gitignore b/apps/remix-ide/.gitignore index cf8c2c0ad3..3e0c4b3136 100644 --- a/apps/remix-ide/.gitignore +++ b/apps/remix-ide/.gitignore @@ -13,4 +13,4 @@ TODO .tern-port temp_publish_docker src/assets/version.json -src/assets/js/soljson-v* \ No newline at end of file +src/assets/js/soljson/soljson-v* \ No newline at end of file diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 5349db0358..996f76134a 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -4,7 +4,7 @@ var child_process = require('child_process'); const axios = require('axios'); const { exit } = require('process'); -var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); +var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v0"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); if (child.error) { console.log("ERROR: ", child); @@ -22,14 +22,17 @@ if (soljson) { url = `https://binaries.soliditylang.org/bin/soljson${version}.js`; - const path = `./dist/apps/remix-ide/assets/js/soljson${version}.js`; + const dir = './dist/apps/remix-ide/assets/js/soljson'; + if (!fs.existsSync(dir)) { + fs.mkdirSync(dir); + } + + const path = `./dist/apps/remix-ide/assets/js/soljson/soljson${version}.js`; // check if the file exists const exists = fs.existsSync(path); if (!exists) { console.log(url) - // use axios to get the file try { - /* axios({ method: 'get', url: url, @@ -39,7 +42,9 @@ if (soljson) { console.log(err); } }) - })*/ + }).catch(function (error) { + console.log(error); + }) } catch (e) { console.log('Failed to download soljson' + version + ' from ' + url) } From 67b9317e153810fd0189e802f6e2a13229788986 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 12:56:54 +0200 Subject: [PATCH 07/30] fix config --- .circleci/config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c510866f33..e8d71b17e6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,8 +40,7 @@ jobs: - soljson-{{ checksum "soljson-versions.txt" }} - run: yarn run downloadsolc_assets_e2e - save_cache: - keys: - - soljson-{{ checksum "soljson-versions.txt" }} + keys: soljson-{{ checksum "soljson-versions.txt" }} paths: - dist/apps/remix-ide/assets/js/soljson From f292c0b866efcace544cefcd96c0e608bac79be2 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 12:57:37 +0200 Subject: [PATCH 08/30] config --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e8d71b17e6..6353a2fae4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -40,7 +40,7 @@ jobs: - soljson-{{ checksum "soljson-versions.txt" }} - run: yarn run downloadsolc_assets_e2e - save_cache: - keys: soljson-{{ checksum "soljson-versions.txt" }} + key: soljson-{{ checksum "soljson-versions.txt" }} paths: - dist/apps/remix-ide/assets/js/soljson From 64c12514d9311674de926ac7d138f219a9120c24 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 13:00:39 +0200 Subject: [PATCH 09/30] fix grep --- .circleci/config.yml | 2 +- apps/remix-ide/ci/download_e2e_assets.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6353a2fae4..0338a563bd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: fi - run: yarn run build:e2e - - run: grep -ir "soljson-v0" apps/* libs/* > soljson-versions.txt + - run: grep -ir "soljson-v[0-9]" apps/* libs/* > soljson-versions.txt - restore_cache: keys: - soljson-{{ checksum "soljson-versions.txt" }} diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 996f76134a..736d31eb2b 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -4,7 +4,7 @@ var child_process = require('child_process'); const axios = require('axios'); const { exit } = require('process'); -var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v0"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); +var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v[0-9]"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); if (child.error) { console.log("ERROR: ", child); From 78f4aa91cff9411e6615ad54d9a0bb312cc41dff Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 13:05:42 +0200 Subject: [PATCH 10/30] fix lint --- apps/remix-ide/ci/download_e2e_assets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 736d31eb2b..eb9413fb5d 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -4,7 +4,7 @@ var child_process = require('child_process'); const axios = require('axios'); const { exit } = require('process'); -var child = child_process.spawnSync('grep', ['-ir', '"\soljson-v[0-9]"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); +var child = child_process.spawnSync('grep', ['-ir', '"soljson-v[0-9]"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); if (child.error) { console.log("ERROR: ", child); From 7b1cb69634cc183945e9aac3f2692eeee7fdbe73 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 13:27:17 +0200 Subject: [PATCH 11/30] nightly --- apps/remix-ide/ci/download_e2e_assets.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index eb9413fb5d..7d6a848fd5 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -20,7 +20,12 @@ if (soljson) { if (version) { let url = '' - url = `https://binaries.soliditylang.org/bin/soljson${version}.js`; + // if nightly + if (version.includes('nightly')) { + url = `https://binaries.soliditylang.org/bin/soljson${version}.js`; + }else{ + url = `https://binaries.soliditylang.org/wasm/soljson${version}.js`; + } const dir = './dist/apps/remix-ide/assets/js/soljson'; if (!fs.existsSync(dir)) { From c848208ed362abac8adf944d6d3a01a78baba81a Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 14:50:39 +0200 Subject: [PATCH 12/30] catch webpack --- apps/remix-ide/webpack.config.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/webpack.config.js b/apps/remix-ide/webpack.config.js index 8006ff5591..ff9a21e9d2 100644 --- a/apps/remix-ide/webpack.config.js +++ b/apps/remix-ide/webpack.config.js @@ -23,18 +23,22 @@ const loadLocalSolJson = async () => { let info = response.data; info.builds = info.builds.filter(build => build.path.indexOf('nightly') === -1) info.builds = info.builds.slice(-1) - const buildurl = `https://binaries.soliditylang.org/bin/${info.builds[0].path}`; + const buildurl = `https://binaries.soliditylang.org/bin/${info.builds[0].path}` console.log(`Copying... ${buildurl} to assets`) const path = `./apps/remix-ide/src/assets/js/soljson.js`; axios({ method: 'get', url: buildurl, responseType: 'stream' - }).then(function (response) { + }).then((response) => { response.data.pipe(fs.createWriteStream(path)); + }).catch((error) => { + console.log(error.message) }) } - ) + ).catch((error) => { + console.log(error.message) + }) } fs.writeFileSync('./apps/remix-ide/src/assets/version.json', JSON.stringify(versionData)) From 36d8f10e5ea2ec7b920a0a393271f947a1e787f3 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 15:17:59 +0200 Subject: [PATCH 13/30] url curl --- apps/remix-ide/ci/download_e2e_assets.js | 15 ++------------ apps/remix-ide/ci/downloadsoljson.sh | 19 +++++++++++++++++ apps/remix-ide/webpack.config.js | 26 ++---------------------- 3 files changed, 23 insertions(+), 37 deletions(-) create mode 100644 apps/remix-ide/ci/downloadsoljson.sh diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 7d6a848fd5..5a22043201 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -1,7 +1,6 @@ const fs = require('fs'); var child_process = require('child_process'); -const axios = require('axios'); const { exit } = require('process'); var child = child_process.spawnSync('grep', ['-ir', '"soljson-v[0-9]"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); @@ -38,18 +37,8 @@ if (soljson) { if (!exists) { console.log(url) try { - axios({ - method: 'get', - url: url, - }).then(function (response) { - fs.writeFile(path, response.data, function (err) { - if (err) { - console.log(err); - } - }) - }).catch(function (error) { - console.log(error); - }) + // use curl to download the file + child_process.exec(`curl -o ${path} ${url}`, { encoding: 'utf8', cwd: process.cwd(), shell: true }) } catch (e) { console.log('Failed to download soljson' + version + ' from ' + url) } diff --git a/apps/remix-ide/ci/downloadsoljson.sh b/apps/remix-ide/ci/downloadsoljson.sh new file mode 100644 index 0000000000..9d2562e08c --- /dev/null +++ b/apps/remix-ide/ci/downloadsoljson.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -e + +# download https://binaries.soliditylang.org/wasm/list.json as json +curl https://binaries.soliditylang.org/wasm/list.json > list.json +# get the latest version +version=$(cat list.json | jq -r '.latestRelease') +echo $version +# the value of releases with key $version +url=$(cat list.json | npx jq -r '.releases[]' | grep $version) +echo $url +# set path to the url +path="https://binaries.soliditylang.org/bin/$url" +echo $path +# download the file to ./apps/remix-ide/src/assets/js/soljson.js +curl $path > ./apps/remix-ide/src/assets/js/soljson.js +# remove list.json +rm list.json diff --git a/apps/remix-ide/webpack.config.js b/apps/remix-ide/webpack.config.js index ff9a21e9d2..3191b1d886 100644 --- a/apps/remix-ide/webpack.config.js +++ b/apps/remix-ide/webpack.config.js @@ -15,30 +15,8 @@ const versionData = { } const loadLocalSolJson = async () => { - let url = 'https://binaries.soliditylang.org/wasm/list.json' - axios({ - url: url, - method: 'GET', - }).then((response) => { - let info = response.data; - info.builds = info.builds.filter(build => build.path.indexOf('nightly') === -1) - info.builds = info.builds.slice(-1) - const buildurl = `https://binaries.soliditylang.org/bin/${info.builds[0].path}` - console.log(`Copying... ${buildurl} to assets`) - const path = `./apps/remix-ide/src/assets/js/soljson.js`; - axios({ - method: 'get', - url: buildurl, - responseType: 'stream' - }).then((response) => { - response.data.pipe(fs.createWriteStream(path)); - }).catch((error) => { - console.log(error.message) - }) - } - ).catch((error) => { - console.log(error.message) - }) + // execute apps/remix-ide/ci/downloadsoljson.sh + const child = require('child_process').execSync('bash ./apps/remix-ide/ci/downloadsoljson.sh', { encoding: 'utf8', cwd: process.cwd(), shell: true }) } fs.writeFileSync('./apps/remix-ide/src/assets/version.json', JSON.stringify(versionData)) From 5755c71c78f97a201819cb640068fbee3bdb20db Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 15:18:47 +0200 Subject: [PATCH 14/30] check curl --- apps/remix-ide/ci/downloadsoljson.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/remix-ide/ci/downloadsoljson.sh b/apps/remix-ide/ci/downloadsoljson.sh index 9d2562e08c..114bfea7d3 100644 --- a/apps/remix-ide/ci/downloadsoljson.sh +++ b/apps/remix-ide/ci/downloadsoljson.sh @@ -1,6 +1,12 @@ #!/usr/bin/env bash set -e +# check if curl is installed +if ! command -v curl &> /dev/null +then + echo "curl could not be found" + exit +fi # download https://binaries.soliditylang.org/wasm/list.json as json curl https://binaries.soliditylang.org/wasm/list.json > list.json From 6bb5aa3b0e05c23435dc1be3c30e52ccdfa349dc Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 15:36:12 +0200 Subject: [PATCH 15/30] use plus --- apps/remix-ide/ci/downloadsoljson.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/ci/downloadsoljson.sh b/apps/remix-ide/ci/downloadsoljson.sh index 114bfea7d3..7e6ff6fb16 100644 --- a/apps/remix-ide/ci/downloadsoljson.sh +++ b/apps/remix-ide/ci/downloadsoljson.sh @@ -14,7 +14,7 @@ curl https://binaries.soliditylang.org/wasm/list.json > list.json version=$(cat list.json | jq -r '.latestRelease') echo $version # the value of releases with key $version -url=$(cat list.json | npx jq -r '.releases[]' | grep $version) +url=$(cat list.json | npx jq -r '.releases[]' | grep "$version+") echo $url # set path to the url path="https://binaries.soliditylang.org/bin/$url" From 3b5dd850a3de8a03e99a9157f0ecef9fb2bcb155 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 15:38:41 +0200 Subject: [PATCH 16/30] install jq --- apps/remix-ide/ci/downloadsoljson.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/remix-ide/ci/downloadsoljson.sh b/apps/remix-ide/ci/downloadsoljson.sh index 7e6ff6fb16..6f7f10b081 100644 --- a/apps/remix-ide/ci/downloadsoljson.sh +++ b/apps/remix-ide/ci/downloadsoljson.sh @@ -8,13 +8,26 @@ then exit fi +# install jq if not installed +if ! command -v jq &> /dev/null +then + echo "jq could not be found" + echo "installing jq" + sudo apt-get install jq +fi +if ! command -v jq &> /dev/null +then + echo "jq could not be found" + exit +fi + # download https://binaries.soliditylang.org/wasm/list.json as json curl https://binaries.soliditylang.org/wasm/list.json > list.json # get the latest version version=$(cat list.json | jq -r '.latestRelease') echo $version # the value of releases with key $version -url=$(cat list.json | npx jq -r '.releases[]' | grep "$version+") +url=$(cat list.json | jq -r '.releases[]' | grep "$version+") echo $url # set path to the url path="https://binaries.soliditylang.org/bin/$url" From 0abb2e793fdb9c7ba0874ba8cd3807acca160495 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 15:41:16 +0200 Subject: [PATCH 17/30] use npx --- apps/remix-ide/ci/downloadsoljson.sh | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/apps/remix-ide/ci/downloadsoljson.sh b/apps/remix-ide/ci/downloadsoljson.sh index 6f7f10b081..e3598e90bc 100644 --- a/apps/remix-ide/ci/downloadsoljson.sh +++ b/apps/remix-ide/ci/downloadsoljson.sh @@ -8,26 +8,14 @@ then exit fi -# install jq if not installed -if ! command -v jq &> /dev/null -then - echo "jq could not be found" - echo "installing jq" - sudo apt-get install jq -fi -if ! command -v jq &> /dev/null -then - echo "jq could not be found" - exit -fi # download https://binaries.soliditylang.org/wasm/list.json as json curl https://binaries.soliditylang.org/wasm/list.json > list.json # get the latest version -version=$(cat list.json | jq -r '.latestRelease') +version=$(cat list.json | npx jq -r '.latestRelease') echo $version # the value of releases with key $version -url=$(cat list.json | jq -r '.releases[]' | grep "$version+") +url=$(cat list.json | npx jq -r '.releases[]' | grep "$version+") echo $url # set path to the url path="https://binaries.soliditylang.org/bin/$url" From 6a54ff53c5809e2987e55bceac86e0050e23883b Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 15:51:52 +0200 Subject: [PATCH 18/30] do not use jq --- apps/remix-ide/ci/downloadsoljson.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/remix-ide/ci/downloadsoljson.sh b/apps/remix-ide/ci/downloadsoljson.sh index e3598e90bc..5a0d786bf1 100644 --- a/apps/remix-ide/ci/downloadsoljson.sh +++ b/apps/remix-ide/ci/downloadsoljson.sh @@ -11,16 +11,16 @@ fi # download https://binaries.soliditylang.org/wasm/list.json as json curl https://binaries.soliditylang.org/wasm/list.json > list.json -# get the latest version -version=$(cat list.json | npx jq -r '.latestRelease') -echo $version -# the value of releases with key $version -url=$(cat list.json | npx jq -r '.releases[]' | grep "$version+") -echo $url -# set path to the url +# get the latest version without jq +latest=$(grep 'latestRelease' list.json | cut -d '"' -f 4) +echo "latest version: $latest" +# get url +url=$(grep "\"$latest\":" list.json | cut -d '"' -f 4) +echo "url: $url" path="https://binaries.soliditylang.org/bin/$url" -echo $path +echo "path: $path" # download the file to ./apps/remix-ide/src/assets/js/soljson.js curl $path > ./apps/remix-ide/src/assets/js/soljson.js # remove list.json rm list.json + From 56b74c6c4fb546557775daebfc996fbb54143315 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 15:58:11 +0200 Subject: [PATCH 19/30] rename cache --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0338a563bd..8cc64a3831 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,10 +37,10 @@ jobs: - run: grep -ir "soljson-v[0-9]" apps/* libs/* > soljson-versions.txt - restore_cache: keys: - - soljson-{{ checksum "soljson-versions.txt" }} + - soljson-cache-{{ checksum "soljson-versions.txt" }} - run: yarn run downloadsolc_assets_e2e - save_cache: - key: soljson-{{ checksum "soljson-versions.txt" }} + key: soljson-cache-{{ checksum "soljson-versions.txt" }} paths: - dist/apps/remix-ide/assets/js/soljson From 9462f7a16875447808467a5add188560e5b4649a Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 16:07:17 +0200 Subject: [PATCH 20/30] filter duplicates --- apps/remix-ide/ci/download_e2e_assets.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 5a22043201..2f383c8e90 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -12,8 +12,11 @@ if (child.error) { const re = /(?<=soljson).*(?=(.js))/g; -const soljson = child.stdout.match(re); +let soljson = child.stdout.match(re); if (soljson) { + // filter out duplicates + soljson = soljson.filter((item, index) => soljson.indexOf(item) === index); + console.log('soljson versions found: ', soljson); for (let i = 0; i < soljson.length; i++) { const version = soljson[i]; if (version) { @@ -35,7 +38,7 @@ if (soljson) { // check if the file exists const exists = fs.existsSync(path); if (!exists) { - console.log(url) + console.log('URL:', url) try { // use curl to download the file child_process.exec(`curl -o ${path} ${url}`, { encoding: 'utf8', cwd: process.cwd(), shell: true }) From 45010a7bec87a91a7e9da98e079544b151a1b238 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 16:46:50 +0200 Subject: [PATCH 21/30] manual versions --- .circleci/config.yml | 2 +- apps/remix-ide/ci/download_e2e_assets.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8cc64a3831..3a41eadf9b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,7 +34,7 @@ jobs: fi - run: yarn run build:e2e - - run: grep -ir "soljson-v[0-9]" apps/* libs/* > soljson-versions.txt + - run: grep -ir "[0-9]+commit" apps/* libs/* --include \*.ts > soljson-versions.txt - restore_cache: keys: - soljson-cache-{{ checksum "soljson-versions.txt" }} diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 2f383c8e90..3ab69ffb34 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -3,7 +3,7 @@ const fs = require('fs'); var child_process = require('child_process'); const { exit } = require('process'); -var child = child_process.spawnSync('grep', ['-ir', '"soljson-v[0-9]"', 'libs/*', 'apps/*'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); +var child = child_process.spawnSync('grep', ['-ir', '[0-9]+commit', 'libs/**/*', 'apps/**/*', '--include', '\*.ts'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); if (child.error) { console.log("ERROR: ", child); @@ -17,6 +17,11 @@ if (soljson) { // filter out duplicates soljson = soljson.filter((item, index) => soljson.indexOf(item) === index); console.log('soljson versions found: ', soljson); + + // manually add some versions + soljson.push('soljson-v0.6.8+commit.0bbfe453.js'); + soljson.push('soljson-v0.6.0+commit.26b70077.js'); + for (let i = 0; i < soljson.length; i++) { const version = soljson[i]; if (version) { @@ -49,7 +54,8 @@ if (soljson) { } + + } - } } From 1e8fe105ed0538ee46249a07942e35a94a7aebda Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 17:02:22 +0200 Subject: [PATCH 22/30] fix manual --- apps/remix-ide/ci/download_e2e_assets.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 3ab69ffb34..f92803b9e4 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -10,6 +10,25 @@ if (child.error) { exit(1); } +// find words between single quotes starting with a number +const re2 = /(?<=\').*(?=\')/g; +let versions = child.stdout.match(re2); +console.log('versions found: ', versions); + +// get all words in versions +const re3 = /(?<=v).*/g; +let version2 = [] +for (let i = 0; i < versions.length; i++) { + const version = versions[i]; + if (version) { + const v = version.match(re3); + if (v) { + version2.push(v[0]); + } + } +} +console.log('versions found: ', version2); + const re = /(?<=soljson).*(?=(.js))/g; let soljson = child.stdout.match(re); @@ -19,8 +38,8 @@ if (soljson) { console.log('soljson versions found: ', soljson); // manually add some versions - soljson.push('soljson-v0.6.8+commit.0bbfe453.js'); - soljson.push('soljson-v0.6.0+commit.26b70077.js'); + soljson.push('-v0.6.8+commit.0bbfe453.js'); + soljson.push('-v0.6.0+commit.26b70077.js'); for (let i = 0; i < soljson.length; i++) { const version = soljson[i]; From 0a1449dfeec985d83027446d87f1a6a78c23a52b Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 17:03:12 +0200 Subject: [PATCH 23/30] v3 --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3a41eadf9b..75fbb11323 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,10 +37,10 @@ jobs: - run: grep -ir "[0-9]+commit" apps/* libs/* --include \*.ts > soljson-versions.txt - restore_cache: keys: - - soljson-cache-{{ checksum "soljson-versions.txt" }} + - soljson-v3-{{ checksum "soljson-versions.txt" }} - run: yarn run downloadsolc_assets_e2e - save_cache: - key: soljson-cache-{{ checksum "soljson-versions.txt" }} + key: soljson-v3-{{ checksum "soljson-versions.txt" }} paths: - dist/apps/remix-ide/assets/js/soljson From d6f56ed3d4008457d3d606a7b8a042514e98b18c Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 17:20:20 +0200 Subject: [PATCH 24/30] 8.18 --- apps/remix-ide/ci/download_e2e_assets.js | 29 ++++++++---------------- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index f92803b9e4..ffc39956e9 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -10,31 +10,22 @@ if (child.error) { exit(1); } -// find words between single quotes starting with a number -const re2 = /(?<=\').*(?=\')/g; -let versions = child.stdout.match(re2); -console.log('versions found: ', versions); - -// get all words in versions -const re3 = /(?<=v).*/g; -let version2 = [] -for (let i = 0; i < versions.length; i++) { - const version = versions[i]; - if (version) { - const v = version.match(re3); - if (v) { - version2.push(v[0]); - } - } -} -console.log('versions found: ', version2); +console.log('stdout here: \n' + child.stdout) const re = /(?<=soljson).*(?=(.js))/g; let soljson = child.stdout.match(re); + +const re2 = /(?<=soljson).*(?=(\'))/g; +let soljson2 = child.stdout.match(re2); +soljson2 = soljson2.filter((item, index) => !item.includes('.js')); + +// merge the two arrays +soljson = soljson.concat(soljson2); + if (soljson) { // filter out duplicates - soljson = soljson.filter((item, index) => soljson.indexOf(item) === index); + //soljson = soljson.filter((item, index) => soljson.indexOf(item) === index); console.log('soljson versions found: ', soljson); // manually add some versions From 52e34bd903d18ed2fa4b52f9dec8ec5970ceffe7 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 17:32:27 +0200 Subject: [PATCH 25/30] fix urls --- .circleci/config.yml | 4 ++-- apps/remix-ide/ci/download_e2e_assets.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 75fbb11323..e1b341b551 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,10 +37,10 @@ jobs: - run: grep -ir "[0-9]+commit" apps/* libs/* --include \*.ts > soljson-versions.txt - restore_cache: keys: - - soljson-v3-{{ checksum "soljson-versions.txt" }} + - soljson-v4-{{ checksum "soljson-versions.txt" }} - run: yarn run downloadsolc_assets_e2e - save_cache: - key: soljson-v3-{{ checksum "soljson-versions.txt" }} + key: soljson-v4-{{ checksum "soljson-versions.txt" }} paths: - dist/apps/remix-ide/assets/js/soljson diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index ffc39956e9..8fe2dc41ac 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -10,8 +10,6 @@ if (child.error) { exit(1); } -console.log('stdout here: \n' + child.stdout) - const re = /(?<=soljson).*(?=(.js))/g; let soljson = child.stdout.match(re); @@ -26,11 +24,13 @@ soljson = soljson.concat(soljson2); if (soljson) { // filter out duplicates //soljson = soljson.filter((item, index) => soljson.indexOf(item) === index); - console.log('soljson versions found: ', soljson); + // manually add some versions - soljson.push('-v0.6.8+commit.0bbfe453.js'); - soljson.push('-v0.6.0+commit.26b70077.js'); + soljson.push('-v0.6.8+commit.0bbfe453'); + soljson.push('-v0.6.0+commit.26b70077'); + + console.log('soljson versions found: ', soljson); for (let i = 0; i < soljson.length; i++) { const version = soljson[i]; From d065574c517f5be972eda0596a1df3cbfa07cdf5 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 17:42:29 +0200 Subject: [PATCH 26/30] 7.6 --- apps/remix-ide/ci/download_e2e_assets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 8fe2dc41ac..3d42cd274a 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -10,7 +10,6 @@ if (child.error) { exit(1); } - const re = /(?<=soljson).*(?=(.js))/g; let soljson = child.stdout.match(re); @@ -29,6 +28,7 @@ if (soljson) { // manually add some versions soljson.push('-v0.6.8+commit.0bbfe453'); soljson.push('-v0.6.0+commit.26b70077'); + soljson.push('-v0.7.6+commit.7338295f'); console.log('soljson versions found: ', soljson); From e949e6fb934f2f3efd5bea2496215e734b00542d Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 18:10:16 +0200 Subject: [PATCH 27/30] fix regex --- .circleci/config.yml | 4 +-- apps/remix-ide/ci/download_e2e_assets.js | 36 +++++++++++++++--------- 2 files changed, 25 insertions(+), 15 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index e1b341b551..78ee7b3a95 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -37,10 +37,10 @@ jobs: - run: grep -ir "[0-9]+commit" apps/* libs/* --include \*.ts > soljson-versions.txt - restore_cache: keys: - - soljson-v4-{{ checksum "soljson-versions.txt" }} + - soljson-v5-{{ checksum "soljson-versions.txt" }} - run: yarn run downloadsolc_assets_e2e - save_cache: - key: soljson-v4-{{ checksum "soljson-versions.txt" }} + key: soljson-v5-{{ checksum "soljson-versions.txt" }} paths: - dist/apps/remix-ide/assets/js/soljson diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 3d42cd274a..8b44014669 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -10,25 +10,35 @@ if (child.error) { exit(1); } -const re = /(?<=soljson).*(?=(.js))/g; -let soljson = child.stdout.match(re); +const nonnightlyre = /v\d*\.\d*\.\d*\+commit\.[\d\w]*/g; -const re2 = /(?<=soljson).*(?=(\'))/g; -let soljson2 = child.stdout.match(re2); -soljson2 = soljson2.filter((item, index) => !item.includes('.js')); +let soljson = child.stdout.match(nonnightlyre); +console.log('non nightly soljson versions found: ', soljson); -// merge the two arrays +const quotedversionre = /\'\d*\.\d*\.\d*\+commit\.[\d\w]*/g; +let soljson2 = child.stdout.match(quotedversionre).map((item) => item.replace('\'', 'v')); +console.log('quoted soljson versions found: ', soljson2); + +const nightlyversions = /\d*\.\d*\.\d-nightly.*\+commit\.[\d\w]*/g +let soljson3 = child.stdout.match(nightlyversions).map((item) => 'v' + item); +console.log('nightly soljson versions found: ', soljson3); + +// merge the three arrays soljson = soljson.concat(soljson2); +soljson = soljson.concat(soljson3); + +console.log('soljson versions found: ', soljson); + + if (soljson) { // filter out duplicates - //soljson = soljson.filter((item, index) => soljson.indexOf(item) === index); + soljson = soljson.filter((item, index) => soljson.indexOf(item) === index); // manually add some versions - soljson.push('-v0.6.8+commit.0bbfe453'); - soljson.push('-v0.6.0+commit.26b70077'); - soljson.push('-v0.7.6+commit.7338295f'); + + soljson.push('v0.7.6+commit.7338295f'); console.log('soljson versions found: ', soljson); @@ -39,9 +49,9 @@ if (soljson) { // if nightly if (version.includes('nightly')) { - url = `https://binaries.soliditylang.org/bin/soljson${version}.js`; + url = `https://binaries.soliditylang.org/bin/soljson-${version}.js`; }else{ - url = `https://binaries.soliditylang.org/wasm/soljson${version}.js`; + url = `https://binaries.soliditylang.org/wasm/soljson-${version}.js`; } const dir = './dist/apps/remix-ide/assets/js/soljson'; @@ -49,7 +59,7 @@ if (soljson) { fs.mkdirSync(dir); } - const path = `./dist/apps/remix-ide/assets/js/soljson/soljson${version}.js`; + const path = `./dist/apps/remix-ide/assets/js/soljson/soljson-${version}.js`; // check if the file exists const exists = fs.existsSync(path); if (!exists) { From 19e62db8cd961af022549d9b1903d496ccd8e796 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 18:24:55 +0200 Subject: [PATCH 28/30] fix latest --- apps/remix-ide/ci/download_e2e_assets.js | 5 ++--- apps/remix-ide/ci/downloadsoljson.sh | 6 ++++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 8b44014669..027165fcdb 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -1,9 +1,8 @@ - const fs = require('fs'); var child_process = require('child_process'); const { exit } = require('process'); -var child = child_process.spawnSync('grep', ['-ir', '[0-9]+commit', 'libs/**/*', 'apps/**/*', '--include', '\*.ts'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); +var child = child_process.spawnSync('grep', ['-ir', '[0-9]+commit', 'libs/**/*', 'apps/**/*', '--include', '*.ts'], { encoding: 'utf8', cwd: process.cwd(), shell: true }); if (child.error) { console.log("ERROR: ", child); @@ -15,7 +14,7 @@ const nonnightlyre = /v\d*\.\d*\.\d*\+commit\.[\d\w]*/g; let soljson = child.stdout.match(nonnightlyre); console.log('non nightly soljson versions found: ', soljson); -const quotedversionre = /\'\d*\.\d*\.\d*\+commit\.[\d\w]*/g; +const quotedversionre = /'\d*\.\d*\.\d*\+commit\.[\d\w]*/g; let soljson2 = child.stdout.match(quotedversionre).map((item) => item.replace('\'', 'v')); console.log('quoted soljson versions found: ', soljson2); diff --git a/apps/remix-ide/ci/downloadsoljson.sh b/apps/remix-ide/ci/downloadsoljson.sh index 5a0d786bf1..5fdbfddf39 100644 --- a/apps/remix-ide/ci/downloadsoljson.sh +++ b/apps/remix-ide/ci/downloadsoljson.sh @@ -21,6 +21,12 @@ path="https://binaries.soliditylang.org/bin/$url" echo "path: $path" # download the file to ./apps/remix-ide/src/assets/js/soljson.js curl $path > ./apps/remix-ide/src/assets/js/soljson.js +# if directory ./apps/remix-ide/src/assets/js/soljson does not exist, create it +if [ ! -d "./apps/remix-ide/src/assets/js/soljson" ]; then + mkdir ./apps/remix-ide/src/assets/js/soljson +fi +cp ./apps/remix-ide/src/assets/js/soljson.js ./apps/remix-ide/src/assets/js/soljson/$url + # remove list.json rm list.json From 3004eda6fa42abddf3daac5af9924d656998d573 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 18:41:10 +0200 Subject: [PATCH 29/30] remixd --- apps/remix-ide/ci/download_e2e_assets.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 027165fcdb..1851e25abe 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -38,6 +38,7 @@ if (soljson) { // manually add some versions soljson.push('v0.7.6+commit.7338295f'); + soljson.push('v0.5.17+commit.d19bba13'); console.log('soljson versions found: ', soljson); From 9cc6c9ebedbae2bb3eaa776b3104559dc6d4b8c0 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Mon, 1 May 2023 18:43:56 +0200 Subject: [PATCH 30/30] rename --- apps/remix-ide/ci/download_e2e_assets.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/remix-ide/ci/download_e2e_assets.js b/apps/remix-ide/ci/download_e2e_assets.js index 1851e25abe..e8188428e1 100644 --- a/apps/remix-ide/ci/download_e2e_assets.js +++ b/apps/remix-ide/ci/download_e2e_assets.js @@ -9,17 +9,17 @@ if (child.error) { exit(1); } -const nonnightlyre = /v\d*\.\d*\.\d*\+commit\.[\d\w]*/g; +const nonNightlyRegex = /v\d*\.\d*\.\d*\+commit\.[\d\w]*/g; -let soljson = child.stdout.match(nonnightlyre); +let soljson = child.stdout.match(nonNightlyRegex); console.log('non nightly soljson versions found: ', soljson); -const quotedversionre = /'\d*\.\d*\.\d*\+commit\.[\d\w]*/g; -let soljson2 = child.stdout.match(quotedversionre).map((item) => item.replace('\'', 'v')); +const quotedVersionsRegex = /'\d*\.\d*\.\d*\+commit\.[\d\w]*/g; +let soljson2 = child.stdout.match(quotedVersionsRegex).map((item) => item.replace('\'', 'v')); console.log('quoted soljson versions found: ', soljson2); -const nightlyversions = /\d*\.\d*\.\d-nightly.*\+commit\.[\d\w]*/g -let soljson3 = child.stdout.match(nightlyversions).map((item) => 'v' + item); +const nightlyVersionsRegex = /\d*\.\d*\.\d-nightly.*\+commit\.[\d\w]*/g +let soljson3 = child.stdout.match(nightlyVersionsRegex).map((item) => 'v' + item); console.log('nightly soljson versions found: ', soljson3); // merge the three arrays