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