lint, build, test working for remix-lib, remix-astwalker

fixAnalyzerTest
aniket-engg 4 years ago
parent 83cc0cb71a
commit 40fd06fd16
  1. 4
      libs/remix-astwalker/package.json
  2. 2
      libs/remix-astwalker/src/sourceMappings.ts
  3. 2
      libs/remix-astwalker/tests/resources/ast.ts
  4. 2
      libs/remix-astwalker/tsconfig.json
  5. 2
      libs/remix-astwalker/tsconfig.lib.json
  6. 5
      libs/remix-lib/index.js
  7. 1
      libs/remix-lib/package.json
  8. 2
      libs/remix-lib/src/execution/execution-context.js
  9. 2
      libs/remix-lib/test/txFormat.js
  10. 2228
      package-lock.json
  11. 3
      package.json
  12. 24
      workspace.json

@ -5,8 +5,7 @@
"main": "dist/index.js", "main": "dist/index.js",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
"lint": "standard", "test": "./../../node_modules/.bin/nyc --reporter=lcov --require ts-node/register --require tsconfig-paths/register ./../../node_modules/.bin/tape ./tests/*.ts | ./../../node_modules/.bin/tap-spec; ./../../node_modules/.bin/nyc report ---reporter=text",
"test": "nyc --reporter=lcov --require ts-node/register tape ./tests/*.ts | tap-spec; nyc report ---reporter=text",
"prepublish": "npm run build" "prepublish": "npm run build"
}, },
"repository": { "repository": {
@ -36,7 +35,6 @@
"@types/tape": "^4.2.33", "@types/tape": "^4.2.33",
"nyc": "^13.3.0", "nyc": "^13.3.0",
"remix-lib": "0.4.29", "remix-lib": "0.4.29",
"standard": "^14.3.4",
"tape": "^4.10.1", "tape": "^4.10.1",
"ts-node": "^8.0.3", "ts-node": "^8.0.3",
"typescript": "^3.4.3" "typescript": "^3.4.3"

@ -1,6 +1,6 @@
import { isAstNode, AstWalker } from './astWalker'; import { isAstNode, AstWalker } from './astWalker';
import { AstNode, LineColPosition, LineColRange, Location } from "./types"; import { AstNode, LineColPosition, LineColRange, Location } from "./types";
import { util } from "remix-lib"; import { util } from "@remix-project/remix-lib";
export declare interface SourceMappings { export declare interface SourceMappings {
// eslint-disable-next-line @typescript-eslint/no-misused-new // eslint-disable-next-line @typescript-eslint/no-misused-new

@ -1,5 +1,5 @@
import { Node } from '../../src/' import { Node } from '../../src/'
const node: Node = { const node = {
ast: { "legacyAST": { "children": [{ "attributes": { "fullyImplemented": true, "isLibrary": false, "linearizedBaseContracts": [5640396], "name": "test" }, "children": [{ "attributes": { "name": "x", "type": "int256" }, "children": [{ "attributes": { "name": "int" }, "id": 5657860, "name": "ElementaryTypeName", "src": "21:3:11" }], "id": 5658100, "name": "VariableDeclaration", "src": "21:5:11" }, { "attributes": { "name": "y", "type": "int256" }, "children": [{ "attributes": { "name": "int" }, "id": 5658180, "name": "ElementaryTypeName", "src": "38:3:11" }], "id": 5658268, "name": "VariableDeclaration", "src": "38:5:11" }, { "attributes": { "constant": false, "name": "set", "public": true }, "children": [{ "children": [{ "attributes": { "name": "_x", "type": "int256" }, "children": [{ "attributes": { "name": "int" }, "id": 5658404, "name": "ElementaryTypeName", "src": "68:3:11" }], "id": 5658492, "name": "VariableDeclaration", "src": "68:6:11" }], "id": 5658572, "name": "ParameterList", "src": "67:8:11" }, { "children": [{ "attributes": { "name": "_r", "type": "int256" }, "children": [{ "attributes": { "name": "int" }, "id": 5658628, "name": "ElementaryTypeName", "src": "85:3:11" }], "id": 5658716, "name": "VariableDeclaration", "src": "85:6:11" }], "id": 5658796, "name": "ParameterList", "src": "84:8:11" }, { "children": [{ "children": [{ "attributes": { "operator": "=", "type": "int256" }, "children": [{ "attributes": { "type": "int256", "value": "x" }, "id": 5658900, "name": "Identifier", "src": "108:1:11" }, { "attributes": { "type": "int256", "value": "_x" }, "id": 5658980, "name": "Identifier", "src": "112:2:11" }], "id": 5657492, "name": "Assignment", "src": "108:6:11" }], "id": 5659028, "name": "ExpressionStatement", "src": "108:6:11" }, { "children": [{ "attributes": { "operator": "=", "type": "int256" }, "children": [{ "attributes": { "type": "int256", "value": "y" }, "id": 5659116, "name": "Identifier", "src": "125:1:11" }, { "attributes": { "string": null, "type": "int_const 10", "value": "10" }, "id": 5659196, "name": "Literal", "src": "129:2:11" }], "id": 5659252, "name": "Assignment", "src": "125:6:11" }], "id": 5659316, "name": "ExpressionStatement", "src": "125:6:11" }, { "children": [{ "attributes": { "operator": "=", "type": "int256" }, "children": [{ "attributes": { "type": "int256", "value": "_r" }, "id": 5659428, "name": "Identifier", "src": "141:2:11" }, { "attributes": { "type": "int256", "value": "x" }, "id": 5639308, "name": "Identifier", "src": "146:1:11" }], "id": 5639356, "name": "Assignment", "src": "141:6:11" }], "id": 5639420, "name": "ExpressionStatement", "src": "141:6:11" }], "id": 5639516, "name": "Block", "src": "97:57:11" }], "id": 5639612, "name": "FunctionDefinition", "src": "55:99:11" }, { "attributes": { "constant": false, "name": "get", "public": true }, "children": [{ "children": [], "id": 5639764, "name": "ParameterList", "src": "179:2:11" }, { "children": [{ "attributes": { "name": "x", "type": "uint256" }, "children": [{ "attributes": { "name": "uint" }, "id": 5639820, "name": "ElementaryTypeName", "src": "191:4:11" }], "id": 5639908, "name": "VariableDeclaration", "src": "191:6:11" }, { "attributes": { "name": "y", "type": "uint256" }, "children": [{ "attributes": { "name": "uint" }, "id": 5639988, "name": "ElementaryTypeName", "src": "199:4:11" }], "id": 5640076, "name": "VariableDeclaration", "src": "199:6:11" }], "id": 5640156, "name": "ParameterList", "src": "190:16:11" }, { "children": [], "id": 5640212, "name": "Block", "src": "212:17:11" }], "id": 5640276, "name": "FunctionDefinition", "src": "167:62:11" }], "id": 5640396, "name": "ContractDefinition", "src": "0:231:11" }], "name": "SourceUnit" } }, ast: { "legacyAST": { "children": [{ "attributes": { "fullyImplemented": true, "isLibrary": false, "linearizedBaseContracts": [5640396], "name": "test" }, "children": [{ "attributes": { "name": "x", "type": "int256" }, "children": [{ "attributes": { "name": "int" }, "id": 5657860, "name": "ElementaryTypeName", "src": "21:3:11" }], "id": 5658100, "name": "VariableDeclaration", "src": "21:5:11" }, { "attributes": { "name": "y", "type": "int256" }, "children": [{ "attributes": { "name": "int" }, "id": 5658180, "name": "ElementaryTypeName", "src": "38:3:11" }], "id": 5658268, "name": "VariableDeclaration", "src": "38:5:11" }, { "attributes": { "constant": false, "name": "set", "public": true }, "children": [{ "children": [{ "attributes": { "name": "_x", "type": "int256" }, "children": [{ "attributes": { "name": "int" }, "id": 5658404, "name": "ElementaryTypeName", "src": "68:3:11" }], "id": 5658492, "name": "VariableDeclaration", "src": "68:6:11" }], "id": 5658572, "name": "ParameterList", "src": "67:8:11" }, { "children": [{ "attributes": { "name": "_r", "type": "int256" }, "children": [{ "attributes": { "name": "int" }, "id": 5658628, "name": "ElementaryTypeName", "src": "85:3:11" }], "id": 5658716, "name": "VariableDeclaration", "src": "85:6:11" }], "id": 5658796, "name": "ParameterList", "src": "84:8:11" }, { "children": [{ "children": [{ "attributes": { "operator": "=", "type": "int256" }, "children": [{ "attributes": { "type": "int256", "value": "x" }, "id": 5658900, "name": "Identifier", "src": "108:1:11" }, { "attributes": { "type": "int256", "value": "_x" }, "id": 5658980, "name": "Identifier", "src": "112:2:11" }], "id": 5657492, "name": "Assignment", "src": "108:6:11" }], "id": 5659028, "name": "ExpressionStatement", "src": "108:6:11" }, { "children": [{ "attributes": { "operator": "=", "type": "int256" }, "children": [{ "attributes": { "type": "int256", "value": "y" }, "id": 5659116, "name": "Identifier", "src": "125:1:11" }, { "attributes": { "string": null, "type": "int_const 10", "value": "10" }, "id": 5659196, "name": "Literal", "src": "129:2:11" }], "id": 5659252, "name": "Assignment", "src": "125:6:11" }], "id": 5659316, "name": "ExpressionStatement", "src": "125:6:11" }, { "children": [{ "attributes": { "operator": "=", "type": "int256" }, "children": [{ "attributes": { "type": "int256", "value": "_r" }, "id": 5659428, "name": "Identifier", "src": "141:2:11" }, { "attributes": { "type": "int256", "value": "x" }, "id": 5639308, "name": "Identifier", "src": "146:1:11" }], "id": 5639356, "name": "Assignment", "src": "141:6:11" }], "id": 5639420, "name": "ExpressionStatement", "src": "141:6:11" }], "id": 5639516, "name": "Block", "src": "97:57:11" }], "id": 5639612, "name": "FunctionDefinition", "src": "55:99:11" }, { "attributes": { "constant": false, "name": "get", "public": true }, "children": [{ "children": [], "id": 5639764, "name": "ParameterList", "src": "179:2:11" }, { "children": [{ "attributes": { "name": "x", "type": "uint256" }, "children": [{ "attributes": { "name": "uint" }, "id": 5639820, "name": "ElementaryTypeName", "src": "191:4:11" }], "id": 5639908, "name": "VariableDeclaration", "src": "191:6:11" }, { "attributes": { "name": "y", "type": "uint256" }, "children": [{ "attributes": { "name": "uint" }, "id": 5639988, "name": "ElementaryTypeName", "src": "199:4:11" }], "id": 5640076, "name": "VariableDeclaration", "src": "199:6:11" }], "id": 5640156, "name": "ParameterList", "src": "190:16:11" }, { "children": [], "id": 5640212, "name": "Block", "src": "212:17:11" }], "id": 5640276, "name": "FunctionDefinition", "src": "167:62:11" }], "id": 5640396, "name": "ContractDefinition", "src": "0:231:11" }], "name": "SourceUnit" } },
source: `contract test { source: `contract test {
int x; int x;

@ -2,6 +2,8 @@
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"types": ["node"], "types": ["node"],
"module": "commonjs",
"esModuleInterop": true,
}, },
"include": ["**/*.ts"] "include": ["**/*.ts"]
} }

@ -4,7 +4,7 @@
"module": "commonjs", "module": "commonjs",
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"declaration": true, "declaration": true,
"rootDir": "./src", "rootDir": "./",
"types": ["node"] "types": ["node"]
}, },
"exclude": ["**/*.spec.ts"], "exclude": ["**/*.spec.ts"],

@ -1,4 +1,3 @@
'use strict'
const EventManager = require('./src/eventManager') const EventManager = require('./src/eventManager')
const traceHelper = require('./src/helpers/traceHelper') const traceHelper = require('./src/helpers/traceHelper')
const uiHelper = require('./src/helpers/uiHelper') const uiHelper = require('./src/helpers/uiHelper')
@ -30,7 +29,7 @@ const TraceManager = require('./src/trace/traceManager')
const UniversalDApp = require('./src/universalDapp') const UniversalDApp = require('./src/universalDapp')
if (typeof (module) !== 'undefined' && typeof (module.exports) !== 'undefined') { if (typeof (module) !== 'undefined' && typeof (module.exports) !== 'undefined') {
exports = modules() module.exports = modules()
} }
function modules () { function modules () {
@ -64,7 +63,7 @@ function modules () {
EventsDecoder: EventsDecoder, EventsDecoder: EventsDecoder,
txExecution: txExecution, txExecution: txExecution,
txHelper: txHelper, txHelper: txHelper,
executionContext: executionContext, executionContext: new executionContext(),
txFormat: txFormat, txFormat: txFormat,
txListener: txListener, txListener: txListener,
txRunner: txRunner, txRunner: txRunner,

@ -37,7 +37,6 @@
"tape": "^4.6.0" "tape": "^4.6.0"
}, },
"scripts": { "scripts": {
"lint": "standard",
"test": "./../../node_modules/.bin/tape ./test/tests.js" "test": "./../../node_modules/.bin/tape ./test/tests.js"
}, },
"repository": { "repository": {

@ -326,4 +326,4 @@ const transactionDetailsLinks = {
'Goerli': 'https://goerli.etherscan.io/tx/' 'Goerli': 'https://goerli.etherscan.io/tx/'
} }
module.exports = new ExecutionContext() module.exports = ExecutionContext

@ -5,7 +5,7 @@ const txHelper = require('../src/execution/txHelper')
const util = require('../src/util') const util = require('../src/util')
let compiler = require('solc') let compiler = require('solc')
const compilerInput = require('../src/helpers/compilerHelper').compilerInput const compilerInput = require('../src/helpers/compilerHelper').compilerInput
const executionContext = require('../src/execution/execution-context') const executionContext = require('../').execution.executionContext
const solidityVersion = 'v0.6.0+commit.26b70077' const solidityVersion = 'v0.6.0+commit.26b70077'
/* tape *********************************************************** */ /* tape *********************************************************** */

2228
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -131,6 +131,7 @@
}, },
"dependencies": { "dependencies": {
"@remixproject/engine": "^0.2.3", "@remixproject/engine": "^0.2.3",
"@types/tape": "^4.2.33",
"ethereumjs-block": "^2.2.2", "ethereumjs-block": "^2.2.2",
"ethereumjs-tx": "^2.1.2", "ethereumjs-tx": "^2.1.2",
"ethereumjs-vm": "4.1.3", "ethereumjs-vm": "4.1.3",
@ -204,6 +205,7 @@
"npm-link-local": "^1.1.0", "npm-link-local": "^1.1.0",
"npm-merge-driver": "^2.3.5", "npm-merge-driver": "^2.3.5",
"npm-run-all": "^4.0.2", "npm-run-all": "^4.0.2",
"nyc": "^13.3.0",
"onchange": "^3.2.1", "onchange": "^3.2.1",
"prettier": "1.19.1", "prettier": "1.19.1",
"remix-tabs": "1.0.48", "remix-tabs": "1.0.48",
@ -214,6 +216,7 @@
"semver": "^6.1.2", "semver": "^6.1.2",
"solc": "^0.6.0", "solc": "^0.6.0",
"swarmgw": "^0.3.1", "swarmgw": "^0.3.1",
"tap-spec": "^5.0.0",
"tape": "^4.13.3", "tape": "^4.13.3",
"ts-node": "~7.0.0", "ts-node": "~7.0.0",
"tslint": "~6.0.0", "tslint": "~6.0.0",

@ -104,7 +104,7 @@
"outputPath": "dist/libs/remix-analyzer", "outputPath": "dist/libs/remix-analyzer",
"tsConfig": "libs/remix-analyzer/tsconfig.lib.json", "tsConfig": "libs/remix-analyzer/tsconfig.lib.json",
"packageJson": "libs/remix-analyzer/package.json", "packageJson": "libs/remix-analyzer/package.json",
"main": "libs/remix-analyzer/src/index.ts", "main": "libs/remix-analyzer/index.ts",
"assets": ["libs/remix-analyzer/*.md"] "assets": ["libs/remix-analyzer/*.md"]
} }
} }
@ -131,9 +131,6 @@
"builder": "@nrwl/workspace:run-commands", "builder": "@nrwl/workspace:run-commands",
"options": { "options": {
"commands": [ "commands": [
{
"command": "rm -rf ../../dist"
},
{ {
"command": "./../../node_modules/.bin/npm-run-all test" "command": "./../../node_modules/.bin/npm-run-all test"
} }
@ -142,17 +139,13 @@
} }
}, },
"build": { "build": {
"builder": "@nrwl/workspace:run-commands", "builder": "@nrwl/node:package",
"options": { "options": {
"commands": [ "outputPath": "dist/libs/remix-astwalker",
{ "tsConfig": "libs/remix-astwalker/tsconfig.lib.json",
"command": "rm -rf ../../dist" "packageJson": "libs/remix-astwalker/package.json",
}, "main": "libs/remix-astwalker/src/index.ts",
{ "assets": ["libs/remix-astwalker/*.md"]
"command": "./../../node_modules/.bin/npm-run-all build"
}
],
"cwd": "libs/remix-astwalker"
} }
} }
} }
@ -211,9 +204,6 @@
"builder": "@nrwl/workspace:run-commands", "builder": "@nrwl/workspace:run-commands",
"options": { "options": {
"commands": [ "commands": [
{
"command": "rm -rf ../../dist"
},
{ {
"command": "./../../node_modules/.bin/npm-run-all test" "command": "./../../node_modules/.bin/npm-run-all test"
} }

Loading…
Cancel
Save