Skip to content

Commit ee1eb4e

Browse files
committed
feat: support selecting what library to generate artifacts
feat: support selecting what library to generate artifacts feat: support selecting what library to generate artifacts feat: support selecting what library to generate artifacts feat: support selecting what library to generate artifacts working web3 artifacts remove unnecessary request address code review issues fixes update tests WIP: add index.js in packages/plugins/embarkjs/ This is a pattern established in #2285 remove comment fix some code review issues
1 parent db9e959 commit ee1eb4e

25 files changed

+169
-51
lines changed

dapps/templates/boilerplate/app/js/index.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ import EmbarkJS from 'Embark/EmbarkJS';
44
// e.g if you have a contract named SimpleStorage:
55
//import SimpleStorage from 'Embark/contracts/SimpleStorage';
66

7-
87
EmbarkJS.onReady((err) => {
98
// You can execute contract calls after the connection
109
});
10+
11+
// OR if using "library: 'web3'" in config/contracts.js
12+
13+
// import web3 from '../../embarkArtifacts/web3.js';
14+
// import SimpleStorage from '../embarkArtifacts/contracts/SimpleStorage';
15+
// web3.onReady(async () => {
16+
// let accounts = await web3.eth.getAccounts();
17+
//})

dapps/templates/boilerplate/config/contracts.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module.exports = {
22
// default applies to all environments
33
default: {
4+
library: 'embarkjs', // can also be 'web3'
5+
46
// order of connections the dapp should connect to
57
dappConnection: [
68
"$EMBARK",

dapps/templates/demo/config/contracts.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
module.exports = {
22
// default applies to all environments
33
default: {
4+
library: 'embarkjs', // can be also be 'web3'
5+
46
// order of connections the dapp should connect to
57
dappConnection: [
68
"$EMBARK",

packages/core/core/src/configDefaults.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export function getContractDefaults(embarkConfigVersions) {
4747

4848
return {
4949
default: {
50+
library: "embarkjs",
5051
versions,
5152
dappConnection: [
5253
"$WEB3",

packages/core/engine/tsconfig.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
{
2323
"path": "../../plugins/debugger"
2424
},
25+
{
26+
"path": "../../plugins/embarkjs"
27+
},
2528
{
2629
"path": "../../plugins/ens"
2730
},
@@ -88,9 +91,6 @@
8891
{
8992
"path": "../../stack/deployment"
9093
},
91-
{
92-
"path": "../../stack/embarkjs"
93-
},
9494
{
9595
"path": "../../stack/library-manager"
9696
},

packages/embark/src/test/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ describe('embark.Config', function () {
212212
dappConnection: ['$WEB3', 'ws://localhost:8546', 'localhost:8545'],
213213
dappAutoEnable: true,
214214
"gas": "400000",
215+
"library": "embarkjs",
215216
"strategy": "implicit",
216217
"contracts": {
217218
"SimpleStorage": {
@@ -234,6 +235,7 @@ describe('embark.Config', function () {
234235
dappConnection: ['$WEB3', 'ws://localhost:8546', 'localhost:8545'],
235236
dappAutoEnable: true,
236237
"gas": "auto",
238+
"library": "embarkjs",
237239
"strategy": "implicit",
238240
"contracts": {
239241
"SimpleStorage": {
File renamed without changes.

0 commit comments

Comments
 (0)