use remix plugin 0.3

pull/5370/head
yann300 4 years ago
parent f9c2a03e7c
commit 8fa720213b
  1. 6
      apps/remix-ide-e2e/src/tests/pluginManager.test.ts
  2. 18
      apps/remix-ide/src/app.js
  3. 2
      apps/remix-ide/src/app/files/remixd-handle.js
  4. 2
      apps/remix-ide/src/app/tabs/debugger-tab.js
  5. 14
      apps/remix-ide/src/remixAppManager.js
  6. 8
      libs/remixd/package.json
  7. 131
      package-lock.json
  8. 21
      package.json

@ -44,6 +44,7 @@ module.exports = {
browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]') browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]')
.click('*[data-id="pluginManagerComponentPluginManager"]') .click('*[data-id="pluginManagerComponentPluginManager"]')
.scrollAndClick('*[data-id="pluginManagerComponentActivateButtondebugger"]') .scrollAndClick('*[data-id="pluginManagerComponentActivateButtondebugger"]')
.pause(2000)
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]') .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]')
.scrollAndClick('*[data-id="pluginManagerComponentActivateButtonvyper"]') .scrollAndClick('*[data-id="pluginManagerComponentActivateButtonvyper"]')
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonvyper"]') .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonvyper"]')
@ -54,8 +55,11 @@ module.exports = {
'Should deactivate plugins': function (browser: NightwatchBrowser) { 'Should deactivate plugins': function (browser: NightwatchBrowser) {
browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]') browser.waitForElementVisible('*[data-id="pluginManagerComponentPluginManager"]')
.click('*[data-id="pluginManagerComponentPluginManager"]') .click('*[data-id="pluginManagerComponentPluginManager"]')
.scrollAndClick('*[data-id="pluginManagerComponentDeactivateButtondebugger"]') .waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtondebugger"]')
.pause(2000)
.scrollAndClick('*[data-id="pluginManagerComponentDeactivateButtondebugger"]')
.waitForElementVisible('*[data-id="pluginManagerComponentActivateButtondebugger"]') .waitForElementVisible('*[data-id="pluginManagerComponentActivateButtondebugger"]')
.waitForElementVisible('*[data-id="pluginManagerComponentDeactivateButtonvyper"]')
.scrollAndClick('*[data-id="pluginManagerComponentDeactivateButtonvyper"]') .scrollAndClick('*[data-id="pluginManagerComponentDeactivateButtonvyper"]')
.waitForElementVisible('*[data-id="pluginManagerComponentActivateButtonvyper"]') .waitForElementVisible('*[data-id="pluginManagerComponentActivateButtonvyper"]')
}, },

@ -231,14 +231,14 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
const appManager = self.appManager const appManager = self.appManager
const pluginLoader = appManager.pluginLoader const pluginLoader = appManager.pluginLoader
const workspace = pluginLoader.get() const workspace = pluginLoader.get()
const engine = new Engine(appManager) const engine = new Engine()
engine.setPluginOption = ({ name, kind }) => { engine.setPluginOption = ({ name, kind }) => {
if (kind === 'provider') return { queueTimeout: 60000 * 2 } if (kind === 'provider') return { queueTimeout: 60000 * 2 }
if (name === 'LearnEth') return { queueTimeout: 60000 } if (name === 'LearnEth') return { queueTimeout: 60000 }
return { queueTimeout: 10000 } return { queueTimeout: 10000 }
} }
await engine.onload() engine.register(appManager)
// SERVICES // SERVICES
// ----------------- import content servive ------------------------ // ----------------- import content servive ------------------------
const contentImport = new CompilerImport() const contentImport = new CompilerImport()
@ -401,17 +401,17 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
await appManager.activatePlugin(['contentImport', 'theme', 'editor', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'network', 'web3Provider', 'offsetToLineColumnConverter']) await appManager.activatePlugin(['contentImport', 'theme', 'editor', 'fileManager', 'compilerMetadata', 'compilerArtefacts', 'network', 'web3Provider', 'offsetToLineColumnConverter'])
await appManager.activatePlugin(['mainPanel', 'menuicons']) await appManager.activatePlugin(['mainPanel', 'menuicons'])
await appManager.activatePlugin(['sidePanel']) // activating host plugin separately await appManager.activatePlugin(['sidePanel']) // activating host plugin separately
await appManager.activatePlugin(['home', 'hiddenPanel', 'pluginManager', 'fileExplorers', 'settings', 'contextualListener', 'scriptRunner', 'terminal', 'fetchAndCompile']) await appManager.activatePlugin(['home', 'hiddenPanel', 'pluginManager', 'fileExplorers', 'settings', 'contextualListener', 'terminal', 'fetchAndCompile'])
const queryParams = new QueryParams() const queryParams = new QueryParams()
const params = queryParams.get() const params = queryParams.get()
// Set workspace after initial activation // Set workspace after initial activation
if (Array.isArray(workspace)) { if (Array.isArray(workspace)) {
appManager.activatePlugin(workspace).then(() => { appManager.activatePlugin(workspace).then(async () => {
try { try {
if (params.deactivate) { if (params.deactivate) {
appManager.deactivatePlugin(params.deactivate.split(',')) await appManager.deactivatePlugin(params.deactivate.split(','))
} }
} catch (e) { } catch (e) {
console.log(e) console.log(e)
@ -425,9 +425,7 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
if (callDetails.length > 1) { if (callDetails.length > 1) {
toolTip(`initiating ${callDetails[0]} ...`) toolTip(`initiating ${callDetails[0]} ...`)
// @todo(remove the timeout when activatePlugin is on 0.3.0) // @todo(remove the timeout when activatePlugin is on 0.3.0)
setTimeout(() => { appManager.call(...callDetails).catch(console.error)
appManager.call(...callDetails).catch(console.error)
}, 5000)
} }
} }
}).catch(console.error) }).catch(console.error)

@ -1,5 +1,5 @@
import isElectron from 'is-electron' import isElectron from 'is-electron'
import { WebsocketPlugin } from '@remixproject/engine' import { WebsocketPlugin } from '@remixproject/engine-web'
import * as packageJson from '../../../../../package.json' import * as packageJson from '../../../../../package.json'
var yo = require('yo-yo') var yo = require('yo-yo')
var modalDialog = require('../ui/modaldialog') var modalDialog = require('../ui/modaldialog')

@ -63,7 +63,7 @@ class DebuggerTab extends ViewPlugin {
this.renderComponent() this.renderComponent()
this.call('manager', 'activatePlugin', 'source-verification').catch(e => console.log(e.message)) this.call('manager', 'activatePlugin', 'source-verification').catch(e => console.error(e))
// this.call('manager', 'activatePlugin', 'udapp') // this.call('manager', 'activatePlugin', 'udapp')
return this.el return this.el

@ -1,5 +1,6 @@
/* global localStorage, fetch */ /* global localStorage, fetch */
import { PluginManager, IframePlugin } from '@remixproject/engine' import { PluginManager } from '@remixproject/engine'
import { IframePlugin } from '@remixproject/engine-web'
import { EventEmitter } from 'events' import { EventEmitter } from 'events'
import QueryParams from './lib/query-params' import QueryParams from './lib/query-params'
import { PermissionHandler } from './app/ui/persmission-handler' import { PermissionHandler } from './app/ui/persmission-handler'
@ -27,11 +28,12 @@ export class RemixAppManager extends PluginManager {
this.permissionHandler = new PermissionHandler() this.permissionHandler = new PermissionHandler()
} }
async canActivate (from, to) { async canActivatePlugin (from, to) {
return canActivate(from.name) return true // canActivate(from.name)
} }
async canDeactivate (from, to) { async canDeactivatePlugin (from, to) {
console.log('canDeactivatePlugin', from, to)
return from.name === 'manager' return from.name === 'manager'
} }
@ -68,8 +70,8 @@ export class RemixAppManager extends PluginManager {
this.event.emit('deactivate', plugin) this.event.emit('deactivate', plugin)
} }
onRegistration (plugin) { onRegistration () {
this.event.emit('added', plugin.name) console.log('manager has been registered')
} }
async ensureActivated (apiName) { async ensureActivated (apiName) {

@ -35,10 +35,10 @@
}, },
"homepage": "https://github.com/ethereum/remix-project#readme", "homepage": "https://github.com/ethereum/remix-project#readme",
"dependencies": { "dependencies": {
"@remixproject/plugin": "0.3.0-beta.5", "@remixproject/plugin": "^0.3.2",
"@remixproject/plugin-api": "0.3.0-beta.5", "@remixproject/plugin-api": "^0.3.2",
"@remixproject/plugin-utils": "0.3.0-beta.5", "@remixproject/plugin-utils": "^0.3.2",
"@remixproject/plugin-ws": "^0.3.0-beta.8", "@remixproject/plugin-ws": "^0.3.2",
"axios": "^0.20.0", "axios": "^0.20.0",
"chokidar": "^2.1.8", "chokidar": "^2.1.8",
"commander": "^2.20.3", "commander": "^2.20.3",

131
package-lock.json generated

@ -6880,57 +6880,128 @@
"integrity": "sha512-tVkIU9JQw5fYPxLQgok/a7I6J1eEZ79svwQGpe2mb3jlVsPADOleefOnQBiS/takK7jQuNeswCUicMH1VWVziA==" "integrity": "sha512-tVkIU9JQw5fYPxLQgok/a7I6J1eEZ79svwQGpe2mb3jlVsPADOleefOnQBiS/takK7jQuNeswCUicMH1VWVziA=="
}, },
"@remixproject/engine": { "@remixproject/engine": {
"version": "0.2.4", "version": "0.3.2",
"resolved": "https://registry.npmjs.org/@remixproject/engine/-/engine-0.2.4.tgz", "resolved": "https://registry.npmjs.org/@remixproject/engine/-/engine-0.3.2.tgz",
"integrity": "sha512-rCekA2QZq5wbT7h9wqU+TDkRexUqhnMqcggmP+eG6ilowyZ4RhMsrrSl3fsZzd0rnp4w1LSmX0vCbuXfja3RqQ==" "integrity": "sha512-kou/v2/EdB3H81vsFA/i//AEx2byVs1l0sdynoj+e7q8pGIMVFs7YCuXj+2DU+UDKUG3JGnyi4jKRygqBq0Wqw==",
"requires": {
"@remixproject/plugin-api": "0.3.2",
"@remixproject/plugin-utils": "0.3.2"
}
},
"@remixproject/engine-web": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@remixproject/engine-web/-/engine-web-0.3.2.tgz",
"integrity": "sha512-52uehTVnJoNP3E0WarqItPTJrLEmvw4FHr8vp2Ww/zyyT9n4JPdmJamdPEI5Dszafp5TtMapQHGIPA0+GrMcYw==",
"requires": {
"@remixproject/engine": "0.3.2",
"@remixproject/plugin-api": "0.3.2",
"@remixproject/plugin-utils": "0.3.2"
},
"dependencies": {
"@remixproject/engine": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@remixproject/engine/-/engine-0.3.2.tgz",
"integrity": "sha512-kou/v2/EdB3H81vsFA/i//AEx2byVs1l0sdynoj+e7q8pGIMVFs7YCuXj+2DU+UDKUG3JGnyi4jKRygqBq0Wqw==",
"requires": {
"@remixproject/plugin-api": "0.3.2",
"@remixproject/plugin-utils": "0.3.2"
}
},
"@remixproject/plugin-api": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@remixproject/plugin-api/-/plugin-api-0.3.2.tgz",
"integrity": "sha512-SR9NPv7hstTorUkna1LjdF5bEclNk0ejzGKmkzO3khCvw/Mii1H8lXo1W9fX1tmqpVqWYCdV/0hY5rnFnQAlSw==",
"requires": {
"@remixproject/plugin-utils": "0.3.2"
}
},
"@remixproject/plugin-utils": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@remixproject/plugin-utils/-/plugin-utils-0.3.2.tgz",
"integrity": "sha512-i7VQNU6XaigUgOoOHM0M379dAKLtKt83nHBSR2SZyt/397aQsBDuYg1Nwv4Y46S74FrZRKFRX9YGNZj1usB2IQ==",
"requires": {
"tslib": "2.0.1"
}
},
"tslib": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
"integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ=="
}
}
}, },
"@remixproject/plugin": { "@remixproject/plugin": {
"version": "0.3.0-beta.5", "version": "0.3.2",
"resolved": "https://registry.npmjs.org/@remixproject/plugin/-/plugin-0.3.0-beta.5.tgz", "resolved": "https://registry.npmjs.org/@remixproject/plugin/-/plugin-0.3.2.tgz",
"integrity": "sha512-mQgXUhGNc+tQGIIFw7OaBaH7sZTBvDk8Gf4fS1NXhO5ilvykw9TXv5LXWoWkJCWQlKGuUTWd+U1XNpm5dPD3ag==" "integrity": "sha512-WfTjlIL+MqWKnY2wl6t4/hmmq+H3TY+Mofl04AGYZwr1yKgG7csPJFgZZDq74biPXNhHb+9xS2S18ytzutjLYg==",
"requires": {
"@remixproject/plugin-api": "0.3.2",
"@remixproject/plugin-utils": "0.3.2",
"events": "3.2.0"
},
"dependencies": {
"events": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/events/-/events-3.2.0.tgz",
"integrity": "sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg=="
}
}
}, },
"@remixproject/plugin-api": { "@remixproject/plugin-api": {
"version": "0.3.0-beta.5", "version": "0.3.2",
"resolved": "https://registry.npmjs.org/@remixproject/plugin-api/-/plugin-api-0.3.0-beta.5.tgz", "resolved": "https://registry.npmjs.org/@remixproject/plugin-api/-/plugin-api-0.3.2.tgz",
"integrity": "sha512-C1fuISsne3sfA61k1rx6qU9ZgubyP8SdNKinzeYvXg4XAm1DwoHQlzjq/WYmjOFx1NZhyMGK8ySBp0VcjAMc/Q==" "integrity": "sha512-SR9NPv7hstTorUkna1LjdF5bEclNk0ejzGKmkzO3khCvw/Mii1H8lXo1W9fX1tmqpVqWYCdV/0hY5rnFnQAlSw==",
"requires": {
"@remixproject/plugin-utils": "0.3.2"
}
}, },
"@remixproject/plugin-utils": { "@remixproject/plugin-utils": {
"version": "0.3.0-beta.5", "version": "0.3.2",
"resolved": "https://registry.npmjs.org/@remixproject/plugin-utils/-/plugin-utils-0.3.0-beta.5.tgz", "resolved": "https://registry.npmjs.org/@remixproject/plugin-utils/-/plugin-utils-0.3.2.tgz",
"integrity": "sha512-+gnfuSUimCxUTRxfTGu+mwI5U6EPUx2A2ANObaZzX8f17nhSW5NWw2vWKauZPSv2PWQoIukYzrmG/kogEe3Cyw==" "integrity": "sha512-i7VQNU6XaigUgOoOHM0M379dAKLtKt83nHBSR2SZyt/397aQsBDuYg1Nwv4Y46S74FrZRKFRX9YGNZj1usB2IQ==",
"requires": {
"tslib": "2.0.1"
},
"dependencies": {
"tslib": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz",
"integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ=="
}
}
}, },
"@remixproject/plugin-ws": { "@remixproject/plugin-ws": {
"version": "0.3.0-beta.11", "version": "0.3.2",
"resolved": "https://registry.npmjs.org/@remixproject/plugin-ws/-/plugin-ws-0.3.0-beta.11.tgz", "resolved": "https://registry.npmjs.org/@remixproject/plugin-ws/-/plugin-ws-0.3.2.tgz",
"integrity": "sha512-wQueX0k99S96G4/jDbCmAn7V4RxDQpaCjaHBkpdr6Oc1ErfUnkplzJLfGs1EgnxCrONnHxDz6YEdKEs/zaHkqw==", "integrity": "sha512-maHL5mZDafELnnyPTO15Jy1y9lfZL0BBhzNqkSVwxtATakqPBLvoFoQpj5Co3xFaH3Kqb+Rb47VxaT415pPjeg==",
"requires": { "requires": {
"@remixproject/plugin": "0.3.0-beta.11", "@remixproject/plugin": "0.3.2",
"@remixproject/plugin-api": "0.3.0-beta.11", "@remixproject/plugin-api": "0.3.2",
"@remixproject/plugin-utils": "0.3.0-beta.11" "@remixproject/plugin-utils": "0.3.2"
}, },
"dependencies": { "dependencies": {
"@remixproject/plugin": { "@remixproject/plugin": {
"version": "0.3.0-beta.11", "version": "0.3.2",
"resolved": "https://registry.npmjs.org/@remixproject/plugin/-/plugin-0.3.0-beta.11.tgz", "resolved": "https://registry.npmjs.org/@remixproject/plugin/-/plugin-0.3.2.tgz",
"integrity": "sha512-/K7EJUXjSf5AqoPJAQ7VKQi7UTmPysHyV9hDLGPoe8tjl4s5ghjopiYLu6uM1WrR4Bz1DvU4hsRObe/PUAmprA==", "integrity": "sha512-WfTjlIL+MqWKnY2wl6t4/hmmq+H3TY+Mofl04AGYZwr1yKgG7csPJFgZZDq74biPXNhHb+9xS2S18ytzutjLYg==",
"requires": { "requires": {
"@remixproject/plugin-api": "0.3.0-beta.11", "@remixproject/plugin-api": "0.3.2",
"@remixproject/plugin-utils": "0.3.0-beta.11", "@remixproject/plugin-utils": "0.3.2",
"events": "3.2.0" "events": "3.2.0"
} }
}, },
"@remixproject/plugin-api": { "@remixproject/plugin-api": {
"version": "0.3.0-beta.11", "version": "0.3.2",
"resolved": "https://registry.npmjs.org/@remixproject/plugin-api/-/plugin-api-0.3.0-beta.11.tgz", "resolved": "https://registry.npmjs.org/@remixproject/plugin-api/-/plugin-api-0.3.2.tgz",
"integrity": "sha512-qmIxfoFivQ6Dtz4RUEGSpSVW6TgcT5pwGuSOFBNm0LcYapqsoY4uWIfNpnP4odH4nVCBaFmARlveOf5magFxAw==", "integrity": "sha512-SR9NPv7hstTorUkna1LjdF5bEclNk0ejzGKmkzO3khCvw/Mii1H8lXo1W9fX1tmqpVqWYCdV/0hY5rnFnQAlSw==",
"requires": { "requires": {
"@remixproject/plugin-utils": "0.3.0-beta.11" "@remixproject/plugin-utils": "0.3.2"
} }
}, },
"@remixproject/plugin-utils": { "@remixproject/plugin-utils": {
"version": "0.3.0-beta.11", "version": "0.3.2",
"resolved": "https://registry.npmjs.org/@remixproject/plugin-utils/-/plugin-utils-0.3.0-beta.11.tgz", "resolved": "https://registry.npmjs.org/@remixproject/plugin-utils/-/plugin-utils-0.3.2.tgz",
"integrity": "sha512-M/ghKF75lLQX6sp993E+3DGtezgY5oCL8659pH2cRpK8MMFX5cJggBfK5Fil29FIdwNOSzXM+W0/JnxnRyQAZA==", "integrity": "sha512-i7VQNU6XaigUgOoOHM0M379dAKLtKt83nHBSR2SZyt/397aQsBDuYg1Nwv4Y46S74FrZRKFRX9YGNZj1usB2IQ==",
"requires": { "requires": {
"tslib": "2.0.1" "tslib": "2.0.1"
} }

@ -127,16 +127,26 @@
] ]
}, },
"dependencies": { "dependencies": {
"@remixproject/engine": "^0.2.3", "@remixproject/engine": "^0.3.2",
"@remixproject/engine-web": "^0.3.2",
"@remixproject/plugin-ws": "^0.3.2",
"@remixproject/plugin": "^0.3.2",
"@remixproject/plugin-api": "^0.3.2",
"@remixproject/plugin-utils": "^0.3.2",
"@types/jest": "^26.0.5", "@types/jest": "^26.0.5",
"@types/tape": "^4.2.33", "@types/tape": "^4.2.33",
"ansi-gray": "^0.1.1", "ansi-gray": "^0.1.1",
"axios": "^0.20.0",
"change-case": "^4.1.1", "change-case": "^4.1.1",
"chokidar": "^2.1.8",
"color-support": "^1.1.3", "color-support": "^1.1.3",
"commander": "^2.20.3",
"ethereumjs-block": "^2.2.2", "ethereumjs-block": "^2.2.2",
"ethereumjs-tx": "^2.1.2", "ethereumjs-tx": "^2.1.2",
"ethereumjs-vm": "4.1.3", "ethereumjs-vm": "4.1.3",
"fs-extra": "^3.0.1",
"http-server": "^0.11.1", "http-server": "^0.11.1",
"isbinaryfile": "^3.0.2",
"merge": "^1.2.0", "merge": "^1.2.0",
"npm-install-version": "^6.0.2", "npm-install-version": "^6.0.2",
"react": "16.13.1", "react": "16.13.1",
@ -145,15 +155,6 @@
"signale": "^1.4.0", "signale": "^1.4.0",
"time-stamp": "^2.2.0", "time-stamp": "^2.2.0",
"winston": "^3.3.3", "winston": "^3.3.3",
"@remixproject/plugin": "0.3.0-beta.5",
"@remixproject/plugin-api": "0.3.0-beta.5",
"@remixproject/plugin-utils": "0.3.0-beta.5",
"@remixproject/plugin-ws": "^0.3.0-beta.8",
"axios": "^0.20.0",
"chokidar": "^2.1.8",
"commander": "^2.20.3",
"fs-extra": "^3.0.1",
"isbinaryfile": "^3.0.2",
"ws": "^7.3.0" "ws": "^7.3.0"
}, },
"devDependencies": { "devDependencies": {

Loading…
Cancel
Save