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 return this._isReady
} }
async compileWithHardhat () {
console.log('Inside compileWithHardhat, calling hardhatCompile using _appManager')
return await this._appManager.call('remixd', 'hardhatCompile', {})
}
close (cb) { close (cb) {
this._isReady = false this._isReady = false
cb() cb()

@ -22,7 +22,7 @@ const profile = {
name: 'remixd', name: 'remixd',
displayName: 'RemixD', displayName: 'RemixD',
url: 'ws://127.0.0.1:65520', 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: [], events: [],
description: 'Using Remixd daemon, allow to access file system', description: 'Using Remixd daemon, allow to access file system',
kind: 'other', kind: 'other',

@ -80,6 +80,11 @@ class CompileTab {
runCompiler () { runCompiler () {
try { 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.fileManager.saveCurrentFile()
this.miscApi.clearAnnotations() this.miscApi.clearAnnotations()
var currentFile = this.config.get('currentFile') var currentFile = this.config.get('currentFile')

@ -5,6 +5,7 @@ import * as utils from '../utils'
import * as chokidar from 'chokidar' import * as chokidar from 'chokidar'
import * as fs from 'fs-extra' import * as fs from 'fs-extra'
import * as isbinaryfile from 'isbinaryfile' import * as isbinaryfile from 'isbinaryfile'
const hre = require("hardhat");
export class RemixdClient extends PluginClient { export class RemixdClient extends PluginClient {
methods: Array<string> methods: Array<string>
@ -14,7 +15,7 @@ export class RemixdClient extends PluginClient {
constructor (private readOnly = false) { constructor (private readOnly = false) {
super() 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 { setWebSocket (websocket: WS): void {
@ -26,6 +27,12 @@ export class RemixdClient extends PluginClient {
if (this.isLoaded) this.emit('rootFolderChanged') 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 { list (): Filelist {
try { try {
return utils.walkSync(this.currentSharedFolder, {}, this.currentSharedFolder) 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", "ethers": "^5.1.4",
"express-ws": "^4.0.0", "express-ws": "^4.0.0",
"fs-extra": "^3.0.1", "fs-extra": "^3.0.1",
"hardhat": "^2.2.1",
"http-server": "^0.11.1", "http-server": "^0.11.1",
"isbinaryfile": "^3.0.2", "isbinaryfile": "^3.0.2",
"jquery": "^3.3.1", "jquery": "^3.3.1",

Loading…
Cancel
Save