refactor(@embark/debugger): Move to embark-debugger

Move the debugger module to the `embark-debugger` package.

Handle case where `debug` is entered as a console command, and there is no transaction to be debugged.

add embark-i18n and mocha deps
This commit is contained in:
emizzle 2019-05-07 13:37:28 +10:00 committed by Pascal Precht
parent 46c4a5c79c
commit f5722546b1
9 changed files with 90 additions and 2 deletions

View File

@ -0,0 +1,4 @@
engine-strict = true
package-lock = false
save-exact = true
scripts-prepend-node-path = true

View File

@ -0,0 +1,6 @@
# `embark-debugger`
> Debugger component for Embark
Visit [embark.status.im](https://embark.status.im/) to get started with
[Embark](https://github.com/embark-framework/embark).

View File

@ -0,0 +1,68 @@
{
"name": "embark-debugger",
"version": "4.1.0-beta.0",
"author": "Iuri Matias <iuri.matias@gmail.com>",
"contributors": [],
"description": "Debugger component for Embark",
"homepage": "https://github.com/embark-framework/embark/tree/master/packages/embark-debugger#readme",
"bugs": "https://github.com/embark-framework/embark/issues",
"keywords": [
"blockchain",
"dapps",
"ethereum",
"ipfs",
"serverless",
"solc",
"solidity"
],
"files": [
"dist"
],
"license": "MIT",
"repository": {
"directory": "packages/embark-debugger",
"type": "git",
"url": "https://github.com/embark-framework/embark.git"
},
"main": "./dist/index.js",
"scripts": {
"build": "cross-env BABEL_ENV=node babel src --extensions \".ts\" --out-dir dist --root-mode upward --source-maps",
"ci": "npm run qa",
"clean": "npm run reset",
"lint": "npm-run-all lint:*",
"lint:ts": "tslint -c tslint.json \"src/**/*.ts\"",
"package": "npm pack",
"qa": "npm-run-all lint typecheck build package",
"reset": "npx rimraf dist embark-*.tgz package",
"start": "npm run watch",
"// test": "nyc --reporter=html --reporter=json mocha \"dist/test/**/*.js\" --exit --no-timeouts --require source-map-support/register",
"typecheck": "tsc",
"watch": "run-p watch:*",
"watch:build": "npm run build -- --verbose --watch",
"watch:typecheck": "npm run typecheck -- --preserveWatchOutput --watch"
},
"dependencies": {
"@babel/runtime-corejs2": "7.3.1",
"async": "2.6.1",
"colors": "1.3.2",
"embark-i18n": "^4.1.0-beta.0",
"remix-debug-debugtest": "0.2.16"
},
"devDependencies": {
"@babel/cli": "7.2.3",
"@babel/core": "7.2.2",
"cross-env": "5.2.0",
"mocha": "5.2.0",
"npm-run-all": "4.1.5",
"nyc": "13.1.0",
"rimraf": "2.6.3",
"source-map-support": "0.5.9",
"tslint": "5.16.0",
"typescript": "3.4.5"
},
"engines": {
"node": ">=8.12.0",
"npm": ">=6.4.1",
"yarn": ">=1.12.3"
}
}

View File

@ -256,6 +256,9 @@ class TransactionDebugger {
});
return;
}
if (this.lastTx === "") {
return callback(undefined, __("No transaction to debug"));
}
this.currentCmdTxHash = this.lastTx;
const filename: string = this.txTracker[this.lastTx].contract.filename;
startDebug(this.lastTx, filename, callback);

View File

@ -0,0 +1,4 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"]
}

View File

@ -0,0 +1,3 @@
{
"extends": "../../tslint.json"
}

View File

@ -101,6 +101,7 @@
"embark-console-listener": "^4.1.0-beta.0",
"embark-contracts-manager": "^4.1.0-beta.0",
"embark-core": "^4.1.0-beta.0",
"embark-debugger": "^4.1.0-beta.0",
"embark-deployment": "^4.1.0-beta.0",
"embark-deploy-tracker": "^4.1.0-beta.0",
"embark-ens": "^4.1.0-beta.0",
@ -165,7 +166,6 @@
"promptly": "2.2.0",
"propose": "0.0.5",
"pump": "3.0.0",
"remix-debug-debugtest": "0.2.16",
"remix-tests": "0.1.1",
"request": "2.88.0",
"sass-loader": "7.1.0",

View File

@ -232,7 +232,7 @@ class Engine {
this.registerModulePackage('embark-console-listener', {ipc: self.ipc});
this.registerModulePackage('embark-deployment', {plugins: this.plugins, onlyCompile: options.onlyCompile});
this.registerModulePackage('embark-transaction-tracker');
this.registerModule('debugger');
this.registerModulePackage('embark-debugger');
this.events.on('file-event', function ({fileType, path}) {
clearTimeout(self.fileTimeout);