Commit Graph

61 Commits

Author SHA1 Message Date
Michael Bradley, Jr 6dbdf63aeb chore(release): 6.0.0 2020-04-27 16:04:43 -05:00
Michael Bradley, Jr 5fc315409b chore(release): 5.3.0 2020-04-24 12:06:40 -05:00
EmbarkBot 1278365768 chore(prerelease): 5.3.0-nightly.16 2020-04-03 00:14:04 +00:00
Pascal Precht de8f2170ba fix(plugins/solc): don't read pluginConfig from plugin.config
In https://github.com/embarklabs/embark/pull/2330#discussion_r389906144 we've changed the `solc` plugin to read its
`pluginConfig` from `embark.config`. This was done under the assumption that
the `embark.config` is always properly populated with a dedicated `pluginConfig`.
In our testing environment we pass `Embark` objects to plugins, while in reality, we pass `Plugin` instances.
These two are different in nature, so relying on `embark.config` inside the plugin seemed the
most pragmatic way forward without introducing a bigger refactoring in the testing APIs.

Unfortunately it turned out that `embark.config` isn't populated with a `pluginConfig`
which essentially caused it to break apps.

This commit reverts that change done in the mentioned PR and patches the Embark testing
API to behave like a `Plugin` while still being an `Embark` instance.
2020-04-02 10:55:58 +02:00
EmbarkBot d578e548cf chore(prerelease): 5.3.0-nightly.14 2020-03-25 00:18:59 +00:00
Pascal Precht 0e32cc09b5 feat(utils/testing): introduce async/await for actions in tests 2020-03-24 14:49:03 +01:00
EmbarkBot 7f52634331 chore(prerelease): 5.3.0-nightly.12 2020-03-21 00:15:48 +00:00
emizzle 471a33a331 chore(@embark/blockchain): Add unit tests to blockchain stack component
fix(@embark/blockchain): Add callback to `blockchain:node:register` and `blockchain:client:register`

Add unit tests for the stack/blockchain and update supporting API documentation in the Wiki.

Add injectables `Web3` and `warnIfPackageNotDefinedLocally` to stack/blockchain so that those functions can be tested properly.

Update stack/blockchain dependencies in `package.json`.
2020-03-20 14:40:14 +01:00
emizzle 56d5b45bbb chore(@embark/testing): Add testables to embark test objects
1. Add IPC mock and assertions.
2. Add console command registration assertion and console command mock.
3. Add event emission assertions
2020-03-20 14:40:14 +01:00
EmbarkBot 7287eda651 chore(prerelease): 5.3.0-nightly.6 2020-03-07 00:14:47 +00:00
dependabot-preview[bot] afa1d14fa0 build(deps): bump async from 2.6.1 to 3.2.0
Bumps [async](https://github.com/caolan/async) from 2.6.1 to 3.2.0.
- [Release notes](https://github.com/caolan/async/releases)
- [Changelog](https://github.com/caolan/async/blob/master/CHANGELOG.md)
- [Commits](https://github.com/caolan/async/compare/v2.6.1...v3.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-06 12:51:09 -06:00
EmbarkBot b19a58b007 chore(prerelease): 5.3.0-nightly.5 2020-03-06 00:15:50 +00:00
dependabot-preview[bot] dcaa2626d9 build(deps-dev): bump eslint-plugin-jest from 22.5.1 to 23.8.1
Bumps [eslint-plugin-jest](https://github.com/jest-community/eslint-plugin-jest) from 22.5.1 to 23.8.1.
- [Release notes](https://github.com/jest-community/eslint-plugin-jest/releases)
- [Changelog](https://github.com/jest-community/eslint-plugin-jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jest-community/eslint-plugin-jest/compare/v22.5.1...v23.8.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-05 11:25:18 -06:00
EmbarkBot 838d421eac chore(prerelease): 5.3.0-nightly.4 2020-03-05 00:15:25 +00:00
dependabot-preview[bot] cb8ece8db5 build(deps): bump @babel/runtime-corejs3 from 7.7.4 to 7.8.4
Bumps [@babel/runtime-corejs3](https://github.com/babel/babel) from 7.7.4 to 7.8.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.7.4...v7.8.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-04 12:05:18 -06:00
EmbarkBot 8de6cf9fe0 chore(prerelease): 5.3.0-nightly.2 2020-03-03 00:14:47 +00:00
dependabot-preview[bot] ead92bd90f build(deps): bump @babel/core from 7.7.4 to 7.8.6
Bumps [@babel/core](https://github.com/babel/babel) from 7.7.4 to 7.8.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/master/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/compare/v7.7.4...v7.8.6)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-03-02 14:42:32 -06:00
EmbarkBot 1675019f44 chore(prerelease): 5.3.0-nightly.0 2020-02-27 00:13:54 +00:00
Pascal Precht 20567e5c03 chore(plugins/specialconfigs): update dependencies and add missing tests 2020-02-26 16:42:10 -05:00
Pascal Precht 4106a49379 feat(utils/testing): make mock apiCall() async
This is needed because API handlers are potentially async as well.
2020-02-26 15:14:49 -05:00
Pascal Precht 1a56d5f792 fix(utils/testing): ensure API mock works with `req.params` and method chaining 2020-02-26 15:14:49 -05:00
Pascal Precht 62a229198b fix(utils/testing): ensure runActionsForEvent() works without params object 2020-02-26 15:14:49 -05:00
Pascal Precht ef1ec3a606 refactor(utils/testing): expose `registerAPICall()` on testbed plugins 2020-02-26 15:14:49 -05:00
Pascal Precht 0ba8d86ea7 fix(utils/testing): add missing trace() API logger in testbed 2020-02-26 15:14:49 -05:00
EmbarkBot c54cc77e01 chore(prerelease): 5.2.4-nightly.0 2020-02-26 00:14:00 +00:00
dependabot-preview[bot] 6cba7af03a build(deps-dev): bump jest from 24.9.0 to 25.1.0
Bumps [jest](https://github.com/facebook/jest) from 24.9.0 to 25.1.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/master/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/compare/v24.9.0...v25.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-02-25 16:12:54 -06:00
Michael Bradley, Jr 8e945a2caa chore(release): 5.2.3 2020-02-25 15:09:29 -06:00
Michael Bradley, Jr 3693ebd90d fix: ensure that packages properly specify their dependencies
Many packages in the monorepo did not specify all of their dependencies; they
were effectively relying on resolution in the monorepo's root
`node_modules`. In a production release of `embark` and `embark[js]-*` packages
this can lead to broken packages.

To fix the problem currently and to help prevent it from happening again, make
use of the `eslint-plugin-import` package's `import/no-extraneous-dependencies`
and `import/no-unresolved` rules. In the root `tslint.json` set
`"no-implicit-dependencies": true`, wich is the tslint equivalent of
`import/no-extraneous-dependencies`; there is no tslint equivalent for
`import/no-unresolved`, but we will eventually replace tslint with an eslint
configuration that checks both `.js` and `.ts` files.

For `import/no-unresolved` to work in our monorepo setup, in most packages add
an `index.js` that has:

```js
module.exports = require('./dist'); // or './dist/lib' in some cases
```

And point `"main"` in `package.json` to `"./index.js"`. Despite what's
indicated in npm's documentation for `package.json`, it's also necessary to add
`"index.js"` to the `"files"` array.

Make sure that all `.js` files that can and should be linted are in fact
linted. For example, files in `packages/embark/src/cmd/` weren't being linted
and many test suites weren't being linted.

Bump all relevant packages to `eslint@6.8.0`.

Fix all linter errors that arose after these changes.

Implement a `check-yarn-lock` script that's run as part of `"ci:full"` and
`"qa:full"`, and can manually be invoked via `yarn cylock` in the root of the
monorepo. The script exits with error if any specifiers are found in
`yarn.lock` for `embark[js][-*]` and/or `@embarklabs/*` (with a few exceptions,
cf. `scripts/check-yarn-lock.js`).
2020-02-25 14:52:10 -06:00
Michael Bradley, Jr f5db3f61b6 chore(release): 5.2.0 2020-02-18 11:45:33 -06:00
EmbarkBot 414de52203 chore(prerelease): 5.2.0-nightly.3 2020-02-14 00:14:39 +00:00
emizzle a7693c0e53 chore(@embark/pipeline): Update pipeline dependencies and add tests
Update `embark-pipeline` dependencies.

Add unit tests for `embark-pipeline`.

Update Embark testing framework to include assertion testsing for API calls and event actions.
2020-02-13 13:08:36 -05:00
Michael Bradley, Jr 110957f273 chore(release): 5.1.1 2020-02-03 13:59:08 -06:00
EmbarkBot a9807b77f5 chore(prerelease): 5.1.1-nightly.2 2020-01-31 00:12:28 +00:00
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 84448f8732 chore(prerelease): 5.1.0-nightly.5 2020-01-24 00:10:58 +00:00
Pascal Precht bef582d312 feat(@embark/testing): add missing APIs to register console commands and API calls
This commit also introduces an IPC mock object, needed for Embark to work as a dependency
within the console module
2020-01-23 10:11:58 -05: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
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
Pascal Precht c947517c0d feat(@embark/testing): introduce proper request2 api for async/await 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
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
Iuri Matias c00511a0e2 chore(release): 5.0.0-alpha.4 2019-12-12 11:38:22 -05:00
Michael Bradley, Jr 9f2a5949c2 build: specify missing test action in relevant package.json "qa" scripts
It's a relevant `package.json` if the package has a test suite. If `test` isn't
specified then the tests won't run in CI (they have't been running).

Include a fix for one failing test in `packages/plugins/ens` and two failing
test in `packages/stack/deployment`. In all three cases, the mock embark
object's config needed a `blockchainConfig` section with `{ enabled: true }`.
2019-12-11 14:01:12 -06: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
Iuri Matias 6efe791cfd chore(release): 5.0.0-alpha.2 2019-12-05 15:03:09 -05:00
Michael Bradley, Jr 8ede518bd2 build(deps): bump core-js from 3.3.5 to 3.4.3 2019-11-26 15:16:29 -06:00