diff --git a/libs/remixd/src/bin/remixd.ts b/libs/remixd/src/bin/remixd.ts index 9ca4104325..8ced09dc23 100644 --- a/libs/remixd/src/bin/remixd.ts +++ b/libs/remixd/src/bin/remixd.ts @@ -77,7 +77,7 @@ function errorHandler (error: any, service: string) { const options = program.opts(); await warnLatestVersion() - if(options.install && !options.readOnly) { + if (options.install && !options.readOnly) { if (options.install.toLowerCase() === 'slither') require('./../scripts/installSlither') process.exit(0) } @@ -128,7 +128,7 @@ function errorHandler (error: any, service: string) { } // Run hardhat service if a hardhat project is shared as folder const hardhatConfigFilePath = absolutePath('./', options.sharedFolder) - const isHardhatProject = existsSync(hardhatConfigFilePath + '/hardhat.config.js') || existsSync(hardhatConfigFilePath + '/hardhat.config.ts') + const isHardhatProject = existsSync(hardhatConfigFilePath + '/hardhat.config.js') || existsSync(hardhatConfigFilePath + '/hardhat.config.ts') if (isHardhatProject) { startService('hardhat', (ws: WS, sharedFolderClient: servicesList.Sharedfolder, error: Error) => { if (error) { @@ -141,7 +141,7 @@ function errorHandler (error: any, service: string) { } // Run foundry service if a founndry project is shared as folder const foundryConfigFilePath = absolutePath('./', options.sharedFolder) - const isFoundryProject = existsSync(foundryConfigFilePath + '/foundry.toml') + const isFoundryProject = existsSync(foundryConfigFilePath + '/foundry.toml') if (isFoundryProject) { startService('foundry', (ws: WS, sharedFolderClient: servicesList.Sharedfolder, error: Error) => { if (error) { diff --git a/libs/remixd/src/services/foundryClient.ts b/libs/remixd/src/services/foundryClient.ts index add3378407..95b4f0a168 100644 --- a/libs/remixd/src/services/foundryClient.ts +++ b/libs/remixd/src/services/foundryClient.ts @@ -52,7 +52,7 @@ export class FoundryClient extends PluginClient { listenOnFoundryFolder() { console.log('Foundry out folder doesn\'t exist... waiting for the compilation.') try { - if(this.watcher) this.watcher.close() + if (this.watcher) this.watcher.close() this.watcher = chokidar.watch(this.currentSharedFolder, { depth: 1, ignorePermissionErrors: true, ignoreInitial: true }) // watch for new folders this.watcher.on('addDir', () => { @@ -126,7 +126,7 @@ export class FoundryClient extends PluginClient { this.logTimeout = setTimeout(() => { // @ts-ignore this.call('terminal', 'log', { type: 'log', value: `receiving compilation result from Foundry` }) - console.log('Syncing compilation result from Foundry') + console.log('Syncing compilation result from Foundry') }, 1000) } catch (e) { @@ -142,7 +142,7 @@ export class FoundryClient extends PluginClient { listenOnFoundryCompilation() { try { - if(this.watcher) this.watcher.close() + if (this.watcher) this.watcher.close() this.watcher = chokidar.watch(this.cachePath, { depth: 0, ignorePermissionErrors: true, ignoreInitial: true }) this.watcher.on('change', async () => await this.triggerProcessArtifact()) this.watcher.on('add', async () => await this.triggerProcessArtifact()) @@ -193,7 +193,6 @@ export class FoundryClient extends PluginClient { console.log('\x1b[32m%s\x1b[0m', 'sources input not found, please update Foundry to the latest version.') } - compilationResultPart.compilationTarget = contentJSON.ast.absolutePath // extract data if (!compilationResultPart.output['sources'][contentJSON.ast.absolutePath]) compilationResultPart.output['sources'][contentJSON.ast.absolutePath] = {} diff --git a/libs/remixd/src/services/hardhatClient.ts b/libs/remixd/src/services/hardhatClient.ts index 3928e9af64..a79700be36 100644 --- a/libs/remixd/src/services/hardhatClient.ts +++ b/libs/remixd/src/services/hardhatClient.ts @@ -143,13 +143,12 @@ export class HardhatClient extends PluginClient { } }, 1000) - } listenOnHardHatFolder() { console.log('Hardhat artifacts folder doesn\'t exist... waiting for the compilation.') try { - if(this.watcher) this.watcher.close() + if (this.watcher) this.watcher.close() this.watcher = chokidar.watch(this.currentSharedFolder, { depth: 2, ignorePermissionErrors: true, ignoreInitial: true }) // watch for new folders this.watcher.on('addDir', () => { @@ -171,7 +170,7 @@ export class HardhatClient extends PluginClient { listenOnHardhatCompilation() { try { console.log('listening on Hardhat compilation...') - if(this.watcher) this.watcher.close() + if (this.watcher) this.watcher.close() this.watcher = chokidar.watch(this.buildPath, { depth: 1, ignorePermissionErrors: true, ignoreInitial: true }) this.watcher.on('change', async () => await this.triggerProcessArtifact()) this.watcher.on('add', async () => await this.triggerProcessArtifact()) diff --git a/libs/remixd/src/services/remixdClient.ts b/libs/remixd/src/services/remixdClient.ts index 4718cfbcf1..9b725901e8 100644 --- a/libs/remixd/src/services/remixdClient.ts +++ b/libs/remixd/src/services/remixdClient.ts @@ -275,12 +275,12 @@ export class RemixdClient extends PluginClient { }) this.watcher.on('unlink', async (f: string) => { if (this.isLoaded) { - this.emit('removed', utils.relativePath(f, this.currentSharedFolder), false) + this.emit('removed', utils.relativePath(f, this.currentSharedFolder), false) } }) this.watcher.on('unlinkDir', async (f: string) => { if (this.isLoaded) { - this.emit('removed', utils.relativePath(f, this.currentSharedFolder), true) + this.emit('removed', utils.relativePath(f, this.currentSharedFolder), true) } }) } diff --git a/libs/remixd/src/services/truffleClient.ts b/libs/remixd/src/services/truffleClient.ts index e62fe54ba2..b05611539c 100644 --- a/libs/remixd/src/services/truffleClient.ts +++ b/libs/remixd/src/services/truffleClient.ts @@ -100,7 +100,6 @@ export class TruffleClient extends PluginClient { return true } - private async processArtifact() { if (!this.checkPath()) return const folderFiles = await fs.readdir(this.buildPath)