@@ -26,21 +26,21 @@ import { WalkthroughService } from './walkthroughService'
2626
2727import { OffsetToLineColumnConverter , CompilerMetadata , CompilerArtefacts , FetchAndCompile , CompilerImports , GistHandler } from '@remix-project/core-plugin'
2828
29- import { Registry } from '@remix-project/remix-lib'
30- import { ConfigPlugin } from './app/plugins/config'
31- import { StoragePlugin } from './app/plugins/storage'
32- import { Layout } from './app/panels/layout'
33- import { NotificationPlugin } from './app/plugins/notification'
34- import { Blockchain } from './blockchain/blockchain'
35- import { MergeVMProvider , LondonVMProvider , BerlinVMProvider , ShanghaiVMProvider , CancunVMProvider } from './app/providers/vm-provider'
36- import { MainnetForkVMProvider } from './app/providers/mainnet-vm-fork-provider'
37- import { SepoliaForkVMProvider } from './app/providers/sepolia-vm-fork-provider'
38- import { GoerliForkVMProvider } from './app/providers/goerli-vm-fork-provider'
39- import { CustomForkVMProvider } from './app/providers/custom-vm-fork-provider'
40- import { HardhatProvider } from './app/providers/hardhat-provider'
41- import { GanacheProvider } from './app/providers/ganache-provider'
42- import { FoundryProvider } from './app/providers/foundry-provider'
43- import { ExternalHttpProvider } from './app/providers/external-http-provider'
29+ import { Registry } from '@remix-project/remix-lib'
30+ import { ConfigPlugin } from './app/plugins/config'
31+ import { StoragePlugin } from './app/plugins/storage'
32+ import { Layout } from './app/panels/layout'
33+ import { NotificationPlugin } from './app/plugins/notification'
34+ import { Blockchain } from './blockchain/blockchain'
35+ import { MergeVMProvider , LondonVMProvider , BerlinVMProvider , ShanghaiVMProvider , CancunVMProvider } from './app/providers/vm-provider'
36+ import { MainnetForkVMProvider } from './app/providers/mainnet-vm-fork-provider'
37+ import { SepoliaForkVMProvider } from './app/providers/sepolia-vm-fork-provider'
38+ import { GoerliForkVMProvider } from './app/providers/goerli-vm-fork-provider'
39+ import { CustomForkVMProvider } from './app/providers/custom-vm-fork-provider'
40+ import { HardhatProvider } from './app/providers/hardhat-provider'
41+ import { GanacheProvider } from './app/providers/ganache-provider'
42+ import { FoundryProvider } from './app/providers/foundry-provider'
43+ import { ExternalHttpProvider } from './app/providers/external-http-provider'
4444import { EnvironmentExplorer } from './app/providers/environment-explorer'
4545import { FileDecorator } from './app/plugins/file-decorator'
4646import { CodeFormat } from './app/plugins/code-format'
@@ -58,7 +58,7 @@ import { xtermPlugin } from './app/plugins/electron/xtermPlugin'
5858import { ripgrepPlugin } from './app/plugins/electron/ripgrepPlugin'
5959import { compilerLoaderPlugin , compilerLoaderPluginDesktop } from './app/plugins/electron/compilerLoaderPlugin'
6060import { appUpdaterPlugin } from './app/plugins/electron/appUpdaterPlugin'
61- import { remixAIDesktopPlugin } from './app/plugins/electron/remixAIDesktopPlugin'
61+ import { remixAIDesktopPlugin } from './app/plugins/electron/remixAIDesktopPlugin'
6262import { RemixAIPlugin } from './app/plugins/remixAIPlugin'
6363import { SlitherHandleDesktop } from './app/plugins/electron/slitherPlugin'
6464import { SlitherHandle } from './app/files/slither-handle'
@@ -72,37 +72,37 @@ import { Matomo } from './app/plugins/matomo'
7272
7373import { TemplatesSelectionPlugin } from './app/plugins/templates-selection/templates-selection-plugin'
7474
75- const isElectron = require ( 'is-electron' )
75+ import isElectron from 'is-electron'
7676
77- const remixLib = require ( '@remix-project/remix-lib' )
77+ import * as remixLib from '@remix-project/remix-lib'
7878
7979import { QueryParams } from '@remix-project/remix-lib'
8080import { SearchPlugin } from './app/tabs/search'
8181import { ScriptRunnerUIPlugin } from './app/tabs/script-runner-ui'
8282import { ElectronProvider } from './app/files/electronProvider'
8383
8484const Storage = remixLib . Storage
85- const RemixDProvider = require ( './app/files/remixDProvider' )
86- const Config = require ( './config' )
85+ import RemixDProvider from './app/files/remixDProvider'
86+ import Config from './config'
8787
88- const FileManager = require ( './app/files/fileManager' )
88+ import FileManager from './app/files/fileManager'
8989import FileProvider from "./app/files/fileProvider"
9090import { appPlatformTypes } from '@remix-ui/app'
9191
92- const DGitProvider = require ( './app/files/dgitProvider' )
93- const WorkspaceFileProvider = require ( './app/files/workspaceFileProvider' )
92+ import DGitProvider from './app/files/dgitProvider'
93+ import WorkspaceFileProvider from './app/files/workspaceFileProvider'
9494
95- const PluginManagerComponent = require ( './app/components/plugin-manager-component' )
95+ import PluginManagerComponent from './app/components/plugin-manager-component'
9696
97- const CompileTab = require ( './app/tabs/compile-tab' )
98- const SettingsTab = require ( './app/tabs/settings-tab' )
99- const AnalysisTab = require ( './app/tabs/analysis-tab' )
100- const { DebuggerTab } = require ( './app/tabs/debugger-tab' )
101- const TestTab = require ( './app/tabs/test-tab' )
102- const FilePanel = require ( './app/panels/file-panel' )
103- const Editor = require ( './app/editor/editor' )
104- const Terminal = require ( './app/panels/terminal' )
105- const { TabProxy } = require ( './app/panels/tab-proxy.js' )
97+ import CompileTab from './app/tabs/compile-tab'
98+ import SettingsTab from './app/tabs/settings-tab'
99+ import AnalysisTab from './app/tabs/analysis-tab'
100+ import DebuggerTab from './app/tabs/debugger-tab'
101+ import TestTab from './app/tabs/test-tab'
102+ import Filepanel from './app/panels/file-panel'
103+ import Editor from './app/editor/editor'
104+ import Terminal from './app/panels/terminal'
105+ import TabProxy from './app/panels/tab-proxy.js'
106106
107107const _paq = ( window . _paq = window . _paq || [ ] )
108108
@@ -115,16 +115,49 @@ export class platformApi {
115115 }
116116}
117117
118+ type Components = {
119+ filesProviders : {
120+ browser ?: any
121+ localhost ?: any
122+ workspace ?: any
123+ electron ?: any
124+ }
125+ }
126+
118127class AppComponent {
128+ appManager : RemixAppManager
129+ queryParams : QueryParams
130+ private _components : Components
131+ panels : any
132+ workspace : any
133+ engine : RemixEngine
134+ matomoConfAlreadySet : any
135+ matomoCurrentSetting : any
136+ showMatomo : boolean
137+ walkthroughService : WalkthroughService
138+ platform : 'desktop' | 'web'
139+ gistHandler : GistHandler
140+ themeModule : ThemeModule
141+ localeModule : LocaleModule
142+ notification : NotificationPlugin
143+ layout : Layout
144+ mainview : any
145+ menuicons : VerticalIcons
146+ sidePanel : SidePanel
147+ hiddenPanel : HiddenPanel
148+ pinnedPanel : PinnedPanel
149+ popupPanel : PopupPanel
150+ statusBar : StatusBar
151+ settings : SettingsTab
119152 constructor ( ) {
120153 const PlatFormAPi = new platformApi ( )
121154 Registry . getInstance ( ) . put ( {
122155 api : PlatFormAPi ,
123156 name : 'platform'
124157 } )
125- this . appManager = new RemixAppManager ( { } )
158+ this . appManager = new RemixAppManager ( )
126159 this . queryParams = new QueryParams ( )
127- this . _components = { }
160+ this . _components = { } as Components
128161 // setup storage
129162 const configStorage = new Storage ( 'config-v0.8:' )
130163
@@ -161,7 +194,6 @@ class AppComponent {
161194 name : 'fileproviders'
162195 } )
163196
164-
165197 }
166198
167199 async run ( ) {
@@ -184,7 +216,7 @@ class AppComponent {
184216 this . matomoConfAlreadySet = Registry . getInstance ( ) . get ( 'config' ) . api . exists ( 'settings/matomo-analytics' )
185217 this . matomoCurrentSetting = Registry . getInstance ( ) . get ( 'config' ) . api . get ( 'settings/matomo-analytics' )
186218
187- let electronTracking = window . electronAPI ? await window . electronAPI . canTrackMatomo ( ) : false
219+ const electronTracking = ( window as any ) . electronAPI ? await ( window as any ) . electronAPI . canTrackMatomo ( ) : false
188220
189221 const lastMatomoCheck = window . localStorage . getItem ( 'matomo-analytics-consent' )
190222 const sixMonthsAgo = new Date ( ) ;
@@ -193,11 +225,11 @@ class AppComponent {
193225 const e2eforceMatomoToShow = window . localStorage . getItem ( 'showMatomo' ) && window . localStorage . getItem ( 'showMatomo' ) === 'true'
194226 const contextShouldShowMatomo = matomoDomains [ window . location . hostname ] || e2eforceMatomoToShow || electronTracking
195227 const shouldRenewConsent = this . matomoCurrentSetting === false && ( ! lastMatomoCheck || new Date ( Number ( lastMatomoCheck ) ) < sixMonthsAgo ) // it is set to false for more than 6 months.
196- this . showMatomo = contextShouldShowMatomo && ( ! this . matomoConfAlreadySet || shouldRenewConsent )
228+ this . showMatomo = contextShouldShowMatomo && ( ! this . matomoConfAlreadySet || shouldRenewConsent )
197229
198230 if ( this . showMatomo && shouldRenewConsent ) {
199231 _paq . push ( [ 'trackEvent' , 'Matomo' , 'refreshMatomoPermissions' ] ) ;
200- }
232+ }
201233
202234 this . walkthroughService = new WalkthroughService ( appManager )
203235
@@ -387,7 +419,7 @@ class AppComponent {
387419 ganacheProvider ,
388420 foundryProvider ,
389421 externalHttpProvider ,
390- environmentExplorer ,
422+ environmentExplorer ,
391423 this . walkthroughService ,
392424 search ,
393425 solidityumlgen ,
@@ -456,10 +488,10 @@ class AppComponent {
456488 this . popupPanel = new PopupPanel ( )
457489
458490 const pluginManagerComponent = new PluginManagerComponent ( appManager , this . engine )
459- const filePanel = new FilePanel ( appManager , contentImport )
491+ const filePanel = new Filepanel ( appManager , contentImport )
460492 this . statusBar = new StatusBar ( filePanel , this . menuicons )
461493 const landingPage = new LandingPage ( appManager , this . menuicons , fileManager , filePanel , contentImport )
462- this . settings = new SettingsTab ( Registry . getInstance ( ) . get ( 'config' ) . api , editor , appManager )
494+ this . settings = new SettingsTab ( Registry . getInstance ( ) . get ( 'config' ) . api , editor ) // , appManager)
463495
464496 this . engine . register ( [ this . menuicons , landingPage , this . hiddenPanel , this . sidePanel , this . statusBar , filePanel , pluginManagerComponent , this . settings , this . pinnedPanel , this . popupPanel ] )
465497
@@ -514,7 +546,7 @@ class AppComponent {
514546
515547 async activate ( ) {
516548 const queryParams = new QueryParams ( )
517- const params = queryParams . get ( )
549+ const params : any = queryParams . get ( )
518550
519551 try {
520552 this . engine . register ( await this . appManager . registeredPlugins ( ) )
@@ -610,10 +642,11 @@ class AppComponent {
610642 }
611643
612644 if ( params . call ) {
613- const callDetails = params . call . split ( '//' )
645+ const callDetails : any = params . call . split ( '//' )
614646 if ( callDetails . length > 1 ) {
615647 this . appManager . call ( 'notification' , 'toast' , `initiating ${ callDetails [ 0 ] } and calling "${ callDetails [ 1 ] } " ...` )
616648 // @todo (remove the timeout when activatePlugin is on 0.3.0)
649+ //@ts -ignore
617650 await this . appManager . call ( ...callDetails ) . catch ( console . error )
618651 }
619652 }
@@ -629,6 +662,7 @@ class AppComponent {
629662
630663 // @todo (remove the timeout when activatePlugin is on 0.3.0)
631664 try {
665+ //@ts -ignore
632666 await this . appManager . call ( ...callDetails )
633667 } catch ( e ) {
634668 console . error ( e )
0 commit comments