From 99bbf6e0ee2ab375539437c1417b528fee20f8f3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 22 Nov 2017 14:54:03 +0100 Subject: [PATCH] use splitted remix --- best-practices.md | 4 ++-- package.json | 5 ++++- src/app.js | 6 +++--- src/app/compiler/compiler.js | 3 ++- src/app/debugger/debugger.js | 10 ++++++---- src/app/editor/contextView.js | 6 +++--- src/app/editor/contextualListener.js | 8 ++++---- src/app/editor/editor.js | 7 +++---- src/app/execution/txFormat.js | 2 +- src/app/execution/txListener.js | 6 +++--- src/app/execution/txLogger.js | 6 +++--- src/app/files/browser-files.js | 2 +- src/app/files/file-explorer.js | 9 ++++----- src/app/files/fileManager.js | 4 ++-- src/app/files/shared-folder.js | 2 +- src/app/panels/editor-panel.js | 6 +++--- src/app/panels/file-panel.js | 6 +++--- src/app/panels/righthand-panel.js | 6 +++--- src/app/panels/terminal.js | 6 +++--- src/app/staticanalysis/modules/abstractAstView.js | 2 +- src/app/staticanalysis/staticAnalysisRunner.js | 2 +- src/app/staticanalysis/staticAnalysisView.js | 6 +++--- src/app/tabs/analysis-tab.js | 4 ++-- src/app/tabs/compile-tab.js | 6 +++--- src/app/tabs/debugger-tab.js | 4 ++-- src/app/tabs/run-tab.js | 4 ++-- src/app/tabs/settings-tab.js | 4 ++-- src/app/tabs/support-tab.js | 4 ++-- src/app/tabs/tabbed-menu.js | 4 ++-- src/app/ui/dropdown.js | 6 +++--- src/app/ui/modaldialog.js | 4 ++-- src/app/ui/renderer.js | 4 ++-- src/execution-context.js | 6 +++--- src/lib/offsetToLineColumnConverter.js | 2 +- src/lib/remixd.js | 2 +- src/universal-dapp.js | 6 +++--- 36 files changed, 89 insertions(+), 85 deletions(-) diff --git a/best-practices.md b/best-practices.md index 24b5805d5d..bce3599d6b 100644 --- a/best-practices.md +++ b/best-practices.md @@ -26,7 +26,7 @@ // user-card.js var yo = require('yo-yo') var csjs = require('csjs-inject') -var EventManager = require('ethereum-remix').lib.EventManager +var EventManager = require('remix-lib').EventManager var css = csjs` .userCard { @@ -110,7 +110,7 @@ module.exports = UserCard ```js /*****************************************************************************/ // 1. SETUP CONTEXT -var EventManager = require('ethereum-remix').lib.EventManager +var EventManager = require('remix-lib').EventManager var funds = { event: new EventManager() } var userfunds = 15 function getUserFunds () { return userfunds } diff --git a/package.json b/package.json index 066a0abb74..ed6cca2d55 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,10 @@ "csjs-inject": "^1.0.1", "csslint": "^1.0.2", "deep-equal": "^1.0.1", - "ethereum-remix": "https://github.com/ethereum/remix", + "remix-core": "^0.0.3", + "remix-lib": "^0.0.3", + "remix-solidity": "^0.0.2", + "remix-debugger": "^0.0.3", "ethereumjs-abi": "https://github.com/ethereumjs/ethereumjs-abi", "ethereumjs-block": "^1.6.0", "ethereumjs-tx": "^1.3.3", diff --git a/src/app.js b/src/app.js index ed6811ed07..cff05fc284 100644 --- a/src/app.js +++ b/src/app.js @@ -3,8 +3,8 @@ var $ = require('jquery') var csjs = require('csjs-inject') var yo = require('yo-yo') -var remix = require('ethereum-remix') -var EventManager = remix.lib.EventManager +var remixLib = require('remix-lib') +var EventManager = remixLib.EventManager var UniversalDApp = require('./universal-dapp.js') var Remixd = require('./lib/remixd') @@ -37,7 +37,7 @@ var FileManager = require('./app/files/fileManager') var ContextualListener = require('./app/editor/contextualListener') var ContextView = require('./app/editor/contextView') -var styleGuide = remix.ui.styleGuide +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = csjs` diff --git a/src/app/compiler/compiler.js b/src/app/compiler/compiler.js index 76b1a9d1fd..f733e294b3 100644 --- a/src/app/compiler/compiler.js +++ b/src/app/compiler/compiler.js @@ -7,7 +7,8 @@ var webworkify = require('webworkify') var compilerInput = require('./compiler-input') -var EventManager = require('ethereum-remix').lib.EventManager +var remixLib = require('remix-lib') +var EventManager = remixLib.EventManager var txHelper = require('../execution/txHelper') diff --git a/src/app/debugger/debugger.js b/src/app/debugger/debugger.js index 6e150c7253..62b17c019b 100644 --- a/src/app/debugger/debugger.js +++ b/src/app/debugger/debugger.js @@ -1,6 +1,8 @@ 'use strict' -var remix = require('ethereum-remix') +var remixDebugger = require('remix-debugger') +var remixLib = require('remix-lib') +var remixCore = require('remix-core') var executionContext = require('../../execution-context') /** @@ -8,13 +10,13 @@ var executionContext = require('../../execution-context') */ function Debugger (id, appAPI, editorEvent) { this.el = document.querySelector(id) - this.debugger = new remix.ui.Debugger() - this.sourceMappingDecoder = new remix.util.SourceMappingDecoder() + this.debugger = new remixDebugger.ui.Debugger() + this.sourceMappingDecoder = new remixLib.SourceMappingDecoder() this.el.appendChild(this.debugger.render()) this.appAPI = appAPI this.isActive = false - this.breakPointManager = new remix.code.BreakpointManager(this.debugger, (sourceLocation) => { + this.breakPointManager = new remixCore.code.BreakpointManager(this.debugger, (sourceLocation) => { return appAPI.offsetToLineColumn(sourceLocation, sourceLocation.file, this.editor, this.appAPI.lastCompilationResult().data) }) diff --git a/src/app/editor/contextView.js b/src/app/editor/contextView.js index c857402a2b..8fb93e4e26 100644 --- a/src/app/editor/contextView.js +++ b/src/app/editor/contextView.js @@ -1,10 +1,10 @@ 'use strict' var yo = require('yo-yo') var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() -var SourceMappingDecoder = remix.util.SourceMappingDecoder +var SourceMappingDecoder = remixLib.SourceMappingDecoder var css = csjs` .contextview { diff --git a/src/app/editor/contextualListener.js b/src/app/editor/contextualListener.js index 73070a007b..9897827ecf 100644 --- a/src/app/editor/contextualListener.js +++ b/src/app/editor/contextualListener.js @@ -1,8 +1,8 @@ 'use strict' -var remix = require('ethereum-remix') -var SourceMappingDecoder = remix.util.SourceMappingDecoder -var AstWalker = remix.util.AstWalker -var EventManager = remix.lib.EventManager +var remixLib = require('remix-lib') +var SourceMappingDecoder = remixLib.SourceMappingDecoder +var AstWalker = remixLib.AstWalker +var EventManager = remixLib.EventManager /* trigger contextChanged(nodes) diff --git a/src/app/editor/editor.js b/src/app/editor/editor.js index cd352da540..29f12b5c2d 100644 --- a/src/app/editor/editor.js +++ b/src/app/editor/editor.js @@ -1,6 +1,6 @@ 'use strict' - -var EventManager = require('ethereum-remix').lib.EventManager +var remixLib = require('remix-lib') +var EventManager = remixLib.EventManager var yo = require('yo-yo') var csjs = require('csjs-inject') var ace = require('brace') @@ -8,8 +8,7 @@ var Range = ace.acequire('ace/range').Range require('brace/ext/language_tools') var langTools = ace.acequire('ace/ext/language_tools') require('./mode-solidity.js') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = csjs` diff --git a/src/app/execution/txFormat.js b/src/app/execution/txFormat.js index bddbd8ac84..cd164c3d2b 100644 --- a/src/app/execution/txFormat.js +++ b/src/app/execution/txFormat.js @@ -4,7 +4,7 @@ var ethJSABI = require('ethereumjs-abi') var ethJSUtil = require('ethereumjs-util') var BN = ethJSUtil.BN var helper = require('./txHelper') -var TreeView = require('ethereum-remix').ui.TreeView +var TreeView = require('remix-debugger').ui.TreeView var executionContext = require('../../execution-context') module.exports = { diff --git a/src/app/execution/txListener.js b/src/app/execution/txListener.js index 8c9df4e0fe..5244860353 100644 --- a/src/app/execution/txListener.js +++ b/src/app/execution/txListener.js @@ -2,9 +2,9 @@ var async = require('async') var ethJSABI = require('ethereumjs-abi') var ethJSUtil = require('ethereumjs-util') -var EventManager = require('ethereum-remix').lib.EventManager -var remix = require('ethereum-remix') -var codeUtil = remix.util.code +var remixLib = require('remix-lib') +var EventManager = remixLib.EventManager +var codeUtil = remixLib.util var executionContext = require('../../execution-context') var txFormat = require('./txFormat') var txHelper = require('./txHelper') diff --git a/src/app/execution/txLogger.js b/src/app/execution/txLogger.js index 203851e0b4..ed3ea87993 100644 --- a/src/app/execution/txLogger.js +++ b/src/app/execution/txLogger.js @@ -4,11 +4,11 @@ const copy = require('clipboard-copy') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() -var EventManager = remix.lib.EventManager +var EventManager = remixLib.EventManager var helper = require('../../lib/helper') var executionContext = require('../../execution-context') var modalDialog = require('../ui/modal-dialog-custom') diff --git a/src/app/files/browser-files.js b/src/app/files/browser-files.js index b14163a892..4142d8df10 100644 --- a/src/app/files/browser-files.js +++ b/src/app/files/browser-files.js @@ -1,6 +1,6 @@ 'use strict' -var EventManager = require('ethereum-remix').lib.EventManager +var EventManager = require('remix-lib').EventManager function Files (storage) { var event = new EventManager() diff --git a/src/app/files/file-explorer.js b/src/app/files/file-explorer.js index ff231ab926..fedeee587c 100755 --- a/src/app/files/file-explorer.js +++ b/src/app/files/file-explorer.js @@ -1,16 +1,15 @@ /* global FileReader */ var yo = require('yo-yo') var csjs = require('csjs-inject') -var Treeview = require('ethereum-remix').ui.TreeView +var Treeview = require('remix-debugger').ui.TreeView var modalDialog = require('../ui/modaldialog') var modalDialogCustom = require('../ui/modal-dialog-custom') - -var EventManager = require('ethereum-remix').lib.EventManager +var remixLib = require('remix-lib') +var EventManager = remixLib.EventManager var helper = require('../../lib/helper') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = csjs` diff --git a/src/app/files/fileManager.js b/src/app/files/fileManager.js index 3eff1539d0..4a641416f8 100644 --- a/src/app/files/fileManager.js +++ b/src/app/files/fileManager.js @@ -1,9 +1,9 @@ 'use strict' var $ = require('jquery') -var remix = require('ethereum-remix') +var remixLib = require('remix-lib') var yo = require('yo-yo') -var EventManager = remix.lib.EventManager +var EventManager = remixLib.EventManager /* attach to files event (removed renamed) diff --git a/src/app/files/shared-folder.js b/src/app/files/shared-folder.js index 3632e8e17a..887f2bf7b6 100644 --- a/src/app/files/shared-folder.js +++ b/src/app/files/shared-folder.js @@ -1,6 +1,6 @@ 'use strict' var async = require('async') -var EventManager = require('ethereum-remix').lib.EventManager +var EventManager = require('remix-lib').EventManager class SharedFolder { constructor (remixd) { diff --git a/src/app/panels/editor-panel.js b/src/app/panels/editor-panel.js index 51240689b8..481aa6b1ad 100644 --- a/src/app/panels/editor-panel.js +++ b/src/app/panels/editor-panel.js @@ -1,8 +1,8 @@ var csjs = require('csjs-inject') var yo = require('yo-yo') -var EventManager = require('ethereum-remix').lib.EventManager -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var EventManager = remixLib.EventManager +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var Terminal = require('./terminal') diff --git a/src/app/panels/file-panel.js b/src/app/panels/file-panel.js index f4a93fe095..9e8deddddf 100644 --- a/src/app/panels/file-panel.js +++ b/src/app/panels/file-panel.js @@ -3,7 +3,8 @@ var $ = require('jquery') var csjs = require('csjs-inject') var yo = require('yo-yo') var minixhr = require('minixhr') // simple and small cross-browser XMLHttpRequest (XHR) -var EventManager = require('ethereum-remix').lib.EventManager +var remixLib = require('remix-lib') +var EventManager = remixLib.EventManager var FileExplorer = require('../files/file-explorer') var modalDialog = require('../ui/modaldialog') var modalDialogCustom = require('../ui/modal-dialog-custom') @@ -11,8 +12,7 @@ var QueryParams = require('../../lib/query-params') var queryParams = new QueryParams() var helper = require('../../lib/helper') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() module.exports = filepanel diff --git a/src/app/panels/righthand-panel.js b/src/app/panels/righthand-panel.js index f540456851..bbfc25a7f4 100644 --- a/src/app/panels/righthand-panel.js +++ b/src/app/panels/righthand-panel.js @@ -1,5 +1,6 @@ var yo = require('yo-yo') -var EventManager = require('ethereum-remix').lib.EventManager +var remixLib = require('remix-lib') +var EventManager = remixLib.EventManager var tabbedMenu = require('../tabs/tabbed-menu') var compileTab = require('../tabs/compile-tab') var runTab = require('../tabs/run-tab') @@ -10,8 +11,7 @@ var supportTab = require('../tabs/support-tab') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = csjs` diff --git a/src/app/panels/terminal.js b/src/app/panels/terminal.js index 43be29ea4a..d4006316e8 100644 --- a/src/app/panels/terminal.js +++ b/src/app/panels/terminal.js @@ -4,15 +4,15 @@ var javascriptserialize = require('javascript-serialize') var jsbeautify = require('js-beautify') var type = require('component-type') var vm = require('vm') -var EventManager = require('ethereum-remix').lib.EventManager +var remixLib = require('remix-lib') +var EventManager = remixLib.EventManager var Web3 = require('web3') var executionContext = require('../../execution-context') var Dropdown = require('../ui/dropdown') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = csjs` diff --git a/src/app/staticanalysis/modules/abstractAstView.js b/src/app/staticanalysis/modules/abstractAstView.js index ead9dfc3eb..ea28f77b32 100644 --- a/src/app/staticanalysis/modules/abstractAstView.js +++ b/src/app/staticanalysis/modules/abstractAstView.js @@ -1,5 +1,5 @@ var common = require('./staticAnalysisCommon') -var AstWalker = require('ethereum-remix').util.AstWalker +var AstWalker = require('remix-lib').AstWalker function abstractAstView () { this.contracts = [] diff --git a/src/app/staticanalysis/staticAnalysisRunner.js b/src/app/staticanalysis/staticAnalysisRunner.js index 8c944672f2..95fce3d013 100644 --- a/src/app/staticanalysis/staticAnalysisRunner.js +++ b/src/app/staticanalysis/staticAnalysisRunner.js @@ -1,5 +1,5 @@ 'use strict' -var AstWalker = require('ethereum-remix').util.AstWalker +var AstWalker = require('remix-lib').AstWalker var list = require('./modules/list') function staticAnalysisRunner () { diff --git a/src/app/staticanalysis/staticAnalysisView.js b/src/app/staticanalysis/staticAnalysisView.js index 9765433e6c..6f9b96d328 100644 --- a/src/app/staticanalysis/staticAnalysisView.js +++ b/src/app/staticanalysis/staticAnalysisView.js @@ -5,11 +5,11 @@ var $ = require('jquery') var utils = require('../../lib/utils') var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() -var EventManager = require('ethereum-remix').lib.EventManager +var EventManager = remixLib.EventManager var css = csjs` .analysis { diff --git a/src/app/tabs/analysis-tab.js b/src/app/tabs/analysis-tab.js index 7f2f6083d5..10c3fd23db 100644 --- a/src/app/tabs/analysis-tab.js +++ b/src/app/tabs/analysis-tab.js @@ -2,8 +2,8 @@ var yo = require('yo-yo') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = csjs` diff --git a/src/app/tabs/compile-tab.js b/src/app/tabs/compile-tab.js index d14e26a955..85bdda7075 100644 --- a/src/app/tabs/compile-tab.js +++ b/src/app/tabs/compile-tab.js @@ -8,12 +8,12 @@ var parseContracts = require('../contract/contractParser') var publishOnSwarm = require('../contract/publishOnSwarm') var modalDialog = require('../ui/modaldialog') var modalDialogCustom = require('../ui/modal-dialog-custom') -var TreeView = require('ethereum-remix').ui.TreeView +var TreeView = require('remix-debugger').ui.TreeView // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = csjs` diff --git a/src/app/tabs/debugger-tab.js b/src/app/tabs/debugger-tab.js index de73a9c8f2..da6edaf156 100644 --- a/src/app/tabs/debugger-tab.js +++ b/src/app/tabs/debugger-tab.js @@ -2,8 +2,8 @@ var yo = require('yo-yo') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = csjs` diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index 66d3690c1d..3aaac2477f 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -11,8 +11,8 @@ const copy = require('clipboard-copy') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = csjs` diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index 3be0aacde2..5dabb1cce3 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -5,8 +5,8 @@ var QueryParams = require('../../lib/query-params') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var helper = require('../../lib/helper') diff --git a/src/app/tabs/support-tab.js b/src/app/tabs/support-tab.js index c6d89efbe4..c6e9ff7f70 100644 --- a/src/app/tabs/support-tab.js +++ b/src/app/tabs/support-tab.js @@ -2,8 +2,8 @@ var yo = require('yo-yo') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = csjs` diff --git a/src/app/tabs/tabbed-menu.js b/src/app/tabs/tabbed-menu.js index ce7fc698d8..2a8a3e49c1 100644 --- a/src/app/tabs/tabbed-menu.js +++ b/src/app/tabs/tabbed-menu.js @@ -2,8 +2,8 @@ var $ = require('jquery') // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() module.exports = tabbedMenu diff --git a/src/app/ui/dropdown.js b/src/app/ui/dropdown.js index 27622904f3..d006ae88c1 100644 --- a/src/app/ui/dropdown.js +++ b/src/app/ui/dropdown.js @@ -1,9 +1,9 @@ var yo = require('yo-yo') -var EventManager = require('ethereum-remix').lib.EventManager +var remixLib = require('remix-lib') +var EventManager = remixLib.EventManager // -------------- styling ---------------------- var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = csjs` diff --git a/src/app/ui/modaldialog.js b/src/app/ui/modaldialog.js index c628874943..36975aaadb 100644 --- a/src/app/ui/modaldialog.js +++ b/src/app/ui/modaldialog.js @@ -1,7 +1,7 @@ var yo = require('yo-yo') var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = csjs` diff --git a/src/app/ui/renderer.js b/src/app/ui/renderer.js index f03f345edc..6e6f21295c 100644 --- a/src/app/ui/renderer.js +++ b/src/app/ui/renderer.js @@ -5,8 +5,8 @@ var yo = require('yo-yo') // -------------- styling ---------------------- // var csjs = require('csjs-inject') -var remix = require('ethereum-remix') -var styleGuide = remix.ui.styleGuide +var remixLib = require('remix-lib') +var styleGuide = remixLib.ui.styleGuide var styles = styleGuide() var css = yo`