fix version

pull/4656/head
filip mertens 8 months ago committed by Aniket
parent 8e8eeb527d
commit 5777cbc533
  1. 49
      apps/remix-ide/ci/downloadsoljson2.sh
  2. 2
      apps/remix-ide/webpack.config.js
  3. 1
      libs/remix-solidity/src/compiler/compiler.ts
  4. 4
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
  5. 8
      libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx
  6. 1
      package.json

@ -0,0 +1,49 @@
#!/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
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

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

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

@ -11,6 +11,7 @@ import {getValidLanguage} from '@remix-project/remix-solidity'
import {CopyToClipboard} from '@remix-ui/clipboard'
import {configFileContent} from './compilerConfiguration'
import { appPlatformTypes, platformContext, onLineContext } from '@remix-ui/app'
import * as packageJson from '../../../../../package.json'
import './css/style.css'
@ -18,6 +19,7 @@ import { CompilerDropdown } from './components/compiler-dropdown'
const defaultPath = 'compiler_config.json'
console.log('local version', packageJson.defaultVersion)
declare global {
interface Window {
@ -61,7 +63,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
downloaded: [],
compilerLicense: null,
selectedVersion: null,
defaultVersion: 'soljson-v0.8.24+commit.e11b9ed9.js', // this default version is defined: in makeMockCompiler (for browser test)
defaultVersion: packageJson.defaultVersion, // this default version is defined: in makeMockCompiler (for browser test)
runs: '',
compiledFileName: '',
includeNightlies: false,

@ -6,10 +6,13 @@ import { Toaster } from '@remix-ui/toaster' // eslint-disable-line
import { ModalDialog } from '@remix-ui/modal-dialog' // eslint-disable-line
import { Renderer } from '@remix-ui/renderer' // eslint-disable-line
import { baseURLBin, baseURLWasm, pathToURL } from '@remix-project/remix-solidity'
import * as packageJson from '../../../../../package.json'
import './css/style.css'
import { iSolJsonBinData, iSolJsonBinDataBuild } from '@remix-project/remix-lib'
const defaultPath = 'compiler_config.json'
console.log('local version', packageJson.defaultVersion)
export const SolidityCompiler = (props: SolidityCompilerProps) => {
const {
api,
@ -39,8 +42,9 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
handleHide: null
},
solJsonBinData: null,
defaultVersion: 'soljson-v0.8.25+commit.b61c2a91.js', // this default version is defined: in makeMockCompiler (for browser test)
defaultVersion: packageJson.defaultVersion, // this default version is defined: in makeMockCompiler (for browser test)
})
const [currentVersion, setCurrentVersion] = useState('')
const [hideWarnings, setHideWarnings] = useState<boolean>(false)
const [compileErrors, setCompileErrors] = useState<Record<string, CompileErrors>>({ [currentFile]: api.compileErrors })

@ -4,6 +4,7 @@
"license": "MIT",
"description": "Ethereum Remix Monorepo",
"main": "index.js",
"defaultVersion": "soljson-v0.8.24+commit.e11b9ed9.js",
"keywords": [
"ethereum",
"solidity",

Loading…
Cancel
Save