pull/4656/head
filip mertens 8 months ago committed by Aniket
parent 00caebd786
commit 1f58a72183
  1. 58
      apps/remix-ide/ci/downloadsoljson.sh
  2. 50
      apps/remix-ide/ci/downloadsoljson2.sh
  3. 2
      apps/remix-ide/webpack.config.js
  4. 1
      libs/remix-solidity/src/compiler/compiler.ts
  5. 1
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
  6. 1
      libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx

@ -1,34 +1,50 @@
#!/usr/bin/env bash #!/usr/bin/env bash
echo "Downloading latest soljson.js from https://binaries.soliditylang.org/wasm/list.json" echo "Downloading specified soljson.js version based on defaultVersion in package.json"
set -e set -e
# check if curl is installed
if ! command -v curl &> /dev/null # Check if curl and jq are installed
then if ! command -v curl &> /dev/null; then
echo "curl could not be found" echo "curl could not be found"
exit exit 1
fi
if ! command -v jq &> /dev/null; then
echo "jq could not be found"
exit 1
fi fi
# Read the defaultVersion from package.json
defaultVersion=$(jq -r '.defaultVersion' package.json)
echo "Specified version from package.json: $defaultVersion"
# download https://binaries.soliditylang.org/wasm/list.json as json # Download the list.json file containing available versions
curl -s https://binaries.soliditylang.org/wasm/list.json > list.json curl -s https://binaries.soliditylang.org/wasm/list.json > list.json
# get the latest version without jq
latest=$(grep 'latestRelease' list.json | cut -d '"' -f 4) # Use jq to extract the path for the specified version from the builds array
echo "latest version: $latest" path=$(jq -r --arg version "$defaultVersion" '.builds[] | select(.path==$version) | .path' list.json)
# get url if [ -z "$path" ]; then
url=$(grep "\"$latest\":" list.json | cut -d '"' -f 4) echo "The specified version $defaultVersion could not be found in the list"
echo "url: $url" exit 1
path="https://binaries.soliditylang.org/bin/$url" fi
echo "path: $path"
# download the file to ./apps/remix-ide/src/assets/js/soljson.js echo "Path for the specified version: $path"
curl -s $path > ./apps/remix-ide/src/assets/js/soljson.js fullPath="https://binaries.soliditylang.org/bin/$path"
# if directory ./apps/remix-ide/src/assets/js/soljson does not exist, create it echo "Download fullPath: $fullPath"
# Ensure the target directory exists
if [ ! -d "./apps/remix-ide/src/assets/js/soljson" ]; then if [ ! -d "./apps/remix-ide/src/assets/js/soljson" ]; then
mkdir ./apps/remix-ide/src/assets/js/soljson mkdir -p ./apps/remix-ide/src/assets/js/soljson
fi fi
cp ./apps/remix-ide/src/assets/js/soljson.js ./apps/remix-ide/src/assets/js/soljson/$url
# Download the file to ./apps/remix-ide/src/assets/js/soljson.js
echo "Downloading soljson.js from "$fullPath" to ./apps/remix-ide/src/assets/js/soljson.js"
curl -s "$fullPath" > ./apps/remix-ide/src/assets/js/soljson.js
# Copy the downloaded soljson.js to the specific version directory
cp ./apps/remix-ide/src/assets/js/soljson.js "./apps/remix-ide/src/assets/js/soljson/$path"
cp list.json ./apps/remix-ide/src/assets/list.json cp list.json ./apps/remix-ide/src/assets/list.json
# remove list.json # Clean up by removing the list.json
rm list.json rm list.json

@ -1,50 +0,0 @@
#!/usr/bin/env bash
echo "Downloading specified soljson.js version based on defaultVersion in package.json"
set -e
# Check if curl and jq are installed
if ! command -v curl &> /dev/null; then
echo "curl could not be found"
exit 1
fi
if ! command -v jq &> /dev/null; then
echo "jq could not be found"
exit 1
fi
# Read the defaultVersion from package.json
defaultVersion=$(jq -r '.defaultVersion' package.json)
echo "Specified version from package.json: $defaultVersion"
# Download the list.json file containing available versions
curl -s https://binaries.soliditylang.org/wasm/list.json > list.json
# Use jq to extract the path for the specified version from the builds array
path=$(jq -r --arg version "$defaultVersion" '.builds[] | select(.path==$version) | .path' list.json)
if [ -z "$path" ]; then
echo "The specified version $defaultVersion could not be found in the list"
exit 1
fi
echo "Path for the specified version: $path"
fullPath="https://binaries.soliditylang.org/bin/$path"
echo "Download fullPath: $fullPath"
# Ensure the target directory exists
if [ ! -d "./apps/remix-ide/src/assets/js/soljson" ]; then
mkdir -p ./apps/remix-ide/src/assets/js/soljson
fi
# Download the file to ./apps/remix-ide/src/assets/js/soljson.js
echo "Downloading soljson.js from "$fullPath" to ./apps/remix-ide/src/assets/js/soljson.js"
curl -s "$fullPath" > ./apps/remix-ide/src/assets/js/soljson.js
# Copy the downloaded soljson.js to the specific version directory
cp ./apps/remix-ide/src/assets/js/soljson.js "./apps/remix-ide/src/assets/js/soljson/$path"
cp list.json ./apps/remix-ide/src/assets/list.json
# Clean up by removing the list.json
rm list.json

@ -17,7 +17,7 @@ const versionData = {
const loadLocalSolJson = async () => { const loadLocalSolJson = async () => {
//execute apps/remix-ide/ci/downloadsoljson.sh //execute apps/remix-ide/ci/downloadsoljson.sh
console.log('loading local soljson') console.log('loading local soljson')
const child = require('child_process').execSync('bash ' + __dirname + '/ci/downloadsoljson2.sh', { encoding: 'utf8', cwd: process.cwd(), shell: true }) const child = require('child_process').execSync('bash ' + __dirname + '/ci/downloadsoljson.sh', { encoding: 'utf8', cwd: process.cwd(), shell: true })
// show output // show output
console.log(child) console.log(child)
} }

@ -112,7 +112,6 @@ export class Compiler {
*/ */
onCompilerLoaded(version: string, license: string): void { onCompilerLoaded(version: string, license: string): void {
console.log('compiler loaded:', version)
this.state.currentVersion = version this.state.currentVersion = version
this.state.compilerLicense = license this.state.compilerLicense = license
this.event.trigger('compilerLoaded', [version, license]) this.event.trigger('compilerLoaded', [version, license])

@ -19,7 +19,6 @@ import { CompilerDropdown } from './components/compiler-dropdown'
const defaultPath = 'compiler_config.json' const defaultPath = 'compiler_config.json'
console.log('local version', packageJson.defaultVersion)
declare global { declare global {
interface Window { interface Window {

@ -11,7 +11,6 @@ import './css/style.css'
import { iSolJsonBinData, iSolJsonBinDataBuild } from '@remix-project/remix-lib' import { iSolJsonBinData, iSolJsonBinDataBuild } from '@remix-project/remix-lib'
const defaultPath = 'compiler_config.json' const defaultPath = 'compiler_config.json'
console.log('local version', packageJson.defaultVersion)
export const SolidityCompiler = (props: SolidityCompilerProps) => { export const SolidityCompiler = (props: SolidityCompilerProps) => {
const { const {

Loading…
Cancel
Save