From d383eb5fd463c5352d493a6b80e63f7d5f680908 Mon Sep 17 00:00:00 2001 From: Joseph Izang Date: Wed, 22 Mar 2023 12:40:36 +0100 Subject: [PATCH] add profile.json to doc-gen and doc-viewer. trim webpack.config --- apps/doc-gen/profile.json | 17 +++++++++++++ apps/doc-gen/src/app/docgen-client.ts | 6 ++--- apps/doc-gen/webpack.config.js | 32 ++++++++++++------------ apps/doc-viewer/profile.json | 16 ++++++++++++ apps/doc-viewer/webpack.config.js | 36 +++++++++++++-------------- 5 files changed, 70 insertions(+), 37 deletions(-) create mode 100644 apps/doc-gen/profile.json create mode 100644 apps/doc-viewer/profile.json diff --git a/apps/doc-gen/profile.json b/apps/doc-gen/profile.json new file mode 100644 index 0000000000..d73a2eb1c3 --- /dev/null +++ b/apps/doc-gen/profile.json @@ -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"] +} \ No newline at end of file diff --git a/apps/doc-gen/src/app/docgen-client.ts b/apps/doc-gen/src/app/docgen-client.ts index 76d702c6b4..c7df22a81c 100644 --- a/apps/doc-gen/src/app/docgen-client.ts +++ b/apps/doc-gen/src/app/docgen-client.ts @@ -18,7 +18,7 @@ export class DocGenClient extends PluginClient { constructor() { super() this.eventEmitter = new EventEmitter() - this.methods = ['generateDocs', 'opendDocs'] + this.methods = ['generateDocs', 'openDocs'] createClient(this) this.onload().then(async () => { await this.setListeners() @@ -65,10 +65,10 @@ export class DocGenClient extends PluginClient { this.eventEmitter.emit('docsGenerated', docs) this.emit('docgen' as any, 'docsGenerated', 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('tabs' as any, 'focus', 'doc-viewer') await this.call('doc-viewer' as any, 'viewDocs', docs) diff --git a/apps/doc-gen/webpack.config.js b/apps/doc-gen/webpack.config.js index 7b3d088f05..ec080cab2f 100644 --- a/apps/doc-gen/webpack.config.js +++ b/apps/doc-gen/webpack.config.js @@ -11,24 +11,24 @@ module.exports = composePlugins(withNx(), withReact(), (config) => { // add fallback for node modules config.resolve.fallback = { - ...config.resolve.fallback, - "crypto": require.resolve("crypto-browserify"), - "stream": require.resolve("stream-browserify"), + // ...config.resolve.fallback, + // "crypto": require.resolve("crypto-browserify"), + // "stream": require.resolve("stream-browserify"), "path": require.resolve("path-browserify"), - "http": require.resolve("stream-http"), - "https": require.resolve("https-browserify"), - "constants": require.resolve("constants-browserify"), - "os": false, //require.resolve("os-browserify/browser"), - "timers": false, // require.resolve("timers-browserify"), - "zlib": require.resolve("browserify-zlib"), + // "http": require.resolve("stream-http"), + // "https": require.resolve("https-browserify"), + // "constants": require.resolve("constants-browserify"), + // "os": false, //require.resolve("os-browserify/browser"), + // "timers": false, // require.resolve("timers-browserify"), + // "zlib": require.resolve("browserify-zlib"), "fs": false, - "module": false, - "tls": false, - "net": false, - "readline": false, - "child_process": false, - "buffer": require.resolve("buffer/"), - "vm": require.resolve('vm-browserify'), + // "module": false, + // "tls": false, + // "net": false, + // "readline": false, + // "child_process": false, + // "buffer": require.resolve("buffer/"), + // "vm": require.resolve('vm-browserify'), } // add externals diff --git a/apps/doc-viewer/profile.json b/apps/doc-viewer/profile.json new file mode 100644 index 0000000000..64cf3dc5a5 --- /dev/null +++ b/apps/doc-viewer/profile.json @@ -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" +} \ No newline at end of file diff --git a/apps/doc-viewer/webpack.config.js b/apps/doc-viewer/webpack.config.js index 7b3d088f05..80384736cd 100644 --- a/apps/doc-viewer/webpack.config.js +++ b/apps/doc-viewer/webpack.config.js @@ -11,24 +11,24 @@ module.exports = composePlugins(withNx(), withReact(), (config) => { // add fallback for node modules config.resolve.fallback = { - ...config.resolve.fallback, - "crypto": require.resolve("crypto-browserify"), - "stream": require.resolve("stream-browserify"), - "path": require.resolve("path-browserify"), - "http": require.resolve("stream-http"), - "https": require.resolve("https-browserify"), - "constants": require.resolve("constants-browserify"), - "os": false, //require.resolve("os-browserify/browser"), - "timers": false, // require.resolve("timers-browserify"), - "zlib": require.resolve("browserify-zlib"), - "fs": false, - "module": false, - "tls": false, - "net": false, - "readline": false, - "child_process": false, - "buffer": require.resolve("buffer/"), - "vm": require.resolve('vm-browserify'), + // ...config.resolve.fallback, + // "crypto": require.resolve("crypto-browserify"), + // "stream": require.resolve("stream-browserify"), + // "path": require.resolve("path-browserify"), + // "http": require.resolve("stream-http"), + // "https": require.resolve("https-browserify"), + // "constants": require.resolve("constants-browserify"), + // "os": false, //require.resolve("os-browserify/browser"), + // "timers": false, // require.resolve("timers-browserify"), + // "zlib": require.resolve("browserify-zlib"), + // "fs": false, + // "module": false, + // "tls": false, + // "net": false, + // "readline": false, + // "child_process": false, + // "buffer": require.resolve("buffer/"), + // "vm": require.resolve('vm-browserify'), } // add externals