restore files

editorcontextDummy
filip mertens 2 years ago
parent 098baa7302
commit bf439f1b11
  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
},
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

@ -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

@ -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
}

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

@ -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<string, string>
},
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,

@ -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)

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

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

Loading…
Cancel
Save