From 76456e5d582c232ea99812289976994c98e58d87 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 27 Jul 2021 17:33:31 +0200 Subject: [PATCH 1/2] remove git, add slither and hardhat --- main.js | 36 +++++++++++---- package-lock.json | 115 ++++++++++++++++++++++++++++++++++++++++++++-- package.json | 3 +- 3 files changed, 138 insertions(+), 16 deletions(-) diff --git a/main.js b/main.js index fbd6fea..67fba3f 100644 --- a/main.js +++ b/main.js @@ -1,4 +1,5 @@ -const remixd = require('@remix-project/remixd') +import * as fs from 'fs-extra' +import { services, Websocket, utils } from '@remix-project/remixd' const path = require('path') const os = require('os') const fetch = require('node-fetch') @@ -78,12 +79,17 @@ function createWindow () { }) } -let sharedFolderClient = new remixd.services.sharedFolder() -let gitClient = new remixd.services.GitClient() +let sharedFolderClient = new services.sharedFolder() +let slitherClient = new services.SlitherClient() +let hardhatClient = new services.HardhatClient() const services = { - git: () => { - gitClient.options.customApi = {} - return gitClient + hardhat: () => { + hardhatClient.options.customApi = {} + return hardhatClient + }, + slither: () => { + slitherClient.options.customApi = {} + return slitherClient }, folder: () => { sharedFolderClient.options.customApi = {} @@ -114,7 +120,7 @@ const ports = { function startService (service, callback) { try { - const socket = new remixd.Websocket(ports[service], { remixIdeUrl }, () => services[service]()) + const socket = new Websocket(ports[service], { remixIdeUrl }, () => services[service]()) socket.start(callback) } catch (e) { console.error(e) @@ -127,14 +133,24 @@ let remixdStart = () => { try { startService('folder', (ws, client) => { client.setWebSocket(ws) - client.sharedFolder(currentFolder, false) + client.sharedFolder(currentFolder) client.setupNotifications(currentFolder) }) - startService('git', (ws, client) => { + startService('slither', (ws, client) => { client.setWebSocket(ws) - client.sharedFolder(currentFolder, false) + client.sharedFolder(currentFolder) }) + + // Run hardhat service if a hardhat project is shared as folder + const hardhatConfigFilePath = utils.absolutePath('./', currentFolder) + '/hardhat.config.js' + const isHardhatProject = fs.existsSync(hardhatConfigFilePath) + if (isHardhatProject) { + startService('hardhat', (ws, client) => { + client.setWebSocket(ws) + client.sharedFolder(currentFolder) + }) + } } catch (error) { throw new Error(error) diff --git a/package-lock.json b/package-lock.json index 821e11c..0752c2f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -916,6 +916,17 @@ "temp-file": "^3.3.4" }, "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "isbinaryfile": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.6.tgz", @@ -1569,6 +1580,19 @@ "source-map-support": "^0.5.13", "stat-mode": "^0.3.0", "temp-file": "^3.3.4" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + } } }, "builder-util-runtime": { @@ -2473,6 +2497,17 @@ "sanitize-filename": "^1.6.2" }, "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "iconv-lite": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.5.2.tgz", @@ -2734,6 +2769,17 @@ "locate-path": "^3.0.0" } }, + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "get-stream": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", @@ -3089,6 +3135,19 @@ "fs-extra": "^8.1.0", "lazy-val": "^1.0.4", "mime": "^2.4.4" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + } } }, "electron-updater": { @@ -3106,6 +3165,16 @@ "semver": "^6.2.0" }, "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -3752,13 +3821,23 @@ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, "fs-extra": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz", + "integrity": "sha1-N5TzeMWLNC6n27sjCVEJxLO2IpE=", "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^4.0.0", + "graceful-fs": "^4.1.2", + "jsonfile": "^3.0.0", "universalify": "^0.1.0" + }, + "dependencies": { + "jsonfile": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", + "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=", + "requires": { + "graceful-fs": "^4.1.6" + } + } } }, "fsevents": { @@ -8778,6 +8857,19 @@ "js-yaml": "^3.13.1", "json5": "^2.1.0", "lazy-val": "^1.0.4" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + } } }, "read-pkg": { @@ -10032,6 +10124,19 @@ "requires": { "async-exit-hook": "^2.0.1", "fs-extra": "^8.1.0" + }, + "dependencies": { + "fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + } } }, "term-size": { diff --git a/package.json b/package.json index 87750de..8acd86f 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,7 @@ "ipfs-http-gateway": "^0.1.3", "latest-version": "^5.1.0", "node-fetch": "^2.6.1", - "semver": "^7.3.5" + "semver": "^7.3.5", + "fs-extra": "^3.0.1" } } From 18b4510ee87b7c9e616eb04468d8158a3fa56ef1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 28 Jul 2021 18:15:32 +0200 Subject: [PATCH 2/2] bumpd remixd --- package-lock.json | 60 +++++++++++++++++------------------------------ package.json | 2 +- 2 files changed, 22 insertions(+), 40 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0752c2f..d78b026 100644 --- a/package-lock.json +++ b/package-lock.json @@ -537,9 +537,9 @@ "integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA=" }, "@remix-project/remixd": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/@remix-project/remixd/-/remixd-0.4.0.tgz", - "integrity": "sha512-hrrez8IGENa/pf/eqGSH5mE2GATKNUIGngtqx01pxRK84hpRyboAjws61VKPJUFKv+wiNxts01PY18G8feii+Q==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@remix-project/remixd/-/remixd-0.5.0.tgz", + "integrity": "sha512-fptRDyGurH54Id3ZEy8bLOGO/uv5QcUg0W5haQHnkUR0LXFRTpHu2JEgbIPZuA1pz7kIWtD5tSjvg4wWuXGNCg==", "requires": { "@remixproject/plugin": "^0.3.11", "@remixproject/plugin-api": "^0.3.11", @@ -555,24 +555,6 @@ "ws": "^7.3.0" }, "dependencies": { - "fs-extra": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-3.0.1.tgz", - "integrity": "sha1-N5TzeMWLNC6n27sjCVEJxLO2IpE=", - "requires": { - "graceful-fs": "^4.1.2", - "jsonfile": "^3.0.0", - "universalify": "^0.1.0" - } - }, - "jsonfile": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-3.0.1.tgz", - "integrity": "sha1-pezG9l9T9mLEQVx2daAzHQmS7GY=", - "requires": { - "graceful-fs": "^4.1.6" - } - }, "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", @@ -581,39 +563,39 @@ } }, "@remixproject/plugin": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@remixproject/plugin/-/plugin-0.3.17.tgz", - "integrity": "sha512-mSg9OiFwAvaKfqV9UL8zLjxxBiypSeiUkW8K4w0TqiEt5MUDNK+mPngEpP43WLfCe4OO9aH4fxNe+A1TyOfRAQ==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@remixproject/plugin/-/plugin-0.3.19.tgz", + "integrity": "sha512-jEG0ge0ku1TfFU/46ckvzB0Q7WyeUEQhvatv1oMrVTHUj2o8B0u500V92AcI0YNcxXjn5UNNrHGQBgLcNvYG6Q==", "requires": { - "@remixproject/plugin-api": "0.3.17", - "@remixproject/plugin-utils": "0.3.17", + "@remixproject/plugin-api": "0.3.19", + "@remixproject/plugin-utils": "0.3.19", "events": "3.2.0" } }, "@remixproject/plugin-api": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@remixproject/plugin-api/-/plugin-api-0.3.17.tgz", - "integrity": "sha512-RHTo4ypiBfSiK963L5Hgjm1QzjhOVfjczAdS124JqZx1IckcCHTXyzxT509j+6ofCw39uAUrh+/AqaHPU2hzMQ==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@remixproject/plugin-api/-/plugin-api-0.3.19.tgz", + "integrity": "sha512-MDCiGYA++5ydncSJUSNe5Fg0qh2fADbMdlCDP8BGsvUfhPEDBRIm8Iw6gYYGu9d5S4xDCs0EBMcExqvdweOGEw==", "requires": { - "@remixproject/plugin-utils": "0.3.17" + "@remixproject/plugin-utils": "0.3.19" } }, "@remixproject/plugin-utils": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@remixproject/plugin-utils/-/plugin-utils-0.3.17.tgz", - "integrity": "sha512-h01pjk8RvSRTCIcmoPq8bBXQGyIBlD4LWQ++5B9y3U2olgN+Mq7OZU4CkKS2IhFmj3IvCKn07DgJhMzMYnxGKg==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@remixproject/plugin-utils/-/plugin-utils-0.3.19.tgz", + "integrity": "sha512-++L83MmSeV4Hri4uldOB0iNqwOAN/3eAnYorpiSCpKJbeQzT08KyorQ6B3FAiG/EM0pF/o+sPZbNtSJuHCUfIw==", "requires": { "tslib": "2.0.1" } }, "@remixproject/plugin-ws": { - "version": "0.3.17", - "resolved": "https://registry.npmjs.org/@remixproject/plugin-ws/-/plugin-ws-0.3.17.tgz", - "integrity": "sha512-hK1IaDhS77VP9Be8SdKeeJgxsGz6cG96P/f3+7hvNvDDuVONKkCwPusLguUmcQhcwOGrTz+7bSbeW/fht1gOHg==", + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/@remixproject/plugin-ws/-/plugin-ws-0.3.19.tgz", + "integrity": "sha512-6c7CwkjKLzXZJ+/GkExOOHcyXYw0Zlo3JisEniEcNqQ8epSIZ7tZIW23ATiNsEnsGBR5GiB0IyQFWSWjSKxBRA==", "requires": { - "@remixproject/plugin": "0.3.17", - "@remixproject/plugin-api": "0.3.17", - "@remixproject/plugin-utils": "0.3.17" + "@remixproject/plugin": "0.3.19", + "@remixproject/plugin-api": "0.3.19", + "@remixproject/plugin-utils": "0.3.19" } }, "@sideway/address": { diff --git a/package.json b/package.json index 8acd86f..cd4b758 100644 --- a/package.json +++ b/package.json @@ -71,7 +71,7 @@ } }, "dependencies": { - "@remix-project/remixd": "^0.4.0", + "@remix-project/remixd": "^0.5.0", "electron-app-manager": "0.57.0", "ipfs": "^0.52.2", "ipfs-http-gateway": "^0.1.3",