Merge pull request #3542 from ethereum/testethdoc

monorepo plugin loader
pull/5370/head
Aniket 2 years ago committed by GitHub
commit 88232c46a0
  1. 11
      .circleci/config.yml
  2. 8
      apps/doc-gen/project.json
  3. 6
      apps/doc-gen/src/app/docgen-client.ts
  4. 40
      apps/doc-gen/src/app/docgen/templates.ts
  5. 17
      apps/doc-gen/src/profile.json
  6. 21
      apps/doc-gen/webpack.config.js
  7. 8
      apps/doc-viewer/project.json
  8. 16
      apps/doc-viewer/src/profile.json
  9. 22
      apps/doc-viewer/webpack.config.js
  10. 8
      apps/etherscan/project.json
  11. 2
      apps/etherscan/src/index.html
  12. 16
      apps/etherscan/src/profile.json
  13. 2
      apps/remix-ide-e2e/src/tests/etherscan_api.test.ts
  14. 2
      apps/remix-ide-e2e/src/tests/vyper_api.test.ts
  15. 5
      apps/remix-ide/project.json
  16. 31
      apps/remix-ide/src/remixAppManager.js
  17. 24
      apps/remix-ide/webpack.config.js
  18. 8
      apps/vyper/project.json
  19. 3
      apps/vyper/src/app/app.tsx
  20. 0
      apps/vyper/src/assets/logo.svg
  21. 0
      apps/vyper/src/assets/star.svg
  22. 2
      apps/vyper/src/index.html
  23. 14
      apps/vyper/src/profile.json

@ -44,7 +44,6 @@ jobs:
build-plugin: build-plugin:
docker: docker:
- image: cimg/node:14.17.6-browsers - image: cimg/node:14.17.6-browsers
resource_class: resource_class:
xlarge xlarge
working_directory: ~/remix-project working_directory: ~/remix-project
@ -61,7 +60,7 @@ jobs:
key: v1-deps-{{ checksum "yarn.lock" }} key: v1-deps-{{ checksum "yarn.lock" }}
paths: paths:
- node_modules - node_modules
- run: yarn build << parameters.plugin >> - run: yarn nx build << parameters.plugin >> --configuration=production
- run: mkdir persist && zip -0 -r persist/plugin-<< parameters.plugin >>.zip dist - run: mkdir persist && zip -0 -r persist/plugin-<< parameters.plugin >>.zip dist
- persist_to_workspace: - persist_to_workspace:
root: . root: .
@ -281,7 +280,7 @@ workflows:
- build-plugin: - build-plugin:
matrix: matrix:
parameters: parameters:
plugin: ["etherscan", "vyper", "plugin_api"] plugin: ["plugin_api"]
- lint: - lint:
requires: requires:
- build - build
@ -294,15 +293,11 @@ workflows:
matrix: matrix:
alias: plugins alias: plugins
parameters: parameters:
plugin: ["etherscan", "vyper", "plugin_api"] plugin: ["plugin_api"]
parallelism: [1, 9] parallelism: [1, 9]
exclude: exclude:
- plugin: plugin_api - plugin: plugin_api
parallelism: 1 parallelism: 1
- plugin: etherscan
parallelism: 9
- plugin: vyper
parallelism: 9
- remix-ide-browser: - remix-ide-browser:
requires: requires:

@ -14,11 +14,12 @@
"compiler": "babel", "compiler": "babel",
"outputPath": "dist/apps/doc-gen", "outputPath": "dist/apps/doc-gen",
"index": "apps/doc-gen/src/index.html", "index": "apps/doc-gen/src/index.html",
"baseHref": "/", "baseHref": "./",
"main": "apps/doc-gen/src/main.tsx", "main": "apps/doc-gen/src/main.tsx",
"tsConfig": "apps/doc-gen/tsconfig.app.json", "tsConfig": "apps/doc-gen/tsconfig.app.json",
"assets": [ "assets": [
"apps/doc-gen/src/favicon.ico" "apps/doc-gen/src/favicon.ico",
"apps/doc-gen/src/profile.json"
], ],
"styles": [], "styles": [],
"scripts": [], "scripts": [],
@ -42,7 +43,8 @@
"defaultConfiguration": "development", "defaultConfiguration": "development",
"options": { "options": {
"buildTarget": "doc-gen:build", "buildTarget": "doc-gen:build",
"hmr": true "hmr": true,
"baseHref": "/"
}, },
"configurations": { "configurations": {
"development": { "development": {

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

@ -1,7 +1,21 @@
/* eslint-disable @typescript-eslint/no-var-requires */
import { mapKeys } from './utils/map-keys'; import { mapKeys } from './utils/map-keys';
import { DocItemContext } from './site'; import { DocItemContext } from './site';
import * as defaultProperties from './common/properties'; import * as defaultProperties from './common/properties';
import * as themeHelpers from './themes/markdown/helpers'
const common = require('./themes/markdown/common.hbs');
const contract = require('./themes/markdown/contract.hbs');
const enum_ = require('./themes/markdown/enum.hbs');
const error = require('./themes/markdown/error.hbs');
const event = require('./themes/markdown/event.hbs');
const function_ = require('./themes/markdown/function.hbs');
const modifier = require('./themes/markdown/modifier.hbs');
const page = require('./themes/markdown/page.hbs');
const struct = require('./themes/markdown/struct.hbs');
const variable = require('./themes/markdown/variable.hbs');
const userDefinedValueType = require('./themes/markdown/user-defined-value-type.hbs');
export type PropertyGetter = (ctx: DocItemContext, original?: unknown) => unknown; export type PropertyGetter = (ctx: DocItemContext, original?: unknown) => unknown;
export type Properties = Record<string, PropertyGetter>; export type Properties = Record<string, PropertyGetter>;
@ -55,23 +69,29 @@ export async function readTemplates(): Promise<Required<Templates>> {
async function readPartials() { async function readPartials() {
const partials: NonNullable<Templates['partials']> = {}; const partials: NonNullable<Templates['partials']> = {};
const partialNames = ["common", "contract", "enum", "error", "event", "function", "modifier", "page", "struct", "variable", "user-defined-value-type"]
for (const name of partialNames) { partials["common"] = () => common
const p = await import('raw-loader!./themes/markdown/' + name + '.hbs') partials["contract"] = () => contract
partials[name] = () => p.default partials["enum"] = () => enum_
} partials["error"] = () => error
partials["event"] = () => event
partials["function"] = () => function_
partials["modifier"] = () => modifier
partials["page"] = () => page
partials["struct"] = () => struct
partials["variable"] = () => variable
partials["user-defined-value-type"] = () => userDefinedValueType
return partials; return partials;
} }
async function readHelpers(name: string) { async function readHelpers(name: string) {
let helpersPath;
const h = await import('./themes/markdown/helpers');
const helpers: Record<string, (...args: any[]) => any> = {}; const helpers: Record<string, (...args: any[]) => any> = {};
for (const name in h) { for (const name in themeHelpers) {
if (typeof h[name] === 'function') { if (typeof themeHelpers[name] === 'function') {
helpers[name] = h[name]; helpers[name] = themeHelpers[name];
} }
} }

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

@ -12,23 +12,8 @@ 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"),
"stream": require.resolve("stream-browserify"),
"path": require.resolve("path-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, "fs": false,
"module": false,
"tls": false,
"net": false,
"readline": false,
"child_process": false,
"buffer": require.resolve("buffer/"),
"vm": require.resolve('vm-browserify'),
} }
// add externals // add externals
@ -37,6 +22,12 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
solc: 'solc', solc: 'solc',
} }
config.module.rules.push({
test: /\.hbs$/,
type: 'asset/source'
})
// add public path // add public path
config.output.publicPath = '/' config.output.publicPath = '/'

@ -14,11 +14,12 @@
"compiler": "babel", "compiler": "babel",
"outputPath": "dist/apps/doc-viewer", "outputPath": "dist/apps/doc-viewer",
"index": "apps/doc-viewer/src/index.html", "index": "apps/doc-viewer/src/index.html",
"baseHref": "/", "baseHref": "./",
"main": "apps/doc-viewer/src/main.tsx", "main": "apps/doc-viewer/src/main.tsx",
"tsConfig": "apps/doc-viewer/tsconfig.app.json", "tsConfig": "apps/doc-viewer/tsconfig.app.json",
"assets": [ "assets": [
"apps/doc-viewer/src/favicon.ico" "apps/doc-viewer/src/favicon.ico",
"apps/doc-viewer/src/profile.json"
], ],
"styles": [], "styles": [],
"scripts": [], "scripts": [],
@ -42,7 +43,8 @@
"defaultConfiguration": "development", "defaultConfiguration": "development",
"options": { "options": {
"buildTarget": "doc-viewer:build", "buildTarget": "doc-viewer:build",
"hmr": true "hmr": true,
"baseHref": "/"
}, },
"configurations": { "configurations": {
"development": { "development": {

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

@ -9,28 +9,6 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
// Update the webpack config as needed here. // Update the webpack config as needed here.
// e.g. `config.plugins.push(new MyPlugin())` // e.g. `config.plugins.push(new MyPlugin())`
// 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'),
}
// add externals // add externals
config.externals = { config.externals = {
...config.externals, ...config.externals,

@ -12,13 +12,14 @@
"compiler": "babel", "compiler": "babel",
"outputPath": "dist/apps/etherscan", "outputPath": "dist/apps/etherscan",
"index": "apps/etherscan/src/index.html", "index": "apps/etherscan/src/index.html",
"baseHref": "/", "baseHref": "./",
"main": "apps/etherscan/src/main.tsx", "main": "apps/etherscan/src/main.tsx",
"polyfills": "apps/etherscan/src/polyfills.ts", "polyfills": "apps/etherscan/src/polyfills.ts",
"tsConfig": "apps/etherscan/tsconfig.app.json", "tsConfig": "apps/etherscan/tsconfig.app.json",
"assets": [ "assets": [
"apps/etherscan/src/favicon.ico", "apps/etherscan/src/favicon.ico",
"apps/etherscan/src/assets" "apps/etherscan/src/assets",
"apps/etherscan/src/profile.json"
], ],
"styles": ["apps/etherscan/src/styles.css"], "styles": ["apps/etherscan/src/styles.css"],
"scripts": [], "scripts": [],
@ -42,7 +43,8 @@
"defaultConfiguration": "development", "defaultConfiguration": "development",
"options": { "options": {
"buildTarget": "etherscan:build", "buildTarget": "etherscan:build",
"hmr": true "hmr": true,
"baseHref": "/"
}, },
"configurations": { "configurations": {
"development": { "development": {

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Etherscan</title> <title>Etherscan</title>
<base href="/" /> <base href="./" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="icon" type="image/x-icon" href="favicon.ico" />

@ -0,0 +1,16 @@
{
"name": "etherscan",
"displayName": "Etherscan - Contract verification",
"description": "Verify Solidity contract code using Etherscan API",
"version": "0.1.0",
"events": [],
"methods": ["verify", "receiptStatus"],
"kind": "none",
"icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHsAAAB7CAYAAABUx/9/AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAHBklEQVR42u2dy3WbTBTH/+ikgFEFwZ8K8HQAm6yjDkIHdiogHWBXgDqADgQVaLLJToZ1NtAB38JC0QNJIPGYx73nsIgcHVvz033OnblWVVXQQcqyhBACQgiUZYk0TfHnz5/q79+/rd7PGPsA8I1z/gEAjuOAMQbOOVzX1WKNLFVhCyGQJAnSNEUcx0N/CMu2bXDO4TgOXNcF51y9RauqSomnKApEUQTG2BZANeXDGNsyxuB5HqIoUmYNpf8DoyjC1HBbPEqAl/KPyrJMCg2+V+N930eWZQT72rNer6Ea4FvavtlsCLbGkM+gu66L9XptNuwsy3SG3KjpU5r3ySJrgyCfQfd93wzYmpvs1sBt2x7dtJM2S2DatYJN2nxby8eI2of/BQSzNfQgCNSETWb7PuDL5VIt2IalVL0D55wPwmXW98bKfD7fPj096bFvOtHeVJ7n2/l8DiGEvLteKtazZa+z9xm4EWiDgBNog4ATaIOAE2iDgFMebVBadnfDoWVZlF5N1CTKOcdms+n8xhmBVi8PF0Lg58+fw+fZZErlMeldGxwpIFM8YOvS+UJarUF/W++waWGbNSuKoof6ynpom269NUrme0SfOYQydTHnpNUPwO6zU3QMc06gH1hgyTp6blqam0UVyqkvL02fJ2B7WGfLtu26caR7UYVAK9f0gLe3t+7fzvl8vi3L8j9aQ2U0u75QYLHbt2hfQSOfrJzPvnni5OK3k0y4epp9y3fPCLSevnu1WrX7dhJspT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tVrAsq5IBdN2F0ulGBl0Dpj6f3YJKN8PscEBbq0CbYCoHuaqrZF0/D/lsuX1yo5++5y408tknVa/5fL6VxSdfq5J1vSKLfLb8proxn95sNvf31JkIuOUUXa1AGwd7VztWanJwX6CNgK2KmR4atJawsyxTUoOHBq0N7CiK6u6MSodnCNDKwtYNLhom+Qxx8kT65oUkSSCEwO/fv7FarXSvAFnL5RJhGF5sLXpEpICd5znyPIcQAmVZIk1TJEliWmnPCoLgYrOgUrCTJEGSJAD+TWo3EOjFqlgYhsOPwRrT12rqYx+eYHh40nLQ9TesV0sayHWNe1RlmyqiNhm07/ujabM0qdfUzXpTmOyhDvMrk2fv9ma1hVz3iU29ztSWO7Am910F066ClmUZfN9XdofK9/1JzbWy5dIoilSAjuVyiSiKpF5L5WriMjQd1BrseR6iKJoksr7nUbbhUAiBJEmQpiniOB7lNgMZT4x2+hA6dZfWmyZ1fV0I0bpLtL4Gq4boOM7+GFN9q6/q8j8QmqQtM04gOgAAAABJRU5ErkJggg==",
"location": "sidePanel",
"url": "https://ipfs-cluster.ethdevops.io/ipfs/QmQsZbBSYCVBVpz2mVRbPRVTrcz59oJEpuuoxiT9otu3mh",
"repo": "https://github.com/ethereum/remix-project/tree/master/apps/etherscan",
"documentation": "https://remix-etherscan-plugin.readthedocs.io/en/latest",
"maintainedBy": "Remix",
"authorContact": "remix@ethereum.org"
}

@ -9,7 +9,7 @@ declare global {
module.exports = { module.exports = {
'@disabled': true, '@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done, null, true, { name: 'etherscan', url: 'http://127.0.0.1:9999'}) init(browser, done, null)
}, },
'Should load etherscan plugin #group1': function (browser: NightwatchBrowser) { 'Should load etherscan plugin #group1': function (browser: NightwatchBrowser) {

@ -9,7 +9,7 @@ declare global {
module.exports = { module.exports = {
'@disabled': true, '@disabled': true,
before: function (browser: NightwatchBrowser, done: VoidFunction) { before: function (browser: NightwatchBrowser, done: VoidFunction) {
init(browser, done, null, true, { name: 'vyper', url: 'http://127.0.0.1:9999'}) init(browser, done)
}, },
'Should connect to vyper plugin #group1': function (browser: NightwatchBrowser) { 'Should connect to vyper plugin #group1': function (browser: NightwatchBrowser) {

@ -3,8 +3,7 @@
"$schema": "../../node_modules/nx/schemas/project-schema.json", "$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "apps/remix-ide/src", "sourceRoot": "apps/remix-ide/src",
"projectType": "application", "projectType": "application",
"implicitDependencies": [ "implicitDependencies": ["doc-gen", "doc-viewer", "etherscan", "vyper"],
],
"targets": { "targets": {
"build": { "build": {
"executor": "@nrwl/webpack:webpack", "executor": "@nrwl/webpack:webpack",
@ -47,7 +46,7 @@
"executor": "@nrwl/webpack:dev-server", "executor": "@nrwl/webpack:dev-server",
"defaultConfiguration": "development", "defaultConfiguration": "development",
"options": { "options": {
"buildTarget": "remix-ide:build", "buildTarget": "remix-ide:build"
}, },
"configurations": { "configurations": {

@ -9,12 +9,14 @@ const requiredModules = [ // services + layout views + system views
'manager', 'config', 'compilerArtefacts', 'compilerMetadata', 'contextualListener', 'editor', 'offsetToLineColumnConverter', 'network', 'theme', 'locale', 'manager', 'config', 'compilerArtefacts', 'compilerMetadata', 'contextualListener', 'editor', 'offsetToLineColumnConverter', 'network', 'theme', 'locale',
'fileManager', 'contentImport', 'blockchain', 'web3Provider', 'scriptRunner', 'fetchAndCompile', 'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons', 'fileManager', 'contentImport', 'blockchain', 'web3Provider', 'scriptRunner', 'fetchAndCompile', 'mainPanel', 'hiddenPanel', 'sidePanel', 'menuicons',
'filePanel', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp', 'dGitProvider', 'solidity', 'solidity-logic', 'gistHandler', 'layout', 'filePanel', 'terminal', 'settings', 'pluginManager', 'tabs', 'udapp', 'dGitProvider', 'solidity', 'solidity-logic', 'gistHandler', 'layout',
'notification', 'permissionhandler', 'walkthrough', 'storage', 'restorebackupzip', 'link-libraries', 'deploy-libraries', 'openzeppelin-proxy', 'notification', 'permissionhandler', 'walkthrough', 'storage', 'restorebackupzip', 'link-libraries', 'deploy-libraries', 'openzeppelin-proxy',
'hardhat-provider', 'ganache-provider', 'foundry-provider', 'basic-http-provider', 'injected', 'injected-trustwallet', 'injected-optimism-provider', 'injected-arbitrum-one-provider', 'vm-custom-fork', 'vm-goerli-fork', 'vm-mainnet-fork', 'vm-sepolia-fork', 'vm-merge', 'vm-london', 'vm-berlin', 'hardhat-provider', 'ganache-provider', 'foundry-provider', 'basic-http-provider', 'injected', 'injected-trustwallet', 'injected-optimism-provider', 'injected-arbitrum-one-provider', 'vm-custom-fork', 'vm-goerli-fork', 'vm-mainnet-fork', 'vm-sepolia-fork', 'vm-merge', 'vm-london', 'vm-berlin',
'compileAndRun', 'search', 'recorder', 'fileDecorator', 'codeParser', 'codeFormatter', 'solidityumlgen', 'contractflattener', 'doc-gen', 'doc-viewer', 'solidity-script'] 'compileAndRun', 'search', 'recorder', 'fileDecorator', 'codeParser', 'codeFormatter', 'solidityumlgen', 'contractflattener', 'solidity-script']
// dependentModules shouldn't be manually activated (e.g hardhat is activated by remixd) // dependentModules shouldn't be manually activated (e.g hardhat is activated by remixd)
const dependentModules = ['foundry', 'hardhat', 'truffle', 'slither'] const dependentModules = ['foundry', 'hardhat', 'truffle', 'slither']
const loadLocalPlugins = ["doc-gen", "doc-viewer", "etherscan", "vyper"]
const sensitiveCalls = { const sensitiveCalls = {
'fileManager': ['writeFile', 'copyFile', 'rename', 'copyDir'], 'fileManager': ['writeFile', 'copyFile', 'rename', 'copyDir'],
@ -24,9 +26,9 @@ const sensitiveCalls = {
export function isNative(name) { export function isNative(name) {
// nativePlugin allows to bypass the permission request // nativePlugin allows to bypass the permission request
const nativePlugins = ['vyper', 'workshops', 'debugger', 'remixd', 'menuicons', 'solidity', 'solidity-logic', 'solidityStaticAnalysis', 'solidityUnitTesting', const nativePlugins = ['vyper', 'workshops', 'debugger', 'remixd', 'menuicons', 'solidity', 'solidity-logic', 'solidityStaticAnalysis', 'solidityUnitTesting',
'layout', 'notification', 'hardhat-provider', 'ganache-provider', 'foundry-provider', 'basic-http-provider', 'injected-optimism-provider', 'layout', 'notification', 'hardhat-provider', 'ganache-provider', 'foundry-provider', 'basic-http-provider', 'injected-optimism-provider',
'tabs', 'injected-arbitrum-one-provider', 'injected'] 'tabs', 'injected-arbitrum-one-provider', 'injected', 'doc-gen', 'doc-viewer']
return nativePlugins.includes(name) || requiredModules.includes(name) return nativePlugins.includes(name) || requiredModules.includes(name)
} }
@ -149,7 +151,24 @@ export class RemixAppManager extends PluginManager {
} }
const testPluginName = localStorage.getItem('test-plugin-name') const testPluginName = localStorage.getItem('test-plugin-name')
const testPluginUrl = localStorage.getItem('test-plugin-url') const testPluginUrl = localStorage.getItem('test-plugin-url')
return plugins.map(plugin => {
for (let plugin of loadLocalPlugins) {
// fetch the profile from the local plugin
try {
const profile = await fetch(`plugins/${plugin}/profile.json`)
const profileJson = await profile.json()
// remove duplicates
plugins = plugins.filter((p) => p.name !== profileJson.name && p.displayName !== profileJson.displayName)
// change url
profileJson.url = `plugins/${plugin}/index.html`
// add the local plugin
plugins.push(profileJson)
} catch (e) {
console.log(e)
}
}
return plugins.map(plugin => {
if (plugin.name === testPluginName) plugin.url = testPluginUrl if (plugin.name === testPluginName) plugin.url = testPluginUrl
return new IframePlugin(plugin) return new IframePlugin(plugin)
}) })

@ -15,6 +15,23 @@ const versionData = {
fs.writeFileSync('./apps/remix-ide/src/assets/version.json', JSON.stringify(versionData)) fs.writeFileSync('./apps/remix-ide/src/assets/version.json', JSON.stringify(versionData))
const project = fs.readFileSync('./apps/remix-ide/project.json', 'utf8')
const implicitDependencies = JSON.parse(project).implicitDependencies
const copyPatterns = implicitDependencies.map((dep) => {
try {
fs.statSync(__dirname + `/../../dist/apps/${dep}`).isDirectory()
return { from: `../../dist/apps/${dep}`, to: `plugins/${dep}` }
}
catch (e) {
console.log('error', e)
return false
}
})
console.log('Copying plugins... ', copyPatterns)
// Nx plugins for webpack. // Nx plugins for webpack.
module.exports = composePlugins(withNx(), withReact(), (config) => { module.exports = composePlugins(withNx(), withReact(), (config) => {
// Update the webpack config as needed here. // Update the webpack config as needed here.
@ -41,7 +58,7 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
"buffer": require.resolve("buffer/"), "buffer": require.resolve("buffer/"),
"vm": require.resolve('vm-browserify'), "vm": require.resolve('vm-browserify'),
} }
// add externals // add externals
config.externals = { config.externals = {
@ -60,7 +77,8 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
config.plugins.push( config.plugins.push(
new CopyPlugin({ new CopyPlugin({
patterns: [ patterns: [
{ from: '../../node_modules/monaco-editor/min/vs', to: 'assets/js/monaco-editor/min/vs' } { from: '../../node_modules/monaco-editor/min/vs', to: 'assets/js/monaco-editor/min/vs' },
...copyPatterns
].filter(Boolean) ].filter(Boolean)
}), }),
new webpack.ProvidePlugin({ new webpack.ProvidePlugin({
@ -77,7 +95,7 @@ module.exports = composePlugins(withNx(), withReact(), (config) => {
enforce: "pre" enforce: "pre"
}) })
config.ignoreWarnings = [/Failed to parse source map/, /require function/ ] // ignore source-map-loader warnings & AST warnings config.ignoreWarnings = [/Failed to parse source map/, /require function/] // ignore source-map-loader warnings & AST warnings
// set minimizer // set minimizer
config.optimization.minimizer = [ config.optimization.minimizer = [

@ -12,13 +12,14 @@
"compiler": "babel", "compiler": "babel",
"outputPath": "dist/apps/vyper", "outputPath": "dist/apps/vyper",
"index": "apps/vyper/src/index.html", "index": "apps/vyper/src/index.html",
"baseHref": "/", "baseHref": "./",
"main": "apps/vyper/src/main.tsx", "main": "apps/vyper/src/main.tsx",
"polyfills": "apps/vyper/src/polyfills.ts", "polyfills": "apps/vyper/src/polyfills.ts",
"tsConfig": "apps/vyper/tsconfig.app.json", "tsConfig": "apps/vyper/tsconfig.app.json",
"assets": [ "assets": [
"apps/vyper/src/favicon.ico", "apps/vyper/src/favicon.ico",
"apps/vyper/src/assets" "apps/vyper/src/assets",
"apps/vyper/src/profile.json"
], ],
"styles": ["apps/vyper/src/styles.css"], "styles": ["apps/vyper/src/styles.css"],
"scripts": [], "scripts": [],
@ -42,7 +43,8 @@
"defaultConfiguration": "development", "defaultConfiguration": "development",
"options": { "options": {
"buildTarget": "vyper:build", "buildTarget": "vyper:build",
"hmr": true "hmr": true,
"baseHref": "/"
}, },
"configurations": { "configurations": {
"development": { "development": {

@ -12,7 +12,6 @@ import ToggleButtonGroup from 'react-bootstrap/ToggleButtonGroup'
import ToggleButton from 'react-bootstrap/ToggleButton' import ToggleButton from 'react-bootstrap/ToggleButton'
import Button from 'react-bootstrap/Button' import Button from 'react-bootstrap/Button'
import vyperLogo from './logo.svg'
import './app.css' import './app.css'
interface AppState { interface AppState {
@ -71,7 +70,7 @@ const App: React.FC = () => {
<main id="vyper-plugin"> <main id="vyper-plugin">
<header> <header>
<div className="title"> <div className="title">
<img src={vyperLogo} alt="Vyper logo" /> <img src={'assets/logo.svg'} alt="Vyper logo" />
<h4>yper Compiler</h4> <h4>yper Compiler</h4>
</div> </div>
<a <a

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 347 B

@ -3,7 +3,7 @@
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8" />
<title>Vyper</title> <title>Vyper</title>
<base href="/" /> <base href="./" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="icon" type="image/x-icon" href="favicon.ico" />

@ -0,0 +1,14 @@
{
"name": "vyper",
"displayName": "Vyper",
"methods": ["getCompilationResult", "compile"],
"url": "https://ipfs-cluster.ethdevops.io/ipfs/QmbmPzUg7ghTKcF2eo64zm1k1LKdibYfqYmiqXkHKXks8r",
"documentation": "https://github.com/GrandSch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z0iMjA0OCAwIDE1MzYgMCAxNzkyIDQ0My40IDIwNDggMCIgc3R5bGU9ImZpbGw6I2IyYjJiMiIvPiAgPHBvbHlsaW5lIHBvaW50cz0iNTEyIDAgMCAwIDI1NiA0NDMuNCA1MTIgMCIgc3R5bGU9ImZpbGw6I2IyYjJiMiIvPjwvc3ZnPg==",
"location": "sidePanel",
"repo": "https://github.com/ethereum/remix-project/tree/master/apps/vyper",
"maintainedBy": "Remix",
"authorContact": "remix@ethereum.org"
}
Loading…
Cancel
Save