Activate circom plugin after template selected

pull/4164/head
ioedeveloper 1 year ago
parent a0dd0b5e89
commit feb7e861f6
  1. 6
      apps/remix-ide/src/remixAppManager.js
  2. 5
      libs/remix-ui/workspace/src/lib/actions/workspace.ts
  3. 2
      libs/remix-ui/workspace/src/lib/types/index.ts

@ -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)
}

@ -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) => {

@ -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
}

Loading…
Cancel
Save