From feb7e861f6fc88a1e4c1b2f7dbb60fc76cf109e7 Mon Sep 17 00:00:00 2001 From: ioedeveloper Date: Tue, 31 Oct 2023 12:24:35 +0100 Subject: [PATCH] Activate circom plugin after template selected --- apps/remix-ide/src/remixAppManager.js | 6 +++--- libs/remix-ui/workspace/src/lib/actions/workspace.ts | 5 +++++ libs/remix-ui/workspace/src/lib/types/index.ts | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/apps/remix-ide/src/remixAppManager.js b/apps/remix-ide/src/remixAppManager.js index a6e4565ac6..9f4a70e017 100644 --- a/apps/remix-ide/src/remixAppManager.js +++ b/apps/remix-ide/src/remixAppManager.js @@ -74,8 +74,7 @@ const requiredModules = [ 'compilationDetails', 'contractflattener', 'solidity-script', - 'openaigpt', - 'circuit-compiler' + 'openaigpt' ] // dependentModules shouldn't be manually activated (e.g hardhat is activated by remixd) @@ -114,7 +113,8 @@ export function isNative(name) { 'injected-ephemery-testnet-provider', 'injected', 'doc-gen', - 'doc-viewer' + 'doc-viewer', + 'circuit-compiler' ] return nativePlugins.includes(name) || requiredModules.includes(name) } diff --git a/libs/remix-ui/workspace/src/lib/actions/workspace.ts b/libs/remix-ui/workspace/src/lib/actions/workspace.ts index e00840d36c..e425315711 100644 --- a/libs/remix-ui/workspace/src/lib/actions/workspace.ts +++ b/libs/remix-ui/workspace/src/lib/actions/workspace.ts @@ -136,6 +136,11 @@ export const createWorkspace = async (workspaceName: string, workspaceTemplateNa const isActive = await plugin.call('manager', 'isActive', 'dgit') if (!isActive) await plugin.call('manager', 'activatePlugin', 'dgit') } + if (workspaceTemplateName === 'semaphore') { + const isCircomActive = await plugin.call('manager', 'isActive', 'circuit-compiler') + + if (!isCircomActive) await plugin.call('manager', 'activatePlugin', 'circuit-compiler') + } // this call needs to be here after the callback because it calls dGitProvider which also calls this function and that would cause an infinite loop await plugin.setWorkspaces(await getWorkspaces()) }).catch((error) => { diff --git a/libs/remix-ui/workspace/src/lib/types/index.ts b/libs/remix-ui/workspace/src/lib/types/index.ts index 018a1cdb8e..ad91681659 100644 --- a/libs/remix-ui/workspace/src/lib/types/index.ts +++ b/libs/remix-ui/workspace/src/lib/types/index.ts @@ -17,7 +17,7 @@ export interface JSONStandardInput { }; } export type MenuItems = action[] -export type WorkspaceTemplate = 'gist-template' | 'code-template' | 'remixDefault' | 'blank' | 'ozerc20' | 'zeroxErc20' | 'ozerc721' +export type WorkspaceTemplate = 'gist-template' | 'code-template' | 'remixDefault' | 'blank' | 'ozerc20' | 'zeroxErc20' | 'ozerc721' | 'semaphore' export interface WorkspaceProps { plugin: FilePanelType }