Skip to content

Commit 5777cbc

Browse files
filip mertensAniket-Engg
authored andcommitted
fix version
1 parent 8e8eeb5 commit 5777cbc

File tree

6 files changed

+61
-4
lines changed

6 files changed

+61
-4
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env bash
2+
3+
echo "Downloading specified soljson.js version based on defaultVersion in package.json"
4+
5+
set -e
6+
7+
# Check if curl and jq are installed
8+
if ! command -v curl &> /dev/null; then
9+
echo "curl could not be found"
10+
exit 1
11+
fi
12+
13+
if ! command -v jq &> /dev/null; then
14+
echo "jq could not be found"
15+
exit 1
16+
fi
17+
18+
# Read the defaultVersion from package.json
19+
defaultVersion=$(jq -r '.defaultVersion' package.json)
20+
echo "Specified version from package.json: $defaultVersion"
21+
22+
# Download the list.json file containing available versions
23+
curl -s https://binaries.soliditylang.org/wasm/list.json > list.json
24+
25+
# Use jq to extract the path for the specified version from the builds array
26+
path=$(jq -r --arg version "$defaultVersion" '.builds[] | select(.path==$version) | .path' list.json)
27+
if [ -z "$path" ]; then
28+
echo "The specified version $defaultVersion could not be found in the list"
29+
exit 1
30+
fi
31+
32+
echo "Path for the specified version: $path"
33+
fullPath="https://binaries.soliditylang.org/bin/$path"
34+
echo "Download fullPath: $fullPath"
35+
36+
# Ensure the target directory exists
37+
if [ ! -d "./apps/remix-ide/src/assets/js/soljson" ]; then
38+
mkdir -p ./apps/remix-ide/src/assets/js/soljson
39+
fi
40+
41+
# Download the file to ./apps/remix-ide/src/assets/js/soljson.js
42+
curl -s "$fullPath" > ./apps/remix-ide/src/assets/js/soljson.js
43+
44+
# Copy the downloaded soljson.js to the specific version directory
45+
cp ./apps/remix-ide/src/assets/js/soljson.js "./apps/remix-ide/src/assets/js/soljson/$path"
46+
cp list.json ./apps/remix-ide/src/assets/list.json
47+
48+
# Clean up by removing the list.json
49+
rm list.json

apps/remix-ide/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const versionData = {
1616

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

libs/remix-solidity/src/compiler/compiler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export class Compiler {
112112
*/
113113

114114
onCompilerLoaded(version: string, license: string): void {
115+
console.log('compiler loaded:', version)
115116
this.state.currentVersion = version
116117
this.state.compilerLicense = license
117118
this.event.trigger('compilerLoaded', [version, license])

libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ import {getValidLanguage} from '@remix-project/remix-solidity'
1111
import {CopyToClipboard} from '@remix-ui/clipboard'
1212
import {configFileContent} from './compilerConfiguration'
1313
import { appPlatformTypes, platformContext, onLineContext } from '@remix-ui/app'
14+
import * as packageJson from '../../../../../package.json'
1415

1516
import './css/style.css'
1617

1718
import { CompilerDropdown } from './components/compiler-dropdown'
1819

1920

2021
const defaultPath = 'compiler_config.json'
22+
console.log('local version', packageJson.defaultVersion)
2123

2224
declare global {
2325
interface Window {
@@ -61,7 +63,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
6163
downloaded: [],
6264
compilerLicense: null,
6365
selectedVersion: null,
64-
defaultVersion: 'soljson-v0.8.24+commit.e11b9ed9.js', // this default version is defined: in makeMockCompiler (for browser test)
66+
defaultVersion: packageJson.defaultVersion, // this default version is defined: in makeMockCompiler (for browser test)
6567
runs: '',
6668
compiledFileName: '',
6769
includeNightlies: false,

libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ import { Toaster } from '@remix-ui/toaster' // eslint-disable-line
66
import { ModalDialog } from '@remix-ui/modal-dialog' // eslint-disable-line
77
import { Renderer } from '@remix-ui/renderer' // eslint-disable-line
88
import { baseURLBin, baseURLWasm, pathToURL } from '@remix-project/remix-solidity'
9-
9+
import * as packageJson from '../../../../../package.json'
1010
import './css/style.css'
1111
import { iSolJsonBinData, iSolJsonBinDataBuild } from '@remix-project/remix-lib'
1212

13+
const defaultPath = 'compiler_config.json'
14+
console.log('local version', packageJson.defaultVersion)
15+
1316
export const SolidityCompiler = (props: SolidityCompilerProps) => {
1417
const {
1518
api,
@@ -39,8 +42,9 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
3942
handleHide: null
4043
},
4144
solJsonBinData: null,
42-
defaultVersion: 'soljson-v0.8.25+commit.b61c2a91.js', // this default version is defined: in makeMockCompiler (for browser test)
45+
defaultVersion: packageJson.defaultVersion, // this default version is defined: in makeMockCompiler (for browser test)
4346
})
47+
4448
const [currentVersion, setCurrentVersion] = useState('')
4549
const [hideWarnings, setHideWarnings] = useState<boolean>(false)
4650
const [compileErrors, setCompileErrors] = useState<Record<string, CompileErrors>>({ [currentFile]: api.compileErrors })

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"license": "MIT",
55
"description": "Ethereum Remix Monorepo",
66
"main": "index.js",
7+
"defaultVersion": "soljson-v0.8.24+commit.e11b9ed9.js",
78
"keywords": [
89
"ethereum",
910
"solidity",

0 commit comments

Comments
 (0)