From 19e91e867e1209b26b2218adeb45c53bbea626af Mon Sep 17 00:00:00 2001 From: lianahus Date: Tue, 10 May 2022 13:55:08 +0200 Subject: [PATCH] added config file to solidity-compiler --- .../src/lib/compiler-container.tsx | 17 ++++------------- .../solidity-compiler/src/lib/types/index.ts | 1 - 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx index d9ecdb5f66..2173e3d9b2 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx @@ -11,7 +11,7 @@ import { getValidLanguage } from '@remix-project/remix-solidity' import { CopyToClipboard } from '@remix-ui/clipboard' // eslint-disable-next-line @nrwl/nx/enforce-module-boundaries import * as json_config from '../../../../../apps/remix-ide/contracts/solidity_compiler_config.json' -import { readFileSync } from 'fs' +import { configFileContent } from './compilerConfiguration' import './css/style.css' @@ -188,18 +188,9 @@ export const CompilerContainer = (props: CompilerContainerProps) => { } const createNewConfigFile = async () => { - if (json_config.default) json_config.default = null - const configFileContent = JSON.stringify(json_config, null, '\t') - console.log("file content as string -> ", json_config) - console.log("file content as json -> ", configFileContent) - try { - const contentContent: string = readFileSync('../../../../../apps/remix-ide/contracts/solidity_compiler_config.json', 'utf8') - console.log("content is ", contentContent) - - } catch (err) { - console.log(err); - return; - } + const configFileJSON = JSON.stringify(configFileContent, null, '\t') + console.log("file content as string -> ", configFileContent) + console.log("file content as json -> ", configFileJSON) const filePath = configFilePathInput.current && configFilePathInput.current.value !== '' ? configFilePathInput.current.value : state.configFilePath await api.writeFile(filePath, configFileContent) diff --git a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts index 6b4dfed741..37cffd4289 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts @@ -46,4 +46,3 @@ export interface CompilationDetails { export interface ContractsFile { [currentFile: string]: CompilationDetails } -