diff --git a/apps/remix-ide/src/app/tabs/compile-tab.js b/apps/remix-ide/src/app/tabs/compile-tab.js index baecfc8e6e..e451ffd1f3 100644 --- a/apps/remix-ide/src/app/tabs/compile-tab.js +++ b/apps/remix-ide/src/app/tabs/compile-tab.js @@ -5,8 +5,12 @@ import { SolidityCompiler } from '@remix-ui/solidity-compiler' // eslint-disable import { CompileTabLogic } from '@remix-ui/solidity-compiler' // eslint-disable-line import { CompilerApiMixin } from '@remixproject/solidity-compiler-plugin' import { ViewPlugin } from '@remixproject/engine-web' +<<<<<<< HEAD import QueryParams from '../../lib/query-params' // import { ICompilerApi } from '@remix-project/remix-lib-ts' +======= +import { ICompilerApi } from '@remix-project/remix-lib-ts' +>>>>>>> 49c62946c (better org of types) import * as packageJson from '../../../../../package.json' const yo = require('yo-yo') @@ -32,7 +36,11 @@ const profile = { // - methods: ['getCompilationResult'] class CompileTab extends CompilerApiMixin(ViewPlugin) { // implements ICompilerApi +<<<<<<< HEAD constructor (config, fileManager) { +======= + constructor () { +>>>>>>> 49c62946c (better org of types) super(profile) this.fileManager = fileManager this.config = config diff --git a/apps/solidity-compiler/src/app/compiler.ts b/apps/solidity-compiler/src/app/compiler.ts index 5a6e8eafaa..d059d5bd2c 100644 --- a/apps/solidity-compiler/src/app/compiler.ts +++ b/apps/solidity-compiler/src/app/compiler.ts @@ -2,7 +2,10 @@ import { PluginClient } from "@remixproject/plugin"; import { createClient } from "@remixproject/plugin-webview"; import { CompilerApiMixin } from './compiler-api' import { ICompilerApi } from '@remix-project/remix-lib-ts' +<<<<<<< HEAD import { CompileTabLogic } from '@remix-ui/solidity-compiler' +======= +>>>>>>> 49c62946c (better org of types) const profile = { name: 'solidity', @@ -23,6 +26,7 @@ const defaultAppParameters = { includeNightlies: false } +<<<<<<< HEAD const defaultCompilerParameters = { runs: '200', optimize: false, @@ -30,6 +34,43 @@ const defaultCompilerParameters = { evmVersion: null, // compiler default language: 'Solidity' } +======= +export class CompilerClientApi extends CompilerApiMixin(PluginClient) implements ICompilerApi { + // interface matches libs/remix-ui/solidity-compiler/types/index.ts : ICompilerApi + currentFile: string + contractMap: { + file: string + } | Record + compileErrors: any + compileTabLogic: any + contractsDetails: Record + configurationSettings: ConfigurationSettings + + setHardHatCompilation: (value: boolean) => void + getParameters: () => ConfigurationSettings + setParameters: (params: Partial) => void + setCompilerConfig: (settings: ConfigurationSettings) => void + + getConfiguration: (value: string) => string + setConfiguration: (name: string, value: string) => void + getFileManagerMode: () => string + + + getCompilationResult: () => any + + onCurrentFileChanged: (fileName: string) => void + onResetResults: () => void + onSetWorkspace: (isLocalhost: boolean) => void + onNoFileSelected: () => void + onCompilationFinished: (contractsDetails: any, contractMap: any) => void + onSessionSwitched: () => void + onContentChanged: () => void + + fileExists: (file: string) => Promise + writeFile: (file: string, content: string) => Promise + readFile: (file: string) => Promise + open: (file: string) => void +>>>>>>> 49c62946c (better org of types) export class CompilerClientApi extends CompilerApiMixin(PluginClient) implements ICompilerApi { constructor () { diff --git a/libs/remix-lib/src/index.ts b/libs/remix-lib/src/index.ts index 1ba94fdd21..51be11a255 100644 --- a/libs/remix-lib/src/index.ts +++ b/libs/remix-lib/src/index.ts @@ -18,7 +18,11 @@ import * as typeConversion from './execution/typeConversion' import { TxRunnerVM } from './execution/txRunnerVM' import { TxRunnerWeb3 } from './execution/txRunnerWeb3' import * as txResultHelper from './helpers/txResultHelper' +<<<<<<< HEAD export { ICompilerApi, ConfigurationSettings } from './types/ICompilerApi' +======= +export { ICompilerApi, ConfigurationSettings} from './types/ICompilerApi' +>>>>>>> 49c62946c (better org of types) const helpers = { ui: uiHelper, diff --git a/libs/remix-lib/src/types/ICompilerApi.ts b/libs/remix-lib/src/types/ICompilerApi.ts index de765327ad..dc8ba3101d 100644 --- a/libs/remix-lib/src/types/ICompilerApi.ts +++ b/libs/remix-lib/src/types/ICompilerApi.ts @@ -7,6 +7,7 @@ export interface ICompilerApi { compileTabLogic: any contractsDetails: Record configurationSettings: ConfigurationSettings +<<<<<<< HEAD getCompilerParameters: () => ConfigurationSettings setCompilerParameters: (ConfigurationSettings?) => void @@ -19,6 +20,19 @@ export interface ICompilerApi { getCompilationResult: () => any +======= + + setHardHatCompilation: (value: boolean) => void + getParameters: () => any + setParameters: (params) => void + getConfiguration: (value: string) => string + setConfiguration: (name: string, value: string) => void + getFileManagerMode: () => string + setCompilerConfig: (settings: any) => void + + getCompilationResult: () => any + +>>>>>>> 49c62946c (better org of types) onCurrentFileChanged: (fileName: string) => void onResetResults: () => void, onSetWorkspace: (workspace: any) => void @@ -26,12 +40,17 @@ export interface ICompilerApi { onCompilationFinished: (contractsDetails: any, contractMap: any) => void onSessionSwitched: () => void onContentChanged: () => void +<<<<<<< HEAD resolveContentAndSave: (url: string) => Promise +======= + +>>>>>>> 49c62946c (better org of types) fileExists: (file: string) => Promise writeFile: (file: string, content: string) => Promise readFile: (file: string) => Promise open: (file: string) => void +<<<<<<< HEAD saveCurrentFile: () => void logToTerminal: (log: terminalLog) => {} @@ -43,6 +62,9 @@ export type terminalLog = { type: 'info' | 'error' | 'warning' value: string } +======= + } +>>>>>>> 49c62946c (better org of types) export interface ConfigurationSettings { version: string, @@ -50,4 +72,8 @@ export interface ConfigurationSettings { language: string, optimize: boolean, runs: string +<<<<<<< HEAD +} +======= } +>>>>>>> 49c62946c (better org of types) 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 4932b1456c..d1cb987169 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/types/index.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/types/index.ts @@ -1,9 +1,16 @@ import { ICompilerApi, ConfigurationSettings } from '@remix-project/remix-lib-ts' +<<<<<<< HEAD import { CompileTabLogic } from '../logic/compileTabLogic' export type onCurrentFileChanged = (fileName: string) => void export interface SolidityCompilerProps { api: ICompilerApi +======= +export type onCurrentFileChanged = (fileName: string) => void + +export interface SolidityCompilerProps { + plugin: ICompilerApi +>>>>>>> 49c62946c (better org of types) } export interface CompilerContainerProps { @@ -23,4 +30,8 @@ export interface ContractSelectionProps { } | Record, modal: (title: string, message: string | JSX.Element, okLabel: string, okFn: () => void, cancelLabel?: string, cancelFn?: () => void) => void, contractsDetails: Record +<<<<<<< HEAD +} +======= } +>>>>>>> 49c62946c (better org of types)