diff --git a/libs/remix-solidity/src/compiler/compiler-input.ts b/libs/remix-solidity/src/compiler/compiler-input.ts index 0b214b5201..44c03305e0 100644 --- a/libs/remix-solidity/src/compiler/compiler-input.ts +++ b/libs/remix-solidity/src/compiler/compiler-input.ts @@ -12,18 +12,14 @@ export default (sources: Source, opts: CompilerInputOptions): string => { runs: opts.runs || 200 }, libraries: opts.libraries, - parserErrorRecovery: false, outputSelection: { '*': { '': ['ast'], - //'*': [] - //'*' : ['abi', 'metadata'] - '*': ['abi', 'metadata', 'devdoc', 'userdoc', 'storageLayout', 'evm.legacyAssembly', 'evm.bytecode', 'evm.deployedBytecode', 'evm.methodIdentifiers', 'evm.gasEstimates', 'evm.assembly'] + '*': ['abi', 'metadata', 'devdoc', 'userdoc', 'storageLayout', 'evm.legacyAssembly', 'evm.bytecode', 'evm.deployedBytecode', 'evm.methodIdentifiers', 'evm.gasEstimates', 'evm.assembly'] } } } } - if (opts.evmVersion) { if (opts.evmVersion.toLowerCase() == 'default') { opts.evmVersion = null diff --git a/libs/remix-solidity/src/compiler/compiler-utils.ts b/libs/remix-solidity/src/compiler/compiler-utils.ts index 9fe7590b35..310cc50f1c 100644 --- a/libs/remix-solidity/src/compiler/compiler-utils.ts +++ b/libs/remix-solidity/src/compiler/compiler-utils.ts @@ -12,7 +12,6 @@ export const pathToURL = {} * @param version is the version of compiler with or without 'soljson-v' prefix and .js postfix */ export function urlFromVersion (version) { - console.log('urlFromVersion', version) let url if (version === 'builtin') { let location: string | Location = window.document.location diff --git a/libs/remix-solidity/src/compiler/compiler-worker.ts b/libs/remix-solidity/src/compiler/compiler-worker.ts index ab86666ef0..662a03ec06 100644 --- a/libs/remix-solidity/src/compiler/compiler-worker.ts +++ b/libs/remix-solidity/src/compiler/compiler-worker.ts @@ -26,10 +26,7 @@ export default function (self) { // eslint-disable-line @typescript-eslint/expli missingInputs.push(path) return { error: 'Deferred import' } } - //console.log(input) - const ret = compiler.compile(input, { import: missingInputsCallback }) - //console.log(JSON.parse(ret)) - return ret + return compiler.compile(input, { import: missingInputsCallback }) } catch (exception) { return JSON.stringify({ error: 'Uncaught JavaScript exception:\n' + exception }) } @@ -44,13 +41,13 @@ export default function (self) { // eslint-disable-line @typescript-eslint/expli case 'compile': missingInputs.length = 0 if (data.input && compileJSON) { - self.postMessage({ - cmd: 'compiled', - job: data.job, - data: compileJSON(data.input), - input: data.input, - missingInputs: missingInputs - }) + self.postMessage({ + cmd: 'compiled', + job: data.job, + data: compileJSON(data.input), + input: data.input, + missingInputs: missingInputs + }) } break } diff --git a/libs/remix-solidity/src/compiler/compiler.ts b/libs/remix-solidity/src/compiler/compiler.ts index fda73c88f9..f728748a9e 100644 --- a/libs/remix-solidity/src/compiler/compiler.ts +++ b/libs/remix-solidity/src/compiler/compiler.ts @@ -170,7 +170,6 @@ export class Compiler { } this.event.trigger('compilationFinished', [true, data, source, input, version]) } - } /** diff --git a/libs/remix-solidity/src/compiler/types.ts b/libs/remix-solidity/src/compiler/types.ts index d81dc8b2bc..c4e48dd2ff 100644 --- a/libs/remix-solidity/src/compiler/types.ts +++ b/libs/remix-solidity/src/compiler/types.ts @@ -77,8 +77,7 @@ export interface CompilerInput { // after remappings were applied. // If this key is an empty string, that refers to a global level. [fileName: string]: Record - }, - parserErrorRecovery: boolean, + } // The following can be used to select desired outputs based // on file and contract names. // If this field is omitted, then the compiler loads and does type checking, diff --git a/libs/remix-tests/src/compiler.ts b/libs/remix-tests/src/compiler.ts index 6e0d9696da..f16c925edc 100644 --- a/libs/remix-tests/src/compiler.ts +++ b/libs/remix-tests/src/compiler.ts @@ -3,7 +3,7 @@ import async from 'async' import path from 'path' import deepequal from 'deep-equal' import Log from './logger' -import { Compiler } from '@remix-project/remix-solidity' +import { Compiler as RemixCompiler } from '@remix-project/remix-solidity' import { SrcIfc, CompilerConfiguration, CompilationErrors } from './types' const logger = new Log() const log = logger.logger @@ -114,7 +114,7 @@ export function compileFileOrFiles (filename: string, isDirectory: boolean, opts } finally { async.waterfall([ function loadCompiler (next) { - compiler = new Compiler((url, cb) => { + compiler = new RemixCompiler((url, cb) => { try { cb(null, fs.readFileSync(url, 'utf-8')) } catch (e) { @@ -186,7 +186,7 @@ export function compileContractSources (sources: SrcIfc, newCompConfig: any, imp if (!compiler || !deepequal(UTRunner.compilerConfig, newCompConfig)) { UTRunner.compilerConfig = newCompConfig const { currentCompilerUrl, evmVersion, optimize, runs, usingWorker } = newCompConfig - compiler = new Compiler(importFileCb) + compiler = new RemixCompiler(importFileCb) compiler.set('evmVersion', evmVersion) compiler.set('optimize', optimize) compiler.set('runs', runs) diff --git a/libs/remix-tests/tsconfig.json b/libs/remix-tests/tsconfig.json index e960ad42b3..3b54496f3d 100644 --- a/libs/remix-tests/tsconfig.json +++ b/libs/remix-tests/tsconfig.json @@ -4,7 +4,8 @@ "types": ["node", "jest"], "module": "commonjs", "esModuleInterop": true, - "rootDir": "./src", + "allowJs": true, + "rootDir": "./", }, "include": ["**/*.ts"] } \ No newline at end of file diff --git a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx index 5bd57b66d2..8d0aeec020 100644 --- a/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx +++ b/libs/remix-ui/app/src/lib/remix-app/remix-app.tsx @@ -23,7 +23,7 @@ const RemixApp = (props: IRemixAppUi) => { async function activateApp () { props.app.themeModule.initTheme(() => { setAppReady(true) - props.app.activate() + props.app.activate() setListeners() }) }