Commit Graph

139 Commits

Author SHA1 Message Date
Richard Ramos 939642f74c
Validation of datatypes + small refactoring 2018-10-23 10:59:16 +02:00
Richard Ramos d6de374ce7
Adding scaffold option to generate contract from scratch 2018-10-23 10:59:16 +02:00
emizzle 5d29ab1d42
Minor PR comments
Removed a null check and intialised `this.context` to an empty object.
2018-10-23 10:57:05 +02:00
emizzle d4d7e3b8ac
Addressed PR comments
*Console.js*
- Moved `DEFAULT_PROCESS` const to outside of the `Console` class (but inside the module).
- Removed `(` and `)` from `.filter` in `getProcessLogs()`.
- Updated comments

*logger.js*
- Moved `dateFormat` and `logRegex` to constants outside of `Logger` class
- Moved the `parseLogFile` method inside of the `Logger` class (ES6 style)
- Added a log limit to the `parseLogFile` method
- Added the log path to the constants file and used inside of `Logger`

*cmd_controller.js*
- Defaulted `this.context` to `[constants.context.any]` in the constructor.
- Changed `’embark’` to split modules`coreProcess` and `loggerApi`.

*engine.js*
- Changed `’embark’` to split modules`coreProcess` and `loggerApi`.
2018-10-23 10:57:04 +02:00
emizzle 0760965bda
Overwrite log file so .embark doesn’t bloat
The embark log file is being overwritten each time embark is run. There is a separate log file for each context, so that running, for example, `embark run` then `embark console` doesn’t get the `run` log overwritten with the `console` log.
2018-10-23 10:54:35 +02:00
emizzle 7de72cb474
Addressed PR feedback
- Created an “embark” module so that an “embark” process could be registered in the correct way. This service is only used on `embark run` (can be extended to other commands if needed).

- extracted “embark” to a const `DEFAULT_PROCESS` param in the `Console` component.

- extracted commands result rendering to it’s own function to keep the `renderTabs` function from getting cluttered

- Added sorting of logs by timestamp

- Added milliseconds to the log file data (which helps in sorting log messages).
2018-10-23 10:53:25 +02:00
Richard Ramos 2c0644b5cb
Changed scaffolding to service 2018-10-23 10:50:37 +02:00
Richard Ramos e5e8d21765
Installing react packages automatically 2018-10-23 10:50:04 +02:00
Richard Ramos deb9c9a838
Changed state handling on template and engine initialization 2018-10-23 10:50:03 +02:00
Richard Ramos b93d2d1145
Error handling, added overwrite, fixed duplication of components 2018-10-23 10:50:03 +02:00
Richard Ramos c8d357e601
Fix scaffolding command logic so it works with Embark 3.2.2 2018-10-23 10:48:36 +02:00
Jonathan Rainville 4e7a0389bb
fix eslint on EVERYTHING 2018-10-23 10:26:14 +02:00
Anthony Laibe 57874bac71
Use path embark-api 2018-10-23 10:22:37 +02:00
Iuri Matias 26d7e42218
move dashboard api into dashboard module 2018-10-23 10:20:09 +02:00
Anthony Laibe 8df718cf3c
Replace light monitor by REPL 2018-10-23 10:05:24 +02:00
Anthony Laibe bade74d2c2
Reuse Light Monitor 2018-10-23 10:05:23 +02:00
Jonathan Rainville 2a24c3cbf0
remove use of initConfig 2018-10-23 10:05:20 +02:00
Jonathan Rainville da6956695d
set isDev as default if there is no blockchain file 2018-10-23 10:05:20 +02:00
Richard Ramos 8861588726
Adding base command logic for scaffolding generation 2018-10-23 09:57:16 +02:00
Richard Ramos 668a25221f
Fixing framework loading 2018-10-23 09:42:09 +02:00
Richard Ramos 0eaafb77f1
Adding base command logic for scaffolding generation 2018-10-23 09:42:08 +02:00
Pascal Precht df2aa30fb4
fix(core/cmd_controller): ensure webserver host and port aren't set to undefined
We've introduced a regression in 6d75a4c6c4 where running
`embark run` breaks due to webserver options not being defined.

The reason this happened is because in the mentioned commit, we're checking given
webserver options with an identity check against `null` and only set dedicated
options, if that condition is true.

E.g.:

```
if (options.runWebserver !== null) {
  webServerConfig.enabled = options.runWebserver;
}
```

Unfortunately, due to one of JavaScript design flaws, this condition behaves totally
different when no identity check is done, which causes Embark to break.

Meaning that in JavaScript:

```
undefined != null // false
undefined !== null // true
```

In other words, after the mentioned commit, the condition is true, resulting
in several webserver configurations to be set to `undefined`.

This conflicts at runtime when we compose webserver configurations out of user input
and Embark's defaults here: dc5de7c1b4/lib/core/config.js (L392)

In other words, since webserver config options are already set to `undefined`,
they don't get overridden by our config algorithm.

This commit ensures that webserver config values are not set when their values
are either `null` or `undefined`.
2018-10-22 19:54:50 +02:00
Michael Bradley, Jr 6eae7a9a31
use a customized require/.resolve instead of relying on NODE_PATH
# Conflicts:
#	cmd/cmd.js
2018-10-22 19:54:49 +02:00
Jonathan Rainville ce3f9bdf25
fix a couple of bugs caused by bounties 2018-10-22 19:54:48 +02:00
Jonathan Rainville 7a70f5df26
use constants instead of magic numbers 2018-10-22 19:54:47 +02:00
Jonathan Rainville df218397cd
use lowercase for loglevel 2018-10-22 19:54:47 +02:00
Jonathan Rainville 0ef879d6a6
exit with 1 if there is an error in tests 2018-10-22 19:54:47 +02:00
Jonathan Rainville fe0b84349a
update noserver and nobrowser and fix noserver 2018-10-22 19:54:47 +02:00
Jonathan Rainville 75d9998c57
refactor to not use the blockchain_connector directly 2018-10-22 19:54:47 +02:00
Jonathan Rainville 7a83b02db5
fix logLevel 2018-10-22 19:54:46 +02:00
Jonathan Rainville f4d7636b7a
make code coverage work with refactored tests 2018-10-22 19:54:45 +02:00
Jonathan Rainville ddc8b36329
make tests work by using events 2018-10-22 19:54:45 +02:00
Jonathan Rainville ca3aea7923
BROKEN: solc doesnt load 2018-10-22 19:54:45 +02:00
Jonathan Rainville e8574f33eb
conflict in run_tests 2018-10-22 19:54:44 +02:00
Jonathan Rainville e6cad1675a
move test files to a module folder 2018-10-22 19:54:44 +02:00
Cryptomental 47dcb1552c
console, dashboard: Add persistent, automatically loaded history.
Add persistent automatically loaded history file for repl console
and Embark dashboard.

Default location of the history file is stored in DEFAULT_CMD_HISTORY_PATH
pointing to DAPP_PATH/.embark/cmd_history.

The history is automatically saved and loaded on startup.

test/console: Pass Embark object to constructor.

Update console test to pass Embark object to constructor.

Refs: https://github.com/embark-framework/embark/issues/939
2018-10-22 19:54:43 +02:00
Subramanian Venkatesan f686fec74a
ens resolve 2018-10-22 19:53:50 +02:00
Giuseppe Bertone 81e798c89c
Add support for Parity
Addons
 - New chain initialization and genesis management
 - Option to choose client to use
 - Option to "ping forever" for Geth
 - Creation and unlock of accounts at client's start
 - Utility to fund accounts with ethers
 - Miner settings inside the ethereum client
 - Workaround to CORS problem: origin is now http://embark
 - Several double callback's checks

Updates
 - Boilerplate, templates, configuration files and demo stuff
 - Messages and i18n strings
 - Tests

Fixes
 - Geth client now uses miner.gastarget instead of the deprecated targetGasLimit
 - Workaround for shh_version with Parity

Reworks of other PRs into the new code
 - Included delayed proxy
 - Send ready only when the proxy is started
 - Start HTTP and WS proxies individually
 - Async setupProxy
 - Fixed datadir for GethMiner
2018-10-22 19:53:49 +02:00
Pascal Precht 5fc9f076dd
fix(commands/graph): don't start blockchain node when generating graphs 2018-10-22 19:40:52 +02:00
Pascal Precht 80c80e9beb
fix(commands/build): don't start blockchain node when `--contracts` is used
Prior to this commit `$ embark build --contracts` spinned up a blockchain node
which is not necessary as `--contracts` can be seen as a "compile only" option.

This commit ensures we don't start any web3 services with `--contracts` is used.
2018-10-22 19:40:52 +02:00
Michael Bradley, Jr 965c22d108
bin/embark handles checkDeps 2018-10-22 19:39:27 +02:00
Michael Bradley, Jr fd856f8163
PKG_PATH, pkgPath 2018-10-22 19:39:26 +02:00
hodlbank f41bcd55d6
[f] Fix for #971 - "Fatal error when Ethereum node going offline".
[a] Added .once() into Events.
2018-10-22 19:39:26 +02:00
Subramanian Venkatesan ee77ac7f7f
Adds solc option to tests. Runs smart contract tests using remix-tests
Ref: #817
2018-10-22 19:39:24 +02:00
Pascal Precht a0ef234fea
feat(modules/pipeline): move pipeline into its own module plugin
This is the first step of refactoring Embark's pipeline abstraction into
dedicated plugin modules that take advantage of Embark's event system.

With this commit we're moving `Pipeline` into `lib/modules/pipeline` and
introduce a new command handler `pipeline:build`. Embark's engine now
requests builds via this command handler.

Notice that `Watch` still lives in `lib/pipeline` as this is a step-by-step
refactoring to reduce chances of introducing regressions.
2018-10-22 19:35:58 +02:00
Michael Bradley, Jr 882271dc60
rev file name to better reflect its purpose 2018-10-22 19:35:56 +02:00
Michael Bradley, Jr ae878fd7c8
extract copy/preserve logic into a helper in lib/core/fs
preserved files should end with <number>.<ext> vs. <ext>.<number>
2018-10-22 19:35:55 +02:00
Michael Bradley, Jr b2f56a9eb1
eject webpack overrides 2018-10-22 19:35:52 +02:00
Cryptomental 10bf3e4412
cmd, cmd_controller, graph: Add --output option to graph.
Add optional --output argument to graph generator. The argument allows
to specify a filepath for graph output. Default filepath is ./diagram.svg
if the argument is not specified.

Refs: https://github.com/embark-framework/embark/issues/944
2018-10-22 19:25:18 +02:00
Cryptomental 0483920421
cmd, run_tests: Add --nobrowser option for runCoverage.
Do not start browser during coverage run when --nobrowser option is passed.

Refs: https://github.com/embark-framework/embark/issues/941
2018-10-22 19:25:18 +02:00