compile with hardhat and remixd

pull/1202/head
aniket-engg 4 years ago committed by Aniket
parent 54dae6e484
commit 6dfd7d91d9
  1. 5
      apps/remix-ide/src/app/files/remixDProvider.js
  2. 2
      apps/remix-ide/src/app/files/remixd-handle.js
  3. 5
      apps/remix-ide/src/app/tabs/compileTab/compileTab.js
  4. 9
      libs/remixd/src/services/remixdClient.ts
  5. 1008
      package-lock.json
  6. 1
      package.json

@ -50,6 +50,11 @@ module.exports = class RemixDProvider extends FileProvider {
return this._isReady
}
async compileWithHardhat () {
console.log('Inside compileWithHardhat, calling hardhatCompile using _appManager')
return await this._appManager.call('remixd', 'hardhatCompile', {})
}
close (cb) {
this._isReady = false
cb()

@ -22,7 +22,7 @@ const profile = {
name: 'remixd',
displayName: 'RemixD',
url: 'ws://127.0.0.1:65520',
methods: ['folderIsReadOnly', 'resolveDirectory', 'get', 'exists', 'isFile', 'set', 'rename', 'remove', 'isDirectory', 'list', 'createDir'],
methods: ['folderIsReadOnly', 'hardhatCompile', 'resolveDirectory', 'get', 'exists', 'isFile', 'set', 'rename', 'remove', 'isDirectory', 'list', 'createDir'],
events: [],
description: 'Using Remixd daemon, allow to access file system',
kind: 'other',

@ -80,6 +80,11 @@ class CompileTab {
runCompiler () {
try {
console.log('mode is - ', this.fileManager.mode)
if(this.fileManager.mode === 'localhost') {
console.log('calling compilehardhat')
this.fileProvider.compileWithHardhat().then(console.log)
}
this.fileManager.saveCurrentFile()
this.miscApi.clearAnnotations()
var currentFile = this.config.get('currentFile')

@ -5,6 +5,7 @@ import * as utils from '../utils'
import * as chokidar from 'chokidar'
import * as fs from 'fs-extra'
import * as isbinaryfile from 'isbinaryfile'
const hre = require("hardhat");
export class RemixdClient extends PluginClient {
methods: Array<string>
@ -14,7 +15,7 @@ export class RemixdClient extends PluginClient {
constructor (private readOnly = false) {
super()
this.methods = ['folderIsReadOnly', 'resolveDirectory', 'get', 'exists', 'isFile', 'set', 'rename', 'remove', 'isDirectory', 'list', 'createDir', 'canDeactivate']
this.methods = ['folderIsReadOnly', 'hardhatCompile', 'resolveDirectory', 'get', 'exists', 'isFile', 'set', 'rename', 'remove', 'isDirectory', 'list', 'createDir', 'canDeactivate']
}
setWebSocket (websocket: WS): void {
@ -26,6 +27,12 @@ export class RemixdClient extends PluginClient {
if (this.isLoaded) this.emit('rootFolderChanged')
}
async hardhatCompile() {
console.log('inside hardhatCompile')
console.log('here is hre-->', hre.tasks)
// await hre.tasks.accounts.action();
}
list (): Filelist {
try {
return utils.walkSync(this.currentSharedFolder, {}, this.currentSharedFolder)

1008
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -155,6 +155,7 @@
"ethers": "^5.1.4",
"express-ws": "^4.0.0",
"fs-extra": "^3.0.1",
"hardhat": "^2.2.1",
"http-server": "^0.11.1",
"isbinaryfile": "^3.0.2",
"jquery": "^3.3.1",

Loading…
Cancel
Save