Skip to content

Commit

Permalink
use splitted remix
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 committed Nov 22, 2017
1 parent 57a496a commit 578a326
Show file tree
Hide file tree
Showing 36 changed files with 89 additions and 85 deletions.
4 changes: 2 additions & 2 deletions best-practices.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 }
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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`
Expand Down
3 changes: 2 additions & 1 deletion src/app/compiler/compiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
10 changes: 6 additions & 4 deletions src/app/debugger/debugger.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
'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')

/**
* Manage remix and source highlighting
*/
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)
})

Expand Down
6 changes: 3 additions & 3 deletions src/app/editor/contextView.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions src/app/editor/contextualListener.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
7 changes: 3 additions & 4 deletions src/app/editor/editor.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
'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')
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`
Expand Down
2 changes: 1 addition & 1 deletion src/app/execution/txFormat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
6 changes: 3 additions & 3 deletions src/app/execution/txListener.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
6 changes: 3 additions & 3 deletions src/app/execution/txLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion src/app/files/browser-files.js
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
9 changes: 4 additions & 5 deletions src/app/files/file-explorer.js
Original file line number Diff line number Diff line change
@@ -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`
Expand Down
4 changes: 2 additions & 2 deletions src/app/files/fileManager.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/app/files/shared-folder.js
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions src/app/panels/editor-panel.js
Original file line number Diff line number Diff line change
@@ -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')
Expand Down
6 changes: 3 additions & 3 deletions src/app/panels/file-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ 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')
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
Expand Down
6 changes: 3 additions & 3 deletions src/app/panels/righthand-panel.js
Original file line number Diff line number Diff line change
@@ -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')
Expand All @@ -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`
Expand Down
6 changes: 3 additions & 3 deletions src/app/panels/terminal.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion src/app/staticanalysis/modules/abstractAstView.js
Original file line number Diff line number Diff line change
@@ -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 = []
Expand Down
2 changes: 1 addition & 1 deletion src/app/staticanalysis/staticAnalysisRunner.js
Original file line number Diff line number Diff line change
@@ -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 () {
Expand Down
6 changes: 3 additions & 3 deletions src/app/staticanalysis/staticAnalysisView.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/app/tabs/analysis-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
6 changes: 3 additions & 3 deletions src/app/tabs/compile-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions src/app/tabs/debugger-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions src/app/tabs/run-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions src/app/tabs/settings-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down
4 changes: 2 additions & 2 deletions src/app/tabs/support-tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
4 changes: 2 additions & 2 deletions src/app/tabs/tabbed-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 578a326

Please sign in to comment.