From 1f1738edd91a901e1dfc764b7a84b61e72f9508d Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 1 Jul 2024 08:08:42 +0200 Subject: [PATCH 01/19] add foundry --- apps/remixdesktop/src/lib/foundry.ts | 207 ++++++++++++++++++ .../remixdesktop/src/plugins/foundryPlugin.ts | 35 +++ 2 files changed, 242 insertions(+) create mode 100644 apps/remixdesktop/src/lib/foundry.ts create mode 100644 apps/remixdesktop/src/plugins/foundryPlugin.ts diff --git a/apps/remixdesktop/src/lib/foundry.ts b/apps/remixdesktop/src/lib/foundry.ts new file mode 100644 index 0000000000..30edf37889 --- /dev/null +++ b/apps/remixdesktop/src/lib/foundry.ts @@ -0,0 +1,207 @@ +import { spawn } from 'child_process' +import chokidar from 'chokidar' +import fs from 'fs' +import { basename, join } from 'path' +import * as utils from './utils' +export const FoundryClientMixin = (Base) => class extends Base { + + currentSharedFolder: string + watcher: chokidar.FSWatcher + warnlog: boolean + buildPath: string + cachePath: string + logTimeout: NodeJS.Timeout + processingTimeout: NodeJS.Timeout + + startListening() { + if (fs.existsSync(this.buildPath) && fs.existsSync(this.cachePath)) { + this.listenOnFoundryCompilation() + } else { + this.listenOnFoundryFolder() + } + } + + listenOnFoundryFolder() { + console.log('Foundry out folder doesn\'t exist... waiting for the compilation.') + try { + 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', () => { + if (fs.existsSync(this.buildPath) && fs.existsSync(this.cachePath)) { + this.listenOnFoundryCompilation() + } + }) + } catch (e) { + console.log(e) + } + } + + compile() { + return new Promise((resolve, reject) => { + if (this.readOnly) { + const errMsg = '[Foundry Compilation]: Cannot compile in read-only mode' + return reject(new Error(errMsg)) + } + const cmd = `forge build` + const options = { cwd: this.currentSharedFolder, shell: true } + const child = spawn(cmd, options) + let result = '' + let error = '' + child.stdout.on('data', (data) => { + const msg = `[Foundry Compilation]: ${data.toString()}` + console.log('\x1b[32m%s\x1b[0m', msg) + result += msg + '\n' + }) + child.stderr.on('data', (err) => { + error += `[Foundry Compilation]: ${err.toString()} \n` + }) + child.on('close', () => { + if (error && result) resolve(error + result) + else if (error) reject(error) + else resolve(result) + }) + }) + } + + checkPath() { + if (!fs.existsSync(this.buildPath) || !fs.existsSync(this.cachePath)) { + this.listenOnFoundryFolder() + return false + } + if (!fs.existsSync(join(this.cachePath, 'solidity-files-cache.json'))) return false + return true + } + + private async processArtifact() { + if (!this.checkPath()) return + const folderFiles = await fs.promises.readdir(this.buildPath) // "out" folder + try { + const cache = JSON.parse(await fs.promises.readFile(join(this.cachePath, 'solidity-files-cache.json'), { encoding: 'utf-8' })) + // name of folders are file names + for (const file of folderFiles) { + const path = join(this.buildPath, file) // out/Counter.sol/ + const compilationResult = { + input: {}, + output: { + contracts: {}, + sources: {} + }, + inputSources: { sources: {}, target: '' }, + solcVersion: null, + compilationTarget: null + } + compilationResult.inputSources.target = file + await this.readContract(path, compilationResult, cache) + this.emit('compilationFinished', compilationResult.compilationTarget, { sources: compilationResult.input }, 'soljson', compilationResult.output, compilationResult.solcVersion) + } + + clearTimeout(this.logTimeout) + this.logTimeout = setTimeout(() => { + // @ts-ignore + this.call('terminal', 'log', { type: 'log', value: `receiving compilation result from Foundry. Select a file to populate the contract interaction interface.` }) + console.log('Syncing compilation result from Foundry') + }, 1000) + + } catch (e) { + console.log(e) + } + } + + async triggerProcessArtifact() { + // prevent multiple calls + clearTimeout(this.processingTimeout) + this.processingTimeout = setTimeout(async () => await this.processArtifact(), 1000) + } + + listenOnFoundryCompilation() { + try { + 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()) + // process the artifact on activation + this.triggerProcessArtifact() + } catch (e) { + console.log(e) + } + } + + async readContract(contractFolder, compilationResultPart, cache) { + const files = await fs.promises.readdir(contractFolder) + for (const file of files) { + const path = join(contractFolder, file) + const content = await fs.promises.readFile(path, { encoding: 'utf-8' }) + compilationResultPart.inputSources.sources[file] = { content } + await this.feedContractArtifactFile(file, content, compilationResultPart, cache) + } + } + + async feedContractArtifactFile(path, content, compilationResultPart, cache) { + const contentJSON = JSON.parse(content) + const contractName = basename(path).replace('.json', '') + + let sourcePath = '' + if (contentJSON?.metadata?.settings?.compilationTarget) { + for (const key in contentJSON.metadata.settings.compilationTarget) { + if (contentJSON.metadata.settings.compilationTarget[key] === contractName) { + sourcePath = key + break + } + } + } + + if (!sourcePath) return + + const currentCache = cache.files[sourcePath] + if (!currentCache.artifacts[contractName]) return + + // extract source and version + const metadata = contentJSON.metadata + if (metadata.compiler && metadata.compiler.version) { + compilationResultPart.solcVersion = metadata.compiler.version + } else { + compilationResultPart.solcVersion = '' + console.log('\x1b[32m%s\x1b[0m', 'compiler version not found, please update Foundry to the latest version.') + } + + if (metadata.sources) { + for (const path in metadata.sources) { + const absPath = utils.absolutePath(path, this.currentSharedFolder) + try { + const content = await fs.promises.readFile(absPath, { encoding: 'utf-8' }) + compilationResultPart.input[path] = { content } + } catch (e) { + compilationResultPart.input[path] = { content: '' } + } + } + } else { + console.log('\x1b[32m%s\x1b[0m', 'sources input not found, please update Foundry to the latest version.') + } + + compilationResultPart.compilationTarget = sourcePath + // extract data + if (!compilationResultPart.output['sources'][sourcePath]) compilationResultPart.output['sources'][sourcePath] = {} + compilationResultPart.output['sources'][sourcePath] = { + ast: contentJSON['ast'], + id: contentJSON['id'] + } + if (!compilationResultPart.output['contracts'][sourcePath]) compilationResultPart.output['contracts'][sourcePath] = {} + + contentJSON.bytecode.object = contentJSON.bytecode.object.replace('0x', '') + contentJSON.deployedBytecode.object = contentJSON.deployedBytecode.object.replace('0x', '') + compilationResultPart.output['contracts'][sourcePath][contractName] = { + abi: contentJSON.abi, + evm: { + bytecode: contentJSON.bytecode, + deployedBytecode: contentJSON.deployedBytecode, + methodIdentifiers: contentJSON.methodIdentifiers + } + } + } + + async sync() { + console.log('syncing Foundry with Remix...') + this.processArtifact() + } +} \ No newline at end of file diff --git a/apps/remixdesktop/src/plugins/foundryPlugin.ts b/apps/remixdesktop/src/plugins/foundryPlugin.ts new file mode 100644 index 0000000000..0b3411ceae --- /dev/null +++ b/apps/remixdesktop/src/plugins/foundryPlugin.ts @@ -0,0 +1,35 @@ +import { Profile } from "@remixproject/plugin-utils"; +import { ElectronBasePlugin, ElectronBasePluginClient } from "@remixproject/plugin-electron" + +import { ElectronBasePluginRemixdClient } from "../lib/remixd" + +import { FoundryClientMixin } from "../lib/foundry"; +const profile: Profile = { + name: 'slither', + displayName: 'electron slither', + description: 'electron slither', +} + +export class FoundryPlugin extends ElectronBasePlugin { + clients: any [] + constructor() { + super(profile, clientProfile, FoundryClientMixin(FoundryPluginClient)) + this.methods = [...super.methods] + } +} + +const clientProfile: Profile = { + name: 'foundry', + displayName: 'electron foundry', + description: 'electron foundry', + methods: ['sync', 'compile'] +} + + +class FoundryPluginClient extends ElectronBasePluginRemixdClient { + constructor(webContentsId: number, profile: Profile) { + super(webContentsId, profile); + } +} + + From 8b397ef97799001028515a318cfd19bcdf53e615 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 2 Jul 2024 18:58:07 +0200 Subject: [PATCH 02/19] add plugins --- apps/remix-ide/src/app.js | 138 +++++----- apps/remix-ide/src/app/panels/file-panel.js | 4 - .../src/app/plugins/electron/foundryPlugin.ts | 13 + .../src/app/plugins/electron/hardhatPlugin.ts | 13 + apps/remixdesktop/src/engine.ts | 6 + apps/remixdesktop/src/lib/foundry.ts | 207 --------------- apps/remixdesktop/src/lib/remixd.ts | 1 + apps/remixdesktop/src/lib/slither.ts | 193 -------------- apps/remixdesktop/src/lib/utils.ts | 2 +- .../remixdesktop/src/plugins/foundryPlugin.ts | 246 ++++++++++++++++-- .../remixdesktop/src/plugins/hardhatPlugin.ts | 219 ++++++++++++++++ .../remixdesktop/src/plugins/slitherPlugin.ts | 175 ++++++++++++- apps/remixdesktop/src/preload.ts | 2 +- 13 files changed, 727 insertions(+), 492 deletions(-) create mode 100644 apps/remix-ide/src/app/plugins/electron/foundryPlugin.ts create mode 100644 apps/remix-ide/src/app/plugins/electron/hardhatPlugin.ts delete mode 100644 apps/remixdesktop/src/lib/foundry.ts delete mode 100644 apps/remixdesktop/src/lib/slither.ts create mode 100644 apps/remixdesktop/src/plugins/hardhatPlugin.ts diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index cb6d5826de..2801654f38 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -1,45 +1,45 @@ 'use strict' -import {RunTab, makeUdapp} from './app/udapp' -import {RemixEngine} from './remixEngine' -import {RemixAppManager} from './remixAppManager' -import {ThemeModule} from './app/tabs/theme-module' -import {LocaleModule} from './app/tabs/locale-module' -import {NetworkModule} from './app/tabs/network-module' -import {Web3ProviderModule} from './app/tabs/web3-provider' -import {CompileAndRun} from './app/tabs/compile-and-run' -import {PluginStateLogger} from './app/tabs/state-logger' -import {SidePanel} from './app/components/side-panel' -import {StatusBar} from './app/components/status-bar' -import {HiddenPanel} from './app/components/hidden-panel' -import {PinnedPanel} from './app/components/pinned-panel' -import {VerticalIcons} from './app/components/vertical-icons' -import {LandingPage} from './app/ui/landing-page/landing-page' -import {MainPanel} from './app/components/main-panel' -import {PermissionHandlerPlugin} from './app/plugins/permission-handler-plugin' -import {AstWalker} from '@remix-project/remix-astwalker' -import {LinkLibraries, DeployLibraries, OpenZeppelinProxy} from '@remix-project/core-plugin' -import {CodeParser} from './app/plugins/parser/code-parser' -import {SolidityScript} from './app/plugins/solidity-script' - -import {WalkthroughService} from './walkthroughService' - -import {OffsetToLineColumnConverter, CompilerMetadata, CompilerArtefacts, FetchAndCompile, CompilerImports, GistHandler} from '@remix-project/core-plugin' - -import {Registry} from '@remix-project/remix-lib' -import {ConfigPlugin} from './app/plugins/config' -import {StoragePlugin} from './app/plugins/storage' -import {Layout} from './app/panels/layout' -import {NotificationPlugin} from './app/plugins/notification' -import {Blockchain} from './blockchain/blockchain' -import {MergeVMProvider, LondonVMProvider, BerlinVMProvider, ShanghaiVMProvider, CancunVMProvider} from './app/providers/vm-provider' -import {MainnetForkVMProvider} from './app/providers/mainnet-vm-fork-provider' -import {SepoliaForkVMProvider} from './app/providers/sepolia-vm-fork-provider' -import {GoerliForkVMProvider} from './app/providers/goerli-vm-fork-provider' -import {CustomForkVMProvider} from './app/providers/custom-vm-fork-provider' -import {HardhatProvider} from './app/providers/hardhat-provider' -import {GanacheProvider} from './app/providers/ganache-provider' -import {FoundryProvider} from './app/providers/foundry-provider' -import {ExternalHttpProvider} from './app/providers/external-http-provider' +import { RunTab, makeUdapp } from './app/udapp' +import { RemixEngine } from './remixEngine' +import { RemixAppManager } from './remixAppManager' +import { ThemeModule } from './app/tabs/theme-module' +import { LocaleModule } from './app/tabs/locale-module' +import { NetworkModule } from './app/tabs/network-module' +import { Web3ProviderModule } from './app/tabs/web3-provider' +import { CompileAndRun } from './app/tabs/compile-and-run' +import { PluginStateLogger } from './app/tabs/state-logger' +import { SidePanel } from './app/components/side-panel' +import { StatusBar } from './app/components/status-bar' +import { HiddenPanel } from './app/components/hidden-panel' +import { PinnedPanel } from './app/components/pinned-panel' +import { VerticalIcons } from './app/components/vertical-icons' +import { LandingPage } from './app/ui/landing-page/landing-page' +import { MainPanel } from './app/components/main-panel' +import { PermissionHandlerPlugin } from './app/plugins/permission-handler-plugin' +import { AstWalker } from '@remix-project/remix-astwalker' +import { LinkLibraries, DeployLibraries, OpenZeppelinProxy } from '@remix-project/core-plugin' +import { CodeParser } from './app/plugins/parser/code-parser' +import { SolidityScript } from './app/plugins/solidity-script' + +import { WalkthroughService } from './walkthroughService' + +import { OffsetToLineColumnConverter, CompilerMetadata, CompilerArtefacts, FetchAndCompile, CompilerImports, GistHandler } from '@remix-project/core-plugin' + +import { Registry } from '@remix-project/remix-lib' +import { ConfigPlugin } from './app/plugins/config' +import { StoragePlugin } from './app/plugins/storage' +import { Layout } from './app/panels/layout' +import { NotificationPlugin } from './app/plugins/notification' +import { Blockchain } from './blockchain/blockchain' +import { MergeVMProvider, LondonVMProvider, BerlinVMProvider, ShanghaiVMProvider, CancunVMProvider } from './app/providers/vm-provider' +import { MainnetForkVMProvider } from './app/providers/mainnet-vm-fork-provider' +import { SepoliaForkVMProvider } from './app/providers/sepolia-vm-fork-provider' +import { GoerliForkVMProvider } from './app/providers/goerli-vm-fork-provider' +import { CustomForkVMProvider } from './app/providers/custom-vm-fork-provider' +import { HardhatProvider } from './app/providers/hardhat-provider' +import { GanacheProvider } from './app/providers/ganache-provider' +import { FoundryProvider } from './app/providers/foundry-provider' +import { ExternalHttpProvider } from './app/providers/external-http-provider' import { FileDecorator } from './app/plugins/file-decorator' import { CodeFormat } from './app/plugins/code-format' import { SolidityUmlGen } from './app/plugins/solidity-umlgen' @@ -58,7 +58,12 @@ import { compilerLoaderPlugin, compilerLoaderPluginDesktop } from './app/plugins import { appUpdaterPlugin } from './app/plugins/electron/appUpdaterPlugin' import { SlitherHandleDesktop } from './app/plugins/electron/slitherPlugin' import { SlitherHandle } from './app/files/slither-handle' -import {SolCoder} from './app/plugins/solcoderAI' +import { FoundryHandle } from './app/files/foundry-handle' +import { FoundryHandleDesktop } from './app/plugins/electron/foundryPlugin' +import { HardhatHandle } from './app/files/hardhat-handle' +import { HardhatHandleDesktop } from './app/plugins/electron/hardhatPlugin' + +import { SolCoder } from './app/plugins/solcoderAI' const isElectron = require('is-electron') @@ -75,6 +80,7 @@ const Config = require('./config') const FileManager = require('./app/files/fileManager') import FileProvider from "./app/files/fileProvider" import { appPlatformTypes } from '@remix-ui/app' + const DGitProvider = require('./app/files/dgitProvider') const WorkspaceFileProvider = require('./app/files/workspaceFileProvider') @@ -83,19 +89,19 @@ const PluginManagerComponent = require('./app/components/plugin-manager-componen const CompileTab = require('./app/tabs/compile-tab') const SettingsTab = require('./app/tabs/settings-tab') const AnalysisTab = require('./app/tabs/analysis-tab') -const {DebuggerTab} = require('./app/tabs/debugger-tab') +const { DebuggerTab } = require('./app/tabs/debugger-tab') const TestTab = require('./app/tabs/test-tab') const FilePanel = require('./app/panels/file-panel') const Editor = require('./app/editor/editor') const Terminal = require('./app/panels/terminal') -const {TabProxy} = require('./app/panels/tab-proxy.js') +const { TabProxy } = require('./app/panels/tab-proxy.js') export class platformApi { - get name () { + get name() { return isElectron() ? appPlatformTypes.desktop : appPlatformTypes.web } - isDesktop () { + isDesktop() { return isElectron() } } @@ -115,7 +121,7 @@ class AppComponent { // load app config const config = new Config(configStorage) - Registry.getInstance().put({api: config, name: 'config'}) + Registry.getInstance().put({ api: config, name: 'config' }) // load file system this._components.filesProviders = {} @@ -196,12 +202,12 @@ class AppComponent { this.themeModule = new ThemeModule() // ----------------- locale service --------------------------------- this.localeModule = new LocaleModule() - Registry.getInstance().put({api: this.themeModule, name: 'themeModule'}) - Registry.getInstance().put({api: this.localeModule, name: 'localeModule'}) + Registry.getInstance().put({ api: this.themeModule, name: 'themeModule' }) + Registry.getInstance().put({ api: this.localeModule, name: 'localeModule' }) // ----------------- editor service ---------------------------- const editor = new Editor() // wrapper around ace editor - Registry.getInstance().put({api: editor, name: 'editor'}) + Registry.getInstance().put({ api: editor, name: 'editor' }) editor.event.register('requiringToSaveCurrentfile', (currentFile) => { fileManager.saveCurrentFile() if (currentFile.endsWith('.circom')) this.appManager.activatePlugin(['circuit-compiler']) @@ -209,7 +215,7 @@ class AppComponent { // ----------------- fileManager service ---------------------------- const fileManager = new FileManager(editor, appManager) - Registry.getInstance().put({api: fileManager, name: 'filemanager'}) + Registry.getInstance().put({ api: fileManager, name: 'filemanager' }) // ----------------- dGit provider --------------------------------- const dGitProvider = new DGitProvider() @@ -288,7 +294,7 @@ class AppComponent { // -------------------Terminal---------------------------------------- makeUdapp(blockchain, compilersArtefacts, (domEl) => terminal.logHtml(domEl)) const terminal = new Terminal( - {appManager, blockchain}, + { appManager, blockchain }, { getPosition: (event) => { const limitUp = 36 @@ -382,16 +388,24 @@ class AppComponent { this.engine.register([appUpdater]) } - const compilerloader = isElectron()? new compilerLoaderPluginDesktop(): new compilerLoaderPlugin() + const compilerloader = isElectron() ? new compilerLoaderPluginDesktop() : new compilerLoaderPlugin() this.engine.register([compilerloader]) // slither analyzer plugin (remixd / desktop) const slitherPlugin = isElectron() ? new SlitherHandleDesktop() : new SlitherHandle() this.engine.register([slitherPlugin]) + //foundry plugin + const foundryPlugin = isElectron() ? new FoundryHandleDesktop() : new FoundryHandle() + this.engine.register([foundryPlugin]) + + // hardhat plugin + const hardhatPlugin = isElectron() ? new HardhatHandleDesktop() : new HardhatHandle() + this.engine.register([hardhatPlugin]) + // LAYOUT & SYSTEM VIEWS const appPanel = new MainPanel() - Registry.getInstance().put({api: this.mainview, name: 'mainview'}) + Registry.getInstance().put({ api: this.mainview, name: 'mainview' }) const tabProxy = new TabProxy(fileManager, editor) this.engine.register([appPanel, tabProxy]) @@ -443,8 +457,6 @@ class AppComponent { analysis, test, filePanel.remixdHandle, - filePanel.hardhatHandle, - filePanel.foundryHandle, filePanel.truffleHandle, linkLibraries, deployLibraries, @@ -453,10 +465,10 @@ class AppComponent { ]) this.layout.panels = { - tabs: {plugin: tabProxy, active: true}, - editor: {plugin: editor, active: true}, - main: {plugin: appPanel, active: false}, - terminal: {plugin: terminal, active: true, minimized: false} + tabs: { plugin: tabProxy, active: true }, + editor: { plugin: editor, active: true }, + main: { plugin: appPanel, active: false }, + terminal: { plugin: terminal, active: true, minimized: false } } } @@ -469,7 +481,7 @@ class AppComponent { } catch (e) { console.log("couldn't register iframe plugins", e.message) } - if (isElectron()){ + if (isElectron()) { await this.appManager.activatePlugin(['fs']) } await this.appManager.activatePlugin(['layout']) @@ -511,8 +523,8 @@ class AppComponent { await this.appManager.activatePlugin(['walkthrough', 'storage', 'search', 'compileAndRun', 'recorder']) await this.appManager.activatePlugin(['solidity-script', 'remix-templates']) - if (isElectron()){ - await this.appManager.activatePlugin(['isogit', 'electronconfig', 'electronTemplates', 'xterm', 'ripgrep', 'appUpdater', 'slither']) + if (isElectron()) { + await this.appManager.activatePlugin(['isogit', 'electronconfig', 'electronTemplates', 'xterm', 'ripgrep', 'appUpdater', 'slither', 'foundry', 'hardhat']) } this.appManager.on( diff --git a/apps/remix-ide/src/app/panels/file-panel.js b/apps/remix-ide/src/app/panels/file-panel.js index fed62be18a..2260443663 100644 --- a/apps/remix-ide/src/app/panels/file-panel.js +++ b/apps/remix-ide/src/app/panels/file-panel.js @@ -6,8 +6,6 @@ import { FileSystemProvider } from '@remix-ui/workspace' // eslint-disable-line import {Registry} from '@remix-project/remix-lib' import { RemixdHandle } from '../plugins/remixd-handle' import {PluginViewWrapper} from '@remix-ui/helper' -const { HardhatHandle } = require('../files/hardhat-handle.js') -const { FoundryHandle } = require('../files/foundry-handle.js') const { TruffleHandle } = require('../files/truffle-handle.js') /* @@ -68,8 +66,6 @@ module.exports = class Filepanel extends ViewPlugin { this.el.setAttribute('id', 'fileExplorerView') this.remixdHandle = new RemixdHandle(this.fileProviders.localhost, appManager) - this.hardhatHandle = new HardhatHandle() - this.foundryHandle = new FoundryHandle() this.truffleHandle = new TruffleHandle() this.contentImport = contentImport this.workspaces = [] diff --git a/apps/remix-ide/src/app/plugins/electron/foundryPlugin.ts b/apps/remix-ide/src/app/plugins/electron/foundryPlugin.ts new file mode 100644 index 0000000000..1655681697 --- /dev/null +++ b/apps/remix-ide/src/app/plugins/electron/foundryPlugin.ts @@ -0,0 +1,13 @@ +import { ElectronPlugin } from '@remixproject/engine-electron'; + +export class FoundryHandleDesktop extends ElectronPlugin { + constructor() { + super({ + displayName: 'foundry', + name: 'foundry', + description: 'electron foundry', + methods: ['sync', 'compile'] + }) + this.methods = ['sync', 'compile'] + } +} diff --git a/apps/remix-ide/src/app/plugins/electron/hardhatPlugin.ts b/apps/remix-ide/src/app/plugins/electron/hardhatPlugin.ts new file mode 100644 index 0000000000..fad7190df4 --- /dev/null +++ b/apps/remix-ide/src/app/plugins/electron/hardhatPlugin.ts @@ -0,0 +1,13 @@ +import { ElectronPlugin } from '@remixproject/engine-electron'; + +export class HardhatHandleDesktop extends ElectronPlugin { + constructor() { + super({ + displayName: 'hardhat', + name: 'hardhat', + description: 'electron hardhat', + methods: ['sync', 'compile'] + }) + this.methods = ['sync', 'compile'] + } +} diff --git a/apps/remixdesktop/src/engine.ts b/apps/remixdesktop/src/engine.ts index 6a00ceab31..9a8fd78aad 100644 --- a/apps/remixdesktop/src/engine.ts +++ b/apps/remixdesktop/src/engine.ts @@ -11,6 +11,8 @@ import { RipgrepPlugin } from './plugins/ripgrepPlugin'; import { CompilerLoaderPlugin } from './plugins/compilerLoader'; import { SlitherPlugin } from './plugins/slitherPlugin'; import { AppUpdaterPlugin } from './plugins/appUpdater'; +import { FoundryPlugin } from './plugins/foundryPlugin'; +import { HardhatPlugin } from './plugins/hardhatPlugin'; const engine = new Engine() const appManager = new PluginManager() @@ -23,6 +25,8 @@ const ripgrepPlugin = new RipgrepPlugin() const compilerLoaderPlugin = new CompilerLoaderPlugin() const slitherPlugin = new SlitherPlugin() const appUpdaterPlugin = new AppUpdaterPlugin() +const foundryPlugin = new FoundryPlugin() +const hardhatPlugin = new HardhatPlugin() engine.register(appManager) engine.register(fsPlugin) @@ -33,7 +37,9 @@ engine.register(templatesPlugin) engine.register(ripgrepPlugin) engine.register(compilerLoaderPlugin) engine.register(slitherPlugin) +engine.register(foundryPlugin) engine.register(appUpdaterPlugin) +engine.register(hardhatPlugin) appManager.activatePlugin('electronconfig') appManager.activatePlugin('fs') diff --git a/apps/remixdesktop/src/lib/foundry.ts b/apps/remixdesktop/src/lib/foundry.ts deleted file mode 100644 index 30edf37889..0000000000 --- a/apps/remixdesktop/src/lib/foundry.ts +++ /dev/null @@ -1,207 +0,0 @@ -import { spawn } from 'child_process' -import chokidar from 'chokidar' -import fs from 'fs' -import { basename, join } from 'path' -import * as utils from './utils' -export const FoundryClientMixin = (Base) => class extends Base { - - currentSharedFolder: string - watcher: chokidar.FSWatcher - warnlog: boolean - buildPath: string - cachePath: string - logTimeout: NodeJS.Timeout - processingTimeout: NodeJS.Timeout - - startListening() { - if (fs.existsSync(this.buildPath) && fs.existsSync(this.cachePath)) { - this.listenOnFoundryCompilation() - } else { - this.listenOnFoundryFolder() - } - } - - listenOnFoundryFolder() { - console.log('Foundry out folder doesn\'t exist... waiting for the compilation.') - try { - 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', () => { - if (fs.existsSync(this.buildPath) && fs.existsSync(this.cachePath)) { - this.listenOnFoundryCompilation() - } - }) - } catch (e) { - console.log(e) - } - } - - compile() { - return new Promise((resolve, reject) => { - if (this.readOnly) { - const errMsg = '[Foundry Compilation]: Cannot compile in read-only mode' - return reject(new Error(errMsg)) - } - const cmd = `forge build` - const options = { cwd: this.currentSharedFolder, shell: true } - const child = spawn(cmd, options) - let result = '' - let error = '' - child.stdout.on('data', (data) => { - const msg = `[Foundry Compilation]: ${data.toString()}` - console.log('\x1b[32m%s\x1b[0m', msg) - result += msg + '\n' - }) - child.stderr.on('data', (err) => { - error += `[Foundry Compilation]: ${err.toString()} \n` - }) - child.on('close', () => { - if (error && result) resolve(error + result) - else if (error) reject(error) - else resolve(result) - }) - }) - } - - checkPath() { - if (!fs.existsSync(this.buildPath) || !fs.existsSync(this.cachePath)) { - this.listenOnFoundryFolder() - return false - } - if (!fs.existsSync(join(this.cachePath, 'solidity-files-cache.json'))) return false - return true - } - - private async processArtifact() { - if (!this.checkPath()) return - const folderFiles = await fs.promises.readdir(this.buildPath) // "out" folder - try { - const cache = JSON.parse(await fs.promises.readFile(join(this.cachePath, 'solidity-files-cache.json'), { encoding: 'utf-8' })) - // name of folders are file names - for (const file of folderFiles) { - const path = join(this.buildPath, file) // out/Counter.sol/ - const compilationResult = { - input: {}, - output: { - contracts: {}, - sources: {} - }, - inputSources: { sources: {}, target: '' }, - solcVersion: null, - compilationTarget: null - } - compilationResult.inputSources.target = file - await this.readContract(path, compilationResult, cache) - this.emit('compilationFinished', compilationResult.compilationTarget, { sources: compilationResult.input }, 'soljson', compilationResult.output, compilationResult.solcVersion) - } - - clearTimeout(this.logTimeout) - this.logTimeout = setTimeout(() => { - // @ts-ignore - this.call('terminal', 'log', { type: 'log', value: `receiving compilation result from Foundry. Select a file to populate the contract interaction interface.` }) - console.log('Syncing compilation result from Foundry') - }, 1000) - - } catch (e) { - console.log(e) - } - } - - async triggerProcessArtifact() { - // prevent multiple calls - clearTimeout(this.processingTimeout) - this.processingTimeout = setTimeout(async () => await this.processArtifact(), 1000) - } - - listenOnFoundryCompilation() { - try { - 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()) - // process the artifact on activation - this.triggerProcessArtifact() - } catch (e) { - console.log(e) - } - } - - async readContract(contractFolder, compilationResultPart, cache) { - const files = await fs.promises.readdir(contractFolder) - for (const file of files) { - const path = join(contractFolder, file) - const content = await fs.promises.readFile(path, { encoding: 'utf-8' }) - compilationResultPart.inputSources.sources[file] = { content } - await this.feedContractArtifactFile(file, content, compilationResultPart, cache) - } - } - - async feedContractArtifactFile(path, content, compilationResultPart, cache) { - const contentJSON = JSON.parse(content) - const contractName = basename(path).replace('.json', '') - - let sourcePath = '' - if (contentJSON?.metadata?.settings?.compilationTarget) { - for (const key in contentJSON.metadata.settings.compilationTarget) { - if (contentJSON.metadata.settings.compilationTarget[key] === contractName) { - sourcePath = key - break - } - } - } - - if (!sourcePath) return - - const currentCache = cache.files[sourcePath] - if (!currentCache.artifacts[contractName]) return - - // extract source and version - const metadata = contentJSON.metadata - if (metadata.compiler && metadata.compiler.version) { - compilationResultPart.solcVersion = metadata.compiler.version - } else { - compilationResultPart.solcVersion = '' - console.log('\x1b[32m%s\x1b[0m', 'compiler version not found, please update Foundry to the latest version.') - } - - if (metadata.sources) { - for (const path in metadata.sources) { - const absPath = utils.absolutePath(path, this.currentSharedFolder) - try { - const content = await fs.promises.readFile(absPath, { encoding: 'utf-8' }) - compilationResultPart.input[path] = { content } - } catch (e) { - compilationResultPart.input[path] = { content: '' } - } - } - } else { - console.log('\x1b[32m%s\x1b[0m', 'sources input not found, please update Foundry to the latest version.') - } - - compilationResultPart.compilationTarget = sourcePath - // extract data - if (!compilationResultPart.output['sources'][sourcePath]) compilationResultPart.output['sources'][sourcePath] = {} - compilationResultPart.output['sources'][sourcePath] = { - ast: contentJSON['ast'], - id: contentJSON['id'] - } - if (!compilationResultPart.output['contracts'][sourcePath]) compilationResultPart.output['contracts'][sourcePath] = {} - - contentJSON.bytecode.object = contentJSON.bytecode.object.replace('0x', '') - contentJSON.deployedBytecode.object = contentJSON.deployedBytecode.object.replace('0x', '') - compilationResultPart.output['contracts'][sourcePath][contractName] = { - abi: contentJSON.abi, - evm: { - bytecode: contentJSON.bytecode, - deployedBytecode: contentJSON.deployedBytecode, - methodIdentifiers: contentJSON.methodIdentifiers - } - } - } - - async sync() { - console.log('syncing Foundry with Remix...') - this.processArtifact() - } -} \ No newline at end of file diff --git a/apps/remixdesktop/src/lib/remixd.ts b/apps/remixdesktop/src/lib/remixd.ts index 4315da2880..ea3c2afd2b 100644 --- a/apps/remixdesktop/src/lib/remixd.ts +++ b/apps/remixdesktop/src/lib/remixd.ts @@ -28,6 +28,7 @@ export class ElectronBasePluginRemixdClient extends ElectronBasePluginClient { this.onload(async () => { this.on('fs' as any, 'workingDirChanged', async (path: string) => { + console.log('workingDirChanged base remixd', path) this.currentSharedFolder = path }) this.currentSharedFolder = await this.call('fs' as any, 'getWorkingDir') diff --git a/apps/remixdesktop/src/lib/slither.ts b/apps/remixdesktop/src/lib/slither.ts deleted file mode 100644 index 3ff55f80dd..0000000000 --- a/apps/remixdesktop/src/lib/slither.ts +++ /dev/null @@ -1,193 +0,0 @@ -import { existsSync, readFileSync, readdirSync, unlinkSync } from 'fs' -import * as utils from './utils' -const { spawn, execSync } = require('child_process') // eslint-disable-line -export interface OutputStandard { - description: string - title: string - confidence: string - severity: string - sourceMap: any - category?: string - reference?: string - example?: any - [key: string]: any -} - -export const SlitherClientMixin = (Base) => class extends Base { - methods: Array - currentSharedFolder: string - - constructor(...args: any[]) { - super(...args); // Ensure the parent constructor is called - } - - - log(...message: any) { - if (this.log) { - this.log(...message) - } else { - console.log(...message) - } - } - - error(...message: any) { - if (this.error) { - this.error(...message) - } else { - console.error(...message) - } - } - - - mapNpmDepsDir(list) { - const remixNpmDepsPath = utils.absolutePath('.deps/npm', this.currentSharedFolder) - const localNpmDepsPath = utils.absolutePath('node_modules', this.currentSharedFolder) - const npmDepsExists = existsSync(remixNpmDepsPath) - const nodeModulesExists = existsSync(localNpmDepsPath) - let isLocalDep = false - let isRemixDep = false - let allowPathString = '' - let remapString = '' - - for (const e of list) { - const importPath = e.replace(/import ['"]/g, '').trim() - const packageName = importPath.split('/')[0] - if (nodeModulesExists && readdirSync(localNpmDepsPath).includes(packageName)) { - isLocalDep = true - remapString += `${packageName}=./node_modules/${packageName} ` - } else if (npmDepsExists && readdirSync(remixNpmDepsPath).includes(packageName)) { - isRemixDep = true - remapString += `${packageName}=./.deps/npm/${packageName} ` - } - } - if (isLocalDep) allowPathString += './node_modules,' - if (isRemixDep) allowPathString += './.deps/npm,' - - return { remapString, allowPathString } - } - - transform(detectors: Record[]): OutputStandard[] { - const standardReport: OutputStandard[] = [] - for (const e of detectors) { - const obj = {} as OutputStandard - obj.description = e.description - obj.title = e.check - obj.confidence = e.confidence - obj.severity = e.impact - obj.sourceMap = e.elements.map((element) => { - delete element.source_mapping.filename_used - delete element.source_mapping.filename_absolute - return element - }) - standardReport.push(obj) - } - return standardReport - } - - analyse(filePath: string, compilerConfig: Record) { - return new Promise((resolve, reject) => { - const options = { cwd: this.currentSharedFolder, shell: true } - - const { currentVersion, optimize, evmVersion } = compilerConfig - if (currentVersion && currentVersion.includes('+commit')) { - // Get compiler version with commit id e.g: 0.8.2+commit.661d110 - const versionString: string = currentVersion.substring(0, currentVersion.indexOf('+commit') + 16) - this.log(`[Slither Analysis]: Compiler version is ${versionString}`) - let solcOutput: Buffer - // Check solc current installed version - try { - solcOutput = execSync('solc --version', options) - } catch (err) { - this.error(err) - reject(new Error('Error in running solc command')) - } - if (!solcOutput.toString().includes(versionString)) { - this.log('[Slither Analysis]: Compiler version is different from installed solc version') - // Get compiler version without commit id e.g: 0.8.2 - const version: string = versionString.substring(0, versionString.indexOf('+commit')) - // List solc versions installed using solc-select - try { - const solcSelectInstalledVersions: Buffer = execSync('solc-select versions', options) - // Check if required version is already installed - if (!solcSelectInstalledVersions.toString().includes(version)) { - this.log(`[Slither Analysis]: Installing ${version} using solc-select`) - // Install required version - execSync(`solc-select install ${version}`, options) - } - this.log(`[Slither Analysis]: Setting ${version} as current solc version using solc-select`) - // Set solc current version as required version - execSync(`solc-select use ${version}`, options) - } catch (err) { - this.error(err) - reject(new Error('Error in running solc-select command')) - } - } else this.log('[Slither Analysis]: Compiler version is same as installed solc version') - } - // Allow paths and set solc remapping for import URLs - const fileContent = readFileSync(utils.absolutePath(filePath, this.currentSharedFolder), 'utf8') - const importsArr = fileContent.match(/import ['"][^.|..](.+?)['"];/g) - let remaps = '' - if (importsArr?.length) { - const { remapString } = this.mapNpmDepsDir(importsArr) - remaps = remapString.trim() - } - const optimizeOption: string = optimize ? '--optimize' : '' - const evmOption: string = evmVersion ? `--evm-version ${evmVersion}` : '' - let solcArgs = '' - if (optimizeOption) { - solcArgs += optimizeOption + ' ' - } - if (evmOption) { - if (!solcArgs.endsWith(' ')) solcArgs += ' ' - solcArgs += evmOption - } - if (solcArgs) { - solcArgs = `--solc-args "${solcArgs.trimStart()}"` - } - const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : '' - - const outputFile = 'remix-slither-report.json' - try { - // We don't keep the previous analysis - const outputFilePath = utils.absolutePath(outputFile, this.currentSharedFolder) - if (existsSync(outputFilePath)) unlinkSync(outputFilePath) - } catch (e) { - this.error('unable to remove the output file') - this.error(e.message) - } - const cmd = `slither ${filePath} ${solcArgs} ${solcRemaps} --json ${outputFile}` - this.log('[Slither Analysis]: Running Slither...') - // Added `stdio: 'ignore'` as for contract with NPM imports analysis which is exported in 'stderr' - // get too big and hangs the process. We process analysis from the report file only - const child = spawn(cmd, { cwd: this.currentSharedFolder, shell: true, stdio: 'ignore' }) - - const response = {} - child.on('close', () => { - const outputFileAbsPath: string = utils.absolutePath(outputFile, this.currentSharedFolder) - // Check if slither report file exists - if (existsSync(outputFileAbsPath)) { - let report = readFileSync(outputFileAbsPath, 'utf8') - report = JSON.parse(report) - if (report['success']) { - response['status'] = true - if (!report['results'] || !report['results'].detectors || !report['results'].detectors.length) { - response['count'] = 0 - } else { - const { detectors } = report['results'] - response['count'] = detectors.length - response['data'] = this.transform(detectors) - } - - resolve(response) - } else { - this.log(report['error']) - reject(new Error('Error in running Slither Analysis.')) - } - } else { - this.error('Error in generating Slither Analysis Report. Make sure Slither is properly installed.') - reject(new Error('Error in generating Slither Analysis Report. Make sure Slither is properly installed.')) - } - }) - }) - } -} diff --git a/apps/remixdesktop/src/lib/utils.ts b/apps/remixdesktop/src/lib/utils.ts index e406b647b9..1520915d8b 100644 --- a/apps/remixdesktop/src/lib/utils.ts +++ b/apps/remixdesktop/src/lib/utils.ts @@ -19,6 +19,6 @@ function normalizePath (path) { return path } -export { absolutePath } +export { absolutePath, normalizePath } diff --git a/apps/remixdesktop/src/plugins/foundryPlugin.ts b/apps/remixdesktop/src/plugins/foundryPlugin.ts index 0b3411ceae..1eacb81cab 100644 --- a/apps/remixdesktop/src/plugins/foundryPlugin.ts +++ b/apps/remixdesktop/src/plugins/foundryPlugin.ts @@ -1,35 +1,247 @@ import { Profile } from "@remixproject/plugin-utils"; import { ElectronBasePlugin, ElectronBasePluginClient } from "@remixproject/plugin-electron" - +import chokidar from 'chokidar' import { ElectronBasePluginRemixdClient } from "../lib/remixd" +import fs from 'fs' +import * as utils from '../lib/utils' -import { FoundryClientMixin } from "../lib/foundry"; +import { basename, join } from "path"; +import { spawn } from "child_process"; const profile: Profile = { - name: 'slither', - displayName: 'electron slither', - description: 'electron slither', + name: 'foundry', + displayName: 'electron foundry', + description: 'electron foundry', } export class FoundryPlugin extends ElectronBasePlugin { - clients: any [] - constructor() { - super(profile, clientProfile, FoundryClientMixin(FoundryPluginClient)) - this.methods = [...super.methods] - } + clients: any[] + constructor() { + super(profile, clientProfile, FoundryPluginClient) + this.methods = [...super.methods] + } } const clientProfile: Profile = { - name: 'foundry', - displayName: 'electron foundry', - description: 'electron foundry', - methods: ['sync', 'compile'] + name: 'foundry', + displayName: 'electron foundry', + description: 'electron foundry', + methods: ['sync', 'compile'] } class FoundryPluginClient extends ElectronBasePluginRemixdClient { - constructor(webContentsId: number, profile: Profile) { - super(webContentsId, profile); - } + + watcher: chokidar.FSWatcher + warnlog: boolean + buildPath: string + cachePath: string + logTimeout: NodeJS.Timeout + processingTimeout: NodeJS.Timeout + + async onActivation(): Promise { + console.log('Foundry plugin activated') + this.call('terminal', 'log', { type: 'log', value: 'Foundry plugin activated' }) + this.startListening() + this.on('fs' as any, 'workingDirChanged', async (path: string) => { + console.log('workingDirChanged foundry', path) + this.currentSharedFolder = path + this.startListening() + }) + this.currentSharedFolder = await this.call('fs' as any, 'getWorkingDir') + } + + startListening() { + this.buildPath = utils.absolutePath('out', this.currentSharedFolder) + this.cachePath = utils.absolutePath('cache', this.currentSharedFolder) + console.log('Foundry plugin checking for', this.buildPath, this.cachePath) + if (fs.existsSync(this.buildPath) && fs.existsSync(this.cachePath)) { + this.listenOnFoundryCompilation() + } else { + this.listenOnFoundryFolder() + } + } + + listenOnFoundryFolder() { + console.log('Foundry out folder doesn\'t exist... waiting for the compilation.') + try { + 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', (path: string) => { + console.log('add dir foundry', path) + if (fs.existsSync(this.buildPath) && fs.existsSync(this.cachePath)) { + this.listenOnFoundryCompilation() + } + }) + } catch (e) { + console.log(e) + } + } + + compile() { + return new Promise((resolve, reject) => { + const cmd = `forge build` + const options = { cwd: this.currentSharedFolder, shell: true } + const child = spawn(cmd, options) + let result = '' + let error = '' + child.stdout.on('data', (data) => { + const msg = `[Foundry Compilation]: ${data.toString()}` + console.log('\x1b[32m%s\x1b[0m', msg) + result += msg + '\n' + }) + child.stderr.on('data', (err) => { + error += `[Foundry Compilation]: ${err.toString()} \n` + }) + child.on('close', () => { + if (error && result) resolve(error + result) + else if (error) reject(error) + else resolve(result) + }) + }) + } + + checkPath() { + if (!fs.existsSync(this.buildPath) || !fs.existsSync(this.cachePath)) { + this.listenOnFoundryFolder() + return false + } + if (!fs.existsSync(join(this.cachePath, 'solidity-files-cache.json'))) return false + return true + } + + private async processArtifact() { + if (!this.checkPath()) return + const folderFiles = await fs.promises.readdir(this.buildPath) // "out" folder + try { + const cache = JSON.parse(await fs.promises.readFile(join(this.cachePath, 'solidity-files-cache.json'), { encoding: 'utf-8' })) + // name of folders are file names + for (const file of folderFiles) { + const path = join(this.buildPath, file) // out/Counter.sol/ + const compilationResult = { + input: {}, + output: { + contracts: {}, + sources: {} + }, + inputSources: { sources: {}, target: '' }, + solcVersion: null, + compilationTarget: null + } + compilationResult.inputSources.target = file + await this.readContract(path, compilationResult, cache) + this.emit('compilationFinished', compilationResult.compilationTarget, { sources: compilationResult.input }, 'soljson', compilationResult.output, compilationResult.solcVersion) + } + + clearTimeout(this.logTimeout) + this.logTimeout = setTimeout(() => { + // @ts-ignore + this.call('terminal', 'log', { type: 'log', value: `receiving compilation result from Foundry. Select a file to populate the contract interaction interface.` }) + console.log('Syncing compilation result from Foundry') + }, 1000) + + } catch (e) { + console.log(e) + } + } + + async triggerProcessArtifact() { + // prevent multiple calls + clearTimeout(this.processingTimeout) + this.processingTimeout = setTimeout(async () => await this.processArtifact(), 1000) + } + + listenOnFoundryCompilation() { + try { + console.log('Foundry out folder exists... processing the artifact.') + 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()) + // process the artifact on activation + this.triggerProcessArtifact() + } catch (e) { + console.log(e) + } + } + + async readContract(contractFolder, compilationResultPart, cache) { + const files = await fs.promises.readdir(contractFolder) + for (const file of files) { + const path = join(contractFolder, file) + const content = await fs.promises.readFile(path, { encoding: 'utf-8' }) + compilationResultPart.inputSources.sources[file] = { content } + await this.feedContractArtifactFile(file, content, compilationResultPart, cache) + } + } + + async feedContractArtifactFile(path, content, compilationResultPart, cache) { + const contentJSON = JSON.parse(content) + const contractName = basename(path).replace('.json', '') + + let sourcePath = '' + if (contentJSON?.metadata?.settings?.compilationTarget) { + for (const key in contentJSON.metadata.settings.compilationTarget) { + if (contentJSON.metadata.settings.compilationTarget[key] === contractName) { + sourcePath = key + break + } + } + } + + if (!sourcePath) return + + const currentCache = cache.files[sourcePath] + if (!currentCache.artifacts[contractName]) return + + // extract source and version + const metadata = contentJSON.metadata + if (metadata.compiler && metadata.compiler.version) { + compilationResultPart.solcVersion = metadata.compiler.version + } else { + compilationResultPart.solcVersion = '' + console.log('\x1b[32m%s\x1b[0m', 'compiler version not found, please update Foundry to the latest version.') + } + + if (metadata.sources) { + for (const path in metadata.sources) { + const absPath = utils.absolutePath(path, this.currentSharedFolder) + try { + const content = await fs.promises.readFile(absPath, { encoding: 'utf-8' }) + compilationResultPart.input[path] = { content } + } catch (e) { + compilationResultPart.input[path] = { content: '' } + } + } + } else { + console.log('\x1b[32m%s\x1b[0m', 'sources input not found, please update Foundry to the latest version.') + } + + compilationResultPart.compilationTarget = sourcePath + // extract data + if (!compilationResultPart.output['sources'][sourcePath]) compilationResultPart.output['sources'][sourcePath] = {} + compilationResultPart.output['sources'][sourcePath] = { + ast: contentJSON['ast'], + id: contentJSON['id'] + } + if (!compilationResultPart.output['contracts'][sourcePath]) compilationResultPart.output['contracts'][sourcePath] = {} + + contentJSON.bytecode.object = contentJSON.bytecode.object.replace('0x', '') + contentJSON.deployedBytecode.object = contentJSON.deployedBytecode.object.replace('0x', '') + compilationResultPart.output['contracts'][sourcePath][contractName] = { + abi: contentJSON.abi, + evm: { + bytecode: contentJSON.bytecode, + deployedBytecode: contentJSON.deployedBytecode, + methodIdentifiers: contentJSON.methodIdentifiers + } + } + } + + async sync() { + console.log('syncing Foundry with Remix...') + this.processArtifact() + } } diff --git a/apps/remixdesktop/src/plugins/hardhatPlugin.ts b/apps/remixdesktop/src/plugins/hardhatPlugin.ts new file mode 100644 index 0000000000..2fae8844db --- /dev/null +++ b/apps/remixdesktop/src/plugins/hardhatPlugin.ts @@ -0,0 +1,219 @@ +import { Profile } from "@remixproject/plugin-utils"; +import { ElectronBasePlugin, ElectronBasePluginClient } from "@remixproject/plugin-electron" +import chokidar from 'chokidar' +import { ElectronBasePluginRemixdClient } from "../lib/remixd" +import fs from 'fs' +import * as utils from '../lib/utils' + +import { basename, join } from "path"; +import { spawn } from "child_process"; +const profile: Profile = { + name: 'hardhat', + displayName: 'electron slither', + description: 'electron slither', +} + +export class HardhatPlugin extends ElectronBasePlugin { + clients: any[] + constructor() { + super(profile, clientProfile, HardhatPluginClient) + this.methods = [...super.methods] + } +} + +const clientProfile: Profile = { + name: 'hardhat', + displayName: 'electron hardhat', + description: 'electron hardhat', + methods: ['sync', 'compile'] +} + + +class HardhatPluginClient extends ElectronBasePluginRemixdClient { + watcher: chokidar.FSWatcher + warnlog: boolean + buildPath: string + cachePath: string + logTimeout: NodeJS.Timeout + processingTimeout: NodeJS.Timeout + + async onActivation(): Promise { + console.log('Hardhat plugin activated') + this.call('terminal', 'log', { type: 'log', value: 'Hardhat plugin activated' }) + this.startListening() + this.on('fs' as any, 'workingDirChanged', async (path: string) => { + console.log('workingDirChanged hardhat', path) + this.currentSharedFolder = path + this.startListening() + }) + this.currentSharedFolder = await this.call('fs' as any, 'getWorkingDir') + } + + startListening() { + this.buildPath = utils.absolutePath('artifacts/contracts', this.currentSharedFolder) + if (fs.existsSync(this.buildPath)) { + this.listenOnHardhatCompilation() + } else { + console.log('If you are using Hardhat, run `npx hardhat compile` or run the compilation with `Enable Hardhat Compilation` checked from the Remix IDE.') + this.listenOnHardHatFolder() + } + } + + compile(configPath: string) { + return new Promise((resolve, reject) => { + const cmd = `npx hardhat compile --config ${utils.normalizePath(configPath)}` + const options = { cwd: this.currentSharedFolder, shell: true } + const child = spawn(cmd, options) + let result = '' + let error = '' + child.stdout.on('data', (data) => { + const msg = `[Hardhat Compilation]: ${data.toString()}` + console.log('\x1b[32m%s\x1b[0m', msg) + result += msg + '\n' + }) + child.stderr.on('data', (err) => { + error += `[Hardhat Compilation]: ${err.toString()} \n` + }) + child.on('close', () => { + if (error && result) resolve(error + result) + else if (error) reject(error) + else resolve(result) + }) + }) + } + + checkPath() { + if (!fs.existsSync(this.buildPath)) { + this.listenOnHardHatFolder() + return false + } + return true + } + + private async processArtifact() { + console.log('processing artifact') + if (!this.checkPath()) return + // resolving the files + const folderFiles = await fs.promises.readdir(this.buildPath) + const targetsSynced = [] + // name of folders are file names + for (const file of folderFiles) { // ["artifacts/contracts/Greeter.sol/"] + const contractFilePath = join(this.buildPath, file) + const stat = await fs.promises.stat(contractFilePath) + if (!stat.isDirectory()) continue + const files = await fs.promises.readdir(contractFilePath) + const compilationResult = { + input: {}, + output: { + contracts: {}, + sources: {} + }, + solcVersion: null, + target: null + } + for (const file of files) { + if (file.endsWith('.dbg.json')) { // "artifacts/contracts/Greeter.sol/Greeter.dbg.json" + const stdFile = file.replace('.dbg.json', '.json') + const contentStd = await fs.promises.readFile(join(contractFilePath, stdFile), { encoding: 'utf-8' }) + const contentDbg = await fs.promises.readFile(join(contractFilePath, file), { encoding: 'utf-8' }) + const jsonDbg = JSON.parse(contentDbg) + const jsonStd = JSON.parse(contentStd) + compilationResult.target = jsonStd.sourceName + + targetsSynced.push(compilationResult.target) + const path = join(contractFilePath, jsonDbg.buildInfo) + const content = await fs.promises.readFile(path, { encoding: 'utf-8' }) + + await this.feedContractArtifactFile(content, compilationResult) + } + if (compilationResult.target) { + // we are only interested in the contracts that are in the target of the compilation + compilationResult.output = { + ...compilationResult.output, + contracts: { [compilationResult.target]: compilationResult.output.contracts[compilationResult.target] } + } + this.emit('compilationFinished', compilationResult.target, { sources: compilationResult.input }, 'soljson', compilationResult.output, compilationResult.solcVersion) + } + } + } + + clearTimeout(this.logTimeout) + this.logTimeout = setTimeout(() => { + this.call('terminal', 'log', { value: 'receiving compilation result from Hardhat. Select a file to populate the contract interaction interface.', type: 'log' }) + if (targetsSynced.length) { + console.log(`Processing artifacts for files: ${[...new Set(targetsSynced)].join(', ')}`) + // @ts-ignore + this.call('terminal', 'log', { type: 'log', value: `synced with Hardhat: ${[...new Set(targetsSynced)].join(', ')}` }) + } else { + console.log('No artifacts to process') + // @ts-ignore + this.call('terminal', 'log', { type: 'log', value: 'No artifacts from Hardhat to process' }) + } + }, 1000) + + } + + listenOnHardHatFolder() { + console.log('Hardhat artifacts folder doesn\'t exist... waiting for the compilation.') + try { + 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', (path: string) => { + console.log('add dir hardhat', path) + if (fs.existsSync(this.buildPath)) { + this.listenOnHardhatCompilation() + } + }) + } catch (e) { + console.log('listenOnHardHatFolder', e) + } + } + + async triggerProcessArtifact() { + console.log('triggerProcessArtifact') + // prevent multiple calls + clearTimeout(this.processingTimeout) + this.processingTimeout = setTimeout(async () => await this.processArtifact(), 1000) + } + + listenOnHardhatCompilation() { + try { + console.log('listening on Hardhat compilation...', this.buildPath) + 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()) + this.watcher.on('unlink', async () => await this.triggerProcessArtifact()) + // process the artifact on activation + this.processArtifact() + } catch (e) { + console.log('listenOnHardhatCompilation', e) + } + } + + async sync() { + console.log('syncing from Hardhat') + this.processArtifact() + } + + async feedContractArtifactFile(artifactContent, compilationResultPart) { + const contentJSON = JSON.parse(artifactContent) + compilationResultPart.solcVersion = contentJSON.solcVersion + for (const file in contentJSON.input.sources) { + const source = contentJSON.input.sources[file] + const absPath = join(this.currentSharedFolder, file) + if (fs.existsSync(absPath)) { // if not that is a lib + const contentOnDisk = await fs.promises.readFile(absPath, { encoding: 'utf-8' }) + if (contentOnDisk === source.content) { + compilationResultPart.input[file] = source + compilationResultPart.output['sources'][file] = contentJSON.output.sources[file] + compilationResultPart.output['contracts'][file] = contentJSON.output.contracts[file] + if (contentJSON.output.errors && contentJSON.output.errors.length) { + compilationResultPart.output['errors'] = contentJSON.output.errors.filter(error => error.sourceLocation.file === file) + } + } + } + } + } +} \ No newline at end of file diff --git a/apps/remixdesktop/src/plugins/slitherPlugin.ts b/apps/remixdesktop/src/plugins/slitherPlugin.ts index 5819e0a46b..abf7971e30 100644 --- a/apps/remixdesktop/src/plugins/slitherPlugin.ts +++ b/apps/remixdesktop/src/plugins/slitherPlugin.ts @@ -2,7 +2,22 @@ import { Profile } from "@remixproject/plugin-utils"; import { ElectronBasePlugin, ElectronBasePluginClient } from "@remixproject/plugin-electron" import { ElectronBasePluginRemixdClient } from "../lib/remixd" -import { SlitherClientMixin } from "../lib/slither"; +import * as utils from '../lib/utils' +import { existsSync, readdirSync, readFileSync, unlinkSync } from "fs-extra"; + +export interface OutputStandard { + description: string + title: string + confidence: string + severity: string + sourceMap: any + category?: string + reference?: string + example?: any + [key: string]: any +} + +const { spawn, execSync } = require('child_process') // eslint-disable-line const profile: Profile = { name: 'slither', displayName: 'electron slither', @@ -10,9 +25,9 @@ const profile: Profile = { } export class SlitherPlugin extends ElectronBasePlugin { - clients: any [] + clients: any[] constructor() { - super(profile, clientProfile, SlitherClientMixin(SlitherPluginClient)) + super(profile, clientProfile, SlitherPluginClient) this.methods = [...super.methods] } } @@ -24,10 +39,158 @@ const clientProfile: Profile = { methods: ['analyse'] } - class SlitherPluginClient extends ElectronBasePluginRemixdClient { - constructor(webContentsId: number, profile: Profile) { - super(webContentsId, profile); + + mapNpmDepsDir(list) { + const remixNpmDepsPath = utils.absolutePath('.deps/npm', this.currentSharedFolder) + const localNpmDepsPath = utils.absolutePath('node_modules', this.currentSharedFolder) + const npmDepsExists = existsSync(remixNpmDepsPath) + const nodeModulesExists = existsSync(localNpmDepsPath) + let isLocalDep = false + let isRemixDep = false + let allowPathString = '' + let remapString = '' + + for (const e of list) { + const importPath = e.replace(/import ['"]/g, '').trim() + const packageName = importPath.split('/')[0] + if (nodeModulesExists && readdirSync(localNpmDepsPath).includes(packageName)) { + isLocalDep = true + remapString += `${packageName}=./node_modules/${packageName} ` + } else if (npmDepsExists && readdirSync(remixNpmDepsPath).includes(packageName)) { + isRemixDep = true + remapString += `${packageName}=./.deps/npm/${packageName} ` + } + } + if (isLocalDep) allowPathString += './node_modules,' + if (isRemixDep) allowPathString += './.deps/npm,' + + return { remapString, allowPathString } + } + + transform(detectors: Record[]): OutputStandard[] { + const standardReport: OutputStandard[] = [] + for (const e of detectors) { + const obj = {} as OutputStandard + obj.description = e.description + obj.title = e.check + obj.confidence = e.confidence + obj.severity = e.impact + obj.sourceMap = e.elements.map((element) => { + delete element.source_mapping.filename_used + delete element.source_mapping.filename_absolute + return element + }) + standardReport.push(obj) + } + return standardReport + } + + analyse(filePath: string, compilerConfig: Record) { + return new Promise((resolve, reject) => { + const options = { cwd: this.currentSharedFolder, shell: true } + + const { currentVersion, optimize, evmVersion } = compilerConfig + if (currentVersion && currentVersion.includes('+commit')) { + // Get compiler version with commit id e.g: 0.8.2+commit.661d110 + const versionString: string = currentVersion.substring(0, currentVersion.indexOf('+commit') + 16) + this.log(`[Slither Analysis]: Compiler version is ${versionString}`) + let solcOutput: Buffer + // Check solc current installed version + try { + solcOutput = execSync('solc --version', options) + } catch (err) { + this.error(err) + reject(new Error('Error in running solc command')) + } + if (!solcOutput.toString().includes(versionString)) { + this.log('[Slither Analysis]: Compiler version is different from installed solc version') + // Get compiler version without commit id e.g: 0.8.2 + const version: string = versionString.substring(0, versionString.indexOf('+commit')) + // List solc versions installed using solc-select + try { + const solcSelectInstalledVersions: Buffer = execSync('solc-select versions', options) + // Check if required version is already installed + if (!solcSelectInstalledVersions.toString().includes(version)) { + this.log(`[Slither Analysis]: Installing ${version} using solc-select`) + // Install required version + execSync(`solc-select install ${version}`, options) + } + this.log(`[Slither Analysis]: Setting ${version} as current solc version using solc-select`) + // Set solc current version as required version + execSync(`solc-select use ${version}`, options) + } catch (err) { + this.error(err) + reject(new Error('Error in running solc-select command')) + } + } else this.log('[Slither Analysis]: Compiler version is same as installed solc version') + } + // Allow paths and set solc remapping for import URLs + const fileContent = readFileSync(utils.absolutePath(filePath, this.currentSharedFolder), 'utf8') + const importsArr = fileContent.match(/import ['"][^.|..](.+?)['"];/g) + let remaps = '' + if (importsArr?.length) { + const { remapString } = this.mapNpmDepsDir(importsArr) + remaps = remapString.trim() + } + const optimizeOption: string = optimize ? '--optimize' : '' + const evmOption: string = evmVersion ? `--evm-version ${evmVersion}` : '' + let solcArgs = '' + if (optimizeOption) { + solcArgs += optimizeOption + ' ' + } + if (evmOption) { + if (!solcArgs.endsWith(' ')) solcArgs += ' ' + solcArgs += evmOption + } + if (solcArgs) { + solcArgs = `--solc-args "${solcArgs.trimStart()}"` + } + const solcRemaps = remaps ? `--solc-remaps "${remaps}"` : '' + + const outputFile = 'remix-slither-report.json' + try { + // We don't keep the previous analysis + const outputFilePath = utils.absolutePath(outputFile, this.currentSharedFolder) + if (existsSync(outputFilePath)) unlinkSync(outputFilePath) + } catch (e) { + this.error('unable to remove the output file') + this.error(e.message) + } + const cmd = `slither ${filePath} ${solcArgs} ${solcRemaps} --json ${outputFile}` + this.log('[Slither Analysis]: Running Slither...') + // Added `stdio: 'ignore'` as for contract with NPM imports analysis which is exported in 'stderr' + // get too big and hangs the process. We process analysis from the report file only + const child = spawn(cmd, { cwd: this.currentSharedFolder, shell: true, stdio: 'ignore' }) + + const response = {} + child.on('close', () => { + const outputFileAbsPath: string = utils.absolutePath(outputFile, this.currentSharedFolder) + // Check if slither report file exists + if (existsSync(outputFileAbsPath)) { + let report = readFileSync(outputFileAbsPath, 'utf8') + report = JSON.parse(report) + if (report['success']) { + response['status'] = true + if (!report['results'] || !report['results'].detectors || !report['results'].detectors.length) { + response['count'] = 0 + } else { + const { detectors } = report['results'] + response['count'] = detectors.length + response['data'] = this.transform(detectors) + } + + resolve(response) + } else { + this.log(report['error']) + reject(new Error('Error in running Slither Analysis.')) + } + } else { + this.error('Error in generating Slither Analysis Report. Make sure Slither is properly installed.') + reject(new Error('Error in generating Slither Analysis Report. Make sure Slither is properly installed.')) + } + }) + }) } } diff --git a/apps/remixdesktop/src/preload.ts b/apps/remixdesktop/src/preload.ts index 6c5c2f1fc9..9f757541c1 100644 --- a/apps/remixdesktop/src/preload.ts +++ b/apps/remixdesktop/src/preload.ts @@ -6,7 +6,7 @@ console.log('preload.ts', new Date().toLocaleTimeString()) /* preload script needs statically defined API for each plugin */ -const exposedPLugins = ['fs', 'git', 'xterm', 'isogit', 'electronconfig', 'electronTemplates', 'ripgrep', 'compilerloader', 'appUpdater', 'slither'] +const exposedPLugins = ['fs', 'git', 'xterm', 'isogit', 'electronconfig', 'electronTemplates', 'ripgrep', 'compilerloader', 'appUpdater', 'slither', 'foundry', 'hardhat'] let webContentsId: number | undefined From 4ae7b897cd4a0faef0b46f20b932f3508eeff483 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Jul 2024 15:04:56 +0200 Subject: [PATCH 03/19] compiler for hardhat --- apps/remix-ide/src/app/tabs/compile-tab.js | 6 +++++- apps/solidity-compiler/src/app/compiler.ts | 4 ++++ libs/remix-lib/src/types/ICompilerApi.ts | 1 + .../src/lib/logic/compileTabLogic.ts | 9 +++++---- .../solidity-compiler/src/lib/solidity-compiler.tsx | 13 +++++++++---- 5 files changed, 24 insertions(+), 9 deletions(-) diff --git a/apps/remix-ide/src/app/tabs/compile-tab.js b/apps/remix-ide/src/app/tabs/compile-tab.js index e3505358af..1fb7dea231 100644 --- a/apps/remix-ide/src/app/tabs/compile-tab.js +++ b/apps/remix-ide/src/app/tabs/compile-tab.js @@ -9,7 +9,7 @@ import { QueryParams } from '@remix-project/remix-lib' import * as packageJson from '../../../../../package.json' import { compilerConfigChangedToastMsg, compileToastMsg } from '@remix-ui/helper' import { isNative } from '../../remixAppManager' - +import { Registry } from '@remix-project/remix-lib' const profile = { name: 'solidity', displayName: 'Solidity compiler', @@ -90,6 +90,10 @@ class CompileTab extends CompilerApiMixin(ViewPlugin) { // implements ICompilerA return this.fileManager.mode } + isDesktop () { + return Registry.getInstance().get('platform').api.isDesktop() + } + /** * set the compiler configuration * This function is used by remix-plugin compiler API. diff --git a/apps/solidity-compiler/src/app/compiler.ts b/apps/solidity-compiler/src/app/compiler.ts index d86d5322cb..d20f8db8d8 100644 --- a/apps/solidity-compiler/src/app/compiler.ts +++ b/apps/solidity-compiler/src/app/compiler.ts @@ -55,4 +55,8 @@ export class CompilerClientApi extends CompilerApiMixin(PluginClient) implements getFileManagerMode () { return 'browser' } + + isDesktop() { + return false + } } diff --git a/libs/remix-lib/src/types/ICompilerApi.ts b/libs/remix-lib/src/types/ICompilerApi.ts index da8dc3b694..cfb4ce832f 100644 --- a/libs/remix-lib/src/types/ICompilerApi.ts +++ b/libs/remix-lib/src/types/ICompilerApi.ts @@ -18,6 +18,7 @@ export interface ICompilerApi { setAppParameter: (name: string, value: string | boolean) => void getFileManagerMode: () => string + isDesktop: () => boolean setCompilerConfig: (settings: any) => void getCompilationResult: () => any diff --git a/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts b/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts index 49aad01d31..0c5800a46e 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts +++ b/libs/remix-ui/solidity-compiler/src/lib/logic/compileTabLogic.ts @@ -129,26 +129,27 @@ export class CompileTabLogic { } async isHardhatProject () { - if (this.api.getFileManagerMode() === 'localhost') { + if (this.api.getFileManagerMode() === ('localhost') || this.api.isDesktop()) { + console.log('checking hardhat project') return await this.api.fileExists('hardhat.config.js') || await this.api.fileExists('hardhat.config.ts') } else return false } async isTruffleProject () { - if (this.api.getFileManagerMode() === 'localhost') { + if (this.api.getFileManagerMode() === ('localhost') || this.api.isDesktop()) { return await this.api.fileExists('truffle-config.js') } else return false } async isFoundryProject () { - if (this.api.getFileManagerMode() === 'localhost') { + if (this.api.getFileManagerMode() === ('localhost') || this.api.isDesktop()) { return await this.api.fileExists('foundry.toml') } else return false } runCompiler (externalCompType) { try { - if (this.api.getFileManagerMode() === 'localhost') { + if (this.api.getFileManagerMode() === 'localhost' || this.api.isDesktop()) { if (externalCompType === 'hardhat') { const { currentVersion, optimize, runs } = this.compiler.state if (currentVersion) { diff --git a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx index 46f13d3047..04908c35ec 100644 --- a/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx +++ b/libs/remix-ui/solidity-compiler/src/lib/solidity-compiler.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react' // eslint-disable-line +import React, { useContext, useEffect, useState } from 'react' // eslint-disable-line import { CompileErrors, ContractsFile, SolidityCompilerProps } from './types' import { CompilerContainer } from './compiler-container' // eslint-disable-line import { ContractSelection } from './contract-selection' // eslint-disable-line @@ -9,6 +9,7 @@ import { baseURLBin, baseURLWasm, pathToURL } from '@remix-project/remix-solidit import * as packageJson from '../../../../../package.json' import './css/style.css' import { iSolJsonBinData, iSolJsonBinDataBuild } from '@remix-project/remix-lib' +import { appPlatformTypes, platformContext } from '@remix-ui/app' export const SolidityCompiler = (props: SolidityCompilerProps) => { const { @@ -47,6 +48,7 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => { const [compileErrors, setCompileErrors] = useState>({ [currentFile]: api.compileErrors }) const [badgeStatus, setBadgeStatus] = useState>({}) const [contractsFile, setContractsFile] = useState({}) + const platform = useContext(platformContext) useEffect(() => { ; (async () => { @@ -77,9 +79,12 @@ export const SolidityCompiler = (props: SolidityCompilerProps) => { } api.onSetWorkspace = async (isLocalhost: boolean, workspaceName: string) => { - const isHardhat = isLocalhost && (await compileTabLogic.isHardhatProject()) - const isTruffle = isLocalhost && (await compileTabLogic.isTruffleProject()) - const isFoundry = isLocalhost && (await compileTabLogic.isFoundryProject()) + const isDesktop = platform === appPlatformTypes.desktop + console.log('onSetWorkspace', workspaceName, isLocalhost, isDesktop, workspaceName) + const isHardhat = (isLocalhost || isDesktop) && (await compileTabLogic.isHardhatProject()) + const isTruffle = (isLocalhost || isDesktop) && (await compileTabLogic.isTruffleProject()) + const isFoundry = (isLocalhost || isDesktop) && (await compileTabLogic.isFoundryProject()) + console.log(isFoundry, isHardhat, isTruffle) setState((prevState) => { return { ...prevState, From 6269a30e83ba0361541dfcd29398fdc10b50ab4f Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Wed, 3 Jul 2024 15:38:22 +0200 Subject: [PATCH 04/19] fix or open folders --- .../remixdesktop/src/plugins/foundryPlugin.ts | 1 + apps/remixdesktop/src/plugins/fsPlugin.ts | 28 +++++++++++++------ .../test/tests/app/hardhat.test.ts | 0 3 files changed, 20 insertions(+), 9 deletions(-) create mode 100644 apps/remixdesktop/test/tests/app/hardhat.test.ts diff --git a/apps/remixdesktop/src/plugins/foundryPlugin.ts b/apps/remixdesktop/src/plugins/foundryPlugin.ts index 1eacb81cab..140b826739 100644 --- a/apps/remixdesktop/src/plugins/foundryPlugin.ts +++ b/apps/remixdesktop/src/plugins/foundryPlugin.ts @@ -158,6 +158,7 @@ class FoundryPluginClient extends ElectronBasePluginRemixdClient { 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()) + this.watcher.on('unlink', async () => await this.triggerProcessArtifact()) // process the artifact on activation this.triggerProcessArtifact() } catch (e) { diff --git a/apps/remixdesktop/src/plugins/fsPlugin.ts b/apps/remixdesktop/src/plugins/fsPlugin.ts index d01235de66..65210e9da5 100644 --- a/apps/remixdesktop/src/plugins/fsPlugin.ts +++ b/apps/remixdesktop/src/plugins/fsPlugin.ts @@ -32,6 +32,15 @@ const getBaseName = (pathName: string): string => { return path.basename(pathName) } +function onlyUnique(value: recentFolder, index: number, self: recentFolder[]) { + console.log(index, value) + return self.findIndex((rc, index) => rc.path === value.path) === index +} + +const deplucateFolderList = (list: recentFolder[]): recentFolder[] => { + return list.filter(onlyUnique) +} + export class FSPlugin extends ElectronBasePlugin { clients: FSPluginClient[] = [] constructor() { @@ -40,28 +49,28 @@ export class FSPlugin extends ElectronBasePlugin { } async onActivation(): Promise { - const config = await this.call('electronconfig' as any, 'readConfig') + const config = await this.call('electronconfig', 'readConfig') const openedFolders = (config && config.openedFolders) || [] - const recentFolders = (config && config.recentFolders) || [] + const recentFolders: recentFolder[] = (config && config.recentFolders) || [] this.call('electronconfig', 'writeConfig', {...config, - recentFolders: recentFolders, + recentFolders: deplucateFolderList(recentFolders), openedFolders: openedFolders}) const foldersToDelete: string[] = [] - if (openedFolders && openedFolders.length) { - for (const folder of openedFolders) { + if (recentFolders && recentFolders.length) { + for (const folder of recentFolders) { try { - const stat = await fs.stat(folder) + const stat = await fs.stat(folder.path); if (stat.isDirectory()) { // do nothing } } catch (e) { console.log('error opening folder', folder, e) - foldersToDelete.push(folder) + foldersToDelete.push(folder.path) } } if (foldersToDelete.length) { - const newFolders = openedFolders.filter((f: string) => !foldersToDelete.includes(f)) - this.call('electronconfig', 'writeConfig', {recentFolders: newFolders}) + const newFolders = recentFolders.filter((f: recentFolder) => !foldersToDelete.includes(f.path)) + this.call('electronconfig', 'writeConfig', {recentFolders: deplucateFolderList(newFolders)}) } } createWindow() @@ -346,6 +355,7 @@ class FSPluginClient extends ElectronBasePluginClient { path, timestamp, }) + config.recentFolders = deplucateFolderList(config.recentFolders) writeConfig(config) } diff --git a/apps/remixdesktop/test/tests/app/hardhat.test.ts b/apps/remixdesktop/test/tests/app/hardhat.test.ts new file mode 100644 index 0000000000..e69de29bb2 From 41e72b6dcf9ed65b0df543265bbfccc771c69054 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Fri, 5 Jul 2024 19:34:39 +0200 Subject: [PATCH 05/19] hardhat test --- apps/remixdesktop/src/engine.ts | 13 ++++ apps/remixdesktop/src/plugins/fsPlugin.ts | 7 ++ apps/remixdesktop/src/preload.ts | 3 +- .../test/tests/app/hardhat.test.ts | 73 +++++++++++++++++++ 4 files changed, 95 insertions(+), 1 deletion(-) diff --git a/apps/remixdesktop/src/engine.ts b/apps/remixdesktop/src/engine.ts index 9a8fd78aad..534cdf850c 100644 --- a/apps/remixdesktop/src/engine.ts +++ b/apps/remixdesktop/src/engine.ts @@ -13,6 +13,7 @@ import { SlitherPlugin } from './plugins/slitherPlugin'; import { AppUpdaterPlugin } from './plugins/appUpdater'; import { FoundryPlugin } from './plugins/foundryPlugin'; import { HardhatPlugin } from './plugins/hardhatPlugin'; +import { isE2E } from './main'; const engine = new Engine() const appManager = new PluginManager() @@ -52,6 +53,18 @@ ipcMain.on('fs:openFolder', async (event, path?) => { fsPlugin.openFolder(event, path) }) +ipcMain.handle('fs:openFolder', async (event, webContentsId, path?) => { + if(!isE2E) return + console.log('openFolder', webContentsId, path) + fsPlugin.openFolder(webContentsId, path) +}) + +ipcMain.handle('fs:openFolderInSameWindow', async (event, webContentsId, path?) => { + if(!isE2E) return + console.log('openFolderInSameWindow', webContentsId, path) + fsPlugin.openFolderInSameWindow(webContentsId, path) +}) + ipcMain.on('terminal:new', async (event) => { xtermPlugin.new(event) diff --git a/apps/remixdesktop/src/plugins/fsPlugin.ts b/apps/remixdesktop/src/plugins/fsPlugin.ts index 65210e9da5..0f45727066 100644 --- a/apps/remixdesktop/src/plugins/fsPlugin.ts +++ b/apps/remixdesktop/src/plugins/fsPlugin.ts @@ -94,6 +94,13 @@ export class FSPlugin extends ElectronBasePlugin { client.openFolder(path) } } + + openFolderInSameWindow(webContentsId: any, path?: string): void { + const client = this.clients.find((c) => c.webContentsId === webContentsId) + if (client) { + client.openFolderInSameWindow(path) + } + } } const clientProfile: Profile = { diff --git a/apps/remixdesktop/src/preload.ts b/apps/remixdesktop/src/preload.ts index 9f757541c1..356e262347 100644 --- a/apps/remixdesktop/src/preload.ts +++ b/apps/remixdesktop/src/preload.ts @@ -19,7 +19,8 @@ contextBridge.exposeInMainWorld('electronAPI', { isE2E: () => ipcRenderer.invoke('config:isE2E'), canTrackMatomo: () => ipcRenderer.invoke('config:canTrackMatomo'), trackEvent: (args: any[]) => ipcRenderer.invoke('matomo:trackEvent', args), - + openFolder: (path: string) => ipcRenderer.invoke('fs:openFolder', webContentsId, path), + openFolderInSameWindow: (path: string) => ipcRenderer.invoke('fs:openFolderInSameWindow', webContentsId, path), activatePlugin: (name: string) => { return ipcRenderer.invoke('manager:activatePlugin', name) }, diff --git a/apps/remixdesktop/test/tests/app/hardhat.test.ts b/apps/remixdesktop/test/tests/app/hardhat.test.ts index e69de29bb2..492d95700b 100644 --- a/apps/remixdesktop/test/tests/app/hardhat.test.ts +++ b/apps/remixdesktop/test/tests/app/hardhat.test.ts @@ -0,0 +1,73 @@ +import { NightwatchBrowser } from 'nightwatch' +import { ChildProcess, spawn, execSync } from 'child_process' +import { homedir } from 'os' +import path from 'path' +import os from 'os' + +const dir = path.join('remix-desktop-test-' + Date.now().toString()) + +const tests = { + before: function (browser: NightwatchBrowser, done: VoidFunction) { + done() + }, + setuphardhat: function (browser: NightwatchBrowser) { + browser.perform(async (done) => { + await setupHardhatProject() + done() + }) + }, + addScript: function (browser: NightwatchBrowser) { + // run script in console + browser.executeAsync(function (dir, done) { + (window as any).electronAPI.openFolderInSameWindow('/tmp/' + dir).then(done) + }, [dir], () => { + console.log('done window opened') + }) + .waitForElementVisible('*[data-id="treeViewDivDraggableItemhardhat.config.js"]', 10000) + }, + compile: function (browser: NightwatchBrowser) { + browser.perform(async (done) => { + console.log('generating compilation result') + await compileHardhatProject() + done() + }) + .expect.element('*[data-id="terminalJournal"]').text.to.contain('receiving compilation result from Hardhat').before(60000) + } +} + +async function compileHardhatProject(): Promise { + console.log(process.cwd()) + try { + const server = spawn('npx hardhat compile', [], { cwd: '/tmp/' + dir, shell: true, detached: true }) + return new Promise((resolve, reject) => { + server.on('exit', function (exitCode) { + console.log("Child exited with code: " + exitCode); + console.log('end') + resolve() + }) + }) + } catch (e) { + console.log(e) + } +} + +async function setupHardhatProject(): Promise { + console.log('setup hardhat project', dir) + try { + const server = spawn(`git clone https://github.com/NomicFoundation/hardhat-boilerplate ${dir} && cd ${dir} && yarn install && yarn add "@typechain/ethers-v5@^10.1.0" && yarn add "@typechain/hardhat@^6.1.2" && yarn add "typechain@^8.1.0" && echo "END"`, [], { cwd: '/tmp/', shell: true, detached: true }) + return new Promise((resolve, reject) => { + server.on('exit', function (exitCode) { + console.log("Child exited with code: " + exitCode); + console.log('end') + resolve() + }) + }) + } catch (e) { + console.log(e) + } +} + + +module.exports = { + ...tests +} \ No newline at end of file From 345b0023b6667fd8d028f6843550a124f80e8d32 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 6 Jul 2024 07:48:41 +0200 Subject: [PATCH 06/19] foundry test --- .../test/tests/app/foundry.test.ts | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) create mode 100644 apps/remixdesktop/test/tests/app/foundry.test.ts diff --git a/apps/remixdesktop/test/tests/app/foundry.test.ts b/apps/remixdesktop/test/tests/app/foundry.test.ts new file mode 100644 index 0000000000..49004ccd50 --- /dev/null +++ b/apps/remixdesktop/test/tests/app/foundry.test.ts @@ -0,0 +1,132 @@ +import { NightwatchBrowser } from 'nightwatch' +import { ChildProcess, spawn, execSync } from 'child_process' +import { homedir } from 'os' +import path from 'path' +import os from 'os' + +const projectDir = path.join('remix-desktop-test-' + Date.now().toString()) +const dir = '/tmp/' + projectDir + +const tests = { + before: function (browser: NightwatchBrowser, done: VoidFunction) { + done() + }, + installFoundry: function (browser: NightwatchBrowser) { + browser.perform(async (done) => { + await downloadFoundry() + await installFoundry() + await initFoundryProject() + done() + }) + }, + addScript: function (browser: NightwatchBrowser) { + // run script in console + browser.executeAsync(function (dir, done) { + (window as any).electronAPI.openFolderInSameWindow(dir).then(done) + }, [dir], () => { + console.log('done window opened') + }) + .waitForElementVisible('*[data-id="treeViewDivDraggableItemhardhat.config.js"]', 10000) + }, + compile: function (browser: NightwatchBrowser) { + browser.perform(async (done) => { + console.log('generating compilation result') + await buildFoundryProject() + done() + }) + .expect.element('*[data-id="terminalJournal"]').text.to.contain('receiving compilation result from Foundry').before(60000) + } +} +async function downloadFoundry(): Promise { + console.log('downloadFoundry', process.cwd()) + try { + const server = spawn('curl -L https://foundry.paradigm.xyz | bash', [], { cwd: process.cwd(), shell: true, detached: true }) + return new Promise((resolve, reject) => { + server.stdout.on('data', function (data) { + console.log(data.toString()) + if ( + data.toString().includes("simply run 'foundryup' to install Foundry") + || data.toString().includes("foundryup: could not detect shell, manually add") + ) { + console.log('resolving') + resolve() + } + }) + server.stderr.on('err', function (data) { + console.log(data.toString()) + reject(data.toString()) + }) + }) + } catch (e) { + console.log(e) + } + } + + async function installFoundry(): Promise { + console.log('installFoundry', process.cwd()) + try { + const server = spawn('export PATH="' + homedir() + '/.foundry/bin:$PATH" && foundryup', [], { cwd: process.cwd(), shell: true, detached: true }) + return new Promise((resolve, reject) => { + server.stdout.on('data', function (data) { + console.log(data.toString()) + if ( + data.toString().includes("foundryup: done!") + ) { + console.log('resolving') + resolve() + } + }) + server.stderr.on('err', function (data) { + console.log(data.toString()) + reject(data.toString()) + }) + }) + } catch (e) { + console.log(e) + } + } + + async function initFoundryProject(): Promise { + console.log('initFoundryProject', homedir()) + try { + if(process.env.CIRCLECI) { + spawn('git config --global user.email \"you@example.com\"', [], { cwd: homedir(), shell: true, detached: true }) + spawn('git config --global user.name \"Your Name\"', [], { cwd: homedir(), shell: true, detached: true }) + } + spawn('mkdir ' + projectDir, [], { cwd: '/tmp/', shell: true, detached: true }) + const server = spawn('export PATH="' + homedir() + '/.foundry/bin:$PATH" && forge init hello_foundry', [], { cwd: dir, shell: true, detached: true }) + server.stdout.pipe(process.stdout) + return new Promise((resolve, reject) => { + server.on('exit', function (exitCode) { + console.log("Child exited with code: " + exitCode); + console.log('end') + resolve() + }) + }) + } catch (e) { + console.log(e) + } + } + + async function buildFoundryProject(): Promise { + console.log('buildFoundryProject', homedir()) + try { + const server = spawn('export PATH="' + homedir() + '/.foundry/bin:$PATH" && forge build', [], { cwd: dir + '/hello_foundry', shell: true, detached: true }) + server.stdout.pipe(process.stdout) + return new Promise((resolve, reject) => { + server.on('exit', function (exitCode) { + console.log("Child exited with code: " + exitCode); + console.log('end') + resolve() + }) + }) + } catch (e) { + console.log(e) + } + } + + + +module.exports = { + ...tests +} \ No newline at end of file From aa567cacddd5533344e83e19a9474408fabbbf8d Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 6 Jul 2024 08:01:55 +0200 Subject: [PATCH 07/19] foundry test --- .../test/tests/app/foundry.test.ts | 71 ++++++++++++------- 1 file changed, 45 insertions(+), 26 deletions(-) diff --git a/apps/remixdesktop/test/tests/app/foundry.test.ts b/apps/remixdesktop/test/tests/app/foundry.test.ts index 49004ccd50..ad4285375d 100644 --- a/apps/remixdesktop/test/tests/app/foundry.test.ts +++ b/apps/remixdesktop/test/tests/app/foundry.test.ts @@ -13,10 +13,10 @@ const tests = { }, installFoundry: function (browser: NightwatchBrowser) { browser.perform(async (done) => { - await downloadFoundry() - await installFoundry() - await initFoundryProject() - done() + await downloadFoundry() + await installFoundry() + await initFoundryProject() + done() }) }, addScript: function (browser: NightwatchBrowser) { @@ -26,7 +26,7 @@ const tests = { }, [dir], () => { console.log('done window opened') }) - .waitForElementVisible('*[data-id="treeViewDivDraggableItemhardhat.config.js"]', 10000) + .waitForElementVisible('*[data-id="treeViewDivDraggableItemfoundry.toml"]', 10000) }, compile: function (browser: NightwatchBrowser) { browser.perform(async (done) => { @@ -34,7 +34,26 @@ const tests = { await buildFoundryProject() done() }) - .expect.element('*[data-id="terminalJournal"]').text.to.contain('receiving compilation result from Foundry').before(60000) + .expect.element('*[data-id="terminalJournal"]').text.to.contain('receiving compilation result from Foundry').before(60000) + + let contractAaddress + browser.clickLaunchIcon('filePanel') + .openFile('src') + .openFile('src/Counter.sol') + .clickLaunchIcon('udapp') + .selectContract('Counter') + .createContract('') + .getAddressAtPosition(0, (address) => { + console.log(contractAaddress) + contractAaddress = address + }) + .clickInstance(0) + .clickFunction('increment - transact (not payable)') + .perform((done) => { + browser.testConstantFunction(contractAaddress, 'number - call', null, '0:\nuint256: 1').perform(() => { + done() + }) + }) } } async function downloadFoundry(): Promise { @@ -60,9 +79,9 @@ async function downloadFoundry(): Promise { } catch (e) { console.log(e) } - } - - async function installFoundry(): Promise { +} + +async function installFoundry(): Promise { console.log('installFoundry', process.cwd()) try { const server = spawn('export PATH="' + homedir() + '/.foundry/bin:$PATH" && foundryup', [], { cwd: process.cwd(), shell: true, detached: true }) @@ -84,12 +103,12 @@ async function downloadFoundry(): Promise { } catch (e) { console.log(e) } - } - - async function initFoundryProject(): Promise { +} + +async function initFoundryProject(): Promise { console.log('initFoundryProject', homedir()) - try { - if(process.env.CIRCLECI) { + try { + if (process.env.CIRCLECI) { spawn('git config --global user.email \"you@example.com\"', [], { cwd: homedir(), shell: true, detached: true }) spawn('git config --global user.name \"Your Name\"', [], { cwd: homedir(), shell: true, detached: true }) } @@ -98,35 +117,35 @@ async function downloadFoundry(): Promise { server.stdout.pipe(process.stdout) return new Promise((resolve, reject) => { server.on('exit', function (exitCode) { - console.log("Child exited with code: " + exitCode); - console.log('end') - resolve() + console.log("Child exited with code: " + exitCode); + console.log('end') + resolve() }) }) } catch (e) { console.log(e) } - } - - async function buildFoundryProject(): Promise { +} + +async function buildFoundryProject(): Promise { console.log('buildFoundryProject', homedir()) try { const server = spawn('export PATH="' + homedir() + '/.foundry/bin:$PATH" && forge build', [], { cwd: dir + '/hello_foundry', shell: true, detached: true }) server.stdout.pipe(process.stdout) return new Promise((resolve, reject) => { server.on('exit', function (exitCode) { - console.log("Child exited with code: " + exitCode); - console.log('end') - resolve() + console.log("Child exited with code: " + exitCode); + console.log('end') + resolve() }) }) } catch (e) { console.log(e) } - } - +} + module.exports = { - ...tests + ...process.platform.startsWith('linux') ? tests : {} } \ No newline at end of file From 50f442fd4353633f05fea736eea79a8424e56ed4 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 6 Jul 2024 08:04:11 +0200 Subject: [PATCH 08/19] HH test --- .../test/tests/app/hardhat.test.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/apps/remixdesktop/test/tests/app/hardhat.test.ts b/apps/remixdesktop/test/tests/app/hardhat.test.ts index 492d95700b..f8c093102e 100644 --- a/apps/remixdesktop/test/tests/app/hardhat.test.ts +++ b/apps/remixdesktop/test/tests/app/hardhat.test.ts @@ -31,7 +31,24 @@ const tests = { await compileHardhatProject() done() }) - .expect.element('*[data-id="terminalJournal"]').text.to.contain('receiving compilation result from Hardhat').before(60000) + .expect.element('*[data-id="terminalJournal"]').text.to.contain('receiving compilation result from Hardhat').before(60000) + let addressRef + browser.clickLaunchIcon('filePanel') + .openFile('contracts') + .openFile('contracts/Token.sol') + .clickLaunchIcon('udapp') + .selectAccount('0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c') + .selectContract('Token') + .createContract('') + .clickInstance(0) + .clickFunction('balanceOf - call', { types: 'address account', values: '0xCA35b7d915458EF540aDe6068dFe2F44E8fa733c' }) + .getAddressAtPosition(0, (address) => { + addressRef = address + }) + .perform((done) => { + browser.verifyCallReturnValue(addressRef, ['0:uint256: 1000000']) + .perform(() => done()) + }) } } From a9b47604658d780e4ee64d8ebd2dbf586cc0acbd Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 6 Jul 2024 08:21:45 +0200 Subject: [PATCH 09/19] foundry test --- apps/remixdesktop/test/tests/app/foundry.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remixdesktop/test/tests/app/foundry.test.ts b/apps/remixdesktop/test/tests/app/foundry.test.ts index ad4285375d..c218592428 100644 --- a/apps/remixdesktop/test/tests/app/foundry.test.ts +++ b/apps/remixdesktop/test/tests/app/foundry.test.ts @@ -22,7 +22,7 @@ const tests = { addScript: function (browser: NightwatchBrowser) { // run script in console browser.executeAsync(function (dir, done) { - (window as any).electronAPI.openFolderInSameWindow(dir).then(done) + (window as any).electronAPI.openFolderInSameWindow(dir + '/hello_foundry/').then(done) }, [dir], () => { console.log('done window opened') }) From 9d40e5df3b7f6eddfb9efe15d5d59986e40e7194 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sat, 6 Jul 2024 17:51:57 +0200 Subject: [PATCH 10/19] 1.0.6 --- apps/remixdesktop/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remixdesktop/package.json b/apps/remixdesktop/package.json index d77096be3e..bd93a58c06 100644 --- a/apps/remixdesktop/package.json +++ b/apps/remixdesktop/package.json @@ -1,6 +1,6 @@ { "name": "remixdesktop", - "version": "1.0.5-insiders", + "version": "1.0.6-insiders", "main": "build/main.js", "license": "MIT", "type": "commonjs", From 97f649e1b2fdf07a7f416e75f263b40fa70c21e8 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sun, 7 Jul 2024 10:14:20 +0200 Subject: [PATCH 11/19] fix listener --- apps/remixdesktop/src/plugins/foundryPlugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remixdesktop/src/plugins/foundryPlugin.ts b/apps/remixdesktop/src/plugins/foundryPlugin.ts index 140b826739..71a24c58b8 100644 --- a/apps/remixdesktop/src/plugins/foundryPlugin.ts +++ b/apps/remixdesktop/src/plugins/foundryPlugin.ts @@ -41,13 +41,13 @@ class FoundryPluginClient extends ElectronBasePluginRemixdClient { async onActivation(): Promise { console.log('Foundry plugin activated') this.call('terminal', 'log', { type: 'log', value: 'Foundry plugin activated' }) - this.startListening() this.on('fs' as any, 'workingDirChanged', async (path: string) => { console.log('workingDirChanged foundry', path) this.currentSharedFolder = path this.startListening() }) this.currentSharedFolder = await this.call('fs' as any, 'getWorkingDir') + if(this.currentSharedFolder) this.startListening() } startListening() { From 4bc3f9069ed17023377339e4436962abaaf7b5e8 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sun, 7 Jul 2024 10:14:25 +0200 Subject: [PATCH 12/19] fix listener --- apps/remixdesktop/src/plugins/hardhatPlugin.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/remixdesktop/src/plugins/hardhatPlugin.ts b/apps/remixdesktop/src/plugins/hardhatPlugin.ts index 2fae8844db..ffef08e1c7 100644 --- a/apps/remixdesktop/src/plugins/hardhatPlugin.ts +++ b/apps/remixdesktop/src/plugins/hardhatPlugin.ts @@ -40,13 +40,14 @@ class HardhatPluginClient extends ElectronBasePluginRemixdClient { async onActivation(): Promise { console.log('Hardhat plugin activated') this.call('terminal', 'log', { type: 'log', value: 'Hardhat plugin activated' }) - this.startListening() + this.on('fs' as any, 'workingDirChanged', async (path: string) => { console.log('workingDirChanged hardhat', path) this.currentSharedFolder = path this.startListening() }) this.currentSharedFolder = await this.call('fs' as any, 'getWorkingDir') + if(this.currentSharedFolder) this.startListening() } startListening() { From 34101cc1343fe17cb7910a65075cb876c84e6924 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sun, 7 Jul 2024 10:52:45 +0200 Subject: [PATCH 13/19] log foundry test --- apps/remixdesktop/test/tests/app/foundry.test.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/remixdesktop/test/tests/app/foundry.test.ts b/apps/remixdesktop/test/tests/app/foundry.test.ts index c218592428..c525d900ff 100644 --- a/apps/remixdesktop/test/tests/app/foundry.test.ts +++ b/apps/remixdesktop/test/tests/app/foundry.test.ts @@ -121,6 +121,12 @@ async function initFoundryProject(): Promise { console.log('end') resolve() }) + server.stderr.on('err', function (data) { + console.log('err', data.toString()) + }) + server.stdout.on('data', function (data) { + console.log('data', data.toString()) + }) }) } catch (e) { console.log(e) From 734c6562111b08815567fcfe7f1264a86e0be963 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Sun, 7 Jul 2024 11:08:41 +0200 Subject: [PATCH 14/19] 1.0.7 --- apps/remixdesktop/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remixdesktop/package.json b/apps/remixdesktop/package.json index bd93a58c06..c6411f2dcd 100644 --- a/apps/remixdesktop/package.json +++ b/apps/remixdesktop/package.json @@ -1,6 +1,6 @@ { "name": "remixdesktop", - "version": "1.0.6-insiders", + "version": "1.0.7-insiders", "main": "build/main.js", "license": "MIT", "type": "commonjs", From 6cefd134e7c187b6cb61c1d1569aee1ade145746 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Tue, 9 Jul 2024 07:33:03 +0200 Subject: [PATCH 15/19] webpack --- apps/remixdesktop/package.json | 11 +++++--- apps/remixdesktop/tsconfig.json | 6 +---- apps/remixdesktop/webpack.config.js | 40 +++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 8 deletions(-) create mode 100644 apps/remixdesktop/webpack.config.js diff --git a/apps/remixdesktop/package.json b/apps/remixdesktop/package.json index c6411f2dcd..b0d27d7714 100644 --- a/apps/remixdesktop/package.json +++ b/apps/remixdesktop/package.json @@ -22,9 +22,9 @@ "category": "public.app-category.productivity" }, "scripts": { - "start:dev": "tsc && cp -R node_modules/yarn build/tools/ && cross-env NODE_ENV=development electron --inspect=5858 .", - "start:production": "tsc && && cp -R node_modules/yarn build/tools/ && cross-env NODE_ENV=production electron .", - "dist": "tsc && cp -R node_modules/yarn build/tools/ && electron-builder -p never", + "start:dev": "yarn webpack --config webpack.config.js && electron --inspect=5858 .", + "start:production": "cross-env NODE_ENV=production yarn webpack --config webpack.config.js && electron .", + "dist": "cross-env NODE_ENV=production yarn webpack --config webpack.config.js && electron-builder -p never", "installRipGrepMacOXx64": "rm -rf node_modules/@vscode/ripgrep/bin && npm_config_arch=x64 node node_modules/@vscode/ripgrep/lib/postinstall.js", "installRipGrepMacOXarm64": "rm -rf node_modules/@vscode/ripgrep/bin && npm_config_arch=arm64 node node_modules/@vscode/ripgrep/lib/postinstall.js", "postinstall": "electron-builder install-app-deps", @@ -46,7 +46,12 @@ "electron-devtools-installer": "^3.2.0", "nightwatch": "2.3", "selenium-standalone": "^9.3.1", + "ts-loader": "^9.5.1", + "tsconfig-paths-webpack-plugin": "^4.1.0", "typescript": "^5.1.3", + "webpack": "^5.92.1", + "webpack-merge": "^6.0.1", + "webpack-node-externals": "^3.0.0", "yarn": "^1.22.21" }, "dependencies": { diff --git a/apps/remixdesktop/tsconfig.json b/apps/remixdesktop/tsconfig.json index ac23558de2..78334312b5 100644 --- a/apps/remixdesktop/tsconfig.json +++ b/apps/remixdesktop/tsconfig.json @@ -1,9 +1,8 @@ { "compilerOptions": { - "jsx": "react-jsx", "target": "ES6", "allowJs": true, - "module": "commonjs", + "module": "ES6", "skipLibCheck": true, "esModuleInterop": true, "noImplicitAny": false, @@ -12,9 +11,6 @@ "outDir": "build", "moduleResolution": "node", "resolveJsonModule": true, - "paths": { - "*": ["node_modules/*"] - }, "typeRoots": ["src/**/*.d.ts", "node_modules/@types", "test/**/*.d.ts", "../remix-ide-e2e/src/**/*.d.ts"] }, "include": ["src/**/*"] diff --git a/apps/remixdesktop/webpack.config.js b/apps/remixdesktop/webpack.config.js new file mode 100644 index 0000000000..4b2c1a5bf8 --- /dev/null +++ b/apps/remixdesktop/webpack.config.js @@ -0,0 +1,40 @@ +const path = require('path'); +const nodeExternals = require('webpack-node-externals'); +const TsconfigPathsPlugin = require('tsconfig-paths-webpack-plugin'); +const mode = process.env.NODE_ENV || 'development'; +const webpack = require('webpack'); +module.exports = { + mode, + entry: { + main: './src/main.ts', + preload: './src/preload.ts', + }, + target: 'electron-main', + externals: [nodeExternals()], + module: { + rules: [ + { + test: /\.ts$/, + include: /src/, + use: [{ loader: 'ts-loader' }] + } + ] + }, + resolve: { + extensions: ['.ts', '.js'], + plugins: [new TsconfigPathsPlugin({ configFile: './tsconfig.json' })] + }, + plugins: [ + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || mode) + }) + ], + output: { + path: path.resolve(__dirname, 'build'), + filename: '[name].js' + }, + node: { + __dirname: false, + __filename: false + } +} From 10030335adffc3e18d6943cb9693cb7d7a8e5530 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Tue, 9 Jul 2024 07:33:11 +0200 Subject: [PATCH 16/19] lock --- apps/remixdesktop/yarn.lock | 551 +++++++++++++++++++++++++++++++++++- 1 file changed, 543 insertions(+), 8 deletions(-) diff --git a/apps/remixdesktop/yarn.lock b/apps/remixdesktop/yarn.lock index d39ddaa9dc..2a01180e97 100644 --- a/apps/remixdesktop/yarn.lock +++ b/apps/remixdesktop/yarn.lock @@ -491,6 +491,46 @@ wrap-ansi "^8.1.0" wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.5" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.5.tgz#dcce6aff74bdf6dad1a95802b69b04a2fcb1fb36" + integrity sha512-IzL8ZoEDIBRWEzlCcRhOaCupYyN5gdIK+Q6fbFdPDg6HqX6jpkItn7DFIpW9LQzXG6Df9sA7+OKnq0qlz/GaQg== + dependencies: + "@jridgewell/set-array" "^1.2.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.24" + +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== + +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== + +"@jridgewell/source-map@^0.3.3": + version "0.3.6" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.6.tgz#9d71ca886e32502eb9362c9a74a46787c36df81a" + integrity sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ== + dependencies: + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" + +"@jridgewell/sourcemap-codec@^1.4.10", "@jridgewell/sourcemap-codec@^1.4.14": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@^0.3.20", "@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== + dependencies: + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" + "@malept/cross-spawn-promise@^1.1.0": version "1.1.1" resolved "https://registry.npmjs.org/@malept/cross-spawn-promise/-/cross-spawn-promise-1.1.1.tgz" @@ -740,6 +780,27 @@ dependencies: "@types/ms" "*" +"@types/eslint-scope@^3.7.3": + version "3.7.7" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" + integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== + dependencies: + "@types/eslint" "*" + "@types/estree" "*" + +"@types/eslint@*": + version "8.56.10" + resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-8.56.10.tgz#eb2370a73bf04a901eeba8f22595c7ee0f7eb58d" + integrity sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ== + dependencies: + "@types/estree" "*" + "@types/json-schema" "*" + +"@types/estree@*", "@types/estree@^1.0.5": + version "1.0.5" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" + integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== + "@types/express-serve-static-core@^4.17.33": version "4.17.41" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz#5077defa630c2e8d28aa9ffc2c01c157c305bef6" @@ -777,6 +838,11 @@ resolved "https://registry.yarnpkg.com/@types/http-errors/-/http-errors-2.0.4.tgz#7eb47726c391b7345a6ec35ad7f4de469cf5ba4f" integrity sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA== +"@types/json-schema@*", "@types/json-schema@^7.0.8": + version "7.0.15" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" + integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== + "@types/keyv@^3.1.4": version "3.1.4" resolved "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz" @@ -918,11 +984,142 @@ https-proxy-agent "^7.0.2" proxy-from-env "^1.1.0" +"@webassemblyjs/ast@1.12.1", "@webassemblyjs/ast@^1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.12.1.tgz#bb16a0e8b1914f979f45864c23819cc3e3f0d4bb" + integrity sha512-EKfMUOPRRUTy5UII4qJDGPpqfwjOmZ5jeGFwid9mnoqIFK+e0vqoi1qH56JpmZSzEL53jKnNzScdmftJyG5xWg== + dependencies: + "@webassemblyjs/helper-numbers" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + +"@webassemblyjs/floating-point-hex-parser@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.6.tgz#dacbcb95aff135c8260f77fa3b4c5fea600a6431" + integrity sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw== + +"@webassemblyjs/helper-api-error@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.6.tgz#6132f68c4acd59dcd141c44b18cbebbd9f2fa768" + integrity sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q== + +"@webassemblyjs/helper-buffer@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.12.1.tgz#6df20d272ea5439bf20ab3492b7fb70e9bfcb3f6" + integrity sha512-nzJwQw99DNDKr9BVCOZcLuJJUlqkJh+kVzVl6Fmq/tI5ZtEyWT1KZMyOXltXLZJmDtvLCDgwsyrkohEtopTXCw== + +"@webassemblyjs/helper-numbers@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.6.tgz#cbce5e7e0c1bd32cf4905ae444ef64cea919f1b5" + integrity sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g== + dependencies: + "@webassemblyjs/floating-point-hex-parser" "1.11.6" + "@webassemblyjs/helper-api-error" "1.11.6" + "@xtuc/long" "4.2.2" + +"@webassemblyjs/helper-wasm-bytecode@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.6.tgz#bb2ebdb3b83aa26d9baad4c46d4315283acd51e9" + integrity sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA== + +"@webassemblyjs/helper-wasm-section@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.12.1.tgz#3da623233ae1a60409b509a52ade9bc22a37f7bf" + integrity sha512-Jif4vfB6FJlUlSbgEMHUyk1j234GTNG9dBJ4XJdOySoj518Xj0oGsNi59cUQF4RRMS9ouBUxDDdyBVfPTypa5g== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-buffer" "1.12.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/wasm-gen" "1.12.1" + +"@webassemblyjs/ieee754@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.6.tgz#bb665c91d0b14fffceb0e38298c329af043c6e3a" + integrity sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg== + dependencies: + "@xtuc/ieee754" "^1.2.0" + +"@webassemblyjs/leb128@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.6.tgz#70e60e5e82f9ac81118bc25381a0b283893240d7" + integrity sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ== + dependencies: + "@xtuc/long" "4.2.2" + +"@webassemblyjs/utf8@1.11.6": + version "1.11.6" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.6.tgz#90f8bc34c561595fe156603be7253cdbcd0fab5a" + integrity sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA== + +"@webassemblyjs/wasm-edit@^1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.12.1.tgz#9f9f3ff52a14c980939be0ef9d5df9ebc678ae3b" + integrity sha512-1DuwbVvADvS5mGnXbE+c9NfA8QRcZ6iKquqjjmR10k6o+zzsRVesil54DKexiowcFCPdr/Q0qaMgB01+SQ1u6g== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-buffer" "1.12.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/helper-wasm-section" "1.12.1" + "@webassemblyjs/wasm-gen" "1.12.1" + "@webassemblyjs/wasm-opt" "1.12.1" + "@webassemblyjs/wasm-parser" "1.12.1" + "@webassemblyjs/wast-printer" "1.12.1" + +"@webassemblyjs/wasm-gen@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.12.1.tgz#a6520601da1b5700448273666a71ad0a45d78547" + integrity sha512-TDq4Ojh9fcohAw6OIMXqiIcTq5KUXTGRkVxbSo1hQnSy6lAM5GSdfwWeSxpAo0YzgsgF182E/U0mDNhuA0tW7w== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + +"@webassemblyjs/wasm-opt@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.12.1.tgz#9e6e81475dfcfb62dab574ac2dda38226c232bc5" + integrity sha512-Jg99j/2gG2iaz3hijw857AVYekZe2SAskcqlWIZXjji5WStnOpVoat3gQfT/Q5tb2djnCjBtMocY/Su1GfxPBg== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-buffer" "1.12.1" + "@webassemblyjs/wasm-gen" "1.12.1" + "@webassemblyjs/wasm-parser" "1.12.1" + +"@webassemblyjs/wasm-parser@1.12.1", "@webassemblyjs/wasm-parser@^1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.12.1.tgz#c47acb90e6f083391e3fa61d113650eea1e95937" + integrity sha512-xikIi7c2FHXysxXe3COrVUPSheuBtpcfhbpFj4gmu7KRLYOzANztwUU0IbsqvMqzuNK2+glRGWCEqZo1WCLyAQ== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@webassemblyjs/helper-api-error" "1.11.6" + "@webassemblyjs/helper-wasm-bytecode" "1.11.6" + "@webassemblyjs/ieee754" "1.11.6" + "@webassemblyjs/leb128" "1.11.6" + "@webassemblyjs/utf8" "1.11.6" + +"@webassemblyjs/wast-printer@1.12.1": + version "1.12.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.12.1.tgz#bcecf661d7d1abdaf989d8341a4833e33e2b31ac" + integrity sha512-+X4WAlOisVWQMikjbcvY2e0rwPsKQ9F688lksZhBcPycBBuii3O7m8FACbDMWDojpAqvjIncrG8J0XHKyQfVeA== + dependencies: + "@webassemblyjs/ast" "1.12.1" + "@xtuc/long" "4.2.2" + "@xmldom/xmldom@^0.8.8": version "0.8.10" resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.10.tgz#a1337ca426aa61cef9fe15b5b28e340a72f6fa99" integrity sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw== +"@xtuc/ieee754@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@xtuc/ieee754/-/ieee754-1.2.0.tgz#eef014a3145ae477a1cbc00cd1e552336dceb790" + integrity sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA== + +"@xtuc/long@4.2.2": + version "4.2.2" + resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" + integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== + abortcontroller-polyfill@^1.7.5: version "1.7.5" resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.7.5.tgz#6738495f4e901fbb57b6c0611d0c75f76c485bed" @@ -936,6 +1133,16 @@ accepts@~1.3.8: mime-types "~2.1.34" negotiator "0.6.3" +acorn-import-attributes@^1.9.5: + version "1.9.5" + resolved "https://registry.yarnpkg.com/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef" + integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ== + +acorn@^8.7.1, acorn@^8.8.2: + version "8.12.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.12.1.tgz#71616bdccbe25e27a54439e0046e89ca76df2248" + integrity sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg== + add@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/add/-/add-2.0.6.tgz#248f0a9f6e5a528ef2295dbeec30532130ae2235" @@ -968,12 +1175,12 @@ aggregate-error@^3.1.0: clean-stack "^2.0.0" indent-string "^4.0.0" -ajv-keywords@^3.4.1: +ajv-keywords@^3.4.1, ajv-keywords@^3.5.2: version "3.5.2" resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv@^6.10.0, ajv@^6.12.0, ajv@^6.12.3: +ajv@^6.10.0, ajv@^6.12.0, ajv@^6.12.3, ajv@^6.12.5: version "6.12.6" resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1352,6 +1559,13 @@ brace-expansion@^2.0.1: dependencies: balanced-match "^1.0.0" +braces@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + braces@~3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz" @@ -1381,6 +1595,16 @@ browserify-aes@^1.2.0: inherits "^2.0.1" safe-buffer "^5.0.1" +browserslist@^4.21.10: + version "4.23.1" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.1.tgz#ce4af0534b3d37db5c1a4ca98b9080f985041e96" + integrity sha512-TUfofFo/KsK/bWZ9TWQ5O26tsWW4Uhmt8IYklbnUa70udB6P2wA7w7o4PY4muaEPBQaAX+CEnmmIA41NVHtPVw== + dependencies: + caniuse-lite "^1.0.30001629" + electron-to-chromium "^1.4.796" + node-releases "^2.0.14" + update-browserslist-db "^1.0.16" + bs58@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/bs58/-/bs58-4.0.1.tgz#be161e76c354f6f788ae4071f63f34e8c4f0a42a" @@ -1525,6 +1749,11 @@ camelcase@^6.0.0, camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== +caniuse-lite@^1.0.30001629: + version "1.0.30001640" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001640.tgz#32c467d4bf1f1a0faa63fc793c2ba81169e7652f" + integrity sha512-lA4VMpW0PSUrFnkmVuEKBUovSWKhj7puyCg8StBChgu298N1AtuF1sKWEvfDuimSEDbhlb/KqPKC3fs1HbuQUA== + caseless@~0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" @@ -1580,6 +1809,11 @@ chownr@^2.0.0: resolved "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz" integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== +chrome-trace-event@^1.0.2: + version "1.0.4" + resolved "https://registry.yarnpkg.com/chrome-trace-event/-/chrome-trace-event-1.0.4.tgz#05bffd7ff928465093314708c93bdfa9bd1f0f5b" + integrity sha512-rNjApaLzuwaOTjCiT8lSDdGN1APCiqkChLMJxJPWLunPAt5fy8xgU9/jNOchV84wfIxrA0lRQB7oCT8jrn/wrQ== + chromedriver@116: version "116.0.0" resolved "https://registry.yarnpkg.com/chromedriver/-/chromedriver-116.0.0.tgz#3f5d07b5427953270461791651d7b68cb6afe9fe" @@ -1685,6 +1919,15 @@ cliui@^8.0.1: strip-ansi "^6.0.1" wrap-ansi "^7.0.0" +clone-deep@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" + integrity sha512-neHB9xuzh/wk0dIHweyAXv2aPGZIVk3pLMe+/RNzINf17fe0OG96QroktYAUm7SM1PBnzTabaLboqqxDyMU+SQ== + dependencies: + is-plain-object "^2.0.4" + kind-of "^6.0.2" + shallow-clone "^3.0.0" + clone-response@^1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz" @@ -1716,6 +1959,11 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + commander@^5.0.0, commander@^5.1.0: version "5.1.0" resolved "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz" @@ -2184,6 +2432,11 @@ electron-publish@24.8.1: lazy-val "^1.0.5" mime "^2.5.2" +electron-to-chromium@^1.4.796: + version "1.4.819" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.819.tgz#b1bf73d71748a44c3b719cfe7b351d75268c9044" + integrity sha512-8RwI6gKUokbHWcN3iRij/qpvf/wCbIVY5slODi85werwqUQwpFXM+dvUBND93Qh7SB0pW3Hlq3/wZsqQ3M9Jaw== + electron-updater@^6.1.8: version "6.1.8" resolved "https://registry.yarnpkg.com/electron-updater/-/electron-updater-6.1.8.tgz#17637bca165322f4e526b13c99165f43e6f697d8" @@ -2242,6 +2495,14 @@ end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" +enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.0, enhanced-resolve@^5.7.0: + version "5.17.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.17.0.tgz#d037603789dd9555b89aaec7eb78845c49089bc5" + integrity sha512-dwDPwZL0dmye8Txp2gzFmA6sxALaSvdRDjPH0viLcKrtlOL3tw62nWWweVD1SdILDTJrbrL6tdWVN58Wo6U3eA== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + entities@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" @@ -2334,6 +2595,11 @@ es-get-iterator@^1.1.3: isarray "^2.0.5" stop-iteration-iterator "^1.0.0" +es-module-lexer@^1.2.1: + version "1.5.4" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.5.4.tgz#a8efec3a3da991e60efa6b633a7cad6ab8d26b78" + integrity sha512-MVNK56NiMrOwitFB7cqDwq0CQutbw+0BvLshJSse0MUNU+y1FC3bUS/AQg7oUng+/wKrrki7JfmwtVHkVfPLlw== + es-set-tostringtag@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/es-set-tostringtag/-/es-set-tostringtag-2.0.2.tgz#11f7cc9f63376930a5f20be4915834f4bc74f9c9" @@ -2401,6 +2667,11 @@ escalade@^3.1.1: resolved "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escalade@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.2.tgz#54076e9ab29ea5bf3d8f1ed62acffbb88272df27" + integrity sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA== + escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -2411,6 +2682,14 @@ escape-string-regexp@4.0.0, escape-string-regexp@^4.0.0: resolved "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +eslint-scope@5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + esniff@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/esniff/-/esniff-2.0.1.tgz#a4d4b43a5c71c7ec51c51098c1d8a29081f9b308" @@ -2421,6 +2700,23 @@ esniff@^2.0.1: event-emitter "^0.3.5" type "^2.7.2" +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + etag@~1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" @@ -2566,6 +2862,11 @@ events@3.2.0: resolved "https://registry.npmjs.org/events/-/events-3.2.0.tgz" integrity sha512-/46HWwbfCX2xTawVfkKLGxMifJYQBWMwY1mjywRtb4c9x8l5NP3KoJtnIOiL1hfdRkIuYhETxQlo62IF8tcnlg== +events@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" + integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== + evp_bytestokey@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02" @@ -2711,6 +3012,13 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + finalhandler@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" @@ -2997,6 +3305,11 @@ glob-parent@~5.1.2: dependencies: is-glob "^4.0.1" +glob-to-regexp@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" + integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== + glob@7.2.0: version "7.2.0" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" @@ -3102,7 +3415,7 @@ got@^11.8.5, got@^11.8.6: p-cancelable "^2.0.0" responselike "^2.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0: +graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -3523,6 +3836,13 @@ is-plain-obj@^2.1.0: resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287" integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA== +is-plain-object@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677" + integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og== + dependencies: + isobject "^3.0.1" + is-port-reachable@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/is-port-reachable/-/is-port-reachable-3.1.0.tgz#f6668d3bca9c36b07f737c48a8f875ab0653cd2b" @@ -3650,6 +3970,11 @@ isexe@^2.0.0: resolved "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz" integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== +isobject@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" + integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== + isomorphic-git@^1.24.2: version "1.24.2" resolved "https://registry.npmjs.org/isomorphic-git/-/isomorphic-git-1.24.2.tgz" @@ -3691,6 +4016,15 @@ jake@^10.8.5: filelist "^1.0.4" minimatch "^3.1.2" +jest-worker@^27.4.5: + version "27.5.1" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-27.5.1.tgz#8d146f0900e8973b106b6f73cc1e9a8cb86f8db0" + integrity sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + js-sha3@0.8.0, js-sha3@^0.8.0: version "0.8.0" resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" @@ -3718,6 +4052,11 @@ json-buffer@3.0.1: resolved "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz" integrity sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ== +json-parse-even-better-errors@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz" @@ -3733,7 +4072,7 @@ json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: resolved "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" integrity sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA== -json5@^2.2.0: +json5@^2.2.0, json5@^2.2.2: version "2.2.3" resolved "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz" integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== @@ -3790,6 +4129,11 @@ keyv@^4.0.0: dependencies: json-buffer "3.0.1" +kind-of@^6.0.2: + version "6.0.3" + resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" + integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== + lazy-val@^1.0.4, lazy-val@^1.0.5: version "1.0.5" resolved "https://registry.npmjs.org/lazy-val/-/lazy-val-1.0.5.tgz" @@ -3802,6 +4146,11 @@ lie@~3.3.0: dependencies: immediate "~3.0.5" +loader-runner@^4.2.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" + integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== + locate-path@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" @@ -4019,12 +4368,20 @@ micro-ftch@^0.3.1: resolved "https://registry.yarnpkg.com/micro-ftch/-/micro-ftch-0.3.1.tgz#6cb83388de4c1f279a034fb0cf96dfc050853c5f" integrity sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg== +micromatch@^4.0.0: + version "4.0.7" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.7.tgz#33e8190d9fe474a9895525f5618eee136d46c2e5" + integrity sha512-LPP/3KorzCwBxfeUuZmaR6bG2kdeHSbe0P2tY3FLRU4vYrjYz5hI4QZwV0njUx3jeuKe67YukQ1LSPZBKDqO/Q== + dependencies: + braces "^3.0.3" + picomatch "^2.3.1" + mime-db@1.52.0: version "1.52.0" resolved "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@^2.1.16, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: +mime-types@^2.1.12, mime-types@^2.1.16, mime-types@^2.1.27, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -4302,6 +4659,11 @@ negotiator@0.6.3: resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== +neo-async@^2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" + integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== + next-tick@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" @@ -4377,6 +4739,11 @@ node-pty@^0.10.1: dependencies: nan "^2.14.0" +node-releases@^2.0.14: + version "2.0.14" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.14.tgz#2ffb053bceb8b2be8495ece1ab6ce600c4461b0b" + integrity sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw== + normalize-path@^3.0.0, normalize-path@~3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz" @@ -4590,7 +4957,12 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow== -picomatch@^2.0.4, picomatch@^2.2.1: +picocolors@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.1.tgz#a8ad579b571952f0e5d25892de5445bcfe25aaa1" + integrity sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew== + +picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== @@ -4956,6 +5328,15 @@ sax@^1.2.4: resolved "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz" integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw== +schema-utils@^3.1.1, schema-utils@^3.2.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.3.0.tgz#f50a88877c3c01652a15b622ae9e9795df7a60fe" + integrity sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg== + dependencies: + "@types/json-schema" "^7.0.8" + ajv "^6.12.5" + ajv-keywords "^3.5.2" + scrypt-js@3.0.1, scrypt-js@^3.0.0, scrypt-js@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/scrypt-js/-/scrypt-js-3.0.1.tgz#d314a57c2aef69d1ad98a138a21fe9eafa9ee312" @@ -5034,6 +5415,11 @@ semver@^7.3.2: dependencies: lru-cache "^6.0.0" +semver@^7.3.4: + version "7.6.2" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" + integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== + send@0.18.0: version "0.18.0" resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" @@ -5067,6 +5453,13 @@ serialize-javascript@6.0.0: dependencies: randombytes "^2.1.0" +serialize-javascript@^6.0.1: + version "6.0.2" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== + dependencies: + randombytes "^2.1.0" + serve-static@1.15.0: version "1.15.0" resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" @@ -5137,6 +5530,13 @@ sha.js@^2.4.0, sha.js@^2.4.8, sha.js@^2.4.9: inherits "^2.0.1" safe-buffer "^5.0.1" +shallow-clone@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" + integrity sha512-/6KqX+GVUdqPuPPd2LxDDxzX6CAbjJehAAOKlNpqqUpAqPM6HeL8f+o3a+JsyGjn2lv0WY8UsTgUJjU9Ok55NA== + dependencies: + kind-of "^6.0.2" + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz" @@ -5212,7 +5612,7 @@ smart-buffer@^4.0.2: resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== -source-map-support@^0.5.19: +source-map-support@^0.5.19, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== @@ -5225,6 +5625,11 @@ source-map@^0.6.0: resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +source-map@^0.7.4: + version "0.7.4" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.7.4.tgz#a9bbe705c9d8846f4e08ff6765acf0f1b0898656" + integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== + sprintf-js@^1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.2.tgz" @@ -5371,6 +5776,11 @@ strip-ansi@^7.0.1: dependencies: ansi-regex "^6.0.1" +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== + strip-final-newline@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" @@ -5395,7 +5805,7 @@ sumchecker@^3.0.1: dependencies: debug "^4.1.0" -supports-color@8.1.1: +supports-color@8.1.1, supports-color@^8.0.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== @@ -5426,6 +5836,11 @@ swarm-js@^0.1.40: tar "^4.0.2" xhr-request "^1.0.1" +tapable@^2.1.1, tapable@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0" + integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ== + tar-stream@3.1.6: version "3.1.6" resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-3.1.6.tgz#6520607b55a06f4a2e2e04db360ba7d338cc5bab" @@ -5495,6 +5910,27 @@ temp-file@^3.4.0: async-exit-hook "^2.0.1" fs-extra "^10.0.0" +terser-webpack-plugin@^5.3.10: + version "5.3.10" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.10.tgz#904f4c9193c6fd2a03f693a2150c62a92f40d199" + integrity sha512-BKFPWlPDndPs+NGGCr1U59t0XScL5317Y0UReNrHaw9/FwhPENlq6bfgs+4yPfyP51vqC1bQ4rp1EfXW5ZSH9w== + dependencies: + "@jridgewell/trace-mapping" "^0.3.20" + jest-worker "^27.4.5" + schema-utils "^3.1.1" + serialize-javascript "^6.0.1" + terser "^5.26.0" + +terser@^5.26.0: + version "5.31.1" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.31.1.tgz#735de3c987dd671e95190e6b98cfe2f07f3cf0d4" + integrity sha512-37upzU1+viGvuFtBo9NPufCb9dwM0+l9hMxYyWfBA+fbwrPqNJAhbZ6W47bBFnZHKHTUBnMvi87434qq+qnxOg== + dependencies: + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" + commander "^2.20.0" + source-map-support "~0.5.20" + timed-out@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/timed-out/-/timed-out-4.0.1.tgz#f32eacac5a175bea25d7fab565ab3ed8741ef56f" @@ -5551,6 +5987,35 @@ truncate-utf8-bytes@^1.0.0: dependencies: utf8-byte-length "^1.0.1" +ts-loader@^9.5.1: + version "9.5.1" + resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.5.1.tgz#63d5912a86312f1fbe32cef0859fb8b2193d9b89" + integrity sha512-rNH3sK9kGZcH9dYzC7CewQm4NtxJTjSEVRJ2DyBZR7f8/wcta+iV44UPCXc5+nzDzivKtlzV6c9P4e+oFhDLYg== + dependencies: + chalk "^4.1.0" + enhanced-resolve "^5.0.0" + micromatch "^4.0.0" + semver "^7.3.4" + source-map "^0.7.4" + +tsconfig-paths-webpack-plugin@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths-webpack-plugin/-/tsconfig-paths-webpack-plugin-4.1.0.tgz#3c6892c5e7319c146eee1e7302ed9e6f2be4f763" + integrity sha512-xWFISjviPydmtmgeUAuXp4N1fky+VCtfhOkDUFIv5ea7p4wuTomI4QTrXvFBX2S4jZsmyTSrStQl+E+4w+RzxA== + dependencies: + chalk "^4.1.0" + enhanced-resolve "^5.7.0" + tsconfig-paths "^4.1.2" + +tsconfig-paths@^4.1.2: + version "4.2.0" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz#ef78e19039133446d244beac0fd6a1632e2d107c" + integrity sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg== + dependencies: + json5 "^2.2.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + tslib@2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz" @@ -5706,6 +6171,14 @@ unzip-crx-3@^0.2.0: mkdirp "^0.5.1" yaku "^0.16.6" +update-browserslist-db@^1.0.16: + version "1.1.0" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.0.tgz#7ca61c0d8650766090728046e416a8cde682859e" + integrity sha512-EdRAaAyk2cUE1wOf2DkEhzxqOQvFOoRJFNS6NeyJ01Gp2beMRpBAINjM2iDXE3KCuKhwnvHIQCJm6ThL2Z+HzQ== + dependencies: + escalade "^3.1.2" + picocolors "^1.0.1" + uri-js@^4.2.2: version "4.4.1" resolved "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz" @@ -5812,6 +6285,14 @@ verror@^1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +watchpack@^2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.1.tgz#29308f2cac150fa8e4c92f90e0ec954a9fed7fff" + integrity sha512-8wrBCMtVhqcXP2Sup1ctSkga6uc2Bx0IIvKyT7yTFier5AXHooSI+QyQQAtTb7+E0IUCCKyTFmXqdqgum2XWGg== + dependencies: + glob-to-regexp "^0.4.1" + graceful-fs "^4.1.2" + wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" @@ -6054,6 +6535,55 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== +webpack-merge@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-6.0.1.tgz#50c776868e080574725abc5869bd6e4ef0a16c6a" + integrity sha512-hXXvrjtx2PLYx4qruKl+kyRSLc52V+cCvMxRjmKwoA+CBbbF5GfIBtR6kCvl0fYGqTUPKB+1ktVmTHqMOzgCBg== + dependencies: + clone-deep "^4.0.1" + flat "^5.0.2" + wildcard "^2.0.1" + +webpack-node-externals@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/webpack-node-externals/-/webpack-node-externals-3.0.0.tgz#1a3407c158d547a9feb4229a9e3385b7b60c9917" + integrity sha512-LnL6Z3GGDPht/AigwRh2dvL9PQPFQ8skEpVrWZXLWBYmqcaojHNN0onvHzie6rq7EWKrrBfPYqNEzTJgiwEQDQ== + +webpack-sources@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" + integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== + +webpack@^5.92.1: + version "5.92.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.92.1.tgz#eca5c1725b9e189cffbd86e8b6c3c7400efc5788" + integrity sha512-JECQ7IwJb+7fgUFBlrJzbyu3GEuNBcdqr1LD7IbSzwkSmIevTm8PF+wej3Oxuz/JFBUZ6O1o43zsPkwm1C4TmA== + dependencies: + "@types/eslint-scope" "^3.7.3" + "@types/estree" "^1.0.5" + "@webassemblyjs/ast" "^1.12.1" + "@webassemblyjs/wasm-edit" "^1.12.1" + "@webassemblyjs/wasm-parser" "^1.12.1" + acorn "^8.7.1" + acorn-import-attributes "^1.9.5" + browserslist "^4.21.10" + chrome-trace-event "^1.0.2" + enhanced-resolve "^5.17.0" + es-module-lexer "^1.2.1" + eslint-scope "5.1.1" + events "^3.2.0" + glob-to-regexp "^0.4.1" + graceful-fs "^4.2.11" + json-parse-even-better-errors "^2.3.1" + loader-runner "^4.2.0" + mime-types "^2.1.27" + neo-async "^2.6.2" + schema-utils "^3.2.0" + tapable "^2.1.1" + terser-webpack-plugin "^5.3.10" + watchpack "^2.4.1" + webpack-sources "^3.2.3" + websocket@^1.0.32: version "1.0.34" resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.34.tgz#2bdc2602c08bf2c82253b730655c0ef7dcab3111" @@ -6120,6 +6650,11 @@ widest-line@^3.1.0: dependencies: string-width "^4.0.0" +wildcard@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67" + integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ== + workerpool@6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.0.tgz#827d93c9ba23ee2019c3ffaff5c27fccea289e8b" From 28c0718d9345e35a0ed7053508c9c49b2efdcbd1 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Tue, 9 Jul 2024 07:43:42 +0200 Subject: [PATCH 17/19] webpack-cli --- apps/remixdesktop/package.json | 1 + apps/remixdesktop/yarn.lock | 176 ++++++++++++++++++++++++++++++++- 2 files changed, 176 insertions(+), 1 deletion(-) diff --git a/apps/remixdesktop/package.json b/apps/remixdesktop/package.json index b0d27d7714..3aa8a9121c 100644 --- a/apps/remixdesktop/package.json +++ b/apps/remixdesktop/package.json @@ -50,6 +50,7 @@ "tsconfig-paths-webpack-plugin": "^4.1.0", "typescript": "^5.1.3", "webpack": "^5.92.1", + "webpack-cli": "^5.1.4", "webpack-merge": "^6.0.1", "webpack-node-externals": "^3.0.0", "yarn": "^1.22.21" diff --git a/apps/remixdesktop/yarn.lock b/apps/remixdesktop/yarn.lock index 2a01180e97..808b40dbb9 100644 --- a/apps/remixdesktop/yarn.lock +++ b/apps/remixdesktop/yarn.lock @@ -22,6 +22,11 @@ ajv "^6.12.0" ajv-keywords "^3.4.1" +"@discoveryjs/json-ext@^0.5.0": + version "0.5.7" + resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" + integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== + "@electron/asar@^3.2.1": version "3.2.8" resolved "https://registry.yarnpkg.com/@electron/asar/-/asar-3.2.8.tgz#2ea722f3452583dbd4ffdcc4b4f5dc903f1d8178" @@ -1105,6 +1110,21 @@ "@webassemblyjs/ast" "1.12.1" "@xtuc/long" "4.2.2" +"@webpack-cli/configtest@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@webpack-cli/configtest/-/configtest-2.1.1.tgz#3b2f852e91dac6e3b85fb2a314fb8bef46d94646" + integrity sha512-wy0mglZpDSiSS0XHrVR+BAdId2+yxPSoJW8fsna3ZpYSlufjvxnP4YbKTCBZnNIcGN4r6ZPXV55X4mYExOfLmw== + +"@webpack-cli/info@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@webpack-cli/info/-/info-2.0.2.tgz#cc3fbf22efeb88ff62310cf885c5b09f44ae0fdd" + integrity sha512-zLHQdI/Qs1UyT5UBdWNqsARasIA+AaF8t+4u2aS2nEpBQh2mWIVb8qAklq0eUENnC5mOItrIB4LiS9xMtph18A== + +"@webpack-cli/serve@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@webpack-cli/serve/-/serve-2.0.5.tgz#325db42395cd49fe6c14057f9a900e427df8810e" + integrity sha512-lqaoKnRYBdo1UgDX8uF24AfGMifWK19TxPmM5FHc2vAGxrJ/qtyUyFBWoY1tISZdelsQ5fBcOusifo5o5wSJxQ== + "@xmldom/xmldom@^0.8.8": version "0.8.10" resolved "https://registry.yarnpkg.com/@xmldom/xmldom/-/xmldom-0.8.10.tgz#a1337ca426aa61cef9fe15b5b28e340a72f6fa99" @@ -1952,6 +1972,11 @@ color-name@~1.1.4: resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +colorette@^2.0.14: + version "2.0.20" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.20.tgz#9eb793e6833067f7235902fcd3b09917a000a95a" + integrity sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w== + combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: version "1.0.8" resolved "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz" @@ -1959,6 +1984,11 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" +commander@^10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.1.tgz#881ee46b4f77d1c1dccc5823433aa39b022cbe06" + integrity sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug== + commander@^2.20.0: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" @@ -2518,6 +2548,11 @@ envinfo@7.8.1: resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== +envinfo@^7.7.3: + version "7.13.0" + resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.13.0.tgz#81fbb81e5da35d74e814941aeab7c325a606fb31" + integrity sha512-cvcaMr7KqXVh4nyzGTVqTum+gAiL265x5jUWQIDLq//zOGbW+gSW/C+OWLleY/rs9Qole6AZLMXPbtIFQbqu+Q== + err-code@^2.0.2: version "2.0.3" resolved "https://registry.yarnpkg.com/err-code/-/err-code-2.0.3.tgz#23c2f3b756ffdfc608d30e27c9a941024807e7f9" @@ -2991,6 +3026,11 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +fastest-levenshtein@^1.0.12: + version "1.0.16" + resolved "https://registry.yarnpkg.com/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz#210e61b6ff181de91ea9b3d1b84fdedd47e034e5" + integrity sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg== + fd-slicer@~1.1.0: version "1.1.0" resolved "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz" @@ -3049,6 +3089,14 @@ find-up@5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" +find-up@^4.0.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + fkill@^7.2.1: version "7.2.1" resolved "https://registry.yarnpkg.com/fkill/-/fkill-7.2.1.tgz#7036200cd2edd28a6bc40f0defc1e159d9e24e64" @@ -3510,6 +3558,13 @@ hasown@^2.0.0: dependencies: function-bind "^1.1.2" +hasown@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" + integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== + dependencies: + function-bind "^1.1.2" + he@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f" @@ -3656,6 +3711,14 @@ immediate@~3.0.5: resolved "https://registry.yarnpkg.com/immediate/-/immediate-3.0.6.tgz#9db1dbd0faf8de6fbe0f5dd5e56bb606280de69b" integrity sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ== +import-local@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" + integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== + dependencies: + pkg-dir "^4.2.0" + resolve-cwd "^3.0.0" + indent-string@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-4.0.0.tgz#624f8f4497d619b2d9768531d58f4122854d7251" @@ -3692,6 +3755,11 @@ internal-slot@^1.0.5: hasown "^2.0.0" side-channel "^1.0.4" +interpret@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-3.1.1.tgz#5be0ceed67ca79c6c4bc5cf0d7ee843dcea110c4" + integrity sha512-6xwYfHbajpoF0xLW+iwLkhwgvLoZDfjYfoFNu8ftMoXINzwuymNLd9u/KmwtdT2GbR+/Cz66otEGEVVUHX9QLQ== + ip-regex@^4.1.0: version "4.3.0" resolved "https://registry.yarnpkg.com/ip-regex/-/ip-regex-4.3.0.tgz#687275ab0f57fa76978ff8f4dddc8a23d5990db5" @@ -3758,6 +3826,13 @@ is-ci@^3.0.0: dependencies: ci-info "^3.2.0" +is-core-module@^2.13.0: + version "2.14.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.14.0.tgz#43b8ef9f46a6a08888db67b1ffd4ec9e3dfd59d1" + integrity sha512-a5dFJih5ZLYlRtDc0dZWP7RiKr6xIKzmn/oAYCDvdLThadVgyJwlaoQPmRtMSpz+rk0OGAgIu+TcM9HUF0fk1A== + dependencies: + hasown "^2.0.2" + is-date-object@^1.0.1, is-date-object@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" @@ -4151,6 +4226,13 @@ loader-runner@^4.2.0: resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.0.tgz#c1b4a163b99f614830353b16755e7149ac2314e1" integrity sha512-3R/1M+yS3j5ou80Me59j7F9IMs4PXs3VqRrm0TU3AbKPxlmpoY1TNscJV/oGJXo8qCatFGTfDbY6W6ipGOYXfg== +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + locate-path@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" @@ -4874,6 +4956,13 @@ p-finally@^2.0.0: resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-2.0.1.tgz#bd6fcaa9c559a096b680806f4d657b3f0f240561" integrity sha512-vpm09aKwq6H9phqRQzecoDpD8TmVyGw70qmWlyq5onxY7tqyTTFVvxMykxQSQKILBSFlbXpypIw2T1Ml7+DDtw== +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + p-limit@^3.0.2: version "3.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" @@ -4881,6 +4970,13 @@ p-limit@^3.0.2: dependencies: yocto-queue "^0.1.0" +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + p-locate@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" @@ -4888,6 +4984,11 @@ p-locate@^5.0.0: dependencies: p-limit "^3.0.2" +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + pako@^1.0.10, pako@~1.0.2: version "1.0.11" resolved "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz" @@ -4918,6 +5019,11 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + path-scurry@^1.10.1: version "1.10.1" resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.10.1.tgz#9ba6bf5aa8500fe9fd67df4f0d9483b2b0bfc698" @@ -4979,6 +5085,13 @@ pify@^4.0.1: resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + plist@^3.0.4: version "3.0.6" resolved "https://registry.npmjs.org/plist/-/plist-3.0.6.tgz" @@ -5178,6 +5291,13 @@ readdirp@~3.6.0: dependencies: picomatch "^2.2.1" +rechoir@^0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.8.0.tgz#49f866e0d32146142da3ad8f0eff352b3215ff22" + integrity sha512-/vxpCXddiX8NGfGO/mTafwjq4aFa/71pvamip0++IQk3zG8cbCj0fifNPrjjF1XMXUne91jL9OoxmdykoEtifQ== + dependencies: + resolve "^1.20.0" + regenerator-runtime@^0.14.0: version "0.14.0" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" @@ -5228,6 +5348,27 @@ resolve-alpn@^1.0.0, resolve-alpn@^1.2.0: resolved "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz" integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== +resolve-cwd@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" + integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== + dependencies: + resolve-from "^5.0.0" + +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve@^1.20.0: + version "1.22.8" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.8.tgz#b6c87a9f2aa06dfab52e3d70ac8cde321fa5a48d" + integrity sha512-oKWePCxqpd6FlLvGV1VU0x7bkPmmCNolxzjMf4NczoDnQcIWrAF+cPtZn5i6n+RfD2d9i0tzpKnG6Yk168yIyw== + dependencies: + is-core-module "^2.13.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + responselike@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz" @@ -5819,6 +5960,11 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + swarm-js@^0.1.40: version "0.1.42" resolved "https://registry.yarnpkg.com/swarm-js/-/swarm-js-0.1.42.tgz#497995c62df6696f6e22372f457120e43e727979" @@ -6535,6 +6681,34 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ== +webpack-cli@^5.1.4: + version "5.1.4" + resolved "https://registry.yarnpkg.com/webpack-cli/-/webpack-cli-5.1.4.tgz#c8e046ba7eaae4911d7e71e2b25b776fcc35759b" + integrity sha512-pIDJHIEI9LR0yxHXQ+Qh95k2EvXpWzZ5l+d+jIo+RdSm9MiHfzazIxwwni/p7+x4eJZuvG1AJwgC4TNQ7NRgsg== + dependencies: + "@discoveryjs/json-ext" "^0.5.0" + "@webpack-cli/configtest" "^2.1.1" + "@webpack-cli/info" "^2.0.2" + "@webpack-cli/serve" "^2.0.5" + colorette "^2.0.14" + commander "^10.0.1" + cross-spawn "^7.0.3" + envinfo "^7.7.3" + fastest-levenshtein "^1.0.12" + import-local "^3.0.2" + interpret "^3.1.1" + rechoir "^0.8.0" + webpack-merge "^5.7.3" + +webpack-merge@^5.7.3: + version "5.10.0" + resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-5.10.0.tgz#a3ad5d773241e9c682803abf628d4cd62b8a4177" + integrity sha512-+4zXKdx7UnO+1jaN4l2lHVD+mFvnlZQP/6ljaJVb4SZiwIKeUnrT5l0gkT8z+n4hKpC+jpOv6O9R+gLtag7pSA== + dependencies: + clone-deep "^4.0.1" + flat "^5.0.2" + wildcard "^2.0.0" + webpack-merge@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/webpack-merge/-/webpack-merge-6.0.1.tgz#50c776868e080574725abc5869bd6e4ef0a16c6a" @@ -6650,7 +6824,7 @@ widest-line@^3.1.0: dependencies: string-width "^4.0.0" -wildcard@^2.0.1: +wildcard@^2.0.0, wildcard@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/wildcard/-/wildcard-2.0.1.tgz#5ab10d02487198954836b6349f74fff961e10f67" integrity sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ== From 31f48a12ec837e82d9c9e321a045e1c574437cb1 Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Tue, 9 Jul 2024 07:53:34 +0200 Subject: [PATCH 18/19] tsconfig --- apps/remixdesktop/tsconfig.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/remixdesktop/tsconfig.json b/apps/remixdesktop/tsconfig.json index 78334312b5..332266e816 100644 --- a/apps/remixdesktop/tsconfig.json +++ b/apps/remixdesktop/tsconfig.json @@ -11,6 +11,9 @@ "outDir": "build", "moduleResolution": "node", "resolveJsonModule": true, + "paths": { + "*": ["node_modules/*"] + }, "typeRoots": ["src/**/*.d.ts", "node_modules/@types", "test/**/*.d.ts", "../remix-ide-e2e/src/**/*.d.ts"] }, "include": ["src/**/*"] From 86a4c923669ba360a43f611e8932cdfbe79a58dc Mon Sep 17 00:00:00 2001 From: bunsenstraat Date: Tue, 9 Jul 2024 07:55:49 +0200 Subject: [PATCH 19/19] tsconfig --- apps/remixdesktop/tsconfig.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remixdesktop/tsconfig.json b/apps/remixdesktop/tsconfig.json index 332266e816..81b0e9fc55 100644 --- a/apps/remixdesktop/tsconfig.json +++ b/apps/remixdesktop/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "target": "ES6", "allowJs": true, - "module": "ES6", + "module": "CommonJS", "skipLibCheck": true, "esModuleInterop": true, "noImplicitAny": false,