|
|
@ -1,29 +1,29 @@ |
|
|
|
'use strict' |
|
|
|
'use strict' |
|
|
|
import {RunTab, makeUdapp} from './app/udapp' |
|
|
|
import { RunTab, makeUdapp } from './app/udapp' |
|
|
|
import {RemixEngine} from './remixEngine' |
|
|
|
import { RemixEngine } from './remixEngine' |
|
|
|
import {RemixAppManager} from './remixAppManager' |
|
|
|
import { RemixAppManager } from './remixAppManager' |
|
|
|
import {ThemeModule} from './app/tabs/theme-module' |
|
|
|
import { ThemeModule } from './app/tabs/theme-module' |
|
|
|
import {LocaleModule} from './app/tabs/locale-module' |
|
|
|
import { LocaleModule } from './app/tabs/locale-module' |
|
|
|
import {NetworkModule} from './app/tabs/network-module' |
|
|
|
import { NetworkModule } from './app/tabs/network-module' |
|
|
|
import {Web3ProviderModule} from './app/tabs/web3-provider' |
|
|
|
import { Web3ProviderModule } from './app/tabs/web3-provider' |
|
|
|
import {CompileAndRun} from './app/tabs/compile-and-run' |
|
|
|
import { CompileAndRun } from './app/tabs/compile-and-run' |
|
|
|
import {PluginStateLogger} from './app/tabs/state-logger' |
|
|
|
import { PluginStateLogger } from './app/tabs/state-logger' |
|
|
|
import {SidePanel} from './app/components/side-panel' |
|
|
|
import { SidePanel } from './app/components/side-panel' |
|
|
|
import {StatusBar} from './app/components/status-bar' |
|
|
|
import { StatusBar } from './app/components/status-bar' |
|
|
|
import {HiddenPanel} from './app/components/hidden-panel' |
|
|
|
import { HiddenPanel } from './app/components/hidden-panel' |
|
|
|
import {PinnedPanel} from './app/components/pinned-panel' |
|
|
|
import { PinnedPanel } from './app/components/pinned-panel' |
|
|
|
import {VerticalIcons} from './app/components/vertical-icons' |
|
|
|
import { VerticalIcons } from './app/components/vertical-icons' |
|
|
|
import {LandingPage} from './app/ui/landing-page/landing-page' |
|
|
|
import { LandingPage } from './app/ui/landing-page/landing-page' |
|
|
|
import {MainPanel} from './app/components/main-panel' |
|
|
|
import { MainPanel } from './app/components/main-panel' |
|
|
|
import {PermissionHandlerPlugin} from './app/plugins/permission-handler-plugin' |
|
|
|
import { PermissionHandlerPlugin } from './app/plugins/permission-handler-plugin' |
|
|
|
import {AstWalker} from '@remix-project/remix-astwalker' |
|
|
|
import { AstWalker } from '@remix-project/remix-astwalker' |
|
|
|
import {LinkLibraries, DeployLibraries, OpenZeppelinProxy} from '@remix-project/core-plugin' |
|
|
|
import { LinkLibraries, DeployLibraries, OpenZeppelinProxy } from '@remix-project/core-plugin' |
|
|
|
import {CodeParser} from './app/plugins/parser/code-parser' |
|
|
|
import { CodeParser } from './app/plugins/parser/code-parser' |
|
|
|
import {SolidityScript} from './app/plugins/solidity-script' |
|
|
|
import { SolidityScript } from './app/plugins/solidity-script' |
|
|
|
|
|
|
|
|
|
|
|
import {WalkthroughService} from './walkthroughService' |
|
|
|
import { WalkthroughService } from './walkthroughService' |
|
|
|
|
|
|
|
|
|
|
|
import {OffsetToLineColumnConverter, CompilerMetadata, CompilerArtefacts, FetchAndCompile, CompilerImports, GistHandler} from '@remix-project/core-plugin' |
|
|
|
import { OffsetToLineColumnConverter, CompilerMetadata, CompilerArtefacts, FetchAndCompile, CompilerImports, GistHandler } from '@remix-project/core-plugin' |
|
|
|
|
|
|
|
|
|
|
|
import {Registry} from '@remix-project/remix-lib' |
|
|
|
import {Registry} from '@remix-project/remix-lib' |
|
|
|
import {ConfigPlugin} from './app/plugins/config' |
|
|
|
import {ConfigPlugin} from './app/plugins/config' |
|
|
@ -61,10 +61,16 @@ import { remixAIDesktopPlugin } from './app/plugins/electron/remixAIDesktopPlugi |
|
|
|
import { RemixAIPlugin } from './app/plugins/remixAIPlugin' |
|
|
|
import { RemixAIPlugin } from './app/plugins/remixAIPlugin' |
|
|
|
import { SlitherHandleDesktop } from './app/plugins/electron/slitherPlugin' |
|
|
|
import { SlitherHandleDesktop } from './app/plugins/electron/slitherPlugin' |
|
|
|
import { SlitherHandle } from './app/files/slither-handle' |
|
|
|
import { SlitherHandle } from './app/files/slither-handle' |
|
|
|
|
|
|
|
import { FoundryHandle } from './app/files/foundry-handle' |
|
|
|
|
|
|
|
import { FoundryHandleDesktop } from './app/plugins/electron/foundryPlugin' |
|
|
|
|
|
|
|
import { HardhatHandle } from './app/files/hardhat-handle' |
|
|
|
|
|
|
|
import { HardhatHandleDesktop } from './app/plugins/electron/hardhatPlugin' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { SolCoder } from './app/plugins/solcoderAI' |
|
|
|
import { GitPlugin } from './app/plugins/git' |
|
|
|
import { GitPlugin } from './app/plugins/git' |
|
|
|
import { Matomo } from './app/plugins/matomo' |
|
|
|
import { Matomo } from './app/plugins/matomo' |
|
|
|
|
|
|
|
|
|
|
|
import {SolCoder} from './app/plugins/solcoderAI' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { TemplatesSelectionPlugin } from './app/plugins/templates-selection/templates-selection-plugin' |
|
|
|
import { TemplatesSelectionPlugin } from './app/plugins/templates-selection/templates-selection-plugin' |
|
|
|
|
|
|
|
|
|
|
@ -83,6 +89,7 @@ const Config = require('./config') |
|
|
|
const FileManager = require('./app/files/fileManager') |
|
|
|
const FileManager = require('./app/files/fileManager') |
|
|
|
import FileProvider from "./app/files/fileProvider" |
|
|
|
import FileProvider from "./app/files/fileProvider" |
|
|
|
import { appPlatformTypes } from '@remix-ui/app' |
|
|
|
import { appPlatformTypes } from '@remix-ui/app' |
|
|
|
|
|
|
|
|
|
|
|
const DGitProvider = require('./app/files/dgitProvider') |
|
|
|
const DGitProvider = require('./app/files/dgitProvider') |
|
|
|
const WorkspaceFileProvider = require('./app/files/workspaceFileProvider') |
|
|
|
const WorkspaceFileProvider = require('./app/files/workspaceFileProvider') |
|
|
|
|
|
|
|
|
|
|
@ -91,19 +98,19 @@ const PluginManagerComponent = require('./app/components/plugin-manager-componen |
|
|
|
const CompileTab = require('./app/tabs/compile-tab') |
|
|
|
const CompileTab = require('./app/tabs/compile-tab') |
|
|
|
const SettingsTab = require('./app/tabs/settings-tab') |
|
|
|
const SettingsTab = require('./app/tabs/settings-tab') |
|
|
|
const AnalysisTab = require('./app/tabs/analysis-tab') |
|
|
|
const AnalysisTab = require('./app/tabs/analysis-tab') |
|
|
|
const {DebuggerTab} = require('./app/tabs/debugger-tab') |
|
|
|
const { DebuggerTab } = require('./app/tabs/debugger-tab') |
|
|
|
const TestTab = require('./app/tabs/test-tab') |
|
|
|
const TestTab = require('./app/tabs/test-tab') |
|
|
|
const FilePanel = require('./app/panels/file-panel') |
|
|
|
const FilePanel = require('./app/panels/file-panel') |
|
|
|
const Editor = require('./app/editor/editor') |
|
|
|
const Editor = require('./app/editor/editor') |
|
|
|
const Terminal = require('./app/panels/terminal') |
|
|
|
const Terminal = require('./app/panels/terminal') |
|
|
|
const {TabProxy} = require('./app/panels/tab-proxy.js') |
|
|
|
const { TabProxy } = require('./app/panels/tab-proxy.js') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export class platformApi { |
|
|
|
export class platformApi { |
|
|
|
get name () { |
|
|
|
get name() { |
|
|
|
return isElectron() ? appPlatformTypes.desktop : appPlatformTypes.web |
|
|
|
return isElectron() ? appPlatformTypes.desktop : appPlatformTypes.web |
|
|
|
} |
|
|
|
} |
|
|
|
isDesktop () { |
|
|
|
isDesktop() { |
|
|
|
return isElectron() |
|
|
|
return isElectron() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -123,7 +130,7 @@ class AppComponent { |
|
|
|
|
|
|
|
|
|
|
|
// load app config
|
|
|
|
// load app config
|
|
|
|
const config = new Config(configStorage) |
|
|
|
const config = new Config(configStorage) |
|
|
|
Registry.getInstance().put({api: config, name: 'config'}) |
|
|
|
Registry.getInstance().put({ api: config, name: 'config' }) |
|
|
|
|
|
|
|
|
|
|
|
// load file system
|
|
|
|
// load file system
|
|
|
|
this._components.filesProviders = {} |
|
|
|
this._components.filesProviders = {} |
|
|
@ -204,12 +211,12 @@ class AppComponent { |
|
|
|
this.themeModule = new ThemeModule() |
|
|
|
this.themeModule = new ThemeModule() |
|
|
|
// ----------------- locale service ---------------------------------
|
|
|
|
// ----------------- locale service ---------------------------------
|
|
|
|
this.localeModule = new LocaleModule() |
|
|
|
this.localeModule = new LocaleModule() |
|
|
|
Registry.getInstance().put({api: this.themeModule, name: 'themeModule'}) |
|
|
|
Registry.getInstance().put({ api: this.themeModule, name: 'themeModule' }) |
|
|
|
Registry.getInstance().put({api: this.localeModule, name: 'localeModule'}) |
|
|
|
Registry.getInstance().put({ api: this.localeModule, name: 'localeModule' }) |
|
|
|
|
|
|
|
|
|
|
|
// ----------------- editor service ----------------------------
|
|
|
|
// ----------------- editor service ----------------------------
|
|
|
|
const editor = new Editor() // wrapper around ace editor
|
|
|
|
const editor = new Editor() // wrapper around ace editor
|
|
|
|
Registry.getInstance().put({api: editor, name: 'editor'}) |
|
|
|
Registry.getInstance().put({ api: editor, name: 'editor' }) |
|
|
|
editor.event.register('requiringToSaveCurrentfile', (currentFile) => { |
|
|
|
editor.event.register('requiringToSaveCurrentfile', (currentFile) => { |
|
|
|
fileManager.saveCurrentFile() |
|
|
|
fileManager.saveCurrentFile() |
|
|
|
if (currentFile.endsWith('.circom')) this.appManager.activatePlugin(['circuit-compiler']) |
|
|
|
if (currentFile.endsWith('.circom')) this.appManager.activatePlugin(['circuit-compiler']) |
|
|
@ -217,7 +224,7 @@ class AppComponent { |
|
|
|
|
|
|
|
|
|
|
|
// ----------------- fileManager service ----------------------------
|
|
|
|
// ----------------- fileManager service ----------------------------
|
|
|
|
const fileManager = new FileManager(editor, appManager) |
|
|
|
const fileManager = new FileManager(editor, appManager) |
|
|
|
Registry.getInstance().put({api: fileManager, name: 'filemanager'}) |
|
|
|
Registry.getInstance().put({ api: fileManager, name: 'filemanager' }) |
|
|
|
// ----------------- dGit provider ---------------------------------
|
|
|
|
// ----------------- dGit provider ---------------------------------
|
|
|
|
const dGitProvider = new DGitProvider() |
|
|
|
const dGitProvider = new DGitProvider() |
|
|
|
|
|
|
|
|
|
|
@ -304,7 +311,7 @@ class AppComponent { |
|
|
|
// -------------------Terminal----------------------------------------
|
|
|
|
// -------------------Terminal----------------------------------------
|
|
|
|
makeUdapp(blockchain, compilersArtefacts, (domEl) => terminal.logHtml(domEl)) |
|
|
|
makeUdapp(blockchain, compilersArtefacts, (domEl) => terminal.logHtml(domEl)) |
|
|
|
const terminal = new Terminal( |
|
|
|
const terminal = new Terminal( |
|
|
|
{appManager, blockchain}, |
|
|
|
{ appManager, blockchain }, |
|
|
|
{ |
|
|
|
{ |
|
|
|
getPosition: (event) => { |
|
|
|
getPosition: (event) => { |
|
|
|
const limitUp = 36 |
|
|
|
const limitUp = 36 |
|
|
@ -405,20 +412,27 @@ class AppComponent { |
|
|
|
const remixAIDesktop = new remixAIDesktopPlugin() |
|
|
|
const remixAIDesktop = new remixAIDesktopPlugin() |
|
|
|
this.engine.register([remixAIDesktop]) |
|
|
|
this.engine.register([remixAIDesktop]) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const remixAI = new RemixAIPlugin(isElectron()) |
|
|
|
const remixAI = new RemixAIPlugin(isElectron()) |
|
|
|
this.engine.register([remixAI]) |
|
|
|
this.engine.register([remixAI]) |
|
|
|
|
|
|
|
|
|
|
|
const compilerloader = isElectron()? new compilerLoaderPluginDesktop(): new compilerLoaderPlugin() |
|
|
|
const compilerloader = isElectron() ? new compilerLoaderPluginDesktop() : new compilerLoaderPlugin() |
|
|
|
this.engine.register([compilerloader]) |
|
|
|
this.engine.register([compilerloader]) |
|
|
|
|
|
|
|
|
|
|
|
// slither analyzer plugin (remixd / desktop)
|
|
|
|
// slither analyzer plugin (remixd / desktop)
|
|
|
|
const slitherPlugin = isElectron() ? new SlitherHandleDesktop() : new SlitherHandle() |
|
|
|
const slitherPlugin = isElectron() ? new SlitherHandleDesktop() : new SlitherHandle() |
|
|
|
this.engine.register([slitherPlugin]) |
|
|
|
this.engine.register([slitherPlugin]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//foundry plugin
|
|
|
|
|
|
|
|
const foundryPlugin = isElectron() ? new FoundryHandleDesktop() : new FoundryHandle() |
|
|
|
|
|
|
|
this.engine.register([foundryPlugin]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// hardhat plugin
|
|
|
|
|
|
|
|
const hardhatPlugin = isElectron() ? new HardhatHandleDesktop() : new HardhatHandle() |
|
|
|
|
|
|
|
this.engine.register([hardhatPlugin]) |
|
|
|
|
|
|
|
|
|
|
|
// LAYOUT & SYSTEM VIEWS
|
|
|
|
// LAYOUT & SYSTEM VIEWS
|
|
|
|
const appPanel = new MainPanel() |
|
|
|
const appPanel = new MainPanel() |
|
|
|
Registry.getInstance().put({api: this.mainview, name: 'mainview'}) |
|
|
|
Registry.getInstance().put({ api: this.mainview, name: 'mainview' }) |
|
|
|
const tabProxy = new TabProxy(fileManager, editor) |
|
|
|
const tabProxy = new TabProxy(fileManager, editor) |
|
|
|
this.engine.register([appPanel, tabProxy]) |
|
|
|
this.engine.register([appPanel, tabProxy]) |
|
|
|
|
|
|
|
|
|
|
@ -470,8 +484,6 @@ class AppComponent { |
|
|
|
analysis, |
|
|
|
analysis, |
|
|
|
test, |
|
|
|
test, |
|
|
|
filePanel.remixdHandle, |
|
|
|
filePanel.remixdHandle, |
|
|
|
filePanel.hardhatHandle, |
|
|
|
|
|
|
|
filePanel.foundryHandle, |
|
|
|
|
|
|
|
filePanel.truffleHandle, |
|
|
|
filePanel.truffleHandle, |
|
|
|
linkLibraries, |
|
|
|
linkLibraries, |
|
|
|
deployLibraries, |
|
|
|
deployLibraries, |
|
|
@ -480,10 +492,10 @@ class AppComponent { |
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
this.layout.panels = { |
|
|
|
this.layout.panels = { |
|
|
|
tabs: {plugin: tabProxy, active: true}, |
|
|
|
tabs: { plugin: tabProxy, active: true }, |
|
|
|
editor: {plugin: editor, active: true}, |
|
|
|
editor: { plugin: editor, active: true }, |
|
|
|
main: {plugin: appPanel, active: false}, |
|
|
|
main: { plugin: appPanel, active: false }, |
|
|
|
terminal: {plugin: terminal, active: true, minimized: false} |
|
|
|
terminal: { plugin: terminal, active: true, minimized: false } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -496,7 +508,7 @@ class AppComponent { |
|
|
|
} catch (e) { |
|
|
|
} catch (e) { |
|
|
|
console.log("couldn't register iframe plugins", e.message) |
|
|
|
console.log("couldn't register iframe plugins", e.message) |
|
|
|
} |
|
|
|
} |
|
|
|
if (isElectron()){ |
|
|
|
if (isElectron()) { |
|
|
|
await this.appManager.activatePlugin(['fs']) |
|
|
|
await this.appManager.activatePlugin(['fs']) |
|
|
|
} |
|
|
|
} |
|
|
|
await this.appManager.activatePlugin(['layout']) |
|
|
|
await this.appManager.activatePlugin(['layout']) |
|
|
@ -539,8 +551,8 @@ class AppComponent { |
|
|
|
await this.appManager.activatePlugin(['walkthrough', 'storage', 'search', 'compileAndRun', 'recorder', 'dgitApi', 'dgit']) |
|
|
|
await this.appManager.activatePlugin(['walkthrough', 'storage', 'search', 'compileAndRun', 'recorder', 'dgitApi', 'dgit']) |
|
|
|
await this.appManager.activatePlugin(['solidity-script', 'remix-templates']) |
|
|
|
await this.appManager.activatePlugin(['solidity-script', 'remix-templates']) |
|
|
|
|
|
|
|
|
|
|
|
if (isElectron()){ |
|
|
|
if (isElectron()) { |
|
|
|
await this.appManager.activatePlugin(['isogit', 'electronconfig', 'electronTemplates', 'xterm', 'ripgrep', 'appUpdater', 'remixAID', 'slither']) |
|
|
|
await this.appManager.activatePlugin(['isogit', 'electronconfig', 'electronTemplates', 'xterm', 'ripgrep', 'appUpdater', 'slither', 'foundry', 'hardhat', 'remixAID']) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.appManager.on( |
|
|
|
this.appManager.on( |
|
|
|