refactor(@embark): remove the embark-async-wrapper package (#1911)

It's principal use was in `stack/compiler`, but that package was refactored
in #1878 to use async/await. There was a replica in
`packages/embark/src/lib/utils/async_extend.js` but it wasn't being used to do
async operations and could be replaced with `Object.entries().forEach()`. It
was required by `plugins/vyper` but the wrapper's custom `eachObject` method
wasn't being used. `stack/api` had it as a dependency but wasn't using it.
This commit is contained in:
Michael Bradley 2019-09-17 10:31:57 -05:00 committed by Iuri Matias
parent 6c5a4ce536
commit fe107546a8
12 changed files with 6 additions and 176 deletions

View File

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

View File

@ -1,53 +0,0 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [4.1.1](https://github.com/embark-framework/embark/compare/v4.1.0...v4.1.1) (2019-08-28)
**Note:** Version bump only for package embark-async-wrapper
# [4.1.0](https://github.com/embark-framework/embark/compare/v4.1.0-beta.6...v4.1.0) (2019-08-12)
**Note:** Version bump only for package embark-async-wrapper
# [4.1.0-beta.3](https://github.com/embark-framework/embark/compare/v4.1.0-beta.2...v4.1.0-beta.3) (2019-06-07)
**Note:** Version bump only for package embark-async-wrapper
# [4.1.0-beta.1](https://github.com/embark-framework/embark/compare/v4.1.0-beta.0...v4.1.0-beta.1) (2019-05-15)
**Note:** Version bump only for package embark-async-wrapper
# [4.0.0](https://github.com/embark-framework/embark/compare/v4.0.0-beta.2...v4.0.0) (2019-03-18)
**Note:** Version bump only for package embark-async-wrapper
# [4.0.0-beta.1](https://github.com/embark-framework/embark/compare/v4.0.0-beta.0...v4.0.0-beta.1) (2019-03-18)
### Features
* add repository.directory field to package.json ([a9c5e1a](https://github.com/embark-framework/embark/commit/a9c5e1a))
* create async wrapper ([bc24598](https://github.com/embark-framework/embark/commit/bc24598))
* normalize README and package.json bugs, homepage, description ([5418f16](https://github.com/embark-framework/embark/commit/5418f16))

View File

@ -1,6 +0,0 @@
# `embark-async-wrapper`
> Extensions to caolan/async used by Embark
Visit [embark.status.im](https://embark.status.im/) to get started with
[Embark](https://github.com/embark-framework/embark).

View File

@ -1,67 +0,0 @@
{
"name": "embark-async-wrapper",
"version": "4.1.1",
"author": "Iuri Matias <iuri.matias@gmail.com>",
"contributors": [],
"description": "Extensions to caolan/async used by Embark",
"homepage": "https://github.com/embark-framework/embark/tree/master/packages/embark-async-wrapper#readme",
"bugs": "https://github.com/embark-framework/embark/issues",
"keywords": [
"blockchain",
"dapps",
"ethereum",
"ipfs",
"serverless",
"solc",
"solidity"
],
"license": "MIT",
"repository": {
"directory": "packages/embark-async-wrapper",
"type": "git",
"url": "https://github.com/embark-framework/embark.git"
},
"main": "./dist/index.js",
"files": [
"dist"
],
"scripts": {
"build": "cross-env BABEL_ENV=node babel src --extensions \".js\" --out-dir dist --root-mode upward --source-maps",
"ci": "npm run qa",
"clean": "npm run reset",
"lint": "npm-run-all lint:*",
"lint:js": "eslint src/",
"// lint:ts": "tslint -c tslint.json \"src/**/*.ts\"",
"package": "npm pack",
"// qa": "npm-run-all lint typecheck build package",
"qa": "npm-run-all lint build package",
"reset": "npx rimraf dist embark-*.tgz package",
"start": "npm run watch",
"// typecheck": "tsc",
"watch": "run-p watch:*",
"watch:build": "npm run build -- --verbose --watch",
"// watch:typecheck": "npm run typecheck -- --preserveWatchOutput --watch"
},
"eslintConfig": {
"extends": "../../../.eslintrc.json"
},
"dependencies": {
"@babel/runtime-corejs2": "7.3.1",
"async": "2.6.1"
},
"devDependencies": {
"@babel/cli": "7.2.3",
"@babel/core": "7.2.2",
"cross-env": "5.2.0",
"eslint": "5.7.0",
"npm-run-all": "4.1.5",
"rimraf": "3.0.0",
"tslint": "5.16.0",
"typescript": "3.4.5"
},
"engines": {
"node": ">=8.12.0 <12.0.0",
"npm": ">=6.4.1",
"yarn": ">=1.12.3"
}
}

View File

@ -1,15 +0,0 @@
let async = require('async');
function asyncEachObject(object, iterator, callback) {
async.each(
Object.keys(object || {}),
function (key, next) {
iterator(key, object[key], next);
},
callback
);
}
async.eachObject = asyncEachObject;
module.exports = async;

View File

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

View File

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

View File

@ -1,5 +1,4 @@
import { __ } from 'embark-i18n';
const async = require('../utils/async_extend.js');
class ServicesMonitor {
constructor(options) {
@ -81,11 +80,10 @@ ServicesMonitor.prototype.startMonitor = function () {
self.addCheck(pluginCheck.checkName, pluginCheck.checkFn, pluginCheck.time);
});
async.eachObject(this.checkList, function (checkName, check, callback) {
self.initCheck(checkName);
callback();
}, function (err) {
if (err) {
Object.entries(this.checkList).forEach(([checkName, check]) => {
try {
self.initCheck(checkName);
} catch (err) {
self.logger.error(__("error running service check"));
self.logger.error(err.message);
}

View File

@ -1,15 +0,0 @@
let async = require('async');
function asyncEachObject(object, iterator, callback) {
async.each(
Object.keys(object || {}),
function (key, next) {
iterator(key, object[key], next);
},
callback
);
}
async.eachObject = asyncEachObject;
module.exports = async;

View File

@ -47,7 +47,7 @@
},
"dependencies": {
"@babel/runtime-corejs2": "7.3.1",
"embark-async-wrapper": "^4.1.1",
"async": "2.6.1",
"embark-i18n": "^4.1.1",
"shelljs": "0.8.3"
},

View File

@ -1,5 +1,5 @@
import { __ } from 'embark-i18n';
const async = require("embark-async-wrapper");
const async = require('async');
const shelljs = require('shelljs');
const path = require('path');

View File

@ -43,7 +43,6 @@
"dependencies": {
"@babel/runtime-corejs2": "7.3.1",
"colors": "1.3.2",
"embark-async-wrapper": "^4.1.1",
"embark-i18n": "^4.1.1",
"embark-utils": "^4.1.1"
},