Merge branch 'master' of https://github.com/ethereum/remix-project into remixd_terminal

pull/1342/head
davidzagi93@gmail.com 3 years ago
commit 545f4873a3
  1. 9
      libs/remixd/src/services/slitherClient.ts
  2. 24
      workspace.json

@ -4,6 +4,7 @@ import * as WS from 'ws' // eslint-disable-line
import { PluginClient } from '@remixproject/plugin' import { PluginClient } from '@remixproject/plugin'
import { existsSync, readFileSync, readdirSync, unlink } from 'fs' import { existsSync, readFileSync, readdirSync, unlink } from 'fs'
import { OutputStandard } from '../types' // eslint-disable-line import { OutputStandard } from '../types' // eslint-disable-line
import * as utils from '../utils'
const { spawn, execSync } = require('child_process') const { spawn, execSync } = require('child_process')
export class SlitherClient extends PluginClient { export class SlitherClient extends PluginClient {
@ -25,8 +26,8 @@ export class SlitherClient extends PluginClient {
} }
mapNpmDepsDir (list) { mapNpmDepsDir (list) {
const remixNpmDepsPath = `${this.currentSharedFolder}/.deps/npm` const remixNpmDepsPath = utils.absolutePath('.deps/npm', this.currentSharedFolder)
const localNpmDepsPath = `${this.currentSharedFolder}/node_modules` const localNpmDepsPath = utils.absolutePath('node_modules', this.currentSharedFolder)
const npmDepsExists = existsSync(remixNpmDepsPath) const npmDepsExists = existsSync(remixNpmDepsPath)
const nodeModulesExists = existsSync(localNpmDepsPath) const nodeModulesExists = existsSync(localNpmDepsPath)
let isLocalDep = false let isLocalDep = false
@ -112,7 +113,7 @@ export class SlitherClient extends PluginClient {
} else console.log('\x1b[32m%s\x1b[0m', '[Slither Analysis]: Compiler version is same as installed solc version') } else console.log('\x1b[32m%s\x1b[0m', '[Slither Analysis]: Compiler version is same as installed solc version')
} }
// Allow paths and set solc remapping for import URLs // Allow paths and set solc remapping for import URLs
const fileContent = readFileSync(`${this.currentSharedFolder}/${filePath}`, 'utf8') const fileContent = readFileSync(utils.absolutePath(filePath, this.currentSharedFolder), 'utf8')
const importsArr = fileContent.match(/import ['"][^.|..](.+?)['"];/g) const importsArr = fileContent.match(/import ['"][^.|..](.+?)['"];/g)
let remaps = '' let remaps = ''
if (importsArr?.length) { if (importsArr?.length) {
@ -143,7 +144,7 @@ export class SlitherClient extends PluginClient {
const response = {} const response = {}
child.on('close', () => { child.on('close', () => {
const outputFileAbsPath: string = `${this.currentSharedFolder}/${outputFile}` const outputFileAbsPath: string = utils.absolutePath(outputFile, this.currentSharedFolder)
// Check if slither report file exists // Check if slither report file exists
if (existsSync(outputFileAbsPath)) { if (existsSync(outputFileAbsPath)) {
let report = readFileSync(outputFileAbsPath, 'utf8') let report = readFileSync(outputFileAbsPath, 'utf8')

@ -797,12 +797,22 @@
"remix-ui-plugin-manager": { "remix-ui-plugin-manager": {
"root": "libs/remix-ui/plugin-manager", "root": "libs/remix-ui/plugin-manager",
"sourceRoot": "libs/remix-ui/plugin-manager/src", "sourceRoot": "libs/remix-ui/plugin-manager/src",
"tsConfig": ["libs/remix-ui/plugin-manager/tsconfig.lib.json"], "projectType": "library",
"schematics": {},
"architect": {
"lint": {
"builder": "@nrwl/linter:lint",
"options": {
"linter": "eslint",
"tsConfig": ["libs/remix-ui/plugin-manager/tsconfig.lib.json"],
"exclude": [ "exclude": [
"**/node_modules/**", "**/node_modules/**",
"!libs/remix-ui/plugin-manager/**/*" "!libs/remix-ui/plugin-manager/**/*"
] ]
}, }
}
}
},
"remix-core-plugin": { "remix-core-plugin": {
"root": "libs/remix-core-plugin", "root": "libs/remix-core-plugin",
"sourceRoot": "libs/remix-core-plugin/src", "sourceRoot": "libs/remix-core-plugin/src",
@ -813,13 +823,8 @@
"builder": "@nrwl/linter:lint", "builder": "@nrwl/linter:lint",
"options": { "options": {
"linter": "eslint", "linter": "eslint",
"tsConfig": [ "tsConfig": ["libs/remix-core-plugin/tsconfig.lib.json"],
"libs/remix-core-plugin/tsconfig.lib.json" "exclude": ["**/node_modules/**", "!libs/remix-core-plugin/**/*"]
],
"exclude": [
"**/node_modules/**",
"!libs/remix-core-plugin/**/*"
]
} }
}, },
"build": { "build": {
@ -884,7 +889,6 @@
"tsConfig": ["libs/remix-ui/renderer/tsconfig.lib.json"], "tsConfig": ["libs/remix-ui/renderer/tsconfig.lib.json"],
"exclude": ["**/node_modules/**", "!libs/remix-ui/renderer/**/*"] "exclude": ["**/node_modules/**", "!libs/remix-ui/renderer/**/*"]
} }
} }
} }
} }

Loading…
Cancel
Save