refactor(@embark/communication): move module into own package (#1899)

This commit is contained in:
Pascal Precht 2019-09-12 23:30:46 +02:00 committed by Iuri Matias
parent f54fbf0b3d
commit e282ae4974
8 changed files with 148 additions and 1 deletions

View File

@ -94,6 +94,7 @@
"embark-api": "^4.1.1",
"embark-authenticator": "^4.1.1",
"embark-code-runner": "^4.1.1",
"embark-communication": "^4.1.1",
"embark-compiler": "^4.1.1",
"embark-console": "^4.1.1",
"embark-contracts-manager": "^4.1.1",

View File

@ -172,7 +172,7 @@ class Engine {
this.registerModulePackage('embark-deployment', {plugins: this.plugins, onlyCompile: options.onlyCompile});
this.registerModule('blockchain-client');
this.registerModulePackage('embark-storage');
this.registerModule('communication');
this.registerModulePackage('embark-communication');
this.registerModulePackage('embark-namesystem');
this.registerModulePackage('embark-process-logs-api-manager');
this.registerModule('embark-embarkjs', {plugins: this.plugins});

View File

@ -0,0 +1,7 @@
# `embark-communication`
Communication APIs 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,44 @@
const cloneDeep = require('lodash.clonedeep');
module.exports = api => {
const env = api.env();
const base = {
plugins: [
'@babel/plugin-proposal-class-properties',
[
'@babel/plugin-transform-runtime',
{
corejs: 2
}
]
],
presets: ['@babel/preset-env']
};
if (env === 'base' || env.startsWith('base:')) {
return base;
}
const node = cloneDeep(base);
node.presets[0] = [
node.presets[0],
{
targets: { node: '8.11.3' }
}
];
if (env === 'node' || env.startsWith('node:')) {
return node;
}
const test = cloneDeep(node);
if (env === 'test') {
return test;
}
return {};
};

View File

@ -0,0 +1,86 @@
{
"name": "embark-communication",
"version": "4.1.1",
"author": "Iuri Matias <iuri.matias@gmail.com>",
"contributors": [],
"description": "Communication APIs for Embark",
"homepage": "https://github.com/embark-framework/embark/tree/master/packages/stack/communication#readme",
"bugs": "https://github.com/embark-framework/embark/issues",
"keywords": [
"blockchain",
"dapps",
"ethereum",
"ipfs",
"serverless",
"solc",
"solidity"
],
"files": [
"dist"
],
"license": "MIT",
"repository": {
"directory": "packages/stack/communication",
"type": "git",
"url": "https://github.com/embark-framework/embark.git"
},
"main": "./dist/index.js",
"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",
"test": "jest",
"// 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",
"clone-deep": "4.0.0",
"embark-core": "^4.1.1",
"embark-i18n": "^4.1.1",
"embark-utils": "^4.1.1"
},
"devDependencies": {
"@babel/cli": "7.5.5",
"@babel/core": "7.5.5",
"@babel/plugin-proposal-class-properties": "7.5.5",
"@babel/plugin-transform-runtime": "7.5.5",
"@babel/preset-env": "7.5.5",
"babel-jest": "24.9.0",
"cross-env": "5.2.0",
"embark-testing": "^5.0.0",
"eslint": "5.7.0",
"jest": "24.9.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"
},
"jest": {
"collectCoverage": true,
"testEnvironment": "node",
"testMatch": [
"**/test/**/*.js"
]
}
}

View File

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

View File

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