|
|
@ -1,6 +1,6 @@ |
|
|
|
/* eslint-disable @typescript-eslint/no-explicit-any */ |
|
|
|
/* eslint-disable @typescript-eslint/no-explicit-any */ |
|
|
|
import { PluginClient } from '@remixproject/plugin' |
|
|
|
import { PluginClient } from '@remixproject/plugin' |
|
|
|
import { CompilationResult, SourceWithTarget } from '@remixproject/plugin-api' |
|
|
|
import { CompilationResult, SourceWithTarget, customAction } from '@remixproject/plugin-api' |
|
|
|
import { createClient } from '@remixproject/plugin-webview' |
|
|
|
import { createClient } from '@remixproject/plugin-webview' |
|
|
|
import EventEmitter from 'events' |
|
|
|
import EventEmitter from 'events' |
|
|
|
import { Config, defaults } from './docgen/config' |
|
|
|
import { Config, defaults } from './docgen/config' |
|
|
@ -21,7 +21,7 @@ export class DocGenClient extends PluginClient { |
|
|
|
constructor() { |
|
|
|
constructor() { |
|
|
|
super() |
|
|
|
super() |
|
|
|
this.eventEmitter = new EventEmitter() |
|
|
|
this.eventEmitter = new EventEmitter() |
|
|
|
this.methods = ['generateDocs', 'openDocs'] |
|
|
|
this.methods = ['generateDocs', 'openDocs', 'generateDocsCustomAction'] |
|
|
|
createClient(this) |
|
|
|
createClient(this) |
|
|
|
this.onload().then(async () => { |
|
|
|
this.onload().then(async () => { |
|
|
|
await this.setListeners() |
|
|
|
await this.setListeners() |
|
|
@ -55,6 +55,11 @@ export class DocGenClient extends PluginClient { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async generateDocsCustomAction(action: customAction) { |
|
|
|
|
|
|
|
console.log({ action }) |
|
|
|
|
|
|
|
// await this.generateDocs()
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async docgen(builds: Build[], userConfig?: Config): Promise<void> { |
|
|
|
async docgen(builds: Build[], userConfig?: Config): Promise<void> { |
|
|
|
const config = { ...defaults, ...userConfig } |
|
|
|
const config = { ...defaults, ...userConfig } |
|
|
|
config.sourcesDir = this.contractPath !== config.sourcesDir ? this.contractPath : config.sourcesDir |
|
|
|
config.sourcesDir = this.contractPath !== config.sourcesDir ? this.contractPath : config.sourcesDir |
|
|
|