load local soljson in webpack

pull/3660/head
filip mertens 2 years ago committed by Aniket
parent ce657ef428
commit d022973f6c
  1. 5
      .circleci/config.yml
  2. 1
      .github/workflows/publish-action.yml
  3. 28
      apps/remix-ide/webpack.config.js
  4. 2
      package.json

@ -155,7 +155,7 @@ jobs:
at: . at: .
- run: unzip ./persist/dist.zip - run: unzip ./persist/dist.zip
- run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules - run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules
- run: yarn run downloadsolc_assets_e2e && yarn run downloadsolc_assets_dist - run: yarn run downloadsolc_assets_e2e
- run: ls -la ./dist/apps/remix-ide/assets/js - run: ls -la ./dist/apps/remix-ide/assets/js
- run: yarn run selenium-install || yarn run selenium-install - run: yarn run selenium-install || yarn run selenium-install
- run: - run:
@ -202,7 +202,7 @@ jobs:
- run: unzip ./persist/dist.zip - run: unzip ./persist/dist.zip
- run: unzip ./persist/plugin-<< parameters.plugin >>.zip - run: unzip ./persist/plugin-<< parameters.plugin >>.zip
- run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules - run: yarn install --cwd ./apps/remix-ide-e2e --modules-folder ../../node_modules
- run: yarn run downloadsolc_assets_e2e && yarn run downloadsolc_assets_dist - run: yarn run downloadsolc_assets_e2e
- run: yarn run selenium-install || yarn run selenium-install - run: yarn run selenium-install || yarn run selenium-install
- run: - run:
name: Start Selenium name: Start Selenium
@ -232,7 +232,6 @@ jobs:
paths: paths:
- node_modules - node_modules
- run: yarn build:production - run: yarn build:production
- run: yarn run downloadsolc_assets_dist
- run: mkdir persist && zip -0 -r persist/predeploy.zip dist - run: mkdir persist && zip -0 -r persist/predeploy.zip dist
- persist_to_workspace: - persist_to_workspace:
root: . root: .

@ -15,7 +15,6 @@ jobs:
- run: yarn install - run: yarn install
- run: ls - run: ls
- run: pwd - run: pwd
- run: yarn run downloadsolc_assets
- run: yarn run build:production - run: yarn run build:production
- run: echo "action_state=$('./apps/remix-ide/ci/publishIpfs' ${{ secrets.IPFS_PROJET_ID }} ${{ secrets.IPFS_PROJECT_SECRET }})" >> $GITHUB_ENV - run: echo "action_state=$('./apps/remix-ide/ci/publishIpfs' ${{ secrets.IPFS_PROJET_ID }} ${{ secrets.IPFS_PROJECT_SECRET }})" >> $GITHUB_ENV
- uses: mshick/add-pr-comment@v1 - uses: mshick/add-pr-comment@v1

@ -6,6 +6,7 @@ const version = require('../../package.json').version
const fs = require('fs') const fs = require('fs')
const TerserPlugin = require("terser-webpack-plugin") const TerserPlugin = require("terser-webpack-plugin")
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin") const CssMinimizerPlugin = require("css-minimizer-webpack-plugin")
const axios = require('axios')
const versionData = { const versionData = {
version: version, version: version,
@ -13,8 +14,33 @@ const versionData = {
mode: process.env.NODE_ENV === 'production' ? 'production' : 'development' mode: process.env.NODE_ENV === 'production' ? 'production' : 'development'
} }
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://solc-bin.ethereum.org/wasm/${info.builds[0].path}`;
console.log(`Copying... ${buildurl} to assets`)
const path = `./dist/apps/remix-ide/assets/js/soljson.js`;
axios({
method: 'get',
url: buildurl,
responseType: 'stream'
}).then(function (response) {
response.data.pipe(fs.createWriteStream(path));
})
}
)
}
fs.writeFileSync('./apps/remix-ide/src/assets/version.json', JSON.stringify(versionData)) fs.writeFileSync('./apps/remix-ide/src/assets/version.json', JSON.stringify(versionData))
loadLocalSolJson()
const project = fs.readFileSync('./apps/remix-ide/project.json', 'utf8') const project = fs.readFileSync('./apps/remix-ide/project.json', 'utf8')
const implicitDependencies = JSON.parse(project).implicitDependencies const implicitDependencies = JSON.parse(project).implicitDependencies
@ -120,3 +146,5 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
return config; return config;
}); });

@ -58,8 +58,6 @@
"browsertest": "sleep 5 && yarn run nightwatch_local", "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/", "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": "node ./apps/remix-ide/ci/download_e2e_assets.js", "downloadsolc_assets_e2e": "node ./apps/remix-ide/ci/download_e2e_assets.js",
"downloadsolc_assets": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.18+commit.87f61d96.js -O ./apps/remix-ide/src/assets/js/soljson.js",
"downloadsolc_assets_dist": "wget --no-check-certificate https://binaries.soliditylang.org/wasm/soljson-v0.8.18+commit.87f61d96.js -O ./dist/apps/remix-ide/assets/js/soljson.js",
"make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js", "make-mock-compiler": "node apps/remix-ide/ci/makeMockCompiler.js",
"minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false", "minify": "uglifyjs --in-source-map inline --source-map-inline -c warnings=false",
"build:production": "NODE_ENV=production nx build remix-ide --configuration=production --skip-nx-cache", "build:production": "NODE_ENV=production nx build remix-ide --configuration=production --skip-nx-cache",

Loading…
Cancel
Save