Commit Graph

97 Commits

Author SHA1 Message Date
Iuri Matias d328b9953a chore: update site urls 2020-01-28 12:07:17 -05:00
Michael Bradley, Jr 0d1da2971c chore(release): 5.1.0 2020-01-27 12:33:50 -06:00
EmbarkBot c891c2de95 chore(prerelease): 5.1.0-nightly.6 2020-01-25 00:12:13 +00:00
Iuri Matias 292331f229 bugfix(@embark/console): fix included package files 2020-01-24 15:21:58 -05:00
EmbarkBot 84448f8732 chore(prerelease): 5.1.0-nightly.5 2020-01-24 00:10:58 +00:00
dependabot-preview[bot] 9caa424aeb build(deps): bump solc from 0.5.0 to 0.6.1
Make various related changes to templates, tests, etc. The methodology for
finding files that needed changes was to search through the whole monorepo for
the strings "solc" and "solidity" and then inspect the hits to see whether
changes were needed/appropriate.

Remove `solc` as a dependency in `packages/embark/package.json` so that it's
only a proper dependency in `packages/plugins/solidity/package.json`. Adjust
how the "bundled" `solc` package's version is determined, i.e. inspect the
`package.json` of `embark-solidity` instead of `embark`.

When `solc`'s version is `>=0.6.0` use the [new callback API][api].

[api]: https://github.com/ethereum/solc-js/blob/master/README.md#example-usage-with-import-callback
2020-01-23 14:20:42 -05:00
Pascal Precht d0d584a934 refactor(@embark/core): move console source out of lib folder 2020-01-23 10:11:58 -05:00
Pascal Precht 63e83dcfce refactor(@embark/core): migrate console module tests to jets and embark-testing 2020-01-23 10:11:58 -05:00
EmbarkBot e8b5c7ab89 chore(prerelease): 5.1.0-nightly.4 2020-01-23 00:13:38 +00:00
dependabot-preview[bot] 6bc1687f81 build(deps): bump follow-redirects from 1.8.0 to 1.9.0
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.8.0 to 1.9.0.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.8.0...v1.9.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-22 15:04:49 -06:00
EmbarkBot 99d629c8a0 chore(prerelease): 5.1.0-nightly.3 2020-01-22 00:13:43 +00:00
EmbarkBot bfda1b3124 chore(prerelease): 5.1.0-nightly.2 2020-01-21 00:12:55 +00:00
Michael Bradley, Jr 3ceffa8454 chore(@embark/suggestions): include suggestions.json in the files to be packed by npm
And remove `suggestions.json` in the `"files"` list of
`packages/core/console/package.json` since it was moved to
`packages/plugins/suggestions/suggestions.json`.
2020-01-20 12:13:56 -06:00
EmbarkBot c98e769d0d chore(prerelease): 5.1.0-nightly.1 2020-01-20 09:57:35 -06:00
Michael Bradley, Jr c093cf88ea feat: support Node.js v12.x and newer
Remove the `<12.0.0` restriction re: Node.js version in the `"engines"`
settings for all the packages in the monorepo that had that restriction.

Add missing `"engines"` settings in `packages/plugins/snark/package.json`.

Adjust the Azure Pipelines config to include builds for Node.js v12.x and
v13.x.

Bump `solc` to `0.4.26` in `dapps/tests/app` and `dapps/tests/contracts`. It
was discovered that older versions suffered a fatal `Maximum call stack size
exceeded` error when run on Windows with Node.js v12.x or newer. Display a
warning re: the bad combo (solc version + Windows + Node version) if it's
detected at runtime.

Adjust the root `yarn.lock` so that the `sha3` transitive dependency resolves
to a newer version that is compatible with Node v13.x.
2020-01-20 08:28:24 -06:00
Pascal Precht a2244019c9 refactor(@embark/suggestions): move suggestions API into plugin 2020-01-20 11:35:29 +01:00
dependabot-preview[bot] 61bf7d5b16 build(deps): bump pretty-ms from 5.0.0 to 5.1.0
Bumps [pretty-ms](https://github.com/sindresorhus/pretty-ms) from 5.0.0 to 5.1.0.
- [Release notes](https://github.com/sindresorhus/pretty-ms/releases)
- [Commits](https://github.com/sindresorhus/pretty-ms/compare/v5.0.0...v5.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-01-19 17:02:37 -06:00
EmbarkBot 4d44e29b3c chore(prerelease): 5.1.0-nightly.0 2020-01-17 00:15:31 +00:00
Iuri Matias 9aeddaa998 chore: rename org references from embark-framework to embarklabs 2020-01-16 15:36:29 -05:00
Jonathan Rainville 6db8d8750a feat(@embark/nethermind): add Nethermind blockchain client plugin 2020-01-16 10:15:18 -05:00
Jonathan Rainville 4190d5ec65 fix(@embark/utils): fix deconstruct url to return port as an integer
(cherry picked from commit e41a1d58c11b9808e8d2827e73ed98bce6d82d22)
2020-01-16 10:15:18 -05:00
Michael Bradley, Jr 9aa9e6cf5a build(deps): replace ethereumjs-wallet@0.6.3 with @embarklabs/ethereumjs-wallet@0.6.4
See: https://github.com/embark-framework/ethereumjs-wallet/releases/tag/v0.6.4
See also: https://www.npmjs.com/package/@embarklabs/ethereumjs-wallet?activeTab=versions

The primary difference is that `ethereumjs-wallet@0.6.3` is depdendent on a
version of `scrypt.js` that has the [older `scrypt`][old-scrypt] package as an
optional depdendency; whereas `@embarklabs/ethereumjs-wallet` depends on
[`@web3-js/scrypt-shim`][web3-scrypt] (authored by @michaelsbradleyjr), which
checks for the availability of
[Node's built-in scrypt KDF][builtin-kdf] (Node.js `>= 10.5.0`) and uses that,
or else falls back to a pure JS implementation provided by the `scryptsy`
package.

[old-scrypt]: https://github.com/barrysteyn/node-scrypt
[web3-scrypt]: https://github.com/web3-js/scrypt-shim
[builtin-kdf]: https://nodejs.org/docs/latest-v10.x/api/crypto.html#crypto_crypto_scrypt_password_salt_keylen_options_callback
2020-01-15 11:31:50 -05:00
Pascal Precht 23adb0ced7 test(@embark/code-runner): add unit tests for code-runner module 2020-01-15 11:30:31 -05:00
Michael Bradley, Jr ba0d6d17f3 chore(release): 5.0.0 2020-01-07 12:14:37 -06:00
Michael Bradley, Jr 902dba0c02 chore(release): 5.0.0-beta.0 2020-01-03 09:37:36 -06:00
Iuri Matias b02b7ec751 chore(release): 5.0.0-alpha.10 2019-12-24 15:27:23 -05:00
Iuri Matias 472efbbf6e chore(release): 5.0.0-alpha.9 2019-12-20 18:13:47 -05:00
Michael Bradley, Jr 7e550f0e6f build(deps): bump web3[-*] from 1.2.1 to 1.2.4
Refactor typings as necessary. In order for `bignumber.js` in the root
`node_modules` to not conflict with `@types/bignumber.js`, specify
`"bignumber.js": "5.0.0"` in `devDependencies` and `"embark-ui/bignumber.js"`
in `nohoist` of the root `package.json`.

In `packages/plugins/rpc-manager` switch from callback to promise usage with
respect to `web3.eth.accounts.signTransaction` because of a [bug][bug]
discovered in web3 v1.2.4.

In `packages/plugins/solidity-tests` specialize the tsc compiler options with
`"skipLibCheck": true` because of a problematic web3-related typing in the
`.d.ts` files of the remix-tests package.

Bump ganache-cli from 6.4.3 to 6.7.0 (latest) because 6.4.3 doesn't support
`eth_chainId` but web3 1.2.4 makes use of the `eth_chainId` RPC method (EIP
695).

BREAKING CHANGE: bump embark's minimum supported version of parity from
`>=2.0.0` to `>=2.2.1`. This is necessary since web3 1.2.4 makes use of the
`eth_chainId` RPC method (EIP 695) and that parity version is the earliest one
to implement it.

[bug]: https://github.com/ethereum/web3.js/issues/3283
2019-12-20 08:35:48 -06:00
Iuri Matias 4091296924 chore(release): 5.0.0-alpha.8 2019-12-19 14:14:23 -05:00
Jonathan Rainville 03bd49cf64 fix(@embark/rpc-manager): fix duplicated accounts in rpc manager
Was caused by the fact that each rpc-modifier got its own node
accounts, but once the eth_accounts modifier is enabled, the
"node" accounts are always going to contain the custom accounts too
Now, the node accounts are set once eth_accounts is initiated, so
that every modifier is on the same page
Also implement a second layer of protection to make sure that if a
duplication happens, it is gotten rid of
2019-12-19 11:19:03 -05:00
Iuri Matias f72d6f2915 chore(release): 5.0.0-alpha.7 2019-12-18 12:07:13 -05:00
Pascal Precht fba4ccfee8 refactor(@embark/engine): move back to arrow functions and ...args
As discussed in https://github.com/embark-framework/embark/pull/2143#issuecomment-566671315
2019-12-18 11:22:45 -05:00
Iuri Matias 5893bc38b9 chore(release): 5.0.0-alpha.6 2019-12-17 15:41:00 -05:00
Pascal Precht 920b07853a fix(@embark/engine): ensure deployment hook logs don't produce unexpected output
Since ee56f37713, any deployment hook that
was using simple `console.log()` statements to output information, would result in
unexpected `[[object object], [object object]]`.

Unfortunately, the reason for that was that we switched from non-arrow functions to
arrow functions [here](ee56f37713 (diff-a7c4cef8bfebeb39fcd092aca5570fecL324-L340)). Usually switching from non-arrow functions to arrow functions solves
a lot of lexical scope issues where the current reference of `this` isn't pointing at the
right thing.

We're tempering with the global `console.log` inside Embark, which then, combined with
**proper** lexical scope, causes the output described above.

Generally there are a few ways to go about this:

1. Ensure that our custom log functions doesn't turn every log statement into an array output
2. Tell users not to use `console.log` inside deployment hooks and instead rely on `deps.logger`
3. Revert the changes made in the mentioned commit and use non-arrow functions inside `interceptLogs`

Option 2) is not really a solution as we can't simply tell our users that they can't use one of
the most used functions in JavaScript. Option 1) requires finding out why we're formatting logs
by default in an array shapre in the first place. On top of that, we might be relying on this
inside Embark, so it could break certain output.

Option 3) seems to be the most pragmatic solution for now as it doesn't introduce any of the
downsides mentioned above at the cost of using non-arrow functions.
2019-12-17 10:42:14 -05:00
Iuri Matias 78a06c9d76 chore(release): 5.0.0-alpha.5 2019-12-16 13:49:41 -05:00
Michael Bradley, Jr ee56f37713 build: implement collective typecheck
This PR replaces #2057.

Implement a collective typecheck action that can be invoked in the root of the
monorepo with `yarn typecheck` or in watch-mode with `yarn watch:typecheck`.
Include the watch-mode typecheck action as part of `yarn start` (a.k.a
`yarn watch`).

To activate collective typecheck for a package in the monorepo, its
`package.json` file should specify:

```
{
  "embark-collective": {
    "typecheck": true
  }
}
```
*-or-*
```
{
  "embark-collective": {
    "typecheck": {...}
  }
}
```

Where `{...}` above is a `tsconfig.json` fragment that will be merged into the
config generated for the package according the same rules that `tsc` applies
when merging [configs][config].

When collective typecheck begins, it generates a `tsconfig.json` for the root
of the monorepo and for each package that is activated for the action. If the
generated JSON is different than what's on disk for the respective root/package
config, or if the config is not present on disk, then it will be
written. Changes to generated `tsconfig.json` files should be committed; such
changes will arise when there are structural changes to the monorepo, e.g. a
package is added, removed, moved and/or the directory containing it is
renamed. Since the configs are only generated at the beginning of collective
typecheck, when structural changes are made in the monorepo `yarn typecheck`
(or `yarn start` or `yarn watch:typecheck`) should be restarted.

Nearly all of the packages in the monorepo (i.e. all those for which it makes
sense) have been activated for collective typecheck. Even those packages that
don't contain `.ts` sources are activated because `tsc` can make better sense
of the code base as a whole owing to the project references included in the
generated `tsconfig.json` files. Also, owing to the fully cross-referenced
`tsconfig.json` files, it's possible for `tsc` to type check the whole code
base without babel (`yarn build` or `yarn watch:build`) having been run
beforehand.

**NOTE** that a *"cold typecheck"* of the whole monorepo is resource intensive:
on this author's 2019 MacBook Pro it takes around three minutes, the fans spin
up, and `tsc` uses nearly 0.5 GB of RAM. However, once a full typecheck has
completed, the next full typecheck will complete in a few seconds or less; and
when running in watch-mode there is likewise a *big* speedup once a full
typecheck has completed, whether that full check happened before it's running
in watch-mode or when watch-mode itself resulted in a full check before
switching automatically to incremental check, as well a corresponding *big*
reduction in resource consumption. A full check will be needed any time
`yarn typecheck` (or `yarn start` or `yarn watch:typecheck`) is run in a fresh
clone plus `yarn install`, or after doing `yarn reboot[:full]` or `yarn reset`.

The combination of options in each generated package-level `tsconfig.json` and
the root `tsconfig.base.json` result in `tsc` writing `.d.ts` files (TypeScript
declaration files) into the `dist/` directory of each package. That
output is intended to live side-by-side with babel's output, and therefore the
`"rootDir"` option in each generated config is set to `"./src"`.

In projects activated for collective typecheck, `.js` may be converted to `.ts`
and/or `.ts` sources may be added without any additional changes needed in
package-level `package.json`.

---

Reorganize types in `packages/core/typings` (a.k.a `@types/embark`) into
`packages/core/core` (`embark-core`), refactor other packages' imports
accordingly, and delete `packages/core/typings` from the monorepo. This results
in some similarly named but incompatible types exported from `embark-core`
(e.g. `Events` and `EmbarkEvents`, the latter being the one from
`packages/core/typings`); future refactoring should consolidate those types. To
avoid circular dependency relationships it's also necessary to split out
`Engine` from `embark-core` into its own package (`embark-engine`) and to
introduce a bit of duplication, e.g. the `Maybe` type that's now defined in
both `embark-i18n` and `embark-core`.

In the process of the types reorg, move many dependencies spec'd in various
`package.json` to the `package.json` of the package/s that actually depend on
them, e.g. many are moved from `packages/embark/package.json` to
`packages/core/engine/package.json`. Related to those moves, fix some Node.js
`require`-logic related to bug-prone dependency resolution.

Fix all type errors that appeared as a result of activating collective
typecheck across the whole monorepo.

Reactivate `tslint` in `packages/core/core` and fix the remaining linter errors.

Tidy up and add a few items in the root `package.json` scripts.

Bump lerna from `3.16.4` to `3.19.0`.

Bumpt typescript from `3.6.3` to `3.7.2`.

Bumpt tslint from `5.16.0` to `5.20.1`.

Make various changes related to packages' `import`/`require`ing packages that
weren't spec'd in their respective `package.json`. More refactoring is needed
in this regard, but changes were made as the problems were observed in the
process of authoring this PR.

[config]: https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
2019-12-13 13:59:47 -05:00
Jonathan Rainville 0503bb24a3 fix: fix node connection test to use the endpoints correctly
This caused issues to connect to Infura for example, because we did
not support HTTPS at all, nor WSS
2019-12-13 10:38:53 -05:00
Iuri Matias b25ade64f0 bugfix(@embark/core): remove contracts from path which was causing getting contracts from npm packages not to work 2019-12-12 15:27:40 -05:00
Iuri Matias c00511a0e2 chore(release): 5.0.0-alpha.4 2019-12-12 11:38:22 -05:00
emizzle acd1d72f2d fix(@embark/tests): Tests exiting early
Tests were exiting early and Mocha was reporting an exit code of 0. This allowed CI to complete as if the tests were successful.

Change `compiler:contracts` event request to `compiler:contracts:compile` and update documentation. Because the `compiler:contracts` event didn’t exist, this test was silently failing.

Update the `TestEvents` mock object to allow passing of parameters to an event that is not a callback.

Add unit tests to test for contracts loaded via node_modules.

1. This PR contains a change where any contracts loaded from node_modules will be imported in to `.embark/contracts/node_modules`. Previously, these contracts were loaded in to `.embark/node_modules` (with the `/contracts`).
2019-12-11 11:27:45 -05:00
emizzle bd4b110a78 feat(@embark/whisper): Add Whisper client config
Add option in communication config to choose which Whisper client to use.

Because Parity’s implementation of Whisper is not compatible with Whisper v6, and therefore web3.js in its current form, the following changes have been made:
1. remove any functionality associated with launching a Parity Whisper process.
2. Warn the user when the Parity Whisper client has been opted for in the communication config.
3. Return an error for API calls when Parity Whisper client has been opted for in the communication config.
4. Update Cockpit’s Communication module to show errors returned from API calls.
5. Update the messaging configuration documentation for the new communication client option.
2019-12-11 11:12:18 -05:00
Jonathan Rainville b82a240933 fix(@embark/test): fix using --node option in tests 2019-12-11 11:05:12 -05:00
Jonathan Rainville eae97dee4f fix(@embark/proxy): fix conflict for WS port in the proxy
This error arose when using tests parallel to Embark
2019-12-11 11:05:12 -05:00
Iuri Matias 37ae942b99 chore(release): 5.0.0-alpha.3 2019-12-06 06:15:07 -05:00
Michael Bradley, Jr 6044576ca0 refactor(@embark/core): spec embark-whisper-* as deps of embark-core instead of embark
It is unnecessary and not a good idea for `packages/embark` to provide
dependencies to other monorepo packages via any kind of transitive dependency
relationship. In this case, `embark` depended on `embark-core` and
`embark-core` needs `embark-whisper-*` packages but it's `embark` that supplies
those packages indirectly. It works out in the monorepo, *probably* in
production too, but we need to move away from that pattern completely.
2019-12-05 18:47:01 -05:00
Michael Bradley, Jr a5d06509a3 fix(@embark/core): spec embark-rpc-manager as a dependency 2019-12-05 18:03:53 -05:00
Iuri Matias 6efe791cfd chore(release): 5.0.0-alpha.2 2019-12-05 15:03:09 -05:00
Pascal Precht a7edca0be8 fix(@embark/core): don't exit in Engine consumer API
`Engine.startEngine(cb)` potentially exits the current process if
any registered plugins emits an error in the bootstrap phase.

This limits consumers of this API to react accordingly. Embark's APIs
should be considered library APIs that propagate errors, but let callers
decide what to do with them.

This commit ensures we keep propagating the error of `startEngine()` without
exiting the current process.
2019-11-29 12:57:19 +01:00
Michael Bradley, Jr 5f33b93b31 refactor(@embark/core): make 8547 the default port of communication provider node
Client traffic with the communication provider node, e.g. a whisper node, is
not proxied so make the default port 8547 instead of 8557. It's not a technical
problem for it to be 8557, but our convention to present has been for 855*
ports to be proxied while the upstream is an 854* port.

Update the boilerplate and demo templates to match.
2019-11-29 11:49:30 +01:00
Michael Bradley, Jr 86bc69b54a build(deps-dev): remove unneeded @types/os-locale dev-dep in packages/core/i18n 2019-11-27 09:44:21 -06:00