From 5a0a139be03063700056f1134caa31991a751a83 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Thu, 9 Nov 2023 08:45:35 +0100 Subject: [PATCH] mv registry --- apps/remix-ide/src/app.js | 2 +- apps/remix-ide/src/app/files/dgitProvider.ts | 2 +- apps/remix-ide/src/app/files/fileManager.ts | 2 +- apps/remix-ide/src/app/panels/file-panel.js | 2 +- apps/remix-ide/src/app/panels/terminal.js | 2 +- apps/remix-ide/src/app/plugins/config.ts | 2 +- .../app/plugins/parser/services/code-parser-antlr-service.ts | 2 +- .../src/app/plugins/parser/services/code-parser-imports.ts | 2 +- apps/remix-ide/src/app/plugins/remixd-handle.tsx | 2 +- apps/remix-ide/src/app/tabs/analysis-tab.js | 2 +- apps/remix-ide/src/app/tabs/locale-module.js | 2 +- apps/remix-ide/src/app/tabs/settings-tab.tsx | 2 +- apps/remix-ide/src/app/tabs/theme-module.js | 2 +- apps/remix-ide/src/app/udapp/make-udapp.js | 2 +- apps/remix-ide/src/index.tsx | 2 +- apps/remix-ide/src/remixAppManager.js | 2 +- libs/remix-lib/src/index.ts | 1 + .../remix-ide/src/app/state => libs/remix-lib/src}/registry.ts | 2 +- libs/remix-ui/search/src/lib/components/results/SearchHelper.ts | 2 +- libs/remix-ui/static-analyser/src/staticanalyser.d.ts | 2 +- libs/remix-ui/workspace/src/lib/actions/index.ts | 2 +- .../workspace/src/lib/components/workspace-hamburger.tsx | 2 +- 22 files changed, 22 insertions(+), 21 deletions(-) rename {apps/remix-ide/src/app/state => libs/remix-lib/src}/registry.ts (95%) diff --git a/apps/remix-ide/src/app.js b/apps/remix-ide/src/app.js index 01b1b6ff08..149481e68d 100644 --- a/apps/remix-ide/src/app.js +++ b/apps/remix-ide/src/app.js @@ -22,7 +22,7 @@ import {WalkthroughService} from './walkthroughService' import {OffsetToLineColumnConverter, CompilerMetadata, CompilerArtefacts, FetchAndCompile, CompilerImports, GistHandler} from '@remix-project/core-plugin' -import Registry from './app/state/registry' +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' diff --git a/apps/remix-ide/src/app/files/dgitProvider.ts b/apps/remix-ide/src/app/files/dgitProvider.ts index 889aef6c4e..a271c48436 100644 --- a/apps/remix-ide/src/app/files/dgitProvider.ts +++ b/apps/remix-ide/src/app/files/dgitProvider.ts @@ -14,7 +14,7 @@ import JSZip from 'jszip' import path from 'path' import FormData from 'form-data' import axios from 'axios' -import Registry from '../state/registry' +import {Registry} from '@remix-project/remix-lib' const profile = { name: 'dGitProvider', diff --git a/apps/remix-ide/src/app/files/fileManager.ts b/apps/remix-ide/src/app/files/fileManager.ts index 9ddac154d0..cb77a5c856 100644 --- a/apps/remix-ide/src/app/files/fileManager.ts +++ b/apps/remix-ide/src/app/files/fileManager.ts @@ -4,7 +4,7 @@ import { saveAs } from 'file-saver' import JSZip from 'jszip' import { Plugin } from '@remixproject/engine' import * as packageJson from '../../../../../package.json' -import Registry from '../state/registry' +import {Registry} from '@remix-project/remix-lib' import { EventEmitter } from 'events' import { fileChangedToastMsg, recursivePasteToastMsg, storageFullMessage } from '@remix-ui/helper' import helper from '../../lib/helper.js' diff --git a/apps/remix-ide/src/app/panels/file-panel.js b/apps/remix-ide/src/app/panels/file-panel.js index f7f9aa1da2..247a1ed57f 100644 --- a/apps/remix-ide/src/app/panels/file-panel.js +++ b/apps/remix-ide/src/app/panels/file-panel.js @@ -3,7 +3,7 @@ import { ViewPlugin } from '@remixproject/engine-web' import * as packageJson from '../../../../../package.json' import React from 'react' // eslint-disable-line import { FileSystemProvider } from '@remix-ui/workspace' // eslint-disable-line -import Registry from '../state/registry' +import {Registry} from '@remix-project/remix-lib' import { RemixdHandle } from '../plugins/remixd-handle' const { HardhatHandle } = require('../files/hardhat-handle.js') const { FoundryHandle } = require('../files/foundry-handle.js') diff --git a/apps/remix-ide/src/app/panels/terminal.js b/apps/remix-ide/src/app/panels/terminal.js index c786fbef24..5ad90adf00 100644 --- a/apps/remix-ide/src/app/panels/terminal.js +++ b/apps/remix-ide/src/app/panels/terminal.js @@ -3,7 +3,7 @@ import React from 'react' // eslint-disable-line import { RemixUiTerminal } from '@remix-ui/terminal' // eslint-disable-line import { Plugin } from '@remixproject/engine' import * as packageJson from '../../../../../package.json' -import Registry from '../state/registry' +import {Registry} from '@remix-project/remix-lib' import { PluginViewWrapper } from '@remix-ui/helper' import vm from 'vm' const EventManager = require('../../lib/events') diff --git a/apps/remix-ide/src/app/plugins/config.ts b/apps/remix-ide/src/app/plugins/config.ts index b4ff5fe30b..c979fab743 100644 --- a/apps/remix-ide/src/app/plugins/config.ts +++ b/apps/remix-ide/src/app/plugins/config.ts @@ -1,6 +1,6 @@ import { Plugin } from '@remixproject/engine' import { QueryParams } from '@remix-project/remix-lib' -import Registry from '../state/registry' +import {Registry} from '@remix-project/remix-lib' const profile = { name: 'config', diff --git a/apps/remix-ide/src/app/plugins/parser/services/code-parser-antlr-service.ts b/apps/remix-ide/src/app/plugins/parser/services/code-parser-antlr-service.ts index 636614eed9..2da19bdaa6 100644 --- a/apps/remix-ide/src/app/plugins/parser/services/code-parser-antlr-service.ts +++ b/apps/remix-ide/src/app/plugins/parser/services/code-parser-antlr-service.ts @@ -4,7 +4,7 @@ import { AstNode } from "@remix-project/remix-solidity" import { CodeParser } from "../code-parser" import { antlr } from '../types' import { pathToFileURL } from 'url' -import Registry from "../../../state/registry" +import {Registry} from '@remix-project/remix-lib' const SolidityParser = (window as any).SolidityParser = (window as any).SolidityParser || [] diff --git a/apps/remix-ide/src/app/plugins/parser/services/code-parser-imports.ts b/apps/remix-ide/src/app/plugins/parser/services/code-parser-imports.ts index 8d23a608ab..a54fc2a382 100644 --- a/apps/remix-ide/src/app/plugins/parser/services/code-parser-imports.ts +++ b/apps/remix-ide/src/app/plugins/parser/services/code-parser-imports.ts @@ -1,5 +1,5 @@ 'use strict' -import Registry from "../../../state/registry"; +import {Registry} from '@remix-project/remix-lib' import { CodeParser } from "../code-parser"; export type CodeParserImportsData = { diff --git a/apps/remix-ide/src/app/plugins/remixd-handle.tsx b/apps/remix-ide/src/app/plugins/remixd-handle.tsx index dd09d4e5e9..b31e8f6208 100644 --- a/apps/remix-ide/src/app/plugins/remixd-handle.tsx +++ b/apps/remix-ide/src/app/plugins/remixd-handle.tsx @@ -6,7 +6,7 @@ import * as packageJson from '../../../../../package.json' import {version as remixdVersion} from '../../../../../libs/remixd/package.json' import {PluginManager} from '@remixproject/engine' import {AppModal, AlertModal, appPlatformTypes} from '@remix-ui/app' -import Registry from '../state/registry' +import {Registry} from '@remix-project/remix-lib' const LOCALHOST = ' - connect to localhost - ' diff --git a/apps/remix-ide/src/app/tabs/analysis-tab.js b/apps/remix-ide/src/app/tabs/analysis-tab.js index 9a57c16516..77080b1770 100644 --- a/apps/remix-ide/src/app/tabs/analysis-tab.js +++ b/apps/remix-ide/src/app/tabs/analysis-tab.js @@ -3,7 +3,7 @@ import { ViewPlugin } from '@remixproject/engine-web' import { EventEmitter } from 'events' import {RemixUiStaticAnalyser} from '@remix-ui/static-analyser' // eslint-disable-line import * as packageJson from '../../../../../package.json' -import Registry from '../state/registry' +import {Registry} from '@remix-project/remix-lib' import { PluginViewWrapper } from '@remix-ui/helper' var EventManager = require('../../lib/events') diff --git a/apps/remix-ide/src/app/tabs/locale-module.js b/apps/remix-ide/src/app/tabs/locale-module.js index ad9b3c641f..89febee68d 100644 --- a/apps/remix-ide/src/app/tabs/locale-module.js +++ b/apps/remix-ide/src/app/tabs/locale-module.js @@ -2,7 +2,7 @@ import { Plugin } from '@remixproject/engine' import { EventEmitter } from 'events' import { QueryParams } from '@remix-project/remix-lib' import * as packageJson from '../../../../../package.json' -import Registry from '../state/registry' +import {Registry} from '@remix-project/remix-lib' import enJson from './locales/en' import zhJson from './locales/zh' import esJson from './locales/es' diff --git a/apps/remix-ide/src/app/tabs/settings-tab.tsx b/apps/remix-ide/src/app/tabs/settings-tab.tsx index cfc168054a..8eeea2b0fb 100644 --- a/apps/remix-ide/src/app/tabs/settings-tab.tsx +++ b/apps/remix-ide/src/app/tabs/settings-tab.tsx @@ -3,7 +3,7 @@ import React from 'react' // eslint-disable-line import {ViewPlugin} from '@remixproject/engine-web' import * as packageJson from '../../../../../package.json' import {RemixUiSettings} from '@remix-ui/settings' //eslint-disable-line -import Registry from '../state/registry' +import {Registry} from '@remix-project/remix-lib' import {PluginViewWrapper} from '@remix-ui/helper' const profile = { diff --git a/apps/remix-ide/src/app/tabs/theme-module.js b/apps/remix-ide/src/app/tabs/theme-module.js index b748376ec2..96cfef7bcd 100644 --- a/apps/remix-ide/src/app/tabs/theme-module.js +++ b/apps/remix-ide/src/app/tabs/theme-module.js @@ -2,7 +2,7 @@ import { Plugin } from '@remixproject/engine' import { EventEmitter } from 'events' import { QueryParams } from '@remix-project/remix-lib' import * as packageJson from '../../../../../package.json' -import Registry from '../state/registry' +import {Registry} from '@remix-project/remix-lib' const isElectron = require('is-electron') const _paq = window._paq = window._paq || [] diff --git a/apps/remix-ide/src/app/udapp/make-udapp.js b/apps/remix-ide/src/app/udapp/make-udapp.js index f2980e0263..da76944ce9 100644 --- a/apps/remix-ide/src/app/udapp/make-udapp.js +++ b/apps/remix-ide/src/app/udapp/make-udapp.js @@ -1,4 +1,4 @@ -import Registry from '../state/registry' +import {Registry} from '@remix-project/remix-lib' var remixLib = require('@remix-project/remix-lib') var EventsDecoder = remixLib.execution.EventsDecoder diff --git a/apps/remix-ide/src/index.tsx b/apps/remix-ide/src/index.tsx index 94d143eb1e..1733f93ec2 100644 --- a/apps/remix-ide/src/index.tsx +++ b/apps/remix-ide/src/index.tsx @@ -5,7 +5,7 @@ import './index.css' import {ThemeModule} from './app/tabs/theme-module' import {Preload} from './app/components/preload' import Config from './config' -import Registry from './app/state/registry' +import {Registry} from '@remix-project/remix-lib' import {Storage} from '@remix-project/remix-lib' ;(async function () { try { diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index 61178b1207..6dd9e9428a 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -2,7 +2,7 @@ import {PluginManager} from '@remixproject/engine' import {EventEmitter} from 'events' import {QueryParams} from '@remix-project/remix-lib' import {IframePlugin} from '@remixproject/engine-web' -import Registry from './app/state/registry' +import {Registry} from '@remix-project/remix-lib' const _paq = (window._paq = window._paq || []) diff --git a/libs/remix-lib/src/index.ts b/libs/remix-lib/src/index.ts index d3f28e470a..e92b00cab8 100644 --- a/libs/remix-lib/src/index.ts +++ b/libs/remix-lib/src/index.ts @@ -20,6 +20,7 @@ export { ConsoleLogs } from './helpers/hhconsoleSigs' export { ICompilerApi, ConfigurationSettings } from './types/ICompilerApi' export { QueryParams } from './query-params' export { VMexecutionResult } from './execution/txRunnerVM' +export { Registry } from './registry' const helpers = { ui: uiHelper, diff --git a/apps/remix-ide/src/app/state/registry.ts b/libs/remix-lib/src/registry.ts similarity index 95% rename from apps/remix-ide/src/app/state/registry.ts rename to libs/remix-lib/src/registry.ts index 7cf378db29..a43d16b526 100644 --- a/apps/remix-ide/src/app/state/registry.ts +++ b/libs/remix-lib/src/registry.ts @@ -3,7 +3,7 @@ type registryEntry = { name: string } -export default class Registry { +export class Registry { private static instance: Registry; private state: any diff --git a/libs/remix-ui/search/src/lib/components/results/SearchHelper.ts b/libs/remix-ui/search/src/lib/components/results/SearchHelper.ts index 09900607ef..c0355cbfca 100644 --- a/libs/remix-ui/search/src/lib/components/results/SearchHelper.ts +++ b/libs/remix-ui/search/src/lib/components/results/SearchHelper.ts @@ -1,6 +1,6 @@ import { EOL } from 'os' import { SearchResultLineLine } from '../../types' -import Registry from 'apps/remix-ide/src/app/state/registry' +import {Registry} from '@remix-project/remix-lib' export const getDirectory = async (dir: string, plugin: any) => { diff --git a/libs/remix-ui/static-analyser/src/staticanalyser.d.ts b/libs/remix-ui/static-analyser/src/staticanalyser.d.ts index 91ab488009..df314ede72 100644 --- a/libs/remix-ui/static-analyser/src/staticanalyser.d.ts +++ b/libs/remix-ui/static-analyser/src/staticanalyser.d.ts @@ -2,7 +2,7 @@ import { CompilationResult, SourceWithTarget } from '@remixproject/plugin-api' import { ViewPlugin } from '@remixproject/engine-web'; import { EventEmitter } from 'events'; -import Registry from '../state/registry'; +import {Registry} from '@remix-project/remix-lib'; export declare class AnalysisTab extends ViewPlugin { event: EventManager; events: EventEmitter; diff --git a/libs/remix-ui/workspace/src/lib/actions/index.ts b/libs/remix-ui/workspace/src/lib/actions/index.ts index 635e5c371d..4ee4af4c0d 100644 --- a/libs/remix-ui/workspace/src/lib/actions/index.ts +++ b/libs/remix-ui/workspace/src/lib/actions/index.ts @@ -9,7 +9,7 @@ import { QueryParams } from '@remix-project/remix-lib' import { fetchContractFromEtherscan } from '@remix-project/core-plugin' // eslint-disable-line import JSZip from 'jszip' import { Actions, FileTree } from '../types' -import Registry from 'apps/remix-ide/src/app/state/registry' +import {Registry} from '@remix-project/remix-lib' export * from './events' export * from './workspace' diff --git a/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx b/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx index 909dc59d56..65f0bd4062 100644 --- a/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx +++ b/libs/remix-ui/workspace/src/lib/components/workspace-hamburger.tsx @@ -1,4 +1,4 @@ -import { appPlatformTypes } from 'libs/remix-ui/app/src/lib/remix-app/context/context' +import { appPlatformTypes } from '@remix-ui/app' import React from 'react' import {Dropdown} from 'react-bootstrap' import {HamburgerMenuItem, HamburgerSubMenuItem} from './workspace-hamburger-item'