mirror of https://github.com/embarklabs/embark.git
address changes in code review
This commit is contained in:
parent
68fbb50816
commit
81f6204ae4
|
@ -18,6 +18,13 @@
|
|||
"solc": "0.4.26"
|
||||
},
|
||||
"plugins": {
|
||||
"embark-ipfs": {},
|
||||
"embark-swarm": {},
|
||||
"embark-whisper-geth": {},
|
||||
"embark-geth": {},
|
||||
"embark-parity": {},
|
||||
"embark-profiler": {},
|
||||
"embark-graph": {},
|
||||
"embark-dapp-test-service": {}
|
||||
},
|
||||
"options": {
|
||||
|
|
|
@ -13,6 +13,13 @@
|
|||
"embarkjs-swarm": "^5.1.0",
|
||||
"embarkjs-web3": "^5.1.0",
|
||||
"embarkjs-whisper": "^5.1.0",
|
||||
"embark-ipfs": "^5.1.0",
|
||||
"embark-swarm": "^5.1.0",
|
||||
"embark-whisper-geth": "^5.1.0",
|
||||
"embark-geth": "^5.1.0",
|
||||
"embark-parity": "^5.1.0",
|
||||
"embark-profiler": "^5.1.0",
|
||||
"embark-graph": "^5.1.0",
|
||||
"fs-extra": "8.1.0",
|
||||
"haml": "0.4.3",
|
||||
"jquery": "3.4.0",
|
||||
|
|
|
@ -15,5 +15,12 @@
|
|||
"solc": "0.4.26"
|
||||
},
|
||||
"plugins": {
|
||||
"embark-ipfs": {},
|
||||
"embark-swarm": {},
|
||||
"embark-whisper-geth": {},
|
||||
"embark-geth": {},
|
||||
"embark-parity": {},
|
||||
"embark-profiler": {},
|
||||
"embark-graph": {}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,13 @@
|
|||
"embarkjs-swarm": "^5.1.0",
|
||||
"embarkjs-web3": "^5.1.0",
|
||||
"embarkjs-whisper": "^5.1.0",
|
||||
"embark-ipfs": "^5.1.0",
|
||||
"embark-swarm": "^5.1.0",
|
||||
"embark-whisper-geth": "^5.1.0",
|
||||
"embark-geth": "^5.1.0",
|
||||
"embark-parity": "^5.1.0",
|
||||
"embark-profiler": "^5.1.0",
|
||||
"embark-graph": "^5.1.0",
|
||||
"rimraf": "3.0.0"
|
||||
},
|
||||
"license": "MIT",
|
||||
|
|
|
@ -187,8 +187,7 @@ export class Config {
|
|||
context: this.context,
|
||||
env: this.env,
|
||||
version: this.version,
|
||||
client: this.client,
|
||||
locale: this.locale
|
||||
client: this.client
|
||||
});
|
||||
|
||||
this.loadEmbarkConfigFile();
|
||||
|
|
|
@ -34,8 +34,6 @@ export class Plugins {
|
|||
|
||||
client: string;
|
||||
|
||||
locale: string;
|
||||
|
||||
static deprecated = {
|
||||
'embarkjs-connector-web3': '4.1.0'
|
||||
};
|
||||
|
@ -52,7 +50,6 @@ export class Plugins {
|
|||
this.env = options.env;
|
||||
this.version = options.version;
|
||||
this.client = options.client;
|
||||
this.locale = options.locale;
|
||||
}
|
||||
|
||||
loadPlugins() {
|
||||
|
@ -93,8 +90,7 @@ export class Plugins {
|
|||
fs: this.fs,
|
||||
isInternal: true,
|
||||
context: this.context,
|
||||
client: this.client,
|
||||
locale: this.locale
|
||||
client: this.client
|
||||
});
|
||||
this.plugins.push(pluginWrapper);
|
||||
return pluginWrapper;
|
||||
|
@ -129,8 +125,7 @@ export class Plugins {
|
|||
isInternal: true,
|
||||
context: this.context,
|
||||
env: this.env,
|
||||
client: this.client,
|
||||
locale: this.locale
|
||||
client: this.client
|
||||
});
|
||||
const pluginInstance = pluginWrapper.loadInternalPlugin();
|
||||
this.plugins.push(pluginWrapper);
|
||||
|
@ -161,8 +156,7 @@ export class Plugins {
|
|||
isInternal: false,
|
||||
context: this.context,
|
||||
version: this.version,
|
||||
client: this.client,
|
||||
locale: this.locale
|
||||
client: this.client
|
||||
});
|
||||
pluginWrapper.loadPlugin();
|
||||
this.plugins.push(pluginWrapper);
|
||||
|
|
|
@ -97,7 +97,6 @@ export class Engine {
|
|||
locale: this.locale,
|
||||
|
||||
client: this.client,
|
||||
// plugins: this.plugins,
|
||||
ipc: this.ipc
|
||||
});
|
||||
this.config.loadConfigFiles({embarkConfig: this.embarkConfig, interceptLogs: this.interceptLogs});
|
||||
|
|
|
@ -308,18 +308,18 @@ export function isEs6Module(module) {
|
|||
export function warnIfPackageNotDefinedLocally(packageName, warnFunc) {
|
||||
const packageIsResolvable = findUp.sync("node_modules/" + packageName, {cwd: dappPath()});
|
||||
if (!packageIsResolvable) {
|
||||
return warnFunc("== WARNING: it seems " + packageName + " is not defined in your dapp package.json; In future versions of embark this package should be a local dependency and configured as a plugin");
|
||||
return warnFunc("== WARNING: " + packageName + " could not be resolved. ensure that is defined in your dapp's package.json and npm or yarn install was done; In future versions of embark this package should be a local dependency and configured as a plugin");
|
||||
}
|
||||
|
||||
const dappPackage = fs.readJSONSync(dappPath("package.json"));
|
||||
const { dependencies, devDependencies } = dappPackage;
|
||||
if (!((dependencies && dependencies[packageName]) || (devDependencies && devDependencies[packageName]))) {
|
||||
return warnFunc("== WARNING: it seems " + packageName + " is not defined in your dapp package.json dependencies; In future versions of embark this package should be a local dependency and configured as a plugin");
|
||||
return warnFunc("== WARNING: it seems " + packageName + " is not defined in your dapp's package.json dependencies; In future versions of embark this package should be a local dependency and configured as a plugin");
|
||||
}
|
||||
|
||||
const embarkConfig = fs.readJSONSync(dappPath("embark.json"));
|
||||
if (!embarkConfig.plugins[packageName]) {
|
||||
return warnFunc("== WARNING: it seems " + packageName + " is not defined in your dapp embark.json plugins; In future versions of embark this package should be a local dependency and configured as a plugin");
|
||||
return warnFunc("== WARNING: it seems " + packageName + " is not defined in your dapp's embark.json plugins; In future versions of embark this package should be a local dependency and configured as a plugin");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -13,7 +13,7 @@ class Geth {
|
|||
this.blockchainConfig = embark.config.blockchainConfig;
|
||||
this.communicationConfig = embark.config.communicationConfig;
|
||||
// TODO get options from config instead of options
|
||||
this.locale = embark.locale;
|
||||
this.locale = embark.config.locale;
|
||||
this.logger = embark.logger;
|
||||
this.client = embark.client;
|
||||
this.events = embark.events;
|
||||
|
|
|
@ -9,7 +9,7 @@ class GraphGenerator {
|
|||
this.events = embark.events;
|
||||
|
||||
this.events.setCommandHandler("graph:create", this.generate.bind(this));
|
||||
warnIfPackageNotDefinedLocally("embark-graph", this.embark.logger.info.bind(this.embark.logger));
|
||||
warnIfPackageNotDefinedLocally("embark-graph", this.embark.logger.warn.bind(this.embark.logger));
|
||||
}
|
||||
|
||||
/*eslint complexity: ["error", 21]*/
|
||||
|
|
|
@ -12,7 +12,7 @@ class Parity {
|
|||
this.embarkConfig = embark.config.embarkConfig;
|
||||
this.blockchainConfig = embark.config.blockchainConfig;
|
||||
// TODO get options from config instead of options
|
||||
this.locale = embark.locale;
|
||||
this.locale = embark.config.locale;
|
||||
this.logger = embark.logger;
|
||||
this.client = embark.client;
|
||||
this.events = embark.events;
|
||||
|
|
|
@ -12,7 +12,7 @@ class Profiler {
|
|||
|
||||
this.registerConsoleCommand();
|
||||
this.registerApi();
|
||||
warnIfPackageNotDefinedLocally("embark-profiler", this.embark.logger.info.bind(this.embark.logger));
|
||||
warnIfPackageNotDefinedLocally("embark-profiler", this.embark.logger.warn.bind(this.embark.logger));
|
||||
}
|
||||
|
||||
profileJSON(contractName, returnCb) {
|
||||
|
|
|
@ -112,10 +112,10 @@ export default class Blockchain {
|
|||
this.blockchainApi.registerRequests("ethereum");
|
||||
|
||||
if (this.blockchainConfig.enabled && this.blockchainConfig.client === "geth") {
|
||||
warnIfPackageNotDefinedLocally("embark-geth", this.embark.logger.info.bind(this.embark.logger));
|
||||
warnIfPackageNotDefinedLocally("embark-geth", this.embark.logger.warn.bind(this.embark.logger));
|
||||
}
|
||||
if (this.blockchainConfig.enabled && this.blockchainConfig.client === "parity") {
|
||||
warnIfPackageNotDefinedLocally("embark-parity", this.embark.logger.info.bind(this.embark.logger));
|
||||
warnIfPackageNotDefinedLocally("embark-parity", this.embark.logger.warn.bind(this.embark.logger));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ class Communication {
|
|||
});
|
||||
|
||||
if (this.communicationConfig.enabled && this.communicationConfig.available_providers.includes("whisper")) {
|
||||
warnIfPackageNotDefinedLocally("embark-whisper-geth", this.embark.logger.info.bind(this.embark.logger));
|
||||
warnIfPackageNotDefinedLocally("embark-whisper-geth", this.embark.logger.warn.bind(this.embark.logger));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,10 +44,10 @@ class Storage {
|
|||
});
|
||||
|
||||
if (this.storageConfig.enabled && this.storageConfig.available_providers.includes("ipfs")) {
|
||||
warnIfPackageNotDefinedLocally("embark-ipfs", this.embark.logger.info.bind(this.embark.logger));
|
||||
warnIfPackageNotDefinedLocally("embark-ipfs", this.embark.logger.warn.bind(this.embark.logger));
|
||||
}
|
||||
if (this.storageConfig.enabled && this.storageConfig.available_providers.includes("swarm")) {
|
||||
warnIfPackageNotDefinedLocally("embark-swarm", this.embark.logger.info.bind(this.embark.logger));
|
||||
warnIfPackageNotDefinedLocally("embark-swarm", this.embark.logger.warn.bind(this.embark.logger));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue