Skip to content

Commit dcc9aa7

Browse files
committed
Merge branch 'meteor' into develop
2 parents d45ca38 + d70c986 commit dcc9aa7

File tree

23 files changed

+279
-23
lines changed

23 files changed

+279
-23
lines changed

bin/embark

Lines changed: 67 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,31 +51,80 @@ program.command('deploy [env]').description('deploy contracts').action(function(
5151

5252
program.command('build [env]').description('build dapp').action(function(env_) {
5353
var env = env_ || 'development';
54-
run("grunt clean");
55-
run("grunt deploy_contracts:" + env);
56-
run('grunt build:' + env);
54+
var embarkConfig = readYaml.sync("./embark.yml");
55+
56+
if (embarkConfig.type === "grunt") {
57+
run("grunt clean");
58+
run("grunt deploy_contracts:" + env);
59+
run('grunt build:' + env);
60+
}
61+
else if (embarkConfig.type === "meteor") {
62+
//deploy
63+
run("meteor-build-client ./build -p ''");
64+
}
5765
});
5866

5967
program.command('ipfs [env]').description('build dapp and make it available in ipfs').action(function(env_) {
6068
var env = env_ || 'development';
61-
run("grunt clean")
62-
run("grunt deploy_contracts:" + env)
63-
run('grunt build:' + env)
64-
run('grunt ipfs:' + env)
69+
var embarkConfig = readYaml.sync("./embark.yml");
70+
71+
if (embarkConfig.type === "grunt") {
72+
run("grunt clean")
73+
run("grunt deploy_contracts:" + env)
74+
run('grunt build:' + env)
75+
run('grunt ipfs:' + env)
76+
}
77+
else if (embarkConfig.type === "meteor") {
78+
//deploy
79+
//build
80+
Embark = require('embark-framework')
81+
Embark.release.ipfs("build/")
82+
}
83+
else {
84+
console.log("command not available in manual mode yet");
85+
}
6586
});
6687

6788
program.command('run [env]').description('run dapp').action(function(env_) {
6889
var env = env_ || 'development';
69-
run('grunt deploy:' + env);
90+
var embarkConfig = readYaml.sync("./embark.yml");
91+
92+
if (embarkConfig.type === "grunt") {
93+
run('grunt deploy:' + env);
94+
}
95+
else {
96+
console.log("command not available in meteor or manual mode yet");
97+
}
7098
});
7199

72100
program.command('spec').description('run specs').action(function() {
73-
run('jasmine');
101+
var embarkConfig = readYaml.sync("./embark.yml");
102+
103+
if (embarkConfig.type === "grunt") {
104+
run('jasmine');
105+
}
106+
else {
107+
console.log("command not available in meteor or manual mode yet");
108+
}
74109
});
75110

76111
program.command('blockchain [env]').description('run blockchain').action(function(env_) {
77112
var env = env_ || 'development';
78-
run('grunt blockchain:' + env);
113+
var embarkConfig = readYaml.sync("./embark.yml");
114+
115+
if (embarkConfig.type === "grunt") {
116+
run('grunt blockchain:' + env);
117+
}
118+
else {
119+
Embark.init()
120+
Embark.blockchainConfig.loadConfigFile(embarkConfig.blockchainConfig)
121+
Embark.contractsConfig.loadConfigFile(embarkConfig.contractsConfig)
122+
123+
//TODO: better with --exec, but need to fix console bug first
124+
wrench.copyDirSyncRecursive(__dirname + "/../js", "/tmp", {forceDelete: true});
125+
126+
Embark.startBlockchain(env, true);
127+
}
79128
});
80129

81130
program.command('demo').description('create a working dapp with a SimpleStorage contract').action(function() {
@@ -93,6 +142,14 @@ program.command('demo').description('create a working dapp with a SimpleStorage
93142
console.log('\n\ninit complete');
94143
});
95144

145+
program.command('meteor_demo').description('create a working meteor dapp with a SimpleStorage contract').action(function() {
146+
var boilerPath = path.join(__dirname + '/../demo_meteor');
147+
148+
var targetDir = "./embark_demo";
149+
wrench.copyDirSyncRecursive(boilerPath, targetDir);
150+
console.log('\n\ninit complete');
151+
});
152+
96153
program.parse(process.argv)
97154

98155
if (!process.argv.slice(2).length) {

boilerplate/embark.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
type: "grunt" #other options: meteor, manual
2-
#contracts: ["app/contracts/**"]
3-
#output: "generated/tmp/abi.js"
2+
#contracts: ["app/contracts/**/*.sol"]
3+
#output: "src/embark.js"
44
#blockchainConfig: "config/blockchain.yml"
55
#contractsConfig: "config/contracts.yml"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This file contains information which helps Meteor properly upgrade your
2+
# app when you run 'meteor update'. You should check it into version control
3+
# with your project.
4+
5+
notices-for-0.9.0
6+
notices-for-0.9.1
7+
0.9.4-platform-file
8+
notices-for-facebook-graph-api-2

demo_meteor/.meteor/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
local

demo_meteor/.meteor/.id

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This file contains a token that is unique to your project.
2+
# Check it into your repository along with the rest of this directory.
3+
# It can be used for purposes such as:
4+
# - ensuring you don't accidentally deploy one app on top of another
5+
# - providing package authors with aggregated statistics
6+
7+
v2fbp61wvu7nd11xgkdz

demo_meteor/.meteor/packages

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Meteor packages used by this project, one per line.
2+
# Check this file (and the other files in this directory) into your repository.
3+
#
4+
# 'meteor add' and 'meteor remove' will edit this file for you,
5+
# but you can also edit it by hand.
6+
7+
meteor-platform
8+
autopublish
9+
insecure
10+
ethereum:web3

demo_meteor/.meteor/platforms

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
server
2+
browser

demo_meteor/.meteor/release

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

demo_meteor/client/embark.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)