restore files

pull/5370/head
filip mertens 3 years ago
parent 4366aed934
commit 6668f4ff6e
  1. 6
      libs/remix-solidity/src/compiler/compiler-input.ts
  2. 1
      libs/remix-solidity/src/compiler/compiler-utils.ts
  3. 19
      libs/remix-solidity/src/compiler/compiler-worker.ts
  4. 1
      libs/remix-solidity/src/compiler/compiler.ts
  5. 3
      libs/remix-solidity/src/compiler/types.ts
  6. 6
      libs/remix-tests/src/compiler.ts
  7. 3
      libs/remix-tests/tsconfig.json
  8. 2
      libs/remix-ui/app/src/lib/remix-app/remix-app.tsx

@ -12,18 +12,14 @@ export default (sources: Source, opts: CompilerInputOptions): string => {
runs: opts.runs || 200 runs: opts.runs || 200
}, },
libraries: opts.libraries, libraries: opts.libraries,
parserErrorRecovery: false,
outputSelection: { outputSelection: {
'*': { '*': {
'': ['ast'], '': ['ast'],
//'*': [] '*': ['abi', 'metadata', 'devdoc', 'userdoc', 'storageLayout', 'evm.legacyAssembly', 'evm.bytecode', 'evm.deployedBytecode', 'evm.methodIdentifiers', 'evm.gasEstimates', 'evm.assembly']
//'*' : ['abi', 'metadata']
'*': ['abi', 'metadata', 'devdoc', 'userdoc', 'storageLayout', 'evm.legacyAssembly', 'evm.bytecode', 'evm.deployedBytecode', 'evm.methodIdentifiers', 'evm.gasEstimates', 'evm.assembly']
} }
} }
} }
} }
if (opts.evmVersion) { if (opts.evmVersion) {
if (opts.evmVersion.toLowerCase() == 'default') { if (opts.evmVersion.toLowerCase() == 'default') {
opts.evmVersion = null opts.evmVersion = null

@ -12,7 +12,6 @@ export const pathToURL = {}
* @param version is the version of compiler with or without 'soljson-v' prefix and .js postfix * @param version is the version of compiler with or without 'soljson-v' prefix and .js postfix
*/ */
export function urlFromVersion (version) { export function urlFromVersion (version) {
console.log('urlFromVersion', version)
let url let url
if (version === 'builtin') { if (version === 'builtin') {
let location: string | Location = window.document.location let location: string | Location = window.document.location

@ -26,10 +26,7 @@ export default function (self) { // eslint-disable-line @typescript-eslint/expli
missingInputs.push(path) missingInputs.push(path)
return { error: 'Deferred import' } return { error: 'Deferred import' }
} }
//console.log(input) return compiler.compile(input, { import: missingInputsCallback })
const ret = compiler.compile(input, { import: missingInputsCallback })
//console.log(JSON.parse(ret))
return ret
} catch (exception) { } catch (exception) {
return JSON.stringify({ error: 'Uncaught JavaScript exception:\n' + 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': case 'compile':
missingInputs.length = 0 missingInputs.length = 0
if (data.input && compileJSON) { if (data.input && compileJSON) {
self.postMessage({ self.postMessage({
cmd: 'compiled', cmd: 'compiled',
job: data.job, job: data.job,
data: compileJSON(data.input), data: compileJSON(data.input),
input: data.input, input: data.input,
missingInputs: missingInputs missingInputs: missingInputs
}) })
} }
break break
} }

@ -170,7 +170,6 @@ export class Compiler {
} }
this.event.trigger('compilationFinished', [true, data, source, input, version]) this.event.trigger('compilationFinished', [true, data, source, input, version])
} }
} }
/** /**

@ -77,8 +77,7 @@ export interface CompilerInput {
// after remappings were applied. // after remappings were applied.
// If this key is an empty string, that refers to a global level. // If this key is an empty string, that refers to a global level.
[fileName: string]: Record<string, string> [fileName: string]: Record<string, string>
}, }
parserErrorRecovery: boolean,
// The following can be used to select desired outputs based // The following can be used to select desired outputs based
// on file and contract names. // on file and contract names.
// If this field is omitted, then the compiler loads and does type checking, // If this field is omitted, then the compiler loads and does type checking,

@ -3,7 +3,7 @@ import async from 'async'
import path from 'path' import path from 'path'
import deepequal from 'deep-equal' import deepequal from 'deep-equal'
import Log from './logger' 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' import { SrcIfc, CompilerConfiguration, CompilationErrors } from './types'
const logger = new Log() const logger = new Log()
const log = logger.logger const log = logger.logger
@ -114,7 +114,7 @@ export function compileFileOrFiles (filename: string, isDirectory: boolean, opts
} finally { } finally {
async.waterfall([ async.waterfall([
function loadCompiler (next) { function loadCompiler (next) {
compiler = new Compiler((url, cb) => { compiler = new RemixCompiler((url, cb) => {
try { try {
cb(null, fs.readFileSync(url, 'utf-8')) cb(null, fs.readFileSync(url, 'utf-8'))
} catch (e) { } catch (e) {
@ -186,7 +186,7 @@ export function compileContractSources (sources: SrcIfc, newCompConfig: any, imp
if (!compiler || !deepequal(UTRunner.compilerConfig, newCompConfig)) { if (!compiler || !deepequal(UTRunner.compilerConfig, newCompConfig)) {
UTRunner.compilerConfig = newCompConfig UTRunner.compilerConfig = newCompConfig
const { currentCompilerUrl, evmVersion, optimize, runs, usingWorker } = newCompConfig const { currentCompilerUrl, evmVersion, optimize, runs, usingWorker } = newCompConfig
compiler = new Compiler(importFileCb) compiler = new RemixCompiler(importFileCb)
compiler.set('evmVersion', evmVersion) compiler.set('evmVersion', evmVersion)
compiler.set('optimize', optimize) compiler.set('optimize', optimize)
compiler.set('runs', runs) compiler.set('runs', runs)

@ -4,7 +4,8 @@
"types": ["node", "jest"], "types": ["node", "jest"],
"module": "commonjs", "module": "commonjs",
"esModuleInterop": true, "esModuleInterop": true,
"rootDir": "./src", "allowJs": true,
"rootDir": "./",
}, },
"include": ["**/*.ts"] "include": ["**/*.ts"]
} }

@ -23,7 +23,7 @@ const RemixApp = (props: IRemixAppUi) => {
async function activateApp () { async function activateApp () {
props.app.themeModule.initTheme(() => { props.app.themeModule.initTheme(() => {
setAppReady(true) setAppReady(true)
props.app.activate() props.app.activate()
setListeners() setListeners()
}) })
} }

Loading…
Cancel
Save