Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into tlist
Browse files Browse the repository at this point in the history
  • Loading branch information
Thore3 committed Jan 31, 2017
2 parents d8d0ae7 + 25f196d commit 3c6952f
Show file tree
Hide file tree
Showing 108 changed files with 9,474 additions and 12,575 deletions.
123 changes: 0 additions & 123 deletions Gruntfile.coffee

This file was deleted.

156 changes: 156 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),

clean: {
build: ['build'],
dist: ['dist'],
test: ['coverage', 'coverage-lcov'],
testjs: ['tests/*js']
},

coveralls: {
options: {
debug: true,
coverageDir: 'coverage-lcov',
dryRun: false,
force: true,
recursive: true
}
},

concat: {
options: {
separator: ';'
},

mywallet: {
src: [
'build/blockchain.js'
],
dest: 'dist/my-wallet.js'
}
},

replace: {
// monkey patch deps
bitcoinjs: {
// comment out value validation in fromBuffer to speed up node
// creation from cached xpub/xpriv values
src: ['node_modules/bitcoinjs-lib/src/hdnode.js'],
overwrite: true,
replacements: [{
from: /\n{4}curve\.validate\(Q\)/g,
to: '\n // curve.validate(Q)'
}]
}
},

uglify: {
options: {
banner: '/*! <%= pkg.name %> <%= grunt.template.today(\'yyyy-mm-dd\') %> */\n',
mangle: false
},

mywallet: {
src: 'dist/my-wallet.js',
dest: 'dist/my-wallet.min.js'
}
},

browserify: {
options: {
debug: true,
browserifyOptions: {
standalone: 'Blockchain',
transform: [
['babelify', {
presets: ['es2015'],
global: true,
ignore: [
'/src/blockchain-socket.js',
'/src/ws-browser.js'
]
}]
]
}
},

build: {
src: ['index.js'],
dest: 'build/blockchain.js'
},

production: {
options: {
debug: false
},
src: '<%= browserify.build.src %>',
dest: 'build/blockchain.js'
}
},

watch: {
scripts: {
files: 'src/**/*.js',
tasks: ['build']
}
},

env: {
build: {
DEBUG: '1',
PRODUCTION: '0'
},

production: {
PRODUCTION: '1'
}
},

preprocess: {
js: {
expand: true,
cwd: 'src/',
src: '**/*.js',
dest: 'build',
ext: '.processed.js'
}
}
});

grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-env');
grunt.loadNpmTasks('grunt-preprocess');
grunt.loadNpmTasks('grunt-text-replace');
grunt.loadNpmTasks('grunt-karma-coveralls');

grunt.registerTask('default', [
'build',
'watch'
]);

grunt.registerTask('build', [
'env:build',
'preprocess',
'replace:bitcoinjs',
'browserify:build',
'concat:mywallet'
]);

// You must run grunt clean and grunt build first
grunt.registerTask('dist', () => {
return grunt.task.run([
'env:production',
'preprocess',
'replace:bitcoinjs',
'browserify:production',
'concat:mywallet',
'uglify:mywallet'
]);
});
};
13 changes: 10 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
'use strict';

require('es6-promise').polyfill();
require('isomorphic-fetch');
require('es6-promise').polyfill();

global.Symbol = require('core-js/es6/symbol');

var Buffer = require('buffer').Buffer;

Expand Down Expand Up @@ -31,7 +33,6 @@ module.exports = {
Helpers: require('./src/helpers'),
API: require('./src/api'),
Tx: require('./src/wallet-transaction'),
Shared: require('./src/shared'),
WalletTokenEndpoints: require('./src/wallet-token-endpoints'),
WalletNetwork: require('./src/wallet-network'),
RNG: require('./src/rng'),
Expand All @@ -40,5 +41,11 @@ module.exports = {
Metadata: require('./src/metadata'),
Bitcoin: require('bitcoinjs-lib'),
External: require('./src/external'),
BuySell: require('./src/buy-sell')
BuySell: require('./src/buy-sell'),
constants: require('./src/constants'),
BigInteger: require('bigi/lib'),
BIP39: require('bip39'),
Networks: require('bitcoinjs-lib/src/networks'),
ECDSA: require('bitcoinjs-lib/src/ecdsa'),
R: require('ramda')
};
Loading

0 comments on commit 3c6952f

Please sign in to comment.