diff --git a/libs/remixd/src/services/slitherClient.ts b/libs/remixd/src/services/slitherClient.ts index 80a194490f..24e485045d 100644 --- a/libs/remixd/src/services/slitherClient.ts +++ b/libs/remixd/src/services/slitherClient.ts @@ -4,6 +4,7 @@ import * as WS from 'ws' // eslint-disable-line import { PluginClient } from '@remixproject/plugin' import { existsSync, readFileSync, readdirSync, unlink } from 'fs' import { OutputStandard } from '../types' // eslint-disable-line +import * as utils from '../utils' const { spawn, execSync } = require('child_process') export class SlitherClient extends PluginClient { @@ -25,8 +26,8 @@ export class SlitherClient extends PluginClient { } mapNpmDepsDir (list) { - const remixNpmDepsPath = `${this.currentSharedFolder}/.deps/npm` - const localNpmDepsPath = `${this.currentSharedFolder}/node_modules` + const remixNpmDepsPath = utils.absolutePath('.deps/npm', this.currentSharedFolder) + const localNpmDepsPath = utils.absolutePath('node_modules', this.currentSharedFolder) const npmDepsExists = existsSync(remixNpmDepsPath) const nodeModulesExists = existsSync(localNpmDepsPath) 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') } // 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) let remaps = '' if (importsArr?.length) { @@ -143,7 +144,7 @@ export class SlitherClient extends PluginClient { const response = {} child.on('close', () => { - const outputFileAbsPath: string = `${this.currentSharedFolder}/${outputFile}` + const outputFileAbsPath: string = utils.absolutePath(outputFile, this.currentSharedFolder) // Check if slither report file exists if (existsSync(outputFileAbsPath)) { let report = readFileSync(outputFileAbsPath, 'utf8') diff --git a/workspace.json b/workspace.json index b76d77822b..286c5caad4 100644 --- a/workspace.json +++ b/workspace.json @@ -797,12 +797,22 @@ "remix-ui-plugin-manager": { "root": "libs/remix-ui/plugin-manager", "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": [ "**/node_modules/**", "!libs/remix-ui/plugin-manager/**/*" ] - }, + } + } + } + }, "remix-core-plugin": { "root": "libs/remix-core-plugin", "sourceRoot": "libs/remix-core-plugin/src", @@ -813,13 +823,8 @@ "builder": "@nrwl/linter:lint", "options": { "linter": "eslint", - "tsConfig": [ - "libs/remix-core-plugin/tsconfig.lib.json" - ], - "exclude": [ - "**/node_modules/**", - "!libs/remix-core-plugin/**/*" - ] + "tsConfig": ["libs/remix-core-plugin/tsconfig.lib.json"], + "exclude": ["**/node_modules/**", "!libs/remix-core-plugin/**/*"] } }, "build": { @@ -884,7 +889,6 @@ "tsConfig": ["libs/remix-ui/renderer/tsconfig.lib.json"], "exclude": ["**/node_modules/**", "!libs/remix-ui/renderer/**/*"] } - } } }