compiler loader

pull/4346/head
filip mertens 11 months ago
parent 929bc8892f
commit 8efdbb3a5b
  1. 12
      apps/remix-ide-e2e/src/commands/setSolidityCompilerVersion.ts
  2. 2
      apps/remix-ide-e2e/src/local-plugin/src/app/Client.ts
  3. 56
      apps/remix-ide/src/app/plugins/electron/compilerLoaderPlugin.ts
  4. 2
      apps/remix-ide/src/app/plugins/solidity-script.tsx
  5. 6
      apps/remix-ide/src/app/tabs/compile-tab.js
  6. 8
      apps/remixdesktop/package.json
  7. 119
      apps/remixdesktop/src/plugins/compilerLoader.ts
  8. 4
      apps/remixdesktop/src/plugins/xtermPlugin.ts
  9. 72
      apps/remixdesktop/yarn.lock
  10. 4
      apps/solidity-compiler/src/app/compiler.ts
  11. 11
      libs/remix-lib/src/types/ICompilerApi.ts
  12. 5
      libs/remix-ui/solidity-compiler/src/lib/api/compiler-api.ts
  13. 139
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
  14. 4
      libs/remix-ui/solidity-compiler/src/lib/components/compiler-dropdown.tsx
  15. 24
      libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts
  16. 109
      libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx
  17. 42
      libs/remix-ui/vertical-icons-panel/src/lib/remix-ui-vertical-icons-panel.tsx
  18. 2
      libs/remix-ui/xterm/src/lib/components/remix-ui-xterminals.tsx
  19. 18
      package.json
  20. 134
      yarn.lock

@ -8,16 +8,12 @@ class SetSolidityCompilerVersion extends EventEmitter {
selector: "//*[@id='versionSelector']",
locateStrategy: 'xpath'
})
.waitForElementPresent({
selector: `//option[@value='${version}']`,
.click({
selector: "//*[@id='versionSelector']",
locateStrategy: 'xpath'
})
.click(`#compileTabView #versionSelector [value="${version}"]`)
.waitForElementPresent({
selector: `//span[@data-version='${version}']`,
locateStrategy: 'xpath',
timeout: 60000
})
.waitForElementVisible(`[data-id="dropdown-item-${version}"]`)
.click(`[data-id="dropdown-item-${version}"]`)
.perform(() => {
this.emit('complete')
})

@ -4,7 +4,7 @@ export class RemixPlugin extends PluginClient {
constructor () {
super()
this.methods = ['testCommand']
createClient(this)
createClient(this as any)
}
async testCommand (data: any) {

@ -1,5 +1,8 @@
import { ElectronPlugin } from '@remixproject/engine-electron';
import { Plugin } from '@remixproject/engine';
import { baseURLBin, baseURLWasm } from '@remix-project/remix-solidity'
import axios, {AxiosResponse} from 'axios'
import { iSolJsonBinData } from '@remix-project/remix-lib'
const profile = {
displayName: 'compilerLoader',
@ -7,7 +10,7 @@ const profile = {
description: 'Loads the compiler for offline use',
}
const methods = ['getBaseUrls']
const methods = ['getJsonBinData']
export class compilerLoaderPlugin extends Plugin {
constructor() {
@ -15,9 +18,39 @@ export class compilerLoaderPlugin extends Plugin {
this.methods = methods
}
async getBaseUrls() {
async getJsonBinData() {
let response: iSolJsonBinData = {
baseURLBin: '',
baseURLWasm: '',
binList: [],
wasmList: [],
selectorList: []
}
let binRes: AxiosResponse
let wasmRes: AxiosResponse
try {
// fetch normal builds
binRes = await axios(`${baseURLBin}/list.json`)
// fetch wasm builds
wasmRes = await axios(`${baseURLWasm}/list.json`)
} catch (e) {
}
if (wasmRes.status === 200) {
response.wasmList = wasmRes.data.builds
}
if (binRes.status === 200) {
response.binList = binRes.data.builds
}
response.baseURLBin = baseURLBin
response.baseURLWasm = baseURLWasm
this.emit('jsonBinDataLoaded', response)
}
async onActivation(): Promise<void> {
}
}
export class compilerLoaderPluginDesktop extends ElectronPlugin {
@ -26,24 +59,11 @@ export class compilerLoaderPluginDesktop extends ElectronPlugin {
this.methods = []
}
onActivation(): void {
this.on('compilerloader', 'downloadFinished', (path, url) => {
console.log('downloadFinished', path, url)
this.call('terminal', 'logHtml', 'Compiler downloaded from ' + url + ' to ' + path)
})
async onActivation(): Promise<void> {
this.on('solidity', 'loadingCompiler', async (url) => {
console.log('loadingCompiler in compilerloader', url, this)
await this.call('compilerloader', 'downloadCompiler', url)
const compilerList = await this.call('compilerloader', 'listCompilers')
console.log('compilerList', compilerList)
this.emit('compilersDownloaded', compilerList)
})
this.on('compilerloader', 'setSolJsonBinData', (url) => {
console.log('setSolJsonBinData', url)
})
}
}

@ -21,7 +21,7 @@ export class SolidityScript extends Plugin {
_paq.push(['trackEvent', 'SolidityScript', 'execute', 'script'])
this.call('terminal', 'log', `Running free function '${functionName}' from ${path}...`)
let content = await this.call('fileManager', 'readFile', path)
const params = await this.call('solidity', 'getCompilerParameters')
const params = await this.call('solidity', 'getCompilerQueryParameters')
content = `
// SPDX-License-Identifier: GPL-3.0

@ -21,7 +21,7 @@ const profile = {
documentation: 'https://remix-ide.readthedocs.io/en/latest/compile.html',
version: packageJson.version,
maintainedBy: 'Remix',
methods: ['getCompilationResult', 'compile', 'compileWithParameters', 'setCompilerConfig', 'compileFile', 'getCompilerState', 'getCompilerParameters', 'getCompiler']
methods: ['getCompilationResult', 'compile', 'compileWithParameters', 'setCompilerConfig', 'compileFile', 'getCompilerState', 'getCompilerQueryParameters', 'getCompiler']
}
// EditorApi:
@ -138,7 +138,7 @@ class CompileTab extends CompilerApiMixin(ViewPlugin) { // implements ICompilerA
return this.compileTabLogic.compiler
}
getCompilerParameters () {
getCompilerQueryParameters () {
const params = this.queryParams.get()
params.evmVersion = params.evmVersion === 'null' || params.evmVersion === 'undefined' ? null : params.evmVersion
params.optimize = (params.optimize === 'false' || params.optimize === null || params.optimize === undefined) ? false : params.optimize
@ -146,7 +146,7 @@ class CompileTab extends CompilerApiMixin(ViewPlugin) { // implements ICompilerA
return params
}
setCompilerParameters (params) {
setCompilerQueryParameters (params) {
this.queryParams.update(params)
}

@ -38,10 +38,10 @@
},
"dependencies": {
"@remix-project/remix-url-resolver": "^0.0.65",
"@remixproject/engine": "0.3.37",
"@remixproject/engine-electron": "0.3.37",
"@remixproject/plugin": "0.3.37",
"@remixproject/plugin-electron": "0.3.37",
"@remixproject/engine": "0.3.41",
"@remixproject/engine-electron": "0.3.41",
"@remixproject/plugin": "0.3.41",
"@remixproject/plugin-electron": "0.3.41",
"@vscode/ripgrep": "^1.15.6",
"add": "^2.0.6",
"axios": "^1.6.1",

@ -1,10 +1,10 @@
import { Profile } from '@remixproject/plugin-utils'
import { ElectronBasePlugin, ElectronBasePluginClient } from '@remixproject/plugin-electron'
import {Profile} from '@remixproject/plugin-utils'
import {ElectronBasePlugin, ElectronBasePluginClient} from '@remixproject/plugin-electron'
import fs from 'fs/promises'
import axios from 'axios'
import express from 'express'
import { cacheDir } from '../utils/config'
import {cacheDir} from '../utils/config'
export const baseURLBin = 'https://binaries.soliditylang.org/bin'
export const baseURLWasm = 'https://binaries.soliditylang.org/wasm'
@ -27,56 +27,50 @@ export class CompilerLoaderPlugin extends ElectronBasePlugin {
clients: CompilerLoaderPluginClient[] = []
constructor() {
super(profile, clientProfile, CompilerLoaderPluginClient)
this.methods = [...super.methods, 'getPort'];
(async()=>{
this.methods = [...super.methods]
;(async () => {
await getLists()
})()
}
async getPort(): Promise<number> {
return (server.address() as any).port
}
}
const clientProfile: Profile = {
name: 'compilerloader',
displayName: 'compilerloader',
description: 'Compiler Loader',
methods: ['getPort', 'downloadCompiler', 'listCompilers', 'getBaseUrls', 'getLists'],
methods: ['downloadCompiler', 'listCompilers', 'getBaseUrls', 'getJsonBinData'],
}
export interface iSolJsonBinDataBuild {
path: string,
version: string,
build: string,
longVersion: string,
path: string
version: string
build: string
longVersion: string
wasmURL: string
binURL: string
isDownloaded: boolean
}
export interface iSolJsonBinData {
baseURLWasm: string,
baseURLBin: string,
wasmList: iSolJsonBinDataBuild[],
baseURLWasm: string
baseURLBin: string
wasmList: iSolJsonBinDataBuild[]
binList: iSolJsonBinDataBuild[]
}
class CompilerLoaderPluginClient extends ElectronBasePluginClient {
solJsonBinData: iSolJsonBinData
constructor(webContentsId: number, profile: Profile) {
super(webContentsId, profile)
}
async onActivation(): Promise<void> {
const lists = await this.getLists()
console.log('onActivation', (server.address() as any))
const baseURLS: iSolJsonBinData = {
baseURLWasm: 'http://localhost:' + (server.address() as any).port + '/compilers',
baseURLBin: 'http://localhost:' + (server.address() as any).port + '/compilers',
wasmList: lists.wasmData,
binList: lists.binData
}
this.emit('setSolJsonBinData', baseURLS)
}
async getPort(): Promise<number> {
return (server.address() as any).port
console.log('onActivation', 'CompilerLoaderPluginClient')
this.onload(() => {
console.log('onload', 'CompilerLoaderPluginClient')
this.emit('loaded')
})
}
async downloadCompiler(url: string): Promise<void> {
@ -91,8 +85,7 @@ class CompilerLoaderPluginClient extends ElectronBasePluginClient {
if (await fs.stat(filePath)) {
return
}
}
catch (e) {
} catch (e) {
// do nothing
}
}
@ -116,7 +109,9 @@ class CompilerLoaderPluginClient extends ElectronBasePluginClient {
const filePath = cacheDir + '/compilers/' + fileName
await fs.writeFile(filePath, file)
console.log('downloaded', filePath)
this.emit('downloadFinished', fileName, url)
plugin.call('terminal' as any, 'logHtml', 'Compiler downloaded from ' + url + ' to ' + fileName)
await plugin.getJsonBinData()
//this.emit('downloadFinished', fileName, url)
}
} catch (e: any) {
plugin.call('terminal' as any, 'log', {
@ -132,53 +127,67 @@ class CompilerLoaderPluginClient extends ElectronBasePluginClient {
return compilers
}
async getBaseUrls(){
async getJsonBinData() {
const lists = await this.getLists()
console.log('getJsonBinData', Date.now())
this.solJsonBinData = {
baseURLWasm: 'http://localhost:' + (server.address() as any).port + '/compilers',
baseURLBin: 'http://localhost:' + (server.address() as any).port + '/compilers',
wasmList: lists.wasmData,
binList: lists.binData,
}
console.log('emit', Date.now())
const localCompilers = await this.listCompilers()
this.solJsonBinData.wasmList = this.solJsonBinData.wasmList.map((item) => {
localCompilers.includes(item.path) ? (item.wasmURL = 'http://localhost:' + (server.address() as any).port + '/compilers/') && (item.isDownloaded=true) : (item.wasmURL = baseURLWasm) && (item.isDownloaded = false)
return item
})
this.solJsonBinData.binList = this.solJsonBinData.binList.map((item) => {
localCompilers.includes(item.path) ? (item.binURL = 'http://localhost:' + (server.address() as any).port + '/compilers/') && (item.isDownloaded=true) : (item.binURL = baseURLBin) && (item.isDownloaded = false)
return item
})
this.emit('jsonBinDataLoaded', this.solJsonBinData)
}
async getLists(){
async getLists() {
return await getLists()
}
}
const getLists = async()=>{
const getLists = async () => {
let binData
let wasmData
try{
try {
const binRes = await axios.get(baseURLBin + '/list.json')
await fs.writeFile(cacheDir + '/binlist.json', JSON.stringify(binRes.data, null, 2))
binData = binRes.data
}catch(e) {
}
} catch (e) {}
try{
try {
const wasmRes = await axios.get(baseURLWasm + '/list.json')
await fs.writeFile(cacheDir + '/wasmlist.json', JSON.stringify(wasmRes.data, null, 2))
wasmData = wasmRes.data
}catch(e) {
}
} catch (e) {}
if(!wasmData){
try{
wasmData = JSON.parse(await fs.readFile(cacheDir + '/wasmlist.json', 'utf8'));
}catch(e){
if (!wasmData) {
try {
wasmData = JSON.parse(await fs.readFile(cacheDir + '/wasmlist.json', 'utf8'))
} catch (e) {
wasmData = {}
}
}
if(!binData){
try{
binData = JSON.parse(await fs.readFile(cacheDir + '/binlist.json', 'utf8'));
}catch(e){
if (!binData) {
try {
binData = JSON.parse(await fs.readFile(cacheDir + '/binlist.json', 'utf8'))
} catch (e) {
binData = {}
}
}
return {
binData: binData.builds as any[], wasmData: wasmData.builds as any[]
binData: binData.builds as any[],
wasmData: wasmData.builds as any[],
}
}
}

@ -97,7 +97,7 @@ const clientProfile: Profile = {
name: 'xterm',
displayName: 'xterm',
description: 'xterm plugin',
methods: ['createTerminal', 'close', 'keystroke', 'getShells', 'resize'],
methods: ['createTerminal', 'closeTerminal', 'keystroke', 'getShells', 'resize'],
}
class XtermPluginClient extends ElectronBasePluginClient {
@ -165,7 +165,7 @@ class XtermPluginClient extends ElectronBasePluginClient {
return ptyProcess.pid
}
async close(pid: number): Promise<void> {
async closeTerminal(pid: number): Promise<void> {
this.terminals[pid].kill()
delete this.terminals[pid]
this.emit('close', pid)

@ -666,54 +666,54 @@
ethers "^5.4.2"
web3 "^1.5.1"
"@remixproject/engine-electron@0.3.37":
version "0.3.37"
resolved "https://registry.npmjs.org/@remixproject/engine-electron/-/engine-electron-0.3.37.tgz"
integrity sha512-XQea0a5SPtYtOl1XH8qu9AN+Fkc/LSZ8FYuxenFUeczqy9t4gxlPibLrCQXSlrcNEdoGhDE/DW/wltQoX8JLtg==
"@remixproject/engine-electron@0.3.41":
version "0.3.41"
resolved "https://registry.yarnpkg.com/@remixproject/engine-electron/-/engine-electron-0.3.41.tgz#a354d4a4dd43ade644ea27636cfc0aa63c5155b2"
integrity sha512-fF2l3LkDVK1KjkIHll7mOo6AkjUg4hgbHG2jDzHZW6m1jYr6SGxauVoYlOQvlfTe283dpsGxWEdU7TOC8Kne7w==
dependencies:
"@remixproject/engine" "0.3.37"
"@remixproject/plugin-api" "0.3.37"
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/engine" "0.3.41"
"@remixproject/plugin-api" "0.3.41"
"@remixproject/plugin-utils" "0.3.41"
"@remixproject/engine@0.3.37":
version "0.3.37"
resolved "https://registry.npmjs.org/@remixproject/engine/-/engine-0.3.37.tgz"
integrity sha512-+dO32Bdgm2GLlamCnCWIPYX0v57Ft2vWGkFwXil1xiLvPttVOjnSPkqz9Xu0DAqDIqXIr4A15E2pHklVR+shLQ==
"@remixproject/engine@0.3.41":
version "0.3.41"
resolved "https://registry.yarnpkg.com/@remixproject/engine/-/engine-0.3.41.tgz#71b447d07dd52ec7645c6538f64caa638f3d9702"
integrity sha512-5ppAEana+I9FvSOjdNoLkLFbBTIpLoN5DAKsw+efyZ076i/67OsZ6oHXZqzGoHTOr4s4aS0wHmCBJPSla8GUBA==
dependencies:
"@remixproject/plugin-api" "0.3.37"
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/plugin-api" "0.3.41"
"@remixproject/plugin-utils" "0.3.41"
"@remixproject/plugin-api@0.3.37":
version "0.3.37"
resolved "https://registry.npmjs.org/@remixproject/plugin-api/-/plugin-api-0.3.37.tgz"
integrity sha512-bJ8oIpaI4qP3/Ku7jxXW3XRkTyQ2hjWX6N8yob3d/jjHtaJ/IorDx/vieGXQoJTPKAMPol0KVKCVCxx+xmzcUQ==
"@remixproject/plugin-api@0.3.41":
version "0.3.41"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-api/-/plugin-api-0.3.41.tgz#9a60d92332af608a871366bec6097bda2d2d1658"
integrity sha512-+gZOzJH4KUMVOEYFFW4LwwCWbojACqxvLM9FJRRkHehohue07Y7ojIbFoYk4EPWkdBtOXOsIR2zjdUIUlzzrTg==
dependencies:
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/plugin-utils" "0.3.41"
"@remixproject/plugin-electron@0.3.37":
version "0.3.37"
resolved "https://registry.npmjs.org/@remixproject/plugin-electron/-/plugin-electron-0.3.37.tgz"
integrity sha512-ZmkYLk9LEewPCqXIiMPJC8ZpgRjMW3dh2LbgeSGhKG0ly8pD5VuZj3/07iP/ZvjDNuTliX08gqvCru9/oOskqA==
"@remixproject/plugin-electron@0.3.41":
version "0.3.41"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-electron/-/plugin-electron-0.3.41.tgz#6f736dfa5146bdf41fe0c452ab0b78e7f914fda1"
integrity sha512-E/rmKSbUa4rZKq02C+HD6WQDTS2CH6+Gqc6Z9p5wxQwbbJoMD/WVtWUvOFr1p2PSp0Nwpc4qWfOoQC6EmaugOg==
dependencies:
"@remixproject/engine" "0.3.37"
"@remixproject/plugin" "0.3.37"
"@remixproject/plugin-api" "0.3.37"
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/engine" "0.3.41"
"@remixproject/plugin" "0.3.41"
"@remixproject/plugin-api" "0.3.41"
"@remixproject/plugin-utils" "0.3.41"
"@remixproject/plugin-utils@0.3.37":
version "0.3.37"
resolved "https://registry.npmjs.org/@remixproject/plugin-utils/-/plugin-utils-0.3.37.tgz"
integrity sha512-Ow4gFf15ym7Sysza4hx4+QEYQHvluu0pDEj3GlNAMWAbvbjBGxb7O81b3Tvu7n8ywESYJlbIifNr++vYY63+PQ==
"@remixproject/plugin-utils@0.3.41":
version "0.3.41"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-utils/-/plugin-utils-0.3.41.tgz#6de4d016084cf54fbf710ed717c9c1efc0a990de"
integrity sha512-pyqewxfQwr35YkFoZItH5E9qiIZRlpwxLuGBCMXzo6fmPm2YybhpblLaefppsdbqY1yEVsqakQa6U6d6vJRSNQ==
dependencies:
tslib "2.0.1"
"@remixproject/plugin@0.3.37":
version "0.3.37"
resolved "https://registry.npmjs.org/@remixproject/plugin/-/plugin-0.3.37.tgz"
integrity sha512-3DgGCPE78ThfqGUJlrWwdArRol2nLZMBHTZpPxLE9K4tpspY7G1KV8HLB55mkX/uPVvVbNTRoFI4TNm87Jjiwg==
"@remixproject/plugin@0.3.41":
version "0.3.41"
resolved "https://registry.yarnpkg.com/@remixproject/plugin/-/plugin-0.3.41.tgz#fc82d0afd08ba659d09ee7714fa91af92cdb8e72"
integrity sha512-GqBaxExtNGQHNHwPwx/2RKX7vinEBJe9KzxzkzR2BGuBZD963+il2WsMu+QYyHjTxJ8kHZF9exqUSYJd9jZ+Yw==
dependencies:
"@remixproject/plugin-api" "0.3.37"
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/plugin-api" "0.3.41"
"@remixproject/plugin-utils" "0.3.41"
events "3.2.0"
"@scure/base@~1.1.0":

@ -25,7 +25,7 @@ export class CompilerClientApi extends CompilerApiMixin(PluginClient) implements
this.initCompilerApi()
}
getCompilerParameters () {
getCompilerQueryParameters () {
const params = {
runs: localStorage.getItem('runs') || defaultCompilerParameters.runs,
optimize: localStorage.getItem('optimize') === 'true',
@ -38,7 +38,7 @@ export class CompilerClientApi extends CompilerApiMixin(PluginClient) implements
return params
}
setCompilerParameters (params) {
setCompilerQueryParameters (params) {
for (const key of Object.keys(params)) {
localStorage.setItem(key, params[key])
}

@ -11,8 +11,8 @@ export interface ICompilerApi {
compileTabLogic: any
configurationSettings: ConfigurationSettings
getCompilerParameters: () => ConfigurationSettings
setCompilerParameters: (ConfigurationSettings?) => void
getCompilerQueryParameters: () => ConfigurationSettings
setCompilerQueryParameters: (ConfigurationSettings?) => void
getAppParameter: (value: string) => Promise<any>
setAppParameter: (name: string, value: string | boolean) => void
@ -55,13 +55,18 @@ export interface iSolJsonBinDataBuild {
path: string,
version: string,
build: string,
prerelease: string,
longVersion: string,
binURL: string,
wasmURL: string,
isDownloaded: boolean,
}
export interface iSolJsonBinData {
baseURLWasm: string,
baseURLBin: string,
wasmList: iSolJsonBinDataBuild[],
binList: iSolJsonBinDataBuild[]
binList: iSolJsonBinDataBuild[],
selectorList: iSolJsonBinDataBuild[]
}
export type terminalLog = {

@ -294,10 +294,11 @@ export const CompilerApiMixin = (Base) => class extends Base {
this.compilersDownloaded(list)
})
this.on('compilerloader', 'setSolJsonBinData', (urls: iSolJsonBinData) => {
console.log('basuURLS', urls)
this.on('compilerloader', 'jsonBinDataLoaded', (urls: iSolJsonBinData) => {
this.setSolJsonBinData(urls)
})
this.call('compilerloader', 'getJsonBinData')
this.data.eventHandlers.onCompilationFinished = async (success, data, source, input, version) => {
this.compileErrors = data

@ -44,6 +44,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
configFilePath,
setConfigFilePath,
compilersDownloaded,
solJsonBinData,
//@ts-ignore
pluginProps
} = props // eslint-disable-line
@ -56,7 +57,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
optimize: false,
compileTimeout: null,
timeout: 300,
allversions: [],
//allversions: [],
customVersions: [],
downloaded: [],
compilerLicense: null,
@ -69,7 +70,8 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
remappings: [],
evmVersion: '',
createFileOnce: true,
onlyDownloaded: false
onlyDownloaded: false,
updatedVersionSelectorFromUrlQuery: false,
})
const [showFilePathInput, setShowFilePathInput] = useState<boolean>(false)
const [toggleExpander, setToggleExpander] = useState<boolean>(false)
@ -130,22 +132,22 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
})
useEffect(() => {
fetchAllVersion((allversions, selectedVersion, isURL) => {
console.log('allversions', allversions)
if(!state.updatedVersionSelectorFromUrlQuery && solJsonBinData.binList && solJsonBinData.binList.length) {
const versionFromQueryParameter = getSelectVersionFromQueryParam()
if (versionFromQueryParameter.isURL) _updateVersionSelector(state.defaultVersion, versionFromQueryParameter.selectedVersion)
else{
updateCurrentVersion(versionFromQueryParameter.selectedVersion)
_updateVersionSelector(versionFromQueryParameter.selectedVersion)
}
setState((prevState) => {
return {...prevState, allversions}
return {...prevState, updatedVersionSelectorFromUrlQuery: true}
})
if (isURL) _updateVersionSelector(state.defaultVersion, selectedVersion)
else {
setState((prevState) => {
return {...prevState, selectedVersion}
})
updateCurrentVersion(selectedVersion)
_updateVersionSelector(selectedVersion)
}
})
const currentFileName = api.currentFile
}
}, [solJsonBinData])
useEffect(() => {
const currentFileName = api.currentFile
currentFile(currentFileName)
listenToEvents(compileTabLogic, api)(dispatch)
}, [])
@ -163,7 +165,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
setConfigFilePath(configFilePathSaved)
setState((prevState) => {
const params = api.getCompilerParameters()
const params = api.getCompilerQueryParameters()
const optimize = params.optimize
const runs = params.runs as string
const evmVersion = compileTabLogic.evmVersions.includes(params.evmVersion) ? params.evmVersion : 'default'
@ -242,28 +244,6 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
}
}, [configurationSettings])
useEffect(() => {
console.log('compilersDownloaded', compilersDownloaded)
setState((prevState) => {
return {...prevState, downloaded: compilersDownloaded}
})
},[compilersDownloaded])
useEffect(() => {
updateAllVersionsWithDownloadStatus()
}, [state.downloaded])
const updateAllVersionsWithDownloadStatus = () => {
const updatedAllVersions = state.allversions.map((version) => {
version.isDownloaded = state.downloaded.includes(version.path)
return version
})
console.log('updatedAllVersions', updatedAllVersions)
setState((prevState) => {
return {...prevState, allversions: updatedAllVersions}
})
}
const toggleConfigType = () => {
if (state.useFileConfiguration)
if (state.createFileOnce) {
@ -335,38 +315,14 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
return semver.coerce(version) ? semver.coerce(version).version : ''
}
// fetching both normal and wasm builds and creating a [version, baseUrl] map
const fetchAllVersion = async (callback) => {
let selectedVersion, allVersionsWasm, isURL
let allVersions = [
{
path: 'builtin',
longVersion: 'latest local version - ' + state.defaultVersion
}
]
let binRes: AxiosResponse
let wasmRes: AxiosResponse
try {
// fetch normal builds
binRes = await axios(`${baseURLBin}/list.json`)
// fetch wasm builds
wasmRes = await axios(`${baseURLWasm}/list.json`)
} catch (e) {
selectedVersion = 'builtin'
console.log('Error while fetching compiler list', e.message)
return callback(allVersions, selectedVersion)
}
if (binRes.status !== 200 && wasmRes.status !== 200) {
selectedVersion = 'builtin'
return callback(allVersions, selectedVersion)
}
const getSelectVersionFromQueryParam = () => {
let selectedVersion = state.defaultVersion
let isURL = false
try {
const versions = binRes.data.builds.slice().reverse()
const versions = solJsonBinData.binList
allVersions = [...allVersions, ...versions]
selectedVersion = state.defaultVersion
if (api.getCompilerParameters().version) {
const versionFromURL = api.getCompilerParameters().version
if (api.getCompilerQueryParameters().version) {
const versionFromURL = api.getCompilerQueryParameters().version
// Check if version is a URL and corresponding filename starts with 'soljson'
if (versionFromURL.startsWith('https://')) {
const urlArr = versionFromURL.split('/')
@ -382,29 +338,12 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
if (selectedVersionArr.length) selectedVersion = selectedVersionArr[0].path
}
}
if (wasmRes.status === 200) {
allVersionsWasm = wasmRes.data.builds.slice().reverse()
}
} catch (e) {
tooltip(intl.formatMessage({id: 'solidity.tooltipText5'}) + e)
}
// replace in allVersions those compiler builds which exist in allVersionsWasm with new once
if (allVersionsWasm && allVersions) {
allVersions.forEach((compiler, index) => {
const wasmIndex = allVersionsWasm.findIndex((wasmCompiler) => {
return wasmCompiler.longVersion === compiler.longVersion
})
const URLWasm: string = process && process.env && process.env['NX_WASM_URL'] ? process.env['NX_WASM_URL'] : baseURLWasm
const URLBin: string = process && process.env && process.env['NX_BIN_URL'] ? process.env['NX_BIN_URL'] : baseURLBin
if (wasmIndex !== -1) {
allVersions[index] = allVersionsWasm[wasmIndex]
pathToURL[compiler.path] = URLWasm
} else {
pathToURL[compiler.path] = URLBin
}
})
}
callback(allVersions, selectedVersion, isURL)
return {selectedVersion, isURL}
}
/**
@ -423,15 +362,15 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
// Load solc compiler version according to pragma in contract file
const _setCompilerVersionFromPragma = (filename: string) => {
if (!state.allversions) return
if (!solJsonBinData.selectorList) return
api.readFile(filename).then((data) => {
if (!data) return
const pragmaArr = data.match(/(pragma solidity (.+?);)/g)
if (pragmaArr && pragmaArr.length === 1) {
const pragmaStr = pragmaArr[0].replace('pragma solidity', '').trim()
const pragma = pragmaStr.substring(0, pragmaStr.length - 1)
const releasedVersions = state.allversions.filter((obj) => !obj.prerelease).map((obj) => obj.version)
const allVersions = state.allversions.map((obj) => _retrieveVersion(obj.version))
const releasedVersions = solJsonBinData.selectorList.filter((obj) => !obj.prerelease).map((obj) => obj.version)
const allVersions = solJsonBinData.selectorList.map((obj) => _retrieveVersion(obj.version))
const currentCompilerName = _retrieveVersion(state.selectedVersion)
// contains only numbers part, for example '0.4.22'
const pureVersion = _retrieveVersion()
@ -443,7 +382,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
const isOfficial = allVersions.includes(currentCompilerName)
if (isOfficial && !isInRange && !isNewestNightly) {
const compilerToLoad = semver.maxSatisfying(releasedVersions, pragma)
const compilerPath = state.allversions.filter((obj) => !obj.prerelease && obj.version === compilerToLoad)[0].path
const compilerPath = solJsonBinData.selectorList.filter((obj) => !obj.prerelease && obj.version === compilerToLoad)[0].path
if (state.selectedVersion !== compilerPath) {
// @ts-ignore
api.call('notification', 'toast', intl.formatMessage({id: 'solidity.toastMessage'}, {version: _retrieveVersion(compilerPath)}))
@ -591,7 +530,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
})
}
updateCurrentVersion(selectedVersion)
api.setCompilerParameters({version: selectedVersion})
api.setCompilerQueryParameters({version: selectedVersion})
let url
if (customUrl !== '') {
@ -605,8 +544,15 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
})
updateCurrentVersion(selectedVersion)
url = customUrl
api.setCompilerParameters({version: selectedVersion})
api.setCompilerQueryParameters({version: selectedVersion})
} else {
setState((prevState) => {
return {
...prevState,
selectedVersion,
}
})
if (checkSpecialChars(selectedVersion)) {
return console.log('loading ' + selectedVersion + ' not allowed, special chars not allowed.')
}
@ -836,7 +782,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
<span className="far fa-file-certificate border-0 p-0 ml-2" onClick={() => showCompilerLicense()}></span>
</CustomTooltip>
<CompilerDropdown
allversions={state.allversions}
allversions={solJsonBinData.selectorList}
customVersions={state.customVersions}
selectedVersion={state.selectedVersion}
defaultVersion={state.defaultVersion}
@ -851,12 +797,13 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
<FormattedMessage id="solidity.includeNightlyBuilds" />
</label>
</div>
{platform === appPlatformTypes.desktop ?
<div className="mb-2 flex-row-reverse remixui_nightlyBuilds custom-control custom-checkbox">
<input className="mr-2 custom-control-input" id="downloadedcompilers" type="checkbox" onChange={handleOnlyDownloadedChange} checked={state.onlyDownloaded} />
<label htmlFor="downloadedcompilers" data-id="compilerNightliesBuild" className="form-check-label custom-control-label">
<FormattedMessage id="solidity.downloadedCompilers" />
</label>
</div>
</div>:null}
<div className="mt-2 remixui_compilerConfig custom-control custom-checkbox">
<input
className="remixui_autocompile custom-control-input"

@ -1,3 +1,4 @@
import { AppContext, appPlatformTypes } from '@remix-ui/app';
import React, { useEffect, useState, useRef, useReducer, useContext } from 'react' // eslint-disable-line
import { Dropdown } from 'react-bootstrap';
import { CompilerMenu, CompilerMenuToggle } from './compiler-menu';
@ -19,6 +20,7 @@ interface compilerDropdownProps {
}
export const CompilerDropdown = (props: compilerDropdownProps) => {
const {platform, online} = useContext(AppContext)
const { customVersions, selectedVersion, defaultVersion, allversions, handleLoadVersion, _shouldBeAdded, onlyDownloaded } = props
return (
<Dropdown id="versionSelector" data-id="versionSelector">
@ -102,7 +104,7 @@ export const CompilerDropdown = (props: compilerDropdownProps) => {
{build.longVersion}
</div>
</div>
{build.isDownloaded ? <div className='fas fa-arrow-circle-down text-success ml-auto'></div> : <div className='far fa-arrow-circle-down'></div>}
{platform == appPlatformTypes.desktop ? (build.isDownloaded ? <div className='fas fa-arrow-circle-down text-success ml-auto'></div> : <div className='far fa-arrow-circle-down'></div>) : null}
</div>
</Dropdown.Item>
) : null

@ -11,7 +11,7 @@ const _paq = window._paq = window._paq || [] //eslint-disable-line
export class CompileTabLogic {
public compiler
public api
public api: ICompilerApi
public contentImport
public optimize
public runs
@ -32,16 +32,16 @@ export class CompileTabLogic {
}
init () {
this.optimize = this.api.getCompilerParameters().optimize
this.api.setCompilerParameters({ optimize: this.optimize })
this.optimize = this.api.getCompilerQueryParameters().optimize
this.api.setCompilerQueryParameters({ optimize: this.optimize })
this.compiler.set('optimize', this.optimize)
this.runs = this.api.getCompilerParameters().runs
this.runs = this.api.getCompilerQueryParameters().runs
this.runs = this.runs && this.runs !== 'undefined' ? this.runs : 200
this.api.setCompilerParameters({ runs: this.runs })
this.api.setCompilerQueryParameters({ runs: this.runs })
this.compiler.set('runs', this.runs)
this.evmVersion = this.api.getCompilerParameters().evmVersion
this.evmVersion = this.api.getCompilerQueryParameters().evmVersion
if (
this.evmVersion === 'undefined' ||
this.evmVersion === 'null' ||
@ -49,10 +49,10 @@ export class CompileTabLogic {
!this.evmVersions.includes(this.evmVersion)) {
this.evmVersion = null
}
this.api.setCompilerParameters({ evmVersion: this.evmVersion })
this.api.setCompilerQueryParameters({ evmVersion: this.evmVersion })
this.compiler.set('evmVersion', this.evmVersion)
this.language = getValidLanguage(this.api.getCompilerParameters().language)
this.language = getValidLanguage(this.api.getCompilerQueryParameters().language)
if (this.language != null) {
this.compiler.set('language', this.language)
}
@ -60,7 +60,7 @@ export class CompileTabLogic {
setOptimize (newOptimizeValue: boolean) {
this.optimize = newOptimizeValue
this.api.setCompilerParameters({ optimize: this.optimize })
this.api.setCompilerQueryParameters({ optimize: this.optimize })
this.compiler.set('optimize', this.optimize)
}
@ -75,13 +75,13 @@ export class CompileTabLogic {
setRuns (runs) {
this.runs = runs
this.api.setCompilerParameters({ runs: this.runs })
this.api.setCompilerQueryParameters({ runs: this.runs })
this.compiler.set('runs', this.runs)
}
setEvmVersion (newEvmVersion) {
this.evmVersion = newEvmVersion
this.api.setCompilerParameters({ evmVersion: this.evmVersion })
this.api.setCompilerQueryParameters({ evmVersion: this.evmVersion })
this.compiler.set('evmVersion', this.evmVersion)
}
@ -95,7 +95,7 @@ export class CompileTabLogic {
*/
setLanguage (lang) {
this.language = lang
this.api.setCompilerParameters({ language: lang })
this.api.setCompilerQueryParameters({ language: lang })
this.compiler.set('language', lang)
}

@ -1,19 +1,19 @@
import React, {useEffect, useState} from 'react' // eslint-disable-line
import {CompileErrors, ContractsFile, SolidityCompilerProps} from './types'
import {CompilerContainer} from './compiler-container' // eslint-disable-line
import {ContractSelection} from './contract-selection' // eslint-disable-line
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} from '@remix-project/remix-solidity'
import React, { useEffect, useState } from 'react' // eslint-disable-line
import { CompileErrors, ContractsFile, SolidityCompilerProps } from './types'
import { CompilerContainer } from './compiler-container' // eslint-disable-line
import { ContractSelection } from './contract-selection' // eslint-disable-line
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 './css/style.css'
import { iSolJsonBinData } from '@remix-project/remix-lib'
import { iSolJsonBinData, iSolJsonBinDataBuild } from '@remix-project/remix-lib'
export const SolidityCompiler = (props: SolidityCompilerProps) => {
const {
api,
api: {currentFile, compileTabLogic, configurationSettings}
api: { currentFile, compileTabLogic, configurationSettings }
} = props
const [state, setState] = useState({
@ -32,10 +32,10 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
title: '',
message: null,
okLabel: '',
okFn: () => {},
okFn: () => { },
donotHideOnOkClick: false,
cancelLabel: '',
cancelFn: () => {},
cancelFn: () => { },
handleHide: null
},
compilersDownloaded: [],
@ -43,17 +43,19 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
baseURLBin,
baseURLWasm,
binList: [],
wasmList: []
}
wasmList: [],
selectorList: []
},
defaultVersion: 'soljson-v0.8.22+commit.4fc1097e.js', // 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})
const [badgeStatus, setBadgeStatus] = useState<Record<string, {key: string; title?: string; type?: string}>>({})
const [compileErrors, setCompileErrors] = useState<Record<string, CompileErrors>>({ [currentFile]: api.compileErrors })
const [badgeStatus, setBadgeStatus] = useState<Record<string, { key: string; title?: string; type?: string }>>({})
const [contractsFile, setContractsFile] = useState<ContractsFile>({})
useEffect(() => {
;(async () => {
; (async () => {
const hide = ((await api.getAppParameter('hideWarnings')) as boolean) || false
setHideWarnings(hide)
})()
@ -63,7 +65,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
if (badgeStatus[currentFile]) {
api.emit('statusChanged', badgeStatus[currentFile])
} else {
api.emit('statusChanged', {key: 'none'})
api.emit('statusChanged', { key: 'none' })
}
}, [badgeStatus[currentFile], currentFile])
@ -76,7 +78,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
api.onCurrentFileChanged = (currentFile: string) => {
setState((prevState) => {
return {...prevState, currentFile}
return { ...prevState, currentFile }
})
}
@ -99,24 +101,24 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
api.onFileRemoved = (path: string) => {
if (path === state.configFilePath)
setState((prevState) => {
return {...prevState, configFilePath: ''}
return { ...prevState, configFilePath: '' }
})
}
api.onNoFileSelected = () => {
setState((prevState) => {
return {...prevState, currentFile: ''}
return { ...prevState, currentFile: '' }
})
setCompileErrors({} as Record<string, CompileErrors>)
}
api.onCompilationFinished = (compilationDetails: {
contractMap: {file: string} | Record<string, any>
contractMap: { file: string } | Record<string, any>
contractsDetails: Record<string, any>
target?: string
input?: Record<string, any>
}) => {
const {contractMap, contractsDetails, target, input} = compilationDetails
const { contractMap, contractsDetails, target, input } = compilationDetails
const contractList = contractMap
? Object.keys(contractMap).map((key) => {
return {
@ -128,50 +130,81 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
setContractsFile({
...contractsFile,
[target]: {contractList, contractsDetails, input}
[target]: { contractList, contractsDetails, input }
})
setCompileErrors({...compileErrors, [currentFile]: api.compileErrors})
setCompileErrors({ ...compileErrors, [currentFile]: api.compileErrors })
}
api.onFileClosed = (name) => {
if (name === currentFile) {
setCompileErrors({...compileErrors, [currentFile]: {} as CompileErrors})
setBadgeStatus({...badgeStatus, [currentFile]: {key: 'none'}})
setCompileErrors({ ...compileErrors, [currentFile]: {} as CompileErrors })
setBadgeStatus({ ...badgeStatus, [currentFile]: { key: 'none' } })
}
}
api.statusChanged = (data: {key: string; title?: string; type?: string}) => {
setBadgeStatus({...badgeStatus, [currentFile]: data})
api.statusChanged = (data: { key: string; title?: string; type?: string }) => {
setBadgeStatus({ ...badgeStatus, [currentFile]: data })
}
api.compilersDownloaded = (list: string[]) => {
setState((prevState) => {
return {...prevState, compilersDownloaded: list}
return { ...prevState, compilersDownloaded: list }
})
}
api.setSolJsonBinData = (urls: iSolJsonBinData) => {
api.setSolJsonBinData = (data: iSolJsonBinData) => {
const builtin: iSolJsonBinDataBuild =
{
path: 'builtin',
longVersion: 'latest local version - ' + state.defaultVersion,
binURL: '',
wasmURL: '',
isDownloaded: false,
version: 'builtin',
build: '',
prerelease: ''
}
const binVersions = data.binList
let selectorList = binVersions
const wasmVersions = data.wasmList
selectorList.forEach((compiler, index) => {
const wasmIndex = wasmVersions.findIndex((wasmCompiler) => {
return wasmCompiler.longVersion === compiler.longVersion
})
if (wasmIndex !== -1) {
const URLWasm: string = process && process.env && process.env['NX_WASM_URL'] ? process.env['NX_WASM_URL'] : wasmVersions[wasmIndex].wasmURL || data.baseURLWasm
selectorList[index] = wasmVersions[wasmIndex]
pathToURL[compiler.path] = URLWasm
} else {
const URLBin: string = process && process.env && process.env['NX_BIN_URL'] ? process.env['NX_BIN_URL'] : compiler.binURL || data.baseURLBin
pathToURL[compiler.path] = URLBin
}
})
data.selectorList = selectorList
data.selectorList.reverse()
setState((prevState) => {
return {...prevState, baseURLS: urls}
return { ...prevState, solJsonBinData: data }
})
}
const setConfigFilePath = (path: string) => {
setState((prevState) => {
return {...prevState, configFilePath: path}
return { ...prevState, configFilePath: path }
})
}
const toast = (message: string) => {
setState((prevState) => {
return {...prevState, toasterMsg: message}
return { ...prevState, toasterMsg: message }
})
}
const updateCurrentVersion = (value) => {
setCurrentVersion(value)
api.setCompilerParameters({version: value})
api.setCompilerQueryParameters({ version: value })
}
const modal = async (
@ -203,7 +236,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
const handleHideModal = () => {
setState((prevState) => {
return {...prevState, modal: {...state.modal, hide: true, message: null}}
return { ...prevState, modal: { ...state.modal, hide: true, message: null } }
})
}
@ -280,10 +313,10 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => {
compileErrors[currentFile].errors.map((err, index) => {
if (hideWarnings) {
if (err.severity !== 'warning') {
return <Renderer key={index} message={err.formattedMessage} plugin={api} opt={{type: err.severity, errorType: err.type}} />
return <Renderer key={index} message={err.formattedMessage} plugin={api} opt={{ type: err.severity, errorType: err.type }} />
}
} else {
return <Renderer key={index} message={err.formattedMessage} plugin={api} opt={{type: err.severity, errorType: err.type}} />
return <Renderer key={index} message={err.formattedMessage} plugin={api} opt={{ type: err.severity, errorType: err.type }} />
}
})}
</>

@ -1,11 +1,11 @@
import React, {Fragment, useContext, useEffect, useReducer, useRef, useState} from 'react'
import {Plugin} from '@remixproject/engine'
import React, { Fragment, useContext, useEffect, useReducer, useRef, useState } from 'react'
import { Plugin } from '@remixproject/engine'
import './remix-ui-vertical-icons-panel.css'
import IconList from './components/IconList'
import Home from './components/Home'
import {verticalScrollReducer} from './reducers/verticalScrollReducer'
import {Chevron} from './components/Chevron'
import {IconRecord} from './types'
import { verticalScrollReducer } from './reducers/verticalScrollReducer'
import { Chevron } from './components/Chevron'
import { IconRecord } from './types'
import { AppContext } from '@remix-ui/app'
import { CustomTooltip } from '@remix-ui/helper'
export interface RemixUiVerticalIconsPanelProps {
@ -19,12 +19,12 @@ const initialState = {
scrollState: false
}
const RemixUiVerticalIconsPanel = ({verticalIconsPlugin, icons}: RemixUiVerticalIconsPanelProps) => {
const RemixUiVerticalIconsPanel = ({ verticalIconsPlugin, icons }: RemixUiVerticalIconsPanelProps) => {
const scrollableRef = useRef<any>()
const iconPanelRef = useRef<any>()
const [activateScroll, dispatchScrollAction] = useReducer(verticalScrollReducer, initialState)
const [theme, setTheme] = useState<string>('dark')
const {online} = useContext(AppContext)
const { online } = useContext(AppContext)
const evaluateScrollability = () => {
dispatchScrollAction({
@ -118,21 +118,21 @@ const RemixUiVerticalIconsPanel = ({verticalIconsPlugin, icons}: RemixUiVertical
verticalIconsPlugin={verticalIconsPlugin}
itemContextAction={itemContextAction}
/>
{online ?
<CustomTooltip
placement="top"
tooltipText={'You are online'}
>
<i className="fa-solid fa-wifi text-success p-2"></i>
</CustomTooltip>
:
<CustomTooltip
placement="top"
tooltipText={'You are offline'}
>
<i className="fa-solid fa-wifi-exclamation text-danger p-2"></i>
</CustomTooltip>}
</div>
{online ?
<CustomTooltip
placement="top"
tooltipText={'You are online'}
>
<i className="fa-solid fa-wifi text-success p-2"></i>
</CustomTooltip>
:
<CustomTooltip
placement="top"
tooltipText={'You are offline'}
>
<i className="fa-solid fa-wifi-exclamation text-danger p-2"></i>
</CustomTooltip>}
</div>
</div>
)

@ -171,7 +171,7 @@ export const RemixUiXterminals = (props: RemixUiXterminalsProps) => {
const closeTerminal = () => {
const pid = terminals.find(xtermState => xtermState.hidden === false).pid
if (pid)
plugin.call('xterm', 'close', pid)
plugin.call('xterm', 'closeTerminal', pid)
}
const selectOutput = () => {

@ -134,15 +134,15 @@
"@openzeppelin/contracts": "^5.0.0",
"@openzeppelin/upgrades-core": "^1.30.0",
"@openzeppelin/wizard": "0.4.0",
"@remixproject/engine": "0.3.37",
"@remixproject/engine-electron": "0.3.37",
"@remixproject/engine-web": "0.3.37",
"@remixproject/plugin": "0.3.37",
"@remixproject/plugin-api": "0.3.37",
"@remixproject/plugin-electron": "0.3.37",
"@remixproject/plugin-utils": "0.3.37",
"@remixproject/plugin-webview": "0.3.37",
"@remixproject/plugin-ws": "0.3.37",
"@remixproject/engine": "0.3.42",
"@remixproject/engine-electron": "0.3.42",
"@remixproject/engine-web": "0.3.42",
"@remixproject/plugin": "0.3.42",
"@remixproject/plugin-api": "0.3.42",
"@remixproject/plugin-electron": "0.3.42",
"@remixproject/plugin-utils": "0.3.42",
"@remixproject/plugin-webview": "0.3.42",
"@remixproject/plugin-ws": "0.3.42",
"@types/nightwatch": "^2.3.1",
"@web3modal/ethereum": "^2.7.1",
"@web3modal/react": "^2.6.2",

@ -4964,82 +4964,82 @@
unbzip2-stream "1.4.3"
yargs "17.7.1"
"@remixproject/engine-electron@0.3.37":
version "0.3.37"
resolved "https://registry.yarnpkg.com/@remixproject/engine-electron/-/engine-electron-0.3.37.tgz#5e14bcf08201603cfccff0761d6f8612b1f3d62f"
integrity sha512-XQea0a5SPtYtOl1XH8qu9AN+Fkc/LSZ8FYuxenFUeczqy9t4gxlPibLrCQXSlrcNEdoGhDE/DW/wltQoX8JLtg==
dependencies:
"@remixproject/engine" "0.3.37"
"@remixproject/plugin-api" "0.3.37"
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/engine-web@0.3.37":
version "0.3.37"
resolved "https://registry.yarnpkg.com/@remixproject/engine-web/-/engine-web-0.3.37.tgz#cb9e09a135f9083202207039b2f5104278d4db1b"
integrity sha512-9FcJOm5xMOta5DE/JVMu2TnGcJpoe6MagG/NC89QrxJq8mCQSDgiFeSfqJhgFXye/hjlCmaO96aLgXIeoXMhWQ==
dependencies:
"@remixproject/engine" "0.3.37"
"@remixproject/plugin-api" "0.3.37"
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/engine@0.3.37":
version "0.3.37"
resolved "https://registry.yarnpkg.com/@remixproject/engine/-/engine-0.3.37.tgz#995abd53c505f6f37eaa6550d81ec36f2e60d106"
integrity sha512-+dO32Bdgm2GLlamCnCWIPYX0v57Ft2vWGkFwXil1xiLvPttVOjnSPkqz9Xu0DAqDIqXIr4A15E2pHklVR+shLQ==
dependencies:
"@remixproject/plugin-api" "0.3.37"
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/plugin-api@0.3.37":
version "0.3.37"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-api/-/plugin-api-0.3.37.tgz#2b5c628f81632bb0063e4c6afbce62085d20e883"
integrity sha512-bJ8oIpaI4qP3/Ku7jxXW3XRkTyQ2hjWX6N8yob3d/jjHtaJ/IorDx/vieGXQoJTPKAMPol0KVKCVCxx+xmzcUQ==
dependencies:
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/plugin-electron@0.3.37":
version "0.3.37"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-electron/-/plugin-electron-0.3.37.tgz#e850b6aae55af1e7b0cd74f4583e8eeb946735ce"
integrity sha512-ZmkYLk9LEewPCqXIiMPJC8ZpgRjMW3dh2LbgeSGhKG0ly8pD5VuZj3/07iP/ZvjDNuTliX08gqvCru9/oOskqA==
dependencies:
"@remixproject/engine" "0.3.37"
"@remixproject/plugin" "0.3.37"
"@remixproject/plugin-api" "0.3.37"
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/plugin-utils@0.3.37":
version "0.3.37"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-utils/-/plugin-utils-0.3.37.tgz#7068523398164976c2470f55837e93c6fa210489"
integrity sha512-Ow4gFf15ym7Sysza4hx4+QEYQHvluu0pDEj3GlNAMWAbvbjBGxb7O81b3Tvu7n8ywESYJlbIifNr++vYY63+PQ==
"@remixproject/engine-electron@0.3.42":
version "0.3.42"
resolved "https://registry.yarnpkg.com/@remixproject/engine-electron/-/engine-electron-0.3.42.tgz#12328f762f3a2969a55abda58c9f3307143bb03b"
integrity sha512-rtvHtNPfAUUxDEFeHd2Wm6M7ee6Tx8uDhprgA9PRxiL3WjJg39PVTCm6X4Y3hpPdiqFvC56cTW30q5Fsg8X8dQ==
dependencies:
"@remixproject/engine" "0.3.42"
"@remixproject/plugin-api" "0.3.42"
"@remixproject/plugin-utils" "0.3.42"
"@remixproject/engine-web@0.3.42":
version "0.3.42"
resolved "https://registry.yarnpkg.com/@remixproject/engine-web/-/engine-web-0.3.42.tgz#1221666a43d33c73119df97e6f65ab908fc2e80d"
integrity sha512-FtKfXOLY3mxHtkgdEKargup17N4w9Qqniiwxec5193zO6nR0wlBz5fB8ClKUp3V1boiQAg7fEOJv01QZ4UUTgw==
dependencies:
"@remixproject/engine" "0.3.42"
"@remixproject/plugin-api" "0.3.42"
"@remixproject/plugin-utils" "0.3.42"
"@remixproject/engine@0.3.42":
version "0.3.42"
resolved "https://registry.yarnpkg.com/@remixproject/engine/-/engine-0.3.42.tgz#30606ea9c6b6d16a14eb71480ad450e82bac18dd"
integrity sha512-5t0H7SLxzyy03FAm7OSVLaiufrOYRinICAY3LRZDIqTu2wWeNQ/MTuBsfzBv0erzq8F/07rRyksbaPQdeQKoOw==
dependencies:
"@remixproject/plugin-api" "0.3.42"
"@remixproject/plugin-utils" "0.3.42"
"@remixproject/plugin-api@0.3.42":
version "0.3.42"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-api/-/plugin-api-0.3.42.tgz#c64d8b75a139d4e5cc342861d288d638818a8081"
integrity sha512-q1YLSAeluuTaLZDO2iwn3k3wW4Ii/FFVMt/5IoB8bId7pWLyVe4C+QtntrIpoRnfa8D1Hi6XEE3Sq0l5W2knMQ==
dependencies:
"@remixproject/plugin-utils" "0.3.42"
"@remixproject/plugin-electron@0.3.42":
version "0.3.42"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-electron/-/plugin-electron-0.3.42.tgz#e3a230593c5ec5d9f88ef6e6bb5a8a0d0c52e6ed"
integrity sha512-Raa/A6raZ79VRAh4GYPxD74ZXy4W1JqocnR23AV/WVVjefF/5EsmjBFyCGJLFW9cN53+QeB968T3VFNBjHtaUQ==
dependencies:
"@remixproject/engine" "0.3.42"
"@remixproject/plugin" "0.3.42"
"@remixproject/plugin-api" "0.3.42"
"@remixproject/plugin-utils" "0.3.42"
"@remixproject/plugin-utils@0.3.42":
version "0.3.42"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-utils/-/plugin-utils-0.3.42.tgz#4ac4b4aaa15e14f1a905236645a4813a63b00c9c"
integrity sha512-4SkvanwKTxZ7iffTkjwxFqqXo9XLl1swc4SIyW02WrzXAOYPKZ8Vj48N1CIcTA+HqZtnoKAHlQklYcegDtL2sw==
dependencies:
tslib "2.0.1"
"@remixproject/plugin-webview@0.3.37":
version "0.3.37"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-webview/-/plugin-webview-0.3.37.tgz#b38882fc8f05ba22405c0baa4bef9662652fec1a"
integrity sha512-LeKS05MXnVUM4xS9IUmKBE5HJzs3L5hvuqWcRosB6ASbhzzFu4h7zeDtBbjSK46dL6/3Ym/dDqdJM9e6I+Gltw==
"@remixproject/plugin-webview@0.3.42":
version "0.3.42"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-webview/-/plugin-webview-0.3.42.tgz#08febdcd1b61e8296128fdb4130d99415e8a63dc"
integrity sha512-Do+TmHDMirXXzbuneVRWdsfUax3z4R3d+dAu2AVMO2eRkiElRUgxO9A4bcwMZNP2ETW2A5Dq9jL0qDtjyaYiXg==
dependencies:
"@remixproject/plugin" "0.3.37"
"@remixproject/plugin-api" "0.3.37"
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/plugin" "0.3.42"
"@remixproject/plugin-api" "0.3.42"
"@remixproject/plugin-utils" "0.3.42"
axios "^0.21.1"
"@remixproject/plugin-ws@0.3.37":
version "0.3.37"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-ws/-/plugin-ws-0.3.37.tgz#1f29d037a1743eb8b3da438f8a9dbdb3d322b9a4"
integrity sha512-fjGBrj3qP0UnraiG/opzMySxk0SdfABrx1PuM8f3c3tmZDdjTrVcsJ11NlNNvztOPkyY5fL4e2gXDUkpELKztg==
"@remixproject/plugin-ws@0.3.42":
version "0.3.42"
resolved "https://registry.yarnpkg.com/@remixproject/plugin-ws/-/plugin-ws-0.3.42.tgz#5c93112445de3bfbaddd3ce04e177d66e2ebd08a"
integrity sha512-CifgiuaHWHQVTjH4O5tMBGd9ov4LW1ENBObez1xTLYEGW90EQjFHnBXBgyyMbR9vrpMtBim7unTBUZokRdT9bg==
dependencies:
"@remixproject/plugin" "0.3.37"
"@remixproject/plugin-api" "0.3.37"
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/plugin" "0.3.42"
"@remixproject/plugin-api" "0.3.42"
"@remixproject/plugin-utils" "0.3.42"
"@remixproject/plugin@0.3.37":
version "0.3.37"
resolved "https://registry.yarnpkg.com/@remixproject/plugin/-/plugin-0.3.37.tgz#d7b41a7fd03d712717eeb44526399e6c6ce6647c"
integrity sha512-3DgGCPE78ThfqGUJlrWwdArRol2nLZMBHTZpPxLE9K4tpspY7G1KV8HLB55mkX/uPVvVbNTRoFI4TNm87Jjiwg==
"@remixproject/plugin@0.3.42":
version "0.3.42"
resolved "https://registry.yarnpkg.com/@remixproject/plugin/-/plugin-0.3.42.tgz#26709eedf53a7fe13717fa909eebebfd757f74bf"
integrity sha512-QhpKCnxlxuwGWxaJHpO7yW3p+GqEEA7451BMT2zeFfUs///RrkmJdG7Z56RHAmH8GaGlALrMemsg68O3K55eAQ==
dependencies:
"@remixproject/plugin-api" "0.3.37"
"@remixproject/plugin-utils" "0.3.37"
"@remixproject/plugin-api" "0.3.42"
"@remixproject/plugin-utils" "0.3.42"
events "3.2.0"
"@restart/context@^2.1.4":

Loading…
Cancel
Save