Merge branch 'ethdoc-plugin' of https://github.com/ethereum/remix-project into testethdoc

pull/5370/head
filip mertens 2 years ago
commit 3ec78298e6
  1. 17
      apps/doc-gen/profile.json
  2. 6
      apps/doc-gen/src/app/docgen-client.ts
  3. 32
      apps/doc-gen/webpack.config.js
  4. 16
      apps/doc-viewer/profile.json
  5. 36
      apps/doc-viewer/webpack.config.js

@ -0,0 +1,17 @@
{
"name": "doc-gen",
"displayName": "Docgen - Documentation Generator",
"description": "Generate Solidity documentation (as md)",
"version": "0.1.0",
"events": [],
"methods": ["generateDocs", "openDocs"],
"kind": "none",
"icon": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaGVpZ2h0PSIxMDI0IiB3aWR0aD0iMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOTUwLjE1NCAxOTJINzMuODQ2QzMzLjEyNyAxOTIgMCAyMjUuMTI2OTk5OTk5OTk5OTUgMCAyNjUuODQ2djQ5Mi4zMDhDMCA3OTguODc1IDMzLjEyNyA4MzIgNzMuODQ2IDgzMmg4NzYuMzA4YzQwLjcyMSAwIDczLjg0Ni0zMy4xMjUgNzMuODQ2LTczLjg0NlYyNjUuODQ2QzEwMjQgMjI1LjEyNjk5OTk5OTk5OTk1IDk5MC44NzUgMTkyIDk1MC4xNTQgMTkyek01NzYgNzAzLjg3NUw0NDggNzA0VjUxMmwtOTYgMTIzLjA3N0wyNTYgNTEydjE5MkgxMjhWMzIwaDEyOGw5NiAxMjggOTYtMTI4IDEyOC0wLjEyNVY3MDMuODc1ek03NjcuMDkxIDczNS44NzVMNjA4IDUxMmg5NlYzMjBoMTI4djE5Mmg5Nkw3NjcuMDkxIDczNS44NzV6Ii8+PC9zdmc+",
"location": "sidePanel",
"documentation": "",
"repo": "https://github.com/ethereum/remix-project/",
"maintainedBy": "",
"authorContact": "",
"url": "",
"targets":["remix"]
}

@ -18,7 +18,7 @@ export class DocGenClient extends PluginClient {
constructor() { constructor() {
super() super()
this.eventEmitter = new EventEmitter() this.eventEmitter = new EventEmitter()
this.methods = ['generateDocs', 'opendDocs'] this.methods = ['generateDocs', 'openDocs']
createClient(this) createClient(this)
this.onload().then(async () => { this.onload().then(async () => {
await this.setListeners() await this.setListeners()
@ -65,10 +65,10 @@ export class DocGenClient extends PluginClient {
this.eventEmitter.emit('docsGenerated', docs) this.eventEmitter.emit('docsGenerated', docs)
this.emit('docgen' as any, 'docsGenerated', docs) this.emit('docgen' as any, 'docsGenerated', docs)
this.docs = docs this.docs = docs
await this.opendDocs(docs) await this.openDocs(docs)
} }
async opendDocs(docs: string[]) { async openDocs(docs: string[]) {
await this.call('manager', 'activatePlugin', 'doc-viewer') await this.call('manager', 'activatePlugin', 'doc-viewer')
await this.call('tabs' as any, 'focus', 'doc-viewer') await this.call('tabs' as any, 'focus', 'doc-viewer')
await this.call('doc-viewer' as any, 'viewDocs', docs) await this.call('doc-viewer' as any, 'viewDocs', docs)

@ -11,24 +11,24 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
// add fallback for node modules // add fallback for node modules
config.resolve.fallback = { config.resolve.fallback = {
...config.resolve.fallback, // ...config.resolve.fallback,
"crypto": require.resolve("crypto-browserify"), // "crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"), // "stream": require.resolve("stream-browserify"),
"path": require.resolve("path-browserify"), "path": require.resolve("path-browserify"),
"http": require.resolve("stream-http"), // "http": require.resolve("stream-http"),
"https": require.resolve("https-browserify"), // "https": require.resolve("https-browserify"),
"constants": require.resolve("constants-browserify"), // "constants": require.resolve("constants-browserify"),
"os": false, //require.resolve("os-browserify/browser"), // "os": false, //require.resolve("os-browserify/browser"),
"timers": false, // require.resolve("timers-browserify"), // "timers": false, // require.resolve("timers-browserify"),
"zlib": require.resolve("browserify-zlib"), // "zlib": require.resolve("browserify-zlib"),
"fs": false, "fs": false,
"module": false, // "module": false,
"tls": false, // "tls": false,
"net": false, // "net": false,
"readline": false, // "readline": false,
"child_process": false, // "child_process": false,
"buffer": require.resolve("buffer/"), // "buffer": require.resolve("buffer/"),
"vm": require.resolve('vm-browserify'), // "vm": require.resolve('vm-browserify'),
} }
// add externals // add externals

@ -0,0 +1,16 @@
{
"name": "doc-viewer",
"displayName": "Docgen Viewer",
"description": "Visualize Solidity documentation from Docgen Plugin",
"version": "0.1.0",
"events": [],
"methods": ["viewDoc"],
"kind": "none",
"icon": "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjxzdmcgaGVpZ2h0PSIxMDI0IiB3aWR0aD0iMTAyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOTUwLjE1NCAxOTJINzMuODQ2QzMzLjEyNyAxOTIgMCAyMjUuMTI2OTk5OTk5OTk5OTUgMCAyNjUuODQ2djQ5Mi4zMDhDMCA3OTguODc1IDMzLjEyNyA4MzIgNzMuODQ2IDgzMmg4NzYuMzA4YzQwLjcyMSAwIDczLjg0Ni0zMy4xMjUgNzMuODQ2LTczLjg0NlYyNjUuODQ2QzEwMjQgMjI1LjEyNjk5OTk5OTk5OTk1IDk5MC44NzUgMTkyIDk1MC4xNTQgMTkyek01NzYgNzAzLjg3NUw0NDggNzA0VjUxMmwtOTYgMTIzLjA3N0wyNTYgNTEydjE5MkgxMjhWMzIwaDEyOGw5NiAxMjggOTYtMTI4IDEyOC0wLjEyNVY3MDMuODc1ek03NjcuMDkxIDczNS44NzVMNjA4IDUxMmg5NlYzMjBoMTI4djE5Mmg5Nkw3NjcuMDkxIDczNS44NzV6Ii8+PC9zdmc+",
"location": "mainPanel",
"url": "",
"documentation": "https://remix-plugins.readthedocs.io/en/latest/",
"repo": "https://github.com/Machinalabs/remix-ethdoc-plugin/",
"maintainedBy": "Remix",
"authorContact": "remix@ethereum.org"
}

@ -11,24 +11,24 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
// add fallback for node modules // add fallback for node modules
config.resolve.fallback = { config.resolve.fallback = {
...config.resolve.fallback, // ...config.resolve.fallback,
"crypto": require.resolve("crypto-browserify"), // "crypto": require.resolve("crypto-browserify"),
"stream": require.resolve("stream-browserify"), // "stream": require.resolve("stream-browserify"),
"path": require.resolve("path-browserify"), // "path": require.resolve("path-browserify"),
"http": require.resolve("stream-http"), // "http": require.resolve("stream-http"),
"https": require.resolve("https-browserify"), // "https": require.resolve("https-browserify"),
"constants": require.resolve("constants-browserify"), // "constants": require.resolve("constants-browserify"),
"os": false, //require.resolve("os-browserify/browser"), // "os": false, //require.resolve("os-browserify/browser"),
"timers": false, // require.resolve("timers-browserify"), // "timers": false, // require.resolve("timers-browserify"),
"zlib": require.resolve("browserify-zlib"), // "zlib": require.resolve("browserify-zlib"),
"fs": false, // "fs": false,
"module": false, // "module": false,
"tls": false, // "tls": false,
"net": false, // "net": false,
"readline": false, // "readline": false,
"child_process": false, // "child_process": false,
"buffer": require.resolve("buffer/"), // "buffer": require.resolve("buffer/"),
"vm": require.resolve('vm-browserify'), // "vm": require.resolve('vm-browserify'),
} }
// add externals // add externals

Loading…
Cancel
Save