compile using hardhat

pull/1202/head
aniket-engg 4 years ago committed by Aniket
parent d79bdab5f5
commit 234c362a91
  1. 3
      apps/remix-ide/src/app.js
  2. 5
      apps/remix-ide/src/app/files/fileManager.js
  3. 2
      apps/remix-ide/src/app/files/hardhat-handle.js
  4. 2
      apps/remix-ide/src/app/files/remixd-handle.js
  5. 2
      apps/remix-ide/src/app/panels/file-panel.js
  6. 2
      apps/remix-ide/src/app/tabs/compileTab/compileTab.js
  7. 1
      libs/remixd/src/services/remixdClient.ts

@ -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>

Loading…
Cancel
Save