Commit Graph

5092 Commits

Author SHA1 Message Date
Andre Medeiros 4dca72368b fix(@embark/cmd): output contract json
This fix ensures that `embark build --contracts` outputs the contracts
the same way a normal build would.
2018-11-21 16:13:54 -05:00
Richard Ramos 46e351ed36 feat(@embark/whister): Add signature and recipient public key to whisper envelope 2018-11-21 16:08:56 -05:00
Jonathan Rainville 0032569b50 fix(tests): enable coverage only when --coverage
Fixes #1091
Speeds up tests because coverage does stuff on each block
2018-11-21 15:57:42 -05:00
Filip Š 6522aaae24 Add Slovenian translation 2018-11-21 15:53:37 -05:00
Andre Medeiros 485b8ef558
fix: handle contracts being removed
Fixes #1077
2018-11-21 13:40:41 +01:00
Pascal Precht ab41860d9b chore: introduce release script
This commit automates our release process. It takes care of a couple of things:

- Bumps version number in package.json as needed, see below
- Generates changelog based on commit history
- Create release commit
- Tags release commit
- Pushes release commit including tags to upstream repository
- Publishes release on npm

There are a couple of options supported. The base command is run like this:

```
npm run release
```

This will do a minor bump and try to push to `origin` on `master`. However,
this can be altered with the following options.

```
npm run release -- --dry-run
```

Can be used to perform dry run and not actually committing, tagging, pushing,
publishing anything.

```
npm run release -- --release-as <something>
```

Something can be `minor`, `major`, `patch` or anything you want `foo`, `1.0.0` etc.

```
npm run release -- --prerelease alpha
```

Will create a prerelease version a la `4.0.0-alpha.x`.

```
npm run release -- --prerelease alpha --npm-dist-tag next
```

Publishes a dist tag on npm using dist tag `next`

```
npm run release -- --sign
```

Signs the release commit (you need to have PGP setup for that).

```
npm run release -- --repo-origin pascal --repo-branch foo/bar
```

Pushes the release commit into `pascal/foo/bar`.
2018-11-21 13:28:50 +01:00
Anthony Laibe 45afe83cb3 feat: update to solc 0.5.0 2018-11-21 08:50:43 +00:00
Anthony Laibe f32ddc9935 fix: coverage count
Instead of full match, start to count as soon
as there is 1 match
2018-11-21 08:50:01 +00:00
Pascal Precht c66fe695f0 refactor(@embark/deployment): make use of newly introduced ZERO_ADDRESS 2018-11-20 16:41:32 +01:00
Pascal Precht 8b68beca17 feat: introduce function support for deploy lifecycle hooks
Prior to this commits deployment lifecycle hooks had been defined as Array<string> due
to historical reasons (contracts.js) used to be a json file back in the days.

`deployIf`, `onDeploy` and `afterDeploy` can now be defined as (async)
function and have access to several dependencies such as contract instances and web3.
However, in order to have needed dependencies registered in the dependencies object,
all lifecycle hook dependencies need to be listed in the `deps` property
as shown below.

Also note that this is NOT a breaking change. Existing deployment lifecycle
hooks written in Array<string> style still work.

All three lifecycle hooks can now be defined as (async) functions and get an dependency
object with a shape like this:

```
interface DeploymentLifecycleHookDependencies {
  contracts: Map<string, ContractInstance>;
  web3: Web3Instance
}
```

`deployIf` lifecycle hook has to return a promise (or be defined using async/await and return
a value) like this:

```
contracts: {
  MyToken: {...},
  SimpleStorage: {
    deps: ['MyToken'], // this is needed to make `MyToken` available within `dependencies`
    deployIf: async (dependencies) => {
      return dependencies.contracts.MyToken_address;
    }
  },
}
```

Vanilla promises (instead of async/await) can be used as well:

```
contracts: {
  MyToken: {...},
  SimpleStorage: {
    deps: ['MyToken'],
    deployIf: (dependencies) => {
      return new Promise(resolve => resolve(dependencies.contracts.MyToken_address);
    }
  },
}
```

`onDeploy` as well, returns either a promise or is used using async/await:

```
contracts: {
  SimpleStorage: {
    onDeploy: async (dependencies) => {
      const simpleStorage = dependencies.contracts.SimpleStorage;
      const value = await simpleStorage.methods.get().call();
      console.log(value);
    }
  },
}
```

`afterDeploy` has automatically access to all configured and deployed contracts of the dapp:

```
contracts: {
  SimpleStorage: {...},
  MyToken: {...},
  afterDeploy: (dependencies) => {
    console.log('Done!');
  }
}
```

Closes #1029
2018-11-20 16:41:03 +01:00
Michael Bradley, Jr 53191447f5 build: use yarn for reproducible builds and CI
yarn.lock files are generated for embark and embark-ui, and their package.json
files and other npm related files are updated to support and require using yarn
for development of embark itself and for embark's CI.
2018-11-20 09:25:42 -06:00
Michael Bradley, Jr 9cd50c2031 build: remove and disable npm lock files, rely on pinned dev/deps
Buggy behavior related to npm lock files makes the goal of reproducible builds
and hassle-free automated releases nearly impossible to achieve at
present. With npm's lock files disabled we rely on pinned dependencies (exact
versions only in the package.json files of embark and embark-ui) for a
hopefully good result. This is an experiment while the project is in an alpha
release phase, and if problems are experienced we can return to using
npm-shrinkwrap.json / package-lock.json, or we can investigate a transition to
the yarn package manager, for ourselves and possibly for our users too.
2018-11-20 09:25:42 -06:00
Anthony Laibe 10caddd872 fix(ui): white screen on text editor
Only happens on Firefox
2018-11-20 13:31:50 +00:00
Anthony Laibe 66e431cf13 fix(ui): switch aside 2018-11-20 09:21:03 +00:00
Jonathan Rainville cabfa939e7 fix(ipc): sends requests and events only when connected
Fixes #1063
2018-11-18 13:00:44 -05:00
Santiago Gonzalez Toral 89e3eb6156 feat(@embark/cli): add --template option to embark demo cli command
Adds a --template option to the embark demo cli command so it is now possible to generate a demo project using an existing embark's template repository on Github with an existing demo branch (e.g. embark demo --template vue will use embark-framework/embark-vue-template#demo), or any other git URL repository. If no --template option is specified, the command  will generate a demo from default template in templates/demo
2018-11-18 12:50:02 -05:00
Anthony Laibe 58795ca7d2 refactor(core): convert i18n to TS 2018-11-18 12:30:36 -05:00
Jonathan Rainville c85c3bc809
Merge pull request #1089 from embark-framework/bug_fix/deploy-error
Fix using an object as arguments
2018-11-16 08:37:24 -05:00
Anthony Laibe b63525e7c0 style(modules/coverage): replace var 2018-11-16 09:49:30 +00:00
Anthony Laibe f84d7f1d21 feat: run coverage for bytecode and deployedBytecode 2018-11-16 09:49:30 +00:00
Anthony Laibe 3406ae833c feat: Allow parallel deploy 2018-11-16 09:35:12 +00:00
Anthony Laibe 51b8224325 feat: permanently save logs/events 2018-11-16 09:31:14 +00:00
Anthony Laibe 7fb5c0d0da chore: add scripts to start embark only 2018-11-16 09:31:14 +00:00
Jonathan Rainville 6b61c8ada9 fix(contracts_manager): fix object contract arguments 2018-11-15 14:53:27 -05:00
Jonathan Rainville 7a5035ec49 fix(deployment): add a message when the errror is about the input 2018-11-15 14:19:44 -05:00
Iuri Matias 21dff441d1 refactor(@embark/console): move console index.js to typescript 2018-11-15 14:00:30 -05:00
Iuri Matias d427e626c2 feat(@embark/console): better determine suggestions for any js object not just with the dot.' 2018-11-15 13:51:05 -05:00
Iuri Matias 23f623d750 refactor(@embark/console): convert suggestions class into typescript 2018-11-15 13:51:05 -05:00
Iuri Matias f206062919 feat(@embark/console): determine suggestions automatically for a js object of the type 'command.' 2018-11-15 13:51:05 -05:00
Iuri Matias 29117c280a refactor(@embark/console): refactor getSuggestions to return results in a callback; move sorting to its own method 2018-11-15 13:51:05 -05:00
Anthony Laibe 327aa00141 docs: align with angular/conventional commit config 2018-11-15 12:12:43 +01:00
Pascal Precht d3f6b43986 fix(@embark/core): ensure 0x0 address are extended to full zero addresses
This was a regression introduced in a web3 upgrade where `0x0` addresses where no longer
accepted as valid addresses and have to be replaced with full zero addresses.

This commit ensures that, if Embark apps still make use of `0x0` addresses in
their configs, they are properly replaced or extended to satisfy web3's APIs.

Fixes #956
2018-11-14 16:03:39 +01:00
Pascal Precht 70a61c5965 uiux(@embark/cli): propose `build --contracts as alternative if `compile` is used 2018-11-14 12:16:56 +01:00
Iuri Matias 3986d9761c chore(@embark/utils): convert utils/hosts.js to typescript 2018-11-13 10:35:24 -05:00
Anthony Laibe 192e6e112a chore(embark-ui): upgrade embark-ui to latest and greatest CRA 2018-11-13 10:55:35 +00:00
Jonathan Rainville 1a29a8f6c9
fix(simulator): adds `node` to sim command to comply with Windows 2018-11-13 10:19:51 +01:00
Jonathan Rainville 3353a05c3e
fix(simulator): use config's gas limit if no option provided
Fixes #1054
2018-11-13 10:19:51 +01:00
Jonathan Rainville 43be2a28d6
fix(cmd): removes -h as an option for host for the simulator 2018-11-13 10:19:50 +01:00
Pascal Precht 4961f70e5f fix(@embark/core): don't expect `balance` on `accounts`
In 594d1323fa we've introduced the ability
to configure balance-related options with human readable ether units.

There are cases where there's account configurations that don't come
with a `balance` property, which breaks Embark when running an Embark app.

Fixes #1067
2018-11-13 10:17:55 +01:00
Anthony Laibe f82d3de1b0 feat: add CRUD to file explorer 2018-11-13 09:13:23 +00:00
Anthony Laibe c8d6f18648
Merge pull request #1068 from embark-framework/bugfix/no-webserver-no-url
fix: do not display log if no webserver
2018-11-13 09:13:01 +00:00
Pascal Precht 8a00e04c06 chore(@embark/cli): introduce alias for `--simple` option in `run` command
Closes #1025
2018-11-13 10:11:08 +01:00
Michael Bradley, Jr 96f7688ee8 fix(@embark/webserver): load embark-ui sources from the correct path
embark's webserver needs to serve the production build of embark-ui from the
root of the package not from dist/
2018-11-12 12:08:43 -05:00
Michael Bradley, Jr 23f19a0df5 fix: runtime environment needs to support locally installed embark
Reintroduce NODE_PATH so that DApps with embark locally installed can properly
resolve modules supplied by embark. Refactor process.env related settings into
src/lib/core/env.js
2018-11-12 11:03:48 -06:00
Anthony Laibe 97829c04f4 fix(module/authenticator): do not display log if no webserver 2018-11-12 15:30:30 +00:00
Michael Bradley 53154f8730
Merge pull request #1055 from embark-framework/chores/ts-rev
chore: add babel+ts — revised
2018-11-12 09:23:38 -06:00
Michael Bradley, Jr 17d58a5c54 docs: fix typo in filename 2018-11-11 15:09:11 -06:00
Michael Bradley, Jr 69dd8c5b89 build(packaging): reorg sources for transpilation with Babel
Allow for embark sources to be authored in TypeScript and/or JavaScript, and to
make use of upcoming features of the JS language. Sources in the src/ directory
are transpiled into the dist/ directory, and npm-scripts are provided to
support and automate various aspect of the build process. Source map support is
enabled at runtime, i.e. when invoking the embark cli and running embark's test
suite.
2018-11-11 15:08:55 -06:00
Pascal Precht 317449e840 refactor(@embark/deployment): remove try/catch block
This code didn't really make sense in the first place as we use `async.auto()` at the
moment for callback based error handling.
2018-11-09 16:28:47 +01:00
Pascal Precht 8997476e33 uiux(@embark/deployment): improve error messages by logging contract name
Closes #1038
2018-11-09 16:28:47 +01:00