added config file to solidity-compiler

pull/2249/head
lianahus 3 years ago committed by yann300
parent 6711499dda
commit 19e91e867e
  1. 17
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx
  2. 1
      libs/remix-ui/solidity-compiler/src/lib/types/index.ts

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

@ -46,4 +46,3 @@ export interface CompilationDetails {
export interface ContractsFile {
[currentFile: string]: CompilationDetails
}

Loading…
Cancel
Save