Commit 234c362a authored by aniket-engg's avatar aniket-engg Committed by Aniket

compile using hardhat

parent d79bdab5
......@@ -436,7 +436,8 @@ Please make a backup of your contracts and start using http://remix.ethereum.org
analysis,
test,
filePanel.remixdHandle,
filePanel.gitHandle
filePanel.gitHandle,
filePanel.hardhatHandle
])
if (isElectron()) {
......
......@@ -57,6 +57,11 @@ class FileManager extends Plugin {
this.mode = mode
}
async compileWithHardhat (cmd) {
console.log('Inside compileWithHardhat, calling hardhat compile using appManager')
return await this.appManager.call('hardhat', 'compile', cmd)
}
limitPluginScope (path) {
return path.replace(/^\/browser\//, '').replace(/^browser\//, '') // forbids plugin to access the root filesystem
}
......
......@@ -11,7 +11,7 @@ const profile = {
version: packageJson.version
}
export class hardhatHandle extends WebsocketPlugin {
export class HardhatHandle extends WebsocketPlugin {
constructor () {
super(profile)
}
......
......@@ -81,7 +81,7 @@ export class RemixdHandle extends WebsocketPlugin {
}
}, 3000)
this.locahostProvider.init(() => {})
// this.call('manager', 'activatePlugin', 'git')
this.call('manager', 'activatePlugin', 'hardhat')
}
}
if (this.locahostProvider.isConnected()) {
......
......@@ -9,6 +9,7 @@ import { checkSpecialChars, checkSlash } from '../../lib/helper'
var EventManager = require('../../lib/events')
var { RemixdHandle } = require('../files/remixd-handle.js')
var { GitHandle } = require('../files/git-handle.js')
var { HardhatHandle } = require('../files/hardhat-handle.js')
var globalRegistry = require('../../global/registry')
var examples = require('../editor/examples')
var GistHandler = require('../../lib/gist-handler')
......@@ -60,6 +61,7 @@ module.exports = class Filepanel extends ViewPlugin {
this.remixdHandle = new RemixdHandle(this._deps.fileProviders.localhost, appManager)
this.gitHandle = new GitHandle()
this.hardhatHandle = new HardhatHandle()
this.registeredMenuItems = []
this.request = {}
this.workspaces = []
......
......@@ -83,7 +83,7 @@ class CompileTab {
console.log('mode is - ', this.fileManager.mode)
if(this.fileManager.mode === 'localhost') {
console.log('calling compilehardhat')
// this.fileProvider.compileWithHardhat().then(console.log)
this.fileManager.compileWithHardhat('npx hardhat compile').then(console.log)
}
this.fileManager.saveCurrentFile()
this.miscApi.clearAnnotations()
......
......@@ -5,7 +5,6 @@ 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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment